create-opentray 0.0.0 → 0.19.0

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.
Files changed (44) hide show
  1. package/README.md +163 -0
  2. package/dist/assets/create-openspec-template-iOS-Dark-1024@1x.png +0 -0
  3. package/dist/assets/create-openspec-template-iOS-Default-1024@1x.png +0 -0
  4. package/dist/bin-BT_kcLuP.mjs +3823 -0
  5. package/dist/bin-BT_kcLuP.mjs.map +1 -0
  6. package/dist/bin-CeFW1wxR.d.mts +15 -0
  7. package/dist/bin-CeFW1wxR.d.mts.map +1 -0
  8. package/dist/bin.d.mts +2 -0
  9. package/dist/bin.mjs +3 -0
  10. package/dist/icon-codec-BQ3cGV1n.mjs +13 -0
  11. package/dist/icon-codec-BQ3cGV1n.mjs.map +1 -0
  12. package/dist/index.d.mts +557 -0
  13. package/dist/index.d.mts.map +1 -0
  14. package/dist/index.mjs +2 -0
  15. package/dist/shell/assets/__vite-browser-external-2447137e.js +1 -0
  16. package/dist/shell/assets/browse.js +1 -0
  17. package/dist/shell/assets/ghostty-web.js +13 -0
  18. package/dist/shell/assets/index.css +1 -0
  19. package/dist/shell/assets/index.js +9 -0
  20. package/dist/shell/assets/input.js +1 -0
  21. package/dist/shell/assets/main.js +43 -0
  22. package/dist/shell/assets/terminal-pane.js +2 -0
  23. package/dist/shell/assets/terminal.js +1 -0
  24. package/dist/shell/browse.html +15 -0
  25. package/dist/shell/ghostty-vt.wasm +0 -0
  26. package/dist/shell/index.html +15 -0
  27. package/dist/shell/terminal.html +15 -0
  28. package/dist/webui/assets/__vite-browser-external-2447137e.js +1 -0
  29. package/dist/webui/assets/browse.js +1 -0
  30. package/dist/webui/assets/ghostty-web.js +13 -0
  31. package/dist/webui/assets/index.css +1 -0
  32. package/dist/webui/assets/index.js +9 -0
  33. package/dist/webui/assets/input.js +1 -0
  34. package/dist/webui/assets/main.js +43 -0
  35. package/dist/webui/assets/terminal-pane.js +2 -0
  36. package/dist/webui/assets/terminal.js +1 -0
  37. package/dist/webui/browse.html +15 -0
  38. package/dist/webui/ghostty-vt.wasm +0 -0
  39. package/dist/webui/index.html +16 -0
  40. package/dist/webui/terminal.html +15 -0
  41. package/dist/webui/vendor/ghostty-vt.wasm +0 -0
  42. package/dist/webui/vendor/ghostty-web.js +2963 -0
  43. package/package.json +45 -5
  44. package/index.js +0 -1
@@ -0,0 +1 @@
1
+ import{c as m,r as a,e as I,j as _,d as E,f as L}from"./index.js";const z=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],K=m("arrow-left",z);const V=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Q=m("arrow-right",V);const A=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],U=m("globe",A);const O=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],X=m("rotate-cw",O);var M=Object.defineProperty,g=(e,t)=>M(e,"name",{value:t,configurable:!0});function b(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}g(b,"setRef");function S(...e){return t=>{let o=!1;const n=e.map(r=>{const s=b(r,t);return!o&&typeof s=="function"&&(o=!0),s});if(o)return()=>{for(let r=0;r<n.length;r++){const s=n[r];typeof s=="function"?s():b(e[r],null)}}}}g(S,"composeRefs");function R(...e){return a.useCallback(S(...e),e)}g(R,"useComposedRefs");var B=Object.defineProperty,l=(e,t)=>B(e,"name",{value:t,configurable:!0});function w(e){const t=a.forwardRef((o,n)=>{let{children:r,...s}=o,i=null,c=!1;const d=[];y(r)&&typeof p=="function"&&(r=p(r._payload)),a.Children.forEach(r,h=>{if(j(h)){c=!0;const u=h;let f="child"in u.props?u.props.child:u.props.children;y(f)&&typeof p=="function"&&(f=p(f._payload)),i=F(u,f),d.push(i?.props?.children)}else d.push(h)}),i?i=a.cloneElement(i,void 0,d):!c&&a.Children.count(r)===1&&a.isValidElement(r)&&(i=r);const v=i?$(i):void 0,N=R(n,v);if(!i){if(r||r===0)throw new Error(c?q(e):H(e));return r}const x=P(s,i.props??{});return i.type!==a.Fragment&&(x.ref=n?N:v),a.cloneElement(i,x)});return t.displayName=`${e}.Slot`,t}l(w,"createSlot");var T=w("Slot"),k=Symbol.for("radix.slottable");function W(e){const t=l(o=>"child"in o?o.children(o.child):o.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=k,t}l(W,"createSlottable");var F=l((e,t)=>{if("child"in e.props){const o=e.props.child;return a.isValidElement(o)?a.cloneElement(o,void 0,e.props.children(o.props.children)):null}return a.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function P(e,t){const o={...t};for(const n in t){const r=e[n],s=t[n];/^on[A-Z]/.test(n)?r&&s?o[n]=(...c)=>{const d=s(...c);return r(...c),d}:r&&(o[n]=r):n==="style"?o[n]={...r,...s}:n==="className"&&(o[n]=[r,s].filter(Boolean).join(" "))}return{...e,...o}}l(P,"mergeProps");function $(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}l($,"getElementRef");function j(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===k}l(j,"isSlottable");var D=Symbol.for("react.lazy");function y(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===D&&"_payload"in e&&C(e._payload)}l(y,"isLazyComponent");function C(e){return typeof e=="object"&&e!==null&&"then"in e}l(C,"isPromiseLike");var H=l(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),q=l(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),p=I[" use ".trim().toString()];const G=L("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9",iconSm:"h-7 w-7"}},defaultVariants:{variant:"default",size:"default"}}),Y=a.forwardRef(({className:e,variant:t,size:o,asChild:n=!1,...r},s)=>{const i=n?T:"button";return _.jsx(i,{className:E(G({variant:t,size:o,className:e})),ref:s,...r})});Y.displayName="Button";const Z=a.forwardRef(({className:e,type:t,...o},n)=>_.jsx("input",{type:t,className:E("flex h-9 w-full rounded-md border border-input bg-popover px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...o}));Z.displayName="Input";export{K as A,Y as B,U as G,Z as I,X as R,Q as a,w as c,R as u};
@@ -0,0 +1,43 @@
1
+ var so=e=>{throw TypeError(e)};var io=(e,t,n)=>t.has(e)||so("Cannot "+n);var ce=(e,t,n)=>(io(e,t,"read from private field"),n?n.call(e):t.get(e)),ao=(e,t,n)=>t.has(e)?so("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),In=(e,t,n,r)=>(io(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);import{c as _e,b as ua,r as c,j as i,d as Q,e as At,R as da,a as fa}from"./index.js";import{c as tt,I as et,u as ne,B as de,G as co,A as pa,a as ma,R as ha}from"./input.js";import{T as nn,B as ar,p as va,c as ga}from"./terminal-pane.js";const xa=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ba=_e("check",xa);const ya=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],$o=_e("chevron-down",ya);const wa=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ca=_e("circle-check",wa);const Sa=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Ra=_e("external-link",Sa);const Ea=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Pa=_e("play",Ea);const ja=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Na=_e("settings-2",ja);const Ia=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Aa=_e("square",Ia);const Ta=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Oa=_e("triangle-alert",Ta);const _a=[["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"}]],Fo=_e("upload",_a);const Da=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Lo=_e("x",Da);var Tt=ua(),ka=Object.defineProperty,Ma=(e,t)=>ka(e,"name",{value:t,configurable:!0}),$a=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],H=$a.reduce((e,t)=>{const n=tt(`Primitive.${t}`),r=c.forwardRef((o,s)=>{const{asChild:a,...l}=o,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(u,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Bo(e,t){e&&Tt.flushSync(()=>e.dispatchEvent(t))}Ma(Bo,"dispatchDiscreteCustomEvent");var Fa=Object.defineProperty,La=(e,t)=>Fa(e,"name",{value:t,configurable:!0}),Ba=c.forwardRef(La(function(t,n){return i.jsx(H.label,{...t,ref:n,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(t.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}})},"Label")),zo=Ba;const fe=c.forwardRef(({className:e,...t},n)=>i.jsx(zo,{ref:n,className:Q("text-xs font-medium text-muted-foreground leading-none",e),...t}));fe.displayName=zo.displayName;const Vo=e=>`/api/icon-composed/${e}?token=${encodeURIComponent(new URLSearchParams(location.search).get("token")??"")}`,za={cwd:"",env:[],argsMode:"string"},cr=new URLSearchParams(location.search).get("token")??"",J=(e,t={})=>fetch(e,{method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${cr}`},body:JSON.stringify(t)}),Va=()=>new EventSource(`/api/events?token=${encodeURIComponent(cr)}`),pt=(e,t)=>`/api/icon-data/${e}/${t}?token=${encodeURIComponent(cr)}`,Ha=e=>{try{return new URL(e).hostname}catch{return e}};function Ua({values:e,defaults:t,frozen:n,iconCandidates:r,iconCandidatesPort:o,uploadedIconUrl:s,selectedIconRef:a,iconAnalysis:l,iconComposition:u,iconComposeError:f,iconBackground:p,iconScale:d,onIconBackgroundChange:h,onIconScaleChange:x,onPickIconCandidate:g,onUploadIcon:v,onClearIcon:m,onPatch:C}){const b=n,y=c.useRef(null),[w,R]=c.useState(!1);return i.jsxs("div",{className:"grid grid-cols-1 gap-y-1",children:[i.jsxs("div",{children:[i.jsx(fe,{children:"应用图标"}),i.jsxs("div",{className:"mt-1.5 flex flex-wrap items-start gap-3",children:[i.jsx("button",{type:"button",disabled:b,"aria-label":"选择本地图片作为应用图标",onClick:()=>y.current?.click(),onDragOver:S=>{S.preventDefault(),b||R(!0)},onDragLeave:()=>R(!1),onDrop:S=>{if(S.preventDefault(),R(!1),b)return;const P=S.dataTransfer.files[0];P!==void 0&&v(P)},className:Q("flex size-20 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-dashed border-border bg-popover transition-colors",b?"opacity-50":"hover:border-primary",w&&"border-primary bg-primary/10"),children:s!==void 0?i.jsx("img",{src:s,alt:"已选图标",className:"icon-checker size-full rounded object-contain"}):i.jsxs("span",{className:"flex flex-col items-center gap-1 text-muted-foreground",children:[i.jsx(Fo,{className:"size-4"}),i.jsx("span",{className:"text-[10px] leading-tight",children:"点击或拖入图片"})]})}),i.jsx("input",{ref:y,type:"file",accept:"image/png,image/jpeg,image/svg+xml,image/webp,image/gif",className:"hidden",disabled:b,onChange:S=>{const P=S.target.files?.[0];P!==void 0&&v(P),S.target.value=""}}),i.jsx("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:r.length===0?i.jsx("span",{className:"text-xs text-muted-foreground",children:"未抓取到候选图标;将使用首字母图标"}):r.map(S=>{const P=o===void 0?void 0:pt(o,S.index),I=a===`${o}:${S.index}`,N=a===void 0&&S.index===0;return i.jsx("button",{type:"button",disabled:b,title:`${S.width}×${S.height} ${S.format.toUpperCase()}`,onClick:()=>g(S),className:Q("icon-checker flex size-14 items-center justify-center overflow-hidden rounded-lg border p-1 transition-all",I||N?"border-primary ring-2 ring-primary/60":"border-border hover:border-primary/60",b&&"opacity-50"),children:P!==void 0?i.jsx("img",{src:P,alt:`候选图标 ${S.width}×${S.height}`,className:"size-full object-contain"}):null},S.index)})}),a!==void 0||s!==void 0?i.jsx("button",{type:"button",disabled:b,onClick:m,className:"text-[11px] text-muted-foreground underline-offset-2 hover:underline",children:"清除选择(回到默认)"}):null]}),i.jsx("div",{className:"mt-3 rounded-lg border border-border p-3",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{role:"img",className:"icon-checker size-14 shrink-0 overflow-hidden rounded-[10px]","aria-label":"图标合成预览",children:u!==void 0?i.jsx("img",{src:Vo(u.key),alt:"图标合成预览",className:"size-full object-contain",onError:S=>{S.currentTarget.style.display="none"}}):i.jsx("span",{className:"flex size-full items-center justify-center text-[10px] text-muted-foreground",children:"预览"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx(fe,{children:"图标背景"}),i.jsx("div",{className:"mt-1.5 flex gap-1.5",children:["black","white","transparent"].map(S=>i.jsxs("button",{type:"button",disabled:b,"aria-pressed":p===S,onClick:()=>h(S),className:Q("flex h-7 items-center gap-1.5 rounded-md border px-2.5 text-[11px] transition-colors",p===S?"border-foreground bg-secondary text-secondary-foreground":"border-border text-muted-foreground hover:border-foreground/40"),children:[S==="black"?"黑色":S==="white"?"白色":"透明",l!==void 0&&l.suggested===S?i.jsx("span",{className:"text-[10px] text-muted-foreground/70",children:"自动"}):null]},S))}),i.jsxs("div",{className:"mt-2.5",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(fe,{className:"text-[11px]",children:"前景缩放"}),i.jsxs("span",{className:"text-[11px] tabular-nums text-muted-foreground",children:[Math.round(d*100),"%"]})]}),i.jsx("input",{type:"range",min:50,max:95,step:5,value:Math.round(d*100),disabled:b,onChange:S=>x(Number(S.target.value)/100),className:"mt-1 w-full accent-foreground","aria-label":"前景图标缩放"})]}),f!==void 0?i.jsx("p",{role:"alert",className:"mt-1.5 text-[11px] font-medium text-red-400",children:f}):null,l!==void 0?i.jsx("p",{className:"mt-1.5 text-[11px] leading-relaxed text-muted-foreground",children:p==="transparent"?"透明背景:原始像素直接透出。":`已按明暗自动选择${l.suggested===p?"":"(已手动覆盖)"}:${l.luminance===void 0?"无法分析明暗":`前景明度 ${l.luminance.toFixed(2)}、覆盖率 ${(l.coverage*100).toFixed(0)}%`}。`}):null]})]})})]}),i.jsxs("div",{children:[i.jsx(fe,{htmlFor:"appId",children:"App ID"}),i.jsx(et,{id:"appId",className:"mt-1 font-mono",disabled:b,value:e.appId,placeholder:t.appId||"由命令推导(如 start.somecommand.npx)",onChange:S=>C({appId:S.target.value})})]}),i.jsxs("div",{children:[i.jsx(fe,{htmlFor:"appName",children:"应用名称"}),i.jsx(et,{id:"appName",className:"mt-1",disabled:b,value:e.appName,placeholder:t.appName||"从服务页面标题抓取",onChange:S=>C({appName:S.target.value})})]})]})}function Wa({candidates:e,port:t,disabled:n,selectedRef:r,uploadedUrl:o,includeVariants:s,defaultLabel:a,onPick:l,onUpload:u,onClear:f}){const p=c.useRef(null),[d,h]=c.useState(!1),x=s?e:e.filter(v=>v.variant==="original"),g=e.filter(v=>v.variant==="original");return i.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[i.jsx("button",{type:"button",disabled:n,"aria-label":"选择本地图片",onClick:()=>p.current?.click(),onDragOver:v=>{v.preventDefault(),n||h(!0)},onDragLeave:()=>h(!1),onDrop:v=>{if(v.preventDefault(),h(!1),n)return;const m=v.dataTransfer.files[0];m!==void 0&&u(m)},className:Q("flex size-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-dashed border-border bg-popover transition-colors",n?"opacity-50":"hover:border-primary",d&&"border-primary bg-primary/10"),children:o!==void 0?i.jsx("img",{src:o,alt:"已选图标",className:"icon-checker size-full rounded object-contain"}):i.jsxs("span",{className:"flex flex-col items-center gap-1 text-muted-foreground",children:[i.jsx(Fo,{className:"size-4"}),i.jsx("span",{className:"text-[10px] leading-tight",children:"上传"})]})}),i.jsx("input",{ref:p,type:"file",accept:"image/png,image/jpeg,image/svg+xml,image/webp,image/gif",className:"hidden",disabled:n,onChange:v=>{const m=v.target.files?.[0];m!==void 0&&u(m),v.target.value=""}}),i.jsxs("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:[x.length===0?i.jsx("span",{className:"text-xs text-muted-foreground",children:"暂无候选图标"}):x.map(v=>{const m=t===void 0?void 0:pt(t,v.index),C=r===`${t}:${v.index}`,b=r===void 0&&v.variant==="original"&&v.index===(g[0]?.index??-1);return i.jsx("button",{type:"button",disabled:n,title:v.variant==="original"?`${v.width}×${v.height} ${v.format.toUpperCase()}`:`${v.variant==="solid-black"?"黑色":"白色"}纯色 ${v.format.toUpperCase()}`,onClick:()=>l(v),className:Q("icon-checker flex size-12 items-center justify-center overflow-hidden rounded-lg border p-1 transition-all",C||b?"border-primary ring-2 ring-primary/60":"border-border hover:border-primary/60",n&&"opacity-50"),children:m!==void 0?i.jsx("img",{src:m,alt:`候选 ${v.variant}`,className:"size-full object-contain"}):null},`${v.variant}:${v.index}`)}),a!==void 0&&r===void 0&&x.length>0?i.jsx("span",{className:"text-[11px] text-muted-foreground",children:a}):null]}),r!==void 0||o!==void 0?i.jsx("button",{type:"button",disabled:n,onClick:f,className:"text-[11px] text-muted-foreground underline-offset-2 hover:underline",children:"清除"}):null]})}var Ka=Object.defineProperty,Ce=(e,t)=>Ka(e,"name",{value:t,configurable:!0});function Ga(e,t){const n=c.createContext(t);n.displayName=e+"Context";const r=Ce(s=>{const{children:a,...l}=s,u=c.useMemo(()=>l,Object.values(l));return i.jsx(n.Provider,{value:u,children:a})},"Provider");r.displayName=e+"Provider";function o(s,a={}){const{optional:l=!1}=a,u=c.useContext(n);if(u)return u;if(t!==void 0)return t;if(!l)throw new Error(`\`${s}\` must be used within \`${e}\``)}return Ce(o,"useContext"),[r,o]}Ce(Ga,"createContext");function Pe(e,t=[]){let n=[];function r(s,a){const l=c.createContext(a);l.displayName=s+"Context";const u=n.length;n=[...n,a];const f=Ce(d=>{const{scope:h,children:x,...g}=d,v=h?.[e]?.[u]||l,m=c.useMemo(()=>g,Object.values(g));return i.jsx(v.Provider,{value:m,children:x})},"Provider");f.displayName=s+"Provider";function p(d,h,x={}){const{optional:g=!1}=x,v=h?.[e]?.[u]||l,m=c.useContext(v);if(m)return m;if(a!==void 0)return a;if(!g)throw new Error(`\`${d}\` must be used within \`${s}\``)}return Ce(p,"useContext"),[f,p]}Ce(r,"createContext");const o=Ce(()=>{const s=n.map(a=>c.createContext(a));return Ce(function(l){const u=l?.[e]||s;return c.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])},"useScope")},"createScope");return o.scopeName=e,[r,Ho(o,...t)]}Ce(Pe,"createContextScope");function Ho(...e){const t=e[0];if(e.length===1)return t;const n=Ce(()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return Ce(function(s){const a=r.reduce((l,{useScope:u,scopeName:f})=>{const d=u(s)[`__scope${f}`];return{...l,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}Ce(Ho,"composeContextScopes");var Ya=Object.defineProperty,ie=(e,t)=>Ya(e,"name",{value:t,configurable:!0});function cn(e){const t=e+"CollectionProvider",[n,r]=Pe(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=ie(v=>{const{scope:m,children:C}=v,b=c.useRef(null),y=c.useRef(new Map).current;return i.jsx(o,{scope:m,itemMap:y,collectionRef:b,children:C})},"CollectionProvider");a.displayName=t;const l=e+"CollectionSlot",u=tt(l),f=c.forwardRef((v,m)=>{const{scope:C,children:b}=v,y=s(l,C),w=ne(m,y.collectionRef);return i.jsx(u,{ref:w,children:b})});f.displayName=l;const p=e+"CollectionItemSlot",d="data-radix-collection-item",h=tt(p),x=c.forwardRef((v,m)=>{const{scope:C,children:b,...y}=v,w=c.useRef(null),R=ne(m,w),S=s(p,C);return c.useEffect(()=>(S.itemMap.set(w,{ref:w,...y}),()=>{S.itemMap.delete(w)})),i.jsx(h,{[d]:"",ref:R,children:b})});x.displayName=p;function g(v){const m=s(e+"CollectionConsumer",v);return c.useCallback(()=>{const b=m.collectionRef.current;if(!b)return[];const y=Array.from(b.querySelectorAll(`[${d}]`));return Array.from(m.itemMap.values()).sort((S,P)=>y.indexOf(S.ref.current)-y.indexOf(P.ref.current))},[m.collectionRef,m.itemMap])}return ie(g,"useCollection"),[{Provider:a,Slot:f,ItemSlot:x},g,r]}ie(cn,"createCollection");var lo=new WeakMap,re,be,An=(be=class extends Map{constructor(n){super(n);ao(this,re);In(this,re,[...super.keys()]),lo.set(this,!0)}set(n,r){return lo.get(this)&&(this.has(n)?ce(this,re)[ce(this,re).indexOf(n)]=n:ce(this,re).push(n)),super.set(n,r),this}insert(n,r,o){const s=this.has(r),a=ce(this,re).length,l=lr(n);let u=l>=0?l:a+l;const f=u<0||u>=a?-1:u;if(f===this.size||s&&f===this.size-1||f===-1)return this.set(r,o),this;const p=this.size+(s?0:1);l<0&&u++;const d=[...ce(this,re)];let h,x=!1;for(let g=u;g<p;g++)if(u===g){let v=d[g];d[g]===r&&(v=d[g+1]),s&&this.delete(r),h=this.get(v),this.set(r,o)}else{!x&&d[g-1]===r&&(x=!0);const v=d[x?g:g-1],m=h;h=this.get(v),this.delete(v),this.set(v,m)}return this}with(n,r,o){const s=new be(this);return s.insert(n,r,o),s}before(n){const r=ce(this,re).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,o){const s=ce(this,re).indexOf(n);return s===-1?this:this.insert(s,r,o)}after(n){let r=ce(this,re).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,o){const s=ce(this,re).indexOf(n);return s===-1?this:this.insert(s+1,r,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return In(this,re,[]),super.clear()}delete(n){const r=super.delete(n);return r&&ce(this,re).splice(ce(this,re).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=Xt(ce(this,re),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=Xt(ce(this,re),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return ce(this,re).indexOf(n)}keyAt(n){return Xt(ce(this,re),n)}from(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return s;o++}}findIndex(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return o;o++}return-1}filter(n,r){const o=[];let s=0;for(const a of this)Reflect.apply(n,r,[a,s,this])&&o.push(a),s++;return new be(o)}map(n,r){const o=[];let s=0;for(const a of this)o.push([a[0],Reflect.apply(n,r,[a,s,this])]),s++;return new be(o)}reduce(...n){const[r,o]=n;let s=0,a=o??this.at(0);for(const l of this)s===0&&n.length===1?a=l:a=Reflect.apply(r,this,[a,l,s,this]),s++;return a}reduceRight(...n){const[r,o]=n;let s=o??this.at(-1);for(let a=this.size-1;a>=0;a--){const l=this.at(a);a===this.size-1&&n.length===1?s=l:s=Reflect.apply(r,this,[s,l,a,this])}return s}toSorted(n){const r=[...this.entries()].sort(n);return new be(r)}toReversed(){const n=new be;for(let r=this.size-1;r>=0;r--){const o=this.keyAt(r),s=this.get(o);n.set(o,s)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new be(r)}slice(n,r){const o=new be;let s=this.size-1;if(n===void 0)return o;n<0&&(n=n+this.size),r!==void 0&&r>0&&(s=r-1);for(let a=n;a<=s;a++){const l=this.keyAt(a),u=this.get(l);o.set(l,u)}return o}every(n,r){let o=0;for(const s of this){if(!Reflect.apply(n,r,[s,o,this]))return!1;o++}return!0}some(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return!0;o++}return!1}},re=new WeakMap,ie(be,"OrderedDict"),be);function Xt(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=Uo(e,t);return n===-1?void 0:e[n]}ie(Xt,"at");function Uo(e,t){const n=e.length,r=lr(t),o=r>=0?r:n+r;return o<0||o>=n?-1:o}ie(Uo,"toSafeIndex");function lr(e){return e!==e||e===0?0:Math.trunc(e)}ie(lr,"toSafeInteger");function qa(e){const t=e+"CollectionProvider",[n,r]=Pe(t),[o,s]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new An,setItemMap:ie(()=>{},"setItemMap")}),a=ie(({state:y,...w})=>y?i.jsx(u,{...w,state:y}):i.jsx(l,{...w}),"CollectionProvider");a.displayName=t;const l=ie(y=>{const w=m();return i.jsx(u,{...y,state:w})},"CollectionInit");l.displayName=t+"Init";const u=ie(y=>{const{scope:w,children:R,state:S}=y,P=c.useRef(null),[I,N]=c.useState(null),A=ne(P,N),[_,T]=S;return c.useEffect(()=>{if(!I)return;const D=Go(()=>{});return D.observe(I,{childList:!0,subtree:!0}),()=>{D.disconnect()}},[I]),i.jsx(o,{scope:w,itemMap:_,setItemMap:T,collectionRef:A,collectionRefObject:P,collectionElement:I,children:R})},"CollectionProviderImpl");u.displayName=t+"Impl";const f=e+"CollectionSlot",p=tt(f),d=c.forwardRef((y,w)=>{const{scope:R,children:S}=y,P=s(f,R),I=ne(w,P.collectionRef);return i.jsx(p,{ref:I,children:S})});d.displayName=f;const h=e+"CollectionItemSlot",x="data-radix-collection-item",g=tt(h),v=c.forwardRef((y,w)=>{const{scope:R,children:S,...P}=y,I=c.useRef(null),[N,A]=c.useState(null),_=ne(w,I,A),T=s(h,R),{setItemMap:D}=T,$=c.useRef(P);Wo($.current,P)||($.current=P);const K=$.current;return c.useEffect(()=>{const L=K;return D(k=>N?k.has(N)?k.set(N,{...L,element:N}).toSorted(Hn):(k.set(N,{...L,element:N}),k.toSorted(Hn)):k),()=>{D(k=>!N||!k.has(N)?k:(k.delete(N),new An(k)))}},[N,K,D]),i.jsx(g,{[x]:"",ref:_,children:S})});v.displayName=h;function m(){return c.useState(new An)}ie(m,"useInitCollection");function C(y){const{itemMap:w}=s(e+"CollectionConsumer",y);return w}return ie(C,"useCollection"),[{Provider:a,Slot:d,ItemSlot:v},{createCollectionScope:r,useCollection:C,useInitCollection:m}]}ie(qa,"createCollection");function Wo(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||e[o]!==t[o])return!1;return!0}ie(Wo,"shallowEqual");function Ko(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}ie(Ko,"isElementPreceding");function Hn(e,t){return!e[1].element||!t[1].element?0:Ko(e[1].element,t[1].element)?-1:1}ie(Hn,"sortByDocumentPosition");function Go(e){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){e();return}})}ie(Go,"getChildListObserver");var Xa=Object.defineProperty,gt=(e,t)=>Xa(e,"name",{value:t,configurable:!0}),Yo=!!(typeof window<"u"&&window.document&&window.document.createElement);function z(e,t,{checkForDefaultPrevented:n=!0}={}){return gt(function(o){if(e?.(o),n===!1||!o||!o.defaultPrevented)return t?.(o)},"handleEvent")}gt(z,"composeEventHandlers");function Za(e){if(!Yo)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}gt(Za,"getOwnerWindow");function Un(e){if(!Yo)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}gt(Un,"getOwnerDocument");function qo(e,t=!1){const{activeElement:n}=Un(e);if(!n?.nodeName)return null;if(Xo(n)&&n.contentDocument)return qo(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=Un(n).getElementById(r);if(o)return o}}return n}gt(qo,"getActiveElement");function Xo(e){return e.tagName==="IFRAME"}gt(Xo,"isFrame");var oe=globalThis?.document?c.useLayoutEffect:()=>{},Ja=Object.defineProperty,Qa=(e,t)=>Ja(e,"name",{value:t,configurable:!0}),uo=At[" useEffectEvent ".trim().toString()],fo=At[" useInsertionEffect ".trim().toString()];function Zo(e){if(typeof uo=="function")return uo(e);const t=c.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof fo=="function"?fo(()=>{t.current=e}):oe(()=>{t.current=e}),c.useMemo(()=>((...n)=>t.current?.(...n)),[])}Qa(Zo,"useEffectEvent");var ec=Object.defineProperty,Ot=(e,t)=>ec(e,"name",{value:t,configurable:!0}),tc=At[" useInsertionEffect ".trim().toString()]||oe;function Ae({prop:e,defaultProp:t,onChange:n=Ot(()=>{},"onChange"),caller:r}){const[o,s,a]=Jo({defaultProp:t,onChange:n}),l=e!==void 0,u=l?e:o,f=c.useCallback(p=>{if(l){const d=Qo(p)?p(e):p;d!==e&&a.current?.(d)}else s(p)},[l,e,s,a]);return[u,f]}Ot(Ae,"useControllableState");function Jo({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),s=c.useRef(t);return tc(()=>{s.current=t},[t]),c.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}Ot(Jo,"useUncontrolledState");function Qo(e){return typeof e=="function"}Ot(Qo,"isFunction");var po=Symbol("RADIX:SYNC_STATE");function nc(e,t,n,r){const{prop:o,defaultProp:s,onChange:a,caller:l}=t,u=o!==void 0,f=Zo(a),p=[{...n,state:s}];r&&p.push(r);const[d,h]=c.useReducer((m,C)=>{if(C.type===po)return{...m,state:C.state};const b=e(m,C);return u&&!Object.is(b.state,m.state)&&f(b.state),b},...p),x=d.state,g=c.useRef(x);c.useEffect(()=>{g.current!==x&&(g.current=x,u||f(x))},[x,g,u]);const v=c.useMemo(()=>o!==void 0?{...d,state:o}:d,[d,o]);return c.useEffect(()=>{u&&!Object.is(o,d.state)&&h({type:po,state:o})},[o,d.state,u]),[v,h]}Ot(nc,"useControllableStateReducer");var rc=Object.defineProperty,Ve=(e,t)=>rc(e,"name",{value:t,configurable:!0});function es(e,t){return c.useReducer((n,r)=>t[n][r]??n,e)}Ve(es,"useStateMachine");var xt=Ve(e=>{const{present:t,children:n}=e,r=ts(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),s=ns(r.ref,rs(o));return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:s}):null},"Presence");function ts(e){const[t,n]=c.useState(),r=c.useRef(null),o=c.useRef(e),s=c.useRef("none"),a=c.useRef(void 0),l=e?"mounted":"unmounted",[u,f]=es(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{u==="mounted"?(s.current=a.current??ft(r.current),a.current=void 0):s.current="none"},[u]),oe(()=>{const p=r.current,d=o.current;if(d!==e){const x=s.current,g=ft(p);e?(a.current=g,f("MOUNT")):g==="none"||p?.display==="none"?f("UNMOUNT"):f(d&&x!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,f]),oe(()=>{if(t){let p;const d=t.ownerDocument.defaultView??window,h=Ve(g=>{const m=ft(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&m&&(f("ANIMATION_END"),!o.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",p=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},"handleAnimationEnd"),x=Ve(g=>{g.target===t&&(s.current=ft(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(p),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:c.useCallback(p=>{if(p){const d=getComputedStyle(p);r.current=d,a.current=ft(d)}else r.current=null;n(p)},[])}}Ve(ts,"usePresence");function Wn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Ve(Wn,"setRef");function ns(...e){const t=c.useRef(e);return t.current=e,c.useCallback(n=>{const r=t.current;let o=!1;const s=r.map(a=>{const l=Wn(a,n);return!o&&typeof l=="function"&&(o=!0),l});if(o)return()=>{for(let a=0;a<s.length;a++){const l=s[a];typeof l=="function"?l():Wn(r[a],null)}}},[])}Ve(ns,"useStableComposedRefs");function ft(e){return e?.animationName||"none"}Ve(ft,"getAnimationName");function rs(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Ve(rs,"getElementRef");var oc=Object.defineProperty,sc=(e,t)=>oc(e,"name",{value:t,configurable:!0}),ic=At[" useId ".trim().toString()]||(()=>{}),ac=0;function Ie(e){const[t,n]=c.useState(ic());return oe(()=>{e||n(r=>r??String(ac++))},[e]),e||(t?`radix-${t}`:"")}sc(Ie,"useId");var cc=Object.defineProperty,_t=(e,t)=>cc(e,"name",{value:t,configurable:!0}),ur="Collapsible",[lc,os]=Pe(ur),[uc,dr]=lc(ur),dc=c.forwardRef(_t(function(t,n){const{__scopeCollapsible:r,open:o,defaultOpen:s,disabled:a,onOpenChange:l,...u}=t,[f,p]=Ae({prop:o,defaultProp:s??!1,onChange:l,caller:ur});return i.jsx(uc,{scope:r,disabled:a,contentId:Ie(),open:f,onOpenToggle:c.useCallback(()=>p(d=>!d),[p]),children:i.jsx(H.div,{"data-state":ln(f),"data-disabled":a?"":void 0,...u,ref:n})})},"Collapsible")),fc="CollapsibleTrigger",pc=c.forwardRef(_t(function(t,n){const{__scopeCollapsible:r,...o}=t,s=dr(fc,r);return i.jsx(H.button,{type:"button","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open||!1,"data-state":ln(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...o,ref:n,onClick:z(t.onClick,s.onOpenToggle)})},"CollapsibleTrigger")),ss="CollapsibleContent",mc=c.forwardRef(_t(function(t,n){const{forceMount:r,...o}=t,s=dr(ss,t.__scopeCollapsible);return i.jsx(xt,{present:r||s.open,children:({present:a})=>i.jsx(hc,{...o,ref:n,present:a})})},"CollapsibleContent")),hc=c.forwardRef(_t(function(t,n){const{__scopeCollapsible:r,present:o,children:s,...a}=t,l=dr(ss,r),[u,f]=c.useState(o),p=c.useRef(null),d=ne(n,p),h=c.useRef(0),x=h.current,g=c.useRef(0),v=g.current,m=l.open||u,C=c.useRef(m),b=c.useRef(void 0);return c.useEffect(()=>{const y=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(y)},[]),oe(()=>{const y=p.current;if(y){b.current=b.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const w=y.getBoundingClientRect();h.current=w.height,g.current=w.width,C.current||(y.style.transitionDuration=b.current.transitionDuration,y.style.animationName=b.current.animationName),f(o)}},[l.open,o]),i.jsx(H.div,{"data-state":ln(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!m,...a,ref:d,style:{"--radix-collapsible-content-height":x?`${x}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...t.style},children:m&&s})},"CollapsibleContentImpl"));function ln(e){return e?"open":"closed"}_t(ln,"getState");var vc=dc,gc=pc,xc=mc,bc=Object.defineProperty,yc=(e,t)=>bc(e,"name",{value:t,configurable:!0}),wc=c.createContext(void 0);function Dt(e){const t=c.useContext(wc);return e||t||"ltr"}yc(Dt,"useDirection");var Cc=Object.defineProperty,ye=(e,t)=>Cc(e,"name",{value:t,configurable:!0}),De="Accordion",Sc=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[fr,Rc,Ec]=cn(De),[un,Xf]=Pe(De,[Ec,os]),pr=os(),Pc=c.forwardRef(ye(function(t,n){const{type:r,...o}=t,s=o,a=o;return i.jsx(fr.Provider,{scope:t.__scopeAccordion,children:r==="multiple"?i.jsx(Ac,{...a,ref:n}):i.jsx(Ic,{...s,ref:n})})},"Accordion")),[is,jc]=un(De),[as,Nc]=un(De,{collapsible:!1}),Ic=c.forwardRef(ye(function(t,n){const{value:r,defaultValue:o,onValueChange:s=ye(()=>{},"onValueChange"),collapsible:a=!1,...l}=t,[u,f]=Ae({prop:r,defaultProp:o??"",onChange:s,caller:De});return i.jsx(is,{scope:t.__scopeAccordion,value:c.useMemo(()=>u?[u]:[],[u]),onItemOpen:f,onItemClose:c.useCallback(()=>a&&f(""),[a,f]),children:i.jsx(as,{scope:t.__scopeAccordion,collapsible:a,children:i.jsx(cs,{...l,ref:n})})})},"AccordionImplSingle")),Ac=c.forwardRef(ye(function(t,n){const{value:r,defaultValue:o,onValueChange:s=ye(()=>{},"onValueChange"),...a}=t,[l,u]=Ae({prop:r,defaultProp:o??[],onChange:s,caller:De}),f=c.useCallback(d=>u((h=[])=>[...h,d]),[u]),p=c.useCallback(d=>u((h=[])=>h.filter(x=>x!==d)),[u]);return i.jsx(is,{scope:t.__scopeAccordion,value:l,onItemOpen:f,onItemClose:p,children:i.jsx(as,{scope:t.__scopeAccordion,collapsible:!0,children:i.jsx(cs,{...a,ref:n})})})},"AccordionImplMultiple")),[Tc,dn]=un(De),cs=c.forwardRef(ye(function(t,n){const{__scopeAccordion:r,disabled:o,dir:s,orientation:a="vertical",...l}=t,u=c.useRef(null),f=ne(u,n),p=Rc(r),h=Dt(s)==="ltr",x=z(t.onKeyDown,g=>{if(!Sc.includes(g.key))return;const v=g.target,m=p().filter(N=>!N.ref.current?.disabled),C=m.findIndex(N=>N.ref.current===v),b=m.length;if(C===-1)return;g.preventDefault();let y=C;const w=0,R=b-1,S=ye(()=>{y=C+1,y>R&&(y=w)},"moveNext"),P=ye(()=>{y=C-1,y<w&&(y=R)},"movePrev");switch(g.key){case"Home":y=w;break;case"End":y=R;break;case"ArrowRight":a==="horizontal"&&(h?S():P());break;case"ArrowDown":a==="vertical"&&S();break;case"ArrowLeft":a==="horizontal"&&(h?P():S());break;case"ArrowUp":a==="vertical"&&P();break}const I=y%b;m[I].ref.current?.focus()});return i.jsx(Tc,{scope:r,disabled:o,direction:s,orientation:a,children:i.jsx(fr.Slot,{scope:r,children:i.jsx(H.div,{...l,"data-orientation":a,ref:f,onKeyDown:o?void 0:x})})})},"AccordionImpl")),Kn="AccordionItem",[Oc,mr]=un(Kn),_c=c.forwardRef(ye(function(t,n){const{__scopeAccordion:r,value:o,...s}=t,a=dn(Kn,r),l=jc(Kn,r),u=pr(r),f=Ie(),p=o&&l.value.includes(o)||!1,d=a.disabled||t.disabled;return i.jsx(Oc,{scope:r,open:p,disabled:d,triggerId:f,children:i.jsx(vc,{"data-orientation":a.orientation,"data-state":hr(p),...u,...s,ref:n,disabled:d,open:p,onOpenChange:h=>{h?l.onItemOpen(o):l.onItemClose(o)}})})},"AccordionItem")),Dc="AccordionHeader",kc=c.forwardRef(ye(function(t,n){const{__scopeAccordion:r,...o}=t,s=dn(De,r),a=mr(Dc,r);return i.jsx(H.h3,{"data-orientation":s.orientation,"data-state":hr(a.open),"data-disabled":a.disabled?"":void 0,...o,ref:n})},"AccordionHeader")),mo="AccordionTrigger",Mc=c.forwardRef(ye(function(t,n){const{__scopeAccordion:r,...o}=t,s=dn(De,r),a=mr(mo,r),l=Nc(mo,r),u=pr(r);return i.jsx(fr.ItemSlot,{scope:r,children:i.jsx(gc,{"aria-disabled":a.open&&!l.collapsible||void 0,"data-orientation":s.orientation,id:a.triggerId,...u,...o,ref:n})})},"AccordionTrigger")),$c="AccordionContent",Fc=c.forwardRef(ye(function(t,n){const{__scopeAccordion:r,...o}=t,s=dn(De,r),a=mr($c,r),l=pr(r);return i.jsx(xc,{role:"region","aria-labelledby":a.triggerId,"data-orientation":s.orientation,...l,...o,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})},"AccordionContent"));function hr(e){return e?"open":"closed"}ye(hr,"getState");var Lc=Pc,Bc=_c,zc=kc,ls=Mc,us=Fc;const ds=Lc,vr=c.forwardRef(({className:e,...t},n)=>i.jsx(Bc,{className:Q("border-b border-border",e),...t,ref:n}));vr.displayName="AccordionItem";const gr=c.forwardRef(({className:e,children:t,...n},r)=>i.jsx(zc,{className:"flex",children:i.jsxs(ls,{className:Q("flex flex-1 items-center justify-between gap-2 py-3 text-left text-sm font-semibold transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,ref:r,children:[t,i.jsx($o,{className:"size-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));gr.displayName=ls.displayName;const xr=c.forwardRef(({className:e,children:t,...n},r)=>i.jsx(us,{forceMount:!0,className:"grid overflow-hidden text-sm transition-[grid-template-rows] duration-300 ease-out data-[state=closed]:grid-rows-[0fr] data-[state=open]:grid-rows-[1fr]",...n,ref:r,children:i.jsx("div",{className:"min-h-0 overflow-hidden",children:i.jsx("div",{className:Q("pb-4 pt-0",e),children:t})})}));xr.displayName=us.displayName;var Vc=Object.defineProperty,Hc=(e,t)=>Vc(e,"name",{value:t,configurable:!0});function Gn(e,[t,n]){return Math.min(n,Math.max(t,e))}Hc(Gn,"clamp");var Uc=Object.defineProperty,Wc=(e,t)=>Uc(e,"name",{value:t,configurable:!0});function Ee(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>((...n)=>t.current?.(...n)),[])}Wc(Ee,"useCallbackRef");var Kc=Object.defineProperty,se=(e,t)=>Kc(e,"name",{value:t,configurable:!0}),Yn="dismissableLayer.update",Gc="dismissableLayer.pointerDownOutside",Yc="dismissableLayer.focusOutside",ho,fs=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ps=c.forwardRef(se(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l,onInteractOutside:u,onDismiss:f,...p}=t,d=c.useContext(fs),[h,x]=c.useState(null),g=h?.ownerDocument??globalThis?.document,[,v]=c.useState({}),m=ne(n,x),C=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=b?C.indexOf(b):-1,w=h?C.indexOf(h):-1,R=d.layersWithOutsidePointerEventsDisabled.size>0,S=w>=y,P=c.useRef(!1),I=hs(T=>{a?.(T),u?.(T),T.defaultPrevented||f?.()},{ownerDocument:g,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:P,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:c.useCallback(T=>{if(!(T instanceof Node))return!1;const D=[...d.branches].some($=>$.contains(T));return S&&!D},[d.branches,S])}),N=vs(T=>{if(o&&P.current)return;const D=T.target;[...d.branches].some(K=>K.contains(D))||(l?.(T),u?.(T),T.defaultPrevented||f?.())},g),A=h?w===C.length-1:!1,_=Ee(T=>{T.key==="Escape"&&(s?.(T),!T.defaultPrevented&&f&&(T.preventDefault(),f()))});return c.useEffect(()=>{if(A)return g.addEventListener("keydown",_,{capture:!0}),()=>g.removeEventListener("keydown",_,{capture:!0})},[g,A,_]),c.useEffect(()=>{if(h)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ho=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),qn(),()=>{r&&(d.layersWithOutsidePointerEventsDisabled.delete(h),d.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=ho))}},[h,g,r,d]),c.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),qn())},[h,d]),c.useEffect(()=>{const T=se(()=>v({}),"handleUpdate");return document.addEventListener(Yn,T),()=>document.removeEventListener(Yn,T)},[]),i.jsx(H.div,{...p,ref:m,style:{pointerEvents:R?S?"auto":"none":void 0,...t.style},onFocusCapture:z(t.onFocusCapture,N.onFocusCapture),onBlurCapture:z(t.onBlurCapture,N.onBlurCapture),onPointerDownCapture:z(t.onPointerDownCapture,I.onPointerDownCapture)})},"DismissableLayer"));function ms(){const e=c.useContext(fs),[t,n]=c.useState(null);return c.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}se(ms,"useDismissableLayerSurface");var qc=se(()=>!0,"IS_TRUE");function hs(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:a=qc}=t,l=Ee(e),u=c.useRef(!1),f=c.useRef(!1),p=c.useRef(new Map),d=c.useRef(()=>{});return c.useEffect(()=>{function h(){f.current=!1,o.current=!1,p.current.clear()}se(h,"resetOutsideInteraction");function x(){return Array.from(p.current.values()).some(Boolean)}se(x,"isOutsideInteractionIntercepted");function g(y){if(!f.current)return;const w=y.target;w instanceof Node&&[...s].some(S=>S.contains(w))||p.current.set(y.type,!0),y.type==="click"&&window.setTimeout(()=>{f.current&&d.current()},0)}se(g,"handleInteractionCapture");function v(y){f.current&&p.current.set(y.type,!1)}se(v,"handleInteractionBubble");const m=se(y=>{if(y.target&&!u.current){let w=function(){n.removeEventListener("click",d.current);const S=x();h(),S||br(Gc,l,R,{discrete:!0})};if(se(w,"handleAndDispatchPointerDownOutsideEvent"),!a(y.target)){n.removeEventListener("click",d.current),h(),u.current=!1;return}const R={originalEvent:y};f.current=!0,o.current=r&&y.button===0,p.current.clear(),!r||y.button!==0?w():(n.removeEventListener("click",d.current),d.current=w,n.addEventListener("click",d.current,{once:!0}))}else n.removeEventListener("click",d.current),h();u.current=!1},"handlePointerDown"),C=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const y of C)n.addEventListener(y,g,!0),n.addEventListener(y,v);const b=window.setTimeout(()=>{n.addEventListener("pointerdown",m)},0);return()=>{window.clearTimeout(b),n.removeEventListener("pointerdown",m),n.removeEventListener("click",d.current);for(const y of C)n.removeEventListener(y,g,!0),n.removeEventListener(y,v)}},[n,l,r,o,s,a]),{onPointerDownCapture:se(()=>u.current=!0,"onPointerDownCapture")}}se(hs,"usePointerDownOutside");function vs(e,t=globalThis?.document){const n=Ee(e),r=c.useRef(!1);return c.useEffect(()=>{const o=se(s=>{s.target&&!r.current&&br(Yc,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:se(()=>r.current=!0,"onFocusCapture"),onBlurCapture:se(()=>r.current=!1,"onBlurCapture")}}se(vs,"useFocusOutside");function qn(){const e=new CustomEvent(Yn);document.dispatchEvent(e)}se(qn,"dispatchUpdate");function br(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Bo(o,s):o.dispatchEvent(s)}se(br,"handleAndDispatchCustomEvent");var Xc=Object.defineProperty,yr=(e,t)=>Xc(e,"name",{value:t,configurable:!0}),Ht=0,ct=null;function Zc(e){return fn(),e.children}yr(Zc,"FocusGuards");function fn(){c.useEffect(()=>{ct||(ct={start:Xn(),end:Xn()});const{start:e,end:t}=ct;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Ht++,()=>{Ht===1&&(ct?.start.remove(),ct?.end.remove(),ct=null),Ht=Math.max(0,Ht-1)}},[])}yr(fn,"useFocusGuards");function Xn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}yr(Xn,"createFocusGuard");var Jc=Object.defineProperty,pe=(e,t)=>Jc(e,"name",{value:t,configurable:!0}),Tn="focusScope.autoFocusOnMount",On="focusScope.autoFocusOnUnmount",vo={bubbles:!1,cancelable:!0},gs=c.forwardRef(pe(function(t,n){const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=t,[u,f]=c.useState(null),p=Ee(s),d=Ee(a),h=c.useRef(null),x=ne(n,f),g=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(o){let m=function(w){if(g.paused||!u)return;const R=w.target;u.contains(R)?h.current=R:Le(h.current,{select:!0})},C=function(w){if(g.paused||!u)return;const R=w.relatedTarget;R!==null&&(u.contains(R)||Le(h.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&Le(u)};pe(m,"handleFocusIn"),pe(C,"handleFocusOut"),pe(b,"handleMutations"),document.addEventListener("focusin",m),document.addEventListener("focusout",C);const y=new MutationObserver(b);return u&&y.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",C),y.disconnect()}}},[o,u,g.paused]),c.useEffect(()=>{if(u){go.add(g);const m=document.activeElement;if(!u.contains(m)){const b=new CustomEvent(Tn,vo);u.addEventListener(Tn,p),u.dispatchEvent(b),b.defaultPrevented||(xs(Ss(wr(u)),{select:!0}),document.activeElement===m&&Le(u))}return()=>{u.removeEventListener(Tn,p),setTimeout(()=>{const b=new CustomEvent(On,vo);u.addEventListener(On,d),u.dispatchEvent(b),b.defaultPrevented||Le(m??document.body,{select:!0}),u.removeEventListener(On,d),go.remove(g)},0)}}},[u,p,d,g]);const v=c.useCallback(m=>{if(!r&&!o||g.paused)return;const C=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(C&&b){const y=m.currentTarget,[w,R]=bs(y);w&&R?!m.shiftKey&&b===R?(m.preventDefault(),r&&Le(w,{select:!0})):m.shiftKey&&b===w&&(m.preventDefault(),r&&Le(R,{select:!0})):b===y&&m.preventDefault()}},[r,o,g.paused]);return i.jsx(H.div,{tabIndex:-1,...l,ref:x,onKeyDown:v})},"FocusScope"));function xs(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Le(r,{select:t}),document.activeElement!==n)return}pe(xs,"focusFirst");function bs(e){const t=wr(e),n=Zn(t,e),r=Zn(t.reverse(),e);return[n,r]}pe(bs,"getTabbableEdges");function wr(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:pe(r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}pe(wr,"getTabbableCandidates");function Zn(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):ys(r,{upTo:t})))return r}pe(Zn,"findVisible");function ys(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}pe(ys,"isHidden");function ws(e){return e instanceof HTMLInputElement&&"select"in e}pe(ws,"isSelectableInput");function Le(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ws(e)&&t&&e.select()}}pe(Le,"focus");var go=Cs();function Cs(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Jn(e,t),e.unshift(t)},remove(t){e=Jn(e,t),e[0]?.resume()}}}pe(Cs,"createFocusScopesStack");function Jn(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}pe(Jn,"arrayRemove");function Ss(e){return e.filter(t=>t.tagName!=="A")}pe(Ss,"removeLinks");const Qc=["top","right","bottom","left"],Ye=Math.min,Be=Math.max,rn=Math.round,Ut=Math.floor,ze=e=>({x:e,y:e}),el={left:"right",right:"left",bottom:"top",top:"bottom"};function Rs(e,t,n){return Be(e,Ye(t,n))}function He(e,t){return typeof e=="function"?e(t):e}function qe(e){return e.split("-")[0]}function bt(e){return e.split("-")[1]}function Cr(e){return e==="x"?"y":"x"}function Sr(e){return e==="y"?"height":"width"}function Ne(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Rr(e){return Cr(Ne(e))}function tl(e,t,n){n===void 0&&(n=!1);const r=bt(e),o=Rr(e),s=Sr(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=on(a)),[a,on(a)]}function nl(e){const t=on(e);return[Qn(e),t,Qn(t)]}function Qn(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const xo=["left","right"],bo=["right","left"],rl=["top","bottom"],ol=["bottom","top"];function sl(e,t,n){switch(e){case"top":case"bottom":return n?t?bo:xo:t?xo:bo;case"left":case"right":return t?rl:ol;default:return[]}}function il(e,t,n,r){const o=bt(e);let s=sl(qe(e),n==="start",r);return o&&(s=s.map(a=>a+"-"+o),t&&(s=s.concat(s.map(Qn)))),s}function on(e){const t=qe(e);return el[t]+e.slice(t.length)}function al(e){var t,n,r,o;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(o=e.left)!=null?o:0}}function Es(e){return typeof e!="number"?al(e):{top:e,right:e,bottom:e,left:e}}function sn(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function yo(e,t,n){let{reference:r,floating:o}=e;const s=Ne(t),a=Rr(t),l=Sr(a),u=qe(t),f=s==="y",p=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[l]/2-o[l]/2;let x;switch(u){case"top":x={x:p,y:r.y-o.height};break;case"bottom":x={x:p,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:d};break;case"left":x={x:r.x-o.width,y:d};break;default:x={x:r.x,y:r.y}}const g=bt(t);return g&&(x[a]+=h*(g==="end"?1:-1)*(n&&f?-1:1)),x}async function cl(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:a,elements:l,strategy:u}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:d="floating",altBoundary:h=!1,padding:x=0}=He(t,e),g=Es(x),m=l[h?d==="floating"?"reference":"floating":d],C=sn(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:f,rootBoundary:p,strategy:u})),b=d==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),w=await(s.isElement==null?void 0:s.isElement(y))&&await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1},R=sn(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:y,strategy:u}):b);return{top:(C.top-R.top+g.top)/w.y,bottom:(R.bottom-C.bottom+g.bottom)/w.y,left:(C.left-R.left+g.left)/w.x,right:(R.right-C.right+g.right)/w.x}}const ll=50,ul=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:a}=n,l=a.detectOverflow?a:{...a,detectOverflow:cl},u=await(a.isRTL==null?void 0:a.isRTL(t));let f=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:d}=yo(f,r,u),h=r,x=0;const g={};for(let v=0;v<s.length;v++){const m=s[v];if(!m)continue;const{name:C,fn:b}=m,{x:y,y:w,data:R,reset:S}=await b({x:p,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:g,rects:f,platform:l,elements:{reference:e,floating:t}});p=y??p,d=w??d,g[C]={...g[C],...R},S&&x<ll&&(x++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(f=S.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:p,y:d}=yo(f,h,u)),v=-1)}return{x:p,y:d,placement:h,strategy:o,middlewareData:g}},dl=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:a,elements:l,middlewareData:u}=t,{element:f,padding:p=0}=He(e,t)||{};if(f==null)return{};const d=Es(p),h={x:n,y:r},x=Rr(o),g=Sr(x),v=await a.getDimensions(f),m=x==="y",C=m?"top":"left",b=m?"bottom":"right",y=m?"clientHeight":"clientWidth",w=s.reference[g]+s.reference[x]-h[x]-s.floating[g],R=h[x]-s.reference[x],S=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let P=S?S[y]:0;(!P||!await(a.isElement==null?void 0:a.isElement(S)))&&(P=l.floating[y]||s.floating[g]);const I=w/2-R/2,N=P/2-v[g]/2-1,A=Ye(d[C],N),_=Ye(d[b],N),T=P-v[g]-_,D=P/2-v[g]/2+I,$=Rs(A,D,T),K=!u.arrow&&bt(o)!=null&&D!==$&&s.reference[g]/2-(D<A?A:_)-v[g]/2<0,L=K?D<A?D-A:D-T:0;return{[x]:h[x]+L,data:{[x]:$,centerOffset:D-$-L,...K&&{alignmentOffset:L}},reset:K}}}),fl=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:a,initialPlacement:l,platform:u,elements:f}=t,{mainAxis:p=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...m}=He(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const C=qe(o),b=Ne(l),y=qe(l)===l,w=await(u.isRTL==null?void 0:u.isRTL(f.floating)),R=h||(y||!v?[on(l)]:nl(l)),S=g!=="none";!h&&S&&R.push(...il(l,v,g,w));const P=[l,...R],I=await u.detectOverflow(t,m),N=[];let A=((r=s.flip)==null?void 0:r.overflows)||[];if(p&&N.push(I[C]),d){const $=tl(o,a,w);N.push(I[$[0]],I[$[1]])}if(A=[...A,{placement:o,overflows:N}],!N.every($=>$<=0)){var _,T;const $=(((_=s.flip)==null?void 0:_.index)||0)+1,K=P[$];if(K&&(!(d==="alignment"?b!==Ne(K):!1)||A.every(F=>Ne(F.placement)===b?F.overflows[0]>0:!0)))return{data:{index:$,overflows:A},reset:{placement:K}};let L=(T=A.filter(k=>k.overflows[0]<=0).sort((k,F)=>k.overflows[1]-F.overflows[1])[0])==null?void 0:T.placement;if(!L)switch(x){case"bestFit":{var D;const k=(D=A.filter(F=>{if(S){const U=Ne(F.placement);return U===b||U==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(U=>U>0).reduce((U,V)=>U+V,0)]).sort((F,U)=>F[1]-U[1])[0])==null?void 0:D[0];k&&(L=k);break}case"initialPlacement":L=l;break}if(o!==L)return{reset:{placement:L}}}return{}}}};function wo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Co(e){return Qc.some(t=>e[t]>=0)}const pl=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=He(e,t);switch(o){case"referenceHidden":{const a=await r.detectOverflow(t,{...s,elementContext:"reference"}),l=wo(a,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Co(l)}}}case"escaped":{const a=await r.detectOverflow(t,{...s,altBoundary:!0}),l=wo(a,n.floating);return{data:{escapedOffsets:l,escaped:Co(l)}}}default:return{}}}}},Ps=new Set(["left","top"]);async function ml(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=qe(n),l=bt(n),u=Ne(n)==="y",f=Ps.has(a)?-1:1,p=s&&u?-1:1,d=He(t,e);let{mainAxis:h,crossAxis:x,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof g=="number"&&(x=l==="end"?g*-1:g),u?{x:x*p,y:h*f}:{x:h*f,y:x*p}}const hl=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:a,middlewareData:l}=t,u=await ml(t,e);return a===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:a}}}}},vl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:a=!0,crossAxis:l=!1,limiter:u={fn:b=>{let{x:y,y:w}=b;return{x:y,y:w}}},...f}=He(e,t),p={x:n,y:r},d=await s.detectOverflow(t,f),h=Ne(o),x=Cr(h);let g=p[x],v=p[h];const m=(b,y)=>Rs(y+d[b==="y"?"top":"left"],y,y-d[b==="y"?"bottom":"right"]);a&&(g=m(x,g)),l&&(v=m(h,v));const C=u.fn({...t,[x]:g,[h]:v});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[x]:a,[h]:l}}}}}},gl=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:o,y:s,placement:a,rects:l,middlewareData:u}=t,{offset:f=0,mainAxis:p=!0,crossAxis:d=!0}=He(e,t),h={x:o,y:s},x=Ne(a),g=Cr(x);let v=h[g],m=h[x];const C=He(f,t),b=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:(n=C.mainAxis)!=null?n:0,crossAxis:(r=C.crossAxis)!=null?r:0};if(p){const R=g==="y"?"height":"width",S=l.reference[g]-l.floating[R]+b.mainAxis,P=l.reference[g]+l.reference[R]-b.mainAxis;v<S?v=S:v>P&&(v=P)}if(d){var y,w;const R=g==="y"?"width":"height",S=Ps.has(qe(a)),P=l.reference[x]-l.floating[R]+(S&&((y=u.offset)==null?void 0:y[x])||0)+(S?0:b.crossAxis),I=l.reference[x]+l.reference[R]+(S?0:((w=u.offset)==null?void 0:w[x])||0)-(S?b.crossAxis:0);m<P?m=P:m>I&&(m=I)}return{[g]:v,[x]:m}}}},xl=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:a=()=>{},...l}=He(e,t),u=await o.detectOverflow(t,l),f=qe(n),p=bt(n),d=Ne(n)==="y",{width:h,height:x}=r.floating;let g,v;f==="top"||f==="bottom"?(g=f,v=p===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(v=f,g=p==="end"?"top":"bottom");const m=x-u.top-u.bottom,C=h-u.left-u.right,b=Ye(x-u[g],m),y=Ye(h-u[v],C),w=t.middlewareData.shift,R=!w;let S=b,P=y;w!=null&&w.enabled.x&&(P=C),w!=null&&w.enabled.y&&(S=m),R&&!p&&(d?P=h-2*Be(u.left,u.right):S=x-2*Be(u.top,u.bottom)),await a({...t,availableWidth:P,availableHeight:S});const I=await o.getDimensions(s.floating);return h!==I.width||x!==I.height?{reset:{rects:!0}}:{}}}};function pn(){return typeof window<"u"}function yt(e){return js(e)?(e.nodeName||"").toLowerCase():"#document"}function ge(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ue(e){var t;return(t=(js(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function js(e){return pn()?e instanceof Node||e instanceof ge(e).Node:!1}function Te(e){return pn()?e instanceof Element||e instanceof ge(e).Element:!1}function Ze(e){return pn()?e instanceof HTMLElement||e instanceof ge(e).HTMLElement:!1}function So(e){return!pn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ge(e).ShadowRoot}function mn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Oe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function bl(e){return/^(table|td|th)$/.test(yt(e))}function hn(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const yl=/transform|translate|scale|rotate|perspective|filter/,wl=/paint|layout|strict|content/,Qe=e=>!!e&&e!=="none";let _n;function Er(e){const t=Te(e)?Oe(e):e;return Qe(t.transform)||Qe(t.translate)||Qe(t.scale)||Qe(t.rotate)||Qe(t.perspective)||!Pr()&&(Qe(t.backdropFilter)||Qe(t.filter))||yl.test(t.willChange||"")||wl.test(t.contain||"")}function Cl(e){let t=nt(e);for(;Ze(t)&&!jt(t);){if(Er(t))return t;if(hn(t))return null;t=nt(t)}return null}function Pr(){return _n==null&&(_n=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),_n}function jt(e){return/^(html|body|#document)$/.test(yt(e))}function Oe(e){return ge(e).getComputedStyle(e)}function vn(e){return Te(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function nt(e){if(yt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||So(e)&&e.host||Ue(e);return So(t)?t.host:t}function Ns(e){const t=nt(e);return jt(t)?(e.ownerDocument||e).body:Ze(t)&&mn(t)?t:Ns(t)}function Nt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ns(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),a=ge(o);if(s){const l=er(a);return t.concat(a,a.visualViewport||[],mn(o)?o:[],l&&n?Nt(l):[])}else return t.concat(o,Nt(o,[],n))}function er(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Is(e){const t=Oe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ze(e),s=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=rn(n)!==s||rn(r)!==a;return l&&(n=s,r=a),{width:n,height:r,$:l}}function jr(e){return Te(e)?e:e.contextElement}function mt(e){const t=jr(e);if(!Ze(t))return ze(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Is(t);let a=(s?rn(n.width):n.width)/r,l=(s?rn(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const Sl=ze(0);function As(e){const t=ge(e);return!Pr()||!t.visualViewport?Sl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Rl(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ge(e)}function rt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=jr(e);let a=ze(1);t&&(r?Te(r)&&(a=mt(r)):a=mt(e));const l=Rl(s,n,r)?As(s):ze(0);let u=(o.left+l.x)/a.x,f=(o.top+l.y)/a.y,p=o.width/a.x,d=o.height/a.y;if(s&&r){const h=ge(s),x=Te(r)?ge(r):r;let g=h,v=er(g);for(;v&&x!==g;){const m=mt(v),C=v.getBoundingClientRect(),b=Oe(v),y=C.left+(v.clientLeft+parseFloat(b.paddingLeft))*m.x,w=C.top+(v.clientTop+parseFloat(b.paddingTop))*m.y;u*=m.x,f*=m.y,p*=m.x,d*=m.y,u+=y,f+=w,g=ge(v),v=er(g)}}return sn({width:p,height:d,x:u,y:f})}function gn(e,t){const n=vn(e).scrollLeft;return t?t.left+n:rt(Ue(e)).left+n}function Ts(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-gn(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function El(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",a=Ue(r),l=t?hn(t.floating):!1;if(r===a||l&&s)return n;let u={scrollLeft:0,scrollTop:0},f=ze(1);const p=ze(0),d=Ze(r);if((d||!s)&&((yt(r)!=="body"||mn(a))&&(u=vn(r)),d)){const x=rt(r);f=mt(r),p.x=x.x+r.clientLeft,p.y=x.y+r.clientTop}const h=a&&!d&&!s?Ts(a,u):ze(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-u.scrollLeft*f.x+p.x+h.x,y:n.y*f.y-u.scrollTop*f.y+p.y+h.y}}function Pl(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function jl(e){const t=vn(e),n=e.ownerDocument.body,r=Be(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=Be(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+gn(e);const a=-t.scrollTop;return Oe(n).direction==="rtl"&&(s+=Be(e.clientWidth,n.clientWidth)-r),{width:r,height:o,x:s,y:a}}const Nl=25;function Il(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",o=ge(e),s=Ue(e),a=o.visualViewport;let l=s.clientWidth,u=s.clientHeight,f=0,p=0;if(a){const h=!Pr()||t==="fixed";r?h||(f=-a.offsetLeft,p=-a.offsetTop):(l=a.width,u=a.height,h&&(f=a.offsetLeft,p=a.offsetTop))}if(gn(s)<=0){const h=s.ownerDocument,x=h.body,g=getComputedStyle(x),v=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,m=Math.abs(s.clientWidth-x.clientWidth-v),C=getComputedStyle(s).scrollbarGutter==="stable both-edges"?m/2:m;C<=Nl&&(l-=C)}return{width:l,height:u,x:f,y:p}}function Al(e,t){const n=rt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=mt(e),a=e.clientWidth*s.x,l=e.clientHeight*s.y,u=o*s.x,f=r*s.y;return{width:a,height:l,x:u,y:f}}function Ro(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=Il(e,n,t);else if(t==="document")r=jl(Ue(e));else if(Te(t))r=Al(t,n);else{const o=As(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return sn(r)}function Tl(e,t){const n=t.get(e);if(n)return n;let r=Nt(e,[],!1).filter(l=>Te(l)&&yt(l)!=="body"),o=null;const s=Oe(e).position==="fixed";let a=s?nt(e):e;for(;Te(a)&&!jt(a);){const l=Oe(a),u=Er(a),f=o?o.position:s?"fixed":"";!u&&(f==="fixed"||f==="absolute"&&l.position==="static")?r=r.filter(d=>d!==a):o=l,a=nt(a)}return t.set(e,r),r}function Ol(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?hn(t)?[]:Tl(t,this._c):[].concat(n),r],l=Ro(t,a[0],o);let u=l.top,f=l.right,p=l.bottom,d=l.left;for(let h=1;h<a.length;h++){const x=Ro(t,a[h],o);u=Be(x.top,u),f=Ye(x.right,f),p=Ye(x.bottom,p),d=Be(x.left,d)}return{width:f-d,height:p-u,x:d,y:u}}function _l(e){const{width:t,height:n}=Is(e);return{width:t,height:n}}function Dl(e,t,n){const r=Ze(t),o=Ue(t),s=n==="fixed",a=rt(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const u=ze(0);if((r||!s)&&((yt(t)!=="body"||mn(o))&&(l=vn(t)),r)){const h=rt(t,!0,s,t);u.x=h.x+t.clientLeft,u.y=h.y+t.clientTop}!r&&o&&(u.x=gn(o));const f=o&&!r&&!s?Ts(o,l):ze(0),p=a.left+l.scrollLeft-u.x-f.x,d=a.top+l.scrollTop-u.y-f.y;return{x:p,y:d,width:a.width,height:a.height}}function Dn(e){return Oe(e).position==="static"}function Eo(e,t){if(!Ze(e)||Oe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ue(e)===n&&(n=n.ownerDocument.body),n}function Os(e,t){const n=ge(e);if(hn(e))return n;if(!Ze(e)){let o=nt(e);for(;o&&!jt(o);){if(Te(o)&&!Dn(o))return o;o=nt(o)}return n}let r=Eo(e,t);for(;r&&bl(r)&&Dn(r);)r=Eo(r,t);return r&&jt(r)&&Dn(r)&&!Er(r)?n:r||Cl(e)||n}const kl=async function(e){const t=this.getOffsetParent||Os,n=this.getDimensions,r=await n(e.floating);return{reference:Dl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ml(e){return Oe(e).direction==="rtl"}const $l={convertOffsetParentRelativeRectToViewportRelativeRect:El,getDocumentElement:Ue,getClippingRect:Ol,getOffsetParent:Os,getElementRects:kl,getClientRects:Pl,getDimensions:_l,getScale:mt,isElement:Te,isRTL:Ml};function _s(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Fl(e,t,n){let r=null,o;const s=Ue(e);function a(){var p;clearTimeout(o),(p=r)==null||p.disconnect(),r=null}function l(p,d){p===void 0&&(p=!1),d===void 0&&(d=1),a();const h=e.getBoundingClientRect(),{left:x,top:g,width:v,height:m}=h;if(p||t(),!v||!m)return;const C=Ut(g),b=Ut(s.clientWidth-(x+v)),y=Ut(s.clientHeight-(g+m)),w=Ut(x),S={rootMargin:-C+"px "+-b+"px "+-y+"px "+-w+"px",threshold:Be(0,Ye(1,d))||1};let P=!0;function I(N){const A=N[0].intersectionRatio;if(!_s(h,e.getBoundingClientRect()))return l();if(A!==d){if(!P)return l();A?l(!1,A):o=setTimeout(()=>{l(!1,1e-7)},1e3)}P=!1}try{r=new IntersectionObserver(I,{...S,root:s.ownerDocument})}catch{r=new IntersectionObserver(I,S)}r.observe(e)}const u=ge(e),f=()=>l(n);return u.addEventListener("resize",f),l(!0),()=>{u.removeEventListener("resize",f),a()}}function Ll(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,f=jr(e),p=o||s?[...f?Nt(f):[],...t?Nt(t):[]]:[];p.forEach(C=>{o&&C.addEventListener("scroll",n),s&&C.addEventListener("resize",n)});const d=f&&l?Fl(f,n,s):null;let h=-1,x=null;a&&(x=new ResizeObserver(C=>{let[b]=C;b&&b.target===f&&x&&t&&(x.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=x)==null||y.observe(t)})),n()}),f&&!u&&x.observe(f),t&&x.observe(t));let g,v=u?rt(e):null;u&&m();function m(){const C=rt(e);v&&!_s(v,C)&&n(),v=C,g=requestAnimationFrame(m)}return n(),()=>{var C;p.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),d?.(),(C=x)==null||C.disconnect(),x=null,u&&cancelAnimationFrame(g)}}const Bl=hl,zl=vl,Vl=fl,Hl=xl,Ul=pl,Po=dl,Wl=gl,Kl=(e,t,n)=>{const r=new Map,o=n??{},s={...$l,...o.platform,_c:r};return ul(e,t,{...o,platform:s})};var Gl=typeof document<"u",Yl=function(){},Zt=Gl?c.useLayoutEffect:Yl;function an(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!an(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!an(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ds(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jo(e,t){const n=Ds(e);return Math.round(t*n)/n}function kn(e){const t=c.useRef(e);return Zt(()=>{t.current=e}),t}function ql(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:a}={},transform:l=!0,whileElementsMounted:u,open:f}=e,[p,d]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,x]=c.useState(r);an(h,r)||x(r);const[g,v]=c.useState(null),[m,C]=c.useState(null),b=c.useCallback(F=>{F!==S.current&&(S.current=F,v(F))},[]),y=c.useCallback(F=>{F!==P.current&&(P.current=F,C(F))},[]),w=s||g,R=a||m,S=c.useRef(null),P=c.useRef(null),I=c.useRef(p),N=u!=null,A=kn(u),_=kn(o),T=kn(f),D=c.useCallback(()=>{if(!S.current||!P.current)return;const F={placement:t,strategy:n,middleware:h};_.current&&(F.platform=_.current),Kl(S.current,P.current,F).then(U=>{const V={...U,isPositioned:T.current!==!1};$.current&&!an(I.current,V)&&(I.current=V,Tt.flushSync(()=>{d(V)}))})},[h,t,n,_,T]);Zt(()=>{f===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,d(F=>({...F,isPositioned:!1})))},[f]);const $=c.useRef(!1);Zt(()=>($.current=!0,()=>{$.current=!1}),[]),Zt(()=>{if(w&&(S.current=w),R&&(P.current=R),w&&R){if(A.current)return A.current(w,R,D);D()}},[w,R,D,A,N]);const K=c.useMemo(()=>({reference:S,floating:P,setReference:b,setFloating:y}),[b,y]),L=c.useMemo(()=>({reference:w,floating:R}),[w,R]),k=c.useMemo(()=>{const F={position:n,left:0,top:0};if(!L.floating)return F;const U=jo(L.floating,p.x),V=jo(L.floating,p.y);return l?{...F,transform:"translate("+U+"px, "+V+"px)",...Ds(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:V}},[n,l,L.floating,p.x,p.y]);return c.useMemo(()=>({...p,update:D,refs:K,elements:L,floatingStyles:k}),[p,D,K,L,k])}const Xl=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Po({element:r.current,padding:o}).fn(n):{}:r?Po({element:r,padding:o}).fn(n):{}}}},Zl=(e,t)=>{const n=Bl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jl=(e,t)=>{const n=zl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ql=(e,t)=>({fn:Wl(e).fn,options:[e,t]}),eu=(e,t)=>{const n=Vl(e);return{name:n.name,fn:n.fn,options:[e,t]}},tu=(e,t)=>{const n=Hl(e);return{name:n.name,fn:n.fn,options:[e,t]}},nu=(e,t)=>{const n=Ul(e);return{name:n.name,fn:n.fn,options:[e,t]}},ru=(e,t)=>{const n=Xl(e);return{name:n.name,fn:n.fn,options:[e,t]}};var ou=Object.defineProperty,su=(e,t)=>ou(e,"name",{value:t,configurable:!0});function Nr(e){const[t,n]=c.useState(void 0);return oe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let a,l;if("borderBoxSize"in s){const u=s.borderBoxSize,f=Array.isArray(u)?u[0]:u;a=f.inlineSize,l=f.blockSize}else a=e.offsetWidth,l=e.offsetHeight;n({width:a,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}su(Nr,"useSize");var iu=Object.defineProperty,Ge=(e,t)=>iu(e,"name",{value:t,configurable:!0}),ks="Popper",[Ms,$s]=Pe(ks),[au,Fs]=Ms(ks),cu=Ge(e=>{const{__scopePopper:t,children:n}=e,[r,o]=c.useState(null),[s,a]=c.useState(void 0);return i.jsx(au,{scope:t,anchor:r,onAnchorChange:o,placementState:s,setPlacementState:a,children:n})},"Popper"),lu="PopperAnchor",uu=c.forwardRef(Ge(function(t,n){const{__scopePopper:r,virtualRef:o,...s}=t,a=Fs(lu,r),l=c.useRef(null),u=a.onAnchorChange,f=c.useCallback(v=>{l.current=v,v&&u(v)},[u]),p=ne(n,f),d=c.useRef(null);c.useEffect(()=>{if(!o)return;const v=d.current;d.current=o.current,v!==d.current&&u(d.current)});const h=a.placementState&&xn(a.placementState),x=h?.[0],g=h?.[1];return o?null:i.jsx(H.div,{"data-radix-popper-side":x,"data-radix-popper-align":g,...s,ref:p})},"PopperAnchor")),Ls="PopperContent",[du,Zf]=Ms(Ls),fu=c.forwardRef(Ge(function(t,n){const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:p=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:x=!1,updatePositionStrategy:g="optimized",onPlaced:v,...m}=t,C=Fs(Ls,r),[b,y]=c.useState(null),w=ne(n,y),[R,S]=c.useState(null),P=Nr(R),I=P?.width??0,N=P?.height??0,A=o+(a!=="center"?"-"+a:""),_=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},T=Array.isArray(p)?p:[p],D=T.length>0,$={padding:_,boundary:T.filter(Bs),altBoundary:D},{refs:K,floatingStyles:L,placement:k,isPositioned:F,middlewareData:U}=ql({strategy:"fixed",placement:A,whileElementsMounted:Ge((...q)=>Ll(...q,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:C.anchor},middleware:[Zl({mainAxis:s+N,alignmentAxis:l}),f&&Jl({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Ql():void 0,...$}),f&&eu({...$}),tu({...$,apply:Ge(({elements:q,rects:ee,availableWidth:W,availableHeight:X})=>{const{width:te,height:xe}=ee.reference,le=q.floating.style;le.setProperty("--radix-popper-available-width",`${W}px`),le.setProperty("--radix-popper-available-height",`${X}px`),le.setProperty("--radix-popper-anchor-width",`${te}px`),le.setProperty("--radix-popper-anchor-height",`${xe}px`)},"apply")}),R&&ru({element:R,padding:u}),pu({arrowWidth:I,arrowHeight:N}),x&&nu({strategy:"referenceHidden",...$,boundary:D?$.boundary:void 0})]}),V=C.setPlacementState;oe(()=>(V(k),()=>{V(void 0)}),[k,V]);const[we,G]=xn(k),ae=Ee(v);oe(()=>{F&&ae?.()},[F,ae]);const me=U.arrow?.x,he=U.arrow?.y,We=U.arrow?.centerOffset!==0,[ve,M]=c.useState();return oe(()=>{b&&M(window.getComputedStyle(b).zIndex)},[b]),i.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:F?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:i.jsx(du,{scope:r,placedSide:we,placedAlign:G,onArrowChange:S,arrowX:me,arrowY:he,shouldHideArrow:We,children:i.jsx(H.div,{"data-side":we,"data-align":G,...m,ref:w,style:{...m.style,animation:F?m.style?.animation:"none"}})})})},"PopperContent"));function Bs(e){return e!==null}Ge(Bs,"isNotNull");var pu=Ge(e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,l=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[f,p]=xn(n),d={start:"0%",center:"50%",end:"100%"}[p],h=(o.arrow?.x??0)+l/2,x=(o.arrow?.y??0)+u/2;let g="",v="";return f==="bottom"?(g=a?d:`${h}px`,v=`${-u}px`):f==="top"?(g=a?d:`${h}px`,v=`${r.floating.height+u}px`):f==="right"?(g=`${-u}px`,v=a?d:`${x}px`):f==="left"&&(g=`${r.floating.width+u}px`,v=a?d:`${x}px`),{data:{x:g,y:v}}}}),"transformOrigin");function xn(e){const[t,n="center"]=e.split("-");return[t,n]}Ge(xn,"getSideAndAlignFromPlacement");var mu=cu,hu=uu,vu=fu,gu=Object.defineProperty,xu=(e,t)=>gu(e,"name",{value:t,configurable:!0}),zs=c.forwardRef(xu(function(t,n){const{container:r,...o}=t,[s,a]=c.useState(!1);oe(()=>a(!0),[]);const l=r||s&&globalThis?.document?.body;return l?Tt.createPortal(i.jsx(H.div,{...o,ref:n}),l):null},"Portal")),bu=Object.defineProperty,yu=(e,t)=>bu(e,"name",{value:t,configurable:!0});function Vs(e){const t=c.useRef({value:e,previous:e});return c.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}yu(Vs,"usePrevious");var wu=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"}),Cu=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},lt=new WeakMap,Wt=new WeakMap,Kt={},Mn=0,Hs=function(e){return e&&(e.host||Hs(e.parentNode))},Su=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Hs(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Ru=function(e,t,n,r){var o=Su(t,Array.isArray(e)?e:[e]);Kt[n]||(Kt[n]=new WeakMap);var s=Kt[n],a=[],l=new Set,u=new Set(o),f=function(d){!d||l.has(d)||(l.add(d),f(d.parentNode))};o.forEach(f);var p=function(d){!d||u.has(d)||Array.prototype.forEach.call(d.children,function(h){if(l.has(h))p(h);else try{var x=h.getAttribute(r),g=x!==null&&x!=="false",v=(lt.get(h)||0)+1,m=(s.get(h)||0)+1;lt.set(h,v),s.set(h,m),a.push(h),v===1&&g&&Wt.set(h,!0),m===1&&h.setAttribute(n,"true"),g||h.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",h,C)}})};return p(t),l.clear(),Mn++,function(){a.forEach(function(d){var h=lt.get(d)-1,x=s.get(d)-1;lt.set(d,h),s.set(d,x),h||(Wt.has(d)||d.removeAttribute(r),Wt.delete(d)),x||d.removeAttribute(n)}),Mn--,Mn||(lt=new WeakMap,lt=new WeakMap,Wt=new WeakMap,Kt={})}},Us=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Cu(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Ru(r,o,n,"aria-hidden")):function(){return null}},je=function(){return je=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},je.apply(this,arguments)};function Ws(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Eu(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Jt="right-scroll-bar-position",Qt="width-before-scroll-bar",Pu="with-scroll-bars-hidden",ju="--removed-body-scroll-bar-size";function $n(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Nu(e,t){var n=c.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Iu=typeof window<"u"?c.useLayoutEffect:c.useEffect,No=new WeakMap;function Au(e,t){var n=Nu(null,function(r){return e.forEach(function(o){return $n(o,r)})});return Iu(function(){var r=No.get(n);if(r){var o=new Set(r),s=new Set(e),a=n.current;o.forEach(function(l){s.has(l)||$n(l,null)}),s.forEach(function(l){o.has(l)||$n(l,a)})}No.set(n,e)},[e]),n}function Tu(e){return e}function Ou(e,t){t===void 0&&(t=Tu);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var a=t(s,r);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(s),a=n}var u=function(){var p=a;a=[],p.forEach(s)},f=function(){return Promise.resolve().then(u)};f(),n={push:function(p){a.push(p),f()},filter:function(p){return a=a.filter(p),n}}}};return o}function _u(e){e===void 0&&(e={});var t=Ou(null);return t.options=je({async:!0,ssr:!1},e),t}var Ks=function(e){var t=e.sideCar,n=Ws(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return c.createElement(r,je({},n))};Ks.isSideCarExport=!0;function Du(e,t){return e.useMedium(t),Ks}var Gs=_u(),Fn=function(){},bn=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:Fn,onWheelCapture:Fn,onTouchMoveCapture:Fn}),o=r[0],s=r[1],a=e.forwardProps,l=e.children,u=e.className,f=e.removeScrollBar,p=e.enabled,d=e.shards,h=e.sideCar,x=e.noRelative,g=e.noIsolation,v=e.inert,m=e.allowPinchZoom,C=e.as,b=C===void 0?"div":C,y=e.gapMode,w=Ws(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=h,S=Au([n,t]),P=je(je({},w),o);return c.createElement(c.Fragment,null,p&&c.createElement(R,{sideCar:Gs,removeScrollBar:f,shards:d,noRelative:x,noIsolation:g,inert:v,setCallbacks:s,allowPinchZoom:!!m,lockRef:n,gapMode:y}),a?c.cloneElement(c.Children.only(l),je(je({},P),{ref:S})):c.createElement(b,je({},P,{className:u,ref:S}),l))});bn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};bn.classNames={fullWidth:Qt,zeroRight:Jt};var ku=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Mu(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ku();return t&&e.setAttribute("nonce",t),e}function $u(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Fu(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Lu=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Mu())&&($u(t,n),Fu(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Bu=function(){var e=Lu();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ys=function(){var e=Bu(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},zu={left:0,top:0,right:0,gap:0},Ln=function(e){return parseInt(e||"",10)||0},Vu=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ln(n),Ln(r),Ln(o)]},Hu=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return zu;var t=Vu(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Uu=Ys(),ht="data-scroll-locked",Wu=function(e,t,n,r){var o=e.left,s=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),`
2
+ .`.concat(Pu,` {
3
+ overflow: hidden `).concat(r,`;
4
+ padding-right: `).concat(l,"px ").concat(r,`;
5
+ }
6
+ body[`).concat(ht,`] {
7
+ overflow: hidden `).concat(r,`;
8
+ overscroll-behavior: contain;
9
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
10
+ padding-left: `.concat(o,`px;
11
+ padding-top: `).concat(s,`px;
12
+ padding-right: `).concat(a,`px;
13
+ margin-left:0;
14
+ margin-top:0;
15
+ margin-right: `).concat(l,"px ").concat(r,`;
16
+ `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
17
+ }
18
+
19
+ .`).concat(Jt,` {
20
+ right: `).concat(l,"px ").concat(r,`;
21
+ }
22
+
23
+ .`).concat(Qt,` {
24
+ margin-right: `).concat(l,"px ").concat(r,`;
25
+ }
26
+
27
+ .`).concat(Jt," .").concat(Jt,` {
28
+ right: 0 `).concat(r,`;
29
+ }
30
+
31
+ .`).concat(Qt," .").concat(Qt,` {
32
+ margin-right: 0 `).concat(r,`;
33
+ }
34
+
35
+ body[`).concat(ht,`] {
36
+ `).concat(ju,": ").concat(l,`px;
37
+ }
38
+ `)},Io=function(){var e=parseInt(document.body.getAttribute(ht)||"0",10);return isFinite(e)?e:0},Ku=function(){c.useEffect(function(){return document.body.setAttribute(ht,(Io()+1).toString()),function(){var e=Io()-1;e<=0?document.body.removeAttribute(ht):document.body.setAttribute(ht,e.toString())}},[])},Gu=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Ku();var s=c.useMemo(function(){return Hu(o)},[o]);return c.createElement(Uu,{styles:Wu(s,!t,o,n?"":"!important")})},tr=!1;if(typeof window<"u")try{var Gt=Object.defineProperty({},"passive",{get:function(){return tr=!0,!0}});window.addEventListener("test",Gt,Gt),window.removeEventListener("test",Gt,Gt)}catch{tr=!1}var ut=tr?{passive:!1}:!1,Yu=function(e){return e.tagName==="TEXTAREA"},qs=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Yu(e)&&n[t]==="visible")},qu=function(e){return qs(e,"overflowY")},Xu=function(e){return qs(e,"overflowX")},Ao=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Xs(e,r);if(o){var s=Zs(e,r),a=s[1],l=s[2];if(a>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Zu=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Ju=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Xs=function(e,t){return e==="v"?qu(t):Xu(t)},Zs=function(e,t){return e==="v"?Zu(t):Ju(t)},Qu=function(e,t){return e==="h"&&t==="rtl"?-1:1},ed=function(e,t,n,r,o){var s=Qu(e,window.getComputedStyle(t).direction),a=s*r,l=n.target,u=t.contains(l),f=!1,p=a>0,d=0,h=0;do{if(!l)break;var x=Zs(e,l),g=x[0],v=x[1],m=x[2],C=v-m-s*g;(g||C)&&Xs(e,l)&&(d+=C,h+=g);var b=l.parentNode;l=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return(p&&Math.abs(d)<1||!p&&Math.abs(h)<1)&&(f=!0),f},Yt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},To=function(e){return[e.deltaX,e.deltaY]},Oo=function(e){return e&&"current"in e?e.current:e},td=function(e,t){return e[0]===t[0]&&e[1]===t[1]},nd=function(e){return`
39
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
40
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
41
+ `)},rd=0,dt=[];function od(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(rd++)[0],s=c.useState(Ys)[0],a=c.useRef(e);c.useEffect(function(){a.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=Eu([e.lockRef.current],(e.shards||[]).map(Oo),!0).filter(Boolean);return v.forEach(function(m){return m.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=c.useCallback(function(v,m){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!a.current.allowPinchZoom;var C=Yt(v),b=n.current,y="deltaX"in v?v.deltaX:b[0]-C[0],w="deltaY"in v?v.deltaY:b[1]-C[1],R,S=v.target,P=Math.abs(y)>Math.abs(w)?"h":"v";if("touches"in v&&P==="h"&&S.type==="range")return!1;var I=window.getSelection(),N=I&&I.anchorNode,A=N?N===S||N.contains(S):!1;if(A)return!1;var _=Ao(P,S);if(!_)return!0;if(_?R=P:(R=P==="v"?"h":"v",_=Ao(P,S)),!_)return!1;if(!r.current&&"changedTouches"in v&&(y||w)&&(r.current=R),!R)return!0;var T=r.current||R;return ed(T,m,v,T==="h"?y:w)},[]),u=c.useCallback(function(v){var m=v;if(!(!dt.length||dt[dt.length-1]!==s)){var C="deltaY"in m?To(m):Yt(m),b=t.current.filter(function(R){return R.name===m.type&&(R.target===m.target||m.target===R.shadowParent)&&td(R.delta,C)})[0];if(b&&b.should){m.cancelable&&m.preventDefault();return}if(!b){var y=(a.current.shards||[]).map(Oo).filter(Boolean).filter(function(R){return R.contains(m.target)}),w=y.length>0?l(m,y[0]):!a.current.noIsolation;w&&m.cancelable&&m.preventDefault()}}},[]),f=c.useCallback(function(v,m,C,b){var y={name:v,delta:m,target:C,should:b,shadowParent:sd(C)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(w){return w!==y})},1)},[]),p=c.useCallback(function(v){n.current=Yt(v),r.current=void 0},[]),d=c.useCallback(function(v){f(v.type,To(v),v.target,l(v,e.lockRef.current))},[]),h=c.useCallback(function(v){f(v.type,Yt(v),v.target,l(v,e.lockRef.current))},[]);c.useEffect(function(){return dt.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",u,ut),document.addEventListener("touchmove",u,ut),document.addEventListener("touchstart",p,ut),function(){dt=dt.filter(function(v){return v!==s}),document.removeEventListener("wheel",u,ut),document.removeEventListener("touchmove",u,ut),document.removeEventListener("touchstart",p,ut)}},[]);var x=e.removeScrollBar,g=e.inert;return c.createElement(c.Fragment,null,g?c.createElement(s,{styles:nd(o)}):null,x?c.createElement(Gu,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function sd(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const id=Du(Gs,od);var Ir=c.forwardRef(function(e,t){return c.createElement(bn,je({},e,{ref:t,sideCar:id}))});Ir.classNames=bn.classNames;var ad=Object.defineProperty,Y=(e,t)=>ad(e,"name",{value:t,configurable:!0}),cd=[" ","Enter","ArrowUp","ArrowDown"],ld=[" ","Enter"],vt="Select",[yn,Ar,ud]=cn(vt),[st,Jf]=Pe(vt,[ud,$s]),Tr=$s(),[dd,Je]=st(vt),[fd,pd]=st(vt);function Js(e){const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:a,defaultValue:l,onValueChange:u,dir:f,name:p,autoComplete:d,disabled:h,required:x,form:g,internal_do_not_use_render:v}=e,m=Tr(t),[C,b]=c.useState(null),[y,w]=c.useState(null),[R,S]=c.useState(!1),P=Dt(f),[I,N]=Ae({prop:r,defaultProp:o??!1,onChange:s,caller:vt}),[A,_]=Ae({prop:a,defaultProp:l,onChange:u,caller:vt}),T=c.useRef(null),D=c.useRef(A);c.useEffect(()=>{const G=g?C?.ownerDocument.getElementById(g):C?.form;if(G instanceof HTMLFormElement){const ae=Y(()=>_(D.current),"reset");return G.addEventListener("reset",ae),()=>G.removeEventListener("reset",ae)}},[g,C,_]);const $=C?!!g||!!C.closest("form"):!0,[K,L]=c.useState(new Set),k=Ie(),F=Array.from(K).map(G=>G.props.value).join(";"),U=c.useCallback(G=>{L(ae=>new Set(ae).add(G))},[]),V=c.useCallback(G=>{L(ae=>{const me=new Set(ae);return me.delete(G),me})},[]),we={required:x,trigger:C,onTriggerChange:b,valueNode:y,onValueNodeChange:w,valueNodeHasChildren:R,onValueNodeHasChildrenChange:S,contentId:k,value:A,onValueChange:_,open:I,onOpenChange:N,dir:P,triggerPointerDownPosRef:T,disabled:h,name:p,autoComplete:d,form:g,nativeOptions:K,nativeSelectKey:F,isFormControl:$};return i.jsx(mu,{...m,children:i.jsx(dd,{scope:t,...we,children:i.jsx(yn.Provider,{scope:t,children:i.jsx(fd,{scope:t,onNativeOptionAdd:U,onNativeOptionRemove:V,children:oi(v)?v(we):n})})})})}Y(Js,"SelectProvider");var md=Y(e=>{const{__scopeSelect:t,children:n,...r}=e;return i.jsx(Js,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:o})=>i.jsxs(i.Fragment,{children:[n,o?i.jsx(Md,{__scopeSelect:t}):null]})})},"Select"),hd="SelectTrigger",Qs=c.forwardRef(Y(function(t,n){const{__scopeSelect:r,disabled:o=!1,...s}=t,a=Tr(r),l=Je(hd,r),u=l.disabled||o,f=ne(n,l.onTriggerChange),p=Ar(r),d=c.useRef("touch"),[h,x,g]=Or(m=>{const C=p().filter(w=>!w.disabled),b=C.find(w=>w.value===l.value),y=_r(C,m,b);y!==void 0&&l.onValueChange(y.value)}),v=Y(m=>{u||(l.onOpenChange(!0),g()),m&&(l.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})},"handleOpen");return i.jsx(hu,{asChild:!0,...a,children:i.jsx(H.button,{type:"button",role:"combobox","aria-controls":l.open?l.contentId:void 0,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":kt(l.value)?"":void 0,...s,ref:f,onClick:z(s.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&v(m)}),onPointerDown:z(s.onPointerDown,m=>{d.current=m.pointerType;const C=m.target;C.hasPointerCapture(m.pointerId)&&C.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(v(m),m.preventDefault())}),onKeyDown:z(s.onKeyDown,m=>{const C=h.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&x(m.key),!(C&&m.key===" ")&&cd.includes(m.key)&&(v(),m.preventDefault())})})})},"SelectTrigger")),vd="SelectValue",gd=c.forwardRef(Y(function(t,n){const{__scopeSelect:r,className:o,style:s,children:a,placeholder:l="",...u}=t,f=Je(vd,r),{onValueNodeHasChildrenChange:p}=f,d=a!==void 0,h=ne(n,f.onValueNodeChange);oe(()=>{p(d)},[p,d]);const x=kt(f.value);return i.jsx(H.span,{...u,asChild:x?!1:u.asChild,ref:h,style:{pointerEvents:"none"},children:i.jsx(c.Fragment,{children:x?l:a},x?"placeholder":"value")})},"SelectValue")),xd=c.forwardRef(Y(function(t,n){const{__scopeSelect:r,children:o,...s}=t;return i.jsx(H.span,{"aria-hidden":!0,...s,ref:n,children:o||"▼"})},"SelectIcon")),bd="SelectPortal",[yd,wd]=st(bd,{forceMount:void 0}),Cd=Y(e=>{const{__scopeSelect:t,forceMount:n,...r}=e;return i.jsx(yd,{scope:e.__scopeSelect,forceMount:n,children:i.jsx(zs,{asChild:!0,...r})})},"SelectPortal"),ot="SelectContent",ei=c.forwardRef(Y(function(t,n){const r=wd(ot,t.__scopeSelect),{forceMount:o=r.forceMount,...s}=t,a=Je(ot,t.__scopeSelect),[l,u]=c.useState();return oe(()=>{u(new DocumentFragment)},[]),i.jsx(xt,{present:o||a.open,children:({present:f})=>f?i.jsx(Ed,{...s,ref:n}):i.jsx(Sd,{...s,fragment:l})})},"SelectContent")),Sd=c.forwardRef(Y(function(t,n){const{__scopeSelect:r,children:o,fragment:s}=t;return s?Tt.createPortal(i.jsx(ti,{scope:r,children:i.jsx(yn.Slot,{scope:r,children:i.jsx("div",{ref:n,children:o})})}),s):null},"SelectContentFragment")),Re=10,[ti,wn]=st(ot),Rd=tt("SelectContent.RemoveScroll"),Ed=c.forwardRef(Y(function(t,n){const{__scopeSelect:r}=t,{position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:l,side:u,sideOffset:f,align:p,alignOffset:d,arrowPadding:h,collisionBoundary:x,collisionPadding:g,sticky:v,hideWhenDetached:m,avoidCollisions:C,...b}=t,y=Je(ot,r),[w,R]=c.useState(null),[S,P]=c.useState(null),I=ne(n,R),[N,A]=c.useState(null),[_,T]=c.useState(null),D=Ar(r),[$,K]=c.useState(!1),L=c.useRef(!1);c.useEffect(()=>{if(w)return Us(w)},[w]),fn();const k=c.useCallback(M=>{const[q,...ee]=D().map(te=>te.ref.current),[W]=ee.slice(-1),X=document.activeElement;for(const te of M)if(te===X||(te?.scrollIntoView({block:"nearest"}),te===q&&S&&(S.scrollTop=0),te===W&&S&&(S.scrollTop=S.scrollHeight),te?.focus(),document.activeElement!==X))return},[D,S]),F=c.useCallback(()=>k([N,w]),[k,N,w]);c.useEffect(()=>{$&&F()},[$,F]);const{onOpenChange:U,triggerPointerDownPosRef:V}=y;c.useEffect(()=>{if(w){let M={x:0,y:0};const q=Y(W=>{M={x:Math.abs(Math.round(W.pageX)-(V.current?.x??0)),y:Math.abs(Math.round(W.pageY)-(V.current?.y??0))}},"handlePointerMove"),ee=Y(W=>{M.x<=10&&M.y<=10?W.preventDefault():W.composedPath().includes(w)||U(!1),document.removeEventListener("pointermove",q),V.current=null},"handlePointerUp");return V.current!==null&&(document.addEventListener("pointermove",q),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",ee,{capture:!0})}}},[w,U,V]),c.useEffect(()=>{const M=Y(()=>U(!1),"close");return window.addEventListener("blur",M),window.addEventListener("resize",M),()=>{window.removeEventListener("blur",M),window.removeEventListener("resize",M)}},[U]);const[we,G]=Or(M=>{const q=D().filter(X=>!X.disabled),ee=q.find(X=>X.ref.current===document.activeElement),W=_r(q,M,ee);W&&setTimeout(()=>W.ref.current?.focus())}),ae=c.useCallback((M,q,ee)=>{const W=!L.current&&!ee;(y.value!==void 0&&y.value===q||W)&&(A(M),W&&(L.current=!0))},[y.value]),me=c.useCallback(()=>w?.focus(),[w]),he=c.useCallback((M,q,ee)=>{const W=!L.current&&!ee;(y.value!==void 0&&y.value===q||W)&&T(M)},[y.value]),We=o==="popper"?_o:Pd,ve=We===_o?{side:u,sideOffset:f,align:p,alignOffset:d,arrowPadding:h,collisionBoundary:x,collisionPadding:g,sticky:v,hideWhenDetached:m,avoidCollisions:C}:{};return i.jsx(ti,{scope:r,content:w,viewport:S,onViewportChange:P,itemRefCallback:ae,selectedItem:N,onItemLeave:me,itemTextRefCallback:he,focusSelectedItem:F,selectedItemText:_,position:o,isPositioned:$,searchRef:we,children:i.jsx(Ir,{as:Rd,allowPinchZoom:!0,children:i.jsx(gs,{asChild:!0,trapped:y.open,onMountAutoFocus:M=>{M.preventDefault()},onUnmountAutoFocus:z(s,M=>{y.trigger?.focus({preventScroll:!0}),M.preventDefault()}),children:i.jsx(ps,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:M=>M.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:i.jsx(We,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:M=>M.preventDefault(),...b,...ve,onPlaced:()=>K(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:z(b.onKeyDown,M=>{const q=M.ctrlKey||M.altKey||M.metaKey;if(M.key==="Tab"&&M.preventDefault(),!q&&M.key.length===1&&G(M.key),["ArrowUp","ArrowDown","Home","End"].includes(M.key)){let W=D().filter(X=>!X.disabled).map(X=>X.ref.current);if(["ArrowUp","End"].includes(M.key)&&(W=W.slice().reverse()),["ArrowUp","ArrowDown"].includes(M.key)){const X=M.target,te=W.indexOf(X);W=W.slice(te+1)}setTimeout(()=>k(W)),M.preventDefault()}})})})})})})},"SelectContentImpl")),Pd=c.forwardRef(Y(function(t,n){const{__scopeSelect:r,onPlaced:o,...s}=t,a=Je(ot,r),l=wn(ot,r),[u,f]=c.useState(null),[p,d]=c.useState(null),h=ne(n,d),x=Ar(r),g=c.useRef(!1),v=c.useRef(!0),{viewport:m,selectedItem:C,selectedItemText:b,focusSelectedItem:y}=l,w=c.useCallback(()=>{if(a.trigger&&a.valueNode&&u&&p&&m&&C&&b){const I=a.trigger.getBoundingClientRect(),N=p.getBoundingClientRect(),A=a.valueNode.getBoundingClientRect(),_=b.getBoundingClientRect();if(a.dir!=="rtl"){const X=_.left-N.left,te=A.left-X,xe=I.left-te,le=I.width+xe,Me=Math.max(le,N.width),Ke=window.innerWidth-Re,at=Gn(te,[Re,Math.max(Re,Ke-Me)]);u.style.minWidth=le+"px",u.style.left=at+"px"}else{const X=N.right-_.right,te=window.innerWidth-A.right-X,xe=window.innerWidth-I.right-te,le=I.width+xe,Me=Math.max(le,N.width),Ke=window.innerWidth-Re,at=Gn(te,[Re,Math.max(Re,Ke-Me)]);u.style.minWidth=le+"px",u.style.right=at+"px"}const T=x(),D=window.innerHeight-Re*2,$=m.scrollHeight,K=window.getComputedStyle(p),L=parseInt(K.borderTopWidth,10),k=parseInt(K.paddingTop,10),F=parseInt(K.borderBottomWidth,10),U=parseInt(K.paddingBottom,10),V=L+k+$+U+F,we=Math.min(C.offsetHeight*5,V),G=window.getComputedStyle(m),ae=parseInt(G.paddingTop,10),me=parseInt(G.paddingBottom,10),he=I.top+I.height/2-Re,We=D-he,ve=C.offsetHeight/2,M=C.offsetTop+ve,q=L+k+M,ee=V-q;if(q<=he){const X=T.length>0&&C===T[T.length-1].ref.current;u.style.bottom="0px";const te=p.clientHeight-m.offsetTop-m.offsetHeight,xe=Math.max(We,ve+(X?me:0)+te+F),le=q+xe;u.style.height=le+"px"}else{const X=T.length>0&&C===T[0].ref.current;u.style.top="0px";const xe=Math.max(he,L+m.offsetTop+(X?ae:0)+ve)+ee;u.style.height=xe+"px",m.scrollTop=q-he+m.offsetTop}u.style.margin=`${Re}px 0`,u.style.minHeight=we+"px",u.style.maxHeight=D+"px",o?.(),requestAnimationFrame(()=>g.current=!0)}},[x,a.trigger,a.valueNode,u,p,m,C,b,a.dir,o]);oe(()=>w(),[w]);const[R,S]=c.useState();oe(()=>{p&&S(window.getComputedStyle(p).zIndex)},[p]);const P=c.useCallback(I=>{I&&v.current===!0&&(w(),y?.(),v.current=!1)},[w,y]);return i.jsx(jd,{scope:r,contentWrapper:u,shouldExpandOnScrollRef:g,onScrollButtonChange:P,children:i.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:i.jsx(H.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})},"SelectItemAlignedPosition")),_o=c.forwardRef(Y(function(t,n){const{__scopeSelect:r,align:o="start",collisionPadding:s=Re,...a}=t,l=Tr(r);return i.jsx(vu,{...l,...a,ref:n,align:o,collisionPadding:s,style:{boxSizing:"border-box",...a.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)"}})},"SelectPopperPosition")),[jd,Nd]=st(ot,{}),Do="SelectViewport",Id=c.forwardRef(Y(function(t,n){const{__scopeSelect:r,nonce:o,...s}=t,a=wn(Do,r),l=Nd(Do,r),u=ne(n,a.onViewportChange),f=c.useRef(0);return i.jsxs(i.Fragment,{children:[i.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:o}),i.jsx(yn.Slot,{scope:r,children:i.jsx(H.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:z(s.onScroll,p=>{const d=p.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:x}=l;if(x?.current&&h){const g=Math.abs(f.current-d.scrollTop);if(g>0){const v=window.innerHeight-Re*2,m=parseFloat(h.style.minHeight),C=parseFloat(h.style.height),b=Math.max(m,C);if(b<v){const y=b+g,w=Math.min(v,y),R=y-w;h.style.height=w+"px",h.style.bottom==="0px"&&(d.scrollTop=R>0?R:0,h.style.justifyContent="flex-end")}}}f.current=d.scrollTop})})})]})},"SelectViewport")),Ad="SelectGroup",[Qf,ep]=st(Ad),nr="SelectItem",[Td,ni]=st(nr),ri=c.forwardRef(Y(function(t,n){const{__scopeSelect:r,value:o,disabled:s=!1,textValue:a,...l}=t,u=Je(nr,r),f=wn(nr,r),p=u.value===o,[d,h]=c.useState(a??""),[x,g]=c.useState(!1),v=Ee(w=>f.itemRefCallback?.(w,o,s)),m=ne(n,v),C=Ie(),b=c.useRef("touch"),y=Y(()=>{s||(u.onValueChange(o),u.onOpenChange(!1))},"handleSelect");return i.jsx(Td,{scope:r,value:o,disabled:s,textId:C,isSelected:p,onItemTextChange:c.useCallback(w=>{h(R=>R||(w?.textContent??"").trim())},[]),children:i.jsx(yn.ItemSlot,{scope:r,value:o,disabled:s,textValue:d,children:i.jsx(H.div,{role:"option","aria-labelledby":C,"data-highlighted":x?"":void 0,"aria-selected":p&&x,"data-state":p?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:m,onFocus:z(l.onFocus,()=>g(!0)),onBlur:z(l.onBlur,()=>g(!1)),onClick:z(l.onClick,()=>{b.current!=="mouse"&&y()}),onPointerUp:z(l.onPointerUp,()=>{b.current==="mouse"&&y()}),onPointerDown:z(l.onPointerDown,w=>{b.current=w.pointerType}),onPointerMove:z(l.onPointerMove,w=>{b.current=w.pointerType,s?f.onItemLeave?.():b.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:z(l.onPointerLeave,w=>{w.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:z(l.onKeyDown,w=>{s||w.target!==w.currentTarget||f.searchRef?.current!==""&&w.key===" "||(ld.includes(w.key)&&y(),w.key===" "&&w.preventDefault())})})})})},"SelectItem")),qt="SelectItemText",Od=c.forwardRef(Y(function(t,n){const{__scopeSelect:r,className:o,style:s,...a}=t,l=Je(qt,r),u=wn(qt,r),f=ni(qt,r),p=pd(qt,r),[d,h]=c.useState(null),x=Ee(y=>u.itemTextRefCallback?.(y,f.value,f.disabled)),g=ne(n,h,f.onItemTextChange,x),v=d?.textContent,m=c.useMemo(()=>i.jsx("option",{value:f.value,disabled:f.disabled,children:v},f.value),[f.disabled,f.value,v]),{onNativeOptionAdd:C,onNativeOptionRemove:b}=p;return oe(()=>(C(m),()=>b(m)),[C,b,m]),i.jsxs(i.Fragment,{children:[i.jsx(H.span,{id:f.textId,...a,ref:g}),f.isSelected&&l.valueNode&&!l.valueNodeHasChildren&&!kt(l.value)?Tt.createPortal(a.children,l.valueNode):null]})},"SelectItemText")),_d="SelectItemIndicator",Dd=c.forwardRef(Y(function(t,n){const{__scopeSelect:r,...o}=t;return ni(_d,r).isSelected?i.jsx(H.span,{"aria-hidden":!0,...o,ref:n}):null},"SelectItemIndicator")),kd="SelectBubbleInput",Md=c.forwardRef(Y(function({__scopeSelect:t,...n},r){const o=Je(kd,t),{value:s,onValueChange:a,required:l,disabled:u,name:f,autoComplete:p,form:d}=o,{nativeOptions:h,nativeSelectKey:x}=o,g=c.useRef(null),v=ne(r,g),m=s??"",C=Vs(m),b=Array.from(h).some(y=>(y.props.value??"")==="");return c.useEffect(()=>{const y=g.current;if(!y)return;const w=window.HTMLSelectElement.prototype,S=Object.getOwnPropertyDescriptor(w,"value").set;if(C!==m&&S){const P=new Event("change",{bubbles:!0});S.call(y,m),y.dispatchEvent(P)}},[C,m]),i.jsxs(H.select,{"aria-hidden":!0,required:l,tabIndex:-1,name:f,autoComplete:p,disabled:u,form:d,onChange:y=>a(y.target.value),...n,style:{...wu,...n.style},ref:v,defaultValue:m,children:[kt(s)&&!b?i.jsx("option",{value:""}):null,Array.from(h)]},x)},"SelectBubbleInput"));function oi(e){return typeof e=="function"}Y(oi,"isFunction");function kt(e){return e===""||e===void 0}Y(kt,"shouldShowPlaceholder");function Or(e){const t=Ee(e),n=c.useRef(""),r=c.useRef(0),o=c.useCallback(a=>{const l=n.current+a;t(l),Y((function u(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}),"updateSearch")(l)},[t]),s=c.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}Y(Or,"useTypeaheadSearch");function _r(e,t,n){const o=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=si(e,Math.max(s,0));o.length===1&&(a=a.filter(f=>f!==n));const u=a.find(f=>f.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}Y(_r,"findNextItem");function si(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Y(si,"wrapArray");const $d=md,Fd=gd,ii=c.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(Qs,{ref:r,className:Q("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-popover px-3 py-2 text-sm shadow-sm focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,i.jsx(xd,{asChild:!0,children:i.jsx($o,{className:"h-4 w-4 opacity-50"})})]}));ii.displayName=Qs.displayName;const ai=c.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>i.jsx(Cd,{children:i.jsx(ei,{ref:o,className:Q("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1",e),position:n,...r,children:i.jsx(Id,{className:Q("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));ai.displayName=ei.displayName;const en=c.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(ri,{ref:r,className:Q("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[i.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(Dd,{children:i.jsx(ba,{className:"h-4 w-4"})})}),i.jsx(Od,{children:t})]}));en.displayName=ri.displayName;var Ld=Object.defineProperty,Xe=(e,t)=>Ld(e,"name",{value:t,configurable:!0}),Dr="Switch",[Bd,tp]=Pe(Dr),[zd,kr]=Bd(Dr);function ci(e){const{__scopeSwitch:t,checked:n,children:r,defaultChecked:o,disabled:s,form:a,name:l,onCheckedChange:u,required:f,value:p="on",internal_do_not_use_render:d}=e,[h,x]=Ae({prop:n,defaultProp:o??!1,onChange:u,caller:Dr}),[g,v]=c.useState(null),[m,C]=c.useState(null),b=c.useRef(!1),[y,w]=c.useReducer(P=>P+1,0),R=g?!!a||!!g.closest("form"):!0,S={checked:h,setChecked:x,disabled:s,control:g,setControl:v,name:l,form:a,value:p,hasConsumerStoppedPropagationRef:b,userInteractionCount:y,onUserInteraction:w,required:f,defaultChecked:o,isFormControl:R,bubbleInput:m,setBubbleInput:C};return i.jsx(zd,{scope:t,...S,children:ui(d)?d(S):r})}Xe(ci,"SwitchProvider");var Vd="SwitchTrigger",Hd=c.forwardRef(Xe(function({__scopeSwitch:t,onClick:n,...r},o){const{control:s,form:a,value:l,disabled:u,checked:f,required:p,setControl:d,setChecked:h,hasConsumerStoppedPropagationRef:x,onUserInteraction:g,isFormControl:v,bubbleInput:m}=kr(Vd,t),C=ne(o,d),b=c.useRef(f);return c.useEffect(()=>{const y=a?s?.ownerDocument.getElementById(a):s?.form;if(y instanceof HTMLFormElement){const w=Xe(()=>h(b.current),"reset");return y.addEventListener("reset",w),()=>y.removeEventListener("reset",w)}},[s,a,h]),i.jsx(H.button,{type:"button",role:"switch","aria-checked":f,"aria-required":p,"data-state":Mr(f),"data-disabled":u?"":void 0,disabled:u,value:l,...r,ref:C,onClick:z(n,y=>{g(),h(w=>!w),m&&v&&(x.current=y.isPropagationStopped(),x.current||y.stopPropagation())})})},"SwitchTrigger")),li=c.forwardRef(Xe(function(t,n){const{__scopeSwitch:r,name:o,checked:s,defaultChecked:a,required:l,disabled:u,value:f,onCheckedChange:p,form:d,...h}=t;return i.jsx(ci,{__scopeSwitch:r,checked:s,defaultChecked:a,disabled:u,required:l,onCheckedChange:p,name:o,form:d,value:f,internal_do_not_use_render:({isFormControl:x})=>i.jsxs(i.Fragment,{children:[i.jsx(Hd,{...h,ref:n,__scopeSwitch:r}),x&&i.jsx(Gd,{__scopeSwitch:r})]})})},"Switch")),Ud="SwitchThumb",Wd=c.forwardRef(Xe(function(t,n){const{__scopeSwitch:r,...o}=t,s=kr(Ud,r);return i.jsx(H.span,{"data-state":Mr(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:n})},"SwitchThumb")),Kd="SwitchBubbleInput",Gd=c.forwardRef(Xe(function({__scopeSwitch:t,onClick:n,...r},o){const{control:s,hasConsumerStoppedPropagationRef:a,userInteractionCount:l,checked:u,defaultChecked:f,required:p,disabled:d,name:h,value:x,form:g,bubbleInput:v,setBubbleInput:m}=kr(Kd,t),C=ne(o,m),b=Nr(s),y=c.useRef(!1),w=c.useRef(u),R=c.useRef(l);c.useEffect(()=>{const P=v;if(!P)return;const I=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(I,"checked").set,_=l!==R.current;R.current=l;const T=w.current!==u;w.current=u;const D=!(_&&a.current);if(T&&A){y.current=!_;const $=new Event("click",{bubbles:D});A.call(P,u),P.dispatchEvent($),y.current=!1}},[v,u,a,l]);const S=c.useRef(u);return i.jsx(H.input,{type:"checkbox","aria-hidden":!0,defaultChecked:f??S.current,required:p,disabled:d,name:h,value:x,form:g,...r,tabIndex:-1,ref:C,onClick:z(n,P=>{y.current&&P.stopPropagation()}),style:{...r.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function ui(e){return typeof e=="function"}Xe(ui,"isFunction");function Mr(e){return e?"checked":"unchecked"}Xe(Mr,"getState");const tn=c.forwardRef(({className:e,...t},n)=>i.jsx(li,{className:Q("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:i.jsx(Wd,{className:Q("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));tn.displayName=li.displayName;function Yd({frozen:e,values:t,defaults:n,candidates:r,candidatesPort:o,selectedIconRef:s,uploadedIconUrl:a,iconAnalysis:l,iconComposition:u,iconComposeError:f,iconBackground:p,iconScale:d,onIconBackgroundChange:h,onIconScaleChange:x,selectedTrayRef:g,uploadedTrayUrl:v,selectedPort:m,targetDirExists:C,onPickIconCandidate:b,onUploadIcon:y,onClearIcon:w,onPickTray:R,onUploadTray:S,onClearTray:P,onPatch:I,onConfirm:N}){return i.jsxs("section",{className:"rounded-xl border border-border bg-card p-4",children:[i.jsx(Ua,{values:t,defaults:n,frozen:e,iconCandidates:r,iconCandidatesPort:o,uploadedIconUrl:a,selectedIconRef:s,iconAnalysis:l,iconComposition:u,iconComposeError:f,iconBackground:p,iconScale:d,onIconBackgroundChange:h,onIconScaleChange:x,onPickIconCandidate:b,onUploadIcon:y,onClearIcon:w,onPatch:I}),i.jsx(ds,{type:"multiple",className:"mt-4 border-t border-border pt-1",children:i.jsxs(vr,{value:"advanced",className:"border-b-0",children:[i.jsx(gr,{children:"高级选项"}),i.jsxs(xr,{className:"space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[i.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border p-3",children:[i.jsx(tn,{id:"showStartupTerminal",checked:t.showStartupTerminal,disabled:e,onCheckedChange:A=>I({showStartupTerminal:A})}),i.jsxs("div",{children:[i.jsx(fe,{htmlFor:"showStartupTerminal",className:"text-foreground",children:"显示启动终端"}),i.jsxs("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:[i.jsx(nn,{className:"mr-0.5 inline size-3"}),"应用启动时打开独立终端窗口,实时显示命令的 PTY 输出(可交互)。"]})]})]}),i.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border p-3",children:[i.jsx(tn,{id:"showAddressBar",checked:t.showAddressBar,disabled:e,onCheckedChange:A=>I({showAddressBar:A})}),i.jsxs("div",{children:[i.jsx(fe,{htmlFor:"showAddressBar",className:"text-foreground",children:"显示地址栏"}),i.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:"服务窗口顶部显示地址栏(Web Navigation API 管理导航)。"})]})]})]}),i.jsxs("div",{children:[i.jsx(fe,{children:"托盘图标"}),i.jsx("p",{className:"mb-1.5 mt-0.5 text-[11px] text-muted-foreground",children:"默认与应用图标一致;纯色候选适合系统托盘(macOS 模板风格)。"}),i.jsx(Wa,{candidates:r,port:o,disabled:e,selectedRef:g,uploadedUrl:v,includeVariants:!0,defaultLabel:"默认跟随应用图标",onPick:R,onUpload:S,onClear:P})]}),i.jsxs("div",{children:[i.jsx(fe,{htmlFor:"pm",children:"包管理器"}),i.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] leading-relaxed text-muted-foreground",children:"仅为生成的应用安装依赖时使用的工具(决定 install 命令与锁文件形态),不影响应用本身的运行方式——生成的应用始终以 Node 启动。默认自动跟随你启动向导所用的包管理器,一般无需修改。"}),i.jsxs($d,{value:t.pm,disabled:e,onValueChange:A=>I({pm:A}),children:[i.jsx(ii,{id:"pm",className:"mt-0",children:i.jsx(Fd,{})}),i.jsxs(ai,{children:[i.jsx(en,{value:"npm",children:"npm"}),i.jsx(en,{value:"pnpm",children:"pnpm"}),i.jsx(en,{value:"bun",children:"bun"})]})]})]}),i.jsxs("div",{className:"rounded-lg border border-border p-3",children:[i.jsx(fe,{children:"生成位置"}),i.jsx("p",{className:"mt-1 font-mono text-[11px] break-all text-muted-foreground",children:n.targetDir||"~/.opentray/create/<应用名>"}),i.jsx("p",{className:"mt-1.5 text-[11px] leading-relaxed text-muted-foreground",children:"生成的项目默认落在 OpenTray 主目录下,同一命令重复创建会落到同一位置; 也可在启动向导时通过位置参数指定其他目录。"}),C?i.jsx("p",{className:"mt-2 text-[11px] font-medium text-amber-400",children:"目标目录已存在且非空——继续生成会失败,或开启下方强制覆盖。"}):null,i.jsxs("div",{className:"mt-3 flex items-start gap-3",children:[i.jsx(tn,{id:"force-overwrite",checked:t.force,disabled:e,onCheckedChange:A=>I({force:A})}),i.jsxs("div",{children:[i.jsx(fe,{htmlFor:"force-overwrite",className:"text-foreground",children:"强制覆盖已存在的目录"}),i.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:"开启后将清空目标目录内的现有内容并重新生成(等同 --force)。请确认目录中没有你需要的文件。"})]})]})]})]})]})}),i.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[i.jsx(de,{onClick:N,disabled:e,children:"确定创建应用"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:m!==void 0?`已选服务 :${m}(点击状态栏服务可切换)`:"未运行也不影响:应用启动时会自行嗅探命令的监听端口"})]})]})}function qd({tags:e,onTagsChange:t,disabled:n=!1,placeholder:r,className:o,...s}){const[a,l]=c.useState(""),u=()=>{a.length!==0&&(t([...e,a]),l(""))};return i.jsxs("div",{className:Q("flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-md border border-input bg-transparent px-2 py-1.5 font-mono text-xs shadow-xs focus-within:border-ring",n&&"opacity-50",o),children:[e.map((f,p)=>i.jsxs("span",{className:"flex items-center gap-1 rounded bg-accent px-1.5 py-0.5 text-accent-foreground",children:[i.jsx("span",{className:"max-w-56 truncate",title:f,children:f}),n?null:i.jsx("button",{type:"button","aria-label":`移除参数 ${p+1}`,className:"text-muted-foreground hover:text-foreground",onClick:()=>{t(e.filter((d,h)=>h!==p))},children:i.jsx(Lo,{className:"size-3"})})]},`${p}:${f}`)),i.jsx("input",{className:"min-w-24 flex-1 bg-transparent font-mono text-xs outline-none placeholder:text-muted-foreground",value:a,disabled:n,placeholder:r??(e.length===0?"程序(如 npx)":"参数,回车添加"),onChange:f=>l(f.target.value),onKeyDown:f=>{if(f.key==="Enter"){f.preventDefault(),u();return}f.key==="Backspace"&&a.length===0&&e.length>0&&(f.preventDefault(),t(e.slice(0,-1)))},onBlur:u,...s})]})}function Xd({command:e,onCommandChange:t,argv:n,onArgvChange:r,runAlive:o,frozen:s,failedReason:a,commandOptions:l,defaultCwd:u,onCommandOptionsChange:f,onRun:p,onStop:d}){const h=x=>{f({...l,...x})};return i.jsxs("section",{className:"rounded-xl border border-border bg-card p-4",children:[i.jsxs("div",{className:"flex gap-2",children:[l.argsMode==="array"?i.jsx(qd,{tags:n,onTagsChange:r,disabled:o,"aria-label":"命令参数(argv)"}):i.jsx(et,{className:"font-mono",placeholder:"npx somecommand start --xx",value:e,disabled:o,onChange:x=>t(x.target.value),onKeyDown:x=>{x.key==="Enter"&&!o&&p()}}),o?i.jsxs(de,{variant:"destructive",onClick:d,"aria-label":"中断命令",children:[i.jsx(Aa,{}),"中断"]}):i.jsxs(de,{disabled:s,onClick:p,"aria-label":"运行命令",children:[i.jsx(Pa,{}),"运行"]})]}),a!==void 0?i.jsx("p",{className:"mt-2 font-mono text-xs text-red-400",children:a}):null,i.jsx(ds,{type:"multiple",defaultValue:["command"],className:"mt-3 border-t border-border pt-1",children:i.jsxs(vr,{value:"command",className:"border-b-0",children:[i.jsx(gr,{children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Na,{className:"size-4 text-muted-foreground"}),"命令选项"]})}),i.jsxs(xr,{className:"space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[i.jsxs("div",{children:[i.jsx(fe,{children:"参数输入模式"}),i.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"数组模式逐个输入参数(回车添加),原样传递、绝不拆分。"}),i.jsxs("div",{className:"flex gap-1.5",children:[i.jsx(de,{type:"button",size:"sm",variant:l.argsMode==="string"?"default":"outline",disabled:s,onClick:()=>h({argsMode:"string"}),children:"字符串"}),i.jsx(de,{type:"button",size:"sm",variant:l.argsMode==="array"?"default":"outline",disabled:s,onClick:()=>h({argsMode:"array"}),children:"数组 (argv)"})]})]}),i.jsxs("div",{children:[i.jsx(fe,{htmlFor:"cmd-cwd",children:"工作目录 (cwd)"}),i.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"留空使用用户主目录(下方完整路径);相对路径按主目录解析。"}),i.jsx(et,{id:"cmd-cwd",className:"mt-0 font-mono text-xs",disabled:s,value:l.cwd,placeholder:u.length>0?`默认:${u}`:"默认:用户主目录",title:u,onChange:x=>h({cwd:x.target.value})}),u.length>0&&l.cwd.trim().length===0?i.jsx("p",{className:"mt-1 font-mono text-[11px] break-all text-muted-foreground",children:u}):null]})]}),i.jsxs("div",{children:[i.jsx(fe,{children:"环境变量 (env)"}),i.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"启动命令时叠加在当前环境之上;同时写入生成的应用。"}),i.jsxs("div",{className:"space-y-1.5",children:[l.env.length===0?i.jsx("p",{className:"text-xs text-muted-foreground",children:"未配置"}):l.env.map((x,g)=>i.jsxs("div",{className:"flex gap-1.5",children:[i.jsx(et,{className:"font-mono text-xs",disabled:s,"aria-label":`env 名称 ${g+1}`,value:x.key,placeholder:"NAME",onChange:v=>{const m=[...l.env];m[g]={...x,key:v.target.value},h({env:m})}}),i.jsx(et,{className:"font-mono text-xs",disabled:s,"aria-label":`env 值 ${g+1}`,value:x.value,placeholder:"value",onChange:v=>{const m=[...l.env];m[g]={...x,value:v.target.value},h({env:m})}}),i.jsx(de,{type:"button",variant:"ghost",size:"iconSm",disabled:s,"aria-label":"删除环境变量",onClick:()=>{h({env:l.env.filter((v,m)=>m!==g)})},children:"×"})]},g)),i.jsxs(de,{type:"button",variant:"outline",size:"sm",disabled:s,onClick:()=>h({env:[...l.env,{key:"",value:""}]}),children:[i.jsx(nn,{className:"size-3.5"}),"添加变量"]})]})]})]})]})})]})}var Zd=Object.defineProperty,Se=(e,t)=>Zd(e,"name",{value:t,configurable:!0}),$r="Dialog",[di,np]=Pe($r),[Jd,ke]=di($r),Qd=Se(e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,l=c.useRef(null),u=c.useRef(null),[f,p]=Ae({prop:r,defaultProp:o??!1,onChange:s,caller:$r}),[d,h]=c.useState(0),[x,g]=c.useState(0);return i.jsx(Jd,{scope:t,triggerRef:l,contentRef:u,contentId:Ie(),titleId:Ie(),descriptionId:Ie(),titlePresent:d>0,descriptionPresent:x>0,setTitleCount:h,setDescriptionCount:g,open:f,onOpenChange:p,onOpenToggle:c.useCallback(()=>p(v=>!v),[p]),modal:a,children:n})},"Dialog"),fi="DialogPortal",[ef,pi]=di(fi,{forceMount:void 0}),tf=Se(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=ke(fi,t);return i.jsx(ef,{scope:t,forceMount:n,children:c.Children.map(r,a=>i.jsx(xt,{present:n||s.open,children:i.jsx(zs,{asChild:!0,container:o,children:a})}))})},"DialogPortal"),rr="DialogOverlay",mi=c.forwardRef(Se(function(t,n){const r=pi(rr,t.__scopeDialog),{forceMount:o=r.forceMount,...s}=t,a=ke(rr,t.__scopeDialog);return a.modal?i.jsx(xt,{present:o||a.open,children:i.jsx(rf,{...s,ref:n})}):null},"DialogOverlay")),nf=tt("DialogOverlay.RemoveScroll"),rf=c.forwardRef(Se(function(t,n){const{__scopeDialog:r,...o}=t,s=ke(rr,r),a=ms(),l=ne(n,a);return i.jsx(Ir,{as:nf,allowPinchZoom:!0,shards:[s.contentRef],children:i.jsx(H.div,{"data-state":Fr(s.open),...o,ref:l,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),It="DialogContent",hi=c.forwardRef(Se(function(t,n){const r=pi(It,t.__scopeDialog),{forceMount:o=r.forceMount,...s}=t,a=ke(It,t.__scopeDialog);return i.jsx(xt,{present:o||a.open,children:a.modal?i.jsx(of,{...s,ref:n}):i.jsx(sf,{...s,ref:n})})},"DialogContent")),of=c.forwardRef(Se(function(t,n){const r=ke(It,t.__scopeDialog),o=c.useRef(null),s=ne(n,r.contentRef,o);return c.useEffect(()=>{const a=o.current;if(a)return Us(a)},[]),i.jsx(vi,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:z(t.onCloseAutoFocus,a=>{a.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:z(t.onPointerDownOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&a.preventDefault()}),onFocusOutside:z(t.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),sf=c.forwardRef(Se(function(t,n){const r=ke(It,t.__scopeDialog),o=c.useRef(!1),s=c.useRef(!1);return i.jsx(vi,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(o.current||r.triggerRef.current?.focus(),a.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=a.target;r.triggerRef.current?.contains(l)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})},"DialogContentNonModal")),vi=c.forwardRef(Se(function(t,n){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,...l}=t,u=ke(It,r);return fn(),i.jsx(i.Fragment,{children:i.jsx(gs,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:a,children:i.jsx(ps,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":Fr(u.open),...l,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl")),af="DialogTitle",gi=c.forwardRef(Se(function(t,n){const{__scopeDialog:r,...o}=t,s=ke(af,r),{setTitleCount:a}=s;return oe(()=>(a(l=>l+1),()=>a(l=>l-1)),[a]),i.jsx(H.h2,{id:s.titleId,...o,ref:n})},"DialogTitle")),cf="DialogDescription",xi=c.forwardRef(Se(function(t,n){const{__scopeDialog:r,...o}=t,s=ke(cf,r),{setDescriptionCount:a}=s;return oe(()=>(a(l=>l+1),()=>a(l=>l-1)),[a]),i.jsx(H.p,{id:s.descriptionId,...o,ref:n})},"DialogDescription")),lf="DialogClose",uf=c.forwardRef(Se(function(t,n){const{__scopeDialog:r,...o}=t,s=ke(lf,r);return i.jsx(H.button,{type:"button",...o,ref:n,onClick:z(t.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function Fr(e){return e?"open":"closed"}Se(Fr,"getState");const df=Qd,ff=tf,bi=c.forwardRef(({className:e,...t},n)=>i.jsx(mi,{ref:n,className:Q("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out",e),...t}));bi.displayName=mi.displayName;const yi=c.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(ff,{children:[i.jsx(bi,{}),i.jsxs(hi,{ref:r,className:Q("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border border-border bg-card p-6 shadow-lg rounded-xl",e),...n,children:[t,i.jsxs(uf,{className:"absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none",children:[i.jsx(Lo,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));yi.displayName=hi.displayName;const Et=({className:e,...t})=>i.jsx("div",{className:Q("flex flex-col space-y-1.5 text-left",e),...t});Et.displayName="DialogHeader";const Pt=c.forwardRef(({className:e,...t},n)=>i.jsx(gi,{ref:n,className:Q("text-lg font-semibold leading-none tracking-tight",e),...t}));Pt.displayName=gi.displayName;const wi=c.forwardRef(({className:e,...t},n)=>i.jsx(xi,{ref:n,className:Q("text-sm text-muted-foreground",e),...t}));wi.displayName=xi.displayName;const Bn=["scaffold","icon","install","launch","bundle"];function pf({open:e,phase:t,frozenValues:n,iconSrc:r,iconLabel:o,traySrc:s,trayLabel:a,selectedPort:l,currentStep:u,logs:f,error:p,result:d,onBack:h,onCreate:x,onOpenApp:g,onClose:v,confirmError:m,onOpenChange:C}){const b=c.useRef(null);c.useEffect(()=>{b.current?.scrollTo({top:b.current.scrollHeight})},[f.length]);const y=w=>{const R=Bn.indexOf(w),S=Bn.indexOf(u);return t==="success"||R<S?"done":R===S?"active":""};return i.jsx(df,{open:e,onOpenChange:w=>{t==="pending"&&w===!1||C(w)},children:i.jsx(yi,{className:"max-w-xl",children:t==="confirm"?i.jsxs(i.Fragment,{children:[i.jsxs(Et,{children:[i.jsx(Pt,{children:"确认应用信息"}),i.jsx(wi,{children:"表单已固定,以下值将用于生成应用。"})]}),i.jsxs("dl",{className:"grid grid-cols-[110px_1fr] gap-x-3 gap-y-2 text-sm",children:[i.jsx("dt",{className:"text-muted-foreground",children:"App ID"}),i.jsx("dd",{className:"font-mono break-all",children:n.appId}),i.jsx("dt",{className:"text-muted-foreground",children:"应用名称"}),i.jsx("dd",{className:"break-all",children:n.appName}),i.jsx("dt",{className:"text-muted-foreground",children:"图标"}),i.jsxs("dd",{className:"flex flex-wrap items-center gap-4",children:[i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"icon-checker flex size-10 items-center justify-center overflow-hidden rounded-md","aria-label":"应用图标预览",children:r!==void 0?i.jsx("img",{src:r,alt:"应用图标",className:"size-full object-contain"}):i.jsx("span",{className:"text-[10px] text-muted-foreground",children:"无"})}),i.jsxs("span",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs leading-tight",children:"应用图标"}),i.jsx("span",{className:"font-mono text-[10px] leading-tight text-muted-foreground",children:o})]})]}),i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"icon-checker flex size-10 items-center justify-center overflow-hidden rounded-md","aria-label":"托盘图标预览",children:s!==void 0?i.jsx("img",{src:s,alt:"托盘图标",className:"size-full object-contain"}):i.jsx("span",{className:"text-[10px] text-muted-foreground",children:"文字"})}),i.jsxs("span",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs leading-tight",children:"托盘图标"}),i.jsx("span",{className:"font-mono text-[10px] leading-tight text-muted-foreground",children:a})]})]})]}),i.jsx("dt",{className:"text-muted-foreground",children:"服务端口"}),i.jsx("dd",{className:"font-mono",children:l!==void 0?`:${l}(生成后运行时重新嗅探)`:"运行时嗅探"}),i.jsx("dt",{className:"text-muted-foreground",children:"包管理器"}),i.jsx("dd",{children:n.pm})]}),m!==void 0?i.jsx("p",{className:"text-xs font-medium text-red-400",children:m}):null,i.jsxs("div",{className:"flex justify-end gap-2",children:[i.jsx(de,{variant:"outline",onClick:h,children:"返回修改"}),i.jsx(de,{onClick:x,children:"确认生成"})]})]}):t==="pending"?i.jsxs(i.Fragment,{children:[i.jsx(Et,{children:i.jsx(Pt,{children:"正在生成应用…"})}),i.jsx("div",{className:"flex flex-wrap gap-1.5",children:Bn.map(w=>i.jsx(ar,{variant:y(w)==="done"?"success":y(w)==="active"?"warning":"secondary",children:w},w))}),i.jsx("div",{ref:b,className:"h-48 overflow-y-auto rounded-md border border-border bg-[#05070b] p-3 font-mono text-[11px] leading-5 text-[#b7c3d8] whitespace-pre-wrap",children:f.join(`
42
+ `)})]}):t==="success"&&d!==void 0?i.jsxs(i.Fragment,{children:[i.jsx(Et,{children:i.jsxs(Pt,{className:"flex items-center gap-2",children:[i.jsx(Ca,{className:"size-5 text-emerald-400"}),"应用已生成"]})}),i.jsxs("dl",{className:"grid grid-cols-[110px_1fr] gap-x-3 gap-y-2 text-sm",children:[i.jsx("dt",{className:"text-muted-foreground",children:"项目目录"}),i.jsx("dd",{className:"font-mono break-all",children:d.projectDir}),d.bundlePath?i.jsxs(i.Fragment,{children:[i.jsx("dt",{className:"text-muted-foreground",children:"macOS Bundle"}),i.jsx("dd",{className:"font-mono break-all",children:d.bundlePath})]}):null]}),i.jsxs("div",{className:"flex justify-end gap-2",children:[i.jsx(de,{variant:"outline",onClick:v,children:"完成"}),i.jsxs(de,{onClick:g,children:[i.jsx(Ra,{}),"打开应用"]})]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:d.pinHint})]}):i.jsxs(i.Fragment,{children:[i.jsx(Et,{children:i.jsxs(Pt,{className:"flex items-center gap-2",children:[i.jsx(Oa,{className:"size-5 text-red-400"}),"生成失败"]})}),i.jsx("p",{className:"break-all font-mono text-xs text-red-400",children:p??"未知错误"}),i.jsx("div",{className:"flex justify-end",children:i.jsx(de,{variant:"outline",onClick:h,children:"返回重试"})})]})})})}const ko=(e,t)=>{const n=c.useRef(e);n.current=e;const r=c.useRef(void 0),o=c.useRef(void 0),s=c.useCallback(()=>{r.current!==void 0&&(clearTimeout(r.current),r.current=void 0);const p=o.current;o.current=void 0,p!==void 0&&n.current(...p)},[]),a=c.useCallback(()=>{r.current!==void 0&&(clearTimeout(r.current),r.current=void 0),o.current=void 0},[]),l=c.useCallback((...p)=>{o.current=p,r.current!==void 0&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=void 0;const d=o.current;o.current=void 0,d!==void 0&&n.current(...d)},t)},[t]);c.useEffect(()=>s,[s]);const u=c.useRef(l);u.current=l;const f=c.useCallback((...p)=>{u.current(...p)},[]);return f.flush=s,f.cancel=a,f};var mf=Object.defineProperty,Lr=(e,t)=>mf(e,"name",{value:t,configurable:!0}),zn=!1;function Ci(){const[e,t]=c.useState(zn);return c.useEffect(()=>{zn||(zn=!0,t(!0))},[]),e}Lr(Ci,"useIsHydrated");var Si=At[" useSyncExternalStore ".trim().toString()];function Ri(){return()=>{}}Lr(Ri,"subscribe");function Ei(){return Si(Ri,()=>!0,()=>!1)}Lr(Ei,"useIsHydratedModern");var hf=typeof Si=="function"?Ei:Ci,vf=Object.defineProperty,it=(e,t)=>vf(e,"name",{value:t,configurable:!0}),Vn="rovingFocusGroup.onEntryFocus",gf={bubbles:!1,cancelable:!0},Cn="RovingFocusGroup",[or,Pi,xf]=cn(Cn),[bf,ji]=Pe(Cn,[xf]),[yf,wf]=bf(Cn),Cf=c.forwardRef(it(function(t,n){return i.jsx(or.Provider,{scope:t.__scopeRovingFocusGroup,children:i.jsx(or.Slot,{scope:t.__scopeRovingFocusGroup,children:i.jsx(Sf,{...t,ref:n})})})},"RovingFocusGroup")),Sf=c.forwardRef(it(function(t,n){const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:p,preventScrollOnEntryFocus:d=!1,...h}=t,x=c.useRef(null),g=ne(n,x),v=Dt(a),[m,C]=Ae({prop:l,defaultProp:u??null,onChange:f,caller:Cn}),[b,y]=c.useState(!1),w=Ee(p),R=Pi(r),S=c.useRef(!1),[P,I]=c.useState(0);return c.useEffect(()=>{const N=x.current;if(N)return N.addEventListener(Vn,w),()=>N.removeEventListener(Vn,w)},[w]),i.jsx(yf,{scope:r,orientation:o,dir:v,loop:s,currentTabStopId:m,onItemFocus:c.useCallback(N=>C(N),[C]),onItemShiftTab:c.useCallback(()=>y(!0),[]),onFocusableItemAdd:c.useCallback(()=>I(N=>N+1),[]),onFocusableItemRemove:c.useCallback(()=>I(N=>N-1),[]),children:i.jsx(H.div,{tabIndex:b||P===0?-1:0,"data-orientation":o,...h,ref:g,style:{outline:"none",...t.style},onMouseDown:z(t.onMouseDown,()=>{S.current=!0}),onFocus:z(t.onFocus,N=>{const A=!S.current;if(N.target===N.currentTarget&&A&&!b){const _=new CustomEvent(Vn,gf);if(N.currentTarget.dispatchEvent(_),!_.defaultPrevented){const T=R().filter(k=>k.focusable),D=T.find(k=>k.active),$=T.find(k=>k.id===m),L=[D,$,...T].filter(Boolean).map(k=>k.ref.current);Br(L,d)}}S.current=!1}),onBlur:z(t.onBlur,()=>y(!1))})})},"RovingFocusGroupImpl")),Rf="RovingFocusGroupItem",Ef=c.forwardRef(it(function(t,n){const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:a,children:l,...u}=t,f=Ie(),p=a||f,d=wf(Rf,r),h=d.currentTabStopId===p,x=Pi(r),{onFocusableItemAdd:g,onFocusableItemRemove:v,currentTabStopId:m}=d,C=hf();return oe(()=>{if(!(!C||!o))return g(),()=>v()},[C,o,g,v]),c.useEffect(()=>{if(!(C||!o))return g(),()=>v()},[C,o,g,v]),i.jsx(or.ItemSlot,{scope:r,id:p,focusable:o,active:s,children:i.jsx(H.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...u,ref:n,onMouseDown:z(t.onMouseDown,b=>{o?d.onItemFocus(p):b.preventDefault()}),onFocus:z(t.onFocus,()=>d.onItemFocus(p)),onKeyDown:z(t.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){d.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const y=Ii(b,d.orientation,d.dir);if(y!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let R=x().filter(S=>S.focusable).map(S=>S.ref.current);if(y==="last")R.reverse();else if(y==="prev"||y==="next"){y==="prev"&&R.reverse();const S=R.indexOf(b.currentTarget);R=d.loop?Ai(R,S+1):R.slice(S+1)}setTimeout(()=>Br(R))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:m!=null}):l})})},"RovingFocusGroupItem")),Pf={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ni(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}it(Ni,"getDirectionAwareKey");function Ii(e,t,n){const r=Ni(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Pf[r]}it(Ii,"getFocusIntent");function Br(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}it(Br,"focusFirst");function Ai(e,t){return e.map((n,r)=>e[(t+r)%e.length])}it(Ai,"wrapArray");var jf=Cf,Nf=Ef,If=Object.defineProperty,wt=(e,t)=>If(e,"name",{value:t,configurable:!0}),zr="Tabs",[Af,rp]=Pe(zr,[ji]),Ti=ji(),[Tf,Vr]=Af(zr),Of=c.forwardRef(wt(function(t,n){const{__scopeTabs:r,value:o,onValueChange:s,defaultValue:a,orientation:l="horizontal",dir:u,activationMode:f="automatic",...p}=t,d=Dt(u),[h,x]=Ae({prop:o,onChange:s,defaultProp:a??"",caller:zr});return i.jsx(Tf,{scope:r,baseId:Ie(),value:h,onValueChange:x,orientation:l,dir:d,activationMode:f,children:i.jsx(H.div,{dir:d,"data-orientation":l,...p,ref:n})})},"Tabs")),_f="TabsList",Df=c.forwardRef(wt(function(t,n){const{__scopeTabs:r,loop:o=!0,...s}=t,a=Vr(_f,r),l=Ti(r);return i.jsx(jf,{asChild:!0,...l,orientation:a.orientation,dir:a.dir,loop:o,children:i.jsx(H.div,{role:"tablist","aria-orientation":a.orientation,...s,ref:n})})},"TabsList")),kf="TabsTrigger",Mf=c.forwardRef(wt(function(t,n){const{__scopeTabs:r,value:o,disabled:s=!1,...a}=t,l=Vr(kf,r),u=Ti(r),f=Hr(l.baseId,o),p=Ur(l.baseId,o),d=o===l.value;return i.jsx(Nf,{asChild:!0,...u,focusable:!s,active:d,children:i.jsx(H.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":p,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:f,...a,ref:n,onMouseDown:z(t.onMouseDown,h=>{!s&&h.button===0&&h.ctrlKey===!1?l.onValueChange(o):h.preventDefault()}),onKeyDown:z(t.onKeyDown,h=>{s||h.target!==h.currentTarget||[" ","Enter"].includes(h.key)&&l.onValueChange(o)}),onFocus:z(t.onFocus,()=>{const h=l.activationMode!=="manual";!d&&!s&&h&&l.onValueChange(o)})})})},"TabsTrigger")),$f="TabsContent",Ff=c.forwardRef(wt(function(t,n){const{__scopeTabs:r,value:o,forceMount:s,children:a,...l}=t,u=Vr($f,r),f=Hr(u.baseId,o),p=Ur(u.baseId,o),d=o===u.value,h=c.useRef(d);return c.useEffect(()=>{const x=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(x)},[]),i.jsx(xt,{present:s||d,children:({present:x})=>i.jsx(H.div,{"data-state":d?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!x,id:p,tabIndex:0,...l,ref:n,style:{...t.style,animationDuration:h.current?"0s":void 0},children:x&&a})})},"TabsContent"));function Hr(e,t){return`${e}-trigger-${t}`}wt(Hr,"makeTriggerId");function Ur(e,t){return`${e}-content-${t}`}wt(Ur,"makeContentId");var Lf=Of,Oi=Df,_i=Mf,Di=Ff;const Bf=Lf,ki=c.forwardRef(({className:e,...t},n)=>i.jsx(Oi,{ref:n,className:Q("inline-flex h-9 items-center justify-start gap-1 rounded-t-lg bg-muted/50 p-1 text-muted-foreground w-full overflow-x-auto",e),...t}));ki.displayName=Oi.displayName;const sr=c.forwardRef(({className:e,...t},n)=>i.jsx(_i,{ref:n,className:Q("inline-flex items-center gap-1.5 whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));sr.displayName=_i.displayName;const ir=c.forwardRef(({className:e,...t},n)=>i.jsx(Di,{ref:n,className:Q("mt-2 ring-offset-background focus-visible:outline-none",e),...t}));ir.displayName=Di.displayName;const zf=e=>{const t=e.trim();if(t.length!==0)try{return new URL(/^https?:\/\//iu.test(t)?t:`http://${t}`).href}catch{return}};function Vf({command:e,terminalHostRef:t,terminalReady:n,interactive:r,status:o,services:s,iframeTabs:a,activeTab:l,onActiveTabChange:u,onIframeNavigate:f,onIframeHistoryMove:p,onJumpToService:d,className:h}){const x=a.find(b=>`svc-${b.port}`===l),[g,v]=c.useState("");c.useEffect(()=>{v(x?.url??"")},[x?.url,l]);const m=x!==void 0&&x.historyIndex>0,C=x!==void 0&&x.historyIndex<x.history.length-1;return i.jsxs("div",{className:Q("flex flex-col rounded-xl border border-border bg-card overflow-hidden",h),children:[i.jsxs(Bf,{value:l,onValueChange:u,className:"flex min-h-0 flex-1 flex-col",children:[i.jsxs(ki,{children:[i.jsxs(sr,{value:"terminal",children:[i.jsx(nn,{className:"size-3.5"}),"终端",!r&&n?i.jsx("span",{className:"text-[10px] text-amber-400",children:"非交互"}):null]}),a.map(b=>i.jsxs(sr,{value:`svc-${b.port}`,children:[i.jsx(co,{className:"size-3.5"}),Ha(b.url),":",new URL(b.url).port]},b.port))]}),i.jsx("div",{className:"flex h-11 items-center gap-2 border-y border-border px-3",children:x===void 0?i.jsxs(i.Fragment,{children:[i.jsx(nn,{className:"size-4 shrink-0 text-muted-foreground"}),i.jsx("span",{className:"truncate font-mono text-xs text-muted-foreground",children:e||"尚未运行命令"})]}):i.jsxs(i.Fragment,{children:[i.jsx(de,{variant:"ghost",size:"iconSm",disabled:!m,onClick:()=>p(x.port,-1),"aria-label":"后退",children:i.jsx(pa,{})}),i.jsx(de,{variant:"ghost",size:"iconSm",disabled:!C,onClick:()=>p(x.port,1),"aria-label":"前进",children:i.jsx(ma,{})}),i.jsx(de,{variant:"ghost",size:"iconSm",onClick:()=>f(x.port,x.url,"replace"),"aria-label":"重新加载",children:i.jsx(ha,{})}),i.jsx(co,{className:"size-4 shrink-0 text-muted-foreground"}),i.jsx(et,{className:"h-7 font-mono text-xs",value:g,placeholder:"输入 URL 跳转",onChange:b=>v(b.target.value),onKeyDown:b=>{if(b.key!=="Enter")return;const y=zf(g);y!==void 0&&f(x.port,y,"push")}})]})}),i.jsxs(ir,{value:"terminal",forceMount:!0,className:"mt-0 min-h-0 flex-1",style:{display:l==="terminal"?"flex":"none",flexDirection:"column"},children:[i.jsx("div",{ref:t,className:"min-h-0 min-w-0 flex-1 bg-[#05070b] px-1"}),n?null:i.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:"正在加载终端渲染器…"})]}),a.map(b=>i.jsx(ir,{value:`svc-${b.port}`,forceMount:!0,className:"mt-0 min-h-0 flex-1",style:{display:l===`svc-${b.port}`?"flex":"none",flexDirection:"column"},children:i.jsx("iframe",{title:`service-${b.port}`,src:b.url,className:"min-h-0 w-full flex-1 border-0 bg-white",sandbox:"allow-same-origin allow-scripts allow-forms"})},b.port))]}),i.jsxs("div",{className:"flex h-8 shrink-0 items-center gap-3 overflow-x-auto border-t border-border px-3 text-[11px] text-muted-foreground",children:[i.jsxs("span",{className:"font-mono whitespace-nowrap",children:["光标 ",o.cursorY,":",o.cursorX]}),i.jsxs("span",{className:"font-mono whitespace-nowrap",children:[o.cols,"×",o.rows]}),i.jsx("span",{className:"font-mono whitespace-nowrap",children:o.selection===void 0?"无选区":`选区 ${o.selection.start.y}:${o.selection.start.x} – ${o.selection.end.y}:${o.selection.end.x}`}),i.jsx("span",{className:"h-3 w-px bg-border"}),s.length===0?i.jsx("span",{children:"嗅探 HTTP 服务中…(未发现不影响创建应用)"}):s.map(b=>i.jsxs(ar,{variant:l===`svc-${b.port}`?"default":"secondary",className:"cursor-pointer font-mono whitespace-nowrap",onClick:()=>d(b.port),children:[":",b.port,b.title?` · ${b.title}`:""]},b.port))]})]})}const Mo={appId:"",appName:"",iconPath:"",iconBackground:"transparent",iconScale:.8,trayIconPath:"",force:!1,pm:"npm",showStartupTerminal:!1,showAddressBar:!1},Hf={appId:"",appName:"",targetDir:"",iconPath:""};function Uf(){const[e,t]=c.useState(""),[n,r]=c.useState([]),[o,s]=c.useState(za),[a,l]=c.useState(""),[u,f]=c.useState(!1),[p,d]=c.useState(!1),[h,x]=c.useState(!1),[g,v]=c.useState("idle"),[m,C]=c.useState(),[b,y]=c.useState(""),[w,R]=c.useState(!0),[S,P]=c.useState(!1),[I,N]=c.useState(),[A,_]=c.useState(Mo),[T,D]=c.useState(Hf),[$,K]=c.useState([]),[L,k]=c.useState(),[F,U]=c.useState(!1),[V,we]=c.useState([]),[G,ae]=c.useState(),[me,he]=c.useState(),[We,ve]=c.useState(),[M,q]=c.useState(),[ee,W]=c.useState(),[X,te]=c.useState("transparent"),[xe,le]=c.useState(.8),Me=c.useRef(void 0),Ke=c.useRef(void 0),at=c.useRef(!1),Wr=c.useRef(!1),[Mt,$t]=c.useState(),[Sn,Ct]=c.useState(),[Ft,Lt]=c.useState(),[Mi,Bt]=c.useState("terminal"),[Kr,zt]=c.useState([]),[$i,Fi]=c.useState({cursorX:0,cursorY:0,cols:0,rows:0}),[Rn,St]=c.useState(!1),[Li,Rt]=c.useState("confirm"),[Bi,En]=c.useState([]),[zi,Vi]=c.useState(""),[Hi,Ui]=c.useState(),[Wi,Ki]=c.useState(),[Gi,Yi]=c.useState(Mo),Gr=c.useRef(null),$e=c.useRef(void 0),Vt=c.useRef([]),Yr=c.useRef(A);Yr.current=A;const qr=c.useRef(g);qr.current=g;const Xr=(E,B,j)=>{if(B===void 0)return!1;const O=Number.parseInt(B.split(":")[1]??"",10);return!E.some(Z=>Z.index===O)||B.split(":")[0]!==String(j)},Pn=c.useRef(void 0);c.useEffect(()=>{const E=A.iconPath.trim().length>0?A.iconPath.trim():T.iconPath.trim().length>0?T.iconPath.trim():void 0;if(Pn.current=E,E===void 0){ve(void 0),W(void 0),Me.current=void 0;return}E===Me.current&&ee!==void 0||(async()=>{try{q(void 0);const B=await J("/api/icon-analyze",{path:E});if(!B.ok)throw new Error("analyze failed");const j=await B.json();if(Pn.current!==E)return;ve(j),at.current=!1,te(j.suggested),J("/api/form",{iconBackground:j.suggested});const O=await J("/api/icon-compose",{foregroundPath:E,background:j.suggested,scale:xe});if(!O.ok)throw new Error("compose failed");const Z=await O.json();if(Pn.current!==E)return;W(Z),Me.current=E}catch{ve(void 0),W(void 0),q("图标分析或合成失败,预览不可用")}})()},[A.iconPath,T.iconPath]);const Zr=ko(E=>{J("/api/form",{iconScale:E});const B=Qr();eo(B,X,E)},250),qi=E=>{le(E),Zr(E)},Jr=ko(E=>{J("/api/form",{iconBackground:E});const B=Qr();eo(B,E,xe)},120),Xi=E=>{at.current=!0,te(E),Jr(E)},Qr=()=>A.iconPath.trim().length>0?A.iconPath.trim():T.iconPath.trim().length>0?T.iconPath.trim():void 0,eo=c.useCallback(async(E,B,j)=>{if(E===void 0){ve(void 0),W(void 0),Me.current=void 0,Ke.current=void 0;return}Ke.current=E;try{const O=await J("/api/icon-analyze",{path:E});if(!O.ok)throw new Error("analyze failed");const Z=await O.json();if(Ke.current!==E)return;ve(Z);const ue=await J("/api/icon-compose",{foregroundPath:E,background:B,scale:j});if(!ue.ok)throw new Error("compose failed");const Fe=await ue.json();if(Ke.current!==E)return;W(Fe),Me.current=E}catch{ve(void 0),W(void 0),q("图标合成失败,预览未更新")}},[]);c.useEffect(()=>{va()},[]),c.useEffect(()=>{if(!p)return;let E=!1;return(async()=>{const B=Gr.current;if(B===null)return;const j=await ga(B);if(E||j===void 0){E||N("ghostty-web 加载失败,输出将以纯文本显示");return}$e.current=j,P(!0);const O=Vt.current;Vt.current=[];for(const ue of O)j.write(ue);j.onData(ue=>{to.current&&J("/api/terminal-input",{data:ue})}),j.onResize(({cols:ue,rows:Fe})=>{J("/api/terminal-resize",{cols:ue,rows:Fe})});const Z=window.setInterval(()=>{if(!(qr.current==="idle"&&!$e.current))try{Fi(j.readState())}catch{}},300);return()=>window.clearInterval(Z)})(),()=>{E=!0,$e.current?.dispose(),$e.current=void 0}},[p]);const to=c.useRef(!0);c.useEffect(()=>{to.current=w},[w]),c.useEffect(()=>{const E=Va();return E.onmessage=B=>{const j=JSON.parse(B.data);switch(j.type){case"state":v(j.state),j.state==="failed"&&C(j.reason),j.state==="frozen"&&(Rt("confirm"),St(!0)),j.state==="materializing"&&(Rt("pending"),En([])),j.state==="success"&&Rt("success"),j.state==="failed"&&ro.current&&(Rt("failed"),Ui(j.reason));break;case"log":{$e.current!==void 0?$e.current.write(j.chunk):no.current!==void 0?N(O=>(O??"")+j.chunk):Vt.current.push(j.chunk);break}case"term-mode":if(R(j.interactive),!j.interactive&&j.message!==void 0){const O=`\x1B[33m${j.message}\x1B[0m\r
43
+ `;$e.current!==void 0?$e.current.write(O):Vt.current.push(O)}break;case"run-status":x(j.running);break;case"command-display":y(j.command);break;case"command-options":s(j.options),l(j.defaultCwd);break;case"services":{K(j.services),k(j.selectedPort),zt(O=>{const Z=[...O];let ue;for(const Fe of j.services)Z.find(la=>la.port===Fe.port)===void 0&&(Z.push({port:Fe.port,url:Fe.url,history:[Fe.url],historyIndex:0}),ue=Fe.port);return ue!==void 0&&Bt(`svc-${ue}`),Z});break}case"icons":we(j.icons),ae(j.port),Xr(j.icons,me,j.port)&&he(void 0),Xr(j.icons,Sn,j.port)&&Ct(void 0);break;case"scrape":U(j.hasIcon);break;case"form":_(j.values),D(j.defaults),f(j.targetDirExists),Wr.current||(Wr.current=!0,te(j.values.iconBackground),le(j.values.iconScale));break;case"materialize-step":Vi(j.step),En(O=>[...O,`[${j.step}] ${j.message}`]);break;case"materialize-log":En(O=>[...O,j.message]);break;case"success":Ki({projectDir:j.projectDir,...j.bundlePath===void 0?{}:{bundlePath:j.bundlePath},pinHint:j.pinHint});break}},()=>E.close()},[]);const no=c.useRef(void 0);c.useEffect(()=>{no.current=I},[I]);const ro=c.useRef(!1);c.useEffect(()=>{ro.current=Rn},[Rn]);const jn=me===void 0?void 0:Number.parseInt(me.split(":")[1]??"",10),Zi=ee!==void 0?Vo(ee.key):Mt!==void 0?Mt:G!==void 0&&jn!==void 0&&V.some(E=>E.index===jn)?pt(G,jn):G!==void 0&&V[0]!==void 0&&me===void 0?pt(G,V[0].index):void 0,Ji=ee!==void 0?`合成 ${ee.background==="transparent"?"透明底":ee.background==="black"?"黑底":"白底"}`:Mt!==void 0?"本地图片":V[0]!==void 0?`${V[0].width}×${V[0].height} ${V[0].format.toUpperCase()}`:"首字母图标",oo=(()=>{if(Ft!==void 0)return Ft;const E=A.trayIconPath.trim();if(E.length>0&&G!==void 0){const j=V.find(O=>O.path===E);if(j!==void 0)return pt(G,j.index)}const B=/^([^:]+):(\d+)$/.exec(Sn??"");if(B!==null){const j=Number(B[1]),O=Number(B[2]);if(Number.isInteger(j)&&Number.isInteger(O))return pt(j,O)}E.length})(),Qi=Ft!==void 0?"本地图片":oo!==void 0?"跟随源图":"跟随应用图标";c.useEffect(()=>{const E=e.trim();if(E.length===0)return;const B=window.setTimeout(()=>{J("/api/prime",{command:E})},400);return()=>window.clearTimeout(B)},[e]);const ea=async()=>{const E=e.trim();if(!(o.argsMode==="string"&&E.length===0)){if(d(!0),Bt("terminal"),$e.current?.reset(),zt([]),K([]),U(!1),we([]),ae(void 0),he(void 0),$t(void 0),Ct(void 0),Lt(void 0),o.argsMode==="array"){if(n.length===0||(n[0]??"").trim().length===0)return;await J("/api/command",{argv:n});return}await J("/api/command",{command:E})}},ta=E=>{if(Kr.find(j=>j.port===E)===void 0){J("/api/select-service",{port:E});return}J("/api/select-service",{port:E}),Bt(`svc-${E}`)},na=(E,B,j)=>{zt(O=>O.map(Z=>{if(Z.port!==E)return Z;if(j==="replace")return{...Z,url:B};const ue=[...Z.history.slice(0,Z.historyIndex+1),B];return{...Z,url:B,history:ue,historyIndex:ue.length-1}}))},ra=(E,B)=>{zt(j=>j.map(O=>{if(O.port!==E)return O;const Z=O.historyIndex+B;return Z<0||Z>=O.history.length?O:{...O,historyIndex:Z,url:O.history[Z]}}))},[oa,Nn]=c.useState(),sa=async()=>{Zr.flush(),Jr.flush(),Rt("confirm"),St(!0);try{const E=await J("/api/confirm",{});if(!E.ok){const B=await E.json().catch(()=>({}));Nn(B.error??`确认失败(${E.status})`);return}Nn(void 0)}catch{Nn("确认请求失败")}};c.useEffect(()=>{g==="frozen"&&Yi({...Yr.current,...A})},[g]);const ia=async()=>{await J("/api/create",{})},aa=g==="discovered"||g==="success"?"success":g==="running"||g==="materializing"?"warning":g==="failed"?"destructive":"secondary",ca=p?"minmax(0, 520px) minmax(0, 1fr) minmax(0, 0fr)":"minmax(0, 1fr) minmax(0, var(--list-w)) minmax(0, 1fr)";return i.jsxs("div",{className:"grid h-screen w-full overflow-hidden",style:{"--list-w":"min(520px, 100vw - 40px)",gridTemplateColumns:ca,transition:"grid-template-columns 450ms cubic-bezier(0.4, 0, 0.2, 1)"},children:[i.jsxs("div",{className:"flex w-full flex-col gap-4 overflow-y-auto p-5 max-md:min-h-screen "+(p?"md:border-r md:border-border":""),style:{gridColumn:p?"1":"2",gridRow:"1",transition:"border-color 450ms",scrollbarGutter:"stable"},children:[i.jsxs("header",{className:"flex items-center gap-3",children:[i.jsx("h1",{className:"text-lg font-bold",children:"create-opentray"}),i.jsx(ar,{variant:aa,className:"ml-auto shrink-0",children:g})]}),i.jsx(Xd,{command:e,onCommandChange:t,argv:n,onArgvChange:E=>r([...E]),runAlive:h,frozen:g==="materializing"||g==="frozen"||g==="success",failedReason:g==="failed"?m:void 0,commandOptions:o,defaultCwd:a,onCommandOptionsChange:E=>{s(E),J("/api/command-options",{cwd:E.cwd,env:E.env,argsMode:E.argsMode})},onRun:()=>{ea()},onStop:()=>{J("/api/stop",{})}}),i.jsx(Yd,{frozen:g==="frozen"||g==="materializing"||g==="success",values:A,defaults:T,candidates:V,candidatesPort:G,selectedIconRef:me,uploadedIconUrl:Mt,iconAnalysis:We,iconComposition:ee,iconComposeError:M,iconBackground:X,iconScale:xe,onIconBackgroundChange:Xi,onIconScaleChange:qi,selectedTrayRef:Sn,uploadedTrayUrl:Ft,selectedPort:L,targetDirExists:u,onPickIconCandidate:E=>{G!==void 0&&(he(`${G}:${E.index}`),$t(void 0),J("/api/icon-select",{port:G,index:E.index}))},onUploadIcon:E=>{const B=URL.createObjectURL(E);$t(B),he(void 0),E.arrayBuffer().then(j=>{fetch("/api/icon-upload",{method:"POST",headers:{"content-type":E.type||"application/octet-stream",authorization:`Bearer ${new URLSearchParams(location.search).get("token")??""}`},body:j}).then(O=>O.json()).then(({path:O})=>{O===void 0||O.length===0||(_(Z=>({...Z,iconPath:O})),J("/api/form",{iconPath:O}))}).catch(()=>{})})},onClearIcon:()=>{he(void 0),$t(void 0),_(E=>({...E,iconPath:""})),J("/api/form",{iconPath:""})},onPickTray:E=>{G!==void 0&&(Ct(`${G}:${E.index}`),Lt(void 0),J("/api/tray-icon-select",{port:G,index:E.index}))},onUploadTray:E=>{const B=URL.createObjectURL(E);Lt(B),Ct(void 0),E.arrayBuffer().then(j=>{fetch("/api/icon-upload",{method:"POST",headers:{"content-type":E.type||"application/octet-stream",authorization:`Bearer ${new URLSearchParams(location.search).get("token")??""}`},body:j}).then(O=>O.json()).then(({path:O})=>{O===void 0||O.length===0||(_(Z=>({...Z,trayIconPath:O})),J("/api/form",{trayIconPath:O}))}).catch(()=>{})})},onClearTray:()=>{Ct(void 0),Lt(void 0),_(E=>({...E,trayIconPath:""})),J("/api/form",{trayIconPath:""})},onPatch:E=>{_(B=>({...B,...E})),J("/api/form",E)},onConfirm:()=>{sa()}})]}),i.jsx("div",{className:"flex min-h-0 min-w-0 flex-col gap-4 overflow-y-auto p-4 max-md:hidden",style:{scrollbarGutter:"stable",gridColumn:p?"2":"3",gridRow:"1",opacity:p?1:0,visibility:p?"visible":"hidden",transition:"opacity 450ms cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear "+(p?"0s":"450ms")},children:p?i.jsxs(i.Fragment,{children:[i.jsx(Vf,{command:b,terminalHostRef:Gr,terminalReady:S,interactive:w,status:$i,services:[...$],iframeTabs:Kr,activeTab:Mi,onActiveTabChange:Bt,onIframeNavigate:na,onIframeHistoryMove:ra,onJumpToService:ta,className:"min-h-[480px] flex-1"}),I!==void 0?i.jsx("pre",{className:"max-h-56 overflow-auto rounded-xl border border-border bg-card p-3 font-mono text-xs whitespace-pre-wrap",children:I}):null]}):null}),i.jsx(pf,{open:Rn,onOpenChange:St,phase:Li,frozenValues:Gi,iconSrc:Zi,iconLabel:Ji,traySrc:oo,trayLabel:Qi,selectedPort:L,currentStep:zi,logs:Bi,error:Hi??m,result:Wi,onBack:()=>St(!1),onCreate:()=>{ia()},onOpenApp:()=>{J("/api/open-app",{})},confirmError:oa,onClose:()=>St(!1)})]})}da.createRoot(document.getElementById("root")).render(i.jsx(fa.StrictMode,{children:i.jsx(Uf,{})}));
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ghostty-web.js","assets/index.js","assets/index.css"])))=>i.map(i=>d[i]);
2
+ import{c as v,j as h,d as g,f as w}from"./index.js";const x=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],L=v("terminal",x),E=w("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors",{variants:{variant:{default:"border-transparent bg-primary/15 text-primary",secondary:"border-transparent bg-secondary text-secondary-foreground",outline:"text-foreground",success:"border-transparent bg-emerald-500/15 text-emerald-400",warning:"border-transparent bg-amber-500/15 text-amber-400",destructive:"border-transparent bg-red-500/15 text-red-400"}},defaultVariants:{variant:"default"}});function z({className:n,variant:c,...t}){return h.jsx("div",{className:g(E({variant:c}),n),...t})}const S="modulepreload",P=function(n){return"/"+n},m={},_=function(c,t,u){let d=Promise.resolve();if(t&&t.length>0){let f=function(e){return Promise.all(e.map(r=>Promise.resolve(r).then(i=>({status:"fulfilled",value:i}),i=>({status:"rejected",reason:i}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=s?.nonce||s?.getAttribute("nonce");d=f(t.map(e=>{if(e=P(e),e in m)return;m[e]=!0;const r=e.endsWith(".css"),i=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${i}`))return;const a=document.createElement("link");if(a.rel=r?"stylesheet":S,r||(a.as="script"),a.crossOrigin="",a.href=e,o&&a.setAttribute("nonce",o),document.head.appendChild(a),r)return new Promise((y,b)=>{a.addEventListener("load",y),a.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${e}`)))})}))}function l(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return d.then(s=>{for(const o of s||[])o.status==="rejected"&&l(o.reason);return c().catch(l)})};let p;const R=()=>{p??=(async()=>{const n=await _(()=>import("./ghostty-web.js"),__vite__mapDeps([0,1,2]));return await n.init(),n})()};async function T(n){let c;try{R(),c=await p}catch{return}const t=new c.Terminal({fontSize:13,theme:{background:"#05070b",foreground:"#b7c3d8",cursor:"#3d8bff",selectionBackground:"#2a3550"}});t.open(n);const u=new c.FitAddon;t.loadAddon(u),u.fit();const d=new Set,l=new Set,s=t.onData(e=>{for(const r of d)r(e)}),o=t.onResize(({cols:e,rows:r})=>{for(const i of l)i({cols:e,rows:r})}),f=new ResizeObserver(()=>{try{u.fit()}catch{}});return f.observe(n),{write:e=>t.write(e),reset:()=>t.reset(),fit:()=>u.fit(),focus:()=>n.querySelector("canvas")?.dispatchEvent(new Event("focus")),readState:()=>{const e=t.buffer.active,r=t.getSelectionPosition();return{cols:t.cols,rows:t.rows,cursorX:e.cursorX,cursorY:e.cursorY,...r===void 0?{}:{selection:{start:{x:r.start.x,y:r.start.y},end:{x:r.end.x,y:r.end.y}}}}},onData(e){return d.add(e),()=>d.delete(e)},onResize(e){return l.add(e),()=>l.delete(e)},dispose(){f.disconnect(),s.dispose(),o.dispose(),t.dispose()}}}export{z as B,L as T,_,T as c,R as p};
@@ -0,0 +1 @@
1
+ import{r as s,j as t,R as j,a as b}from"./index.js";import{p as N,c as R,T as y,B as S}from"./terminal-pane.js";function E(){const[h,x]=s.useState(""),[v,w]=s.useState(!1),[u,f]=s.useState([]),[o,g]=s.useState({cursorX:0,cursorY:0,cols:0,rows:0}),m=s.useRef(null),c=s.useRef(void 0),i=s.useRef([]),p=s.useRef(!1);return s.useEffect(()=>{N()},[]),s.useEffect(()=>{let r=!1;return(async()=>{const a=m.current;if(a===null)return;const n=await R(a);if(r||n===void 0)return;c.current=n,n.onData(l=>{p.current&&fetch("/api/terminal-input",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({data:l})}).catch(()=>{})});const e=i.current;i.current=[];for(const l of e)n.write(l);const d=window.setInterval(()=>{try{g(n.readState())}catch{}},300);return()=>window.clearInterval(d)})(),()=>{r=!0,c.current?.dispose(),c.current=void 0}},[]),s.useEffect(()=>{const r=n=>{const e=c.current;e!==void 0?e.write(n):i.current.push(n)},a=new EventSource("/api/events");return a.onmessage=n=>{const e=JSON.parse(n.data);if(e.type==="state"){x(e.command),p.current=e.interactive,w(e.interactive),f(e.services);for(const d of e.output)r(d)}else e.type==="log"?r(e.chunk):f(e.services)},()=>a.close()},[]),t.jsxs("div",{className:"flex h-screen flex-col overflow-hidden",children:[t.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-2 border-b border-border bg-card px-3",children:[t.jsx(y,{className:"size-4 shrink-0 text-muted-foreground"}),t.jsx("span",{className:"truncate font-mono text-xs text-muted-foreground",children:h||"…"}),v?null:t.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-amber-400",children:"非交互"})]}),t.jsx("div",{ref:m,className:"min-h-0 flex-1 bg-[#05070b] px-1"}),t.jsxs("div",{className:"flex h-8 shrink-0 items-center gap-3 overflow-x-auto border-t border-border bg-card px-3 text-[11px] text-muted-foreground",children:[t.jsxs("span",{className:"font-mono whitespace-nowrap",children:["光标 ",o.cursorY,":",o.cursorX]}),t.jsxs("span",{className:"font-mono whitespace-nowrap",children:[o.cols,"×",o.rows]}),t.jsx("span",{className:"h-3 w-px bg-border"}),u.length===0?t.jsx("span",{children:"监听端口嗅探中…"}):u.map(r=>t.jsxs(S,{variant:r.detached?"destructive":"secondary",className:"font-mono whitespace-nowrap",children:[":",r.port,r.detached?" · detached":""]},r.port))]})]})}j.createRoot(document.getElementById("root")).render(t.jsx(b.StrictMode,{children:t.jsx(E,{})}));
@@ -0,0 +1,15 @@
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Browse</title>
7
+ <script type="module" crossorigin src="./assets/browse.js"></script>
8
+ <link rel="modulepreload" crossorigin href="./assets/index.js">
9
+ <link rel="modulepreload" crossorigin href="./assets/input.js">
10
+ <link rel="stylesheet" crossorigin href="./assets/index.css">
11
+ </head>
12
+ <body>
13
+ <div id="root"></div>
14
+ </body>
15
+ </html>
Binary file
@@ -0,0 +1,15 @@
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Terminal</title>
7
+ <script type="module" crossorigin src="./assets/terminal.js"></script>
8
+ <link rel="modulepreload" crossorigin href="./assets/index.js">
9
+ <link rel="modulepreload" crossorigin href="./assets/terminal-pane.js">
10
+ <link rel="stylesheet" crossorigin href="./assets/index.css">
11
+ </head>
12
+ <body>
13
+ <div id="root"></div>
14
+ </body>
15
+ </html>
@@ -0,0 +1,15 @@
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Terminal</title>
7
+ <script type="module" crossorigin src="./assets/terminal.js"></script>
8
+ <link rel="modulepreload" crossorigin href="./assets/index.js">
9
+ <link rel="modulepreload" crossorigin href="./assets/terminal-pane.js">
10
+ <link rel="stylesheet" crossorigin href="./assets/index.css">
11
+ </head>
12
+ <body>
13
+ <div id="root"></div>
14
+ </body>
15
+ </html>
@@ -0,0 +1 @@
1
+ const e={};export{e as default};
@@ -0,0 +1 @@
1
+ import{r as a,j as r,R as L,a as C}from"./index.js";import{B as m,A as N,a as U,R as z,G as B,I}from"./input.js";const A=()=>typeof window<"u"&&"navigation"in window?window.navigation:void 0,v=c=>{const s=c.trim();if(s.length!==0)try{return new URL(/^https?:\/\//iu.test(s)?s:`http://${s}`).href}catch{return}},T=c=>`${location.pathname}?url=${encodeURIComponent(c)}`,D=()=>{const c=new URLSearchParams(location.search).get("url");return v(c??"")??"about:blank"};function P(){const c=a.useRef(D()),[s,x]=a.useState(c.current),[g,b]=a.useState(c.current),o=a.useRef([c.current]),t=a.useRef(0),i=a.useRef(A()),h=a.useRef(null),[$,y]=a.useState(0),d=a.useCallback(e=>{b(e),x(e)},[]);a.useEffect(()=>{const e=i.current;if(e===void 0)return;const n=u=>{!u.canIntercept||u.hashChange||u.intercept({handler:()=>{const p=new URLSearchParams(new URL(u.destination.url).search).get("url");if(p===null)return;const w=v(p);w!==void 0&&d(w)}})},l=()=>y(u=>u+1);return e.addEventListener("navigate",n),e.addEventListener("currententrychange",l),()=>{e.removeEventListener("navigate",n),e.removeEventListener("currententrychange",l)}},[]);const R=e=>{const n=i.current;if(n!==void 0)try{n.navigate(T(e));return}catch{}o.current=[...o.current.slice(0,t.current+1),e],t.current=o.current.length-1,d(e)},j=()=>{const e=i.current;if(e!==void 0&&e.currentEntry!==null&&e.currentEntry.index>0){const n=e.entries()[e.currentEntry.index-1];if(n!==void 0)try{e.traverseTo(n.key);return}catch{}}t.current>0&&(t.current-=1,d(o.current[t.current]))},E=()=>{const e=i.current;if(e!==void 0&&e.currentEntry!==null){const l=e.entries()[e.currentEntry.index+1];if(l!==void 0)try{e.traverseTo(l.key);return}catch{}}t.current<o.current.length-1&&(t.current+=1,d(o.current[t.current]))},f=i.current?.currentEntry??null,k=f!==null?f.index>0:t.current>0,S=f!==null?f.index<(i.current?.entries().length??1)-1:t.current<o.current.length-1;return r.jsxs("div",{className:"flex h-screen flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-border bg-card px-3",children:[r.jsx(m,{variant:"ghost",size:"iconSm",disabled:!k,onClick:j,"aria-label":"后退",children:r.jsx(N,{})}),r.jsx(m,{variant:"ghost",size:"iconSm",disabled:!S,onClick:E,"aria-label":"前进",children:r.jsx(U,{})}),r.jsx(m,{variant:"ghost",size:"iconSm",onClick:()=>{h.current!==null&&(h.current.src=g)},"aria-label":"重新加载",children:r.jsx(z,{})}),r.jsx(B,{className:"size-4 shrink-0 text-muted-foreground"}),r.jsx(I,{className:"h-7 font-mono text-xs",value:s,placeholder:"输入 URL 跳转",onChange:e=>x(e.target.value),onKeyDown:e=>{if(e.key!=="Enter")return;const n=v(s);n!==void 0&&R(n)}})]}),r.jsx("iframe",{ref:h,title:"service",src:g,className:"min-h-0 flex-1 border-0 bg-white",sandbox:"allow-same-origin allow-scripts allow-forms"})]})}L.createRoot(document.getElementById("root")).render(r.jsx(C.StrictMode,{children:r.jsx(P,{})}));