@fntio/infra-client
Version:
Self-hosted AWS access portal: credential vending, target-account trust, and grant-driven private networking as CDK stacks and constructs.
2 lines (1 loc) • 9.92 kB
JavaScript
import{a as N}from"./chunk-XOFD5DNL.js";import{b as I}from"./chunk-MID2IYAR.js";import{Aa as a,Ba as l,Ca as F,I as P,Ja as g,K as m,L as x,La as d,Na as s,R as b,U as T,Va as M,Xa as c,Ya as f,Z as E,Za as v,_ as o,ga as V,qb as k,sa as h,ta as u,tb as S,ua as _,wb as D,xa as y,ya as w,za as C}from"./chunk-FYA6QUPZ.js";var $=(n,t)=>t.key,O=(n,t)=>t.key+"#"+t.value,L=(n,t)=>t.value;function A(n,t){if(n&1&&(a(0,"span",3),c(1),l()),n&2){let e=s();o(),v(" ",e.filters().length," ")}}function B(n,t){if(n&1&&(a(0,"span",7)(1,"span",9),c(2),l(),a(3,"span",10),c(4),l()()),n&2){let e=s().$implicit;o(2),v("",e.label,":"),o(2),f(e.firstValue)}}function H(n,t){if(n&1&&(a(0,"span",7)(1,"span",9),c(2),l(),a(3,"span",9),c(4,"\xB7"),l(),a(5,"span",10),c(6),l()()),n&2){let e=s().$implicit;o(2),f(e.label),o(4),f(e.count)}}function q(n,t){if(n&1){let e=g();a(0,"span",4)(1,"button",6),d("click",function(){let r=m(e).$implicit,p=s();return x(p.openCategory(r.key))}),u(2,B,5,2,"span",7)(3,H,7,2,"span",7),l(),a(4,"button",8),d("click",function(){let r=m(e).$implicit,p=s();return x(p.clearCategory(r.key))}),c(5," \u2715 "),l()()}if(n&2){let e=t.$implicit,i=s();o(),h("aria-label","Edit "+e.label+" filter \u2014 "+e.count+" selected")("aria-expanded",i.open()&&i.level()===e.key),o(),_(e.count===1?2:3),o(2),h("aria-label","Clear "+e.label+" filters")}}function z(n,t){if(n&1&&c(0),n&2){let e=s().$implicit;v(" \xB7 ",e.count)}}function G(n,t){if(n&1){let e=g();a(0,"label",16)(1,"input",18),d("change",function(){let r=m(e).$implicit,p=s(4);return x(p.toggle(r.key,r.value))}),l(),a(2,"span",19),c(3),l(),a(4,"span",20),c(5),u(6,z,1,1),l()()}if(n&2){let e=t.$implicit,i=s(4);o(),C("checked",i.isOn(e.key,e.value)),o(),C("title",e.value),o(),f(e.value),o(2),v(" ",e.label),o(),_(e.count!==void 0?6:-1)}}function j(n,t){n&1&&(a(0,"p",17),c(1," Nothing named that in any category. "),l())}function W(n,t){if(n&1&&(a(0,"div",14),y(1,G,7,5,"label",16,O,!1,j,2,0,"p",17),l()),n&2){let e=s(3);o(),w(e.rootMatches())}}function R(n,t){n&1&&(a(0,"span",24),c(1),l()),n&2&&(o(),v("",t," selected"))}function J(n,t){if(n&1){let e=g();a(0,"button",22),d("click",function(){let r=m(e).$implicit,p=s(4);return x(p.enter(r.key))}),a(1,"span",23),c(2),l(),u(3,R,2,1,"span",24),F(4,"app-icon",25),l()}if(n&2){let e,i=t.$implicit,r=s(4);o(2),f(i.label),o(),_((e=r.selectedCount(i.key))?3:-1,e)}}function K(n,t){if(n&1&&(a(0,"div",15),y(1,J,5,2,"button",21,$),l()),n&2){let e=s(3);o(),w(e.sections())}}function U(n,t){if(n&1){let e=g();a(0,"input",13),d("input",function(r){m(e);let p=s(2);return x(p.rootQuery.set(r.target.value))}),l(),u(1,W,4,1,"div",14)(2,K,3,0,"div",15)}if(n&2){let e=s(2);C("value",e.rootQuery()),o(),_(e.rootQuery().trim()?1:2)}}function X(n,t){n&1&&(a(0,"span",30),c(1),l()),n&2&&(o(),v("",t," selected"))}function Y(n,t){if(n&1&&(a(0,"span",32),c(1),l()),n&2){let e=s().$implicit;o(),f(e.count)}}function Z(n,t){if(n&1){let e=g();a(0,"label",16)(1,"input",18),d("change",function(){let r=m(e).$implicit,p=s(3);return x(p.toggle(p.level(),r.value))}),l(),a(2,"span",19),c(3),l(),u(4,Y,2,1,"span",32),l()}if(n&2){let e=t.$implicit,i=s(3);o(),C("checked",i.isOn(i.level(),e.value)),o(),C("title",e.value),o(),f(e.value),o(),_(e.count!==void 0?4:-1)}}function ee(n,t){n&1&&(a(0,"p",17),c(1,"No matches."),l())}function te(n,t){if(n&1){let e=g();a(0,"div",26)(1,"button",27),d("click",function(){m(e);let r=s(2);return x(r.back())}),F(2,"app-icon",28),l(),a(3,"span",29),c(4),l(),u(5,X,2,1,"span",30),l(),a(6,"input",31),d("input",function(r){m(e);let p=s(2);return x(p.sectionQuery.set(r.target.value))}),l(),a(7,"div",14),y(8,Z,5,4,"label",16,L,!1,ee,2,0,"p",17),l()}if(n&2){let e,i=s(2);o(4),f(i.labelOf(i.level())),o(),_((e=i.selectedCount(i.level()))?5:-1,e),o(),C("placeholder","Search "+i.labelOf(i.level()).toLowerCase()+"s")("value",i.sectionQuery()),h("aria-label","Search "+i.labelOf(i.level()).toLowerCase()+"s"),o(2),w(i.sectionMatches())}}function ne(n,t){if(n&1){let e=g();a(0,"div",12)(1,"button",33),d("click",function(){m(e);let r=s(2);return x(r.clearAll())}),c(2," Clear all filters "),l()()}}function ie(n,t){if(n&1&&(a(0,"div",11),u(1,U,3,2)(2,te,11,6),u(3,ne,3,0,"div",12),l()),n&2){let e=s();M("left-0",e.align()==="start")("right-0",e.align()==="end"),o(),_(e.level()==="root"?1:2),o(2),_(e.filters().length?3:-1)}}var Q=class n{sections=S.required();align=S("start");filters=D([]);open=b(!1);level=b("root");rootQuery=b("");sectionQuery=b("");selected=k(()=>{let t=new Map;for(let e of this.filters()){let i=t.get(e.key);i||t.set(e.key,i=new Set),i.add(e.value)}return t});pillGroups=k(()=>{let t=this.selected();return this.sections().filter(e=>t.has(e.key)).map(e=>{let i=[...t.get(e.key)??[]];return{key:e.key,label:e.label,count:i.length,firstValue:i[0]}})});rootMatches=k(()=>{let t=this.rootQuery().trim().toLowerCase();if(!t)return[];let e=[];for(let i of this.sections())for(let r of i.options)if(r.value.toLowerCase().includes(t)&&(e.push({key:i.key,label:i.label,value:r.value,count:r.count}),e.length>=50))return e;return e});sectionMatches=k(()=>{let t=this.sections().find(r=>r.key===this.level());if(!t)return[];let e=this.sectionQuery().trim().toLowerCase();return(e?t.options.filter(r=>r.value.toLowerCase().includes(e)):t.options).slice(0,200)});labelOf(t){return this.sections().find(e=>e.key===t)?.label??t}toggleOpen(){let t=!this.open();this.open.set(t),t&&(this.level.set("root"),this.rootQuery.set(""),this.sectionQuery.set(""))}enter(t){this.level.set(t),this.sectionQuery.set("")}openCategory(t){this.open.set(!0),this.rootQuery.set(""),this.enter(t)}back(){this.level.set("root"),this.sectionQuery.set("")}isOn(t,e){return this.selected().get(t)?.has(e)??!1}selectedCount(t){return this.selected().get(t)?.size??0}toggle(t,e){let i=this.filters().filter(r=>!(r.key===t&&r.value===e));this.filters.set(i.length===this.filters().length?[...i,{key:t,value:e}]:i)}clearAll(){this.filters.set([])}clearCategory(t){this.filters.set(this.filters().filter(e=>e.key!==t))}host=P(T);onDocumentMousedown(t){this.host.nativeElement.contains(t.target)||this.open.set(!1)}onEscape(){this.open.set(!1)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=V({type:n,selectors:[["app-filter-popup"]],hostAttrs:[1,"relative","block"],hostBindings:function(e,i){e&1&&d("mousedown",function(p){return i.onDocumentMousedown(p)},E)("keydown.escape",function(){return i.onEscape()},E)},inputs:{sections:[1,"sections"],align:[1,"align"],filters:[1,"filters"]},outputs:{filters:"filtersChange"},decls:7,vars:4,consts:[[1,"flex","flex-wrap","items-center","gap-2"],["type","button","aria-label","Filter",1,"ui-input","relative","flex","h-7","w-7","shrink-0","items-center","justify-center","!p-0","text-muted-foreground",3,"click"],["name","filter",1,"h-4","w-4",3,"strokeWidth"],[1,"absolute","-right-1","-top-1","grid","h-4","min-w-4","place-items-center","rounded-full","bg-brand","px-1","text-[10px]","font-bold","text-brand-foreground"],[1,"inline-flex","items-center","gap-0.5","rounded-full","bg-brand/10","py-1","pl-1","pr-1.5","text-xs","font-medium","text-brand-text","transition-colors","hover:bg-brand/20"],[1,"absolute","top-full","z-20","mt-1","w-80","max-w-[88vw]","rounded-xl","border","border-border-strong","bg-popover","p-2.5","shadow-lg","backdrop-blur-2xl",3,"left-0","right-0"],["type","button",1,"rounded-full","py-0.5","pl-2","pr-1",3,"click"],[1,"inline-flex","items-center","gap-1"],["type","button",1,"grid","h-4","w-4","shrink-0","place-items-center","rounded-full","text-[9px]","opacity-70","transition-opacity","hover:opacity-100",3,"click"],[1,"opacity-70"],[1,"max-w-44","truncate"],[1,"absolute","top-full","z-20","mt-1","w-80","max-w-[88vw]","rounded-xl","border","border-border-strong","bg-popover","p-2.5","shadow-lg","backdrop-blur-2xl"],[1,"mt-2","border-t","border-border","pt-2"],["placeholder","Search all filters","aria-label","Search values across every filter category",1,"ui-input",3,"input","value"],[1,"mt-1.5","max-h-64","overflow-y-auto"],[1,"mt-1.5"],[1,"flex","cursor-pointer","items-center","gap-2","rounded-md","px-2","py-1.5","text-sm","text-surface-foreground","hover:bg-muted"],[1,"px-2","py-1.5","text-xs","text-muted-foreground"],["type","checkbox",1,"h-3.5","w-3.5","shrink-0","rounded","border-border-strong","text-brand",3,"change","checked"],[1,"min-w-0","flex-1","truncate",3,"title"],[1,"shrink-0","text-[11px]","text-muted-foreground"],["type","button",1,"flex","w-full","items-center","gap-2","rounded-md","px-2","py-2","text-left","text-sm","text-surface-foreground","hover:bg-muted"],["type","button",1,"flex","w-full","items-center","gap-2","rounded-md","px-2","py-2","text-left","text-sm","text-surface-foreground","hover:bg-muted",3,"click"],[1,"flex-1","font-medium"],[1,"text-[11px]","font-medium","text-brand-text"],["name","chevron-right",1,"h-3.5","w-3.5","text-muted-foreground"],[1,"mb-1.5","flex","items-center","gap-1"],["type","button","aria-label","Back to all categories",1,"grid","h-6","w-6","place-items-center","rounded-md","text-muted-foreground","hover:bg-muted","hover:text-surface-foreground",3,"click"],["name","chevron-right",1,"h-3.5","w-3.5","rotate-180"],[1,"text-sm","font-medium","text-surface-foreground"],[1,"ml-auto","text-[11px]","font-medium","text-brand-text"],["appAutofocusSelect","",1,"ui-input",3,"input","placeholder","value"],[1,"text-[11px]","tabular-nums","text-muted-foreground"],["type","button",1,"text-xs","text-muted-foreground","underline","hover:text-surface-foreground",3,"click"]],template:function(e,i){e&1&&(a(0,"div",0)(1,"button",1),d("click",function(){return i.toggleOpen()}),F(2,"app-icon",2),u(3,A,2,1,"span",3),l(),y(4,q,6,4,"span",4,$),l(),u(6,ie,4,6,"div",5)),e&2&&(o(),h("aria-expanded",i.open()),o(),C("strokeWidth",1.75),o(),_(i.filters().length?3:-1),o(),w(i.pillGroups()),o(2),_(i.open()?6:-1))},dependencies:[I,N],encapsulation:2})};export{Q as a};