@vectorize-io/hindsight-control-plane 0.4.17 → 0.4.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/standalone/.next/BUILD_ID +1 -1
- package/standalone/.next/app-path-routes-manifest.json +1 -0
- package/standalone/.next/build-manifest.json +2 -2
- package/standalone/.next/prerender-manifest.json +3 -3
- package/standalone/.next/routes-manifest.json +8 -0
- package/standalone/.next/server/app/_global-error.html +2 -2
- package/standalone/.next/server/app/_global-error.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/_not-found.html +1 -1
- package/standalone/.next/server/app/_not-found.rsc +13 -13
- package/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +13 -13
- package/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +8 -8
- package/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/standalone/.next/server/app/api/banks/[bankId]/config/route.js +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/config/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/consolidate/route.js +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/consolidate/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/consolidation-recover/route/app-paths-manifest.json +3 -0
- package/standalone/.next/server/app/api/banks/[bankId]/consolidation-recover/route/build-manifest.json +11 -0
- package/standalone/.next/server/app/api/banks/[bankId]/consolidation-recover/route/server-reference-manifest.json +4 -0
- package/standalone/.next/server/app/api/banks/[bankId]/consolidation-recover/route.js +6 -0
- package/standalone/.next/server/app/api/banks/[bankId]/consolidation-recover/route.js.map +5 -0
- package/standalone/.next/server/app/api/banks/[bankId]/consolidation-recover/route.js.nft.json +1 -0
- package/standalone/.next/server/app/api/banks/[bankId]/consolidation-recover/route_client-reference-manifest.js +2 -0
- package/standalone/.next/server/app/api/banks/[bankId]/directives/[directiveId]/route.js +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/directives/[directiveId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/directives/route.js +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/directives/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/mental-models/[mentalModelId]/history/route.js +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/mental-models/[mentalModelId]/history/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/mental-models/[mentalModelId]/refresh/route.js +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/mental-models/[mentalModelId]/refresh/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/mental-models/[mentalModelId]/route.js +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/mental-models/[mentalModelId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/mental-models/route.js +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/mental-models/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/observations/[modelId]/route.js +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/observations/[modelId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/observations/route.js +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/observations/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/operations/[operationId]/route.js +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/operations/[operationId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/route.js +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/webhooks/[webhookId]/deliveries/route.js +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/webhooks/[webhookId]/deliveries/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/webhooks/[webhookId]/route.js +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/webhooks/[webhookId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/webhooks/route.js +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/webhooks/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/route.js +1 -1
- package/standalone/.next/server/app/api/banks/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/chunks/[chunkId]/route.js +1 -1
- package/standalone/.next/server/app/api/chunks/[chunkId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/documents/[documentId]/route.js +1 -1
- package/standalone/.next/server/app/api/documents/[documentId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/documents/route.js +1 -1
- package/standalone/.next/server/app/api/documents/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/entities/[entityId]/regenerate/route.js +1 -1
- package/standalone/.next/server/app/api/entities/[entityId]/regenerate/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/entities/[entityId]/route.js +1 -1
- package/standalone/.next/server/app/api/entities/[entityId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/entities/route.js +1 -1
- package/standalone/.next/server/app/api/entities/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/files/retain/route.js +1 -1
- package/standalone/.next/server/app/api/files/retain/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/graph/route.js +1 -1
- package/standalone/.next/server/app/api/graph/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/health/route.js +1 -1
- package/standalone/.next/server/app/api/health/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/list/route.js +1 -1
- package/standalone/.next/server/app/api/list/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/memories/[memoryId]/history/route.js +1 -1
- package/standalone/.next/server/app/api/memories/[memoryId]/history/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/memories/[memoryId]/route.js +1 -1
- package/standalone/.next/server/app/api/memories/[memoryId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/memories/retain/route.js +1 -1
- package/standalone/.next/server/app/api/memories/retain/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/memories/retain_async/route.js +1 -1
- package/standalone/.next/server/app/api/memories/retain_async/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/operations/[agentId]/route.js +1 -1
- package/standalone/.next/server/app/api/operations/[agentId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/profile/[bankId]/route.js +1 -1
- package/standalone/.next/server/app/api/profile/[bankId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/recall/route.js +1 -1
- package/standalone/.next/server/app/api/recall/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/reflect/route.js +1 -1
- package/standalone/.next/server/app/api/reflect/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/stats/[agentId]/route.js +1 -1
- package/standalone/.next/server/app/api/stats/[agentId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/version/route.js +1 -1
- package/standalone/.next/server/app/api/version/route.js.nft.json +1 -1
- package/standalone/.next/server/app/banks/[bankId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/dashboard/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/dashboard.html +1 -1
- package/standalone/.next/server/app/dashboard.rsc +7 -7
- package/standalone/.next/server/app/dashboard.segments/_full.segment.rsc +7 -7
- package/standalone/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/standalone/.next/server/app/dashboard.segments/_index.segment.rsc +6 -6
- package/standalone/.next/server/app/dashboard.segments/_tree.segment.rsc +2 -2
- package/standalone/.next/server/app/dashboard.segments/dashboard/__PAGE__.segment.rsc +2 -2
- package/standalone/.next/server/app/dashboard.segments/dashboard.segment.rsc +1 -1
- package/standalone/.next/server/app/index.html +1 -1
- package/standalone/.next/server/app/index.rsc +6 -6
- package/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/standalone/.next/server/app/index.segments/_full.segment.rsc +6 -6
- package/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/standalone/.next/server/app/index.segments/_index.segment.rsc +6 -6
- package/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app-paths-manifest.json +1 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__00f576e1._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__2382d378._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__292b0698._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__452b2327._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__51ee396a._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__55ac8836._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__631bd6ec._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__6680ef3a._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__6927a12a._.js +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__f91a8834._.js → [root-of-the-server]__70002a37._.js} +6 -6
- package/standalone/.next/server/chunks/[root-of-the-server]__703c53ad._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__753186a7._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__817863c1._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__8f909cd1._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__a53f0ad4._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__a6b65147._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__a8fdd1d4._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__cb9928bd._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__d04f3011._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__d4f61da7._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__dab310ad._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__edeec8c1._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__f93edf8b._.js +1 -1
- package/standalone/.next/server/chunks/a6ea4_server_app_api_banks_[bankId]_consolidation-recover_route_actions_a6207e64.js +3 -0
- package/standalone/.next/server/chunks/ssr/[root-of-the-server]__d9fd2a9b._.js +1 -1
- package/standalone/.next/server/chunks/ssr/_29833292._.js +1 -1
- package/standalone/.next/server/chunks/ssr/_3b0b29a6._.js +1 -1
- package/standalone/.next/server/pages/404.html +1 -1
- package/standalone/.next/server/pages/500.html +2 -2
- package/standalone/.next/server/server-reference-manifest.js +1 -1
- package/standalone/.next/server/server-reference-manifest.json +1 -1
- package/standalone/.next/static/chunks/{07990944179445fa.js → c0fbf65a88b3da4e.js} +3 -3
- package/standalone/.next/static/chunks/c74a7e9c0b009083.css +2 -0
- package/standalone/.next/static/chunks/{8bdae5fbee506af4.js → d1ba061af94ae5b9.js} +1 -1
- package/standalone/.next/static/chunks/{4b55bedec7b62fa2.js → ec879bb3721bee10.js} +4 -4
- package/standalone/package.json +1 -1
- package/standalone/.next/static/chunks/823ce62ea6cdec3c.css +0 -2
- /package/standalone/.next/static/{a2mBPNyqrIdH0XcenXxph → R6vjDnKl5rOWlU3TdV0Y0}/_buildManifest.js +0 -0
- /package/standalone/.next/static/{a2mBPNyqrIdH0XcenXxph → R6vjDnKl5rOWlU3TdV0Y0}/_clientMiddlewareManifest.json +0 -0
- /package/standalone/.next/static/{a2mBPNyqrIdH0XcenXxph → R6vjDnKl5rOWlU3TdV0Y0}/_ssgManifest.js +0 -0
|
@@ -4,6 +4,6 @@ Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpattern
|
|
|
4
4
|
|
|
5
5
|
If you want to hide the \`${b.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
6
6
|
|
|
7
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${b.docsSlug}`;return u.useEffect(()=>{a&&(document.getElementById(a)||console.error(c))},[c,a]),null},cG=({contentRef:a,descriptionId:b})=>{let c=cE("DialogDescriptionWarning"),d=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${c.contentName}}.`;return u.useEffect(()=>{let c=a.current?.getAttribute("aria-describedby");b&&c&&(document.getElementById(b)||console.warn(d))},[d,a,b]),null};a.s(["Close",()=>cA,"Content",()=>cr,"Description",()=>cy,"Overlay",()=>cn,"Portal",()=>cl,"Root",()=>cf,"Title",()=>cw,"Trigger",()=>ch,"WarningProvider",()=>cD,"createDialogScope",()=>cc],97942);var cH='[cmdk-group=""]',cI='[cmdk-group-items=""]',cJ='[cmdk-item=""]',cK=`${cJ}:not([aria-disabled="true"])`,cL="cmdk-item-select",cM="data-value",cN=(a,b,c)=>{var d;return d=a,function a(b,c,d,e,f,g,h){if(g===c.length)return f===b.length?1:.99;var i=`${f},${g}`;if(void 0!==h[i])return h[i];for(var j,k,l,m,n=e.charAt(g),o=d.indexOf(n,f),p=0;o>=0;)(j=a(b,c,d,e,o+1,g+1,h))>p&&(o===f?j*=1:aU.test(b.charAt(o-1))?(j*=.8,(l=b.slice(f,o-1).match(aV))&&f>0&&(j*=Math.pow(.999,l.length))):aW.test(b.charAt(o-1))?(j*=.9,(m=b.slice(f,o-1).match(aX))&&f>0&&(j*=Math.pow(.999,m.length))):(j*=.17,f>0&&(j*=Math.pow(.999,o-f))),b.charAt(o)!==c.charAt(g)&&(j*=.9999)),(j<.1&&d.charAt(o-1)===e.charAt(g+1)||e.charAt(g+1)===e.charAt(g)&&d.charAt(o-1)!==e.charAt(g))&&.1*(k=a(b,c,d,e,o+1,g+2,h))>j&&(j=.1*k),j>p&&(p=j),o=d.indexOf(n,o+1);return h[i]=p,p}(d=c&&c.length>0?`${d+" "+c.join(" ")}`:d,b,aY(d),aY(b),0,0,{})},cO=u.createContext(void 0),cP=u.createContext(void 0),cQ=u.createContext(void 0),cR=u.forwardRef((a,b)=>{let c=c_(()=>{var b,c;return{search:"",value:null!=(c=null!=(b=a.value)?b:a.defaultValue)?c:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),d=c_(()=>new Set),e=c_(()=>new Map),f=c_(()=>new Map),g=c_(()=>new Set),h=cZ(a),{label:i,children:j,value:k,onValueChange:l,filter:m,shouldFilter:n,loop:o,disablePointerSelection:p=!1,vimBindings:q=!0,...r}=a,s=a3(),t=a3(),v=a3(),w=u.useRef(null),x=c2();c$(()=>{if(void 0!==k){let a=k.trim();c.current.value=a,y.emit()}},[k]),c$(()=>{x(6,E)},[]);let y=u.useMemo(()=>({subscribe:a=>(g.current.add(a),()=>g.current.delete(a)),snapshot:()=>c.current,setState:(a,b,d)=>{var e,f,g,i;if(!Object.is(c.current[a],b)){if(c.current[a]=b,"search"===a)D(),B(),x(1,C);else if("value"===a){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let a=document.getElementById(v);a?a.focus():null==(e=document.getElementById(s))||e.focus()}if(x(7,()=>{var a;c.current.selectedItemId=null==(a=F())?void 0:a.id,y.emit()}),d||x(5,E),(null==(f=h.current)?void 0:f.value)!==void 0){null==(i=(g=h.current).onValueChange)||i.call(g,null!=b?b:"");return}}y.emit()}},emit:()=>{g.current.forEach(a=>a())}}),[]),z=u.useMemo(()=>({value:(a,b,d)=>{var e;b!==(null==(e=f.current.get(a))?void 0:e.value)&&(f.current.set(a,{value:b,keywords:d}),c.current.filtered.items.set(a,A(b,d)),x(2,()=>{B(),y.emit()}))},item:(a,b)=>(d.current.add(a),b&&(e.current.has(b)?e.current.get(b).add(a):e.current.set(b,new Set([a]))),x(3,()=>{D(),B(),c.current.value||C(),y.emit()}),()=>{f.current.delete(a),d.current.delete(a),c.current.filtered.items.delete(a);let b=F();x(4,()=>{D(),(null==b?void 0:b.getAttribute("id"))===a&&C(),y.emit()})}),group:a=>(e.current.has(a)||e.current.set(a,new Set),()=>{f.current.delete(a),e.current.delete(a)}),filter:()=>h.current.shouldFilter,label:i||a["aria-label"],getDisablePointerSelection:()=>h.current.disablePointerSelection,listId:s,inputId:v,labelId:t,listInnerRef:w}),[]);function A(a,b){var d,e;let f=null!=(e=null==(d=h.current)?void 0:d.filter)?e:cN;return a?f(a,c.current.search,b):0}function B(){if(!c.current.search||!1===h.current.shouldFilter)return;let a=c.current.filtered.items,b=[];c.current.filtered.groups.forEach(c=>{let d=e.current.get(c),f=0;d.forEach(b=>{f=Math.max(a.get(b),f)}),b.push([c,f])});let d=w.current;G().sort((b,c)=>{var d,e;let f=b.getAttribute("id"),g=c.getAttribute("id");return(null!=(d=a.get(g))?d:0)-(null!=(e=a.get(f))?e:0)}).forEach(a=>{let b=a.closest(cI);b?b.appendChild(a.parentElement===b?a:a.closest(`${cI} > *`)):d.appendChild(a.parentElement===d?a:a.closest(`${cI} > *`))}),b.sort((a,b)=>b[1]-a[1]).forEach(a=>{var b;let c=null==(b=w.current)?void 0:b.querySelector(`${cH}[${cM}="${encodeURIComponent(a[0])}"]`);null==c||c.parentElement.appendChild(c)})}function C(){let a=G().find(a=>"true"!==a.getAttribute("aria-disabled")),b=null==a?void 0:a.getAttribute(cM);y.setState("value",b||void 0)}function D(){var a,b,g,i;if(!c.current.search||!1===h.current.shouldFilter){c.current.filtered.count=d.current.size;return}c.current.filtered.groups=new Set;let j=0;for(let e of d.current){let d=A(null!=(b=null==(a=f.current.get(e))?void 0:a.value)?b:"",null!=(i=null==(g=f.current.get(e))?void 0:g.keywords)?i:[]);c.current.filtered.items.set(e,d),d>0&&j++}for(let[a,b]of e.current)for(let d of b)if(c.current.filtered.items.get(d)>0){c.current.filtered.groups.add(a);break}c.current.filtered.count=j}function E(){var a,b,c;let d=F();d&&((null==(a=d.parentElement)?void 0:a.firstChild)===d&&(null==(c=null==(b=d.closest(cH))?void 0:b.querySelector('[cmdk-group-heading=""]'))||c.scrollIntoView({block:"nearest"})),d.scrollIntoView({block:"nearest"}))}function F(){var a;return null==(a=w.current)?void 0:a.querySelector(`${cJ}[aria-selected="true"]`)}function G(){var a;return Array.from((null==(a=w.current)?void 0:a.querySelectorAll(cK))||[])}function H(a){let b=G()[a];b&&y.setState("value",b.getAttribute(cM))}function I(a){var b;let c=F(),d=G(),e=d.findIndex(a=>a===c),f=d[e+a];null!=(b=h.current)&&b.loop&&(f=e+a<0?d[d.length-1]:e+a===d.length?d[0]:d[e+a]),f&&y.setState("value",f.getAttribute(cM))}function J(a){let b=F(),c=null==b?void 0:b.closest(cH),d;for(;c&&!d;)d=null==(c=a>0?function(a,b){let c=a.nextElementSibling;for(;c;){if(c.matches(b))return c;c=c.nextElementSibling}}(c,cH):function(a,b){let c=a.previousElementSibling;for(;c;){if(c.matches(b))return c;c=c.previousElementSibling}}(c,cH))?void 0:c.querySelector(cK);d?y.setState("value",d.getAttribute(cM)):I(a)}let K=()=>H(G().length-1),L=a=>{a.preventDefault(),a.metaKey?K():a.altKey?J(1):I(1)},M=a=>{a.preventDefault(),a.metaKey?H(0):a.altKey?J(-1):I(-1)};return u.createElement(a9.div,{ref:b,tabIndex:-1,...r,"cmdk-root":"",onKeyDown:a=>{var b;null==(b=r.onKeyDown)||b.call(r,a);let c=a.nativeEvent.isComposing||229===a.keyCode;if(!(a.defaultPrevented||c))switch(a.key){case"n":case"j":q&&a.ctrlKey&&L(a);break;case"ArrowDown":L(a);break;case"p":case"k":q&&a.ctrlKey&&M(a);break;case"ArrowUp":M(a);break;case"Home":a.preventDefault(),H(0);break;case"End":a.preventDefault(),K();break;case"Enter":{a.preventDefault();let b=F();if(b){let a=new Event(cL);b.dispatchEvent(a)}}}}},u.createElement("label",{"cmdk-label":"",htmlFor:z.inputId,id:z.labelId,style:c4},i),c3(a,a=>u.createElement(cP.Provider,{value:y},u.createElement(cO.Provider,{value:z},a))))}),cS=u.forwardRef((a,b)=>{var c,d;let e=a3(),f=u.useRef(null),g=u.useContext(cQ),h=u.useContext(cO),i=cZ(a),j=null!=(d=null==(c=i.current)?void 0:c.forceMount)?d:null==g?void 0:g.forceMount;c$(()=>{if(!j)return h.item(e,null==g?void 0:g.id)},[j]);let k=c1(e,f,[a.value,a.children,f],a.keywords),l=u.useContext(cP),m=c0(a=>a.value&&a.value===k.current),n=c0(a=>!!j||!1===h.filter()||!a.search||a.filtered.items.get(e)>0);function o(){var a,b;p(),null==(b=(a=i.current).onSelect)||b.call(a,k.current)}function p(){l.setState("value",k.current,!0)}if(u.useEffect(()=>{let b=f.current;if(!(!b||a.disabled))return b.addEventListener(cL,o),()=>b.removeEventListener(cL,o)},[n,a.onSelect,a.disabled]),!n)return null;let{disabled:q,value:r,onSelect:s,forceMount:t,keywords:v,...w}=a;return u.createElement(a9.div,{ref:z(f,b),...w,id:e,"cmdk-item":"",role:"option","aria-disabled":!!q,"aria-selected":!!m,"data-disabled":!!q,"data-selected":!!m,onPointerMove:q||h.getDisablePointerSelection()?void 0:p,onClick:q?void 0:o},a.children)}),cT=u.forwardRef((a,b)=>{let{heading:c,children:d,forceMount:e,...f}=a,g=a3(),h=u.useRef(null),i=u.useRef(null),j=a3(),k=u.useContext(cO),l=c0(a=>!!e||!1===k.filter()||!a.search||a.filtered.groups.has(g));c$(()=>k.group(g),[]),c1(g,h,[a.value,a.heading,i]);let m=u.useMemo(()=>({id:g,forceMount:e}),[e]);return u.createElement(a9.div,{ref:z(h,b),...f,"cmdk-group":"",role:"presentation",hidden:!l||void 0},c&&u.createElement("div",{ref:i,"cmdk-group-heading":"","aria-hidden":!0,id:j},c),c3(a,a=>u.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":c?j:void 0},u.createElement(cQ.Provider,{value:m},a))))}),cU=u.forwardRef((a,b)=>{let{alwaysRender:c,...d}=a,e=u.useRef(null),f=c0(a=>!a.search);return c||f?u.createElement(a9.div,{ref:z(e,b),...d,"cmdk-separator":"",role:"separator"}):null}),cV=u.forwardRef((a,b)=>{let{onValueChange:c,...d}=a,e=null!=a.value,f=u.useContext(cP),g=c0(a=>a.search),h=c0(a=>a.selectedItemId),i=u.useContext(cO);return u.useEffect(()=>{null!=a.value&&f.setState("search",a.value)},[a.value]),u.createElement(a9.input,{ref:b,...d,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":i.listId,"aria-labelledby":i.labelId,"aria-activedescendant":h,id:i.inputId,type:"text",value:e?a.value:g,onChange:a=>{e||f.setState("search",a.target.value),null==c||c(a.target.value)}})}),cW=u.forwardRef((a,b)=>{let{children:c,label:d="Suggestions",...e}=a,f=u.useRef(null),g=u.useRef(null),h=c0(a=>a.selectedItemId),i=u.useContext(cO);return u.useEffect(()=>{if(g.current&&f.current){let a=g.current,b=f.current,c,d=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let c=a.offsetHeight;b.style.setProperty("--cmdk-list-height",c.toFixed(1)+"px")})});return d.observe(a),()=>{cancelAnimationFrame(c),d.unobserve(a)}}},[]),u.createElement(a9.div,{ref:z(f,b),...e,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":h,"aria-label":d,id:i.listId},c3(a,a=>u.createElement("div",{ref:z(g,i.listInnerRef),"cmdk-list-sizer":""},a)))}),cX=u.forwardRef((a,b)=>{let{open:c,onOpenChange:d,overlayClassName:e,contentClassName:f,container:g,...h}=a;return u.createElement(cf,{open:c,onOpenChange:d},u.createElement(cl,{container:g},u.createElement(cn,{"cmdk-overlay":"",className:e}),u.createElement(cr,{"aria-label":a.label,"cmdk-dialog":"",className:f},u.createElement(cR,{ref:b,...h}))))}),cY=Object.assign(cR,{List:cW,Item:cS,Input:cV,Group:cT,Separator:cU,Dialog:cX,Empty:u.forwardRef((a,b)=>c0(a=>0===a.filtered.count)?u.createElement(a9.div,{ref:b,...a,"cmdk-empty":"",role:"presentation"}):null),Loading:u.forwardRef((a,b)=>{let{progress:c,children:d,label:e="Loading...",...f}=a;return u.createElement(a9.div,{ref:b,...f,"cmdk-loading":"",role:"progressbar","aria-valuenow":c,"aria-valuemin":0,"aria-valuemax":100,"aria-label":e},c3(a,a=>u.createElement("div",{"aria-hidden":!0},a)))})});function cZ(a){let b=u.useRef(a);return c$(()=>{b.current=a}),b}var c$=u.useEffect;function c_(a){let b=u.useRef();return void 0===b.current&&(b.current=a()),b}function c0(a){let b=u.useContext(cP),c=()=>a(b.snapshot());return u.useSyncExternalStore(b.subscribe,c,c)}function c1(a,b,c,d=[]){let e=u.useRef(),f=u.useContext(cO);return c$(()=>{var g;let h=(()=>{var a;for(let b of c){if("string"==typeof b)return b.trim();if("object"==typeof b&&"current"in b)return b.current?null==(a=b.current.textContent)?void 0:a.trim():e.current}})(),i=d.map(a=>a.trim());f.value(a,h,i),null==(g=b.current)||g.setAttribute(cM,h),e.current=h}),e}var c2=()=>{let[a,b]=u.useState(),c=c_(()=>new Map);return c$(()=>{c.current.forEach(a=>a()),c.current=new Map},[a]),(a,d)=>{c.current.set(a,d),b({})}};function c3({asChild:a,children:b},c){let d;return a&&u.isValidElement(b)?u.cloneElement("function"==typeof(d=b.type)?d(b.props):"render"in d?d.render(b.props):b,{ref:b.ref},c(b.props.children)):c(b)}var c4={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},c5=a.i(70106);let c6=(0,c5.default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);a.s(["Search",()=>c6],87532);let c7=(0,c5.default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);a.s(["X",()=>c7],33508);let c8=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(cn,{ref:c,className:aR("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...b}));c8.displayName=cn.displayName;let c9=u.forwardRef(({className:a,children:b,...c},d)=>(0,t.jsxs)(cl,{children:[(0,t.jsx)(c8,{}),(0,t.jsxs)(cr,{ref:d,className:aR("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...c,children:[b,(0,t.jsxs)(cA,{className:"absolute right-4 top-4 rounded-sm ring-offset-background transition-opacity hover:opacity-80 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground text-foreground",children:[(0,t.jsx)(c7,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));c9.displayName=cr.displayName;let da=({className:a,...b})=>(0,t.jsx)("div",{className:aR("flex flex-col space-y-1.5 text-center sm:text-left",a),...b});da.displayName="DialogHeader";let db=({className:a,...b})=>(0,t.jsx)("div",{className:aR("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...b});db.displayName="DialogFooter";let dc=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(cw,{ref:c,className:aR("text-lg font-semibold leading-none tracking-tight text-foreground",a),...b}));dc.displayName=cw.displayName;let dd=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(cy,{ref:c,className:aR("text-sm text-muted-foreground",a),...b}));dd.displayName=cy.displayName,a.s(["Dialog",()=>cf,"DialogContent",()=>c9,"DialogDescription",()=>dd,"DialogFooter",()=>db,"DialogHeader",()=>da,"DialogTitle",()=>dc],85442);let de=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(cY,{ref:c,className:aR("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",a),...b}));de.displayName=cY.displayName;let df=u.forwardRef(({className:a,...b},c)=>(0,t.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,t.jsx)(c6,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,t.jsx)(cY.Input,{ref:c,className:aR("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",a),...b})]}));df.displayName=cY.Input.displayName;let dg=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(cY.List,{ref:c,className:aR("max-h-[300px] overflow-y-auto overflow-x-hidden",a),...b}));dg.displayName=cY.List.displayName;let dh=u.forwardRef((a,b)=>(0,t.jsx)(cY.Empty,{ref:b,className:"py-6 text-center text-sm",...a}));dh.displayName=cY.Empty.displayName;let di=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(cY.Group,{ref:c,className:aR("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",a),...b}));di.displayName=cY.Group.displayName,u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(cY.Separator,{ref:c,className:aR("-mx-1 h-px bg-border",a),...b})).displayName=cY.Separator.displayName;let dj=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(cY.Item,{ref:c,className:aR("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a),...b}));dj.displayName=cY.Item.displayName;let dk=["top","right","bottom","left"],dl=Math.min,dm=Math.max,dn=Math.round,dp=Math.floor,dq=a=>({x:a,y:a}),dr={left:"right",right:"left",bottom:"top",top:"bottom"},ds={start:"end",end:"start"};function dt(a,b){return"function"==typeof a?a(b):a}function du(a){return a.split("-")[0]}function dv(a){return a.split("-")[1]}function dw(a){return"x"===a?"y":"x"}function dx(a){return"y"===a?"height":"width"}let dy=new Set(["top","bottom"]);function dz(a){return dy.has(du(a))?"y":"x"}function dA(a){return a.replace(/start|end/g,a=>ds[a])}let dB=["left","right"],dC=["right","left"],dD=["top","bottom"],dE=["bottom","top"];function dF(a){return a.replace(/left|right|bottom|top/g,a=>dr[a])}function dG(a){return"number"!=typeof a?{top:0,right:0,bottom:0,left:0,...a}:{top:a,right:a,bottom:a,left:a}}function dH(a){let{x:b,y:c,width:d,height:e}=a;return{width:d,height:e,top:c,left:b,right:b+d,bottom:c+e,x:b,y:c}}function dI(a,b,c){let d,{reference:e,floating:f}=a,g=dz(b),h=dw(dz(b)),i=dx(h),j=du(b),k="y"===g,l=e.x+e.width/2-f.width/2,m=e.y+e.height/2-f.height/2,n=e[i]/2-f[i]/2;switch(j){case"top":d={x:l,y:e.y-f.height};break;case"bottom":d={x:l,y:e.y+e.height};break;case"right":d={x:e.x+e.width,y:m};break;case"left":d={x:e.x-f.width,y:m};break;default:d={x:e.x,y:e.y}}switch(dv(b)){case"start":d[h]-=n*(c&&k?-1:1);break;case"end":d[h]+=n*(c&&k?-1:1)}return d}let dJ=async(a,b,c)=>{let{placement:d="bottom",strategy:e="absolute",middleware:f=[],platform:g}=c,h=f.filter(Boolean),i=await (null==g.isRTL?void 0:g.isRTL(b)),j=await g.getElementRects({reference:a,floating:b,strategy:e}),{x:k,y:l}=dI(j,d,i),m=d,n={},o=0;for(let c=0;c<h.length;c++){let{name:f,fn:p}=h[c],{x:q,y:r,data:s,reset:t}=await p({x:k,y:l,initialPlacement:d,placement:m,strategy:e,middlewareData:n,rects:j,platform:g,elements:{reference:a,floating:b}});k=null!=q?q:k,l=null!=r?r:l,n={...n,[f]:{...n[f],...s}},t&&o<=50&&(o++,"object"==typeof t&&(t.placement&&(m=t.placement),t.rects&&(j=!0===t.rects?await g.getElementRects({reference:a,floating:b,strategy:e}):t.rects),{x:k,y:l}=dI(j,m,i)),c=-1)}return{x:k,y:l,placement:m,strategy:e,middlewareData:n}};async function dK(a,b){var c;void 0===b&&(b={});let{x:d,y:e,platform:f,rects:g,elements:h,strategy:i}=a,{boundary:j="clippingAncestors",rootBoundary:k="viewport",elementContext:l="floating",altBoundary:m=!1,padding:n=0}=dt(b,a),o=dG(n),p=h[m?"floating"===l?"reference":"floating":l],q=dH(await f.getClippingRect({element:null==(c=await (null==f.isElement?void 0:f.isElement(p)))||c?p:p.contextElement||await (null==f.getDocumentElement?void 0:f.getDocumentElement(h.floating)),boundary:j,rootBoundary:k,strategy:i})),r="floating"===l?{x:d,y:e,width:g.floating.width,height:g.floating.height}:g.reference,s=await (null==f.getOffsetParent?void 0:f.getOffsetParent(h.floating)),t=await (null==f.isElement?void 0:f.isElement(s))&&await (null==f.getScale?void 0:f.getScale(s))||{x:1,y:1},u=dH(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:r,offsetParent:s,strategy:i}):r);return{top:(q.top-u.top+o.top)/t.y,bottom:(u.bottom-q.bottom+o.bottom)/t.y,left:(q.left-u.left+o.left)/t.x,right:(u.right-q.right+o.right)/t.x}}function dL(a,b){return{top:a.top-b.height,right:a.right-b.width,bottom:a.bottom-b.height,left:a.left-b.width}}function dM(a){return dk.some(b=>a[b]>=0)}let dN=new Set(["left","top"]);async function dO(a,b){let{placement:c,platform:d,elements:e}=a,f=await (null==d.isRTL?void 0:d.isRTL(e.floating)),g=du(c),h=dv(c),i="y"===dz(c),j=dN.has(g)?-1:1,k=f&&i?-1:1,l=dt(b,a),{mainAxis:m,crossAxis:n,alignmentAxis:o}="number"==typeof l?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return h&&"number"==typeof o&&(n="end"===h?-1*o:o),i?{x:n*k,y:m*j}:{x:m*j,y:n*k}}function dP(a){return function(a){return!1}(a)?(a.nodeName||"").toLowerCase():"#document"}function dQ(a){var b;return(null==a||null==(b=a.ownerDocument)?void 0:b.defaultView)||window}function dR(a){var b;return null==(b=(function(a){return!1}(a)?a.ownerDocument:a.document)||window.document)?void 0:b.documentElement}function dS(a){return!1}let dT=new Set(["inline","contents"]);function dU(a){let{overflow:b,overflowX:c,overflowY:d,display:e}=d3(a);return/auto|scroll|overlay|hidden|clip/.test(b+d+c)&&!dT.has(e)}let dV=new Set(["table","td","th"]),dW=[":popover-open",":modal"];function dX(a){return dW.some(b=>{try{return a.matches(b)}catch(a){return!1}})}let dY=["transform","translate","scale","rotate","perspective"],dZ=["transform","translate","scale","rotate","perspective","filter"],d$=["paint","layout","strict","content"];function d_(a){let b=d0(),c=a;return dY.some(a=>!!c[a]&&"none"!==c[a])||!!c.containerType&&"normal"!==c.containerType||!b&&!!c.backdropFilter&&"none"!==c.backdropFilter||!b&&!!c.filter&&"none"!==c.filter||dZ.some(a=>(c.willChange||"").includes(a))||d$.some(a=>(c.contain||"").includes(a))}function d0(){return!("u"<typeof CSS)&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let d1=new Set(["html","body","#document"]);function d2(a){return d1.has(dP(a))}function d3(a){return dQ(a).getComputedStyle(a)}function d4(a){return{scrollLeft:a.scrollX,scrollTop:a.scrollY}}function d5(a){if("html"===dP(a))return a;let b=a.assignedSlot||a.parentNode||!1||dR(a);return b}function d6(a,b,c){var d;void 0===b&&(b=[]),void 0===c&&(c=!0);let e=function a(b){let c=d5(b);return d2(c)?b.ownerDocument?b.ownerDocument.body:b.body:a(c)}(a),f=e===(null==(d=a.ownerDocument)?void 0:d.body),g=dQ(e);if(f){let a=d7(g);return b.concat(g,g.visualViewport||[],dU(e)?e:[],a&&c?d6(a):[])}return b.concat(e,d6(e,[],c))}function d7(a){return a.parent&&Object.getPrototypeOf(a.parent)?a.frameElement:null}function d8(a){let b=d3(a),c=parseFloat(b.width)||0,d=parseFloat(b.height)||0,e=!1,f=e?a.offsetWidth:c,g=e?a.offsetHeight:d,h=dn(c)!==f||dn(d)!==g;return h&&(c=f,d=g),{width:c,height:d,$:h}}function d9(a){return 0,a.contextElement}function ea(a){let b=d9(a);1;return dq(1)}let eb=dq(0);function ec(a){let b=dQ(a);return d0()&&b.visualViewport?{x:b.visualViewport.offsetLeft,y:b.visualViewport.offsetTop}:eb}function ed(a,b,c,d){var e;void 0===b&&(b=!1),void 0===c&&(c=!1);let f=a.getBoundingClientRect(),g=d9(a),h=dq(1);b&&(d||(h=ea(a)));let i=(void 0===(e=c)&&(e=!1),d&&(!e||d===dQ(g))&&e)?ec(g):dq(0),j=(f.left+i.x)/h.x,k=(f.top+i.y)/h.y,l=f.width/h.x,m=f.height/h.y;if(g){let a=dQ(g),b=d,c=a,e=d7(c);for(;e&&d&&b!==c;){let a=ea(e),b=e.getBoundingClientRect(),d=d3(e),f=b.left+(e.clientLeft+parseFloat(d.paddingLeft))*a.x,g=b.top+(e.clientTop+parseFloat(d.paddingTop))*a.y;j*=a.x,k*=a.y,l*=a.x,m*=a.y,j+=f,k+=g,e=d7(c=dQ(e))}}return dH({width:l,height:m,x:j,y:k})}function ee(a,b){let c=d4(a).scrollLeft;return b?b.left+c:ed(dR(a)).left+c}function ef(a,b){let c=a.getBoundingClientRect();return{x:c.left+b.scrollLeft-ee(a,c),y:c.top+b.scrollTop}}function eg(a,b,c){var d;let e;if("viewport"===b)e=function(a,b){let c=dQ(a),d=dR(a),e=c.visualViewport,f=d.clientWidth,g=d.clientHeight,h=0,i=0;if(e){f=e.width,g=e.height;let a=d0();(!a||a&&"fixed"===b)&&(h=e.offsetLeft,i=e.offsetTop)}let j=ee(d);if(j<=0){let a=d.ownerDocument,b=a.body,c=getComputedStyle(b),e="CSS1Compat"===a.compatMode&&parseFloat(c.marginLeft)+parseFloat(c.marginRight)||0,g=Math.abs(d.clientWidth-b.clientWidth-e);g<=25&&(f-=g)}else j<=25&&(f+=j);return{width:f,height:g,x:h,y:i}}(a,c);else if("document"===b){let b,c,f,g,h,i,j;d=dR(a),b=dR(d),c=d4(d),f=d.ownerDocument.body,g=dm(b.scrollWidth,b.clientWidth,f.scrollWidth,f.clientWidth),h=dm(b.scrollHeight,b.clientHeight,f.scrollHeight,f.clientHeight),i=-c.scrollLeft+ee(d),j=-c.scrollTop,"rtl"===d3(f).direction&&(i+=dm(b.clientWidth,f.clientWidth)-g),e={width:g,height:h,x:i,y:j}}else{1;{let c=ec(a);e={x:b.x-c.x,y:b.y-c.y,width:b.width,height:b.height}}}return dH(e)}function eh(a){return"static"===d3(a).position}function ei(a,b){1;return null}function ej(a,b){var c;let d=dQ(a);if(dX(a))return d;1;{let b=d5(a);for(;b&&!d2(b);){0;b=d5(b)}return d}}let ek=async function(a){let b=this.getOffsetParent||ej,c=this.getDimensions,d=await c(a.floating);return{reference:function(a,b,c){var d;let e=(d=0,!1),f=dR(b),g="fixed"===c,h=ed(a,!0,g,b),i={scrollLeft:0,scrollTop:0},j=dq(0);if(e||!e&&!g)if(("body"!==dP(b)||dU(f))&&(i=d4(b)),e){let a=ed(b,!0,g,b);j.x=a.x+b.clientLeft,j.y=a.y+b.clientTop}else f&&(j.x=ee(f));g&&!e&&f&&(j.x=ee(f));let k=!f||e||g?dq(0):ef(f,i);return{x:h.left+i.scrollLeft-j.x-k.x,y:h.top+i.scrollTop-j.y-k.y,width:h.width,height:h.height}}(a.reference,await b(a.floating),a.strategy),floating:{x:0,y:0,width:d.width,height:d.height}}},el={convertOffsetParentRelativeRectToViewportRelativeRect:function(a){var b,c;let{elements:d,rect:e,offsetParent:f,strategy:g}=a,h="fixed"===g,i=dR(f),j=!!d&&dX(d.floating);if(f===i||j&&h)return e;let k={scrollLeft:0,scrollTop:0},l=dq(1),m=dq(0),n=(b=0,!1);(n||!n&&!h)&&(("body"!==dP(f)||dU(i))&&(k=d4(f)),c=0,0);let o=!i||n||h?dq(0):ef(i,k);return{width:e.width*l.x,height:e.height*l.y,x:e.x*l.x-k.scrollLeft*l.x+m.x+o.x,y:e.y*l.y-k.scrollTop*l.y+m.y+o.y}},getDocumentElement:dR,getClippingRect:function(a){let{element:b,boundary:c,rootBoundary:d,strategy:e}=a,f=[..."clippingAncestors"===c?dX(b)?[]:function(a,b){var c;let d=b.get(a);if(d)return d;let e=d6(a,[],!1).filter(a=>{var b;return b=0,!1}),f="fixed"===d3(a).position,g=f?d5(a):a;return c=0,b.set(a,e),e}(b,this._c):[].concat(c),d],g=f[0],h=f.reduce((a,c)=>{let d=eg(b,c,e);return a.top=dm(d.top,a.top),a.right=dl(d.right,a.right),a.bottom=dl(d.bottom,a.bottom),a.left=dm(d.left,a.left),a},eg(b,g,e));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}},getOffsetParent:ej,getElementRects:ek,getClientRects:function(a){return Array.from(a.getClientRects())},getDimensions:function(a){let{width:b,height:c}=d8(a);return{width:b,height:c}},getScale:ea,isElement:dS,isRTL:function(a){return"rtl"===d3(a).direction}};function em(a,b){return a.x===b.x&&a.y===b.y&&a.width===b.width&&a.height===b.height}let en=a=>({name:"arrow",options:a,async fn(b){let{x:c,y:d,placement:e,rects:f,platform:g,elements:h,middlewareData:i}=b,{element:j,padding:k=0}=dt(a,b)||{};if(null==j)return{};let l=dG(k),m={x:c,y:d},n=dw(dz(e)),o=dx(n),p=await g.getDimensions(j),q="y"===n,r=q?"clientHeight":"clientWidth",s=f.reference[o]+f.reference[n]-m[n]-f.floating[o],t=m[n]-f.reference[n],u=await (null==g.getOffsetParent?void 0:g.getOffsetParent(j)),v=u?u[r]:0;v&&await (null==g.isElement?void 0:g.isElement(u))||(v=h.floating[r]||f.floating[o]);let w=v/2-p[o]/2-1,x=dl(l[q?"top":"left"],w),y=dl(l[q?"bottom":"right"],w),z=v-p[o]-y,A=v/2-p[o]/2+(s/2-t/2),B=dm(x,dl(A,z)),C=!i.arrow&&null!=dv(e)&&A!==B&&f.reference[o]/2-(A<x?x:y)-p[o]/2<0,D=C?A<x?A-x:A-z:0;return{[n]:m[n]+D,data:{[n]:B,centerOffset:A-B-D,...C&&{alignmentOffset:D}},reset:C}}});var eo="u">typeof document?u.useLayoutEffect:function(){};function ep(a,b){let c,d,e;if(a===b)return!0;if(typeof a!=typeof b)return!1;if("function"==typeof a&&a.toString()===b.toString())return!0;if(a&&b&&"object"==typeof a){if(Array.isArray(a)){if((c=a.length)!==b.length)return!1;for(d=c;0!=d--;)if(!ep(a[d],b[d]))return!1;return!0}if((c=(e=Object.keys(a)).length)!==Object.keys(b).length)return!1;for(d=c;0!=d--;)if(!({}).hasOwnProperty.call(b,e[d]))return!1;for(d=c;0!=d--;){let c=e[d];if(("_owner"!==c||!a.$$typeof)&&!ep(a[c],b[c]))return!1}return!0}return a!=a&&b!=b}function eq(a,b){let c=1;return Math.round(b*c)/c}function er(a){let b=u.useRef(a);return eo(()=>{b.current=a}),b}var es=u.forwardRef((a,b)=>{let{children:c,width:d=10,height:e=5,...f}=a;return(0,t.jsx)(a9.svg,{...f,ref:b,width:d,height:e,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:a.asChild?c:(0,t.jsx)("polygon",{points:"0,0 30,0 15,10"})})});function et(a){let[b,c]=u.useState(void 0);return a0(()=>{if(a){c({width:a.offsetWidth,height:a.offsetHeight});let b=new ResizeObserver(b=>{let d,e;if(!Array.isArray(b)||!b.length)return;let f=b[0];if("borderBoxSize"in f){let a=f.borderBoxSize,b=Array.isArray(a)?a[0]:a;d=b.inlineSize,e=b.blockSize}else d=a.offsetWidth,e=a.offsetHeight;c({width:d,height:e})});return b.observe(a,{box:"border-box"}),()=>b.unobserve(a)}c(void 0)},[a]),b}es.displayName="Arrow",a.s(["useSize",()=>et],3688);var eu="Popper",[ev,ew]=a_(eu),[ex,ey]=ev(eu),ez=a=>{let{__scopePopper:b,children:c}=a,[d,e]=u.useState(null);return(0,t.jsx)(ex,{scope:b,anchor:d,onAnchorChange:e,children:c})};ez.displayName=eu;var eA="PopperAnchor",eB=u.forwardRef((a,b)=>{let{__scopePopper:c,virtualRef:d,...e}=a,f=ey(eA,c),g=u.useRef(null),h=A(b,g),i=u.useRef(null);return u.useEffect(()=>{let a=i.current;i.current=d?.current||g.current,a!==i.current&&f.onAnchorChange(i.current)}),d?null:(0,t.jsx)(a9.div,{...e,ref:h})});eB.displayName=eA;var eC="PopperContent",[eD,eE]=ev(eC),eF=u.forwardRef((a,b)=>{var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,v,w,x,y;let{__scopePopper:z,side:B="bottom",sideOffset:C=0,align:D="center",alignOffset:E=0,arrowPadding:F=0,avoidCollisions:G=!0,collisionBoundary:H=[],collisionPadding:I=0,sticky:J="partial",hideWhenDetached:K=!1,updatePositionStrategy:L="optimized",onPlaced:M,...N}=a,O=ey(eC,z),[P,Q]=u.useState(null),R=A(b,a=>Q(a)),[S,T]=u.useState(null),U=et(S),V=U?.width??0,W=U?.height??0,X="number"==typeof I?I:{top:0,right:0,bottom:0,left:0,...I},Y=Array.isArray(H)?H:[H],Z=Y.length>0,$={padding:X,boundary:Y.filter(eJ),altBoundary:Z},{refs:_,floatingStyles:aa,placement:ab,isPositioned:ac,middlewareData:ad}=function(a){void 0===a&&(a={});let{placement:b="bottom",strategy:c="absolute",middleware:d=[],platform:e,elements:{reference:f,floating:g}={},transform:h=!0,whileElementsMounted:i,open:j}=a,[k,l]=u.useState({x:0,y:0,strategy:c,placement:b,middlewareData:{},isPositioned:!1}),[m,n]=u.useState(d);ep(m,d)||n(d);let[o,p]=u.useState(null),[q,r]=u.useState(null),s=u.useCallback(a=>{a!==x.current&&(x.current=a,p(a))},[]),t=u.useCallback(a=>{a!==y.current&&(y.current=a,r(a))},[]),v=f||o,w=g||q,x=u.useRef(null),y=u.useRef(null),z=u.useRef(k),A=null!=i,B=er(i),C=er(e),D=er(j),E=u.useCallback(()=>{var a,d;let e,f,g;if(!x.current||!y.current)return;let h={placement:b,strategy:c,middleware:m};C.current&&(h.platform=C.current),(a=x.current,d=y.current,e=new Map,g={...(f={platform:el,...h}).platform,_c:e},dJ(a,d,{...f,platform:g})).then(a=>{let b={...a,isPositioned:!1!==D.current};F.current&&!ep(z.current,b)&&(z.current=b,a6.flushSync(()=>{l(b)}))})},[m,b,c,C,D]);eo(()=>{!1===j&&z.current.isPositioned&&(z.current.isPositioned=!1,l(a=>({...a,isPositioned:!1})))},[j]);let F=u.useRef(!1);eo(()=>(F.current=!0,()=>{F.current=!1}),[]),eo(()=>{if(v&&(x.current=v),w&&(y.current=w),v&&w){if(B.current)return B.current(v,w,E);E()}},[v,w,E,B,A]);let G=u.useMemo(()=>({reference:x,floating:y,setReference:s,setFloating:t}),[s,t]),H=u.useMemo(()=>({reference:v,floating:w}),[v,w]),I=u.useMemo(()=>{let a={position:c,left:0,top:0};if(!H.floating)return a;let b=eq(H.floating,k.x),d=eq(H.floating,k.y);if(h)return{...a,transform:"translate("+b+"px, "+d+"px)",...(H.floating,false)};return{position:c,left:b,top:d}},[c,h,H.floating,k.x,k.y]);return u.useMemo(()=>({...k,update:E,refs:G,elements:H,floatingStyles:I}),[k,E,G,H,I])}({strategy:"fixed",placement:B+("center"!==D?"-"+D:""),whileElementsMounted:(...a)=>(function(a,b,c,d){let e;void 0===d&&(d={});let{ancestorScroll:f=!0,ancestorResize:g=!0,elementResize:h="function"==typeof ResizeObserver,layoutShift:i="function"==typeof IntersectionObserver,animationFrame:j=!1}=d,k=d9(a),l=f||g?[...k?d6(k):[],...d6(b)]:[];l.forEach(a=>{f&&a.addEventListener("scroll",c,{passive:!0}),g&&a.addEventListener("resize",c)});let m=k&&i?function(a,b){let c,d=null,e=dR(a);function f(){var a;clearTimeout(c),null==(a=d)||a.disconnect(),d=null}return!function g(h,i){void 0===h&&(h=!1),void 0===i&&(i=1),f();let j=a.getBoundingClientRect(),{left:k,top:l,width:m,height:n}=j;if(h||b(),!m||!n)return;let o={rootMargin:-dp(l)+"px "+-dp(e.clientWidth-(k+m))+"px "+-dp(e.clientHeight-(l+n))+"px "+-dp(k)+"px",threshold:dm(0,dl(1,i))||1},p=!0;function q(b){let d=b[0].intersectionRatio;if(d!==i){if(!p)return g();d?g(!1,d):c=setTimeout(()=>{g(!1,1e-7)},1e3)}1!==d||em(j,a.getBoundingClientRect())||g(),p=!1}try{d=new IntersectionObserver(q,{...o,root:e.ownerDocument})}catch(a){d=new IntersectionObserver(q,o)}d.observe(a)}(!0),f}(k,c):null,n=-1,o=null;h&&(o=new ResizeObserver(a=>{let[d]=a;d&&d.target===k&&o&&(o.unobserve(b),cancelAnimationFrame(n),n=requestAnimationFrame(()=>{var a;null==(a=o)||a.observe(b)})),c()}),k&&!j&&o.observe(k),o.observe(b));let p=j?ed(a):null;return j&&function b(){let d=ed(a);p&&!em(p,d)&&c(),p=d,e=requestAnimationFrame(b)}(),c(),()=>{var a;l.forEach(a=>{f&&a.removeEventListener("scroll",c),g&&a.removeEventListener("resize",c)}),null==m||m(),null==(a=o)||a.disconnect(),o=null,j&&cancelAnimationFrame(e)}})(...a,{animationFrame:"always"===L}),elements:{reference:O.anchor},middleware:[{...{name:"offset",options:e=c={mainAxis:C+W,alignmentAxis:E},async fn(a){var b,c;let{x:d,y:f,placement:g,middlewareData:h}=a,i=await dO(a,e);return g===(null==(b=h.offset)?void 0:b.placement)&&null!=(c=h.arrow)&&c.alignmentOffset?{}:{x:d+i.x,y:f+i.y,data:{...i,placement:g}}}},options:[c,d]},G&&{...{name:"shift",options:k=i={mainAxis:!0,crossAxis:!1,limiter:"partial"===J?{...(void 0===(h=f)&&(h={}),{options:h,fn(a){let{x:b,y:c,placement:d,rects:e,middlewareData:f}=a,{offset:g=0,mainAxis:i=!0,crossAxis:j=!0}=dt(h,a),k={x:b,y:c},l=dz(d),m=dw(l),n=k[m],o=k[l],p=dt(g,a),q="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(i){let a="y"===m?"height":"width",b=e.reference[m]-e.floating[a]+q.mainAxis,c=e.reference[m]+e.reference[a]-q.mainAxis;n<b?n=b:n>c&&(n=c)}if(j){var r,s;let a="y"===m?"width":"height",b=dN.has(du(d)),c=e.reference[l]-e.floating[a]+(b&&(null==(r=f.offset)?void 0:r[l])||0)+(b?0:q.crossAxis),g=e.reference[l]+e.reference[a]+(b?0:(null==(s=f.offset)?void 0:s[l])||0)-(b?q.crossAxis:0);o<c?o=c:o>g&&(o=g)}return{[m]:n,[l]:o}}}),options:[f,g]}:void 0,...$},async fn(a){let{x:b,y:c,placement:d}=a,{mainAxis:e=!0,crossAxis:f=!1,limiter:g={fn:a=>{let{x:b,y:c}=a;return{x:b,y:c}}},...h}=dt(k,a),i={x:b,y:c},j=await dK(a,h),l=dz(du(d)),m=dw(l),n=i[m],o=i[l];if(e){let a="y"===m?"top":"left",b="y"===m?"bottom":"right",c=n+j[a],d=n-j[b];n=dm(c,dl(n,d))}if(f){let a="y"===l?"top":"left",b="y"===l?"bottom":"right",c=o+j[a],d=o-j[b];o=dm(c,dl(o,d))}let p=g.fn({...a,[m]:n,[l]:o});return{...p,data:{x:p.x-b,y:p.y-c,enabled:{[m]:e,[l]:f}}}}},options:[i,j]},G&&{...{name:"flip",options:n=l={...$},async fn(a){var b,c,d,e,f,g,h,i;let j,k,l,{placement:m,middlewareData:o,rects:p,initialPlacement:q,platform:r,elements:s}=a,{mainAxis:t=!0,crossAxis:u=!0,fallbackPlacements:v,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...z}=dt(n,a);if(null!=(b=o.arrow)&&b.alignmentOffset)return{};let A=du(m),B=dz(q),C=du(q)===q,D=await (null==r.isRTL?void 0:r.isRTL(s.floating)),E=v||(C||!y?[dF(q)]:(j=dF(q),[dA(q),j,dA(j)])),F="none"!==x;!v&&F&&E.push(...(k=dv(q),l=function(a,b,c){switch(a){case"top":case"bottom":if(c)return b?dC:dB;return b?dB:dC;case"left":case"right":return b?dD:dE;default:return[]}}(du(q),"start"===x,D),k&&(l=l.map(a=>a+"-"+k),y&&(l=l.concat(l.map(dA)))),l));let G=[q,...E],H=await dK(a,z),I=[],J=(null==(c=o.flip)?void 0:c.overflows)||[];if(t&&I.push(H[A]),u){let a,b,c,d,e=(g=m,h=p,void 0===(i=D)&&(i=!1),a=dv(g),c=dx(b=dw(dz(g))),d="x"===b?a===(i?"end":"start")?"right":"left":"start"===a?"bottom":"top",h.reference[c]>h.floating[c]&&(d=dF(d)),[d,dF(d)]);I.push(H[e[0]],H[e[1]])}if(J=[...J,{placement:m,overflows:I}],!I.every(a=>a<=0)){let a=((null==(d=o.flip)?void 0:d.index)||0)+1,b=G[a];if(b&&("alignment"!==u||B===dz(b)||J.every(a=>dz(a.placement)!==B||a.overflows[0]>0)))return{data:{index:a,overflows:J},reset:{placement:b}};let c=null==(e=J.filter(a=>a.overflows[0]<=0).sort((a,b)=>a.overflows[1]-b.overflows[1])[0])?void 0:e.placement;if(!c)switch(w){case"bestFit":{let a=null==(f=J.filter(a=>{if(F){let b=dz(a.placement);return b===B||"y"===b}return!0}).map(a=>[a.placement,a.overflows.filter(a=>a>0).reduce((a,b)=>a+b,0)]).sort((a,b)=>a[1]-b[1])[0])?void 0:f[0];a&&(c=a);break}case"initialPlacement":c=q}if(m!==c)return{reset:{placement:c}}}return{}}},options:[l,m]},{...{name:"size",options:q=o={...$,apply:({elements:a,rects:b,availableWidth:c,availableHeight:d})=>{let{width:e,height:f}=b.reference,g=a.floating.style;g.setProperty("--radix-popper-available-width",`${c}px`),g.setProperty("--radix-popper-available-height",`${d}px`),g.setProperty("--radix-popper-anchor-width",`${e}px`),g.setProperty("--radix-popper-anchor-height",`${f}px`)}},async fn(a){var b,c;let d,e,{placement:f,rects:g,platform:h,elements:i}=a,{apply:j=()=>{},...k}=dt(q,a),l=await dK(a,k),m=du(f),n=dv(f),o="y"===dz(f),{width:p,height:r}=g.floating;"top"===m||"bottom"===m?(d=m,e=n===(await (null==h.isRTL?void 0:h.isRTL(i.floating))?"start":"end")?"left":"right"):(e=m,d="end"===n?"top":"bottom");let s=r-l.top-l.bottom,t=p-l.left-l.right,u=dl(r-l[d],s),v=dl(p-l[e],t),w=!a.middlewareData.shift,x=u,y=v;if(null!=(b=a.middlewareData.shift)&&b.enabled.x&&(y=t),null!=(c=a.middlewareData.shift)&&c.enabled.y&&(x=s),w&&!n){let a=dm(l.left,0),b=dm(l.right,0),c=dm(l.top,0),d=dm(l.bottom,0);o?y=p-2*(0!==a||0!==b?a+b:dm(l.left,l.right)):x=r-2*(0!==c||0!==d?c+d:dm(l.top,l.bottom))}await j({...a,availableWidth:y,availableHeight:x});let z=await h.getDimensions(i.floating);return p!==z.width||r!==z.height?{reset:{rects:!0}}:{}}},options:[o,p]},S&&{...{name:"arrow",options:v=r={element:S,padding:F},fn(a){let{element:b,padding:c}="function"==typeof v?v(a):v;return b&&({}).hasOwnProperty.call(b,"current")?null!=b.current?en({element:b.current,padding:c}).fn(a):{}:b?en({element:b,padding:c}).fn(a):{}}},options:[r,s]},eK({arrowWidth:V,arrowHeight:W}),K&&{...{name:"hide",options:y=w={strategy:"referenceHidden",...$},async fn(a){let{rects:b}=a,{strategy:c="referenceHidden",...d}=dt(y,a);switch(c){case"referenceHidden":{let c=dL(await dK(a,{...d,elementContext:"reference"}),b.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:dM(c)}}}case"escaped":{let c=dL(await dK(a,{...d,altBoundary:!0}),b.floating);return{data:{escapedOffsets:c,escaped:dM(c)}}}default:return{}}}},options:[w,x]}]}),[ae,af]=eL(ab),ag=bb(M);a0(()=>{ac&&ag?.()},[ac,ag]);let ah=ad.arrow?.x,ai=ad.arrow?.y,aj=ad.arrow?.centerOffset!==0,[ak,al]=u.useState();return a0(()=>{P&&al(window.getComputedStyle(P).zIndex)},[P]),(0,t.jsx)("div",{ref:_.setFloating,"data-radix-popper-content-wrapper":"",style:{...aa,transform:ac?aa.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ak,"--radix-popper-transform-origin":[ad.transformOrigin?.x,ad.transformOrigin?.y].join(" "),...ad.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:(0,t.jsx)(eD,{scope:z,placedSide:ae,onArrowChange:T,arrowX:ah,arrowY:ai,shouldHideArrow:aj,children:(0,t.jsx)(a9.div,{"data-side":ae,"data-align":af,...N,ref:R,style:{...N.style,animation:ac?void 0:"none"}})})})});eF.displayName=eC;var eG="PopperArrow",eH={top:"bottom",right:"left",bottom:"top",left:"right"},eI=u.forwardRef(function(a,b){let{__scopePopper:c,...d}=a,e=eE(eG,c),f=eH[e.placedSide];return(0,t.jsx)("span",{ref:e.onArrowChange,style:{position:"absolute",left:e.arrowX,top:e.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[e.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[e.placedSide],visibility:e.shouldHideArrow?"hidden":void 0},children:(0,t.jsx)(es,{...d,ref:b,style:{...d.style,display:"block"}})})});function eJ(a){return null!==a}eI.displayName=eG;var eK=a=>({name:"transformOrigin",options:a,fn(b){let{placement:c,rects:d,middlewareData:e}=b,f=e.arrow?.centerOffset!==0,g=f?0:a.arrowWidth,h=f?0:a.arrowHeight,[i,j]=eL(c),k={start:"0%",center:"50%",end:"100%"}[j],l=(e.arrow?.x??0)+g/2,m=(e.arrow?.y??0)+h/2,n="",o="";return"bottom"===i?(n=f?k:`${l}px`,o=`${-h}px`):"top"===i?(n=f?k:`${l}px`,o=`${d.floating.height+h}px`):"right"===i?(n=`${-h}px`,o=f?k:`${m}px`):"left"===i&&(n=`${d.floating.width+h}px`,o=f?k:`${m}px`),{data:{x:n,y:o}}}});function eL(a){let[b,c="center"]=a.split("-");return[b,c]}a.s(["Anchor",()=>eB,"Arrow",()=>eI,"Content",()=>eF,"Root",()=>ez,"createPopperScope",()=>ew],4691);var eM=Symbol("radix.slottable");function eN(a){return u.isValidElement(a)&&"function"==typeof a.type&&"__radixId"in a.type&&a.type.__radixId===eM}var eO="Popover",[eP,eQ]=a_(eO,[ew]),eR=ew(),[eS,eT]=eP(eO),eU=a=>{let{__scopePopover:b,children:c,open:d,defaultOpen:e,onOpenChange:f,modal:g=!1}=a,h=eR(b),i=u.useRef(null),[j,k]=u.useState(!1),[l,m]=a5({prop:d,defaultProp:e??!1,onChange:f,caller:eO});return(0,t.jsx)(ez,{...h,children:(0,t.jsx)(eS,{scope:b,contentId:a3(),triggerRef:i,open:l,onOpenChange:m,onOpenToggle:u.useCallback(()=>m(a=>!a),[m]),hasCustomAnchor:j,onCustomAnchorAdd:u.useCallback(()=>k(!0),[]),onCustomAnchorRemove:u.useCallback(()=>k(!1),[]),modal:g,children:c})})};eU.displayName=eO;var eV="PopoverAnchor";u.forwardRef((a,b)=>{let{__scopePopover:c,...d}=a,e=eT(eV,c),f=eR(c),{onCustomAnchorAdd:g,onCustomAnchorRemove:h}=e;return u.useEffect(()=>(g(),()=>h()),[g,h]),(0,t.jsx)(eB,{...f,...d,ref:b})}).displayName=eV;var eW="PopoverTrigger",eX=u.forwardRef((a,b)=>{let{__scopePopover:c,...d}=a,e=eT(eW,c),f=eR(c),g=A(b,e.triggerRef),h=(0,t.jsx)(a9.button,{type:"button","aria-haspopup":"dialog","aria-expanded":e.open,"aria-controls":e.contentId,"data-state":e7(e.open),...d,ref:g,onClick:aZ(a.onClick,e.onOpenToggle)});return e.hasCustomAnchor?h:(0,t.jsx)(eB,{asChild:!0,...f,children:h})});eX.displayName=eW;var eY="PopoverPortal",[eZ,e$]=eP(eY,{forceMount:void 0}),e_=a=>{let{__scopePopover:b,forceMount:c,children:d,container:e}=a,f=eT(eY,b);return(0,t.jsx)(eZ,{scope:b,forceMount:c,children:(0,t.jsx)(br,{present:c||f.open,children:(0,t.jsx)(bq,{asChild:!0,container:e,children:d})})})};e_.displayName=eY;var e0="PopoverContent",e1=u.forwardRef((a,b)=>{let c=e$(e0,a.__scopePopover),{forceMount:d=c.forceMount,...e}=a,f=eT(e0,a.__scopePopover);return(0,t.jsx)(br,{present:d||f.open,children:f.modal?(0,t.jsx)(e3,{...e,ref:b}):(0,t.jsx)(e4,{...e,ref:b})})});e1.displayName=e0;var e2=((j=u.forwardRef((a,b)=>{let{children:c,...d}=a;if(u.isValidElement(c)){var e;let a,f,g=(e=c,(f=(a=Object.getOwnPropertyDescriptor(e.props,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.ref:(f=(a=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.props.ref:e.props.ref||e.ref),h=function(a,b){let c={...b};for(let d in b){let e=a[d],f=b[d];/^on[A-Z]/.test(d)?e&&f?c[d]=(...a)=>{let b=f(...a);return e(...a),b}:e&&(c[d]=e):"style"===d?c[d]={...e,...f}:"className"===d&&(c[d]=[e,f].filter(Boolean).join(" "))}return{...a,...c}}(d,c.props);return c.type!==u.Fragment&&(h.ref=b?z(b,g):g),u.cloneElement(c,h)}return u.Children.count(c)>1?u.Children.only(null):null})).displayName="PopoverContent.RemoveScroll.SlotClone",d=j,(e=u.forwardRef((a,b)=>{let{children:c,...e}=a,f=u.Children.toArray(c),g=f.find(eN);if(g){let a=g.props.children,c=f.map(b=>b!==g?b:u.Children.count(a)>1?u.Children.only(null):u.isValidElement(a)?a.props.children:null);return(0,t.jsx)(d,{...e,ref:b,children:u.isValidElement(a)?u.cloneElement(a,void 0,c):null})}return(0,t.jsx)(d,{...e,ref:b,children:c})})).displayName="PopoverContent.RemoveScroll.Slot",e),e3=u.forwardRef((a,b)=>{let c=eT(e0,a.__scopePopover),d=u.useRef(null),e=A(b,d),f=u.useRef(!1);return u.useEffect(()=>{let a=d.current;if(a)return b7(a)},[]),(0,t.jsx)(b0,{as:e2,allowPinchZoom:!0,children:(0,t.jsx)(e5,{...a,ref:e,trapFocus:c.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:aZ(a.onCloseAutoFocus,a=>{a.preventDefault(),f.current||c.triggerRef.current?.focus()}),onPointerDownOutside:aZ(a.onPointerDownOutside,a=>{let b=a.detail.originalEvent,c=0===b.button&&!0===b.ctrlKey;f.current=2===b.button||c},{checkForDefaultPrevented:!1}),onFocusOutside:aZ(a.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),e4=u.forwardRef((a,b)=>{let c=eT(e0,a.__scopePopover),d=u.useRef(!1),e=u.useRef(!1);return(0,t.jsx)(e5,{...a,ref:b,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:b=>{a.onCloseAutoFocus?.(b),b.defaultPrevented||(d.current||c.triggerRef.current?.focus(),b.preventDefault()),d.current=!1,e.current=!1},onInteractOutside:b=>{a.onInteractOutside?.(b),b.defaultPrevented||(d.current=!0,"pointerdown"===b.detail.originalEvent.type&&(e.current=!0));let f=b.target;c.triggerRef.current?.contains(f)&&b.preventDefault(),"focusin"===b.detail.originalEvent.type&&e.current&&b.preventDefault()}})}),e5=u.forwardRef((a,b)=>{let{__scopePopover:c,trapFocus:d,onOpenAutoFocus:e,onCloseAutoFocus:f,disableOutsidePointerEvents:g,onEscapeKeyDown:h,onPointerDownOutside:i,onFocusOutside:j,onInteractOutside:k,...l}=a,m=eT(e0,c),n=eR(c);return bu(),(0,t.jsx)(bk,{asChild:!0,loop:!0,trapped:d,onMountAutoFocus:e,onUnmountAutoFocus:f,children:(0,t.jsx)(be,{asChild:!0,disableOutsidePointerEvents:g,onInteractOutside:k,onEscapeKeyDown:h,onPointerDownOutside:i,onFocusOutside:j,onDismiss:()=>m.onOpenChange(!1),children:(0,t.jsx)(eF,{"data-state":e7(m.open),role:"dialog",id:m.contentId,...n,...l,ref:b,style:{...l.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),e6="PopoverClose";function e7(a){return a?"open":"closed"}u.forwardRef((a,b)=>{let{__scopePopover:c,...d}=a,e=eT(e6,c);return(0,t.jsx)(a9.button,{type:"button",...d,ref:b,onClick:aZ(a.onClick,()=>e.onOpenChange(!1))})}).displayName=e6,u.forwardRef((a,b)=>{let{__scopePopover:c,...d}=a,e=eR(c);return(0,t.jsx)(eI,{...e,...d,ref:b})}).displayName="PopoverArrow";let e8=u.forwardRef(({className:a,align:b="center",sideOffset:c=4,...d},e)=>(0,t.jsx)(e_,{children:(0,t.jsx)(e1,{ref:e,align:b,sideOffset:c,className:aR("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",a),...d})}));e8.displayName=e1.displayName;let e9=u.forwardRef(({className:a,type:b,...c},d)=>(0,t.jsx)("input",{type:b,className:aR("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",a),ref:d,...c}));e9.displayName="Input",a.s(["Input",()=>e9],22027);let fa=(0,c5.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);a.s(["Check",()=>fa],33441);let fb=(0,c5.default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),fc=(0,c5.default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);a.s(["Plus",()=>fc],15618);let fd=(0,c5.default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);a.s(["FileText",()=>fd],4720);let fe=(0,c5.default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]),ff=(0,c5.default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),fg=(0,c5.default)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),fh=(0,c5.default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]),fi=(0,c5.default)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),fj=(0,c5.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);a.s(["ChevronDown",()=>fj],5784);let fk=(0,c5.default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);a.s(["ChevronRight",()=>fk],50522);var fl=a.i(5500),fm=a.i(31186);let fn=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)("textarea",{className:aR("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",a),ref:c,...b}));function fo(a){let b=u.useRef({value:a,previous:a});return u.useMemo(()=>(b.current.value!==a&&(b.current.previous=b.current.value,b.current.value=a),b.current.previous),[a])}fn.displayName="Textarea",a.s(["Textarea",()=>fn],6219),a.s(["usePrevious",()=>fo],56558);var fp="Checkbox",[fq,fr]=a_(fp),[fs,ft]=fq(fp);function fu(a){let{__scopeCheckbox:b,checked:c,children:d,defaultChecked:e,disabled:f,form:g,name:h,onCheckedChange:i,required:j,value:k="on",internal_do_not_use_render:l}=a,[m,n]=a5({prop:c,defaultProp:e??!1,onChange:i,caller:fp}),[o,p]=u.useState(null),[q,r]=u.useState(null),s=u.useRef(!1),v=!o||!!g||!!o.closest("form"),w={checked:m,disabled:f,setChecked:n,control:o,setControl:p,name:h,form:g,value:k,hasConsumerStoppedPropagationRef:s,required:j,defaultChecked:!fC(e)&&e,isFormControl:v,bubbleInput:q,setBubbleInput:r};return(0,t.jsx)(fs,{scope:b,...w,children:"function"==typeof l?l(w):d})}var fv="CheckboxTrigger",fw=u.forwardRef(({__scopeCheckbox:a,onKeyDown:b,onClick:c,...d},e)=>{let{control:f,value:g,disabled:h,checked:i,required:j,setControl:k,setChecked:l,hasConsumerStoppedPropagationRef:m,isFormControl:n,bubbleInput:o}=ft(fv,a),p=A(e,k),q=u.useRef(i);return u.useEffect(()=>{let a=f?.form;if(a){let b=()=>l(q.current);return a.addEventListener("reset",b),()=>a.removeEventListener("reset",b)}},[f,l]),(0,t.jsx)(a9.button,{type:"button",role:"checkbox","aria-checked":fC(i)?"mixed":i,"aria-required":j,"data-state":fD(i),"data-disabled":h?"":void 0,disabled:h,value:g,...d,ref:p,onKeyDown:aZ(b,a=>{"Enter"===a.key&&a.preventDefault()}),onClick:aZ(c,a=>{l(a=>!!fC(a)||!a),o&&n&&(m.current=a.isPropagationStopped(),m.current||a.stopPropagation())})})});fw.displayName=fv;var fx=u.forwardRef((a,b)=>{let{__scopeCheckbox:c,name:d,checked:e,defaultChecked:f,required:g,disabled:h,value:i,onCheckedChange:j,form:k,...l}=a;return(0,t.jsx)(fu,{__scopeCheckbox:c,checked:e,defaultChecked:f,disabled:h,required:g,onCheckedChange:j,name:d,form:k,value:i,internal_do_not_use_render:({isFormControl:a})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(fw,{...l,ref:b,__scopeCheckbox:c}),a&&(0,t.jsx)(fB,{__scopeCheckbox:c})]})})});fx.displayName=fp;var fy="CheckboxIndicator",fz=u.forwardRef((a,b)=>{let{__scopeCheckbox:c,forceMount:d,...e}=a,f=ft(fy,c);return(0,t.jsx)(br,{present:d||fC(f.checked)||!0===f.checked,children:(0,t.jsx)(a9.span,{"data-state":fD(f.checked),"data-disabled":f.disabled?"":void 0,...e,ref:b,style:{pointerEvents:"none",...a.style}})})});fz.displayName=fy;var fA="CheckboxBubbleInput",fB=u.forwardRef(({__scopeCheckbox:a,...b},c)=>{let{control:d,hasConsumerStoppedPropagationRef:e,checked:f,defaultChecked:g,required:h,disabled:i,name:j,value:k,form:l,bubbleInput:m,setBubbleInput:n}=ft(fA,a),o=A(c,n),p=fo(f),q=et(d);u.useEffect(()=>{if(!m)return;let a=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,b=!e.current;if(p!==f&&a){let c=new Event("click",{bubbles:b});m.indeterminate=fC(f),a.call(m,!fC(f)&&f),m.dispatchEvent(c)}},[m,p,f,e]);let r=u.useRef(!fC(f)&&f);return(0,t.jsx)(a9.input,{type:"checkbox","aria-hidden":!0,defaultChecked:g??r.current,required:h,disabled:i,name:j,value:k,form:l,...b,tabIndex:-1,ref:o,style:{...b.style,...q,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function fC(a){return"indeterminate"===a}function fD(a){return fC(a)?"indeterminate":a?"checked":"unchecked"}fB.displayName=fA;let fE=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(fx,{ref:c,className:aR("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",a),...b,children:(0,t.jsx)(fz,{className:aR("grid place-content-center text-current"),children:(0,t.jsx)(fa,{className:"h-4 w-4"})})}));function fF(a){var b;let c,d=(b=a,(c=u.forwardRef((a,b)=>{let{children:c,...d}=a;if(u.isValidElement(c)){var e;let a,f,g=(e=c,(f=(a=Object.getOwnPropertyDescriptor(e.props,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.ref:(f=(a=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.props.ref:e.props.ref||e.ref),h=function(a,b){let c={...b};for(let d in b){let e=a[d],f=b[d];/^on[A-Z]/.test(d)?e&&f?c[d]=(...a)=>{let b=f(...a);return e(...a),b}:e&&(c[d]=e):"style"===d?c[d]={...e,...f}:"className"===d&&(c[d]=[e,f].filter(Boolean).join(" "))}return{...a,...c}}(d,c.props);return c.type!==u.Fragment&&(h.ref=b?z(b,g):g),u.cloneElement(c,h)}return u.Children.count(c)>1?u.Children.only(null):null})).displayName=`${b}.SlotClone`,c),e=u.forwardRef((a,b)=>{let{children:c,...e}=a,f=u.Children.toArray(c),g=f.find(fH);if(g){let a=g.props.children,c=f.map(b=>b!==g?b:u.Children.count(a)>1?u.Children.only(null):u.isValidElement(a)?a.props.children:null);return(0,t.jsx)(d,{...e,ref:b,children:u.isValidElement(a)?u.cloneElement(a,void 0,c):null})}return(0,t.jsx)(d,{...e,ref:b,children:c})});return e.displayName=`${a}.Slot`,e}fE.displayName=fx.displayName,a.s(["Checkbox",()=>fE],4212);var fG=Symbol("radix.slottable");function fH(a){return u.isValidElement(a)&&"function"==typeof a.type&&"__radixId"in a.type&&a.type.__radixId===fG}function fI(a){let b=a+"CollectionProvider",[c,d]=a_(b),[e,f]=c(b,{collectionRef:{current:null},itemMap:new Map}),g=a=>{let{scope:b,children:c}=a,d=u.default.useRef(null),f=u.default.useRef(new Map).current;return(0,t.jsx)(e,{scope:b,itemMap:f,collectionRef:d,children:c})};g.displayName=b;let h=a+"CollectionSlot",i=fF(h),j=u.default.forwardRef((a,b)=>{let{scope:c,children:d}=a,e=A(b,f(h,c).collectionRef);return(0,t.jsx)(i,{ref:e,children:d})});j.displayName=h;let k=a+"CollectionItemSlot",l="data-radix-collection-item",m=fF(k),n=u.default.forwardRef((a,b)=>{let{scope:c,children:d,...e}=a,g=u.default.useRef(null),h=A(b,g),i=f(k,c);return u.default.useEffect(()=>(i.itemMap.set(g,{ref:g,...e}),()=>void i.itemMap.delete(g))),(0,t.jsx)(m,{...{[l]:""},ref:h,children:d})});return n.displayName=k,[{Provider:g,Slot:j,ItemSlot:n},function(b){let c=f(a+"CollectionConsumer",b);return u.default.useCallback(()=>{let a=c.collectionRef.current;if(!a)return[];let b=Array.from(a.querySelectorAll(`[${l}]`));return Array.from(c.itemMap.values()).sort((a,c)=>b.indexOf(a.ref.current)-b.indexOf(c.ref.current))},[c.collectionRef,c.itemMap])},d]}var fJ=new WeakMap;function fK(a,b){var c,d;let e,f,g;if("at"in Array.prototype)return Array.prototype.at.call(a,b);let h=(c=a,d=b,e=c.length,(g=(f=fL(d))>=0?f:e+f)<0||g>=e?-1:g);return -1===h?void 0:a[h]}function fL(a){return a!=a||0===a?0:Math.trunc(a)}(class a extends Map{#a;constructor(a){super(a),this.#a=[...super.keys()],fJ.set(this,!0)}set(a,b){return fJ.get(this)&&(this.has(a)?this.#a[this.#a.indexOf(a)]=a:this.#a.push(a)),super.set(a,b),this}insert(a,b,c){let d,e=this.has(b),f=this.#a.length,g=fL(a),h=g>=0?g:f+g,i=h<0||h>=f?-1:h;if(i===this.size||e&&i===this.size-1||-1===i)return this.set(b,c),this;let j=this.size+ +!e;g<0&&h++;let k=[...this.#a],l=!1;for(let a=h;a<j;a++)if(h===a){let f=k[a];k[a]===b&&(f=k[a+1]),e&&this.delete(b),d=this.get(f),this.set(b,c)}else{l||k[a-1]!==b||(l=!0);let c=k[l?a:a-1],e=d;d=this.get(c),this.delete(c),this.set(c,e)}return this}with(b,c,d){let e=new a(this);return e.insert(b,c,d),e}before(a){let b=this.#a.indexOf(a)-1;if(!(b<0))return this.entryAt(b)}setBefore(a,b,c){let d=this.#a.indexOf(a);return -1===d?this:this.insert(d,b,c)}after(a){let b=this.#a.indexOf(a);if(-1!==(b=-1===b||b===this.size-1?-1:b+1))return this.entryAt(b)}setAfter(a,b,c){let d=this.#a.indexOf(a);return -1===d?this:this.insert(d+1,b,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#a=[],super.clear()}delete(a){let b=super.delete(a);return b&&this.#a.splice(this.#a.indexOf(a),1),b}deleteAt(a){let b=this.keyAt(a);return void 0!==b&&this.delete(b)}at(a){let b=fK(this.#a,a);if(void 0!==b)return this.get(b)}entryAt(a){let b=fK(this.#a,a);if(void 0!==b)return[b,this.get(b)]}indexOf(a){return this.#a.indexOf(a)}keyAt(a){return fK(this.#a,a)}from(a,b){let c=this.indexOf(a);if(-1===c)return;let d=c+b;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.at(d)}keyFrom(a,b){let c=this.indexOf(a);if(-1===c)return;let d=c+b;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.keyAt(d)}find(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return d;c++}}findIndex(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return c;c++}return -1}filter(b,c){let d=[],e=0;for(let a of this)Reflect.apply(b,c,[a,e,this])&&d.push(a),e++;return new a(d)}map(b,c){let d=[],e=0;for(let a of this)d.push([a[0],Reflect.apply(b,c,[a,e,this])]),e++;return new a(d)}reduce(...a){let[b,c]=a,d=0,e=c??this.at(0);for(let c of this)e=0===d&&1===a.length?c:Reflect.apply(b,this,[e,c,d,this]),d++;return e}reduceRight(...a){let[b,c]=a,d=c??this.at(-1);for(let c=this.size-1;c>=0;c--){let e=this.at(c);d=c===this.size-1&&1===a.length?e:Reflect.apply(b,this,[d,e,c,this])}return d}toSorted(b){return new a([...this.entries()].sort(b))}toReversed(){let b=new a;for(let a=this.size-1;a>=0;a--){let c=this.keyAt(a),d=this.get(c);b.set(c,d)}return b}toSpliced(...b){let c=[...this.entries()];return c.splice(...b),new a(c)}slice(b,c){let d=new a,e=this.size-1;if(void 0===b)return d;b<0&&(b+=this.size),void 0!==c&&c>0&&(e=c-1);for(let a=b;a<=e;a++){let b=this.keyAt(a),c=this.get(b);d.set(b,c)}return d}every(a,b){let c=0;for(let d of this){if(!Reflect.apply(a,b,[d,c,this]))return!1;c++}return!0}some(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return!0;c++}return!1}}),a.s(["createCollection",()=>fI],37738);var fM=u.createContext(void 0);function fN(a){let b=u.useContext(fM);return a||b||"ltr"}a.s(["useDirection",()=>fN],7827);var fO="rovingFocusGroup.onEntryFocus",fP={bubbles:!1,cancelable:!0},fQ="RovingFocusGroup",[fR,fS,fT]=fI(fQ),[fU,fV]=a_(fQ,[fT]),[fW,fX]=fU(fQ),fY=u.forwardRef((a,b)=>(0,t.jsx)(fR.Provider,{scope:a.__scopeRovingFocusGroup,children:(0,t.jsx)(fR.Slot,{scope:a.__scopeRovingFocusGroup,children:(0,t.jsx)(fZ,{...a,ref:b})})}));fY.displayName=fQ;var fZ=u.forwardRef((a,b)=>{let{__scopeRovingFocusGroup:c,orientation:d,loop:e=!1,dir:f,currentTabStopId:g,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:i,onEntryFocus:j,preventScrollOnEntryFocus:k=!1,...l}=a,m=u.useRef(null),n=A(b,m),o=fN(f),[p,q]=a5({prop:g,defaultProp:h??null,onChange:i,caller:fQ}),[r,s]=u.useState(!1),v=bb(j),w=fS(c),x=u.useRef(!1),[y,z]=u.useState(0);return u.useEffect(()=>{let a=m.current;if(a)return a.addEventListener(fO,v),()=>a.removeEventListener(fO,v)},[v]),(0,t.jsx)(fW,{scope:c,orientation:d,dir:o,loop:e,currentTabStopId:p,onItemFocus:u.useCallback(a=>q(a),[q]),onItemShiftTab:u.useCallback(()=>s(!0),[]),onFocusableItemAdd:u.useCallback(()=>z(a=>a+1),[]),onFocusableItemRemove:u.useCallback(()=>z(a=>a-1),[]),children:(0,t.jsx)(a9.div,{tabIndex:r||0===y?-1:0,"data-orientation":d,...l,ref:n,style:{outline:"none",...a.style},onMouseDown:aZ(a.onMouseDown,()=>{x.current=!0}),onFocus:aZ(a.onFocus,a=>{let b=!x.current;if(a.target===a.currentTarget&&b&&!r){let b=new CustomEvent(fO,fP);if(a.currentTarget.dispatchEvent(b),!b.defaultPrevented){let a=w().filter(a=>a.focusable);f1([a.find(a=>a.active),a.find(a=>a.id===p),...a].filter(Boolean).map(a=>a.ref.current),k)}}x.current=!1}),onBlur:aZ(a.onBlur,()=>s(!1))})})}),f$="RovingFocusGroupItem",f_=u.forwardRef((a,b)=>{let{__scopeRovingFocusGroup:c,focusable:d=!0,active:e=!1,tabStopId:f,children:g,...h}=a,i=a3(),j=f||i,k=fX(f$,c),l=k.currentTabStopId===j,m=fS(c),{onFocusableItemAdd:n,onFocusableItemRemove:o,currentTabStopId:p}=k;return u.useEffect(()=>{if(d)return n(),()=>o()},[d,n,o]),(0,t.jsx)(fR.ItemSlot,{scope:c,id:j,focusable:d,active:e,children:(0,t.jsx)(a9.span,{tabIndex:l?0:-1,"data-orientation":k.orientation,...h,ref:b,onMouseDown:aZ(a.onMouseDown,a=>{d?k.onItemFocus(j):a.preventDefault()}),onFocus:aZ(a.onFocus,()=>k.onItemFocus(j)),onKeyDown:aZ(a.onKeyDown,a=>{if("Tab"===a.key&&a.shiftKey)return void k.onItemShiftTab();if(a.target!==a.currentTarget)return;let b=function(a,b,c){var d;let e=(d=a.key,"rtl"!==c?d:"ArrowLeft"===d?"ArrowRight":"ArrowRight"===d?"ArrowLeft":d);if(!("vertical"===b&&["ArrowLeft","ArrowRight"].includes(e))&&!("horizontal"===b&&["ArrowUp","ArrowDown"].includes(e)))return f0[e]}(a,k.orientation,k.dir);if(void 0!==b){if(a.metaKey||a.ctrlKey||a.altKey||a.shiftKey)return;a.preventDefault();let e=m().filter(a=>a.focusable).map(a=>a.ref.current);if("last"===b)e.reverse();else if("prev"===b||"next"===b){var c,d;"prev"===b&&e.reverse();let f=e.indexOf(a.currentTarget);e=k.loop?(c=e,d=f+1,c.map((a,b)=>c[(d+b)%c.length])):e.slice(f+1)}setTimeout(()=>f1(e))}}),children:"function"==typeof g?g({isCurrentTabStop:l,hasTabStop:null!=p}):g})})});f_.displayName=f$;var f0={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function f1(a,b=!1){let c=document.activeElement;for(let d of a)if(d===c||(d.focus({preventScroll:b}),document.activeElement!==c))return}a.s(["Item",()=>f_,"Root",()=>fY,"createRovingFocusGroupScope",()=>fV],24050);var f2="Tabs",[f3,f4]=a_(f2,[fV]),f5=fV(),[f6,f7]=f3(f2),f8=u.forwardRef((a,b)=>{let{__scopeTabs:c,value:d,onValueChange:e,defaultValue:f,orientation:g="horizontal",dir:h,activationMode:i="automatic",...j}=a,k=fN(h),[l,m]=a5({prop:d,onChange:e,defaultProp:f??"",caller:f2});return(0,t.jsx)(f6,{scope:c,baseId:a3(),value:l,onValueChange:m,orientation:g,dir:k,activationMode:i,children:(0,t.jsx)(a9.div,{dir:k,"data-orientation":g,...j,ref:b})})});f8.displayName=f2;var f9="TabsList",ga=u.forwardRef((a,b)=>{let{__scopeTabs:c,loop:d=!0,...e}=a,f=f7(f9,c),g=f5(c);return(0,t.jsx)(fY,{asChild:!0,...g,orientation:f.orientation,dir:f.dir,loop:d,children:(0,t.jsx)(a9.div,{role:"tablist","aria-orientation":f.orientation,...e,ref:b})})});ga.displayName=f9;var gb="TabsTrigger",gc=u.forwardRef((a,b)=>{let{__scopeTabs:c,value:d,disabled:e=!1,...f}=a,g=f7(gb,c),h=f5(c),i=gf(g.baseId,d),j=gg(g.baseId,d),k=d===g.value;return(0,t.jsx)(f_,{asChild:!0,...h,focusable:!e,active:k,children:(0,t.jsx)(a9.button,{type:"button",role:"tab","aria-selected":k,"aria-controls":j,"data-state":k?"active":"inactive","data-disabled":e?"":void 0,disabled:e,id:i,...f,ref:b,onMouseDown:aZ(a.onMouseDown,a=>{e||0!==a.button||!1!==a.ctrlKey?a.preventDefault():g.onValueChange(d)}),onKeyDown:aZ(a.onKeyDown,a=>{[" ","Enter"].includes(a.key)&&g.onValueChange(d)}),onFocus:aZ(a.onFocus,()=>{let a="manual"!==g.activationMode;k||e||!a||g.onValueChange(d)})})})});gc.displayName=gb;var gd="TabsContent",ge=u.forwardRef((a,b)=>{let{__scopeTabs:c,value:d,forceMount:e,children:f,...g}=a,h=f7(gd,c),i=gf(h.baseId,d),j=gg(h.baseId,d),k=d===h.value,l=u.useRef(k);return u.useEffect(()=>{let a=requestAnimationFrame(()=>l.current=!1);return()=>cancelAnimationFrame(a)},[]),(0,t.jsx)(br,{present:e||k,children:({present:c})=>(0,t.jsx)(a9.div,{"data-state":k?"active":"inactive","data-orientation":h.orientation,role:"tabpanel","aria-labelledby":i,hidden:!c,id:j,tabIndex:0,...g,ref:b,style:{...a.style,animationDuration:l.current?"0s":void 0},children:c&&f})})});function gf(a,b){return`${a}-trigger-${b}`}function gg(a,b){return`${a}-content-${b}`}ge.displayName=gd;let gh=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(ga,{ref:c,className:aR("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",a),...b}));gh.displayName=ga.displayName;let gi=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(gc,{ref:c,className:aR("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",a),...b}));gi.displayName=gc.displayName;let gj=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(ge,{ref:c,className:aR("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a),...b}));function gk(a,[b,c]){return Math.min(c,Math.max(b,a))}gj.displayName=ge.displayName,a.s(["Tabs",()=>f8,"TabsContent",()=>gj,"TabsList",()=>gh,"TabsTrigger",()=>gi],20218),a.s(["clamp",()=>gk],30656);var gl=Symbol("radix.slottable");function gm(a){return u.isValidElement(a)&&"function"==typeof a.type&&"__radixId"in a.type&&a.type.__radixId===gl}var gn=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),go=u.forwardRef((a,b)=>(0,t.jsx)(a9.span,{...a,ref:b,style:{...gn,...a.style}}));go.displayName="VisuallyHidden",a.s(["VISUALLY_HIDDEN_STYLES",()=>gn,"VisuallyHidden",()=>go],28094);var gp=[" ","Enter","ArrowUp","ArrowDown"],gq=[" ","Enter"],gr="Select",[gs,gt,gu]=fI(gr),[gv,gw]=a_(gr,[gu,ew]),gx=ew(),[gy,gz]=gv(gr),[gA,gB]=gv(gr),gC=a=>{let{__scopeSelect:b,children:c,open:d,defaultOpen:e,onOpenChange:f,value:g,defaultValue:h,onValueChange:i,dir:j,name:k,autoComplete:l,disabled:m,required:n,form:o}=a,p=gx(b),[q,r]=u.useState(null),[s,v]=u.useState(null),[w,x]=u.useState(!1),y=fN(j),[z,A]=a5({prop:d,defaultProp:e??!1,onChange:f,caller:gr}),[B,C]=a5({prop:g,defaultProp:h,onChange:i,caller:gr}),D=u.useRef(null),E=!q||o||!!q.closest("form"),[F,G]=u.useState(new Set),H=Array.from(F).map(a=>a.props.value).join(";");return(0,t.jsx)(ez,{...p,children:(0,t.jsxs)(gy,{required:n,scope:b,trigger:q,onTriggerChange:r,valueNode:s,onValueNodeChange:v,valueNodeHasChildren:w,onValueNodeHasChildrenChange:x,contentId:a3(),value:B,onValueChange:C,open:z,onOpenChange:A,dir:y,triggerPointerDownPosRef:D,disabled:m,children:[(0,t.jsx)(gs.Provider,{scope:b,children:(0,t.jsx)(gA,{scope:a.__scopeSelect,onNativeOptionAdd:u.useCallback(a=>{G(b=>new Set(b).add(a))},[]),onNativeOptionRemove:u.useCallback(a=>{G(b=>{let c=new Set(b);return c.delete(a),c})},[]),children:c})}),E?(0,t.jsxs)(hd,{"aria-hidden":!0,required:n,tabIndex:-1,name:k,autoComplete:l,value:B,onChange:a=>C(a.target.value),disabled:m,form:o,children:[void 0===B?(0,t.jsx)("option",{value:""}):null,Array.from(F)]},H):null]})})};gC.displayName=gr;var gD="SelectTrigger",gE=u.forwardRef((a,b)=>{let{__scopeSelect:c,disabled:d=!1,...e}=a,f=gx(c),g=gz(gD,c),h=g.disabled||d,i=A(b,g.onTriggerChange),j=gt(c),k=u.useRef("touch"),[l,m,n]=hf(a=>{let b=j().filter(a=>!a.disabled),c=b.find(a=>a.value===g.value),d=hg(b,a,c);void 0!==d&&g.onValueChange(d.value)}),o=a=>{h||(g.onOpenChange(!0),n()),a&&(g.triggerPointerDownPosRef.current={x:Math.round(a.pageX),y:Math.round(a.pageY)})};return(0,t.jsx)(eB,{asChild:!0,...f,children:(0,t.jsx)(a9.button,{type:"button",role:"combobox","aria-controls":g.contentId,"aria-expanded":g.open,"aria-required":g.required,"aria-autocomplete":"none",dir:g.dir,"data-state":g.open?"open":"closed",disabled:h,"data-disabled":h?"":void 0,"data-placeholder":he(g.value)?"":void 0,...e,ref:i,onClick:aZ(e.onClick,a=>{a.currentTarget.focus(),"mouse"!==k.current&&o(a)}),onPointerDown:aZ(e.onPointerDown,a=>{k.current=a.pointerType;let b=a.target;b.hasPointerCapture(a.pointerId)&&b.releasePointerCapture(a.pointerId),0===a.button&&!1===a.ctrlKey&&"mouse"===a.pointerType&&(o(a),a.preventDefault())}),onKeyDown:aZ(e.onKeyDown,a=>{let b=""!==l.current;a.ctrlKey||a.altKey||a.metaKey||1!==a.key.length||m(a.key),(!b||" "!==a.key)&&gp.includes(a.key)&&(o(),a.preventDefault())})})})});gE.displayName=gD;var gF="SelectValue",gG=u.forwardRef((a,b)=>{let{__scopeSelect:c,className:d,style:e,children:f,placeholder:g="",...h}=a,i=gz(gF,c),{onValueNodeHasChildrenChange:j}=i,k=void 0!==f,l=A(b,i.onValueNodeChange);return a0(()=>{j(k)},[j,k]),(0,t.jsx)(a9.span,{...h,ref:l,style:{pointerEvents:"none"},children:he(i.value)?(0,t.jsx)(t.Fragment,{children:g}):f})});gG.displayName=gF;var gH=u.forwardRef((a,b)=>{let{__scopeSelect:c,children:d,...e}=a;return(0,t.jsx)(a9.span,{"aria-hidden":!0,...e,ref:b,children:d||"▼"})});gH.displayName="SelectIcon";var gI=a=>(0,t.jsx)(bq,{asChild:!0,...a});gI.displayName="SelectPortal";var gJ="SelectContent",gK=u.forwardRef((a,b)=>{let c=gz(gJ,a.__scopeSelect),[d,e]=u.useState();return(a0(()=>{e(new DocumentFragment)},[]),c.open)?(0,t.jsx)(gO,{...a,ref:b}):d?a6.createPortal((0,t.jsx)(gL,{scope:a.__scopeSelect,children:(0,t.jsx)(gs.Slot,{scope:a.__scopeSelect,children:(0,t.jsx)("div",{children:a.children})})}),d):null});gK.displayName=gJ;var[gL,gM]=gv(gJ),gN=((k=u.forwardRef((a,b)=>{let{children:c,...d}=a;if(u.isValidElement(c)){var e;let a,f,g=(e=c,(f=(a=Object.getOwnPropertyDescriptor(e.props,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.ref:(f=(a=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.props.ref:e.props.ref||e.ref),h=function(a,b){let c={...b};for(let d in b){let e=a[d],f=b[d];/^on[A-Z]/.test(d)?e&&f?c[d]=(...a)=>{let b=f(...a);return e(...a),b}:e&&(c[d]=e):"style"===d?c[d]={...e,...f}:"className"===d&&(c[d]=[e,f].filter(Boolean).join(" "))}return{...a,...c}}(d,c.props);return c.type!==u.Fragment&&(h.ref=b?z(b,g):g),u.cloneElement(c,h)}return u.Children.count(c)>1?u.Children.only(null):null})).displayName="SelectContent.RemoveScroll.SlotClone",f=k,(g=u.forwardRef((a,b)=>{let{children:c,...d}=a,e=u.Children.toArray(c),g=e.find(gm);if(g){let a=g.props.children,c=e.map(b=>b!==g?b:u.Children.count(a)>1?u.Children.only(null):u.isValidElement(a)?a.props.children:null);return(0,t.jsx)(f,{...d,ref:b,children:u.isValidElement(a)?u.cloneElement(a,void 0,c):null})}return(0,t.jsx)(f,{...d,ref:b,children:c})})).displayName="SelectContent.RemoveScroll.Slot",g),gO=u.forwardRef((a,b)=>{let{__scopeSelect:c,position:d="item-aligned",onCloseAutoFocus:e,onEscapeKeyDown:f,onPointerDownOutside:g,side:h,sideOffset:i,align:j,alignOffset:k,arrowPadding:l,collisionBoundary:m,collisionPadding:n,sticky:o,hideWhenDetached:p,avoidCollisions:q,...r}=a,s=gz(gJ,c),[v,w]=u.useState(null),[x,y]=u.useState(null),z=A(b,a=>w(a)),[B,C]=u.useState(null),[D,E]=u.useState(null),F=gt(c),[G,H]=u.useState(!1),I=u.useRef(!1);u.useEffect(()=>{if(v)return b7(v)},[v]),bu();let J=u.useCallback(a=>{let[b,...c]=F().map(a=>a.ref.current),[d]=c.slice(-1),e=document.activeElement;for(let c of a)if(c===e||(c?.scrollIntoView({block:"nearest"}),c===b&&x&&(x.scrollTop=0),c===d&&x&&(x.scrollTop=x.scrollHeight),c?.focus(),document.activeElement!==e))return},[F,x]),K=u.useCallback(()=>J([B,v]),[J,B,v]);u.useEffect(()=>{G&&K()},[G,K]);let{onOpenChange:L,triggerPointerDownPosRef:M}=s;u.useEffect(()=>{if(v){let a={x:0,y:0},b=b=>{a={x:Math.abs(Math.round(b.pageX)-(M.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(M.current?.y??0))}},c=c=>{a.x<=10&&a.y<=10?c.preventDefault():v.contains(c.target)||L(!1),document.removeEventListener("pointermove",b),M.current=null};return null!==M.current&&(document.addEventListener("pointermove",b),document.addEventListener("pointerup",c,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",b),document.removeEventListener("pointerup",c,{capture:!0})}}},[v,L,M]),u.useEffect(()=>{let a=()=>L(!1);return window.addEventListener("blur",a),window.addEventListener("resize",a),()=>{window.removeEventListener("blur",a),window.removeEventListener("resize",a)}},[L]);let[N,O]=hf(a=>{let b=F().filter(a=>!a.disabled),c=b.find(a=>a.ref.current===document.activeElement),d=hg(b,a,c);d&&setTimeout(()=>d.ref.current.focus())}),P=u.useCallback((a,b,c)=>{let d=!I.current&&!c;(void 0!==s.value&&s.value===b||d)&&(C(a),d&&(I.current=!0))},[s.value]),Q=u.useCallback(()=>v?.focus(),[v]),R=u.useCallback((a,b,c)=>{let d=!I.current&&!c;(void 0!==s.value&&s.value===b||d)&&E(a)},[s.value]),S="popper"===d?gQ:gP,T=S===gQ?{side:h,sideOffset:i,align:j,alignOffset:k,arrowPadding:l,collisionBoundary:m,collisionPadding:n,sticky:o,hideWhenDetached:p,avoidCollisions:q}:{};return(0,t.jsx)(gL,{scope:c,content:v,viewport:x,onViewportChange:y,itemRefCallback:P,selectedItem:B,onItemLeave:Q,itemTextRefCallback:R,focusSelectedItem:K,selectedItemText:D,position:d,isPositioned:G,searchRef:N,children:(0,t.jsx)(b0,{as:gN,allowPinchZoom:!0,children:(0,t.jsx)(bk,{asChild:!0,trapped:s.open,onMountAutoFocus:a=>{a.preventDefault()},onUnmountAutoFocus:aZ(e,a=>{s.trigger?.focus({preventScroll:!0}),a.preventDefault()}),children:(0,t.jsx)(be,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:f,onPointerDownOutside:g,onFocusOutside:a=>a.preventDefault(),onDismiss:()=>s.onOpenChange(!1),children:(0,t.jsx)(S,{role:"listbox",id:s.contentId,"data-state":s.open?"open":"closed",dir:s.dir,onContextMenu:a=>a.preventDefault(),...r,...T,onPlaced:()=>H(!0),ref:z,style:{display:"flex",flexDirection:"column",outline:"none",...r.style},onKeyDown:aZ(r.onKeyDown,a=>{let b=a.ctrlKey||a.altKey||a.metaKey;if("Tab"===a.key&&a.preventDefault(),b||1!==a.key.length||O(a.key),["ArrowUp","ArrowDown","Home","End"].includes(a.key)){let b=F().filter(a=>!a.disabled).map(a=>a.ref.current);if(["ArrowUp","End"].includes(a.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(a.key)){let c=a.target,d=b.indexOf(c);b=b.slice(d+1)}setTimeout(()=>J(b)),a.preventDefault()}})})})})})})});gO.displayName="SelectContentImpl";var gP=u.forwardRef((a,b)=>{let{__scopeSelect:c,onPlaced:d,...e}=a,f=gz(gJ,c),g=gM(gJ,c),[h,i]=u.useState(null),[j,k]=u.useState(null),l=A(b,a=>k(a)),m=gt(c),n=u.useRef(!1),o=u.useRef(!0),{viewport:p,selectedItem:q,selectedItemText:r,focusSelectedItem:s}=g,v=u.useCallback(()=>{if(f.trigger&&f.valueNode&&h&&j&&p&&q&&r){let a=f.trigger.getBoundingClientRect(),b=j.getBoundingClientRect(),c=f.valueNode.getBoundingClientRect(),e=r.getBoundingClientRect();if("rtl"!==f.dir){let d=e.left-b.left,f=c.left-d,g=a.left-f,i=a.width+g,j=Math.max(i,b.width),k=gk(f,[10,Math.max(10,window.innerWidth-10-j)]);h.style.minWidth=i+"px",h.style.left=k+"px"}else{let d=b.right-e.right,f=window.innerWidth-c.right-d,g=window.innerWidth-a.right-f,i=a.width+g,j=Math.max(i,b.width),k=gk(f,[10,Math.max(10,window.innerWidth-10-j)]);h.style.minWidth=i+"px",h.style.right=k+"px"}let g=m(),i=window.innerHeight-20,k=p.scrollHeight,l=window.getComputedStyle(j),o=parseInt(l.borderTopWidth,10),s=parseInt(l.paddingTop,10),t=parseInt(l.borderBottomWidth,10),u=o+s+k+parseInt(l.paddingBottom,10)+t,v=Math.min(5*q.offsetHeight,u),w=window.getComputedStyle(p),x=parseInt(w.paddingTop,10),y=parseInt(w.paddingBottom,10),z=a.top+a.height/2-10,A=q.offsetHeight/2,B=o+s+(q.offsetTop+A);if(B<=z){let a=g.length>0&&q===g[g.length-1].ref.current;h.style.bottom="0px";let b=Math.max(i-z,A+(a?y:0)+(j.clientHeight-p.offsetTop-p.offsetHeight)+t);h.style.height=B+b+"px"}else{let a=g.length>0&&q===g[0].ref.current;h.style.top="0px";let b=Math.max(z,o+p.offsetTop+(a?x:0)+A);h.style.height=b+(u-B)+"px",p.scrollTop=B-z+p.offsetTop}h.style.margin="10px 0",h.style.minHeight=v+"px",h.style.maxHeight=i+"px",d?.(),requestAnimationFrame(()=>n.current=!0)}},[m,f.trigger,f.valueNode,h,j,p,q,r,f.dir,d]);a0(()=>v(),[v]);let[w,x]=u.useState();a0(()=>{j&&x(window.getComputedStyle(j).zIndex)},[j]);let y=u.useCallback(a=>{a&&!0===o.current&&(v(),s?.(),o.current=!1)},[v,s]);return(0,t.jsx)(gR,{scope:c,contentWrapper:h,shouldExpandOnScrollRef:n,onScrollButtonChange:y,children:(0,t.jsx)("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:(0,t.jsx)(a9.div,{...e,ref:l,style:{boxSizing:"border-box",maxHeight:"100%",...e.style}})})})});gP.displayName="SelectItemAlignedPosition";var gQ=u.forwardRef((a,b)=>{let{__scopeSelect:c,align:d="start",collisionPadding:e=10,...f}=a,g=gx(c);return(0,t.jsx)(eF,{...g,...f,ref:b,align:d,collisionPadding:e,style:{boxSizing:"border-box",...f.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});gQ.displayName="SelectPopperPosition";var[gR,gS]=gv(gJ,{}),gT="SelectViewport",gU=u.forwardRef((a,b)=>{let{__scopeSelect:c,nonce:d,...e}=a,f=gM(gT,c),g=gS(gT,c),h=A(b,f.onViewportChange),i=u.useRef(0);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:d}),(0,t.jsx)(gs.Slot,{scope:c,children:(0,t.jsx)(a9.div,{"data-radix-select-viewport":"",role:"presentation",...e,ref:h,style:{position:"relative",flex:1,overflow:"hidden auto",...e.style},onScroll:aZ(e.onScroll,a=>{let b=a.currentTarget,{contentWrapper:c,shouldExpandOnScrollRef:d}=g;if(d?.current&&c){let a=Math.abs(i.current-b.scrollTop);if(a>0){let d=window.innerHeight-20,e=Math.max(parseFloat(c.style.minHeight),parseFloat(c.style.height));if(e<d){let f=e+a,g=Math.min(d,f),h=f-g;c.style.height=g+"px","0px"===c.style.bottom&&(b.scrollTop=h>0?h:0,c.style.justifyContent="flex-end")}}}i.current=b.scrollTop})})})]})});gU.displayName=gT;var gV="SelectGroup",[gW,gX]=gv(gV);u.forwardRef((a,b)=>{let{__scopeSelect:c,...d}=a,e=a3();return(0,t.jsx)(gW,{scope:c,id:e,children:(0,t.jsx)(a9.div,{role:"group","aria-labelledby":e,...d,ref:b})})}).displayName=gV;var gY="SelectLabel",gZ=u.forwardRef((a,b)=>{let{__scopeSelect:c,...d}=a,e=gX(gY,c);return(0,t.jsx)(a9.div,{id:e.id,...d,ref:b})});gZ.displayName=gY;var g$="SelectItem",[g_,g0]=gv(g$),g1=u.forwardRef((a,b)=>{let{__scopeSelect:c,value:d,disabled:e=!1,textValue:f,...g}=a,h=gz(g$,c),i=gM(g$,c),j=h.value===d,[k,l]=u.useState(f??""),[m,n]=u.useState(!1),o=A(b,a=>i.itemRefCallback?.(a,d,e)),p=a3(),q=u.useRef("touch"),r=()=>{e||(h.onValueChange(d),h.onOpenChange(!1))};if(""===d)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,t.jsx)(g_,{scope:c,value:d,disabled:e,textId:p,isSelected:j,onItemTextChange:u.useCallback(a=>{l(b=>b||(a?.textContent??"").trim())},[]),children:(0,t.jsx)(gs.ItemSlot,{scope:c,value:d,disabled:e,textValue:k,children:(0,t.jsx)(a9.div,{role:"option","aria-labelledby":p,"data-highlighted":m?"":void 0,"aria-selected":j&&m,"data-state":j?"checked":"unchecked","aria-disabled":e||void 0,"data-disabled":e?"":void 0,tabIndex:e?void 0:-1,...g,ref:o,onFocus:aZ(g.onFocus,()=>n(!0)),onBlur:aZ(g.onBlur,()=>n(!1)),onClick:aZ(g.onClick,()=>{"mouse"!==q.current&&r()}),onPointerUp:aZ(g.onPointerUp,()=>{"mouse"===q.current&&r()}),onPointerDown:aZ(g.onPointerDown,a=>{q.current=a.pointerType}),onPointerMove:aZ(g.onPointerMove,a=>{q.current=a.pointerType,e?i.onItemLeave?.():"mouse"===q.current&&a.currentTarget.focus({preventScroll:!0})}),onPointerLeave:aZ(g.onPointerLeave,a=>{a.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:aZ(g.onKeyDown,a=>{(i.searchRef?.current===""||" "!==a.key)&&(gq.includes(a.key)&&r()," "===a.key&&a.preventDefault())})})})})});g1.displayName=g$;var g2="SelectItemText",g3=u.forwardRef((a,b)=>{let{__scopeSelect:c,className:d,style:e,...f}=a,g=gz(g2,c),h=gM(g2,c),i=g0(g2,c),j=gB(g2,c),[k,l]=u.useState(null),m=A(b,a=>l(a),i.onItemTextChange,a=>h.itemTextRefCallback?.(a,i.value,i.disabled)),n=k?.textContent,o=u.useMemo(()=>(0,t.jsx)("option",{value:i.value,disabled:i.disabled,children:n},i.value),[i.disabled,i.value,n]),{onNativeOptionAdd:p,onNativeOptionRemove:q}=j;return a0(()=>(p(o),()=>q(o)),[p,q,o]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a9.span,{id:i.textId,...f,ref:m}),i.isSelected&&g.valueNode&&!g.valueNodeHasChildren?a6.createPortal(f.children,g.valueNode):null]})});g3.displayName=g2;var g4="SelectItemIndicator",g5=u.forwardRef((a,b)=>{let{__scopeSelect:c,...d}=a;return g0(g4,c).isSelected?(0,t.jsx)(a9.span,{"aria-hidden":!0,...d,ref:b}):null});g5.displayName=g4;var g6="SelectScrollUpButton",g7=u.forwardRef((a,b)=>{let c=gM(g6,a.__scopeSelect),d=gS(g6,a.__scopeSelect),[e,f]=u.useState(!1),g=A(b,d.onScrollButtonChange);return a0(()=>{if(c.viewport&&c.isPositioned){let a=function(){f(b.scrollTop>0)},b=c.viewport;return a(),b.addEventListener("scroll",a),()=>b.removeEventListener("scroll",a)}},[c.viewport,c.isPositioned]),e?(0,t.jsx)(ha,{...a,ref:g,onAutoScroll:()=>{let{viewport:a,selectedItem:b}=c;a&&b&&(a.scrollTop=a.scrollTop-b.offsetHeight)}}):null});g7.displayName=g6;var g8="SelectScrollDownButton",g9=u.forwardRef((a,b)=>{let c=gM(g8,a.__scopeSelect),d=gS(g8,a.__scopeSelect),[e,f]=u.useState(!1),g=A(b,d.onScrollButtonChange);return a0(()=>{if(c.viewport&&c.isPositioned){let a=function(){let a=b.scrollHeight-b.clientHeight;f(Math.ceil(b.scrollTop)<a)},b=c.viewport;return a(),b.addEventListener("scroll",a),()=>b.removeEventListener("scroll",a)}},[c.viewport,c.isPositioned]),e?(0,t.jsx)(ha,{...a,ref:g,onAutoScroll:()=>{let{viewport:a,selectedItem:b}=c;a&&b&&(a.scrollTop=a.scrollTop+b.offsetHeight)}}):null});g9.displayName=g8;var ha=u.forwardRef((a,b)=>{let{__scopeSelect:c,onAutoScroll:d,...e}=a,f=gM("SelectScrollButton",c),g=u.useRef(null),h=gt(c),i=u.useCallback(()=>{null!==g.current&&(window.clearInterval(g.current),g.current=null)},[]);return u.useEffect(()=>()=>i(),[i]),a0(()=>{let a=h().find(a=>a.ref.current===document.activeElement);a?.ref.current?.scrollIntoView({block:"nearest"})},[h]),(0,t.jsx)(a9.div,{"aria-hidden":!0,...e,ref:b,style:{flexShrink:0,...e.style},onPointerDown:aZ(e.onPointerDown,()=>{null===g.current&&(g.current=window.setInterval(d,50))}),onPointerMove:aZ(e.onPointerMove,()=>{f.onItemLeave?.(),null===g.current&&(g.current=window.setInterval(d,50))}),onPointerLeave:aZ(e.onPointerLeave,()=>{i()})})}),hb=u.forwardRef((a,b)=>{let{__scopeSelect:c,...d}=a;return(0,t.jsx)(a9.div,{"aria-hidden":!0,...d,ref:b})});hb.displayName="SelectSeparator";var hc="SelectArrow";u.forwardRef((a,b)=>{let{__scopeSelect:c,...d}=a,e=gx(c),f=gz(hc,c),g=gM(hc,c);return f.open&&"popper"===g.position?(0,t.jsx)(eI,{...e,...d,ref:b}):null}).displayName=hc;var hd=u.forwardRef(({__scopeSelect:a,value:b,...c},d)=>{let e=u.useRef(null),f=A(d,e),g=fo(b);return u.useEffect(()=>{let a=e.current;if(!a)return;let c=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(g!==b&&c){let d=new Event("change",{bubbles:!0});c.call(a,b),a.dispatchEvent(d)}},[g,b]),(0,t.jsx)(a9.select,{...c,style:{...gn,...c.style},ref:f,defaultValue:b})});function he(a){return""===a||void 0===a}function hf(a){let b=bb(a),c=u.useRef(""),d=u.useRef(0),e=u.useCallback(a=>{let e=c.current+a;b(e),function a(b){c.current=b,window.clearTimeout(d.current),""!==b&&(d.current=window.setTimeout(()=>a(""),1e3))}(e)},[b]),f=u.useCallback(()=>{c.current="",window.clearTimeout(d.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(d.current),[]),[c,e,f]}function hg(a,b,c){var d,e;let f=b.length>1&&Array.from(b).every(a=>a===b[0])?b[0]:b,g=c?a.indexOf(c):-1,h=(d=a,e=Math.max(g,0),d.map((a,b)=>d[(e+b)%d.length]));1===f.length&&(h=h.filter(a=>a!==c));let i=h.find(a=>a.textValue.toLowerCase().startsWith(f.toLowerCase()));return i!==c?i:void 0}hd.displayName="SelectBubbleInput";let hh=(0,c5.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),hi=u.forwardRef(({className:a,children:b,...c},d)=>(0,t.jsxs)(gE,{ref:d,className:aR("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",a),...c,children:[b,(0,t.jsx)(gH,{asChild:!0,children:(0,t.jsx)(fj,{className:"h-4 w-4 opacity-50"})})]}));hi.displayName=gE.displayName;let hj=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(g7,{ref:c,className:aR("flex cursor-default items-center justify-center py-1",a),...b,children:(0,t.jsx)(hh,{className:"h-4 w-4"})}));hj.displayName=g7.displayName;let hk=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(g9,{ref:c,className:aR("flex cursor-default items-center justify-center py-1",a),...b,children:(0,t.jsx)(fj,{className:"h-4 w-4"})}));hk.displayName=g9.displayName;let hl=u.forwardRef(({className:a,children:b,position:c="popper",...d},e)=>(0,t.jsx)(gI,{children:(0,t.jsxs)(gK,{ref:e,className:aR("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]","popper"===c&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:c,...d,children:[(0,t.jsx)(hj,{}),(0,t.jsx)(gU,{className:aR("p-1","popper"===c&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:b}),(0,t.jsx)(hk,{})]})}));hl.displayName=gK.displayName,u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(gZ,{ref:c,className:aR("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...b})).displayName=gZ.displayName;let hm=u.forwardRef(({className:a,children:b,...c},d)=>(0,t.jsxs)(g1,{ref:d,className:aR("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...c,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(g5,{children:(0,t.jsx)(fa,{className:"h-4 w-4"})})}),(0,t.jsx)(g3,{children:b})]}));function hn(){let a,b,c=(0,v.useRouter)(),d=(0,v.useSearchParams)(),{currentBank:e,setCurrentBank:f,banks:g,loadBanks:h}=(0,w.useBank)(),{theme:i,toggleTheme:j}=(0,fl.useTheme)(),[k,l]=u.useState(!1),[m,n]=u.useState(!1),[o,p]=u.useState(""),[q,r]=u.useState(!1),[s,y]=u.useState(null),[z,A]=u.useState(!1),[B,C]=u.useState("text"),[D,E]=u.useState(""),[F,G]=u.useState(""),[H,I]=u.useState(""),[J,K]=u.useState(""),[L,M]=u.useState(""),[N,O]=u.useState("combined"),[P,Q]=u.useState(""),[R,S]=u.useState(""),[T,U]=u.useState(""),[V,W]=u.useState("document"),[X,Y]=u.useState(!1),[Z,$]=u.useState(!1),[_,aa]=u.useState([]),[ab,ac]=u.useState([]),[ad,ae]=u.useState(""),af=u.useRef(null),[ag,ah]=u.useState(null);u.useEffect(()=>{x.client.getVersion().then(a=>{ah(a.features.file_upload_api)}).catch(()=>{ah(!1)})},[]);let ai=u.useMemo(()=>[...g].sort((a,b)=>a.localeCompare(b)),[g]),aj=async()=>{if(o.trim()){r(!0),y(null);try{await x.client.createBank(o.trim()),await h(),n(!1),p(""),f(o.trim()),c.push(`/banks/${o.trim()}?view=data`)}catch(a){y(a instanceof Error?a.message:"Failed to create bank")}finally{r(!1)}}},ak=a=>{let b={};for(let c of a.split("\n")){let a=c.indexOf(":");if(a>0){let d=c.slice(0,a).trim(),e=c.slice(a+1).trim();d&&(b[d]=e)}}return Object.keys(b).length>0?b:void 0},al=()=>({context:"",timestamp:"",document_id:"",tags:"",metadata:"",expanded:!1}),am=(a,b,c)=>{ac(d=>d.map((d,e)=>e===a?{...d,[b]:c}:d))},an=async()=>{if(e&&0!==_.length){$(!0),ae("");try{ae(`Uploading ${_.length} file(s)...`);let a=ab.map(a=>({...a.context&&{context:a.context},...a.timestamp&&{timestamp:a.timestamp+":00"},...a.document_id&&{document_id:a.document_id},...a.tags&&{tags:a.tags.split(",").map(a=>a.trim()).filter(Boolean)},...a.metadata&&{metadata:ak(a.metadata)}}));await x.client.uploadFiles({bank_id:e,files:_,async:!0,files_metadata:a}),A(!1),aa([]),ac([]),M(""),Y(!1),ae(""),c.push(`/banks/${e}?view=documents`)}catch{}finally{$(!1),ae("")}}},ao=async()=>{if(e&&D.trim()){$(!0);try{let a=L.split(",").map(a=>a.trim()).filter(Boolean),b={content:D};if(F&&(b.context=F),H&&(b.timestamp=H+":00"),J&&(b.document_id=J),a.length>0&&(b.tags=a),"per_tag"===N)b.observation_scopes="per_tag";else if("combined"===N)b.observation_scopes="combined";else if("all_combinations"===N)b.observation_scopes="all_combinations";else if("custom"===N){let a=P.split("\n").map(a=>a.split(",").map(a=>a.trim()).filter(Boolean)).filter(a=>a.length>0);a.length>0&&(b.observation_scopes=a)}let d=ak(R);d&&(b.metadata=d);let f=(a=>{let b=a.split(",").map(a=>a.trim()).filter(Boolean);if(0!==b.length)return b.map(a=>({text:a}))})(T);f&&(b.entities=f),await x.client.retain({bank_id:e,items:[b],async:X}),A(!1),E(""),G(""),I(""),K(""),M(""),O("combined"),Q(""),S(""),U(""),W("document"),Y(!1),c.push(`/banks/${e}?view=documents`)}catch{}finally{$(!1)}}};return(0,t.jsx)("div",{className:"bg-card text-card-foreground px-5 py-3 border-b-4 border-primary-gradient",children:(0,t.jsxs)("div",{className:"flex items-center gap-4 text-sm",children:[(0,t.jsx)(fm.default,{src:"/logo.png",alt:"Hindsight",width:40,height:40,className:"h-10 w-auto",unoptimized:!0}),(0,t.jsx)("div",{className:"h-8 w-px bg-border"}),(0,t.jsxs)(eU,{open:k,onOpenChange:a=>{l(a),a&&h()},children:[(0,t.jsx)(eX,{asChild:!0,children:(0,t.jsxs)(aT,{variant:"outline",role:"combobox","aria-expanded":k,className:"w-[250px] justify-between font-bold border-2 border-primary hover:bg-accent",children:[(0,t.jsx)("span",{className:"truncate",children:e||"Select a memory bank..."}),(0,t.jsx)(fb,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(e8,{className:"w-[250px] p-0",children:(0,t.jsxs)(de,{children:[ai.length>0&&(0,t.jsx)(df,{placeholder:"Search memory banks..."}),(0,t.jsxs)(dg,{children:[(0,t.jsx)(dh,{children:"No memory banks yet."}),(0,t.jsx)(di,{children:ai.map(a=>(0,t.jsxs)(dj,{value:a,onSelect:a=>{f(a),l(!1);let b=d.get("view")||"data",e=d.get("subTab"),g=e?`?view=${b}&subTab=${e}`:`?view=${b}`;c.push(`/banks/${a}${g}`)},children:[(0,t.jsx)(fa,{className:aR("mr-2 h-4 w-4",e===a?"opacity-100":"opacity-0")}),a]},a))})]}),(0,t.jsx)("div",{className:"border-t border-border p-1",children:(0,t.jsxs)("button",{className:"w-full flex items-center gap-2 px-2 py-2 text-sm rounded-md hover:bg-accent transition-colors text-muted-foreground hover:text-foreground",onClick:()=>{l(!1),n(!0)},children:[(0,t.jsx)(fc,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"Create new bank"})]})})]})})]}),(0,t.jsx)("div",{className:"h-8 w-px bg-border"}),e&&(0,t.jsxs)(aT,{variant:"outline",size:"sm",className:"h-9 gap-1.5",onClick:()=>A(!0),title:"Add document to current bank",children:[(0,t.jsx)(fc,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"Add Document"})]}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)("a",{href:"https://github.com/vectorize-io/hindsight",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-accent transition-colors text-muted-foreground hover:text-foreground",title:"View on GitHub",children:[(0,t.jsx)(fg,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"GitHub"})]}),(0,t.jsx)("div",{className:"h-8 w-px bg-border"}),(0,t.jsx)(aT,{variant:"ghost",size:"icon",onClick:j,className:"h-9 w-9",title:"light"===i?"Switch to dark mode":"Switch to light mode",children:"light"===i?(0,t.jsx)(fe,{className:"h-5 w-5"}):(0,t.jsx)(ff,{className:"h-5 w-5"})}),(0,t.jsx)(cf,{open:m,onOpenChange:n,children:(0,t.jsxs)(c9,{className:"sm:max-w-[425px]",children:[(0,t.jsx)(da,{children:(0,t.jsx)(dc,{children:"Create New Memory Bank"})}),(0,t.jsxs)("div",{className:"py-4",children:[(0,t.jsx)(e9,{placeholder:"Enter bank ID...",value:o,onChange:a=>p(a.target.value),onKeyDown:a=>{"Enter"!==a.key||q||aj()},autoFocus:!0}),s&&(0,t.jsx)("p",{className:"text-sm text-destructive mt-2",children:s})]}),(0,t.jsxs)(db,{children:[(0,t.jsx)(aT,{variant:"secondary",onClick:()=>{n(!1),p(""),y(null)},children:"Cancel"}),(0,t.jsx)(aT,{onClick:aj,disabled:q||!o.trim(),children:q?"Creating...":"Create"})]})]})}),(0,t.jsx)(cf,{open:z,onOpenChange:A,children:(0,t.jsxs)(c9,{className:"sm:max-w-[750px] max-h-[90vh] flex flex-col",children:[(0,t.jsxs)(da,{children:[(0,t.jsx)(dc,{children:"Add New Document"}),(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Add a new document to memory bank:"," ",(0,t.jsx)("span",{className:"font-semibold",children:e})]})]}),(0,t.jsxs)("div",{className:"space-y-4 overflow-y-auto flex-1 px-1 -mx-1",children:[(0,t.jsxs)(f8,{value:B,onValueChange:a=>C(a),children:[(0,t.jsxs)(gh,{className:"grid w-full grid-cols-2",children:[(0,t.jsxs)(gi,{value:"text",className:"flex items-center gap-2",children:[(0,t.jsx)(fd,{className:"h-4 w-4"}),"Text"]}),(0,t.jsxs)(gi,{value:"upload",className:"flex items-center gap-2",disabled:!1===ag,children:[!1===ag?(0,t.jsx)(fi,{className:"h-4 w-4"}):(0,t.jsx)(fh,{className:"h-4 w-4"}),"Upload Files"]})]}),(0,t.jsxs)(gj,{value:"text",className:"mt-3",children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Content *"}),(0,t.jsx)(fn,{value:D,onChange:a=>E(a.target.value),placeholder:"Enter the document content...",className:"min-h-[150px] resize-y",autoFocus:!0})]}),(0,t.jsx)(gj,{value:"upload",className:"mt-3",children:!1===ag?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center space-y-3",children:[(0,t.jsx)(fi,{className:"h-12 w-12 text-muted-foreground/50"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-semibold text-foreground",children:"File Upload API Disabled"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"File upload is not enabled on this server."}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:["To enable, set"," ",(0,t.jsx)("code",{className:"bg-muted px-1 py-0.5 rounded",children:"HINDSIGHT_API_ENABLE_FILE_UPLOAD_API=true"})]})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{ref:af,type:"file",multiple:!0,onChange:a=>{let b=Array.from(a.target.files||[]);aa(a=>[...a,...b]),ac(a=>[...a,...b.map(al)]),af.current&&(af.current.value="")},className:"hidden",id:"file-upload"}),(0,t.jsxs)("label",{htmlFor:"file-upload",className:"flex flex-col items-center justify-center w-full h-32 border-2 border-dashed border-muted-foreground/25 rounded-lg cursor-pointer hover:border-primary/50 hover:bg-accent/50 transition-colors",children:[(0,t.jsx)(fh,{className:"h-8 w-8 text-muted-foreground mb-2"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Click to select files or drag and drop"})]}),_.length>0&&(0,t.jsx)("div",{className:"mt-3 space-y-1",children:_.map((a,b)=>{let c=ab[b],d=c&&(c.context||c.timestamp||c.document_id||c.tags||c.metadata);return(0,t.jsxs)("div",{className:"bg-muted rounded-md overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 px-2 py-2",children:[(0,t.jsxs)("button",{type:"button",className:"flex items-center gap-1.5 min-w-0 flex-1 text-left hover:opacity-75 transition-opacity",onClick:()=>{ac(a=>a.map((a,c)=>c===b?{...a,expanded:!a.expanded}:a))},title:"Edit metadata for this file",children:[c?.expanded?(0,t.jsx)(fj,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):(0,t.jsx)(fk,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,t.jsx)(fd,{className:`h-4 w-4 shrink-0 ${d?"text-primary":"text-muted-foreground"}`}),(0,t.jsx)("span",{className:"text-sm truncate",children:a.name}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground shrink-0",children:["(",(a.size/1024).toFixed(1)," KB)"]})]}),(0,t.jsx)(aT,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 shrink-0",onClick:()=>{aa(a=>a.filter((a,c)=>c!==b)),ac(a=>a.filter((a,c)=>c!==b))},children:(0,t.jsx)(c7,{className:"h-4 w-4"})})]}),c?.expanded&&(0,t.jsxs)("div",{className:"px-3 pb-3 space-y-2 border-t border-border/50",children:[(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Context"}),(0,t.jsx)(e9,{value:c.context,onChange:a=>am(b,"context",a.target.value),placeholder:"Optional context...",className:"h-8 text-sm"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Event Date"}),(0,t.jsx)(e9,{type:"datetime-local",value:c.timestamp,onChange:a=>am(b,"timestamp",a.target.value),className:"h-8 text-sm text-foreground"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Document ID"}),(0,t.jsx)(e9,{value:c.document_id,onChange:a=>am(b,"document_id",a.target.value),placeholder:"Optional ID...",className:"h-8 text-sm"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Tags"}),(0,t.jsx)(e9,{value:c.tags,onChange:a=>am(b,"tags",a.target.value),placeholder:"tag1, tag2...",className:"h-8 text-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Metadata"}),(0,t.jsx)(fn,{value:c.metadata,onChange:a=>am(b,"metadata",a.target.value),placeholder:"source: slack\nchannel: engineering",className:"min-h-[52px] resize-y font-mono text-sm"})]})]})]},`${a.name}-${b}`)})}),ad&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-2",children:ad})]})})]}),"text"===B&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Context"}),(0,t.jsx)(e9,{type:"text",value:F,onChange:a=>G(a.target.value),placeholder:"Optional context about this document..."})]}),"text"===B&&(0,t.jsx)("div",{children:(0,t.jsxs)(f8,{value:V,onValueChange:a=>W(a),children:[(0,t.jsxs)(gh,{className:"w-full border-b border-border bg-transparent h-8 p-0 gap-0 justify-start rounded-none",children:[(0,t.jsx)(gi,{value:"document",className:"rounded-none h-full px-4 text-xs font-medium bg-transparent shadow-none text-muted-foreground hover:text-foreground data-[state=active]:text-foreground data-[state=active]:shadow-none data-[state=active]:bg-transparent data-[state=active]:border-b-2 data-[state=active]:border-primary -mb-px",children:"Document"}),(0,t.jsx)(gi,{value:"tags",className:"rounded-none h-full px-4 text-xs font-medium bg-transparent shadow-none text-muted-foreground hover:text-foreground data-[state=active]:text-foreground data-[state=active]:shadow-none data-[state=active]:bg-transparent data-[state=active]:border-b-2 data-[state=active]:border-primary -mb-px",children:"Tags"}),(0,t.jsx)(gi,{value:"source",className:"rounded-none h-full px-4 text-xs font-medium bg-transparent shadow-none text-muted-foreground hover:text-foreground data-[state=active]:text-foreground data-[state=active]:shadow-none data-[state=active]:bg-transparent data-[state=active]:border-b-2 data-[state=active]:border-primary -mb-px",children:"Source"})]}),(0,t.jsxs)("div",{className:"pt-3 space-y-3",children:[(0,t.jsxs)(gj,{value:"document",className:"mt-0 space-y-3",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Event Date"}),(0,t.jsx)(e9,{type:"datetime-local",value:H,onChange:a=>I(a.target.value),className:"text-foreground"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Document ID"}),(0,t.jsx)(e9,{type:"text",value:J,onChange:a=>K(a.target.value),placeholder:"Optional document identifier..."})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(fE,{id:"async-doc",checked:X,onCheckedChange:a=>Y(a)}),(0,t.jsx)("label",{htmlFor:"async-doc",className:"text-sm cursor-pointer text-foreground",children:"Process in background (async)"})]})]}),(0,t.jsxs)(gj,{value:"tags",className:"mt-0 space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Tags"}),(0,t.jsx)(e9,{type:"text",value:L,onChange:a=>M(a.target.value),placeholder:"user_alice, session_123, project_x"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Comma-separated — used to filter memories during recall/reflect"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Observation Scopes"}),(0,t.jsxs)(gC,{value:N,onValueChange:a=>O(a),children:[(0,t.jsx)(hi,{className:"w-full",children:(0,t.jsx)(gG,{})}),(0,t.jsxs)(hl,{children:[(0,t.jsx)(hm,{value:"per_tag",children:"Per tag"}),(0,t.jsx)(hm,{value:"combined",children:"Combined"}),(0,t.jsx)(hm,{value:"all_combinations",children:"All combinations"}),(0,t.jsx)(hm,{value:"custom",children:"Custom"})]})]}),"custom"!==N&&(b=((a,b)=>{if(0===a.length)return[];if("per_tag"===b)return a.map(a=>[a]);if("combined"===b)return[a];let c=[];for(let b=1;b<=a.length;b++){let d=(e,f)=>{if(f.length===b)return void c.push([...f]);for(let b=e;b<a.length;b++)d(b+1,[...f,a[b]])};d(0,[])}return c})(a=L.split(",").map(a=>a.trim()).filter(Boolean),N),0===a.length?(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60 mt-1.5 italic",children:"Add tags above to preview observation scopes"}):(0,t.jsxs)("ul",{className:"mt-2 space-y-1.5",children:[b.slice(0,6).map((a,b)=>(0,t.jsxs)("li",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-mono text-foreground",children:a.join(", ")}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:(a=>{if(1===a.length)return`What happened with ${a[0]}?`;let b=a.slice(0,-1).join(", ");return`What happened with ${b} and ${a[a.length-1]}?`})(a)})]},b)),b.length>6&&(0,t.jsxs)("li",{className:"text-xs text-muted-foreground",children:["+",b.length-6," more scopes"]})]})),"custom"===N&&(0,t.jsx)(fn,{value:P,onChange:a=>Q(a.target.value),placeholder:"user:alice\nuser:alice, place:online",className:"min-h-[72px] resize-y font-mono text-sm mt-2"})]})]}),(0,t.jsxs)(gj,{value:"source",className:"mt-0 space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Metadata"}),(0,t.jsx)(fn,{value:R,onChange:a=>S(a.target.value),placeholder:"source: slack\nchannel: engineering",className:"min-h-[72px] resize-y font-mono text-sm"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:["One ",(0,t.jsx)("code",{className:"bg-muted px-0.5 rounded",children:"key: value"})," per line"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Entities"}),(0,t.jsx)(e9,{type:"text",value:T,onChange:a=>U(a.target.value),placeholder:"Alice, Google, ML model"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Comma-separated hints merged with auto-extracted entities"})]})]})]})]})})]}),(0,t.jsxs)(db,{children:[(0,t.jsx)(aT,{variant:"secondary",onClick:()=>{A(!1),E(""),G(""),I(""),K(""),M(""),O("combined"),Q(""),S(""),U(""),W("document"),Y(!1),aa([]),ac([]),ae("")},children:"Cancel"}),"text"===B?(0,t.jsx)(aT,{onClick:ao,disabled:Z||!D.trim(),children:Z?"Adding...":"Add Document"}):(0,t.jsx)(aT,{onClick:an,disabled:Z||0===_.length,children:Z?ad||"Uploading...":`Upload ${_.length} File${1!==_.length?"s":""}`})]})]})})]})})}function ho(){return(0,t.jsx)(u.Suspense,{fallback:(0,t.jsx)("div",{className:"bg-card text-card-foreground px-5 py-3 border-b-4 border-primary-gradient",children:(0,t.jsxs)("div",{className:"flex items-center gap-4 text-sm",children:[(0,t.jsx)(fm.default,{src:"/logo.png",alt:"Hindsight",width:40,height:40,className:"h-10 w-auto",unoptimized:!0}),(0,t.jsx)("div",{className:"h-8 w-px bg-border"}),(0,t.jsxs)(aT,{variant:"outline",className:"w-[250px] justify-between font-bold border-2 border-primary",disabled:!0,children:["Loading...",(0,t.jsx)(fb,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)("a",{href:"https://github.com/vectorize-io/hindsight",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-accent transition-colors text-muted-foreground",children:[(0,t.jsx)(fg,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"GitHub"})]}),(0,t.jsx)("div",{className:"h-8 w-px bg-border"}),(0,t.jsx)(aT,{variant:"ghost",size:"icon",className:"h-9 w-9",disabled:!0,children:(0,t.jsx)(fe,{className:"h-5 w-5"})})]})}),children:(0,t.jsx)(hn,{})})}hm.displayName=g1.displayName,u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(hb,{ref:c,className:aR("-mx-1 my-1 h-px bg-muted",a),...b})).displayName=hb.displayName,a.s(["Select",()=>gC,"SelectContent",()=>hl,"SelectItem",()=>hm,"SelectTrigger",()=>hi,"SelectValue",()=>gG],99295),a.s(["BankSelector",()=>ho],49839)}];
|
|
7
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${b.docsSlug}`;return u.useEffect(()=>{a&&(document.getElementById(a)||console.error(c))},[c,a]),null},cG=({contentRef:a,descriptionId:b})=>{let c=cE("DialogDescriptionWarning"),d=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${c.contentName}}.`;return u.useEffect(()=>{let c=a.current?.getAttribute("aria-describedby");b&&c&&(document.getElementById(b)||console.warn(d))},[d,a,b]),null};a.s(["Close",()=>cA,"Content",()=>cr,"Description",()=>cy,"Overlay",()=>cn,"Portal",()=>cl,"Root",()=>cf,"Title",()=>cw,"Trigger",()=>ch,"WarningProvider",()=>cD,"createDialogScope",()=>cc],97942);var cH='[cmdk-group=""]',cI='[cmdk-group-items=""]',cJ='[cmdk-item=""]',cK=`${cJ}:not([aria-disabled="true"])`,cL="cmdk-item-select",cM="data-value",cN=(a,b,c)=>{var d;return d=a,function a(b,c,d,e,f,g,h){if(g===c.length)return f===b.length?1:.99;var i=`${f},${g}`;if(void 0!==h[i])return h[i];for(var j,k,l,m,n=e.charAt(g),o=d.indexOf(n,f),p=0;o>=0;)(j=a(b,c,d,e,o+1,g+1,h))>p&&(o===f?j*=1:aU.test(b.charAt(o-1))?(j*=.8,(l=b.slice(f,o-1).match(aV))&&f>0&&(j*=Math.pow(.999,l.length))):aW.test(b.charAt(o-1))?(j*=.9,(m=b.slice(f,o-1).match(aX))&&f>0&&(j*=Math.pow(.999,m.length))):(j*=.17,f>0&&(j*=Math.pow(.999,o-f))),b.charAt(o)!==c.charAt(g)&&(j*=.9999)),(j<.1&&d.charAt(o-1)===e.charAt(g+1)||e.charAt(g+1)===e.charAt(g)&&d.charAt(o-1)!==e.charAt(g))&&.1*(k=a(b,c,d,e,o+1,g+2,h))>j&&(j=.1*k),j>p&&(p=j),o=d.indexOf(n,o+1);return h[i]=p,p}(d=c&&c.length>0?`${d+" "+c.join(" ")}`:d,b,aY(d),aY(b),0,0,{})},cO=u.createContext(void 0),cP=u.createContext(void 0),cQ=u.createContext(void 0),cR=u.forwardRef((a,b)=>{let c=c_(()=>{var b,c;return{search:"",value:null!=(c=null!=(b=a.value)?b:a.defaultValue)?c:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),d=c_(()=>new Set),e=c_(()=>new Map),f=c_(()=>new Map),g=c_(()=>new Set),h=cZ(a),{label:i,children:j,value:k,onValueChange:l,filter:m,shouldFilter:n,loop:o,disablePointerSelection:p=!1,vimBindings:q=!0,...r}=a,s=a3(),t=a3(),v=a3(),w=u.useRef(null),x=c2();c$(()=>{if(void 0!==k){let a=k.trim();c.current.value=a,y.emit()}},[k]),c$(()=>{x(6,E)},[]);let y=u.useMemo(()=>({subscribe:a=>(g.current.add(a),()=>g.current.delete(a)),snapshot:()=>c.current,setState:(a,b,d)=>{var e,f,g,i;if(!Object.is(c.current[a],b)){if(c.current[a]=b,"search"===a)D(),B(),x(1,C);else if("value"===a){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let a=document.getElementById(v);a?a.focus():null==(e=document.getElementById(s))||e.focus()}if(x(7,()=>{var a;c.current.selectedItemId=null==(a=F())?void 0:a.id,y.emit()}),d||x(5,E),(null==(f=h.current)?void 0:f.value)!==void 0){null==(i=(g=h.current).onValueChange)||i.call(g,null!=b?b:"");return}}y.emit()}},emit:()=>{g.current.forEach(a=>a())}}),[]),z=u.useMemo(()=>({value:(a,b,d)=>{var e;b!==(null==(e=f.current.get(a))?void 0:e.value)&&(f.current.set(a,{value:b,keywords:d}),c.current.filtered.items.set(a,A(b,d)),x(2,()=>{B(),y.emit()}))},item:(a,b)=>(d.current.add(a),b&&(e.current.has(b)?e.current.get(b).add(a):e.current.set(b,new Set([a]))),x(3,()=>{D(),B(),c.current.value||C(),y.emit()}),()=>{f.current.delete(a),d.current.delete(a),c.current.filtered.items.delete(a);let b=F();x(4,()=>{D(),(null==b?void 0:b.getAttribute("id"))===a&&C(),y.emit()})}),group:a=>(e.current.has(a)||e.current.set(a,new Set),()=>{f.current.delete(a),e.current.delete(a)}),filter:()=>h.current.shouldFilter,label:i||a["aria-label"],getDisablePointerSelection:()=>h.current.disablePointerSelection,listId:s,inputId:v,labelId:t,listInnerRef:w}),[]);function A(a,b){var d,e;let f=null!=(e=null==(d=h.current)?void 0:d.filter)?e:cN;return a?f(a,c.current.search,b):0}function B(){if(!c.current.search||!1===h.current.shouldFilter)return;let a=c.current.filtered.items,b=[];c.current.filtered.groups.forEach(c=>{let d=e.current.get(c),f=0;d.forEach(b=>{f=Math.max(a.get(b),f)}),b.push([c,f])});let d=w.current;G().sort((b,c)=>{var d,e;let f=b.getAttribute("id"),g=c.getAttribute("id");return(null!=(d=a.get(g))?d:0)-(null!=(e=a.get(f))?e:0)}).forEach(a=>{let b=a.closest(cI);b?b.appendChild(a.parentElement===b?a:a.closest(`${cI} > *`)):d.appendChild(a.parentElement===d?a:a.closest(`${cI} > *`))}),b.sort((a,b)=>b[1]-a[1]).forEach(a=>{var b;let c=null==(b=w.current)?void 0:b.querySelector(`${cH}[${cM}="${encodeURIComponent(a[0])}"]`);null==c||c.parentElement.appendChild(c)})}function C(){let a=G().find(a=>"true"!==a.getAttribute("aria-disabled")),b=null==a?void 0:a.getAttribute(cM);y.setState("value",b||void 0)}function D(){var a,b,g,i;if(!c.current.search||!1===h.current.shouldFilter){c.current.filtered.count=d.current.size;return}c.current.filtered.groups=new Set;let j=0;for(let e of d.current){let d=A(null!=(b=null==(a=f.current.get(e))?void 0:a.value)?b:"",null!=(i=null==(g=f.current.get(e))?void 0:g.keywords)?i:[]);c.current.filtered.items.set(e,d),d>0&&j++}for(let[a,b]of e.current)for(let d of b)if(c.current.filtered.items.get(d)>0){c.current.filtered.groups.add(a);break}c.current.filtered.count=j}function E(){var a,b,c;let d=F();d&&((null==(a=d.parentElement)?void 0:a.firstChild)===d&&(null==(c=null==(b=d.closest(cH))?void 0:b.querySelector('[cmdk-group-heading=""]'))||c.scrollIntoView({block:"nearest"})),d.scrollIntoView({block:"nearest"}))}function F(){var a;return null==(a=w.current)?void 0:a.querySelector(`${cJ}[aria-selected="true"]`)}function G(){var a;return Array.from((null==(a=w.current)?void 0:a.querySelectorAll(cK))||[])}function H(a){let b=G()[a];b&&y.setState("value",b.getAttribute(cM))}function I(a){var b;let c=F(),d=G(),e=d.findIndex(a=>a===c),f=d[e+a];null!=(b=h.current)&&b.loop&&(f=e+a<0?d[d.length-1]:e+a===d.length?d[0]:d[e+a]),f&&y.setState("value",f.getAttribute(cM))}function J(a){let b=F(),c=null==b?void 0:b.closest(cH),d;for(;c&&!d;)d=null==(c=a>0?function(a,b){let c=a.nextElementSibling;for(;c;){if(c.matches(b))return c;c=c.nextElementSibling}}(c,cH):function(a,b){let c=a.previousElementSibling;for(;c;){if(c.matches(b))return c;c=c.previousElementSibling}}(c,cH))?void 0:c.querySelector(cK);d?y.setState("value",d.getAttribute(cM)):I(a)}let K=()=>H(G().length-1),L=a=>{a.preventDefault(),a.metaKey?K():a.altKey?J(1):I(1)},M=a=>{a.preventDefault(),a.metaKey?H(0):a.altKey?J(-1):I(-1)};return u.createElement(a9.div,{ref:b,tabIndex:-1,...r,"cmdk-root":"",onKeyDown:a=>{var b;null==(b=r.onKeyDown)||b.call(r,a);let c=a.nativeEvent.isComposing||229===a.keyCode;if(!(a.defaultPrevented||c))switch(a.key){case"n":case"j":q&&a.ctrlKey&&L(a);break;case"ArrowDown":L(a);break;case"p":case"k":q&&a.ctrlKey&&M(a);break;case"ArrowUp":M(a);break;case"Home":a.preventDefault(),H(0);break;case"End":a.preventDefault(),K();break;case"Enter":{a.preventDefault();let b=F();if(b){let a=new Event(cL);b.dispatchEvent(a)}}}}},u.createElement("label",{"cmdk-label":"",htmlFor:z.inputId,id:z.labelId,style:c4},i),c3(a,a=>u.createElement(cP.Provider,{value:y},u.createElement(cO.Provider,{value:z},a))))}),cS=u.forwardRef((a,b)=>{var c,d;let e=a3(),f=u.useRef(null),g=u.useContext(cQ),h=u.useContext(cO),i=cZ(a),j=null!=(d=null==(c=i.current)?void 0:c.forceMount)?d:null==g?void 0:g.forceMount;c$(()=>{if(!j)return h.item(e,null==g?void 0:g.id)},[j]);let k=c1(e,f,[a.value,a.children,f],a.keywords),l=u.useContext(cP),m=c0(a=>a.value&&a.value===k.current),n=c0(a=>!!j||!1===h.filter()||!a.search||a.filtered.items.get(e)>0);function o(){var a,b;p(),null==(b=(a=i.current).onSelect)||b.call(a,k.current)}function p(){l.setState("value",k.current,!0)}if(u.useEffect(()=>{let b=f.current;if(!(!b||a.disabled))return b.addEventListener(cL,o),()=>b.removeEventListener(cL,o)},[n,a.onSelect,a.disabled]),!n)return null;let{disabled:q,value:r,onSelect:s,forceMount:t,keywords:v,...w}=a;return u.createElement(a9.div,{ref:z(f,b),...w,id:e,"cmdk-item":"",role:"option","aria-disabled":!!q,"aria-selected":!!m,"data-disabled":!!q,"data-selected":!!m,onPointerMove:q||h.getDisablePointerSelection()?void 0:p,onClick:q?void 0:o},a.children)}),cT=u.forwardRef((a,b)=>{let{heading:c,children:d,forceMount:e,...f}=a,g=a3(),h=u.useRef(null),i=u.useRef(null),j=a3(),k=u.useContext(cO),l=c0(a=>!!e||!1===k.filter()||!a.search||a.filtered.groups.has(g));c$(()=>k.group(g),[]),c1(g,h,[a.value,a.heading,i]);let m=u.useMemo(()=>({id:g,forceMount:e}),[e]);return u.createElement(a9.div,{ref:z(h,b),...f,"cmdk-group":"",role:"presentation",hidden:!l||void 0},c&&u.createElement("div",{ref:i,"cmdk-group-heading":"","aria-hidden":!0,id:j},c),c3(a,a=>u.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":c?j:void 0},u.createElement(cQ.Provider,{value:m},a))))}),cU=u.forwardRef((a,b)=>{let{alwaysRender:c,...d}=a,e=u.useRef(null),f=c0(a=>!a.search);return c||f?u.createElement(a9.div,{ref:z(e,b),...d,"cmdk-separator":"",role:"separator"}):null}),cV=u.forwardRef((a,b)=>{let{onValueChange:c,...d}=a,e=null!=a.value,f=u.useContext(cP),g=c0(a=>a.search),h=c0(a=>a.selectedItemId),i=u.useContext(cO);return u.useEffect(()=>{null!=a.value&&f.setState("search",a.value)},[a.value]),u.createElement(a9.input,{ref:b,...d,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":i.listId,"aria-labelledby":i.labelId,"aria-activedescendant":h,id:i.inputId,type:"text",value:e?a.value:g,onChange:a=>{e||f.setState("search",a.target.value),null==c||c(a.target.value)}})}),cW=u.forwardRef((a,b)=>{let{children:c,label:d="Suggestions",...e}=a,f=u.useRef(null),g=u.useRef(null),h=c0(a=>a.selectedItemId),i=u.useContext(cO);return u.useEffect(()=>{if(g.current&&f.current){let a=g.current,b=f.current,c,d=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let c=a.offsetHeight;b.style.setProperty("--cmdk-list-height",c.toFixed(1)+"px")})});return d.observe(a),()=>{cancelAnimationFrame(c),d.unobserve(a)}}},[]),u.createElement(a9.div,{ref:z(f,b),...e,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":h,"aria-label":d,id:i.listId},c3(a,a=>u.createElement("div",{ref:z(g,i.listInnerRef),"cmdk-list-sizer":""},a)))}),cX=u.forwardRef((a,b)=>{let{open:c,onOpenChange:d,overlayClassName:e,contentClassName:f,container:g,...h}=a;return u.createElement(cf,{open:c,onOpenChange:d},u.createElement(cl,{container:g},u.createElement(cn,{"cmdk-overlay":"",className:e}),u.createElement(cr,{"aria-label":a.label,"cmdk-dialog":"",className:f},u.createElement(cR,{ref:b,...h}))))}),cY=Object.assign(cR,{List:cW,Item:cS,Input:cV,Group:cT,Separator:cU,Dialog:cX,Empty:u.forwardRef((a,b)=>c0(a=>0===a.filtered.count)?u.createElement(a9.div,{ref:b,...a,"cmdk-empty":"",role:"presentation"}):null),Loading:u.forwardRef((a,b)=>{let{progress:c,children:d,label:e="Loading...",...f}=a;return u.createElement(a9.div,{ref:b,...f,"cmdk-loading":"",role:"progressbar","aria-valuenow":c,"aria-valuemin":0,"aria-valuemax":100,"aria-label":e},c3(a,a=>u.createElement("div",{"aria-hidden":!0},a)))})});function cZ(a){let b=u.useRef(a);return c$(()=>{b.current=a}),b}var c$=u.useEffect;function c_(a){let b=u.useRef();return void 0===b.current&&(b.current=a()),b}function c0(a){let b=u.useContext(cP),c=()=>a(b.snapshot());return u.useSyncExternalStore(b.subscribe,c,c)}function c1(a,b,c,d=[]){let e=u.useRef(),f=u.useContext(cO);return c$(()=>{var g;let h=(()=>{var a;for(let b of c){if("string"==typeof b)return b.trim();if("object"==typeof b&&"current"in b)return b.current?null==(a=b.current.textContent)?void 0:a.trim():e.current}})(),i=d.map(a=>a.trim());f.value(a,h,i),null==(g=b.current)||g.setAttribute(cM,h),e.current=h}),e}var c2=()=>{let[a,b]=u.useState(),c=c_(()=>new Map);return c$(()=>{c.current.forEach(a=>a()),c.current=new Map},[a]),(a,d)=>{c.current.set(a,d),b({})}};function c3({asChild:a,children:b},c){let d;return a&&u.isValidElement(b)?u.cloneElement("function"==typeof(d=b.type)?d(b.props):"render"in d?d.render(b.props):b,{ref:b.ref},c(b.props.children)):c(b)}var c4={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},c5=a.i(70106);let c6=(0,c5.default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);a.s(["Search",()=>c6],87532);let c7=(0,c5.default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);a.s(["X",()=>c7],33508);let c8=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(cn,{ref:c,className:aR("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...b}));c8.displayName=cn.displayName;let c9=u.forwardRef(({className:a,children:b,...c},d)=>(0,t.jsxs)(cl,{children:[(0,t.jsx)(c8,{}),(0,t.jsxs)(cr,{ref:d,className:aR("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...c,children:[b,(0,t.jsxs)(cA,{className:"absolute right-4 top-4 rounded-sm ring-offset-background transition-opacity hover:opacity-80 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground text-foreground",children:[(0,t.jsx)(c7,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));c9.displayName=cr.displayName;let da=({className:a,...b})=>(0,t.jsx)("div",{className:aR("flex flex-col space-y-1.5 text-center sm:text-left",a),...b});da.displayName="DialogHeader";let db=({className:a,...b})=>(0,t.jsx)("div",{className:aR("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...b});db.displayName="DialogFooter";let dc=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(cw,{ref:c,className:aR("text-lg font-semibold leading-none tracking-tight text-foreground",a),...b}));dc.displayName=cw.displayName;let dd=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(cy,{ref:c,className:aR("text-sm text-muted-foreground",a),...b}));dd.displayName=cy.displayName,a.s(["Dialog",()=>cf,"DialogContent",()=>c9,"DialogDescription",()=>dd,"DialogFooter",()=>db,"DialogHeader",()=>da,"DialogTitle",()=>dc],85442);let de=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(cY,{ref:c,className:aR("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",a),...b}));de.displayName=cY.displayName;let df=u.forwardRef(({className:a,...b},c)=>(0,t.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,t.jsx)(c6,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,t.jsx)(cY.Input,{ref:c,className:aR("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",a),...b})]}));df.displayName=cY.Input.displayName;let dg=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(cY.List,{ref:c,className:aR("max-h-[300px] overflow-y-auto overflow-x-hidden",a),...b}));dg.displayName=cY.List.displayName;let dh=u.forwardRef((a,b)=>(0,t.jsx)(cY.Empty,{ref:b,className:"py-6 text-center text-sm",...a}));dh.displayName=cY.Empty.displayName;let di=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(cY.Group,{ref:c,className:aR("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",a),...b}));di.displayName=cY.Group.displayName,u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(cY.Separator,{ref:c,className:aR("-mx-1 h-px bg-border",a),...b})).displayName=cY.Separator.displayName;let dj=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(cY.Item,{ref:c,className:aR("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a),...b}));dj.displayName=cY.Item.displayName;let dk=["top","right","bottom","left"],dl=Math.min,dm=Math.max,dn=Math.round,dp=Math.floor,dq=a=>({x:a,y:a}),dr={left:"right",right:"left",bottom:"top",top:"bottom"},ds={start:"end",end:"start"};function dt(a,b){return"function"==typeof a?a(b):a}function du(a){return a.split("-")[0]}function dv(a){return a.split("-")[1]}function dw(a){return"x"===a?"y":"x"}function dx(a){return"y"===a?"height":"width"}let dy=new Set(["top","bottom"]);function dz(a){return dy.has(du(a))?"y":"x"}function dA(a){return a.replace(/start|end/g,a=>ds[a])}let dB=["left","right"],dC=["right","left"],dD=["top","bottom"],dE=["bottom","top"];function dF(a){return a.replace(/left|right|bottom|top/g,a=>dr[a])}function dG(a){return"number"!=typeof a?{top:0,right:0,bottom:0,left:0,...a}:{top:a,right:a,bottom:a,left:a}}function dH(a){let{x:b,y:c,width:d,height:e}=a;return{width:d,height:e,top:c,left:b,right:b+d,bottom:c+e,x:b,y:c}}function dI(a,b,c){let d,{reference:e,floating:f}=a,g=dz(b),h=dw(dz(b)),i=dx(h),j=du(b),k="y"===g,l=e.x+e.width/2-f.width/2,m=e.y+e.height/2-f.height/2,n=e[i]/2-f[i]/2;switch(j){case"top":d={x:l,y:e.y-f.height};break;case"bottom":d={x:l,y:e.y+e.height};break;case"right":d={x:e.x+e.width,y:m};break;case"left":d={x:e.x-f.width,y:m};break;default:d={x:e.x,y:e.y}}switch(dv(b)){case"start":d[h]-=n*(c&&k?-1:1);break;case"end":d[h]+=n*(c&&k?-1:1)}return d}let dJ=async(a,b,c)=>{let{placement:d="bottom",strategy:e="absolute",middleware:f=[],platform:g}=c,h=f.filter(Boolean),i=await (null==g.isRTL?void 0:g.isRTL(b)),j=await g.getElementRects({reference:a,floating:b,strategy:e}),{x:k,y:l}=dI(j,d,i),m=d,n={},o=0;for(let c=0;c<h.length;c++){let{name:f,fn:p}=h[c],{x:q,y:r,data:s,reset:t}=await p({x:k,y:l,initialPlacement:d,placement:m,strategy:e,middlewareData:n,rects:j,platform:g,elements:{reference:a,floating:b}});k=null!=q?q:k,l=null!=r?r:l,n={...n,[f]:{...n[f],...s}},t&&o<=50&&(o++,"object"==typeof t&&(t.placement&&(m=t.placement),t.rects&&(j=!0===t.rects?await g.getElementRects({reference:a,floating:b,strategy:e}):t.rects),{x:k,y:l}=dI(j,m,i)),c=-1)}return{x:k,y:l,placement:m,strategy:e,middlewareData:n}};async function dK(a,b){var c;void 0===b&&(b={});let{x:d,y:e,platform:f,rects:g,elements:h,strategy:i}=a,{boundary:j="clippingAncestors",rootBoundary:k="viewport",elementContext:l="floating",altBoundary:m=!1,padding:n=0}=dt(b,a),o=dG(n),p=h[m?"floating"===l?"reference":"floating":l],q=dH(await f.getClippingRect({element:null==(c=await (null==f.isElement?void 0:f.isElement(p)))||c?p:p.contextElement||await (null==f.getDocumentElement?void 0:f.getDocumentElement(h.floating)),boundary:j,rootBoundary:k,strategy:i})),r="floating"===l?{x:d,y:e,width:g.floating.width,height:g.floating.height}:g.reference,s=await (null==f.getOffsetParent?void 0:f.getOffsetParent(h.floating)),t=await (null==f.isElement?void 0:f.isElement(s))&&await (null==f.getScale?void 0:f.getScale(s))||{x:1,y:1},u=dH(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:r,offsetParent:s,strategy:i}):r);return{top:(q.top-u.top+o.top)/t.y,bottom:(u.bottom-q.bottom+o.bottom)/t.y,left:(q.left-u.left+o.left)/t.x,right:(u.right-q.right+o.right)/t.x}}function dL(a,b){return{top:a.top-b.height,right:a.right-b.width,bottom:a.bottom-b.height,left:a.left-b.width}}function dM(a){return dk.some(b=>a[b]>=0)}let dN=new Set(["left","top"]);async function dO(a,b){let{placement:c,platform:d,elements:e}=a,f=await (null==d.isRTL?void 0:d.isRTL(e.floating)),g=du(c),h=dv(c),i="y"===dz(c),j=dN.has(g)?-1:1,k=f&&i?-1:1,l=dt(b,a),{mainAxis:m,crossAxis:n,alignmentAxis:o}="number"==typeof l?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return h&&"number"==typeof o&&(n="end"===h?-1*o:o),i?{x:n*k,y:m*j}:{x:m*j,y:n*k}}function dP(a){return function(a){return!1}(a)?(a.nodeName||"").toLowerCase():"#document"}function dQ(a){var b;return(null==a||null==(b=a.ownerDocument)?void 0:b.defaultView)||window}function dR(a){var b;return null==(b=(function(a){return!1}(a)?a.ownerDocument:a.document)||window.document)?void 0:b.documentElement}function dS(a){return!1}let dT=new Set(["inline","contents"]);function dU(a){let{overflow:b,overflowX:c,overflowY:d,display:e}=d3(a);return/auto|scroll|overlay|hidden|clip/.test(b+d+c)&&!dT.has(e)}let dV=new Set(["table","td","th"]),dW=[":popover-open",":modal"];function dX(a){return dW.some(b=>{try{return a.matches(b)}catch(a){return!1}})}let dY=["transform","translate","scale","rotate","perspective"],dZ=["transform","translate","scale","rotate","perspective","filter"],d$=["paint","layout","strict","content"];function d_(a){let b=d0(),c=a;return dY.some(a=>!!c[a]&&"none"!==c[a])||!!c.containerType&&"normal"!==c.containerType||!b&&!!c.backdropFilter&&"none"!==c.backdropFilter||!b&&!!c.filter&&"none"!==c.filter||dZ.some(a=>(c.willChange||"").includes(a))||d$.some(a=>(c.contain||"").includes(a))}function d0(){return!("u"<typeof CSS)&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let d1=new Set(["html","body","#document"]);function d2(a){return d1.has(dP(a))}function d3(a){return dQ(a).getComputedStyle(a)}function d4(a){return{scrollLeft:a.scrollX,scrollTop:a.scrollY}}function d5(a){if("html"===dP(a))return a;let b=a.assignedSlot||a.parentNode||!1||dR(a);return b}function d6(a,b,c){var d;void 0===b&&(b=[]),void 0===c&&(c=!0);let e=function a(b){let c=d5(b);return d2(c)?b.ownerDocument?b.ownerDocument.body:b.body:a(c)}(a),f=e===(null==(d=a.ownerDocument)?void 0:d.body),g=dQ(e);if(f){let a=d7(g);return b.concat(g,g.visualViewport||[],dU(e)?e:[],a&&c?d6(a):[])}return b.concat(e,d6(e,[],c))}function d7(a){return a.parent&&Object.getPrototypeOf(a.parent)?a.frameElement:null}function d8(a){let b=d3(a),c=parseFloat(b.width)||0,d=parseFloat(b.height)||0,e=!1,f=e?a.offsetWidth:c,g=e?a.offsetHeight:d,h=dn(c)!==f||dn(d)!==g;return h&&(c=f,d=g),{width:c,height:d,$:h}}function d9(a){return 0,a.contextElement}function ea(a){let b=d9(a);1;return dq(1)}let eb=dq(0);function ec(a){let b=dQ(a);return d0()&&b.visualViewport?{x:b.visualViewport.offsetLeft,y:b.visualViewport.offsetTop}:eb}function ed(a,b,c,d){var e;void 0===b&&(b=!1),void 0===c&&(c=!1);let f=a.getBoundingClientRect(),g=d9(a),h=dq(1);b&&(d||(h=ea(a)));let i=(void 0===(e=c)&&(e=!1),d&&(!e||d===dQ(g))&&e)?ec(g):dq(0),j=(f.left+i.x)/h.x,k=(f.top+i.y)/h.y,l=f.width/h.x,m=f.height/h.y;if(g){let a=dQ(g),b=d,c=a,e=d7(c);for(;e&&d&&b!==c;){let a=ea(e),b=e.getBoundingClientRect(),d=d3(e),f=b.left+(e.clientLeft+parseFloat(d.paddingLeft))*a.x,g=b.top+(e.clientTop+parseFloat(d.paddingTop))*a.y;j*=a.x,k*=a.y,l*=a.x,m*=a.y,j+=f,k+=g,e=d7(c=dQ(e))}}return dH({width:l,height:m,x:j,y:k})}function ee(a,b){let c=d4(a).scrollLeft;return b?b.left+c:ed(dR(a)).left+c}function ef(a,b){let c=a.getBoundingClientRect();return{x:c.left+b.scrollLeft-ee(a,c),y:c.top+b.scrollTop}}function eg(a,b,c){var d;let e;if("viewport"===b)e=function(a,b){let c=dQ(a),d=dR(a),e=c.visualViewport,f=d.clientWidth,g=d.clientHeight,h=0,i=0;if(e){f=e.width,g=e.height;let a=d0();(!a||a&&"fixed"===b)&&(h=e.offsetLeft,i=e.offsetTop)}let j=ee(d);if(j<=0){let a=d.ownerDocument,b=a.body,c=getComputedStyle(b),e="CSS1Compat"===a.compatMode&&parseFloat(c.marginLeft)+parseFloat(c.marginRight)||0,g=Math.abs(d.clientWidth-b.clientWidth-e);g<=25&&(f-=g)}else j<=25&&(f+=j);return{width:f,height:g,x:h,y:i}}(a,c);else if("document"===b){let b,c,f,g,h,i,j;d=dR(a),b=dR(d),c=d4(d),f=d.ownerDocument.body,g=dm(b.scrollWidth,b.clientWidth,f.scrollWidth,f.clientWidth),h=dm(b.scrollHeight,b.clientHeight,f.scrollHeight,f.clientHeight),i=-c.scrollLeft+ee(d),j=-c.scrollTop,"rtl"===d3(f).direction&&(i+=dm(b.clientWidth,f.clientWidth)-g),e={width:g,height:h,x:i,y:j}}else{1;{let c=ec(a);e={x:b.x-c.x,y:b.y-c.y,width:b.width,height:b.height}}}return dH(e)}function eh(a){return"static"===d3(a).position}function ei(a,b){1;return null}function ej(a,b){var c;let d=dQ(a);if(dX(a))return d;1;{let b=d5(a);for(;b&&!d2(b);){0;b=d5(b)}return d}}let ek=async function(a){let b=this.getOffsetParent||ej,c=this.getDimensions,d=await c(a.floating);return{reference:function(a,b,c){var d;let e=(d=0,!1),f=dR(b),g="fixed"===c,h=ed(a,!0,g,b),i={scrollLeft:0,scrollTop:0},j=dq(0);if(e||!e&&!g)if(("body"!==dP(b)||dU(f))&&(i=d4(b)),e){let a=ed(b,!0,g,b);j.x=a.x+b.clientLeft,j.y=a.y+b.clientTop}else f&&(j.x=ee(f));g&&!e&&f&&(j.x=ee(f));let k=!f||e||g?dq(0):ef(f,i);return{x:h.left+i.scrollLeft-j.x-k.x,y:h.top+i.scrollTop-j.y-k.y,width:h.width,height:h.height}}(a.reference,await b(a.floating),a.strategy),floating:{x:0,y:0,width:d.width,height:d.height}}},el={convertOffsetParentRelativeRectToViewportRelativeRect:function(a){var b,c;let{elements:d,rect:e,offsetParent:f,strategy:g}=a,h="fixed"===g,i=dR(f),j=!!d&&dX(d.floating);if(f===i||j&&h)return e;let k={scrollLeft:0,scrollTop:0},l=dq(1),m=dq(0),n=(b=0,!1);(n||!n&&!h)&&(("body"!==dP(f)||dU(i))&&(k=d4(f)),c=0,0);let o=!i||n||h?dq(0):ef(i,k);return{width:e.width*l.x,height:e.height*l.y,x:e.x*l.x-k.scrollLeft*l.x+m.x+o.x,y:e.y*l.y-k.scrollTop*l.y+m.y+o.y}},getDocumentElement:dR,getClippingRect:function(a){let{element:b,boundary:c,rootBoundary:d,strategy:e}=a,f=[..."clippingAncestors"===c?dX(b)?[]:function(a,b){var c;let d=b.get(a);if(d)return d;let e=d6(a,[],!1).filter(a=>{var b;return b=0,!1}),f="fixed"===d3(a).position,g=f?d5(a):a;return c=0,b.set(a,e),e}(b,this._c):[].concat(c),d],g=f[0],h=f.reduce((a,c)=>{let d=eg(b,c,e);return a.top=dm(d.top,a.top),a.right=dl(d.right,a.right),a.bottom=dl(d.bottom,a.bottom),a.left=dm(d.left,a.left),a},eg(b,g,e));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}},getOffsetParent:ej,getElementRects:ek,getClientRects:function(a){return Array.from(a.getClientRects())},getDimensions:function(a){let{width:b,height:c}=d8(a);return{width:b,height:c}},getScale:ea,isElement:dS,isRTL:function(a){return"rtl"===d3(a).direction}};function em(a,b){return a.x===b.x&&a.y===b.y&&a.width===b.width&&a.height===b.height}let en=a=>({name:"arrow",options:a,async fn(b){let{x:c,y:d,placement:e,rects:f,platform:g,elements:h,middlewareData:i}=b,{element:j,padding:k=0}=dt(a,b)||{};if(null==j)return{};let l=dG(k),m={x:c,y:d},n=dw(dz(e)),o=dx(n),p=await g.getDimensions(j),q="y"===n,r=q?"clientHeight":"clientWidth",s=f.reference[o]+f.reference[n]-m[n]-f.floating[o],t=m[n]-f.reference[n],u=await (null==g.getOffsetParent?void 0:g.getOffsetParent(j)),v=u?u[r]:0;v&&await (null==g.isElement?void 0:g.isElement(u))||(v=h.floating[r]||f.floating[o]);let w=v/2-p[o]/2-1,x=dl(l[q?"top":"left"],w),y=dl(l[q?"bottom":"right"],w),z=v-p[o]-y,A=v/2-p[o]/2+(s/2-t/2),B=dm(x,dl(A,z)),C=!i.arrow&&null!=dv(e)&&A!==B&&f.reference[o]/2-(A<x?x:y)-p[o]/2<0,D=C?A<x?A-x:A-z:0;return{[n]:m[n]+D,data:{[n]:B,centerOffset:A-B-D,...C&&{alignmentOffset:D}},reset:C}}});var eo="u">typeof document?u.useLayoutEffect:function(){};function ep(a,b){let c,d,e;if(a===b)return!0;if(typeof a!=typeof b)return!1;if("function"==typeof a&&a.toString()===b.toString())return!0;if(a&&b&&"object"==typeof a){if(Array.isArray(a)){if((c=a.length)!==b.length)return!1;for(d=c;0!=d--;)if(!ep(a[d],b[d]))return!1;return!0}if((c=(e=Object.keys(a)).length)!==Object.keys(b).length)return!1;for(d=c;0!=d--;)if(!({}).hasOwnProperty.call(b,e[d]))return!1;for(d=c;0!=d--;){let c=e[d];if(("_owner"!==c||!a.$$typeof)&&!ep(a[c],b[c]))return!1}return!0}return a!=a&&b!=b}function eq(a,b){let c=1;return Math.round(b*c)/c}function er(a){let b=u.useRef(a);return eo(()=>{b.current=a}),b}var es=u.forwardRef((a,b)=>{let{children:c,width:d=10,height:e=5,...f}=a;return(0,t.jsx)(a9.svg,{...f,ref:b,width:d,height:e,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:a.asChild?c:(0,t.jsx)("polygon",{points:"0,0 30,0 15,10"})})});function et(a){let[b,c]=u.useState(void 0);return a0(()=>{if(a){c({width:a.offsetWidth,height:a.offsetHeight});let b=new ResizeObserver(b=>{let d,e;if(!Array.isArray(b)||!b.length)return;let f=b[0];if("borderBoxSize"in f){let a=f.borderBoxSize,b=Array.isArray(a)?a[0]:a;d=b.inlineSize,e=b.blockSize}else d=a.offsetWidth,e=a.offsetHeight;c({width:d,height:e})});return b.observe(a,{box:"border-box"}),()=>b.unobserve(a)}c(void 0)},[a]),b}es.displayName="Arrow",a.s(["useSize",()=>et],3688);var eu="Popper",[ev,ew]=a_(eu),[ex,ey]=ev(eu),ez=a=>{let{__scopePopper:b,children:c}=a,[d,e]=u.useState(null);return(0,t.jsx)(ex,{scope:b,anchor:d,onAnchorChange:e,children:c})};ez.displayName=eu;var eA="PopperAnchor",eB=u.forwardRef((a,b)=>{let{__scopePopper:c,virtualRef:d,...e}=a,f=ey(eA,c),g=u.useRef(null),h=A(b,g),i=u.useRef(null);return u.useEffect(()=>{let a=i.current;i.current=d?.current||g.current,a!==i.current&&f.onAnchorChange(i.current)}),d?null:(0,t.jsx)(a9.div,{...e,ref:h})});eB.displayName=eA;var eC="PopperContent",[eD,eE]=ev(eC),eF=u.forwardRef((a,b)=>{var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,v,w,x,y;let{__scopePopper:z,side:B="bottom",sideOffset:C=0,align:D="center",alignOffset:E=0,arrowPadding:F=0,avoidCollisions:G=!0,collisionBoundary:H=[],collisionPadding:I=0,sticky:J="partial",hideWhenDetached:K=!1,updatePositionStrategy:L="optimized",onPlaced:M,...N}=a,O=ey(eC,z),[P,Q]=u.useState(null),R=A(b,a=>Q(a)),[S,T]=u.useState(null),U=et(S),V=U?.width??0,W=U?.height??0,X="number"==typeof I?I:{top:0,right:0,bottom:0,left:0,...I},Y=Array.isArray(H)?H:[H],Z=Y.length>0,$={padding:X,boundary:Y.filter(eJ),altBoundary:Z},{refs:_,floatingStyles:aa,placement:ab,isPositioned:ac,middlewareData:ad}=function(a){void 0===a&&(a={});let{placement:b="bottom",strategy:c="absolute",middleware:d=[],platform:e,elements:{reference:f,floating:g}={},transform:h=!0,whileElementsMounted:i,open:j}=a,[k,l]=u.useState({x:0,y:0,strategy:c,placement:b,middlewareData:{},isPositioned:!1}),[m,n]=u.useState(d);ep(m,d)||n(d);let[o,p]=u.useState(null),[q,r]=u.useState(null),s=u.useCallback(a=>{a!==x.current&&(x.current=a,p(a))},[]),t=u.useCallback(a=>{a!==y.current&&(y.current=a,r(a))},[]),v=f||o,w=g||q,x=u.useRef(null),y=u.useRef(null),z=u.useRef(k),A=null!=i,B=er(i),C=er(e),D=er(j),E=u.useCallback(()=>{var a,d;let e,f,g;if(!x.current||!y.current)return;let h={placement:b,strategy:c,middleware:m};C.current&&(h.platform=C.current),(a=x.current,d=y.current,e=new Map,g={...(f={platform:el,...h}).platform,_c:e},dJ(a,d,{...f,platform:g})).then(a=>{let b={...a,isPositioned:!1!==D.current};F.current&&!ep(z.current,b)&&(z.current=b,a6.flushSync(()=>{l(b)}))})},[m,b,c,C,D]);eo(()=>{!1===j&&z.current.isPositioned&&(z.current.isPositioned=!1,l(a=>({...a,isPositioned:!1})))},[j]);let F=u.useRef(!1);eo(()=>(F.current=!0,()=>{F.current=!1}),[]),eo(()=>{if(v&&(x.current=v),w&&(y.current=w),v&&w){if(B.current)return B.current(v,w,E);E()}},[v,w,E,B,A]);let G=u.useMemo(()=>({reference:x,floating:y,setReference:s,setFloating:t}),[s,t]),H=u.useMemo(()=>({reference:v,floating:w}),[v,w]),I=u.useMemo(()=>{let a={position:c,left:0,top:0};if(!H.floating)return a;let b=eq(H.floating,k.x),d=eq(H.floating,k.y);if(h)return{...a,transform:"translate("+b+"px, "+d+"px)",...(H.floating,false)};return{position:c,left:b,top:d}},[c,h,H.floating,k.x,k.y]);return u.useMemo(()=>({...k,update:E,refs:G,elements:H,floatingStyles:I}),[k,E,G,H,I])}({strategy:"fixed",placement:B+("center"!==D?"-"+D:""),whileElementsMounted:(...a)=>(function(a,b,c,d){let e;void 0===d&&(d={});let{ancestorScroll:f=!0,ancestorResize:g=!0,elementResize:h="function"==typeof ResizeObserver,layoutShift:i="function"==typeof IntersectionObserver,animationFrame:j=!1}=d,k=d9(a),l=f||g?[...k?d6(k):[],...d6(b)]:[];l.forEach(a=>{f&&a.addEventListener("scroll",c,{passive:!0}),g&&a.addEventListener("resize",c)});let m=k&&i?function(a,b){let c,d=null,e=dR(a);function f(){var a;clearTimeout(c),null==(a=d)||a.disconnect(),d=null}return!function g(h,i){void 0===h&&(h=!1),void 0===i&&(i=1),f();let j=a.getBoundingClientRect(),{left:k,top:l,width:m,height:n}=j;if(h||b(),!m||!n)return;let o={rootMargin:-dp(l)+"px "+-dp(e.clientWidth-(k+m))+"px "+-dp(e.clientHeight-(l+n))+"px "+-dp(k)+"px",threshold:dm(0,dl(1,i))||1},p=!0;function q(b){let d=b[0].intersectionRatio;if(d!==i){if(!p)return g();d?g(!1,d):c=setTimeout(()=>{g(!1,1e-7)},1e3)}1!==d||em(j,a.getBoundingClientRect())||g(),p=!1}try{d=new IntersectionObserver(q,{...o,root:e.ownerDocument})}catch(a){d=new IntersectionObserver(q,o)}d.observe(a)}(!0),f}(k,c):null,n=-1,o=null;h&&(o=new ResizeObserver(a=>{let[d]=a;d&&d.target===k&&o&&(o.unobserve(b),cancelAnimationFrame(n),n=requestAnimationFrame(()=>{var a;null==(a=o)||a.observe(b)})),c()}),k&&!j&&o.observe(k),o.observe(b));let p=j?ed(a):null;return j&&function b(){let d=ed(a);p&&!em(p,d)&&c(),p=d,e=requestAnimationFrame(b)}(),c(),()=>{var a;l.forEach(a=>{f&&a.removeEventListener("scroll",c),g&&a.removeEventListener("resize",c)}),null==m||m(),null==(a=o)||a.disconnect(),o=null,j&&cancelAnimationFrame(e)}})(...a,{animationFrame:"always"===L}),elements:{reference:O.anchor},middleware:[{...{name:"offset",options:e=c={mainAxis:C+W,alignmentAxis:E},async fn(a){var b,c;let{x:d,y:f,placement:g,middlewareData:h}=a,i=await dO(a,e);return g===(null==(b=h.offset)?void 0:b.placement)&&null!=(c=h.arrow)&&c.alignmentOffset?{}:{x:d+i.x,y:f+i.y,data:{...i,placement:g}}}},options:[c,d]},G&&{...{name:"shift",options:k=i={mainAxis:!0,crossAxis:!1,limiter:"partial"===J?{...(void 0===(h=f)&&(h={}),{options:h,fn(a){let{x:b,y:c,placement:d,rects:e,middlewareData:f}=a,{offset:g=0,mainAxis:i=!0,crossAxis:j=!0}=dt(h,a),k={x:b,y:c},l=dz(d),m=dw(l),n=k[m],o=k[l],p=dt(g,a),q="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(i){let a="y"===m?"height":"width",b=e.reference[m]-e.floating[a]+q.mainAxis,c=e.reference[m]+e.reference[a]-q.mainAxis;n<b?n=b:n>c&&(n=c)}if(j){var r,s;let a="y"===m?"width":"height",b=dN.has(du(d)),c=e.reference[l]-e.floating[a]+(b&&(null==(r=f.offset)?void 0:r[l])||0)+(b?0:q.crossAxis),g=e.reference[l]+e.reference[a]+(b?0:(null==(s=f.offset)?void 0:s[l])||0)-(b?q.crossAxis:0);o<c?o=c:o>g&&(o=g)}return{[m]:n,[l]:o}}}),options:[f,g]}:void 0,...$},async fn(a){let{x:b,y:c,placement:d}=a,{mainAxis:e=!0,crossAxis:f=!1,limiter:g={fn:a=>{let{x:b,y:c}=a;return{x:b,y:c}}},...h}=dt(k,a),i={x:b,y:c},j=await dK(a,h),l=dz(du(d)),m=dw(l),n=i[m],o=i[l];if(e){let a="y"===m?"top":"left",b="y"===m?"bottom":"right",c=n+j[a],d=n-j[b];n=dm(c,dl(n,d))}if(f){let a="y"===l?"top":"left",b="y"===l?"bottom":"right",c=o+j[a],d=o-j[b];o=dm(c,dl(o,d))}let p=g.fn({...a,[m]:n,[l]:o});return{...p,data:{x:p.x-b,y:p.y-c,enabled:{[m]:e,[l]:f}}}}},options:[i,j]},G&&{...{name:"flip",options:n=l={...$},async fn(a){var b,c,d,e,f,g,h,i;let j,k,l,{placement:m,middlewareData:o,rects:p,initialPlacement:q,platform:r,elements:s}=a,{mainAxis:t=!0,crossAxis:u=!0,fallbackPlacements:v,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...z}=dt(n,a);if(null!=(b=o.arrow)&&b.alignmentOffset)return{};let A=du(m),B=dz(q),C=du(q)===q,D=await (null==r.isRTL?void 0:r.isRTL(s.floating)),E=v||(C||!y?[dF(q)]:(j=dF(q),[dA(q),j,dA(j)])),F="none"!==x;!v&&F&&E.push(...(k=dv(q),l=function(a,b,c){switch(a){case"top":case"bottom":if(c)return b?dC:dB;return b?dB:dC;case"left":case"right":return b?dD:dE;default:return[]}}(du(q),"start"===x,D),k&&(l=l.map(a=>a+"-"+k),y&&(l=l.concat(l.map(dA)))),l));let G=[q,...E],H=await dK(a,z),I=[],J=(null==(c=o.flip)?void 0:c.overflows)||[];if(t&&I.push(H[A]),u){let a,b,c,d,e=(g=m,h=p,void 0===(i=D)&&(i=!1),a=dv(g),c=dx(b=dw(dz(g))),d="x"===b?a===(i?"end":"start")?"right":"left":"start"===a?"bottom":"top",h.reference[c]>h.floating[c]&&(d=dF(d)),[d,dF(d)]);I.push(H[e[0]],H[e[1]])}if(J=[...J,{placement:m,overflows:I}],!I.every(a=>a<=0)){let a=((null==(d=o.flip)?void 0:d.index)||0)+1,b=G[a];if(b&&("alignment"!==u||B===dz(b)||J.every(a=>dz(a.placement)!==B||a.overflows[0]>0)))return{data:{index:a,overflows:J},reset:{placement:b}};let c=null==(e=J.filter(a=>a.overflows[0]<=0).sort((a,b)=>a.overflows[1]-b.overflows[1])[0])?void 0:e.placement;if(!c)switch(w){case"bestFit":{let a=null==(f=J.filter(a=>{if(F){let b=dz(a.placement);return b===B||"y"===b}return!0}).map(a=>[a.placement,a.overflows.filter(a=>a>0).reduce((a,b)=>a+b,0)]).sort((a,b)=>a[1]-b[1])[0])?void 0:f[0];a&&(c=a);break}case"initialPlacement":c=q}if(m!==c)return{reset:{placement:c}}}return{}}},options:[l,m]},{...{name:"size",options:q=o={...$,apply:({elements:a,rects:b,availableWidth:c,availableHeight:d})=>{let{width:e,height:f}=b.reference,g=a.floating.style;g.setProperty("--radix-popper-available-width",`${c}px`),g.setProperty("--radix-popper-available-height",`${d}px`),g.setProperty("--radix-popper-anchor-width",`${e}px`),g.setProperty("--radix-popper-anchor-height",`${f}px`)}},async fn(a){var b,c;let d,e,{placement:f,rects:g,platform:h,elements:i}=a,{apply:j=()=>{},...k}=dt(q,a),l=await dK(a,k),m=du(f),n=dv(f),o="y"===dz(f),{width:p,height:r}=g.floating;"top"===m||"bottom"===m?(d=m,e=n===(await (null==h.isRTL?void 0:h.isRTL(i.floating))?"start":"end")?"left":"right"):(e=m,d="end"===n?"top":"bottom");let s=r-l.top-l.bottom,t=p-l.left-l.right,u=dl(r-l[d],s),v=dl(p-l[e],t),w=!a.middlewareData.shift,x=u,y=v;if(null!=(b=a.middlewareData.shift)&&b.enabled.x&&(y=t),null!=(c=a.middlewareData.shift)&&c.enabled.y&&(x=s),w&&!n){let a=dm(l.left,0),b=dm(l.right,0),c=dm(l.top,0),d=dm(l.bottom,0);o?y=p-2*(0!==a||0!==b?a+b:dm(l.left,l.right)):x=r-2*(0!==c||0!==d?c+d:dm(l.top,l.bottom))}await j({...a,availableWidth:y,availableHeight:x});let z=await h.getDimensions(i.floating);return p!==z.width||r!==z.height?{reset:{rects:!0}}:{}}},options:[o,p]},S&&{...{name:"arrow",options:v=r={element:S,padding:F},fn(a){let{element:b,padding:c}="function"==typeof v?v(a):v;return b&&({}).hasOwnProperty.call(b,"current")?null!=b.current?en({element:b.current,padding:c}).fn(a):{}:b?en({element:b,padding:c}).fn(a):{}}},options:[r,s]},eK({arrowWidth:V,arrowHeight:W}),K&&{...{name:"hide",options:y=w={strategy:"referenceHidden",...$},async fn(a){let{rects:b}=a,{strategy:c="referenceHidden",...d}=dt(y,a);switch(c){case"referenceHidden":{let c=dL(await dK(a,{...d,elementContext:"reference"}),b.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:dM(c)}}}case"escaped":{let c=dL(await dK(a,{...d,altBoundary:!0}),b.floating);return{data:{escapedOffsets:c,escaped:dM(c)}}}default:return{}}}},options:[w,x]}]}),[ae,af]=eL(ab),ag=bb(M);a0(()=>{ac&&ag?.()},[ac,ag]);let ah=ad.arrow?.x,ai=ad.arrow?.y,aj=ad.arrow?.centerOffset!==0,[ak,al]=u.useState();return a0(()=>{P&&al(window.getComputedStyle(P).zIndex)},[P]),(0,t.jsx)("div",{ref:_.setFloating,"data-radix-popper-content-wrapper":"",style:{...aa,transform:ac?aa.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ak,"--radix-popper-transform-origin":[ad.transformOrigin?.x,ad.transformOrigin?.y].join(" "),...ad.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:(0,t.jsx)(eD,{scope:z,placedSide:ae,onArrowChange:T,arrowX:ah,arrowY:ai,shouldHideArrow:aj,children:(0,t.jsx)(a9.div,{"data-side":ae,"data-align":af,...N,ref:R,style:{...N.style,animation:ac?void 0:"none"}})})})});eF.displayName=eC;var eG="PopperArrow",eH={top:"bottom",right:"left",bottom:"top",left:"right"},eI=u.forwardRef(function(a,b){let{__scopePopper:c,...d}=a,e=eE(eG,c),f=eH[e.placedSide];return(0,t.jsx)("span",{ref:e.onArrowChange,style:{position:"absolute",left:e.arrowX,top:e.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[e.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[e.placedSide],visibility:e.shouldHideArrow?"hidden":void 0},children:(0,t.jsx)(es,{...d,ref:b,style:{...d.style,display:"block"}})})});function eJ(a){return null!==a}eI.displayName=eG;var eK=a=>({name:"transformOrigin",options:a,fn(b){let{placement:c,rects:d,middlewareData:e}=b,f=e.arrow?.centerOffset!==0,g=f?0:a.arrowWidth,h=f?0:a.arrowHeight,[i,j]=eL(c),k={start:"0%",center:"50%",end:"100%"}[j],l=(e.arrow?.x??0)+g/2,m=(e.arrow?.y??0)+h/2,n="",o="";return"bottom"===i?(n=f?k:`${l}px`,o=`${-h}px`):"top"===i?(n=f?k:`${l}px`,o=`${d.floating.height+h}px`):"right"===i?(n=`${-h}px`,o=f?k:`${m}px`):"left"===i&&(n=`${d.floating.width+h}px`,o=f?k:`${m}px`),{data:{x:n,y:o}}}});function eL(a){let[b,c="center"]=a.split("-");return[b,c]}a.s(["Anchor",()=>eB,"Arrow",()=>eI,"Content",()=>eF,"Root",()=>ez,"createPopperScope",()=>ew],4691);var eM=Symbol("radix.slottable");function eN(a){return u.isValidElement(a)&&"function"==typeof a.type&&"__radixId"in a.type&&a.type.__radixId===eM}var eO="Popover",[eP,eQ]=a_(eO,[ew]),eR=ew(),[eS,eT]=eP(eO),eU=a=>{let{__scopePopover:b,children:c,open:d,defaultOpen:e,onOpenChange:f,modal:g=!1}=a,h=eR(b),i=u.useRef(null),[j,k]=u.useState(!1),[l,m]=a5({prop:d,defaultProp:e??!1,onChange:f,caller:eO});return(0,t.jsx)(ez,{...h,children:(0,t.jsx)(eS,{scope:b,contentId:a3(),triggerRef:i,open:l,onOpenChange:m,onOpenToggle:u.useCallback(()=>m(a=>!a),[m]),hasCustomAnchor:j,onCustomAnchorAdd:u.useCallback(()=>k(!0),[]),onCustomAnchorRemove:u.useCallback(()=>k(!1),[]),modal:g,children:c})})};eU.displayName=eO;var eV="PopoverAnchor";u.forwardRef((a,b)=>{let{__scopePopover:c,...d}=a,e=eT(eV,c),f=eR(c),{onCustomAnchorAdd:g,onCustomAnchorRemove:h}=e;return u.useEffect(()=>(g(),()=>h()),[g,h]),(0,t.jsx)(eB,{...f,...d,ref:b})}).displayName=eV;var eW="PopoverTrigger",eX=u.forwardRef((a,b)=>{let{__scopePopover:c,...d}=a,e=eT(eW,c),f=eR(c),g=A(b,e.triggerRef),h=(0,t.jsx)(a9.button,{type:"button","aria-haspopup":"dialog","aria-expanded":e.open,"aria-controls":e.contentId,"data-state":e7(e.open),...d,ref:g,onClick:aZ(a.onClick,e.onOpenToggle)});return e.hasCustomAnchor?h:(0,t.jsx)(eB,{asChild:!0,...f,children:h})});eX.displayName=eW;var eY="PopoverPortal",[eZ,e$]=eP(eY,{forceMount:void 0}),e_=a=>{let{__scopePopover:b,forceMount:c,children:d,container:e}=a,f=eT(eY,b);return(0,t.jsx)(eZ,{scope:b,forceMount:c,children:(0,t.jsx)(br,{present:c||f.open,children:(0,t.jsx)(bq,{asChild:!0,container:e,children:d})})})};e_.displayName=eY;var e0="PopoverContent",e1=u.forwardRef((a,b)=>{let c=e$(e0,a.__scopePopover),{forceMount:d=c.forceMount,...e}=a,f=eT(e0,a.__scopePopover);return(0,t.jsx)(br,{present:d||f.open,children:f.modal?(0,t.jsx)(e3,{...e,ref:b}):(0,t.jsx)(e4,{...e,ref:b})})});e1.displayName=e0;var e2=((j=u.forwardRef((a,b)=>{let{children:c,...d}=a;if(u.isValidElement(c)){var e;let a,f,g=(e=c,(f=(a=Object.getOwnPropertyDescriptor(e.props,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.ref:(f=(a=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.props.ref:e.props.ref||e.ref),h=function(a,b){let c={...b};for(let d in b){let e=a[d],f=b[d];/^on[A-Z]/.test(d)?e&&f?c[d]=(...a)=>{let b=f(...a);return e(...a),b}:e&&(c[d]=e):"style"===d?c[d]={...e,...f}:"className"===d&&(c[d]=[e,f].filter(Boolean).join(" "))}return{...a,...c}}(d,c.props);return c.type!==u.Fragment&&(h.ref=b?z(b,g):g),u.cloneElement(c,h)}return u.Children.count(c)>1?u.Children.only(null):null})).displayName="PopoverContent.RemoveScroll.SlotClone",d=j,(e=u.forwardRef((a,b)=>{let{children:c,...e}=a,f=u.Children.toArray(c),g=f.find(eN);if(g){let a=g.props.children,c=f.map(b=>b!==g?b:u.Children.count(a)>1?u.Children.only(null):u.isValidElement(a)?a.props.children:null);return(0,t.jsx)(d,{...e,ref:b,children:u.isValidElement(a)?u.cloneElement(a,void 0,c):null})}return(0,t.jsx)(d,{...e,ref:b,children:c})})).displayName="PopoverContent.RemoveScroll.Slot",e),e3=u.forwardRef((a,b)=>{let c=eT(e0,a.__scopePopover),d=u.useRef(null),e=A(b,d),f=u.useRef(!1);return u.useEffect(()=>{let a=d.current;if(a)return b7(a)},[]),(0,t.jsx)(b0,{as:e2,allowPinchZoom:!0,children:(0,t.jsx)(e5,{...a,ref:e,trapFocus:c.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:aZ(a.onCloseAutoFocus,a=>{a.preventDefault(),f.current||c.triggerRef.current?.focus()}),onPointerDownOutside:aZ(a.onPointerDownOutside,a=>{let b=a.detail.originalEvent,c=0===b.button&&!0===b.ctrlKey;f.current=2===b.button||c},{checkForDefaultPrevented:!1}),onFocusOutside:aZ(a.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),e4=u.forwardRef((a,b)=>{let c=eT(e0,a.__scopePopover),d=u.useRef(!1),e=u.useRef(!1);return(0,t.jsx)(e5,{...a,ref:b,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:b=>{a.onCloseAutoFocus?.(b),b.defaultPrevented||(d.current||c.triggerRef.current?.focus(),b.preventDefault()),d.current=!1,e.current=!1},onInteractOutside:b=>{a.onInteractOutside?.(b),b.defaultPrevented||(d.current=!0,"pointerdown"===b.detail.originalEvent.type&&(e.current=!0));let f=b.target;c.triggerRef.current?.contains(f)&&b.preventDefault(),"focusin"===b.detail.originalEvent.type&&e.current&&b.preventDefault()}})}),e5=u.forwardRef((a,b)=>{let{__scopePopover:c,trapFocus:d,onOpenAutoFocus:e,onCloseAutoFocus:f,disableOutsidePointerEvents:g,onEscapeKeyDown:h,onPointerDownOutside:i,onFocusOutside:j,onInteractOutside:k,...l}=a,m=eT(e0,c),n=eR(c);return bu(),(0,t.jsx)(bk,{asChild:!0,loop:!0,trapped:d,onMountAutoFocus:e,onUnmountAutoFocus:f,children:(0,t.jsx)(be,{asChild:!0,disableOutsidePointerEvents:g,onInteractOutside:k,onEscapeKeyDown:h,onPointerDownOutside:i,onFocusOutside:j,onDismiss:()=>m.onOpenChange(!1),children:(0,t.jsx)(eF,{"data-state":e7(m.open),role:"dialog",id:m.contentId,...n,...l,ref:b,style:{...l.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),e6="PopoverClose";function e7(a){return a?"open":"closed"}u.forwardRef((a,b)=>{let{__scopePopover:c,...d}=a,e=eT(e6,c);return(0,t.jsx)(a9.button,{type:"button",...d,ref:b,onClick:aZ(a.onClick,()=>e.onOpenChange(!1))})}).displayName=e6,u.forwardRef((a,b)=>{let{__scopePopover:c,...d}=a,e=eR(c);return(0,t.jsx)(eI,{...e,...d,ref:b})}).displayName="PopoverArrow";let e8=u.forwardRef(({className:a,align:b="center",sideOffset:c=4,...d},e)=>(0,t.jsx)(e_,{children:(0,t.jsx)(e1,{ref:e,align:b,sideOffset:c,className:aR("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",a),...d})}));e8.displayName=e1.displayName;let e9=u.forwardRef(({className:a,type:b,...c},d)=>(0,t.jsx)("input",{type:b,className:aR("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",a),ref:d,...c}));e9.displayName="Input",a.s(["Input",()=>e9],22027);let fa=(0,c5.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);a.s(["Check",()=>fa],33441);let fb=(0,c5.default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),fc=(0,c5.default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);a.s(["Plus",()=>fc],15618);let fd=(0,c5.default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);a.s(["FileText",()=>fd],4720);let fe=(0,c5.default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]),ff=(0,c5.default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),fg=(0,c5.default)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),fh=(0,c5.default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]),fi=(0,c5.default)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),fj=(0,c5.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);a.s(["ChevronDown",()=>fj],5784);let fk=(0,c5.default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);a.s(["ChevronRight",()=>fk],50522);var fl=a.i(5500),fm=a.i(31186);let fn=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)("textarea",{className:aR("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",a),ref:c,...b}));function fo(a){let b=u.useRef({value:a,previous:a});return u.useMemo(()=>(b.current.value!==a&&(b.current.previous=b.current.value,b.current.value=a),b.current.previous),[a])}fn.displayName="Textarea",a.s(["Textarea",()=>fn],6219),a.s(["usePrevious",()=>fo],56558);var fp="Checkbox",[fq,fr]=a_(fp),[fs,ft]=fq(fp);function fu(a){let{__scopeCheckbox:b,checked:c,children:d,defaultChecked:e,disabled:f,form:g,name:h,onCheckedChange:i,required:j,value:k="on",internal_do_not_use_render:l}=a,[m,n]=a5({prop:c,defaultProp:e??!1,onChange:i,caller:fp}),[o,p]=u.useState(null),[q,r]=u.useState(null),s=u.useRef(!1),v=!o||!!g||!!o.closest("form"),w={checked:m,disabled:f,setChecked:n,control:o,setControl:p,name:h,form:g,value:k,hasConsumerStoppedPropagationRef:s,required:j,defaultChecked:!fC(e)&&e,isFormControl:v,bubbleInput:q,setBubbleInput:r};return(0,t.jsx)(fs,{scope:b,...w,children:"function"==typeof l?l(w):d})}var fv="CheckboxTrigger",fw=u.forwardRef(({__scopeCheckbox:a,onKeyDown:b,onClick:c,...d},e)=>{let{control:f,value:g,disabled:h,checked:i,required:j,setControl:k,setChecked:l,hasConsumerStoppedPropagationRef:m,isFormControl:n,bubbleInput:o}=ft(fv,a),p=A(e,k),q=u.useRef(i);return u.useEffect(()=>{let a=f?.form;if(a){let b=()=>l(q.current);return a.addEventListener("reset",b),()=>a.removeEventListener("reset",b)}},[f,l]),(0,t.jsx)(a9.button,{type:"button",role:"checkbox","aria-checked":fC(i)?"mixed":i,"aria-required":j,"data-state":fD(i),"data-disabled":h?"":void 0,disabled:h,value:g,...d,ref:p,onKeyDown:aZ(b,a=>{"Enter"===a.key&&a.preventDefault()}),onClick:aZ(c,a=>{l(a=>!!fC(a)||!a),o&&n&&(m.current=a.isPropagationStopped(),m.current||a.stopPropagation())})})});fw.displayName=fv;var fx=u.forwardRef((a,b)=>{let{__scopeCheckbox:c,name:d,checked:e,defaultChecked:f,required:g,disabled:h,value:i,onCheckedChange:j,form:k,...l}=a;return(0,t.jsx)(fu,{__scopeCheckbox:c,checked:e,defaultChecked:f,disabled:h,required:g,onCheckedChange:j,name:d,form:k,value:i,internal_do_not_use_render:({isFormControl:a})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(fw,{...l,ref:b,__scopeCheckbox:c}),a&&(0,t.jsx)(fB,{__scopeCheckbox:c})]})})});fx.displayName=fp;var fy="CheckboxIndicator",fz=u.forwardRef((a,b)=>{let{__scopeCheckbox:c,forceMount:d,...e}=a,f=ft(fy,c);return(0,t.jsx)(br,{present:d||fC(f.checked)||!0===f.checked,children:(0,t.jsx)(a9.span,{"data-state":fD(f.checked),"data-disabled":f.disabled?"":void 0,...e,ref:b,style:{pointerEvents:"none",...a.style}})})});fz.displayName=fy;var fA="CheckboxBubbleInput",fB=u.forwardRef(({__scopeCheckbox:a,...b},c)=>{let{control:d,hasConsumerStoppedPropagationRef:e,checked:f,defaultChecked:g,required:h,disabled:i,name:j,value:k,form:l,bubbleInput:m,setBubbleInput:n}=ft(fA,a),o=A(c,n),p=fo(f),q=et(d);u.useEffect(()=>{if(!m)return;let a=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,b=!e.current;if(p!==f&&a){let c=new Event("click",{bubbles:b});m.indeterminate=fC(f),a.call(m,!fC(f)&&f),m.dispatchEvent(c)}},[m,p,f,e]);let r=u.useRef(!fC(f)&&f);return(0,t.jsx)(a9.input,{type:"checkbox","aria-hidden":!0,defaultChecked:g??r.current,required:h,disabled:i,name:j,value:k,form:l,...b,tabIndex:-1,ref:o,style:{...b.style,...q,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function fC(a){return"indeterminate"===a}function fD(a){return fC(a)?"indeterminate":a?"checked":"unchecked"}fB.displayName=fA;let fE=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(fx,{ref:c,className:aR("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",a),...b,children:(0,t.jsx)(fz,{className:aR("grid place-content-center text-current"),children:(0,t.jsx)(fa,{className:"h-4 w-4"})})}));function fF(a){var b;let c,d=(b=a,(c=u.forwardRef((a,b)=>{let{children:c,...d}=a;if(u.isValidElement(c)){var e;let a,f,g=(e=c,(f=(a=Object.getOwnPropertyDescriptor(e.props,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.ref:(f=(a=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.props.ref:e.props.ref||e.ref),h=function(a,b){let c={...b};for(let d in b){let e=a[d],f=b[d];/^on[A-Z]/.test(d)?e&&f?c[d]=(...a)=>{let b=f(...a);return e(...a),b}:e&&(c[d]=e):"style"===d?c[d]={...e,...f}:"className"===d&&(c[d]=[e,f].filter(Boolean).join(" "))}return{...a,...c}}(d,c.props);return c.type!==u.Fragment&&(h.ref=b?z(b,g):g),u.cloneElement(c,h)}return u.Children.count(c)>1?u.Children.only(null):null})).displayName=`${b}.SlotClone`,c),e=u.forwardRef((a,b)=>{let{children:c,...e}=a,f=u.Children.toArray(c),g=f.find(fH);if(g){let a=g.props.children,c=f.map(b=>b!==g?b:u.Children.count(a)>1?u.Children.only(null):u.isValidElement(a)?a.props.children:null);return(0,t.jsx)(d,{...e,ref:b,children:u.isValidElement(a)?u.cloneElement(a,void 0,c):null})}return(0,t.jsx)(d,{...e,ref:b,children:c})});return e.displayName=`${a}.Slot`,e}fE.displayName=fx.displayName,a.s(["Checkbox",()=>fE],4212);var fG=Symbol("radix.slottable");function fH(a){return u.isValidElement(a)&&"function"==typeof a.type&&"__radixId"in a.type&&a.type.__radixId===fG}function fI(a){let b=a+"CollectionProvider",[c,d]=a_(b),[e,f]=c(b,{collectionRef:{current:null},itemMap:new Map}),g=a=>{let{scope:b,children:c}=a,d=u.default.useRef(null),f=u.default.useRef(new Map).current;return(0,t.jsx)(e,{scope:b,itemMap:f,collectionRef:d,children:c})};g.displayName=b;let h=a+"CollectionSlot",i=fF(h),j=u.default.forwardRef((a,b)=>{let{scope:c,children:d}=a,e=A(b,f(h,c).collectionRef);return(0,t.jsx)(i,{ref:e,children:d})});j.displayName=h;let k=a+"CollectionItemSlot",l="data-radix-collection-item",m=fF(k),n=u.default.forwardRef((a,b)=>{let{scope:c,children:d,...e}=a,g=u.default.useRef(null),h=A(b,g),i=f(k,c);return u.default.useEffect(()=>(i.itemMap.set(g,{ref:g,...e}),()=>void i.itemMap.delete(g))),(0,t.jsx)(m,{...{[l]:""},ref:h,children:d})});return n.displayName=k,[{Provider:g,Slot:j,ItemSlot:n},function(b){let c=f(a+"CollectionConsumer",b);return u.default.useCallback(()=>{let a=c.collectionRef.current;if(!a)return[];let b=Array.from(a.querySelectorAll(`[${l}]`));return Array.from(c.itemMap.values()).sort((a,c)=>b.indexOf(a.ref.current)-b.indexOf(c.ref.current))},[c.collectionRef,c.itemMap])},d]}var fJ=new WeakMap;function fK(a,b){var c,d;let e,f,g;if("at"in Array.prototype)return Array.prototype.at.call(a,b);let h=(c=a,d=b,e=c.length,(g=(f=fL(d))>=0?f:e+f)<0||g>=e?-1:g);return -1===h?void 0:a[h]}function fL(a){return a!=a||0===a?0:Math.trunc(a)}(class a extends Map{#a;constructor(a){super(a),this.#a=[...super.keys()],fJ.set(this,!0)}set(a,b){return fJ.get(this)&&(this.has(a)?this.#a[this.#a.indexOf(a)]=a:this.#a.push(a)),super.set(a,b),this}insert(a,b,c){let d,e=this.has(b),f=this.#a.length,g=fL(a),h=g>=0?g:f+g,i=h<0||h>=f?-1:h;if(i===this.size||e&&i===this.size-1||-1===i)return this.set(b,c),this;let j=this.size+ +!e;g<0&&h++;let k=[...this.#a],l=!1;for(let a=h;a<j;a++)if(h===a){let f=k[a];k[a]===b&&(f=k[a+1]),e&&this.delete(b),d=this.get(f),this.set(b,c)}else{l||k[a-1]!==b||(l=!0);let c=k[l?a:a-1],e=d;d=this.get(c),this.delete(c),this.set(c,e)}return this}with(b,c,d){let e=new a(this);return e.insert(b,c,d),e}before(a){let b=this.#a.indexOf(a)-1;if(!(b<0))return this.entryAt(b)}setBefore(a,b,c){let d=this.#a.indexOf(a);return -1===d?this:this.insert(d,b,c)}after(a){let b=this.#a.indexOf(a);if(-1!==(b=-1===b||b===this.size-1?-1:b+1))return this.entryAt(b)}setAfter(a,b,c){let d=this.#a.indexOf(a);return -1===d?this:this.insert(d+1,b,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#a=[],super.clear()}delete(a){let b=super.delete(a);return b&&this.#a.splice(this.#a.indexOf(a),1),b}deleteAt(a){let b=this.keyAt(a);return void 0!==b&&this.delete(b)}at(a){let b=fK(this.#a,a);if(void 0!==b)return this.get(b)}entryAt(a){let b=fK(this.#a,a);if(void 0!==b)return[b,this.get(b)]}indexOf(a){return this.#a.indexOf(a)}keyAt(a){return fK(this.#a,a)}from(a,b){let c=this.indexOf(a);if(-1===c)return;let d=c+b;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.at(d)}keyFrom(a,b){let c=this.indexOf(a);if(-1===c)return;let d=c+b;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.keyAt(d)}find(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return d;c++}}findIndex(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return c;c++}return -1}filter(b,c){let d=[],e=0;for(let a of this)Reflect.apply(b,c,[a,e,this])&&d.push(a),e++;return new a(d)}map(b,c){let d=[],e=0;for(let a of this)d.push([a[0],Reflect.apply(b,c,[a,e,this])]),e++;return new a(d)}reduce(...a){let[b,c]=a,d=0,e=c??this.at(0);for(let c of this)e=0===d&&1===a.length?c:Reflect.apply(b,this,[e,c,d,this]),d++;return e}reduceRight(...a){let[b,c]=a,d=c??this.at(-1);for(let c=this.size-1;c>=0;c--){let e=this.at(c);d=c===this.size-1&&1===a.length?e:Reflect.apply(b,this,[d,e,c,this])}return d}toSorted(b){return new a([...this.entries()].sort(b))}toReversed(){let b=new a;for(let a=this.size-1;a>=0;a--){let c=this.keyAt(a),d=this.get(c);b.set(c,d)}return b}toSpliced(...b){let c=[...this.entries()];return c.splice(...b),new a(c)}slice(b,c){let d=new a,e=this.size-1;if(void 0===b)return d;b<0&&(b+=this.size),void 0!==c&&c>0&&(e=c-1);for(let a=b;a<=e;a++){let b=this.keyAt(a),c=this.get(b);d.set(b,c)}return d}every(a,b){let c=0;for(let d of this){if(!Reflect.apply(a,b,[d,c,this]))return!1;c++}return!0}some(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return!0;c++}return!1}}),a.s(["createCollection",()=>fI],37738);var fM=u.createContext(void 0);function fN(a){let b=u.useContext(fM);return a||b||"ltr"}a.s(["useDirection",()=>fN],7827);var fO="rovingFocusGroup.onEntryFocus",fP={bubbles:!1,cancelable:!0},fQ="RovingFocusGroup",[fR,fS,fT]=fI(fQ),[fU,fV]=a_(fQ,[fT]),[fW,fX]=fU(fQ),fY=u.forwardRef((a,b)=>(0,t.jsx)(fR.Provider,{scope:a.__scopeRovingFocusGroup,children:(0,t.jsx)(fR.Slot,{scope:a.__scopeRovingFocusGroup,children:(0,t.jsx)(fZ,{...a,ref:b})})}));fY.displayName=fQ;var fZ=u.forwardRef((a,b)=>{let{__scopeRovingFocusGroup:c,orientation:d,loop:e=!1,dir:f,currentTabStopId:g,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:i,onEntryFocus:j,preventScrollOnEntryFocus:k=!1,...l}=a,m=u.useRef(null),n=A(b,m),o=fN(f),[p,q]=a5({prop:g,defaultProp:h??null,onChange:i,caller:fQ}),[r,s]=u.useState(!1),v=bb(j),w=fS(c),x=u.useRef(!1),[y,z]=u.useState(0);return u.useEffect(()=>{let a=m.current;if(a)return a.addEventListener(fO,v),()=>a.removeEventListener(fO,v)},[v]),(0,t.jsx)(fW,{scope:c,orientation:d,dir:o,loop:e,currentTabStopId:p,onItemFocus:u.useCallback(a=>q(a),[q]),onItemShiftTab:u.useCallback(()=>s(!0),[]),onFocusableItemAdd:u.useCallback(()=>z(a=>a+1),[]),onFocusableItemRemove:u.useCallback(()=>z(a=>a-1),[]),children:(0,t.jsx)(a9.div,{tabIndex:r||0===y?-1:0,"data-orientation":d,...l,ref:n,style:{outline:"none",...a.style},onMouseDown:aZ(a.onMouseDown,()=>{x.current=!0}),onFocus:aZ(a.onFocus,a=>{let b=!x.current;if(a.target===a.currentTarget&&b&&!r){let b=new CustomEvent(fO,fP);if(a.currentTarget.dispatchEvent(b),!b.defaultPrevented){let a=w().filter(a=>a.focusable);f1([a.find(a=>a.active),a.find(a=>a.id===p),...a].filter(Boolean).map(a=>a.ref.current),k)}}x.current=!1}),onBlur:aZ(a.onBlur,()=>s(!1))})})}),f$="RovingFocusGroupItem",f_=u.forwardRef((a,b)=>{let{__scopeRovingFocusGroup:c,focusable:d=!0,active:e=!1,tabStopId:f,children:g,...h}=a,i=a3(),j=f||i,k=fX(f$,c),l=k.currentTabStopId===j,m=fS(c),{onFocusableItemAdd:n,onFocusableItemRemove:o,currentTabStopId:p}=k;return u.useEffect(()=>{if(d)return n(),()=>o()},[d,n,o]),(0,t.jsx)(fR.ItemSlot,{scope:c,id:j,focusable:d,active:e,children:(0,t.jsx)(a9.span,{tabIndex:l?0:-1,"data-orientation":k.orientation,...h,ref:b,onMouseDown:aZ(a.onMouseDown,a=>{d?k.onItemFocus(j):a.preventDefault()}),onFocus:aZ(a.onFocus,()=>k.onItemFocus(j)),onKeyDown:aZ(a.onKeyDown,a=>{if("Tab"===a.key&&a.shiftKey)return void k.onItemShiftTab();if(a.target!==a.currentTarget)return;let b=function(a,b,c){var d;let e=(d=a.key,"rtl"!==c?d:"ArrowLeft"===d?"ArrowRight":"ArrowRight"===d?"ArrowLeft":d);if(!("vertical"===b&&["ArrowLeft","ArrowRight"].includes(e))&&!("horizontal"===b&&["ArrowUp","ArrowDown"].includes(e)))return f0[e]}(a,k.orientation,k.dir);if(void 0!==b){if(a.metaKey||a.ctrlKey||a.altKey||a.shiftKey)return;a.preventDefault();let e=m().filter(a=>a.focusable).map(a=>a.ref.current);if("last"===b)e.reverse();else if("prev"===b||"next"===b){var c,d;"prev"===b&&e.reverse();let f=e.indexOf(a.currentTarget);e=k.loop?(c=e,d=f+1,c.map((a,b)=>c[(d+b)%c.length])):e.slice(f+1)}setTimeout(()=>f1(e))}}),children:"function"==typeof g?g({isCurrentTabStop:l,hasTabStop:null!=p}):g})})});f_.displayName=f$;var f0={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function f1(a,b=!1){let c=document.activeElement;for(let d of a)if(d===c||(d.focus({preventScroll:b}),document.activeElement!==c))return}a.s(["Item",()=>f_,"Root",()=>fY,"createRovingFocusGroupScope",()=>fV],24050);var f2="Tabs",[f3,f4]=a_(f2,[fV]),f5=fV(),[f6,f7]=f3(f2),f8=u.forwardRef((a,b)=>{let{__scopeTabs:c,value:d,onValueChange:e,defaultValue:f,orientation:g="horizontal",dir:h,activationMode:i="automatic",...j}=a,k=fN(h),[l,m]=a5({prop:d,onChange:e,defaultProp:f??"",caller:f2});return(0,t.jsx)(f6,{scope:c,baseId:a3(),value:l,onValueChange:m,orientation:g,dir:k,activationMode:i,children:(0,t.jsx)(a9.div,{dir:k,"data-orientation":g,...j,ref:b})})});f8.displayName=f2;var f9="TabsList",ga=u.forwardRef((a,b)=>{let{__scopeTabs:c,loop:d=!0,...e}=a,f=f7(f9,c),g=f5(c);return(0,t.jsx)(fY,{asChild:!0,...g,orientation:f.orientation,dir:f.dir,loop:d,children:(0,t.jsx)(a9.div,{role:"tablist","aria-orientation":f.orientation,...e,ref:b})})});ga.displayName=f9;var gb="TabsTrigger",gc=u.forwardRef((a,b)=>{let{__scopeTabs:c,value:d,disabled:e=!1,...f}=a,g=f7(gb,c),h=f5(c),i=gf(g.baseId,d),j=gg(g.baseId,d),k=d===g.value;return(0,t.jsx)(f_,{asChild:!0,...h,focusable:!e,active:k,children:(0,t.jsx)(a9.button,{type:"button",role:"tab","aria-selected":k,"aria-controls":j,"data-state":k?"active":"inactive","data-disabled":e?"":void 0,disabled:e,id:i,...f,ref:b,onMouseDown:aZ(a.onMouseDown,a=>{e||0!==a.button||!1!==a.ctrlKey?a.preventDefault():g.onValueChange(d)}),onKeyDown:aZ(a.onKeyDown,a=>{[" ","Enter"].includes(a.key)&&g.onValueChange(d)}),onFocus:aZ(a.onFocus,()=>{let a="manual"!==g.activationMode;k||e||!a||g.onValueChange(d)})})})});gc.displayName=gb;var gd="TabsContent",ge=u.forwardRef((a,b)=>{let{__scopeTabs:c,value:d,forceMount:e,children:f,...g}=a,h=f7(gd,c),i=gf(h.baseId,d),j=gg(h.baseId,d),k=d===h.value,l=u.useRef(k);return u.useEffect(()=>{let a=requestAnimationFrame(()=>l.current=!1);return()=>cancelAnimationFrame(a)},[]),(0,t.jsx)(br,{present:e||k,children:({present:c})=>(0,t.jsx)(a9.div,{"data-state":k?"active":"inactive","data-orientation":h.orientation,role:"tabpanel","aria-labelledby":i,hidden:!c,id:j,tabIndex:0,...g,ref:b,style:{...a.style,animationDuration:l.current?"0s":void 0},children:c&&f})})});function gf(a,b){return`${a}-trigger-${b}`}function gg(a,b){return`${a}-content-${b}`}ge.displayName=gd;let gh=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(ga,{ref:c,className:aR("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",a),...b}));gh.displayName=ga.displayName;let gi=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(gc,{ref:c,className:aR("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",a),...b}));gi.displayName=gc.displayName;let gj=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(ge,{ref:c,className:aR("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a),...b}));function gk(a,[b,c]){return Math.min(c,Math.max(b,a))}gj.displayName=ge.displayName,a.s(["Tabs",()=>f8,"TabsContent",()=>gj,"TabsList",()=>gh,"TabsTrigger",()=>gi],20218),a.s(["clamp",()=>gk],30656);var gl=Symbol("radix.slottable");function gm(a){return u.isValidElement(a)&&"function"==typeof a.type&&"__radixId"in a.type&&a.type.__radixId===gl}var gn=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),go=u.forwardRef((a,b)=>(0,t.jsx)(a9.span,{...a,ref:b,style:{...gn,...a.style}}));go.displayName="VisuallyHidden",a.s(["VISUALLY_HIDDEN_STYLES",()=>gn,"VisuallyHidden",()=>go],28094);var gp=[" ","Enter","ArrowUp","ArrowDown"],gq=[" ","Enter"],gr="Select",[gs,gt,gu]=fI(gr),[gv,gw]=a_(gr,[gu,ew]),gx=ew(),[gy,gz]=gv(gr),[gA,gB]=gv(gr),gC=a=>{let{__scopeSelect:b,children:c,open:d,defaultOpen:e,onOpenChange:f,value:g,defaultValue:h,onValueChange:i,dir:j,name:k,autoComplete:l,disabled:m,required:n,form:o}=a,p=gx(b),[q,r]=u.useState(null),[s,v]=u.useState(null),[w,x]=u.useState(!1),y=fN(j),[z,A]=a5({prop:d,defaultProp:e??!1,onChange:f,caller:gr}),[B,C]=a5({prop:g,defaultProp:h,onChange:i,caller:gr}),D=u.useRef(null),E=!q||o||!!q.closest("form"),[F,G]=u.useState(new Set),H=Array.from(F).map(a=>a.props.value).join(";");return(0,t.jsx)(ez,{...p,children:(0,t.jsxs)(gy,{required:n,scope:b,trigger:q,onTriggerChange:r,valueNode:s,onValueNodeChange:v,valueNodeHasChildren:w,onValueNodeHasChildrenChange:x,contentId:a3(),value:B,onValueChange:C,open:z,onOpenChange:A,dir:y,triggerPointerDownPosRef:D,disabled:m,children:[(0,t.jsx)(gs.Provider,{scope:b,children:(0,t.jsx)(gA,{scope:a.__scopeSelect,onNativeOptionAdd:u.useCallback(a=>{G(b=>new Set(b).add(a))},[]),onNativeOptionRemove:u.useCallback(a=>{G(b=>{let c=new Set(b);return c.delete(a),c})},[]),children:c})}),E?(0,t.jsxs)(hd,{"aria-hidden":!0,required:n,tabIndex:-1,name:k,autoComplete:l,value:B,onChange:a=>C(a.target.value),disabled:m,form:o,children:[void 0===B?(0,t.jsx)("option",{value:""}):null,Array.from(F)]},H):null]})})};gC.displayName=gr;var gD="SelectTrigger",gE=u.forwardRef((a,b)=>{let{__scopeSelect:c,disabled:d=!1,...e}=a,f=gx(c),g=gz(gD,c),h=g.disabled||d,i=A(b,g.onTriggerChange),j=gt(c),k=u.useRef("touch"),[l,m,n]=hf(a=>{let b=j().filter(a=>!a.disabled),c=b.find(a=>a.value===g.value),d=hg(b,a,c);void 0!==d&&g.onValueChange(d.value)}),o=a=>{h||(g.onOpenChange(!0),n()),a&&(g.triggerPointerDownPosRef.current={x:Math.round(a.pageX),y:Math.round(a.pageY)})};return(0,t.jsx)(eB,{asChild:!0,...f,children:(0,t.jsx)(a9.button,{type:"button",role:"combobox","aria-controls":g.contentId,"aria-expanded":g.open,"aria-required":g.required,"aria-autocomplete":"none",dir:g.dir,"data-state":g.open?"open":"closed",disabled:h,"data-disabled":h?"":void 0,"data-placeholder":he(g.value)?"":void 0,...e,ref:i,onClick:aZ(e.onClick,a=>{a.currentTarget.focus(),"mouse"!==k.current&&o(a)}),onPointerDown:aZ(e.onPointerDown,a=>{k.current=a.pointerType;let b=a.target;b.hasPointerCapture(a.pointerId)&&b.releasePointerCapture(a.pointerId),0===a.button&&!1===a.ctrlKey&&"mouse"===a.pointerType&&(o(a),a.preventDefault())}),onKeyDown:aZ(e.onKeyDown,a=>{let b=""!==l.current;a.ctrlKey||a.altKey||a.metaKey||1!==a.key.length||m(a.key),(!b||" "!==a.key)&&gp.includes(a.key)&&(o(),a.preventDefault())})})})});gE.displayName=gD;var gF="SelectValue",gG=u.forwardRef((a,b)=>{let{__scopeSelect:c,className:d,style:e,children:f,placeholder:g="",...h}=a,i=gz(gF,c),{onValueNodeHasChildrenChange:j}=i,k=void 0!==f,l=A(b,i.onValueNodeChange);return a0(()=>{j(k)},[j,k]),(0,t.jsx)(a9.span,{...h,ref:l,style:{pointerEvents:"none"},children:he(i.value)?(0,t.jsx)(t.Fragment,{children:g}):f})});gG.displayName=gF;var gH=u.forwardRef((a,b)=>{let{__scopeSelect:c,children:d,...e}=a;return(0,t.jsx)(a9.span,{"aria-hidden":!0,...e,ref:b,children:d||"▼"})});gH.displayName="SelectIcon";var gI=a=>(0,t.jsx)(bq,{asChild:!0,...a});gI.displayName="SelectPortal";var gJ="SelectContent",gK=u.forwardRef((a,b)=>{let c=gz(gJ,a.__scopeSelect),[d,e]=u.useState();return(a0(()=>{e(new DocumentFragment)},[]),c.open)?(0,t.jsx)(gO,{...a,ref:b}):d?a6.createPortal((0,t.jsx)(gL,{scope:a.__scopeSelect,children:(0,t.jsx)(gs.Slot,{scope:a.__scopeSelect,children:(0,t.jsx)("div",{children:a.children})})}),d):null});gK.displayName=gJ;var[gL,gM]=gv(gJ),gN=((k=u.forwardRef((a,b)=>{let{children:c,...d}=a;if(u.isValidElement(c)){var e;let a,f,g=(e=c,(f=(a=Object.getOwnPropertyDescriptor(e.props,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.ref:(f=(a=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.props.ref:e.props.ref||e.ref),h=function(a,b){let c={...b};for(let d in b){let e=a[d],f=b[d];/^on[A-Z]/.test(d)?e&&f?c[d]=(...a)=>{let b=f(...a);return e(...a),b}:e&&(c[d]=e):"style"===d?c[d]={...e,...f}:"className"===d&&(c[d]=[e,f].filter(Boolean).join(" "))}return{...a,...c}}(d,c.props);return c.type!==u.Fragment&&(h.ref=b?z(b,g):g),u.cloneElement(c,h)}return u.Children.count(c)>1?u.Children.only(null):null})).displayName="SelectContent.RemoveScroll.SlotClone",f=k,(g=u.forwardRef((a,b)=>{let{children:c,...d}=a,e=u.Children.toArray(c),g=e.find(gm);if(g){let a=g.props.children,c=e.map(b=>b!==g?b:u.Children.count(a)>1?u.Children.only(null):u.isValidElement(a)?a.props.children:null);return(0,t.jsx)(f,{...d,ref:b,children:u.isValidElement(a)?u.cloneElement(a,void 0,c):null})}return(0,t.jsx)(f,{...d,ref:b,children:c})})).displayName="SelectContent.RemoveScroll.Slot",g),gO=u.forwardRef((a,b)=>{let{__scopeSelect:c,position:d="item-aligned",onCloseAutoFocus:e,onEscapeKeyDown:f,onPointerDownOutside:g,side:h,sideOffset:i,align:j,alignOffset:k,arrowPadding:l,collisionBoundary:m,collisionPadding:n,sticky:o,hideWhenDetached:p,avoidCollisions:q,...r}=a,s=gz(gJ,c),[v,w]=u.useState(null),[x,y]=u.useState(null),z=A(b,a=>w(a)),[B,C]=u.useState(null),[D,E]=u.useState(null),F=gt(c),[G,H]=u.useState(!1),I=u.useRef(!1);u.useEffect(()=>{if(v)return b7(v)},[v]),bu();let J=u.useCallback(a=>{let[b,...c]=F().map(a=>a.ref.current),[d]=c.slice(-1),e=document.activeElement;for(let c of a)if(c===e||(c?.scrollIntoView({block:"nearest"}),c===b&&x&&(x.scrollTop=0),c===d&&x&&(x.scrollTop=x.scrollHeight),c?.focus(),document.activeElement!==e))return},[F,x]),K=u.useCallback(()=>J([B,v]),[J,B,v]);u.useEffect(()=>{G&&K()},[G,K]);let{onOpenChange:L,triggerPointerDownPosRef:M}=s;u.useEffect(()=>{if(v){let a={x:0,y:0},b=b=>{a={x:Math.abs(Math.round(b.pageX)-(M.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(M.current?.y??0))}},c=c=>{a.x<=10&&a.y<=10?c.preventDefault():v.contains(c.target)||L(!1),document.removeEventListener("pointermove",b),M.current=null};return null!==M.current&&(document.addEventListener("pointermove",b),document.addEventListener("pointerup",c,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",b),document.removeEventListener("pointerup",c,{capture:!0})}}},[v,L,M]),u.useEffect(()=>{let a=()=>L(!1);return window.addEventListener("blur",a),window.addEventListener("resize",a),()=>{window.removeEventListener("blur",a),window.removeEventListener("resize",a)}},[L]);let[N,O]=hf(a=>{let b=F().filter(a=>!a.disabled),c=b.find(a=>a.ref.current===document.activeElement),d=hg(b,a,c);d&&setTimeout(()=>d.ref.current.focus())}),P=u.useCallback((a,b,c)=>{let d=!I.current&&!c;(void 0!==s.value&&s.value===b||d)&&(C(a),d&&(I.current=!0))},[s.value]),Q=u.useCallback(()=>v?.focus(),[v]),R=u.useCallback((a,b,c)=>{let d=!I.current&&!c;(void 0!==s.value&&s.value===b||d)&&E(a)},[s.value]),S="popper"===d?gQ:gP,T=S===gQ?{side:h,sideOffset:i,align:j,alignOffset:k,arrowPadding:l,collisionBoundary:m,collisionPadding:n,sticky:o,hideWhenDetached:p,avoidCollisions:q}:{};return(0,t.jsx)(gL,{scope:c,content:v,viewport:x,onViewportChange:y,itemRefCallback:P,selectedItem:B,onItemLeave:Q,itemTextRefCallback:R,focusSelectedItem:K,selectedItemText:D,position:d,isPositioned:G,searchRef:N,children:(0,t.jsx)(b0,{as:gN,allowPinchZoom:!0,children:(0,t.jsx)(bk,{asChild:!0,trapped:s.open,onMountAutoFocus:a=>{a.preventDefault()},onUnmountAutoFocus:aZ(e,a=>{s.trigger?.focus({preventScroll:!0}),a.preventDefault()}),children:(0,t.jsx)(be,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:f,onPointerDownOutside:g,onFocusOutside:a=>a.preventDefault(),onDismiss:()=>s.onOpenChange(!1),children:(0,t.jsx)(S,{role:"listbox",id:s.contentId,"data-state":s.open?"open":"closed",dir:s.dir,onContextMenu:a=>a.preventDefault(),...r,...T,onPlaced:()=>H(!0),ref:z,style:{display:"flex",flexDirection:"column",outline:"none",...r.style},onKeyDown:aZ(r.onKeyDown,a=>{let b=a.ctrlKey||a.altKey||a.metaKey;if("Tab"===a.key&&a.preventDefault(),b||1!==a.key.length||O(a.key),["ArrowUp","ArrowDown","Home","End"].includes(a.key)){let b=F().filter(a=>!a.disabled).map(a=>a.ref.current);if(["ArrowUp","End"].includes(a.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(a.key)){let c=a.target,d=b.indexOf(c);b=b.slice(d+1)}setTimeout(()=>J(b)),a.preventDefault()}})})})})})})});gO.displayName="SelectContentImpl";var gP=u.forwardRef((a,b)=>{let{__scopeSelect:c,onPlaced:d,...e}=a,f=gz(gJ,c),g=gM(gJ,c),[h,i]=u.useState(null),[j,k]=u.useState(null),l=A(b,a=>k(a)),m=gt(c),n=u.useRef(!1),o=u.useRef(!0),{viewport:p,selectedItem:q,selectedItemText:r,focusSelectedItem:s}=g,v=u.useCallback(()=>{if(f.trigger&&f.valueNode&&h&&j&&p&&q&&r){let a=f.trigger.getBoundingClientRect(),b=j.getBoundingClientRect(),c=f.valueNode.getBoundingClientRect(),e=r.getBoundingClientRect();if("rtl"!==f.dir){let d=e.left-b.left,f=c.left-d,g=a.left-f,i=a.width+g,j=Math.max(i,b.width),k=gk(f,[10,Math.max(10,window.innerWidth-10-j)]);h.style.minWidth=i+"px",h.style.left=k+"px"}else{let d=b.right-e.right,f=window.innerWidth-c.right-d,g=window.innerWidth-a.right-f,i=a.width+g,j=Math.max(i,b.width),k=gk(f,[10,Math.max(10,window.innerWidth-10-j)]);h.style.minWidth=i+"px",h.style.right=k+"px"}let g=m(),i=window.innerHeight-20,k=p.scrollHeight,l=window.getComputedStyle(j),o=parseInt(l.borderTopWidth,10),s=parseInt(l.paddingTop,10),t=parseInt(l.borderBottomWidth,10),u=o+s+k+parseInt(l.paddingBottom,10)+t,v=Math.min(5*q.offsetHeight,u),w=window.getComputedStyle(p),x=parseInt(w.paddingTop,10),y=parseInt(w.paddingBottom,10),z=a.top+a.height/2-10,A=q.offsetHeight/2,B=o+s+(q.offsetTop+A);if(B<=z){let a=g.length>0&&q===g[g.length-1].ref.current;h.style.bottom="0px";let b=Math.max(i-z,A+(a?y:0)+(j.clientHeight-p.offsetTop-p.offsetHeight)+t);h.style.height=B+b+"px"}else{let a=g.length>0&&q===g[0].ref.current;h.style.top="0px";let b=Math.max(z,o+p.offsetTop+(a?x:0)+A);h.style.height=b+(u-B)+"px",p.scrollTop=B-z+p.offsetTop}h.style.margin="10px 0",h.style.minHeight=v+"px",h.style.maxHeight=i+"px",d?.(),requestAnimationFrame(()=>n.current=!0)}},[m,f.trigger,f.valueNode,h,j,p,q,r,f.dir,d]);a0(()=>v(),[v]);let[w,x]=u.useState();a0(()=>{j&&x(window.getComputedStyle(j).zIndex)},[j]);let y=u.useCallback(a=>{a&&!0===o.current&&(v(),s?.(),o.current=!1)},[v,s]);return(0,t.jsx)(gR,{scope:c,contentWrapper:h,shouldExpandOnScrollRef:n,onScrollButtonChange:y,children:(0,t.jsx)("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:(0,t.jsx)(a9.div,{...e,ref:l,style:{boxSizing:"border-box",maxHeight:"100%",...e.style}})})})});gP.displayName="SelectItemAlignedPosition";var gQ=u.forwardRef((a,b)=>{let{__scopeSelect:c,align:d="start",collisionPadding:e=10,...f}=a,g=gx(c);return(0,t.jsx)(eF,{...g,...f,ref:b,align:d,collisionPadding:e,style:{boxSizing:"border-box",...f.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});gQ.displayName="SelectPopperPosition";var[gR,gS]=gv(gJ,{}),gT="SelectViewport",gU=u.forwardRef((a,b)=>{let{__scopeSelect:c,nonce:d,...e}=a,f=gM(gT,c),g=gS(gT,c),h=A(b,f.onViewportChange),i=u.useRef(0);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:d}),(0,t.jsx)(gs.Slot,{scope:c,children:(0,t.jsx)(a9.div,{"data-radix-select-viewport":"",role:"presentation",...e,ref:h,style:{position:"relative",flex:1,overflow:"hidden auto",...e.style},onScroll:aZ(e.onScroll,a=>{let b=a.currentTarget,{contentWrapper:c,shouldExpandOnScrollRef:d}=g;if(d?.current&&c){let a=Math.abs(i.current-b.scrollTop);if(a>0){let d=window.innerHeight-20,e=Math.max(parseFloat(c.style.minHeight),parseFloat(c.style.height));if(e<d){let f=e+a,g=Math.min(d,f),h=f-g;c.style.height=g+"px","0px"===c.style.bottom&&(b.scrollTop=h>0?h:0,c.style.justifyContent="flex-end")}}}i.current=b.scrollTop})})})]})});gU.displayName=gT;var gV="SelectGroup",[gW,gX]=gv(gV);u.forwardRef((a,b)=>{let{__scopeSelect:c,...d}=a,e=a3();return(0,t.jsx)(gW,{scope:c,id:e,children:(0,t.jsx)(a9.div,{role:"group","aria-labelledby":e,...d,ref:b})})}).displayName=gV;var gY="SelectLabel",gZ=u.forwardRef((a,b)=>{let{__scopeSelect:c,...d}=a,e=gX(gY,c);return(0,t.jsx)(a9.div,{id:e.id,...d,ref:b})});gZ.displayName=gY;var g$="SelectItem",[g_,g0]=gv(g$),g1=u.forwardRef((a,b)=>{let{__scopeSelect:c,value:d,disabled:e=!1,textValue:f,...g}=a,h=gz(g$,c),i=gM(g$,c),j=h.value===d,[k,l]=u.useState(f??""),[m,n]=u.useState(!1),o=A(b,a=>i.itemRefCallback?.(a,d,e)),p=a3(),q=u.useRef("touch"),r=()=>{e||(h.onValueChange(d),h.onOpenChange(!1))};if(""===d)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,t.jsx)(g_,{scope:c,value:d,disabled:e,textId:p,isSelected:j,onItemTextChange:u.useCallback(a=>{l(b=>b||(a?.textContent??"").trim())},[]),children:(0,t.jsx)(gs.ItemSlot,{scope:c,value:d,disabled:e,textValue:k,children:(0,t.jsx)(a9.div,{role:"option","aria-labelledby":p,"data-highlighted":m?"":void 0,"aria-selected":j&&m,"data-state":j?"checked":"unchecked","aria-disabled":e||void 0,"data-disabled":e?"":void 0,tabIndex:e?void 0:-1,...g,ref:o,onFocus:aZ(g.onFocus,()=>n(!0)),onBlur:aZ(g.onBlur,()=>n(!1)),onClick:aZ(g.onClick,()=>{"mouse"!==q.current&&r()}),onPointerUp:aZ(g.onPointerUp,()=>{"mouse"===q.current&&r()}),onPointerDown:aZ(g.onPointerDown,a=>{q.current=a.pointerType}),onPointerMove:aZ(g.onPointerMove,a=>{q.current=a.pointerType,e?i.onItemLeave?.():"mouse"===q.current&&a.currentTarget.focus({preventScroll:!0})}),onPointerLeave:aZ(g.onPointerLeave,a=>{a.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:aZ(g.onKeyDown,a=>{(i.searchRef?.current===""||" "!==a.key)&&(gq.includes(a.key)&&r()," "===a.key&&a.preventDefault())})})})})});g1.displayName=g$;var g2="SelectItemText",g3=u.forwardRef((a,b)=>{let{__scopeSelect:c,className:d,style:e,...f}=a,g=gz(g2,c),h=gM(g2,c),i=g0(g2,c),j=gB(g2,c),[k,l]=u.useState(null),m=A(b,a=>l(a),i.onItemTextChange,a=>h.itemTextRefCallback?.(a,i.value,i.disabled)),n=k?.textContent,o=u.useMemo(()=>(0,t.jsx)("option",{value:i.value,disabled:i.disabled,children:n},i.value),[i.disabled,i.value,n]),{onNativeOptionAdd:p,onNativeOptionRemove:q}=j;return a0(()=>(p(o),()=>q(o)),[p,q,o]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a9.span,{id:i.textId,...f,ref:m}),i.isSelected&&g.valueNode&&!g.valueNodeHasChildren?a6.createPortal(f.children,g.valueNode):null]})});g3.displayName=g2;var g4="SelectItemIndicator",g5=u.forwardRef((a,b)=>{let{__scopeSelect:c,...d}=a;return g0(g4,c).isSelected?(0,t.jsx)(a9.span,{"aria-hidden":!0,...d,ref:b}):null});g5.displayName=g4;var g6="SelectScrollUpButton",g7=u.forwardRef((a,b)=>{let c=gM(g6,a.__scopeSelect),d=gS(g6,a.__scopeSelect),[e,f]=u.useState(!1),g=A(b,d.onScrollButtonChange);return a0(()=>{if(c.viewport&&c.isPositioned){let a=function(){f(b.scrollTop>0)},b=c.viewport;return a(),b.addEventListener("scroll",a),()=>b.removeEventListener("scroll",a)}},[c.viewport,c.isPositioned]),e?(0,t.jsx)(ha,{...a,ref:g,onAutoScroll:()=>{let{viewport:a,selectedItem:b}=c;a&&b&&(a.scrollTop=a.scrollTop-b.offsetHeight)}}):null});g7.displayName=g6;var g8="SelectScrollDownButton",g9=u.forwardRef((a,b)=>{let c=gM(g8,a.__scopeSelect),d=gS(g8,a.__scopeSelect),[e,f]=u.useState(!1),g=A(b,d.onScrollButtonChange);return a0(()=>{if(c.viewport&&c.isPositioned){let a=function(){let a=b.scrollHeight-b.clientHeight;f(Math.ceil(b.scrollTop)<a)},b=c.viewport;return a(),b.addEventListener("scroll",a),()=>b.removeEventListener("scroll",a)}},[c.viewport,c.isPositioned]),e?(0,t.jsx)(ha,{...a,ref:g,onAutoScroll:()=>{let{viewport:a,selectedItem:b}=c;a&&b&&(a.scrollTop=a.scrollTop+b.offsetHeight)}}):null});g9.displayName=g8;var ha=u.forwardRef((a,b)=>{let{__scopeSelect:c,onAutoScroll:d,...e}=a,f=gM("SelectScrollButton",c),g=u.useRef(null),h=gt(c),i=u.useCallback(()=>{null!==g.current&&(window.clearInterval(g.current),g.current=null)},[]);return u.useEffect(()=>()=>i(),[i]),a0(()=>{let a=h().find(a=>a.ref.current===document.activeElement);a?.ref.current?.scrollIntoView({block:"nearest"})},[h]),(0,t.jsx)(a9.div,{"aria-hidden":!0,...e,ref:b,style:{flexShrink:0,...e.style},onPointerDown:aZ(e.onPointerDown,()=>{null===g.current&&(g.current=window.setInterval(d,50))}),onPointerMove:aZ(e.onPointerMove,()=>{f.onItemLeave?.(),null===g.current&&(g.current=window.setInterval(d,50))}),onPointerLeave:aZ(e.onPointerLeave,()=>{i()})})}),hb=u.forwardRef((a,b)=>{let{__scopeSelect:c,...d}=a;return(0,t.jsx)(a9.div,{"aria-hidden":!0,...d,ref:b})});hb.displayName="SelectSeparator";var hc="SelectArrow";u.forwardRef((a,b)=>{let{__scopeSelect:c,...d}=a,e=gx(c),f=gz(hc,c),g=gM(hc,c);return f.open&&"popper"===g.position?(0,t.jsx)(eI,{...e,...d,ref:b}):null}).displayName=hc;var hd=u.forwardRef(({__scopeSelect:a,value:b,...c},d)=>{let e=u.useRef(null),f=A(d,e),g=fo(b);return u.useEffect(()=>{let a=e.current;if(!a)return;let c=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(g!==b&&c){let d=new Event("change",{bubbles:!0});c.call(a,b),a.dispatchEvent(d)}},[g,b]),(0,t.jsx)(a9.select,{...c,style:{...gn,...c.style},ref:f,defaultValue:b})});function he(a){return""===a||void 0===a}function hf(a){let b=bb(a),c=u.useRef(""),d=u.useRef(0),e=u.useCallback(a=>{let e=c.current+a;b(e),function a(b){c.current=b,window.clearTimeout(d.current),""!==b&&(d.current=window.setTimeout(()=>a(""),1e3))}(e)},[b]),f=u.useCallback(()=>{c.current="",window.clearTimeout(d.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(d.current),[]),[c,e,f]}function hg(a,b,c){var d,e;let f=b.length>1&&Array.from(b).every(a=>a===b[0])?b[0]:b,g=c?a.indexOf(c):-1,h=(d=a,e=Math.max(g,0),d.map((a,b)=>d[(e+b)%d.length]));1===f.length&&(h=h.filter(a=>a!==c));let i=h.find(a=>a.textValue.toLowerCase().startsWith(f.toLowerCase()));return i!==c?i:void 0}hd.displayName="SelectBubbleInput";let hh=(0,c5.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),hi=u.forwardRef(({className:a,children:b,...c},d)=>(0,t.jsxs)(gE,{ref:d,className:aR("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",a),...c,children:[b,(0,t.jsx)(gH,{asChild:!0,children:(0,t.jsx)(fj,{className:"h-4 w-4 opacity-50"})})]}));hi.displayName=gE.displayName;let hj=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(g7,{ref:c,className:aR("flex cursor-default items-center justify-center py-1",a),...b,children:(0,t.jsx)(hh,{className:"h-4 w-4"})}));hj.displayName=g7.displayName;let hk=u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(g9,{ref:c,className:aR("flex cursor-default items-center justify-center py-1",a),...b,children:(0,t.jsx)(fj,{className:"h-4 w-4"})}));hk.displayName=g9.displayName;let hl=u.forwardRef(({className:a,children:b,position:c="popper",...d},e)=>(0,t.jsx)(gI,{children:(0,t.jsxs)(gK,{ref:e,className:aR("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]","popper"===c&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:c,...d,children:[(0,t.jsx)(hj,{}),(0,t.jsx)(gU,{className:aR("p-1","popper"===c&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:b}),(0,t.jsx)(hk,{})]})}));hl.displayName=gK.displayName,u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(gZ,{ref:c,className:aR("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...b})).displayName=gZ.displayName;let hm=u.forwardRef(({className:a,children:b,...c},d)=>(0,t.jsxs)(g1,{ref:d,className:aR("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...c,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(g5,{children:(0,t.jsx)(fa,{className:"h-4 w-4"})})}),(0,t.jsx)(g3,{children:b})]}));function hn(){let a,b,c=(0,v.useRouter)(),d=(0,v.useSearchParams)(),{currentBank:e,setCurrentBank:f,banks:g,loadBanks:h}=(0,w.useBank)(),{theme:i,toggleTheme:j}=(0,fl.useTheme)(),[k,l]=u.useState(!1),[m,n]=u.useState(!1),[o,p]=u.useState(""),[q,r]=u.useState(!1),[s,y]=u.useState(null),[z,A]=u.useState(!1),[B,C]=u.useState("text"),[D,E]=u.useState(""),[F,G]=u.useState(""),[H,I]=u.useState(""),[J,K]=u.useState(""),[L,M]=u.useState(""),[N,O]=u.useState("combined"),[P,Q]=u.useState(""),[R,S]=u.useState(""),[T,U]=u.useState(""),[V,W]=u.useState("document"),[X,Y]=u.useState(!1),[Z,$]=u.useState(""),[_,aa]=u.useState(!1),[ab,ac]=u.useState([]);u.useEffect(()=>{z&&e&&x.client.getBankConfig(e).then(a=>{let b=a.config?.retain_strategies;ac(b?Object.keys(b):[])}).catch(()=>ac([]))},[z,e]);let[ad,ae]=u.useState([]),[af,ag]=u.useState([]),[ah,ai]=u.useState(""),aj=u.useRef(null),[ak,al]=u.useState(null);u.useEffect(()=>{x.client.getVersion().then(a=>{al(a.features.file_upload_api)}).catch(()=>{al(!1)})},[]);let am=u.useMemo(()=>[...g].sort((a,b)=>a.localeCompare(b)),[g]),an=async()=>{if(o.trim()){r(!0),y(null);try{await x.client.createBank(o.trim()),await h(),n(!1),p(""),f(o.trim()),c.push(`/banks/${o.trim()}?view=data`)}catch(a){y(a instanceof Error?a.message:"Failed to create bank")}finally{r(!1)}}},ao=a=>{let b={};for(let c of a.split("\n")){let a=c.indexOf(":");if(a>0){let d=c.slice(0,a).trim(),e=c.slice(a+1).trim();d&&(b[d]=e)}}return Object.keys(b).length>0?b:void 0},ap=()=>({context:"",timestamp:"",document_id:"",tags:"",metadata:"",strategy:"",advancedTab:"document",expanded:!1}),aq=(a,b,c)=>{ag(d=>d.map((d,e)=>e===a?{...d,[b]:c}:d))},ar=async()=>{if(e&&0!==ad.length){aa(!0),ai("");try{ai(`Uploading ${ad.length} file(s)...`);let a=af.map(a=>({...a.context&&{context:a.context},...a.timestamp&&{timestamp:a.timestamp+":00"},...a.document_id&&{document_id:a.document_id},...a.tags&&{tags:a.tags.split(",").map(a=>a.trim()).filter(Boolean)},...a.metadata&&{metadata:ao(a.metadata)},...a.strategy&&{strategy:a.strategy}}));await x.client.uploadFiles({bank_id:e,files:ad,async:!0,files_metadata:a}),A(!1),ae([]),ag([]),M(""),Y(!1),ai(""),c.push(`/banks/${e}?view=documents`)}catch{}finally{aa(!1),ai("")}}},as=async()=>{if(e&&D.trim()){aa(!0);try{let a=L.split(",").map(a=>a.trim()).filter(Boolean),b={content:D};if(F&&(b.context=F),H&&(b.timestamp=H+":00"),J&&(b.document_id=J),a.length>0&&(b.tags=a),"per_tag"===N)b.observation_scopes="per_tag";else if("combined"===N)b.observation_scopes="combined";else if("all_combinations"===N)b.observation_scopes="all_combinations";else if("custom"===N){let a=P.split("\n").map(a=>a.split(",").map(a=>a.trim()).filter(Boolean)).filter(a=>a.length>0);a.length>0&&(b.observation_scopes=a)}let d=ao(R);d&&(b.metadata=d);let f=(a=>{let b=a.split(",").map(a=>a.trim()).filter(Boolean);if(0!==b.length)return b.map(a=>({text:a}))})(T);f&&(b.entities=f),Z&&(b.strategy=Z),await x.client.retain({bank_id:e,items:[b],async:X}),A(!1),E(""),G(""),I(""),K(""),M(""),O("combined"),Q(""),S(""),U(""),W("document"),Y(!1),$(""),c.push(`/banks/${e}?view=documents`)}catch{}finally{aa(!1)}}};return(0,t.jsx)("div",{className:"bg-card text-card-foreground px-5 py-3 border-b-4 border-primary-gradient",children:(0,t.jsxs)("div",{className:"flex items-center gap-4 text-sm",children:[(0,t.jsx)(fm.default,{src:"/logo.png",alt:"Hindsight",width:40,height:40,className:"h-10 w-auto",unoptimized:!0}),(0,t.jsx)("div",{className:"h-8 w-px bg-border"}),(0,t.jsxs)(eU,{open:k,onOpenChange:a=>{l(a),a&&h()},children:[(0,t.jsx)(eX,{asChild:!0,children:(0,t.jsxs)(aT,{variant:"outline",role:"combobox","aria-expanded":k,className:"w-[250px] justify-between font-bold border-2 border-primary hover:bg-accent",children:[(0,t.jsx)("span",{className:"truncate",children:e||"Select a memory bank..."}),(0,t.jsx)(fb,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(e8,{className:"w-[250px] p-0",children:(0,t.jsxs)(de,{children:[am.length>0&&(0,t.jsx)(df,{placeholder:"Search memory banks..."}),(0,t.jsxs)(dg,{children:[(0,t.jsx)(dh,{children:"No memory banks yet."}),(0,t.jsx)(di,{children:am.map(a=>(0,t.jsxs)(dj,{value:a,onSelect:a=>{f(a),l(!1);let b=d.get("view")||"data",e=d.get("subTab"),g=e?`?view=${b}&subTab=${e}`:`?view=${b}`;c.push(`/banks/${a}${g}`)},children:[(0,t.jsx)(fa,{className:aR("mr-2 h-4 w-4",e===a?"opacity-100":"opacity-0")}),a]},a))})]}),(0,t.jsx)("div",{className:"border-t border-border p-1",children:(0,t.jsxs)("button",{className:"w-full flex items-center gap-2 px-2 py-2 text-sm rounded-md hover:bg-accent transition-colors text-muted-foreground hover:text-foreground",onClick:()=>{l(!1),n(!0)},children:[(0,t.jsx)(fc,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"Create new bank"})]})})]})})]}),(0,t.jsx)("div",{className:"h-8 w-px bg-border"}),e&&(0,t.jsxs)(aT,{variant:"outline",size:"sm",className:"h-9 gap-1.5",onClick:()=>A(!0),title:"Add document to current bank",children:[(0,t.jsx)(fc,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:"Add Document"})]}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)("a",{href:"https://github.com/vectorize-io/hindsight",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-accent transition-colors text-muted-foreground hover:text-foreground",title:"View on GitHub",children:[(0,t.jsx)(fg,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"GitHub"})]}),(0,t.jsx)("div",{className:"h-8 w-px bg-border"}),(0,t.jsx)(aT,{variant:"ghost",size:"icon",onClick:j,className:"h-9 w-9",title:"light"===i?"Switch to dark mode":"Switch to light mode",children:"light"===i?(0,t.jsx)(fe,{className:"h-5 w-5"}):(0,t.jsx)(ff,{className:"h-5 w-5"})}),(0,t.jsx)(cf,{open:m,onOpenChange:n,children:(0,t.jsxs)(c9,{className:"sm:max-w-[425px]",children:[(0,t.jsx)(da,{children:(0,t.jsx)(dc,{children:"Create New Memory Bank"})}),(0,t.jsxs)("div",{className:"py-4",children:[(0,t.jsx)(e9,{placeholder:"Enter bank ID...",value:o,onChange:a=>p(a.target.value),onKeyDown:a=>{"Enter"!==a.key||q||an()},autoFocus:!0}),s&&(0,t.jsx)("p",{className:"text-sm text-destructive mt-2",children:s})]}),(0,t.jsxs)(db,{children:[(0,t.jsx)(aT,{variant:"secondary",onClick:()=>{n(!1),p(""),y(null)},children:"Cancel"}),(0,t.jsx)(aT,{onClick:an,disabled:q||!o.trim(),children:q?"Creating...":"Create"})]})]})}),(0,t.jsx)(cf,{open:z,onOpenChange:A,children:(0,t.jsxs)(c9,{className:"sm:max-w-[750px] max-h-[90vh] flex flex-col",children:[(0,t.jsxs)(da,{children:[(0,t.jsx)(dc,{children:"Add New Document"}),(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Add a new document to memory bank:"," ",(0,t.jsx)("span",{className:"font-semibold",children:e})]})]}),(0,t.jsxs)("div",{className:"space-y-4 overflow-y-auto flex-1 px-1 -mx-1",children:[(0,t.jsxs)(f8,{value:B,onValueChange:a=>C(a),children:[(0,t.jsxs)(gh,{className:"grid w-full grid-cols-2",children:[(0,t.jsxs)(gi,{value:"text",className:"flex items-center gap-2",children:[(0,t.jsx)(fd,{className:"h-4 w-4"}),"Text"]}),(0,t.jsxs)(gi,{value:"upload",className:"flex items-center gap-2",disabled:!1===ak,children:[!1===ak?(0,t.jsx)(fi,{className:"h-4 w-4"}):(0,t.jsx)(fh,{className:"h-4 w-4"}),"Upload Files"]})]}),(0,t.jsxs)(gj,{value:"text",className:"mt-3",children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Content *"}),(0,t.jsx)(fn,{value:D,onChange:a=>E(a.target.value),placeholder:"Enter the document content...",className:"min-h-[150px] resize-y",autoFocus:!0})]}),(0,t.jsx)(gj,{value:"upload",className:"mt-3",children:!1===ak?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center space-y-3",children:[(0,t.jsx)(fi,{className:"h-12 w-12 text-muted-foreground/50"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-semibold text-foreground",children:"File Upload API Disabled"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"File upload is not enabled on this server."}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:["To enable, set"," ",(0,t.jsx)("code",{className:"bg-muted px-1 py-0.5 rounded",children:"HINDSIGHT_API_ENABLE_FILE_UPLOAD_API=true"})]})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{ref:aj,type:"file",multiple:!0,onChange:a=>{let b=Array.from(a.target.files||[]);ae(a=>[...a,...b]),ag(a=>[...a,...b.map(ap)]),aj.current&&(aj.current.value="")},className:"hidden",id:"file-upload"}),(0,t.jsxs)("label",{htmlFor:"file-upload",className:"flex flex-col items-center justify-center w-full h-32 border-2 border-dashed border-muted-foreground/25 rounded-lg cursor-pointer hover:border-primary/50 hover:bg-accent/50 transition-colors",children:[(0,t.jsx)(fh,{className:"h-8 w-8 text-muted-foreground mb-2"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Click to select files or drag and drop"})]}),ad.length>0&&(0,t.jsx)("div",{className:"mt-3 space-y-1",children:ad.map((a,b)=>{let c=af[b],d=c&&(c.context||c.timestamp||c.document_id||c.tags||c.metadata);return(0,t.jsxs)("div",{className:"bg-muted rounded-md overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 px-2 py-2",children:[(0,t.jsxs)("button",{type:"button",className:"flex items-center gap-1.5 min-w-0 flex-1 text-left hover:opacity-75 transition-opacity",onClick:()=>{ag(a=>a.map((a,c)=>c===b?{...a,expanded:!a.expanded}:a))},title:"Edit metadata for this file",children:[c?.expanded?(0,t.jsx)(fj,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):(0,t.jsx)(fk,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,t.jsx)(fd,{className:`h-4 w-4 shrink-0 ${d?"text-primary":"text-muted-foreground"}`}),(0,t.jsx)("span",{className:"text-sm truncate",children:a.name}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground shrink-0",children:["(",(a.size/1024).toFixed(1)," KB)"]})]}),(0,t.jsx)(aT,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 shrink-0",onClick:()=>{ae(a=>a.filter((a,c)=>c!==b)),ag(a=>a.filter((a,c)=>c!==b))},children:(0,t.jsx)(c7,{className:"h-4 w-4"})})]}),c?.expanded&&(0,t.jsx)("div",{className:"border-t border-border/50",children:(0,t.jsxs)(f8,{value:c.advancedTab,onValueChange:a=>aq(b,"advancedTab",a),children:[(0,t.jsx)(gh,{className:"w-full border-b border-border bg-transparent h-8 p-0 gap-0 justify-start rounded-none",children:["document","tags","source"].map(a=>(0,t.jsx)(gi,{value:a,className:"rounded-none h-full px-4 text-xs font-medium bg-transparent shadow-none text-muted-foreground hover:text-foreground data-[state=active]:text-foreground data-[state=active]:shadow-none data-[state=active]:bg-transparent data-[state=active]:border-b-2 data-[state=active]:border-primary -mb-px capitalize",children:a},a))}),(0,t.jsxs)("div",{className:"px-3 py-3 space-y-2",children:[(0,t.jsxs)(gj,{value:"document",className:"mt-0 space-y-2",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Event Date"}),(0,t.jsx)(e9,{type:"datetime-local",value:c.timestamp,onChange:a=>aq(b,"timestamp",a.target.value),className:"h-8 text-sm text-foreground"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Document ID"}),(0,t.jsx)(e9,{value:c.document_id,onChange:a=>aq(b,"document_id",a.target.value),placeholder:"Optional ID...",className:"h-8 text-sm"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Strategy"}),ab.length>0?(0,t.jsxs)(gC,{value:c.strategy||"__none__",onValueChange:a=>aq(b,"strategy","__none__"===a?"":a),children:[(0,t.jsx)(hi,{className:"w-full h-8 text-sm",children:(0,t.jsx)(gG,{})}),(0,t.jsxs)(hl,{children:[(0,t.jsx)(hm,{value:"__none__",children:(0,t.jsx)("span",{className:"text-muted-foreground italic",children:"Default"})}),ab.map(a=>(0,t.jsx)(hm,{value:a,children:a},a))]})]}):(0,t.jsx)(e9,{value:c.strategy,onChange:a=>aq(b,"strategy",a.target.value),placeholder:"Strategy name (optional)...",className:"h-8 text-sm"})]})]}),(0,t.jsx)(gj,{value:"tags",className:"mt-0 space-y-2",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Tags"}),(0,t.jsx)(e9,{value:c.tags,onChange:a=>aq(b,"tags",a.target.value),placeholder:"tag1, tag2...",className:"h-8 text-sm"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Comma-separated — used to filter memories during recall/reflect"})]})}),(0,t.jsxs)(gj,{value:"source",className:"mt-0 space-y-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Context"}),(0,t.jsx)(e9,{value:c.context,onChange:a=>aq(b,"context",a.target.value),placeholder:"Optional context...",className:"h-8 text-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Metadata"}),(0,t.jsx)(fn,{value:c.metadata,onChange:a=>aq(b,"metadata",a.target.value),placeholder:"source: slack\nchannel: engineering",className:"min-h-[52px] resize-y font-mono text-sm"})]})]})]})]})})]},`${a.name}-${b}`)})}),ah&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-2",children:ah})]})})]}),"text"===B&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Context"}),(0,t.jsx)(e9,{type:"text",value:F,onChange:a=>G(a.target.value),placeholder:"Optional context about this document..."})]}),"text"===B&&(0,t.jsx)("div",{children:(0,t.jsxs)(f8,{value:V,onValueChange:a=>W(a),children:[(0,t.jsxs)(gh,{className:"w-full border-b border-border bg-transparent h-8 p-0 gap-0 justify-start rounded-none",children:[(0,t.jsx)(gi,{value:"document",className:"rounded-none h-full px-4 text-xs font-medium bg-transparent shadow-none text-muted-foreground hover:text-foreground data-[state=active]:text-foreground data-[state=active]:shadow-none data-[state=active]:bg-transparent data-[state=active]:border-b-2 data-[state=active]:border-primary -mb-px",children:"Document"}),(0,t.jsx)(gi,{value:"tags",className:"rounded-none h-full px-4 text-xs font-medium bg-transparent shadow-none text-muted-foreground hover:text-foreground data-[state=active]:text-foreground data-[state=active]:shadow-none data-[state=active]:bg-transparent data-[state=active]:border-b-2 data-[state=active]:border-primary -mb-px",children:"Tags"}),(0,t.jsx)(gi,{value:"source",className:"rounded-none h-full px-4 text-xs font-medium bg-transparent shadow-none text-muted-foreground hover:text-foreground data-[state=active]:text-foreground data-[state=active]:shadow-none data-[state=active]:bg-transparent data-[state=active]:border-b-2 data-[state=active]:border-primary -mb-px",children:"Source"})]}),(0,t.jsxs)("div",{className:"pt-3 space-y-3",children:[(0,t.jsxs)(gj,{value:"document",className:"mt-0 space-y-3",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Event Date"}),(0,t.jsx)(e9,{type:"datetime-local",value:H,onChange:a=>I(a.target.value),className:"text-foreground"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Document ID"}),(0,t.jsx)(e9,{type:"text",value:J,onChange:a=>K(a.target.value),placeholder:"Optional document identifier..."})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Strategy"}),ab.length>0?(0,t.jsxs)(gC,{value:Z||"__none__",onValueChange:a=>$("__none__"===a?"":a),children:[(0,t.jsx)(hi,{className:"w-full",children:(0,t.jsx)(gG,{})}),(0,t.jsxs)(hl,{children:[(0,t.jsx)(hm,{value:"__none__",children:(0,t.jsx)("span",{className:"text-muted-foreground italic",children:"Default"})}),ab.map(a=>(0,t.jsx)(hm,{value:a,children:a},a))]})]}):(0,t.jsx)(e9,{type:"text",value:Z,onChange:a=>$(a.target.value),placeholder:"Strategy name (optional)..."}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Override the bank's default extraction strategy for this document."})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(fE,{id:"async-doc",checked:X,onCheckedChange:a=>Y(a)}),(0,t.jsx)("label",{htmlFor:"async-doc",className:"text-sm cursor-pointer text-foreground",children:"Process in background (async)"})]})]}),(0,t.jsxs)(gj,{value:"tags",className:"mt-0 space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Tags"}),(0,t.jsx)(e9,{type:"text",value:L,onChange:a=>M(a.target.value),placeholder:"user_alice, session_123, project_x"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Comma-separated — used to filter memories during recall/reflect"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Observation Scopes"}),(0,t.jsxs)(gC,{value:N,onValueChange:a=>O(a),children:[(0,t.jsx)(hi,{className:"w-full",children:(0,t.jsx)(gG,{})}),(0,t.jsxs)(hl,{children:[(0,t.jsx)(hm,{value:"per_tag",children:"Per tag"}),(0,t.jsx)(hm,{value:"combined",children:"Combined"}),(0,t.jsx)(hm,{value:"all_combinations",children:"All combinations"}),(0,t.jsx)(hm,{value:"custom",children:"Custom"})]})]}),"custom"!==N&&(b=((a,b)=>{if(0===a.length)return[];if("per_tag"===b)return a.map(a=>[a]);if("combined"===b)return[a];let c=[];for(let b=1;b<=a.length;b++){let d=(e,f)=>{if(f.length===b)return void c.push([...f]);for(let b=e;b<a.length;b++)d(b+1,[...f,a[b]])};d(0,[])}return c})(a=L.split(",").map(a=>a.trim()).filter(Boolean),N),0===a.length?(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60 mt-1.5 italic",children:"Add tags above to preview observation scopes"}):(0,t.jsxs)("ul",{className:"mt-2 space-y-1.5",children:[b.slice(0,6).map((a,b)=>(0,t.jsxs)("li",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-mono text-foreground",children:a.join(", ")}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:(a=>{if(1===a.length)return`What happened with ${a[0]}?`;let b=a.slice(0,-1).join(", ");return`What happened with ${b} and ${a[a.length-1]}?`})(a)})]},b)),b.length>6&&(0,t.jsxs)("li",{className:"text-xs text-muted-foreground",children:["+",b.length-6," more scopes"]})]})),"custom"===N&&(0,t.jsx)(fn,{value:P,onChange:a=>Q(a.target.value),placeholder:"user:alice\nuser:alice, place:online",className:"min-h-[72px] resize-y font-mono text-sm mt-2"})]})]}),(0,t.jsxs)(gj,{value:"source",className:"mt-0 space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Metadata"}),(0,t.jsx)(fn,{value:R,onChange:a=>S(a.target.value),placeholder:"source: slack\nchannel: engineering",className:"min-h-[72px] resize-y font-mono text-sm"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:["One ",(0,t.jsx)("code",{className:"bg-muted px-0.5 rounded",children:"key: value"})," per line"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"font-bold block mb-1 text-sm text-foreground",children:"Entities"}),(0,t.jsx)(e9,{type:"text",value:T,onChange:a=>U(a.target.value),placeholder:"Alice, Google, ML model"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Comma-separated hints merged with auto-extracted entities"})]})]})]})]})})]}),(0,t.jsxs)(db,{children:[(0,t.jsx)(aT,{variant:"secondary",onClick:()=>{A(!1),E(""),G(""),I(""),K(""),M(""),O("combined"),Q(""),S(""),U(""),W("document"),Y(!1),ae([]),ag([]),ai("")},children:"Cancel"}),"text"===B?(0,t.jsx)(aT,{onClick:as,disabled:_||!D.trim(),children:_?"Adding...":"Add Document"}):(0,t.jsx)(aT,{onClick:ar,disabled:_||0===ad.length,children:_?ah||"Uploading...":`Upload ${ad.length} File${1!==ad.length?"s":""}`})]})]})})]})})}function ho(){return(0,t.jsx)(u.Suspense,{fallback:(0,t.jsx)("div",{className:"bg-card text-card-foreground px-5 py-3 border-b-4 border-primary-gradient",children:(0,t.jsxs)("div",{className:"flex items-center gap-4 text-sm",children:[(0,t.jsx)(fm.default,{src:"/logo.png",alt:"Hindsight",width:40,height:40,className:"h-10 w-auto",unoptimized:!0}),(0,t.jsx)("div",{className:"h-8 w-px bg-border"}),(0,t.jsxs)(aT,{variant:"outline",className:"w-[250px] justify-between font-bold border-2 border-primary",disabled:!0,children:["Loading...",(0,t.jsx)(fb,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)("a",{href:"https://github.com/vectorize-io/hindsight",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-accent transition-colors text-muted-foreground",children:[(0,t.jsx)(fg,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"GitHub"})]}),(0,t.jsx)("div",{className:"h-8 w-px bg-border"}),(0,t.jsx)(aT,{variant:"ghost",size:"icon",className:"h-9 w-9",disabled:!0,children:(0,t.jsx)(fe,{className:"h-5 w-5"})})]})}),children:(0,t.jsx)(hn,{})})}hm.displayName=g1.displayName,u.forwardRef(({className:a,...b},c)=>(0,t.jsx)(hb,{ref:c,className:aR("-mx-1 my-1 h-px bg-muted",a),...b})).displayName=hb.displayName,a.s(["Select",()=>gC,"SelectContent",()=>hl,"SelectItem",()=>hm,"SelectTrigger",()=>hi,"SelectValue",()=>gG],99295),a.s(["BankSelector",()=>ho],49839)}];
|
|
8
8
|
|
|
9
9
|
//# sourceMappingURL=_29833292._.js.map
|