create-opentray 0.22.0 → 0.23.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.
- package/dist/{bin-Dyfucd3C.mjs → bin-DDNgskyb.mjs} +195 -45
- package/dist/bin-DDNgskyb.mjs.map +1 -0
- package/dist/bin.mjs +1 -1
- package/dist/index.d.mts +23 -4
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/shell/assets/index.css +1 -1
- package/dist/shell/assets/index2.js +2 -0
- package/dist/shell/assets/main.js +19 -18
- package/dist/shell/assets/ort.bundle.min.js +2763 -0
- package/dist/shell/assets/ort.bundle.min.mjs +2817 -0
- package/dist/shell/assets/ort.webgpu.bundle.min.js +2763 -0
- package/dist/shell/assets/ort.webgpu.bundle.min.mjs +2817 -0
- package/dist/webui/assets/index.css +1 -1
- package/dist/webui/assets/index2.js +2 -0
- package/dist/webui/assets/main.js +19 -18
- package/dist/webui/assets/ort.bundle.min.js +2763 -0
- package/dist/webui/assets/ort.bundle.min.mjs +2817 -0
- package/dist/webui/assets/ort.webgpu.bundle.min.js +2763 -0
- package/dist/webui/assets/ort.webgpu.bundle.min.mjs +2817 -0
- package/package.json +6 -6
- package/dist/bin-Dyfucd3C.mjs.map +0 -1
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import{c as He,r as d,E as Nt,u as Dt,b as Fp,d as lu,f as ot,e as je,j as l,N as Er,g as ct,h as Qt,i as cu,k as fe,m as Bt,l as ki,n as Bp,o as jp,R as Mp,a as Pp}from"./index.js";import{u as It,b as ie,i as Xe,c as Pe,d as ve,g as _t,o as Be,e as vt,f as wt,h as Ei,j as de,k as Gt,l as Ce,m as Tp,n as Mt,p as Bn,q as Jn,r as Np,t as at,s as Lo,v as rt,w as At,x as Pn,y as Ko,z as Dn,C as $n,D as Zs,E as yn,F as Si,H as _p,J as uu,K as Op,L as Ri,M as Wo,N as du,O as sl,P as Yn,Q as Js,S as Di,B as Oe,T as fu,U as Fi,V as Cr,W as xr,X as Bi,Y as pu,Z as ji,_ as Mi,$ as Qo,a0 as Pi,a1 as on,a2 as Ti,a3 as Hp,I as qe,a4 as Ni,a5 as Lp,G as $s,a6 as il,a7 as al,A as Kp,a as Wp,R as Qp}from"./input.js";import{u as hu,B as bo,T as Sr,p as Gp,c as Yp}from"./terminal-pane.js";const zp=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],_i=He("check",zp);const Up=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Tn=He("chevron-down",Up);const Vp=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Oi=He("chevron-up",Vp);const Zp=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Jp=He("circle-check",Zp);const $p=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Xp=He("circle-question-mark",$p);const qp=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],eh=He("copy",qp);const th=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],nh=He("download",th);const rh=[["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"}]],Au=He("external-link",rh);const oh=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],sh=He("file-text",oh);const ih=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],ah=He("folder-open",ih);const lh=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],ch=He("folder",lh);const uh=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],dh=He("link-2",uh);const fh=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],ph=He("list",fh);const hh=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ah=He("loader-circle",hh);const gh=[["path",{d:"M5 12h14",key:"1ays0h"}]],mh=He("minus",gh);const xh=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],bh=He("monitor",xh);const vh=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],yh=He("moon",vh);const Ch=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],ll=He("panel-left",Ch);const Ih=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],gu=He("pencil",Ih);const wh=[["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"}]],kh=He("play",wh);const Eh=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],mu=He("plus",Eh);const Sh=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Rh=He("refresh-cw",Sh);const Dh=[["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"}]],Fh=He("settings-2",Dh);const Bh=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],jh=He("share-2",Bh);const Mh=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Ph=He("square",Mh);const Th=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Nh=He("sun",Th);const _h=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Oh=He("trash-2",_h);const Hh=[["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"}]],Lh=He("triangle-alert",Hh);const Kh=[["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"}]],xu=He("upload",Kh);const Wh=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Hi=He("x",Wh);function bu(e,t,n,r=!0,o){const[s,i]=d.useState(),a=It(o?`${o}-label`:void 0),c=e??t??s;return ie(()=>{const u=e||t||!r?void 0:Qh(n.current,a);s!==u&&i(u)}),c}function Qh(e,t){const n=Gh(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function Gh(e){if(!e)return;const t=e.parentElement;if(t&&t.tagName==="LABEL")return t;const n=e.id;if(n){const o=e.nextElementSibling;if(o&&o.htmlFor===n)return o}const r=e.labels;return r&&r[0]}function Yh(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:zh,platform:Uh,maxTouchPoints:Vh}=Yh(),Go=zh.toLowerCase(),Rr=Uh.toLowerCase(),Yo=/^i(os$|p)/.test(Rr)||Rr==="macintel"&&Vh>1,cl="android",Xs=Rr===cl||Go.includes(cl),Li=!Yo&&Rr.startsWith("mac");Rr.startsWith("win");const Zh=Li||Yo,an=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!an&&Go.includes("firefox");!an&&Go.includes("chrom");const Jh=Zh,Ki=/jsdom|happydom/.test(Go),qs="data-base-ui-focusable",vu="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",zo="ArrowLeft",Uo="ArrowRight",yu="ArrowUp",Wi="ArrowDown";function vo(e,t){if(!Pe(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(ve(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function vs(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function $h(e){return e.matches("html,body")}function Vo(e){return Xe(e)&&e.matches(vu)}function Xh(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${vu}`)!=null}function ei(e){return e?e.getAttribute("role")==="combobox"&&Vo(e):!1}function qh(e){if(!e||Ki)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function yo(e){return e?e.hasAttribute(qs)?e:e.querySelector(`[${qs}]`)||e:null}function xn(e,t,n=!0){return e.filter(o=>o.parentId===t).flatMap(o=>[...!n||o.context?.open?[o]:[],...xn(e,o.id,n)])}function ul(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function Ht(e){e.preventDefault(),e.stopPropagation()}function eA(e){return"nativeEvent"in e}function Qi(e){return e.pointerType===""&&e.isTrusted?!0:Xs&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Gi(e){return Ki?!1:!Xs&&e.width===0&&e.height===0||Xs&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function mn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function tA(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Xn=Math.min,nn=Math.max,Co=Math.round,Zr=Math.floor,rn=e=>({x:e,y:e}),nA={left:"right",right:"left",bottom:"top",top:"bottom"};function Cu(e,t,n){return nn(e,Xn(t,n))}function bn(e,t){return typeof e=="function"?e(t):e}function jt(e){return e.split("-")[0]}function Cn(e){return e.split("-")[1]}function Yi(e){return e==="x"?"y":"x"}function zi(e){return e==="y"?"height":"width"}function Ft(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Ui(e){return Yi(Ft(e))}function rA(e,t,n){n===void 0&&(n=!1);const r=Cn(e),o=Ui(e),s=zi(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Io(i)),[i,Io(i)]}function oA(e){const t=Io(e);return[ti(e),t,ti(t)]}function ti(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const dl=["left","right"],fl=["right","left"],sA=["top","bottom"],iA=["bottom","top"];function aA(e,t,n){switch(e){case"top":case"bottom":return n?t?fl:dl:t?dl:fl;case"left":case"right":return t?sA:iA;default:return[]}}function lA(e,t,n,r){const o=Cn(e);let s=aA(jt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(ti)))),s}function Io(e){const t=jt(e);return nA[t]+e.slice(t.length)}function cA(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 Iu(e){return typeof e!="number"?cA(e):{top:e,right:e,bottom:e,left:e}}function Dr(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 Ir(e,t){return t<0||t>=e.length}function Ao(e,t){return tn(e.current,{disabledIndices:t})}function ni(e,t){return tn(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function tn(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let s=t;do s+=n?-o:o;while(s>=0&&s<=e.length-1&&wo(e,s,r));return s}function wo(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const o=e[t];return o?!Zo(o)||o.matches(":disabled")?!0:!n&&(o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"):!1}function uA(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Zo(e,t=e?_t(e):null){return!e||!e.isConnected||!t||uA(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const dA='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function fA(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Ei(n)?n.host:null}function ri(e){for(const t of Array.from(e.children))if(wt(t)==="summary")return t;return null}function pA(e,t){const n=ri(t);return!!n&&(e===n||ve(n,e))}function wu(e){const t=e?wt(e):"";return e!=null&&e.matches(dA)&&(t!=="summary"||e.parentElement!=null&&wt(e.parentElement)==="details"&&ri(e.parentElement)===e)&&(t!=="details"||ri(e)==null)&&(t!=="input"||e.type!=="hidden")}function ku(e){if(!wu(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=fA(t)){const n=t!==e,r=wt(t)==="slot";if(t.hasAttribute("inert")||n&&wt(t)==="details"&&!t.open&&!pA(e,t)||t.hasAttribute("hidden")||!r&&!hA(t,n))return!1}return!0}function hA(e,t){const n=_t(e);return t?n.display!=="none":Zo(e,n)}function Eu(e){const t=e.tabIndex;if(t<0){const n=wt(e);if(n==="details"||n==="audio"||n==="video"||Xe(e)&&e.isContentEditable)return 0}return t}function ys(e){if(wt(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function AA(e,t){const n=ys(e);if(!n)return!0;const r=t.find(o=>{const s=ys(o);return s?.name===n.name&&s.form===n.form&&s.checked});return r?r===n:t.find(o=>{const s=ys(o);return s?.name===n.name&&s.form===n.form})===n}function Su(e){if(Xe(e)&&wt(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Xe(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Ru(e,t){Su(e).forEach(n=>{wu(n)&&t.push(n),Ru(n,t)})}function Du(e,t,n){Su(e).forEach(r=>{Xe(r)&&r.matches(t)&&n.push(r),Du(r,t,n)})}function Vi(e){return ku(e)&&Eu(e)>=0}function Fu(e){const t=[];return Ru(e,t),t.filter(ku)}function Kr(e){const t=Fu(e);return t.filter(n=>Eu(n)>=0&&AA(n,t))}function Bu(e,t){const n=Kr(e),r=n.length;if(r===0)return;const o=vt(Be(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function Zi(e){return Bu(Be(e).body,1)||e}function ju(e){return Bu(Be(e).body,-1)||e}function Mu(e,t){if(!e)return null;const n=Kr(Be(e).body),r=n.length;if(r===0)return null;const o=n.indexOf(e);if(o===-1)return null;const s=(o+t+r)%r;return n[s]}function gA(e){return Mu(e,1)}function mA(e){return Mu(e,-1)}function zn(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ve(n,r)}function xA(e){Kr(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function pl(e){const t=[];Du(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Ji(e){d.useEffect(e,Nt)}const ar=0;class Ot{static create(){return new Ot}currentId=ar;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ar,n()},t)}isStarted(){return this.currentId!==ar}clear=()=>{this.currentId!==ar&&(clearTimeout(this.currentId),this.currentId=ar)};disposeEffect=()=>this.clear}function pt(){const e=Dt(Ot.create).current;return Ji(e.disposeEffect),e}const bA=d.createContext({disabled:!1});function vA(){return d.useContext(bA)}var sn=Fp();const Jr=null;class yA{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}let $r=new yA;class Ct{static create(){return new Ct}static request(t){return $r.request(t)}static cancel(t){return $r.cancel(t)}currentId=Jr;request(t){this.cancel(),this.currentId=$r.request(()=>{this.currentId=Jr,t()})}cancel=()=>{this.currentId!==Jr&&($r.cancel(this.currentId),this.currentId=Jr)};disposeEffect=()=>this.cancel}function qn(){const e=Dt(Ct.create).current;return Ji(e.disposeEffect),e}function Xt(e){return e==null?e:"current"in e?e.current:e}function $i(e,t=!1){const n=qn();return de((r,o=null)=>{n.cancel();const s=Xt(e);if(s==null)return;const i=s,a=()=>{sn.flushSync(r)};if(typeof i.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function c(){Promise.all(i.getAnimations().map(u=>u.finished)).then(()=>{o?.aborted||a()},()=>{if(o?.aborted)return;if(i.getAnimations().some(f=>f.pending||f.playState!=="finished")){c();return}a()})}if(t){const u="data-starting-style";if(!i.hasAttribute(u)){n.request(c);return}const f=new MutationObserver(()=>{i.hasAttribute(u)||(f.disconnect(),c())});f.observe(i,{attributes:!0,attributeFilter:[u]}),o?.addEventListener("abort",()=>f.disconnect(),{once:!0});return}n.request(c)})}function Yt(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=de(o),i=$i(r,n);d.useEffect(()=>{if(!t)return;const a=new AbortController;return i(s,a.signal),()=>{a.abort()}},[t,n,s,i])}let ko=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const CA={"data-starting-style":""},IA={"data-ending-style":""},Nn={transitionStatus(e){return e==="starting"?CA:e==="ending"?IA:null}};function sr(e,t=!1,n=!1){const[r,o]=d.useState(e&&t?"idle":void 0),[s,i]=d.useState(e);return e&&!s&&(i(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),ie(()=>{if(!e&&s&&r!=="ending"&&n){const a=Ct.request(()=>{o("ending")});return()=>{Ct.cancel(a)}}},[e,s,r,n]),ie(()=>{if(!e||t)return;const a=Ct.request(()=>{o(void 0)});return()=>{Ct.cancel(a)}},[t,e]),ie(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const a=Ct.request(()=>{o("idle")});return()=>{Ct.cancel(a)}},[t,e,s,r]),{mounted:s,setMounted:i,transitionStatus:r}}var Cs={exports:{}},Is={};var hl;function wA(){if(hl)return Is;hl=1;var e=lu();function t(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(h,g){var A=g(),p=r({inst:{value:A,getSnapshot:g}}),m=p[0].inst,x=p[1];return s(function(){m.value=A,m.getSnapshot=g,c(m)&&x({inst:m})},[h,A,g]),o(function(){return c(m)&&x({inst:m}),h(function(){c(m)&&x({inst:m})})},[h]),i(A),A}function c(h){var g=h.getSnapshot;h=h.value;try{var A=g();return!n(h,A)}catch{return!0}}function u(h,g){return g()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return Is.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Is}var Al;function Pu(){return Al||(Al=1,Cs.exports=wA()),Cs.exports}var Jo=Pu();const br={v:[]},gl=()=>br.v.forEach(e=>e()),kA=e=>(br.v.push(e)===1&&addEventListener("hashchange",gl),()=>{br.v=br.v.filter(t=>t!==e),br.v.length||removeEventListener("hashchange",gl)}),EA=()=>"/"+location.hash.replace(/^#?\/?/,""),SA=(e,{state:t=null,replace:n=!1}={})=>{const r=location.href,[o,s]=e.replace(/^#?\/?/,"").split("?"),i=new URL(location.href);i.hash=`/${o}`,s&&(i.search=s);const a=i.href;n?history.replaceState(t,"",a):history.pushState(t,"",a);const c=typeof HashChangeEvent<"u"?new HashChangeEvent("hashchange",{oldURL:r,newURL:a}):new Event("hashchange",{detail:{oldURL:r,newURL:a}});dispatchEvent(c)},Tu=({ssrPath:e="/"}={})=>[Jo.useSyncExternalStore(kA,EA,()=>e),SA];Tu.hrefs=e=>"#"+e;const ws=768;function RA(){const[e,t]=d.useState(void 0);return d.useEffect(()=>{const n=window.matchMedia(`(max-width: ${ws-1}px)`),r=()=>t(window.innerWidth<ws);return n.addEventListener("change",r),t(window.innerWidth<ws),()=>n.removeEventListener("change",r)},[]),!!e}const Nu=d.createContext(void 0);function _n(e){const t=d.useContext(Nu);if(!e&&t===void 0)throw new Error(ot(27));return t}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=ko.startingStyle]="startingStyle",e[e.endingStyle=ko.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const DA={"data-popup-open":""},FA={"data-popup-open":"","data-pressed":""},BA={"data-open":""},jA={"data-closed":""},MA={"data-anchor-hidden":""},_u={open(e){return e?DA:null}},oi={open(e){return e?FA:null}},Wr={open(e){return e?BA:jA},anchorHidden(e){return e?MA:null}},Xi={...Wr,...Nn},qi=d.forwardRef(function(t,n){const{render:r,className:o,style:s,forceRender:i=!1,...a}=t,c=_n(),u=c.useState("open"),f=c.useState("nested"),h=c.useState("mounted"),g=c.useState("transitionStatus");return je("div",t,{state:{open:u,transitionStatus:g},ref:[c.context.backdropRef,n],stateAttributesMapping:Xi,props:[{role:"presentation",hidden:!h,style:{userSelect:"none",WebkitUserSelect:"none"}},a],enabled:i||!f})}),Qr=d.forwardRef(function(t,n){const{render:r,className:o,style:s,disabled:i=!1,nativeButton:a=!0,...c}=t,u=_n(),f=u.useState("open"),{getButtonProps:h,buttonRef:g}=Gt({disabled:i,native:a}),A={disabled:i};function p(m){f&&u.setOpen(!1,Ce(Tp,m.nativeEvent))}return je("button",t,{state:A,ref:[n,g],props:[{onClick:p},c,h]})}),ea=d.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,...a}=t,c=_n(),u=It(i);return c.useSyncedValueWithCleanup("descriptionElementId",u),je("p",t,{ref:n,props:[{id:u},a]})});function PA(e,t){return t!=null&&!mn(t)?0:typeof e=="function"?e():e}function er(e,t,n){const r=PA(e,n);return typeof r=="number"?r:r?.[t]}function ml(e){return typeof e=="function"?e():e}function Ou(e,t){return t||e==="click"||e==="mousedown"}function TA(e){return e?.includes("mouse")&&e!=="mousedown"}const NA=d.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Ot,currentIdRef:{current:null},currentContextRef:{current:null}});function _A(e,t){e.current=t.current}function OA(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,o=r.useState("floatingId"),s=d.useContext(NA),{currentIdRef:i,delayRef:a,timeoutMs:c,initialDelayRef:u,currentContextRef:f,hasProvider:h,timeout:g}=s,[A,p]=d.useState(!1),m=d.useRef(n);return ie(()=>{m.current=n},[n]),ie(()=>{function x(){f.current?.setIsInstantPhase(!1),i.current=null,f.current=null,a.current=u.current,g.clear()}if(i.current&&!n&&i.current===o){if(p(!1),c){const v=o;return g.start(c,()=>{r.select("open")||i.current&&i.current!==v||x()}),()=>{(m.current||i.current!==v)&&g.clear()}}x()}},[n,o,i,a,c,u,f,g,r]),ie(()=>{if(!n)return;const x=f.current,v=i.current;g.clear(),f.current={onOpenChange:r.setOpen,setIsInstantPhase:p},i.current=o,a.current={open:0,close:er(u.current,"close")},v!==null&&v!==o?(p(!0),x?.setIsInstantPhase(!0),x?.onOpenChange(!1,Ce(Mt))):(p(!1),x?.setIsInstantPhase(!1))},[n,o,r,i,a,u,f,g]),ie(()=>()=>{if(i.current===o){if(f.current=null,!m.current)return;i.current=null,_A(a,u),g.clear()}},[f,i,a,o,u,g]),d.useMemo(()=>({hasProvider:h,delayRef:a,isInstantPhase:A}),[h,a,A])}function De(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Wt(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function tt(e){const t=Dt(HA,e).current;return t.next=e,ie(t.effect),t}function HA(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Hu={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},$o={...Hu,position:"fixed",top:0,left:0},ta={...Hu,position:"absolute"},tr=d.forwardRef(function(t,n){const[r,o]=d.useState();ie(()=>{Jh&&an&&o("button")},[]);const s={tabIndex:0,role:r};return l.jsx("span",{...t,ref:n,style:$o,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});function Fr(e){return`data-base-ui-${e}`}let Xr=0;function go(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:o}=t;cancelAnimationFrame(Xr);function s(){o&&!o()||e?.focus({preventScroll:n})}if(r)return s(),Er;const i=requestAnimationFrame(s);return Xr=i,()=>{Xr===i&&(cancelAnimationFrame(i),Xr=0)}}const ks={inert:new WeakMap,"aria-hidden":new WeakMap},xl="data-base-ui-inert",si={inert:new WeakSet,"aria-hidden":new WeakSet};let lr=new WeakMap,Es=0;function LA(e){return si[e]}function Lu(e){return e?Ei(e)?e.host:Lu(e.parentNode):null}const bl=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Lu(n);return e.contains(r)?r:null}).filter(n=>n!=null),vl=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},yl=(e,t,n)=>{const r=[],o=s=>{!s||n.has(s)||Array.from(s.children).forEach(i=>{wt(i)!=="script"&&(t.has(i)?o(i):r.push(i))})};return o(e),r};function KA(e,t,n,r,{mark:o=!0}){let s=null;r?s="inert":n&&(s="aria-hidden");let i=null,a=null;const c=bl(t,e),u=o?yl(t,vl(c),new Set(c)):[],f=[],h=[];if(s){const g=ks[s],A=LA(s);a=A,i=g;const p=bl(t,Array.from(t.querySelectorAll("[aria-live]"))),m=c.concat(p);yl(t,vl(m),new Set(m)).forEach(v=>{const b=v.getAttribute(s),y=b!==null&&b!=="false",C=(g.get(v)||0)+1;g.set(v,C),f.push(v),C===1&&y&&A.add(v),y||v.setAttribute(s,s==="inert"?"":"true")})}return o&&u.forEach(g=>{const A=(lr.get(g)||0)+1;lr.set(g,A),h.push(g),A===1&&g.setAttribute(xl,"")}),Es+=1,()=>{i&&f.forEach(g=>{const p=(i.get(g)||0)-1;i.set(g,p),p||(!a?.has(g)&&s&&g.removeAttribute(s),a?.delete(g))}),o&&h.forEach(g=>{const A=(lr.get(g)||0)-1;lr.set(g,A),A||g.removeAttribute(xl)}),Es-=1,Es||(ks.inert=new WeakMap,ks["aria-hidden"]=new WeakMap,si.inert=new WeakSet,si["aria-hidden"]=new WeakSet,lr=new WeakMap)}}function Cl(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:o=!0}=t,s=Be(e[0]).body;return KA(e,s,n,r,{mark:o})}const WA=500,QA=500,GA={style:{transition:"none"}},YA="data-base-ui-click-trigger",Ku={fallbackAxisSide:"none"},Wu={fallbackAxisSide:"end"},zA={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Qu=d.createContext(null),Gu=()=>d.useContext(Qu),UA=Fr("portal");function Yu(e={}){const{ref:t,container:n,componentProps:r=ct,elementProps:o}=e,s=Jn(),a=Gu()?.portalNode,[c,u]=d.useState(null),[f,h]=d.useState(null),g=de(x=>{x!==null&&h(x)}),A=d.useRef(null);ie(()=>{if(n===null){A.current&&(A.current=null,h(null),u(null));return}const x=(n&&(Np(n)?n:n.current))??a??document.body;if(x==null){A.current&&(A.current=null,h(null),u(null));return}A.current!==x&&(A.current=x,h(null),u(x))},[n,a]);const p=je("div",r,{ref:[t,g],props:[{id:s,[UA]:""},o]}),m=c&&p?sn.createPortal(p,c):null;return{node:f,nodeId:d.isValidElement(p)?p.props.id:void 0,subtree:m}}const na=d.forwardRef(function(t,n){const{render:r,className:o,style:s,children:i,container:a,...c}=t,{node:u,nodeId:f,subtree:h}=Yu({container:a,ref:n,componentProps:t,elementProps:c}),g=d.useRef(null),A=d.useRef(null),p=d.useRef(null),m=d.useRef(null),[x,v]=d.useState(null),b=d.useRef(!1),y=x?.modal,C=x?.open,w=!!x&&!x.modal&&x.open&&!!u;d.useEffect(()=>{if(!u||y)return;function S(R){u&&R.relatedTarget&&zn(R)&&(R.type==="focusin"?b.current&&(pl(u),b.current=!1):(xA(u),b.current=!0))}return Wt(De(u,"focusin",S,!0),De(u,"focusout",S,!0))},[u,y]),ie(()=>{!u||C!==!0||!b.current||(pl(u),b.current=!1)},[C,u]);const I=d.useMemo(()=>({beforeOutsideRef:g,afterOutsideRef:A,beforeInsideRef:p,afterInsideRef:m,portalNode:u,setFocusManagerState:v}),[u]);return l.jsxs(d.Fragment,{children:[h,l.jsxs(Qu.Provider,{value:I,children:[w&&u&&l.jsx(tr,{"data-type":"outside",ref:g,onFocus:S=>{if(zn(S,u))p.current?.focus();else{const R=x?x.domReference:null;ju(R)?.focus()}}}),w&&u&&l.jsx("span",{"aria-owns":f,style:zA}),u&&sn.createPortal(i,u),w&&u&&l.jsx(tr,{"data-type":"outside",ref:A,onFocus:S=>{if(zn(S,u))m.current?.focus();else{const R=x?x.domReference:null;Zi(R)?.focus(),x?.closeOnFocusOut&&x?.onOpenChange(!1,Ce(Bn,S.nativeEvent))}}})]})]})});function zu(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class ra{nodesRef={current:[]};events=zu();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Uu=d.createContext(null),Vu=d.createContext(null),In=()=>d.useContext(Uu)?.id||null,wn=e=>{const t=d.useContext(Vu);return e??t};function Zu(e){const t=Jn(),n=wn(e),r=In();return ie(()=>{if(!t)return;const o={id:t,parentId:r};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,r]),t}function VA(e){const{children:t,id:n}=e,r=In();return l.jsx(Uu.Provider,{value:d.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function ZA(e){const{children:t,externalTree:n}=e,r=Dt(()=>n??new ra).current;return l.jsx(Vu.Provider,{value:r,children:t})}function JA(e,t){const n=rt(At(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const Il=20;let gn=[];function oa(){gn=gn.filter(e=>e.deref()?.isConnected)}function wl(e){oa(),e&&wt(e)!=="body"&&(gn.push(new WeakRef(e)),gn.length>Il&&(gn=gn.slice(-Il)))}function kl(){return oa(),gn[gn.length-1]?.deref()}function $A(e){return e?Vi(e)?e:Kr(e)[0]||e:null}function El(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=Fu(e).filter(o=>{const s=o.getAttribute("data-tabindex")||"";return Vi(o)||o.hasAttribute("data-tabindex")&&!s.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function sa(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:a=!0,closeOnFocusOut:c=!0,openInteractionType:u="",nextFocusableElement:f,previousFocusableElement:h,beforeContentFocusGuardRef:g,externalTree:A,getInsideElements:p}=e,m="rootStore"in t?t.rootStore:t,x=m.useState("open"),v=m.useState("domReferenceElement"),b=m.useState("floatingElement"),{events:y,dataRef:C}=m.context,w=de(()=>C.current.floatingContext?.nodeId),I=o===!1,S=ei(v)&&I,R=tt(o),E=tt(s),k=tt(u),F=tt(x),T=wn(A),N=Gu(),M=d.useRef(!1),D=d.useRef(!1),L=d.useRef(!1),_=d.useRef(null),j=d.useRef(""),H=d.useRef(""),P=d.useRef(null),B=d.useRef(null),O=Qt(P,g,N?.beforeInsideRef),G=Qt(B,N?.afterInsideRef),z=pt(),U=pt(),Q=qn(),Z=N!=null,K=yo(b),te=de((ee=K)=>ee?Kr(ee):[]),le=de(()=>p?.().filter(ee=>ee!=null)??[]);d.useEffect(()=>{if(r||!a)return;function ee(ce){ce.key==="Tab"&&ve(K,vt(Be(K)))&&te().length===0&&!S&&Ht(ce)}const J=Be(K);return De(J,"keydown",ee)},[r,K,a,S,te]),d.useEffect(()=>{if(r||!x)return;const ee=Be(K);function J(){L.current=!1}function ce(ge){const ae=At(ge),pe=le(),oe=ve(b,ae)||ve(v,ae)||ve(N?.portalNode,ae)||pe.some(re=>re===ae||ve(re,ae));L.current=!oe,H.current=ge.pointerType||"keyboard",ae?.closest(`[${YA}]`)&&(D.current=!0,U.start(0,()=>{D.current=!1}))}function ue(){H.current="keyboard"}return Wt(De(ee,"pointerdown",ce,!0),De(ee,"pointerup",J,!0),De(ee,"pointercancel",J,!0),De(ee,"keydown",ue,!0),J)},[r,b,v,K,x,N,U,le]),d.useEffect(()=>{if(r||!c)return;const ee=Be(K);function J(){D.current=!0,U.start(0,()=>{D.current=!1})}function ce(pe){const oe=At(pe);Vi(oe)&&(_.current=oe)}function ue(pe){const oe=pe.relatedTarget,re=pe.currentTarget,se=At(pe);a&&oe==null&&se!=null&&ve(b,se)&&wl(se),queueMicrotask(()=>{const he=w(),me=m.context.triggerElements,W=le(),Y=oe?.hasAttribute(Fr("focus-guard"))&&[P.current,B.current,N?.beforeInsideRef.current,N?.afterInsideRef.current,N?.beforeOutsideRef.current,N?.afterOutsideRef.current,Xt(h),Xt(f)].includes(oe),ye=!(ve(v,oe)||ve(b,oe)||ve(oe,b)||ve(N?.portalNode,oe)||W.some(q=>q===oe||ve(q,oe))||me.hasMatchingElement(q=>ve(q,oe))||Y||T&&(xn(T.nodesRef.current,he).find(q=>ve(q.context?.elements.floating,oe)||ve(q.context?.elements.domReference,oe))||ul(T.nodesRef.current,he).find(q=>[q.context?.elements.floating,yo(q.context?.elements.floating)].includes(oe)||q.context?.elements.domReference===oe)));if(re===v&&K&&El(K),i&&re!==v&&!Zo(se)&&vt(ee)===ee.body){if(Xe(K)&&(K.focus(),i==="popup")){Q.request(()=>{K.focus()});return}const q=te(),ne=_.current,Ee=(ne&&q.includes(ne)?ne:null)||q[q.length-1]||K;Xe(Ee)&&Ee.focus()}if(C.current.insideReactTree){C.current.insideReactTree=!1;return}(S||!a)&&oe&&ye&&!D.current&&(S||oe!==kl())&&(M.current=!0,m.setOpen(!1,Ce(Bn,pe)))})}function ge(){L.current||(C.current.insideReactTree=!0,z.start(0,()=>{C.current.insideReactTree=!1}))}const ae=Xe(v)?v:null;if(!(!b&&!ae))return Wt(ae&&De(ae,"focusout",ue),ae&&De(ae,"pointerdown",J),b&&De(b,"focusin",ce),b&&De(b,"focusout",ue),b&&N&&De(b,"focusout",ge,!0))},[r,v,b,K,a,T,N,m,c,i,te,S,w,C,z,U,Q,f,h,le]),d.useEffect(()=>{if(r||!b||!x)return;const ee=Array.from(N?.portalNode?.querySelectorAll(`[${Fr("portal")}]`)||[]),ce=(T?ul(T.nodesRef.current,w()):[]).find(re=>ei(re.context?.elements.domReference||null))?.context?.elements.domReference,ge=[...[b,...ee,P.current,B.current,N?.beforeOutsideRef.current,N?.afterOutsideRef.current,...le()],ce,Xt(h),Xt(f),S?v:null].filter(re=>re!=null),ae=Cl(ge,{ariaHidden:a||S,mark:!1}),pe=[b,...ee].filter(re=>re!=null),oe=Cl(pe);return()=>{oe(),ae()}},[x,r,v,b,a,N,S,T,w,f,h,le]),ie(()=>{if(!x||r||!Xe(K))return;j.current="",H.current="";const ee=Be(K),J=vt(ee);queueMicrotask(()=>{const ce=R.current,ue=typeof ce=="function"?ce(k.current||""):ce;if(ue===void 0||ue===!1||ve(K,J))return;let ae=null;const pe=()=>(ae==null&&(ae=te(K)),ae[0]||K);let oe;ue===!0||ue===null?oe=pe():oe=Xt(ue),oe=oe||pe();const re=ve(K,vt(ee));go(oe,{preventScroll:oe===K,shouldFocus(){if(!F.current)return!1;if(re)return!0;const se=vt(ee);return!(se!==oe&&ve(K,se))}})})},[r,x,K,te,R,k,F]),ie(()=>{if(r||!K)return;const ee=Be(K),J=vt(ee),ce=k.current==null;wl(J);function ue(ae){if(ae.open||(j.current=JA(ae.nativeEvent,H.current)),ae.reason===at&&ae.nativeEvent.type==="mouseleave"&&(M.current=!0),ae.reason===Lo)if(ae.nested)M.current=!1;else if(Qi(ae.nativeEvent)||Gi(ae.nativeEvent))M.current=!1;else{let pe=!1;Be(K).createElement("div").focus({get preventScroll(){return pe=!0,!1}}),pe?M.current=!1:M.current=!0}}y.on("openchange",ue);function ge(ae){const pe=E.current;let oe=typeof pe=="function"?pe(ae):pe;if(oe===void 0||oe===!1)return null;oe===null&&(oe=!0);const re=v?.isConnected?v:null,se=J?.isConnected&&wt(J)!=="body"?J:null;let he=ce?se||re:re||se;return he||(he=kl()||null),typeof oe=="boolean"?he:Xt(oe)||he||null}return()=>{y.off("openchange",ue);const ae=vt(ee),pe=le(),oe=ve(b,ae)||pe.some(me=>me===ae||ve(me,ae))||T&&xn(T.nodesRef.current,w(),!1).some(me=>ve(me.context?.elements.floating,ae)),re=E.current,se=j.current,he=ge(se);queueMicrotask(()=>{const me=$A(he),W=typeof re!="boolean";if(re&&!M.current&&Xe(me)&&(!(!W&&me!==ae&&ae!==ee.body)||oe)){const Y={preventScroll:!0};se==="keyboard"&&(Y.focusVisible=!0),me.focus(Y)}M.current=!1})}},[r,b,K,E,k,y,T,v,w,le]),ie(()=>{if(!an||x||!b)return;const ee=vt(Be(b));!Xe(ee)||!Vo(ee)||ve(b,ee)&&ee.blur()},[x,b]),ie(()=>{if(!(r||!N))return N.setFocusManagerState({modal:a,closeOnFocusOut:c,open:x,onOpenChange:m.setOpen,domReference:v}),()=>{N.setFocusManagerState(null)}},[r,N,a,x,m,c,v]),ie(()=>{if(!(r||!K))return El(K),()=>{queueMicrotask(oa)}},[r,K]);const X=!r&&(a?!S:!0)&&(Z||a);return l.jsxs(d.Fragment,{children:[X&&l.jsx(tr,{"data-type":"inside",ref:O,onFocus:ee=>{if(a){const J=te();go(J[J.length-1])}else N?.portalNode&&(M.current=!1,zn(ee,N.portalNode)?Zi(v)?.focus():Xt(h??N.beforeOutsideRef)?.focus())}}),n,X&&l.jsx(tr,{"data-type":"inside",ref:G,onFocus:ee=>{a?go(te()[0]):N?.portalNode&&(c&&(M.current=!0),zn(ee,N.portalNode)?ju(v)?.focus():Xt(f??N.afterOutsideRef)?.focus())}})]})}function Ju(e,t={}){const{enabled:n=!0,event:r="click",toggle:o=!0,ignoreMouse:s=!1,stickIfOpen:i=!0,touchOpenDelay:a=0,reason:c=Pn}=t,u="rootStore"in e?e.rootStore:e,f=u.context.dataRef,h=d.useRef(void 0),g=qn(),A=pt(),p=d.useMemo(()=>{function m(v,b,y,C){const w=Ce(c,b,y);v&&C==="touch"&&a>0?A.start(a,()=>{u.setOpen(!0,w)}):u.setOpen(v,w)}function x(v,b,y){const C=f.current.openEvent,w=u.select("domReferenceElement")!==b;return v&&w||!v||!o?!0:C&&i?!y(C.type):!1}return{onPointerDown(v){h.current=mn(v.pointerType,!0)&&Gi(v.nativeEvent)?"virtual":v.pointerType},onMouseDown(v){const b=h.current,y=v.nativeEvent,C=u.select("open");if(v.button!==0||r==="click"||mn(b,!0)&&s)return;const w=x(C,v.currentTarget,R=>R==="click"||R==="mousedown"),I=At(y);if(Vo(I)){m(w,y,I,b);return}const S=v.currentTarget;g.request(()=>{m(w,y,S,b)})},onClick(v){if(r==="mousedown-only")return;const b=h.current;if(r==="mousedown"&&b){h.current=void 0;return}if(mn(b,!0)&&s)return;const y=u.select("open"),C=x(y,v.currentTarget,w=>w==="click"||w==="mousedown"||w==="keydown"||w==="keyup");m(C,v.nativeEvent,v.currentTarget,b)},onKeyDown(){h.current=void 0}}},[f,r,s,c,u,i,o,g,A,a]);return d.useMemo(()=>n?{reference:p}:ct,[n,p])}function XA(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){const s=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},i=t.axis==="x"||t.axis==="both",a=t.axis==="y"||t.axis==="both",c=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch";let u=s.width,f=s.height,h=s.x,g=s.y;return n==null&&t.x&&i&&(n=s.x-t.x),r==null&&t.y&&a&&(r=s.y-t.y),h-=n||0,g-=r||0,u=0,f=0,!o||c?(u=t.axis==="y"?s.width:0,f=t.axis==="x"?s.height:0,h=i&&t.x!=null?t.x:h,g=a&&t.y!=null?t.y:g):o&&!c&&(f=t.axis==="x"?s.height:f,u=t.axis==="y"?s.width:u),o=!0,{width:u,height:f,x:h,y:g,top:g,right:h+u,bottom:g+f,left:h}}}}function Sl(e){return e!=null&&e.clientX!=null}function qA(e,t={}){const{enabled:n=!0,axis:r="both"}=t,o="rootStore"in e?e.rootStore:e,s=o.useState("open"),i=o.useState("floatingElement"),a=o.useState("domReferenceElement"),c=o.context.dataRef,u=d.useRef(!1),f=d.useRef(null),[h,g]=d.useState(),[A,p]=d.useState([]),m=de(C=>{o.set("positionReference",C)}),x=de((C,w,I)=>{u.current||c.current.openEvent&&!Sl(c.current.openEvent)||o.set("positionReference",XA(I??a,{x:C,y:w,axis:r,dataRef:c,pointerType:h}))}),v=de(C=>{s?f.current||(x(C.clientX,C.clientY,C.currentTarget),p([])):x(C.clientX,C.clientY,C.currentTarget)}),b=mn(h)?i:s;d.useEffect(()=>{if(!n){m(a);return}if(!b)return;function C(){f.current?.(),f.current=null}const w=rt(i);function I(S){const R=At(S);ve(i,R)?C():x(S.clientX,S.clientY)}return!c.current.openEvent||Sl(c.current.openEvent)?f.current=De(w,"mousemove",I):m(a),C},[b,n,i,c,a,o,x,m,A]),d.useEffect(()=>()=>{o.set("positionReference",null)},[o]),d.useEffect(()=>{n&&!i&&(u.current=!1)},[n,i]),d.useEffect(()=>{!n&&s&&(u.current=!0)},[n,s]);const y=d.useMemo(()=>{function C(w){g(w.pointerType)}return{onPointerDown:C,onPointerEnter:C,onMouseMove:v,onMouseEnter:v}},[v]);return d.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function eg(){return!1}function tg(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Xo(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:o=!0,outsidePressEvent:s="sloppy",referencePress:i=eg,bubbles:a,externalTree:c}=t,u="rootStore"in e?e.rootStore:e,f=u.useState("open"),h=u.useState("floatingElement"),{dataRef:g}=u.context,A=wn(c),p=de(typeof o=="function"?o:()=>!1),m=typeof o=="function"?p:o,x=m!==!1,v=de(()=>s),{escapeKey:b,outsidePress:y}=tg(a),C=d.useRef(!1),w=d.useRef(!1),I=d.useRef(!1),S=d.useRef(!1),R=d.useRef(""),E=d.useRef(null),k=pt(),F=pt(),T=de(()=>{F.clear(),g.current.insideReactTree=!1}),N=de(O=>{const G=g.current.floatingContext?.nodeId;return(A?xn(A.nodesRef.current,G):[]).some(U=>U.context?.open&&!U.context.dataRef.current[O])}),M=de(O=>vs(O,u.select("floatingElement"))||vs(O,u.select("domReferenceElement"))),D=de(O=>{i()&&u.setOpen(!1,Ce(Pn,O.nativeEvent))}),L=de(O=>{if(!f||!n||!r||O.key!=="Escape"||S.current||!b&&N("__escapeKeyBubbles"))return;const G=eA(O)?O.nativeEvent:O,z=Ce(Ko,G);u.setOpen(!1,z),z.isCanceled||O.preventDefault(),!b&&!z.isPropagationAllowed&&O.stopPropagation()}),_=de(()=>{g.current.insideReactTree=!0,F.start(0,T)}),j=de(O=>{if(!f||!n||O.button!==0)return;const G=At(O.nativeEvent);ve(u.select("floatingElement"),G)&&(C.current||(C.current=!0,w.current=!1))}),H=de(O=>{!f||!n||(O.defaultPrevented||O.nativeEvent.defaultPrevented)&&C.current&&(w.current=!0)});d.useEffect(()=>{if(!f||!n)return T;g.current.__escapeKeyBubbles=b,g.current.__outsidePressBubbles=y;const O=new Ot,G=new Ot;function z(){O.clear(),S.current=!0}function U(){O.start(an?5:0,()=>{S.current=!1})}function Q(){I.current=!0,G.start(0,()=>{I.current=!1})}function Z(){C.current=!1,w.current=!1}function K(){const W=R.current,Y=W==="pen"||!W?"mouse":W,ye=v(),q=typeof ye=="function"?ye():ye;return typeof q=="string"?q:q[Y]}function te(W){const Y=K();return Y==="intentional"&&W.type!=="click"||Y==="sloppy"&&W.type==="click"}function le(W){const Y=g.current.floatingContext?.nodeId,ye=A&&xn(A.nodesRef.current,Y).some(q=>vs(W,q.context?.elements.floating));return M(W)||ye}function X(W){if(te(W)){W.type!=="click"&&!M(W)&&(G.clear(),I.current=!1),T();return}if(g.current.insideReactTree){T();return}const Y=At(W),ye=`[${Fr("inert")}]`,q=Pe(Y)?Y.getRootNode():null,ne=Array.from((Ei(q)?q:Be(u.select("floatingElement"))).querySelectorAll(ye)),Ee=u.context.triggerElements;if(Y&&(Ee.hasElement(Y)||Ee.hasMatchingElement(Le=>ve(Le,Y))))return;let Se=Pe(Y)?Y:null;for(;Se&&!Dn(Se);){const Le=$n(Se);if(Dn(Le)||!Pe(Le))break;Se=Le}if(!(ne.length&&Pe(Y)&&!$h(Y)&&!ve(Y,u.select("floatingElement"))&&ne.every(Le=>!ve(Se,Le)))){if(Xe(Y)&&!("touches"in W)){const Le=Dn(Y),Je=_t(Y),We=/auto|scroll/,ut=Le||We.test(Je.overflowX),$e=Le||We.test(Je.overflowY),Ye=ut&&Y.clientWidth>0&&Y.scrollWidth>Y.clientWidth,mt=$e&&Y.clientHeight>0&&Y.scrollHeight>Y.clientHeight,Ie=Je.direction==="rtl",ze=mt&&(Ie?W.offsetX<=Y.offsetWidth-Y.clientWidth:W.offsetX>Y.clientWidth),Ne=Ye&&W.offsetY>Y.clientHeight;if(ze||Ne)return}if(!le(W)){if(K()==="intentional"&&I.current){G.clear(),I.current=!1;return}typeof m=="function"&&!m(W)||N("__outsidePressBubbles")||(u.setOpen(!1,Ce(Lo,W)),T())}}}function ee(W){K()!=="sloppy"||W.pointerType==="touch"||!u.select("open")||!n||M(W)||X(W)}function J(W){if(K()!=="sloppy"||!u.select("open")||!n||M(W))return;const Y=W.touches[0];Y&&(E.current={startTime:Date.now(),startX:Y.clientX,startY:Y.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},k.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function ce(W,Y){const ye=At(W);if(!ye)return;const q=De(ye,W.type,()=>{Y(W),q()})}function ue(W){R.current="touch",ce(W,J)}function ge(W){k.clear(),W.type==="pointerdown"&&(R.current=W.pointerType),!(W.type==="mousedown"&&E.current&&!E.current.dismissOnMouseDown)&&ce(W,Y=>{Y.type==="pointerdown"?ee(Y):X(Y)})}function ae(W){if(!C.current)return;const Y=w.current;if(Z(),K()==="intentional"){if(W.type==="pointercancel"){Y&&Q();return}if(!le(W)){if(Y){Q();return}typeof m=="function"&&!m(W)||(G.clear(),I.current=!0,T())}}}function pe(W){if(K()!=="sloppy"||!E.current||M(W))return;const Y=W.touches[0];if(!Y)return;const ye=Math.abs(Y.clientX-E.current.startX),q=Math.abs(Y.clientY-E.current.startY),ne=Math.sqrt(ye*ye+q*q);ne>5&&(E.current.dismissOnTouchEnd=!0),ne>10&&(X(W),k.clear(),E.current=null)}function oe(W){ce(W,pe)}function re(W){K()!=="sloppy"||!E.current||M(W)||(E.current.dismissOnTouchEnd&&X(W),k.clear(),E.current=null)}function se(W){ce(W,re)}const he=Be(h),me=Wt(r&&Wt(De(he,"keydown",L),De(he,"compositionstart",z),De(he,"compositionend",U)),x&&Wt(De(he,"click",ge,!0),De(he,"pointerdown",ge,!0),De(he,"pointerup",ae,!0),De(he,"pointercancel",ae,!0),De(he,"mousedown",ge,!0),De(he,"mouseup",ae,!0),De(he,"touchstart",ue,!0),De(he,"touchmove",oe,!0),De(he,"touchend",se,!0)));return()=>{me(),O.clear(),G.clear(),Z(),I.current=!1,T()}},[g,h,r,x,m,f,n,b,y,L,T,v,N,M,A,u,k]);const P=d.useMemo(()=>({onKeyDown:L,onPointerDown:D,onClick:D}),[L,D]),B=d.useMemo(()=>({onKeyDown:L,onPointerDown:H,onMouseDown:H,onClickCapture:_,onMouseDownCapture(O){_(),j(O)},onPointerDownCapture(O){_(),j(O)},onMouseUpCapture:_,onTouchEndCapture:_,onTouchMoveCapture:_}),[L,_,j,H]);return d.useMemo(()=>n?{reference:P,floating:B,trigger:P}:{},[n,P,B])}function Rl(e,t,n){let{reference:r,floating:o}=e;const s=Ft(t),i=Ui(t),a=zi(i),c=jt(t),u=s==="y",f=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,g=r[a]/2-o[a]/2;let A;switch(c){case"top":A={x:f,y:r.y-o.height};break;case"bottom":A={x:f,y:r.y+r.height};break;case"right":A={x:r.x+r.width,y:h};break;case"left":A={x:r.x-o.width,y:h};break;default:A={x:r.x,y:r.y}}const p=Cn(t);return p&&(A[i]+=g*(p==="end"?1:-1)*(n&&u?-1:1)),A}async function ng(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:g=!1,padding:A=0}=bn(t,e),p=Iu(A),x=a[g?h==="floating"?"reference":"floating":h],v=Dr(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:c})),b=h==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(y))&&await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1},w=Dr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:y,strategy:c}):b);return{top:(v.top-w.top+p.top)/C.y,bottom:(w.bottom-v.bottom+p.bottom)/C.y,left:(v.left-w.left+p.left)/C.x,right:(w.right-v.right+p.right)/C.x}}const rg=50,og=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:ng},c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:h}=Rl(u,r,c),g=r,A=0;const p={};for(let m=0;m<s.length;m++){const x=s[m];if(!x)continue;const{name:v,fn:b}=x,{x:y,y:C,data:w,reset:I}=await b({x:f,y:h,initialPlacement:r,placement:g,strategy:o,middlewareData:p,rects:u,platform:a,elements:{reference:e,floating:t}});f=y??f,h=C??h,p[v]={...p[v],...w},I&&A<rg&&(A++,typeof I=="object"&&(I.placement&&(g=I.placement),I.rects&&(u=I.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):I.rects),{x:f,y:h}=Rl(u,g,c)),m=-1)}return{x:f,y:h,placement:g,strategy:o,middlewareData:p}},sg=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:A="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...x}=bn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=jt(o),b=Ft(a),y=jt(a)===a,C=await(c.isRTL==null?void 0:c.isRTL(u.floating)),w=g||(y||!m?[Io(a)]:oA(a)),I=p!=="none";!g&&I&&w.push(...lA(a,m,p,C));const S=[a,...w],R=await c.detectOverflow(t,x),E=[];let k=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&E.push(R[v]),h){const M=rA(o,i,C);E.push(R[M[0]],R[M[1]])}if(k=[...k,{placement:o,overflows:E}],!E.every(M=>M<=0)){var F,T;const M=(((F=s.flip)==null?void 0:F.index)||0)+1,D=S[M];if(D&&(!(h==="alignment"?b!==Ft(D):!1)||k.every(j=>Ft(j.placement)===b?j.overflows[0]>0:!0)))return{data:{index:M,overflows:k},reset:{placement:D}};let L=(T=k.filter(_=>_.overflows[0]<=0).sort((_,j)=>_.overflows[1]-j.overflows[1])[0])==null?void 0:T.placement;if(!L)switch(A){case"bestFit":{var N;const _=(N=k.filter(j=>{if(I){const H=Ft(j.placement);return H===b||H==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(H=>H>0).reduce((H,P)=>H+P,0)]).sort((j,H)=>j[1]-H[1])[0])==null?void 0:N[0];_&&(L=_);break}case"initialPlacement":L=a;break}if(o!==L)return{reset:{placement:L}}}return{}}}},$u=new Set(["left","top"]);async function ig(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=jt(n),a=Cn(n),c=Ft(n)==="y",u=$u.has(i)?-1:1,f=s&&c?-1:1,h=bn(t,e);let{mainAxis:g,crossAxis:A,alignmentAxis:p}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof p=="number"&&(A=a==="end"?p*-1:p),c?{x:A*f,y:g*u}:{x:g*u,y:A*f}}const ag=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await ig(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},lg=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:i=!0,crossAxis:a=!1,limiter:c={fn:b=>{let{x:y,y:C}=b;return{x:y,y:C}}},...u}=bn(e,t),f={x:n,y:r},h=await s.detectOverflow(t,u),g=Ft(o),A=Yi(g);let p=f[A],m=f[g];const x=(b,y)=>Cu(y+h[b==="y"?"top":"left"],y,y-h[b==="y"?"bottom":"right"]);i&&(p=x(A,p)),a&&(m=x(g,m));const v=c.fn({...t,[A]:p,[g]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[A]:i,[g]:a}}}}}},cg=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:o,y:s,placement:i,rects:a,middlewareData:c}=t,{offset:u=0,mainAxis:f=!0,crossAxis:h=!0}=bn(e,t),g={x:o,y:s},A=Ft(i),p=Yi(A);let m=g[p],x=g[A];const v=bn(u,t),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:(n=v.mainAxis)!=null?n:0,crossAxis:(r=v.crossAxis)!=null?r:0};if(f){const w=p==="y"?"height":"width",I=a.reference[p]-a.floating[w]+b.mainAxis,S=a.reference[p]+a.reference[w]-b.mainAxis;m<I?m=I:m>S&&(m=S)}if(h){var y,C;const w=p==="y"?"width":"height",I=$u.has(jt(i)),S=a.reference[A]-a.floating[w]+(I&&((y=c.offset)==null?void 0:y[A])||0)+(I?0:b.crossAxis),R=a.reference[A]+a.reference[w]+(I?0:((C=c.offset)==null?void 0:C[A])||0)-(I?b.crossAxis:0);x<S?x=S:x>R&&(x=R)}return{[p]:m,[A]:x}}}},ug=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:i=()=>{},...a}=bn(e,t),c=await o.detectOverflow(t,a),u=jt(n),f=Cn(n),h=Ft(n)==="y",{width:g,height:A}=r.floating;let p,m;u==="top"||u==="bottom"?(p=u,m=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(m=u,p=f==="end"?"top":"bottom");const x=A-c.top-c.bottom,v=g-c.left-c.right,b=Xn(A-c[p],x),y=Xn(g-c[m],v),C=t.middlewareData.shift,w=!C;let I=b,S=y;C!=null&&C.enabled.x&&(S=v),C!=null&&C.enabled.y&&(I=x),w&&!f&&(h?S=g-2*nn(c.left,c.right):I=A-2*nn(c.top,c.bottom)),await i({...t,availableWidth:S,availableHeight:I});const R=await o.getDimensions(s.floating);return g!==R.width||A!==R.height?{reset:{rects:!0}}:{}}}};function Xu(e){const t=_t(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Xe(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Co(n)!==s||Co(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function ia(e){return Pe(e)?e:e.contextElement}function Un(e){const t=ia(e);if(!Xe(t))return rn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Xu(t);let i=(s?Co(n.width):n.width)/r,a=(s?Co(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const dg=rn(0);function qu(e){const t=rt(e);return!du()||!t.visualViewport?dg:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fg(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===rt(e)}function jn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=ia(e);let i=rn(1);t&&(r?Pe(r)&&(i=Un(r)):i=Un(e));const a=fg(s,n,r)?qu(s):rn(0);let c=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,f=o.width/i.x,h=o.height/i.y;if(s&&r){const g=rt(s),A=Pe(r)?rt(r):r;let p=g,m=sl(p);for(;m&&A!==p;){const x=Un(m),v=m.getBoundingClientRect(),b=_t(m),y=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*x.x,C=v.top+(m.clientTop+parseFloat(b.paddingTop))*x.y;c*=x.x,u*=x.y,f*=x.x,h*=x.y,c+=y,u+=C,p=rt(m),m=sl(p)}}return Dr({width:f,height:h,x:c,y:u})}function qo(e,t){const n=Wo(e).scrollLeft;return t?t.left+n:jn(yn(e)).left+n}function ed(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-qo(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function pg(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=yn(r),a=t?Si(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=rn(1);const f=rn(0),h=Xe(r);if((h||!s)&&((wt(r)!=="body"||Ri(i))&&(c=Wo(r)),h)){const A=jn(r);u=Un(r),f.x=A.x+r.clientLeft,f.y=A.y+r.clientTop}const g=i&&!h&&!s?ed(i,c):rn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+f.x+g.x,y:n.y*u.y-c.scrollTop*u.y+f.y+g.y}}function hg(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ag(e){const t=Wo(e),n=e.ownerDocument.body,r=nn(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=nn(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+qo(e);const i=-t.scrollTop;return _t(n).direction==="rtl"&&(s+=nn(e.clientWidth,n.clientWidth)-r),{width:r,height:o,x:s,y:i}}const gg=25;function mg(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",o=rt(e),s=yn(e),i=o.visualViewport;let a=s.clientWidth,c=s.clientHeight,u=0,f=0;if(i){const g=!du()||t==="fixed";r?g||(u=-i.offsetLeft,f=-i.offsetTop):(a=i.width,c=i.height,g&&(u=i.offsetLeft,f=i.offsetTop))}if(qo(s)<=0){const g=s.ownerDocument,A=g.body,p=getComputedStyle(A),m=g.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,x=Math.abs(s.clientWidth-A.clientWidth-m),v=getComputedStyle(s).scrollbarGutter==="stable both-edges"?x/2:x;v<=gg&&(a-=v)}return{width:a,height:c,x:u,y:f}}function xg(e,t){const n=jn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Un(e),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function Dl(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=mg(e,n,t);else if(t==="document")r=Ag(yn(e));else if(Pe(t))r=xg(t,n);else{const o=qu(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Dr(r)}function bg(e,t){const n=t.get(e);if(n)return n;let r=Zs(e,[],!1).filter(a=>Pe(a)&&wt(a)!=="body"),o=null;const s=_t(e).position==="fixed";let i=s?$n(e):e;for(;Pe(i)&&!Dn(i);){const a=_t(i),c=uu(i),u=o?o.position:s?"fixed":"";!c&&(u==="fixed"||u==="absolute"&&a.position==="static")?r=r.filter(h=>h!==i):o=a,i=$n(i)}return t.set(e,r),r}function vg(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Si(t)?[]:bg(t,this._c):[].concat(n),r],a=Dl(t,i[0],o);let c=a.top,u=a.right,f=a.bottom,h=a.left;for(let g=1;g<i.length;g++){const A=Dl(t,i[g],o);c=nn(A.top,c),u=Xn(A.right,u),f=Xn(A.bottom,f),h=nn(A.left,h)}return{width:u-h,height:f-c,x:h,y:c}}function yg(e){const{width:t,height:n}=Xu(e);return{width:t,height:n}}function Cg(e,t,n){const r=Xe(t),o=yn(t),s=n==="fixed",i=jn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=rn(0);if((r||!s)&&((wt(t)!=="body"||Ri(o))&&(a=Wo(t)),r)){const g=jn(t,!0,s,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}!r&&o&&(c.x=qo(o));const u=o&&!r&&!s?ed(o,a):rn(0),f=i.left+a.scrollLeft-c.x-u.x,h=i.top+a.scrollTop-c.y-u.y;return{x:f,y:h,width:i.width,height:i.height}}function Ss(e){return _t(e).position==="static"}function Fl(e,t){if(!Xe(e)||_t(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return yn(e)===n&&(n=n.ownerDocument.body),n}function td(e,t){const n=rt(e);if(Si(e))return n;if(!Xe(e)){let o=$n(e);for(;o&&!Dn(o);){if(Pe(o)&&!Ss(o))return o;o=$n(o)}return n}let r=Fl(e,t);for(;r&&_p(r)&&Ss(r);)r=Fl(r,t);return r&&Dn(r)&&Ss(r)&&!uu(r)?n:r||Op(e)||n}const Ig=async function(e){const t=this.getOffsetParent||td,n=this.getDimensions,r=await n(e.floating);return{reference:Cg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function wg(e){return _t(e).direction==="rtl"}const nd={convertOffsetParentRelativeRectToViewportRelativeRect:pg,getDocumentElement:yn,getClippingRect:vg,getOffsetParent:td,getElementRects:Ig,getClientRects:hg,getDimensions:yg,getScale:Un,isElement:Pe,isRTL:wg};function rd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function kg(e,t,n){let r=null,o;const s=yn(e);function i(){var f;clearTimeout(o),(f=r)==null||f.disconnect(),r=null}function a(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),i();const g=e.getBoundingClientRect(),{left:A,top:p,width:m,height:x}=g;if(f||t(),!m||!x)return;const v=Zr(p),b=Zr(s.clientWidth-(A+m)),y=Zr(s.clientHeight-(p+x)),C=Zr(A),I={rootMargin:-v+"px "+-b+"px "+-y+"px "+-C+"px",threshold:nn(0,Xn(1,h))||1};let S=!0;function R(E){const k=E[0].intersectionRatio;if(!rd(g,e.getBoundingClientRect()))return a();if(k!==h){if(!S)return a();k?a(!1,k):o=setTimeout(()=>{a(!1,1e-7)},1e3)}S=!1}try{r=new IntersectionObserver(R,{...I,root:s.ownerDocument})}catch{r=new IntersectionObserver(R,I)}r.observe(e)}const c=rt(e),u=()=>a(n);return c.addEventListener("resize",u),a(!0),()=>{c.removeEventListener("resize",u),i()}}function Bl(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=ia(e),f=o||s?[...u?Zs(u):[],...t?Zs(t):[]]:[];f.forEach(v=>{o&&v.addEventListener("scroll",n),s&&v.addEventListener("resize",n)});const h=u&&a?kg(u,n,s):null;let g=-1,A=null;i&&(A=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&A&&t&&(A.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var y;(y=A)==null||y.observe(t)})),n()}),u&&!c&&A.observe(u),t&&A.observe(t));let p,m=c?jn(e):null;c&&x();function x(){const v=jn(e);m&&!rd(m,v)&&n(),m=v,p=requestAnimationFrame(x)}return n(),()=>{var v;f.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),h?.(),(v=A)==null||v.disconnect(),A=null,c&&cancelAnimationFrame(p)}}const Eg=ag,Sg=lg,Rg=sg,Dg=ug,Fg=cg,Bg=(e,t,n)=>{const r=new Map,o=n??{},s={...nd,...o.platform,_c:r};return og(e,t,{...o,platform:s})};var jg=typeof document<"u",Mg=function(){},mo=jg?d.useLayoutEffect:Mg;function Eo(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(!Eo(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)&&!Eo(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function od(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jl(e,t){const n=od(e);return Math.round(t*n)/n}function Rs(e){const t=d.useRef(e);return mo(()=>{t.current=e}),t}function Pg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[f,h]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,A]=d.useState(r);Eo(g,r)||A(r);const[p,m]=d.useState(null),[x,v]=d.useState(null),b=d.useCallback(j=>{j!==I.current&&(I.current=j,m(j))},[]),y=d.useCallback(j=>{j!==S.current&&(S.current=j,v(j))},[]),C=s||p,w=i||x,I=d.useRef(null),S=d.useRef(null),R=d.useRef(f),E=c!=null,k=Rs(c),F=Rs(o),T=Rs(u),N=d.useCallback(()=>{if(!I.current||!S.current)return;const j={placement:t,strategy:n,middleware:g};F.current&&(j.platform=F.current),Bg(I.current,S.current,j).then(H=>{const P={...H,isPositioned:T.current!==!1};M.current&&!Eo(R.current,P)&&(R.current=P,sn.flushSync(()=>{h(P)}))})},[g,t,n,F,T]);mo(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,h(j=>({...j,isPositioned:!1})))},[u]);const M=d.useRef(!1);mo(()=>(M.current=!0,()=>{M.current=!1}),[]),mo(()=>{if(C&&(I.current=C),w&&(S.current=w),C&&w){if(k.current)return k.current(C,w,N);N()}},[C,w,N,k,E]);const D=d.useMemo(()=>({reference:I,floating:S,setReference:b,setFloating:y}),[b,y]),L=d.useMemo(()=>({reference:C,floating:w}),[C,w]),_=d.useMemo(()=>{const j={position:n,left:0,top:0};if(!L.floating)return j;const H=jl(L.floating,f.x),P=jl(L.floating,f.y);return a?{...j,transform:"translate("+H+"px, "+P+"px)",...od(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:P}},[n,a,L.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:N,refs:D,elements:L,floatingStyles:_}),[f,N,D,L,_])}const Tg=(e,t)=>{const n=Eg(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ng=(e,t)=>{const n=Sg(e);return{name:n.name,fn:n.fn,options:[e,t]}},_g=(e,t)=>({fn:Fg(e).fn,options:[e,t]}),Og=(e,t)=>{const n=Rg(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hg=(e,t)=>{const n=Dg(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Ds={exports:{}},Fs={};var Ml;function Lg(){if(Ml)return Fs;Ml=1;var e=lu(),t=Pu();function n(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,c=e.useDebugValue;return Fs.useSyncExternalStoreWithSelector=function(u,f,h,g,A){var p=s(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=a(function(){function v(I){if(!b){if(b=!0,y=I,I=g(I),A!==void 0&&m.hasValue){var S=m.value;if(A(S,I))return C=S}return C=I}if(S=C,r(y,I))return S;var R=g(I);return A!==void 0&&A(S,R)?(y=I,S):(y=I,C=R)}var b=!1,y,C,w=h===void 0?null:h;return[function(){return v(f())},w===null?void 0:function(){return v(w())}]},[f,h,g,A]);var x=o(u,p[0],p[1]);return i(function(){m.hasValue=!0,m.value=x},[x]),c(x),x},Fs}var Pl;function Kg(){return Pl||(Pl=1,Ds.exports=Lg()),Ds.exports}var Wg=Kg();const ii=[];let ai;function Qg(){return ai}function Gg(e){ii.push(e)}function aa(e){const t=(n,r)=>{const o=Dt(Yg).current;let s;try{ai=o;for(const i of ii)i.before(o);s=e(n,r);for(const i of ii)i.after(o);o.didInitialize=!0}finally{ai=void 0}return s};return t.displayName=e.displayName||e.name,t}function sd(e){return d.forwardRef(aa(e))}function Yg(){return{didInitialize:!1}}const zg=cu(19),Ug=zg?Zg:Jg;function we(e,t,n,r,o){return Ug(e,t,n,r,o)}function Vg(e,t,n,r,o){const s=d.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return Jo.useSyncExternalStore(e.subscribe,s,s)}Gg({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],o=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,o)||(t=!0,r.value=o)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const o of e.syncHooks)n.add(o.store);const r=[];for(const o of n)r.push(o.subscribe(t));return()=>{for(const o of r)o()}}),Jo.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Zg(e,t,n,r,o){const s=Qg();if(!s)return Vg(e,t,n,r,o);const i=s.syncIndex;s.syncIndex+=1;let a;return s.didInitialize?(a=s.syncHooks[i],(a.store!==e||a.selector!==t||!Object.is(a.a1,n)||!Object.is(a.a2,r)||!Object.is(a.a3,o))&&(a.store!==e&&(s.didChangeStore=!0),a.store=e,a.selector=t,a.a1=n,a.a2=r,a.a3=o,a.value=t(e.getSnapshot(),n,r,o))):(a={store:e,selector:t,a1:n,a2:r,a3:o,value:t(e.getSnapshot(),n,r,o)},s.syncHooks.push(a)),a.value}function Jg(e,t,n,r,o){return Wg.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class $g{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,o){return we(this,t,n,r,o)}}class Gr extends $g{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){d.useDebugValue(t);const r=this;ie(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;ie(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);ie(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){d.useDebugValue(t);const r=this,o=n!==void 0;ie(()=>{o&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,o])}select(t,n,r,o){const s=this.selectors[t];return s(this.state,n,r,o)}useState(t,n,r,o){return d.useDebugValue(t),we(this,this.selectors[t],n,r,o)}useContextCallback(t,n){d.useDebugValue(t);const r=de(n??Er);this.context[t]=r}useStateSetter(t){const n=d.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return n(o,o,this),this.subscribe(s=>{const i=r(s);if(!Object.is(o,i)){const a=o;o=i,n(i,a,this)}})}}const Xg={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class es extends Gr{constructor(t){const{syncOnly:n,nested:r,onOpenChange:o,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:zu(),nested:r,triggerElements:s},Xg),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&tA(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function id(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:o,nested:s,onOpenChange:i}=e,a=t.useState("open"),c=t.useState("activeTriggerElement"),u=t.useState(n?"popupElement":"positionerElement"),f=t.context.triggerElements,h=i,g=d.useRef(null);r===void 0&&g.current===null&&(g.current=new es({open:a,transitionStatus:void 0,referenceElement:c,floatingElement:u,triggerElements:f,onOpenChange:h,floatingId:o,syncOnly:!0,nested:s}));const A=r??g.current;return t.useSyncedValue("floatingId",o),ie(()=>{const p={open:a,floatingId:o,referenceElement:c,floatingElement:u};Pe(c)&&(p.domReferenceElement=c),A.state.positionReference===A.state.referenceElement&&(p.positionReference=c),A.update(p)},[a,o,c,u,A]),A.context.onOpenChange=h,A.context.nested=s,A}const ts={tabIndex:-1,[qs]:""};function qg(e){return t=>t==="touch"?e.current:!0}function ad(e,t=!1){const n=Jn(),r=In()!=null,o=Dt(()=>e(n,r)).current;return id({popupStore:o,treatPopupAsFloatingElement:t,floatingRootContext:o.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:o.setOpen}),o}function la({handle:e,store:t}){return ie(()=>e.attachStore(t),[e,t]),null}function em(e,t){const n=d.useRef(null),r=d.useRef(null);return d.useCallback(o=>{if(e===void 0)return;let s=!1;if(n.current!==null){const i=n.current,a=r.current,c=t.context.triggerElements.getById(i);a&&c===a&&(t.context.triggerElements.delete(i),s=!0),n.current=null,r.current=null}if(o!==null&&(n.current=e,r.current=o,t.context.triggerElements.add(e,o),s=!0),s){const i=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==i&&t.set("triggerCount",i)}},[t,e])}function ca(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const o=n?.id??null;(o||t)&&(e.activeTriggerId=o,e.activeTriggerElement=n??null)}function ld(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function tm(e,t,n,r={}){const o=n.reason,s=o===at,i=t&&o===Yn,a=!t&&(o===Pn||o===Ko),c=ld(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const u=()=>{const f={...r.extraState,open:t};i?f.instantType="focus":a?f.instantType="dismiss":s&&(f.instantType=void 0),ca(f,t,n.trigger,c()),e.update(f)};s?sn.flushSync(u):u()}function cd(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=em(e,n),i=de(c=>{const u=n.select("open"),f=n.select("activeTriggerId");if(f===e){n.update({activeTriggerElement:c,...u?r:null});return}f==null&&u&&n.update({activeTriggerId:e,activeTriggerElement:c,...r})}),a=d.useCallback(c=>{s(c),c&&i(c)},[s,i]);return ie(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:a,isMountedByThisTrigger:o}}function ua(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=d.useRef(null),o=e.useState("open"),s=e.useState("triggerCount"),i=e.useState("activeTriggerId"),a=e.useState("activeTriggerElement");ie(()=>{if(!o){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const c=e.context.triggerElements.size,u={};e.state.triggerCount!==c&&(u.triggerCount=c);const f=e.select("activeTriggerId");let h=null;if(f){const g=e.context.triggerElements.getById(f);if(g)r.current=f,g!==e.state.activeTriggerElement&&(u.activeTriggerElement=g);else{for(const[A,p]of e.context.triggerElements.entries())if(p===e.state.activeTriggerElement){u.activeTriggerId=A,u.activeTriggerElement=p,r.current=A;break}u.activeTriggerId===void 0&&(r.current===f?h=f:r.current=null)}}else r.current=null;if(!h&&!f&&c===1){const g=e.context.triggerElements.entries().next();if(!g.done){const[A,p]=g.value;u.activeTriggerId=A,u.activeTriggerElement=p,r.current=A}}(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)&&e.update(u),h&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===h&&!e.context.triggerElements.getById(h)){const g=Ce(Mt);e.setOpen(!1,g),g.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[o,e,s,i,a,n])}function da(e,t,n){const{mounted:r,setMounted:o,transitionStatus:s}=sr(e),i=t.useState("preventUnmountingOnClose"),a=e?!1:i;t.useSyncedValues({mounted:r,transitionStatus:s,preventUnmountingOnClose:a});const c=de(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Yt({enabled:r&&!e&&!a,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:s}}function fa(e,t){e.useSyncedValues(t),ie(()=>()=>{e.update({activeTriggerProps:ct,inactiveTriggerProps:ct,popupProps:ct})},[e])}function nm(e,t){ie(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),ie(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Yr{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function rm(){return new es({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Yr,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function pa(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:rm(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:ct,inactiveTriggerProps:ct,popupProps:ct}}function ud(e,t,n=!1){return new es({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const wr=e=>e.triggerIdProp??e.activeTriggerId,ha=e=>e.openProp??e.open,Tl=e=>(e.popupElement?.id??e.floatingId)||void 0;function dd(e,t){return t!==void 0&&ha(e)&&wr(e)===t}function om(e,t){return dd(e,t)?!0:t!==void 0&&ha(e)&&wr(e)==null&&e.triggerCount===1}const Aa={open:ha,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:wr,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Tl,isTriggerActive:(e,t)=>t!==void 0&&wr(e)===t,isOpenedByTrigger:(e,t)=>dd(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&wr(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>om(e,t)?Tl(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function fd(e){const t=d.useCallback(r=>e===void 0?Er:e.subscribeStore(r),[e]),n=d.useCallback(()=>e===void 0?void 0:e.store,[e]);return Jo.useSyncExternalStore(t,n,()=>e?.serverStore)}function sm(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,o=Jn(),s=In()!=null,i=Dt(()=>new es({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Yr,floatingId:o,syncOnly:!1,nested:s})).current;return ie(()=>{const a={open:t,floatingId:o};r.reference!==void 0&&(a.referenceElement=r.reference,a.domReferenceElement=Pe(r.reference)?r.reference:null),r.floating!==void 0&&(a.floatingElement=r.floating),i.update(a)},[t,o,r.reference,r.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i}function im(e){return am(e,e.rootContext)}function am(e,t){const{nodeId:n,externalTree:r}=e,o=t.useState("referenceElement"),s=t.useState("floatingElement"),i=t.useState("domReferenceElement"),a=t.useState("open"),c=t.useState("floatingId"),[u,f]=d.useState(null),[h,g]=d.useState(void 0),[A,p]=d.useState(void 0),m=d.useRef(null),x=wn(r),v=d.useMemo(()=>({reference:o,floating:s,domReference:i}),[o,s,i]),b=Pg({...e,elements:{...v,...u&&{reference:u}}}),y=Pe(h)?h:null,C=A===void 0?t.state.floatingElement:A;t.useSyncedValue("referenceElement",h??null),t.useSyncedValue("domReferenceElement",h===void 0?i:y),t.useSyncedValue("floatingElement",C);const w=d.useCallback(F=>{const T=Pe(F)?{getBoundingClientRect:()=>F.getBoundingClientRect(),getClientRects:()=>F.getClientRects(),contextElement:F}:F;f(T),b.refs.setReference(T)},[b.refs]),I=d.useCallback(F=>{(Pe(F)||F===null)&&(m.current=F,g(F)),(Pe(b.refs.reference.current)||b.refs.reference.current===null||F!==null&&!Pe(F))&&b.refs.setReference(F)},[b.refs,g]),S=d.useCallback(F=>{p(F),b.refs.setFloating(F)},[b.refs]),R=d.useMemo(()=>({...b.refs,setReference:I,setFloating:S,setPositionReference:w,domReference:m}),[b.refs,I,S,w]),E=d.useMemo(()=>({...b.elements,domReference:i}),[b.elements,i]),k=d.useMemo(()=>({...b,dataRef:t.context.dataRef,open:a,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:R,elements:E,nodeId:n,rootStore:t}),[b,R,E,n,t,a,c]);return ie(()=>{i&&(m.current=i)},[i]),ie(()=>{t.context.dataRef.current.floatingContext=k;const F=x?.nodesRef.current.find(T=>T.id===n);F&&(F.context=k)}),d.useMemo(()=>({...b,context:k,refs:R,elements:E,rootStore:t}),[b,R,E,k,t])}const Bs=Li&&an;function pd(e,t={}){const{enabled:n=!0,delay:r}=t,o="rootStore"in e?e.rootStore:e,{events:s,dataRef:i}=o.context,a=d.useRef(!1),c=d.useRef(null),u=d.useRef(!0),f=pt();d.useEffect(()=>{const g=o.select("domReferenceElement");if(!n)return;const A=rt(g);function p(){const v=o.select("domReferenceElement");!o.select("open")&&Xe(v)&&v===vt(Be(v))&&(a.current=!0)}function m(){u.current=!0}function x(){u.current=!1}return Wt(De(A,"blur",p),Bs&&De(A,"keydown",m,!0),Bs&&De(A,"pointerdown",x,!0))},[o,n]),d.useEffect(()=>{if(!n)return;function g(A){if(A.reason===Pn||A.reason===Ko){const p=o.select("domReferenceElement");Pe(p)&&(c.current=p,a.current=!0)}}return s.on("openchange",g),()=>{s.off("openchange",g)}},[s,n,o]);const h=d.useMemo(()=>{function g(){a.current=!1,c.current=null}return{onMouseLeave(){g()},onFocus(A){const p=A.currentTarget;if(a.current){if(c.current===p)return;g()}const m=At(A.nativeEvent);if(Pe(m)){if(Bs&&!A.relatedTarget){if(!u.current&&!Vo(m))return}else if(!qh(m))return}const x=vo(A.relatedTarget,o.context.triggerElements),{nativeEvent:v,currentTarget:b}=A,y=typeof r=="function"?r():r;if(o.select("open")&&x||y===0||y===void 0){o.setOpen(!0,Ce(Yn,v,b));return}f.start(y,()=>{a.current||o.setOpen(!0,Ce(Yn,v,b))})},onBlur(A){g();const p=A.relatedTarget,m=A.nativeEvent,x=Pe(p)&&p.hasAttribute(Fr("focus-guard"))&&p.getAttribute("data-type")==="outside";f.start(0,()=>{const v=o.select("domReferenceElement"),b=vt(Be(v));!p&&b===v||ve(i.current.floatingContext?.refs.floating.current,b)||ve(v,b)||x||vo(p??b,o.context.triggerElements)||o.setOpen(!1,Ce(Yn,m))})}}},[i,r,o,f]);return d.useMemo(()=>n?{reference:h,trigger:h}:{},[n,h])}class ga{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Ot,this.restTimeout=new Ot,this.handleCloseOptions=void 0}static create(){return new ga}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const So=new WeakMap;function Ro(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&So.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),So.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function hd(e,t){const{scopeElement:n,referenceElement:r,floatingElement:o}=t,s=So.get(n);s&&s!==e&&Ro(s),Ro(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=o,So.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",o.style.pointerEvents="auto"}function ma(e){const t=e.context.dataRef.current,n=Dt(()=>t.hoverInteractionState??ga.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),Ji(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Ad(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:o}=t,s="rootStore"in e?e.rootStore:e,i=s.useState("open"),a=s.useState("floatingElement"),c=s.useState("domReferenceElement"),{dataRef:u}=s.context,f=wn(),h=In(),g=ma(s),A=pt(),p=de(()=>Ou(u.current.openEvent?.type,g.interactedInside)),m=de(()=>TA(u.current.openEvent?.type)),x=de(()=>{Ro(g)});ie(()=>{i||(g.pointerType=void 0,g.restTimeoutPending=!1,g.interactedInside=!1,x())},[i,g,x]),d.useEffect(()=>x,[x]),ie(()=>{if(n&&i&&g.handleCloseOptions?.blockPointerEvents&&m()&&Pe(c)&&a){const v=c,b=a,y=Be(a),C=f?.nodesRef.current.find(R=>R.id===h)?.context?.elements.floating;C&&(C.style.pointerEvents="");const w=g.pointerEventsScopeElement!==b?g.pointerEventsScopeElement:null,I=C!==b?C:null,S=g.handleCloseOptions?.getScope?.()??w??I??v.closest("[data-rootownerid]")??y.body;return hd(g,{scopeElement:S,referenceElement:v,floatingElement:b}),()=>{x()}}},[n,i,c,a,g,m,f,h,x]),d.useEffect(()=>{if(!n)return;function v(){return!!(f&&h&&xn(f.nodesRef.current,h).length>0)}function b(R){const E=er(r,"close",g.pointerType),k=()=>{s.setOpen(!1,Ce(at,R)),f?.events.emit("floating.closed",R)};E?g.openChangeTimeout.start(E,k):(g.openChangeTimeout.clear(),k())}function y(R){const E=At(R);if(!Xh(E)){g.interactedInside=!1;return}g.interactedInside=E?.closest("[aria-haspopup]")!=null}function C(){g.openChangeTimeout.clear(),A.clear(),f?.events.off("floating.closed",I),x()}function w(R){if(v()&&f){f.events.on("floating.closed",I);return}if(vo(R.relatedTarget,s.context.triggerElements))return;const E=u.current.floatingContext?.nodeId??o,k=R.relatedTarget;if(!(f&&E&&Pe(k)&&xn(f.nodesRef.current,E,!1).some(T=>ve(T.context?.elements.floating,k)))){if(g.handler){g.handler(R);return}x(),m()&&!p()&&b(R)}}function I(R){!f||!h||v()||A.start(0,()=>{f.events.off("floating.closed",I),s.setOpen(!1,Ce(at,R)),f.events.emit("floating.closed",R)})}const S=a;return Wt(S&&De(S,"mouseenter",C),S&&De(S,"mouseleave",w),S&&De(S,"pointerdown",y,!0),()=>{f?.events.off("floating.closed",I)})},[n,a,s,u,r,o,m,p,x,g,f,h,A])}const lm={current:null};function gd(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:o=null,mouseOnly:s=!1,restMs:i=0,move:a=!0,triggerElementRef:c=lm,externalTree:u,isActiveTrigger:f=!0,getHandleCloseContext:h,isClosing:g,shouldOpen:A,guardStaleOpen:p=!1}=t,m="rootStore"in e?e.rootStore:e,{dataRef:x,events:v}=m.context,b=wn(u),y=ma(m),C=d.useRef(!1),w=tt(o),I=tt(r),S=tt(i),R=tt(n),E=tt(A),k=tt(g),F=de(()=>Ou(x.current.openEvent?.type,y.interactedInside)),T=de(()=>E.current?.()!==!1),N=de((L,_,j)=>{const H=m.context.triggerElements;if(H.hasElement(_))return!L||!ve(L,_);if(!Pe(j))return!1;const P=j;return H.hasMatchingElement(B=>ve(B,P))&&(!L||!ve(L,P))}),M=de(()=>{if(!y.handler)return;Be(m.select("domReferenceElement")).removeEventListener("mousemove",y.handler),y.handler=void 0}),D=de(()=>{Ro(y)});return f&&(y.handleCloseOptions=w.current?.__options),d.useEffect(()=>M,[M]),d.useEffect(()=>{if(!n)return;function L(_){_.open?C.current=!1:(C.current=_.reason===at,M(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return v.on("openchange",L),()=>{v.off("openchange",L)}},[n,v,y,M]),d.useEffect(()=>{if(!n)return;function L(O,G=!0){const z=er(I.current,"close",y.pointerType);z?y.openChangeTimeout.start(z,()=>{m.setOpen(!1,Ce(at,O)),b?.events.emit("floating.closed",O)}):G&&(y.openChangeTimeout.clear(),m.setOpen(!1,Ce(at,O)),b?.events.emit("floating.closed",O))}const _=c.current??(f?m.select("domReferenceElement"):null);if(!Pe(_))return;function j(O){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,s&&!mn(y.pointerType))return;const G=ml(S.current),z=er(I.current,"open",y.pointerType),U=At(O),Q=O.currentTarget??null,Z=m.select("domReferenceElement");let K=Q;if(Pe(U)&&!m.context.triggerElements.hasElement(U)){for(const ae of m.context.triggerElements.elements())if(ve(ae,U)){K=ae;break}}Pe(Q)&&Pe(Z)&&!m.context.triggerElements.hasElement(Q)&&ve(Q,Z)&&(K=Z);const te=K==null?!1:N(Z,K,U),le=m.select("open"),X=k.current?.()??m.select("transitionStatus")==="ending",ee=!le&&X&&C.current,J=!te&&Pe(K)&&Pe(Z)&&ve(Z,K)&&ee,ce=G>0&&!z,ue=te&&(le||ee)||J,ge=!le||te;if(ue){T()&&m.setOpen(!0,Ce(at,O,K));return}ce||(z?y.openChangeTimeout.start(z,()=>{ge&&T()&&m.setOpen(!0,Ce(at,O,K))}):ge&&T()&&m.setOpen(!0,Ce(at,O,K)))}function H(O){if(F()){D();return}M();const G=m.select("domReferenceElement"),z=Be(G);y.restTimeout.clear(),y.restTimeoutPending=!1;const U=x.current.floatingContext??h?.();if(vo(O.relatedTarget,m.context.triggerElements))return;if(w.current&&U){m.select("open")||y.openChangeTimeout.clear();const Z=c.current;y.handler=w.current({...U,tree:b,x:O.clientX,y:O.clientY,onClose(){D(),M(),R.current&&!F()&&Z===m.select("domReferenceElement")&&L(O,!0)}}),z.addEventListener("mousemove",y.handler),y.handler(O);return}(y.pointerType!=="touch"||!ve(m.select("floatingElement"),O.relatedTarget))&&L(O)}function P(O){ve(_,O.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}const B=p?De(_,"mouseout",P):void 0;return a?Wt(De(_,"mousemove",j,{once:!0}),De(_,"mouseenter",j),De(_,"mouseleave",H),B):Wt(De(_,"mouseenter",j),De(_,"mouseleave",H),B)},[M,D,x,I,m,n,w,y,f,N,F,s,a,S,c,b,R,h,k,T,p]),d.useMemo(()=>{if(!n)return;function L(_){y.pointerType=_.pointerType}return{onPointerDown:L,onPointerEnter:L,onMouseMove(_){const{nativeEvent:j}=_,H=_.currentTarget,P=m.select("domReferenceElement"),B=m.select("open"),O=N(P,H,_.target);if(s&&!mn(y.pointerType))return;if(B&&O&&y.handleCloseOptions?.blockPointerEvents){const U=m.select("floatingElement");if(U){const Q=y.handleCloseOptions?.getScope?.()??H.ownerDocument.body;hd(y,{scopeElement:Q,referenceElement:H,floatingElement:U})}}const G=ml(S.current);if(B&&!O||G===0||!O&&y.restTimeoutPending&&_.movementX**2+_.movementY**2<2)return;y.restTimeout.clear();function z(){if(y.restTimeoutPending=!1,F())return;const U=m.select("open");!y.blockMouseMove&&(!U||O)&&T()&&m.setOpen(!0,Ce(at,j,H))}y.pointerType==="touch"?sn.flushSync(()=>{z()}):O&&B?z():(y.restTimeoutPending=!0,y.restTimeout.start(G,z))}}},[n,y,F,N,s,m,S,T])}const cm="Escape";function Nl(e){return an&&e.movementX===0&&e.movementY===0}function ns(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function qr(e,t){return ns(t,e===yu||e===Wi,e===zo||e===Uo)}function js(e,t,n){return ns(t,e===Wi,n?e===zo:e===Uo)||e==="Enter"||e===" "||e===""}function um(e,t,n){return ns(t,n?e===zo:e===Uo,e===Wi)}function dm(e,t,n,r){const o=n?e===Uo:e===zo,s=e===yu;return t==="both"||t==="horizontal"&&r?e===cm:ns(t,o,s)}function md(e,t){const{listRef:n,activeIndex:r,onNavigate:o=()=>{},enabled:s=!0,selectedIndex:i=null,allowEscape:a=!1,loopFocus:c=!1,nested:u=!1,rtl:f=!1,virtual:h=!1,focusItemOnOpen:g="auto",focusItemOnHover:A=!0,openOnArrowKeyDown:p=!0,disabledIndices:m=void 0,orientation:x="vertical",parentOrientation:v,id:b,resetOnPointerLeave:y=!0,externalTree:C,grid:w}=t,I=w!=null,S="rootStore"in e?e.rootStore:e,R=S.useState("open"),E=S.useState("floatingElement"),k=S.useState("domReferenceElement"),F=S.context.dataRef,T=yo(E),N=ei(k),M=tt(T),D=In(),L=wn(C),_=d.useRef(g),j=d.useRef(i??-1),H=d.useRef(null),P=d.useRef(!0),B=de(W=>{o(j.current===-1?null:j.current,W)}),O=d.useRef(!!E),G=d.useRef(R),z=d.useRef(!1),U=d.useRef(!1),Q=d.useRef(null),Z=tt(m),K=tt(R),te=tt(i),le=tt(y),X=qn(),ee=qn(),J=de(()=>{function W(ne){h?L?.events.emit("virtualfocus",ne):Q.current=go(ne,{sync:z.current,preventScroll:!0})}const Y=n.current[j.current],ye=U.current;Y&&W(Y),(z.current?ne=>ne():ne=>X.request(ne))(()=>{const ne=n.current[j.current]||Y;if(!ne)return;Y||W(ne),oe&&(ye||!P.current)&&ne.scrollIntoView?.({block:"nearest",inline:"nearest"})})});ie(()=>{F.current.orientation=x},[F,x]),ie(()=>{s&&(R&&E?(j.current=i??-1,_.current&&i!=null&&(U.current=!0,B())):O.current&&(j.current=-1,B()))},[s,R,E,i,B]),ie(()=>{if(s){if(!R){z.current=!1;return}if(E)if(r==null){if(z.current=!1,te.current!=null)return;if(O.current&&(j.current=-1,J()),(!G.current||!O.current)&&_.current&&(H.current!=null||_.current===!0&&H.current==null)){let W=0;const Y=()=>{n.current[0]==null?(W<2&&(W?q=>ee.request(q):queueMicrotask)(Y),W+=1):(j.current=H.current==null||js(H.current,x,f)||u?Ao(n):ni(n),H.current=null,B())};Y()}}else Ir(n.current,r)||(j.current=r,J(),U.current=!1)}},[s,R,E,r,te,u,n,x,f,B,J,ee]),ie(()=>{if(!s||E||!L||h||!O.current)return;const W=L.nodesRef.current,Y=W.find(ne=>ne.id===D)?.context?.elements.floating,ye=vt(Be(k??Y??null)),q=W.some(ne=>ne.context&&ve(ne.context.elements.floating,ye));Y&&!q&&P.current&&Y.focus({preventScroll:!0})},[s,E,k,L,D,h]),ie(()=>{G.current=R,O.current=!!E}),ie(()=>{R||(H.current=null,_.current=g)},[R,g]);const ce=r!=null,ue=de(W=>{if(!K.current)return;const Y=n.current.indexOf(W.currentTarget);Y!==-1&&(j.current!==Y||r!==Y)&&(j.current=Y,B(W))}),ge=de(()=>v??L?.nodesRef.current.find(W=>W.id===D)?.context?.dataRef?.current.orientation),ae=de(()=>Ao(n,Z.current)),pe=de(W=>{if(P.current=!1,z.current=!0,W.which===229||!K.current&&W.currentTarget===M.current)return;if(u&&dm(W.key,x,f,I)){qr(W.key,ge())||Ht(W),S.setOpen(!1,Ce(Js,W.nativeEvent)),Xe(k)&&(h?L?.events.emit("virtualfocus",k):k.focus());return}const Y=j.current,ye=Ao(n,m),q=ni(n,m);if(N||(W.key==="Home"&&(Ht(W),j.current=ye,B(W)),W.key==="End"&&(Ht(W),j.current=q,B(W))),w!=null){const ne=w(W,j.current,n,x,c,f,m,ye,q);if(ne!=null&&(j.current=ne,B(W)),x==="both")return}if(qr(W.key,x)){if(Ht(W),R&&!h&&vt(W.currentTarget.ownerDocument)===W.currentTarget){j.current=js(W.key,x,f)?ye:q,B(W);return}js(W.key,x,f)?c?Y>=q?a&&Y!==n.current.length?j.current=-1:(z.current=!1,j.current=ye):j.current=tn(n.current,{startingIndex:Y,disabledIndices:m}):j.current=Math.min(q,tn(n.current,{startingIndex:Y,disabledIndices:m})):c?Y<=ye?a&&Y!==-1?j.current=n.current.length:(z.current=!1,j.current=q):j.current=tn(n.current,{startingIndex:Y,decrement:!0,disabledIndices:m}):j.current=Math.max(ye,tn(n.current,{startingIndex:Y,decrement:!0,disabledIndices:m})),Ir(n.current,j.current)&&(j.current=-1),B(W)}}),oe=d.useMemo(()=>({onFocus(Y){z.current=!0,ue(Y)},onClick:({currentTarget:Y})=>Y.focus({preventScroll:!0}),onMouseMove(Y){Nl(Y)||(z.current=!0,U.current=!1,A&&ue(Y))},onPointerLeave(Y){if(!K.current||!P.current||Y.pointerType==="touch")return;z.current=!0;const ye=Y.relatedTarget;if(!(!A||n.current.includes(ye))&&le.current&&(Q.current?.(),Q.current=null,j.current=-1,B(Y),!h)){const q=M.current,ne=vt(Be(q));q&&ve(q,ne)&&q.focus({preventScroll:!0})}}}),[ue,K,M,A,n,B,le,h]),re=d.useMemo(()=>h&&R&&ce&&{"aria-activedescendant":`${b}-${r}`},[h,R,ce,b,r]),se=d.useMemo(()=>({"aria-orientation":x==="both"?void 0:x,...N?{}:re,onKeyDown(W){if(W.key==="Tab"&&W.shiftKey&&R&&!h){const Y=At(W.nativeEvent);if(Y&&!ve(M.current,Y))return;Ht(W),S.setOpen(!1,Ce(Bn,W.nativeEvent)),Xe(k)&&k.focus();return}pe(W)},onPointerMove(W){Nl(W)||(P.current=!0)}}),[re,pe,M,x,N,S,R,h,k]),he=d.useMemo(()=>{function W(q){S.setOpen(!0,Ce(Js,q.nativeEvent,q.currentTarget))}function Y(q){g==="auto"&&Qi(q.nativeEvent)&&(_.current=!h)}function ye(q){_.current=g,g==="auto"&&Gi(q.nativeEvent)&&(_.current=!0)}return{onKeyDown(q){const ne=S.select("open");P.current=!1;const Ee=q.key.startsWith("Arrow"),Se=um(q.key,ge(),f),Le=qr(q.key,x),Je=(u?Se:Le)||q.key==="Enter"||q.key.trim()==="";if(h&&ne)return pe(q);if(!(!ne&&!p&&Ee)){if(Je){const We=qr(q.key,ge());H.current=u&&We?null:q.key}if(u){Se&&(Ht(q),ne?(j.current=ae(),B(q)):W(q));return}Le&&(te.current!=null&&(j.current=te.current),Ht(q),!ne&&p?W(q):pe(q),ne&&B(q))}},onFocus(q){S.select("open")&&!h&&(j.current=-1,B(q))},onPointerDown:ye,onPointerEnter:ye,onMouseDown:Y,onClick:Y}},[pe,g,ae,u,B,S,p,x,ge,f,te,h]),me=d.useMemo(()=>({...re,...he}),[re,he]);return d.useMemo(()=>s?{reference:me,floating:se,item:oe,trigger:he}:{},[s,me,se,he,oe])}function xd(e,t){const{listRef:n,elementsRef:r,activeIndex:o,onMatch:s,disabledIndices:i,onTyping:a,enabled:c=!0,resetMs:u=750,selectedIndex:f=null}=t,h="rootStore"in e?e.rootStore:e,g=h.useState("open"),A=pt(),p=d.useRef(""),m=d.useRef(f??o??-1),x=d.useRef(null),v=de(C=>{function w(M){return r?.current[M]}function I(M){const D=w(M);return D&&!Zo(D)||D?.matches(":disabled")?!1:i==null||!wo(Nt,M,i)}function S(M,D,L=0){if(M.length===0)return-1;const _=(L%M.length+M.length)%M.length,j=D.toLowerCase();for(let H=0;H<M.length;H+=1){const P=(_+H)%M.length;if(!(!M[P]?.toLowerCase().startsWith(j)||!I(P)))return P}return-1}const R=n.current;if(p.current.length>0&&C.key===" "&&(Ht(C),a?.(!0)),p.current.length>0&&p.current[0]!==" "&&S(R,p.current)===-1&&C.key!==" "&&a?.(!1),R==null||C.key.length!==1||C.ctrlKey||C.metaKey||C.altKey)return;g&&C.key!==" "&&(Ht(C),a?.(!0));const E=p.current==="";E&&(m.current=f??o??-1),R.every((M,D)=>M&&I(D)?M[0]?.toLowerCase()!==M[1]?.toLowerCase():!0)&&p.current===C.key&&(p.current="",m.current=x.current),p.current+=C.key,A.start(u,()=>{p.current="",m.current=x.current,a?.(!1)});const T=((E?f??o??-1:m.current)??0)+1,N=S(R,p.current,T);N!==-1?(s?.(N),x.current=N):C.key!==" "&&(p.current="",a?.(!1))}),b=de(C=>{const w=C.relatedTarget,I=h.select("domReferenceElement"),S=h.select("floatingElement");ve(I,w)||ve(S,w)||(A.clear(),p.current="",m.current=x.current,a?.(!1))});ie(()=>{!g&&f!==null||(A.clear(),x.current=null,p.current!==""&&(p.current=""))},[g,f,A]);const y=d.useMemo(()=>({onKeyDown:v,onBlur:b}),[v,b]);return d.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}const _l=.1,fm=_l*_l,Qe=.5;function eo(e,t,n,r,o,s){return r>=t!=s>=t&&e<=(o-n)*(t-r)/(s-r)+n}function to(e,t,n,r,o,s,i,a,c,u){let f=!1;return eo(e,t,n,r,o,s)&&(f=!f),eo(e,t,o,s,i,a)&&(f=!f),eo(e,t,i,a,c,u)&&(f=!f),eo(e,t,c,u,n,r)&&(f=!f),f}function pm(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function no(e,t,n,r,o,s){const i=Math.min(n,o),a=Math.max(n,o),c=Math.min(r,s),u=Math.max(r,s);return e>=i&&e<=a&&t>=c&&t<=u}function bd(e={}){const{blockPointerEvents:t=!1}=e,n=new Ot,r=({x:o,y:s,placement:i,elements:a,onClose:c,nodeId:u,tree:f})=>{const h=i?.split("-")[0];let g=!1,A=null,p=null,m=typeof performance<"u"?performance.now():0;function x(b,y){const C=performance.now(),w=C-m;if(A===null||p===null||w===0)return A=b,p=y,m=C,!1;const I=b-A,S=y-p,R=I*I+S*S,E=w*w*fm;return A=b,p=y,m=C,R<E}function v(){n.clear(),c()}return function(y){n.clear();const C=a.domReference,w=a.floating;if(!C||!w||h==null||o==null||s==null)return;const{clientX:I,clientY:S}=y,R=At(y),E=y.type==="mouseleave",k=ve(w,R),F=ve(C,R);if(k&&(g=!0,!E))return;if(F&&(g=!1,!E)){g=!0;return}if(E&&Pe(y.relatedTarget)&&ve(w,y.relatedTarget))return;function T(){return!!(f&&xn(f.nodesRef.current,u).length>0)}function N(){T()||v()}if(T())return;const M=C.getBoundingClientRect(),D=w.getBoundingClientRect(),L=o>D.right-D.width/2,_=s>D.bottom-D.height/2,j=D.width>M.width,H=D.height>M.height,P=(j?M:D).left,B=(j?M:D).right,O=(H?M:D).top,G=(H?M:D).bottom;if(h==="top"&&s>=M.bottom-1||h==="bottom"&&s<=M.top+1||h==="left"&&o>=M.right-1||h==="right"&&o<=M.left+1){N();return}let z=!1;switch(h){case"top":z=no(I,S,P,M.top+1,B,D.bottom-1);break;case"bottom":z=no(I,S,P,D.top+1,B,M.bottom-1);break;case"left":z=no(I,S,D.right-1,G,M.left+1,O);break;case"right":z=no(I,S,M.right-1,G,D.left+1,O);break}if(z)return;if(g&&!pm(I,S,M)){N();return}if(!E&&x(I,S)){N();return}let U=!1;switch(h){case"top":{const Q=j?Qe/2:Qe*4,Z=j||L?o+Q:o-Q,K=j?o-Q:L?o+Q:o-Q,te=s+Qe+1,le=L||j?D.bottom-Qe:D.top,X=L?j?D.bottom-Qe:D.top:D.bottom-Qe;U=to(I,S,Z,te,K,te,D.left,le,D.right,X);break}case"bottom":{const Q=j?Qe/2:Qe*4,Z=j||L?o+Q:o-Q,K=j?o-Q:L?o+Q:o-Q,te=s-Qe,le=L||j?D.top+Qe:D.bottom,X=L?j?D.top+Qe:D.bottom:D.top+Qe;U=to(I,S,Z,te,K,te,D.left,le,D.right,X);break}case"left":{const Q=H?Qe/2:Qe*4,Z=H||_?s+Q:s-Q,K=H?s-Q:_?s+Q:s-Q,te=o+Qe+1,le=_||H?D.right-Qe:D.left,X=_?H?D.right-Qe:D.left:D.right-Qe;U=to(I,S,le,D.top,X,D.bottom,te,Z,te,K);break}case"right":{const Q=H?Qe/2:Qe*4,Z=H||_?s+Q:s-Q,K=H?s-Q:_?s+Q:s-Q,te=o-Qe,le=_||H?D.left+Qe:D.right,X=_?H?D.left+Qe:D.right:D.left+Qe;U=to(I,S,te,Z,te,K,le,D.top,X,D.bottom);break}}U?g||n.start(40,N):N()}};return r.__options={...e,blockPointerEvents:t},r}const vd=d.createContext(void 0);function hm(){const e=d.useContext(vd);if(e===void 0)throw new Error(ot(26));return e}const li="ArrowUp",ci="ArrowDown",ui="ArrowLeft",di="ArrowRight",fi="Home",pi="End",rs=new Set([li,ci,ui,di,fi,pi]),Am="Shift",gm=[Am,"Control","Alt","Meta"];function mm(e){return Xe(e)&&e.tagName==="INPUT"}function Ol(e){return!!(mm(e)&&e.selectionStart!=null||Xe(e)&&e.tagName==="TEXTAREA")}function Hl(e,t,n,r){if(!e||!t||!t.scrollTo)return;let o=e.scrollLeft,s=e.scrollTop;const i=e.clientWidth<e.scrollWidth,a=e.clientHeight<e.scrollHeight;if(i&&r!=="vertical"){const c=Ll(e,t,"left"),u=ro(e),f=ro(t);n==="ltr"&&(c+t.offsetWidth+f.scrollMarginRight>e.scrollLeft+e.clientWidth-u.scrollPaddingRight?o=c+t.offsetWidth+f.scrollMarginRight-e.clientWidth+u.scrollPaddingRight:c-f.scrollMarginLeft<e.scrollLeft+u.scrollPaddingLeft&&(o=c-f.scrollMarginLeft-u.scrollPaddingLeft)),n==="rtl"&&(c-f.scrollMarginLeft<e.scrollLeft+u.scrollPaddingLeft?o=c-f.scrollMarginLeft-u.scrollPaddingLeft:c+t.offsetWidth+f.scrollMarginRight>e.scrollLeft+e.clientWidth-u.scrollPaddingRight&&(o=c+t.offsetWidth+f.scrollMarginRight-e.clientWidth+u.scrollPaddingRight))}if(a&&r!=="horizontal"){const c=Ll(e,t,"top"),u=ro(e),f=ro(t);c-f.scrollMarginTop<e.scrollTop+u.scrollPaddingTop?s=c-f.scrollMarginTop-u.scrollPaddingTop:c+t.offsetHeight+f.scrollMarginBottom>e.scrollTop+e.clientHeight-u.scrollPaddingBottom&&(s=c+t.offsetHeight+f.scrollMarginBottom-e.clientHeight+u.scrollPaddingBottom)}e.scrollTo({left:o,top:s,behavior:"auto"})}function Ll(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);)t=t.offsetParent;return o}function ro(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const xm={...Wr,...Nn,nestedDialogOpen(e){return e?{"data-nested-dialog-open":""}:null}},xa=d.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:i,initialFocus:a,...c}=t,u=_n(),f=u.useState("descriptionElementId"),h=u.useState("disablePointerDismissal"),g=u.useState("floatingRootContext"),A=u.useState("popupProps"),p=u.useState("modal"),m=u.useState("mounted"),x=u.useState("nested"),v=u.useState("nestedOpenDialogCount"),b=u.useState("open"),y=u.useState("openMethod"),C=u.useState("titleElementId"),w=u.useState("transitionStatus"),I=u.useState("role"),S=g.useState("floatingId");hm(),Yt({open:b,ref:u.context.popupRef,onComplete(){b&&u.context.onOpenChangeComplete?.(!0)}});const R=a===void 0?qg(u.context.popupRef):a,E=v>0,k=u.useStateSetter("popupElement"),T=je("div",t,{state:{open:b,nested:x,transitionStatus:w,nestedDialogOpen:E},props:[A,{id:S,"aria-labelledby":C,"aria-describedby":f,role:I,...ts,hidden:!m,onKeyDown(N){rs.has(N.key)&&N.stopPropagation()},style:{"--nested-dialogs":v}},c],ref:[n,u.context.popupRef,k],stateAttributesMapping:xm});return l.jsx(sa,{context:g,openInteractionType:y,disabled:!m,closeOnFocusOut:!h,initialFocus:R,returnFocus:i,modal:p!==!1,restoreFocus:"popup",children:T})});function ba(e){return cu(19)?e:e?"true":void 0}const va=d.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const i=r.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return l.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})}),ya=d.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,s=_n(),i=s.useState("mounted"),a=s.useState("modal"),c=s.useState("open");return i||r?l.jsx(vd.Provider,{value:r,children:l.jsxs(na,{ref:n,...o,children:[i&&a===!0&&l.jsx(va,{ref:s.context.internalBackdropRef,inert:ba(!c)}),t.children]})}):null});let Kl={},Wl={},Ql="";function os(e,t){return Ri(e)?e:t}function Gl(e,t,n){return/hidden|clip/.test(e.getComputedStyle(os(t,n)).overflowY)}function bm(e){if(typeof document>"u")return!1;const t=Be(e);return rt(t).innerWidth-t.documentElement.clientWidth>0}function vm(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Be(e),r=n.documentElement,o=n.body,s=os(r,o),i=s.style.overflowY,a=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const c=s.offsetWidth;s.style.overflowY="hidden";const u=s.offsetWidth;return s.style.overflowY=i,r.style.scrollbarGutter=a,c===u}function ym(e){const t=Be(e),n=t.documentElement,r=t.body,o=os(n,r),s={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,s)}}function Cm(e){const t=Be(e),n=t.documentElement,r=t.body,o=rt(n);let s=0,i=0,a=!1;const c=Ct.create();if(an&&(o.visualViewport?.scale??1)!==1)return()=>{};function u(){const A=o.getComputedStyle(n),p=o.getComputedStyle(r),v=(A.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,Kl={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Ql=n.style.scrollBehavior,Wl={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const b=n.scrollHeight>n.clientHeight,y=n.scrollWidth>n.clientWidth,C=A.overflowY==="scroll"||p.overflowY==="scroll",w=A.overflowX==="scroll"||p.overflowX==="scroll",I=Math.max(0,o.innerWidth-r.clientWidth),S=Math.max(0,o.innerHeight-r.clientHeight),R=parseFloat(p.marginTop)+parseFloat(p.marginBottom),E=parseFloat(p.marginLeft)+parseFloat(p.marginRight),k=os(n,r);if(a=vm(e),a){n.style.scrollbarGutter=v,k.style.overflowY="hidden",k.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:v,overflowY:"hidden",overflowX:"hidden"}),(b||C)&&(n.style.overflowY="scroll"),(y||w)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:R||S?`calc(100dvh - ${R+S}px)`:"100dvh",width:E||I?`calc(100vw - ${E+I}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function f(){Object.assign(n.style,Kl),Object.assign(r.style,Wl),a||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Ql)}function h(){f(),c.request(u)}u();const g=De(o,"resize",h);return()=>{c.cancel(),f(),typeof o.removeEventListener=="function"&&g()}}class Im{lockCount=0;restore=null;timeoutLock=Ot.create();timeoutUnlock=Ot.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const n=Be(t),r=n.documentElement,o=n.body,s=rt(r);if(Gl(s,r,o)){const a=new s.MutationObserver(()=>{Gl(s,r,o)||(a.disconnect(),this.restore=null,this.lock(t))}),c={attributes:!0};a.observe(r,c),a.observe(o,c),this.restore=()=>a.disconnect();return}const i=Yo||!bm(t);this.restore=i?ym(t):Cm(t)}}const wm=new Im;function yd(e=!0,t=null){ie(()=>{if(e)return wm.acquire(t)},[e,t])}function km({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),o=e.useState("disablePointerDismissal"),s=e.useState("modal"),i=e.useState("popupElement"),a=e.useState("floatingRootContext"),[c,u]=d.useState(0),[f,h]=d.useState(0),g=c===0,A=Xo(a,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(p){if(!e.context.outsidePressEnabledRef.current||"button"in p&&p.button!==0)return!1;if("touches"in p){if(p.type==="touchend"){if(p.changedTouches.length!==1||p.touches.length!==0)return!1}else if(p.touches.length!==1)return!1}const m=At(p);if(g&&!o){if(s){const x=e.context.internalBackdropRef.current,v=e.context.backdropRef.current;return x||v?x===m||v===m||ve(m,i)&&!m?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:g});return yd(r&&s===!0,i),e.useContextCallback("onNestedDialogOpen",(p,m)=>{u(p),h(m)}),ie(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(c+1,f+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,c,f,t]),fa(e,{activeTriggerProps:A.reference,inactiveTriggerProps:A.trigger,popupProps:A.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:f}),null}const Em={...Aa,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class Sm extends Gr{constructor(t,n,r){const o=new Yr,s=Rm(t,o,n,r);super(s,Dm(o),Em)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const r={open:t};ca(r,t,n.trigger),this.update(r)}}function Rm(e,t,n,r=!1){const o={...pa(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e};return o.floatingRootContext=ud(t,n,r),o}function Dm(e){return{popupRef:d.createRef(),backdropRef:d.createRef(),internalBackdropRef:d.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Cd(e,t){const{children:n,open:r,defaultOpen:o=!1,onOpenChange:s,onOpenChangeComplete:i,disablePointerDismissal:a=!1,modal:c=!0,actionsRef:u,handle:f,triggerId:h,defaultTriggerId:g=null}=t,A=e==="drawer",p=e==="alert-dialog",m=p?!0:c,x=p||a,v=p?"alertdialog":"dialog",b=_n(!0),y=b!=null,C={modal:m,disablePointerDismissal:x,nested:y,role:v},w=ad((F,T)=>new Sm({open:o,openProp:r,activeTriggerId:g,triggerIdProp:h,...C},F,T),!0);w.useControlledProp("openProp",r),w.useControlledProp("triggerIdProp",h),w.useSyncedValues(C),w.useContextCallback("onOpenChange",s),w.useContextCallback("onOpenChangeComplete",i);const I=w.useState("open"),S=w.useState("mounted"),R=w.useState("payload");nm(w,I),ua(w);const{forceUnmount:E}=da(I,w);d.useImperativeHandle(u,()=>({unmount:E,close:()=>w.setOpen(!1,Ce(Di))}),[E,w]);const k=I||S;return l.jsxs(Nu.Provider,{value:w,children:[f&&l.jsx(la,{handle:f,store:w}),k&&l.jsx(km,{store:w,parentContext:b?.context,isDrawer:A}),typeof n=="function"?n({payload:R}):n]})}function Id(e){return Cd("dialog",e)}const Ca=d.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,...a}=t,c=_n(),u=It(i);return c.useSyncedValueWithCleanup("titleElementId",u),je("h2",t,{ref:n,props:[{id:u},a]})});function Fm(e){const t=d.useRef(""),n=d.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:d.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o?e(o,o.pointerType):e(o,t.current),t.current=""},[e]),onPointerDown:n}}function ss(e,t){const n=d.useRef(e),r=de(t);ie(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Bm(e,t){const n=de((s,i)=>{(typeof e=="function"?e():e)||t(i||(Yo?"touch":""))}),{onClick:r,onPointerDown:o}=Fm(n);return d.useMemo(()=>({onClick:r,onPointerDown:o}),[r,o])}function wd(e){const[t,n]=d.useState(null),r=Bm(e,n);return ss(e,o=>{o&&!e&&n(null)}),d.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function jm({...e}){return l.jsx(Id,{"data-slot":"sheet",...e})}function Mm({...e}){return l.jsx(ya,{"data-slot":"sheet-portal",...e})}function Pm({className:e,...t}){return l.jsx(qi,{"data-slot":"sheet-overlay",className:fe("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...t})}function Tm({className:e,children:t,side:n="right",showCloseButton:r=!0,...o}){return l.jsxs(Mm,{children:[l.jsx(Pm,{}),l.jsxs(xa,{"data-slot":"sheet-content","data-side":n,className:fe("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...o,children:[t,r&&l.jsxs(Qr,{"data-slot":"sheet-close",render:l.jsx(Oe,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[l.jsx(Hi,{}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Nm({className:e,...t}){return l.jsx("div",{"data-slot":"sheet-header",className:fe("flex flex-col gap-0.5 p-4",e),...t})}function _m({className:e,...t}){return l.jsx(Ca,{"data-slot":"sheet-title",className:fe("cn-font-heading text-base font-medium text-foreground",e),...t})}function Om({className:e,...t}){return l.jsx(ea,{"data-slot":"sheet-description",className:fe("text-sm text-muted-foreground",e),...t})}function qt({className:e,...t}){return l.jsx("div",{"data-slot":"skeleton",className:fe("animate-pulse rounded-md bg-muted",e),...t})}const kd=d.createContext(void 0);function zr(e){const t=d.useContext(kd);if(t===void 0&&!e)throw new Error(ot(72));return t}const Hm={...Aa,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class Lm extends Gr{constructor(t,n,r){const o=new Yr;super(Km(t,o,n,r),Wm(o),Hm)}setOpen=(t,n)=>{tm(this,t,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(t){this.state.floatingRootContext.dispatchOpenChange(!1,Ce(Pn,t))}}function Km(e,t,n,r=!1){const o={...pa(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e};return o.floatingRootContext=ud(t,n,r),o}function Wm(e){return{popupRef:d.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const Qm=aa(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:o,disableHoverablePopup:s=!1,trackCursorAxis:i="none",actionsRef:a,onOpenChange:c,onOpenChangeComplete:u,handle:f,triggerId:h,defaultTriggerId:g=null,children:A}=t,p=ad((F,T)=>new Lm({open:r,openProp:o,activeTriggerId:g,triggerIdProp:h},F,T));p.useControlledProp("openProp",o),p.useControlledProp("triggerIdProp",h),p.useContextCallback("onOpenChange",c),p.useContextCallback("onOpenChangeComplete",u);const m=p.useState("open"),x=!n&&m,v=p.useState("activeTriggerId"),b=p.useState("mounted"),y=p.useState("payload");p.useSyncedValues({trackCursorAxis:i,disableHoverablePopup:s,disabled:n}),ua(p,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:C,transitionStatus:w}=da(x,p),I=p.useState("isInstantPhase"),S=p.useState("instantType"),R=p.useState("lastOpenChangeReason"),E=d.useRef(null);ie(()=>{m&&n&&p.setOpen(!1,Ce(fu))},[m,n,p]),ie(()=>{w==="ending"&&R===Mt||w!=="ending"&&I?(S!=="delay"&&(E.current=S),p.set("instantType","delay")):E.current!==null&&(p.set("instantType",E.current),E.current=null)},[w,I,R,S,p]),ie(()=>{x&&v==null&&p.set("payload",void 0)},[p,v,x]),d.useImperativeHandle(a,()=>({unmount:C,close:()=>p.setOpen(!1,Ce(Di))}),[C,p]);const k=x||b||!n&&i!=="none";return l.jsxs(kd.Provider,{value:p,children:[f&&l.jsx(la,{handle:f,store:p}),k&&l.jsx(Gm,{store:p,disabled:n,trackCursorAxis:i}),typeof A=="function"?A({payload:y}):A]})});function Gm({store:e,disabled:t,trackCursorAxis:n}){const r=e.useState("floatingRootContext"),o=Xo(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),s=qA(r,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),i=d.useMemo(()=>Bt(s.reference,o.reference),[s.reference,o.reference]);return fa(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:o.floating??ct}),null}const Ym=d.createContext(void 0);function zm(){return d.useContext(Ym)}const Yl=600,Ed="data-base-ui-tooltip-trigger";function zl(e){if("composedPath"in e){const n=e.composedPath();for(let r=0;r<n.length;r+=1){const o=n[r];if(Pe(o))return o}}const t=e.target;return Pe(t)?t:null}function Um(e){let t=e;for(;t;){const n=t.closest(`[${Ed}]`);if(n)return n;const r=t.getRootNode();t="host"in r&&Pe(r.host)?r.host:null}return null}const Vm=sd(function(t,n){const{render:r,className:o,style:s,handle:i,payload:a,disabled:c,delay:u,closeOnClick:f=!0,closeDelay:h,id:g,...A}=t,p=zr(!0),x=fd(i)??p;if(!x)throw new Error(ot(82));const v=It(g),b=x.useState("isTriggerActive",v),y=x.useState("isOpenedByTrigger",v),C=x.useState("floatingRootContext"),w=d.useRef(null),I=u??Yl,S=h??0,{registerTrigger:R,isMountedByThisTrigger:E}=cd(v,w,x,{payload:a,closeOnClick:f,closeDelay:S}),k=zm(),{delayRef:F,isInstantPhase:T,hasProvider:N}=OA(C,{open:y}),M=ma(C);x.useSyncedValue("isInstantPhase",T);const D=x.useState("disabled"),L=c??D,_=tt(L),j=x.useState("trackCursorAxis"),H=x.useState("disableHoverablePopup"),P=d.useRef(!1),B=pt(),O=d.useRef(void 0);function G(){return N?er(F.current,"open")===0?0:u??k??Yl:I}function z(J){const ce=w.current;if(!ce||!J)return!1;const ue=Um(J);return ue!==null&&ue!==ce&&ve(ce,ue)}function U(J){const ce=z(J);return P.current=ce,ce&&(M.openChangeTimeout.clear(),M.restTimeout.clear(),M.restTimeoutPending=!1,B.clear()),ce}const Q=gd(C,{enabled:!L,mouseOnly:!0,move:!1,handleClose:!H&&j!=="both"?bd():null,restMs:G,delay(){return h==null&&N?{close:er(F.current,"close")}:{close:S}},triggerElementRef:w,isActiveTrigger:b,isClosing:()=>x.select("transitionStatus")==="ending",shouldOpen(){return!P.current}}),Z=pd(C,{enabled:!L}).reference,K=J=>{const ce=P.current,ue=zl(J),ge=U(ue),ae=w.current,pe=ae&&ue&&ve(ae,ue);if(ge&&x.select("open")&&x.select("lastOpenChangeReason")===at){x.setOpen(!1,Ce(at,J));return}if(ce&&!ge&&pe&&!_.current&&!x.select("open")&&ae&&mn(O.current)){const oe=()=>{!P.current&&!_.current&&!x.select("open")&&x.setOpen(!0,Ce(at,J,ae))},re=G();re===0?(B.clear(),oe()):B.start(re,oe)}},te=x.useState("triggerProps",E);return je("button",t,{state:{open:y},ref:[n,R,w],props:[Q,Z,E||j!=="none"?te:void 0,{onMouseOver(J){K(J.nativeEvent)},onFocus(J){z(zl(J.nativeEvent))&&J.preventBaseUIHandler()},onMouseLeave(){P.current=!1,B.clear(),O.current=void 0},onPointerEnter(J){O.current=J.pointerType},onPointerDown(J){O.current=J.pointerType,x.set("closeOnClick",f),f&&!x.select("open")&&x.cancelPendingOpen(J.nativeEvent)},onClick(J){f&&!x.select("open")&&x.cancelPendingOpen(J.nativeEvent)},id:v,"data-trigger-disabled":L?"":void 0,[Ed]:L?void 0:""},A],stateAttributesMapping:_u})}),Sd=d.createContext(void 0);function Zm(){const e=d.useContext(Sd);if(e===void 0)throw new Error(ot(70));return e}const Jm=d.forwardRef(function(t,n){const{children:r,container:o,className:s,render:i,style:a,...c}=t,{node:u,subtree:f}=Yu({container:o,ref:n,componentProps:t,elementProps:c});return!f&&!u?null:l.jsxs(d.Fragment,{children:[f,u&&sn.createPortal(r,u)]})}),$m=d.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t;return zr().useState("mounted")||r?l.jsx(Sd.Provider,{value:r,children:l.jsx(Jm,{ref:n,...o})}):null}),Rd=d.createContext(void 0);function Dd(){const e=d.useContext(Rd);if(e===void 0)throw new Error(ot(71));return e}const Xm=d.createContext(void 0);function is(){return d.useContext(Xm)?.direction??"ltr"}const qm=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:u,padding:f=0,offsetParent:h="real"}=bn(e,t)||{};if(u==null)return{};const g=Iu(f),A={x:n,y:r},p=Ui(o),m=zi(p),x=await i.getDimensions(u),v=p==="y",b=v?"top":"left",y=v?"bottom":"right",C=v?"clientHeight":"clientWidth",w=s.reference[m]+s.reference[p]-A[p]-s.floating[m],I=A[p]-s.reference[p],S=h==="real"?await i.getOffsetParent?.(u):a.floating;let R=a.floating[C]||s.floating[m];(!R||!await i.isElement?.(S))&&(R=a.floating[C]||s.floating[m]);const E=w/2-I/2,k=R/2-x[m]/2-1,F=Math.min(g[b],k),T=Math.min(g[y],k),N=F,M=R-x[m]-T,D=R/2-x[m]/2+E,L=Cu(N,D,M),_=!c.arrow&&Cn(o)!=null&&D!==L&&s.reference[m]/2-(D<N?F:T)-x[m]/2<0,j=_?D<N?D-N:D-M:0;return{[p]:A[p]+j,data:{[p]:L,centerOffset:D-L-j,..._&&{alignmentOffset:j}},reset:_}}}),e0=(e,t)=>({...qm(e),options:[e,t]}),t0={name:"hide",async fn(e){const{width:t,height:n,x:r,y:o}=e.rects.reference,s=t===0&&n===0&&r===0&&o===0,i=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:i.top-n>=0||i.right-t>=0||i.bottom-n>=0||i.left-t>=0||s}}}},n0={sideX:"left",sideY:"top"},Ul="--available-width",Vl="--available-height";function Fd(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function Zl(e,t,n){const{rects:r,placement:o}=e;return{side:Fd(t,jt(o),n),align:Cn(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Ia(e){return r0(e,im)}function r0(e,t){const{anchor:n,positionMethod:r="absolute",side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,collisionBoundary:c,collisionPadding:u=5,sticky:f=!1,arrowPadding:h=5,disableAnchorTracking:g=!1,inline:A,keepMounted:p=!1,floatingRootContext:m,mounted:x,collisionAvoidance:v,shift:b,nodeId:y,adaptiveOrigin:C,lazyFlip:w=!1,externalTree:I}=e,[S,R]=d.useState(null);!x&&S!==null&&R(null);const E=v.side||"flip",k=v.align||"flip",F=v.fallbackAxisSide||"end",T=b?.crossAxis??!1,N=b?.rootBoundary,M=typeof n=="function"?n:void 0,D=de(M),L=M?D:n,_=tt(n),j=tt(x),P=is()==="rtl",B=S||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":P?"left":"right","inline-start":P?"right":"left"}[o],O=i==="center"?B:`${B}-${i}`;let G=u;typeof G=="number"?G={top:G,right:G,bottom:G,left:G}:G&&(G={top:G.top||0,right:G.right||0,bottom:G.bottom||0,left:G.left||0});const z=1,U=o==="bottom"?z:0,Q=o==="top"?z:0,Z=o==="right"?z:0,K=o==="left"?z:0,te={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:G},le=d.useRef(null),X=tt(s),ee=tt(a),J=typeof s!="function"?s:0,ce=typeof a!="function"?a:0,ue=[];A&&ue.push(A),ue.push(Tg(Re=>{const Ge=Zl(Re,o,P),_e=typeof X.current=="function"?X.current(Ge):X.current,Ze=typeof ee.current=="function"?ee.current(Ge):ee.current;return{mainAxis:_e,crossAxis:Ze,alignmentAxis:Ze}},[J,ce,P,o]));const ge=k==="none"&&E!=="shift",ae=!ge&&(f||T||E==="shift"),pe=E==="none"?null:Og({...te,padding:{top:G.top+z+U,right:G.right+z+K,bottom:G.bottom+z+Q,left:G.left+z+Z},mainAxis:!T&&E==="flip",crossAxis:k==="flip"?"alignment":!1,fallbackAxisSideDirection:F}),oe=ge?null:Ng({...te,rootBoundary:N,mainAxis:k!=="none",crossAxis:ae,limiter:f||T?void 0:_g(Re=>{if(!le.current)return{};const{width:Ge,height:_e}=le.current.getBoundingClientRect(),Ze=Ft(jt(Re.placement)),st=Ze==="y"?Ge:_e,ht=Ze==="y"?G.left+G.right:G.top+G.bottom;return{offset:st/2+ht/2}})},[te,f,T,N,G,k]);E==="shift"||k==="shift"||i==="center"?ue.push(oe,pe):ue.push(pe,oe),ue.push(Hg({...te,apply({elements:{floating:Re},availableWidth:Ge,availableHeight:_e,rects:Ze}){if(!j.current)return;const st=Re.style;st.setProperty(Ul,`${Ge}px`),st.setProperty(Vl,`${_e}px`);const ht=rt(Re).devicePixelRatio||1,{x:yt,y:dt,width:kt,height:Pt}=Ze.reference,Zt=(Math.round((yt+kt)*ht)-Math.round(yt*ht))/ht,Fe=(Math.round((dt+Pt)*ht)-Math.round(dt*ht))/ht;st.setProperty("--anchor-width",`${Zt}px`),st.setProperty("--anchor-height",`${Fe}px`)}}),e0(Re=>({element:le.current||Be(Re.elements.floating).createElement("div"),padding:h,offsetParent:"floating"}),[h]),{name:"transformOrigin",fn(Re){const{elements:Ge,middlewareData:_e,placement:Ze,rects:st,y:ht}=Re,yt=jt(Ze),dt=Ft(yt),kt=le.current,Pt=_e.arrow?.x||0,Zt=_e.arrow?.y||0,Fe=kt?.clientWidth||0,Ue=kt?.clientHeight||0,gt=Pt+Fe/2,Et=Zt+Ue/2,St=Math.abs(_e.shift?.y||0),it=st.reference.height/2,Rt=typeof s=="function"?s(Zl(Re,o,P)):s,cn=St>Rt,On={top:`${gt}px calc(100% + ${Rt}px)`,bottom:`${gt}px ${-Rt}px`,left:`calc(100% + ${Rt}px) ${Et}px`,right:`${-Rt}px ${Et}px`}[yt],kn=`${gt}px ${st.reference.y+it-ht}px`;return Ge.floating.style.setProperty("--transform-origin",ae&&dt==="y"&&cn?kn:On),{}}},t0,C),ie(()=>{!x&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[x,m]);const re=d.useMemo(()=>({elementResize:!g&&typeof ResizeObserver<"u",layoutShift:!g&&typeof IntersectionObserver<"u"}),[g]),{refs:se,elements:he,x:me,y:W,middlewareData:Y,update:ye,placement:q,context:ne,isPositioned:Ee,floatingStyles:Se}=t({rootContext:m,open:p?x:void 0,placement:O,middleware:ue,strategy:r,whileElementsMounted:p?void 0:(...Re)=>Bl(...Re,re),nodeId:y,externalTree:I}),{sideX:Le,sideY:Je}=Y.adaptiveOrigin||n0,We=Ee?r:"fixed",ut=d.useMemo(()=>{let Re;return Ee?C?Re={position:We,[Le]:me,[Je]:W}:Re={...Se,position:We}:Re={position:We,top:0,left:0},Re[Ul]="100vw",Re[Vl]="100vh",Ee||(Re.opacity=0),Re},[C,We,Le,me,Je,W,Se,Ee]),$e=d.useRef(null);ie(()=>{if(!x)return;const Re=_.current,Ge=typeof Re=="function"?Re():Re,Ze=(Jl(Ge)?Ge.current:Ge)||null||null;Ze!==$e.current&&(se.setPositionReference(Ze),$e.current=Ze)},[x,se,L,_]),d.useEffect(()=>{if(!x)return;const Re=_.current;typeof Re!="function"&&Jl(Re)&&Re.current!==$e.current&&(se.setPositionReference(Re.current),$e.current=Re.current)},[x,se,L,_]),d.useEffect(()=>{if(p&&x&&he.reference&&he.floating)return Bl(he.reference,he.floating,ye,re)},[p,x,he,ye,re]);const Ye=jt(q),mt=Fd(o,Ye,P),Ie=Cn(q)||"center",ze=!!Y.hide?.referenceHidden;ie(()=>{w&&x&&Ee&&Ye!==B&&R(Ye)},[w,x,Ee,Ye,B]);const Ne=d.useMemo(()=>({position:"absolute",top:Y.arrow?.y,left:Y.arrow?.x}),[Y.arrow]),nt=Y.arrow?.centerOffset!==0;return d.useMemo(()=>({positionerStyles:ut,arrowStyles:Ne,arrowRef:le,arrowUncentered:nt,side:mt,align:Ie,physicalSide:Ye,anchorHidden:ze,refs:se,context:ne,isPositioned:Ee,update:ye}),[ut,Ne,le,nt,mt,Ie,Ye,ze,se,ne,Ee,ye])}function Jl(e){return e!=null&&"current"in e}function as(e){return e==="starting"?GA:ct}function wa(e,t,{styles:n,transitionStatus:r,props:o,refs:s,hidden:i,inert:a=!1}){const c={...n};return a&&(c.pointerEvents="none"),je("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:i,style:c},as(r),o],stateAttributesMapping:Wr})}const o0=d.forwardRef(function(t,n){const{render:r,className:o,anchor:s,positionMethod:i="absolute",side:a="top",align:c="center",sideOffset:u=0,alignOffset:f=0,collisionBoundary:h="clipping-ancestors",collisionPadding:g=5,arrowPadding:A=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:x=Wu,style:v,...b}=t,y=zr(),C=Zm(),w=y.useState("open"),I=y.useState("mounted"),S=y.useState("trackCursorAxis"),R=y.useState("disableHoverablePopup"),E=y.useState("floatingRootContext"),k=y.useState("instantType"),F=y.useState("transitionStatus"),T=y.useState("adaptiveOrigin"),N=Ia({anchor:s,positionMethod:i,floatingRootContext:E,mounted:I,side:a,sideOffset:u,align:c,alignOffset:f,collisionBoundary:h,collisionPadding:g,sticky:p,arrowPadding:A,disableAnchorTracking:m,keepMounted:C,collisionAvoidance:x,adaptiveOrigin:T}),M=d.useMemo(()=>({open:w,side:N.side,align:N.align,anchorHidden:N.anchorHidden,instant:S!=="none"?"tracking-cursor":k}),[w,N.side,N.align,N.anchorHidden,S,k]),D=wa(t,M,{styles:N.positionerStyles,transitionStatus:F,props:b,refs:[n,y.useStateSetter("positionerElement")],hidden:!I,inert:!w||S==="both"||R});return l.jsx(Rd.Provider,{value:N,children:D})}),s0=d.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,a=zr(),{side:c,align:u}=Dd(),f=a.useState("open"),h=a.useState("instantType"),g=a.useState("transitionStatus"),A=a.useState("popupProps"),p=a.useState("floatingRootContext"),m=a.useState("disabled"),x=a.useState("closeDelay");Yt({open:f,ref:a.context.popupRef,onComplete(){f&&a.context.onOpenChangeComplete?.(!0)}}),Ad(p,{enabled:!m,closeDelay:x});const v=a.useStateSetter("popupElement");return je("div",t,{state:{open:f,side:c,align:u,instant:h,transitionStatus:g},ref:[n,a.context.popupRef,v],props:[ts,A,as(g),i],stateAttributesMapping:Xi})}),i0=d.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,a=zr(),{arrowRef:c,side:u,align:f,arrowUncentered:h,arrowStyles:g}=Dd(),A=a.useState("open"),p=a.useState("instantType");return je("div",t,{state:{open:A,side:u,align:f,uncentered:h,instant:p},ref:[n,c],props:[{style:g,"aria-hidden":!0},i],stateAttributesMapping:Wr})});function a0(e){const[t,n]=d.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function ls({...e}){return l.jsx(Qm,{"data-slot":"tooltip",...e})}function cs({...e}){return l.jsx(Vm,{"data-slot":"tooltip-trigger",...e})}function us({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:o=0,children:s,...i}){return l.jsx($m,{children:l.jsx(o0,{align:r,alignOffset:o,side:t,sideOffset:n,className:"isolate z-50",children:l.jsxs(s0,{"data-slot":"tooltip-content",className:fe("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...i,children:[s,l.jsx(i0,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const l0="sidebar_state",c0=3600*24*7,u0="16rem",d0="18rem",f0="3rem",p0="b",Bd=d.createContext(null);function ds(){const e=d.useContext(Bd);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function h0({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:o,children:s,...i}){const a=RA(),[c,u]=d.useState(!1),[f,h]=d.useState(e),g=t??f,A=d.useCallback(v=>{const b=typeof v=="function"?v(g):v;n?n(b):h(b),document.cookie=`${l0}=${b}; path=/; max-age=${c0}`},[n,g]),p=d.useCallback(()=>a?u(v=>!v):A(v=>!v),[a,A,u]);d.useEffect(()=>{const v=b=>{b.key===p0&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),p())};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[p]);const m=g?"expanded":"collapsed",x=d.useMemo(()=>({state:m,open:g,setOpen:A,isMobile:a,openMobile:c,setOpenMobile:u,toggleSidebar:p}),[m,g,A,a,c,u,p]);return l.jsx(Bd.Provider,{value:x,children:l.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":u0,"--sidebar-width-icon":f0,...o},className:fe("group/sidebar-wrapper flex h-svh w-full has-data-[variant=inset]:bg-sidebar",r),...i,children:s})})}function A0({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:o,dir:s,...i}){const{isMobile:a,state:c,openMobile:u,setOpenMobile:f}=ds();return n==="none"?l.jsx("div",{"data-slot":"sidebar",className:fe("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",r),...i,children:o}):a?l.jsx(jm,{open:u,onOpenChange:f,...i,children:l.jsxs(Tm,{dir:s,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":d0},side:e,children:[l.jsxs(Nm,{className:"sr-only",children:[l.jsx(_m,{children:"Sidebar"}),l.jsx(Om,{children:"Displays the mobile sidebar."})]}),l.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):l.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":c,"data-collapsible":c==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[l.jsx("div",{"data-slot":"sidebar-gap",className:fe("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),l.jsx("div",{"data-slot":"sidebar-container","data-side":e,className:fe("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...i,children:l.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:o})})]})}function g0({className:e,...t}){const{toggleSidebar:n}=ds();return l.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:fe("absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function m0({className:e,...t}){return l.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:fe("flex flex-col gap-2 p-2",e),...t})}function x0({className:e,...t}){return l.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:fe("flex flex-col gap-2 p-2",e),...t})}function b0({className:e,...t}){return l.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:fe("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function v0({className:e,...t}){return l.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:fe("relative flex w-full min-w-0 flex-col p-2",e),...t})}function y0({className:e,...t}){return l.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:fe("w-full text-sm",e),...t})}function Ms({className:e,...t}){return l.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:fe("flex w-full min-w-0 flex-col gap-0",e),...t})}function oo({className:e,...t}){return l.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:fe("group/menu-item relative",e),...t})}const C0=ki("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function kr({render:e,isActive:t=!1,variant:n="default",size:r="default",tooltip:o,className:s,...i}){const{isMobile:a,state:c}=ds(),u=hu({defaultTagName:"button",props:Bt({className:fe(C0({variant:n,size:r}),s)},i),render:o?l.jsx(cs,{render:e}):e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:r,active:t}});return o?(typeof o=="string"&&(o={children:o}),l.jsxs(ls,{children:[u,l.jsx(us,{side:"right",align:"center",hidden:c!=="collapsed"||a,...o})]})):u}const jd=d.createContext(void 0);function Md(e){const t=d.useContext(jd);if(t===void 0&&!e)throw new Error(ot(33));return t}const Pd=d.createContext(void 0);function ir(e){const t=d.useContext(Pd);if(t===void 0&&!e)throw new Error(ot(36));return t}const I0=d.createContext(void 0);function ka(e=!0){const t=d.useContext(I0);if(t===void 0&&!e)throw new Error(ot(25));return t}function w0(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:o,store:s,typingRef:i,itemRef:a,itemMetadata:c}=e,{events:u}=s.useState("floatingTreeRoot"),f=s.useState("open"),h=ka(!0),g=h!==void 0;return d.useMemo(()=>({id:r,role:"menuitem",tabIndex:f&&n?0:-1,onKeyDown(A){A.key===" "&&i?.current&&A.preventDefault()},onMouseMove(A){o&&u.emit("itemhover",{nodeId:o,target:A.currentTarget})},onClick(A){t&&u.emit("close",{domEvent:A,reason:Cr})},onMouseUp(A){if(h){const p=h.initialCursorPointRef.current;if(h.initialCursorPointRef.current=null,g&&p&&Math.abs(A.clientX-p.x)<=1&&Math.abs(A.clientY-p.y)<=1||g&&!Li&&A.button===2)return}a.current&&s.context.allowMouseUpTriggerRef.current&&(!g||A.button===2)&&c.type==="regular-item"&&Fi(a.current,A,{detail:1})}}),[t,n,r,u,o,f,s,i,a,h,g,c])}const k0={type:"regular-item"};function E0(e){const{closeOnClick:t,disabled:n,highlighted:r,id:o,store:s,typingRef:i=s.context.typingRef,nativeButton:a,itemMetadata:c,nodeId:u}=e,f=d.useRef(null),{getButtonProps:h,buttonRef:g}=Gt({disabled:n,focusableWhenDisabled:!0,native:a,composite:!0}),A=w0({closeOnClick:t,highlighted:r,id:o,nodeId:u,store:s,typingRef:i,itemRef:f,itemMetadata:c}),p=d.useCallback(x=>Bt(A,{onMouseEnter(){c.type==="submenu-trigger"&&c.setActive()}},x,h),[A,h,c]),m=Qt(f,g);return d.useMemo(()=>({getItemProps:p,itemRef:m}),[p,m])}const Td=d.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function S0(){return d.useContext(Td)}function fs(e={}){const{guess:t,label:n,metadata:r,textRef:o,index:s}=e,{register:i,unregister:a,subscribeMapChange:c,nextIndexRef:u}=S0(),f=d.useRef(-1),[h,g]=d.useState(s==null&&t?()=>{if(f.current===-1){const x=u.current;u.current+=1,f.current=x}return f.current}:-1),A=s??h,p=d.useRef(null),m=d.useCallback(x=>{const v=p.current;v&&a(v),p.current=x,x&&i(x,{metadata:r??null,index:s??null,label:n,textRef:o})},[s,i,a,r,n,o]);return ie(()=>{if(s==null)return c(x=>{const v=p.current?x.get(p.current)?.index:null;v!=null&&g(v)})},[s,c]),{ref:m,index:A}}const R0=d.forwardRef(function(t,n){const{render:r,className:o,id:s,label:i,nativeButton:a=!1,disabled:c=!1,closeOnClick:u=!0,style:f,...h}=t,g=fs({guess:!0,label:i}),A=Md(!0),p=It(s),{store:m}=ir(),x=m.useState("disabled"),v=c||x,b=m.useState("isActive",g.index),y=m.useState("itemProps"),{getItemProps:C,itemRef:w}=E0({closeOnClick:u,disabled:v,highlighted:b,id:p,store:m,nativeButton:a,nodeId:A?.context.nodeId,itemMetadata:k0});return je("div",t,{state:{disabled:v,highlighted:b},props:[y,h,C],ref:[w,n,g.ref]})}),D0=d.createContext(void 0);function Ea(e){return d.useContext(D0)}const F0=d.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:i,...a}=t,{store:c}=ir(),{side:u,align:f}=Md(),h=Ea()!=null,g=c.useState("open"),A=c.useState("transitionStatus"),p=c.useState("popupProps"),m=c.useState("mounted"),x=c.useState("instantType"),v=c.useState("activeTriggerElement"),b=c.useState("parent"),y=c.useState("lastOpenChangeReason"),C=c.useState("rootId"),w=c.useState("floatingRootContext"),I=c.useState("floatingTreeRoot"),S=c.useState("closeDelay"),R=c.useState("hoverEnabled"),E=c.useState("disabled"),k=c.useState("openMethod"),F=b.type==="context-menu";Yt({open:g,ref:c.context.popupRef,onComplete(){g&&c.context.onOpenChangeComplete?.(!0)}}),d.useEffect(()=>{function L(_){c.setOpen(!1,Ce(_.reason,_.domEvent))}return I.events.on("close",L),()=>{I.events.off("close",L)}},[I.events,c]),Ad(w,{enabled:R&&!E&&!F&&b.type!=="menubar",closeDelay:S});const T=c.useStateSetter("popupElement"),N={transitionStatus:A,side:u,align:f,open:g,nested:b.type==="menu",instant:x},M=je("div",t,{state:N,ref:[n,c.context.popupRef,T],stateAttributesMapping:Xi,props:[p,{onKeyDown(L){h&&rs.has(L.key)&&L.stopPropagation()}},as(A),a,{"data-rootownerid":C}]});let D=b.type===void 0||F;return(v||b.type==="menubar"&&y!==Lo)&&(D=!0),l.jsx(sa,{context:w,openInteractionType:k,modal:F,disabled:!m,returnFocus:i===void 0?D:i,initialFocus:b.type!=="menu",restoreFocus:!0,externalTree:b.type!=="menubar"?I:void 0,previousFocusableElement:v,nextFocusableElement:b.type===void 0?c.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:b.type===void 0?c.context.beforeContentFocusGuardRef:void 0,children:M})}),Nd=d.createContext(void 0);function B0(){const e=d.useContext(Nd);if(e===void 0)throw new Error(ot(32));return e}const j0=d.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:s}=ir();return s.useState("mounted")||r?l.jsx(Nd.Provider,{value:r,children:l.jsx(na,{ref:n,...o})}):null});function Ur(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:o}=e,s=de(o),[,i]=d.useState(!1),a=Dt(P0).current,c=Dt(M0).current,u=d.useRef(0),f=d.useRef(!0),h=d.useRef([]),g=d.useRef(null),A=de(()=>{f.current||(f.current=!0,i(w=>!w))}),p=de((w,I)=>{c.set(w,I),A()}),m=de(w=>{c.delete(w),A()}),x=de(w=>{const I=new Map;return n.current.length=0,r&&(r.current.length=0),w.forEach(S=>{I.set(S.element,{...S.registration.metadata??{},index:S.index}),n.current[S.index]=S.element,r&&(r.current[S.index]=S.registration.label!==void 0?S.registration.label:S.registration.textRef?.current?.textContent??S.element.textContent)}),u.current=n.current.length,I});function v(w){if(g.current?.disconnect(),g.current=null,typeof MutationObserver!="function"||w.length<2)return;const I=new MutationObserver(R=>{if(!_0(R))return;let E=null;for(const k of w)if(k.isConnected){if(E&&_d(E,k)>0){I.disconnect(),A();return}E=k}});g.current=I;const S=new Set;for(let R=1;R<w.length;R+=1){const E=N0(w[R-1],w[R]);E&&S.add(E)}S.forEach(R=>I.observe(R,{childList:!0}))}const b=de(()=>{const[w,I]=T0(c),S=x(w);v(I),h.current=w,f.current=!1,a.forEach(R=>R(S)),s(S)});ie(()=>(f.current||x(h.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,x]),ie(()=>{f.current&&b()}),ie(()=>()=>{g.current?.disconnect(),f.current=!0},[]);const y=de(w=>(a.add(w),()=>{a.delete(w)})),C=d.useMemo(()=>({register:p,unregister:m,subscribeMapChange:y,nextIndexRef:u}),[p,m,y,u]);return l.jsx(Td.Provider,{value:C,children:t})}function M0(){return new Map}function P0(){return new Set}function T0(e){const t=new Set,n=[],r=[];e.forEach((s,i)=>{if(!i.isConnected)return;const a=s.index,c={index:a??-1,element:i,registration:s};a===null?r.push(c):a>=0&&(t.add(a),n.push(c))});let o=0;return r.sort((s,i)=>_d(s.element,i.element)),r.forEach(s=>{for(;t.has(o);)o+=1;s.index=o,n.push(s),o+=1}),t.size>0&&n.sort((s,i)=>s.index-i.index),[n,r.map(s=>s.element)]}function N0(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function _0(e){for(const t of e)for(let n=0;n<t.removedNodes.length;n+=1)if(t.removedNodes[n].isConnected)return!0;return!1}function _d(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const O0=20;function Od(e,t,n,r){const[o,s]=d.useState(!1);ie(()=>{if(!e||!t||n==null){s(!1);return}const i=Be(n).documentElement.clientWidth,a=n.offsetWidth;s(i>0&&a>0&&a>=i-O0)},[e,t,n]),yd(e&&(!t||o),r)}const H0=d.forwardRef(function(t,n){const{anchor:r,positionMethod:o="absolute",className:s,render:i,side:a,align:c,sideOffset:u=0,alignOffset:f=0,collisionBoundary:h="clipping-ancestors",collisionPadding:g=5,arrowPadding:A=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:x=Ku,style:v,...b}=t,{store:y}=ir(),C=B0(),w=ka(!0),I=y.useState("parent"),S=y.useState("floatingRootContext"),R=y.useState("floatingTreeRoot"),E=y.useState("mounted"),k=y.useState("open"),F=y.useState("modal"),T=y.useState("openMethod"),N=y.useState("activeTriggerElement"),M=y.useState("transitionStatus"),D=y.useState("positionerElement"),L=y.useState("instantType"),_=y.useState("adaptiveOrigin"),j=y.useState("lastOpenChangeReason"),H=y.useState("floatingNodeId"),P=y.useState("floatingParentNodeId"),B=S.useState("domReferenceElement"),O=d.useRef(null),G=$i(D);let z=r,U=u,Q=f,Z=c,K=x;I.type==="context-menu"&&(z=r??I.context?.anchor,Z=Z??"start",!a&&Z!=="center"&&(Q=t.alignOffset??2,U=t.sideOffset??-5));let te=a,le=Z;I.type==="menu"?(te=te??"inline-end",le=le??"start",K=t.collisionAvoidance??Wu):I.type==="menubar"&&(te=te??(I.context.orientation==="vertical"?"inline-end":"bottom"),le=le??"start");const X=I.type==="context-menu",ee=Ia({anchor:z,floatingRootContext:S,positionMethod:w?"fixed":o,mounted:E,side:te,sideOffset:U,align:le,alignOffset:Q,arrowPadding:X?0:A,collisionBoundary:h,collisionPadding:g,sticky:p,nodeId:H,keepMounted:C,disableAnchorTracking:m,collisionAvoidance:K,shift:X?{crossAxis:!("side"in K&&K.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:R,adaptiveOrigin:_});d.useEffect(()=>{function re(se){se.open&&(se.parentNodeId===H&&y.set("hoverEnabled",!1),se.nodeId!==H&&se.parentNodeId===y.select("floatingParentNodeId")&&y.setOpen(!1,Ce(xr)))}return R.events.on("menuopenchange",re),()=>{R.events.off("menuopenchange",re)}},[y,R.events,H]),d.useEffect(()=>{if(y.select("floatingParentNodeId")==null)return;function re(se){if(se.open||se.nodeId!==y.select("floatingParentNodeId"))return;const he=se.reason??xr;y.setOpen(!1,Ce(he))}return R.events.on("menuopenchange",re),()=>{R.events.off("menuopenchange",re)}},[R.events,y]);const J=pt();d.useEffect(()=>{k||J.clear()},[k,J]),d.useEffect(()=>{function re(se){if(!(!k||se.nodeId!==y.select("floatingParentNodeId")))if(se.target&&N&&N!==se.target){const he=y.select("closeDelay");he>0?J.isStarted()||J.start(he,()=>{y.setOpen(!1,Ce(xr))}):y.setOpen(!1,Ce(xr))}else J.clear()}return R.events.on("itemhover",re),()=>{R.events.off("itemhover",re)}},[R.events,k,N,y,J]),d.useEffect(()=>{const re={open:k,nodeId:H,parentNodeId:P,reason:y.select("lastOpenChangeReason")};R.events.emit("menuopenchange",re)},[R.events,k,y,H,P]),ie(()=>{const re=B,se=O.current;if(re&&(O.current=re),se&&re&&re!==se){y.set("instantType",void 0);const he=new AbortController;return G(()=>{y.set("instantType","trigger-change")},he.signal),()=>{he.abort()}}},[B,G,y]);const ce={open:k,side:ee.side,align:ee.align,anchorHidden:ee.anchorHidden,nested:I.type==="menu",instant:L},ue=I.type==="menubar"&&I.context.modal;Od(k&&(ue||F&&j!==at),T==="touch",D,N);const ae=wa(t,ce,{styles:ee.positionerStyles,transitionStatus:M,props:b,refs:[n,y.useStateSetter("positionerElement")],hidden:!E,inert:!k}),pe=E&&I.type!=="menu"&&(I.type!=="menubar"&&F&&j!==at||I.type==="menubar"&&I.context.modal);let oe=null;return I.type==="menubar"?oe=I.context.contentElement:I.type===void 0&&(oe=N),l.jsxs(jd.Provider,{value:ee,children:[pe&&l.jsx(va,{ref:I.type==="context-menu"||I.type==="nested-context-menu"?I.context.internalBackdropRef:null,inert:ba(!k),cutout:oe}),l.jsx(VA,{id:H,children:l.jsx(Ur,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,children:ae})})]})}),L0=d.createContext(null);function Hd(e){return d.useContext(L0)}const K0={...Aa,disabled:e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")}};class W0 extends Gr{constructor(t){super({...G0(),...t},Q0(),K0),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){let r=n.store.select("rootId"),o=n.store.select("floatingTreeRoot"),s=n.store.select("keyboardEventRelay");this.unsubscribeParentListener=n.store.subscribe(()=>{const i=n.store.select("rootId"),a=n.store.select("floatingTreeRoot"),c=n.store.select("keyboardEventRelay");r===i&&o===a&&s===c||(r=i,o=a,s=c,this.notifyAll())}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}unsubscribeParentListener=null}function Q0(){return{positionerRef:d.createRef(),popupRef:d.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:d.createRef(),beforeContentFocusGuardRef:d.createRef(),onOpenChangeComplete:void 0,triggerElements:new Yr}}function G0(){return{...pa(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new ra,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:ct,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0}}const Y0=d.createContext(void 0);function z0(){return d.useContext(Y0)}const U0=aa(function(t){const{children:n,open:r,onOpenChange:o,onOpenChangeComplete:s,defaultOpen:i=!1,disabled:a=!1,modal:c,loopFocus:u=!0,orientation:f="vertical",actionsRef:h,closeParentOnEsc:g=!1,handle:A,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:x=!0}=t,v=ka(!0),b=ir(!0),y=Hd(!0),C=z0(),w=d.useMemo(()=>C&&b?{type:"menu",store:b.store}:y?{type:"menubar",context:y}:v&&!b?{type:"context-menu",context:v}:{type:void 0},[v,b,y,C]),I=V0({open:i,openProp:r,activeTriggerId:m,triggerIdProp:p,parent:w});I.useControlledProp("openProp",r),I.useControlledProp("triggerIdProp",p),I.useContextCallback("onOpenChangeComplete",s);const S=Jn(),R=Jn(),E=I.useState("floatingTreeRoot"),k=Zu(E),F=In(),T=I.useState("open"),N=I.useState("activeTriggerElement"),M=I.useState("positionerElement"),D=I.useState("hoverEnabled"),L=I.useState("disabled"),_=I.useState("lastOpenChangeReason"),j=I.useState("parent"),H=I.useState("activeIndex"),P=I.useState("payload"),B=I.useState("floatingParentNodeId"),O=d.useRef(null),G=d.useRef(j.type!=="context-menu"),z=pt(),U=d.useRef(!0),Q=pt(),Z=B!=null,{openMethod:K,triggerProps:te}=wd(T);I.useSyncedValues({disabled:a,highlightItemOnHover:x,modal:j.type===void 0?c:void 0,openMethod:K,rootId:S}),ua(I);const{forceUnmount:le}=da(T,I,()=>{I.set("allowMouseEnter",!1)});ie(()=>{v&&!b?I.update({parent:{type:"context-menu",context:v},floatingNodeId:k,floatingParentNodeId:F}):b&&I.update({floatingNodeId:k,floatingParentNodeId:F})},[v,b,k,F,I]),d.useEffect(()=>{if(T||(O.current=null),j.type==="context-menu"){if(!T){z.clear(),G.current=!1;return}z.start(500,()=>{G.current=!0})}},[z,T,j.type]),ie(()=>{!T&&!D&&I.set("hoverEnabled",!0)},[T,D,I]);const X=de((ne,Ee)=>{const Se=Ee.reason;if(!ne&&!I.select("open")||T===ne&&Ee.trigger===N&&_===Se)return;const Le=ld(Ee);if(!ne&&Ee.trigger==null&&(Ee.trigger=N??void 0),o?.(ne,Ee),Ee.isCanceled)return;I.state.floatingRootContext.dispatchOpenChange(ne,Ee);const Je=Ee.event;if(ne===!1&&Je?.type==="click"&&Je.pointerType==="touch"&&!U.current)return;ne&&Se===Yn?(U.current=!1,Q.start(300,()=>{U.current=!0})):(U.current=!0,Q.clear());const We=(Se===Pn||Se===Cr)&&Je.detail===0,ut=!ne&&(Se===Ko||Se==null),$e={open:ne,openChangeReason:Se};O.current=Ee.event,ca($e,ne,Ee.trigger,Le()),I.update($e),j.type==="menubar"&&(Se===Yn||Se===Bn||Se===at||Se===Js||Se===xr)?I.set("instantType","group"):We||ut?I.set("instantType",We?"click":"dismiss"):I.set("instantType",void 0)}),ee=id({popupStore:I,floatingId:R,nested:F!=null,onOpenChange:X}),J=ee.context.events;ie(()=>{const ne=({open:Ee,eventDetails:Se})=>X(Ee,Se);return J.on("setOpen",ne),()=>{J?.off("setOpen",ne)}},[J,X]);const ce=d.useCallback(()=>{I.setOpen(!1,Ce(Di))},[I]);d.useImperativeHandle(h,()=>({unmount:le,close:ce}),[le,ce]);let ue;j.type==="context-menu"&&(ue=j.context),d.useImperativeHandle(ue?.positionerRef,()=>M,[M]),d.useImperativeHandle(ue?.actionsRef,()=>({setOpen:X}),[X]);const ge=Xo(ee,{enabled:!L,bubbles:{escapeKey:g&&j.type==="menu"},outsidePress(){return j.type!=="context-menu"||O.current?.type==="contextmenu"?!0:G.current},externalTree:Z?E:void 0}),ae=is(),pe=d.useCallback(ne=>{I.select("activeIndex")!==ne&&I.set("activeIndex",ne)},[I]),oe=md(ee,{enabled:!L,listRef:I.context.itemDomElements,activeIndex:H,nested:j.type!==void 0,loopFocus:u,orientation:f,parentOrientation:j.type==="menubar"?j.context.orientation:void 0,rtl:ae==="rtl",disabledIndices:Nt,onNavigate:pe,openOnArrowKeyDown:j.type!=="context-menu",externalTree:Z?E:void 0,focusItemOnHover:x}),re=d.useCallback(ne=>{I.context.typingRef.current=ne},[I]),se=xd(ee,{enabled:!L,listRef:I.context.itemLabels,elementsRef:I.context.itemDomElements,activeIndex:H,resetMs:WA,onMatch:ne=>{T&&ne!==H&&I.set("activeIndex",ne)},onTyping:re}),he=d.useMemo(()=>{const ne=Bt(se.reference,oe.reference,ge.reference,{onMouseMove(){I.set("allowMouseEnter",!0)}},te);return ne["aria-haspopup"]="menu",ne["aria-expanded"]=T,ne},[I,se.reference,oe.reference,ge.reference,te,T]),me=d.useMemo(()=>{const ne=Bt(oe.trigger,ge.trigger,te);return ne["aria-haspopup"]="menu",ne["aria-expanded"]=!1,ne},[oe.trigger,ge.trigger,te]),W=d.useMemo(()=>Bt(ts,{id:R,role:"menu","aria-labelledby":N?.id,onMouseMove(){I.set("allowMouseEnter",!0),j.type==="menu"&&I.set("hoverEnabled",!1)},onClick(){I.select("hoverEnabled")&&I.set("hoverEnabled",!1)},onKeyDown(ne){const Ee=I.select("keyboardEventRelay");Ee&&!ne.isPropagationStopped()&&Ee(ne)}},se.floating,oe.floating,ge.floating),[N,R,j.type,I,se.floating,oe.floating,ge.floating]),Y=oe.item??ct;fa(I,{floatingRootContext:ee,activeTriggerProps:he,inactiveTriggerProps:me,popupProps:W,itemProps:Y});const ye=d.useMemo(()=>({store:I,parent:w}),[I,w]),q=l.jsxs(Pd.Provider,{value:ye,children:[A&&l.jsx(la,{handle:A,store:I}),typeof n=="function"?n({payload:P}):n]});return j.type===void 0||j.type==="context-menu"?l.jsx(ZA,{externalTree:E,children:q}):q});function V0(e){return Dt(()=>new W0(e)).current}const so=5;function Ld(e,t){const n=Z0(t);return e.clientX>=n.left-so&&e.clientX<=n.right+so&&e.clientY>=n.top-so&&e.clientY<=n.bottom+so}function Z0(e){const t=e.getBoundingClientRect(),n=rt(e);if(Ki)return t;const r=n.getComputedStyle(e,"::before"),o=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||o.content!=="none"))return t;const i=parseFloat(r.width)||0,a=parseFloat(r.height)||0,c=parseFloat(o.width)||0,u=parseFloat(o.height)||0,f=Math.max(t.width,i,c),h=Math.max(t.height,a,u),g=f-t.width,A=h-t.height;return{left:t.left-g/2,right:t.right+g/2,top:t.top-A/2,bottom:t.bottom+A/2}}function Kd(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Bi(),{ref:o,index:s}=fs(e),i=n===s,a=d.useRef(null),c=Qt(o,a);return{compositeProps:{tabIndex:i?0:-1,onFocus(){r(s)},onMouseMove(){const f=a.current;if(!t||!f)return;const h=f.hasAttribute("disabled")||f.ariaDisabled==="true";!i&&!h&&f.focus()}},compositeRef:c,index:s}}function Wd(e){const{render:t,className:n,style:r,state:o=ct,props:s=Nt,refs:i=Nt,metadata:a,stateAttributesMapping:c,tag:u="div",...f}=e,{compositeProps:h,compositeRef:g}=Kd({metadata:a});return je(u,e,{state:o,ref:[g,...i],props:[h,...s,f],stateAttributesMapping:c})}function Qd(e){if(Xe(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid");if(!Dn(e))return Qd($n(e))}function J0(e,t){const n=d.useRef(null);function r(s){sn.flushSync(()=>{e.setOpen(!1,Ce(Bn,s.nativeEvent,s.currentTarget))}),mA(n.current)?.focus()}function o(s){const i=e.select("positionerElement");if(i&&zn(s,i))e.context.beforeContentFocusGuardRef.current?.focus();else{sn.flushSync(()=>{e.setOpen(!1,Ce(Bn,s.nativeEvent,s.currentTarget))});let a=gA(e.context.triggerFocusTargetRef.current||t.current);for(;a!==null&&ve(i,a);){const c=a;if(a=Zi(a),a===c)break}a?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:o}}function $0(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,o=d.useRef(!1);return d.useMemo(()=>t?{onMouseDown:s=>{(n==="open"&&!r||n==="close"&&r)&&(o.current=!0,Be(s.currentTarget).addEventListener("click",()=>{o.current=!1},{once:!0}))},onClick:s=>{o.current&&(o.current=!1,s.preventBaseUIHandler())}}:ct,[t,n,r])}const X0=sd(function(t,n){const{render:r,className:o,style:s,disabled:i=!1,nativeButton:a=!0,id:c,openOnHover:u,delay:f=100,closeDelay:h=0,handle:g,payload:A,...p}=t,m=ir(!0),v=fd(g)??m?.store;if(!v)throw new Error(ot(85));const b=It(c),y=v.useState("isTriggerActive",b),C=v.useState("floatingRootContext"),w=v.useState("isOpenedByTrigger",b),I=v.useState("triggerPopupId",b),S=d.useRef(null),R=ex(),E=Bi(!0),k=wn(),F=d.useMemo(()=>k??new ra,[k]),T=Zu(F),N=In(),{registerTrigger:M,isMountedByThisTrigger:D}=cd(b,S,v,{payload:A,closeDelay:h,parent:R,floatingTreeRoot:F,floatingNodeId:T,floatingParentNodeId:N,keyboardEventRelay:E?.relayKeyboardEvent}),L=R.type==="menubar",_=v.useState("disabled"),j=i||_||L&&R.context.disabled,{getButtonProps:H,buttonRef:P}=Gt({disabled:j,native:a});d.useEffect(()=>{!w&&R.type===void 0&&(v.context.allowMouseUpTriggerRef.current=!1)},[v,w,R.type]);const B=d.useRef(null),O=pt(),G=de(re=>{if(!B.current)return;O.clear(),v.context.allowMouseUpTriggerRef.current=!1;const se=re.target;ve(B.current,se)||ve(v.select("positionerElement"),se)||se===B.current||se!=null&&Qd(se)===v.select("rootId")||Ld(re,B.current)||F.events.emit("close",{domEvent:re,reason:pu})});d.useEffect(()=>{w&&v.select("lastOpenChangeReason")===at&&Be(B.current).addEventListener("mouseup",G,{once:!0})},[w,G,v]);const z=L&&R.context.hasSubmenuOpen,Q=gd(C,{enabled:(u??z)&&!j&&(!L||z&&!D),handleClose:bd({blockPointerEvents:!L}),mouseOnly:!0,move:!1,restMs:R.type===void 0?f:void 0,delay:{close:h},triggerElementRef:S,externalTree:F,isActiveTrigger:y,isClosing:()=>v.select("transitionStatus")==="ending"}),Z=q0(w,v.select("lastOpenChangeReason")),K=Ju(C,{enabled:!j,event:w&&L?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:R.type===void 0?Z:!1}),te=pd(C,{enabled:!j&&z}),le=$0({open:w,enabled:L,mouseDownAction:"open"}),X=d.useMemo(()=>Bt(te.reference,K.reference),[te.reference,K.reference]),ee=v.useState("triggerProps",D),{preFocusGuardRef:J,handlePreFocusGuardFocus:ce,handleFocusTargetFocus:ue}=J0(v,S),ge={disabled:j,open:w},ae=[B,n,P,M,S],pe=[X,Q??ct,ee,{"aria-haspopup":"menu","aria-controls":I,id:b,onMouseDown:re=>{if(v.select("open"))return;O.start(200,()=>{v.context.allowMouseUpTriggerRef.current=!0}),Be(re.currentTarget).addEventListener("mouseup",G,{once:!0})}},L?{role:"menuitem"}:{},le,p,H],oe=je("button",t,{enabled:!L,stateAttributesMapping:oi,state:ge,ref:ae,props:pe});return L?l.jsx(Wd,{tag:"button",render:r,className:o,style:s,state:ge,refs:ae,props:pe,stateAttributesMapping:oi}):w?l.jsxs(d.Fragment,{children:[l.jsx(tr,{ref:J,onFocus:ce},`${b}-pre-focus-guard`),l.jsx(d.Fragment,{children:oe},b),l.jsx(tr,{ref:v.context.triggerFocusTargetRef,onFocus:ue},`${b}-post-focus-guard`)]}):l.jsx(d.Fragment,{children:oe},b)});function q0(e,t){const n=pt(),[r,o]=d.useState(!1);return ie(()=>{e&&t===at?(o(!0),n.start(QA,()=>{o(!1)})):e||(n.clear(),o(!1))},[e,t,n]),r}function ex(){const e=Hd();return d.useMemo(()=>e?{type:"menubar",context:e}:{type:void 0},[e])}function Gd(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function Do({...e}){return l.jsx(U0,{"data-slot":"dropdown-menu",...e})}function Fo({...e}){return l.jsx(X0,{"data-slot":"dropdown-menu-trigger",...e})}function Bo({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=4,className:o,...s}){return l.jsx(j0,{children:l.jsx(H0,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:r,children:l.jsx(F0,{"data-slot":"dropdown-menu-content",className:fe("cn-menu-target cn-menu-translucent z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",o),...s})})})}function jo({className:e,inset:t,variant:n="default",...r}){return l.jsx(R0,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:fe("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...r})}const Mo=["zh-CN","ja","ko","en","ar","fr","es","de","ru"],tx=["ar"],Yd=e=>tx.includes(e)?"rtl":"ltr",nx=e=>({"zh-CN":"简体中文",ja:"日本語",ko:"한국어",en:"English",ar:"العربية",fr:"Français",es:"Español",de:"Deutsch",ru:"Русский"})[e],rx=e=>{for(const t of e){const n=t.toLowerCase(),r=Mo.find(i=>i.toLowerCase()===n);if(r!==void 0)return r;const o=n.split("-")[0],s=Mo.find(i=>i.toLowerCase().split("-")[0]===o);if(s!==void 0)return s;if(o==="zh")return"zh-CN"}return"en"},$t={nav:{add:"Add",applications:"Applications",help:"Help Center"},shell:{product:"create-opentray",toggleSidebar:"Toggle Sidebar"},common:{loading:"Loading…",error:"Something went wrong.",retry:"Retry",cancel:"Cancel",confirm:"Confirm",close:"Close",copy:"Copy",copied:"Copied",download:"Download",refresh:"Refresh",empty:"Nothing here yet."},theme:{title:"Theme",system:"System",light:"Light",dark:"Dark"},language:{title:"Language"},applications:{title:"Applications",statusHealthy:"Healthy",statusInvalidConfig:"Invalid config",statusIncompatible:"Incompatible version",statusMissingPayload:"Missing payload",statusBrokenLink:"Broken link",statusRunning:"Running",edit:"Edit",open:"Open",share:"Share",details:"Details",source:"Source",sourceWizard:"Wizard",sourceRegistered:"Registered",detailsCommand:"Command",detailsCwd:"Working directory",detailsEnv:"Environment keys",detailsPm:"Package manager",detailsWindow:"Window",detailsDevMode:"Developer mode",detailsProjectDir:"Project directory",detailsServiceHint:"Service port hint",uninstall:"Uninstall",uninstallTitle:"Uninstall application?",uninstallDescription:"The registration and its payload link are removed. Dock/taskbar pins must be removed manually.",uninstallWizardDescription:"The wizard project directory and its materialized app bundle are removed after stopping a running entry when authorized. Dock/taskbar pins must be removed manually.",stopRunningTitle:"Force stop and uninstall?",stopRunningDescription:"The application is still running (likely a leftover from an earlier session). Continuing terminates its process tree first, then removes the project.",stopRunningConfirm:"Force stop and uninstall",stopRunningPids:"Running pids",uninstallPurge:"Also delete the linked external target",uninstallPurgeHint:"Deletes the external directory itself after identity revalidation. This cannot be undone.",uninstallPinHint:"macOS Dock pins and Windows taskbar pins are user-managed; remove them manually if present.",emptyHint:"No applications yet — create one from Add.",payload:"Payload",registration:"Registration",linked:"Linked",uninstallRetained:"External target retained:",uninstallDeleted:"External target deleted:"},help:{title:"Help Center",listTitle:"Documents",empty:"No documents available.",readError:"This document could not be read."},export:{title:"Export",shareTitle:"Share application",shareSubtitle:"Built from the current wizard parameters — nothing runs, nothing is written.",command:"Direct command",scriptSh:"Shell script (.sh)",scriptPs1:"PowerShell script (.ps1)",copyCommand:"Copy command",downloadScript:"Download script",downloadFile:"Download file",viewFull:"View full content",building:"Building…",inlineIcon:"Inline icon bytes",inlineIconHint:"Web-scraped icons share as their original URL by default and local icons embed their bytes; toggle to switch between embedding and sharing by reference.",forceCopy:"Force direct copy with embedded icon",forceCopyHint:"Uploaded icons embed as very long data URLs. Scripts are the default; check this only if you accept the length.",envAck:"I reviewed the environment values and accept exporting them",envAckHint:"This application defines environment entries. Complete export includes their values.",envReview:"Environment values (editable before export)",blocked:"Export blocked:"}},un=(e,t)=>{const n=(r,o)=>{if(typeof r=="object"&&r!==null&&!Array.isArray(r)&&typeof o=="object"&&o!==null){const s={...r};for(const[i,a]of Object.entries(o))a!==void 0&&(s[i]=n(r[i],a));return s}return o===void 0?r:o};return n(e,t)},ox={shell:{product:"create-opentray",toggleSidebar:"切换侧边栏"},nav:{add:"新增",applications:"应用列表",help:"帮助中心"},common:{loading:"加载中…",error:"出错了。",retry:"重试",cancel:"取消",confirm:"确认",close:"关闭",copy:"复制",copied:"已复制",download:"下载",refresh:"刷新",empty:"暂无内容。"},theme:{title:"主题",system:"跟随系统",light:"浅色",dark:"深色"},language:{title:"语言"},applications:{title:"应用列表",statusHealthy:"正常",statusInvalidConfig:"配置无效",statusIncompatible:"版本不兼容",statusMissingPayload:"负载缺失",statusBrokenLink:"链接失效",statusRunning:"运行中",edit:"编辑",open:"打开应用",share:"分享",details:"详情",source:"来源",sourceWizard:"向导",sourceRegistered:"注册",detailsCommand:"命令",detailsCwd:"工作目录",detailsEnv:"环境变量键",detailsPm:"包管理器",detailsWindow:"窗口",detailsDevMode:"开发者模式",detailsProjectDir:"项目目录",detailsServiceHint:"服务端口提示",uninstall:"卸载",uninstallTitle:"卸载应用?",uninstallDescription:"将删除注册信息与负载链接。Dock/任务栏图标需手动移除。",uninstallWizardDescription:"将停止运行中的应用(如已授权)并删除项目目录与已物化的应用 Bundle。Dock/任务栏图标需手动移除。",stopRunningTitle:"强制停止并卸载?",stopRunningDescription:"应用仍在运行(可能是上次会话的残留)。继续将先终止其进程树,再删除项目目录与已物化的 Bundle。",stopRunningConfirm:"强制停止并卸载",stopRunningPids:"运行中的进程",uninstallPurge:"同时删除链接的外部目录",uninstallPurgeHint:"重新校验身份后删除外部目录本身,此操作不可撤销。",uninstallPinHint:"macOS Dock 与 Windows 任务栏图标由系统管理,请手动移除。",emptyHint:"还没有应用——去「新增」创建一个。",payload:"负载",registration:"注册",linked:"链接",uninstallRetained:"外部目录已保留:",uninstallDeleted:"外部目录已删除:"},help:{title:"帮助中心",listTitle:"文档",empty:"暂无文档。",readError:"无法读取该文档。"},export:{title:"导出",shareTitle:"分享应用",shareSubtitle:"基于当前向导参数构建——不运行命令、不写入任何内容。",command:"直接命令",scriptSh:"Shell 脚本(.sh)",scriptPs1:"PowerShell 脚本(.ps1)",copyCommand:"复制命令",downloadScript:"下载脚本",downloadFile:"下载文件",viewFull:"查看完整内容",building:"生成中…",inlineIcon:"内联图标字节",inlineIconHint:"网页抓取的图标默认以原始链接分享、本地图标默认内嵌字节;勾选状态即在内嵌与按引用分享之间切换。",forceCopy:"强制直接复制(内嵌图标)",forceCopyHint:"上传的图标会以很长的 data URL 内嵌,默认导出脚本;仅在你接受长度时勾选。",envAck:"我已检查环境变量并接受导出",envAckHint:"该应用定义了环境变量,完整导出将包含其值。",envReview:"环境变量(导出前可编辑)",blocked:"导出被阻止:"}},sx={shell:{product:"create-opentray",toggleSidebar:"サイドバー切替"},nav:{add:"追加",applications:"アプリ一覧",help:"ヘルプセンター"},common:{loading:"読み込み中…",error:"エラーが発生しました。",retry:"再試行",cancel:"キャンセル",confirm:"確認",close:"閉じる",copy:"コピー",copied:"コピーしました",download:"ダウンロード",refresh:"更新",empty:"まだ何もありません。"},theme:{title:"テーマ",system:"システム",light:"ライト",dark:"ダーク"},language:{title:"言語"},applications:{title:"アプリ一覧",statusHealthy:"正常",statusInvalidConfig:"設定が無効",statusIncompatible:"バージョン非対応",statusMissingPayload:"ペイロード欠落",statusBrokenLink:"リンク切れ",statusRunning:"実行中",edit:"編集",uninstall:"アンインストール",uninstallTitle:"アプリをアンインストールしますか?",uninstallDescription:"登録とペイロードリンクを削除します。Dock/タスクバーのピンは手動で外してください。",uninstallPurge:"リンク先の外部ディレクトリも削除する",uninstallPurgeHint:"身份を再検証した上で外部ディレクトリ自体を削除します。元に戻せません。",uninstallPinHint:"macOS の Dock ピンと Windows のタスクバーピンは手動で管理してください。",emptyHint:"登録済みアプリはまだありません。「追加」から作成してください。",payload:"ペイロード",registration:"登録",linked:"リンク",uninstallRetained:"外部ディレクトリは保持されました:",uninstallDeleted:"外部ディレクトリを削除しました:"},help:{title:"ヘルプセンター",listTitle:"ドキュメント",empty:"ドキュメントはありません。",readError:"このドキュメントは読み込めませんでした。"},export:{title:"エクスポート",command:"直接コマンド",scriptSh:"Shell スクリプト(.sh)",scriptPs1:"PowerShell スクリプト(.ps1)",copyCommand:"コマンドをコピー",downloadScript:"スクリプトをダウンロード",forceCopy:"アイコン埋め込みの直接コピーを強制する",forceCopyHint:"アップロードしたアイコンは非常に長い data URL として埋め込まれます。既定はスクリプトです。",envAck:"環境変数を確認し、エクスポートを許可します",envAckHint:"このアプリには環境変数が定義されており、完全なエクスポートに値が含まれます。",envReview:"環境変数(エクスポート前に編集可)",blocked:"エクスポートをブロック:"}},ix={shell:{product:"create-opentray",toggleSidebar:"사이드바 전환"},nav:{add:"추가",applications:"앱 목록",help:"도움말 센터"},common:{loading:"불러오는 중…",error:"문제가 발생했습니다.",retry:"재시도",cancel:"취소",confirm:"확인",close:"닫기",copy:"복사",copied:"복사됨",download:"다운로드",refresh:"새로고침",empty:"아직 없습니다."},theme:{title:"테마",system:"시스템",light:"라이트",dark:"다크"},language:{title:"언어"},applications:{title:"앱 목록",statusHealthy:"정상",statusInvalidConfig:"구성 무효",statusIncompatible:"버전 비호환",statusMissingPayload:"페이로드 누락",statusBrokenLink:"링크 끊김",statusRunning:"실행 중",edit:"편집",uninstall:"제거",uninstallTitle:"앱을 제거할까요?",uninstallDescription:"등록 정보와 페이로드 링크가 삭제됩니다. Dock/작업표시줄 고정은 직접 해제하세요.",uninstallPurge:"연결된 외부 디렉터리도 삭제",uninstallPurgeHint:"신원 재검증 후 외부 디렉터리 자체를 삭제합니다. 되돌릴 수 없습니다.",uninstallPinHint:"macOS Dock 고정과 Windows 작업표시줄 고정은 직접 관리해야 합니다.",emptyHint:"등록된 앱이 아직 없습니다. 「추가」에서 만들어 보세요.",payload:"페이로드",registration:"등록",linked:"링크",uninstallRetained:"외부 디렉터리 유지됨:",uninstallDeleted:"외부 디렉터리 삭제됨:"},help:{title:"도움말 센터",listTitle:"문서",empty:"문서가 없습니다.",readError:"이 문서를 읽을 수 없습니다."},export:{title:"내보내기",command:"직접 명령",scriptSh:"Shell 스크립트(.sh)",scriptPs1:"PowerShell 스크립트(.ps1)",copyCommand:"명령 복사",downloadScript:"스크립트 다운로드",forceCopy:"아이콘 포함 직접 복사 강제",forceCopyHint:"업로드한 아이콘은 매우 긴 data URL로 포함됩니다. 기본은 스크립트입니다.",envAck:"환경 변수를 확인했으며 내보내기를 허용합니다",envAckHint:"이 앱에는 환경 변수가 정의되어 있어 전체 내보내기에 값이 포함됩니다.",envReview:"환경 변수(내보내기 전 편집 가능)",blocked:"내보내기 차단:"}},ax={shell:{product:"create-opentray",toggleSidebar:"تبديل الشريط الجانبي"},nav:{add:"إضافة",applications:"التطبيقات",help:"مركز المساعدة"},common:{loading:"جارٍ التحميل…",error:"حدث خطأ.",retry:"إعادة المحاولة",cancel:"إلغاء",confirm:"تأكيد",close:"إغلاق",copy:"نسخ",copied:"تم النسخ",download:"تنزيل",refresh:"تحديث",empty:"لا يوجد شيء بعد."},theme:{title:"المظهر",system:"النظام",light:"فاتح",dark:"داكن"},language:{title:"اللغة"},applications:{title:"التطبيقات",statusHealthy:"سليم",statusInvalidConfig:"تهيئة غير صالحة",statusIncompatible:"إصدار غير متوافق",statusMissingPayload:"الحِمل مفقود",statusBrokenLink:"رابط معطّل",statusRunning:"قيد التشغيل",edit:"تحرير",uninstall:"إزالة",uninstallTitle:"إزالة التطبيق؟",uninstallDescription:"سيُحذف التسجيل ورابط الحِمل. يجب إزالة تثبيت Dock/شريط المهام يدويًا.",uninstallPurge:"حذف الدليل الخارجي المرتبط أيضًا",uninstallPurgeHint:"يحذف الدليل الخارجي نفسه بعد إعادة التحقق من الهوية. لا يمكن التراجع.",uninstallPinHint:"تثبيتات Dock في macOS وشريط المهام في Windows يديرها المستخدم؛ أزلها يدويًا.",emptyHint:"لا توجد تطبيقات مسجلة بعد — أنشئ واحدًا من «إضافة».",payload:"الحِمل",registration:"التسجيل",linked:"مرتبط",uninstallRetained:"احتُفظ بالدليل الخارجي:",uninstallDeleted:"حُذف الدليل الخارجي:"},help:{title:"مركز المساعدة",listTitle:"المستندات",empty:"لا توجد مستندات.",readError:"تعذّرت قراءة هذا المستند."},export:{title:"تصدير",command:"أمر مباشر",scriptSh:"سكربت Shell (.sh)",scriptPs1:"سكربت PowerShell (.ps1)",copyCommand:"نسخ الأمر",downloadScript:"تنزيل السكربت",forceCopy:"فرض النسخ المباشر مع تضمين الأيقونة",forceCopyHint:"تُضمَّن الأيقونات المرفوعة كعناوين data URL طويلة جدًا؛ السكربت هو الافتراضي.",envAck:"راجعت متغيرات البيئة وأوافق على تصديرها",envAckHint:"يحدّد هذا التطبيق متغيرات بيئة، وسيشمل التصدير الكامل قيمها.",envReview:"متغيرات البيئة (قابلة للتحرير قبل التصدير)",blocked:"التصدير محجوب:"}},lx={shell:{product:"create-opentray",toggleSidebar:"Basculer la barre latérale"},nav:{add:"Ajouter",applications:"Applications",help:"Centre d'aide"},common:{loading:"Chargement…",error:"Une erreur est survenue.",retry:"Réessayer",cancel:"Annuler",confirm:"Confirmer",close:"Fermer",copy:"Copier",copied:"Copié",download:"Télécharger",refresh:"Actualiser",empty:"Rien pour le moment."},theme:{title:"Thème",system:"Système",light:"Clair",dark:"Sombre"},language:{title:"Langue"},applications:{title:"Applications",statusHealthy:"Sain",statusInvalidConfig:"Config invalide",statusIncompatible:"Version incompatible",statusMissingPayload:"Charge utile manquante",statusBrokenLink:"Lien rompu",statusRunning:"En cours",edit:"Modifier",uninstall:"Désinstaller",uninstallTitle:"Désinstaller l'application ?",uninstallDescription:"L'enregistrement et le lien de charge utile sont supprimés. Les épingles Dock/barre des tâches se retirent manuellement.",uninstallPurge:"Supprimer aussi le répertoire externe lié",uninstallPurgeHint:"Supprime le répertoire externe lui-même après revalidation de l'identité. Irréversible.",uninstallPinHint:"Les épingles Dock (macOS) et barre des tâches (Windows) sont gérées par l'utilisateur.",emptyHint:"Aucune application enregistrée — créez-en une depuis Ajouter.",payload:"Charge utile",registration:"Enregistrement",linked:"Lié",uninstallRetained:"Répertoire externe conservé :",uninstallDeleted:"Répertoire externe supprimé :"},help:{title:"Centre d'aide",listTitle:"Documents",empty:"Aucun document.",readError:"Impossible de lire ce document."},export:{title:"Exporter",command:"Commande directe",scriptSh:"Script shell (.sh)",scriptPs1:"Script PowerShell (.ps1)",copyCommand:"Copier la commande",downloadScript:"Télécharger le script",forceCopy:"Forcer la copie directe avec icône intégrée",forceCopyHint:"Les icônes téléversées sont incorporées en data URLs très longues ; le script est la valeur par défaut.",envAck:"J'ai revu les variables d'environnement et accepte de les exporter",envAckHint:"Cette application définit des variables d'environnement ; l'export complet inclut leurs valeurs.",envReview:"Variables d'environnement (modifiables avant export)",blocked:"Export bloqué :"}},cx={shell:{product:"create-opentray",toggleSidebar:"Alternar barra lateral"},nav:{add:"Añadir",applications:"Aplicaciones",help:"Centro de ayuda"},common:{loading:"Cargando…",error:"Algo salió mal.",retry:"Reintentar",cancel:"Cancelar",confirm:"Confirmar",close:"Cerrar",copy:"Copiar",copied:"Copiado",download:"Descargar",refresh:"Actualizar",empty:"Aún no hay nada."},theme:{title:"Tema",system:"Sistema",light:"Claro",dark:"Oscuro"},language:{title:"Idioma"},applications:{title:"Aplicaciones",statusHealthy:"Sano",statusInvalidConfig:"Config no válida",statusIncompatible:"Versión incompatible",statusMissingPayload:"Carga útil ausente",statusBrokenLink:"Enlace roto",statusRunning:"En ejecución",edit:"Editar",uninstall:"Desinstalar",uninstallTitle:"¿Desinstalar la aplicación?",uninstallDescription:"Se eliminan el registro y el enlace de carga útil. Los anclajes del Dock/barra de tareas se quitan manualmente.",uninstallPurge:"Eliminar también el directorio externo enlazado",uninstallPurgeHint:"Elimina el directorio externo tras revalidar la identidad. No se puede deshacer.",uninstallPinHint:"Los anclajes del Dock (macOS) y de la barra de tareas (Windows) los gestiona el usuario.",emptyHint:"Aún no hay aplicaciones registradas: crea una desde Añadir.",payload:"Carga útil",registration:"Registro",linked:"Enlazado",uninstallRetained:"Directorio externo conservado:",uninstallDeleted:"Directorio externo eliminado:"},help:{title:"Centro de ayuda",listTitle:"Documentos",empty:"No hay documentos.",readError:"No se pudo leer este documento."},export:{title:"Exportar",command:"Comando directo",scriptSh:"Script de shell (.sh)",scriptPs1:"Script de PowerShell (.ps1)",copyCommand:"Copiar comando",downloadScript:"Descargar script",forceCopy:"Forzar copia directa con icono incrustado",forceCopyHint:"Los iconos subidos se incrustan como data URLs muy largas; el script es la opción predeterminada.",envAck:"He revisado las variables de entorno y acepto exportarlas",envAckHint:"Esta aplicación define variables de entorno; la exportación completa incluye sus valores.",envReview:"Variables de entorno (editables antes de exportar)",blocked:"Exportación bloqueada:"}},ux={shell:{product:"create-opentray",toggleSidebar:"Seitenleiste umschalten"},nav:{add:"Hinzufügen",applications:"Anwendungen",help:"Hilfecenter"},common:{loading:"Lädt…",error:"Etwas ist schiefgelaufen.",retry:"Erneut versuchen",cancel:"Abbrechen",confirm:"Bestätigen",close:"Schließen",copy:"Kopieren",copied:"Kopiert",download:"Herunterladen",refresh:"Aktualisieren",empty:"Noch nichts vorhanden."},theme:{title:"Design",system:"System",light:"Hell",dark:"Dunkel"},language:{title:"Sprache"},applications:{title:"Anwendungen",statusHealthy:"Intakt",statusInvalidConfig:"Ungültige Konfiguration",statusIncompatible:"Inkompatible Version",statusMissingPayload:"Payload fehlt",statusBrokenLink:"Defekter Link",statusRunning:"Läuft",edit:"Bearbeiten",uninstall:"Deinstallieren",uninstallTitle:"Anwendung deinstallieren?",uninstallDescription:"Registrierung und Payload-Link werden entfernt. Dock-/Taskleisten-Anker bitte manuell entfernen.",uninstallPurge:"Verknüpftes externes Verzeichnis ebenfalls löschen",uninstallPurgeHint:"Löscht das externe Verzeichnis nach Identitätsprüfung. Nicht rückgängig machbar.",uninstallPinHint:"Dock-Anker (macOS) und Taskleisten-Anker (Windows) verwaltet der Benutzer manuell.",emptyHint:"Noch keine registrierten Anwendungen — erstelle eine unter „Hinzufügen“.",payload:"Payload",registration:"Registrierung",linked:"Verknüpft",uninstallRetained:"Externes Verzeichnis behalten:",uninstallDeleted:"Externes Verzeichnis gelöscht:"},help:{title:"Hilfecenter",listTitle:"Dokumente",empty:"Keine Dokumente.",readError:"Dieses Dokument konnte nicht gelesen werden."},export:{title:"Exportieren",command:"Direktbefehl",scriptSh:"Shell-Skript (.sh)",scriptPs1:"PowerShell-Skript (.ps1)",copyCommand:"Befehl kopieren",downloadScript:"Skript herunterladen",forceCopy:"Direktes Kopieren mit eingebettetem Symbol erzwingen",forceCopyHint:"Hochgeladene Symbole werden als sehr lange Data-URLs eingebettet; Standard ist das Skript.",envAck:"Ich habe die Umgebungsvariablen geprüft und akzeptiere ihren Export",envAckHint:"Diese Anwendung definiert Umgebungsvariablen; der vollständige Export enthält deren Werte.",envReview:"Umgebungsvariablen (vor dem Export bearbeitbar)",blocked:"Export blockiert:"}},dx={shell:{product:"create-opentray",toggleSidebar:"Показать/скрыть боковую панель"},nav:{add:"Добавить",applications:"Приложения",help:"Центр справки"},common:{loading:"Загрузка…",error:"Что-то пошло не так.",retry:"Повторить",cancel:"Отмена",confirm:"Подтвердить",close:"Закрыть",copy:"Копировать",copied:"Скопировано",download:"Скачать",refresh:"Обновить",empty:"Пока ничего нет."},theme:{title:"Тема",system:"Системная",light:"Светлая",dark:"Тёмная"},language:{title:"Язык"},applications:{title:"Приложения",statusHealthy:"Исправно",statusInvalidConfig:"Неверная конфигурация",statusIncompatible:"Несовместимая версия",statusMissingPayload:"Отсутствует payload",statusBrokenLink:"Битая ссылка",statusRunning:"Выполняется",edit:"Изменить",uninstall:"Удалить",uninstallTitle:"Удалить приложение?",uninstallDescription:"Регистрация и ссылка payload будут удалены. Значки Dock/панели задач удаляйте вручную.",uninstallPurge:"Также удалить связанный внешний каталог",uninstallPurgeHint:"Удаляет внешний каталог после повторной проверки идентичности. Отменить нельзя.",uninstallPinHint:"Значки Dock (macOS) и панели задач (Windows) управляются пользователем вручную.",emptyHint:"Зарегистрированных приложений пока нет — создайте первое в разделе «Добавить».",payload:"Payload",registration:"Регистрация",linked:"Ссылка",uninstallRetained:"Внешний каталог сохранён:",uninstallDeleted:"Внешний каталог удалён:"},help:{title:"Центр справки",listTitle:"Документы",empty:"Документов нет.",readError:"Не удалось прочитать этот документ."},export:{title:"Экспорт",command:"Прямая команда",scriptSh:"Скрипт shell (.sh)",scriptPs1:"Скрипт PowerShell (.ps1)",copyCommand:"Копировать команду",downloadScript:"Скачать скрипт",forceCopy:"Принудительное копирование со встроенной иконкой",forceCopyHint:"Загруженные иконки встраиваются как очень длинные data-URL; по умолчанию — скрипт.",envAck:"Я проверил переменные окружения и согласен на их экспорт",envAckHint:"В этом приложении заданы переменные окружения; полный экспорт включает их значения.",envReview:"Переменные окружения (можно изменить перед экспортом)",blocked:"Экспорт заблокирован:"}},fx={en:$t,"zh-CN":un($t,ox),ja:un($t,sx),ko:un($t,ix),ar:un($t,ax),fr:un($t,lx),es:un($t,cx),de:un($t,ux),ru:un($t,dx)},px=e=>fx[e],zd="create-opentray.locale",Ud="create-opentray.theme",Vd="lang",Zd=new Set(Mo),hx=()=>{try{const t=new URLSearchParams(window.location.search).get(Vd);return t!==null&&Zd.has(t)?t:null}catch{return null}},Ax=e=>{try{const t=new URL(window.location.href);t.searchParams.set(Vd,e),window.history.replaceState(null,"",t)}catch{}},$l=e=>{try{return window.localStorage.getItem(e)}catch{return null}},Xl=(e,t)=>{try{window.localStorage.setItem(e,t)}catch{}},gx=()=>window.matchMedia("(prefers-color-scheme: dark)").matches,ql=e=>e==="system"?gx()?"dark":"light":e,hi=(e,t)=>{const n=document.documentElement;n.lang=e,n.dir=Yd(e),n.classList.toggle("dark",ql(t)==="dark"),n.style.colorScheme=ql(t)},mx=()=>{const e=hx(),t=e!==null?e:null,n=$l(zd),r=t!==null?t:n!==null&&Zd.has(n)?n:rx(navigator.languages??[navigator.language]),o=$l(Ud);return{locale:r,theme:o==="light"||o==="dark"||o==="system"?o:"system"}},Jd=d.createContext(void 0),xx=({initialLocale:e,initialTheme:t,children:n})=>{const[r,o]=d.useState(e),[s,i]=d.useState(t);d.useEffect(()=>{hi(r,s)},[r,s]),d.useEffect(()=>{if(s!=="system")return;const f=window.matchMedia("(prefers-color-scheme: dark)"),h=()=>{hi(r,"system")};return f.addEventListener("change",h),()=>f.removeEventListener("change",h)},[s,r]);const a=d.useCallback(f=>{Ax(f),Xl(zd,f),o(f)},[]),c=d.useCallback(f=>{Xl(Ud,f),i(f)},[]),u=d.useMemo(()=>({locale:r,messages:px(r),direction:Yd(r),theme:s,setLocale:a,setTheme:c}),[r,s,a,c]);return l.jsx(Jd.Provider,{value:u,children:n})},ps=()=>{const e=d.useContext(Jd);if(e===void 0)throw new Error("usePreferences must be used inside PreferencesProvider");return e},$d=d.createContext(void 0),Xd=()=>{const[e]=Tu(),t=d.useMemo(()=>new URLSearchParams(e.split("?")[1]??""),[e]),n=(e.split("?")[0]??"/add").replace(/^\/?/u,"");return{route:n==="applications"||n==="help"?n:"add",query:t}},qd=()=>{const e=d.useContext($d);if(e===void 0)throw new Error("useWorkbenchNavigation must be used inside WorkbenchShell");return e},bx={"zh-CN":"中",ja:"日",ko:"한",en:"EN",ar:"ع",fr:"FR",es:"ES",de:"DE",ru:"RU"},vx=({product:e})=>{const{state:t,toggleSidebar:n}=ds(),r=t==="collapsed",o=`${e} · ${r?"展开":"收起"}`;return r?l.jsx(kr,{size:"lg",className:"group/brand relative justify-center",children:l.jsxs("span",{className:"relative grid size-8 shrink-0 place-items-center",children:[l.jsx("img",{src:"/logo.png",alt:e,width:24,height:24,className:"size-6 rounded-md transition-opacity group-hover/brand:opacity-0 focus-visible-within:opacity-0"}),l.jsx("button",{type:"button",onClick:n,"aria-label":o,title:o,className:"absolute inset-0 grid place-items-center rounded-md opacity-0 transition-opacity hover:bg-sidebar-accent focus-visible:opacity-100 group-hover/brand:opacity-100",children:l.jsx(ll,{"aria-hidden":!0,className:"size-4"})})]})}):l.jsxs(kr,{size:"lg",className:"justify-start pr-1",children:[l.jsx("img",{src:"/logo.png",alt:e,width:24,height:24,className:"size-6 shrink-0 rounded-md"}),l.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:e}),l.jsx("button",{type:"button",onClick:n,"aria-label":o,title:o,className:"grid size-6 shrink-0 place-items-center rounded-md hover:bg-sidebar-accent",children:l.jsx(ll,{"aria-hidden":!0,className:"size-4"})})]})},yx=({children:e,panelOpen:t})=>{const{locale:n,messages:r,setLocale:o,theme:s,setTheme:i}=ps(),{route:a}=Xd(),c=d.useCallback(m=>{window.location.hash=`#/${m}`},[]),[u,f]=d.useState(()=>window.innerWidth>=768),h=t===!0;d.useEffect(()=>{const m=window.matchMedia("(min-width: 768px)"),x=()=>{f(m.matches&&!h)};return x(),m.addEventListener("change",x),()=>m.removeEventListener("change",x)},[h]);const g=d.useMemo(()=>({route:a,navigate:c}),[a,c]),A=[{route:"add",icon:l.jsx(mu,{"aria-hidden":!0}),label:r.nav.add},{route:"applications",icon:l.jsx(ph,{"aria-hidden":!0}),label:r.nav.applications},{route:"help",icon:l.jsx(Xp,{"aria-hidden":!0}),label:r.nav.help}],p=s==="system"?r.theme.system:s==="light"?r.theme.light:r.theme.dark;return l.jsx($d.Provider,{value:g,children:l.jsxs(h0,{open:u,onOpenChange:f,children:[l.jsxs(A0,{collapsible:"icon",children:[l.jsx(m0,{children:l.jsx(Ms,{children:l.jsx(oo,{children:l.jsx(vx,{product:r.shell.product})})})}),l.jsx(b0,{children:l.jsx(v0,{children:l.jsx(y0,{children:l.jsx(Ms,{children:A.map(m=>l.jsx(oo,{children:l.jsxs(ls,{children:[l.jsxs(cs,{render:l.jsx(kr,{isActive:a===m.route,tooltip:m.label,"aria-label":m.label,onClick:()=>{c(m.route)}}),children:[m.icon,l.jsx("span",{children:m.label})]}),l.jsx(us,{side:"right",children:m.label})]})},m.route))})})})}),l.jsx(x0,{children:l.jsxs(Ms,{children:[l.jsx(oo,{children:l.jsxs(Do,{children:[l.jsx(Fo,{render:l.jsxs(kr,{tooltip:r.language.title,"aria-label":r.language.title,children:[l.jsx("span",{"aria-hidden":!0,className:"text-xs font-semibold",children:bx[n]}),l.jsx("span",{children:r.language.title})]})}),l.jsx(Bo,{side:"top",align:"start",children:Mo.map(m=>l.jsx(jo,{onClick:()=>{o(m)},children:nx(m)},m))})]})}),l.jsx(oo,{children:l.jsxs(Do,{children:[l.jsx(Fo,{render:l.jsxs(kr,{tooltip:`${r.theme.title}: ${p}`,"aria-label":`${r.theme.title}: ${p}`,children:[s==="light"?l.jsx(Nh,{"aria-hidden":!0}):s==="dark"?l.jsx(yh,{"aria-hidden":!0}):l.jsx(bh,{"aria-hidden":!0}),l.jsx("span",{children:p})]})}),l.jsx(Bo,{side:"top",align:"start",children:[["system",r.theme.system],["light",r.theme.light],["dark",r.theme.dark]].map(([m,x])=>l.jsx(jo,{onClick:()=>{i(m)},children:x},m))})]})})]})}),l.jsx(g0,{"aria-label":r.shell.toggleSidebar})]}),l.jsx("main",{className:"relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden",children:e})]})})},Cx=()=>new URLSearchParams(window.location.search).get("token")??"",ln=async(e,t={})=>{const n=await fetch(e,{method:t.method??"GET",headers:{authorization:`Bearer ${Cx()}`,...t.body===void 0?{}:{"content-type":"application/json"}},...t.body===void 0?{}:{body:JSON.stringify(t.body)}}),r=await n.json().catch(()=>({}));return{status:n.status,data:r}},Ix=()=>ln("/api/apps"),ef=e=>ln(`/api/apps/${encodeURIComponent(e)}/config`),wx=e=>ln(`/api/apps/${encodeURIComponent(e)}/icon`),kx=(e,t)=>ln(`/api/apps/${encodeURIComponent(e)}/uninstall`,{method:"POST",body:{...t}}),Ex=()=>ln("/api/skill/list"),Sx=e=>ln(`/api/skill?path=${encodeURIComponent(e)}`),Rx=(e,t)=>ln(`/api/apps/${encodeURIComponent(e)}/export`,{method:"POST",body:{...t}}),Dx=e=>ln(`/api/apps/${encodeURIComponent(e)}/open`,{method:"POST",body:{}}),Fx=e=>ln("/api/export",{method:"POST",body:{...e}}).then(t=>{if(t.status!==200)return t;const n=t.data;return n.ok!==!0?{status:409,data:{code:n.code,message:n.message}}:{status:200,data:n.kind==="command"?{command:n.command}:{filename:n.filename,content:n.content,...n.commandLine===void 0?{}:{commandLine:n.commandLine},...n.iconSharedAs===void 0?{}:{iconSharedAs:n.iconSharedAs},...n.iconReference===void 0?{}:{iconReference:n.iconReference}}}});function Bx(e){if(!e)return null;for(const t of e.elements){const n=t.tagName;if(n==="BUTTON"||n==="INPUT"){const r=t;if(r.type==="submit")return r}}return null}function tf(e){return{checked(t){return e.indeterminate?{}:t?{"data-checked":""}:{"data-unchecked":""}},...ji}}const jx=d.createContext(void 0);function Mx(){return d.useContext(jx)}const nf=d.createContext(void 0);function Px(){const e=d.useContext(nf);if(e===void 0)throw new Error(ot(14));return e}const Tx="data-parent",Nx=d.forwardRef(function(t,n){const{checked:r,className:o,defaultChecked:s=!1,"aria-labelledby":i,disabled:a=!1,form:c,id:u,indeterminate:f=!1,inputRef:h,name:g,onCheckedChange:A,parent:p=!1,readOnly:m=!1,render:x,required:v=!1,uncheckedValue:b,value:y,nativeButton:C=!1,style:w,...I}=t,{clearErrors:S}=Mi(),{disabled:R,name:E,setDirty:k,setFilled:F,setFocused:T,setTouched:N,state:M,validationMode:D,validityData:L,validation:_}=Qo(),j=vA(),{labelId:H,controlId:P,registerControlId:B,getDescriptionProps:O}=Pi(),G=Mx(),z=G?.allValues===void 0?void 0:G.parent,U=z!==void 0,Q=R||j.disabled||G?.disabled||a,Z=E??g,K=y??Z,te=It(),le=It();let X=u||P;U&&(p?X=le:K!==void 0?X=`${z.id}-${K}`:X||=le);let ee={};U&&(p?ee=z.getParentProps():K!==void 0&&(ee=z.getChildProps(K)));const{checked:J=r,indeterminate:ce=f,onCheckedChange:ue,...ge}=ee,ae=G?.value,pe=d.useRef(null),oe=Dt(()=>Symbol()),re=d.useRef(!1),{getButtonProps:se,buttonRef:he}=Gt({disabled:Q,native:C}),me=G?.validation??_,[W,Y]=on({controlled:K!==void 0&&ae!==void 0&&!p?ae.includes(K):J,default:s,name:"Checkbox",state:"checked"}),ye=U?!!J:W,q=U&&ce||f;ie(()=>{B!==Er&&(re.current=!0,B(oe.current,X))},[X,B,oe]),d.useEffect(()=>{const Ie=oe.current;return()=>{!re.current||B===Er||(re.current=!1,B(Ie,void 0))}},[B,oe]),Ti(pe,te,W,void 0,!G&&!Q,g);const ne=d.useRef(null),Ee=me.registerInput,Se=G?K:void 0,Le=d.useCallback(Ie=>Ee(Ie,{controlRef:pe,value:Se}),[Ee,Se]),Je=Qt(h,ne,p?void 0:Le),We=bu(i,H,ne,!C,X??void 0);ie(()=>{ne.current&&(ne.current.indeterminate=q,W&&F(!0))},[W,q,F]),ss(W,()=>{G||(S(Z),F(W),k(W!==L.initialValue),me.change(W))});const ut=Bt({checked:W,disabled:Q,form:c,name:p?void 0:Z,id:C?void 0:X??void 0,required:v,ref:Je,style:Z?ta:$o,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(Ie){if(Ie.nativeEvent.defaultPrevented)return;if(m){Ie.preventDefault();return}const ze=Ie.currentTarget.checked,Ne=Ce(Mt,Ie.nativeEvent);if(A?.(ze,Ne),!Ne.isCanceled&&(ue?.(ze,Ne),!Ne.isCanceled&&(Y(ze),K!==void 0&&G!==void 0&&!p&&!U))){const nt=ze?[...G.value,K]:G.value.filter(Re=>Re!==K);G.setValue(nt,Ne)}},onClick(Ie){Ie.stopPropagation()},onFocus(){pe.current?.focus()}},y!==void 0?{value:(G?W&&y:y)||""}:ct,O,Ie=>me.getValidationProps(Q,Ie));d.useEffect(()=>{if(!z||K===void 0)return;const Ie=z.disabledStatesRef.current;return Ie.set(K,Q),()=>{Ie.delete(K)}},[z,Q,K]);const $e=d.useMemo(()=>({...M,checked:ye,disabled:Q,readOnly:m,required:v,indeterminate:q}),[M,ye,Q,m,v,q]),Ye=tf($e),mt=je("span",t,{state:$e,ref:[he,pe,n],props:[{id:C?X??void 0:te,role:"checkbox","aria-checked":q?"mixed":ye,"aria-readonly":m||void 0,"aria-required":v||void 0,"aria-labelledby":We,[Tx]:p?"":void 0,onFocus(){Q||T(!0)},onBlur(){const Ie=ne.current;Ie&&(N(!0),T(!1),D==="onBlur"&&me.commit(G?ae:Ie.checked))},onKeyDown(Ie){if(Ie.key!=="Enter"||(Ie.preventBaseUIHandler(),Ie.defaultPrevented))return;const ze=ne.current?.form??null,Ne=Ie.currentTarget,nt=Ie.nativeEvent,Re=Ie.preventDefault,Ge=nt.preventDefault;let _e=!1;Ie.preventDefault=()=>{_e=!0,Re.call(Ie)},nt.preventDefault=()=>{_e=!0,Ge.call(nt)},Ge.call(nt),rt(Ne).queueMicrotask(()=>{Ie.preventDefault=Re,nt.preventDefault=Ge,_e||Bx(ze)?.click()})},onClick(Ie){if(m||Q)return;Ie.preventDefault();const ze=ne.current;ze&&Fi(ze,Ie)}},I,ge,se,O,Ie=>me.getValidationProps(Q,Ie)],stateAttributesMapping:Ye});return l.jsxs(nf.Provider,{value:$e,children:[mt,!W&&!G&&Z&&!p&&b!==void 0&&l.jsx("input",{type:"hidden",form:c,name:Z,value:b,disabled:Q}),l.jsx("input",{...ut,suppressHydrationWarning:!0})]})}),_x=d.forwardRef(function(t,n){const{render:r,className:o,style:s,keepMounted:i=!1,...a}=t,c=Px(),u=c.checked||c.indeterminate,{mounted:f,transitionStatus:h,setMounted:g}=sr(u),A=d.useRef(null),p={...c,transitionStatus:h};Yt({open:u,ref:A,onComplete(){u||g(!1)}});const x={...tf(c),...Nn},v=i||f,b=je("span",t,{ref:[n,A],state:p,stateAttributesMapping:x,props:a});return v?b:null});function Ai({className:e,...t}){return l.jsx(Nx,{"data-slot":"checkbox",className:fe("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",e),...t,children:l.jsx(_x,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:l.jsx(_i,{})})})}function Me({className:e,...t}){return l.jsx("label",{"data-slot":"label",className:fe("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const rf=d.createContext(void 0);function of(){const e=d.useContext(rf);if(e===void 0)throw new Error(ot(10));return e}const Ox={value:()=>null},Hx=d.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,hiddenUntilFound:i,keepMounted:a,loopFocus:c,onValueChange:u,multiple:f=!1,orientation:h="vertical",value:g,defaultValue:A,style:p,...m}=t,x=d.useMemo(()=>{if(g===void 0)return A??[]},[g,A]),v=d.useRef([]),[b,y]=on({controlled:g,default:x,name:"Accordion",state:"value"}),C=de((R,E,k)=>{if(f)if(E){const F=b.slice();if(F.push(R),u?.(F,k),k.isCanceled)return;y(F)}else{const F=b.filter(T=>T!==R);if(u?.(F,k),k.isCanceled)return;y(F)}else{const F=b[0]===R?[]:[R];if(u?.(F,k),k.isCanceled)return;y(F)}}),w=d.useMemo(()=>({value:b,disabled:s,orientation:h}),[b,s,h]),I=d.useMemo(()=>({disabled:s,handleValueChange:C,hiddenUntilFound:i??!1,keepMounted:a??!1,state:w,value:b}),[s,C,i,a,w,b]),S=je("div",t,{state:w,ref:n,props:m,stateAttributesMapping:Ox});return l.jsx(rf.Provider,{value:I,children:l.jsx(Ur,{elementsRef:v,children:S})})});function Lx(e){const{open:t,defaultOpen:n,onOpenChange:r,disabled:o}=e,[s,i]=on({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:a,setMounted:c,transitionStatus:u}=sr(s,!0,!0),f=It(),[h,g]=d.useState(),A=h===null?void 0:h??f,p=de(m=>{const x=!s,v=Ce(Pn,m.nativeEvent);r(x,v),!v.isCanceled&&i(x)});return d.useMemo(()=>({defaultPanelId:f,disabled:o,handleTrigger:p,mounted:a,open:s,panelId:A,setMounted:c,setOpen:i,setPanelIdState:g,transitionStatus:u}),[f,o,p,a,s,A,c,i,g,u])}const sf=d.createContext(void 0);function af(){const e=d.useContext(sf);if(e===void 0)throw new Error(ot(15));return e}const lf=d.createContext(void 0);function Sa(){const e=d.useContext(lf);if(e===void 0)throw new Error(ot(9));return e}let Ra=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=ko.startingStyle]="startingStyle",e[e.endingStyle=ko.endingStyle]="endingStyle",e})({}),Kx=(function(e){return e.panelOpen="data-panel-open",e})({});const Wx={[Ra.open]:""},Qx={[Ra.closed]:""},Gx={open(e){return e?{[Kx.panelOpen]:""}:null}},Yx={open(e){return e?Wx:Qx}};let zx=(function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e})({});const Da={...Yx,index:e=>({[zx.index]:String(e)}),...Nn,value:()=>null},Ux=d.forwardRef(function(t,n){const{className:r,disabled:o=!1,onOpenChange:s,render:i,value:a,style:c,...u}=t,{ref:f,index:h}=fs(),g=Qt(n,f),{disabled:A,handleValueChange:p,state:m,value:x}=of(),v=It(),b=a??v,y=o||A,C=x.indexOf(b)!==-1,w=de((L,_)=>{s?.(L,_),!_.isCanceled&&p(b,L,_)}),I=Lx({open:C,onOpenChange:w,disabled:y}),S=d.useMemo(()=>({open:I.open,disabled:I.disabled,transitionStatus:I.transitionStatus}),[I.open,I.disabled,I.transitionStatus]),R=d.useMemo(()=>({...I,onOpenChange:w,state:S}),[I,S,w]),E=d.useMemo(()=>({...m,hidden:!C&&!I.mounted,index:h,disabled:y,open:C}),[I.mounted,y,h,C,m]),k=It(),[F,T]=d.useState(),N=F===null?void 0:F??k,M=d.useMemo(()=>({defaultTriggerId:k,open:C,state:E,setTriggerId:T,triggerId:N}),[k,C,E,T,N]),D=je("div",t,{state:E,ref:g,props:u,stateAttributesMapping:Da});return l.jsx(sf.Provider,{value:R,children:l.jsx(lf.Provider,{value:M,children:D})})}),Vx=d.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,{state:a}=Sa();return je("h3",t,{state:a,ref:n,props:i,stateAttributesMapping:Da})}),Zx=d.forwardRef(function(t,n){const{disabled:r,className:o,id:s,render:i,nativeButton:a=!0,style:c,...u}=t,{panelId:f,open:h,handleTrigger:g,disabled:A}=af(),p=r||A,{getButtonProps:m,buttonRef:x}=Gt({disabled:p,focusableWhenDisabled:!0,native:a}),{defaultTriggerId:v,state:b,setTriggerId:y}=Sa(),C=s||void 0,w=C??v;return ie(()=>(y(R=>C??(R===null?void 0:R)),()=>{y(R=>R===C?null:R)}),[C,y]),je("button",t,{state:b,ref:[n,x],props:[{"aria-controls":h?f:void 0,"aria-expanded":h,id:w,onClick:g},u,m],stateAttributesMapping:Gx})}),cr={height:void 0,width:void 0};function Jx(e){const{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:o,mounted:s,onOpenChange:i,open:a,setMounted:c,setOpen:u,transitionStatus:f}=e,h=d.useRef(null),g=d.useRef(null),[A,p]=d.useState(cr),m=d.useRef(cr),x=d.useRef(!1),v=d.useRef(a),b=d.useRef(!1),[y,C]=d.useState(!1),w=d.useRef(null),I=Qt(t,h),S=tt(a),R=$i(h),E=!a&&!s,k=y?"idle":f,F=a&&(v.current||b.current),T=!a&&s&&g.current==="css-animation"&&A.height===void 0&&A.width===void 0?m.current:A,N=n&&E&&g.current!=="css-animation",M=de((H,P=!0)=>{P&&(m.current=H),p(H)}),D=de(()=>{w.current?.(),w.current=null}),L=de(H=>{D(),w.current=()=>{w.current=null,H()}}),_=de(()=>{a&&s&&g.current==="css-animation"&&(b.current=!0)});ie(()=>{!y||f==="starting"||C(!1)},[y,f]),d.useEffect(()=>()=>{_(),D()},[_,D]),ie(()=>{const H=h.current;if(!H)return;!a&&w.current&&D();const P=$x(H,F);if(g.current=P,a&&f==="idle"&&v.current&&P==="css-animation"){m.current=Hn(H);return}if(a&&f==="starting"){const G=x.current;if(x.current=!1,P==="none"){M(Hn(H)),C(!0);return}if(P==="css-transition"){const Q=Xx(H);if(M(Hn(H)),!G)return Q;const Z=io(H,"transition-duration","0s");return L(Z),C(!0),Q}M(Hn(H));const z=io(H,"animation-name","none");if(!G){z();return}const U=io(H,"animation-duration","0s");z(),L(U),C(!0);return}if(!a&&s&&(f==="idle"||f==="starting")){if(v.current=!1,b.current=!1,P==="none"){M(cr,!1),c(!1);return}M(Hn(H));return}if(f!=="ending")return;if(P==="none"){c(!1);return}const B=Hn(H);if(!(B.height>0||B.width>0)){c(!1);return}M(B),P==="css-animation"&&io(H,"animation-name","none")()},[s,a,D,M,c,L,F,f]),Yt({enabled:a&&s&&k==="idle",open:!0,ref:h,onComplete(){a&&M(cr,!1)}}),d.useEffect(()=>{if(a||!s||k!=="ending"||!h.current)return;const P=new AbortController;let B=-1;function O(){S.current||(c(!1),M(cr,!1))}return B=Ct.request(()=>{R(O,P.signal)}),()=>{Ct.cancel(B),P.abort()}},[S,s,a,k,R,M,c]),ie(()=>{const H=h.current;!H||!n||!E||H.setAttribute("hidden","until-found")},[E,n]),d.useEffect(function(){const P=h.current;if(!P)return;function B(O){const G=Ce(Mt,O);i(!0,G),!G.isCanceled&&(x.current=!0,u(!0))}return De(P,"beforematch",B)},[i,u]);const j=o||n||s||a;return{height:T.height,props:{...N?{[Ra.startingStyle]:""}:void 0,hidden:E,id:r},ref:I,shouldPreventOpenAnimation:F,shouldRender:j,transitionStatus:k,width:T.width}}function Hn(e){return{height:e.scrollHeight,width:e.scrollWidth}}function $x(e,t){const n=rt(e).getComputedStyle(e),r=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&ec(n.animationDuration),o=ec(n.transitionDuration);return r&&o||o?"css-transition":r?"css-animation":"none"}function ec(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function io(e,t,n){const r=e.style.getPropertyValue(t),o=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===""){e.style.removeProperty(t);return}e.style.setProperty(t,r,o)}}function Xx(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(o=>{e.style.setProperty(o,"initial","important")});function n(){Object.entries(t).forEach(([o,s])=>{if(s===""){e.style.removeProperty(o);return}e.style.setProperty(o,s)})}const r=Ct.request(n);return()=>{Ct.cancel(r),n()}}let tc=(function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e})({});const qx=d.forwardRef(function(t,n){const{className:r,hiddenUntilFound:o,keepMounted:s,id:i,render:a,style:c,...u}=t,{hiddenUntilFound:f,keepMounted:h}=of(),{defaultPanelId:g,mounted:A,onOpenChange:p,open:m,setMounted:x,setOpen:v,setPanelIdState:b,transitionStatus:y}=af(),C=o??f,w=s??h,I=i||void 0,S=i??g;ie(()=>(b(P=>I??(P===null?void 0:P)),()=>{b(P=>P===I?null:P)}),[I,b]);const{height:R,props:E,ref:k,shouldPreventOpenAnimation:F,shouldRender:T,transitionStatus:N,width:M}=Jx({externalRef:n,hiddenUntilFound:C,id:S,keepMounted:w,mounted:A,onOpenChange:p,open:m,setMounted:x,setOpen:v,transitionStatus:y}),{state:D,triggerId:L}=Sa(),_={...D,transitionStatus:N},j=Bp(c,_),H=je("div",{...t,style:void 0},{state:_,ref:k,props:[E,{"aria-labelledby":L,role:"region",style:{[tc.accordionPanelHeight]:R===void 0?"auto":`${R}px`,[tc.accordionPanelWidth]:M===void 0?"auto":`${M}px`}},u,j?{style:j}:void 0,F?{style:{animationName:"none"}}:void 0],stateAttributesMapping:Da});return T?H:null});function Fa({className:e,...t}){return l.jsx(Hx,{"data-slot":"accordion",className:fe("flex w-full flex-col",e),...t})}function Ba({className:e,...t}){return l.jsx(Ux,{"data-slot":"accordion-item",className:fe("not-last:border-b",e),...t})}function ja({className:e,children:t,...n}){return l.jsx(Vx,{className:"flex",children:l.jsxs(Zx,{"data-slot":"accordion-trigger",className:fe("group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground",e),...n,children:[t,l.jsx(Tn,{className:"pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden"}),l.jsx(Oi,{className:"pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline"})]})})}function Ma({className:e,children:t,...n}){return l.jsx(qx,{"data-slot":"accordion-content",className:"overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up",...n,children:l.jsx("div",{className:fe("h-(--accordion-panel-height) pt-0 pb-2.5 data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",e),children:t})})}const cf=d.createContext(void 0);function eb(){return d.useContext(cf)}const tb=d.forwardRef(function(t,n){const{className:r,defaultPressed:o=!1,disabled:s=!1,form:i,onPressedChange:a,pressed:c,render:u,type:f,value:h,nativeButton:g=!0,style:A,...p}=t,m=It(h||void 0),x=eb(),v=x?.value??[],b=x?void 0:o,y=(s||x?.disabled)??!1,[C,w]=on({controlled:x?m!==void 0&&v.indexOf(m)>-1:c,default:b,name:"Toggle",state:"pressed"}),{getButtonProps:I,buttonRef:S}=Gt({disabled:y,native:g}),R={disabled:y,pressed:C},E=[S,n],k=[{"aria-pressed":C,onClick(N){const M=!C,D=Ce(Mt,N.nativeEvent);a?.(M,D),!D.isCanceled&&(m&&x?.setGroupValue?.(m,M,D),!D.isCanceled&&w(M))}},p,I],F=je("button",t,{enabled:!x,state:R,ref:E,props:k}),T=d.useMemo(()=>({disabled:y,focusableWhenDisabled:!1}),[y]);return x?l.jsx(Wd,{tag:"button",render:u,className:r,style:A,metadata:T,state:R,refs:E,props:k}):F}),uf="data-composite-item-active",nb=[];function rb(e){const{loopFocus:t=!0,orientation:n="both",grid:r,onLoop:o,direction:s,highlightedIndex:i,onHighlightedIndexChange:a,rootRef:c,enableHomeAndEndKeys:u=!1,stopEventPropagation:f,disabledIndices:h,modifierKeys:g=nb}=e,[A,p]=d.useState(0),m=r!=null,x=d.useRef(null),v=Qt(x,c),b=d.useRef([]),y=d.useRef(!1),C=i??A,w=de((k,F=!1)=>{if((a??p)(k),F){const T=b.current[k];Hl(x.current,T,s,n)}}),I=de(k=>{if(k.size===0||y.current)return;y.current=!0;const F=Array.from(k.keys()),T=F.find(M=>M?.hasAttribute(uf))??null,N=T?k.get(T)?.index??-1:-1;if(N!==-1)w(N);else if(wo(F,C,h)){const M=tn(F,{disabledIndices:h});Ir(F,M)||w(M)}Hl(x.current,T,s,n)});ie(()=>{if(h==null||i!=null||!y.current)return;const k=b.current;if(wo(k,C,h)){const F=tn(k,{disabledIndices:h});Ir(k,F)||w(F)}},[h,i,C,b,w]);const S=de((k,F,T)=>o?o(k,F,T,b):T),R=de(k=>{const F=k.key===fi||k.key===pi;if(!rs.has(k.key)||!u&&F||ob(k,g)||!x.current)return;const N=s==="rtl",M=N?ui:di,D=N?di:ui,L=n==="vertical"?ci:M,_=n==="vertical"?li:D,j=At(k.nativeEvent);if(j!=null&&Ol(j)&&!Gd(j)){const z=j.selectionStart,U=j.selectionEnd,Q=j.value;if(z==null||k.shiftKey||z!==U||k.key!==_&&z<Q.length||k.key!==L&&z>0)return}let H=C;const P=Ao(b,h),B=ni(b,h);r!=null&&(H=r({disabledIndices:h,elementsRef:b,event:k,highlightedIndex:C,loopFocus:t,maxIndex:B,minIndex:P,onLoop:S,orientation:n,rtl:N}));const O=n!=="vertical"&&k.key===M||n!=="horizontal"&&k.key===ci,G=n!=="vertical"&&k.key===D||n!=="horizontal"&&k.key===li;u&&(k.key===fi?H=P:k.key===pi&&(H=B)),H===C&&(O||G)&&(t&&H===B&&O?(H=P,o&&(H=o(k,C,H,b))):t&&H===P&&G?(H=B,o&&(H=o(k,C,H,b))):H=tn(b.current,{startingIndex:H,decrement:G,disabledIndices:h})),H!==C&&!Ir(b.current,H)&&(f&&k.stopPropagation(),(m||F||O||G)&&k.preventDefault(),w(H,!0),queueMicrotask(()=>{b.current[H]?.focus()}))});return{props:{ref:v,onFocus(k){const F=x.current,T=At(k.nativeEvent);!F||T==null||!Ol(T)||T.setSelectionRange(0,T.value.length)},onKeyDown:R},highlightedIndex:C,onHighlightedIndexChange:w,elementsRef:b,onMapChange:I,relayKeyboardEvent:R}}function ob(e,t){for(const n of gm)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function df(e){const{render:t,className:n,style:r,refs:o=Nt,props:s=Nt,state:i=ct,stateAttributesMapping:a,highlightedIndex:c,onHighlightedIndexChange:u,orientation:f,grid:h,loopFocus:g,onLoop:A,enableHomeAndEndKeys:p,onMapChange:m,stopEventPropagation:x=!0,rootRef:v,disabledIndices:b,modifierKeys:y,highlightItemOnHover:C=!1,tag:w="div",...I}=e,S=is(),{props:R,highlightedIndex:E,onHighlightedIndexChange:k,elementsRef:F,onMapChange:T,relayKeyboardEvent:N}=rb({grid:h,loopFocus:g,onLoop:A,orientation:f,highlightedIndex:c,onHighlightedIndexChange:u,rootRef:v,stopEventPropagation:x,enableHomeAndEndKeys:p,direction:S,disabledIndices:b,modifierKeys:y}),M=je(w,e,{state:i,ref:o,props:[R,...s,I],stateAttributesMapping:a}),D=d.useMemo(()=>({highlightedIndex:E,onHighlightedIndexChange:k,highlightItemOnHover:C,relayKeyboardEvent:N}),[E,k,C,N]);return l.jsx(Hp.Provider,{value:D,children:l.jsx(Ur,{elementsRef:F,onMapChange:L=>{m?.(L),T(L)},children:M})})}const sb=d.createContext(void 0);function ib(){return d.useContext(sb)}const ab=d.forwardRef(function(t,n){const{defaultValue:r,disabled:o=!1,loopFocus:s=!0,onValueChange:i,orientation:a="horizontal",multiple:c=!1,value:u,className:f,render:h,style:g,...A}=t,p=Ea(),m=ib(),x=u!==void 0||r!==void 0,v=(p?.disabled??!1)||(m?.disabled??!1)||o,[b,y]=on({controlled:u,default:u===void 0?r??Nt:void 0,name:"ToggleGroup",state:"value"}),C=de((E,k,F)=>{let T;c?(T=b.slice(),k?T.push(E):T.splice(b.indexOf(E),1)):T=k?[E]:[],i?.(T,F),!F.isCanceled&&y(T)}),w={disabled:v,multiple:c,orientation:a},I=d.useMemo(()=>({disabled:v,setGroupValue:C,value:b,isValueInitialized:x}),[v,C,b,x]),S={role:"group"},R=je("div",t,{enabled:!!p,state:w,ref:n,props:[S,A]});return l.jsx(cf.Provider,{value:I,children:p?R:l.jsx(df,{render:h,className:f,style:g,state:w,refs:[n],props:[S,A],loopFocus:s,enableHomeAndEndKeys:!0,orientation:a})})}),lb=ki("group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-muted"},size:{default:"h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",sm:"h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2"}},defaultVariants:{variant:"default",size:"default"}}),ff=d.createContext({size:"default",variant:"default",spacing:2,orientation:"horizontal"});function Pa({className:e,variant:t,size:n,spacing:r=2,orientation:o="horizontal",children:s,...i}){return l.jsx(ab,{"data-slot":"toggle-group","data-variant":t,"data-size":n,"data-spacing":r,"data-orientation":o,style:{"--gap":r},className:fe("group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch",e),...i,children:l.jsx(ff.Provider,{value:{variant:t,size:n,spacing:r,orientation:o},children:s})})}function Br({className:e,children:t,variant:n="default",size:r="default",...o}){const s=d.useContext(ff);return l.jsx(tb,{"data-slot":"toggle-group-item","data-variant":s.variant||n,"data-size":s.size||r,"data-spacing":s.spacing,className:fe("shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",lb({variant:s.variant||n,size:s.size||r}),e),...o,children:t})}function Ta({...e}){return l.jsx(Id,{"data-slot":"dialog",...e})}function cb({...e}){return l.jsx(ya,{"data-slot":"dialog-portal",...e})}function ub({...e}){return l.jsx(Qr,{"data-slot":"dialog-close",...e})}function db({className:e,...t}){return l.jsx(qi,{"data-slot":"dialog-overlay",className:fe("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function Na({className:e,children:t,showCloseButton:n=!0,...r}){return l.jsxs(cb,{children:[l.jsx(db,{}),l.jsxs(xa,{"data-slot":"dialog-content",className:fe("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...r,children:[t,n&&l.jsxs(Qr,{"data-slot":"dialog-close",render:l.jsx(Oe,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[l.jsx(Hi,{}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Kn({className:e,...t}){return l.jsx("div",{"data-slot":"dialog-header",className:fe("flex flex-col gap-2",e),...t})}function fb({className:e,showCloseButton:t=!1,children:n,...r}){return l.jsxs("div",{"data-slot":"dialog-footer",className:fe("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",e),...r,children:[n,t&&l.jsx(Qr,{render:l.jsx(Oe,{variant:"outline"}),children:"Close"})]})}function Wn({className:e,...t}){return l.jsx(Ca,{"data-slot":"dialog-title",className:fe("cn-font-heading text-base leading-none font-medium",e),...t})}function _a({className:e,...t}){return l.jsx(ea,{"data-slot":"dialog-description",className:fe("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}const pf=new Set(["npx","create-opentray","create","set"]),en={comment:"text-muted-foreground italic",keyword:"text-emerald-600 dark:text-emerald-400 font-medium",flag:"text-sky-600 dark:text-sky-400",string:"text-amber-700 dark:text-amber-300 break-all",env:"text-violet-600 dark:text-violet-400",variable:"text-rose-600 dark:text-rose-400"},pb=(e,t)=>e.split(/(\s+|\$[A-Za-z_][A-Za-z0-9_]*)/g).map((r,o)=>{const s=`${t}-u${o}`;return r.startsWith("$")?l.jsx("span",{className:en.variable,children:r},s):pf.has(r)?l.jsx("span",{className:en.keyword,children:r},s):r.startsWith("--")?l.jsx("span",{className:en.flag,children:r},s):/^[A-Za-z_][A-Za-z0-9_]*=/.test(r)?l.jsx("span",{className:en.env,children:r},s):l.jsx("span",{children:r},s)}),hb=(e,t)=>e.startsWith("#")?l.jsx("span",{className:en.comment,children:e}):e.split(/('(?:[^']|'\\'')*')/g).map((r,o)=>{const s=`${t}-s${o}`;if(!r.startsWith("'"))return l.jsx("span",{children:pb(r,s)},s);const i=r.slice(1,-1);return pf.has(i)?l.jsx("span",{className:en.keyword,children:r},s):i.startsWith("--")?l.jsx("span",{className:en.flag,children:r},s):/^[A-Za-z_][A-Za-z0-9_]*=/.test(i)?l.jsx("span",{className:en.env,children:r},s):l.jsx("span",{className:en.string,children:r},s)}),Ab=({content:e})=>l.jsx("pre",{className:"tech-ltr bg-muted max-h-72 overflow-auto rounded-md p-2 text-xs whitespace-pre-wrap break-words",children:e.split(`
|
|
2
|
-
`).map((t,n)=>l.jsx("div",{children:t.length===0?" ":hb(t,n)},n))}),hf=({open:e,subtitle:t,hasEnv:n,share:r=!1,runner:o,onClose:s})=>{const{messages:i}=ps(),[a,c]=d.useState("sh"),[u,f]=d.useState(!1),[h,g]=d.useState(null),[A,p]=d.useState(null),[m,x]=d.useState(null),[v,b]=d.useState(!1),[y,C]=d.useState(!1),w=d.useRef(o);w.current=o,d.useEffect(()=>{f(!1),g(null)},[e]),d.useEffect(()=>{if(!e){p(null),x(null);return}if(n&&!u){p(null),b(!1);return}let E=!1;return b(!0),C(!1),x(null),(async()=>{const k=await w.current({format:a,acknowledgeEnv:u,...h===null?{}:{inlineIcon:h}});if(E)return;if(b(!1),k.status===200){const T=k.data;"content"in T&&T.content!==void 0&&(h===null&&T.iconSharedAs!==void 0&&g(T.iconSharedAs==="embedded"),p({filename:T.filename??"create-opentray.sh",content:T.content,...T.commandLine===void 0?{}:{commandLine:T.commandLine},...T.iconReference===void 0?{}:{iconReference:T.iconReference}}));return}p(null);const F=k.data;"code"in F&&x(`${F.message??F.code}`)})(),()=>{E=!0}},[e,a,u,h,n]);const I=!n||u,S=()=>{if(A===null)return;const E=new Blob([A.content],{type:a==="sh"?"text/x-shellscript":"text/plain"}),k=URL.createObjectURL(E),F=document.createElement("a");F.href=k,F.download=A.filename,F.click(),URL.revokeObjectURL(k)},R=async()=>{A!==null&&(await navigator.clipboard.writeText(A.commandLine??A.content),C(!0))};return l.jsx(Ta,{open:e,onOpenChange:E=>{E||s()},children:l.jsxs(Na,{children:[l.jsxs(Kn,{children:[l.jsx(Wn,{children:r?i.export.shareTitle:i.export.title}),l.jsxs(_a,{children:[l.jsx("span",{className:"tech-ltr block truncate",children:t}),r&&l.jsx("span",{className:"text-muted-foreground mt-1 block text-xs",children:i.export.shareSubtitle})]})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(Pa,{variant:"outline",size:"sm",spacing:0,value:[a],onValueChange:E=>{const k=E[0];(k==="sh"||k==="ps1")&&c(k)},children:[l.jsx(Br,{value:"sh",children:i.export.scriptSh}),l.jsx(Br,{value:"ps1",children:i.export.scriptPs1})]}),v&&l.jsx("span",{className:"text-muted-foreground self-center text-xs",children:i.export.building})]}),n&&l.jsx("div",{className:"border-warning rounded-md border p-3",children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(Ai,{id:"export-env-ack",checked:u,onCheckedChange:E=>f(E===!0)}),l.jsxs(Me,{htmlFor:"export-env-ack",className:"text-xs leading-snug",children:[i.export.envAck,l.jsx("span",{className:"text-muted-foreground block",children:i.export.envAckHint})]})]})}),A?.iconReference!==void 0&&A.iconReference!=="none"&&l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(Ai,{id:"export-inline-icon",checked:h===!0,onCheckedChange:E=>g(E===!0)}),l.jsxs(Me,{htmlFor:"export-inline-icon",className:"text-xs leading-snug",children:[i.export.inlineIcon,l.jsx("span",{className:"text-muted-foreground block",children:i.export.inlineIconHint})]})]}),m!==null&&l.jsxs("p",{className:"text-destructive text-xs",role:"alert",children:[i.export.blocked," ",m]}),A!==null&&l.jsx(Fa,{children:l.jsxs(Ba,{value:"content",children:[l.jsx(ja,{className:"text-xs",children:i.export.viewFull}),l.jsx(Ma,{children:l.jsx(Ab,{content:A.content})})]})}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsxs(Oe,{size:"sm",variant:"outline",disabled:!I||A===null,onClick:()=>{R()},children:[l.jsx(eh,{width:14,height:14,"aria-hidden":!0}),y?i.common.copied:i.export.copyCommand]}),l.jsxs(Oe,{size:"sm",disabled:!I||A===null,onClick:S,children:[l.jsx(nh,{width:14,height:14,"aria-hidden":!0}),i.export.downloadFile]})]})]})})};function gb(e){return Cd("alert-dialog",e)}function nc({...e}){return l.jsx(gb,{"data-slot":"alert-dialog",...e})}function mb({...e}){return l.jsx(ya,{"data-slot":"alert-dialog-portal",...e})}function xb({className:e,...t}){return l.jsx(qi,{"data-slot":"alert-dialog-overlay",className:fe("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function rc({className:e,size:t="default",...n}){return l.jsxs(mb,{children:[l.jsx(xb,{}),l.jsx(xa,{"data-slot":"alert-dialog-content","data-size":t,className:fe("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...n})]})}function oc({className:e,...t}){return l.jsx("div",{"data-slot":"alert-dialog-header",className:fe("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function sc({className:e,...t}){return l.jsx("div",{"data-slot":"alert-dialog-footer",className:fe("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function ic({className:e,...t}){return l.jsx(Ca,{"data-slot":"alert-dialog-title",className:fe("cn-font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function ac({className:e,...t}){return l.jsx(ea,{"data-slot":"alert-dialog-description",className:fe("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}function lc({className:e,...t}){return l.jsx(Oe,{"data-slot":"alert-dialog-action",className:fe(e),...t})}function cc({className:e,variant:t="outline",size:n="default",...r}){return l.jsx(Qr,{"data-slot":"alert-dialog-cancel",className:fe(e),render:l.jsx(Oe,{variant:t,size:n}),...r})}const uc={healthy:"statusHealthy","invalid-config":"statusInvalidConfig","incompatible-version":"statusIncompatible","missing-payload":"statusMissingPayload","broken-link":"statusBrokenLink",running:"statusRunning"},dc=e=>({statusHealthy:e.applications.statusHealthy,statusInvalidConfig:e.applications.statusInvalidConfig,statusIncompatible:e.applications.statusIncompatible,statusMissingPayload:e.applications.statusMissingPayload,statusBrokenLink:e.applications.statusBrokenLink,statusRunning:e.applications.statusRunning}),bb=e=>{const t=e.command??{},n=e.window??{};return{command:[t.executable??"",...t.args??[]].filter(Boolean).join(" "),cwd:t.cwd??"",envKeys:Object.keys(t.env??{}),packageManager:typeof e.packageManager=="string"?e.packageManager:"",window:`${n.width??"—"}×${n.height??"—"}`.replace(/—×—/u,"—"),developerMode:e.developerMode===!0}},dn=({label:e,value:t})=>l.jsxs("div",{className:"grid grid-cols-[110px_1fr] gap-x-3 gap-y-1 text-xs",children:[l.jsx("span",{className:"text-muted-foreground",children:e}),l.jsx("span",{className:"tech-ltr break-all",children:t})]}),vb=({app:e,dataUrl:t})=>{const n=(e.appName??e.key).trim().charAt(0).toUpperCase()||"A";return l.jsx("span",{className:"bg-muted text-muted-foreground flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-md text-sm font-semibold","aria-hidden":!0,children:t!==void 0?l.jsx("img",{src:t,alt:"",className:"size-full object-contain"}):n})},yb=()=>{const{messages:e}=ps(),{navigate:t,route:n}=qd(),[r,o]=d.useState([]),[s,i]=d.useState("loading"),[a,c]=d.useState(null),[u,f]=d.useState(null),[h,g]=d.useState(!1),[A,p]=d.useState(null),[m,x]=d.useState(null),[v,b]=d.useState(null),[y,C]=d.useState({}),[w,I]=d.useState({}),S=d.useCallback(async()=>{i(L=>L==="ready"?"stale":"loading");const D=await Ix();D.status===200?(o(D.data),C({}),i("ready"),await Promise.all(D.data.filter(L=>L.hasIcon===!0).map(async L=>{const _=await wx(L.key),j=_.data;_.status===200&&"dataUrl"in j&&j.dataUrl!==void 0&&I(H=>({...H,[L.key]:j.dataUrl}))}))):i("stale")},[]);d.useEffect(()=>{n==="applications"&&S()},[n,S]),d.useEffect(()=>{const D=()=>{S()};return window.addEventListener("create-opentray:apps-changed",D),()=>window.removeEventListener("create-opentray:apps-changed",D)},[S]);const R=async D=>{if(v===D.key){b(null);return}if(b(D.key),y[D.key]===void 0){const L=await ef(D.key);C(_=>({..._,[D.key]:L.status===200?bb(L.data):"error"}))}},E=async D=>{const L=await Dx(D.key),_=L.data;p(L.status===200&&"ok"in _&&_.ok===!0?_.detail:"message"in _?_.message:e.common.error)},k=D=>{p([D.projectPath!==void 0?D.projectPath:"",D.targetRetained===!0?`${e.applications.uninstallRetained} ${D.payloadPath??""}`:"",D.targetDeleted===!0?`${e.applications.uninstallDeleted} ${D.payloadPath??""}`:"",D.manualPinCleanupHint].filter(Boolean).join(`
|
|
3
|
-
`))},F=async(D,L)=>{const _=await kx(D.key,{...L,purgeTarget:h});if(_.status===200)k(_.data);else{const j=_.data;if(_.status===409&&j.code==="app_running"&&(j.pids!==void 0||j.pid!==void 0)){const H=j.pids??(j.pid!==void 0?[j.pid]:[]);f({app:D,pids:H});return}p(j.message??e.common.error)}await S()},T=async()=>{const D=a;c(null),D!==null&&await F(D,{stopRunning:!1})},N=async()=>{const D=u;f(null),D!==null&&await F(D.app,{stopRunning:!0})},M=D=>m===null?Promise.resolve({status:400,data:{code:"state_error",message:"no target"}}):Rx(m.key,D);return l.jsxs("section",{className:"flex h-full flex-col overflow-hidden","aria-label":e.applications.title,children:[l.jsxs("header",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[l.jsx("h1",{className:"text-sm font-semibold",children:e.applications.title}),l.jsx(Oe,{variant:"ghost",size:"icon-sm","aria-label":e.common.refresh,onClick:()=>{S()},children:l.jsx(Rh,{width:16,height:16,"aria-hidden":!0})})]}),l.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-4",children:[s==="loading"&&l.jsxs("div",{className:"space-y-2","aria-label":e.common.loading,children:[l.jsx(qt,{className:"h-14 w-full"}),l.jsx(qt,{className:"h-14 w-full"}),l.jsx(qt,{className:"h-14 w-full"})]}),s!=="loading"&&r.length===0&&l.jsx("p",{className:"text-muted-foreground text-sm",children:e.applications.emptyHint}),r.length>0&&l.jsx("ul",{className:"space-y-2",children:r.map(D=>{const L=v===D.key,_=y[D.key],j=D.status!=="healthy";return l.jsxs("li",{className:"border-border bg-card text-card-foreground rounded-lg border px-3 py-2",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(vb,{app:D,dataUrl:w[D.key]}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"truncate text-sm font-medium",children:D.appName??D.key}),j&&l.jsxs(ls,{children:[l.jsx(cs,{render:H=>l.jsx(bo,{variant:"destructive",...H,children:dc(e)[uc[D.status]]})}),l.jsx(us,{children:D.error?.message??dc(e)[uc[D.status]]})]}),D.isLink&&l.jsx(bo,{variant:"outline",children:e.applications.linked})]}),l.jsx("div",{className:"tech-ltr text-muted-foreground truncate text-xs",children:D.appId??D.key})]}),l.jsxs(Oe,{variant:"ghost",size:"sm","aria-expanded":L,onClick:()=>{R(D)},children:[L?l.jsx(Oi,{width:14,height:14,"aria-hidden":!0}):l.jsx(Tn,{width:14,height:14,"aria-hidden":!0}),e.applications.details]}),l.jsxs(Oe,{variant:"outline",size:"sm",onClick:()=>{window.location.hash=`#/add?edit=${encodeURIComponent(D.key)}`},children:[l.jsx(gu,{width:14,height:14,"aria-hidden":!0}),e.applications.edit]}),l.jsxs(Oe,{variant:"outline",size:"sm",onClick:()=>{E(D)},children:[l.jsx(Au,{width:14,height:14,"aria-hidden":!0}),e.applications.open]}),l.jsxs(Oe,{variant:"outline",size:"sm",onClick:()=>x(D),children:[l.jsx(jh,{width:14,height:14,"aria-hidden":!0}),e.applications.share]}),l.jsxs(Oe,{variant:"destructive",size:"sm",onClick:()=>c(D),children:[l.jsx(Oh,{width:14,height:14,"aria-hidden":!0}),e.applications.uninstall]})]}),L&&l.jsxs("div",{className:"border-border mt-2 space-y-1 rounded-md border bg-muted/40 p-3",children:[_===void 0&&l.jsx("p",{className:"text-muted-foreground text-xs",children:e.common.loading}),_==="error"&&l.jsx("p",{className:"text-destructive text-xs",role:"alert",children:e.common.error}),_!==void 0&&_!=="error"&&l.jsxs(l.Fragment,{children:[l.jsx(dn,{label:e.applications.source,value:D.source==="wizard"?e.applications.sourceWizard:e.applications.sourceRegistered}),l.jsx(dn,{label:e.applications.detailsCommand,value:_.command}),l.jsx(dn,{label:e.applications.detailsCwd,value:_.cwd}),l.jsx(dn,{label:e.applications.detailsEnv,value:_.envKeys.length>0?_.envKeys.join(", "):"—"}),l.jsx(dn,{label:e.applications.detailsPm,value:_.packageManager}),l.jsx(dn,{label:e.applications.detailsWindow,value:_.window}),l.jsx(dn,{label:e.applications.detailsDevMode,value:_.developerMode?"ON":"OFF"}),l.jsx(dn,{label:e.applications.detailsProjectDir,value:D.projectDir??D.payloadPath??D.registrationDir})]})]})]},D.key)})}),s==="stale"&&l.jsx("p",{className:"text-warning mt-3 text-xs",role:"status",children:e.common.error}),A!==null&&l.jsx("p",{className:"text-muted-foreground bg-muted mt-3 whitespace-pre-line rounded-md p-3 text-xs",role:"status",children:A})]}),l.jsx(nc,{open:a!==null,onOpenChange:D=>{D||c(null)},children:l.jsxs(rc,{children:[l.jsxs(oc,{children:[l.jsx(ic,{children:e.applications.uninstallTitle}),l.jsxs(ac,{children:[a?.source==="wizard"?e.applications.uninstallWizardDescription:e.applications.uninstallDescription,l.jsx("span",{className:"tech-ltr mt-2 block truncate",children:a?.appId??a?.key}),a?.projectDir!==void 0&&l.jsx("span",{className:"tech-ltr mt-1 block truncate",children:a.projectDir})]})]}),a?.isLink===!0&&l.jsxs("label",{className:"flex items-start gap-2 text-xs",children:[l.jsx(Ai,{checked:h,onCheckedChange:D=>g(D===!0)}),l.jsxs("span",{children:[e.applications.uninstallPurge,l.jsx("span",{className:"text-muted-foreground block",children:e.applications.uninstallPurgeHint})]})]}),l.jsx("p",{className:"text-muted-foreground text-xs",children:e.applications.uninstallPinHint}),l.jsxs(sc,{children:[l.jsx(cc,{children:e.common.cancel}),l.jsx(lc,{onClick:()=>{T()},children:e.applications.uninstall})]})]})}),l.jsx(nc,{open:u!==null,onOpenChange:D=>{D||f(null)},children:l.jsxs(rc,{children:[l.jsxs(oc,{children:[l.jsx(ic,{children:e.applications.stopRunningTitle}),l.jsxs(ac,{children:[e.applications.stopRunningDescription,l.jsxs("span",{className:"tech-ltr mt-2 block",children:[e.applications.stopRunningPids,": ",u?.pids.join(", ")]}),l.jsx("span",{className:"tech-ltr mt-1 block truncate",children:u?.app.appId??u?.app.key})]})]}),l.jsx("p",{className:"text-muted-foreground text-xs",children:e.applications.uninstallPinHint}),l.jsxs(sc,{children:[l.jsx(cc,{children:e.common.cancel}),l.jsx(lc,{onClick:()=>{N()},children:e.applications.stopRunningConfirm})]})]})}),l.jsx(hf,{open:m!==null,subtitle:m?.appId??m?.key??"",hasEnv:m?.hasEnv===!0,runner:M,onClose:()=>x(null)})]})},Oa=d.createContext({indent:20,currentItem:void 0,tree:void 0,toggleIconType:"plus-minus"});function Af(){return d.useContext(Oa)}function Cb({indent:e=20,tree:t,className:n,toggleIconType:r="chevron",...o}){const s=t&&typeof t.getContainerProps=="function"?t.getContainerProps():{},i={...o,...s},{style:a,...c}=i,u={...a,"--tree-indent":`${e}px`};return l.jsx(Oa.Provider,{value:{indent:e,tree:t,toggleIconType:r},children:l.jsx("div",{"data-slot":"tree",style:u,className:fe("flex flex-col",n),...c})})}function Ib({item:e,className:t,render:n,children:r,...o}){const s=Af(),{indent:i}=s,a=typeof e.getProps=="function"?e.getProps():{},c={...o,children:r,...a},{style:u,...f}=c,g={"data-slot":"tree-item",style:{...u,"--tree-padding":`${e.getItemMeta().level*i}px`},className:fe("z-10 ps-(--tree-padding) outline-hidden select-none not-last:pb-0.5 focus:z-20 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),"data-focus":typeof e.isFocused=="function"?e.isFocused()||!1:void 0,"data-folder":typeof e.isFolder=="function"?e.isFolder()||!1:void 0,"data-selected":typeof e.isSelected=="function"?e.isSelected()||!1:void 0,"data-drag-target":typeof e.isDragTarget=="function"?e.isDragTarget()||!1:void 0,"data-search-match":typeof e.isMatchingSearch=="function"?e.isMatchingSearch()||!1:void 0,"aria-expanded":e.isExpanded()};return l.jsx(Oa.Provider,{value:{...s,currentItem:e},children:hu({defaultTagName:"button",render:n,props:Bt(g,f)})})}function wb({item:e,children:t,className:n,...r}){const{currentItem:o,toggleIconType:s}=Af(),i=e||o;return i?l.jsxs("span",{"data-slot":"tree-item-label",className:fe("in-focus-visible:ring-ring/50 bg-background hover:bg-accent in-data-[selected=true]:bg-accent in-data-[selected=true]:text-accent-foreground in-data-[drag-target=true]:bg-accent flex items-center gap-1 transition-colors not-in-data-[folder=true]:ps-7 in-focus-visible:ring-[3px] in-data-[search-match=true]:bg-blue-50! [&_svg]:pointer-events-none [&_svg]:shrink-0","rounded-md","py-1.5","px-2","text-sm",n),...r,children:[i.isFolder()&&(s==="plus-minus"?i.isExpanded()?l.jsx(mh,{"aria-hidden":!0,className:"text-muted-foreground size-3.5",stroke:"currentColor",strokeWidth:"1"}):l.jsx(mu,{"aria-hidden":!0,className:"text-muted-foreground size-3.5",stroke:"currentColor",strokeWidth:"1"}):l.jsx(Tn,{"aria-hidden":!0,className:"text-muted-foreground size-4 in-aria-[expanded=false]:-rotate-90"})),t||(typeof i.getItemName=="function"?i.getItemName():null)]}):(console.warn("TreeItemLabel: No item provided via props or context"),null)}const fc={};function kb(e){let t=fc[e];if(t)return t;t=fc[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);t.push(r)}for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return t}function nr(e,t){typeof t!="string"&&(t=nr.defaultChars);const n=kb(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(r){let o="";for(let s=0,i=r.length;s<i;s+=3){const a=parseInt(r.slice(s+1,s+3),16);if(a<128){o+=n[a];continue}if((a&224)===192&&s+3<i){const c=parseInt(r.slice(s+4,s+6),16);if((c&192)===128){const u=a<<6&1984|c&63;u<128?o+="��":o+=String.fromCharCode(u),s+=3;continue}}if((a&240)===224&&s+6<i){const c=parseInt(r.slice(s+4,s+6),16),u=parseInt(r.slice(s+7,s+9),16);if((c&192)===128&&(u&192)===128){const f=a<<12&61440|c<<6&4032|u&63;f<2048||f>=55296&&f<=57343?o+="���":o+=String.fromCharCode(f),s+=6;continue}}if((a&248)===240&&s+9<i){const c=parseInt(r.slice(s+4,s+6),16),u=parseInt(r.slice(s+7,s+9),16),f=parseInt(r.slice(s+10,s+12),16);if((c&192)===128&&(u&192)===128&&(f&192)===128){let h=a<<18&1835008|c<<12&258048|u<<6&4032|f&63;h<65536||h>1114111?o+="����":(h-=65536,o+=String.fromCharCode(55296+(h>>10),56320+(h&1023))),s+=9;continue}}o+="�"}return o})}nr.defaultChars=";/?:@&=+$,#";nr.componentChars="";const pc={};function Eb(e){let t=pc[e];if(t)return t;t=pc[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?t.push(r):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Vr(e,t,n){typeof t!="string"&&(n=t,t=Vr.defaultChars),typeof n>"u"&&(n=!0);const r=Eb(t);let o="";for(let s=0,i=e.length;s<i;s++){const a=e.charCodeAt(s);if(n&&a===37&&s+2<i&&/^[0-9a-f]{2}$/i.test(e.slice(s+1,s+3))){o+=e.slice(s,s+3),s+=2;continue}if(a<128){o+=r[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&s+1<i){const c=e.charCodeAt(s+1);if(c>=56320&&c<=57343){o+=encodeURIComponent(e[s]+e[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[s])}return o}Vr.defaultChars=";/?:@&=+$,-_.!~*'()#";Vr.componentChars="-_.!~*'()";function gi(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function Po(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const Sb=/^([a-z0-9.+-]+:)/i,Rb=/:[0-9]*$/,Db=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Fb=["<",">",'"',"`"," ","\r",`
|
|
4
|
-
`," "],Bb=["{","}","|","\\","^","`"].concat(Fb),jb=["'"].concat(Bb),hc=["%","/","?",";","#"].concat(jb),Ac=["/","?","#"],Mb=255,gc=/^[+a-z0-9A-Z_-]{0,63}$/,Pb=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,mc={javascript:!0,"javascript:":!0},xc={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function mi(e,t){if(e&&e instanceof Po)return e;const n=new Po;return n.parse(e,t),n}Po.prototype.parse=function(e,t){let n,r,o,s=e;if(s=s.trim(),!t&&e.split("#").length===1){const u=Db.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let i=Sb.exec(s);if(i&&(i=i[0],n=i.toLowerCase(),this.protocol=i,s=s.substr(i.length)),(t||i||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(i&&mc[i])&&(s=s.substr(2),this.slashes=!0)),!mc[i]&&(o||i&&!xc[i])){let u=-1;for(let p=0;p<Ac.length;p++)r=s.indexOf(Ac[p]),r!==-1&&(u===-1||r<u)&&(u=r);let f,h;u===-1?h=s.lastIndexOf("@"):h=s.lastIndexOf("@",u),h!==-1&&(f=s.slice(0,h),s=s.slice(h+1),this.auth=f),u=-1;for(let p=0;p<hc.length;p++)r=s.indexOf(hc[p]),r!==-1&&(u===-1||r<u)&&(u=r);u===-1&&(u=s.length),s[u-1]===":"&&u--;const g=s.slice(0,u);s=s.slice(u),this.parseHost(g),this.hostname=this.hostname||"";const A=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!A){const p=this.hostname.split(/\./);for(let m=0,x=p.length;m<x;m++){const v=p[m];if(v&&!v.match(gc)){let b="";for(let y=0,C=v.length;y<C;y++)v.charCodeAt(y)>127?b+="x":b+=v[y];if(!b.match(gc)){const y=p.slice(0,m),C=p.slice(m+1),w=v.match(Pb);w&&(y.push(w[1]),C.unshift(w[2])),C.length&&(s=C.join(".")+s),this.hostname=y.join(".");break}}}}this.hostname.length>Mb&&(this.hostname=""),A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=s.indexOf("#");a!==-1&&(this.hash=s.substr(a),s=s.slice(0,a));const c=s.indexOf("?");return c!==-1&&(this.search=s.substr(c),s=s.slice(0,c)),s&&(this.pathname=s),xc[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Po.prototype.parseHost=function(e){let t=Rb.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const Tb=Object.freeze(Object.defineProperty({__proto__:null,decode:nr,encode:Vr,format:gi,parse:mi},Symbol.toStringTag,{value:"Module"})),gf=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,mf=/[\0-\x1F\x7F-\x9F]/,Nb=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Ha=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,xf=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD803[\uDD8E\uDD8F\uDED1-\uDED8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA]/,bf=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,_b=Object.freeze(Object.defineProperty({__proto__:null,Any:gf,Cc:mf,Cf:Nb,P:Ha,S:xf,Z:bf},Symbol.toStringTag,{value:"Module"})),Ob=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function Hb(e){return e>=55296&&e<=57343||e>1114111?65533:Ob.get(e)??e}function Lb(e){const t=atob(e),n=t.length&-2,r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cgBvAPAAWQt0AHIA6QCaLQABY3XkLegtcgAA4DXYy9wAAWJw7C30LW4AAAFFZXUt8S0A4IoiAP5uAAABRWV/LfktAOCLIgD+6SJnemFnAKCaKYADY2Vmb3BycwANLhAuJS4pLiMuLi40LukhcmN1YQABZGkULiEuAAFiZxguHC5hAHIAAKBfKmUAcaAnIgCgWSLlIXJwAKAYIXIAAOA12DTdcABmAADgNdho3WWgQCJhAHQA6ABqD2MAcgAA4DXYzNzjCuQRUC4AAFQuAABYLmIuAAAAAGMubS5wLnQuAAAAAIguki4AAJouJxIqEnQAcgDpAB0ScgAA4DXYNd0AAUFhWy5eLnIA8gDnAnIA8gCTB75jAAFBYWYuaS5yAPIA4AJyAPIAjAdhAPAAeh5pAHMAAKD7IoABZHB0APgReS6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg");var bt;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.FLAG13=8192]="FLAG13",e[e.BRANCH_LENGTH=8064]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(bt||(bt={}));var et;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(et||(et={}));const bc=32;function xi(e){return e>=et.ZERO&&e<=et.NINE}function Wb(e){return e>=et.UPPER_A&&e<=et.UPPER_F||e>=et.LOWER_A&&e<=et.LOWER_F}function Qb(e){return e>=et.UPPER_A&&e<=et.UPPER_Z||e>=et.LOWER_A&&e<=et.LOWER_Z||xi(e)}function Gb(e){return e===et.EQUALS||Qb(e)}var ft;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(ft||(ft={}));var An;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(An||(An={}));class Yb{decodeTree;emitCodePoint;errors;constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r}state=ft.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=An.Strict;runConsumed=0;startEntity(t){this.decodeMode=t,this.state=ft.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(t,n){switch(this.state){case ft.EntityStart:return t.charCodeAt(n)===et.NUM?(this.state=ft.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=ft.NamedEntity,this.stateNamedEntity(t,n));case ft.NumericStart:return this.stateNumericStart(t,n);case ft.NumericDecimal:return this.stateNumericDecimal(t,n);case ft.NumericHex:return this.stateNumericHex(t,n);case ft.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|bc)===et.LOWER_X?(this.state=ft.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=ft.NumericDecimal,this.stateNumericDecimal(t,n))}stateNumericHex(t,n){for(;n<t.length;){const r=t.charCodeAt(n);if(xi(r)||Wb(r)){const o=r<=et.NINE?r-et.ZERO:(r|bc)-et.LOWER_A+10;this.result=this.result*16+o,this.consumed++,n++}else return this.emitNumericEntity(r,3)}return-1}stateNumericDecimal(t,n){for(;n<t.length;){const r=t.charCodeAt(n);if(xi(r))this.result=this.result*10+(r-et.ZERO),this.consumed++,n++;else return this.emitNumericEntity(r,2)}return-1}emitNumericEntity(t,n){if(this.consumed<=n)return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===et.SEMI)this.consumed+=1;else if(this.decodeMode===An.Strict)return 0;return this.emitCodePoint(Hb(this.result),this.consumed),this.errors&&(t!==et.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let o=r[this.treeIndex],s=(o&bt.VALUE_LENGTH)>>14;for(;n<t.length;){if(s===0&&(o&bt.FLAG13)!==0){const a=(o&bt.BRANCH_LENGTH)>>7;if(this.runConsumed===0){const c=o&bt.JUMP_TABLE;if(t.charCodeAt(n)!==c)return this.result===0?0:this.emitNotTerminatedNamedEntity();n++,this.excess++,this.runConsumed++}for(;this.runConsumed<a;){if(n>=t.length)return-1;const c=this.runConsumed-1,u=r[this.treeIndex+1+(c>>1)],f=c%2===0?u&255:u>>8&255;if(t.charCodeAt(n)!==f)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();n++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(a>>1),o=r[this.treeIndex],s=(o&bt.VALUE_LENGTH)>>14}if(n>=t.length)break;const i=t.charCodeAt(n);if(i===et.SEMI&&s!==0&&(o&bt.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);if(this.treeIndex=Ub(r,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===An.Attribute&&(s===0||Gb(i))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],s=(o&bt.VALUE_LENGTH)>>14,s!==0){if(i===et.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==An.Strict&&(o&bt.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}n++,this.excess++}return-1}emitNotTerminatedNamedEntity(){const{result:t,decodeTree:n}=this,r=(n[t]&bt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:o}=this;return this.emitCodePoint(n===1?o[t]&~(bt.VALUE_LENGTH|bt.FLAG13):o[t+1],r),n===3&&this.emitCodePoint(o[t+2],r),r}end(){switch(this.state){case ft.NamedEntity:return this.result!==0&&(this.decodeMode!==An.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ft.NumericDecimal:return this.emitNumericEntity(0,2);case ft.NumericHex:return this.emitNumericEntity(0,3);case ft.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ft.EntityStart:return 0}}}function zb(e){let t="";const n=new Yb(e,r=>t+=String.fromCodePoint(r));return function(o,s){let i=0,a=0;for(;(a=o.indexOf("&",a))>=0;){t+=o.slice(i,a),n.startEntity(s);const u=n.write(o,a+1);if(u<0){i=a+n.end();break}i=a+u,a=u===0?i+1:i}const c=t+o.slice(i);return t="",c}}function Ub(e,t,n,r){const o=(t&bt.BRANCH_LENGTH)>>7,s=t&bt.JUMP_TABLE;if(o===0)return s!==0&&r===s?n:-1;if(s){const u=r-s;return u<0||u>=o?-1:e[n+u]-1}const i=o+1>>1;let a=0,c=o-1;for(;a<=c;){const u=a+c>>>1,f=u>>1,g=e[n+f]>>(u&1)*8&255;if(g<r)a=u+1;else if(g>r)c=u-1;else return e[n+i+u]}return-1}const Vb=zb(Kb);function vf(e){return Vb(e,An.Strict)}var Zb=class{src_Any=gf.source;src_Cc=mf.source;src_Z=bf.source;src_P=Ha.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){const r=this.escapeRE(e),o=this.escapeRE(t),s=`(?:(?!${this.src_ZCc}|${r}|${o}).)`;let i=`${r}${s}{0,1000}${o}`;for(let a=2;a<=n;a++)i=`${r}(?:${s}|${i}){0,1000}${o}`;return i}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){const e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;const e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map(e=>this.escapeRE(e)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},Ps={validate:(e,t,n)=>{const r=n.re.get_http_validator();r.lastIndex=t;const o=r.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)},Jb={"http:":Ps,"https:":Ps,"ftp:":Ps,"//":{validate:function(e,t,n){const r=n.re.get_relative_proto_validator();r.lastIndex=t;const o=r.exec(e);return o?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){const r=n.re.get_mailto_validator();r.lastIndex=t;const o=r.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)}},$b="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",Xb="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function qb(){const e=Xb.split("|");return $b.split("|").forEach(t=>{const n=t.indexOf(":"),r=t.slice(0,n);for(const o of t.slice(n+1))e.push(r+o)}),e}var ev={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:qb(),urlAuth:!1,maxLength:1e4},vc=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,r){const o=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=o,this.text=o,this.url=o}},tv=class{__opts__;__schemas__;re;constructor(e={}){const{rebuilder:t,...n}=e;this.__opts__={...ev,...n},this.__schemas__={...Jb},this.re=t||new Zb,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{const n={normalize:(r,o)=>o.normalize(r),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){const r=this.re.get_fuzzy_mail_host_search(),o=this.re.get_mail_name_validator();for(r.lastIndex=0;(t=r.exec(e))!==null;){const s=e.slice(Math.max(0,t.index-65),t.index);if(o.test(s))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){const t=[],n=this.re.get_schema_search();let r,o,s,i,a,c,u=!1,f=!1,h=!1,g=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(r=this.re.get_fuzzy_link_search(),r.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(o=this.re.get_fuzzy_mail_host_search(),o.lastIndex=0,s=this.re.get_mail_name_validator());;){const A=Math.max(g-1,0);if(o&&s&&!h&&(!a||a.index<g))for(o.lastIndex<A&&(o.lastIndex=A);;){const b=o.exec(e);if(!b){h=!0,a=void 0;break}const y=s.exec(e.slice(Math.max(0,b.index-65),b.index));if(y){if(a={schema:"mailto:",index:b.index-y[1].length,lastIndex:b.index+b[0].length},a.index>=g)break;o.lastIndex<A&&(o.lastIndex=A)}}if(r&&!f&&(!i||i.index<g))for(r.lastIndex<A&&(r.lastIndex=A);;){const b=r.exec(e);if(!b){f=!0,i=void 0;break}if(i={schema:"",index:b.index+b[1].length,lastIndex:b.index+b[0].length},i.index>=g)break;r.lastIndex<A&&(r.lastIndex=A)}let p=a;(!p||i&&(i.index<p.index||i.index===p.index&&i.lastIndex>p.lastIndex))&&(p=i);let m;if(!u)for(;;){if(!c){n.lastIndex<A&&(n.lastIndex=A);const C=n.exec(e);if(!C){u=!0;break}c={schema:C[2],index:C.index+C[1].length,lastIndex:C.index+C[0].length}}if(c.index<g){c=void 0;continue}if(p&&c.index>p.index)break;const b=c;c=void 0;const y=this.testSchemaAt(e,b.schema,b.lastIndex);if(y){m={schema:b.schema,index:b.index,lastIndex:b.lastIndex+y};break}}let x=m;if((!x||a&&(a.index<x.index||a.index===x.index&&a.lastIndex>x.lastIndex))&&(x=a),(!x||i&&(i.index<x.index||i.index===x.index&&i.lastIndex>x.lastIndex))&&(x=i),!x)break;x===a?a=void 0:x===i&&(i=void 0);const v=new vc(e,x.schema,x.index,x.lastIndex);v.schema?this.__schemas__[v.schema].normalize(v,this):this.normalize(v),t.push(v),g=x.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;const t=this.re.get_schema_at_start().exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const r=new vc(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[r.schema].normalize(r,this),r}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}};const Vn=2147483647,Lt=36,La=1,jr=26,nv=38,rv=700,yf=72,Cf=128,If="-",ov=/^xn--/,sv=/[^\0-\x7F]/,iv=/[\x2E\u3002\uFF0E\uFF61]/g,av={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Ts=Lt-La,Kt=Math.floor,Ns=String.fromCharCode;function fn(e){throw new RangeError(av[e])}function lv(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}function wf(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(iv,".");const o=e.split("."),s=lv(o,t).join(".");return r+s}function kf(e){const t=[];let n=0;const r=e.length;for(;n<r;){const o=e.charCodeAt(n++);if(o>=55296&&o<=56319&&n<r){const s=e.charCodeAt(n++);(s&64512)==56320?t.push(((o&1023)<<10)+(s&1023)+65536):(t.push(o),n--)}else t.push(o)}return t}const cv=e=>String.fromCodePoint(...e),uv=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Lt},yc=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Ef=function(e,t,n){let r=0;for(e=n?Kt(e/rv):e>>1,e+=Kt(e/t);e>Ts*jr>>1;r+=Lt)e=Kt(e/Ts);return Kt(r+(Ts+1)*e/(e+nv))},Sf=function(e){const t=[],n=e.length;let r=0,o=Cf,s=yf,i=e.lastIndexOf(If);i<0&&(i=0);for(let a=0;a<i;++a)e.charCodeAt(a)>=128&&fn("not-basic"),t.push(e.charCodeAt(a));for(let a=i>0?i+1:0;a<n;){const c=r;for(let f=1,h=Lt;;h+=Lt){a>=n&&fn("invalid-input");const g=uv(e.charCodeAt(a++));g>=Lt&&fn("invalid-input"),g>Kt((Vn-r)/f)&&fn("overflow"),r+=g*f;const A=h<=s?La:h>=s+jr?jr:h-s;if(g<A)break;const p=Lt-A;f>Kt(Vn/p)&&fn("overflow"),f*=p}const u=t.length+1;s=Ef(r-c,u,c==0),Kt(r/u)>Vn-o&&fn("overflow"),o+=Kt(r/u),r%=u,t.splice(r++,0,o)}return String.fromCodePoint(...t)},Rf=function(e){const t=[];e=kf(e);const n=e.length;let r=Cf,o=0,s=yf;for(const c of e)c<128&&t.push(Ns(c));const i=t.length;let a=i;for(i&&t.push(If);a<n;){let c=Vn;for(const f of e)f>=r&&f<c&&(c=f);const u=a+1;c-r>Kt((Vn-o)/u)&&fn("overflow"),o+=(c-r)*u,r=c;for(const f of e)if(f<r&&++o>Vn&&fn("overflow"),f===r){let h=o;for(let g=Lt;;g+=Lt){const A=g<=s?La:g>=s+jr?jr:g-s;if(h<A)break;const p=h-A,m=Lt-A;t.push(Ns(yc(A+p%m,0))),h=Kt(p/m)}t.push(Ns(yc(h,0))),s=Ef(o,u,a===i),o=0,++a}++o,++r}return t.join("")},dv=function(e){return wf(e,function(t){return ov.test(t)?Sf(t.slice(4).toLowerCase()):t})},fv=function(e){return wf(e,function(t){return sv.test(t)?"xn--"+Rf(t):t})},Cc={version:"2.3.1",ucs2:{decode:kf,encode:cv},decode:Sf,encode:Rf,toASCII:fv,toUnicode:dv};var Ic=Object.defineProperty,Df=(e,t)=>{let n={};for(var r in e)Ic(n,r,{get:e[r],enumerable:!0});return Ic(n,Symbol.toStringTag,{value:"Module"}),n},pv=Df({arrayReplaceAt:()=>Bf,asciiTrim:()=>As,callable:()=>Ff,escapeHtml:()=>vn,escapeRE:()=>Iv,fromCodePoint:()=>Mr,isMdAsciiPunct:()=>Nr,isPunctChar:()=>Mf,isPunctCharCode:()=>Tr,isSpace:()=>Ve,isValidEntityCode:()=>Ka,isWhiteSpace:()=>Pr,lib:()=>wv,normalizeReference:()=>hs,unescapeAll:()=>rr,unescapeMd:()=>mv});function Ff(e){const t=function(...n){return Reflect.construct(e,n,new.target&&new.target!==t?new.target:e)};return Object.defineProperty(t,"name",{value:e.name}),Object.setPrototypeOf(t,e),t.prototype=e.prototype,t}function Bf(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function Ka(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Mr(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var jf=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,hv=new RegExp(`${jf.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Av=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function gv(e,t){if(t.charCodeAt(0)===35&&Av.test(t)){const r=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Ka(r)?Mr(r):e}const n=vf(e);return n!==e?n:e}function mv(e){return e.indexOf("\\")<0?e:e.replace(jf,"$1")}function rr(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(hv,function(t,n,r){return n||gv(t,r)})}var xv=/[&<>"]/,bv=/[&<>"]/g,vv={"&":"&","<":"<",">":">",'"':"""};function yv(e){return vv[e]}function vn(e){return xv.test(e)?e.replace(bv,yv):e}var Cv=/[.?*+^$[\]\\(){}|-]/g;function Iv(e){return e.replace(Cv,"\\$&")}function Ve(e){switch(e){case 9:case 32:return!0}return!1}function Pr(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Mf(e){return Ha.test(e)||xf.test(e)}function Tr(e){return Mf(Mr(e))}function Nr(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function hs(e){return e=e.trim().replace(/\s+/g," "),e.toLowerCase().toUpperCase()}function wc(e){return e===32||e===9||e===10||e===13}function As(e){let t=0;for(;t<e.length&&wc(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&wc(e.charCodeAt(n));n--);return e.slice(t,n+1)}var wv={mdurl:Tb,ucmicro:_b};function kv(e,t,n){let r,o,s,i;const a=e.posMax,c=e.pos;for(e.pos=t+1,r=1;e.pos<a;){if(s=e.src.charCodeAt(e.pos),s===93&&(r--,r===0)){o=!0;break}if(i=e.pos,e.md.inline.skipToken(e),s===91){if(i===e.pos-1)r++;else if(n)return e.pos=c,-1}}let u=-1;return o&&(u=e.pos),e.pos=c,u}function Ev(e,t,n){let r,o=t;const s={ok:!1,pos:0,str:""};if(e.charCodeAt(o)===60){for(o++;o<n;){if(r=e.charCodeAt(o),r===10||r===60)return s;if(r===62)return s.pos=o+1,s.str=rr(e.slice(t+1,o)),s.ok=!0,s;if(r===92&&o+1<n){o+=2;continue}o++}return s}let i=0;for(;o<n&&(r=e.charCodeAt(o),!(r===32||r<32||r===127));){if(r===92&&o+1<n){if(e.charCodeAt(o+1)===32){o++;continue}o+=2;continue}if(r===40&&(i++,i>32))return s;if(r===41){if(i===0)break;i--}o++}return t===o||i!==0||(s.str=rr(e.slice(t,o)),s.pos=o,s.ok=!0),s}function Sv(e,t,n,r){let o,s=t;const i={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)i.str=r.str,i.marker=r.marker;else{if(s>=n)return i;let a=e.charCodeAt(s);if(a!==34&&a!==39&&a!==40)return i;t++,s++,a===40&&(a=41),i.marker=a}for(;s<n;){if(o=e.charCodeAt(s),o===i.marker)return i.pos=s+1,i.str+=rr(e.slice(t,s)),i.ok=!0,i;if(o===40&&i.marker===41)return i;o===92&&s+1<n&&s++,s++}return i.can_continue=!0,i.str+=rr(e.slice(t,s)),i}var Rv=Df({parseLinkDestination:()=>Ev,parseLinkLabel:()=>kv,parseLinkTitle:()=>Sv});function _r(e){"@babel/helpers - typeof";return _r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_r(e)}function Dv(e,t){if(_r(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(_r(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fv(e){var t=Dv(e,"string");return _r(t)=="symbol"?t:t+""}function xe(e,t,n){return(t=Fv(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Fn=class{constructor(e,t,n){xe(this,"map",null),xe(this,"level",0),xe(this,"children",null),xe(this,"content",""),xe(this,"markup",""),xe(this,"info",""),xe(this,"block",!1),xe(this,"hidden",!1),this.type=e,this.tag=t,this.attrs=null,this.nesting=n,this.meta=null}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},Or=class{constructor(){xe(this,"__rules__",[]),xe(this,"__cache__",null)}__find__(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1}__compile__(){const e=new Set;this.__rules__.forEach(t=>{t.enabled&&t.alt.forEach(n=>{n&&e.add(n)})}),this.__cache__=Object.create(null),this.__cache__[""]=[],this.__rules__.forEach(t=>{t.enabled&&this.__cache__[""].push(t.fn)}),e.forEach(t=>{this.__cache__[t]=[],this.__rules__.forEach(n=>{n.enabled&&n.alt.indexOf(t)>=0&&this.__cache__[t].push(n.fn)})})}at(e,t,n={}){const r=this.__find__(e);if(r===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__[r].fn=t,this.__rules__[r].alt=n.alt||[],this.__cache__=null}before(e,t,n,r={}){const o=this.__find__(e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(o,0,{name:t,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null}after(e,t,n,r={}){const o=this.__find__(e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null}push(e,t,n={}){this.__rules__.push({name:e,enabled:!0,fn:t,alt:n.alt||[]}),this.__cache__=null}enable(e,t=!1){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(r=>{const o=this.__find__(r);if(o<0){if(t)return;throw new Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[o].enabled=!0,n.push(r)}),this.__cache__=null,n}enableOnly(e,t=!1){Array.isArray(e)||(e=[e]),this.__rules__.forEach(n=>{n.enabled=!1}),this.enable(e,t)}disable(e,t=!1){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(r=>{const o=this.__find__(r);if(o<0){if(t)return;throw new Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[o].enabled=!1,n.push(r)}),this.__cache__=null,n}getRules(e){return this.__cache__||this.__compile__(),this.__cache__[e]||[]}},zt={};zt.code_inline=function(e,t,n,r,o){const s=e[t];return`<code${o.renderAttrs(s)}>${vn(s.content)}</code>`};zt.code_block=function(e,t,n,r,o){const s=e[t];return`<pre${o.renderAttrs(s)}><code>${vn(e[t].content)}</code></pre>
|
|
5
|
-
`};zt.fence=function(e,t,n,r,o){const s=e[t],i=s.info?rr(s.info).trim():"";let a="",c="";if(i){const f=i.split(/(\s+)/g);a=f[0],c=f.slice(2).join("")}let u;if(n.highlight?u=n.highlight(s.content,a,c)||vn(s.content):u=vn(s.content),u.indexOf("<pre")===0)return u+`
|
|
6
|
-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index2.js","assets/terminal-pane.js","assets/index.js","assets/index.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as He,r as d,E as Ot,u as Rt,b as Zp,d as Cu,f as st,e as Me,j as l,N as Sr,g as ct,h as zt,i as Iu,k as he,m as Ft,l as Ti,n as Jp,o as $p,R as Xp,a as qp}from"./index.js";import{u as wt,b as ae,i as $e,c as Te,d as ve,g as Ht,o as je,e as Ct,f as kt,h as Ni,j as de,k as Yt,l as Ce,m as eh,n as jt,p as Mn,q as $n,r as th,t as at,s as Go,v as ot,w as gt,x as Nn,y as zo,z as Bn,C as Xn,D as si,E as Cn,F as _i,H as nh,J as wu,K as rh,L as Oi,M as Yo,N as ku,O as vl,P as Yn,Q as ii,S as Hi,B as Oe,T as Eu,U as Li,V as Ir,W as br,X as Ki,Y as Su,Z as Wi,_ as Qi,$ as Uo,a0 as Gi,a1 as sn,a2 as zi,a3 as oh,I as Xe,a4 as Yi,a5 as sh,G as ai,a6 as yl,a7 as Cl,A as ih,a as ah,R as lh}from"./input.js";import{u as Ru,B as Io,T as Rr,_ as ch,p as uh,c as dh}from"./terminal-pane.js";const fh=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ui=He("check",fh);const ph=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],_n=He("chevron-down",ph);const hh=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Vi=He("chevron-up",hh);const gh=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ah=He("circle-check",gh);const mh=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],xh=He("circle-question-mark",mh);const bh=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],vh=He("copy",bh);const yh=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Ch=He("download",yh);const Ih=[["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"}]],Du=He("external-link",Ih);const wh=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],kh=He("file-text",wh);const Eh=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Sh=He("folder-open",Eh);const Rh=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Dh=He("folder",Rh);const Fh=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],Bh=He("link-2",Fh);const jh=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Mh=He("list",jh);const Ph=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Th=He("loader-circle",Ph);const Nh=[["path",{d:"M5 12h14",key:"1ays0h"}]],_h=He("minus",Nh);const Oh=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Hh=He("monitor",Oh);const Lh=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Kh=He("moon",Lh);const Wh=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Il=He("panel-left",Wh);const Qh=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Fu=He("pencil",Qh);const Gh=[["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"}]],zh=He("play",Gh);const Yh=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Bu=He("plus",Yh);const Uh=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Vh=He("refresh-cw",Uh);const Zh=[["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"}]],Jh=He("settings-2",Zh);const $h=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],Xh=He("share-2",$h);const qh=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],eg=He("square",qh);const tg=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],ng=He("sun",tg);const rg=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],og=He("trash-2",rg);const sg=[["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"}]],ig=He("triangle-alert",sg);const ag=[["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"}]],ju=He("upload",ag);const lg=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Zi=He("x",lg);function Mu(e,t,n,r=!0,o){const[s,i]=d.useState(),a=wt(o?`${o}-label`:void 0),c=e??t??s;return ae(()=>{const u=e||t||!r?void 0:cg(n.current,a);s!==u&&i(u)}),c}function cg(e,t){const n=ug(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function ug(e){if(!e)return;const t=e.parentElement;if(t&&t.tagName==="LABEL")return t;const n=e.id;if(n){const o=e.nextElementSibling;if(o&&o.htmlFor===n)return o}const r=e.labels;return r&&r[0]}function dg(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:fg,platform:pg,maxTouchPoints:hg}=dg(),Vo=fg.toLowerCase(),Dr=pg.toLowerCase(),Zo=/^i(os$|p)/.test(Dr)||Dr==="macintel"&&hg>1,wl="android",li=Dr===wl||Vo.includes(wl),Ji=!Zo&&Dr.startsWith("mac");Dr.startsWith("win");const gg=Ji||Zo,ln=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!ln&&Vo.includes("firefox");!ln&&Vo.includes("chrom");const Ag=gg,$i=/jsdom|happydom/.test(Vo),ci="data-base-ui-focusable",Pu="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Jo="ArrowLeft",$o="ArrowRight",Tu="ArrowUp",Xi="ArrowDown";function wo(e,t){if(!Te(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(ve(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function Ds(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function mg(e){return e.matches("html,body")}function Xo(e){return $e(e)&&e.matches(Pu)}function xg(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Pu}`)!=null}function ui(e){return e?e.getAttribute("role")==="combobox"&&Xo(e):!1}function bg(e){if(!e||$i)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function ko(e){return e?e.hasAttribute(ci)?e:e.querySelector(`[${ci}]`)||e:null}function bn(e,t,n=!0){return e.filter(o=>o.parentId===t).flatMap(o=>[...!n||o.context?.open?[o]:[],...bn(e,o.id,n)])}function kl(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function Kt(e){e.preventDefault(),e.stopPropagation()}function vg(e){return"nativeEvent"in e}function qi(e){return e.pointerType===""&&e.isTrusted?!0:li&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function ea(e){return $i?!1:!li&&e.width===0&&e.height===0||li&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function xn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function yg(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const qn=Math.min,rn=Math.max,Eo=Math.round,Xr=Math.floor,on=e=>({x:e,y:e}),Cg={left:"right",right:"left",bottom:"top",top:"bottom"};function Nu(e,t,n){return rn(e,qn(t,n))}function vn(e,t){return typeof e=="function"?e(t):e}function Bt(e){return e.split("-")[0]}function In(e){return e.split("-")[1]}function ta(e){return e==="x"?"y":"x"}function na(e){return e==="y"?"height":"width"}function Dt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ra(e){return ta(Dt(e))}function Ig(e,t,n){n===void 0&&(n=!1);const r=In(e),o=ra(e),s=na(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=So(i)),[i,So(i)]}function wg(e){const t=So(e);return[di(e),t,di(t)]}function di(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const El=["left","right"],Sl=["right","left"],kg=["top","bottom"],Eg=["bottom","top"];function Sg(e,t,n){switch(e){case"top":case"bottom":return n?t?Sl:El:t?El:Sl;case"left":case"right":return t?kg:Eg;default:return[]}}function Rg(e,t,n,r){const o=In(e);let s=Sg(Bt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(di)))),s}function So(e){const t=Bt(e);return Cg[t]+e.slice(t.length)}function Dg(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 _u(e){return typeof e!="number"?Dg(e):{top:e,right:e,bottom:e,left:e}}function Fr(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 wr(e,t){return t<0||t>=e.length}function bo(e,t){return nn(e.current,{disabledIndices:t})}function fi(e,t){return nn(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function nn(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let s=t;do s+=n?-o:o;while(s>=0&&s<=e.length-1&&Ro(e,s,r));return s}function Ro(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const o=e[t];return o?!qo(o)||o.matches(":disabled")?!0:!n&&(o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"):!1}function Fg(e){return e.visibility==="hidden"||e.visibility==="collapse"}function qo(e,t=e?Ht(e):null){return!e||!e.isConnected||!t||Fg(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const Bg='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function jg(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Ni(n)?n.host:null}function pi(e){for(const t of Array.from(e.children))if(kt(t)==="summary")return t;return null}function Mg(e,t){const n=pi(t);return!!n&&(e===n||ve(n,e))}function Ou(e){const t=e?kt(e):"";return e!=null&&e.matches(Bg)&&(t!=="summary"||e.parentElement!=null&&kt(e.parentElement)==="details"&&pi(e.parentElement)===e)&&(t!=="details"||pi(e)==null)&&(t!=="input"||e.type!=="hidden")}function Hu(e){if(!Ou(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=jg(t)){const n=t!==e,r=kt(t)==="slot";if(t.hasAttribute("inert")||n&&kt(t)==="details"&&!t.open&&!Mg(e,t)||t.hasAttribute("hidden")||!r&&!Pg(t,n))return!1}return!0}function Pg(e,t){const n=Ht(e);return t?n.display!=="none":qo(e,n)}function Lu(e){const t=e.tabIndex;if(t<0){const n=kt(e);if(n==="details"||n==="audio"||n==="video"||$e(e)&&e.isContentEditable)return 0}return t}function Fs(e){if(kt(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function Tg(e,t){const n=Fs(e);if(!n)return!0;const r=t.find(o=>{const s=Fs(o);return s?.name===n.name&&s.form===n.form&&s.checked});return r?r===n:t.find(o=>{const s=Fs(o);return s?.name===n.name&&s.form===n.form})===n}function Ku(e){if($e(e)&&kt(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return $e(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Wu(e,t){Ku(e).forEach(n=>{Ou(n)&&t.push(n),Wu(n,t)})}function Qu(e,t,n){Ku(e).forEach(r=>{$e(r)&&r.matches(t)&&n.push(r),Qu(r,t,n)})}function oa(e){return Hu(e)&&Lu(e)>=0}function Gu(e){const t=[];return Wu(e,t),t.filter(Hu)}function Wr(e){const t=Gu(e);return t.filter(n=>Lu(n)>=0&&Tg(n,t))}function zu(e,t){const n=Wr(e),r=n.length;if(r===0)return;const o=Ct(je(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function sa(e){return zu(je(e).body,1)||e}function Yu(e){return zu(je(e).body,-1)||e}function Uu(e,t){if(!e)return null;const n=Wr(je(e).body),r=n.length;if(r===0)return null;const o=n.indexOf(e);if(o===-1)return null;const s=(o+t+r)%r;return n[s]}function Ng(e){return Uu(e,1)}function _g(e){return Uu(e,-1)}function Un(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ve(n,r)}function Og(e){Wr(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Rl(e){const t=[];Qu(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function ia(e){d.useEffect(e,Ot)}const lr=0;class Lt{static create(){return new Lt}currentId=lr;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=lr,n()},t)}isStarted(){return this.currentId!==lr}clear=()=>{this.currentId!==lr&&(clearTimeout(this.currentId),this.currentId=lr)};disposeEffect=()=>this.clear}function pt(){const e=Rt(Lt.create).current;return ia(e.disposeEffect),e}const Hg=d.createContext({disabled:!1});function Lg(){return d.useContext(Hg)}var an=Zp();const qr=null;class Kg{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}let eo=new Kg;class It{static create(){return new It}static request(t){return eo.request(t)}static cancel(t){return eo.cancel(t)}currentId=qr;request(t){this.cancel(),this.currentId=eo.request(()=>{this.currentId=qr,t()})}cancel=()=>{this.currentId!==qr&&(eo.cancel(this.currentId),this.currentId=qr)};disposeEffect=()=>this.cancel}function er(){const e=Rt(It.create).current;return ia(e.disposeEffect),e}function qt(e){return e==null?e:"current"in e?e.current:e}function aa(e,t=!1){const n=er();return de((r,o=null)=>{n.cancel();const s=qt(e);if(s==null)return;const i=s,a=()=>{an.flushSync(r)};if(typeof i.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function c(){Promise.all(i.getAnimations().map(u=>u.finished)).then(()=>{o?.aborted||a()},()=>{if(o?.aborted)return;if(i.getAnimations().some(f=>f.pending||f.playState!=="finished")){c();return}a()})}if(t){const u="data-starting-style";if(!i.hasAttribute(u)){n.request(c);return}const f=new MutationObserver(()=>{i.hasAttribute(u)||(f.disconnect(),c())});f.observe(i,{attributes:!0,attributeFilter:[u]}),o?.addEventListener("abort",()=>f.disconnect(),{once:!0});return}n.request(c)})}function Ut(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=de(o),i=aa(r,n);d.useEffect(()=>{if(!t)return;const a=new AbortController;return i(s,a.signal),()=>{a.abort()}},[t,n,s,i])}let Do=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Wg={"data-starting-style":""},Qg={"data-ending-style":""},On={transitionStatus(e){return e==="starting"?Wg:e==="ending"?Qg:null}};function ir(e,t=!1,n=!1){const[r,o]=d.useState(e&&t?"idle":void 0),[s,i]=d.useState(e);return e&&!s&&(i(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),ae(()=>{if(!e&&s&&r!=="ending"&&n){const a=It.request(()=>{o("ending")});return()=>{It.cancel(a)}}},[e,s,r,n]),ae(()=>{if(!e||t)return;const a=It.request(()=>{o(void 0)});return()=>{It.cancel(a)}},[t,e]),ae(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const a=It.request(()=>{o("idle")});return()=>{It.cancel(a)}},[t,e,s,r]),{mounted:s,setMounted:i,transitionStatus:r}}var Bs={exports:{}},js={};var Dl;function Gg(){if(Dl)return js;Dl=1;var e=Cu();function t(h,A){return h===A&&(h!==0||1/h===1/A)||h!==h&&A!==A}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(h,A){var g=A(),p=r({inst:{value:g,getSnapshot:A}}),x=p[0].inst,m=p[1];return s(function(){x.value=g,x.getSnapshot=A,c(x)&&m({inst:x})},[h,g,A]),o(function(){return c(x)&&m({inst:x}),h(function(){c(x)&&m({inst:x})})},[h]),i(g),g}function c(h){var A=h.getSnapshot;h=h.value;try{var g=A();return!n(h,g)}catch{return!0}}function u(h,A){return A()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return js.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,js}var Fl;function Vu(){return Fl||(Fl=1,Bs.exports=Gg()),Bs.exports}var es=Vu();const vr={v:[]},Bl=()=>vr.v.forEach(e=>e()),zg=e=>(vr.v.push(e)===1&&addEventListener("hashchange",Bl),()=>{vr.v=vr.v.filter(t=>t!==e),vr.v.length||removeEventListener("hashchange",Bl)}),Yg=()=>"/"+location.hash.replace(/^#?\/?/,""),Ug=(e,{state:t=null,replace:n=!1}={})=>{const r=location.href,[o,s]=e.replace(/^#?\/?/,"").split("?"),i=new URL(location.href);i.hash=`/${o}`,s&&(i.search=s);const a=i.href;n?history.replaceState(t,"",a):history.pushState(t,"",a);const c=typeof HashChangeEvent<"u"?new HashChangeEvent("hashchange",{oldURL:r,newURL:a}):new Event("hashchange",{detail:{oldURL:r,newURL:a}});dispatchEvent(c)},Zu=({ssrPath:e="/"}={})=>[es.useSyncExternalStore(zg,Yg,()=>e),Ug];Zu.hrefs=e=>"#"+e;const Ms=768;function Vg(){const[e,t]=d.useState(void 0);return d.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Ms-1}px)`),r=()=>t(window.innerWidth<Ms);return n.addEventListener("change",r),t(window.innerWidth<Ms),()=>n.removeEventListener("change",r)},[]),!!e}const Ju=d.createContext(void 0);function Hn(e){const t=d.useContext(Ju);if(!e&&t===void 0)throw new Error(st(27));return t}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Do.startingStyle]="startingStyle",e[e.endingStyle=Do.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const Zg={"data-popup-open":""},Jg={"data-popup-open":"","data-pressed":""},$g={"data-open":""},Xg={"data-closed":""},qg={"data-anchor-hidden":""},$u={open(e){return e?Zg:null}},hi={open(e){return e?Jg:null}},Qr={open(e){return e?$g:Xg},anchorHidden(e){return e?qg:null}},la={...Qr,...On},ca=d.forwardRef(function(t,n){const{render:r,className:o,style:s,forceRender:i=!1,...a}=t,c=Hn(),u=c.useState("open"),f=c.useState("nested"),h=c.useState("mounted"),A=c.useState("transitionStatus");return Me("div",t,{state:{open:u,transitionStatus:A},ref:[c.context.backdropRef,n],stateAttributesMapping:la,props:[{role:"presentation",hidden:!h,style:{userSelect:"none",WebkitUserSelect:"none"}},a],enabled:i||!f})}),Gr=d.forwardRef(function(t,n){const{render:r,className:o,style:s,disabled:i=!1,nativeButton:a=!0,...c}=t,u=Hn(),f=u.useState("open"),{getButtonProps:h,buttonRef:A}=Yt({disabled:i,native:a}),g={disabled:i};function p(x){f&&u.setOpen(!1,Ce(eh,x.nativeEvent))}return Me("button",t,{state:g,ref:[n,A],props:[{onClick:p},c,h]})}),ua=d.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,...a}=t,c=Hn(),u=wt(i);return c.useSyncedValueWithCleanup("descriptionElementId",u),Me("p",t,{ref:n,props:[{id:u},a]})});function eA(e,t){return t!=null&&!xn(t)?0:typeof e=="function"?e():e}function tr(e,t,n){const r=eA(e,n);return typeof r=="number"?r:r?.[t]}function jl(e){return typeof e=="function"?e():e}function Xu(e,t){return t||e==="click"||e==="mousedown"}function tA(e){return e?.includes("mouse")&&e!=="mousedown"}const nA=d.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Lt,currentIdRef:{current:null},currentContextRef:{current:null}});function rA(e,t){e.current=t.current}function oA(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,o=r.useState("floatingId"),s=d.useContext(nA),{currentIdRef:i,delayRef:a,timeoutMs:c,initialDelayRef:u,currentContextRef:f,hasProvider:h,timeout:A}=s,[g,p]=d.useState(!1),x=d.useRef(n);return ae(()=>{x.current=n},[n]),ae(()=>{function m(){f.current?.setIsInstantPhase(!1),i.current=null,f.current=null,a.current=u.current,A.clear()}if(i.current&&!n&&i.current===o){if(p(!1),c){const v=o;return A.start(c,()=>{r.select("open")||i.current&&i.current!==v||m()}),()=>{(x.current||i.current!==v)&&A.clear()}}m()}},[n,o,i,a,c,u,f,A,r]),ae(()=>{if(!n)return;const m=f.current,v=i.current;A.clear(),f.current={onOpenChange:r.setOpen,setIsInstantPhase:p},i.current=o,a.current={open:0,close:tr(u.current,"close")},v!==null&&v!==o?(p(!0),m?.setIsInstantPhase(!0),m?.onOpenChange(!1,Ce(jt))):(p(!1),m?.setIsInstantPhase(!1))},[n,o,r,i,a,u,f,A]),ae(()=>()=>{if(i.current===o){if(f.current=null,!x.current)return;i.current=null,rA(a,u),A.clear()}},[f,i,a,o,u,A]),d.useMemo(()=>({hasProvider:h,delayRef:a,isInstantPhase:g}),[h,a,g])}function De(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Gt(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function et(e){const t=Rt(sA,e).current;return t.next=e,ae(t.effect),t}function sA(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const qu={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ts={...qu,position:"fixed",top:0,left:0},da={...qu,position:"absolute"},nr=d.forwardRef(function(t,n){const[r,o]=d.useState();ae(()=>{Ag&&ln&&o("button")},[]);const s={tabIndex:0,role:r};return l.jsx("span",{...t,ref:n,style:ts,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});function Br(e){return`data-base-ui-${e}`}let to=0;function vo(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:o}=t;cancelAnimationFrame(to);function s(){o&&!o()||e?.focus({preventScroll:n})}if(r)return s(),Sr;const i=requestAnimationFrame(s);return to=i,()=>{to===i&&(cancelAnimationFrame(i),to=0)}}const Ps={inert:new WeakMap,"aria-hidden":new WeakMap},Ml="data-base-ui-inert",gi={inert:new WeakSet,"aria-hidden":new WeakSet};let cr=new WeakMap,Ts=0;function iA(e){return gi[e]}function ed(e){return e?Ni(e)?e.host:ed(e.parentNode):null}const Pl=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=ed(n);return e.contains(r)?r:null}).filter(n=>n!=null),Tl=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},Nl=(e,t,n)=>{const r=[],o=s=>{!s||n.has(s)||Array.from(s.children).forEach(i=>{kt(i)!=="script"&&(t.has(i)?o(i):r.push(i))})};return o(e),r};function aA(e,t,n,r,{mark:o=!0}){let s=null;r?s="inert":n&&(s="aria-hidden");let i=null,a=null;const c=Pl(t,e),u=o?Nl(t,Tl(c),new Set(c)):[],f=[],h=[];if(s){const A=Ps[s],g=iA(s);a=g,i=A;const p=Pl(t,Array.from(t.querySelectorAll("[aria-live]"))),x=c.concat(p);Nl(t,Tl(x),new Set(x)).forEach(v=>{const b=v.getAttribute(s),y=b!==null&&b!=="false",C=(A.get(v)||0)+1;A.set(v,C),f.push(v),C===1&&y&&g.add(v),y||v.setAttribute(s,s==="inert"?"":"true")})}return o&&u.forEach(A=>{const g=(cr.get(A)||0)+1;cr.set(A,g),h.push(A),g===1&&A.setAttribute(Ml,"")}),Ts+=1,()=>{i&&f.forEach(A=>{const p=(i.get(A)||0)-1;i.set(A,p),p||(!a?.has(A)&&s&&A.removeAttribute(s),a?.delete(A))}),o&&h.forEach(A=>{const g=(cr.get(A)||0)-1;cr.set(A,g),g||A.removeAttribute(Ml)}),Ts-=1,Ts||(Ps.inert=new WeakMap,Ps["aria-hidden"]=new WeakMap,gi.inert=new WeakSet,gi["aria-hidden"]=new WeakSet,cr=new WeakMap)}}function _l(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:o=!0}=t,s=je(e[0]).body;return aA(e,s,n,r,{mark:o})}const lA=500,cA=500,uA={style:{transition:"none"}},dA="data-base-ui-click-trigger",td={fallbackAxisSide:"none"},nd={fallbackAxisSide:"end"},fA={clipPath:"inset(50%)",position:"fixed",top:0,left:0},rd=d.createContext(null),od=()=>d.useContext(rd),pA=Br("portal");function sd(e={}){const{ref:t,container:n,componentProps:r=ct,elementProps:o}=e,s=$n(),a=od()?.portalNode,[c,u]=d.useState(null),[f,h]=d.useState(null),A=de(m=>{m!==null&&h(m)}),g=d.useRef(null);ae(()=>{if(n===null){g.current&&(g.current=null,h(null),u(null));return}const m=(n&&(th(n)?n:n.current))??a??document.body;if(m==null){g.current&&(g.current=null,h(null),u(null));return}g.current!==m&&(g.current=m,h(null),u(m))},[n,a]);const p=Me("div",r,{ref:[t,A],props:[{id:s,[pA]:""},o]}),x=c&&p?an.createPortal(p,c):null;return{node:f,nodeId:d.isValidElement(p)?p.props.id:void 0,subtree:x}}const fa=d.forwardRef(function(t,n){const{render:r,className:o,style:s,children:i,container:a,...c}=t,{node:u,nodeId:f,subtree:h}=sd({container:a,ref:n,componentProps:t,elementProps:c}),A=d.useRef(null),g=d.useRef(null),p=d.useRef(null),x=d.useRef(null),[m,v]=d.useState(null),b=d.useRef(!1),y=m?.modal,C=m?.open,I=!!m&&!m.modal&&m.open&&!!u;d.useEffect(()=>{if(!u||y)return;function S(R){u&&R.relatedTarget&&Un(R)&&(R.type==="focusin"?b.current&&(Rl(u),b.current=!1):(Og(u),b.current=!0))}return Gt(De(u,"focusin",S,!0),De(u,"focusout",S,!0))},[u,y]),ae(()=>{!u||C!==!0||!b.current||(Rl(u),b.current=!1)},[C,u]);const w=d.useMemo(()=>({beforeOutsideRef:A,afterOutsideRef:g,beforeInsideRef:p,afterInsideRef:x,portalNode:u,setFocusManagerState:v}),[u]);return l.jsxs(d.Fragment,{children:[h,l.jsxs(rd.Provider,{value:w,children:[I&&u&&l.jsx(nr,{"data-type":"outside",ref:A,onFocus:S=>{if(Un(S,u))p.current?.focus();else{const R=m?m.domReference:null;Yu(R)?.focus()}}}),I&&u&&l.jsx("span",{"aria-owns":f,style:fA}),u&&an.createPortal(i,u),I&&u&&l.jsx(nr,{"data-type":"outside",ref:g,onFocus:S=>{if(Un(S,u))x.current?.focus();else{const R=m?m.domReference:null;sa(R)?.focus(),m?.closeOnFocusOut&&m?.onOpenChange(!1,Ce(Mn,S.nativeEvent))}}})]})]})});function id(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class pa{nodesRef={current:[]};events=id();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const ad=d.createContext(null),ld=d.createContext(null),wn=()=>d.useContext(ad)?.id||null,kn=e=>{const t=d.useContext(ld);return e??t};function cd(e){const t=$n(),n=kn(e),r=wn();return ae(()=>{if(!t)return;const o={id:t,parentId:r};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,r]),t}function hA(e){const{children:t,id:n}=e,r=wn();return l.jsx(ad.Provider,{value:d.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function gA(e){const{children:t,externalTree:n}=e,r=Rt(()=>n??new pa).current;return l.jsx(ld.Provider,{value:r,children:t})}function AA(e,t){const n=ot(gt(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const Ol=20;let mn=[];function ha(){mn=mn.filter(e=>e.deref()?.isConnected)}function Hl(e){ha(),e&&kt(e)!=="body"&&(mn.push(new WeakRef(e)),mn.length>Ol&&(mn=mn.slice(-Ol)))}function Ll(){return ha(),mn[mn.length-1]?.deref()}function mA(e){return e?oa(e)?e:Wr(e)[0]||e:null}function Kl(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=Gu(e).filter(o=>{const s=o.getAttribute("data-tabindex")||"";return oa(o)||o.hasAttribute("data-tabindex")&&!s.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function ga(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:a=!0,closeOnFocusOut:c=!0,openInteractionType:u="",nextFocusableElement:f,previousFocusableElement:h,beforeContentFocusGuardRef:A,externalTree:g,getInsideElements:p}=e,x="rootStore"in t?t.rootStore:t,m=x.useState("open"),v=x.useState("domReferenceElement"),b=x.useState("floatingElement"),{events:y,dataRef:C}=x.context,I=de(()=>C.current.floatingContext?.nodeId),w=o===!1,S=ui(v)&&w,R=et(o),E=et(s),k=et(u),B=et(m),T=kn(g),F=od(),j=d.useRef(!1),D=d.useRef(!1),H=d.useRef(!1),_=d.useRef(null),P=d.useRef(""),L=d.useRef(""),N=d.useRef(null),M=d.useRef(null),O=zt(N,A,F?.beforeInsideRef),G=zt(M,F?.afterInsideRef),Z=pt(),J=pt(),Q=er(),$=F!=null,K=ko(b),te=de((ee=K)=>ee?Wr(ee):[]),le=de(()=>p?.().filter(ee=>ee!=null)??[]);d.useEffect(()=>{if(r||!a)return;function ee(ue){ue.key==="Tab"&&ve(K,Ct(je(K)))&&te().length===0&&!S&&Kt(ue)}const U=je(K);return De(U,"keydown",ee)},[r,K,a,S,te]),d.useEffect(()=>{if(r||!m)return;const ee=je(K);function U(){H.current=!1}function ue(be){const re=gt(be),Ae=le(),ie=ve(b,re)||ve(v,re)||ve(F?.portalNode,re)||Ae.some(oe=>oe===re||ve(oe,re));H.current=!ie,L.current=be.pointerType||"keyboard",re?.closest(`[${dA}]`)&&(D.current=!0,J.start(0,()=>{D.current=!1}))}function se(){L.current="keyboard"}return Gt(De(ee,"pointerdown",ue,!0),De(ee,"pointerup",U,!0),De(ee,"pointercancel",U,!0),De(ee,"keydown",se,!0),U)},[r,b,v,K,m,F,J,le]),d.useEffect(()=>{if(r||!c)return;const ee=je(K);function U(){D.current=!0,J.start(0,()=>{D.current=!1})}function ue(Ae){const ie=gt(Ae);oa(ie)&&(_.current=ie)}function se(Ae){const ie=Ae.relatedTarget,oe=Ae.currentTarget,ce=gt(Ae);a&&ie==null&&ce!=null&&ve(b,ce)&&Hl(ce),queueMicrotask(()=>{const me=I(),ge=x.context.triggerElements,W=le(),V=ie?.hasAttribute(Br("focus-guard"))&&[N.current,M.current,F?.beforeInsideRef.current,F?.afterInsideRef.current,F?.beforeOutsideRef.current,F?.afterOutsideRef.current,qt(h),qt(f)].includes(ie),ye=!(ve(v,ie)||ve(b,ie)||ve(ie,b)||ve(F?.portalNode,ie)||W.some(q=>q===ie||ve(q,ie))||ge.hasMatchingElement(q=>ve(q,ie))||V||T&&(bn(T.nodesRef.current,me).find(q=>ve(q.context?.elements.floating,ie)||ve(q.context?.elements.domReference,ie))||kl(T.nodesRef.current,me).find(q=>[q.context?.elements.floating,ko(q.context?.elements.floating)].includes(ie)||q.context?.elements.domReference===ie)));if(oe===v&&K&&Kl(K),i&&oe!==v&&!qo(ce)&&Ct(ee)===ee.body){if($e(K)&&(K.focus(),i==="popup")){Q.request(()=>{K.focus()});return}const q=te(),ne=_.current,ke=(ne&&q.includes(ne)?ne:null)||q[q.length-1]||K;$e(ke)&&ke.focus()}if(C.current.insideReactTree){C.current.insideReactTree=!1;return}(S||!a)&&ie&&ye&&!D.current&&(S||ie!==Ll())&&(j.current=!0,x.setOpen(!1,Ce(Mn,Ae)))})}function be(){H.current||(C.current.insideReactTree=!0,Z.start(0,()=>{C.current.insideReactTree=!1}))}const re=$e(v)?v:null;if(!(!b&&!re))return Gt(re&&De(re,"focusout",se),re&&De(re,"pointerdown",U),b&&De(b,"focusin",ue),b&&De(b,"focusout",se),b&&F&&De(b,"focusout",be,!0))},[r,v,b,K,a,T,F,x,c,i,te,S,I,C,Z,J,Q,f,h,le]),d.useEffect(()=>{if(r||!b||!m)return;const ee=Array.from(F?.portalNode?.querySelectorAll(`[${Br("portal")}]`)||[]),ue=(T?kl(T.nodesRef.current,I()):[]).find(oe=>ui(oe.context?.elements.domReference||null))?.context?.elements.domReference,be=[...[b,...ee,N.current,M.current,F?.beforeOutsideRef.current,F?.afterOutsideRef.current,...le()],ue,qt(h),qt(f),S?v:null].filter(oe=>oe!=null),re=_l(be,{ariaHidden:a||S,mark:!1}),Ae=[b,...ee].filter(oe=>oe!=null),ie=_l(Ae);return()=>{ie(),re()}},[m,r,v,b,a,F,S,T,I,f,h,le]),ae(()=>{if(!m||r||!$e(K))return;P.current="",L.current="";const ee=je(K),U=Ct(ee);queueMicrotask(()=>{const ue=R.current,se=typeof ue=="function"?ue(k.current||""):ue;if(se===void 0||se===!1||ve(K,U))return;let re=null;const Ae=()=>(re==null&&(re=te(K)),re[0]||K);let ie;se===!0||se===null?ie=Ae():ie=qt(se),ie=ie||Ae();const oe=ve(K,Ct(ee));vo(ie,{preventScroll:ie===K,shouldFocus(){if(!B.current)return!1;if(oe)return!0;const ce=Ct(ee);return!(ce!==ie&&ve(K,ce))}})})},[r,m,K,te,R,k,B]),ae(()=>{if(r||!K)return;const ee=je(K),U=Ct(ee),ue=k.current==null;Hl(U);function se(re){if(re.open||(P.current=AA(re.nativeEvent,L.current)),re.reason===at&&re.nativeEvent.type==="mouseleave"&&(j.current=!0),re.reason===Go)if(re.nested)j.current=!1;else if(qi(re.nativeEvent)||ea(re.nativeEvent))j.current=!1;else{let Ae=!1;je(K).createElement("div").focus({get preventScroll(){return Ae=!0,!1}}),Ae?j.current=!1:j.current=!0}}y.on("openchange",se);function be(re){const Ae=E.current;let ie=typeof Ae=="function"?Ae(re):Ae;if(ie===void 0||ie===!1)return null;ie===null&&(ie=!0);const oe=v?.isConnected?v:null,ce=U?.isConnected&&kt(U)!=="body"?U:null;let me=ue?ce||oe:oe||ce;return me||(me=Ll()||null),typeof ie=="boolean"?me:qt(ie)||me||null}return()=>{y.off("openchange",se);const re=Ct(ee),Ae=le(),ie=ve(b,re)||Ae.some(ge=>ge===re||ve(ge,re))||T&&bn(T.nodesRef.current,I(),!1).some(ge=>ve(ge.context?.elements.floating,re)),oe=E.current,ce=P.current,me=be(ce);queueMicrotask(()=>{const ge=mA(me),W=typeof oe!="boolean";if(oe&&!j.current&&$e(ge)&&(!(!W&&ge!==re&&re!==ee.body)||ie)){const V={preventScroll:!0};ce==="keyboard"&&(V.focusVisible=!0),ge.focus(V)}j.current=!1})}},[r,b,K,E,k,y,T,v,I,le]),ae(()=>{if(!ln||m||!b)return;const ee=Ct(je(b));!$e(ee)||!Xo(ee)||ve(b,ee)&&ee.blur()},[m,b]),ae(()=>{if(!(r||!F))return F.setFocusManagerState({modal:a,closeOnFocusOut:c,open:m,onOpenChange:x.setOpen,domReference:v}),()=>{F.setFocusManagerState(null)}},[r,F,a,m,x,c,v]),ae(()=>{if(!(r||!K))return Kl(K),()=>{queueMicrotask(ha)}},[r,K]);const X=!r&&(a?!S:!0)&&($||a);return l.jsxs(d.Fragment,{children:[X&&l.jsx(nr,{"data-type":"inside",ref:O,onFocus:ee=>{if(a){const U=te();vo(U[U.length-1])}else F?.portalNode&&(j.current=!1,Un(ee,F.portalNode)?sa(v)?.focus():qt(h??F.beforeOutsideRef)?.focus())}}),n,X&&l.jsx(nr,{"data-type":"inside",ref:G,onFocus:ee=>{a?vo(te()[0]):F?.portalNode&&(c&&(j.current=!0),Un(ee,F.portalNode)?Yu(v)?.focus():qt(f??F.afterOutsideRef)?.focus())}})]})}function ud(e,t={}){const{enabled:n=!0,event:r="click",toggle:o=!0,ignoreMouse:s=!1,stickIfOpen:i=!0,touchOpenDelay:a=0,reason:c=Nn}=t,u="rootStore"in e?e.rootStore:e,f=u.context.dataRef,h=d.useRef(void 0),A=er(),g=pt(),p=d.useMemo(()=>{function x(v,b,y,C){const I=Ce(c,b,y);v&&C==="touch"&&a>0?g.start(a,()=>{u.setOpen(!0,I)}):u.setOpen(v,I)}function m(v,b,y){const C=f.current.openEvent,I=u.select("domReferenceElement")!==b;return v&&I||!v||!o?!0:C&&i?!y(C.type):!1}return{onPointerDown(v){h.current=xn(v.pointerType,!0)&&ea(v.nativeEvent)?"virtual":v.pointerType},onMouseDown(v){const b=h.current,y=v.nativeEvent,C=u.select("open");if(v.button!==0||r==="click"||xn(b,!0)&&s)return;const I=m(C,v.currentTarget,R=>R==="click"||R==="mousedown"),w=gt(y);if(Xo(w)){x(I,y,w,b);return}const S=v.currentTarget;A.request(()=>{x(I,y,S,b)})},onClick(v){if(r==="mousedown-only")return;const b=h.current;if(r==="mousedown"&&b){h.current=void 0;return}if(xn(b,!0)&&s)return;const y=u.select("open"),C=m(y,v.currentTarget,I=>I==="click"||I==="mousedown"||I==="keydown"||I==="keyup");x(C,v.nativeEvent,v.currentTarget,b)},onKeyDown(){h.current=void 0}}},[f,r,s,c,u,i,o,A,g,a]);return d.useMemo(()=>n?{reference:p}:ct,[n,p])}function xA(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){const s=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},i=t.axis==="x"||t.axis==="both",a=t.axis==="y"||t.axis==="both",c=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch";let u=s.width,f=s.height,h=s.x,A=s.y;return n==null&&t.x&&i&&(n=s.x-t.x),r==null&&t.y&&a&&(r=s.y-t.y),h-=n||0,A-=r||0,u=0,f=0,!o||c?(u=t.axis==="y"?s.width:0,f=t.axis==="x"?s.height:0,h=i&&t.x!=null?t.x:h,A=a&&t.y!=null?t.y:A):o&&!c&&(f=t.axis==="x"?s.height:f,u=t.axis==="y"?s.width:u),o=!0,{width:u,height:f,x:h,y:A,top:A,right:h+u,bottom:A+f,left:h}}}}function Wl(e){return e!=null&&e.clientX!=null}function bA(e,t={}){const{enabled:n=!0,axis:r="both"}=t,o="rootStore"in e?e.rootStore:e,s=o.useState("open"),i=o.useState("floatingElement"),a=o.useState("domReferenceElement"),c=o.context.dataRef,u=d.useRef(!1),f=d.useRef(null),[h,A]=d.useState(),[g,p]=d.useState([]),x=de(C=>{o.set("positionReference",C)}),m=de((C,I,w)=>{u.current||c.current.openEvent&&!Wl(c.current.openEvent)||o.set("positionReference",xA(w??a,{x:C,y:I,axis:r,dataRef:c,pointerType:h}))}),v=de(C=>{s?f.current||(m(C.clientX,C.clientY,C.currentTarget),p([])):m(C.clientX,C.clientY,C.currentTarget)}),b=xn(h)?i:s;d.useEffect(()=>{if(!n){x(a);return}if(!b)return;function C(){f.current?.(),f.current=null}const I=ot(i);function w(S){const R=gt(S);ve(i,R)?C():m(S.clientX,S.clientY)}return!c.current.openEvent||Wl(c.current.openEvent)?f.current=De(I,"mousemove",w):x(a),C},[b,n,i,c,a,o,m,x,g]),d.useEffect(()=>()=>{o.set("positionReference",null)},[o]),d.useEffect(()=>{n&&!i&&(u.current=!1)},[n,i]),d.useEffect(()=>{!n&&s&&(u.current=!0)},[n,s]);const y=d.useMemo(()=>{function C(I){A(I.pointerType)}return{onPointerDown:C,onPointerEnter:C,onMouseMove:v,onMouseEnter:v}},[v]);return d.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function vA(){return!1}function yA(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function ns(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:o=!0,outsidePressEvent:s="sloppy",referencePress:i=vA,bubbles:a,externalTree:c}=t,u="rootStore"in e?e.rootStore:e,f=u.useState("open"),h=u.useState("floatingElement"),{dataRef:A}=u.context,g=kn(c),p=de(typeof o=="function"?o:()=>!1),x=typeof o=="function"?p:o,m=x!==!1,v=de(()=>s),{escapeKey:b,outsidePress:y}=yA(a),C=d.useRef(!1),I=d.useRef(!1),w=d.useRef(!1),S=d.useRef(!1),R=d.useRef(""),E=d.useRef(null),k=pt(),B=pt(),T=de(()=>{B.clear(),A.current.insideReactTree=!1}),F=de(O=>{const G=A.current.floatingContext?.nodeId;return(g?bn(g.nodesRef.current,G):[]).some(J=>J.context?.open&&!J.context.dataRef.current[O])}),j=de(O=>Ds(O,u.select("floatingElement"))||Ds(O,u.select("domReferenceElement"))),D=de(O=>{i()&&u.setOpen(!1,Ce(Nn,O.nativeEvent))}),H=de(O=>{if(!f||!n||!r||O.key!=="Escape"||S.current||!b&&F("__escapeKeyBubbles"))return;const G=vg(O)?O.nativeEvent:O,Z=Ce(zo,G);u.setOpen(!1,Z),Z.isCanceled||O.preventDefault(),!b&&!Z.isPropagationAllowed&&O.stopPropagation()}),_=de(()=>{A.current.insideReactTree=!0,B.start(0,T)}),P=de(O=>{if(!f||!n||O.button!==0)return;const G=gt(O.nativeEvent);ve(u.select("floatingElement"),G)&&(C.current||(C.current=!0,I.current=!1))}),L=de(O=>{!f||!n||(O.defaultPrevented||O.nativeEvent.defaultPrevented)&&C.current&&(I.current=!0)});d.useEffect(()=>{if(!f||!n)return T;A.current.__escapeKeyBubbles=b,A.current.__outsidePressBubbles=y;const O=new Lt,G=new Lt;function Z(){O.clear(),S.current=!0}function J(){O.start(ln?5:0,()=>{S.current=!1})}function Q(){w.current=!0,G.start(0,()=>{w.current=!1})}function $(){C.current=!1,I.current=!1}function K(){const W=R.current,V=W==="pen"||!W?"mouse":W,ye=v(),q=typeof ye=="function"?ye():ye;return typeof q=="string"?q:q[V]}function te(W){const V=K();return V==="intentional"&&W.type!=="click"||V==="sloppy"&&W.type==="click"}function le(W){const V=A.current.floatingContext?.nodeId,ye=g&&bn(g.nodesRef.current,V).some(q=>Ds(W,q.context?.elements.floating));return j(W)||ye}function X(W){if(te(W)){W.type!=="click"&&!j(W)&&(G.clear(),w.current=!1),T();return}if(A.current.insideReactTree){T();return}const V=gt(W),ye=`[${Br("inert")}]`,q=Te(V)?V.getRootNode():null,ne=Array.from((Ni(q)?q:je(u.select("floatingElement"))).querySelectorAll(ye)),ke=u.context.triggerElements;if(V&&(ke.hasElement(V)||ke.hasMatchingElement(Qe=>ve(Qe,V))))return;let Se=Te(V)?V:null;for(;Se&&!Bn(Se);){const Qe=Xn(Se);if(Bn(Qe)||!Te(Qe))break;Se=Qe}if(!(ne.length&&Te(V)&&!mg(V)&&!ve(V,u.select("floatingElement"))&&ne.every(Qe=>!ve(Se,Qe)))){if($e(V)&&!("touches"in W)){const Qe=Bn(V),tt=Ht(V),Le=/auto|scroll/,ht=Qe||Le.test(tt.overflowX),Ke=Qe||Le.test(tt.overflowY),Ge=ht&&V.clientWidth>0&&V.scrollWidth>V.clientWidth,ut=Ke&&V.clientHeight>0&&V.scrollHeight>V.clientHeight,Re=tt.direction==="rtl",Ue=ut&&(Re?W.offsetX<=V.offsetWidth-V.clientWidth:W.offsetX>V.clientWidth),_e=Ge&&W.offsetY>V.clientHeight;if(Ue||_e)return}if(!le(W)){if(K()==="intentional"&&w.current){G.clear(),w.current=!1;return}typeof x=="function"&&!x(W)||F("__outsidePressBubbles")||(u.setOpen(!1,Ce(Go,W)),T())}}}function ee(W){K()!=="sloppy"||W.pointerType==="touch"||!u.select("open")||!n||j(W)||X(W)}function U(W){if(K()!=="sloppy"||!u.select("open")||!n||j(W))return;const V=W.touches[0];V&&(E.current={startTime:Date.now(),startX:V.clientX,startY:V.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},k.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function ue(W,V){const ye=gt(W);if(!ye)return;const q=De(ye,W.type,()=>{V(W),q()})}function se(W){R.current="touch",ue(W,U)}function be(W){k.clear(),W.type==="pointerdown"&&(R.current=W.pointerType),!(W.type==="mousedown"&&E.current&&!E.current.dismissOnMouseDown)&&ue(W,V=>{V.type==="pointerdown"?ee(V):X(V)})}function re(W){if(!C.current)return;const V=I.current;if($(),K()==="intentional"){if(W.type==="pointercancel"){V&&Q();return}if(!le(W)){if(V){Q();return}typeof x=="function"&&!x(W)||(G.clear(),w.current=!0,T())}}}function Ae(W){if(K()!=="sloppy"||!E.current||j(W))return;const V=W.touches[0];if(!V)return;const ye=Math.abs(V.clientX-E.current.startX),q=Math.abs(V.clientY-E.current.startY),ne=Math.sqrt(ye*ye+q*q);ne>5&&(E.current.dismissOnTouchEnd=!0),ne>10&&(X(W),k.clear(),E.current=null)}function ie(W){ue(W,Ae)}function oe(W){K()!=="sloppy"||!E.current||j(W)||(E.current.dismissOnTouchEnd&&X(W),k.clear(),E.current=null)}function ce(W){ue(W,oe)}const me=je(h),ge=Gt(r&&Gt(De(me,"keydown",H),De(me,"compositionstart",Z),De(me,"compositionend",J)),m&&Gt(De(me,"click",be,!0),De(me,"pointerdown",be,!0),De(me,"pointerup",re,!0),De(me,"pointercancel",re,!0),De(me,"mousedown",be,!0),De(me,"mouseup",re,!0),De(me,"touchstart",se,!0),De(me,"touchmove",ie,!0),De(me,"touchend",ce,!0)));return()=>{ge(),O.clear(),G.clear(),$(),w.current=!1,T()}},[A,h,r,m,x,f,n,b,y,H,T,v,F,j,g,u,k]);const N=d.useMemo(()=>({onKeyDown:H,onPointerDown:D,onClick:D}),[H,D]),M=d.useMemo(()=>({onKeyDown:H,onPointerDown:L,onMouseDown:L,onClickCapture:_,onMouseDownCapture(O){_(),P(O)},onPointerDownCapture(O){_(),P(O)},onMouseUpCapture:_,onTouchEndCapture:_,onTouchMoveCapture:_}),[H,_,P,L]);return d.useMemo(()=>n?{reference:N,floating:M,trigger:N}:{},[n,N,M])}function Ql(e,t,n){let{reference:r,floating:o}=e;const s=Dt(t),i=ra(t),a=na(i),c=Bt(t),u=s==="y",f=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,A=r[a]/2-o[a]/2;let g;switch(c){case"top":g={x:f,y:r.y-o.height};break;case"bottom":g={x:f,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-o.width,y:h};break;default:g={x:r.x,y:r.y}}const p=In(t);return p&&(g[i]+=A*(p==="end"?1:-1)*(n&&u?-1:1)),g}async function CA(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:A=!1,padding:g=0}=vn(t,e),p=_u(g),m=a[A?h==="floating"?"reference":"floating":h],v=Fr(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(a.floating)),boundary:u,rootBoundary:f,strategy:c})),b=h==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(y))&&await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1},I=Fr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:y,strategy:c}):b);return{top:(v.top-I.top+p.top)/C.y,bottom:(I.bottom-v.bottom+p.bottom)/C.y,left:(v.left-I.left+p.left)/C.x,right:(I.right-v.right+p.right)/C.x}}const IA=50,wA=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:CA},c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:h}=Ql(u,r,c),A=r,g=0;const p={};for(let x=0;x<s.length;x++){const m=s[x];if(!m)continue;const{name:v,fn:b}=m,{x:y,y:C,data:I,reset:w}=await b({x:f,y:h,initialPlacement:r,placement:A,strategy:o,middlewareData:p,rects:u,platform:a,elements:{reference:e,floating:t}});f=y??f,h=C??h,p[v]={...p[v],...I},w&&g<IA&&(g++,typeof w=="object"&&(w.placement&&(A=w.placement),w.rects&&(u=w.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:f,y:h}=Ql(u,A,c)),x=-1)}return{x:f,y:h,placement:A,strategy:o,middlewareData:p}},kA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:A,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:x=!0,...m}=vn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Bt(o),b=Dt(a),y=Bt(a)===a,C=await(c.isRTL==null?void 0:c.isRTL(u.floating)),I=A||(y||!x?[So(a)]:wg(a)),w=p!=="none";!A&&w&&I.push(...Rg(a,x,p,C));const S=[a,...I],R=await c.detectOverflow(t,m),E=[];let k=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&E.push(R[v]),h){const j=Ig(o,i,C);E.push(R[j[0]],R[j[1]])}if(k=[...k,{placement:o,overflows:E}],!E.every(j=>j<=0)){var B,T;const j=(((B=s.flip)==null?void 0:B.index)||0)+1,D=S[j];if(D&&(!(h==="alignment"?b!==Dt(D):!1)||k.every(P=>Dt(P.placement)===b?P.overflows[0]>0:!0)))return{data:{index:j,overflows:k},reset:{placement:D}};let H=(T=k.filter(_=>_.overflows[0]<=0).sort((_,P)=>_.overflows[1]-P.overflows[1])[0])==null?void 0:T.placement;if(!H)switch(g){case"bestFit":{var F;const _=(F=k.filter(P=>{if(w){const L=Dt(P.placement);return L===b||L==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(L=>L>0).reduce((L,N)=>L+N,0)]).sort((P,L)=>P[1]-L[1])[0])==null?void 0:F[0];_&&(H=_);break}case"initialPlacement":H=a;break}if(o!==H)return{reset:{placement:H}}}return{}}}},dd=new Set(["left","top"]);async function EA(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Bt(n),a=In(n),c=Dt(n)==="y",u=dd.has(i)?-1:1,f=s&&c?-1:1,h=vn(t,e);let{mainAxis:A,crossAxis:g,alignmentAxis:p}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof p=="number"&&(g=a==="end"?p*-1:p),c?{x:g*f,y:A*u}:{x:A*u,y:g*f}}const SA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await EA(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},RA=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:i=!0,crossAxis:a=!1,limiter:c={fn:b=>{let{x:y,y:C}=b;return{x:y,y:C}}},...u}=vn(e,t),f={x:n,y:r},h=await s.detectOverflow(t,u),A=Dt(o),g=ta(A);let p=f[g],x=f[A];const m=(b,y)=>Nu(y+h[b==="y"?"top":"left"],y,y-h[b==="y"?"bottom":"right"]);i&&(p=m(g,p)),a&&(x=m(A,x));const v=c.fn({...t,[g]:p,[A]:x});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[g]:i,[A]:a}}}}}},DA=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:o,y:s,placement:i,rects:a,middlewareData:c}=t,{offset:u=0,mainAxis:f=!0,crossAxis:h=!0}=vn(e,t),A={x:o,y:s},g=Dt(i),p=ta(g);let x=A[p],m=A[g];const v=vn(u,t),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:(n=v.mainAxis)!=null?n:0,crossAxis:(r=v.crossAxis)!=null?r:0};if(f){const I=p==="y"?"height":"width",w=a.reference[p]-a.floating[I]+b.mainAxis,S=a.reference[p]+a.reference[I]-b.mainAxis;x<w?x=w:x>S&&(x=S)}if(h){var y,C;const I=p==="y"?"width":"height",w=dd.has(Bt(i)),S=a.reference[g]-a.floating[I]+(w&&((y=c.offset)==null?void 0:y[g])||0)+(w?0:b.crossAxis),R=a.reference[g]+a.reference[I]+(w?0:((C=c.offset)==null?void 0:C[g])||0)-(w?b.crossAxis:0);m<S?m=S:m>R&&(m=R)}return{[p]:x,[g]:m}}}},FA=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:i=()=>{},...a}=vn(e,t),c=await o.detectOverflow(t,a),u=Bt(n),f=In(n),h=Dt(n)==="y",{width:A,height:g}=r.floating;let p,x;u==="top"||u==="bottom"?(p=u,x=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(x=u,p=f==="end"?"top":"bottom");const m=g-c.top-c.bottom,v=A-c.left-c.right,b=qn(g-c[p],m),y=qn(A-c[x],v),C=t.middlewareData.shift,I=!C;let w=b,S=y;C!=null&&C.enabled.x&&(S=v),C!=null&&C.enabled.y&&(w=m),I&&!f&&(h?S=A-2*rn(c.left,c.right):w=g-2*rn(c.top,c.bottom)),await i({...t,availableWidth:S,availableHeight:w});const R=await o.getDimensions(s.floating);return A!==R.width||g!==R.height?{reset:{rects:!0}}:{}}}};function fd(e){const t=Ht(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=$e(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Eo(n)!==s||Eo(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Aa(e){return Te(e)?e:e.contextElement}function Vn(e){const t=Aa(e);if(!$e(t))return on(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=fd(t);let i=(s?Eo(n.width):n.width)/r,a=(s?Eo(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const BA=on(0);function pd(e){const t=ot(e);return!ku()||!t.visualViewport?BA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jA(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ot(e)}function Pn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Aa(e);let i=on(1);t&&(r?Te(r)&&(i=Vn(r)):i=Vn(e));const a=jA(s,n,r)?pd(s):on(0);let c=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,f=o.width/i.x,h=o.height/i.y;if(s&&r){const A=ot(s),g=Te(r)?ot(r):r;let p=A,x=vl(p);for(;x&&g!==p;){const m=Vn(x),v=x.getBoundingClientRect(),b=Ht(x),y=v.left+(x.clientLeft+parseFloat(b.paddingLeft))*m.x,C=v.top+(x.clientTop+parseFloat(b.paddingTop))*m.y;c*=m.x,u*=m.y,f*=m.x,h*=m.y,c+=y,u+=C,p=ot(x),x=vl(p)}}return Fr({width:f,height:h,x:c,y:u})}function rs(e,t){const n=Yo(e).scrollLeft;return t?t.left+n:Pn(Cn(e)).left+n}function hd(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-rs(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function MA(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Cn(r),a=t?_i(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=on(1);const f=on(0),h=$e(r);if((h||!s)&&((kt(r)!=="body"||Oi(i))&&(c=Yo(r)),h)){const g=Pn(r);u=Vn(r),f.x=g.x+r.clientLeft,f.y=g.y+r.clientTop}const A=i&&!h&&!s?hd(i,c):on(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+f.x+A.x,y:n.y*u.y-c.scrollTop*u.y+f.y+A.y}}function PA(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function TA(e){const t=Yo(e),n=e.ownerDocument.body,r=rn(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=rn(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+rs(e);const i=-t.scrollTop;return Ht(n).direction==="rtl"&&(s+=rn(e.clientWidth,n.clientWidth)-r),{width:r,height:o,x:s,y:i}}const NA=25;function _A(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",o=ot(e),s=Cn(e),i=o.visualViewport;let a=s.clientWidth,c=s.clientHeight,u=0,f=0;if(i){const A=!ku()||t==="fixed";r?A||(u=-i.offsetLeft,f=-i.offsetTop):(a=i.width,c=i.height,A&&(u=i.offsetLeft,f=i.offsetTop))}if(rs(s)<=0){const A=s.ownerDocument,g=A.body,p=getComputedStyle(g),x=A.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(s.clientWidth-g.clientWidth-x),v=getComputedStyle(s).scrollbarGutter==="stable both-edges"?m/2:m;v<=NA&&(a-=v)}return{width:a,height:c,x:u,y:f}}function OA(e,t){const n=Pn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Vn(e),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function Gl(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=_A(e,n,t);else if(t==="document")r=TA(Cn(e));else if(Te(t))r=OA(t,n);else{const o=pd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Fr(r)}function HA(e,t){const n=t.get(e);if(n)return n;let r=si(e,[],!1).filter(a=>Te(a)&&kt(a)!=="body"),o=null;const s=Ht(e).position==="fixed";let i=s?Xn(e):e;for(;Te(i)&&!Bn(i);){const a=Ht(i),c=wu(i),u=o?o.position:s?"fixed":"";!c&&(u==="fixed"||u==="absolute"&&a.position==="static")?r=r.filter(h=>h!==i):o=a,i=Xn(i)}return t.set(e,r),r}function LA(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?_i(t)?[]:HA(t,this._c):[].concat(n),r],a=Gl(t,i[0],o);let c=a.top,u=a.right,f=a.bottom,h=a.left;for(let A=1;A<i.length;A++){const g=Gl(t,i[A],o);c=rn(g.top,c),u=qn(g.right,u),f=qn(g.bottom,f),h=rn(g.left,h)}return{width:u-h,height:f-c,x:h,y:c}}function KA(e){const{width:t,height:n}=fd(e);return{width:t,height:n}}function WA(e,t,n){const r=$e(t),o=Cn(t),s=n==="fixed",i=Pn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=on(0);if((r||!s)&&((kt(t)!=="body"||Oi(o))&&(a=Yo(t)),r)){const A=Pn(t,!0,s,t);c.x=A.x+t.clientLeft,c.y=A.y+t.clientTop}!r&&o&&(c.x=rs(o));const u=o&&!r&&!s?hd(o,a):on(0),f=i.left+a.scrollLeft-c.x-u.x,h=i.top+a.scrollTop-c.y-u.y;return{x:f,y:h,width:i.width,height:i.height}}function Ns(e){return Ht(e).position==="static"}function zl(e,t){if(!$e(e)||Ht(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Cn(e)===n&&(n=n.ownerDocument.body),n}function gd(e,t){const n=ot(e);if(_i(e))return n;if(!$e(e)){let o=Xn(e);for(;o&&!Bn(o);){if(Te(o)&&!Ns(o))return o;o=Xn(o)}return n}let r=zl(e,t);for(;r&&nh(r)&&Ns(r);)r=zl(r,t);return r&&Bn(r)&&Ns(r)&&!wu(r)?n:r||rh(e)||n}const QA=async function(e){const t=this.getOffsetParent||gd,n=this.getDimensions,r=await n(e.floating);return{reference:WA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function GA(e){return Ht(e).direction==="rtl"}const Ad={convertOffsetParentRelativeRectToViewportRelativeRect:MA,getDocumentElement:Cn,getClippingRect:LA,getOffsetParent:gd,getElementRects:QA,getClientRects:PA,getDimensions:KA,getScale:Vn,isElement:Te,isRTL:GA};function md(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zA(e,t,n){let r=null,o;const s=Cn(e);function i(){var f;clearTimeout(o),(f=r)==null||f.disconnect(),r=null}function a(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),i();const A=e.getBoundingClientRect(),{left:g,top:p,width:x,height:m}=A;if(f||t(),!x||!m)return;const v=Xr(p),b=Xr(s.clientWidth-(g+x)),y=Xr(s.clientHeight-(p+m)),C=Xr(g),w={rootMargin:-v+"px "+-b+"px "+-y+"px "+-C+"px",threshold:rn(0,qn(1,h))||1};let S=!0;function R(E){const k=E[0].intersectionRatio;if(!md(A,e.getBoundingClientRect()))return a();if(k!==h){if(!S)return a();k?a(!1,k):o=setTimeout(()=>{a(!1,1e-7)},1e3)}S=!1}try{r=new IntersectionObserver(R,{...w,root:s.ownerDocument})}catch{r=new IntersectionObserver(R,w)}r.observe(e)}const c=ot(e),u=()=>a(n);return c.addEventListener("resize",u),a(!0),()=>{c.removeEventListener("resize",u),i()}}function Yl(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Aa(e),f=o||s?[...u?si(u):[],...t?si(t):[]]:[];f.forEach(v=>{o&&v.addEventListener("scroll",n),s&&v.addEventListener("resize",n)});const h=u&&a?zA(u,n,s):null;let A=-1,g=null;i&&(g=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&g&&t&&(g.unobserve(t),cancelAnimationFrame(A),A=requestAnimationFrame(()=>{var y;(y=g)==null||y.observe(t)})),n()}),u&&!c&&g.observe(u),t&&g.observe(t));let p,x=c?Pn(e):null;c&&m();function m(){const v=Pn(e);x&&!md(x,v)&&n(),x=v,p=requestAnimationFrame(m)}return n(),()=>{var v;f.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),h?.(),(v=g)==null||v.disconnect(),g=null,c&&cancelAnimationFrame(p)}}const YA=SA,UA=RA,VA=kA,ZA=FA,JA=DA,$A=(e,t,n)=>{const r=new Map,o=n??{},s={...Ad,...o.platform,_c:r};return wA(e,t,{...o,platform:s})};var XA=typeof document<"u",qA=function(){},yo=XA?d.useLayoutEffect:qA;function Fo(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(!Fo(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)&&!Fo(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function xd(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ul(e,t){const n=xd(e);return Math.round(t*n)/n}function _s(e){const t=d.useRef(e);return yo(()=>{t.current=e}),t}function em(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[f,h]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[A,g]=d.useState(r);Fo(A,r)||g(r);const[p,x]=d.useState(null),[m,v]=d.useState(null),b=d.useCallback(P=>{P!==w.current&&(w.current=P,x(P))},[]),y=d.useCallback(P=>{P!==S.current&&(S.current=P,v(P))},[]),C=s||p,I=i||m,w=d.useRef(null),S=d.useRef(null),R=d.useRef(f),E=c!=null,k=_s(c),B=_s(o),T=_s(u),F=d.useCallback(()=>{if(!w.current||!S.current)return;const P={placement:t,strategy:n,middleware:A};B.current&&(P.platform=B.current),$A(w.current,S.current,P).then(L=>{const N={...L,isPositioned:T.current!==!1};j.current&&!Fo(R.current,N)&&(R.current=N,an.flushSync(()=>{h(N)}))})},[A,t,n,B,T]);yo(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,h(P=>({...P,isPositioned:!1})))},[u]);const j=d.useRef(!1);yo(()=>(j.current=!0,()=>{j.current=!1}),[]),yo(()=>{if(C&&(w.current=C),I&&(S.current=I),C&&I){if(k.current)return k.current(C,I,F);F()}},[C,I,F,k,E]);const D=d.useMemo(()=>({reference:w,floating:S,setReference:b,setFloating:y}),[b,y]),H=d.useMemo(()=>({reference:C,floating:I}),[C,I]),_=d.useMemo(()=>{const P={position:n,left:0,top:0};if(!H.floating)return P;const L=Ul(H.floating,f.x),N=Ul(H.floating,f.y);return a?{...P,transform:"translate("+L+"px, "+N+"px)",...xd(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:N}},[n,a,H.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:F,refs:D,elements:H,floatingStyles:_}),[f,F,D,H,_])}const tm=(e,t)=>{const n=YA(e);return{name:n.name,fn:n.fn,options:[e,t]}},nm=(e,t)=>{const n=UA(e);return{name:n.name,fn:n.fn,options:[e,t]}},rm=(e,t)=>({fn:JA(e).fn,options:[e,t]}),om=(e,t)=>{const n=VA(e);return{name:n.name,fn:n.fn,options:[e,t]}},sm=(e,t)=>{const n=ZA(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Os={exports:{}},Hs={};var Vl;function im(){if(Vl)return Hs;Vl=1;var e=Cu(),t=Vu();function n(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,c=e.useDebugValue;return Hs.useSyncExternalStoreWithSelector=function(u,f,h,A,g){var p=s(null);if(p.current===null){var x={hasValue:!1,value:null};p.current=x}else x=p.current;p=a(function(){function v(w){if(!b){if(b=!0,y=w,w=A(w),g!==void 0&&x.hasValue){var S=x.value;if(g(S,w))return C=S}return C=w}if(S=C,r(y,w))return S;var R=A(w);return g!==void 0&&g(S,R)?(y=w,S):(y=w,C=R)}var b=!1,y,C,I=h===void 0?null:h;return[function(){return v(f())},I===null?void 0:function(){return v(I())}]},[f,h,A,g]);var m=o(u,p[0],p[1]);return i(function(){x.hasValue=!0,x.value=m},[m]),c(m),m},Hs}var Zl;function am(){return Zl||(Zl=1,Os.exports=im()),Os.exports}var lm=am();const Ai=[];let mi;function cm(){return mi}function um(e){Ai.push(e)}function ma(e){const t=(n,r)=>{const o=Rt(dm).current;let s;try{mi=o;for(const i of Ai)i.before(o);s=e(n,r);for(const i of Ai)i.after(o);o.didInitialize=!0}finally{mi=void 0}return s};return t.displayName=e.displayName||e.name,t}function bd(e){return d.forwardRef(ma(e))}function dm(){return{didInitialize:!1}}const fm=Iu(19),pm=fm?gm:Am;function Ie(e,t,n,r,o){return pm(e,t,n,r,o)}function hm(e,t,n,r,o){const s=d.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return es.useSyncExternalStore(e.subscribe,s,s)}um({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],o=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,o)||(t=!0,r.value=o)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const o of e.syncHooks)n.add(o.store);const r=[];for(const o of n)r.push(o.subscribe(t));return()=>{for(const o of r)o()}}),es.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function gm(e,t,n,r,o){const s=cm();if(!s)return hm(e,t,n,r,o);const i=s.syncIndex;s.syncIndex+=1;let a;return s.didInitialize?(a=s.syncHooks[i],(a.store!==e||a.selector!==t||!Object.is(a.a1,n)||!Object.is(a.a2,r)||!Object.is(a.a3,o))&&(a.store!==e&&(s.didChangeStore=!0),a.store=e,a.selector=t,a.a1=n,a.a2=r,a.a3=o,a.value=t(e.getSnapshot(),n,r,o))):(a={store:e,selector:t,a1:n,a2:r,a3:o,value:t(e.getSnapshot(),n,r,o)},s.syncHooks.push(a)),a.value}function Am(e,t,n,r,o){return lm.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class mm{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,o){return Ie(this,t,n,r,o)}}class zr extends mm{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){d.useDebugValue(t);const r=this;ae(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;ae(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);ae(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){d.useDebugValue(t);const r=this,o=n!==void 0;ae(()=>{o&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,o])}select(t,n,r,o){const s=this.selectors[t];return s(this.state,n,r,o)}useState(t,n,r,o){return d.useDebugValue(t),Ie(this,this.selectors[t],n,r,o)}useContextCallback(t,n){d.useDebugValue(t);const r=de(n??Sr);this.context[t]=r}useStateSetter(t){const n=d.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return n(o,o,this),this.subscribe(s=>{const i=r(s);if(!Object.is(o,i)){const a=o;o=i,n(i,a,this)}})}}const xm={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class os extends zr{constructor(t){const{syncOnly:n,nested:r,onOpenChange:o,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:id(),nested:r,triggerElements:s},xm),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&yg(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function vd(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:o,nested:s,onOpenChange:i}=e,a=t.useState("open"),c=t.useState("activeTriggerElement"),u=t.useState(n?"popupElement":"positionerElement"),f=t.context.triggerElements,h=i,A=d.useRef(null);r===void 0&&A.current===null&&(A.current=new os({open:a,transitionStatus:void 0,referenceElement:c,floatingElement:u,triggerElements:f,onOpenChange:h,floatingId:o,syncOnly:!0,nested:s}));const g=r??A.current;return t.useSyncedValue("floatingId",o),ae(()=>{const p={open:a,floatingId:o,referenceElement:c,floatingElement:u};Te(c)&&(p.domReferenceElement=c),g.state.positionReference===g.state.referenceElement&&(p.positionReference=c),g.update(p)},[a,o,c,u,g]),g.context.onOpenChange=h,g.context.nested=s,g}const ss={tabIndex:-1,[ci]:""};function bm(e){return t=>t==="touch"?e.current:!0}function yd(e,t=!1){const n=$n(),r=wn()!=null,o=Rt(()=>e(n,r)).current;return vd({popupStore:o,treatPopupAsFloatingElement:t,floatingRootContext:o.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:o.setOpen}),o}function xa({handle:e,store:t}){return ae(()=>e.attachStore(t),[e,t]),null}function vm(e,t){const n=d.useRef(null),r=d.useRef(null);return d.useCallback(o=>{if(e===void 0)return;let s=!1;if(n.current!==null){const i=n.current,a=r.current,c=t.context.triggerElements.getById(i);a&&c===a&&(t.context.triggerElements.delete(i),s=!0),n.current=null,r.current=null}if(o!==null&&(n.current=e,r.current=o,t.context.triggerElements.add(e,o),s=!0),s){const i=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==i&&t.set("triggerCount",i)}},[t,e])}function ba(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const o=n?.id??null;(o||t)&&(e.activeTriggerId=o,e.activeTriggerElement=n??null)}function Cd(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function ym(e,t,n,r={}){const o=n.reason,s=o===at,i=t&&o===Yn,a=!t&&(o===Nn||o===zo),c=Cd(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const u=()=>{const f={...r.extraState,open:t};i?f.instantType="focus":a?f.instantType="dismiss":s&&(f.instantType=void 0),ba(f,t,n.trigger,c()),e.update(f)};s?an.flushSync(u):u()}function Id(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=vm(e,n),i=de(c=>{const u=n.select("open"),f=n.select("activeTriggerId");if(f===e){n.update({activeTriggerElement:c,...u?r:null});return}f==null&&u&&n.update({activeTriggerId:e,activeTriggerElement:c,...r})}),a=d.useCallback(c=>{s(c),c&&i(c)},[s,i]);return ae(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:a,isMountedByThisTrigger:o}}function va(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=d.useRef(null),o=e.useState("open"),s=e.useState("triggerCount"),i=e.useState("activeTriggerId"),a=e.useState("activeTriggerElement");ae(()=>{if(!o){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const c=e.context.triggerElements.size,u={};e.state.triggerCount!==c&&(u.triggerCount=c);const f=e.select("activeTriggerId");let h=null;if(f){const A=e.context.triggerElements.getById(f);if(A)r.current=f,A!==e.state.activeTriggerElement&&(u.activeTriggerElement=A);else{for(const[g,p]of e.context.triggerElements.entries())if(p===e.state.activeTriggerElement){u.activeTriggerId=g,u.activeTriggerElement=p,r.current=g;break}u.activeTriggerId===void 0&&(r.current===f?h=f:r.current=null)}}else r.current=null;if(!h&&!f&&c===1){const A=e.context.triggerElements.entries().next();if(!A.done){const[g,p]=A.value;u.activeTriggerId=g,u.activeTriggerElement=p,r.current=g}}(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)&&e.update(u),h&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===h&&!e.context.triggerElements.getById(h)){const A=Ce(jt);e.setOpen(!1,A),A.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[o,e,s,i,a,n])}function ya(e,t,n){const{mounted:r,setMounted:o,transitionStatus:s}=ir(e),i=t.useState("preventUnmountingOnClose"),a=e?!1:i;t.useSyncedValues({mounted:r,transitionStatus:s,preventUnmountingOnClose:a});const c=de(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Ut({enabled:r&&!e&&!a,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:s}}function Ca(e,t){e.useSyncedValues(t),ae(()=>()=>{e.update({activeTriggerProps:ct,inactiveTriggerProps:ct,popupProps:ct})},[e])}function Cm(e,t){ae(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),ae(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Yr{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function Im(){return new os({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Yr,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Ia(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Im(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:ct,inactiveTriggerProps:ct,popupProps:ct}}function wd(e,t,n=!1){return new os({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const kr=e=>e.triggerIdProp??e.activeTriggerId,wa=e=>e.openProp??e.open,Jl=e=>(e.popupElement?.id??e.floatingId)||void 0;function kd(e,t){return t!==void 0&&wa(e)&&kr(e)===t}function wm(e,t){return kd(e,t)?!0:t!==void 0&&wa(e)&&kr(e)==null&&e.triggerCount===1}const ka={open:wa,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:kr,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Jl,isTriggerActive:(e,t)=>t!==void 0&&kr(e)===t,isOpenedByTrigger:(e,t)=>kd(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&kr(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>wm(e,t)?Jl(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Ed(e){const t=d.useCallback(r=>e===void 0?Sr:e.subscribeStore(r),[e]),n=d.useCallback(()=>e===void 0?void 0:e.store,[e]);return es.useSyncExternalStore(t,n,()=>e?.serverStore)}function km(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,o=$n(),s=wn()!=null,i=Rt(()=>new os({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Yr,floatingId:o,syncOnly:!1,nested:s})).current;return ae(()=>{const a={open:t,floatingId:o};r.reference!==void 0&&(a.referenceElement=r.reference,a.domReferenceElement=Te(r.reference)?r.reference:null),r.floating!==void 0&&(a.floatingElement=r.floating),i.update(a)},[t,o,r.reference,r.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i}function Em(e){return Sm(e,e.rootContext)}function Sm(e,t){const{nodeId:n,externalTree:r}=e,o=t.useState("referenceElement"),s=t.useState("floatingElement"),i=t.useState("domReferenceElement"),a=t.useState("open"),c=t.useState("floatingId"),[u,f]=d.useState(null),[h,A]=d.useState(void 0),[g,p]=d.useState(void 0),x=d.useRef(null),m=kn(r),v=d.useMemo(()=>({reference:o,floating:s,domReference:i}),[o,s,i]),b=em({...e,elements:{...v,...u&&{reference:u}}}),y=Te(h)?h:null,C=g===void 0?t.state.floatingElement:g;t.useSyncedValue("referenceElement",h??null),t.useSyncedValue("domReferenceElement",h===void 0?i:y),t.useSyncedValue("floatingElement",C);const I=d.useCallback(B=>{const T=Te(B)?{getBoundingClientRect:()=>B.getBoundingClientRect(),getClientRects:()=>B.getClientRects(),contextElement:B}:B;f(T),b.refs.setReference(T)},[b.refs]),w=d.useCallback(B=>{(Te(B)||B===null)&&(x.current=B,A(B)),(Te(b.refs.reference.current)||b.refs.reference.current===null||B!==null&&!Te(B))&&b.refs.setReference(B)},[b.refs,A]),S=d.useCallback(B=>{p(B),b.refs.setFloating(B)},[b.refs]),R=d.useMemo(()=>({...b.refs,setReference:w,setFloating:S,setPositionReference:I,domReference:x}),[b.refs,w,S,I]),E=d.useMemo(()=>({...b.elements,domReference:i}),[b.elements,i]),k=d.useMemo(()=>({...b,dataRef:t.context.dataRef,open:a,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:R,elements:E,nodeId:n,rootStore:t}),[b,R,E,n,t,a,c]);return ae(()=>{i&&(x.current=i)},[i]),ae(()=>{t.context.dataRef.current.floatingContext=k;const B=m?.nodesRef.current.find(T=>T.id===n);B&&(B.context=k)}),d.useMemo(()=>({...b,context:k,refs:R,elements:E,rootStore:t}),[b,R,E,k,t])}const Ls=Ji&&ln;function Sd(e,t={}){const{enabled:n=!0,delay:r}=t,o="rootStore"in e?e.rootStore:e,{events:s,dataRef:i}=o.context,a=d.useRef(!1),c=d.useRef(null),u=d.useRef(!0),f=pt();d.useEffect(()=>{const A=o.select("domReferenceElement");if(!n)return;const g=ot(A);function p(){const v=o.select("domReferenceElement");!o.select("open")&&$e(v)&&v===Ct(je(v))&&(a.current=!0)}function x(){u.current=!0}function m(){u.current=!1}return Gt(De(g,"blur",p),Ls&&De(g,"keydown",x,!0),Ls&&De(g,"pointerdown",m,!0))},[o,n]),d.useEffect(()=>{if(!n)return;function A(g){if(g.reason===Nn||g.reason===zo){const p=o.select("domReferenceElement");Te(p)&&(c.current=p,a.current=!0)}}return s.on("openchange",A),()=>{s.off("openchange",A)}},[s,n,o]);const h=d.useMemo(()=>{function A(){a.current=!1,c.current=null}return{onMouseLeave(){A()},onFocus(g){const p=g.currentTarget;if(a.current){if(c.current===p)return;A()}const x=gt(g.nativeEvent);if(Te(x)){if(Ls&&!g.relatedTarget){if(!u.current&&!Xo(x))return}else if(!bg(x))return}const m=wo(g.relatedTarget,o.context.triggerElements),{nativeEvent:v,currentTarget:b}=g,y=typeof r=="function"?r():r;if(o.select("open")&&m||y===0||y===void 0){o.setOpen(!0,Ce(Yn,v,b));return}f.start(y,()=>{a.current||o.setOpen(!0,Ce(Yn,v,b))})},onBlur(g){A();const p=g.relatedTarget,x=g.nativeEvent,m=Te(p)&&p.hasAttribute(Br("focus-guard"))&&p.getAttribute("data-type")==="outside";f.start(0,()=>{const v=o.select("domReferenceElement"),b=Ct(je(v));!p&&b===v||ve(i.current.floatingContext?.refs.floating.current,b)||ve(v,b)||m||wo(p??b,o.context.triggerElements)||o.setOpen(!1,Ce(Yn,x))})}}},[i,r,o,f]);return d.useMemo(()=>n?{reference:h,trigger:h}:{},[n,h])}class Ea{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Lt,this.restTimeout=new Lt,this.handleCloseOptions=void 0}static create(){return new Ea}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const Bo=new WeakMap;function jo(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&Bo.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Bo.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Rd(e,t){const{scopeElement:n,referenceElement:r,floatingElement:o}=t,s=Bo.get(n);s&&s!==e&&jo(s),jo(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=o,Bo.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",o.style.pointerEvents="auto"}function Sa(e){const t=e.context.dataRef.current,n=Rt(()=>t.hoverInteractionState??Ea.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),ia(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Dd(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:o}=t,s="rootStore"in e?e.rootStore:e,i=s.useState("open"),a=s.useState("floatingElement"),c=s.useState("domReferenceElement"),{dataRef:u}=s.context,f=kn(),h=wn(),A=Sa(s),g=pt(),p=de(()=>Xu(u.current.openEvent?.type,A.interactedInside)),x=de(()=>tA(u.current.openEvent?.type)),m=de(()=>{jo(A)});ae(()=>{i||(A.pointerType=void 0,A.restTimeoutPending=!1,A.interactedInside=!1,m())},[i,A,m]),d.useEffect(()=>m,[m]),ae(()=>{if(n&&i&&A.handleCloseOptions?.blockPointerEvents&&x()&&Te(c)&&a){const v=c,b=a,y=je(a),C=f?.nodesRef.current.find(R=>R.id===h)?.context?.elements.floating;C&&(C.style.pointerEvents="");const I=A.pointerEventsScopeElement!==b?A.pointerEventsScopeElement:null,w=C!==b?C:null,S=A.handleCloseOptions?.getScope?.()??I??w??v.closest("[data-rootownerid]")??y.body;return Rd(A,{scopeElement:S,referenceElement:v,floatingElement:b}),()=>{m()}}},[n,i,c,a,A,x,f,h,m]),d.useEffect(()=>{if(!n)return;function v(){return!!(f&&h&&bn(f.nodesRef.current,h).length>0)}function b(R){const E=tr(r,"close",A.pointerType),k=()=>{s.setOpen(!1,Ce(at,R)),f?.events.emit("floating.closed",R)};E?A.openChangeTimeout.start(E,k):(A.openChangeTimeout.clear(),k())}function y(R){const E=gt(R);if(!xg(E)){A.interactedInside=!1;return}A.interactedInside=E?.closest("[aria-haspopup]")!=null}function C(){A.openChangeTimeout.clear(),g.clear(),f?.events.off("floating.closed",w),m()}function I(R){if(v()&&f){f.events.on("floating.closed",w);return}if(wo(R.relatedTarget,s.context.triggerElements))return;const E=u.current.floatingContext?.nodeId??o,k=R.relatedTarget;if(!(f&&E&&Te(k)&&bn(f.nodesRef.current,E,!1).some(T=>ve(T.context?.elements.floating,k)))){if(A.handler){A.handler(R);return}m(),x()&&!p()&&b(R)}}function w(R){!f||!h||v()||g.start(0,()=>{f.events.off("floating.closed",w),s.setOpen(!1,Ce(at,R)),f.events.emit("floating.closed",R)})}const S=a;return Gt(S&&De(S,"mouseenter",C),S&&De(S,"mouseleave",I),S&&De(S,"pointerdown",y,!0),()=>{f?.events.off("floating.closed",w)})},[n,a,s,u,r,o,x,p,m,A,f,h,g])}const Rm={current:null};function Fd(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:o=null,mouseOnly:s=!1,restMs:i=0,move:a=!0,triggerElementRef:c=Rm,externalTree:u,isActiveTrigger:f=!0,getHandleCloseContext:h,isClosing:A,shouldOpen:g,guardStaleOpen:p=!1}=t,x="rootStore"in e?e.rootStore:e,{dataRef:m,events:v}=x.context,b=kn(u),y=Sa(x),C=d.useRef(!1),I=et(o),w=et(r),S=et(i),R=et(n),E=et(g),k=et(A),B=de(()=>Xu(m.current.openEvent?.type,y.interactedInside)),T=de(()=>E.current?.()!==!1),F=de((H,_,P)=>{const L=x.context.triggerElements;if(L.hasElement(_))return!H||!ve(H,_);if(!Te(P))return!1;const N=P;return L.hasMatchingElement(M=>ve(M,N))&&(!H||!ve(H,N))}),j=de(()=>{if(!y.handler)return;je(x.select("domReferenceElement")).removeEventListener("mousemove",y.handler),y.handler=void 0}),D=de(()=>{jo(y)});return f&&(y.handleCloseOptions=I.current?.__options),d.useEffect(()=>j,[j]),d.useEffect(()=>{if(!n)return;function H(_){_.open?C.current=!1:(C.current=_.reason===at,j(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return v.on("openchange",H),()=>{v.off("openchange",H)}},[n,v,y,j]),d.useEffect(()=>{if(!n)return;function H(O,G=!0){const Z=tr(w.current,"close",y.pointerType);Z?y.openChangeTimeout.start(Z,()=>{x.setOpen(!1,Ce(at,O)),b?.events.emit("floating.closed",O)}):G&&(y.openChangeTimeout.clear(),x.setOpen(!1,Ce(at,O)),b?.events.emit("floating.closed",O))}const _=c.current??(f?x.select("domReferenceElement"):null);if(!Te(_))return;function P(O){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,s&&!xn(y.pointerType))return;const G=jl(S.current),Z=tr(w.current,"open",y.pointerType),J=gt(O),Q=O.currentTarget??null,$=x.select("domReferenceElement");let K=Q;if(Te(J)&&!x.context.triggerElements.hasElement(J)){for(const re of x.context.triggerElements.elements())if(ve(re,J)){K=re;break}}Te(Q)&&Te($)&&!x.context.triggerElements.hasElement(Q)&&ve(Q,$)&&(K=$);const te=K==null?!1:F($,K,J),le=x.select("open"),X=k.current?.()??x.select("transitionStatus")==="ending",ee=!le&&X&&C.current,U=!te&&Te(K)&&Te($)&&ve($,K)&&ee,ue=G>0&&!Z,se=te&&(le||ee)||U,be=!le||te;if(se){T()&&x.setOpen(!0,Ce(at,O,K));return}ue||(Z?y.openChangeTimeout.start(Z,()=>{be&&T()&&x.setOpen(!0,Ce(at,O,K))}):be&&T()&&x.setOpen(!0,Ce(at,O,K)))}function L(O){if(B()){D();return}j();const G=x.select("domReferenceElement"),Z=je(G);y.restTimeout.clear(),y.restTimeoutPending=!1;const J=m.current.floatingContext??h?.();if(wo(O.relatedTarget,x.context.triggerElements))return;if(I.current&&J){x.select("open")||y.openChangeTimeout.clear();const $=c.current;y.handler=I.current({...J,tree:b,x:O.clientX,y:O.clientY,onClose(){D(),j(),R.current&&!B()&&$===x.select("domReferenceElement")&&H(O,!0)}}),Z.addEventListener("mousemove",y.handler),y.handler(O);return}(y.pointerType!=="touch"||!ve(x.select("floatingElement"),O.relatedTarget))&&H(O)}function N(O){ve(_,O.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}const M=p?De(_,"mouseout",N):void 0;return a?Gt(De(_,"mousemove",P,{once:!0}),De(_,"mouseenter",P),De(_,"mouseleave",L),M):Gt(De(_,"mouseenter",P),De(_,"mouseleave",L),M)},[j,D,m,w,x,n,I,y,f,F,B,s,a,S,c,b,R,h,k,T,p]),d.useMemo(()=>{if(!n)return;function H(_){y.pointerType=_.pointerType}return{onPointerDown:H,onPointerEnter:H,onMouseMove(_){const{nativeEvent:P}=_,L=_.currentTarget,N=x.select("domReferenceElement"),M=x.select("open"),O=F(N,L,_.target);if(s&&!xn(y.pointerType))return;if(M&&O&&y.handleCloseOptions?.blockPointerEvents){const J=x.select("floatingElement");if(J){const Q=y.handleCloseOptions?.getScope?.()??L.ownerDocument.body;Rd(y,{scopeElement:Q,referenceElement:L,floatingElement:J})}}const G=jl(S.current);if(M&&!O||G===0||!O&&y.restTimeoutPending&&_.movementX**2+_.movementY**2<2)return;y.restTimeout.clear();function Z(){if(y.restTimeoutPending=!1,B())return;const J=x.select("open");!y.blockMouseMove&&(!J||O)&&T()&&x.setOpen(!0,Ce(at,P,L))}y.pointerType==="touch"?an.flushSync(()=>{Z()}):O&&M?Z():(y.restTimeoutPending=!0,y.restTimeout.start(G,Z))}}},[n,y,B,F,s,x,S,T])}const Dm="Escape";function $l(e){return ln&&e.movementX===0&&e.movementY===0}function is(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function no(e,t){return is(t,e===Tu||e===Xi,e===Jo||e===$o)}function Ks(e,t,n){return is(t,e===Xi,n?e===Jo:e===$o)||e==="Enter"||e===" "||e===""}function Fm(e,t,n){return is(t,n?e===Jo:e===$o,e===Xi)}function Bm(e,t,n,r){const o=n?e===$o:e===Jo,s=e===Tu;return t==="both"||t==="horizontal"&&r?e===Dm:is(t,o,s)}function Bd(e,t){const{listRef:n,activeIndex:r,onNavigate:o=()=>{},enabled:s=!0,selectedIndex:i=null,allowEscape:a=!1,loopFocus:c=!1,nested:u=!1,rtl:f=!1,virtual:h=!1,focusItemOnOpen:A="auto",focusItemOnHover:g=!0,openOnArrowKeyDown:p=!0,disabledIndices:x=void 0,orientation:m="vertical",parentOrientation:v,id:b,resetOnPointerLeave:y=!0,externalTree:C,grid:I}=t,w=I!=null,S="rootStore"in e?e.rootStore:e,R=S.useState("open"),E=S.useState("floatingElement"),k=S.useState("domReferenceElement"),B=S.context.dataRef,T=ko(E),F=ui(k),j=et(T),D=wn(),H=kn(C),_=d.useRef(A),P=d.useRef(i??-1),L=d.useRef(null),N=d.useRef(!0),M=de(W=>{o(P.current===-1?null:P.current,W)}),O=d.useRef(!!E),G=d.useRef(R),Z=d.useRef(!1),J=d.useRef(!1),Q=d.useRef(null),$=et(x),K=et(R),te=et(i),le=et(y),X=er(),ee=er(),U=de(()=>{function W(ne){h?H?.events.emit("virtualfocus",ne):Q.current=vo(ne,{sync:Z.current,preventScroll:!0})}const V=n.current[P.current],ye=J.current;V&&W(V),(Z.current?ne=>ne():ne=>X.request(ne))(()=>{const ne=n.current[P.current]||V;if(!ne)return;V||W(ne),ie&&(ye||!N.current)&&ne.scrollIntoView?.({block:"nearest",inline:"nearest"})})});ae(()=>{B.current.orientation=m},[B,m]),ae(()=>{s&&(R&&E?(P.current=i??-1,_.current&&i!=null&&(J.current=!0,M())):O.current&&(P.current=-1,M()))},[s,R,E,i,M]),ae(()=>{if(s){if(!R){Z.current=!1;return}if(E)if(r==null){if(Z.current=!1,te.current!=null)return;if(O.current&&(P.current=-1,U()),(!G.current||!O.current)&&_.current&&(L.current!=null||_.current===!0&&L.current==null)){let W=0;const V=()=>{n.current[0]==null?(W<2&&(W?q=>ee.request(q):queueMicrotask)(V),W+=1):(P.current=L.current==null||Ks(L.current,m,f)||u?bo(n):fi(n),L.current=null,M())};V()}}else wr(n.current,r)||(P.current=r,U(),J.current=!1)}},[s,R,E,r,te,u,n,m,f,M,U,ee]),ae(()=>{if(!s||E||!H||h||!O.current)return;const W=H.nodesRef.current,V=W.find(ne=>ne.id===D)?.context?.elements.floating,ye=Ct(je(k??V??null)),q=W.some(ne=>ne.context&&ve(ne.context.elements.floating,ye));V&&!q&&N.current&&V.focus({preventScroll:!0})},[s,E,k,H,D,h]),ae(()=>{G.current=R,O.current=!!E}),ae(()=>{R||(L.current=null,_.current=A)},[R,A]);const ue=r!=null,se=de(W=>{if(!K.current)return;const V=n.current.indexOf(W.currentTarget);V!==-1&&(P.current!==V||r!==V)&&(P.current=V,M(W))}),be=de(()=>v??H?.nodesRef.current.find(W=>W.id===D)?.context?.dataRef?.current.orientation),re=de(()=>bo(n,$.current)),Ae=de(W=>{if(N.current=!1,Z.current=!0,W.which===229||!K.current&&W.currentTarget===j.current)return;if(u&&Bm(W.key,m,f,w)){no(W.key,be())||Kt(W),S.setOpen(!1,Ce(ii,W.nativeEvent)),$e(k)&&(h?H?.events.emit("virtualfocus",k):k.focus());return}const V=P.current,ye=bo(n,x),q=fi(n,x);if(F||(W.key==="Home"&&(Kt(W),P.current=ye,M(W)),W.key==="End"&&(Kt(W),P.current=q,M(W))),I!=null){const ne=I(W,P.current,n,m,c,f,x,ye,q);if(ne!=null&&(P.current=ne,M(W)),m==="both")return}if(no(W.key,m)){if(Kt(W),R&&!h&&Ct(W.currentTarget.ownerDocument)===W.currentTarget){P.current=Ks(W.key,m,f)?ye:q,M(W);return}Ks(W.key,m,f)?c?V>=q?a&&V!==n.current.length?P.current=-1:(Z.current=!1,P.current=ye):P.current=nn(n.current,{startingIndex:V,disabledIndices:x}):P.current=Math.min(q,nn(n.current,{startingIndex:V,disabledIndices:x})):c?V<=ye?a&&V!==-1?P.current=n.current.length:(Z.current=!1,P.current=q):P.current=nn(n.current,{startingIndex:V,decrement:!0,disabledIndices:x}):P.current=Math.max(ye,nn(n.current,{startingIndex:V,decrement:!0,disabledIndices:x})),wr(n.current,P.current)&&(P.current=-1),M(W)}}),ie=d.useMemo(()=>({onFocus(V){Z.current=!0,se(V)},onClick:({currentTarget:V})=>V.focus({preventScroll:!0}),onMouseMove(V){$l(V)||(Z.current=!0,J.current=!1,g&&se(V))},onPointerLeave(V){if(!K.current||!N.current||V.pointerType==="touch")return;Z.current=!0;const ye=V.relatedTarget;if(!(!g||n.current.includes(ye))&&le.current&&(Q.current?.(),Q.current=null,P.current=-1,M(V),!h)){const q=j.current,ne=Ct(je(q));q&&ve(q,ne)&&q.focus({preventScroll:!0})}}}),[se,K,j,g,n,M,le,h]),oe=d.useMemo(()=>h&&R&&ue&&{"aria-activedescendant":`${b}-${r}`},[h,R,ue,b,r]),ce=d.useMemo(()=>({"aria-orientation":m==="both"?void 0:m,...F?{}:oe,onKeyDown(W){if(W.key==="Tab"&&W.shiftKey&&R&&!h){const V=gt(W.nativeEvent);if(V&&!ve(j.current,V))return;Kt(W),S.setOpen(!1,Ce(Mn,W.nativeEvent)),$e(k)&&k.focus();return}Ae(W)},onPointerMove(W){$l(W)||(N.current=!0)}}),[oe,Ae,j,m,F,S,R,h,k]),me=d.useMemo(()=>{function W(q){S.setOpen(!0,Ce(ii,q.nativeEvent,q.currentTarget))}function V(q){A==="auto"&&qi(q.nativeEvent)&&(_.current=!h)}function ye(q){_.current=A,A==="auto"&&ea(q.nativeEvent)&&(_.current=!0)}return{onKeyDown(q){const ne=S.select("open");N.current=!1;const ke=q.key.startsWith("Arrow"),Se=Fm(q.key,be(),f),Qe=no(q.key,m),tt=(u?Se:Qe)||q.key==="Enter"||q.key.trim()==="";if(h&&ne)return Ae(q);if(!(!ne&&!p&&ke)){if(tt){const Le=no(q.key,be());L.current=u&&Le?null:q.key}if(u){Se&&(Kt(q),ne?(P.current=re(),M(q)):W(q));return}Qe&&(te.current!=null&&(P.current=te.current),Kt(q),!ne&&p?W(q):Ae(q),ne&&M(q))}},onFocus(q){S.select("open")&&!h&&(P.current=-1,M(q))},onPointerDown:ye,onPointerEnter:ye,onMouseDown:V,onClick:V}},[Ae,A,re,u,M,S,p,m,be,f,te,h]),ge=d.useMemo(()=>({...oe,...me}),[oe,me]);return d.useMemo(()=>s?{reference:ge,floating:ce,item:ie,trigger:me}:{},[s,ge,ce,me,ie])}function jd(e,t){const{listRef:n,elementsRef:r,activeIndex:o,onMatch:s,disabledIndices:i,onTyping:a,enabled:c=!0,resetMs:u=750,selectedIndex:f=null}=t,h="rootStore"in e?e.rootStore:e,A=h.useState("open"),g=pt(),p=d.useRef(""),x=d.useRef(f??o??-1),m=d.useRef(null),v=de(C=>{function I(j){return r?.current[j]}function w(j){const D=I(j);return D&&!qo(D)||D?.matches(":disabled")?!1:i==null||!Ro(Ot,j,i)}function S(j,D,H=0){if(j.length===0)return-1;const _=(H%j.length+j.length)%j.length,P=D.toLowerCase();for(let L=0;L<j.length;L+=1){const N=(_+L)%j.length;if(!(!j[N]?.toLowerCase().startsWith(P)||!w(N)))return N}return-1}const R=n.current;if(p.current.length>0&&C.key===" "&&(Kt(C),a?.(!0)),p.current.length>0&&p.current[0]!==" "&&S(R,p.current)===-1&&C.key!==" "&&a?.(!1),R==null||C.key.length!==1||C.ctrlKey||C.metaKey||C.altKey)return;A&&C.key!==" "&&(Kt(C),a?.(!0));const E=p.current==="";E&&(x.current=f??o??-1),R.every((j,D)=>j&&w(D)?j[0]?.toLowerCase()!==j[1]?.toLowerCase():!0)&&p.current===C.key&&(p.current="",x.current=m.current),p.current+=C.key,g.start(u,()=>{p.current="",x.current=m.current,a?.(!1)});const T=((E?f??o??-1:x.current)??0)+1,F=S(R,p.current,T);F!==-1?(s?.(F),m.current=F):C.key!==" "&&(p.current="",a?.(!1))}),b=de(C=>{const I=C.relatedTarget,w=h.select("domReferenceElement"),S=h.select("floatingElement");ve(w,I)||ve(S,I)||(g.clear(),p.current="",x.current=m.current,a?.(!1))});ae(()=>{!A&&f!==null||(g.clear(),m.current=null,p.current!==""&&(p.current=""))},[A,f,g]);const y=d.useMemo(()=>({onKeyDown:v,onBlur:b}),[v,b]);return d.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}const Xl=.1,jm=Xl*Xl,We=.5;function ro(e,t,n,r,o,s){return r>=t!=s>=t&&e<=(o-n)*(t-r)/(s-r)+n}function oo(e,t,n,r,o,s,i,a,c,u){let f=!1;return ro(e,t,n,r,o,s)&&(f=!f),ro(e,t,o,s,i,a)&&(f=!f),ro(e,t,i,a,c,u)&&(f=!f),ro(e,t,c,u,n,r)&&(f=!f),f}function Mm(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function so(e,t,n,r,o,s){const i=Math.min(n,o),a=Math.max(n,o),c=Math.min(r,s),u=Math.max(r,s);return e>=i&&e<=a&&t>=c&&t<=u}function Md(e={}){const{blockPointerEvents:t=!1}=e,n=new Lt,r=({x:o,y:s,placement:i,elements:a,onClose:c,nodeId:u,tree:f})=>{const h=i?.split("-")[0];let A=!1,g=null,p=null,x=typeof performance<"u"?performance.now():0;function m(b,y){const C=performance.now(),I=C-x;if(g===null||p===null||I===0)return g=b,p=y,x=C,!1;const w=b-g,S=y-p,R=w*w+S*S,E=I*I*jm;return g=b,p=y,x=C,R<E}function v(){n.clear(),c()}return function(y){n.clear();const C=a.domReference,I=a.floating;if(!C||!I||h==null||o==null||s==null)return;const{clientX:w,clientY:S}=y,R=gt(y),E=y.type==="mouseleave",k=ve(I,R),B=ve(C,R);if(k&&(A=!0,!E))return;if(B&&(A=!1,!E)){A=!0;return}if(E&&Te(y.relatedTarget)&&ve(I,y.relatedTarget))return;function T(){return!!(f&&bn(f.nodesRef.current,u).length>0)}function F(){T()||v()}if(T())return;const j=C.getBoundingClientRect(),D=I.getBoundingClientRect(),H=o>D.right-D.width/2,_=s>D.bottom-D.height/2,P=D.width>j.width,L=D.height>j.height,N=(P?j:D).left,M=(P?j:D).right,O=(L?j:D).top,G=(L?j:D).bottom;if(h==="top"&&s>=j.bottom-1||h==="bottom"&&s<=j.top+1||h==="left"&&o>=j.right-1||h==="right"&&o<=j.left+1){F();return}let Z=!1;switch(h){case"top":Z=so(w,S,N,j.top+1,M,D.bottom-1);break;case"bottom":Z=so(w,S,N,D.top+1,M,j.bottom-1);break;case"left":Z=so(w,S,D.right-1,G,j.left+1,O);break;case"right":Z=so(w,S,j.right-1,G,D.left+1,O);break}if(Z)return;if(A&&!Mm(w,S,j)){F();return}if(!E&&m(w,S)){F();return}let J=!1;switch(h){case"top":{const Q=P?We/2:We*4,$=P||H?o+Q:o-Q,K=P?o-Q:H?o+Q:o-Q,te=s+We+1,le=H||P?D.bottom-We:D.top,X=H?P?D.bottom-We:D.top:D.bottom-We;J=oo(w,S,$,te,K,te,D.left,le,D.right,X);break}case"bottom":{const Q=P?We/2:We*4,$=P||H?o+Q:o-Q,K=P?o-Q:H?o+Q:o-Q,te=s-We,le=H||P?D.top+We:D.bottom,X=H?P?D.top+We:D.bottom:D.top+We;J=oo(w,S,$,te,K,te,D.left,le,D.right,X);break}case"left":{const Q=L?We/2:We*4,$=L||_?s+Q:s-Q,K=L?s-Q:_?s+Q:s-Q,te=o+We+1,le=_||L?D.right-We:D.left,X=_?L?D.right-We:D.left:D.right-We;J=oo(w,S,le,D.top,X,D.bottom,te,$,te,K);break}case"right":{const Q=L?We/2:We*4,$=L||_?s+Q:s-Q,K=L?s-Q:_?s+Q:s-Q,te=o-We,le=_||L?D.left+We:D.right,X=_?L?D.left+We:D.right:D.left+We;J=oo(w,S,te,$,te,K,le,D.top,X,D.bottom);break}}J?A||n.start(40,F):F()}};return r.__options={...e,blockPointerEvents:t},r}const Pd=d.createContext(void 0);function Pm(){const e=d.useContext(Pd);if(e===void 0)throw new Error(st(26));return e}const xi="ArrowUp",bi="ArrowDown",vi="ArrowLeft",yi="ArrowRight",Ci="Home",Ii="End",as=new Set([xi,bi,vi,yi,Ci,Ii]),Tm="Shift",Nm=[Tm,"Control","Alt","Meta"];function _m(e){return $e(e)&&e.tagName==="INPUT"}function ql(e){return!!(_m(e)&&e.selectionStart!=null||$e(e)&&e.tagName==="TEXTAREA")}function ec(e,t,n,r){if(!e||!t||!t.scrollTo)return;let o=e.scrollLeft,s=e.scrollTop;const i=e.clientWidth<e.scrollWidth,a=e.clientHeight<e.scrollHeight;if(i&&r!=="vertical"){const c=tc(e,t,"left"),u=io(e),f=io(t);n==="ltr"&&(c+t.offsetWidth+f.scrollMarginRight>e.scrollLeft+e.clientWidth-u.scrollPaddingRight?o=c+t.offsetWidth+f.scrollMarginRight-e.clientWidth+u.scrollPaddingRight:c-f.scrollMarginLeft<e.scrollLeft+u.scrollPaddingLeft&&(o=c-f.scrollMarginLeft-u.scrollPaddingLeft)),n==="rtl"&&(c-f.scrollMarginLeft<e.scrollLeft+u.scrollPaddingLeft?o=c-f.scrollMarginLeft-u.scrollPaddingLeft:c+t.offsetWidth+f.scrollMarginRight>e.scrollLeft+e.clientWidth-u.scrollPaddingRight&&(o=c+t.offsetWidth+f.scrollMarginRight-e.clientWidth+u.scrollPaddingRight))}if(a&&r!=="horizontal"){const c=tc(e,t,"top"),u=io(e),f=io(t);c-f.scrollMarginTop<e.scrollTop+u.scrollPaddingTop?s=c-f.scrollMarginTop-u.scrollPaddingTop:c+t.offsetHeight+f.scrollMarginBottom>e.scrollTop+e.clientHeight-u.scrollPaddingBottom&&(s=c+t.offsetHeight+f.scrollMarginBottom-e.clientHeight+u.scrollPaddingBottom)}e.scrollTo({left:o,top:s,behavior:"auto"})}function tc(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);)t=t.offsetParent;return o}function io(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const Om={...Qr,...On,nestedDialogOpen(e){return e?{"data-nested-dialog-open":""}:null}},Ra=d.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:i,initialFocus:a,...c}=t,u=Hn(),f=u.useState("descriptionElementId"),h=u.useState("disablePointerDismissal"),A=u.useState("floatingRootContext"),g=u.useState("popupProps"),p=u.useState("modal"),x=u.useState("mounted"),m=u.useState("nested"),v=u.useState("nestedOpenDialogCount"),b=u.useState("open"),y=u.useState("openMethod"),C=u.useState("titleElementId"),I=u.useState("transitionStatus"),w=u.useState("role"),S=A.useState("floatingId");Pm(),Ut({open:b,ref:u.context.popupRef,onComplete(){b&&u.context.onOpenChangeComplete?.(!0)}});const R=a===void 0?bm(u.context.popupRef):a,E=v>0,k=u.useStateSetter("popupElement"),T=Me("div",t,{state:{open:b,nested:m,transitionStatus:I,nestedDialogOpen:E},props:[g,{id:S,"aria-labelledby":C,"aria-describedby":f,role:w,...ss,hidden:!x,onKeyDown(F){as.has(F.key)&&F.stopPropagation()},style:{"--nested-dialogs":v}},c],ref:[n,u.context.popupRef,k],stateAttributesMapping:Om});return l.jsx(ga,{context:A,openInteractionType:y,disabled:!x,closeOnFocusOut:!h,initialFocus:R,returnFocus:i,modal:p!==!1,restoreFocus:"popup",children:T})});function Da(e){return Iu(19)?e:e?"true":void 0}const Fa=d.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const i=r.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return l.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})}),Ba=d.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,s=Hn(),i=s.useState("mounted"),a=s.useState("modal"),c=s.useState("open");return i||r?l.jsx(Pd.Provider,{value:r,children:l.jsxs(fa,{ref:n,...o,children:[i&&a===!0&&l.jsx(Fa,{ref:s.context.internalBackdropRef,inert:Da(!c)}),t.children]})}):null});let nc={},rc={},oc="";function ls(e,t){return Oi(e)?e:t}function sc(e,t,n){return/hidden|clip/.test(e.getComputedStyle(ls(t,n)).overflowY)}function Hm(e){if(typeof document>"u")return!1;const t=je(e);return ot(t).innerWidth-t.documentElement.clientWidth>0}function Lm(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=je(e),r=n.documentElement,o=n.body,s=ls(r,o),i=s.style.overflowY,a=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const c=s.offsetWidth;s.style.overflowY="hidden";const u=s.offsetWidth;return s.style.overflowY=i,r.style.scrollbarGutter=a,c===u}function Km(e){const t=je(e),n=t.documentElement,r=t.body,o=ls(n,r),s={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,s)}}function Wm(e){const t=je(e),n=t.documentElement,r=t.body,o=ot(n);let s=0,i=0,a=!1;const c=It.create();if(ln&&(o.visualViewport?.scale??1)!==1)return()=>{};function u(){const g=o.getComputedStyle(n),p=o.getComputedStyle(r),v=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,nc={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},oc=n.style.scrollBehavior,rc={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const b=n.scrollHeight>n.clientHeight,y=n.scrollWidth>n.clientWidth,C=g.overflowY==="scroll"||p.overflowY==="scroll",I=g.overflowX==="scroll"||p.overflowX==="scroll",w=Math.max(0,o.innerWidth-r.clientWidth),S=Math.max(0,o.innerHeight-r.clientHeight),R=parseFloat(p.marginTop)+parseFloat(p.marginBottom),E=parseFloat(p.marginLeft)+parseFloat(p.marginRight),k=ls(n,r);if(a=Lm(e),a){n.style.scrollbarGutter=v,k.style.overflowY="hidden",k.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:v,overflowY:"hidden",overflowX:"hidden"}),(b||C)&&(n.style.overflowY="scroll"),(y||I)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:R||S?`calc(100dvh - ${R+S}px)`:"100dvh",width:E||w?`calc(100vw - ${E+w}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function f(){Object.assign(n.style,nc),Object.assign(r.style,rc),a||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=oc)}function h(){f(),c.request(u)}u();const A=De(o,"resize",h);return()=>{c.cancel(),f(),typeof o.removeEventListener=="function"&&A()}}class Qm{lockCount=0;restore=null;timeoutLock=Lt.create();timeoutUnlock=Lt.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const n=je(t),r=n.documentElement,o=n.body,s=ot(r);if(sc(s,r,o)){const a=new s.MutationObserver(()=>{sc(s,r,o)||(a.disconnect(),this.restore=null,this.lock(t))}),c={attributes:!0};a.observe(r,c),a.observe(o,c),this.restore=()=>a.disconnect();return}const i=Zo||!Hm(t);this.restore=i?Km(t):Wm(t)}}const Gm=new Qm;function Td(e=!0,t=null){ae(()=>{if(e)return Gm.acquire(t)},[e,t])}function zm({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),o=e.useState("disablePointerDismissal"),s=e.useState("modal"),i=e.useState("popupElement"),a=e.useState("floatingRootContext"),[c,u]=d.useState(0),[f,h]=d.useState(0),A=c===0,g=ns(a,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(p){if(!e.context.outsidePressEnabledRef.current||"button"in p&&p.button!==0)return!1;if("touches"in p){if(p.type==="touchend"){if(p.changedTouches.length!==1||p.touches.length!==0)return!1}else if(p.touches.length!==1)return!1}const x=gt(p);if(A&&!o){if(s){const m=e.context.internalBackdropRef.current,v=e.context.backdropRef.current;return m||v?m===x||v===x||ve(x,i)&&!x?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:A});return Td(r&&s===!0,i),e.useContextCallback("onNestedDialogOpen",(p,x)=>{u(p),h(x)}),ae(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(c+1,f+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,c,f,t]),Ca(e,{activeTriggerProps:g.reference,inactiveTriggerProps:g.trigger,popupProps:g.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:f}),null}const Ym={...ka,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class Um extends zr{constructor(t,n,r){const o=new Yr,s=Vm(t,o,n,r);super(s,Zm(o),Ym)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const r={open:t};ba(r,t,n.trigger),this.update(r)}}function Vm(e,t,n,r=!1){const o={...Ia(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e};return o.floatingRootContext=wd(t,n,r),o}function Zm(e){return{popupRef:d.createRef(),backdropRef:d.createRef(),internalBackdropRef:d.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Nd(e,t){const{children:n,open:r,defaultOpen:o=!1,onOpenChange:s,onOpenChangeComplete:i,disablePointerDismissal:a=!1,modal:c=!0,actionsRef:u,handle:f,triggerId:h,defaultTriggerId:A=null}=t,g=e==="drawer",p=e==="alert-dialog",x=p?!0:c,m=p||a,v=p?"alertdialog":"dialog",b=Hn(!0),y=b!=null,C={modal:x,disablePointerDismissal:m,nested:y,role:v},I=yd((B,T)=>new Um({open:o,openProp:r,activeTriggerId:A,triggerIdProp:h,...C},B,T),!0);I.useControlledProp("openProp",r),I.useControlledProp("triggerIdProp",h),I.useSyncedValues(C),I.useContextCallback("onOpenChange",s),I.useContextCallback("onOpenChangeComplete",i);const w=I.useState("open"),S=I.useState("mounted"),R=I.useState("payload");Cm(I,w),va(I);const{forceUnmount:E}=ya(w,I);d.useImperativeHandle(u,()=>({unmount:E,close:()=>I.setOpen(!1,Ce(Hi))}),[E,I]);const k=w||S;return l.jsxs(Ju.Provider,{value:I,children:[f&&l.jsx(xa,{handle:f,store:I}),k&&l.jsx(zm,{store:I,parentContext:b?.context,isDrawer:g}),typeof n=="function"?n({payload:R}):n]})}function _d(e){return Nd("dialog",e)}const ja=d.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,...a}=t,c=Hn(),u=wt(i);return c.useSyncedValueWithCleanup("titleElementId",u),Me("h2",t,{ref:n,props:[{id:u},a]})});function Jm(e){const t=d.useRef(""),n=d.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:d.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o?e(o,o.pointerType):e(o,t.current),t.current=""},[e]),onPointerDown:n}}function cs(e,t){const n=d.useRef(e),r=de(t);ae(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function $m(e,t){const n=de((s,i)=>{(typeof e=="function"?e():e)||t(i||(Zo?"touch":""))}),{onClick:r,onPointerDown:o}=Jm(n);return d.useMemo(()=>({onClick:r,onPointerDown:o}),[r,o])}function Od(e){const[t,n]=d.useState(null),r=$m(e,n);return cs(e,o=>{o&&!e&&n(null)}),d.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Xm({...e}){return l.jsx(_d,{"data-slot":"sheet",...e})}function qm({...e}){return l.jsx(Ba,{"data-slot":"sheet-portal",...e})}function e0({className:e,...t}){return l.jsx(ca,{"data-slot":"sheet-overlay",className:he("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...t})}function t0({className:e,children:t,side:n="right",showCloseButton:r=!0,...o}){return l.jsxs(qm,{children:[l.jsx(e0,{}),l.jsxs(Ra,{"data-slot":"sheet-content","data-side":n,className:he("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...o,children:[t,r&&l.jsxs(Gr,{"data-slot":"sheet-close",render:l.jsx(Oe,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[l.jsx(Zi,{}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function n0({className:e,...t}){return l.jsx("div",{"data-slot":"sheet-header",className:he("flex flex-col gap-0.5 p-4",e),...t})}function r0({className:e,...t}){return l.jsx(ja,{"data-slot":"sheet-title",className:he("cn-font-heading text-base font-medium text-foreground",e),...t})}function o0({className:e,...t}){return l.jsx(ua,{"data-slot":"sheet-description",className:he("text-sm text-muted-foreground",e),...t})}function en({className:e,...t}){return l.jsx("div",{"data-slot":"skeleton",className:he("animate-pulse rounded-md bg-muted",e),...t})}const Hd=d.createContext(void 0);function Ur(e){const t=d.useContext(Hd);if(t===void 0&&!e)throw new Error(st(72));return t}const s0={...ka,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class i0 extends zr{constructor(t,n,r){const o=new Yr;super(a0(t,o,n,r),l0(o),s0)}setOpen=(t,n)=>{ym(this,t,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(t){this.state.floatingRootContext.dispatchOpenChange(!1,Ce(Nn,t))}}function a0(e,t,n,r=!1){const o={...Ia(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e};return o.floatingRootContext=wd(t,n,r),o}function l0(e){return{popupRef:d.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const c0=ma(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:o,disableHoverablePopup:s=!1,trackCursorAxis:i="none",actionsRef:a,onOpenChange:c,onOpenChangeComplete:u,handle:f,triggerId:h,defaultTriggerId:A=null,children:g}=t,p=yd((B,T)=>new i0({open:r,openProp:o,activeTriggerId:A,triggerIdProp:h},B,T));p.useControlledProp("openProp",o),p.useControlledProp("triggerIdProp",h),p.useContextCallback("onOpenChange",c),p.useContextCallback("onOpenChangeComplete",u);const x=p.useState("open"),m=!n&&x,v=p.useState("activeTriggerId"),b=p.useState("mounted"),y=p.useState("payload");p.useSyncedValues({trackCursorAxis:i,disableHoverablePopup:s,disabled:n}),va(p,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:C,transitionStatus:I}=ya(m,p),w=p.useState("isInstantPhase"),S=p.useState("instantType"),R=p.useState("lastOpenChangeReason"),E=d.useRef(null);ae(()=>{x&&n&&p.setOpen(!1,Ce(Eu))},[x,n,p]),ae(()=>{I==="ending"&&R===jt||I!=="ending"&&w?(S!=="delay"&&(E.current=S),p.set("instantType","delay")):E.current!==null&&(p.set("instantType",E.current),E.current=null)},[I,w,R,S,p]),ae(()=>{m&&v==null&&p.set("payload",void 0)},[p,v,m]),d.useImperativeHandle(a,()=>({unmount:C,close:()=>p.setOpen(!1,Ce(Hi))}),[C,p]);const k=m||b||!n&&i!=="none";return l.jsxs(Hd.Provider,{value:p,children:[f&&l.jsx(xa,{handle:f,store:p}),k&&l.jsx(u0,{store:p,disabled:n,trackCursorAxis:i}),typeof g=="function"?g({payload:y}):g]})});function u0({store:e,disabled:t,trackCursorAxis:n}){const r=e.useState("floatingRootContext"),o=ns(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),s=bA(r,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),i=d.useMemo(()=>Ft(s.reference,o.reference),[s.reference,o.reference]);return Ca(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:o.floating??ct}),null}const d0=d.createContext(void 0);function f0(){return d.useContext(d0)}const ic=600,Ld="data-base-ui-tooltip-trigger";function ac(e){if("composedPath"in e){const n=e.composedPath();for(let r=0;r<n.length;r+=1){const o=n[r];if(Te(o))return o}}const t=e.target;return Te(t)?t:null}function p0(e){let t=e;for(;t;){const n=t.closest(`[${Ld}]`);if(n)return n;const r=t.getRootNode();t="host"in r&&Te(r.host)?r.host:null}return null}const h0=bd(function(t,n){const{render:r,className:o,style:s,handle:i,payload:a,disabled:c,delay:u,closeOnClick:f=!0,closeDelay:h,id:A,...g}=t,p=Ur(!0),m=Ed(i)??p;if(!m)throw new Error(st(82));const v=wt(A),b=m.useState("isTriggerActive",v),y=m.useState("isOpenedByTrigger",v),C=m.useState("floatingRootContext"),I=d.useRef(null),w=u??ic,S=h??0,{registerTrigger:R,isMountedByThisTrigger:E}=Id(v,I,m,{payload:a,closeOnClick:f,closeDelay:S}),k=f0(),{delayRef:B,isInstantPhase:T,hasProvider:F}=oA(C,{open:y}),j=Sa(C);m.useSyncedValue("isInstantPhase",T);const D=m.useState("disabled"),H=c??D,_=et(H),P=m.useState("trackCursorAxis"),L=m.useState("disableHoverablePopup"),N=d.useRef(!1),M=pt(),O=d.useRef(void 0);function G(){return F?tr(B.current,"open")===0?0:u??k??ic:w}function Z(U){const ue=I.current;if(!ue||!U)return!1;const se=p0(U);return se!==null&&se!==ue&&ve(ue,se)}function J(U){const ue=Z(U);return N.current=ue,ue&&(j.openChangeTimeout.clear(),j.restTimeout.clear(),j.restTimeoutPending=!1,M.clear()),ue}const Q=Fd(C,{enabled:!H,mouseOnly:!0,move:!1,handleClose:!L&&P!=="both"?Md():null,restMs:G,delay(){return h==null&&F?{close:tr(B.current,"close")}:{close:S}},triggerElementRef:I,isActiveTrigger:b,isClosing:()=>m.select("transitionStatus")==="ending",shouldOpen(){return!N.current}}),$=Sd(C,{enabled:!H}).reference,K=U=>{const ue=N.current,se=ac(U),be=J(se),re=I.current,Ae=re&&se&&ve(re,se);if(be&&m.select("open")&&m.select("lastOpenChangeReason")===at){m.setOpen(!1,Ce(at,U));return}if(ue&&!be&&Ae&&!_.current&&!m.select("open")&&re&&xn(O.current)){const ie=()=>{!N.current&&!_.current&&!m.select("open")&&m.setOpen(!0,Ce(at,U,re))},oe=G();oe===0?(M.clear(),ie()):M.start(oe,ie)}},te=m.useState("triggerProps",E);return Me("button",t,{state:{open:y},ref:[n,R,I],props:[Q,$,E||P!=="none"?te:void 0,{onMouseOver(U){K(U.nativeEvent)},onFocus(U){Z(ac(U.nativeEvent))&&U.preventBaseUIHandler()},onMouseLeave(){N.current=!1,M.clear(),O.current=void 0},onPointerEnter(U){O.current=U.pointerType},onPointerDown(U){O.current=U.pointerType,m.set("closeOnClick",f),f&&!m.select("open")&&m.cancelPendingOpen(U.nativeEvent)},onClick(U){f&&!m.select("open")&&m.cancelPendingOpen(U.nativeEvent)},id:v,"data-trigger-disabled":H?"":void 0,[Ld]:H?void 0:""},g],stateAttributesMapping:$u})}),Kd=d.createContext(void 0);function g0(){const e=d.useContext(Kd);if(e===void 0)throw new Error(st(70));return e}const A0=d.forwardRef(function(t,n){const{children:r,container:o,className:s,render:i,style:a,...c}=t,{node:u,subtree:f}=sd({container:o,ref:n,componentProps:t,elementProps:c});return!f&&!u?null:l.jsxs(d.Fragment,{children:[f,u&&an.createPortal(r,u)]})}),m0=d.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t;return Ur().useState("mounted")||r?l.jsx(Kd.Provider,{value:r,children:l.jsx(A0,{ref:n,...o})}):null}),Wd=d.createContext(void 0);function Qd(){const e=d.useContext(Wd);if(e===void 0)throw new Error(st(71));return e}const x0=d.createContext(void 0);function us(){return d.useContext(x0)?.direction??"ltr"}const b0=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:u,padding:f=0,offsetParent:h="real"}=vn(e,t)||{};if(u==null)return{};const A=_u(f),g={x:n,y:r},p=ra(o),x=na(p),m=await i.getDimensions(u),v=p==="y",b=v?"top":"left",y=v?"bottom":"right",C=v?"clientHeight":"clientWidth",I=s.reference[x]+s.reference[p]-g[p]-s.floating[x],w=g[p]-s.reference[p],S=h==="real"?await i.getOffsetParent?.(u):a.floating;let R=a.floating[C]||s.floating[x];(!R||!await i.isElement?.(S))&&(R=a.floating[C]||s.floating[x]);const E=I/2-w/2,k=R/2-m[x]/2-1,B=Math.min(A[b],k),T=Math.min(A[y],k),F=B,j=R-m[x]-T,D=R/2-m[x]/2+E,H=Nu(F,D,j),_=!c.arrow&&In(o)!=null&&D!==H&&s.reference[x]/2-(D<F?B:T)-m[x]/2<0,P=_?D<F?D-F:D-j:0;return{[p]:g[p]+P,data:{[p]:H,centerOffset:D-H-P,..._&&{alignmentOffset:P}},reset:_}}}),v0=(e,t)=>({...b0(e),options:[e,t]}),y0={name:"hide",async fn(e){const{width:t,height:n,x:r,y:o}=e.rects.reference,s=t===0&&n===0&&r===0&&o===0,i=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:i.top-n>=0||i.right-t>=0||i.bottom-n>=0||i.left-t>=0||s}}}},C0={sideX:"left",sideY:"top"},lc="--available-width",cc="--available-height";function Gd(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function uc(e,t,n){const{rects:r,placement:o}=e;return{side:Gd(t,Bt(o),n),align:In(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Ma(e){return I0(e,Em)}function I0(e,t){const{anchor:n,positionMethod:r="absolute",side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,collisionBoundary:c,collisionPadding:u=5,sticky:f=!1,arrowPadding:h=5,disableAnchorTracking:A=!1,inline:g,keepMounted:p=!1,floatingRootContext:x,mounted:m,collisionAvoidance:v,shift:b,nodeId:y,adaptiveOrigin:C,lazyFlip:I=!1,externalTree:w}=e,[S,R]=d.useState(null);!m&&S!==null&&R(null);const E=v.side||"flip",k=v.align||"flip",B=v.fallbackAxisSide||"end",T=b?.crossAxis??!1,F=b?.rootBoundary,j=typeof n=="function"?n:void 0,D=de(j),H=j?D:n,_=et(n),P=et(m),N=us()==="rtl",M=S||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":N?"left":"right","inline-start":N?"right":"left"}[o],O=i==="center"?M:`${M}-${i}`;let G=u;typeof G=="number"?G={top:G,right:G,bottom:G,left:G}:G&&(G={top:G.top||0,right:G.right||0,bottom:G.bottom||0,left:G.left||0});const Z=1,J=o==="bottom"?Z:0,Q=o==="top"?Z:0,$=o==="right"?Z:0,K=o==="left"?Z:0,te={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:G},le=d.useRef(null),X=et(s),ee=et(a),U=typeof s!="function"?s:0,ue=typeof a!="function"?a:0,se=[];g&&se.push(g),se.push(tm(Ee=>{const Ve=uc(Ee,o,N),Ze=typeof X.current=="function"?X.current(Ve):X.current,Je=typeof ee.current=="function"?ee.current(Ve):ee.current;return{mainAxis:Ze,crossAxis:Je,alignmentAxis:Je}},[U,ue,N,o]));const be=k==="none"&&E!=="shift",re=!be&&(f||T||E==="shift"),Ae=E==="none"?null:om({...te,padding:{top:G.top+Z+J,right:G.right+Z+K,bottom:G.bottom+Z+Q,left:G.left+Z+$},mainAxis:!T&&E==="flip",crossAxis:k==="flip"?"alignment":!1,fallbackAxisSideDirection:B}),ie=be?null:nm({...te,rootBoundary:F,mainAxis:k!=="none",crossAxis:re,limiter:f||T?void 0:rm(Ee=>{if(!le.current)return{};const{width:Ve,height:Ze}=le.current.getBoundingClientRect(),Je=Dt(Bt(Ee.placement)),rt=Je==="y"?Ve:Ze,it=Je==="y"?G.left+G.right:G.top+G.bottom;return{offset:rt/2+it/2}})},[te,f,T,F,G,k]);E==="shift"||k==="shift"||i==="center"?se.push(ie,Ae):se.push(Ae,ie),se.push(sm({...te,apply({elements:{floating:Ee},availableWidth:Ve,availableHeight:Ze,rects:Je}){if(!P.current)return;const rt=Ee.style;rt.setProperty(lc,`${Ve}px`),rt.setProperty(cc,`${Ze}px`);const it=ot(Ee).devicePixelRatio||1,{x:At,y:dt,width:xt,height:Mt}=Je.reference,$t=(Math.round((At+xt)*it)-Math.round(At*it))/it,Be=(Math.round((dt+Mt)*it)-Math.round(dt*it))/it;rt.setProperty("--anchor-width",`${$t}px`),rt.setProperty("--anchor-height",`${Be}px`)}}),v0(Ee=>({element:le.current||je(Ee.elements.floating).createElement("div"),padding:h,offsetParent:"floating"}),[h]),{name:"transformOrigin",fn(Ee){const{elements:Ve,middlewareData:Ze,placement:Je,rects:rt,y:it}=Ee,At=Bt(Je),dt=Dt(At),xt=le.current,Mt=Ze.arrow?.x||0,$t=Ze.arrow?.y||0,Be=xt?.clientWidth||0,ze=xt?.clientHeight||0,bt=Mt+Be/2,Et=$t+ze/2,St=Math.abs(Ze.shift?.y||0),Pt=rt.reference.height/2,Tt=typeof s=="function"?s(uc(Ee,o,N)):s,vt=St>Tt,un={top:`${bt}px calc(100% + ${Tt}px)`,bottom:`${bt}px ${-Tt}px`,left:`calc(100% + ${Tt}px) ${Et}px`,right:`${-Tt}px ${Et}px`}[At],En=`${bt}px ${rt.reference.y+Pt-it}px`;return Ve.floating.style.setProperty("--transform-origin",re&&dt==="y"&&vt?En:un),{}}},y0,C),ae(()=>{!m&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[m,x]);const oe=d.useMemo(()=>({elementResize:!A&&typeof ResizeObserver<"u",layoutShift:!A&&typeof IntersectionObserver<"u"}),[A]),{refs:ce,elements:me,x:ge,y:W,middlewareData:V,update:ye,placement:q,context:ne,isPositioned:ke,floatingStyles:Se}=t({rootContext:x,open:p?m:void 0,placement:O,middleware:se,strategy:r,whileElementsMounted:p?void 0:(...Ee)=>Yl(...Ee,oe),nodeId:y,externalTree:w}),{sideX:Qe,sideY:tt}=V.adaptiveOrigin||C0,Le=ke?r:"fixed",ht=d.useMemo(()=>{let Ee;return ke?C?Ee={position:Le,[Qe]:ge,[tt]:W}:Ee={...Se,position:Le}:Ee={position:Le,top:0,left:0},Ee[lc]="100vw",Ee[cc]="100vh",ke||(Ee.opacity=0),Ee},[C,Le,Qe,ge,tt,W,Se,ke]),Ke=d.useRef(null);ae(()=>{if(!m)return;const Ee=_.current,Ve=typeof Ee=="function"?Ee():Ee,Je=(dc(Ve)?Ve.current:Ve)||null||null;Je!==Ke.current&&(ce.setPositionReference(Je),Ke.current=Je)},[m,ce,H,_]),d.useEffect(()=>{if(!m)return;const Ee=_.current;typeof Ee!="function"&&dc(Ee)&&Ee.current!==Ke.current&&(ce.setPositionReference(Ee.current),Ke.current=Ee.current)},[m,ce,H,_]),d.useEffect(()=>{if(p&&m&&me.reference&&me.floating)return Yl(me.reference,me.floating,ye,oe)},[p,m,me,ye,oe]);const Ge=Bt(q),ut=Gd(o,Ge,N),Re=In(q)||"center",Ue=!!V.hide?.referenceHidden;ae(()=>{I&&m&&ke&&Ge!==M&&R(Ge)},[I,m,ke,Ge,M]);const _e=d.useMemo(()=>({position:"absolute",top:V.arrow?.y,left:V.arrow?.x}),[V.arrow]),nt=V.arrow?.centerOffset!==0;return d.useMemo(()=>({positionerStyles:ht,arrowStyles:_e,arrowRef:le,arrowUncentered:nt,side:ut,align:Re,physicalSide:Ge,anchorHidden:Ue,refs:ce,context:ne,isPositioned:ke,update:ye}),[ht,_e,le,nt,ut,Re,Ge,Ue,ce,ne,ke,ye])}function dc(e){return e!=null&&"current"in e}function ds(e){return e==="starting"?uA:ct}function Pa(e,t,{styles:n,transitionStatus:r,props:o,refs:s,hidden:i,inert:a=!1}){const c={...n};return a&&(c.pointerEvents="none"),Me("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:i,style:c},ds(r),o],stateAttributesMapping:Qr})}const w0=d.forwardRef(function(t,n){const{render:r,className:o,anchor:s,positionMethod:i="absolute",side:a="top",align:c="center",sideOffset:u=0,alignOffset:f=0,collisionBoundary:h="clipping-ancestors",collisionPadding:A=5,arrowPadding:g=5,sticky:p=!1,disableAnchorTracking:x=!1,collisionAvoidance:m=nd,style:v,...b}=t,y=Ur(),C=g0(),I=y.useState("open"),w=y.useState("mounted"),S=y.useState("trackCursorAxis"),R=y.useState("disableHoverablePopup"),E=y.useState("floatingRootContext"),k=y.useState("instantType"),B=y.useState("transitionStatus"),T=y.useState("adaptiveOrigin"),F=Ma({anchor:s,positionMethod:i,floatingRootContext:E,mounted:w,side:a,sideOffset:u,align:c,alignOffset:f,collisionBoundary:h,collisionPadding:A,sticky:p,arrowPadding:g,disableAnchorTracking:x,keepMounted:C,collisionAvoidance:m,adaptiveOrigin:T}),j=d.useMemo(()=>({open:I,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:S!=="none"?"tracking-cursor":k}),[I,F.side,F.align,F.anchorHidden,S,k]),D=Pa(t,j,{styles:F.positionerStyles,transitionStatus:B,props:b,refs:[n,y.useStateSetter("positionerElement")],hidden:!w,inert:!I||S==="both"||R});return l.jsx(Wd.Provider,{value:F,children:D})}),k0=d.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,a=Ur(),{side:c,align:u}=Qd(),f=a.useState("open"),h=a.useState("instantType"),A=a.useState("transitionStatus"),g=a.useState("popupProps"),p=a.useState("floatingRootContext"),x=a.useState("disabled"),m=a.useState("closeDelay");Ut({open:f,ref:a.context.popupRef,onComplete(){f&&a.context.onOpenChangeComplete?.(!0)}}),Dd(p,{enabled:!x,closeDelay:m});const v=a.useStateSetter("popupElement");return Me("div",t,{state:{open:f,side:c,align:u,instant:h,transitionStatus:A},ref:[n,a.context.popupRef,v],props:[ss,g,ds(A),i],stateAttributesMapping:la})}),E0=d.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,a=Ur(),{arrowRef:c,side:u,align:f,arrowUncentered:h,arrowStyles:A}=Qd(),g=a.useState("open"),p=a.useState("instantType");return Me("div",t,{state:{open:g,side:u,align:f,uncentered:h,instant:p},ref:[n,c],props:[{style:A,"aria-hidden":!0},i],stateAttributesMapping:Qr})});function S0(e){const[t,n]=d.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function fs({...e}){return l.jsx(c0,{"data-slot":"tooltip",...e})}function ps({...e}){return l.jsx(h0,{"data-slot":"tooltip-trigger",...e})}function hs({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:o=0,children:s,...i}){return l.jsx(m0,{children:l.jsx(w0,{align:r,alignOffset:o,side:t,sideOffset:n,className:"isolate z-50",children:l.jsxs(k0,{"data-slot":"tooltip-content",className:he("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...i,children:[s,l.jsx(E0,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const R0="sidebar_state",D0=3600*24*7,F0="16rem",B0="18rem",j0="3rem",M0="b",zd=d.createContext(null);function gs(){const e=d.useContext(zd);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function P0({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:o,children:s,...i}){const a=Vg(),[c,u]=d.useState(!1),[f,h]=d.useState(e),A=t??f,g=d.useCallback(v=>{const b=typeof v=="function"?v(A):v;n?n(b):h(b),document.cookie=`${R0}=${b}; path=/; max-age=${D0}`},[n,A]),p=d.useCallback(()=>a?u(v=>!v):g(v=>!v),[a,g,u]);d.useEffect(()=>{const v=b=>{b.key===M0&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),p())};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[p]);const x=A?"expanded":"collapsed",m=d.useMemo(()=>({state:x,open:A,setOpen:g,isMobile:a,openMobile:c,setOpenMobile:u,toggleSidebar:p}),[x,A,g,a,c,u,p]);return l.jsx(zd.Provider,{value:m,children:l.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":F0,"--sidebar-width-icon":j0,...o},className:he("group/sidebar-wrapper flex h-svh w-full has-data-[variant=inset]:bg-sidebar",r),...i,children:s})})}function T0({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:o,dir:s,...i}){const{isMobile:a,state:c,openMobile:u,setOpenMobile:f}=gs();return n==="none"?l.jsx("div",{"data-slot":"sidebar",className:he("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",r),...i,children:o}):a?l.jsx(Xm,{open:u,onOpenChange:f,...i,children:l.jsxs(t0,{dir:s,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":B0},side:e,children:[l.jsxs(n0,{className:"sr-only",children:[l.jsx(r0,{children:"Sidebar"}),l.jsx(o0,{children:"Displays the mobile sidebar."})]}),l.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):l.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":c,"data-collapsible":c==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[l.jsx("div",{"data-slot":"sidebar-gap",className:he("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),l.jsx("div",{"data-slot":"sidebar-container","data-side":e,className:he("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...i,children:l.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:o})})]})}function N0({className:e,...t}){const{toggleSidebar:n}=gs();return l.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:he("absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function _0({className:e,...t}){return l.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:he("flex flex-col gap-2 p-2",e),...t})}function O0({className:e,...t}){return l.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:he("flex flex-col gap-2 p-2",e),...t})}function H0({className:e,...t}){return l.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:he("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function L0({className:e,...t}){return l.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:he("relative flex w-full min-w-0 flex-col p-2",e),...t})}function K0({className:e,...t}){return l.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:he("w-full text-sm",e),...t})}function Ws({className:e,...t}){return l.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:he("flex w-full min-w-0 flex-col gap-0",e),...t})}function ao({className:e,...t}){return l.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:he("group/menu-item relative",e),...t})}const W0=Ti("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Er({render:e,isActive:t=!1,variant:n="default",size:r="default",tooltip:o,className:s,...i}){const{isMobile:a,state:c}=gs(),u=Ru({defaultTagName:"button",props:Ft({className:he(W0({variant:n,size:r}),s)},i),render:o?l.jsx(ps,{render:e}):e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:r,active:t}});return o?(typeof o=="string"&&(o={children:o}),l.jsxs(fs,{children:[u,l.jsx(hs,{side:"right",align:"center",hidden:c!=="collapsed"||a,...o})]})):u}const Yd=d.createContext(void 0);function Ud(e){const t=d.useContext(Yd);if(t===void 0&&!e)throw new Error(st(33));return t}const Vd=d.createContext(void 0);function ar(e){const t=d.useContext(Vd);if(t===void 0&&!e)throw new Error(st(36));return t}const Q0=d.createContext(void 0);function Ta(e=!0){const t=d.useContext(Q0);if(t===void 0&&!e)throw new Error(st(25));return t}function G0(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:o,store:s,typingRef:i,itemRef:a,itemMetadata:c}=e,{events:u}=s.useState("floatingTreeRoot"),f=s.useState("open"),h=Ta(!0),A=h!==void 0;return d.useMemo(()=>({id:r,role:"menuitem",tabIndex:f&&n?0:-1,onKeyDown(g){g.key===" "&&i?.current&&g.preventDefault()},onMouseMove(g){o&&u.emit("itemhover",{nodeId:o,target:g.currentTarget})},onClick(g){t&&u.emit("close",{domEvent:g,reason:Ir})},onMouseUp(g){if(h){const p=h.initialCursorPointRef.current;if(h.initialCursorPointRef.current=null,A&&p&&Math.abs(g.clientX-p.x)<=1&&Math.abs(g.clientY-p.y)<=1||A&&!Ji&&g.button===2)return}a.current&&s.context.allowMouseUpTriggerRef.current&&(!A||g.button===2)&&c.type==="regular-item"&&Li(a.current,g,{detail:1})}}),[t,n,r,u,o,f,s,i,a,h,A,c])}const z0={type:"regular-item"};function Y0(e){const{closeOnClick:t,disabled:n,highlighted:r,id:o,store:s,typingRef:i=s.context.typingRef,nativeButton:a,itemMetadata:c,nodeId:u}=e,f=d.useRef(null),{getButtonProps:h,buttonRef:A}=Yt({disabled:n,focusableWhenDisabled:!0,native:a,composite:!0}),g=G0({closeOnClick:t,highlighted:r,id:o,nodeId:u,store:s,typingRef:i,itemRef:f,itemMetadata:c}),p=d.useCallback(m=>Ft(g,{onMouseEnter(){c.type==="submenu-trigger"&&c.setActive()}},m,h),[g,h,c]),x=zt(f,A);return d.useMemo(()=>({getItemProps:p,itemRef:x}),[p,x])}const Zd=d.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function U0(){return d.useContext(Zd)}function As(e={}){const{guess:t,label:n,metadata:r,textRef:o,index:s}=e,{register:i,unregister:a,subscribeMapChange:c,nextIndexRef:u}=U0(),f=d.useRef(-1),[h,A]=d.useState(s==null&&t?()=>{if(f.current===-1){const m=u.current;u.current+=1,f.current=m}return f.current}:-1),g=s??h,p=d.useRef(null),x=d.useCallback(m=>{const v=p.current;v&&a(v),p.current=m,m&&i(m,{metadata:r??null,index:s??null,label:n,textRef:o})},[s,i,a,r,n,o]);return ae(()=>{if(s==null)return c(m=>{const v=p.current?m.get(p.current)?.index:null;v!=null&&A(v)})},[s,c]),{ref:x,index:g}}const V0=d.forwardRef(function(t,n){const{render:r,className:o,id:s,label:i,nativeButton:a=!1,disabled:c=!1,closeOnClick:u=!0,style:f,...h}=t,A=As({guess:!0,label:i}),g=Ud(!0),p=wt(s),{store:x}=ar(),m=x.useState("disabled"),v=c||m,b=x.useState("isActive",A.index),y=x.useState("itemProps"),{getItemProps:C,itemRef:I}=Y0({closeOnClick:u,disabled:v,highlighted:b,id:p,store:x,nativeButton:a,nodeId:g?.context.nodeId,itemMetadata:z0});return Me("div",t,{state:{disabled:v,highlighted:b},props:[y,h,C],ref:[I,n,A.ref]})}),Z0=d.createContext(void 0);function Na(e){return d.useContext(Z0)}const J0=d.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:i,...a}=t,{store:c}=ar(),{side:u,align:f}=Ud(),h=Na()!=null,A=c.useState("open"),g=c.useState("transitionStatus"),p=c.useState("popupProps"),x=c.useState("mounted"),m=c.useState("instantType"),v=c.useState("activeTriggerElement"),b=c.useState("parent"),y=c.useState("lastOpenChangeReason"),C=c.useState("rootId"),I=c.useState("floatingRootContext"),w=c.useState("floatingTreeRoot"),S=c.useState("closeDelay"),R=c.useState("hoverEnabled"),E=c.useState("disabled"),k=c.useState("openMethod"),B=b.type==="context-menu";Ut({open:A,ref:c.context.popupRef,onComplete(){A&&c.context.onOpenChangeComplete?.(!0)}}),d.useEffect(()=>{function H(_){c.setOpen(!1,Ce(_.reason,_.domEvent))}return w.events.on("close",H),()=>{w.events.off("close",H)}},[w.events,c]),Dd(I,{enabled:R&&!E&&!B&&b.type!=="menubar",closeDelay:S});const T=c.useStateSetter("popupElement"),F={transitionStatus:g,side:u,align:f,open:A,nested:b.type==="menu",instant:m},j=Me("div",t,{state:F,ref:[n,c.context.popupRef,T],stateAttributesMapping:la,props:[p,{onKeyDown(H){h&&as.has(H.key)&&H.stopPropagation()}},ds(g),a,{"data-rootownerid":C}]});let D=b.type===void 0||B;return(v||b.type==="menubar"&&y!==Go)&&(D=!0),l.jsx(ga,{context:I,openInteractionType:k,modal:B,disabled:!x,returnFocus:i===void 0?D:i,initialFocus:b.type!=="menu",restoreFocus:!0,externalTree:b.type!=="menubar"?w:void 0,previousFocusableElement:v,nextFocusableElement:b.type===void 0?c.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:b.type===void 0?c.context.beforeContentFocusGuardRef:void 0,children:j})}),Jd=d.createContext(void 0);function $0(){const e=d.useContext(Jd);if(e===void 0)throw new Error(st(32));return e}const X0=d.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:s}=ar();return s.useState("mounted")||r?l.jsx(Jd.Provider,{value:r,children:l.jsx(fa,{ref:n,...o})}):null});function Vr(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:o}=e,s=de(o),[,i]=d.useState(!1),a=Rt(ex).current,c=Rt(q0).current,u=d.useRef(0),f=d.useRef(!0),h=d.useRef([]),A=d.useRef(null),g=de(()=>{f.current||(f.current=!0,i(I=>!I))}),p=de((I,w)=>{c.set(I,w),g()}),x=de(I=>{c.delete(I),g()}),m=de(I=>{const w=new Map;return n.current.length=0,r&&(r.current.length=0),I.forEach(S=>{w.set(S.element,{...S.registration.metadata??{},index:S.index}),n.current[S.index]=S.element,r&&(r.current[S.index]=S.registration.label!==void 0?S.registration.label:S.registration.textRef?.current?.textContent??S.element.textContent)}),u.current=n.current.length,w});function v(I){if(A.current?.disconnect(),A.current=null,typeof MutationObserver!="function"||I.length<2)return;const w=new MutationObserver(R=>{if(!rx(R))return;let E=null;for(const k of I)if(k.isConnected){if(E&&$d(E,k)>0){w.disconnect(),g();return}E=k}});A.current=w;const S=new Set;for(let R=1;R<I.length;R+=1){const E=nx(I[R-1],I[R]);E&&S.add(E)}S.forEach(R=>w.observe(R,{childList:!0}))}const b=de(()=>{const[I,w]=tx(c),S=m(I);v(w),h.current=I,f.current=!1,a.forEach(R=>R(S)),s(S)});ae(()=>(f.current||m(h.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,m]),ae(()=>{f.current&&b()}),ae(()=>()=>{A.current?.disconnect(),f.current=!0},[]);const y=de(I=>(a.add(I),()=>{a.delete(I)})),C=d.useMemo(()=>({register:p,unregister:x,subscribeMapChange:y,nextIndexRef:u}),[p,x,y,u]);return l.jsx(Zd.Provider,{value:C,children:t})}function q0(){return new Map}function ex(){return new Set}function tx(e){const t=new Set,n=[],r=[];e.forEach((s,i)=>{if(!i.isConnected)return;const a=s.index,c={index:a??-1,element:i,registration:s};a===null?r.push(c):a>=0&&(t.add(a),n.push(c))});let o=0;return r.sort((s,i)=>$d(s.element,i.element)),r.forEach(s=>{for(;t.has(o);)o+=1;s.index=o,n.push(s),o+=1}),t.size>0&&n.sort((s,i)=>s.index-i.index),[n,r.map(s=>s.element)]}function nx(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function rx(e){for(const t of e)for(let n=0;n<t.removedNodes.length;n+=1)if(t.removedNodes[n].isConnected)return!0;return!1}function $d(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const ox=20;function Xd(e,t,n,r){const[o,s]=d.useState(!1);ae(()=>{if(!e||!t||n==null){s(!1);return}const i=je(n).documentElement.clientWidth,a=n.offsetWidth;s(i>0&&a>0&&a>=i-ox)},[e,t,n]),Td(e&&(!t||o),r)}const sx=d.forwardRef(function(t,n){const{anchor:r,positionMethod:o="absolute",className:s,render:i,side:a,align:c,sideOffset:u=0,alignOffset:f=0,collisionBoundary:h="clipping-ancestors",collisionPadding:A=5,arrowPadding:g=5,sticky:p=!1,disableAnchorTracking:x=!1,collisionAvoidance:m=td,style:v,...b}=t,{store:y}=ar(),C=$0(),I=Ta(!0),w=y.useState("parent"),S=y.useState("floatingRootContext"),R=y.useState("floatingTreeRoot"),E=y.useState("mounted"),k=y.useState("open"),B=y.useState("modal"),T=y.useState("openMethod"),F=y.useState("activeTriggerElement"),j=y.useState("transitionStatus"),D=y.useState("positionerElement"),H=y.useState("instantType"),_=y.useState("adaptiveOrigin"),P=y.useState("lastOpenChangeReason"),L=y.useState("floatingNodeId"),N=y.useState("floatingParentNodeId"),M=S.useState("domReferenceElement"),O=d.useRef(null),G=aa(D);let Z=r,J=u,Q=f,$=c,K=m;w.type==="context-menu"&&(Z=r??w.context?.anchor,$=$??"start",!a&&$!=="center"&&(Q=t.alignOffset??2,J=t.sideOffset??-5));let te=a,le=$;w.type==="menu"?(te=te??"inline-end",le=le??"start",K=t.collisionAvoidance??nd):w.type==="menubar"&&(te=te??(w.context.orientation==="vertical"?"inline-end":"bottom"),le=le??"start");const X=w.type==="context-menu",ee=Ma({anchor:Z,floatingRootContext:S,positionMethod:I?"fixed":o,mounted:E,side:te,sideOffset:J,align:le,alignOffset:Q,arrowPadding:X?0:g,collisionBoundary:h,collisionPadding:A,sticky:p,nodeId:L,keepMounted:C,disableAnchorTracking:x,collisionAvoidance:K,shift:X?{crossAxis:!("side"in K&&K.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:R,adaptiveOrigin:_});d.useEffect(()=>{function oe(ce){ce.open&&(ce.parentNodeId===L&&y.set("hoverEnabled",!1),ce.nodeId!==L&&ce.parentNodeId===y.select("floatingParentNodeId")&&y.setOpen(!1,Ce(br)))}return R.events.on("menuopenchange",oe),()=>{R.events.off("menuopenchange",oe)}},[y,R.events,L]),d.useEffect(()=>{if(y.select("floatingParentNodeId")==null)return;function oe(ce){if(ce.open||ce.nodeId!==y.select("floatingParentNodeId"))return;const me=ce.reason??br;y.setOpen(!1,Ce(me))}return R.events.on("menuopenchange",oe),()=>{R.events.off("menuopenchange",oe)}},[R.events,y]);const U=pt();d.useEffect(()=>{k||U.clear()},[k,U]),d.useEffect(()=>{function oe(ce){if(!(!k||ce.nodeId!==y.select("floatingParentNodeId")))if(ce.target&&F&&F!==ce.target){const me=y.select("closeDelay");me>0?U.isStarted()||U.start(me,()=>{y.setOpen(!1,Ce(br))}):y.setOpen(!1,Ce(br))}else U.clear()}return R.events.on("itemhover",oe),()=>{R.events.off("itemhover",oe)}},[R.events,k,F,y,U]),d.useEffect(()=>{const oe={open:k,nodeId:L,parentNodeId:N,reason:y.select("lastOpenChangeReason")};R.events.emit("menuopenchange",oe)},[R.events,k,y,L,N]),ae(()=>{const oe=M,ce=O.current;if(oe&&(O.current=oe),ce&&oe&&oe!==ce){y.set("instantType",void 0);const me=new AbortController;return G(()=>{y.set("instantType","trigger-change")},me.signal),()=>{me.abort()}}},[M,G,y]);const ue={open:k,side:ee.side,align:ee.align,anchorHidden:ee.anchorHidden,nested:w.type==="menu",instant:H},se=w.type==="menubar"&&w.context.modal;Xd(k&&(se||B&&P!==at),T==="touch",D,F);const re=Pa(t,ue,{styles:ee.positionerStyles,transitionStatus:j,props:b,refs:[n,y.useStateSetter("positionerElement")],hidden:!E,inert:!k}),Ae=E&&w.type!=="menu"&&(w.type!=="menubar"&&B&&P!==at||w.type==="menubar"&&w.context.modal);let ie=null;return w.type==="menubar"?ie=w.context.contentElement:w.type===void 0&&(ie=F),l.jsxs(Yd.Provider,{value:ee,children:[Ae&&l.jsx(Fa,{ref:w.type==="context-menu"||w.type==="nested-context-menu"?w.context.internalBackdropRef:null,inert:Da(!k),cutout:ie}),l.jsx(hA,{id:L,children:l.jsx(Vr,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,children:re})})]})}),ix=d.createContext(null);function qd(e){return d.useContext(ix)}const ax={...ka,disabled:e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")}};class lx extends zr{constructor(t){super({...ux(),...t},cx(),ax),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){let r=n.store.select("rootId"),o=n.store.select("floatingTreeRoot"),s=n.store.select("keyboardEventRelay");this.unsubscribeParentListener=n.store.subscribe(()=>{const i=n.store.select("rootId"),a=n.store.select("floatingTreeRoot"),c=n.store.select("keyboardEventRelay");r===i&&o===a&&s===c||(r=i,o=a,s=c,this.notifyAll())}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}unsubscribeParentListener=null}function cx(){return{positionerRef:d.createRef(),popupRef:d.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:d.createRef(),beforeContentFocusGuardRef:d.createRef(),onOpenChangeComplete:void 0,triggerElements:new Yr}}function ux(){return{...Ia(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new pa,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:ct,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0}}const dx=d.createContext(void 0);function fx(){return d.useContext(dx)}const px=ma(function(t){const{children:n,open:r,onOpenChange:o,onOpenChangeComplete:s,defaultOpen:i=!1,disabled:a=!1,modal:c,loopFocus:u=!0,orientation:f="vertical",actionsRef:h,closeParentOnEsc:A=!1,handle:g,triggerId:p,defaultTriggerId:x=null,highlightItemOnHover:m=!0}=t,v=Ta(!0),b=ar(!0),y=qd(!0),C=fx(),I=d.useMemo(()=>C&&b?{type:"menu",store:b.store}:y?{type:"menubar",context:y}:v&&!b?{type:"context-menu",context:v}:{type:void 0},[v,b,y,C]),w=hx({open:i,openProp:r,activeTriggerId:x,triggerIdProp:p,parent:I});w.useControlledProp("openProp",r),w.useControlledProp("triggerIdProp",p),w.useContextCallback("onOpenChangeComplete",s);const S=$n(),R=$n(),E=w.useState("floatingTreeRoot"),k=cd(E),B=wn(),T=w.useState("open"),F=w.useState("activeTriggerElement"),j=w.useState("positionerElement"),D=w.useState("hoverEnabled"),H=w.useState("disabled"),_=w.useState("lastOpenChangeReason"),P=w.useState("parent"),L=w.useState("activeIndex"),N=w.useState("payload"),M=w.useState("floatingParentNodeId"),O=d.useRef(null),G=d.useRef(P.type!=="context-menu"),Z=pt(),J=d.useRef(!0),Q=pt(),$=M!=null,{openMethod:K,triggerProps:te}=Od(T);w.useSyncedValues({disabled:a,highlightItemOnHover:m,modal:P.type===void 0?c:void 0,openMethod:K,rootId:S}),va(w);const{forceUnmount:le}=ya(T,w,()=>{w.set("allowMouseEnter",!1)});ae(()=>{v&&!b?w.update({parent:{type:"context-menu",context:v},floatingNodeId:k,floatingParentNodeId:B}):b&&w.update({floatingNodeId:k,floatingParentNodeId:B})},[v,b,k,B,w]),d.useEffect(()=>{if(T||(O.current=null),P.type==="context-menu"){if(!T){Z.clear(),G.current=!1;return}Z.start(500,()=>{G.current=!0})}},[Z,T,P.type]),ae(()=>{!T&&!D&&w.set("hoverEnabled",!0)},[T,D,w]);const X=de((ne,ke)=>{const Se=ke.reason;if(!ne&&!w.select("open")||T===ne&&ke.trigger===F&&_===Se)return;const Qe=Cd(ke);if(!ne&&ke.trigger==null&&(ke.trigger=F??void 0),o?.(ne,ke),ke.isCanceled)return;w.state.floatingRootContext.dispatchOpenChange(ne,ke);const tt=ke.event;if(ne===!1&&tt?.type==="click"&&tt.pointerType==="touch"&&!J.current)return;ne&&Se===Yn?(J.current=!1,Q.start(300,()=>{J.current=!0})):(J.current=!0,Q.clear());const Le=(Se===Nn||Se===Ir)&&tt.detail===0,ht=!ne&&(Se===zo||Se==null),Ke={open:ne,openChangeReason:Se};O.current=ke.event,ba(Ke,ne,ke.trigger,Qe()),w.update(Ke),P.type==="menubar"&&(Se===Yn||Se===Mn||Se===at||Se===ii||Se===br)?w.set("instantType","group"):Le||ht?w.set("instantType",Le?"click":"dismiss"):w.set("instantType",void 0)}),ee=vd({popupStore:w,floatingId:R,nested:B!=null,onOpenChange:X}),U=ee.context.events;ae(()=>{const ne=({open:ke,eventDetails:Se})=>X(ke,Se);return U.on("setOpen",ne),()=>{U?.off("setOpen",ne)}},[U,X]);const ue=d.useCallback(()=>{w.setOpen(!1,Ce(Hi))},[w]);d.useImperativeHandle(h,()=>({unmount:le,close:ue}),[le,ue]);let se;P.type==="context-menu"&&(se=P.context),d.useImperativeHandle(se?.positionerRef,()=>j,[j]),d.useImperativeHandle(se?.actionsRef,()=>({setOpen:X}),[X]);const be=ns(ee,{enabled:!H,bubbles:{escapeKey:A&&P.type==="menu"},outsidePress(){return P.type!=="context-menu"||O.current?.type==="contextmenu"?!0:G.current},externalTree:$?E:void 0}),re=us(),Ae=d.useCallback(ne=>{w.select("activeIndex")!==ne&&w.set("activeIndex",ne)},[w]),ie=Bd(ee,{enabled:!H,listRef:w.context.itemDomElements,activeIndex:L,nested:P.type!==void 0,loopFocus:u,orientation:f,parentOrientation:P.type==="menubar"?P.context.orientation:void 0,rtl:re==="rtl",disabledIndices:Ot,onNavigate:Ae,openOnArrowKeyDown:P.type!=="context-menu",externalTree:$?E:void 0,focusItemOnHover:m}),oe=d.useCallback(ne=>{w.context.typingRef.current=ne},[w]),ce=jd(ee,{enabled:!H,listRef:w.context.itemLabels,elementsRef:w.context.itemDomElements,activeIndex:L,resetMs:lA,onMatch:ne=>{T&&ne!==L&&w.set("activeIndex",ne)},onTyping:oe}),me=d.useMemo(()=>{const ne=Ft(ce.reference,ie.reference,be.reference,{onMouseMove(){w.set("allowMouseEnter",!0)}},te);return ne["aria-haspopup"]="menu",ne["aria-expanded"]=T,ne},[w,ce.reference,ie.reference,be.reference,te,T]),ge=d.useMemo(()=>{const ne=Ft(ie.trigger,be.trigger,te);return ne["aria-haspopup"]="menu",ne["aria-expanded"]=!1,ne},[ie.trigger,be.trigger,te]),W=d.useMemo(()=>Ft(ss,{id:R,role:"menu","aria-labelledby":F?.id,onMouseMove(){w.set("allowMouseEnter",!0),P.type==="menu"&&w.set("hoverEnabled",!1)},onClick(){w.select("hoverEnabled")&&w.set("hoverEnabled",!1)},onKeyDown(ne){const ke=w.select("keyboardEventRelay");ke&&!ne.isPropagationStopped()&&ke(ne)}},ce.floating,ie.floating,be.floating),[F,R,P.type,w,ce.floating,ie.floating,be.floating]),V=ie.item??ct;Ca(w,{floatingRootContext:ee,activeTriggerProps:me,inactiveTriggerProps:ge,popupProps:W,itemProps:V});const ye=d.useMemo(()=>({store:w,parent:I}),[w,I]),q=l.jsxs(Vd.Provider,{value:ye,children:[g&&l.jsx(xa,{handle:g,store:w}),typeof n=="function"?n({payload:N}):n]});return P.type===void 0||P.type==="context-menu"?l.jsx(gA,{externalTree:E,children:q}):q});function hx(e){return Rt(()=>new lx(e)).current}const lo=5;function ef(e,t){const n=gx(t);return e.clientX>=n.left-lo&&e.clientX<=n.right+lo&&e.clientY>=n.top-lo&&e.clientY<=n.bottom+lo}function gx(e){const t=e.getBoundingClientRect(),n=ot(e);if($i)return t;const r=n.getComputedStyle(e,"::before"),o=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||o.content!=="none"))return t;const i=parseFloat(r.width)||0,a=parseFloat(r.height)||0,c=parseFloat(o.width)||0,u=parseFloat(o.height)||0,f=Math.max(t.width,i,c),h=Math.max(t.height,a,u),A=f-t.width,g=h-t.height;return{left:t.left-A/2,right:t.right+A/2,top:t.top-g/2,bottom:t.bottom+g/2}}function tf(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Ki(),{ref:o,index:s}=As(e),i=n===s,a=d.useRef(null),c=zt(o,a);return{compositeProps:{tabIndex:i?0:-1,onFocus(){r(s)},onMouseMove(){const f=a.current;if(!t||!f)return;const h=f.hasAttribute("disabled")||f.ariaDisabled==="true";!i&&!h&&f.focus()}},compositeRef:c,index:s}}function nf(e){const{render:t,className:n,style:r,state:o=ct,props:s=Ot,refs:i=Ot,metadata:a,stateAttributesMapping:c,tag:u="div",...f}=e,{compositeProps:h,compositeRef:A}=tf({metadata:a});return Me(u,e,{state:o,ref:[A,...i],props:[h,...s,f],stateAttributesMapping:c})}function rf(e){if($e(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid");if(!Bn(e))return rf(Xn(e))}function Ax(e,t){const n=d.useRef(null);function r(s){an.flushSync(()=>{e.setOpen(!1,Ce(Mn,s.nativeEvent,s.currentTarget))}),_g(n.current)?.focus()}function o(s){const i=e.select("positionerElement");if(i&&Un(s,i))e.context.beforeContentFocusGuardRef.current?.focus();else{an.flushSync(()=>{e.setOpen(!1,Ce(Mn,s.nativeEvent,s.currentTarget))});let a=Ng(e.context.triggerFocusTargetRef.current||t.current);for(;a!==null&&ve(i,a);){const c=a;if(a=sa(a),a===c)break}a?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:o}}function mx(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,o=d.useRef(!1);return d.useMemo(()=>t?{onMouseDown:s=>{(n==="open"&&!r||n==="close"&&r)&&(o.current=!0,je(s.currentTarget).addEventListener("click",()=>{o.current=!1},{once:!0}))},onClick:s=>{o.current&&(o.current=!1,s.preventBaseUIHandler())}}:ct,[t,n,r])}const xx=bd(function(t,n){const{render:r,className:o,style:s,disabled:i=!1,nativeButton:a=!0,id:c,openOnHover:u,delay:f=100,closeDelay:h=0,handle:A,payload:g,...p}=t,x=ar(!0),v=Ed(A)??x?.store;if(!v)throw new Error(st(85));const b=wt(c),y=v.useState("isTriggerActive",b),C=v.useState("floatingRootContext"),I=v.useState("isOpenedByTrigger",b),w=v.useState("triggerPopupId",b),S=d.useRef(null),R=vx(),E=Ki(!0),k=kn(),B=d.useMemo(()=>k??new pa,[k]),T=cd(B),F=wn(),{registerTrigger:j,isMountedByThisTrigger:D}=Id(b,S,v,{payload:g,closeDelay:h,parent:R,floatingTreeRoot:B,floatingNodeId:T,floatingParentNodeId:F,keyboardEventRelay:E?.relayKeyboardEvent}),H=R.type==="menubar",_=v.useState("disabled"),P=i||_||H&&R.context.disabled,{getButtonProps:L,buttonRef:N}=Yt({disabled:P,native:a});d.useEffect(()=>{!I&&R.type===void 0&&(v.context.allowMouseUpTriggerRef.current=!1)},[v,I,R.type]);const M=d.useRef(null),O=pt(),G=de(oe=>{if(!M.current)return;O.clear(),v.context.allowMouseUpTriggerRef.current=!1;const ce=oe.target;ve(M.current,ce)||ve(v.select("positionerElement"),ce)||ce===M.current||ce!=null&&rf(ce)===v.select("rootId")||ef(oe,M.current)||B.events.emit("close",{domEvent:oe,reason:Su})});d.useEffect(()=>{I&&v.select("lastOpenChangeReason")===at&&je(M.current).addEventListener("mouseup",G,{once:!0})},[I,G,v]);const Z=H&&R.context.hasSubmenuOpen,Q=Fd(C,{enabled:(u??Z)&&!P&&(!H||Z&&!D),handleClose:Md({blockPointerEvents:!H}),mouseOnly:!0,move:!1,restMs:R.type===void 0?f:void 0,delay:{close:h},triggerElementRef:S,externalTree:B,isActiveTrigger:y,isClosing:()=>v.select("transitionStatus")==="ending"}),$=bx(I,v.select("lastOpenChangeReason")),K=ud(C,{enabled:!P,event:I&&H?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:R.type===void 0?$:!1}),te=Sd(C,{enabled:!P&&Z}),le=mx({open:I,enabled:H,mouseDownAction:"open"}),X=d.useMemo(()=>Ft(te.reference,K.reference),[te.reference,K.reference]),ee=v.useState("triggerProps",D),{preFocusGuardRef:U,handlePreFocusGuardFocus:ue,handleFocusTargetFocus:se}=Ax(v,S),be={disabled:P,open:I},re=[M,n,N,j,S],Ae=[X,Q??ct,ee,{"aria-haspopup":"menu","aria-controls":w,id:b,onMouseDown:oe=>{if(v.select("open"))return;O.start(200,()=>{v.context.allowMouseUpTriggerRef.current=!0}),je(oe.currentTarget).addEventListener("mouseup",G,{once:!0})}},H?{role:"menuitem"}:{},le,p,L],ie=Me("button",t,{enabled:!H,stateAttributesMapping:hi,state:be,ref:re,props:Ae});return H?l.jsx(nf,{tag:"button",render:r,className:o,style:s,state:be,refs:re,props:Ae,stateAttributesMapping:hi}):I?l.jsxs(d.Fragment,{children:[l.jsx(nr,{ref:U,onFocus:ue},`${b}-pre-focus-guard`),l.jsx(d.Fragment,{children:ie},b),l.jsx(nr,{ref:v.context.triggerFocusTargetRef,onFocus:se},`${b}-post-focus-guard`)]}):l.jsx(d.Fragment,{children:ie},b)});function bx(e,t){const n=pt(),[r,o]=d.useState(!1);return ae(()=>{e&&t===at?(o(!0),n.start(cA,()=>{o(!1)})):e||(n.clear(),o(!1))},[e,t,n]),r}function vx(){const e=qd();return d.useMemo(()=>e?{type:"menubar",context:e}:{type:void 0},[e])}function of(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function Mo({...e}){return l.jsx(px,{"data-slot":"dropdown-menu",...e})}function Po({...e}){return l.jsx(xx,{"data-slot":"dropdown-menu-trigger",...e})}function To({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=4,className:o,...s}){return l.jsx(X0,{children:l.jsx(sx,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:r,children:l.jsx(J0,{"data-slot":"dropdown-menu-content",className:he("cn-menu-target cn-menu-translucent z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",o),...s})})})}function No({className:e,inset:t,variant:n="default",...r}){return l.jsx(V0,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:he("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...r})}const _o=["zh-CN","ja","ko","en","ar","fr","es","de","ru"],yx=["ar"],sf=e=>yx.includes(e)?"rtl":"ltr",Cx=e=>({"zh-CN":"简体中文",ja:"日本語",ko:"한국어",en:"English",ar:"العربية",fr:"Français",es:"Español",de:"Deutsch",ru:"Русский"})[e],Ix=e=>{for(const t of e){const n=t.toLowerCase(),r=_o.find(i=>i.toLowerCase()===n);if(r!==void 0)return r;const o=n.split("-")[0],s=_o.find(i=>i.toLowerCase().split("-")[0]===o);if(s!==void 0)return s;if(o==="zh")return"zh-CN"}return"en"},Xt={nav:{add:"Add",applications:"Applications",help:"Help Center"},shell:{product:"create-opentray",toggleSidebar:"Toggle Sidebar"},common:{loading:"Loading…",error:"Something went wrong.",retry:"Retry",cancel:"Cancel",confirm:"Confirm",close:"Close",copy:"Copy",copied:"Copied",download:"Download",refresh:"Refresh",empty:"Nothing here yet."},theme:{title:"Theme",system:"System",light:"Light",dark:"Dark"},language:{title:"Language"},applications:{title:"Applications",statusHealthy:"Healthy",statusInvalidConfig:"Invalid config",statusIncompatible:"Incompatible version",statusMissingPayload:"Missing payload",statusBrokenLink:"Broken link",statusRunning:"Running",edit:"Edit",open:"Open",share:"Share",details:"Details",source:"Source",sourceWizard:"Wizard",sourceRegistered:"Registered",detailsCommand:"Command",detailsCwd:"Working directory",detailsEnv:"Environment keys",detailsPm:"Package manager",detailsWindow:"Window",detailsDevMode:"Developer mode",detailsProjectDir:"Project directory",detailsServiceHint:"Service port hint",uninstall:"Uninstall",uninstallTitle:"Uninstall application?",uninstallDescription:"The registration and its payload link are removed. Dock/taskbar pins must be removed manually.",uninstallWizardDescription:"The wizard project directory and its materialized app bundle are removed after stopping a running entry when authorized. Dock/taskbar pins must be removed manually.",stopRunningTitle:"Force stop and uninstall?",stopRunningDescription:"The application is still running (likely a leftover from an earlier session). Continuing terminates its process tree first, then removes the project.",stopRunningConfirm:"Force stop and uninstall",stopRunningPids:"Running pids",uninstallPurge:"Also delete the linked external target",uninstallPurgeHint:"Deletes the external directory itself after identity revalidation. This cannot be undone.",uninstallPinHint:"macOS Dock pins and Windows taskbar pins are user-managed; remove them manually if present.",emptyHint:"No applications yet — create one from Add.",payload:"Payload",registration:"Registration",linked:"Linked",uninstallRetained:"External target retained:",uninstallDeleted:"External target deleted:"},help:{title:"Help Center",listTitle:"Documents",empty:"No documents available.",readError:"This document could not be read."},export:{title:"Export",shareTitle:"Share application",shareSubtitle:"Built from the current wizard parameters — nothing runs, nothing is written.",command:"Direct command",scriptSh:"Shell script (.sh)",scriptPs1:"PowerShell script (.ps1)",copyCommand:"Copy command",downloadScript:"Download script",downloadFile:"Download file",viewFull:"View full content",building:"Building…",inlineIcon:"Inline icon bytes",inlineIconHint:"Web-scraped icons share as their original URL by default and local icons embed their bytes; toggle to switch between embedding and sharing by reference.",forceCopy:"Force direct copy with embedded icon",forceCopyHint:"Uploaded icons embed as very long data URLs. Scripts are the default; check this only if you accept the length.",envAck:"I reviewed the environment values and accept exporting them",envAckHint:"This application defines environment entries. Complete export includes their values.",envReview:"Environment values (editable before export)",blocked:"Export blocked:"}},dn=(e,t)=>{const n=(r,o)=>{if(typeof r=="object"&&r!==null&&!Array.isArray(r)&&typeof o=="object"&&o!==null){const s={...r};for(const[i,a]of Object.entries(o))a!==void 0&&(s[i]=n(r[i],a));return s}return o===void 0?r:o};return n(e,t)},wx={shell:{product:"create-opentray",toggleSidebar:"切换侧边栏"},nav:{add:"新增",applications:"应用列表",help:"帮助中心"},common:{loading:"加载中…",error:"出错了。",retry:"重试",cancel:"取消",confirm:"确认",close:"关闭",copy:"复制",copied:"已复制",download:"下载",refresh:"刷新",empty:"暂无内容。"},theme:{title:"主题",system:"跟随系统",light:"浅色",dark:"深色"},language:{title:"语言"},applications:{title:"应用列表",statusHealthy:"正常",statusInvalidConfig:"配置无效",statusIncompatible:"版本不兼容",statusMissingPayload:"负载缺失",statusBrokenLink:"链接失效",statusRunning:"运行中",edit:"编辑",open:"打开应用",share:"分享",details:"详情",source:"来源",sourceWizard:"向导",sourceRegistered:"注册",detailsCommand:"命令",detailsCwd:"工作目录",detailsEnv:"环境变量键",detailsPm:"包管理器",detailsWindow:"窗口",detailsDevMode:"开发者模式",detailsProjectDir:"项目目录",detailsServiceHint:"服务端口提示",uninstall:"卸载",uninstallTitle:"卸载应用?",uninstallDescription:"将删除注册信息与负载链接。Dock/任务栏图标需手动移除。",uninstallWizardDescription:"将停止运行中的应用(如已授权)并删除项目目录与已物化的应用 Bundle。Dock/任务栏图标需手动移除。",stopRunningTitle:"强制停止并卸载?",stopRunningDescription:"应用仍在运行(可能是上次会话的残留)。继续将先终止其进程树,再删除项目目录与已物化的 Bundle。",stopRunningConfirm:"强制停止并卸载",stopRunningPids:"运行中的进程",uninstallPurge:"同时删除链接的外部目录",uninstallPurgeHint:"重新校验身份后删除外部目录本身,此操作不可撤销。",uninstallPinHint:"macOS Dock 与 Windows 任务栏图标由系统管理,请手动移除。",emptyHint:"还没有应用——去「新增」创建一个。",payload:"负载",registration:"注册",linked:"链接",uninstallRetained:"外部目录已保留:",uninstallDeleted:"外部目录已删除:"},help:{title:"帮助中心",listTitle:"文档",empty:"暂无文档。",readError:"无法读取该文档。"},export:{title:"导出",shareTitle:"分享应用",shareSubtitle:"基于当前向导参数构建——不运行命令、不写入任何内容。",command:"直接命令",scriptSh:"Shell 脚本(.sh)",scriptPs1:"PowerShell 脚本(.ps1)",copyCommand:"复制命令",downloadScript:"下载脚本",downloadFile:"下载文件",viewFull:"查看完整内容",building:"生成中…",inlineIcon:"内联图标字节",inlineIconHint:"网页抓取的图标默认以原始链接分享、本地图标默认内嵌字节;勾选状态即在内嵌与按引用分享之间切换。",forceCopy:"强制直接复制(内嵌图标)",forceCopyHint:"上传的图标会以很长的 data URL 内嵌,默认导出脚本;仅在你接受长度时勾选。",envAck:"我已检查环境变量并接受导出",envAckHint:"该应用定义了环境变量,完整导出将包含其值。",envReview:"环境变量(导出前可编辑)",blocked:"导出被阻止:"}},kx={shell:{product:"create-opentray",toggleSidebar:"サイドバー切替"},nav:{add:"追加",applications:"アプリ一覧",help:"ヘルプセンター"},common:{loading:"読み込み中…",error:"エラーが発生しました。",retry:"再試行",cancel:"キャンセル",confirm:"確認",close:"閉じる",copy:"コピー",copied:"コピーしました",download:"ダウンロード",refresh:"更新",empty:"まだ何もありません。"},theme:{title:"テーマ",system:"システム",light:"ライト",dark:"ダーク"},language:{title:"言語"},applications:{title:"アプリ一覧",statusHealthy:"正常",statusInvalidConfig:"設定が無効",statusIncompatible:"バージョン非対応",statusMissingPayload:"ペイロード欠落",statusBrokenLink:"リンク切れ",statusRunning:"実行中",edit:"編集",uninstall:"アンインストール",uninstallTitle:"アプリをアンインストールしますか?",uninstallDescription:"登録とペイロードリンクを削除します。Dock/タスクバーのピンは手動で外してください。",uninstallPurge:"リンク先の外部ディレクトリも削除する",uninstallPurgeHint:"身份を再検証した上で外部ディレクトリ自体を削除します。元に戻せません。",uninstallPinHint:"macOS の Dock ピンと Windows のタスクバーピンは手動で管理してください。",emptyHint:"登録済みアプリはまだありません。「追加」から作成してください。",payload:"ペイロード",registration:"登録",linked:"リンク",uninstallRetained:"外部ディレクトリは保持されました:",uninstallDeleted:"外部ディレクトリを削除しました:"},help:{title:"ヘルプセンター",listTitle:"ドキュメント",empty:"ドキュメントはありません。",readError:"このドキュメントは読み込めませんでした。"},export:{title:"エクスポート",command:"直接コマンド",scriptSh:"Shell スクリプト(.sh)",scriptPs1:"PowerShell スクリプト(.ps1)",copyCommand:"コマンドをコピー",downloadScript:"スクリプトをダウンロード",forceCopy:"アイコン埋め込みの直接コピーを強制する",forceCopyHint:"アップロードしたアイコンは非常に長い data URL として埋め込まれます。既定はスクリプトです。",envAck:"環境変数を確認し、エクスポートを許可します",envAckHint:"このアプリには環境変数が定義されており、完全なエクスポートに値が含まれます。",envReview:"環境変数(エクスポート前に編集可)",blocked:"エクスポートをブロック:"}},Ex={shell:{product:"create-opentray",toggleSidebar:"사이드바 전환"},nav:{add:"추가",applications:"앱 목록",help:"도움말 센터"},common:{loading:"불러오는 중…",error:"문제가 발생했습니다.",retry:"재시도",cancel:"취소",confirm:"확인",close:"닫기",copy:"복사",copied:"복사됨",download:"다운로드",refresh:"새로고침",empty:"아직 없습니다."},theme:{title:"테마",system:"시스템",light:"라이트",dark:"다크"},language:{title:"언어"},applications:{title:"앱 목록",statusHealthy:"정상",statusInvalidConfig:"구성 무효",statusIncompatible:"버전 비호환",statusMissingPayload:"페이로드 누락",statusBrokenLink:"링크 끊김",statusRunning:"실행 중",edit:"편집",uninstall:"제거",uninstallTitle:"앱을 제거할까요?",uninstallDescription:"등록 정보와 페이로드 링크가 삭제됩니다. Dock/작업표시줄 고정은 직접 해제하세요.",uninstallPurge:"연결된 외부 디렉터리도 삭제",uninstallPurgeHint:"신원 재검증 후 외부 디렉터리 자체를 삭제합니다. 되돌릴 수 없습니다.",uninstallPinHint:"macOS Dock 고정과 Windows 작업표시줄 고정은 직접 관리해야 합니다.",emptyHint:"등록된 앱이 아직 없습니다. 「추가」에서 만들어 보세요.",payload:"페이로드",registration:"등록",linked:"링크",uninstallRetained:"외부 디렉터리 유지됨:",uninstallDeleted:"외부 디렉터리 삭제됨:"},help:{title:"도움말 센터",listTitle:"문서",empty:"문서가 없습니다.",readError:"이 문서를 읽을 수 없습니다."},export:{title:"내보내기",command:"직접 명령",scriptSh:"Shell 스크립트(.sh)",scriptPs1:"PowerShell 스크립트(.ps1)",copyCommand:"명령 복사",downloadScript:"스크립트 다운로드",forceCopy:"아이콘 포함 직접 복사 강제",forceCopyHint:"업로드한 아이콘은 매우 긴 data URL로 포함됩니다. 기본은 스크립트입니다.",envAck:"환경 변수를 확인했으며 내보내기를 허용합니다",envAckHint:"이 앱에는 환경 변수가 정의되어 있어 전체 내보내기에 값이 포함됩니다.",envReview:"환경 변수(내보내기 전 편집 가능)",blocked:"내보내기 차단:"}},Sx={shell:{product:"create-opentray",toggleSidebar:"تبديل الشريط الجانبي"},nav:{add:"إضافة",applications:"التطبيقات",help:"مركز المساعدة"},common:{loading:"جارٍ التحميل…",error:"حدث خطأ.",retry:"إعادة المحاولة",cancel:"إلغاء",confirm:"تأكيد",close:"إغلاق",copy:"نسخ",copied:"تم النسخ",download:"تنزيل",refresh:"تحديث",empty:"لا يوجد شيء بعد."},theme:{title:"المظهر",system:"النظام",light:"فاتح",dark:"داكن"},language:{title:"اللغة"},applications:{title:"التطبيقات",statusHealthy:"سليم",statusInvalidConfig:"تهيئة غير صالحة",statusIncompatible:"إصدار غير متوافق",statusMissingPayload:"الحِمل مفقود",statusBrokenLink:"رابط معطّل",statusRunning:"قيد التشغيل",edit:"تحرير",uninstall:"إزالة",uninstallTitle:"إزالة التطبيق؟",uninstallDescription:"سيُحذف التسجيل ورابط الحِمل. يجب إزالة تثبيت Dock/شريط المهام يدويًا.",uninstallPurge:"حذف الدليل الخارجي المرتبط أيضًا",uninstallPurgeHint:"يحذف الدليل الخارجي نفسه بعد إعادة التحقق من الهوية. لا يمكن التراجع.",uninstallPinHint:"تثبيتات Dock في macOS وشريط المهام في Windows يديرها المستخدم؛ أزلها يدويًا.",emptyHint:"لا توجد تطبيقات مسجلة بعد — أنشئ واحدًا من «إضافة».",payload:"الحِمل",registration:"التسجيل",linked:"مرتبط",uninstallRetained:"احتُفظ بالدليل الخارجي:",uninstallDeleted:"حُذف الدليل الخارجي:"},help:{title:"مركز المساعدة",listTitle:"المستندات",empty:"لا توجد مستندات.",readError:"تعذّرت قراءة هذا المستند."},export:{title:"تصدير",command:"أمر مباشر",scriptSh:"سكربت Shell (.sh)",scriptPs1:"سكربت PowerShell (.ps1)",copyCommand:"نسخ الأمر",downloadScript:"تنزيل السكربت",forceCopy:"فرض النسخ المباشر مع تضمين الأيقونة",forceCopyHint:"تُضمَّن الأيقونات المرفوعة كعناوين data URL طويلة جدًا؛ السكربت هو الافتراضي.",envAck:"راجعت متغيرات البيئة وأوافق على تصديرها",envAckHint:"يحدّد هذا التطبيق متغيرات بيئة، وسيشمل التصدير الكامل قيمها.",envReview:"متغيرات البيئة (قابلة للتحرير قبل التصدير)",blocked:"التصدير محجوب:"}},Rx={shell:{product:"create-opentray",toggleSidebar:"Basculer la barre latérale"},nav:{add:"Ajouter",applications:"Applications",help:"Centre d'aide"},common:{loading:"Chargement…",error:"Une erreur est survenue.",retry:"Réessayer",cancel:"Annuler",confirm:"Confirmer",close:"Fermer",copy:"Copier",copied:"Copié",download:"Télécharger",refresh:"Actualiser",empty:"Rien pour le moment."},theme:{title:"Thème",system:"Système",light:"Clair",dark:"Sombre"},language:{title:"Langue"},applications:{title:"Applications",statusHealthy:"Sain",statusInvalidConfig:"Config invalide",statusIncompatible:"Version incompatible",statusMissingPayload:"Charge utile manquante",statusBrokenLink:"Lien rompu",statusRunning:"En cours",edit:"Modifier",uninstall:"Désinstaller",uninstallTitle:"Désinstaller l'application ?",uninstallDescription:"L'enregistrement et le lien de charge utile sont supprimés. Les épingles Dock/barre des tâches se retirent manuellement.",uninstallPurge:"Supprimer aussi le répertoire externe lié",uninstallPurgeHint:"Supprime le répertoire externe lui-même après revalidation de l'identité. Irréversible.",uninstallPinHint:"Les épingles Dock (macOS) et barre des tâches (Windows) sont gérées par l'utilisateur.",emptyHint:"Aucune application enregistrée — créez-en une depuis Ajouter.",payload:"Charge utile",registration:"Enregistrement",linked:"Lié",uninstallRetained:"Répertoire externe conservé :",uninstallDeleted:"Répertoire externe supprimé :"},help:{title:"Centre d'aide",listTitle:"Documents",empty:"Aucun document.",readError:"Impossible de lire ce document."},export:{title:"Exporter",command:"Commande directe",scriptSh:"Script shell (.sh)",scriptPs1:"Script PowerShell (.ps1)",copyCommand:"Copier la commande",downloadScript:"Télécharger le script",forceCopy:"Forcer la copie directe avec icône intégrée",forceCopyHint:"Les icônes téléversées sont incorporées en data URLs très longues ; le script est la valeur par défaut.",envAck:"J'ai revu les variables d'environnement et accepte de les exporter",envAckHint:"Cette application définit des variables d'environnement ; l'export complet inclut leurs valeurs.",envReview:"Variables d'environnement (modifiables avant export)",blocked:"Export bloqué :"}},Dx={shell:{product:"create-opentray",toggleSidebar:"Alternar barra lateral"},nav:{add:"Añadir",applications:"Aplicaciones",help:"Centro de ayuda"},common:{loading:"Cargando…",error:"Algo salió mal.",retry:"Reintentar",cancel:"Cancelar",confirm:"Confirmar",close:"Cerrar",copy:"Copiar",copied:"Copiado",download:"Descargar",refresh:"Actualizar",empty:"Aún no hay nada."},theme:{title:"Tema",system:"Sistema",light:"Claro",dark:"Oscuro"},language:{title:"Idioma"},applications:{title:"Aplicaciones",statusHealthy:"Sano",statusInvalidConfig:"Config no válida",statusIncompatible:"Versión incompatible",statusMissingPayload:"Carga útil ausente",statusBrokenLink:"Enlace roto",statusRunning:"En ejecución",edit:"Editar",uninstall:"Desinstalar",uninstallTitle:"¿Desinstalar la aplicación?",uninstallDescription:"Se eliminan el registro y el enlace de carga útil. Los anclajes del Dock/barra de tareas se quitan manualmente.",uninstallPurge:"Eliminar también el directorio externo enlazado",uninstallPurgeHint:"Elimina el directorio externo tras revalidar la identidad. No se puede deshacer.",uninstallPinHint:"Los anclajes del Dock (macOS) y de la barra de tareas (Windows) los gestiona el usuario.",emptyHint:"Aún no hay aplicaciones registradas: crea una desde Añadir.",payload:"Carga útil",registration:"Registro",linked:"Enlazado",uninstallRetained:"Directorio externo conservado:",uninstallDeleted:"Directorio externo eliminado:"},help:{title:"Centro de ayuda",listTitle:"Documentos",empty:"No hay documentos.",readError:"No se pudo leer este documento."},export:{title:"Exportar",command:"Comando directo",scriptSh:"Script de shell (.sh)",scriptPs1:"Script de PowerShell (.ps1)",copyCommand:"Copiar comando",downloadScript:"Descargar script",forceCopy:"Forzar copia directa con icono incrustado",forceCopyHint:"Los iconos subidos se incrustan como data URLs muy largas; el script es la opción predeterminada.",envAck:"He revisado las variables de entorno y acepto exportarlas",envAckHint:"Esta aplicación define variables de entorno; la exportación completa incluye sus valores.",envReview:"Variables de entorno (editables antes de exportar)",blocked:"Exportación bloqueada:"}},Fx={shell:{product:"create-opentray",toggleSidebar:"Seitenleiste umschalten"},nav:{add:"Hinzufügen",applications:"Anwendungen",help:"Hilfecenter"},common:{loading:"Lädt…",error:"Etwas ist schiefgelaufen.",retry:"Erneut versuchen",cancel:"Abbrechen",confirm:"Bestätigen",close:"Schließen",copy:"Kopieren",copied:"Kopiert",download:"Herunterladen",refresh:"Aktualisieren",empty:"Noch nichts vorhanden."},theme:{title:"Design",system:"System",light:"Hell",dark:"Dunkel"},language:{title:"Sprache"},applications:{title:"Anwendungen",statusHealthy:"Intakt",statusInvalidConfig:"Ungültige Konfiguration",statusIncompatible:"Inkompatible Version",statusMissingPayload:"Payload fehlt",statusBrokenLink:"Defekter Link",statusRunning:"Läuft",edit:"Bearbeiten",uninstall:"Deinstallieren",uninstallTitle:"Anwendung deinstallieren?",uninstallDescription:"Registrierung und Payload-Link werden entfernt. Dock-/Taskleisten-Anker bitte manuell entfernen.",uninstallPurge:"Verknüpftes externes Verzeichnis ebenfalls löschen",uninstallPurgeHint:"Löscht das externe Verzeichnis nach Identitätsprüfung. Nicht rückgängig machbar.",uninstallPinHint:"Dock-Anker (macOS) und Taskleisten-Anker (Windows) verwaltet der Benutzer manuell.",emptyHint:"Noch keine registrierten Anwendungen — erstelle eine unter „Hinzufügen“.",payload:"Payload",registration:"Registrierung",linked:"Verknüpft",uninstallRetained:"Externes Verzeichnis behalten:",uninstallDeleted:"Externes Verzeichnis gelöscht:"},help:{title:"Hilfecenter",listTitle:"Dokumente",empty:"Keine Dokumente.",readError:"Dieses Dokument konnte nicht gelesen werden."},export:{title:"Exportieren",command:"Direktbefehl",scriptSh:"Shell-Skript (.sh)",scriptPs1:"PowerShell-Skript (.ps1)",copyCommand:"Befehl kopieren",downloadScript:"Skript herunterladen",forceCopy:"Direktes Kopieren mit eingebettetem Symbol erzwingen",forceCopyHint:"Hochgeladene Symbole werden als sehr lange Data-URLs eingebettet; Standard ist das Skript.",envAck:"Ich habe die Umgebungsvariablen geprüft und akzeptiere ihren Export",envAckHint:"Diese Anwendung definiert Umgebungsvariablen; der vollständige Export enthält deren Werte.",envReview:"Umgebungsvariablen (vor dem Export bearbeitbar)",blocked:"Export blockiert:"}},Bx={shell:{product:"create-opentray",toggleSidebar:"Показать/скрыть боковую панель"},nav:{add:"Добавить",applications:"Приложения",help:"Центр справки"},common:{loading:"Загрузка…",error:"Что-то пошло не так.",retry:"Повторить",cancel:"Отмена",confirm:"Подтвердить",close:"Закрыть",copy:"Копировать",copied:"Скопировано",download:"Скачать",refresh:"Обновить",empty:"Пока ничего нет."},theme:{title:"Тема",system:"Системная",light:"Светлая",dark:"Тёмная"},language:{title:"Язык"},applications:{title:"Приложения",statusHealthy:"Исправно",statusInvalidConfig:"Неверная конфигурация",statusIncompatible:"Несовместимая версия",statusMissingPayload:"Отсутствует payload",statusBrokenLink:"Битая ссылка",statusRunning:"Выполняется",edit:"Изменить",uninstall:"Удалить",uninstallTitle:"Удалить приложение?",uninstallDescription:"Регистрация и ссылка payload будут удалены. Значки Dock/панели задач удаляйте вручную.",uninstallPurge:"Также удалить связанный внешний каталог",uninstallPurgeHint:"Удаляет внешний каталог после повторной проверки идентичности. Отменить нельзя.",uninstallPinHint:"Значки Dock (macOS) и панели задач (Windows) управляются пользователем вручную.",emptyHint:"Зарегистрированных приложений пока нет — создайте первое в разделе «Добавить».",payload:"Payload",registration:"Регистрация",linked:"Ссылка",uninstallRetained:"Внешний каталог сохранён:",uninstallDeleted:"Внешний каталог удалён:"},help:{title:"Центр справки",listTitle:"Документы",empty:"Документов нет.",readError:"Не удалось прочитать этот документ."},export:{title:"Экспорт",command:"Прямая команда",scriptSh:"Скрипт shell (.sh)",scriptPs1:"Скрипт PowerShell (.ps1)",copyCommand:"Копировать команду",downloadScript:"Скачать скрипт",forceCopy:"Принудительное копирование со встроенной иконкой",forceCopyHint:"Загруженные иконки встраиваются как очень длинные data-URL; по умолчанию — скрипт.",envAck:"Я проверил переменные окружения и согласен на их экспорт",envAckHint:"В этом приложении заданы переменные окружения; полный экспорт включает их значения.",envReview:"Переменные окружения (можно изменить перед экспортом)",blocked:"Экспорт заблокирован:"}},jx={en:Xt,"zh-CN":dn(Xt,wx),ja:dn(Xt,kx),ko:dn(Xt,Ex),ar:dn(Xt,Sx),fr:dn(Xt,Rx),es:dn(Xt,Dx),de:dn(Xt,Fx),ru:dn(Xt,Bx)},Mx=e=>jx[e],af="create-opentray.locale",lf="create-opentray.theme",cf="lang",uf=new Set(_o),Px=()=>{try{const t=new URLSearchParams(window.location.search).get(cf);return t!==null&&uf.has(t)?t:null}catch{return null}},Tx=e=>{try{const t=new URL(window.location.href);t.searchParams.set(cf,e),window.history.replaceState(null,"",t)}catch{}},fc=e=>{try{return window.localStorage.getItem(e)}catch{return null}},pc=(e,t)=>{try{window.localStorage.setItem(e,t)}catch{}},Nx=()=>window.matchMedia("(prefers-color-scheme: dark)").matches,hc=e=>e==="system"?Nx()?"dark":"light":e,wi=(e,t)=>{const n=document.documentElement;n.lang=e,n.dir=sf(e),n.classList.toggle("dark",hc(t)==="dark"),n.style.colorScheme=hc(t)},_x=()=>{const e=Px(),t=e!==null?e:null,n=fc(af),r=t!==null?t:n!==null&&uf.has(n)?n:Ix(navigator.languages??[navigator.language]),o=fc(lf);return{locale:r,theme:o==="light"||o==="dark"||o==="system"?o:"system"}},df=d.createContext(void 0),Ox=({initialLocale:e,initialTheme:t,children:n})=>{const[r,o]=d.useState(e),[s,i]=d.useState(t);d.useEffect(()=>{wi(r,s)},[r,s]),d.useEffect(()=>{if(s!=="system")return;const f=window.matchMedia("(prefers-color-scheme: dark)"),h=()=>{wi(r,"system")};return f.addEventListener("change",h),()=>f.removeEventListener("change",h)},[s,r]);const a=d.useCallback(f=>{Tx(f),pc(af,f),o(f)},[]),c=d.useCallback(f=>{pc(lf,f),i(f)},[]),u=d.useMemo(()=>({locale:r,messages:Mx(r),direction:sf(r),theme:s,setLocale:a,setTheme:c}),[r,s,a,c]);return l.jsx(df.Provider,{value:u,children:n})},ms=()=>{const e=d.useContext(df);if(e===void 0)throw new Error("usePreferences must be used inside PreferencesProvider");return e},ff=d.createContext(void 0),pf=()=>{const[e]=Zu(),t=d.useMemo(()=>new URLSearchParams(e.split("?")[1]??""),[e]),n=(e.split("?")[0]??"/add").replace(/^\/?/u,"");return{route:n==="applications"||n==="help"?n:"add",query:t}},hf=()=>{const e=d.useContext(ff);if(e===void 0)throw new Error("useWorkbenchNavigation must be used inside WorkbenchShell");return e},Hx={"zh-CN":"中",ja:"日",ko:"한",en:"EN",ar:"ع",fr:"FR",es:"ES",de:"DE",ru:"RU"},Lx=({product:e})=>{const{state:t,toggleSidebar:n}=gs(),r=t==="collapsed",o=`${e} · ${r?"展开":"收起"}`;return r?l.jsx(Er,{size:"lg",className:"group/brand relative justify-center",children:l.jsxs("span",{className:"relative grid size-8 shrink-0 place-items-center",children:[l.jsx("img",{src:"/logo.png",alt:e,width:24,height:24,className:"size-6 rounded-md transition-opacity group-hover/brand:opacity-0 focus-visible-within:opacity-0"}),l.jsx("button",{type:"button",onClick:n,"aria-label":o,title:o,className:"absolute inset-0 grid place-items-center rounded-md opacity-0 transition-opacity hover:bg-sidebar-accent focus-visible:opacity-100 group-hover/brand:opacity-100",children:l.jsx(Il,{"aria-hidden":!0,className:"size-4"})})]})}):l.jsxs(Er,{size:"lg",className:"justify-start pr-1",children:[l.jsx("img",{src:"/logo.png",alt:e,width:24,height:24,className:"size-6 shrink-0 rounded-md"}),l.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:e}),l.jsx("button",{type:"button",onClick:n,"aria-label":o,title:o,className:"grid size-6 shrink-0 place-items-center rounded-md hover:bg-sidebar-accent",children:l.jsx(Il,{"aria-hidden":!0,className:"size-4"})})]})},Kx=({children:e,panelOpen:t})=>{const{locale:n,messages:r,setLocale:o,theme:s,setTheme:i}=ms(),{route:a}=pf(),c=d.useCallback(x=>{window.location.hash=`#/${x}`},[]),[u,f]=d.useState(()=>window.innerWidth>=768),h=t===!0;d.useEffect(()=>{const x=window.matchMedia("(min-width: 768px)"),m=()=>{f(x.matches&&!h)};return m(),x.addEventListener("change",m),()=>x.removeEventListener("change",m)},[h]);const A=d.useMemo(()=>({route:a,navigate:c}),[a,c]),g=[{route:"add",icon:l.jsx(Bu,{"aria-hidden":!0}),label:r.nav.add},{route:"applications",icon:l.jsx(Mh,{"aria-hidden":!0}),label:r.nav.applications},{route:"help",icon:l.jsx(xh,{"aria-hidden":!0}),label:r.nav.help}],p=s==="system"?r.theme.system:s==="light"?r.theme.light:r.theme.dark;return l.jsx(ff.Provider,{value:A,children:l.jsxs(P0,{open:u,onOpenChange:f,children:[l.jsxs(T0,{collapsible:"icon",children:[l.jsx(_0,{children:l.jsx(Ws,{children:l.jsx(ao,{children:l.jsx(Lx,{product:r.shell.product})})})}),l.jsx(H0,{children:l.jsx(L0,{children:l.jsx(K0,{children:l.jsx(Ws,{children:g.map(x=>l.jsx(ao,{children:l.jsxs(fs,{children:[l.jsxs(ps,{render:l.jsx(Er,{isActive:a===x.route,tooltip:x.label,"aria-label":x.label,onClick:()=>{c(x.route)}}),children:[x.icon,l.jsx("span",{children:x.label})]}),l.jsx(hs,{side:"right",children:x.label})]})},x.route))})})})}),l.jsx(O0,{children:l.jsxs(Ws,{children:[l.jsx(ao,{children:l.jsxs(Mo,{children:[l.jsx(Po,{render:l.jsxs(Er,{tooltip:r.language.title,"aria-label":r.language.title,children:[l.jsx("span",{"aria-hidden":!0,className:"text-xs font-semibold",children:Hx[n]}),l.jsx("span",{children:r.language.title})]})}),l.jsx(To,{side:"top",align:"start",children:_o.map(x=>l.jsx(No,{onClick:()=>{o(x)},children:Cx(x)},x))})]})}),l.jsx(ao,{children:l.jsxs(Mo,{children:[l.jsx(Po,{render:l.jsxs(Er,{tooltip:`${r.theme.title}: ${p}`,"aria-label":`${r.theme.title}: ${p}`,children:[s==="light"?l.jsx(ng,{"aria-hidden":!0}):s==="dark"?l.jsx(Kh,{"aria-hidden":!0}):l.jsx(Hh,{"aria-hidden":!0}),l.jsx("span",{children:p})]})}),l.jsx(To,{side:"top",align:"start",children:[["system",r.theme.system],["light",r.theme.light],["dark",r.theme.dark]].map(([x,m])=>l.jsx(No,{onClick:()=>{i(x)},children:m},x))})]})})]})}),l.jsx(N0,{"aria-label":r.shell.toggleSidebar})]}),l.jsx("main",{className:"relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden",children:e})]})})},Wx=()=>new URLSearchParams(window.location.search).get("token")??"",cn=async(e,t={})=>{const n=await fetch(e,{method:t.method??"GET",headers:{authorization:`Bearer ${Wx()}`,...t.body===void 0?{}:{"content-type":"application/json"}},...t.body===void 0?{}:{body:JSON.stringify(t.body)}}),r=await n.json().catch(()=>({}));return{status:n.status,data:r}},Qx=()=>cn("/api/apps"),gf=e=>cn(`/api/apps/${encodeURIComponent(e)}/config`),Gx=e=>cn(`/api/apps/${encodeURIComponent(e)}/icon`),zx=(e,t)=>cn(`/api/apps/${encodeURIComponent(e)}/uninstall`,{method:"POST",body:{...t}}),Yx=()=>cn("/api/skill/list"),Ux=e=>cn(`/api/skill?path=${encodeURIComponent(e)}`),Vx=(e,t)=>cn(`/api/apps/${encodeURIComponent(e)}/export`,{method:"POST",body:{...t}}),Zx=e=>cn(`/api/apps/${encodeURIComponent(e)}/open`,{method:"POST",body:{}}),Jx=e=>cn("/api/export",{method:"POST",body:{...e}}).then(t=>{if(t.status!==200)return t;const n=t.data;return n.ok!==!0?{status:409,data:{code:n.code,message:n.message}}:{status:200,data:n.kind==="command"?{command:n.command}:{filename:n.filename,content:n.content,...n.commandLine===void 0?{}:{commandLine:n.commandLine},...n.iconSharedAs===void 0?{}:{iconSharedAs:n.iconSharedAs},...n.iconReference===void 0?{}:{iconReference:n.iconReference}}}});function $x(e){if(!e)return null;for(const t of e.elements){const n=t.tagName;if(n==="BUTTON"||n==="INPUT"){const r=t;if(r.type==="submit")return r}}return null}function Af(e){return{checked(t){return e.indeterminate?{}:t?{"data-checked":""}:{"data-unchecked":""}},...Wi}}const Xx=d.createContext(void 0);function qx(){return d.useContext(Xx)}const mf=d.createContext(void 0);function eb(){const e=d.useContext(mf);if(e===void 0)throw new Error(st(14));return e}const tb="data-parent",nb=d.forwardRef(function(t,n){const{checked:r,className:o,defaultChecked:s=!1,"aria-labelledby":i,disabled:a=!1,form:c,id:u,indeterminate:f=!1,inputRef:h,name:A,onCheckedChange:g,parent:p=!1,readOnly:x=!1,render:m,required:v=!1,uncheckedValue:b,value:y,nativeButton:C=!1,style:I,...w}=t,{clearErrors:S}=Qi(),{disabled:R,name:E,setDirty:k,setFilled:B,setFocused:T,setTouched:F,state:j,validationMode:D,validityData:H,validation:_}=Uo(),P=Lg(),{labelId:L,controlId:N,registerControlId:M,getDescriptionProps:O}=Gi(),G=qx(),Z=G?.allValues===void 0?void 0:G.parent,J=Z!==void 0,Q=R||P.disabled||G?.disabled||a,$=E??A,K=y??$,te=wt(),le=wt();let X=u||N;J&&(p?X=le:K!==void 0?X=`${Z.id}-${K}`:X||=le);let ee={};J&&(p?ee=Z.getParentProps():K!==void 0&&(ee=Z.getChildProps(K)));const{checked:U=r,indeterminate:ue=f,onCheckedChange:se,...be}=ee,re=G?.value,Ae=d.useRef(null),ie=Rt(()=>Symbol()),oe=d.useRef(!1),{getButtonProps:ce,buttonRef:me}=Yt({disabled:Q,native:C}),ge=G?.validation??_,[W,V]=sn({controlled:K!==void 0&&re!==void 0&&!p?re.includes(K):U,default:s,name:"Checkbox",state:"checked"}),ye=J?!!U:W,q=J&&ue||f;ae(()=>{M!==Sr&&(oe.current=!0,M(ie.current,X))},[X,M,ie]),d.useEffect(()=>{const Re=ie.current;return()=>{!oe.current||M===Sr||(oe.current=!1,M(Re,void 0))}},[M,ie]),zi(Ae,te,W,void 0,!G&&!Q,A);const ne=d.useRef(null),ke=ge.registerInput,Se=G?K:void 0,Qe=d.useCallback(Re=>ke(Re,{controlRef:Ae,value:Se}),[ke,Se]),tt=zt(h,ne,p?void 0:Qe),Le=Mu(i,L,ne,!C,X??void 0);ae(()=>{ne.current&&(ne.current.indeterminate=q,W&&B(!0))},[W,q,B]),cs(W,()=>{G||(S($),B(W),k(W!==H.initialValue),ge.change(W))});const ht=Ft({checked:W,disabled:Q,form:c,name:p?void 0:$,id:C?void 0:X??void 0,required:v,ref:tt,style:$?da:ts,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(Re){if(Re.nativeEvent.defaultPrevented)return;if(x){Re.preventDefault();return}const Ue=Re.currentTarget.checked,_e=Ce(jt,Re.nativeEvent);if(g?.(Ue,_e),!_e.isCanceled&&(se?.(Ue,_e),!_e.isCanceled&&(V(Ue),K!==void 0&&G!==void 0&&!p&&!J))){const nt=Ue?[...G.value,K]:G.value.filter(Ee=>Ee!==K);G.setValue(nt,_e)}},onClick(Re){Re.stopPropagation()},onFocus(){Ae.current?.focus()}},y!==void 0?{value:(G?W&&y:y)||""}:ct,O,Re=>ge.getValidationProps(Q,Re));d.useEffect(()=>{if(!Z||K===void 0)return;const Re=Z.disabledStatesRef.current;return Re.set(K,Q),()=>{Re.delete(K)}},[Z,Q,K]);const Ke=d.useMemo(()=>({...j,checked:ye,disabled:Q,readOnly:x,required:v,indeterminate:q}),[j,ye,Q,x,v,q]),Ge=Af(Ke),ut=Me("span",t,{state:Ke,ref:[me,Ae,n],props:[{id:C?X??void 0:te,role:"checkbox","aria-checked":q?"mixed":ye,"aria-readonly":x||void 0,"aria-required":v||void 0,"aria-labelledby":Le,[tb]:p?"":void 0,onFocus(){Q||T(!0)},onBlur(){const Re=ne.current;Re&&(F(!0),T(!1),D==="onBlur"&&ge.commit(G?re:Re.checked))},onKeyDown(Re){if(Re.key!=="Enter"||(Re.preventBaseUIHandler(),Re.defaultPrevented))return;const Ue=ne.current?.form??null,_e=Re.currentTarget,nt=Re.nativeEvent,Ee=Re.preventDefault,Ve=nt.preventDefault;let Ze=!1;Re.preventDefault=()=>{Ze=!0,Ee.call(Re)},nt.preventDefault=()=>{Ze=!0,Ve.call(nt)},Ve.call(nt),ot(_e).queueMicrotask(()=>{Re.preventDefault=Ee,nt.preventDefault=Ve,Ze||$x(Ue)?.click()})},onClick(Re){if(x||Q)return;Re.preventDefault();const Ue=ne.current;Ue&&Li(Ue,Re)}},w,be,ce,O,Re=>ge.getValidationProps(Q,Re)],stateAttributesMapping:Ge});return l.jsxs(mf.Provider,{value:Ke,children:[ut,!W&&!G&&$&&!p&&b!==void 0&&l.jsx("input",{type:"hidden",form:c,name:$,value:b,disabled:Q}),l.jsx("input",{...ht,suppressHydrationWarning:!0})]})}),rb=d.forwardRef(function(t,n){const{render:r,className:o,style:s,keepMounted:i=!1,...a}=t,c=eb(),u=c.checked||c.indeterminate,{mounted:f,transitionStatus:h,setMounted:A}=ir(u),g=d.useRef(null),p={...c,transitionStatus:h};Ut({open:u,ref:g,onComplete(){u||A(!1)}});const m={...Af(c),...On},v=i||f,b=Me("span",t,{ref:[n,g],state:p,stateAttributesMapping:m,props:a});return v?b:null});function ki({className:e,...t}){return l.jsx(nb,{"data-slot":"checkbox",className:he("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",e),...t,children:l.jsx(rb,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:l.jsx(Ui,{})})})}function Pe({className:e,...t}){return l.jsx("label",{"data-slot":"label",className:he("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const xf=d.createContext(void 0);function bf(){const e=d.useContext(xf);if(e===void 0)throw new Error(st(10));return e}const ob={value:()=>null},sb=d.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,hiddenUntilFound:i,keepMounted:a,loopFocus:c,onValueChange:u,multiple:f=!1,orientation:h="vertical",value:A,defaultValue:g,style:p,...x}=t,m=d.useMemo(()=>{if(A===void 0)return g??[]},[A,g]),v=d.useRef([]),[b,y]=sn({controlled:A,default:m,name:"Accordion",state:"value"}),C=de((R,E,k)=>{if(f)if(E){const B=b.slice();if(B.push(R),u?.(B,k),k.isCanceled)return;y(B)}else{const B=b.filter(T=>T!==R);if(u?.(B,k),k.isCanceled)return;y(B)}else{const B=b[0]===R?[]:[R];if(u?.(B,k),k.isCanceled)return;y(B)}}),I=d.useMemo(()=>({value:b,disabled:s,orientation:h}),[b,s,h]),w=d.useMemo(()=>({disabled:s,handleValueChange:C,hiddenUntilFound:i??!1,keepMounted:a??!1,state:I,value:b}),[s,C,i,a,I,b]),S=Me("div",t,{state:I,ref:n,props:x,stateAttributesMapping:ob});return l.jsx(xf.Provider,{value:w,children:l.jsx(Vr,{elementsRef:v,children:S})})});function ib(e){const{open:t,defaultOpen:n,onOpenChange:r,disabled:o}=e,[s,i]=sn({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:a,setMounted:c,transitionStatus:u}=ir(s,!0,!0),f=wt(),[h,A]=d.useState(),g=h===null?void 0:h??f,p=de(x=>{const m=!s,v=Ce(Nn,x.nativeEvent);r(m,v),!v.isCanceled&&i(m)});return d.useMemo(()=>({defaultPanelId:f,disabled:o,handleTrigger:p,mounted:a,open:s,panelId:g,setMounted:c,setOpen:i,setPanelIdState:A,transitionStatus:u}),[f,o,p,a,s,g,c,i,A,u])}const vf=d.createContext(void 0);function yf(){const e=d.useContext(vf);if(e===void 0)throw new Error(st(15));return e}const Cf=d.createContext(void 0);function _a(){const e=d.useContext(Cf);if(e===void 0)throw new Error(st(9));return e}let Oa=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Do.startingStyle]="startingStyle",e[e.endingStyle=Do.endingStyle]="endingStyle",e})({}),ab=(function(e){return e.panelOpen="data-panel-open",e})({});const lb={[Oa.open]:""},cb={[Oa.closed]:""},ub={open(e){return e?{[ab.panelOpen]:""}:null}},db={open(e){return e?lb:cb}};let fb=(function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e})({});const Ha={...db,index:e=>({[fb.index]:String(e)}),...On,value:()=>null},pb=d.forwardRef(function(t,n){const{className:r,disabled:o=!1,onOpenChange:s,render:i,value:a,style:c,...u}=t,{ref:f,index:h}=As(),A=zt(n,f),{disabled:g,handleValueChange:p,state:x,value:m}=bf(),v=wt(),b=a??v,y=o||g,C=m.indexOf(b)!==-1,I=de((H,_)=>{s?.(H,_),!_.isCanceled&&p(b,H,_)}),w=ib({open:C,onOpenChange:I,disabled:y}),S=d.useMemo(()=>({open:w.open,disabled:w.disabled,transitionStatus:w.transitionStatus}),[w.open,w.disabled,w.transitionStatus]),R=d.useMemo(()=>({...w,onOpenChange:I,state:S}),[w,S,I]),E=d.useMemo(()=>({...x,hidden:!C&&!w.mounted,index:h,disabled:y,open:C}),[w.mounted,y,h,C,x]),k=wt(),[B,T]=d.useState(),F=B===null?void 0:B??k,j=d.useMemo(()=>({defaultTriggerId:k,open:C,state:E,setTriggerId:T,triggerId:F}),[k,C,E,T,F]),D=Me("div",t,{state:E,ref:A,props:u,stateAttributesMapping:Ha});return l.jsx(vf.Provider,{value:R,children:l.jsx(Cf.Provider,{value:j,children:D})})}),hb=d.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,{state:a}=_a();return Me("h3",t,{state:a,ref:n,props:i,stateAttributesMapping:Ha})}),gb=d.forwardRef(function(t,n){const{disabled:r,className:o,id:s,render:i,nativeButton:a=!0,style:c,...u}=t,{panelId:f,open:h,handleTrigger:A,disabled:g}=yf(),p=r||g,{getButtonProps:x,buttonRef:m}=Yt({disabled:p,focusableWhenDisabled:!0,native:a}),{defaultTriggerId:v,state:b,setTriggerId:y}=_a(),C=s||void 0,I=C??v;return ae(()=>(y(R=>C??(R===null?void 0:R)),()=>{y(R=>R===C?null:R)}),[C,y]),Me("button",t,{state:b,ref:[n,m],props:[{"aria-controls":h?f:void 0,"aria-expanded":h,id:I,onClick:A},u,x],stateAttributesMapping:ub})}),ur={height:void 0,width:void 0};function Ab(e){const{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:o,mounted:s,onOpenChange:i,open:a,setMounted:c,setOpen:u,transitionStatus:f}=e,h=d.useRef(null),A=d.useRef(null),[g,p]=d.useState(ur),x=d.useRef(ur),m=d.useRef(!1),v=d.useRef(a),b=d.useRef(!1),[y,C]=d.useState(!1),I=d.useRef(null),w=zt(t,h),S=et(a),R=aa(h),E=!a&&!s,k=y?"idle":f,B=a&&(v.current||b.current),T=!a&&s&&A.current==="css-animation"&&g.height===void 0&&g.width===void 0?x.current:g,F=n&&E&&A.current!=="css-animation",j=de((L,N=!0)=>{N&&(x.current=L),p(L)}),D=de(()=>{I.current?.(),I.current=null}),H=de(L=>{D(),I.current=()=>{I.current=null,L()}}),_=de(()=>{a&&s&&A.current==="css-animation"&&(b.current=!0)});ae(()=>{!y||f==="starting"||C(!1)},[y,f]),d.useEffect(()=>()=>{_(),D()},[_,D]),ae(()=>{const L=h.current;if(!L)return;!a&&I.current&&D();const N=mb(L,B);if(A.current=N,a&&f==="idle"&&v.current&&N==="css-animation"){x.current=Kn(L);return}if(a&&f==="starting"){const G=m.current;if(m.current=!1,N==="none"){j(Kn(L)),C(!0);return}if(N==="css-transition"){const Q=xb(L);if(j(Kn(L)),!G)return Q;const $=co(L,"transition-duration","0s");return H($),C(!0),Q}j(Kn(L));const Z=co(L,"animation-name","none");if(!G){Z();return}const J=co(L,"animation-duration","0s");Z(),H(J),C(!0);return}if(!a&&s&&(f==="idle"||f==="starting")){if(v.current=!1,b.current=!1,N==="none"){j(ur,!1),c(!1);return}j(Kn(L));return}if(f!=="ending")return;if(N==="none"){c(!1);return}const M=Kn(L);if(!(M.height>0||M.width>0)){c(!1);return}j(M),N==="css-animation"&&co(L,"animation-name","none")()},[s,a,D,j,c,H,B,f]),Ut({enabled:a&&s&&k==="idle",open:!0,ref:h,onComplete(){a&&j(ur,!1)}}),d.useEffect(()=>{if(a||!s||k!=="ending"||!h.current)return;const N=new AbortController;let M=-1;function O(){S.current||(c(!1),j(ur,!1))}return M=It.request(()=>{R(O,N.signal)}),()=>{It.cancel(M),N.abort()}},[S,s,a,k,R,j,c]),ae(()=>{const L=h.current;!L||!n||!E||L.setAttribute("hidden","until-found")},[E,n]),d.useEffect(function(){const N=h.current;if(!N)return;function M(O){const G=Ce(jt,O);i(!0,G),!G.isCanceled&&(m.current=!0,u(!0))}return De(N,"beforematch",M)},[i,u]);const P=o||n||s||a;return{height:T.height,props:{...F?{[Oa.startingStyle]:""}:void 0,hidden:E,id:r},ref:w,shouldPreventOpenAnimation:B,shouldRender:P,transitionStatus:k,width:T.width}}function Kn(e){return{height:e.scrollHeight,width:e.scrollWidth}}function mb(e,t){const n=ot(e).getComputedStyle(e),r=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&gc(n.animationDuration),o=gc(n.transitionDuration);return r&&o||o?"css-transition":r?"css-animation":"none"}function gc(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function co(e,t,n){const r=e.style.getPropertyValue(t),o=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===""){e.style.removeProperty(t);return}e.style.setProperty(t,r,o)}}function xb(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(o=>{e.style.setProperty(o,"initial","important")});function n(){Object.entries(t).forEach(([o,s])=>{if(s===""){e.style.removeProperty(o);return}e.style.setProperty(o,s)})}const r=It.request(n);return()=>{It.cancel(r),n()}}let Ac=(function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e})({});const bb=d.forwardRef(function(t,n){const{className:r,hiddenUntilFound:o,keepMounted:s,id:i,render:a,style:c,...u}=t,{hiddenUntilFound:f,keepMounted:h}=bf(),{defaultPanelId:A,mounted:g,onOpenChange:p,open:x,setMounted:m,setOpen:v,setPanelIdState:b,transitionStatus:y}=yf(),C=o??f,I=s??h,w=i||void 0,S=i??A;ae(()=>(b(N=>w??(N===null?void 0:N)),()=>{b(N=>N===w?null:N)}),[w,b]);const{height:R,props:E,ref:k,shouldPreventOpenAnimation:B,shouldRender:T,transitionStatus:F,width:j}=Ab({externalRef:n,hiddenUntilFound:C,id:S,keepMounted:I,mounted:g,onOpenChange:p,open:x,setMounted:m,setOpen:v,transitionStatus:y}),{state:D,triggerId:H}=_a(),_={...D,transitionStatus:F},P=Jp(c,_),L=Me("div",{...t,style:void 0},{state:_,ref:k,props:[E,{"aria-labelledby":H,role:"region",style:{[Ac.accordionPanelHeight]:R===void 0?"auto":`${R}px`,[Ac.accordionPanelWidth]:j===void 0?"auto":`${j}px`}},u,P?{style:P}:void 0,B?{style:{animationName:"none"}}:void 0],stateAttributesMapping:Ha});return T?L:null});function La({className:e,...t}){return l.jsx(sb,{"data-slot":"accordion",className:he("flex w-full flex-col",e),...t})}function Ka({className:e,...t}){return l.jsx(pb,{"data-slot":"accordion-item",className:he("not-last:border-b",e),...t})}function Wa({className:e,children:t,...n}){return l.jsx(hb,{className:"flex",children:l.jsxs(gb,{"data-slot":"accordion-trigger",className:he("group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground",e),...n,children:[t,l.jsx(_n,{className:"pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden"}),l.jsx(Vi,{className:"pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline"})]})})}function Qa({className:e,children:t,...n}){return l.jsx(bb,{"data-slot":"accordion-content",className:"overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up",...n,children:l.jsx("div",{className:he("h-(--accordion-panel-height) pt-0 pb-2.5 data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",e),children:t})})}const If=d.createContext(void 0);function vb(){return d.useContext(If)}const yb=d.forwardRef(function(t,n){const{className:r,defaultPressed:o=!1,disabled:s=!1,form:i,onPressedChange:a,pressed:c,render:u,type:f,value:h,nativeButton:A=!0,style:g,...p}=t,x=wt(h||void 0),m=vb(),v=m?.value??[],b=m?void 0:o,y=(s||m?.disabled)??!1,[C,I]=sn({controlled:m?x!==void 0&&v.indexOf(x)>-1:c,default:b,name:"Toggle",state:"pressed"}),{getButtonProps:w,buttonRef:S}=Yt({disabled:y,native:A}),R={disabled:y,pressed:C},E=[S,n],k=[{"aria-pressed":C,onClick(F){const j=!C,D=Ce(jt,F.nativeEvent);a?.(j,D),!D.isCanceled&&(x&&m?.setGroupValue?.(x,j,D),!D.isCanceled&&I(j))}},p,w],B=Me("button",t,{enabled:!m,state:R,ref:E,props:k}),T=d.useMemo(()=>({disabled:y,focusableWhenDisabled:!1}),[y]);return m?l.jsx(nf,{tag:"button",render:u,className:r,style:g,metadata:T,state:R,refs:E,props:k}):B}),wf="data-composite-item-active",Cb=[];function Ib(e){const{loopFocus:t=!0,orientation:n="both",grid:r,onLoop:o,direction:s,highlightedIndex:i,onHighlightedIndexChange:a,rootRef:c,enableHomeAndEndKeys:u=!1,stopEventPropagation:f,disabledIndices:h,modifierKeys:A=Cb}=e,[g,p]=d.useState(0),x=r!=null,m=d.useRef(null),v=zt(m,c),b=d.useRef([]),y=d.useRef(!1),C=i??g,I=de((k,B=!1)=>{if((a??p)(k),B){const T=b.current[k];ec(m.current,T,s,n)}}),w=de(k=>{if(k.size===0||y.current)return;y.current=!0;const B=Array.from(k.keys()),T=B.find(j=>j?.hasAttribute(wf))??null,F=T?k.get(T)?.index??-1:-1;if(F!==-1)I(F);else if(Ro(B,C,h)){const j=nn(B,{disabledIndices:h});wr(B,j)||I(j)}ec(m.current,T,s,n)});ae(()=>{if(h==null||i!=null||!y.current)return;const k=b.current;if(Ro(k,C,h)){const B=nn(k,{disabledIndices:h});wr(k,B)||I(B)}},[h,i,C,b,I]);const S=de((k,B,T)=>o?o(k,B,T,b):T),R=de(k=>{const B=k.key===Ci||k.key===Ii;if(!as.has(k.key)||!u&&B||wb(k,A)||!m.current)return;const F=s==="rtl",j=F?vi:yi,D=F?yi:vi,H=n==="vertical"?bi:j,_=n==="vertical"?xi:D,P=gt(k.nativeEvent);if(P!=null&&ql(P)&&!of(P)){const Z=P.selectionStart,J=P.selectionEnd,Q=P.value;if(Z==null||k.shiftKey||Z!==J||k.key!==_&&Z<Q.length||k.key!==H&&Z>0)return}let L=C;const N=bo(b,h),M=fi(b,h);r!=null&&(L=r({disabledIndices:h,elementsRef:b,event:k,highlightedIndex:C,loopFocus:t,maxIndex:M,minIndex:N,onLoop:S,orientation:n,rtl:F}));const O=n!=="vertical"&&k.key===j||n!=="horizontal"&&k.key===bi,G=n!=="vertical"&&k.key===D||n!=="horizontal"&&k.key===xi;u&&(k.key===Ci?L=N:k.key===Ii&&(L=M)),L===C&&(O||G)&&(t&&L===M&&O?(L=N,o&&(L=o(k,C,L,b))):t&&L===N&&G?(L=M,o&&(L=o(k,C,L,b))):L=nn(b.current,{startingIndex:L,decrement:G,disabledIndices:h})),L!==C&&!wr(b.current,L)&&(f&&k.stopPropagation(),(x||B||O||G)&&k.preventDefault(),I(L,!0),queueMicrotask(()=>{b.current[L]?.focus()}))});return{props:{ref:v,onFocus(k){const B=m.current,T=gt(k.nativeEvent);!B||T==null||!ql(T)||T.setSelectionRange(0,T.value.length)},onKeyDown:R},highlightedIndex:C,onHighlightedIndexChange:I,elementsRef:b,onMapChange:w,relayKeyboardEvent:R}}function wb(e,t){for(const n of Nm)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function kf(e){const{render:t,className:n,style:r,refs:o=Ot,props:s=Ot,state:i=ct,stateAttributesMapping:a,highlightedIndex:c,onHighlightedIndexChange:u,orientation:f,grid:h,loopFocus:A,onLoop:g,enableHomeAndEndKeys:p,onMapChange:x,stopEventPropagation:m=!0,rootRef:v,disabledIndices:b,modifierKeys:y,highlightItemOnHover:C=!1,tag:I="div",...w}=e,S=us(),{props:R,highlightedIndex:E,onHighlightedIndexChange:k,elementsRef:B,onMapChange:T,relayKeyboardEvent:F}=Ib({grid:h,loopFocus:A,onLoop:g,orientation:f,highlightedIndex:c,onHighlightedIndexChange:u,rootRef:v,stopEventPropagation:m,enableHomeAndEndKeys:p,direction:S,disabledIndices:b,modifierKeys:y}),j=Me(I,e,{state:i,ref:o,props:[R,...s,w],stateAttributesMapping:a}),D=d.useMemo(()=>({highlightedIndex:E,onHighlightedIndexChange:k,highlightItemOnHover:C,relayKeyboardEvent:F}),[E,k,C,F]);return l.jsx(oh.Provider,{value:D,children:l.jsx(Vr,{elementsRef:B,onMapChange:H=>{x?.(H),T(H)},children:j})})}const kb=d.createContext(void 0);function Eb(){return d.useContext(kb)}const Sb=d.forwardRef(function(t,n){const{defaultValue:r,disabled:o=!1,loopFocus:s=!0,onValueChange:i,orientation:a="horizontal",multiple:c=!1,value:u,className:f,render:h,style:A,...g}=t,p=Na(),x=Eb(),m=u!==void 0||r!==void 0,v=(p?.disabled??!1)||(x?.disabled??!1)||o,[b,y]=sn({controlled:u,default:u===void 0?r??Ot:void 0,name:"ToggleGroup",state:"value"}),C=de((E,k,B)=>{let T;c?(T=b.slice(),k?T.push(E):T.splice(b.indexOf(E),1)):T=k?[E]:[],i?.(T,B),!B.isCanceled&&y(T)}),I={disabled:v,multiple:c,orientation:a},w=d.useMemo(()=>({disabled:v,setGroupValue:C,value:b,isValueInitialized:m}),[v,C,b,m]),S={role:"group"},R=Me("div",t,{enabled:!!p,state:I,ref:n,props:[S,g]});return l.jsx(If.Provider,{value:w,children:p?R:l.jsx(kf,{render:h,className:f,style:A,state:I,refs:[n],props:[S,g],loopFocus:s,enableHomeAndEndKeys:!0,orientation:a})})}),Rb=Ti("group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-muted"},size:{default:"h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",sm:"h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2"}},defaultVariants:{variant:"default",size:"default"}}),Ef=d.createContext({size:"default",variant:"default",spacing:2,orientation:"horizontal"});function Ga({className:e,variant:t,size:n,spacing:r=2,orientation:o="horizontal",children:s,...i}){return l.jsx(Sb,{"data-slot":"toggle-group","data-variant":t,"data-size":n,"data-spacing":r,"data-orientation":o,style:{"--gap":r},className:he("group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch",e),...i,children:l.jsx(Ef.Provider,{value:{variant:t,size:n,spacing:r,orientation:o},children:s})})}function jr({className:e,children:t,variant:n="default",size:r="default",...o}){const s=d.useContext(Ef);return l.jsx(yb,{"data-slot":"toggle-group-item","data-variant":s.variant||n,"data-size":s.size||r,"data-spacing":s.spacing,className:he("shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",Rb({variant:s.variant||n,size:s.size||r}),e),...o,children:t})}function za({...e}){return l.jsx(_d,{"data-slot":"dialog",...e})}function Db({...e}){return l.jsx(Ba,{"data-slot":"dialog-portal",...e})}function Fb({...e}){return l.jsx(Gr,{"data-slot":"dialog-close",...e})}function Bb({className:e,...t}){return l.jsx(ca,{"data-slot":"dialog-overlay",className:he("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function Ya({className:e,children:t,showCloseButton:n=!0,...r}){return l.jsxs(Db,{children:[l.jsx(Bb,{}),l.jsxs(Ra,{"data-slot":"dialog-content",className:he("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...r,children:[t,n&&l.jsxs(Gr,{"data-slot":"dialog-close",render:l.jsx(Oe,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[l.jsx(Zi,{}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Qn({className:e,...t}){return l.jsx("div",{"data-slot":"dialog-header",className:he("flex flex-col gap-2",e),...t})}function jb({className:e,showCloseButton:t=!1,children:n,...r}){return l.jsxs("div",{"data-slot":"dialog-footer",className:he("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",e),...r,children:[n,t&&l.jsx(Gr,{render:l.jsx(Oe,{variant:"outline"}),children:"Close"})]})}function Gn({className:e,...t}){return l.jsx(ja,{"data-slot":"dialog-title",className:he("cn-font-heading text-base leading-none font-medium",e),...t})}function Ua({className:e,...t}){return l.jsx(ua,{"data-slot":"dialog-description",className:he("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}const Sf=new Set(["npx","create-opentray","create","set"]),tn={comment:"text-muted-foreground italic",keyword:"text-emerald-600 dark:text-emerald-400 font-medium",flag:"text-sky-600 dark:text-sky-400",string:"text-amber-700 dark:text-amber-300 break-all",env:"text-violet-600 dark:text-violet-400",variable:"text-rose-600 dark:text-rose-400"},Mb=(e,t)=>e.split(/(\s+|\$[A-Za-z_][A-Za-z0-9_]*)/g).map((r,o)=>{const s=`${t}-u${o}`;return r.startsWith("$")?l.jsx("span",{className:tn.variable,children:r},s):Sf.has(r)?l.jsx("span",{className:tn.keyword,children:r},s):r.startsWith("--")?l.jsx("span",{className:tn.flag,children:r},s):/^[A-Za-z_][A-Za-z0-9_]*=/.test(r)?l.jsx("span",{className:tn.env,children:r},s):l.jsx("span",{children:r},s)}),Pb=(e,t)=>e.startsWith("#")?l.jsx("span",{className:tn.comment,children:e}):e.split(/('(?:[^']|'\\'')*')/g).map((r,o)=>{const s=`${t}-s${o}`;if(!r.startsWith("'"))return l.jsx("span",{children:Mb(r,s)},s);const i=r.slice(1,-1);return Sf.has(i)?l.jsx("span",{className:tn.keyword,children:r},s):i.startsWith("--")?l.jsx("span",{className:tn.flag,children:r},s):/^[A-Za-z_][A-Za-z0-9_]*=/.test(i)?l.jsx("span",{className:tn.env,children:r},s):l.jsx("span",{className:tn.string,children:r},s)}),Tb=({content:e})=>l.jsx("pre",{className:"tech-ltr bg-muted max-h-72 overflow-auto rounded-md p-2 text-xs whitespace-pre-wrap break-words",children:e.split(`
|
|
3
|
+
`).map((t,n)=>l.jsx("div",{children:t.length===0?" ":Pb(t,n)},n))}),Rf=({open:e,subtitle:t,hasEnv:n,share:r=!1,runner:o,onClose:s})=>{const{messages:i}=ms(),[a,c]=d.useState("sh"),[u,f]=d.useState(!1),[h,A]=d.useState(null),[g,p]=d.useState(null),[x,m]=d.useState(null),[v,b]=d.useState(!1),[y,C]=d.useState(!1),I=d.useRef(o);I.current=o,d.useEffect(()=>{f(!1),A(null)},[e]),d.useEffect(()=>{if(!e){p(null),m(null);return}if(n&&!u){p(null),b(!1);return}let E=!1;return b(!0),C(!1),m(null),(async()=>{const k=await I.current({format:a,acknowledgeEnv:u,...h===null?{}:{inlineIcon:h}});if(E)return;if(b(!1),k.status===200){const T=k.data;"content"in T&&T.content!==void 0&&(h===null&&T.iconSharedAs!==void 0&&A(T.iconSharedAs==="embedded"),p({filename:T.filename??"create-opentray.sh",content:T.content,...T.commandLine===void 0?{}:{commandLine:T.commandLine},...T.iconReference===void 0?{}:{iconReference:T.iconReference}}));return}p(null);const B=k.data;"code"in B&&m(`${B.message??B.code}`)})(),()=>{E=!0}},[e,a,u,h,n]);const w=!n||u,S=()=>{if(g===null)return;const E=new Blob([g.content],{type:a==="sh"?"text/x-shellscript":"text/plain"}),k=URL.createObjectURL(E),B=document.createElement("a");B.href=k,B.download=g.filename,B.click(),URL.revokeObjectURL(k)},R=async()=>{g!==null&&(await navigator.clipboard.writeText(g.commandLine??g.content),C(!0))};return l.jsx(za,{open:e,onOpenChange:E=>{E||s()},children:l.jsxs(Ya,{children:[l.jsxs(Qn,{children:[l.jsx(Gn,{children:r?i.export.shareTitle:i.export.title}),l.jsxs(Ua,{children:[l.jsx("span",{className:"tech-ltr block truncate",children:t}),r&&l.jsx("span",{className:"text-muted-foreground mt-1 block text-xs",children:i.export.shareSubtitle})]})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(Ga,{variant:"outline",size:"sm",spacing:0,value:[a],onValueChange:E=>{const k=E[0];(k==="sh"||k==="ps1")&&c(k)},children:[l.jsx(jr,{value:"sh",children:i.export.scriptSh}),l.jsx(jr,{value:"ps1",children:i.export.scriptPs1})]}),v&&l.jsx("span",{className:"text-muted-foreground self-center text-xs",children:i.export.building})]}),n&&l.jsx("div",{className:"border-warning rounded-md border p-3",children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(ki,{id:"export-env-ack",checked:u,onCheckedChange:E=>f(E===!0)}),l.jsxs(Pe,{htmlFor:"export-env-ack",className:"text-xs leading-snug",children:[i.export.envAck,l.jsx("span",{className:"text-muted-foreground block",children:i.export.envAckHint})]})]})}),g?.iconReference!==void 0&&g.iconReference!=="none"&&l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(ki,{id:"export-inline-icon",checked:h===!0,onCheckedChange:E=>A(E===!0)}),l.jsxs(Pe,{htmlFor:"export-inline-icon",className:"text-xs leading-snug",children:[i.export.inlineIcon,l.jsx("span",{className:"text-muted-foreground block",children:i.export.inlineIconHint})]})]}),x!==null&&l.jsxs("p",{className:"text-destructive text-xs",role:"alert",children:[i.export.blocked," ",x]}),g!==null&&l.jsx(La,{children:l.jsxs(Ka,{value:"content",children:[l.jsx(Wa,{className:"text-xs",children:i.export.viewFull}),l.jsx(Qa,{children:l.jsx(Tb,{content:g.content})})]})}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsxs(Oe,{size:"sm",variant:"outline",disabled:!w||g===null,onClick:()=>{R()},children:[l.jsx(vh,{width:14,height:14,"aria-hidden":!0}),y?i.common.copied:i.export.copyCommand]}),l.jsxs(Oe,{size:"sm",disabled:!w||g===null,onClick:S,children:[l.jsx(Ch,{width:14,height:14,"aria-hidden":!0}),i.export.downloadFile]})]})]})})};function Nb(e){return Nd("alert-dialog",e)}function mc({...e}){return l.jsx(Nb,{"data-slot":"alert-dialog",...e})}function _b({...e}){return l.jsx(Ba,{"data-slot":"alert-dialog-portal",...e})}function Ob({className:e,...t}){return l.jsx(ca,{"data-slot":"alert-dialog-overlay",className:he("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function xc({className:e,size:t="default",...n}){return l.jsxs(_b,{children:[l.jsx(Ob,{}),l.jsx(Ra,{"data-slot":"alert-dialog-content","data-size":t,className:he("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...n})]})}function bc({className:e,...t}){return l.jsx("div",{"data-slot":"alert-dialog-header",className:he("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function vc({className:e,...t}){return l.jsx("div",{"data-slot":"alert-dialog-footer",className:he("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function yc({className:e,...t}){return l.jsx(ja,{"data-slot":"alert-dialog-title",className:he("cn-font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function Cc({className:e,...t}){return l.jsx(ua,{"data-slot":"alert-dialog-description",className:he("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}function Ic({className:e,...t}){return l.jsx(Oe,{"data-slot":"alert-dialog-action",className:he(e),...t})}function wc({className:e,variant:t="outline",size:n="default",...r}){return l.jsx(Gr,{"data-slot":"alert-dialog-cancel",className:he(e),render:l.jsx(Oe,{variant:t,size:n}),...r})}const kc={healthy:"statusHealthy","invalid-config":"statusInvalidConfig","incompatible-version":"statusIncompatible","missing-payload":"statusMissingPayload","broken-link":"statusBrokenLink",running:"statusRunning"},Ec=e=>({statusHealthy:e.applications.statusHealthy,statusInvalidConfig:e.applications.statusInvalidConfig,statusIncompatible:e.applications.statusIncompatible,statusMissingPayload:e.applications.statusMissingPayload,statusBrokenLink:e.applications.statusBrokenLink,statusRunning:e.applications.statusRunning}),Hb=e=>{const t=e.command??{},n=e.window??{};return{command:[t.executable??"",...t.args??[]].filter(Boolean).join(" "),cwd:t.cwd??"",envKeys:Object.keys(t.env??{}),packageManager:typeof e.packageManager=="string"?e.packageManager:"",window:`${n.width??"—"}×${n.height??"—"}`.replace(/—×—/u,"—"),developerMode:e.developerMode===!0}},fn=({label:e,value:t})=>l.jsxs("div",{className:"grid grid-cols-[110px_1fr] gap-x-3 gap-y-1 text-xs",children:[l.jsx("span",{className:"text-muted-foreground",children:e}),l.jsx("span",{className:"tech-ltr break-all",children:t})]}),Lb=({app:e,dataUrl:t})=>{const n=(e.appName??e.key).trim().charAt(0).toUpperCase()||"A";return l.jsx("span",{className:"bg-muted text-muted-foreground flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-md text-sm font-semibold","aria-hidden":!0,children:t!==void 0?l.jsx("img",{src:t,alt:"",className:"size-full object-contain"}):n})},Kb=()=>{const{messages:e}=ms(),{navigate:t,route:n}=hf(),[r,o]=d.useState([]),[s,i]=d.useState("loading"),[a,c]=d.useState(null),[u,f]=d.useState(null),[h,A]=d.useState(!1),[g,p]=d.useState(null),[x,m]=d.useState(null),[v,b]=d.useState(null),[y,C]=d.useState({}),[I,w]=d.useState({}),S=d.useCallback(async()=>{i(H=>H==="ready"?"stale":"loading");const D=await Qx();D.status===200?(o(D.data),C({}),i("ready"),await Promise.all(D.data.filter(H=>H.hasIcon===!0).map(async H=>{const _=await Gx(H.key),P=_.data;_.status===200&&"dataUrl"in P&&P.dataUrl!==void 0&&w(L=>({...L,[H.key]:P.dataUrl}))}))):i("stale")},[]);d.useEffect(()=>{n==="applications"&&S()},[n,S]),d.useEffect(()=>{const D=()=>{S()};return window.addEventListener("create-opentray:apps-changed",D),()=>window.removeEventListener("create-opentray:apps-changed",D)},[S]);const R=async D=>{if(v===D.key){b(null);return}if(b(D.key),y[D.key]===void 0){const H=await gf(D.key);C(_=>({..._,[D.key]:H.status===200?Hb(H.data):"error"}))}},E=async D=>{const H=await Zx(D.key),_=H.data;p(H.status===200&&"ok"in _&&_.ok===!0?_.detail:"message"in _?_.message:e.common.error)},k=D=>{p([D.projectPath!==void 0?D.projectPath:"",D.targetRetained===!0?`${e.applications.uninstallRetained} ${D.payloadPath??""}`:"",D.targetDeleted===!0?`${e.applications.uninstallDeleted} ${D.payloadPath??""}`:"",D.manualPinCleanupHint].filter(Boolean).join(`
|
|
4
|
+
`))},B=async(D,H)=>{const _=await zx(D.key,{...H,purgeTarget:h});if(_.status===200)k(_.data);else{const P=_.data;if(_.status===409&&P.code==="app_running"&&(P.pids!==void 0||P.pid!==void 0)){const L=P.pids??(P.pid!==void 0?[P.pid]:[]);f({app:D,pids:L});return}p(P.message??e.common.error)}await S()},T=async()=>{const D=a;c(null),D!==null&&await B(D,{stopRunning:!1})},F=async()=>{const D=u;f(null),D!==null&&await B(D.app,{stopRunning:!0})},j=D=>x===null?Promise.resolve({status:400,data:{code:"state_error",message:"no target"}}):Vx(x.key,D);return l.jsxs("section",{className:"flex h-full flex-col overflow-hidden","aria-label":e.applications.title,children:[l.jsxs("header",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[l.jsx("h1",{className:"text-sm font-semibold",children:e.applications.title}),l.jsx(Oe,{variant:"ghost",size:"icon-sm","aria-label":e.common.refresh,onClick:()=>{S()},children:l.jsx(Vh,{width:16,height:16,"aria-hidden":!0})})]}),l.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-4",children:[s==="loading"&&l.jsxs("div",{className:"space-y-2","aria-label":e.common.loading,children:[l.jsx(en,{className:"h-14 w-full"}),l.jsx(en,{className:"h-14 w-full"}),l.jsx(en,{className:"h-14 w-full"})]}),s!=="loading"&&r.length===0&&l.jsx("p",{className:"text-muted-foreground text-sm",children:e.applications.emptyHint}),r.length>0&&l.jsx("ul",{className:"space-y-2",children:r.map(D=>{const H=v===D.key,_=y[D.key],P=D.status!=="healthy";return l.jsxs("li",{className:"border-border bg-card text-card-foreground rounded-lg border px-3 py-2",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Lb,{app:D,dataUrl:I[D.key]}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"truncate text-sm font-medium",children:D.appName??D.key}),P&&l.jsxs(fs,{children:[l.jsx(ps,{render:L=>l.jsx(Io,{variant:"destructive",...L,children:Ec(e)[kc[D.status]]})}),l.jsx(hs,{children:D.error?.message??Ec(e)[kc[D.status]]})]}),D.isLink&&l.jsx(Io,{variant:"outline",children:e.applications.linked})]}),l.jsx("div",{className:"tech-ltr text-muted-foreground truncate text-xs",children:D.appId??D.key})]}),l.jsxs(Oe,{variant:"ghost",size:"sm","aria-expanded":H,onClick:()=>{R(D)},children:[H?l.jsx(Vi,{width:14,height:14,"aria-hidden":!0}):l.jsx(_n,{width:14,height:14,"aria-hidden":!0}),e.applications.details]}),l.jsxs(Oe,{variant:"outline",size:"sm",onClick:()=>{window.location.hash=`#/add?edit=${encodeURIComponent(D.key)}`},children:[l.jsx(Fu,{width:14,height:14,"aria-hidden":!0}),e.applications.edit]}),l.jsxs(Oe,{variant:"outline",size:"sm",onClick:()=>{E(D)},children:[l.jsx(Du,{width:14,height:14,"aria-hidden":!0}),e.applications.open]}),l.jsxs(Oe,{variant:"outline",size:"sm",onClick:()=>m(D),children:[l.jsx(Xh,{width:14,height:14,"aria-hidden":!0}),e.applications.share]}),l.jsxs(Oe,{variant:"destructive",size:"sm",onClick:()=>c(D),children:[l.jsx(og,{width:14,height:14,"aria-hidden":!0}),e.applications.uninstall]})]}),H&&l.jsxs("div",{className:"border-border mt-2 space-y-1 rounded-md border bg-muted/40 p-3",children:[_===void 0&&l.jsx("p",{className:"text-muted-foreground text-xs",children:e.common.loading}),_==="error"&&l.jsx("p",{className:"text-destructive text-xs",role:"alert",children:e.common.error}),_!==void 0&&_!=="error"&&l.jsxs(l.Fragment,{children:[l.jsx(fn,{label:e.applications.source,value:D.source==="wizard"?e.applications.sourceWizard:e.applications.sourceRegistered}),l.jsx(fn,{label:e.applications.detailsCommand,value:_.command}),l.jsx(fn,{label:e.applications.detailsCwd,value:_.cwd}),l.jsx(fn,{label:e.applications.detailsEnv,value:_.envKeys.length>0?_.envKeys.join(", "):"—"}),l.jsx(fn,{label:e.applications.detailsPm,value:_.packageManager}),l.jsx(fn,{label:e.applications.detailsWindow,value:_.window}),l.jsx(fn,{label:e.applications.detailsDevMode,value:_.developerMode?"ON":"OFF"}),l.jsx(fn,{label:e.applications.detailsProjectDir,value:D.projectDir??D.payloadPath??D.registrationDir})]})]})]},D.key)})}),s==="stale"&&l.jsx("p",{className:"text-warning mt-3 text-xs",role:"status",children:e.common.error}),g!==null&&l.jsx("p",{className:"text-muted-foreground bg-muted mt-3 whitespace-pre-line rounded-md p-3 text-xs",role:"status",children:g})]}),l.jsx(mc,{open:a!==null,onOpenChange:D=>{D||c(null)},children:l.jsxs(xc,{children:[l.jsxs(bc,{children:[l.jsx(yc,{children:e.applications.uninstallTitle}),l.jsxs(Cc,{children:[a?.source==="wizard"?e.applications.uninstallWizardDescription:e.applications.uninstallDescription,l.jsx("span",{className:"tech-ltr mt-2 block truncate",children:a?.appId??a?.key}),a?.projectDir!==void 0&&l.jsx("span",{className:"tech-ltr mt-1 block truncate",children:a.projectDir})]})]}),a?.isLink===!0&&l.jsxs("label",{className:"flex items-start gap-2 text-xs",children:[l.jsx(ki,{checked:h,onCheckedChange:D=>A(D===!0)}),l.jsxs("span",{children:[e.applications.uninstallPurge,l.jsx("span",{className:"text-muted-foreground block",children:e.applications.uninstallPurgeHint})]})]}),l.jsx("p",{className:"text-muted-foreground text-xs",children:e.applications.uninstallPinHint}),l.jsxs(vc,{children:[l.jsx(wc,{children:e.common.cancel}),l.jsx(Ic,{onClick:()=>{T()},children:e.applications.uninstall})]})]})}),l.jsx(mc,{open:u!==null,onOpenChange:D=>{D||f(null)},children:l.jsxs(xc,{children:[l.jsxs(bc,{children:[l.jsx(yc,{children:e.applications.stopRunningTitle}),l.jsxs(Cc,{children:[e.applications.stopRunningDescription,l.jsxs("span",{className:"tech-ltr mt-2 block",children:[e.applications.stopRunningPids,": ",u?.pids.join(", ")]}),l.jsx("span",{className:"tech-ltr mt-1 block truncate",children:u?.app.appId??u?.app.key})]})]}),l.jsx("p",{className:"text-muted-foreground text-xs",children:e.applications.uninstallPinHint}),l.jsxs(vc,{children:[l.jsx(wc,{children:e.common.cancel}),l.jsx(Ic,{onClick:()=>{F()},children:e.applications.stopRunningConfirm})]})]})}),l.jsx(Rf,{open:x!==null,subtitle:x?.appId??x?.key??"",hasEnv:x?.hasEnv===!0,runner:j,onClose:()=>m(null)})]})},Va=d.createContext({indent:20,currentItem:void 0,tree:void 0,toggleIconType:"plus-minus"});function Df(){return d.useContext(Va)}function Wb({indent:e=20,tree:t,className:n,toggleIconType:r="chevron",...o}){const s=t&&typeof t.getContainerProps=="function"?t.getContainerProps():{},i={...o,...s},{style:a,...c}=i,u={...a,"--tree-indent":`${e}px`};return l.jsx(Va.Provider,{value:{indent:e,tree:t,toggleIconType:r},children:l.jsx("div",{"data-slot":"tree",style:u,className:he("flex flex-col",n),...c})})}function Qb({item:e,className:t,render:n,children:r,...o}){const s=Df(),{indent:i}=s,a=typeof e.getProps=="function"?e.getProps():{},c={...o,children:r,...a},{style:u,...f}=c,A={"data-slot":"tree-item",style:{...u,"--tree-padding":`${e.getItemMeta().level*i}px`},className:he("z-10 ps-(--tree-padding) outline-hidden select-none not-last:pb-0.5 focus:z-20 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),"data-focus":typeof e.isFocused=="function"?e.isFocused()||!1:void 0,"data-folder":typeof e.isFolder=="function"?e.isFolder()||!1:void 0,"data-selected":typeof e.isSelected=="function"?e.isSelected()||!1:void 0,"data-drag-target":typeof e.isDragTarget=="function"?e.isDragTarget()||!1:void 0,"data-search-match":typeof e.isMatchingSearch=="function"?e.isMatchingSearch()||!1:void 0,"aria-expanded":e.isExpanded()};return l.jsx(Va.Provider,{value:{...s,currentItem:e},children:Ru({defaultTagName:"button",render:n,props:Ft(A,f)})})}function Gb({item:e,children:t,className:n,...r}){const{currentItem:o,toggleIconType:s}=Df(),i=e||o;return i?l.jsxs("span",{"data-slot":"tree-item-label",className:he("in-focus-visible:ring-ring/50 bg-background hover:bg-accent in-data-[selected=true]:bg-accent in-data-[selected=true]:text-accent-foreground in-data-[drag-target=true]:bg-accent flex items-center gap-1 transition-colors not-in-data-[folder=true]:ps-7 in-focus-visible:ring-[3px] in-data-[search-match=true]:bg-blue-50! [&_svg]:pointer-events-none [&_svg]:shrink-0","rounded-md","py-1.5","px-2","text-sm",n),...r,children:[i.isFolder()&&(s==="plus-minus"?i.isExpanded()?l.jsx(_h,{"aria-hidden":!0,className:"text-muted-foreground size-3.5",stroke:"currentColor",strokeWidth:"1"}):l.jsx(Bu,{"aria-hidden":!0,className:"text-muted-foreground size-3.5",stroke:"currentColor",strokeWidth:"1"}):l.jsx(_n,{"aria-hidden":!0,className:"text-muted-foreground size-4 in-aria-[expanded=false]:-rotate-90"})),t||(typeof i.getItemName=="function"?i.getItemName():null)]}):(console.warn("TreeItemLabel: No item provided via props or context"),null)}const Sc={};function zb(e){let t=Sc[e];if(t)return t;t=Sc[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);t.push(r)}for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return t}function rr(e,t){typeof t!="string"&&(t=rr.defaultChars);const n=zb(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(r){let o="";for(let s=0,i=r.length;s<i;s+=3){const a=parseInt(r.slice(s+1,s+3),16);if(a<128){o+=n[a];continue}if((a&224)===192&&s+3<i){const c=parseInt(r.slice(s+4,s+6),16);if((c&192)===128){const u=a<<6&1984|c&63;u<128?o+="��":o+=String.fromCharCode(u),s+=3;continue}}if((a&240)===224&&s+6<i){const c=parseInt(r.slice(s+4,s+6),16),u=parseInt(r.slice(s+7,s+9),16);if((c&192)===128&&(u&192)===128){const f=a<<12&61440|c<<6&4032|u&63;f<2048||f>=55296&&f<=57343?o+="���":o+=String.fromCharCode(f),s+=6;continue}}if((a&248)===240&&s+9<i){const c=parseInt(r.slice(s+4,s+6),16),u=parseInt(r.slice(s+7,s+9),16),f=parseInt(r.slice(s+10,s+12),16);if((c&192)===128&&(u&192)===128&&(f&192)===128){let h=a<<18&1835008|c<<12&258048|u<<6&4032|f&63;h<65536||h>1114111?o+="����":(h-=65536,o+=String.fromCharCode(55296+(h>>10),56320+(h&1023))),s+=9;continue}}o+="�"}return o})}rr.defaultChars=";/?:@&=+$,#";rr.componentChars="";const Rc={};function Yb(e){let t=Rc[e];if(t)return t;t=Rc[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?t.push(r):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Zr(e,t,n){typeof t!="string"&&(n=t,t=Zr.defaultChars),typeof n>"u"&&(n=!0);const r=Yb(t);let o="";for(let s=0,i=e.length;s<i;s++){const a=e.charCodeAt(s);if(n&&a===37&&s+2<i&&/^[0-9a-f]{2}$/i.test(e.slice(s+1,s+3))){o+=e.slice(s,s+3),s+=2;continue}if(a<128){o+=r[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&s+1<i){const c=e.charCodeAt(s+1);if(c>=56320&&c<=57343){o+=encodeURIComponent(e[s]+e[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[s])}return o}Zr.defaultChars=";/?:@&=+$,-_.!~*'()#";Zr.componentChars="-_.!~*'()";function Ei(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function Oo(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const Ub=/^([a-z0-9.+-]+:)/i,Vb=/:[0-9]*$/,Zb=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Jb=["<",">",'"',"`"," ","\r",`
|
|
5
|
+
`," "],$b=["{","}","|","\\","^","`"].concat(Jb),Xb=["'"].concat($b),Dc=["%","/","?",";","#"].concat(Xb),Fc=["/","?","#"],qb=255,Bc=/^[+a-z0-9A-Z_-]{0,63}$/,ev=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,jc={javascript:!0,"javascript:":!0},Mc={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Si(e,t){if(e&&e instanceof Oo)return e;const n=new Oo;return n.parse(e,t),n}Oo.prototype.parse=function(e,t){let n,r,o,s=e;if(s=s.trim(),!t&&e.split("#").length===1){const u=Zb.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let i=Ub.exec(s);if(i&&(i=i[0],n=i.toLowerCase(),this.protocol=i,s=s.substr(i.length)),(t||i||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(i&&jc[i])&&(s=s.substr(2),this.slashes=!0)),!jc[i]&&(o||i&&!Mc[i])){let u=-1;for(let p=0;p<Fc.length;p++)r=s.indexOf(Fc[p]),r!==-1&&(u===-1||r<u)&&(u=r);let f,h;u===-1?h=s.lastIndexOf("@"):h=s.lastIndexOf("@",u),h!==-1&&(f=s.slice(0,h),s=s.slice(h+1),this.auth=f),u=-1;for(let p=0;p<Dc.length;p++)r=s.indexOf(Dc[p]),r!==-1&&(u===-1||r<u)&&(u=r);u===-1&&(u=s.length),s[u-1]===":"&&u--;const A=s.slice(0,u);s=s.slice(u),this.parseHost(A),this.hostname=this.hostname||"";const g=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!g){const p=this.hostname.split(/\./);for(let x=0,m=p.length;x<m;x++){const v=p[x];if(v&&!v.match(Bc)){let b="";for(let y=0,C=v.length;y<C;y++)v.charCodeAt(y)>127?b+="x":b+=v[y];if(!b.match(Bc)){const y=p.slice(0,x),C=p.slice(x+1),I=v.match(ev);I&&(y.push(I[1]),C.unshift(I[2])),C.length&&(s=C.join(".")+s),this.hostname=y.join(".");break}}}}this.hostname.length>qb&&(this.hostname=""),g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=s.indexOf("#");a!==-1&&(this.hash=s.substr(a),s=s.slice(0,a));const c=s.indexOf("?");return c!==-1&&(this.search=s.substr(c),s=s.slice(0,c)),s&&(this.pathname=s),Mc[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Oo.prototype.parseHost=function(e){let t=Vb.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const tv=Object.freeze(Object.defineProperty({__proto__:null,decode:rr,encode:Zr,format:Ei,parse:Si},Symbol.toStringTag,{value:"Module"})),Ff=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Bf=/[\0-\x1F\x7F-\x9F]/,nv=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Za=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014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uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,jf=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD803[\uDD8E\uDD8F\uDED1-\uDED8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA]/,Mf=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,rv=Object.freeze(Object.defineProperty({__proto__:null,Any:Ff,Cc:Bf,Cf:nv,P:Za,S:jf,Z:Mf},Symbol.toStringTag,{value:"Module"})),ov=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function sv(e){return e>=55296&&e<=57343||e>1114111?65533:ov.get(e)??e}function iv(e){const t=atob(e),n=t.length&-2,r=new Uint16Array(n/2);for(let o=0,s=0;o<n;o+=2){const i=t.charCodeAt(o),a=t.charCodeAt(o+1);r[s++]=i|a<<8}return r}const av=iv("QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlAD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TB75jAAFBYWYuaS5yAPIA4AJyAPIAjAdhAPAAeh5pAHMAAKD7IoABZHB0APgReS6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg");var yt;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.FLAG13=8192]="FLAG13",e[e.BRANCH_LENGTH=8064]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(yt||(yt={}));var qe;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(qe||(qe={}));const Pc=32;function Ri(e){return e>=qe.ZERO&&e<=qe.NINE}function lv(e){return e>=qe.UPPER_A&&e<=qe.UPPER_F||e>=qe.LOWER_A&&e<=qe.LOWER_F}function cv(e){return e>=qe.UPPER_A&&e<=qe.UPPER_Z||e>=qe.LOWER_A&&e<=qe.LOWER_Z||Ri(e)}function uv(e){return e===qe.EQUALS||cv(e)}var ft;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(ft||(ft={}));var An;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(An||(An={}));class dv{decodeTree;emitCodePoint;errors;constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r}state=ft.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=An.Strict;runConsumed=0;startEntity(t){this.decodeMode=t,this.state=ft.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(t,n){switch(this.state){case ft.EntityStart:return t.charCodeAt(n)===qe.NUM?(this.state=ft.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=ft.NamedEntity,this.stateNamedEntity(t,n));case ft.NumericStart:return this.stateNumericStart(t,n);case ft.NumericDecimal:return this.stateNumericDecimal(t,n);case ft.NumericHex:return this.stateNumericHex(t,n);case ft.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|Pc)===qe.LOWER_X?(this.state=ft.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=ft.NumericDecimal,this.stateNumericDecimal(t,n))}stateNumericHex(t,n){for(;n<t.length;){const r=t.charCodeAt(n);if(Ri(r)||lv(r)){const o=r<=qe.NINE?r-qe.ZERO:(r|Pc)-qe.LOWER_A+10;this.result=this.result*16+o,this.consumed++,n++}else return this.emitNumericEntity(r,3)}return-1}stateNumericDecimal(t,n){for(;n<t.length;){const r=t.charCodeAt(n);if(Ri(r))this.result=this.result*10+(r-qe.ZERO),this.consumed++,n++;else return this.emitNumericEntity(r,2)}return-1}emitNumericEntity(t,n){if(this.consumed<=n)return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===qe.SEMI)this.consumed+=1;else if(this.decodeMode===An.Strict)return 0;return this.emitCodePoint(sv(this.result),this.consumed),this.errors&&(t!==qe.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let o=r[this.treeIndex],s=(o&yt.VALUE_LENGTH)>>14;for(;n<t.length;){if(s===0&&(o&yt.FLAG13)!==0){const a=(o&yt.BRANCH_LENGTH)>>7;if(this.runConsumed===0){const c=o&yt.JUMP_TABLE;if(t.charCodeAt(n)!==c)return this.result===0?0:this.emitNotTerminatedNamedEntity();n++,this.excess++,this.runConsumed++}for(;this.runConsumed<a;){if(n>=t.length)return-1;const c=this.runConsumed-1,u=r[this.treeIndex+1+(c>>1)],f=c%2===0?u&255:u>>8&255;if(t.charCodeAt(n)!==f)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();n++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(a>>1),o=r[this.treeIndex],s=(o&yt.VALUE_LENGTH)>>14}if(n>=t.length)break;const i=t.charCodeAt(n);if(i===qe.SEMI&&s!==0&&(o&yt.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);if(this.treeIndex=pv(r,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===An.Attribute&&(s===0||uv(i))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],s=(o&yt.VALUE_LENGTH)>>14,s!==0){if(i===qe.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==An.Strict&&(o&yt.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}n++,this.excess++}return-1}emitNotTerminatedNamedEntity(){const{result:t,decodeTree:n}=this,r=(n[t]&yt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:o}=this;return this.emitCodePoint(n===1?o[t]&~(yt.VALUE_LENGTH|yt.FLAG13):o[t+1],r),n===3&&this.emitCodePoint(o[t+2],r),r}end(){switch(this.state){case ft.NamedEntity:return this.result!==0&&(this.decodeMode!==An.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ft.NumericDecimal:return this.emitNumericEntity(0,2);case ft.NumericHex:return this.emitNumericEntity(0,3);case ft.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ft.EntityStart:return 0}}}function fv(e){let t="";const n=new dv(e,r=>t+=String.fromCodePoint(r));return function(o,s){let i=0,a=0;for(;(a=o.indexOf("&",a))>=0;){t+=o.slice(i,a),n.startEntity(s);const u=n.write(o,a+1);if(u<0){i=a+n.end();break}i=a+u,a=u===0?i+1:i}const c=t+o.slice(i);return t="",c}}function pv(e,t,n,r){const o=(t&yt.BRANCH_LENGTH)>>7,s=t&yt.JUMP_TABLE;if(o===0)return s!==0&&r===s?n:-1;if(s){const u=r-s;return u<0||u>=o?-1:e[n+u]-1}const i=o+1>>1;let a=0,c=o-1;for(;a<=c;){const u=a+c>>>1,f=u>>1,A=e[n+f]>>(u&1)*8&255;if(A<r)a=u+1;else if(A>r)c=u-1;else return e[n+i+u]}return-1}const hv=fv(av);function Pf(e){return hv(e,An.Strict)}var gv=class{src_Any=Ff.source;src_Cc=Bf.source;src_Z=Mf.source;src_P=Za.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){const r=this.escapeRE(e),o=this.escapeRE(t),s=`(?:(?!${this.src_ZCc}|${r}|${o}).)`;let i=`${r}${s}{0,1000}${o}`;for(let a=2;a<=n;a++)i=`${r}(?:${s}|${i}){0,1000}${o}`;return i}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){const e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;const e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map(e=>this.escapeRE(e)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},Qs={validate:(e,t,n)=>{const r=n.re.get_http_validator();r.lastIndex=t;const o=r.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)},Av={"http:":Qs,"https:":Qs,"ftp:":Qs,"//":{validate:function(e,t,n){const r=n.re.get_relative_proto_validator();r.lastIndex=t;const o=r.exec(e);return o?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){const r=n.re.get_mailto_validator();r.lastIndex=t;const o=r.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)}},mv="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",xv="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function bv(){const e=xv.split("|");return mv.split("|").forEach(t=>{const n=t.indexOf(":"),r=t.slice(0,n);for(const o of t.slice(n+1))e.push(r+o)}),e}var vv={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:bv(),urlAuth:!1,maxLength:1e4},Tc=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,r){const o=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=o,this.text=o,this.url=o}},yv=class{__opts__;__schemas__;re;constructor(e={}){const{rebuilder:t,...n}=e;this.__opts__={...vv,...n},this.__schemas__={...Av},this.re=t||new gv,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{const n={normalize:(r,o)=>o.normalize(r),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){const r=this.re.get_fuzzy_mail_host_search(),o=this.re.get_mail_name_validator();for(r.lastIndex=0;(t=r.exec(e))!==null;){const s=e.slice(Math.max(0,t.index-65),t.index);if(o.test(s))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){const t=[],n=this.re.get_schema_search();let r,o,s,i,a,c,u=!1,f=!1,h=!1,A=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(r=this.re.get_fuzzy_link_search(),r.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(o=this.re.get_fuzzy_mail_host_search(),o.lastIndex=0,s=this.re.get_mail_name_validator());;){const g=Math.max(A-1,0);if(o&&s&&!h&&(!a||a.index<A))for(o.lastIndex<g&&(o.lastIndex=g);;){const b=o.exec(e);if(!b){h=!0,a=void 0;break}const y=s.exec(e.slice(Math.max(0,b.index-65),b.index));if(y){if(a={schema:"mailto:",index:b.index-y[1].length,lastIndex:b.index+b[0].length},a.index>=A)break;o.lastIndex<g&&(o.lastIndex=g)}}if(r&&!f&&(!i||i.index<A))for(r.lastIndex<g&&(r.lastIndex=g);;){const b=r.exec(e);if(!b){f=!0,i=void 0;break}if(i={schema:"",index:b.index+b[1].length,lastIndex:b.index+b[0].length},i.index>=A)break;r.lastIndex<g&&(r.lastIndex=g)}let p=a;(!p||i&&(i.index<p.index||i.index===p.index&&i.lastIndex>p.lastIndex))&&(p=i);let x;if(!u)for(;;){if(!c){n.lastIndex<g&&(n.lastIndex=g);const C=n.exec(e);if(!C){u=!0;break}c={schema:C[2],index:C.index+C[1].length,lastIndex:C.index+C[0].length}}if(c.index<A){c=void 0;continue}if(p&&c.index>p.index)break;const b=c;c=void 0;const y=this.testSchemaAt(e,b.schema,b.lastIndex);if(y){x={schema:b.schema,index:b.index,lastIndex:b.lastIndex+y};break}}let m=x;if((!m||a&&(a.index<m.index||a.index===m.index&&a.lastIndex>m.lastIndex))&&(m=a),(!m||i&&(i.index<m.index||i.index===m.index&&i.lastIndex>m.lastIndex))&&(m=i),!m)break;m===a?a=void 0:m===i&&(i=void 0);const v=new Tc(e,m.schema,m.index,m.lastIndex);v.schema?this.__schemas__[v.schema].normalize(v,this):this.normalize(v),t.push(v),A=m.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;const t=this.re.get_schema_at_start().exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const r=new Tc(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[r.schema].normalize(r,this),r}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}};const Zn=2147483647,Wt=36,Ja=1,Mr=26,Cv=38,Iv=700,Tf=72,Nf=128,_f="-",wv=/^xn--/,kv=/[^\0-\x7F]/,Ev=/[\x2E\u3002\uFF0E\uFF61]/g,Sv={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Gs=Wt-Ja,Qt=Math.floor,zs=String.fromCharCode;function pn(e){throw new RangeError(Sv[e])}function Rv(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}function Of(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(Ev,".");const o=e.split("."),s=Rv(o,t).join(".");return r+s}function Hf(e){const t=[];let n=0;const r=e.length;for(;n<r;){const o=e.charCodeAt(n++);if(o>=55296&&o<=56319&&n<r){const s=e.charCodeAt(n++);(s&64512)==56320?t.push(((o&1023)<<10)+(s&1023)+65536):(t.push(o),n--)}else t.push(o)}return t}const Dv=e=>String.fromCodePoint(...e),Fv=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Wt},Nc=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Lf=function(e,t,n){let r=0;for(e=n?Qt(e/Iv):e>>1,e+=Qt(e/t);e>Gs*Mr>>1;r+=Wt)e=Qt(e/Gs);return Qt(r+(Gs+1)*e/(e+Cv))},Kf=function(e){const t=[],n=e.length;let r=0,o=Nf,s=Tf,i=e.lastIndexOf(_f);i<0&&(i=0);for(let a=0;a<i;++a)e.charCodeAt(a)>=128&&pn("not-basic"),t.push(e.charCodeAt(a));for(let a=i>0?i+1:0;a<n;){const c=r;for(let f=1,h=Wt;;h+=Wt){a>=n&&pn("invalid-input");const A=Fv(e.charCodeAt(a++));A>=Wt&&pn("invalid-input"),A>Qt((Zn-r)/f)&&pn("overflow"),r+=A*f;const g=h<=s?Ja:h>=s+Mr?Mr:h-s;if(A<g)break;const p=Wt-g;f>Qt(Zn/p)&&pn("overflow"),f*=p}const u=t.length+1;s=Lf(r-c,u,c==0),Qt(r/u)>Zn-o&&pn("overflow"),o+=Qt(r/u),r%=u,t.splice(r++,0,o)}return String.fromCodePoint(...t)},Wf=function(e){const t=[];e=Hf(e);const n=e.length;let r=Nf,o=0,s=Tf;for(const c of e)c<128&&t.push(zs(c));const i=t.length;let a=i;for(i&&t.push(_f);a<n;){let c=Zn;for(const f of e)f>=r&&f<c&&(c=f);const u=a+1;c-r>Qt((Zn-o)/u)&&pn("overflow"),o+=(c-r)*u,r=c;for(const f of e)if(f<r&&++o>Zn&&pn("overflow"),f===r){let h=o;for(let A=Wt;;A+=Wt){const g=A<=s?Ja:A>=s+Mr?Mr:A-s;if(h<g)break;const p=h-g,x=Wt-g;t.push(zs(Nc(g+p%x,0))),h=Qt(p/x)}t.push(zs(Nc(h,0))),s=Lf(o,u,a===i),o=0,++a}++o,++r}return t.join("")},Bv=function(e){return Of(e,function(t){return wv.test(t)?Kf(t.slice(4).toLowerCase()):t})},jv=function(e){return Of(e,function(t){return kv.test(t)?"xn--"+Wf(t):t})},_c={version:"2.3.1",ucs2:{decode:Hf,encode:Dv},decode:Kf,encode:Wf,toASCII:jv,toUnicode:Bv};var Oc=Object.defineProperty,Qf=(e,t)=>{let n={};for(var r in e)Oc(n,r,{get:e[r],enumerable:!0});return Oc(n,Symbol.toStringTag,{value:"Module"}),n},Mv=Qf({arrayReplaceAt:()=>zf,asciiTrim:()=>bs,callable:()=>Gf,escapeHtml:()=>yn,escapeRE:()=>Qv,fromCodePoint:()=>Pr,isMdAsciiPunct:()=>_r,isPunctChar:()=>Uf,isPunctCharCode:()=>Nr,isSpace:()=>Ye,isValidEntityCode:()=>$a,isWhiteSpace:()=>Tr,lib:()=>Gv,normalizeReference:()=>xs,unescapeAll:()=>or,unescapeMd:()=>_v});function Gf(e){const t=function(...n){return Reflect.construct(e,n,new.target&&new.target!==t?new.target:e)};return Object.defineProperty(t,"name",{value:e.name}),Object.setPrototypeOf(t,e),t.prototype=e.prototype,t}function zf(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function $a(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Pr(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var Yf=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Pv=new RegExp(`${Yf.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Tv=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Nv(e,t){if(t.charCodeAt(0)===35&&Tv.test(t)){const r=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return $a(r)?Pr(r):e}const n=Pf(e);return n!==e?n:e}function _v(e){return e.indexOf("\\")<0?e:e.replace(Yf,"$1")}function or(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(Pv,function(t,n,r){return n||Nv(t,r)})}var Ov=/[&<>"]/,Hv=/[&<>"]/g,Lv={"&":"&","<":"<",">":">",'"':"""};function Kv(e){return Lv[e]}function yn(e){return Ov.test(e)?e.replace(Hv,Kv):e}var Wv=/[.?*+^$[\]\\(){}|-]/g;function Qv(e){return e.replace(Wv,"\\$&")}function Ye(e){switch(e){case 9:case 32:return!0}return!1}function Tr(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Uf(e){return Za.test(e)||jf.test(e)}function Nr(e){return Uf(Pr(e))}function _r(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function xs(e){return e=e.trim().replace(/\s+/g," "),e.toLowerCase().toUpperCase()}function Hc(e){return e===32||e===9||e===10||e===13}function bs(e){let t=0;for(;t<e.length&&Hc(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&Hc(e.charCodeAt(n));n--);return e.slice(t,n+1)}var Gv={mdurl:tv,ucmicro:rv};function zv(e,t,n){let r,o,s,i;const a=e.posMax,c=e.pos;for(e.pos=t+1,r=1;e.pos<a;){if(s=e.src.charCodeAt(e.pos),s===93&&(r--,r===0)){o=!0;break}if(i=e.pos,e.md.inline.skipToken(e),s===91){if(i===e.pos-1)r++;else if(n)return e.pos=c,-1}}let u=-1;return o&&(u=e.pos),e.pos=c,u}function Yv(e,t,n){let r,o=t;const s={ok:!1,pos:0,str:""};if(e.charCodeAt(o)===60){for(o++;o<n;){if(r=e.charCodeAt(o),r===10||r===60)return s;if(r===62)return s.pos=o+1,s.str=or(e.slice(t+1,o)),s.ok=!0,s;if(r===92&&o+1<n){o+=2;continue}o++}return s}let i=0;for(;o<n&&(r=e.charCodeAt(o),!(r===32||r<32||r===127));){if(r===92&&o+1<n){if(e.charCodeAt(o+1)===32){o++;continue}o+=2;continue}if(r===40&&(i++,i>32))return s;if(r===41){if(i===0)break;i--}o++}return t===o||i!==0||(s.str=or(e.slice(t,o)),s.pos=o,s.ok=!0),s}function Uv(e,t,n,r){let o,s=t;const i={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)i.str=r.str,i.marker=r.marker;else{if(s>=n)return i;let a=e.charCodeAt(s);if(a!==34&&a!==39&&a!==40)return i;t++,s++,a===40&&(a=41),i.marker=a}for(;s<n;){if(o=e.charCodeAt(s),o===i.marker)return i.pos=s+1,i.str+=or(e.slice(t,s)),i.ok=!0,i;if(o===40&&i.marker===41)return i;o===92&&s+1<n&&s++,s++}return i.can_continue=!0,i.str+=or(e.slice(t,s)),i}var Vv=Qf({parseLinkDestination:()=>Yv,parseLinkLabel:()=>zv,parseLinkTitle:()=>Uv});function Or(e){"@babel/helpers - typeof";return Or=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Or(e)}function Zv(e,t){if(Or(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Or(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jv(e){var t=Zv(e,"string");return Or(t)=="symbol"?t:t+""}function xe(e,t,n){return(t=Jv(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var jn=class{constructor(e,t,n){xe(this,"map",null),xe(this,"level",0),xe(this,"children",null),xe(this,"content",""),xe(this,"markup",""),xe(this,"info",""),xe(this,"block",!1),xe(this,"hidden",!1),this.type=e,this.tag=t,this.attrs=null,this.nesting=n,this.meta=null}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},Hr=class{constructor(){xe(this,"__rules__",[]),xe(this,"__cache__",null)}__find__(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1}__compile__(){const e=new Set;this.__rules__.forEach(t=>{t.enabled&&t.alt.forEach(n=>{n&&e.add(n)})}),this.__cache__=Object.create(null),this.__cache__[""]=[],this.__rules__.forEach(t=>{t.enabled&&this.__cache__[""].push(t.fn)}),e.forEach(t=>{this.__cache__[t]=[],this.__rules__.forEach(n=>{n.enabled&&n.alt.indexOf(t)>=0&&this.__cache__[t].push(n.fn)})})}at(e,t,n={}){const r=this.__find__(e);if(r===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__[r].fn=t,this.__rules__[r].alt=n.alt||[],this.__cache__=null}before(e,t,n,r={}){const o=this.__find__(e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(o,0,{name:t,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null}after(e,t,n,r={}){const o=this.__find__(e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null}push(e,t,n={}){this.__rules__.push({name:e,enabled:!0,fn:t,alt:n.alt||[]}),this.__cache__=null}enable(e,t=!1){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(r=>{const o=this.__find__(r);if(o<0){if(t)return;throw new Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[o].enabled=!0,n.push(r)}),this.__cache__=null,n}enableOnly(e,t=!1){Array.isArray(e)||(e=[e]),this.__rules__.forEach(n=>{n.enabled=!1}),this.enable(e,t)}disable(e,t=!1){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(r=>{const o=this.__find__(r);if(o<0){if(t)return;throw new Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[o].enabled=!1,n.push(r)}),this.__cache__=null,n}getRules(e){return this.__cache__||this.__compile__(),this.__cache__[e]||[]}},Vt={};Vt.code_inline=function(e,t,n,r,o){const s=e[t];return`<code${o.renderAttrs(s)}>${yn(s.content)}</code>`};Vt.code_block=function(e,t,n,r,o){const s=e[t];return`<pre${o.renderAttrs(s)}><code>${yn(e[t].content)}</code></pre>
|
|
6
|
+
`};Vt.fence=function(e,t,n,r,o){const s=e[t],i=s.info?or(s.info).trim():"";let a="",c="";if(i){const f=i.split(/(\s+)/g);a=f[0],c=f.slice(2).join("")}let u;if(n.highlight?u=n.highlight(s.content,a,c)||yn(s.content):u=yn(s.content),u.indexOf("<pre")===0)return u+`
|
|
7
|
+
`;if(i){const f=s.attrIndex("class"),h=s.attrs?s.attrs.slice():[];f<0?h.push(["class",`${n.langPrefix}${a}`]):(h[f]=[h[f][0],h[f][1]],h[f][1]+=` ${n.langPrefix}${a}`);const A={attrs:h};return`<pre><code${o.renderAttrs(A)}>${u}</code></pre>
|
|
7
8
|
`}return`<pre><code${o.renderAttrs(s)}>${u}</code></pre>
|
|
8
|
-
`};
|
|
9
|
+
`};Vt.image=function(e,t,n,r,o){const s=e[t];return s.attrs[s.attrIndex("alt")][1]=o.renderInlineAsText(s.children,n,r),o.renderToken(e,t,n)};Vt.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
|
|
9
10
|
`:`<br>
|
|
10
|
-
`};
|
|
11
|
+
`};Vt.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
11
12
|
`:`<br>
|
|
12
13
|
`:`
|
|
13
|
-
`};
|
|
14
|
+
`};Vt.text=function(e,t){return yn(e[t].content)};Vt.html_block=function(e,t){return e[t].content};Vt.html_inline=function(e,t){return e[t].content};var Vf=class{constructor(){xe(this,"rules",Object.assign({},Vt))}renderAttrs(e){let t,n,r;if(!e.attrs)return"";for(r="",t=0,n=e.attrs.length;t<n;t++)r+=` ${yn(e.attrs[t][0])}="${yn(String(e.attrs[t][1]))}"`;return r}renderToken(e,t,n){const r=e[t];let o="";if(r.hidden)return"";let s=t-1;for(;s>=0&&e[s].hidden&&e[s].nesting===0;)s--;r.block&&r.nesting!==-1&&s>=0&&e[s].hidden&&e[s].nesting===-1&&(o+=`
|
|
14
15
|
`),o+=(r.nesting===-1?"</":"<")+r.tag,o+=this.renderAttrs(r),r.nesting===0&&n.xhtmlOut&&(o+=" /");let i=!1;if(r.block&&(i=!0,r.nesting===1)){let a=t+1;for(;a<e.length&&e[a].hidden&&e[a].nesting===0;)a++;if(a<e.length){const c=e[a];(c.type==="inline"||c.hidden||c.nesting===-1&&c.tag===r.tag)&&(i=!1)}}return o+=i?`>
|
|
15
16
|
`:">",o}renderInline(e,t,n){let r="";const o=this.rules;for(let s=0,i=e.length;s<i;s++){const a=e[s].type;typeof o[a]<"u"?r+=o[a](e,s,t,n,this):r+=this.renderToken(e,s,t)}return r}renderInlineAsText(e,t,n){let r="";for(let o=0,s=e.length;o<s;o++)switch(e[o].type){case"text":case"code_inline":r+=e[o].content;break;case"image":r+=this.renderInlineAsText(e[o].children,t,n);break;case"html_inline":case"html_block":r+=e[o].content;break;case"softbreak":case"hardbreak":r+=`
|
|
16
|
-
`}return r}render(e,t,n){let r="";const o=this.rules;for(let s=0,i=e.length;s<i;s++){const a=e[s].type;a==="inline"?r+=this.renderInline(e[s].children,t,n):typeof o[a]<"u"?r+=o[a](e,s,t,n,this):r+=this.renderToken(e,s,t)}return r}},
|
|
17
|
-
`),t=t.replace(jv,"�"),e.src=t}function Pv(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function Tv(e){const t=e.tokens;let n=0;for(let r=0;r<t.length;r++)t[r].type!=="reference_definition"&&(r!==n&&(t[n]=t[r]),n++);t.length!==n&&(t.length=n)}function Nv(e){const t=e.tokens;for(let n=0,r=t.length;n<r;n++){const o=t[n];o.type==="inline"&&e.md.inline.parse(o.content,e.md,e.env,o.children)}}function _v(e){return/^<a[>\s]/i.test(e)}function Ov(e){return/^<\/a\s*>/i.test(e)}function Hv(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if(t[n].type!=="inline"||!e.md.linkify.test(t[n].content))continue;let o=t[n].children,s=0;for(let i=o.length-1;i>=0;i--){const a=o[i];if(a.type==="link_close"){for(i--;o[i].level!==a.level&&o[i].type!=="link_open";)i--;continue}if(a.type==="html_inline"&&(_v(a.content)&&s>0&&s--,Ov(a.content)&&s++),!(s>0)&&a.type==="text"&&e.md.linkify.test(a.content)){const c=a.content;let u=e.md.linkify.match(c);const f=[];let h=a.level,g=0;u.length>0&&u[0].index===0&&i>0&&o[i-1].type==="text_special"&&(u=u.slice(1));for(let A=0;A<u.length;A++){const p=u[A].url,m=e.md.normalizeLink(p);if(!e.md.validateLink(m))continue;let x=u[A].text;u[A].schema?u[A].schema==="mailto:"&&!/^mailto:/i.test(x)?x=e.md.normalizeLinkText(`mailto:${x}`).replace(/^mailto:/,""):x=e.md.normalizeLinkText(x):x=e.md.normalizeLinkText(`http://${x}`).replace(/^http:\/\//,"");const v=u[A].index;if(v>g){const w=new e.Token("text","",0);w.content=c.slice(g,v),w.level=h,f.push(w)}const b=new e.Token("link_open","a",1);b.attrs=[["href",m]],b.level=h++,b.markup="linkify",b.info="auto",f.push(b);const y=new e.Token("text","",0);y.content=x,y.level=h,f.push(y);const C=new e.Token("link_close","a",-1);C.level=--h,C.markup="linkify",C.info="auto",f.push(C),g=u[A].lastIndex}if(g<c.length){const A=new e.Token("text","",0);A.content=c.slice(g),A.level=h,f.push(A)}t[n].children=o=Bf(o,i,f)}}}}var Nf=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Lv=/\((c|tm|r)\)/i,Kv=/\((c|tm|r)\)/gi,Wv={c:"©",r:"®",tm:"™"};function Qv(e,t){return Wv[t.toLowerCase()]}function Gv(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&(r.content=r.content.replace(Kv,Qv)),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function Yv(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&Nf.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function zv(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(Lv.test(e.tokens[t].content)&&Gv(e.tokens[t].children),Nf.test(e.tokens[t].content)&&Yv(e.tokens[t].children))}var Uv=/['"]/,kc=/['"]/g,Ec="’";function ao(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function Vv(e,t){let n="",r=0;t.sort((o,s)=>o.pos-s.pos);for(let o=0;o<t.length;o++){const s=t[o];n+=e.slice(r,s.pos)+s.ch,r=s.pos+1}return n+e.slice(r)}function Zv(e,t){let n;const r=[],o={};for(let s=0;s<e.length;s++){const i=e[s],a=e[s].level;for(n=r.length-1;n>=0&&!(r[n].level<=a);n--);if(r.length=n+1,i.type!=="text")continue;const c=i.content;let u=0;const f=c.length;e:for(;u<f;){kc.lastIndex=u;const h=kc.exec(c);if(!h)break;let g=!0,A=!0;u=h.index+1;const p=h[0]==="'";let m=32;if(h.index-1>=0)m=c.charCodeAt(h.index-1);else for(n=s-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let x=32;if(u<f)x=c.charCodeAt(u);else for(n=s+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){x=e[n].content.charCodeAt(0);break}const v=Nr(m)||Tr(m),b=Nr(x)||Tr(x),y=Pr(m),C=Pr(x);if(C?g=!1:b&&(y||v||(g=!1)),y?A=!1:v&&(C||b||(A=!1)),x===34&&h[0]==='"'&&m>=48&&m<=57&&(A=g=!1),g&&A&&(g=v,A=b),!g&&!A){p&&ao(o,s,h.index,Ec);continue}if(A)for(n=r.length-1;n>=0;n--){let w=r[n];if(r[n].level<a)break;if(w.single===p&&r[n].level===a){w=r[n];let I,S;p?(I=t.md.options.quotes[2],S=t.md.options.quotes[3]):(I=t.md.options.quotes[0],S=t.md.options.quotes[1]),ao(o,s,h.index,S),ao(o,w.token,w.pos,I),r.length=n;continue e}}g?r.push({token:s,pos:h.index,single:p,level:a}):A&&p&&ao(o,s,h.index,Ec)}}Object.keys(o).forEach(function(s){const i=Number(s);e[i].content=Vv(e[i].content,o[s])})}function Jv(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!Uv.test(e.tokens[t].content)||Zv(e.tokens[t].children,e)}function $v(e){let t,n;const r=e.length;for(t=0;t<r;t++)e[t].type==="text_special"&&(e[t].type="text");for(t=n=0;t<r;t++)e[t].type==="text"&&t+1<r&&e[t+1].type==="text"?e[t+1].content=e[t].content+e[t+1].content:(t!==n&&(e[n]=e[t]),n++);t!==n&&(e.length=n)}function Xv(e){let t,n;const r=e.tokens,o=r.length;for(let s=0;s<o;s++){if(r[s].type!=="inline")continue;const i=r[s].children,a=i.length;for(t=0;t<a;t++)i[t].type==="text_special"&&(i[t].type="text"),i[t].children&&$v(i[t].children);for(t=n=0;t<a;t++)i[t].type==="text"&&t+1<a&&i[t+1].type==="text"?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}var _s=[["normalize",Mv],["block",Pv],["strip_references",Tv],["inline",Nv],["linkify",Hv],["replacements",zv],["smartquotes",Jv],["text_join",Xv]],_f=class{constructor(){xe(this,"ruler",new Or),xe(this,"State",Tf);for(let e=0;e<_s.length;e++)this.ruler.push(_s[e][0],_s[e][1])}process(e){const t=this.ruler.getRules("");for(let n=0,r=t.length;n<r;n++)t[n](e)}},Of=class{constructor(e,t,n,r){xe(this,"bMarks",[]),xe(this,"eMarks",[]),xe(this,"tShift",[]),xe(this,"sCount",[]),xe(this,"bsCount",[]),xe(this,"blkIndent",0),xe(this,"line",0),xe(this,"lineMax",0),xe(this,"tight",!1),xe(this,"listIndent",-1),xe(this,"parentType","root"),xe(this,"level",0),xe(this,"Token",Fn),this.src=e,this.md=t,this.env=n,this.tokens=r;const o=this.src;for(let s=0,i=0,a=0,c=0,u=o.length,f=!1;i<u;i++){const h=o.charCodeAt(i);if(!f)if(Ve(h)){a++,h===9?c+=4-c%4:c++;continue}else f=!0;(h===10||i===u-1)&&(h!==10&&i++,this.bMarks.push(s),this.eMarks.push(i),this.tShift.push(a),this.sCount.push(c),this.bsCount.push(0),f=!1,a=0,c=0,s=i+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){const r=new Fn(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e}skipSpaces(e){for(let t=this.src.length;e<t&&Ve(this.src.charCodeAt(e));e++);return e}skipSpacesBack(e,t){if(e<=t)return e;for(;e>t;)if(!Ve(this.src.charCodeAt(--e)))return e+1;return e}skipChars(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e}getLines(e,t,n,r){if(e>=t)return"";const o=new Array(t-e);for(let s=0,i=e;i<t;i++,s++){let a=0;const c=this.bMarks[i];let u=c,f;for(i+1<t||r?f=this.eMarks[i]+1:f=this.eMarks[i];u<f&&a<n;){const h=this.src.charCodeAt(u);if(Ve(h))h===9?a+=4-(a+this.bsCount[i])%4:a++;else if(u-c<this.tShift[i])a++;else break;u++}a>n?o[s]=new Array(a-n+1).join(" ")+this.src.slice(u,f):o[s]=this.src.slice(u,f)}return o.join("")}},qv=65536;function Os(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function Sc(e){const t=[],n=e.length;let r=0,o=e.charCodeAt(r),s=!1,i=0,a="";for(;r<n;)o===124&&(s?(a+=e.substring(i,r-1),i=r):(t.push(a+e.substring(i,r)),a="",i=r+1)),s=o===92,r++,o=e.charCodeAt(r);return t.push(a+e.substring(i)),t}function ey(e,t,n,r){if(t+2>n)return!1;let o=t+1;if(e.sCount[o]<e.blkIndent||e.sCount[o]-e.blkIndent>=4)return!1;let s=e.bMarks[o]+e.tShift[o];if(s>=e.eMarks[o])return!1;const i=e.src.charCodeAt(s++);if(i!==124&&i!==45&&i!==58||s>=e.eMarks[o])return!1;const a=e.src.charCodeAt(s++);if(a!==124&&a!==45&&a!==58&&!Ve(a)||i===45&&Ve(a))return!1;for(;s<e.eMarks[o];){const C=e.src.charCodeAt(s);if(C!==124&&C!==45&&C!==58&&!Ve(C))return!1;s++}let c=Os(e,t+1),u=c.split("|");const f=[];for(let C=0;C<u.length;C++){const w=u[C].trim();if(!w){if(C===0||C===u.length-1)continue;return!1}if(!/^:?-+:?$/.test(w))return!1;w.charCodeAt(w.length-1)===58?f.push(w.charCodeAt(0)===58?"center":"right"):w.charCodeAt(0)===58?f.push("left"):f.push("")}if(c=Os(e,t).trim(),c.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;u=Sc(c),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const h=u.length;if(h===0||h!==f.length)return!1;if(r)return!0;const g=e.parentType;e.parentType="table";const A=e.md.block.ruler.getRules("blockquote"),p=e.push("table_open","table",1),m=[t,0];p.map=m;const x=e.push("thead_open","thead",1);x.map=[t,t+1];const v=e.push("tr_open","tr",1);v.map=[t,t+1];for(let C=0;C<u.length;C++){const w=e.push("th_open","th",1);f[C]&&(w.attrs=[["style",`text-align:${f[C]}`]]);const I=e.push("inline","",0);I.content=u[C].trim(),I.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let b,y=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let C=!1;for(let I=0,S=A.length;I<S;I++)if(A[I](e,o,n,!0)){C=!0;break}if(C||(c=Os(e,o).trim(),!c)||e.sCount[o]-e.blkIndent>=4||(u=Sc(c),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),y+=h-u.length,y>qv))break;if(o===t+2){const I=e.push("tbody_open","tbody",1);I.map=b=[t+2,0]}const w=e.push("tr_open","tr",1);w.map=[o,o+1];for(let I=0;I<h;I++){const S=e.push("td_open","td",1);f[I]&&(S.attrs=[["style",`text-align:${f[I]}`]]);const R=e.push("inline","",0);R.content=u[I]?u[I].trim():"",R.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return b&&(e.push("tbody_close","tbody",-1),b[1]=o),e.push("table_close","table",-1),m[1]=o,e.parentType=g,e.line=o,!0}function ty(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,o=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,o=r;continue}break}e.line=o;const s=e.push("code_block","code",0);return s.content=e.getLines(t,o,4+e.blkIndent,!1)+`
|
|
18
|
-
`,s.map=[t,e.line],!0}function ny(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>s)return!1;const i=e.src.charCodeAt(o);if(i!==126&&i!==96)return!1;let a=o;o=e.skipChars(o,i);let c=o-a;if(c<3)return!1;const u=e.src.slice(a,o),f=e.src.slice(o,s);if(i===96&&f.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;let h=t,g=!1;for(;h++,!(h>=n||(o=a=e.bMarks[h]+e.tShift[h],s=e.eMarks[h],o<s&&e.sCount[h]<e.blkIndent));)if(e.src.charCodeAt(o)===i&&!(e.sCount[h]-e.blkIndent>=4)&&(o=e.skipChars(o,i),!(o-a<c)&&(o=e.skipSpaces(o),!(o<s)))){g=!0;break}c=e.sCount[t],e.line=h+(g?1:0);const A=e.push("fence","code",0);return A.info=f,A.content=e.getLines(t+1,h,c,!0),A.markup=u,A.map=[t,e.line],!0}function ry(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];const i=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==62)return!1;if(r)return!0;const a=[],c=[],u=[],f=[],h=e.md.block.ruler.getRules("blockquote"),g=e.parentType;e.parentType="blockquote";let A=!1,p;for(p=t;p<n;p++){const y=e.sCount[p]<e.blkIndent;if(o=e.bMarks[p]+e.tShift[p],s=e.eMarks[p],o>=s)break;if(e.src.charCodeAt(o++)===62&&!y){let w=e.sCount[p]+1,I,S;e.src.charCodeAt(o)===32?(o++,w++,S=!1,I=!0):e.src.charCodeAt(o)===9?(I=!0,(e.bsCount[p]+w)%4===3?(o++,w++,S=!1):S=!0):I=!1;let R=w;for(a.push(e.bMarks[p]),e.bMarks[p]=o;o<s;){const E=e.src.charCodeAt(o);if(Ve(E))E===9?R+=4-(R+e.bsCount[p]+(S?1:0))%4:R++;else break;o++}A=o>=s,c.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(I?1:0),u.push(e.sCount[p]),e.sCount[p]=R-w,f.push(e.tShift[p]),e.tShift[p]=o-e.bMarks[p];continue}if(A)break;let C=!1;for(let w=0,I=h.length;w<I;w++)if(h[w](e,p,n,!0)){C=!0;break}if(C){e.lineMax=p,e.blkIndent!==0&&(a.push(e.bMarks[p]),c.push(e.bsCount[p]),f.push(e.tShift[p]),u.push(e.sCount[p]),e.sCount[p]-=e.blkIndent);break}a.push(e.bMarks[p]),c.push(e.bsCount[p]),f.push(e.tShift[p]),u.push(e.sCount[p]),e.sCount[p]=-1}const m=e.blkIndent;e.blkIndent=0;const x=e.push("blockquote_open","blockquote",1);x.markup=">";const v=[t,0];x.map=v,e.md.block.tokenize(e,t,p);const b=e.push("blockquote_close","blockquote",-1);b.markup=">",e.lineMax=i,e.parentType=g,v[1]=e.line;for(let y=0;y<f.length;y++)e.bMarks[y+t]=a[y],e.tShift[y+t]=f[y],e.sCount[y+t]=u[y],e.bsCount[y+t]=c[y];return e.blkIndent=m,!0}function oy(e,t,n,r){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.bMarks[t]+e.tShift[t];const i=e.src.charCodeAt(s++);if(i!==42&&i!==45&&i!==95)return!1;let a=1;for(;s<o;){const u=e.src.charCodeAt(s++);if(u!==i&&!Ve(u))return!1;u===i&&a++}if(a<3)return!1;if(r)return!0;e.line=t+1;const c=e.push("hr","hr",0);return c.map=[t,e.line],c.markup=Array(a+1).join(String.fromCharCode(i)),!0}function Rc(e,t){const n=e.eMarks[t];let r=e.bMarks[t]+e.tShift[t];const o=e.src.charCodeAt(r++);return o!==42&&o!==45&&o!==43||r<n&&!Ve(e.src.charCodeAt(r))?-1:r}function Dc(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];let o=n;if(o+1>=r)return-1;let s=e.src.charCodeAt(o++);if(s<48||s>57)return-1;for(;;){if(o>=r)return-1;if(s=e.src.charCodeAt(o++),s>=48&&s<=57){if(o-n>=10)return-1;continue}if(s===41||s===46)break;return-1}return o<r&&(s=e.src.charCodeAt(o),!Ve(s))?-1:o}function sy(e,t){const n=e.level+2;for(let r=t+2,o=e.tokens.length-2;r<o;r++)e.tokens[r].level===n&&e.tokens[r].type==="paragraph_open"&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function iy(e,t,n,r){let o,s,i,a,c=t,u=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let f=!1;r&&e.parentType==="paragraph"&&e.sCount[c]>=e.blkIndent&&(f=!0);let h,g,A;if((A=Dc(e,c))>=0){if(h=!0,i=e.bMarks[c]+e.tShift[c],g=Number(e.src.slice(i,A-1)),f&&g!==1)return!1}else if((A=Rc(e,c))>=0)h=!1;else return!1;if(f&&e.skipSpaces(A)>=e.eMarks[c])return!1;if(r)return!0;const p=e.src.charCodeAt(A-1),m=e.tokens.length;h?(a=e.push("ordered_list_open","ol",1),g!==1&&(a.attrs=[["start",g]])):a=e.push("bullet_list_open","ul",1);const x=[c,0];a.map=x,a.markup=String.fromCharCode(p);let v=!1;const b=e.md.block.ruler.getRules("list"),y=e.parentType;for(e.parentType="list";c<n;){s=A,o=e.eMarks[c];const C=e.sCount[c]+A-(e.bMarks[c]+e.tShift[c]);let w=C;for(;s<o;){const D=e.src.charCodeAt(s);if(D===9)w+=4-(w+e.bsCount[c])%4;else if(D===32)w++;else break;s++}const I=s;let S;I>=o?S=1:S=w-C,S>4&&(S=1);const R=C+S;a=e.push("list_item_open","li",1),a.markup=String.fromCharCode(p);const E=[c,0];a.map=E,h&&(a.info=e.src.slice(i,A-1));const k=e.tight,F=e.tShift[c],T=e.sCount[c],N=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=R,e.tight=!0,e.tShift[c]=I-e.bMarks[c],e.sCount[c]=w,I>=o&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n),(!e.tight||v)&&(u=!1),v=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=N,e.tShift[c]=F,e.sCount[c]=T,e.tight=k,a=e.push("list_item_close","li",-1),a.markup=String.fromCharCode(p),c=e.line,E[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let M=!1;for(let D=0,L=b.length;D<L;D++)if(b[D](e,c,n,!0)){M=!0;break}if(M)break;if(h){if(A=Dc(e,c),A<0)break;i=e.bMarks[c]+e.tShift[c]}else if(A=Rc(e,c),A<0)break;if(p!==e.src.charCodeAt(A-1))break}return h?a=e.push("ordered_list_close","ol",-1):a=e.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(p),x[1]=c,e.line=c,e.parentType=y,u&&sy(e,m),!0}function ay(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t],i=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==91)return!1;function a(C){const w=e.lineMax;if(C>=w||e.isEmpty(C))return null;let I=!1;if(e.sCount[C]-e.blkIndent>3&&(I=!0),e.sCount[C]<0&&(I=!0),!I){const E=e.md.block.ruler.getRules("reference"),k=e.parentType;e.parentType="reference";let F=!1;for(let T=0,N=E.length;T<N;T++)if(E[T](e,C,w,!0)){F=!0;break}if(e.parentType=k,F)return null}const S=e.bMarks[C]+e.tShift[C],R=e.eMarks[C];return e.src.slice(S,R+1)}let c=e.src.slice(o,s+1);s=c.length;let u=-1;for(o=1;o<s;o++){const C=c.charCodeAt(o);if(C===91)return!1;if(C===93){u=o;break}else if(C===10){const w=a(i);w!==null&&(c+=w,s=c.length,i++)}else if(C===92&&(o++,o<s&&c.charCodeAt(o)===10)){const w=a(i);w!==null&&(c+=w,s=c.length,i++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(o=u+2;o<s;o++){const C=c.charCodeAt(o);if(C===10){const w=a(i);w!==null&&(c+=w,s=c.length,i++)}else if(!Ve(C))break}const f=e.md.helpers.parseLinkDestination(c,o,s);if(!f.ok)return!1;const h=e.md.normalizeLink(f.str);if(!e.md.validateLink(h))return!1;o=f.pos;const g=o,A=i,p=o;for(;o<s;o++){const C=c.charCodeAt(o);if(C===10){const w=a(i);w!==null&&(c+=w,s=c.length,i++)}else if(!Ve(C))break}let m=e.md.helpers.parseLinkTitle(c,o,s);for(;m.can_continue;){const C=a(i);if(C===null)break;c+=C,o=s,s=c.length,i++,m=e.md.helpers.parseLinkTitle(c,o,s,m)}let x;for(o<s&&p!==o&&m.ok?(x=m.str,o=m.pos):(x="",o=g,i=A);o<s&&Ve(c.charCodeAt(o));)o++;if(o<s&&c.charCodeAt(o)!==10&&x)for(x="",o=g,i=A;o<s&&Ve(c.charCodeAt(o));)o++;if(o<s&&c.charCodeAt(o)!==10)return!1;const v=hs(c.slice(1,u));if(!v)return!1;if(r)return!0;typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[v]>"u"&&(e.env.references[v]={title:x,href:h});const b=e.push("reference_definition","",0);b.map=[t,i],b.hidden=!0;const y=Object.create(null);return y.label=v,b.meta=y,e.line=i,!0}var ly=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Hf=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,Lf="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",cy=new RegExp(`^(?:${Hf}|${Lf}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),uy=new RegExp(`^(?:${Hf}|${Lf})`),En=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Za-z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp(`^</?(${ly.join("|")})(?=(\\s|/?>|$))`,"i"),/^$/,!0],[new RegExp(`${uy.source}\\s*$`),/^$/,!1]];function dy(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let i=e.src.slice(o,s),a=0;for(;a<En.length&&!En[a][0].test(i);a++);if(a===En.length)return!1;if(r)return En[a][2];let c=t+1;const u=En[a][1].test("");if(!En[a][1].test(i)){for(;c<n&&!(e.sCount[c]<e.blkIndent&&(u||!e.isEmpty(c)));c++)if(o=e.bMarks[c]+e.tShift[c],s=e.eMarks[c],i=e.src.slice(o,s),En[a][1].test(i)){i.length!==0&&c++;break}}e.line=c;const f=e.push("html_block","",0);return f.map=[t,c],f.content=e.getLines(t,c,e.blkIndent,!0),!0}function fy(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.src.charCodeAt(o);if(i!==35||o>=s)return!1;let a=1;for(i=e.src.charCodeAt(++o);i===35&&o<s&&a<=6;)a++,i=e.src.charCodeAt(++o);if(a>6||o<s&&!Ve(i))return!1;if(r)return!0;s=e.skipSpacesBack(s,o);const c=e.skipCharsBack(s,35,o);c>o&&Ve(e.src.charCodeAt(c-1))&&(s=c),e.line=t+1;const u=e.push("heading_open",`h${a}`,1);u.markup="########".slice(0,a),u.map=[t,e.line];const f=e.push("inline","",0);f.content=As(e.src.slice(o,s)),f.map=[t,e.line],f.children=[];const h=e.push("heading_close",`h${a}`,-1);return h.markup="########".slice(0,a),!0}function py(e,t,n){const r=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const o=e.parentType;e.parentType="paragraph";let s=0,i,a=t+1;for(;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3)continue;if(e.sCount[a]>=e.blkIndent){let A=e.bMarks[a]+e.tShift[a];const p=e.eMarks[a];if(A<p&&(i=e.src.charCodeAt(A),(i===45||i===61)&&(A=e.skipChars(A,i),A=e.skipSpaces(A),A>=p))){s=i===61?1:2;break}}if(e.sCount[a]<0)continue;let g=!1;for(let A=0,p=r.length;A<p;A++)if(r[A](e,a,n,!0)){g=!0;break}if(g)break}if(!s)return e.parentType=o,!1;const c=As(e.getLines(t,a,e.blkIndent,!1));e.line=a+1;const u=e.push("heading_open",`h${s}`,1);u.markup=String.fromCharCode(i),u.map=[t,e.line];const f=e.push("inline","",0);f.content=c,f.map=[t,e.line-1],f.children=[];const h=e.push("heading_close",`h${s}`,-1);return h.markup=String.fromCharCode(i),e.parentType=o,!0}function hy(e,t,n){const r=e.md.block.ruler.getRules("paragraph"),o=e.parentType;let s=t+1;for(e.parentType="paragraph";s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3||e.sCount[s]<0)continue;let u=!1;for(let f=0,h=r.length;f<h;f++)if(r[f](e,s,n,!0)){u=!0;break}if(u)break}const i=As(e.getLines(t,s,e.blkIndent,!1));e.line=s;const a=e.push("paragraph_open","p",1);a.map=[t,e.line];const c=e.push("inline","",0);return c.content=i,c.map=[t,e.line],c.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}var lo=[["table",ey,["paragraph","reference"]],["code",ty],["fence",ny,["paragraph","reference","blockquote","list"]],["blockquote",ry,["paragraph","reference","blockquote","list"]],["hr",oy,["paragraph","reference","blockquote","list"]],["list",iy,["paragraph","reference","blockquote"]],["reference",ay],["html_block",dy,["paragraph","reference","blockquote"]],["heading",fy,["paragraph","reference","blockquote"]],["lheading",py],["paragraph",hy]],Kf=class{constructor(){xe(this,"ruler",new Or),xe(this,"State",Of);for(let e=0;e<lo.length;e++)this.ruler.push(lo[e][0],lo[e][1],{alt:(lo[e][2]||[]).slice()})}tokenize(e,t,n){const r=this.ruler.getRules(""),o=r.length,s=e.md.options.maxNesting;let i=t,a=!1;for(;i<n&&(e.line=i=e.skipEmptyLines(i),!(i>=n||e.sCount[i]<e.blkIndent));){if(e.level>=s){e.line=n;break}const c=e.line;let u=!1;for(let f=0;f<o;f++)if(u=r[f](e,i,n,!1),u){if(c>=e.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),i=e.line,i<n&&e.isEmpty(i)&&(a=!0,i++,e.line=i)}}parse(e,t,n,r){if(!e)return;const o=new this.State(e,t,n,r);this.tokenize(o,o.line,o.lineMax)}},Wf=class{constructor(e,t,n,r){xe(this,"pos",0),xe(this,"level",0),xe(this,"pending",""),xe(this,"pendingLevel",0),xe(this,"cache",{}),xe(this,"backticks",{}),xe(this,"backticksScanned",!1),xe(this,"linkLevel",0),xe(this,"delimiters",[]),xe(this,"_prev_delimiters",[]),xe(this,"Token",Fn),this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.posMax=this.src.length}pushPending(){const e=new Fn("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}push(e,t,n){this.pending&&this.pushPending();const r=new Fn(e,t,n);let o;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(o),r}scanDelims(e,t){const n=this.posMax,r=this.src.charCodeAt(e);let o;if(e===0)o=32;else if(e===1)o=this.src.charCodeAt(0),(o&63488)===55296&&(o=65533);else if(o=this.src.charCodeAt(e-1),(o&64512)===56320){const p=this.src.charCodeAt(e-2);o=(p&64512)===55296?65536+(p-55296<<10)+(o-56320):65533}else(o&64512)===55296&&(o=65533);let s=e;for(;s<n&&this.src.charCodeAt(s)===r;)s++;const i=s-e;let a=s<n?this.src.charCodeAt(s):32;if((a&64512)===55296){const p=this.src.charCodeAt(s+1);a=(p&64512)===56320?65536+(a-55296<<10)+(p-56320):65533}else(a&64512)===56320&&(a=65533);const c=Nr(o)||Tr(o),u=Nr(a)||Tr(a),f=Pr(o),h=Pr(a),g=!h&&(!u||f||c),A=!f&&(!c||h||u);return{can_open:g&&(t||!A||c),can_close:A&&(t||!g||u),length:i}}};function Ay(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function gy(e,t){let n=e.pos;for(;n<e.posMax&&!Ay(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}var my=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function xy(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=e.pending.match(my);if(!o)return!1;const s=o[1],i=e.md.linkify.matchAtStart(e.src.slice(n-s.length));if(!i)return!1;let a=i.url;if(a.length<=s.length)return!1;let c=a.length;for(;c>0&&a.charCodeAt(c-1)===42;)c--;c!==a.length&&(a=a.slice(0,c));const u=e.md.normalizeLink(a);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-s.length);const f=e.push("link_open","a",1);f.attrs=[["href",u]],f.markup="linkify",f.info="auto";const h=e.push("text","",0);h.content=e.md.normalizeLinkText(a);const g=e.push("link_close","a",-1);g.markup="linkify",g.info="auto"}return e.pos+=a.length-s.length,!0}function by(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const r=e.pending.length-1,o=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let s=r-1;for(;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<o&&Ve(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var Wa=[];for(let e=0;e<256;e++)Wa.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){Wa[e.charCodeAt(0)]=1});function vy(e,t){let n=e.pos;const r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let o=e.src.charCodeAt(n);if(o===10){for(t||e.push("hardbreak","br",0),n++;n<r&&(o=e.src.charCodeAt(n),!!Ve(o));)n++;return e.pos=n,!0}if(o===32){if(!t){const a=e.push("text_special","",0);a.content="\\",a.markup="\\",a.info="escape"}return e.pos=n,!0}let s=e.src[n];if(o>=55296&&o<=56319&&n+1<r){const a=e.src.charCodeAt(n+1);a>=56320&&a<=57343&&(s+=e.src[n+1],n++)}const i="\\"+s;if(!t){const a=e.push("text_special","",0);o<256&&Wa[o]!==0?a.content=s:a.content=i,a.markup=i,a.info="escape"}return e.pos=n+1,!0}function yy(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const r=n;n++;const o=e.posMax;for(;n<o&&e.src.charCodeAt(n)===96;)n++;const s=e.src.slice(r,n),i=s.length;if(e.backticksScanned&&(e.backticks[i]||0)<=r)return t||(e.pending+=s),e.pos+=i,!0;let a=n,c;for(;(c=e.src.indexOf("`",a))!==-1;){for(a=c+1;a<o&&e.src.charCodeAt(a)===96;)a++;const u=a-c;if(u===i){if(!t){const f=e.push("code_inline","code",0);f.markup=s,f.content=e.src.slice(n,c).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=s),e.pos+=i,!0}function Cy(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;const o=e.scanDelims(e.pos,!0);let s=o.length;const i=String.fromCharCode(r);if(s<2)return!1;let a;s%2&&(a=e.push("text","",0),a.content=i,s--);for(let c=0;c<s;c+=2)a=e.push("text","",0),a.content=i+i,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0}function Fc(e,t){let n;const r=[],o=t.length;for(let s=0;s<o;s++){const i=t[s];if(i.marker!==126||i.end===-1)continue;const a=t[i.end];n=e.tokens[i.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[a.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[a.token-1].type==="text"&&e.tokens[a.token-1].content==="~"&&r.push(a.token-1)}for(;r.length;){const s=r.pop();let i=s+1;for(;i<e.tokens.length&&e.tokens[i].type==="s_close";)i++;i--,s!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[s],e.tokens[s]=n)}}function Iy(e){const t=e.tokens_meta,n=e.tokens_meta.length;Fc(e,e.delimiters);for(let o=0;o<n;o++){var r;const s=(r=t[o])===null||r===void 0?void 0:r.delimiters;s&&Fc(e,s)}}var Qf={tokenize:Cy,postProcess:Iy};function wy(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;const o=e.scanDelims(e.pos,r===42);for(let s=0;s<o.length;s++){const i=e.push("text","",0);i.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:o.length,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return e.pos+=o.length,!0}function Bc(e,t){const n=t.length;for(let r=n-1;r>=0;r--){const o=t[r];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;const s=t[o.end],i=r>0&&t[r-1].end===o.end+1&&t[r-1].marker===o.marker&&t[r-1].token===o.token-1&&t[o.end+1].token===s.token+1,a=String.fromCharCode(o.marker),c=e.tokens[o.token];c.type=i?"strong_open":"em_open",c.tag=i?"strong":"em",c.nesting=1,c.markup=i?a+a:a,c.content="";const u=e.tokens[s.token];u.type=i?"strong_close":"em_close",u.tag=i?"strong":"em",u.nesting=-1,u.markup=i?a+a:a,u.content="",i&&(e.tokens[t[r-1].token].content="",e.tokens[t[o.end+1].token].content="",r--)}}function ky(e){const t=e.tokens_meta,n=e.tokens_meta.length;Bc(e,e.delimiters);for(let o=0;o<n;o++){var r;const s=(r=t[o])===null||r===void 0?void 0:r.delimiters;s&&Bc(e,s)}}var Gf={tokenize:wy,postProcess:ky};function Ey(e,t){let n,r,o,s,i="",a="",c=e.pos,u=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const f=e.pos,h=e.posMax,g=e.pos+1,A=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(A<0)return!1;let p=A+1;if(p<h&&e.src.charCodeAt(p)===40){for(u=!1,p++;p<h&&(n=e.src.charCodeAt(p),!(!Ve(n)&&n!==10));p++);if(p>=h)return!1;if(c=p,o=e.md.helpers.parseLinkDestination(e.src,p,e.posMax),o.ok){for(i=e.md.normalizeLink(o.str),e.md.validateLink(i)?p=o.pos:i="",c=p;p<h&&(n=e.src.charCodeAt(p),!(!Ve(n)&&n!==10));p++);if(o=e.md.helpers.parseLinkTitle(e.src,p,e.posMax),p<h&&c!==p&&o.ok)for(a=o.str,p=o.pos;p<h&&(n=e.src.charCodeAt(p),!(!Ve(n)&&n!==10));p++);}(p>=h||e.src.charCodeAt(p)!==41)&&(u=!0),p++}if(u){if(typeof e.env.references>"u")return!1;if(p<h&&e.src.charCodeAt(p)===91?(c=p+1,p=e.md.helpers.parseLinkLabel(e,p),p>=0?r=e.src.slice(c,p++):p=A+1):p=A+1,r||(r=e.src.slice(g,A)),r=hs(r),s=e.env.references[r],!s)return e.pos=f,!1;i=s.href,a=s.title}if(!t){e.pos=g,e.posMax=A;const m=e.push("link_open","a",1),x=[["href",i]];if(m.attrs=x,a&&x.push(["title",a]),r){const v=Object.create(null);v.label=r,m.meta=v}e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=h,!0}function Sy(e,t){let n,r,o,s,i,a,c,u,f="";const h=e.pos,g=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const A=e.pos+2,p=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(p<0)return!1;if(s=p+1,s<g&&e.src.charCodeAt(s)===40){for(s++;s<g&&(n=e.src.charCodeAt(s),!(!Ve(n)&&n!==10));s++);if(s>=g)return!1;for(u=s,a=e.md.helpers.parseLinkDestination(e.src,s,e.posMax),a.ok&&(f=e.md.normalizeLink(a.str),e.md.validateLink(f)?s=a.pos:f=""),u=s;s<g&&(n=e.src.charCodeAt(s),!(!Ve(n)&&n!==10));s++);if(a=e.md.helpers.parseLinkTitle(e.src,s,e.posMax),s<g&&u!==s&&a.ok)for(c=a.str,s=a.pos;s<g&&(n=e.src.charCodeAt(s),!(!Ve(n)&&n!==10));s++);else c="";if(s>=g||e.src.charCodeAt(s)!==41)return e.pos=h,!1;s++}else{if(typeof e.env.references>"u")return!1;if(s<g&&e.src.charCodeAt(s)===91?(u=s+1,s=e.md.helpers.parseLinkLabel(e,s),s>=0?o=e.src.slice(u,s++):s=p+1):s=p+1,o||(o=e.src.slice(A,p)),o=hs(o),i=e.env.references[o],!i)return e.pos=h,!1;f=i.href,c=i.title}if(!t){r=e.src.slice(A,p);const m=[];e.md.inline.parse(r,e.md,e.env,m);const x=e.push("image","img",0),v=[["src",f],["alt",""]];if(x.attrs=v,x.children=m,x.content=r,c&&v.push(["title",c]),o){const b=Object.create(null);b.label=o,x.meta=b}}return e.pos=s,e.posMax=g,!0}var Ry=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,Dy=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Fy(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const r=e.pos,o=e.posMax;for(;;){if(++n>=o)return!1;const i=e.src.charCodeAt(n);if(i===60)return!1;if(i===62)break}const s=e.src.slice(r+1,n);if(Dy.test(s)){const i=e.md.normalizeLink(s);if(!e.md.validateLink(i))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",i]],a.markup="autolink",a.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(s);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=s.length+2,!0}if(Ry.test(s)){const i=e.md.normalizeLink(`mailto:${s}`);if(!e.md.validateLink(i))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",i]],a.markup="autolink",a.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(s);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=s.length+2,!0}return!1}function By(e){return/^<a[>\s]/i.test(e)}function jy(e){return/^<\/a\s*>/i.test(e)}function My(e){const t=e|32;return t>=97&&t<=122}function Py(e,t){if(!e.md.options.html)return!1;const n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;const o=e.src.charCodeAt(r+1);if(o!==33&&o!==63&&o!==47&&!My(o))return!1;const s=e.src.slice(r).match(cy);if(!s)return!1;if(!t){const i=e.push("html_inline","",0);i.content=s[0],By(i.content)&&e.linkLevel++,jy(i.content)&&e.linkLevel--}return e.pos+=s[0].length,!0}var Ty=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Ny=/^&([a-z][a-z0-9]{1,31});/i;function _y(e,t){const n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){const o=e.src.slice(n).match(Ty);if(o){if(!t){const s=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),i=e.push("text_special","",0);i.content=Ka(s)?Mr(s):Mr(65533),i.markup=o[0],i.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(n).match(Ny);if(o){const s=vf(o[0]);if(s!==o[0]){if(!t){const i=e.push("text_special","",0);i.content=s,i.markup=o[0],i.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function jc(e){const t={},n=e.length;if(!n)return;let r=0,o=-2;const s=[];for(let i=0;i<n;i++){const a=e[i];if(s.push(0),(e[r].marker!==a.marker||o!==a.token-1)&&(r=i),o=a.token,a.length=a.length||0,!a.close)continue;t.hasOwnProperty(a.marker)||(t[a.marker]=[-1,-1,-1,-1,-1,-1]);const c=t[a.marker][(a.open?3:0)+a.length%3];let u=r-s[r]-1,f=u;for(;u>c;u-=s[u]+1){const h=e[u];if(h.marker===a.marker&&h.open&&h.end<0){let g=!1;if((h.close||a.open)&&(h.length+a.length)%3===0&&(h.length%3!==0||a.length%3!==0)&&(g=!0),!g){const A=u>0&&!e[u-1].open?s[u-1]+1:0;s[i]=i-u+A,s[u]=A,a.open=!1,h.end=i,h.close=!1,f=-1,o=-2;break}}}f!==-1&&(t[a.marker][(a.open?3:0)+(a.length||0)%3]=f)}}function Oy(e){const t=e.tokens_meta,n=e.tokens_meta.length;jc(e.delimiters);for(let o=0;o<n;o++){var r;const s=(r=t[o])===null||r===void 0?void 0:r.delimiters;s&&jc(s)}}function Hy(e){let t,n,r=0;const o=e.tokens,s=e.tokens.length;for(t=n=0;t<s;t++)o[t].nesting<0&&r--,o[t].level=r,o[t].nesting>0&&r++,o[t].type==="text"&&t+1<s&&o[t+1].type==="text"?o[t+1].content=o[t].content+o[t+1].content:(t!==n&&(o[n]=o[t]),n++);t!==n&&(o.length=n)}var Hs=[["text",gy],["linkify",xy],["newline",by],["escape",vy],["backticks",yy],["strikethrough",Qf.tokenize],["emphasis",Gf.tokenize],["link",Ey],["image",Sy],["autolink",Fy],["html_inline",Py],["entity",_y]],Ls=[["balance_pairs",Oy],["strikethrough",Qf.postProcess],["emphasis",Gf.postProcess],["fragments_join",Hy]],Yf=class{constructor(){xe(this,"ruler",new Or),xe(this,"ruler2",new Or),xe(this,"State",Wf);for(let e=0;e<Hs.length;e++)this.ruler.push(Hs[e][0],Hs[e][1]);for(let e=0;e<Ls.length;e++)this.ruler2.push(Ls[e][0],Ls[e][1])}skipToken(e){const t=e.pos,n=this.ruler.getRules(""),r=n.length,o=e.md.options.maxNesting,s=e.cache;if(typeof s[t]<"u"){e.pos=s[t];return}let i=!1;if(e.level<o){for(let a=0;a<r;a++)if(e.level++,i=n[a](e,!0),e.level--,i){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;i||e.pos++,s[t]=e.pos}tokenize(e){const t=this.ruler.getRules(""),n=t.length,r=e.posMax,o=e.md.options.maxNesting;for(;e.pos<r;){const s=e.pos;let i=!1;if(e.level<o){for(let a=0;a<n;a++)if(i=t[a](e,!1),i){if(s>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(i){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()}parse(e,t,n,r){const o=new this.State(e,t,n,r);this.tokenize(o);const s=this.ruler2.getRules(""),i=s.length;for(let a=0;a<i;a++)s[a](o)}},Ly={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","strip_references","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","strip_references","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},Ky=/^(vbscript|javascript|file|data):/,Wy=/^data:image\/(gif|png|jpeg|webp);/,Mc=["http:","https:","mailto:"],Ut=class{validateLink(e){const t=e.trim().toLowerCase();return Ky.test(t)?Wy.test(t):!0}normalizeLink(e){const t=mi(e,!0);if(t.hostname&&(!t.protocol||Mc.indexOf(t.protocol)>=0))try{t.hostname=Cc.toASCII(t.hostname)}catch{}return Vr(gi(t))}normalizeLinkText(e){const t=mi(e,!0);if(t.hostname&&(!t.protocol||Mc.indexOf(t.protocol)>=0))try{t.hostname=Cc.toUnicode(t.hostname)}catch{}return nr(gi(t),nr.defaultChars+"%")}constructor(...e){xe(this,"inline",new Yf),xe(this,"block",new Kf),xe(this,"core",new _f),xe(this,"renderer",new Pf),xe(this,"linkify",new tv),xe(this,"utils",pv),xe(this,"helpers",Object.assign({},Rv));const[t,n]=e;typeof t=="string"?(this.configure(t),n&&this.set(n)):(this.configure("default"),this.set(t||{}))}set(e){return Object.assign(this.options,e),this}configure(e){let t;if(typeof e=="string"){const o=e;if(t=Ly[o],!t)throw new Error(`Wrong 'markdown-it' preset "${o}", check name`)}else t=e;if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");t.options&&(this.options={...t.options});const n=t.components;if(n){var r;["core","block","inline"].forEach(s=>{var i;const a=(i=n[s])===null||i===void 0?void 0:i.rules;a&&this[s].ruler.enableOnly(a)});const o=(r=n.inline)===null||r===void 0?void 0:r.rules2;o&&this.inline.ruler2.enableOnly(o)}return this}enable(e,t=!1){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(o=>{n=n.concat(this[o].ruler.enable(e,!0))}),n=n.concat(this.inline.ruler2.enable(e,!0));const r=e.filter(o=>n.indexOf(o)<0);if(r.length&&!t)throw new Error(`MarkdownIt. Failed to enable unknown rule(s): ${r}`);return this}disable(e,t=!1){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(o=>{n=n.concat(this[o].ruler.disable(e,!0))}),n=n.concat(this.inline.ruler2.disable(e,!0));const r=e.filter(o=>n.indexOf(o)<0);if(r.length&&!t)throw new Error(`MarkdownIt. Failed to disable unknown rule(s): ${r}`);return this}use(e,...t){return e.apply(e,[this,...t]),this}parse(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens}render(e,t={}){return this.renderer.render(this.parse(e,t),this.options,t)}parseInline(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens}renderInline(e,t={}){return this.renderer.render(this.parseInline(e,t),this.options,t)}};xe(Ut,"Token",Fn);xe(Ut,"Ruler",Or);xe(Ut,"Renderer",Pf);xe(Ut,"ParserCore",_f);xe(Ut,"StateCore",Tf);xe(Ut,"ParserBlock",Kf);xe(Ut,"StateBlock",Of);xe(Ut,"ParserInline",Yf);xe(Ut,"StateInline",Wf);var Qy=Ff(Ut),Ks,Pc;function Gy(){return Pc||(Pc=1,Ks=function(t,n){var r=3,o="-",s=o.charCodeAt(0),i=o.length;function a(c,u,f,h){var g,A,p,m,x,v,b,y=!1,C=c.bMarks[u]+c.tShift[u],w=c.eMarks[u];if(u!==0||s!==c.src.charCodeAt(0))return!1;for(g=C+1;g<=w;g++)if(o[(g-C)%i]!==c.src[g]){b=g+1;break}if(p=Math.floor((g-C)/i),p<r)return!1;if(g-=(g-C)%i,h)return!0;for(A=u;A++,!(A>=f||c.src.slice(C,w)==="..."||(C=c.bMarks[A]+c.tShift[A],w=c.eMarks[A],C<w&&c.sCount[A]<c.blkIndent));)if(s===c.src.charCodeAt(C)&&!(c.sCount[A]-c.blkIndent>=4)){for(g=C+1;g<=w&&o[(g-C)%i]===c.src[g];g++);if(!(Math.floor((g-C)/i)<p)&&(g-=(g-C)%i,g=c.skipSpaces(g),!(g<w))){y=!0;break}}return x=c.parentType,v=c.lineMax,c.parentType="container",c.lineMax=A,m=c.push("front_matter",null,0),m.hidden=!0,m.markup=c.src.slice(u,g),m.block=!0,m.map=[u,A+(y?1:0)],m.meta=c.src.slice(b,C-1),c.parentType=x,c.lineMax=v,c.line=A+(y?1:0),n(m.meta),!0}t.block.ruler.before("table","front_matter",a,{alt:["paragraph","reference","blockquote","list"]})}),Ks}var Yy=Gy();const zy=jp(Yy);var Uy=Object.defineProperty,Vy=Object.defineProperties,Zy=Object.getOwnPropertyDescriptors,Tc=Object.getOwnPropertySymbols,Jy=Object.prototype.hasOwnProperty,$y=Object.prototype.propertyIsEnumerable,Nc=(e,t,n)=>t in e?Uy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lt=(e,t)=>{for(var n in t||(t={}))Jy.call(t,n)&&Nc(e,n,t[n]);if(Tc)for(var n of Tc(t))$y.call(t,n)&&Nc(e,n,t[n]);return e},Hr=(e,t)=>Vy(e,Zy(t)),To=(e,t,n)=>new Promise((r,o)=>{var s=c=>{try{a(n.next(c))}catch(u){o(u)}},i=c=>{try{a(n.throw(c))}catch(u){o(u)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,i);a((n=n.apply(e,t)).next())});function Xy(e,t){return typeof e=="function"?e(t):e}function Lr(e,t){return n=>{t.setState(r=>Hr(lt({},r),{[e]:Xy(n,r[e])}))}}var _c=(e,t=100,n=1e3)=>new Promise(r=>{let o;const s=setInterval(()=>{e()&&(r(),clearInterval(s),clearTimeout(o))},t);o=setTimeout(()=>{clearInterval(s),r()},n)}),zf="Headless Tree: ",bi=e=>Error(zf+e),qy=e=>console.warn(zf+e),eC={key:"tree",getInitialState:e=>lt({expandedItems:[],focusedItem:null},e),getDefaultConfig:(e,t)=>lt({setExpandedItems:Lr("expandedItems",t),setFocusedItem:Lr("focusedItem",t)},e),stateHandlerNames:{expandedItems:"setExpandedItems",focusedItem:"setFocusedItem"},treeInstance:{getItemsMeta:({tree:e})=>{const{rootItemId:t}=e.getConfig(),{expandedItems:n}=e.getState(),r=[],o=new Set(n),s=(c,u,f,h,g)=>{var A;if(u.includes(c)){qy(`Circular reference for ${u.join(".")}`);return}if(r.push({itemId:c,level:f,index:r.length,parentId:u.at(-1),setSize:h,posInSet:g}),o.has(c)){const p=(A=e.retrieveChildrenIds(c))!=null?A:[];let m=0;for(const x of p)s(x,u.concat(c),f+1,p.length,m++)}},i=e.retrieveChildrenIds(t);let a=0;for(const c of i)s(c,[t],0,i.length,a++);return r},getFocusedItem:({tree:e})=>{var t;const n=e.getState().focusedItem;return(t=n!==null?e.getItemInstance(n):null)!=null?t:e.getItems()[0]},getRootItem:({tree:e})=>{const{rootItemId:t}=e.getConfig();return e.getItemInstance(t)},focusNextItem:({tree:e})=>{var t;const n=e.getFocusedItem().getItemMeta();if(!n)return;const r=Math.min(n.index+1,e.getItems().length-1);(t=e.getItems()[r])==null||t.setFocused()},focusPreviousItem:({tree:e})=>{var t;const n=e.getFocusedItem().getItemMeta();if(!n)return;const r=Math.max(n.index-1,0);(t=e.getItems()[r])==null||t.setFocused()},updateDomFocus:({tree:e})=>{setTimeout(()=>To(null,null,function*(){var t,n,r,o,s;const i=e.getFocusedItem();(n=(t=e.getConfig()).scrollToItem)==null||n.call(t,i),yield _c(()=>i.getElement()!==null,20,500);const a=i.getElement();if(!a){(r=e.getItems()[0])==null||r.setFocused(),(s=(o=e.getItems()[0])==null?void 0:o.getElement())==null||s.focus();return}a.focus()}))},getContainerProps:({prev:e,tree:t},n)=>Hr(lt({},e?.()),{role:"tree","aria-label":n??"",ref:t.registerElement}),isSearchOpen:()=>!1},itemInstance:{scrollTo:(e,t)=>To(null,[e,t],function*({tree:n,item:r},o){var s,i,a;(i=(s=n.getConfig()).scrollToItem)==null||i.call(s,r),yield _c(()=>r.getElement()!==null,20),(a=r.getElement())==null||a.scrollIntoView(o)}),getId:({itemId:e})=>e,getKey:({itemId:e})=>e,getProps:({item:e,prev:t})=>{const n=e.getItemMeta();return Hr(lt({},t?.()),{ref:e.registerElement,role:"treeitem","aria-setsize":n.setSize,"aria-posinset":n.posInSet+1,"aria-selected":"false","aria-label":e.getItemName(),"aria-level":n.level+1,"aria-expanded":e.isFolder()?e.isExpanded():void 0,tabIndex:e.isFocused()?0:-1,onClick:r=>{e.setFocused(),e.primaryAction(),!(r.ctrlKey||r.shiftKey||r.metaKey)&&e.isFolder()&&(e.isExpanded()?e.collapse():e.expand())}})},expand:({tree:e,item:t,itemId:n})=>{var r;t.isFolder()&&((r=e.getState().loadingItemChildrens)!=null&&r.includes(n)||(e.applySubStateUpdate("expandedItems",o=>[...o,n]),e.rebuildTree()))},collapse:({tree:e,item:t,itemId:n})=>{t.isFolder()&&(e.applySubStateUpdate("expandedItems",r=>r.filter(o=>o!==n)),e.rebuildTree())},getItemData:({tree:e,itemId:t})=>e.retrieveItemData(t),equals:({item:e},t)=>e.getId()===t?.getId(),isExpanded:({tree:e,itemId:t})=>e.getState().expandedItems.includes(t),isDescendentOf:({item:e},t)=>{const n=e.getParent();return!!(n?.getId()===t||n?.isDescendentOf(t))},isFocused:({tree:e,item:t,itemId:n})=>e.getState().focusedItem===n||e.getState().focusedItem===null&&t.getItemMeta().index===0,isFolder:({tree:e,item:t,itemId:n})=>n===e.getConfig().rootItemId||e.getConfig().isItemFolder(t),getItemName:({tree:e,item:t})=>e.getConfig().getItemName(t),setFocused:({tree:e,itemId:t})=>{e.applySubStateUpdate("focusedItem",t)},primaryAction:({tree:e,item:t})=>{var n,r;return(r=(n=e.getConfig()).onPrimaryAction)==null?void 0:r.call(n,t)},getParent:({tree:e,item:t})=>t.getItemMeta().parentId?e.getItemInstance(t.getItemMeta().parentId):void 0,getIndexInParent:({item:e})=>e.getItemMeta().posInSet,getChildren:({tree:e,itemId:t})=>e.retrieveChildrenIds(t).map(n=>e.getItemInstance(n)),getTree:({tree:e})=>e,getItemAbove:({tree:e,item:t})=>e.getItems()[t.getItemMeta().index-1],getItemBelow:({tree:e,item:t})=>e.getItems()[t.getItemMeta().index+1]},hotkeys:{focusNextItem:{hotkey:"ArrowDown",canRepeat:!0,preventDefault:!0,isEnabled:e=>{var t,n;return!((n=(t=e.isSearchOpen)==null?void 0:t.call(e))!=null&&n)&&!e.getState().dnd},handler:(e,t)=>{t.focusNextItem(),t.updateDomFocus()}},focusPreviousItem:{hotkey:"ArrowUp",canRepeat:!0,preventDefault:!0,isEnabled:e=>{var t,n;return!((n=(t=e.isSearchOpen)==null?void 0:t.call(e))!=null&&n)&&!e.getState().dnd},handler:(e,t)=>{t.focusPreviousItem(),t.updateDomFocus()}},expandOrDown:{hotkey:"ArrowRight",canRepeat:!0,handler:(e,t)=>{const n=t.getFocusedItem();n.isExpanded()||!n.isFolder()?(t.focusNextItem(),t.updateDomFocus()):n.expand()}},collapseOrUp:{hotkey:"ArrowLeft",canRepeat:!0,handler:(e,t)=>{var n;const r=t.getFocusedItem();(!r.isExpanded()||!r.isFolder())&&r.getItemMeta().level!==0?((n=r.getParent())==null||n.setFocused(),t.updateDomFocus()):r.collapse()}},focusFirstItem:{hotkey:"Home",handler:(e,t)=>{var n;(n=t.getItems()[0])==null||n.setFocused(),t.updateDomFocus()}},focusLastItem:{hotkey:"End",handler:(e,t)=>{var n;(n=t.getItems()[t.getItems().length-1])==null||n.setFocused(),t.updateDomFocus()}}}},tC=(e,t,n)=>{const r={};return[r,()=>{const s=n(r);e:for(let i=0;i<e.length;i++){const a=e[i][t];if(!a)continue e;t:for(const[c,u]of Object.entries(a)){if(!u)continue t;const f=r[c];r[c]=(...h)=>u(Hr(lt({},s),{prev:f}),...h)}}}]},nC=e=>{var t;const n=e?.map(r=>r.key);for(const r of e??[]){const o=(t=r.deps)==null?void 0:t.find(s=>!n?.includes(s));if(o)throw bi(`${r.key} needs ${o}`)}},rC=(e,t)=>{const n=e.length;for(let r=0;r<n;r++)for(let o=r+1;o<n;o++)t(e[o],e[r])<0&&([e[r],e[o]]=[e[o],e[r]]);return e},oC=e=>(t,n)=>{var r,o;return n.key&&((r=t.overwrites)!=null&&r.includes(n.key))?1:t.key&&((o=n.overwrites)!=null&&o.includes(t.key))?-1:e.indexOf(t)-e.indexOf(n)},sC=(e=[])=>rC(e,oC(e)),iC=e=>{var t,n,r,o;const s=(t=e.instanceBuilder)!=null?t:tC,i=[eC,...sC(e.features)];nC(i);const a=[...i],[c,u]=s(a,"treeInstance",E=>({tree:E}));let f=i.reduce((E,k)=>{var F,T;return(T=(F=k.getInitialState)==null?void 0:F.call(k,E,c))!=null?T:E},(r=(n=e.initialState)!=null?n:e.state)!=null?r:{}),h=i.reduce((E,k)=>{var F,T;return(T=(F=k.getDefaultConfig)==null?void 0:F.call(k,E,c))!=null?T:E},e);const g=i.reduce((E,k)=>lt(lt({},E),k.stateHandlerNames),{});let A;const p={current:{}};let m=!1;const x={};let v=[];const b={},y={};let C={};const w={},I=()=>{v=[],C={};const[E,k]=s(a,"itemInstance",F=>({item:F,tree:c,itemId:h.rootItemId}));k(),x[h.rootItemId]=E,C[h.rootItemId]={itemId:h.rootItemId,index:-1,parentId:null,level:-1,posInSet:0,setSize:1};for(const F of c.getItemsMeta())if(C[F.itemId]=F,x[F.itemId])v.push(x[F.itemId]);else{const[T,N]=s(a,"itemInstance",M=>({item:M,tree:c,itemId:F.itemId}));N(),x[F.itemId]=T,v.push(T)}m=!1},S=E=>{for(const k of i)E(k)},R={key:"main",treeInstance:{getState:()=>f,setState:({},E)=>{var k;(k=h.setState)==null||k.call(h,f)},setMounted:({},E)=>{var k;const F=p.current;F.isMounted=E,E&&((k=F.waitingForMount)==null||k.forEach(T=>T()),F.waitingForMount=[])},applySubStateUpdate:({},E,k)=>{var F;const T=()=>{f[E]=typeof k=="function"?k(f[E]):k;const M=h[g[E]];M?.(f[E])},N=p.current;N.isMounted?T():((F=N.waitingForMount)!=null||(N.waitingForMount=[]),N.waitingForMount.push(T))},rebuildTree:()=>{var E,k;const F=p.current;F.isMounted?(I(),(E=h.setState)==null||E.call(h,f)):((k=F.waitingForMount)!=null||(F.waitingForMount=[]),F.waitingForMount.push(()=>{var T;I(),(T=h.setState)==null||T.call(h,f)}))},scheduleRebuildTree:()=>{m=!0},getConfig:()=>h,setConfig:(E,k)=>{var F,T,N;const M=typeof k=="function"?k(h):k,D=((F=M.state)==null?void 0:F.expandedItems)&&((T=M.state)==null?void 0:T.expandedItems)!==f.expandedItems;h=M,M.state&&(f=lt(lt({},f),M.state)),D&&(I(),(N=h.setState)==null||N.call(h,f))},getItemInstance:({},E)=>{const k=x[E];if(!k){const[F,T]=s(a,"itemInstance",N=>({item:N,tree:c,itemId:E}));return T(),F}return k},getItems:()=>(m&&I(),v),registerElement:({},E)=>{A!==E&&(A&&!E?S(k=>{var F;return(F=k.onTreeUnmount)==null?void 0:F.call(k,c,A)}):!A&&E&&S(k=>{var F;return(F=k.onTreeMount)==null?void 0:F.call(k,c,E)}),A=E)},getElement:()=>A,getDataRef:()=>p,getHotkeyPresets:()=>w},itemInstance:{registerElement:({itemId:E,item:k},F)=>{if(b[E]===F)return;const T=b[E];T&&!F?S(N=>{var M;return(M=N.onItemUnmount)==null?void 0:M.call(N,k,T,c)}):!T&&F&&S(N=>{var M;return(M=N.onItemMount)==null?void 0:M.call(N,k,F,c)}),b[E]=F},getElement:({itemId:E})=>b[E],getDataRef:({itemId:E})=>{var k;return(k=y[E])!=null?k:y[E]={current:{}}},getItemMeta:({itemId:E})=>{var k;return(k=C[E])!=null?k:{itemId:E,parentId:null,level:-1,index:-1,posInSet:0,setSize:1}}}};a.unshift(R);for(const E of a)Object.assign(w,(o=E.hotkeys)!=null?o:{});return u(),c},aC={key:"selection",getInitialState:e=>lt({selectedItems:[]},e),getDefaultConfig:(e,t)=>lt({setSelectedItems:Lr("selectedItems",t)},e),stateHandlerNames:{selectedItems:"setSelectedItems"},treeInstance:{setSelectedItems:({tree:e},t)=>{e.applySubStateUpdate("selectedItems",t)},getSelectedItems:({tree:e})=>e.getState().selectedItems.map(e.getItemInstance)},itemInstance:{select:({tree:e,itemId:t})=>{const{selectedItems:n}=e.getState();e.setSelectedItems(n.includes(t)?n:[...n,t])},deselect:({tree:e,itemId:t})=>{const{selectedItems:n}=e.getState();e.setSelectedItems(n.filter(r=>r!==t))},isSelected:({tree:e,itemId:t})=>{const{selectedItems:n}=e.getState();return n.includes(t)},selectUpTo:({tree:e,item:t,itemId:n},r)=>{const o=t.getItemMeta().index,s=e.getDataRef();if(!s.current.selectUpToAnchorId){s.current.selectUpToAnchorId=n,e.setSelectedItems([n]);return}const a=e.getItemInstance(s.current.selectUpToAnchorId).getItemMeta().index,[c,u]=o<a?[o,a]:[a,o],f=e.getItems().slice(c,u+1).map(A=>A.getItemMeta().itemId);if(!r){e.setSelectedItems(f);return}const{selectedItems:h}=e.getState(),g=[...new Set([...h,...f])];e.setSelectedItems(g)},toggleSelect:({item:e})=>{e.isSelected()?e.deselect():e.select()},getProps:({tree:e,item:t,itemId:n,prev:r})=>Hr(lt({},r?.()),{"aria-selected":t.isSelected()?"true":"false",onClick:o=>{var s,i;o.shiftKey?t.selectUpTo(o.ctrlKey||o.metaKey):o.ctrlKey||o.metaKey?t.toggleSelect():e.setSelectedItems([n]),o.shiftKey||(e.getDataRef().current.selectUpToAnchorId=n),(i=(s=r?.())==null?void 0:s.onClick)==null||i.call(s,o)}})},hotkeys:{toggleSelectedItem:{hotkey:"Control+Space",preventDefault:!0,handler:(e,t)=>{t.getFocusedItem().toggleSelect()}},selectUpwards:{hotkey:"Shift+ArrowUp",handler:(e,t)=>{const n=t.getFocusedItem(),r=n.getItemAbove();r&&(n.isSelected()&&r.isSelected()?n.deselect():r.select(),r.setFocused(),t.updateDomFocus())}},selectDownwards:{hotkey:"Shift+ArrowDown",handler:(e,t)=>{const n=t.getFocusedItem(),r=n.getItemBelow();r&&(n.isSelected()&&r.isSelected()?n.deselect():r.select(),r.setFocused(),t.updateDomFocus())}},selectAll:{hotkey:"Control+KeyA",preventDefault:!0,handler:(e,t)=>{t.setSelectedItems(t.getItems().map(n=>n.getId()))}}}},Oc=e=>e.code!==""&&e.code!=="Unidentified"?e.code:e.key,Hc={letter:/^Key[A-Z]$/,letterornumber:/^(Key[A-Z]|Digit[0-9])$/,plus:/^(NumpadAdd|Plus)$/,minus:/^(NumpadSubtract|Minus)$/,control:/^(ControlLeft|ControlRight)$/,shift:/^(ShiftLeft|ShiftRight)$/,metaorcontrol:/^(MetaLeft|MetaRight|ControlLeft|ControlRight)$/,enter:/^(Enter|NumpadEnter)$/},Lc=new Set(["MetaLeft","MetaRight","Meta","ControlLeft","ControlRight","Control","AltLeft","AltRight","Alt","ShiftLeft","ShiftRight","Shift"]),lC=(e,t,n)=>{const r=n.hotkey.toLowerCase().split("+"),o=r.every(i=>{if(i in Hc)return[...e].some(c=>Hc[i].test(c));const a=[...e].map(c=>c.toLowerCase());return a.includes(i.toLowerCase())||a.includes(`key${i.toLowerCase()}`)}),s=!n.isEnabled||n.isEnabled(t);return o&&s&&e.size===r.length},cC=(e,t,n,r)=>{var o;return(o=Object.entries(lt(lt({},n),r)).find(([,s])=>lC(e,t,s)))==null?void 0:o[0]},Ws={clearPressedKeys:e=>{e.current.pressedKeys=new Set},dispatchKeyDown:(e,t,n,r={})=>{var o,s,i,a,c;const{isInputFocused:u=!1,releaseAfterDispatch:f=!1}=r,{ignoreHotkeysOnInputs:h,onTreeHotkey:g,hotkeys:A}=e.getConfig();if(u&&h)return;const p=Oc({code:(o=n.code)!=null?o:"",key:(s=n.key)!=null?s:""});(a=(i=t.current).pressedKeys)!=null||(i.pressedKeys=new Set);const m=!t.current.pressedKeys.has(p);p&&t.current.pressedKeys.add(p);const x=cC(t.current.pressedKeys,e,e.getHotkeyPresets(),A);if(f&&p&&t.current.pressedKeys.delete(p),!x)return;const v=lt(lt({},e.getHotkeyPresets()[x]),A?.[x]);v&&(!v.allowWhenInputFocused&&u||!v.canRepeat&&!m||(v.preventDefault&&((c=n.preventDefault)==null||c.call(n)),v.handler(n,e),g?.(x,n)))},dispatchKeyUp:(e,t)=>{var n,r,o,s;const i=Oc({code:(n=t.code)!=null?n:"",key:(r=t.key)!=null?r:""});i&&((s=(o=e.current).pressedKeys)!=null||(o.pressedKeys=new Set),Lc.has(i)&&(e.current.pressedKeys=new Set([...e.current.pressedKeys].filter(a=>Lc.has(a)))),e.current.pressedKeys.delete(i))}},uC={key:"hotkeys-core",onTreeMount:(e,t)=>{const n=e.getDataRef(),r=i=>{const a=i.target instanceof HTMLInputElement;Ws.dispatchKeyDown(e,n,i,{isInputFocused:a,releaseAfterDispatch:a})},o=i=>{Ws.dispatchKeyUp(n,i)},s=()=>{Ws.clearPressedKeys(n)};t.addEventListener("keydown",r),document.addEventListener("keyup",o),window.addEventListener("focus",s),n.current.keydownHandler=r,n.current.keyupHandler=o,n.current.resetHandler=s},onTreeUnmount:(e,t)=>{const n=e.getDataRef();n.current.keyupHandler&&(document.removeEventListener("keyup",n.current.keyupHandler),delete n.current.keyupHandler),n.current.keydownHandler&&(t.removeEventListener("keydown",n.current.keydownHandler),delete n.current.keydownHandler),n.current.resetHandler&&(window.removeEventListener("focus",n.current.resetHandler),delete n.current.resetHandler)}},dC="sync dataLoader returned undefined",fC="sync dataLoader returned promise",Qs=e=>{if(!e)throw bi(dC);if(typeof e=="object"&&"then"in e)throw bi(fC);return e},pC={key:"sync-data-loader",getInitialState:e=>lt({loadingItemData:[],loadingItemChildrens:[]},e),getDefaultConfig:(e,t)=>lt({setLoadingItemData:Lr("loadingItemData",t),setLoadingItemChildrens:Lr("loadingItemChildrens",t)},e),stateHandlerNames:{loadingItemData:"setLoadingItemData",loadingItemChildrens:"setLoadingItemChildrens"},treeInstance:{waitForItemDataLoaded:()=>To(null,null,function*(){}),waitForItemChildrenLoaded:()=>To(null,null,function*(){}),retrieveItemData:({tree:e},t)=>Qs(e.getConfig().dataLoader.getItem(t)),retrieveChildrenIds:({tree:e},t)=>{const{dataLoader:n}=e.getConfig();return"getChildren"in n?Qs(n.getChildren(t)):Qs(n.getChildrenWithData(t)).map(r=>r.data)},loadItemData:({tree:e},t)=>e.retrieveItemData(t),loadChildrenIds:({tree:e},t)=>e.retrieveChildrenIds(t)},itemInstance:{isLoading:()=>!1,hasLoadedData:()=>!0}},hC=Object.defineProperty,AC=Object.defineProperties,gC=Object.getOwnPropertyDescriptors,Kc=Object.getOwnPropertySymbols,mC=Object.prototype.hasOwnProperty,xC=Object.prototype.propertyIsEnumerable,Wc=(e,t,n)=>t in e?hC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,co=(e,t)=>{for(var n in t||(t={}))mC.call(t,n)&&Wc(e,n,t[n]);if(Kc)for(var n of Kc(t))xC.call(t,n)&&Wc(e,n,t[n]);return e},bC=(e,t)=>AC(e,gC(t)),vC=e=>{const[t]=d.useState(()=>({current:iC(e)})),[n,r]=d.useState(()=>t.current.getState());return d.useEffect(()=>(t.current.setMounted(!0),t.current.rebuildTree(),()=>{t.current.setMounted(!1)}),[t]),t.current.setConfig(o=>bC(co(co({},o),e),{state:co(co({},n),e.state),setState:s=>{var i;r(s),(i=e.setState)==null||i.call(e,s)}})),t.current};const yC=/^(https?:|mailto:|#|\.\/|#\/)/iu,CC=e=>e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',"""),Mn=Qy({html:!1,linkify:!0,typographer:!1,breaks:!1});zy(Mn,()=>{});Mn.core.ruler.push("render_front_matter",e=>{for(const t of e.tokens)t.type==="front_matter"&&(t.type="fence",t.tag="code",t.info="yaml",t.content=String(t.meta??"").replace(/\n$/,""),t.block=!0);return!0});Mn.validateLink=e=>yC.test(e.trim());const Uf=e=>{for(const t of e)t.type==="link_open"&&(t.attrSet("rel","noreferrer noopener"),t.attrSet("target","_blank")),t.children!==null&&Uf(t.children)};Mn.core.ruler.push("external_links",e=>(Uf(e.tokens),!0));Mn.renderer.rules.fence=(e,t)=>{const n=e[t];return`<pre class="tech-ltr"><code${n.info.trim().length>0?` class="language-${CC(n.info.trim())}"`:""}>${Mn.utils.escapeHtml(n.content)}</code></pre>
|
|
19
|
-
`};const IC=e=>Mn.render(e),wC=["prose prose-sm","dark:prose-invert","max-w-[75ch]","prose-headings:font-semibold prose-headings:tracking-tight","prose-h1:text-xl prose-h2:text-lg prose-h3:text-base","prose-p:my-2 prose-li:my-0.5","prose-code:before:content-none prose-code:after:content-none","prose-code:font-mono prose-code:text-[0.85em]","prose-pre:bg-muted prose-pre:text-foreground prose-pre:rounded-lg","prose-a:text-primary prose-a:decoration-primary/40 hover:prose-a:decoration-primary","prose-table:border-collapse prose-table:text-xs","prose-th:border prose-th:border-border prose-th:bg-muted prose-th:px-2 prose-th:py-1 prose-th:text-start prose-th:font-semibold","prose-td:border prose-td:border-border prose-td:px-2 prose-td:py-1 prose-td:align-top","prose-td:font-mono","prose-hr:border-border prose-blockquote:border-primary/40"].join(" "),kC=(e,t)=>e.children!==void 0?t?l.jsx(ah,{"aria-hidden":!0,className:"pointer-events-none size-4 text-amber-500"}):l.jsx(ch,{"aria-hidden":!0,className:"pointer-events-none size-4 text-amber-500"}):l.jsx(sh,{"aria-hidden":!0,className:"pointer-events-none size-4 text-muted-foreground"}),Qc=16,EC=({entries:e,selected:t,onSelect:n})=>{const r=d.useMemo(()=>{const c=new Map;for(const f of e){const h=f.path.split("/"),g=h[h.length-1]??f.path;f.type==="directory"?c.set(f.path,{name:g,path:f.path,children:[]}):c.set(f.path,{name:g,path:f.path})}for(const f of e){const h=f.path.split("/");for(let g=1;g<h.length;g+=1){const A=h.slice(0,g).join("/");c.has(A)||c.set(A,{name:h[g-1]??A,path:A,children:[]})}}for(const f of c.values())f.children!==void 0&&(f.children=[...c.values()].filter(h=>h.path!==""&&h.path.split("/").slice(0,-1).join("/")===f.path).map(h=>h.path));const u={name:"skill",path:"",children:[]};return u.children=[...c.values()].filter(f=>f.path!==""&&f.path.split("/").length===1).map(f=>f.path),c.set("root",u),Object.fromEntries(c)},[e]),o=d.useMemo(()=>Object.values(r).filter(c=>c.children!==void 0&&c.path!=="").map(c=>c.path),[r]),[s,i]=d.useState([t]),a=vC({initialState:{selectedItems:[t],expandedItems:o},setSelectedItems:c=>{i(u=>{const f=typeof c=="function"?c(u):c,h=f[0];return h!==void 0&&r[h]?.children===void 0&&h!=="root"&&n(h),f})},indent:Qc,rootItemId:"root",getItemName:c=>c.getItemData().name,isItemFolder:c=>(c.getItemData()?.children?.length??0)>0,dataLoader:{getItem:c=>r[c]??{name:c,path:""},getChildren:c=>r[c]?.children??[]},features:[pC,aC,uC]});return l.jsx(Cb,{indent:Qc,tree:a,children:a.getItems().map(c=>{const u=c.getItemData(),f=u.children===void 0&&u.path!=="";return l.jsx(Ib,{item:c,onClick:()=>{f&&n(u.path)},children:l.jsx(wb,{className:"tech-ltr relative before:bg-background before:absolute before:inset-x-0 before:-inset-y-0.5 before:-z-10",children:l.jsxs("span",{className:"flex items-center gap-2",children:[kC(u,c.isExpanded()),c.getItemName()]})})},c.getId())})})},SC=()=>{const{messages:e}=ps(),[t,n]=d.useState([]),[r,o]=d.useState("SKILL.md"),[s,i]=d.useState(null),[a,c]=d.useState(null),[u,f]=d.useState(!0),[h,g]=d.useState(!1);d.useEffect(()=>{(async()=>{const p=await Ex();p.status===200?n(p.data):c(e.help.readError),f(!1)})()},[e.help.readError]),d.useEffect(()=>{g(!0),c(null),(async()=>{const p=await Sx(r);p.status===200&&"content"in p.data?i(p.data.content):(i(null),c(e.help.readError)),g(!1)})()},[r,e.help.readError]);const A=d.useMemo(()=>s===null?"":IC(s),[s]);return l.jsxs("section",{className:"flex h-full min-h-0 overflow-hidden","aria-label":e.help.title,children:[l.jsx("nav",{className:"w-64 shrink-0 overflow-y-auto border-e border-border p-2","aria-label":e.help.listTitle,children:u?l.jsxs("div",{className:"space-y-2",children:[l.jsx(qt,{className:"h-5 w-full"}),l.jsx(qt,{className:"h-5 w-4/5"}),l.jsx(qt,{className:"h-5 w-3/5"})]}):t.length===0?l.jsx("p",{className:"text-muted-foreground px-2 text-xs",children:e.help.empty}):l.jsx(EC,{entries:t,selected:r,onSelect:o})}),l.jsx("article",{className:"min-h-0 min-w-0 flex-1 overflow-y-auto p-6","aria-live":"polite",children:h?l.jsxs("div",{className:"space-y-2",children:[l.jsx(qt,{className:"h-6 w-1/2"}),l.jsx(qt,{className:"h-4 w-full"}),l.jsx(qt,{className:"h-4 w-5/6"})]}):a!==null?l.jsx("p",{className:"text-destructive text-sm",children:a}):l.jsx("div",{className:wC,dangerouslySetInnerHTML:{__html:A}})})]})},Vf=e=>`/api/icon-composed/${e}?token=${encodeURIComponent(new URLSearchParams(location.search).get("token")??"")}`,RC={cwd:"",env:[],argsMode:"string",family:null},Qa=new URLSearchParams(location.search).get("token")??"",Ke=(e,t={})=>fetch(e,{method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${Qa}`},body:JSON.stringify(t)}),DC=()=>new EventSource(`/api/events?token=${encodeURIComponent(Qa)}`),Qn=(e,t)=>`/api/icon-data/${e}/${t}?token=${encodeURIComponent(Qa)}`,vi=e=>{try{return new URL(e).hostname}catch{return e}};function FC({values:e,defaults:t,frozen:n,iconCandidates:r,iconCandidatesPort:o,uploadedIconUrl:s,selectedIconRef:i,iconAnalysis:a,iconComposition:c,iconComposeError:u,iconBackground:f,iconScale:h,onIconBackgroundChange:g,onIconScaleChange:A,onPickIconCandidate:p,onUploadIcon:m,onClearIcon:x,onPatch:v}){const b=n,y=d.useRef(null),[C,w]=d.useState(!1);return l.jsxs("div",{className:"grid grid-cols-1 gap-y-1",children:[l.jsxs("div",{children:[l.jsx(Me,{children:"应用图标"}),l.jsxs("div",{className:"mt-1.5 flex flex-wrap items-start gap-3",children:[l.jsx("button",{type:"button",disabled:b,"aria-label":"选择本地图片作为应用图标",onClick:()=>y.current?.click(),onDragOver:I=>{I.preventDefault(),b||w(!0)},onDragLeave:()=>w(!1),onDrop:I=>{if(I.preventDefault(),w(!1),b)return;const S=I.dataTransfer.files[0];S!==void 0&&m(S)},className:fe("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",C&&"border-primary bg-primary/10"),children:s!==void 0?l.jsx("img",{src:s,alt:"已选图标",className:"icon-checker size-full rounded object-contain"}):l.jsxs("span",{className:"flex flex-col items-center gap-1 text-muted-foreground",children:[l.jsx(xu,{className:"size-4"}),l.jsx("span",{className:"text-[10px] leading-tight",children:"点击或拖入图片"})]})}),l.jsx("input",{ref:y,type:"file",accept:"image/png,image/jpeg,image/svg+xml,image/webp,image/gif",className:"hidden",disabled:b,onChange:I=>{const S=I.target.files?.[0];S!==void 0&&m(S),I.target.value=""}}),l.jsx("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:r.length===0?l.jsx("span",{className:"text-xs text-muted-foreground",children:"未抓取到候选图标;将使用首字母图标"}):r.map(I=>{const S=o===void 0?void 0:Qn(o,I.index),R=i===`${o}:${I.index}`,E=i===void 0&&I.index===0;return l.jsx("button",{type:"button",disabled:b,title:`${I.width}×${I.height} ${I.format.toUpperCase()}`,onClick:()=>p(I),className:fe("icon-checker flex size-14 items-center justify-center overflow-hidden rounded-lg border p-1 transition-all",R||E?"border-primary ring-2 ring-primary/60":"border-border hover:border-primary/60",b&&"opacity-50"),children:S!==void 0?l.jsx("img",{src:S,alt:`候选图标 ${I.width}×${I.height}`,className:"size-full object-contain"}):null},I.index)})}),i!==void 0||s!==void 0?l.jsx("button",{type:"button",disabled:b,onClick:x,className:"text-[11px] text-muted-foreground underline-offset-2 hover:underline",children:"清除选择(回到默认)"}):null]}),l.jsx("div",{className:"mt-3 rounded-lg border border-border p-3",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{role:"img",className:"icon-checker size-14 shrink-0 overflow-hidden rounded-[10px]","aria-label":"图标合成预览",children:c!==void 0?l.jsx("img",{src:Vf(c.key),alt:"图标合成预览",className:"size-full object-contain",onError:I=>{I.currentTarget.style.display="none"}}):l.jsx("span",{className:"flex size-full items-center justify-center text-[10px] text-muted-foreground",children:"预览"})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx(Me,{children:"图标背景"}),l.jsx("div",{className:"mt-1.5 flex gap-1.5",children:["black","white","transparent"].map(I=>l.jsxs("button",{type:"button",disabled:b,"aria-pressed":f===I,onClick:()=>g(I),className:fe("flex h-7 items-center gap-1.5 rounded-md border px-2.5 text-[11px] transition-colors",f===I?"border-foreground bg-secondary text-secondary-foreground":"border-border text-muted-foreground hover:border-foreground/40"),children:[I==="black"?"黑色":I==="white"?"白色":"透明",a!==void 0&&a.suggested===I?l.jsx("span",{className:"text-[10px] text-muted-foreground/70",children:"自动"}):null]},I))}),l.jsxs("div",{className:"mt-2.5",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(Me,{className:"text-[11px]",children:"前景缩放"}),l.jsxs("span",{className:"text-[11px] tabular-nums text-muted-foreground",children:[Math.round(h*100),"%"]})]}),l.jsx("input",{type:"range",min:50,max:95,step:5,value:Math.round(h*100),disabled:b,onChange:I=>A(Number(I.target.value)/100),className:"mt-1 w-full accent-foreground","aria-label":"前景图标缩放"})]}),u!==void 0?l.jsx("p",{role:"alert",className:"mt-1.5 text-[11px] font-medium text-red-400",children:u}):null,a!==void 0?l.jsx("p",{className:"mt-1.5 text-[11px] leading-relaxed text-muted-foreground",children:f==="transparent"?"透明背景:原始像素直接透出。":`已按明暗自动选择${a.suggested===f?"":"(已手动覆盖)"}:${a.luminance===void 0?"无法分析明暗":`前景明度 ${a.luminance.toFixed(2)}、覆盖率 ${(a.coverage*100).toFixed(0)}%`}。`}):null]})]})})]}),l.jsxs("div",{children:[l.jsx(Me,{htmlFor:"appId",children:"App ID"}),l.jsx(qe,{id:"appId",className:"mt-1 font-mono",disabled:b,value:e.appId,placeholder:t.appId||"由命令推导(如 start.somecommand.npx)",onChange:I=>v({appId:I.target.value})})]}),l.jsxs("div",{children:[l.jsx(Me,{htmlFor:"appName",children:"应用名称"}),l.jsx(qe,{id:"appName",className:"mt-1",disabled:b,value:e.appName,placeholder:t.appName||"从服务页面标题抓取",onChange:I=>v({appName:I.target.value})})]})]})}function BC({candidates:e,port:t,disabled:n,selectedRef:r,uploadedUrl:o,includeVariants:s,defaultLabel:i,onPick:a,onUpload:c,onClear:u}){const f=d.useRef(null),[h,g]=d.useState(!1),A=s?e:e.filter(m=>m.variant==="original"),p=e.filter(m=>m.variant==="original");return l.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[l.jsx("button",{type:"button",disabled:n,"aria-label":"选择本地图片",onClick:()=>f.current?.click(),onDragOver:m=>{m.preventDefault(),n||g(!0)},onDragLeave:()=>g(!1),onDrop:m=>{if(m.preventDefault(),g(!1),n)return;const x=m.dataTransfer.files[0];x!==void 0&&c(x)},className:fe("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",h&&"border-primary bg-primary/10"),children:o!==void 0?l.jsx("img",{src:o,alt:"已选图标",className:"icon-checker size-full rounded object-contain"}):l.jsxs("span",{className:"flex flex-col items-center gap-1 text-muted-foreground",children:[l.jsx(xu,{className:"size-4"}),l.jsx("span",{className:"text-[10px] leading-tight",children:"上传"})]})}),l.jsx("input",{ref:f,type:"file",accept:"image/png,image/jpeg,image/svg+xml,image/webp,image/gif",className:"hidden",disabled:n,onChange:m=>{const x=m.target.files?.[0];x!==void 0&&c(x),m.target.value=""}}),l.jsxs("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:[A.length===0?l.jsx("span",{className:"text-xs text-muted-foreground",children:"暂无候选图标"}):A.map(m=>{const x=t===void 0?void 0:Qn(t,m.index),v=r===`${t}:${m.index}`,b=r===void 0&&m.variant==="original"&&m.index===(p[0]?.index??-1);return l.jsx("button",{type:"button",disabled:n,title:m.variant==="original"?`${m.width}×${m.height} ${m.format.toUpperCase()}`:`${m.variant==="solid-black"?"黑色":"白色"}纯色 ${m.format.toUpperCase()}`,onClick:()=>a(m),className:fe("icon-checker flex size-12 items-center justify-center overflow-hidden rounded-lg border p-1 transition-all",v||b?"border-primary ring-2 ring-primary/60":"border-border hover:border-primary/60",n&&"opacity-50"),children:x!==void 0?l.jsx("img",{src:x,alt:`候选 ${m.variant}`,className:"size-full object-contain"}):null},`${m.variant}:${m.index}`)}),i!==void 0&&r===void 0&&A.length>0?l.jsx("span",{className:"text-[11px] text-muted-foreground",children:i}):null]}),r!==void 0||o!==void 0?l.jsx("button",{type:"button",disabled:n,onClick:u,className:"text-[11px] text-muted-foreground underline-offset-2 hover:underline",children:"清除"}):null]})}function jC(e){const t=d.useRef(!0);t.current&&(t.current=!1,e())}const Zf=d.createContext(null);function Vt(){const e=d.useContext(Zf);if(e===null)throw new Error(ot(60));return e}const MC=(e,t)=>Object.is(e,t);function or(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function xo(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:or(r,t,n))}function PC(e,t,n){return e.filter(r=>!or(t,r,n))}function yi(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Jf(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function TC(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(Jf(t)){for(const n of t)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of t)if(n&&n.value==null&&n.label!=null)return!0;return!1}function $f(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return yi(e)}function Ln(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?yi(e.value):yi(e)}function Xf(e,t,n){function r(){return $f(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const o=t,s=Jf(o)?o.flatMap(i=>i.items):o;if(e==null||typeof e!="object"){const i=s.find(a=>a.value===e);return i&&i.label!=null?i.label:r()}if("value"in e){const i=s.find(a=>a&&a.value===e.value);if(i&&i.label!=null)return i.label}}return r()}function NC(e,t,n){return e.reduce((r,o,s)=>(s>0&&r.push(", "),r.push(l.jsx(d.Fragment,{children:Xf(o,t,n)},s)),r),[])}const ke={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Ln(t,r)!==""},hasNullItemLabel:(e,t)=>t?TC(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{const n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(o=>or(t,o,n)):or(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function _C(e,t,n=(r,o)=>r===o){return e.length===t.length&&e.every((r,o)=>n(r,t[o]))}function vr(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const Tt=1;function Ga(e,t){return Math.max(0,e-t)}function No(e,t){if(t<=0)return 0;const n=vr(e,0,t),r=n,o=t-n,s=r<=Tt,i=o<=Tt;return s&&i?r<=o?0:t:s?0:i?t:n}function OC(e){const{id:t,value:n,defaultValue:r=null,onValueChange:o,open:s,defaultOpen:i=!1,onOpenChange:a,name:c,form:u,autoComplete:f,disabled:h=!1,readOnly:g=!1,required:A=!1,modal:p=!0,actionsRef:m,inputRef:x,onOpenChangeComplete:v,items:b,multiple:y=!1,itemToStringLabel:C,itemToStringValue:w,isItemEqualToValue:I=MC,highlightItemOnHover:S=!0,children:R}=e,{clearErrors:E}=Mi(),{setDirty:k,setTouched:F,setFocused:T,validityData:N,setFilled:M,name:D,disabled:L,validation:_,validationMode:j}=Qo(),H=Ni({id:t}),P=L||h,B=D??c,[O,G]=on({controlled:n,default:y?r??Nt:r,name:"Select",state:"value"}),[z,U]=on({controlled:s,default:i,name:"Select",state:"open"}),Q=d.useRef([]),Z=d.useRef([]),K=d.useRef(null),te=d.useRef(null),le=d.useRef(0),X=d.useRef(null),ee=d.useRef([]),J=d.useRef(!1),ce=d.useRef(null),ue=d.useRef(null),ge=d.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),ae=d.useRef(!1),{mounted:pe,setMounted:oe,transitionStatus:re}=sr(z),{openMethod:se,triggerProps:he}=wd(z),me=Dt(()=>new Gr({id:H,labelId:void 0,modal:p,multiple:y,itemToStringLabel:C,itemToStringValue:w,isItemEqualToValue:I,value:O,open:z,mounted:pe,transitionStatus:re,items:b,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,W=we(me,ke.activeIndex),Y=we(me,ke.selectedIndex),ye=we(me,ke.triggerElement),q=we(me,ke.positionerElement),ne=a0(se),Ee=se??ne,Se=d.useMemo(()=>y?"":Ln(O,w),[y,O,w]),Le=d.useMemo(()=>y&&Array.isArray(O)?O.map(Fe=>Ln(Fe,w)):Ln(O,w),[y,O,w]),Je=tt(ye),We=de(()=>Le);Ti(Je,H,O,We,!P,c);const ut=d.useRef(O),$e=y?Array.isArray(O)&&O.length>0:O!=null&&Se!=="";ie(()=>{M($e)},[$e,M]),ie(function(){let Ue=O,gt=!1;if(y){const it=Array.isArray(O)?O:[];gt=it.length===0,Ue=it[it.length-1]}const Et=gt?-1:xo(ee.current,Ue,I),St=Et===-1?null:Et;St===null&&(ue.current=null),!z&&me.set("selectedIndex",St)},[y,z,O,I,me]);function Ye(Fe){const Ue=N.initialValue;return Array.isArray(Fe)&&Array.isArray(Ue)?!_C(Fe,Ue,(gt,Et)=>or(gt,Et,I)):Fe!==Ue}ss(O,()=>{E(B),k(Ye(O)),_.change(O)});const mt=de((Fe,Ue)=>{a?.(Fe,Ue),!Ue.isCanceled&&(U(Fe),!Fe&&(Ue.reason===Bn||Ue.reason===Lo)&&(F(!0),T(!1),j==="onBlur"&&_.commit(O)))}),Ie=de(()=>{oe(!1),me.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),v?.(!1)});Yt({enabled:!m,open:z,ref:K,onComplete(){z||Ie()}}),d.useImperativeHandle(m,()=>({unmount:Ie}),[Ie]);const ze=de((Fe,Ue)=>{o?.(Fe,Ue),!Ue.isCanceled&&G(Fe)}),Ne=de(Fe=>{const Ue=Ga(Fe.scrollHeight,Fe.clientHeight),gt=No(Fe.scrollTop,Ue),Et=gt>0,St=gt<Ue;me.set("scrollUpArrowVisible",Et),me.set("scrollDownArrowVisible",St)}),nt=sm({open:z,onOpenChange:mt,elements:{reference:ye,floating:q}}),Re=Ju(nt,{enabled:!g&&!P,event:"mousedown"}),Ge=Xo(nt),_e=md(nt,{enabled:!g&&!P,listRef:Q,activeIndex:W,selectedIndex:Y,disabledIndices:Nt,onNavigate(Fe){Fe===null&&!z||me.set("activeIndex",Fe)},focusItemOnHover:S}),Ze=xd(nt,{enabled:!g&&!P&&(z||!y),listRef:Z,activeIndex:W,selectedIndex:Y,disabledIndices:Fe=>Gd(Q.current[Fe]),onMatch(Fe){z?me.set("activeIndex",Fe):ze(ee.current[Fe],Ce(Mt))},onTyping(Fe){J.current=Fe}}),st=d.useMemo(()=>Bt(Ze.reference,_e.reference,Ge.reference,Re.reference,he),[Re.reference,Ze.reference,_e.reference,Ge.reference,he]),ht=d.useMemo(()=>Bt(ts,Ze.floating,_e.floating,Ge.floating),[Ze.floating,_e.floating,Ge.floating]),yt=_e.item??ct;jC(()=>{me.update({popupProps:ht,triggerProps:st})}),me.useSyncedValues({id:H,modal:p,multiple:y,value:O,open:z,mounted:pe,transitionStatus:re,popupProps:ht,triggerProps:st,items:b,itemToStringLabel:C,itemToStringValue:w,isItemEqualToValue:I,openMethod:Ee});const dt=d.useMemo(()=>({store:me,floatingContext:nt,required:A,disabled:P,readOnly:g,multiple:y,highlightItemOnHover:S,setValue:ze,setOpen:mt,listRef:Q,popupRef:K,scrollHandlerRef:te,handleScrollArrowVisibility:Ne,scrollArrowsMountedCountRef:le,itemProps:yt,valueRef:X,valuesRef:ee,labelsRef:Z,typingRef:J,selectionRef:ge,firstItemTextRef:ce,selectedItemTextRef:ue,validation:_,onOpenChangeComplete:v,alignItemWithTriggerActiveRef:ae,initialValueRef:ut}),[me,nt,A,P,g,y,S,ze,mt,yt,_,v,Ne]),kt=Qt(x,_.inputRef),Pt=y?void 0:B,Zt=d.useMemo(()=>!y||!Array.isArray(O)||!B?null:O.map(Fe=>{const Ue=Ln(Fe,w);return l.jsx("input",{type:"hidden",form:u,name:B,value:Ue,disabled:P},Ue)}),[y,O,u,B,w,P]);return l.jsxs(Zf.Provider,{value:dt,children:[R,l.jsx("input",{..._.getValidationProps(P,{onFocus(){me.state.triggerElement?.focus({focusVisible:!0})},onChange(Fe){if(Fe.nativeEvent.defaultPrevented||P||g)return;const Ue=Fe.currentTarget.value,gt=Ce(Mt,Fe.nativeEvent);function Et(){if(y)return;const St=Ue.toLowerCase();let it=ee.current.findIndex(cn=>Ln(cn,w).toLowerCase()===St||$f(cn,C).toLowerCase()===St);it===-1&&(it=ee.current.findIndex((cn,On)=>{const kn=Z.current[On];return kn!=null&&kn.toLowerCase()===St}));const Rt=ee.current[it];Rt!=null&&ze(Rt,gt)}me.set("forceMount",!0),queueMicrotask(Et)}}),id:H&&Pt==null?`${H}-hidden-input`:void 0,form:u,name:Pt,autoComplete:f,value:Se,disabled:P,required:A&&!(y&&$e),readOnly:g,ref:kt,style:B?ta:$o,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Zt]})}function HC(e,t){return e??t}const LC=400,KC={...oi,...ji,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},WC=d.forwardRef(function(t,n){const{render:r,className:o,id:s,disabled:i=!1,nativeButton:a=!0,style:c,...u}=t,{setTouched:f,setFocused:h,validationMode:g,state:A,disabled:p}=Qo(),{labelId:m}=Pi(),{store:x,setOpen:v,selectionRef:b,validation:y,readOnly:C,required:w,alignItemWithTriggerActiveRef:I,disabled:S}=Vt(),R=p||S||i,E=we(x,ke.open),k=we(x,ke.mounted),F=we(x,ke.value),T=we(x,ke.triggerProps),N=we(x,ke.positionerElement),M=we(x,ke.listElement),D=we(x,ke.popupSide),L=we(x,ke.id),_=we(x,ke.labelId),j=we(x,ke.hasSelectedValue),H=k&&N?D:null,P=s??L,B=HC(m,_);Ni({id:P});const O=tt(N),G=d.useRef(null),{getButtonProps:z,buttonRef:U}=Gt({disabled:R,native:a}),Q=x.useStateSetter("triggerElement"),Z=pt(),K=pt(),te=pt();d.useEffect(()=>{if(E)return te.start(LC,()=>{b.current.allowUnselectedMouseUp=!0,b.current.allowSelectedMouseUp=!0}),()=>{te.clear()};b.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},K.clear()},[E,b,K,te]);const le=Bt(T,{id:P,role:"combobox","aria-expanded":E,"aria-haspopup":"listbox","aria-controls":E?M?.id??yo(N)?.id:void 0,"aria-labelledby":B,"aria-readonly":C||void 0,"aria-required":w||void 0,tabIndex:R?-1:0,onFocus(J){h(!0),E&&I.current&&v(!1,Ce(Mt,J.nativeEvent)),Z.start(0,()=>{x.set("forceMount",!0)})},onBlur(J){ve(N,J.relatedTarget)||(f(!0),h(!1),g==="onBlur"&&y.commit(F))},onMouseDown(J){if(E)return;const ce=Be(J.currentTarget);function ue(ge){if(!G.current)return;const ae=ge.target;ve(G.current,ae)||ve(O.current,ae)||Ld(ge,G.current)||v(!1,Ce(pu,ge))}K.start(0,()=>{ce.addEventListener("mouseup",ue,{once:!0})})}},u,z),X=y.getValidationProps(R,le);X.role="combobox";const ee={...A,open:E,disabled:R,value:F,readOnly:C,popupSide:H,placeholder:!j};return je("button",t,{ref:[n,G,U,Q],state:ee,stateAttributesMapping:KC,props:X})}),QC={value:()=>null},GC=d.forwardRef(function(t,n){const{className:r,render:o,children:s,placeholder:i,style:a,...c}=t,{store:u,valueRef:f}=Vt(),h=we(u,ke.value),g=we(u,ke.items),A=we(u,ke.itemToStringLabel),p=we(u,ke.hasSelectedValue),m=!p&&i!=null&&s==null,x=we(u,ke.hasNullItemLabel,m),v={value:h,placeholder:!p};let b=null;return typeof s=="function"?b=s(h):s!=null?b=s:m&&!x?b=i:Array.isArray(h)?b=NC(h,g,A):b=Xf(h,g,A),je("span",t,{state:v,ref:[n,f],props:[{children:b},c],stateAttributesMapping:QC})}),YC=d.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,{store:a}=Vt(),u={open:we(a,ke.open)};return je("span",t,{state:u,ref:n,props:[{"aria-hidden":!0,children:"▼"},i],stateAttributesMapping:_u})}),zC=d.forwardRef(function(t,n){const{store:r}=Vt(),o=we(r,ke.mounted),s=we(r,ke.forceMount);return o||s?l.jsx(na,{ref:n,...t}):null}),qf=d.createContext(void 0);function Ya(){const e=d.useContext(qf);if(!e)throw new Error(ot(59));return e}function _o(e,t){e&&Object.assign(e.style,t)}const ep={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},UC={position:"fixed"},VC=d.forwardRef(function(t,n){const{anchor:r,className:o,render:s,positionMethod:i,side:a,align:c,sideOffset:u,alignOffset:f,collisionBoundary:h="clipping-ancestors",collisionPadding:g,arrowPadding:A,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:x=!0,collisionAvoidance:v=Ku,style:b,...y}=t,{store:C,listRef:w,labelsRef:I,alignItemWithTriggerActiveRef:S,selectedItemTextRef:R,valuesRef:E,initialValueRef:k,popupRef:F,setValue:T,floatingContext:N}=Vt(),M=we(C,ke.open),D=we(C,ke.mounted),L=we(C,ke.modal),_=we(C,ke.value),j=we(C,ke.openMethod),H=we(C,ke.positionerElement),P=we(C,ke.triggerElement),B=we(C,ke.isItemEqualToValue),O=we(C,ke.transitionStatus),G=d.useRef(null),z=d.useRef(null),[U,Q]=d.useState(x),Z=D&&U&&j!=="touch";!D&&U!==x&&Q(x),d.useImperativeHandle(S,()=>Z),Od((Z||L)&&M,j==="touch",H,P);const K=Ia({anchor:r,floatingRootContext:N,positionMethod:i,mounted:D,side:a,sideOffset:u,align:c,alignOffset:f,arrowPadding:A,collisionBoundary:h,collisionPadding:g,sticky:p,disableAnchorTracking:m??Z,collisionAvoidance:v,keepMounted:!0}),te=Z?"none":K.side,le=Z?UC:K.positionerStyles,X={open:M,side:te,align:K.align,anchorHidden:K.anchorHidden};ie(()=>{C.set("popupSide",K.side)},[C,K.side]);const ee=C.useStateSetter("positionerElement"),J=wa(t,X,{styles:le,transitionStatus:O,props:y,refs:[n,ee],hidden:!D,inert:!M}),ce=d.useRef(0),ue=de(ae=>{if(E.current.length===0)return;const pe=ce.current;if(ce.current=ae.size,ae.size===pe)return;const oe=Ce(Mt);if(pe!==0&&!C.state.multiple&&_!==null&&xo(E.current,_,B)===-1){const se=k.current,me=se!=null&&xo(E.current,se,B)!==-1?se:null;T(me,oe),me===null&&(C.set("selectedIndex",null),R.current=null)}if(pe!==0&&C.state.multiple&&Array.isArray(_)){const re=_.filter(se=>xo(E.current,se,B)!==-1);re.length!==_.length&&(T(re,oe),re.length===0&&(C.set("selectedIndex",null),R.current=null))}if(M&&Z){C.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const re={height:""};_o(H,re),_o(F.current,re)}}),ge=d.useMemo(()=>({...K,side:te,alignItemWithTriggerActive:Z,setControlledAlignItemWithTrigger:Q,scrollUpArrowRef:G,scrollDownArrowRef:z}),[K,te,Z,Q]);return l.jsx(Ur,{elementsRef:w,labelsRef:I,onMapChange:ue,children:l.jsxs(qf.Provider,{value:ge,children:[D&&L&&l.jsx(va,{inert:ba(!M),cutout:P}),J]})})}),uo="base-ui-disable-scrollbar",Ci={className:uo,getElement(e){return l.jsx("style",{nonce:e,href:uo,precedence:"base-ui:low",children:`.${uo}{scrollbar-width:none}.${uo}::-webkit-scrollbar{display:none}`})}},ZC=d.createContext(void 0),JC={disableStyleElements:!1};function $C(){return d.useContext(ZC)??JC}const XC={...Wr,...Nn},qC=d.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:i,...a}=t,{store:c,popupRef:u,onOpenChangeComplete:f,setOpen:h,valueRef:g,firstItemTextRef:A,selectedItemTextRef:p,multiple:m,handleScrollArrowVisibility:x,scrollHandlerRef:v,listRef:b,highlightItemOnHover:y,floatingContext:C}=Vt(),{side:w,align:I,alignItemWithTriggerActive:S,isPositioned:R,setControlledAlignItemWithTrigger:E}=Ya(),k=Ea()!=null,F=is(),{nonce:T,disableStyleElements:N}=$C(),M=we(c,ke.id),D=we(c,ke.open),L=we(c,ke.openMethod),_=we(c,ke.mounted),j=we(c,ke.popupProps),H=we(c,ke.transitionStatus),P=we(c,ke.triggerElement),B=we(c,ke.positionerElement),O=we(c,ke.listElement),G=d.useRef(!1),z=d.useRef(!1),U=d.useRef({}),Q=qn(),Z=de(X=>{if(!B||!u.current||!z.current)return;const ee=B.style.top==="0px",J=B.style.bottom==="0px";if(G.current||!S||!ee&&!J){x(X);return}const ce=Yc(B),ue=yr(B.getBoundingClientRect().height,"y",ce),ge=Be(B),ae=rt(B),pe=ae.getComputedStyle(B),oe=parseFloat(pe.marginTop),re=parseFloat(pe.marginBottom),se=Gc(ae.getComputedStyle(u.current)),he=Math.min(ge.documentElement.clientHeight-oe-re,se),me=X.scrollTop,W=fo(X);let Y=null;const ye=Se=>{B.style.height=`${Se}px`},q=ee?W-me:me,ne=Math.min(ue+q,he);if(q<=Tt){const Se=vr(q,0,he-ue);Se>0&&ye(ue+Se),X.scrollTop=ee?W:0,he-(ue+Se)<=Tt&&(G.current=!0),x(X);return}if(he-ne>Tt)Y=ee?1/0:0;else if(J&&me<W){const Se=ue+q-he;Y=me-(q-Se)}const Ee=Math.ceil(ne);if(Ee!==0&&ye(Ee),Y!=null){const Se=vr(Y,0,fo(X));Math.abs(X.scrollTop-Se)>Tt&&(X.scrollTop=Se)}Ee>=he-Tt&&(G.current=!0),x(X)});d.useImperativeHandle(v,()=>Z,[Z]),Yt({open:D,ref:u,onComplete(){D&&f?.(!0)}});const K={open:D,transitionStatus:H,side:w,align:I};ie(()=>{!B||!u.current||Object.keys(U.current).length||(U.current={top:B.style.top||"0",left:B.style.left||"0",right:B.style.right,height:B.style.height,bottom:B.style.bottom,minHeight:B.style.minHeight,maxHeight:B.style.maxHeight,marginTop:B.style.marginTop,marginBottom:B.style.marginBottom})},[u,B]),ie(()=>{D||S||(z.current=!1,G.current=!1,_o(B,U.current))},[D,S,B,u]),ie(()=>{const X=u.current;if(!D||!P||!B||!X||S&&!R||c.state.transitionStatus==="ending")return;if(z.current=!0,X.style.removeProperty("--transform-origin"),!S){Q.request(()=>x(O||X));return}const ee=e1(X);try{let J=p.current;J?.isConnected||(J=!ke.hasSelectedValue(c.state)&&A.current?.isConnected?A.current:null);const ce=g.current,ue=rt(B),ge=ue.getComputedStyle(B),ae=ue.getComputedStyle(X),pe=Be(P),oe=Yc(P),re=po(P.getBoundingClientRect(),oe),se=po(B.getBoundingClientRect(),oe),he=re.height,me=O||X,W=me.scrollHeight,Y=parseFloat(ae.borderBottomWidth),ye=parseFloat(ge.marginTop)||10,q=parseFloat(ge.marginBottom)||10,ne=parseFloat(ge.minHeight)||100,Ee=Gc(ae),Se=5,Le=5,Je=20,We=pe.documentElement.clientHeight-ye-q,ut=pe.documentElement.clientWidth,$e=We-re.bottom+he;let Ye,mt=F==="rtl"?re.right-se.width:re.left,Ie=0;if(J&&ce){const dt=po(ce.getBoundingClientRect(),oe);Ye=po(J.getBoundingClientRect(),oe),mt=se.left+(F==="rtl"?dt.right-Ye.right:dt.left-Ye.left);const kt=dt.top-re.top+dt.height/2;Ie=Ye.top-se.top+Ye.height/2-kt}const ze=$e+Ie+q+Y;let Ne=Math.min(We,ze);const nt=We-ye-q,Re=ze-Ne,Ge=ut-Le;B.style.left=`${vr(mt,Se,Ge-se.width)}px`,B.style.height=`${Ne}px`,B.style.maxHeight="none",B.style.marginTop=`${ye}px`,B.style.marginBottom=`${q}px`,X.style.height="100%";const _e=fo(me),Ze=Re>=_e-Tt;Ze&&(Ne=Math.min(We,se.height)-(Re-_e));const st=re.top<Je||re.bottom>We-Je||Math.ceil(Ne)+Tt<Math.min(W,ne),ht=(ue.visualViewport?.scale??1)!==1&&an;if(st||ht){_o(B,U.current),E(!1);return}const yt=Math.max(ne,Ne);if(Ze){const dt=Math.max(0,We-ze);B.style.top=se.height>=nt?"0":`${dt}px`,B.style.height=`${Ne}px`,me.scrollTop=fo(me)}else B.style.bottom="0",me.scrollTop=Re;if(Ye){const dt=se.top,kt=se.height,Pt=Ye.top+Ye.height/2,Zt=vr(kt>0?(Pt-dt)/kt*100:50,0,100);X.style.setProperty("--transform-origin",`50% ${Zt}%`)}(yt===We||Ne>=Ee)&&(G.current=!0),x(me),y&&c.state.selectedIndex===null&&c.state.activeIndex===null&&b.current[0]!=null&&c.set("activeIndex",0)}finally{ee()}},[c,D,B,P,g,A,p,u,x,S,E,Q,O,b,y,F,R]),d.useEffect(()=>{if(!S||!B||!D)return;const X=rt(B);function ee(J){h(!1,Ce(Lp,J))}return De(X,"resize",ee)},[h,S,B,D]);const te={...O?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":m||void 0,id:`${M}-list`},onKeyDown(X){k&&rs.has(X.key)&&X.stopPropagation()},onScroll(X){O||Z(X.currentTarget)},...S&&{style:O?{height:"100%"}:ep},className:!O&&S?Ci.className:void 0},le=je("div",t,{ref:[n,u],state:K,stateAttributesMapping:XC,props:[j,te,as(H),a]});return l.jsxs(d.Fragment,{children:[!N&&Ci.getElement(T),l.jsx(sa,{context:C,modal:!1,disabled:!_,openInteractionType:L,returnFocus:i,restoreFocus:!0,children:le})]})});function Gc(e){const t=e.maxHeight;return t.endsWith("px")&&parseFloat(t)||1/0}function fo(e){return Ga(e.scrollHeight,e.clientHeight)}function Yc(e){return nd.getScale(e)}function yr(e,t,n){return e/n[t]}function po(e,t){return Dr({x:yr(e.x,"x",t),y:yr(e.y,"y",t),width:yr(e.width,"x",t),height:yr(e.height,"y",t)})}const zc=[["transform","none"],["scale","1"],["translate","0 0"]];function e1(e){const{style:t}=e,n={};for(const[r,o]of zc)n[r]=t.getPropertyValue(r),t.setProperty(r,o,"important");return()=>{for(const[r]of zc){const o=n[r];o?t.setProperty(r,o):t.removeProperty(r)}}}const t1=d.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,{store:a,scrollHandlerRef:c,multiple:u}=Vt(),{alignItemWithTriggerActive:f}=Ya(),h=we(a,ke.hasScrollArrows),g=we(a,ke.openMethod),p={id:`${we(a,ke.id)}-list`,role:"listbox","aria-multiselectable":u||void 0,onScroll(x){c.current?.(x.currentTarget)},...f&&{style:ep},className:h&&g!=="touch"?Ci.className:void 0},m=a.useStateSetter("listElement");return je("div",t,{ref:[n,m],props:[p,i]})}),tp=d.createContext(void 0);function za(){const e=d.useContext(tp);if(!e)throw new Error(ot(57));return e}const n1=d.memo(d.forwardRef(function(t,n){const{render:r,className:o,style:s,value:i=null,label:a,disabled:c=!1,nativeButton:u=!1,...f}=t,h=d.useRef(null),g=fs({guess:!0,label:a,textRef:h}),{store:A,itemProps:p,setOpen:m,setValue:x,selectionRef:v,typingRef:b,valuesRef:y,multiple:C,selectedItemTextRef:w,disabled:I,readOnly:S}=Vt(),R=I||c,E=we(A,ke.isActive,g.index),k=we(A,ke.open),F=we(A,ke.isSelected,i),T=we(A,ke.isSelectedByFocus,g.index),N=we(A,ke.isItemEqualToValue),M=g.index,D=d.useRef(null);ie(()=>{const Q=y.current;return Q[M]=i,()=>{delete Q[M]}},[M,i,y]),ie(()=>{const Q=A.state.value;let Z=Q;C&&Array.isArray(Q)&&(Z=Q.length>0?Q[Q.length-1]:void 0),Z!==void 0&&or(i,Z,N)&&(A.set("selectedIndex",M),h.current&&(w.current=h.current))},[M,C,N,A,i,w]);const L=d.useRef("mouse"),_=d.useRef(!1),{getButtonProps:j,buttonRef:H}=Gt({disabled:R,focusableWhenDisabled:!0,native:u,composite:!0}),P={disabled:R,selected:F,highlighted:E};function B(Q){if(I||S)return;const Z=A.state.value;if(C){const K=Array.isArray(Z)?Z:[],te=F?PC(K,i,N):[...K,i];x(te,Ce(Cr,Q))}else x(i,Ce(Cr,Q)),m(!1,Ce(Cr,Q))}function O(){v.current.dragY=0}const G={role:"option","aria-selected":F,tabIndex:k&&E?0:-1,onKeyDown(Q){A.set("activeIndex",M),Q.key===" "&&b.current&&Q.preventDefault()},onClick(Q){const Z=L.current!=="touch",K=Q.nativeEvent.pointerType,te=Z&&Qi(Q.nativeEvent)&&(K!==void 0||E),le=Z&&!te&&!_.current;_.current=!1,!(R||le)&&B(Q.nativeEvent)},onPointerEnter(Q){L.current=Q.pointerType},onPointerMove(Q){if(Q.pointerType==="mouse"&&Q.buttons===1){const Z=v.current;Z.dragY+=Q.movementY,Z.dragY**2>=64&&(Z.allowUnselectedMouseUp=!0)}},onPointerDown(Q){L.current=Q.pointerType,_.current=!0,O()},onMouseUp(){if(O(),R||L.current==="touch"||_.current)return;const Q=!v.current.allowSelectedMouseUp&&F,Z=!v.current.allowUnselectedMouseUp&&!F;Q||Z||(_.current=!0,D.current?.click(),_.current=!1)}},z=je("div",t,{ref:[H,n,g.ref,D],state:P,props:[p,G,f,j]}),U=d.useMemo(()=>({selected:F,index:M,textRef:h,selectedByFocus:T}),[F,M,h,T]);return l.jsx(tp.Provider,{value:U,children:z})})),r1=d.forwardRef(function(t,n){const{selected:r}=za();return t.keepMounted||r?l.jsx(o1,{...t,ref:n}):null}),o1=d.memo(d.forwardRef((e,t)=>{const{render:n,className:r,style:o,keepMounted:s,...i}=e,{selected:a}=za(),c=d.useRef(null),{transitionStatus:u,setMounted:f}=sr(a),g=je("span",e,{ref:[t,c],state:{selected:a,transitionStatus:u},props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:Nn});return Yt({open:a,ref:c,onComplete(){a||f(!1)}}),g})),s1=d.memo(d.forwardRef(function(t,n){const{index:r,textRef:o,selectedByFocus:s}=za(),{firstItemTextRef:i,selectedItemTextRef:a}=Vt(),{render:c,className:u,style:f,...h}=t,g=d.useCallback(p=>{p&&(r===0&&(i.current=p),s&&(a.current=p))},[i,a,r,s]);return je("div",t,{ref:[g,n,o],props:h})})),np=d.forwardRef(function(t,n){const{render:r,className:o,style:s,direction:i,keepMounted:a,...c}=t,u=i==="up",{store:f,popupRef:h,listRef:g,handleScrollArrowVisibility:A,scrollArrowsMountedCountRef:p}=Vt(),{side:m,scrollDownArrowRef:x,scrollUpArrowRef:v}=Ya(),b=u?ke.scrollUpArrowVisible:ke.scrollDownArrowVisible,y=we(f,b),C=we(f,ke.openMethod),w=y&&C!=="touch",I=pt(),S=u?v:x,{mounted:R,transitionStatus:E,setMounted:k}=sr(w);ie(()=>(p.current+=1,f.set("hasScrollArrows",!0),()=>{p.current=Math.max(0,p.current-1),p.current===0&&f.set("hasScrollArrows",!1)}),[f,p]),Yt({open:w,ref:S,onComplete(){w||k(!1)}});const N=je("div",t,{ref:[n,S],state:{direction:i,visible:w,side:m,transitionStatus:E},props:[{"aria-hidden":!0,children:u?"▲":"▼",style:{position:"absolute"},onMouseMove(D){if(D.movementX===0&&D.movementY===0||I.isStarted())return;f.set("activeIndex",null);function L(){const _=f.state.listElement??h.current;if(!_)return;f.set("activeIndex",null),A(_);const j=Ga(_.scrollHeight,_.clientHeight),H=No(_.scrollTop,j),P=H===(u?0:j),B=g.current;if(H!==_.scrollTop&&(_.scrollTop=H),P){I.clear();return}if(B.length>0){const O=S.current?.offsetHeight||0;_.scrollTop=i1(B,u,H,_.clientHeight,O,j)}I.start(40,L)}I.start(40,L)},onMouseLeave(){I.clear()}},c],stateAttributesMapping:Nn});return R||a?N:null});function i1(e,t,n,r,o,s){if(t){let f=0;const h=n+o-Tt;for(let p=0;p<e.length;p+=1){const m=e[p];if(m&&m.offsetTop>=h){f=p;break}}const g=Math.max(0,f-1),A=e[g];return g<f&&A?No(A.offsetTop-o,s):0}let i=e.length-1;const a=n+r-o+Tt;for(let f=0;f<e.length;f+=1){const h=e[f];if(h&&h.offsetTop+h.offsetHeight>a){i=Math.max(0,f-1);break}}const c=Math.min(e.length-1,i+1),u=e[c];return c>i&&u?No(u.offsetTop+u.offsetHeight-r+o,s):s}const a1=d.forwardRef(function(t,n){return l.jsx(np,{...t,ref:n,direction:"down"})}),l1=d.forwardRef(function(t,n){return l.jsx(np,{...t,ref:n,direction:"up"})}),c1=OC;function u1({className:e,...t}){return l.jsx(GC,{"data-slot":"select-value",className:fe("flex flex-1 text-left",e),...t})}function d1({className:e,size:t="default",children:n,...r}){return l.jsxs(WC,{"data-slot":"select-trigger","data-size":t,className:fe("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,l.jsx(YC,{render:l.jsx(Tn,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function f1({className:e,children:t,side:n="bottom",sideOffset:r=4,align:o="center",alignOffset:s=0,alignItemWithTrigger:i=!0,...a}){return l.jsx(zC,{children:l.jsx(VC,{side:n,sideOffset:r,align:o,alignOffset:s,alignItemWithTrigger:i,className:"isolate z-50",children:l.jsxs(qC,{"data-slot":"select-content","data-align-trigger":i,className:fe("cn-menu-target cn-menu-translucent relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...a,children:[l.jsx(p1,{}),l.jsx(t1,{children:t}),l.jsx(h1,{})]})})})}function Gs({className:e,children:t,...n}){return l.jsxs(n1,{"data-slot":"select-item",className:fe("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[l.jsx(s1,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:t}),l.jsx(r1,{render:l.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:l.jsx(_i,{className:"pointer-events-none"})})]})}function p1({className:e,...t}){return l.jsx(l1,{"data-slot":"select-scroll-up-button",className:fe("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:l.jsx(Oi,{})})}function h1({className:e,...t}){return l.jsx(a1,{"data-slot":"select-scroll-down-button",className:fe("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:l.jsx(Tn,{})})}const rp=d.createContext(void 0);function A1(){const e=d.useContext(rp);if(e===void 0)throw new Error(ot(63));return e}const op={...ji,checked(e){return e?{"data-checked":""}:{"data-unchecked":""}}},g1=d.forwardRef(function(t,n){const{checked:r,className:o,defaultChecked:s,"aria-labelledby":i,form:a,id:c,inputRef:u,name:f,nativeButton:h=!1,onCheckedChange:g,readOnly:A=!1,required:p=!1,disabled:m=!1,render:x,uncheckedValue:v,value:b,style:y,...C}=t,{clearErrors:w}=Mi(),{state:I,setTouched:S,setDirty:R,validityData:E,setFilled:k,setFocused:F,validationMode:T,disabled:N,name:M,validation:D}=Qo(),{labelId:L}=Pi(),_=N||m,j=M??f,H=d.useRef(null),P=Qt(H,u,D.inputRef),B=d.useRef(null),O=It(),G=Ni({id:c,implicit:!1,controlRef:B}),z=h?void 0:G,[U,Q]=on({controlled:r,default:!!s,name:"Switch",state:"checked"});Ti(B,O,U,void 0,!_,f),ie(()=>{H.current&&k(H.current.checked)},[k]),ss(U,()=>{w(j),R(U!==E.initialValue),k(U),D.change(U)});const{getButtonProps:Z,buttonRef:K}=Gt({disabled:_,native:h}),te=bu(i,L,H,!h,z),le={id:h?G:O,role:"switch","aria-checked":U,"aria-readonly":A||void 0,"aria-required":p||void 0,"aria-labelledby":te,onFocus(){_||F(!0)},onBlur(){const ce=H.current;!ce||_||(S(!0),F(!1),T==="onBlur"&&D.commit(ce.checked))},onClick(ce){if(A||_)return;ce.preventDefault();const ue=H.current;ue&&Fi(ue,ce)}},X={...D.getValidationProps(_),checked:U,disabled:_,form:a,id:z,name:j,required:p,style:j?ta:$o,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:P,onChange(ce){if(ce.nativeEvent.defaultPrevented)return;if(A){ce.preventDefault();return}const ue=ce.currentTarget.checked,ge=Ce(Mt,ce.nativeEvent);g?.(ue,ge),!ge.isCanceled&&Q(ue)},onClick(ce){ce.stopPropagation()},onFocus(){B.current?.focus()},...b!==void 0?{value:b}:ct},ee=d.useMemo(()=>({...I,checked:U,disabled:_,readOnly:A,required:p}),[I,U,_,A,p]),J=je("span",t,{state:ee,ref:[n,B,K],props:[le,C,Z,ce=>D.getValidationProps(_,ce)],stateAttributesMapping:op});return l.jsxs(rp.Provider,{value:ee,children:[J,!U&&j&&v!==void 0&&l.jsx("input",{type:"hidden",form:a,name:j,value:v,disabled:_}),l.jsx("input",{...X,suppressHydrationWarning:!0})]})}),m1=d.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,a=A1();return je("span",t,{state:a,ref:n,stateAttributesMapping:op,props:i})});function ur({className:e,size:t="default",...n}){return l.jsx(g1,{"data-slot":"switch","data-size":t,className:fe("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...n,children:l.jsx(m1,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}function x1({frozen:e,values:t,defaults:n,candidates:r,candidatesPort:o,selectedIconRef:s,uploadedIconUrl:i,iconAnalysis:a,iconComposition:c,iconComposeError:u,iconBackground:f,iconScale:h,onIconBackgroundChange:g,onIconScaleChange:A,selectedTrayRef:p,uploadedTrayUrl:m,selectedPort:x,targetDirExists:v,onPickIconCandidate:b,onUploadIcon:y,onClearIcon:C,onPickTray:w,onUploadTray:I,onClearTray:S,onPatch:R,onConfirm:E}){return l.jsxs("section",{className:"rounded-xl border border-border bg-card p-4",children:[l.jsx(FC,{values:t,defaults:n,frozen:e,iconCandidates:r,iconCandidatesPort:o,uploadedIconUrl:i,selectedIconRef:s,iconAnalysis:a,iconComposition:c,iconComposeError:u,iconBackground:f,iconScale:h,onIconBackgroundChange:g,onIconScaleChange:A,onPickIconCandidate:b,onUploadIcon:y,onClearIcon:C,onPatch:R}),l.jsx(Fa,{className:"mt-4 border-t border-border pt-1",children:l.jsxs(Ba,{value:"advanced",className:"border-b-0",children:[l.jsx(ja,{children:"高级选项"}),l.jsxs(Ma,{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[l.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border p-3",children:[l.jsx(ur,{id:"showStartupTerminal",checked:t.showStartupTerminal,disabled:e,onCheckedChange:k=>R({showStartupTerminal:k})}),l.jsxs("div",{children:[l.jsx(Me,{htmlFor:"showStartupTerminal",className:"text-foreground",children:"显示启动终端"}),l.jsxs("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:[l.jsx(Sr,{className:"mr-0.5 inline size-3"}),"应用启动时打开独立终端窗口,实时显示命令的 PTY 输出(可交互)。"]})]})]}),l.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border p-3",children:[l.jsx(ur,{id:"showAddressBar",checked:t.showAddressBar,disabled:e,onCheckedChange:k=>R({showAddressBar:k})}),l.jsxs("div",{children:[l.jsx(Me,{htmlFor:"showAddressBar",className:"text-foreground",children:"显示地址栏"}),l.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:"服务窗口顶部显示地址栏(Web Navigation API 管理导航)。"})]})]}),l.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border p-3",children:[l.jsx(ur,{id:"imageSmoothingEnabled",checked:t.imageSmoothingEnabled,disabled:e,onCheckedChange:k=>R({imageSmoothingEnabled:k})}),l.jsxs("div",{children:[l.jsx(Me,{htmlFor:"imageSmoothingEnabled",className:"text-foreground",children:"平滑缩放(imageSmoothingEnabled)"}),l.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:"默认开启高质量缩放;上传低分辨率像素风图标时关闭可保留硬边锯齿(等比放大应用到应用图标前景与托盘图标)。"})]})]}),l.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border p-3",children:[l.jsx(ur,{id:"developerMode",checked:t.developerMode,disabled:e,onCheckedChange:k=>R({developerMode:k})}),l.jsxs("div",{children:[l.jsx(Me,{htmlFor:"developerMode",className:"text-foreground",children:"允许开发者模式"}),l.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:"仅表示生成应用内的 WebView DevTools 准入;不改变其它行为。"})]})]})]}),l.jsxs("div",{children:[l.jsx(Me,{children:"托盘图标"}),l.jsx("p",{className:"mb-1.5 mt-0.5 text-[11px] text-muted-foreground",children:"默认与应用图标一致;纯色候选适合系统托盘(macOS 模板风格)。"}),l.jsx(BC,{candidates:r,port:o,disabled:e,selectedRef:p,uploadedUrl:m,includeVariants:!0,defaultLabel:"默认跟随应用图标",onPick:w,onUpload:I,onClear:S})]}),l.jsxs("div",{children:[l.jsx(Me,{htmlFor:"pm",children:"包管理器"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] leading-relaxed text-muted-foreground",children:"仅为生成的应用安装依赖时使用的工具(决定 install 命令与锁文件形态),不影响应用本身的运行方式——生成的应用始终以 Node 启动。默认自动跟随你启动向导所用的包管理器,一般无需修改。"}),l.jsxs(c1,{value:t.pm,disabled:e,onValueChange:k=>R({pm:k}),children:[l.jsx(d1,{id:"pm",className:"mt-0",children:l.jsx(u1,{})}),l.jsxs(f1,{children:[l.jsx(Gs,{value:"npm",children:"npm"}),l.jsx(Gs,{value:"pnpm",children:"pnpm"}),l.jsx(Gs,{value:"bun",children:"bun"})]})]})]}),l.jsxs("div",{className:"rounded-lg border border-border p-3",children:[l.jsx(Me,{children:"生成位置"}),l.jsx("p",{className:"mt-1 font-mono text-[11px] break-all text-muted-foreground",children:n.targetDir||"~/.opentray/create/<应用名>"}),l.jsx("p",{className:"mt-1.5 text-[11px] leading-relaxed text-muted-foreground",children:"生成的项目默认落在 OpenTray 主目录下,同一命令重复创建会落到同一位置; 也可在启动向导时通过位置参数指定其他目录。"}),v?l.jsx("p",{className:"mt-2 text-[11px] font-medium text-amber-400",children:"目标目录已存在且非空——继续生成会失败,或开启下方强制覆盖。"}):null,l.jsxs("div",{className:"mt-3 flex items-start gap-3",children:[l.jsx(ur,{id:"force-overwrite",checked:t.force,disabled:e,onCheckedChange:k=>R({force:k})}),l.jsxs("div",{children:[l.jsx(Me,{htmlFor:"force-overwrite",className:"text-foreground",children:"强制覆盖已存在的目录"}),l.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:"开启后将清空目标目录内的现有内容并重新生成(等同 --force)。请确认目录中没有你需要的文件。"})]})]})]})]})]})}),l.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[l.jsx(Oe,{onClick:E,disabled:e,children:"确定创建应用"}),l.jsx("span",{className:"text-xs text-muted-foreground",children:x!==void 0?`已选服务 :${x}(点击状态栏服务可切换)`:"未运行也不影响:应用启动时会自行嗅探命令的监听端口"})]})]})}var ho={},Ys,Uc;function b1(){if(Uc)return Ys;Uc=1;var e=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],t=/[\n\r\u2028\u2029]/,n=/[\s#!"$&'():;<=>@\\^`|]/g;return Ys=function(o){return o.map(function(s){if(s==="")return"''";if(s&&typeof s=="object"){if("op"in s&&s.op==="glob"){if(typeof s.pattern!="string")throw new TypeError("glob token requires a string `pattern`");if(t.test(s.pattern))throw new TypeError("glob `pattern` must not contain line terminators");return s.pattern.replace(n,"\\$&")}if("op"in s&&typeof s.op=="string"){if(e.indexOf(s.op)<0)throw new TypeError("invalid `op` value: "+JSON.stringify(s.op));return s.op.replace(/[\s\S]/g,"\\$&")}if("comment"in s&&typeof s.comment=="string"){if(t.test(s.comment))throw new TypeError("`comment` must not contain line terminators");return"#"+s.comment}throw new TypeError("unrecognized object token shape")}return/["\s\\]/.test(s)&&!/'/.test(s)?"'"+s.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(s)?'"'+s.replace(/(["\\$`!])/g,"\\$1")+'"':String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")},Ys}var zs,Vc;function v1(){if(Vc)return zs;Vc=1;for(var e="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",t=new RegExp("^"+e+"$"),n="|&;()<> \\t",r="'([^']*?)'",o='"((\\\\"|[^"])*?)"',s=/^#$/,i="'",a='"',c="$",u="",f=4294967296,h=0;h<4;h++)u+=(f*Math.random()).toString(16);var g=new RegExp("^"+u);function A(x,v){for(var b=v.lastIndex,y=[],C;C=v.exec(x);)y[y.length]=C,v.lastIndex===C.index&&(v.lastIndex+=1);return v.lastIndex=b,y}function p(x,v,b){var y=typeof x=="function"?x(b):x[b];return typeof y>"u"&&b!=""?y="":typeof y>"u"&&(y="$"),typeof y=="object"?v+u+JSON.stringify(y)+u:v+y}function m(x,v,b){b||(b={});var y=b.escape||"\\",C=b.splitUnquoted===!0?`
|
|
20
|
-
`:typeof b.splitUnquoted=="string"?b.splitUnquoted:"",
|
|
21
|
-
`?0:1:
|
|
22
|
-
`&&(L+=1)}}else N+=B}}if(_)return{op:"glob",pattern:N};if(C){if(L!==null&&L>0){M[M.length]=N,N="";for(var Q=1;Q<L;Q+=1)M[M.length]=""}return(N!==""||D&&M.length===0)&&(M[M.length]=N),M}return N}).reduce(function(E,k){return typeof k>"u"||[].concat(k).forEach(function(F){E[E.length]=F}),E},[])}return zs=function(v,b,y){var C=m(v,b,y);return typeof b!="function"?C:C.reduce(function(w,I){if(typeof I=="object")return w[w.length]=I,w;var S=I.split(RegExp("("+u+".*?"+u+")","g"));return S.length===1?(w[w.length]=S[0],w):(S.filter(Boolean).forEach(function(R){w[w.length]=g.test(R)?JSON.parse(R.split(u)[1]):R}),w)},[])},zs}var Zc;function y1(){return Zc||(Zc=1,ho.quote=b1(),ho.parse=v1()),ho}var C1=y1();const sp=["npm","go","rust","python","dotnet","custom"],pn={npm:"npm",go:"Go",rust:"Rust",python:"Python",dotnet:".NET",custom:"自定义"},I1={npm:"npmjs",go:"golang",rust:"rust",python:"python",dotnet:"dotnet"},ip=["npx","pnpx","bunx","yarn dlx","nubx","deno run","vpx"],w1=["uvx","pipx run"],ap={family:"npm",runner:"npx",runnerFlags:"",pkg:"",version:"",args:"",binary:"",raw:""},Ua=e=>{if(/["']/.test(e)){const r=(e.match(/'/gu)??[]).length,o=(e.match(/"/gu)??[]).length;if(r%2===1||o%2===1)return[]}const t=C1.parse(e),n=[];for(const r of t){if(typeof r!="string")return[];n.push(r)}return n.length===0?[]:n},Va=e=>e.startsWith("-")&&e.length>1,Rn=e=>{const t=e.lastIndexOf("@");return t>0?{base:e.slice(0,t),version:e.slice(t+1)}:{base:e,version:""}},Gn=e=>e.map(t=>t.trim()).filter(t=>t.length>0).join(" "),dr=(e,t)=>{if(t.trim().length===0)return e;const{version:n}=Rn(e);return n.length>0?e:`${e}@${t.trim()}`},k1=e=>/^(npm|jsr):/.test(e)?e:`npm:${e}`,E1=/^[A-Za-z0-9@._/:+=-]+$/u,S1=e=>E1.test(e)&&e.length>0?e:`'${e.replaceAll("'","'\\''")}'`,Sn=e=>e.map(S1).join(" "),fr=e=>{const t=[];let n=0;for(;n<e.length&&Va(e[n]??"");)t.push(e[n]??""),n+=1;return{flags:t,rest:e.slice(n)}},R1=[new Set(["-A","--allow-all","--allow-read","--allow-write","--allow-net","--allow-env","--allow-run","--allow-sys","--allow-ffi","--allow-hrtime","--no-check","--no-remote","--quiet","-q","--cached-only"]),new Set(["-y","--yes"])],D1=e=>e.includes("=")?!1:R1.some(t=>t.has(e)),pr=e=>e.every(t=>D1(t)),F1=(e,t)=>{const n=t.split(" ");if(e.length<n.length)return-1;for(let r=0;r<n.length;r+=1)if((e[r]??"")!==(n[r]??""))return-1;return n.length},hn=e=>({...ap,...e}),hr=e=>hn({family:"custom",raw:Sn(e)}),B1=e=>{const t=e[0]??"",n=e[1]??"";for(const r of ip){const o=F1(e,r);if(o>0){const{flags:s,rest:i}=fr(e.slice(o));if(!pr(s))return hr(e);const a=i[0]??"",{base:c,version:u}=a.length>0?Rn(a):{base:"",version:""};return hn({family:"npm",runner:r,runnerFlags:s.join(" "),pkg:c,version:u,args:Sn(i.slice(1)),raw:e.join(" ")})}}if(t==="go"&&n==="run"){const{flags:r,rest:o}=fr(e.slice(2));if(!pr(r))return hr(e);const s=o[0]??"",{base:i,version:a}=s.length>0?Rn(s):{base:"",version:""};return hn({family:"go",runner:"",runnerFlags:r.join(" "),pkg:i,version:a,args:Sn(o.slice(1)),raw:e.join(" ")})}if(t==="cargo"&&n==="install"){const{flags:r,rest:o}=fr(e.slice(2));if(!pr(r))return hr(e);const s=o[0]??"",i=s.length>0?Rn(s).base:"";return hn({family:"rust",runner:"",runnerFlags:r.join(" "),pkg:i,args:Sn(o.slice(1)),raw:e.join(" ")})}if(t==="uvx"||t==="pipx"&&n==="run"){const r=t==="uvx"?1:2,{flags:o,rest:s}=fr(e.slice(r));if(!pr(o))return hr(e);const i=s[0]??"",{base:a,version:c}=i.length>0?Rn(i):{base:"",version:""};return hn({family:"python",runner:t==="uvx"?"uvx":"pipx run",runnerFlags:o.join(" "),pkg:a,version:c,args:Sn(s.slice(1)),raw:e.join(" ")})}if(t==="dnx"){const{flags:r,rest:o}=fr(e.slice(1));if(!pr(r))return hr(e);const s=o[0]??"",{base:i,version:a}=s.length>0?Rn(s):{base:"",version:""};return hn({family:"dotnet",runner:"",runnerFlags:r.join(" "),pkg:i,version:a,args:Sn(o.slice(1)),raw:e.join(" ")})}return hn({family:"custom",raw:Sn(e)})},j1=e=>{const t=Ua(e);return t.length===0?hn({family:"custom",raw:e}):B1(t)},lp=e=>{const t=e.pkg.trim(),n=e.binary.trim().length>0?e.binary.trim():t;return{install:Gn(["cargo","install",e.runnerFlags,t]),run:Gn([n,e.args])}},Ii=e=>{switch(e.family){case"custom":return e.raw.trim();case"rust":return lp(e).run;case"npm":{const t=e.runner==="deno run"?k1(dr(e.pkg.trim(),e.version)):dr(e.pkg.trim(),e.version);return Gn([e.runner,e.runnerFlags,t,e.args])}case"go":return Gn(["go","run",e.runnerFlags,dr(e.pkg.trim(),e.version),e.args]);case"python":return Gn([e.runner,e.runnerFlags,dr(e.pkg.trim(),e.version),e.args]);case"dotnet":return Gn(["dnx",e.runnerFlags,dr(e.pkg.trim(),e.version),e.args])}},Ar=(e,t)=>{const n=e.trim().replace(/^(npm|jsr):/,""),r=n.split(/[/\\]/).filter(i=>i.length>0&&!i.startsWith("@")),o=r[r.length-1]??n;let s=Rn(o).base.toLowerCase();return t==="python"&&(s=s.replace(/[._]/g,"-")),s.replace(/[^a-z0-9-]/g,"")},gr=e=>{const t=[];for(const n of Ua(e)){if(Va(n))break;const r=n.toLowerCase().replace(/[^a-z0-9-]/g,"");if(r.length===0)break;t.push(r)}return t},M1=e=>{if(e.family==="custom"){const i=[];for(const u of Ua(e.raw)){if(Va(u))break;i.push(u)}const a=i.map(u=>{const f=u.split(/[/\\]/).filter(h=>h.length>0);if(f.some(h=>h.startsWith("@"))){const h=f.filter(g=>!g.startsWith("@"));return(h[h.length-1]??"").split("@")[0]??""}return(f[f.length-1]??u).split("@")[0]??""}).filter(u=>u.length>0).reverse(),c=a.length>0?a.join("."):"app.opentray";return{appId:c,appName:c==="app.opentray"?"Opentray App":c.split(".").filter(u=>u.length>0).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join(" "),identitySegments:a,tail:""}}const t=I1[e.family];let n;switch(e.family){case"npm":n=[...gr(e.args),Ar(e.pkg,"npm")];break;case"go":n=[...gr(e.args),Ar(e.pkg,"go")];break;case"rust":{const i=Ar(e.pkg,"rust"),a=e.binary.trim().length>0?e.binary.trim().toLowerCase().replace(/[^a-z0-9-]/g,""):i;n=[...gr(e.args),a];break}case"python":n=[...gr(e.args),Ar(e.pkg,"python")];break;case"dotnet":n=[...gr(e.args),Ar(e.pkg,"dotnet")];break}const r=n.filter(i=>i.length>0),o=r.length>0?`${r.join(".")}.${t}`:"app.opentray",s=r.length>0?r.map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "):"Opentray App";return{appId:o,appName:s,identitySegments:r,tail:t}},P1=e=>{const t=e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return t.length>0?t:"opentray-app"},T1=(e,t)=>{let n;for(const r of e)r.key.trim()===t&&(n=r.value);return n},N1=e=>e.family==="npm"&&(e.runner==="npx"||e.runner==="pnpx")?[{key:"npm_config_yes",value:"true",note:"跳过 npm 安装确认(等效 -y),首次运行无需交互"}]:[],_1='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>.NET</title><path d="M24 8.77h-2.468v7.565h-1.425V8.77h-2.462V7.53H24zm-6.852 7.565h-4.821V7.53h4.63v1.24h-3.205v2.494h2.953v1.234h-2.953v2.604h3.396zm-6.708 0H8.882L4.78 9.863a2.896 2.896 0 0 1-.258-.51h-.036c.032.189.048.592.048 1.21v5.772H3.157V7.53h1.659l3.965 6.32c.167.261.275.442.323.54h.024c-.04-.233-.06-.629-.06-1.185V7.529h1.372zm-8.703-.693a.868.829 0 0 1-.869.829.868.829 0 0 1-.868-.83.868.829 0 0 1 .868-.828.868.829 0 0 1 .869.829Z"/></svg>',O1='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Go</title><path d="M1.811 10.231c-.047 0-.058-.023-.035-.059l.246-.315c.023-.035.081-.058.128-.058h4.172c.046 0 .058.035.035.07l-.199.303c-.023.036-.082.07-.117.07zM.047 11.306c-.047 0-.059-.023-.035-.058l.245-.316c.023-.035.082-.058.129-.058h5.328c.047 0 .07.035.058.07l-.093.28c-.012.047-.058.07-.105.07zm2.828 1.075c-.047 0-.059-.035-.035-.07l.163-.292c.023-.035.07-.07.117-.07h2.337c.047 0 .07.035.07.082l-.023.28c0 .047-.047.082-.082.082zm12.129-2.36c-.736.187-1.239.327-1.963.514-.176.046-.187.058-.34-.117-.174-.199-.303-.327-.548-.444-.737-.362-1.45-.257-2.115.175-.795.514-1.204 1.274-1.192 2.22.011.935.654 1.706 1.577 1.835.795.105 1.46-.175 1.987-.77.105-.13.198-.27.315-.434H10.47c-.245 0-.304-.152-.222-.35.152-.362.432-.97.596-1.274a.315.315 0 01.292-.187h4.253c-.023.316-.023.631-.07.947a4.983 4.983 0 01-.958 2.29c-.841 1.11-1.94 1.8-3.33 1.986-1.145.152-2.209-.07-3.143-.77-.865-.655-1.356-1.52-1.484-2.595-.152-1.274.222-2.419.993-3.424.83-1.086 1.928-1.776 3.272-2.02 1.098-.2 2.15-.07 3.096.571.62.41 1.063.97 1.356 1.648.07.105.023.164-.117.2m3.868 6.461c-1.064-.024-2.034-.328-2.852-1.029a3.665 3.665 0 01-1.262-2.255c-.21-1.32.152-2.489.947-3.529.853-1.122 1.881-1.706 3.272-1.95 1.192-.21 2.314-.095 3.33.595.923.63 1.496 1.484 1.648 2.605.198 1.578-.257 2.863-1.344 3.962-.771.783-1.718 1.273-2.805 1.495-.315.06-.63.07-.934.106zm2.78-4.72c-.011-.153-.011-.27-.034-.387-.21-1.157-1.274-1.81-2.384-1.554-1.087.245-1.788.935-2.045 2.033-.21.912.234 1.835 1.075 2.21.643.28 1.285.244 1.905-.07.923-.48 1.425-1.228 1.484-2.233z"/></svg>',H1='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>npm</title><path d="M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z"/></svg>',L1='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Python</title><path d="M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02 1.27.05zm-6.3 1.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09 3.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14 1.04.05 1.23-.06 1.23-.16 1.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01 2.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01zm-6.47 14.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z"/></svg>',K1='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Rust</title><path d="M23.8346 11.7033l-1.0073-.6236a13.7268 13.7268 0 00-.0283-.2936l.8656-.8069a.3483.3483 0 00-.1154-.578l-1.1066-.414a8.4958 8.4958 0 00-.087-.2856l.6904-.9587a.3462.3462 0 00-.2257-.5446l-1.1663-.1894a9.3574 9.3574 0 00-.1407-.2622l.49-1.0761a.3437.3437 0 00-.0274-.3361.3486.3486 0 00-.3006-.154l-1.1845.0416a6.7444 6.7444 0 00-.1873-.2268l.2723-1.153a.3472.3472 0 00-.417-.4172l-1.1532.2724a14.0183 14.0183 0 00-.2278-.1873l.0415-1.1845a.3442.3442 0 00-.49-.328l-1.076.491c-.0872-.0476-.1742-.0952-.2623-.1407l-.1903-1.1673A.3483.3483 0 0016.256.955l-.9597.6905a8.4867 8.4867 0 00-.2855-.086l-.414-1.1066a.3483.3483 0 00-.5781-.1154l-.8069.8666a9.2936 9.2936 0 00-.2936-.0284L12.2946.1683a.3462.3462 0 00-.5892 0l-.6236 1.0073a13.7383 13.7383 0 00-.2936.0284L9.9803.3374a.3462.3462 0 00-.578.1154l-.4141 1.1065c-.0962.0274-.1903.0567-.2855.086L7.744.955a.3483.3483 0 00-.5447.2258L7.009 2.348a9.3574 9.3574 0 00-.2622.1407l-1.0762-.491a.3462.3462 0 00-.49.328l.0416 1.1845a7.9826 7.9826 0 00-.2278.1873L3.8413 3.425a.3472.3472 0 00-.4171.4171l.2713 1.1531c-.0628.075-.1255.1509-.1863.2268l-1.1845-.0415a.3462.3462 0 00-.328.49l.491 1.0761a9.167 9.167 0 00-.1407.2622l-1.1662.1894a.3483.3483 0 00-.2258.5446l.6904.9587a13.303 13.303 0 00-.087.2855l-1.1065.414a.3483.3483 0 00-.1155.5781l.8656.807a9.2936 9.2936 0 00-.0283.2935l-1.0073.6236a.3442.3442 0 000 .5892l1.0073.6236c.008.0982.0182.1964.0283.2936l-.8656.8079a.3462.3462 0 00.1155.578l1.1065.4141c.0273.0962.0567.1914.087.2855l-.6904.9587a.3452.3452 0 00.2268.5447l1.1662.1893c.0456.088.0922.1751.1408.2622l-.491 1.0762a.3462.3462 0 00.328.49l1.1834-.0415c.0618.0769.1235.1528.1873.2277l-.2713 1.1541a.3462.3462 0 00.4171.4161l1.153-.2713c.075.0638.151.1255.2279.1863l-.0415 1.1845a.3442.3442 0 00.49.327l1.0761-.49c.087.0486.1741.0951.2622.1407l.1903 1.1662a.3483.3483 0 00.5447.2268l.9587-.6904a9.299 9.299 0 00.2855.087l.414 1.1066a.3452.3452 0 00.5781.1154l.8079-.8656c.0972.0111.1954.0203.2936.0294l.6236 1.0073a.3472.3472 0 00.5892 0l.6236-1.0073c.0982-.0091.1964-.0183.2936-.0294l.8069.8656a.3483.3483 0 00.578-.1154l.4141-1.1066a8.4626 8.4626 0 00.2855-.087l.9587.6904a.3452.3452 0 00.5447-.2268l.1903-1.1662c.088-.0456.1751-.0931.2622-.1407l1.0762.49a.3472.3472 0 00.49-.327l-.0415-1.1845a6.7267 6.7267 0 00.2267-.1863l1.1531.2713a.3472.3472 0 00.4171-.416l-.2713-1.1542c.0628-.0749.1255-.1508.1863-.2278l1.1845.0415a.3442.3442 0 00.328-.49l-.49-1.076c.0475-.0872.0951-.1742.1407-.2623l1.1662-.1893a.3483.3483 0 00.2258-.5447l-.6904-.9587.087-.2855 1.1066-.414a.3462.3462 0 00.1154-.5781l-.8656-.8079c.0101-.0972.0202-.1954.0283-.2936l1.0073-.6236a.3442.3442 0 000-.5892zm-6.7413 8.3551a.7138.7138 0 01.2986-1.396.714.714 0 11-.2997 1.396zm-.3422-2.3142a.649.649 0 00-.7715.5l-.3573 1.6685c-1.1035.501-2.3285.7795-3.6193.7795a8.7368 8.7368 0 01-3.6951-.814l-.3574-1.6684a.648.648 0 00-.7714-.499l-1.473.3158a8.7216 8.7216 0 01-.7613-.898h7.1676c.081 0 .1356-.0141.1356-.088v-2.536c0-.074-.0536-.0881-.1356-.0881h-2.0966v-1.6077h2.2677c.2065 0 1.1065.0587 1.394 1.2088.0901.3533.2875 1.5044.4232 1.8729.1346.413.6833 1.2381 1.2685 1.2381h3.5716a.7492.7492 0 00.1296-.0131 8.7874 8.7874 0 01-.8119.9526zM6.8369 20.024a.714.714 0 11-.2997-1.396.714.714 0 01.2997 1.396zM4.1177 8.9972a.7137.7137 0 11-1.304.5791.7137.7137 0 011.304-.579zm-.8352 1.9813l1.5347-.6824a.65.65 0 00.33-.8585l-.3158-.7147h1.2432v5.6025H3.5669a8.7753 8.7753 0 01-.2834-3.348zm6.7343-.5437V8.7836h2.9601c.153 0 1.0792.1772 1.0792.8697 0 .575-.7107.7815-1.2948.7815zm10.7574 1.4862c0 .2187-.008.4363-.0243.651h-.9c-.09 0-.1265.0586-.1265.1477v.413c0 .973-.5487 1.1846-1.0296 1.2382-.4576.0517-.9648-.1913-1.0275-.4717-.2704-1.5186-.7198-1.8436-1.4305-2.4034.8817-.5599 1.799-1.386 1.799-2.4915 0-1.1936-.819-1.9458-1.3769-2.3153-.7825-.5163-1.6491-.6195-1.883-.6195H5.4682a8.7651 8.7651 0 014.907-2.7699l1.0974 1.151a.648.648 0 00.9182.0213l1.227-1.1743a8.7753 8.7753 0 016.0044 4.2762l-.8403 1.8982a.652.652 0 00.33.8585l1.6178.7188c.0283.2875.0425.577.0425.8717zm-9.3006-9.5993a.7128.7128 0 11.984 1.0316.7137.7137 0 01-.984-1.0316zm8.3389 6.71a.7107.7107 0 01.9395-.3625.7137.7137 0 11-.9405.3635z"/></svg>',mr=e=>{const t=e.replace(/<title>[\s\S]*?<\/title>/g,"");return({className:r})=>l.jsx("span",{"aria-hidden":"true",className:fe("inline-flex size-4 shrink-0 [&_svg]:size-full [&_svg]:fill-current",r),dangerouslySetInnerHTML:{__html:t}})},Oo={npm:mr(H1),go:mr(O1),rust:mr(K1),python:mr(L1),dotnet:mr(_1),custom:gu},W1=sp.filter(e=>e!=="custom"),Jc=(e,t,n)=>l.jsx(Pa,{variant:"outline",size:"sm",className:"flex max-w-full flex-wrap",value:[t],onValueChange:r=>{const o=r[0];o!==void 0&&e.includes(o)&&n(o)},children:e.map(r=>l.jsx(Br,{value:r,className:"px-2.5 text-xs",children:r},r))});function Q1({open:e,draft:t,envPreset:n,onEnvPresetChange:r,onDraftChange:o,onFamilyChange:s,onCancel:i,onApply:a}){const c=p=>{p||i()},u=p=>o({...t,...p}),f=M1(t),h=Ii(t),g=t.family==="rust"?lp(t):null,A=Oo[t.family];return l.jsx(Ta,{open:e,onOpenChange:c,children:l.jsxs(Na,{className:"max-h-[85vh] overflow-y-auto sm:max-w-md",children:[l.jsxs(Kn,{children:[l.jsxs(Wn,{className:"flex items-center gap-2",children:[l.jsxs(Do,{children:[l.jsxs(Fo,{className:"flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring","aria-label":"切换命令系列",title:"切换命令系列",children:[l.jsx(A,{className:"size-4"}),l.jsx(Tn,{className:"size-3"})]}),l.jsx(Bo,{align:"start",className:"w-36",children:W1.map(p=>{const m=Oo[p];return l.jsxs(jo,{onClick:()=>s(p),className:p===t.family?"bg-accent/60":void 0,children:[l.jsx(m,{className:"text-muted-foreground"}),pn[p]]},p)})})]}),"配置 ",pn[t.family]," 系列命令"]}),l.jsx(_a,{children:"修改字段实时预览命令与默认应用标识;确定后写回命令行。"})]}),l.jsxs("div",{className:"space-y-4",children:[t.family==="npm"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx(Me,{children:"Runner"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"同一包换 runner 推导结果不变;deno run 自动补 npm: 前缀。"}),Jc(ip,t.runner,p=>u({runner:p}))]}),t.runnerFlags.length>0||t.runner==="deno run"?l.jsxs("div",{children:[l.jsx(Me,{children:"Runner 参数"}),l.jsx(qe,{className:"mt-1.5 font-mono text-xs",placeholder:"-A",value:t.runnerFlags,onChange:p=>u({runnerFlags:p.target.value})})]}):null,l.jsxs("div",{className:"grid grid-cols-[1fr_110px] gap-3",children:[l.jsxs("div",{children:[l.jsx(Me,{children:"包名"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"支持 @scope/name 与 npm: 前缀。"}),l.jsx(qe,{className:"mt-0 font-mono text-xs",placeholder:"@deepseek-ai/dsh",value:t.pkg,onChange:p=>u({pkg:p.target.value})})]}),l.jsxs("div",{children:[l.jsx(Me,{children:"版本"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"留空 = latest。"}),l.jsx(qe,{className:"mt-0 font-mono text-xs",placeholder:"latest",value:t.version,onChange:p=>u({version:p.target.value})})]})]}),l.jsxs("div",{children:[l.jsx(Me,{children:"运行参数"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"追加在包名之后;子命令参与 appId 推导。"}),l.jsx(qe,{className:"mt-0 font-mono text-xs",placeholder:"web --port 3000",value:t.args,onChange:p=>u({args:p.target.value})})]})]}):null,t.family==="go"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid grid-cols-[1fr_110px] gap-3",children:[l.jsxs("div",{children:[l.jsx(Me,{children:"Module 路径"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"取末段作为身份,如 rsc.io/fortune → fortune。"}),l.jsx(qe,{className:"mt-0 font-mono text-xs",placeholder:"rsc.io/fortune",value:t.pkg,onChange:p=>u({pkg:p.target.value})})]}),l.jsxs("div",{children:[l.jsx(Me,{children:"版本"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"留空 = 本地/默认。"}),l.jsx(qe,{className:"mt-0 font-mono text-xs",placeholder:"latest",value:t.version,onChange:p=>u({version:p.target.value})})]})]}),l.jsxs("div",{children:[l.jsx(Me,{children:"运行参数"}),l.jsx(qe,{className:"mt-0 font-mono text-xs",placeholder:"serve --port 8080",value:t.args,onChange:p=>u({args:p.target.value})})]})]}):null,t.family==="rust"&&g!==null?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx(Me,{children:"安装 crate"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"cargo install 目标;Rust 不能直跑,需先安装。"}),l.jsx(qe,{className:"mt-0 font-mono text-xs",placeholder:"ripgrep",value:t.pkg,onChange:p=>u({pkg:p.target.value})})]}),l.jsxs("div",{children:[l.jsx(Me,{children:"运行二进制"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"留空默认与 crate 同名。"}),l.jsx(qe,{className:"mt-0 font-mono text-xs",placeholder:t.pkg.trim().length>0?t.pkg.trim():"二进制名",value:t.binary,onChange:p=>u({binary:p.target.value})})]})]}),l.jsxs("div",{children:[l.jsx(Me,{children:"运行参数"}),l.jsx(qe,{className:"mt-0 font-mono text-xs",placeholder:"--json .",value:t.args,onChange:p=>u({args:p.target.value})})]}),l.jsxs("div",{className:"space-y-1 rounded-lg bg-muted/60 p-2.5 font-mono text-xs",children:[l.jsxs("p",{className:"text-muted-foreground",children:[l.jsx("span",{className:"mr-1.5 select-none",children:"$"}),g.install]}),l.jsxs("p",{children:[l.jsx("span",{className:"mr-1.5 select-none text-muted-foreground",children:"$"}),g.run]})]})]}):null,t.family==="python"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx(Me,{children:"Runner"}),Jc(w1,t.runner,p=>u({runner:p}))]}),l.jsxs("div",{className:"grid grid-cols-[1fr_110px] gap-3",children:[l.jsxs("div",{children:[l.jsx(Me,{children:"包名"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"包名中的 . _ 归一为 - 参与推导。"}),l.jsx(qe,{className:"mt-0 font-mono text-xs",placeholder:"ruff",value:t.pkg,onChange:p=>u({pkg:p.target.value})})]}),l.jsxs("div",{children:[l.jsx(Me,{children:"版本"}),l.jsx(qe,{className:"mt-0 font-mono text-xs",placeholder:"latest",value:t.version,onChange:p=>u({version:p.target.value})})]})]}),l.jsxs("div",{children:[l.jsx(Me,{children:"运行参数"}),l.jsx(qe,{className:"mt-0 font-mono text-xs",placeholder:"format --check .",value:t.args,onChange:p=>u({args:p.target.value})})]})]}):null,t.family==="dotnet"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid grid-cols-[1fr_110px] gap-3",children:[l.jsxs("div",{children:[l.jsx(Me,{children:"工具 ID"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:".NET 10 dnx:NuGet 工具临时运行,无需安装。"}),l.jsx(qe,{className:"mt-0 font-mono text-xs",placeholder:"dotnet-format",value:t.pkg,onChange:p=>u({pkg:p.target.value})})]}),l.jsxs("div",{children:[l.jsx(Me,{children:"版本"}),l.jsx(qe,{className:"mt-0 font-mono text-xs",placeholder:"latest",value:t.version,onChange:p=>u({version:p.target.value})})]})]}),l.jsxs("div",{children:[l.jsx(Me,{children:"运行参数"}),l.jsx(qe,{className:"mt-0 font-mono text-xs",placeholder:"--verify-no-changes",value:t.args,onChange:p=>u({args:p.target.value})})]})]}):null]},t.family),l.jsx("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/60 px-3 py-2",children:l.jsx("code",{className:"min-w-0 flex-1 font-mono text-xs break-all",children:h.length>0?h:l.jsx("span",{className:"text-muted-foreground",children:"填写后生成命令…"})})}),n!==null?l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[l.jsx("span",{className:"text-[11px] text-muted-foreground",children:"环境变量预设"}),n.state==="off"?l.jsxs("button",{type:"button",className:"rounded-md px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground underline-offset-2 transition-colors hover:bg-accent hover:text-foreground hover:underline",title:n.defaultNote,onClick:()=>r("enable"),children:["+ ",n.key,"=true(启用)"]}):l.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-md border border-border bg-secondary/60 py-0.5 pr-1 pl-1.5 font-mono text-[11px]",title:"来自下方「命令选项 → 环境变量」配置(唯一可信源),两侧同步",children:[n.key,"=",n.explicitValue??"",l.jsx("span",{className:"font-sans text-[10px] text-muted-foreground",children:"env 已配置"}),l.jsx("button",{type:"button","aria-label":"移除环境变量预设",title:n.defaultNote,className:"rounded px-1 text-muted-foreground transition-colors hover:text-foreground",onClick:()=>r("disable"),children:"×"})]})]}):l.jsx("p",{className:"text-[11px] text-muted-foreground",children:"此系列/runner 无需注入环境变量。"}),l.jsxs("div",{className:"space-y-1 rounded-lg border border-border bg-muted/40 p-3",children:[l.jsx("p",{className:"text-[11px] text-muted-foreground",children:"默认应用标识(由命令推导,可在下方应用配置中覆盖)"}),l.jsx("code",{className:"font-mono text-sm font-medium break-all",children:f.appId}),l.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["名称 ",f.appName," · ~/.opentray/create/",P1(f.appId),"/"]})]}),l.jsxs(fb,{children:[l.jsx(ub,{render:l.jsx(Oe,{variant:"outline"}),children:"取消"}),l.jsxs(Oe,{onClick:()=>{a(t)},children:[l.jsx(_i,{}),"确定"]})]})]})})}const $c=e=>({...ap,family:e,runner:e==="python"?"uvx":e==="npm"?"npx":""}),Xc=e=>e!=="custom",Us=(e,t)=>e.family===t.family&&e.runner===t.runner&&e.runnerFlags===t.runnerFlags&&e.pkg===t.pkg&&e.version===t.version&&e.args===t.args&&e.binary===t.binary&&e.raw===t.raw;function G1({command:e,onCommandChange:t,commandOptions:n,onCommandOptionsChange:r,disabled:o,onRun:s}){const i=d.useMemo(()=>j1(e),[e]),a=n.family,c=d.useRef({}),[u,f]=d.useState(null),[h,g]=d.useState(a?.family??null);d.useEffect(()=>{if(a!==null){if(c.current[a.family]=a,u===null){g(P=>P===a.family?P:a.family);return}!Xc(a.family)||u.currentFamily!==a.family||f(P=>{if(P===null||P.currentFamily!==a.family)return P;const B=P.drafts[a.family],O=P.bases[a.family];return B===void 0||O===void 0||!Us(B,O)?P:{...P,drafts:{...P.drafts,[a.family]:a},bases:{...P.bases,[a.family]:a}}})}},[a,u===null]);const A=h??i.family,p=P=>{if(a!==null&&a.family===P)return a;const B=c.current[P];return B!==void 0?B:i.family===P?i:$c(P)},[m,x]=d.useState(!1),[v,b]=d.useState(!1),[y,C]=d.useState(!1),w=u===null?void 0:u.drafts[u.currentFamily],I=w??n.family??i,S=N1(I)[0],R=S===void 0?void 0:T1(n.env,S.key),E=S===void 0?null:{key:S.key,defaultNote:S.note,state:R!==void 0?"explicit":"off",...R!==void 0?{explicitValue:R}:{}},k=R!==void 0,F=P=>{const B=S?.key??"npm_config_yes",O=P==="enable"?[...n.env.filter(G=>G.key.trim()!==B),{key:B,value:"true"}]:n.env.filter(G=>G.key.trim()!==B);r({...n,env:O})},T=P=>{if(P===A)return;g(P);const B={...n,...n.argsMode==="array"?{argsMode:"string"}:{}},O=p(P);c.current[P]===void 0&&(c.current[P]=O),r({...B,family:P==="custom"?null:O}),t(Ii(O))},N=()=>{if(!Xc(A))return;const P=p(A);f({snapshot:{family:A,state:P},currentFamily:A,drafts:{[A]:P},bases:{[A]:P}})},M=P=>{f(B=>B===null||B.currentFamily!==P.family?B:{...B,drafts:{...B.drafts,[P.family]:P}})},D=P=>{f(B=>{if(B===null||B.currentFamily===P)return B;const O=B.drafts[P],G=B.bases[P],z=p(P),U=O!==void 0&&G!==void 0&&!Us(O,G),Q=U?O:z;return{...B,currentFamily:P,drafts:{...B.drafts,[P]:Q},bases:{...B.bases,[P]:U?G:z}}})},L=()=>{f(P=>{if(P===null)return P;const B=c.current[P.snapshot.family];return(B===void 0||Us(B,P.snapshot.state))&&(c.current[P.snapshot.family]=P.snapshot.state),null})},_=P=>{c.current[P.family]=P,g(P.family),t(Ii(P)),r({...n,...n.argsMode==="array"?{argsMode:"string"}:{},family:P}),f(null)},j=Oo[A],H=A==="custom";return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex h-8 w-full min-w-0 items-stretch rounded-lg border border-input bg-transparent transition-colors outline-none focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 disabled:opacity-50 dark:bg-input/30",children:[l.jsxs(Do,{children:[l.jsxs(Fo,{disabled:o,className:"flex w-11 items-center justify-between gap-1 rounded-l-lg border-r border-input transition-colors outline-none hover:bg-accent focus-visible:z-10 focus-visible:border-ring","aria-label":`命令系列:${pn[A]},点击切换`,title:`命令系列:${pn[A]}`,children:[l.jsx(j,{className:"size-4 text-muted-foreground ms-2"}),l.jsx(Tn,{className:"size-3 text-muted-foreground/70 me-0.75"})]}),l.jsx(Bo,{align:"start",className:"w-36",children:sp.map(P=>{const B=Oo[P];return l.jsxs(jo,{onClick:()=>T(P),className:P===A?"bg-accent/60":void 0,children:[l.jsx(B,{className:"text-muted-foreground"}),pn[P]]},P)})})]}),H?l.jsx("input",{className:"h-full w-full min-w-0 flex-1 bg-transparent px-2.5 font-mono text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed",placeholder:"npx somecommand start --xx",disabled:o,value:e,onChange:P=>t(P.target.value),onKeyDown:P=>{P.key==="Enter"&&!o&&s()}}):l.jsx("button",{type:"button",className:"h-full min-w-0 flex-1 cursor-pointer truncate px-2.5 text-left font-mono text-sm outline-none select-none disabled:cursor-not-allowed disabled:opacity-60",disabled:o,title:e.length>0?e:`点击配置 ${pn[A]} 系列命令`,"aria-label":`配置 ${pn[A]} 系列命令`,onClick:N,children:e.length>0?e:l.jsxs("span",{className:"text-muted-foreground",children:["点击配置 ",pn[A]," 系列命令…"]})}),k&&S!==void 0?l.jsxs(ls,{open:m||v||y,onOpenChange:P=>{P||C(!1)},children:[l.jsx(cs,{render:l.jsx("span",{tabIndex:0,className:"mr-1 flex size-6 shrink-0 self-center cursor-help items-center justify-center rounded-md text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring","aria-label":"命令将携带 npm_config_yes 环境变量,悬停或点击查看",onPointerEnter:()=>x(!0),onPointerLeave:()=>x(!1),onFocus:()=>b(!0),onBlur:()=>b(!1),onClick:()=>C(P=>!P)}),children:l.jsx(Sr,{className:"size-3.5"})}),l.jsx(us,{side:"top",children:l.jsxs("div",{className:"space-y-1 text-left",children:[l.jsx("p",{className:"text-[11px] opacity-70",children:"环境变量预设"}),l.jsxs("p",{className:"font-mono text-xs",children:[S.key,"=",R]}),l.jsx("p",{className:"text-[11px] opacity-70",children:"来自「命令选项 → 环境变量」配置(唯一可信源,两侧同步)"})]})})]}):null]}),l.jsx(Q1,{open:u!==null,draft:w??$c(A),envPreset:E,onEnvPresetChange:F,onDraftChange:M,onFamilyChange:D,onCancel:L,onApply:_})]})}function Y1({tags:e,onTagsChange:t,disabled:n=!1,placeholder:r,className:o,...s}){const[i,a]=d.useState(""),c=()=>{i.length!==0&&(t([...e,i]),a(""))};return l.jsxs("div",{className:fe("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((u,f)=>l.jsxs("span",{className:"flex items-center gap-1 rounded bg-accent px-1.5 py-0.5 text-accent-foreground",children:[l.jsx("span",{className:"max-w-56 truncate",title:u,children:u}),n?null:l.jsx("button",{type:"button","aria-label":`移除参数 ${f+1}`,className:"text-muted-foreground hover:text-foreground",onClick:()=>{t(e.filter((h,g)=>g!==f))},children:l.jsx(Hi,{className:"size-3"})})]},`${f}:${u}`)),l.jsx("input",{className:"min-w-24 flex-1 bg-transparent font-mono text-xs outline-none placeholder:text-muted-foreground",value:i,disabled:n,placeholder:r??(e.length===0?"程序(如 npx)":"参数,回车添加"),onChange:u=>a(u.target.value),onKeyDown:u=>{if(u.key==="Enter"){u.preventDefault(),c();return}u.key==="Backspace"&&i.length===0&&e.length>0&&(u.preventDefault(),t(e.slice(0,-1)))},onBlur:c,...s})]})}function z1({command:e,onCommandChange:t,argv:n,onArgvChange:r,runAlive:o,frozen:s,failedReason:i,commandOptions:a,defaultCwd:c,onCommandOptionsChange:u,onRun:f,onStop:h}){const g=A=>{u({...a,...A})};return l.jsxs("section",{className:"rounded-xl border border-border bg-card p-4",children:[l.jsxs("div",{className:"flex gap-2",children:[a.argsMode==="array"?l.jsx(Y1,{tags:n,onTagsChange:r,disabled:o,"aria-label":"命令参数(argv)"}):l.jsx(G1,{command:e,onCommandChange:t,commandOptions:a,onCommandOptionsChange:u,disabled:o||s,onRun:f}),o?l.jsxs(Oe,{variant:"destructive",onClick:h,"aria-label":"中断命令",children:[l.jsx(Ph,{}),"中断"]}):l.jsxs(Oe,{disabled:s,onClick:f,"aria-label":"运行命令",children:[l.jsx(kh,{}),"运行"]})]}),i!==void 0?l.jsx("p",{className:"mt-2 font-mono text-xs text-red-400",children:i}):null,l.jsx(Fa,{defaultValue:["command"],className:"mt-3 border-t border-border pt-1",children:l.jsxs(Ba,{value:"command",className:"border-b-0",children:[l.jsx(ja,{children:l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx(Fh,{className:"size-4 text-muted-foreground"}),"命令选项"]})}),l.jsxs(Ma,{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[l.jsxs("div",{children:[l.jsx(Me,{children:"参数输入模式"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"数组模式逐个输入参数(回车添加),原样传递、绝不拆分。"}),l.jsxs(Pa,{variant:"outline",size:"sm",spacing:0,value:[a.argsMode],onValueChange:A=>{const p=A[0];(p==="string"||p==="array")&&g({argsMode:p})},disabled:s,children:[l.jsx(Br,{value:"string",children:"字符串"}),l.jsx(Br,{value:"array",children:"数组 (argv)"})]})]}),l.jsxs("div",{children:[l.jsx(Me,{htmlFor:"cmd-cwd",children:"工作目录 (cwd)"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"留空使用用户主目录(下方完整路径);相对路径按主目录解析。"}),l.jsx(qe,{id:"cmd-cwd",className:"mt-0 font-mono text-xs",disabled:s,value:a.cwd,placeholder:c.length>0?`默认:${c}`:"默认:用户主目录",title:c,onChange:A=>g({cwd:A.target.value})}),c.length>0&&a.cwd.trim().length===0?l.jsx("p",{className:"mt-1 font-mono text-[11px] break-all text-muted-foreground",children:c}):null]})]}),l.jsxs("div",{children:[l.jsx(Me,{children:"环境变量 (env)"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"启动命令时叠加在当前环境之上;同时写入生成的应用。"}),l.jsxs("div",{className:"space-y-1.5",children:[a.env.length===0?l.jsx("p",{className:"text-xs text-muted-foreground",children:"未配置"}):a.env.map((A,p)=>l.jsxs("div",{className:"flex gap-1.5",children:[l.jsx(qe,{className:"font-mono text-xs",disabled:s,"aria-label":`env 名称 ${p+1}`,value:A.key,placeholder:"NAME",onChange:m=>{const x=[...a.env];x[p]={...A,key:m.target.value},g({env:x})}}),l.jsx(qe,{className:"font-mono text-xs",disabled:s,"aria-label":`env 值 ${p+1}`,value:A.value,placeholder:"value",onChange:m=>{const x=[...a.env];x[p]={...A,value:m.target.value},g({env:x})}}),l.jsx(Oe,{variant:"ghost",size:"icon-sm",disabled:s,"aria-label":"删除环境变量",onClick:()=>{g({env:a.env.filter((m,x)=>x!==p)})},children:"×"})]},p)),l.jsxs(Oe,{variant:"outline",size:"sm",disabled:s,onClick:()=>g({env:[...a.env,{key:"",value:""}]}),children:[l.jsx(Sr,{className:"size-3.5"}),"添加变量"]})]})]})]})]})})]})}const qc=e=>{const t=e.trim();return t.length===0?"":/^https?:\/\//iu.test(t)?t:`https://${t}`};function U1({value:e,onChange:t,activeSource:n,frozen:r,loading:o,failedReason:s,onSubmit:i}){return l.jsxs("section",{className:"rounded-xl border border-border bg-card p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 pb-3 text-sm font-medium text-muted-foreground",children:[l.jsx(dh,{className:"size-4"}),"网页地址"]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx($s,{className:"pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),l.jsx(qe,{className:"pl-8 font-mono text-xs",value:e,placeholder:"https://example.com",disabled:r,onChange:a=>t(a.target.value),onKeyDown:a=>{if(a.key!=="Enter"||r||o)return;const c=qc(e);t(c),i(c)},"aria-label":"网页地址"})]}),l.jsxs(Oe,{size:"sm",disabled:r||o||e.trim().length===0,onClick:()=>{const a=qc(e);t(a),i(a)},children:[o?l.jsx(Ah,{className:"size-4 animate-spin"}):null,"获取预设"]})]}),s!==void 0?l.jsx("p",{className:"pt-2 text-xs text-destructive",role:"alert",children:s}):null,n!==void 0?l.jsxs("p",{className:"pt-2 text-xs text-muted-foreground",children:["源地址:",l.jsx("span",{className:"font-mono",children:n}),"——标题/图标预设来自该页面,均可在下方修改。"]}):l.jsx("p",{className:"pt-2 text-xs text-muted-foreground",children:"直接把网页打包成应用:不需要命令,创建时抓取页面标题与图标作为预设。"})]})}const Vs=["scaffold","icon","install"];function V1({open:e,phase:t,frozenValues:n,iconSrc:r,iconLabel:o,traySrc:s,trayLabel:i,selectedPort:a,currentStep:c,logs:u,error:f,result:h,onBack:g,onCreate:A,onShare:p,onOpenApp:m,onClose:x,confirmError:v,onOpenChange:b}){const y=d.useRef(null);d.useEffect(()=>{y.current?.scrollTo({top:y.current.scrollHeight})},[u.length]);const C=w=>{const I=Vs.indexOf(w),S=Vs.indexOf(c);return t==="success"||I<S?"done":I===S?"active":""};return l.jsx(Ta,{open:e,onOpenChange:w=>{t==="pending"&&w===!1||b(w)},children:l.jsx(Na,{className:"max-w-xl",children:t==="confirm"?l.jsxs(l.Fragment,{children:[l.jsxs(Kn,{children:[l.jsx(Wn,{children:"确认应用信息"}),l.jsx(_a,{children:"表单已固定,以下值将用于生成应用。"})]}),l.jsxs("dl",{className:"grid grid-cols-[110px_1fr] gap-x-3 gap-y-2 text-sm",children:[l.jsx("dt",{className:"text-muted-foreground",children:"App ID"}),l.jsx("dd",{className:"font-mono break-all",children:n.appId}),l.jsx("dt",{className:"text-muted-foreground",children:"应用名称"}),l.jsx("dd",{className:"break-all",children:n.appName}),l.jsx("dt",{className:"text-muted-foreground",children:"图标"}),l.jsxs("dd",{className:"flex flex-wrap items-center gap-4",children:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"icon-checker flex size-10 items-center justify-center overflow-hidden rounded-md","aria-label":"应用图标预览",children:r!==void 0?l.jsx("img",{src:r,alt:"应用图标",className:"size-full object-contain"}):l.jsx("span",{className:"text-[10px] text-muted-foreground",children:"无"})}),l.jsxs("span",{className:"flex flex-col",children:[l.jsx("span",{className:"text-xs leading-tight",children:"应用图标"}),l.jsx("span",{className:"font-mono text-[10px] leading-tight text-muted-foreground",children:o})]})]}),l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"icon-checker flex size-10 items-center justify-center overflow-hidden rounded-md","aria-label":"托盘图标预览",children:s!==void 0?l.jsx("img",{src:s,alt:"托盘图标",className:"size-full object-contain"}):l.jsx("span",{className:"text-[10px] text-muted-foreground",children:"文字"})}),l.jsxs("span",{className:"flex flex-col",children:[l.jsx("span",{className:"text-xs leading-tight",children:"托盘图标"}),l.jsx("span",{className:"font-mono text-[10px] leading-tight text-muted-foreground",children:i})]})]})]}),l.jsx("dt",{className:"text-muted-foreground",children:"服务端口"}),l.jsx("dd",{className:"font-mono",children:a!==void 0?`:${a}(生成后运行时重新嗅探)`:"运行时嗅探"}),l.jsx("dt",{className:"text-muted-foreground",children:"包管理器"}),l.jsx("dd",{children:n.pm})]}),v!==void 0?l.jsx("p",{className:"text-xs font-medium text-red-400",children:v}):null,l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx(Oe,{variant:"outline",onClick:g,children:"返回修改"}),l.jsx(Oe,{variant:"outline",onClick:p,children:"分享"}),l.jsx(Oe,{onClick:A,children:"确认生成"})]})]}):t==="pending"?l.jsxs(l.Fragment,{children:[l.jsx(Kn,{children:l.jsx(Wn,{children:"正在生成应用…"})}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:Vs.map(w=>l.jsx(bo,{variant:C(w)==="done"?"default":"secondary",children:w},w))}),l.jsx("div",{ref:y,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:u.join(`
|
|
23
|
-
`)})]}):t==="success"&&h!==void 0?l.jsxs(l.Fragment,{children:[l.jsx(Kn,{children:l.jsxs(Wn,{className:"flex items-center gap-2",children:[l.jsx(Jp,{className:"size-5 text-emerald-400"}),"应用已生成"]})}),l.jsxs("dl",{className:"grid grid-cols-[110px_1fr] gap-x-3 gap-y-2 text-sm",children:[l.jsx("dt",{className:"text-muted-foreground",children:"项目目录"}),l.jsx("dd",{className:"font-mono break-all",children:h.projectDir}),h.bundlePath?l.jsxs(l.Fragment,{children:[l.jsx("dt",{className:"text-muted-foreground",children:"macOS Bundle"}),l.jsx("dd",{className:"font-mono break-all",children:h.bundlePath})]}):null]}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx(Oe,{variant:"outline",onClick:x,children:"完成"}),l.jsxs(Oe,{onClick:m,children:[l.jsx(Au,{}),"打开应用"]})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:h.pinHint})]}):l.jsxs(l.Fragment,{children:[l.jsx(Kn,{children:l.jsxs(Wn,{className:"flex items-center gap-2",children:[l.jsx(Lh,{className:"size-5 text-red-400"}),"生成失败"]})}),l.jsx("p",{className:"break-all font-mono text-xs text-red-400",children:f??"未知错误"}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Oe,{variant:"outline",onClick:g,children:"返回重试"})})]})})})}const eu=(e,t)=>{const n=d.useRef(e);n.current=e;const r=d.useRef(void 0),o=d.useRef(void 0),s=d.useCallback(()=>{r.current!==void 0&&(clearTimeout(r.current),r.current=void 0);const f=o.current;o.current=void 0,f!==void 0&&n.current(...f)},[]),i=d.useCallback(()=>{r.current!==void 0&&(clearTimeout(r.current),r.current=void 0),o.current=void 0},[]),a=d.useCallback((...f)=>{o.current=f,r.current!==void 0&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=void 0;const h=o.current;o.current=void 0,h!==void 0&&n.current(...h)},t)},[t]);d.useEffect(()=>s,[s]);const c=d.useRef(a);c.current=a;const u=d.useCallback((...f)=>{c.current(...f)},[]);return u.flush=s,u.cancel=i,u},cp=d.createContext(void 0);function up(){const e=d.useContext(cp);if(e===void 0)throw new Error(ot(64));return e}const Za={tabActivationDirection:e=>({"data-activation-direction":e})},Z1=d.forwardRef(function(t,n){const{className:r,defaultValue:o=0,onValueChange:s,orientation:i="horizontal",render:a,value:c,style:u,...f}=t,h=t.defaultValue!==void 0,g=d.useRef([]),[A,p]=d.useState(()=>new Map),[m,x]=on({controlled:c,default:o,name:"Tabs",state:"value"}),v=c!==void 0,[b,y]=d.useState(()=>new Map),C=d.useRef(void 0),w=d.useCallback(K=>wi(b,K),[b]),[I,S]=d.useState(()=>({previousValue:m,tabActivationDirection:"none"})),{previousValue:R,tabActivationDirection:E}=I;let k=E,F=!1;R!==m&&(k=tu(R,m,i,b),F=R!=null&&m!=null&&w(m)==null);const T=F?R:m,N=R!==T||E!==k;ie(()=>{N&&S({previousValue:T,tabActivationDirection:k})},[T,N,k]);const M=de((K,te)=>{const le=tu(m,K,i,b);te.activationDirection=le,s?.(K,te),!te.isCanceled&&x(K)}),D=de((K,te)=>{s?.(K,Ce(te,void 0,void 0,{activationDirection:"none"}))}),L=de((K,te)=>(p(le=>{const X=new Map(le);return X.set(K,te),X}),()=>{p(le=>{if(le.get(K)!==te)return le;const X=new Map(le);return X.delete(K),X})})),_=d.useCallback(K=>A.get(K),[A]),j=d.useCallback(K=>{for(const te of b.values())if(K===te.value)return te.id},[b]),H=d.useMemo(()=>({getTabElementBySelectedValue:w,getTabIdByPanelValue:j,getTabPanelIdByValue:_,onValueChange:M,orientation:i,registerMountedTabPanel:L,setTabMap:y,tabActivationDirection:k,value:m}),[w,j,_,M,i,L,y,k,m]),P=d.useMemo(()=>{for(const K of b.values())if(K.value===m)return K},[b,m]),B=d.useMemo(()=>{for(const K of b.values())if(!K.disabled)return K.value},[b]),O=d.useRef(!h),G=d.useRef(o),z=d.useRef(h),U=d.useRef(!1);ie(()=>{if(v)return;function K(ee,J){x(ee),S({previousValue:ee,tabActivationDirection:"none"}),D(ee,J),O.current=!1}if(b.size===0){U.current&&m!==null&&!C.current?.isConnected&&K(null,al);return}U.current=!0,C.current=b.keys().next().value;const te=P?.disabled,le=P==null&&m!==null;if(!te&&m===G.current&&(z.current=!1),z.current&&te&&m===G.current)return;const X=O.current;if(te||le){const ee=B??null;if(m===ee){O.current=!1;return}let J=al;X?J=il:te&&(J=fu),K(ee,J);return}X&&P!=null&&(D(m,il),O.current=!1)},[B,v,D,P,x,b,m]);const Z=je("div",t,{state:{orientation:i,tabActivationDirection:k},ref:n,props:f,stateAttributesMapping:Za});return l.jsx(cp.Provider,{value:H,children:l.jsx(Ur,{elementsRef:g,children:Z})})});function wi(e,t){for(const[n,r]of e.entries())if(t===r.value)return n;return null}function tu(e,t,n,r){if(e==null||t==null)return"none";const[o,s,i]=n==="horizontal"?["left","left","right"]:["top","up","down"],a=wi(r,e),c=wi(r,t);if(a==null||c==null)return a!==c&&(typeof e=="number"||typeof e=="string")&&typeof e==typeof t?t>e?i:s:"none";const u=a.getBoundingClientRect()[o],f=c.getBoundingClientRect()[o];return f<u?s:f>u?i:"none"}const dp=d.createContext(void 0);function J1(){const e=d.useContext(dp);if(e===void 0)throw new Error(ot(65));return e}const $1=d.forwardRef(function(t,n){const{className:r,disabled:o=!1,render:s,value:i,id:a,nativeButton:c=!0,style:u,...f}=t,{value:h,getTabPanelIdByValue:g,onValueChange:A,orientation:p,tabActivationDirection:m}=up(),{activateOnFocus:x,registerTabResizeObserverElement:v,tabsListElement:b}=J1(),{highlightedIndex:y,onHighlightedIndexChange:C}=Bi(),w=It(a),I=d.useMemo(()=>({disabled:o,id:w,value:i}),[o,w,i]),{compositeProps:S,compositeRef:R,index:E}=Kd({metadata:I}),k=i===h,F=d.useRef(!1),T=d.useRef(null),N=de(U=>{T.current?.(),T.current=U?v(U):null});ie(()=>{if(F.current){F.current=!1;return}if(!(k&&E>-1&&y!==E))return;const U=b;if(U!=null){const Q=vt(Be(U));if(Q&&ve(U,Q))return}o||C(E)},[k,E,y,C,o,b]);const{getButtonProps:M,buttonRef:D}=Gt({disabled:o,native:c,focusableWhenDisabled:!0}),L=g(i),_=d.useRef(!1),j=d.useRef(!1);function H(U){A(i,Ce(Mt,U.nativeEvent,void 0,{activationDirection:"none"}))}function P(U){k||o||H(U)}function B(U){k||o||x&&(!_.current||j.current)&&H(U)}function O(U){if(k||o)return;_.current=!0,j.current=U.button===0;const Q=Be(U.currentTarget);function Z(){_.current=!1,j.current=!1,Q.removeEventListener("pointerup",Z),Q.removeEventListener("pointercancel",Z)}Q.addEventListener("pointerup",Z),Q.addEventListener("pointercancel",Z)}return je("button",t,{state:{disabled:o,active:k,orientation:p,tabActivationDirection:m},ref:[n,D,R,N],props:[S,{role:"tab","aria-controls":L,"aria-selected":k,id:w,onClick:P,onFocus:B,onPointerDown:O,[uf]:k?"":void 0,onKeyDownCapture(){F.current=!0}},f,M],stateAttributesMapping:Za})}),X1=d.forwardRef(function(t,n){const{activateOnFocus:r=!1,className:o,loopFocus:s=!0,render:i,style:a,...c}=t,{orientation:u,setTabMap:f,tabActivationDirection:h}=up(),[g,A]=d.useState(0),[p,m]=d.useState(null),x=d.useRef(new Set),v=d.useRef(new Set),b=d.useRef(null);ie(()=>{if(typeof ResizeObserver>"u")return;const R=new ResizeObserver(()=>{x.current.forEach(E=>{E()})});return b.current=R,p&&R.observe(p),v.current.forEach(E=>{R.observe(E)}),()=>{R.disconnect(),b.current=null}},[p]);const y=de(R=>(x.current.add(R),()=>{x.current.delete(R)})),C=de(R=>(v.current.add(R),b.current?.observe(R),()=>{v.current.delete(R),b.current?.unobserve(R)})),w={orientation:u,tabActivationDirection:h},I={"aria-orientation":u==="vertical"?"vertical":void 0,role:"tablist"},S=d.useMemo(()=>({activateOnFocus:r,registerIndicatorUpdateListener:y,registerTabResizeObserverElement:C,tabsListElement:p}),[r,y,C,p]);return l.jsx(dp.Provider,{value:S,children:l.jsx(df,{render:i,className:o,style:a,state:w,refs:[n,m],props:[I,c],stateAttributesMapping:Za,highlightedIndex:g,enableHomeAndEndKeys:!0,loopFocus:s,orientation:u,onHighlightedIndexChange:A,onMapChange:f,disabledIndices:Nt})})});function q1({className:e,orientation:t="horizontal",...n}){return l.jsx(Z1,{"data-slot":"tabs","data-orientation":t,className:fe("group/tabs flex gap-2 data-horizontal:flex-col",e),...n})}const eI=ki("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function tI({className:e,variant:t="default",...n}){return l.jsx(X1,{"data-slot":"tabs-list","data-variant":t,className:fe(eI({variant:t}),e),...n})}function nu({className:e,...t}){return l.jsx($1,{"data-slot":"tabs-trigger",className:fe("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}function ru({className:e,size:t="default",...n}){return l.jsx("div",{"data-slot":"card","data-size":t,className:fe("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...n})}function ou({className:e,...t}){return l.jsx("div",{"data-slot":"card-header",className:fe("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",e),...t})}function su({className:e,...t}){return l.jsx("div",{"data-slot":"card-content",className:fe("px-(--card-spacing)",e),...t})}function nI({className:e,...t}){return l.jsx("div",{"data-slot":"card-footer",className:fe("flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",e),...t})}const fp=d.memo(({port:e,url:t,visible:n,className:r})=>{const o=d.useRef(null),s=d.useRef(t);return d.useEffect(()=>{const i=o.current;if(i===null){s.current=t;return}s.current!==t&&(s.current=t,i.src=t)},[t]),l.jsx("iframe",{ref:o,title:`service-${e}`,src:t,className:r,style:{width:"100%",height:"100%",border:0,background:"#fff",display:n?"block":"none"},sandbox:"allow-same-origin allow-scripts allow-forms"})});fp.displayName="StableIframe";const rI=e=>{const t=e.trim();if(t.length!==0)try{return new URL(/^https?:\/\//iu.test(t)?t:`http://${t}`).href}catch{return}},iu=({status:e,services:t,activeTab:n,onJumpToService:r})=>l.jsxs(nI,{className:"h-8 shrink-0 gap-3 overflow-x-auto px-3 py-0 text-[11px] text-muted-foreground",children:[l.jsxs("span",{className:"font-mono whitespace-nowrap",children:["光标 ",e.cursorY,":",e.cursorX]}),l.jsxs("span",{className:"font-mono whitespace-nowrap",children:[e.cols,"×",e.rows]}),l.jsx("span",{className:"font-mono whitespace-nowrap",children:e.selection===void 0?"无选区":`选区 ${e.selection.start.y}:${e.selection.start.x} – ${e.selection.end.y}:${e.selection.end.x}`}),l.jsx("span",{className:"h-3 w-px bg-border"}),t.length===0?l.jsx("span",{children:"嗅探 HTTP 服务中…(未发现不影响创建应用)"}):t.map(o=>l.jsxs(bo,{variant:n===`svc-${o.port}`?"default":"secondary",className:"cursor-pointer font-mono whitespace-nowrap",onClick:()=>r(o.port),children:[":",o.port,o.title?` · ${o.title}`:""]},o.port))]});function oI({command:e,terminalHostRef:t,terminalReady:n,interactive:r,status:o,services:s,iframeTabs:i,activeTab:a,onActiveTabChange:c,onIframeNavigate:u,onIframeHistoryMove:f,onJumpToService:h,hideTerminal:g=!1,className:A}){return l.jsxs("div",{className:fe("flex min-h-0 flex-col gap-2",A),children:[l.jsx(q1,{value:a,onValueChange:c,children:l.jsxs(tI,{variant:"line",className:"w-full justify-start border-b px-2",children:[g?null:l.jsxs(nu,{value:"terminal",children:[l.jsx(Sr,{className:"size-3.5"}),"终端",!r&&n?l.jsx("span",{className:"text-[10px] text-amber-400",children:"非交互"}):null]}),i.map(p=>l.jsxs(nu,{value:`svc-${p.port}`,children:[l.jsx($s,{className:"size-3.5"}),new URL(p.url).port===""?vi(p.url):`${vi(p.url)}:${new URL(p.url).port}`]},p.port))]})}),l.jsx("div",{className:"flex min-h-0 flex-1 flex-col",hidden:g||a!=="terminal",children:l.jsxs(ru,{size:"sm",className:"min-h-0 flex-1 gap-0",children:[l.jsx(ou,{className:"border-b [.border-b]:pb-2",children:l.jsxs("span",{className:"tech-ltr flex min-w-0 items-center gap-2 font-mono text-xs text-muted-foreground",children:[l.jsx(Sr,{className:"size-4 shrink-0"}),l.jsx("span",{className:"truncate",children:e||"尚未运行命令"})]})}),l.jsxs(su,{className:"min-h-0 flex-1 p-0",children:[l.jsx("div",{ref:t,className:"min-h-0 min-w-0 h-full bg-[#05070b] px-1"}),n?null:l.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:"正在加载终端渲染器…"})]}),l.jsx(iu,{status:o,services:s,activeTab:a,onJumpToService:h})]})}),i.map(p=>l.jsx("div",{className:"flex min-h-0 flex-1 flex-col",hidden:a!==`svc-${p.port}`,children:l.jsxs(ru,{size:"sm",className:"min-h-0 flex-1 gap-0",children:[l.jsx(ou,{className:"border-b [.border-b]:pb-2",children:l.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[l.jsx(Oe,{variant:"ghost",size:"icon-sm",disabled:p.historyIndex===0,onClick:()=>f(p.port,-1),"aria-label":"后退",children:l.jsx(Kp,{})}),l.jsx(Oe,{variant:"ghost",size:"icon-sm",disabled:p.historyIndex>=p.history.length-1,onClick:()=>f(p.port,1),"aria-label":"前进",children:l.jsx(Wp,{})}),l.jsx(Oe,{variant:"ghost",size:"icon-sm",onClick:()=>u(p.port,p.url,"replace"),"aria-label":"重新加载",children:l.jsx(Qp,{})}),l.jsx($s,{className:"size-4 shrink-0 text-muted-foreground"}),l.jsx(qe,{className:"tech-ltr h-7 font-mono text-xs",defaultValue:p.url,placeholder:"输入 URL 跳转",onKeyDown:m=>{if(m.key!=="Enter")return;const x=m.target.value,v=rI(x);v!==void 0&&u(p.port,v,"push")}},`${p.port}:${p.historyIndex}:${p.url}`)]})}),l.jsx(su,{className:"min-h-0 flex-1 p-0",children:l.jsx(fp,{port:p.port,url:p.url,visible:a===`svc-${p.port}`})}),l.jsx(iu,{status:o,services:s,activeTab:a,onJumpToService:h})]})},p.port))]})}const au={appId:"",appName:"",iconPath:"",iconBackground:"transparent",iconScale:.8,trayIconPath:"",force:!1,pm:"npm",showStartupTerminal:!1,showAddressBar:!1,imageSmoothingEnabled:!0,developerMode:!1},sI={appId:"",appName:"",targetDir:"",iconPath:""};function iI(){const{query:e}=Xd(),t=e.get("edit"),[n,r]=d.useState(void 0),[o,s]=d.useState(""),[i,a]=d.useState([]),[c,u]=d.useState(RC),[f,h]=d.useState(""),[g,A]=d.useState(!1),[p,m]=d.useState(!1),x=d.useCallback($=>{m($),Zn.set($)},[]);d.useEffect(()=>(Zn.set(p),()=>Zn.set(!1)),[p]);const[v,b]=d.useState(void 0),[y,C]=d.useState(!1),[w,I]=d.useState(""),[S,R]=d.useState(!1),[E,k]=d.useState("idle"),[F,T]=d.useState(),[N,M]=d.useState(""),[D,L]=d.useState(!0),[_,j]=d.useState(!1),[H,P]=d.useState(),[B,O]=d.useState(au),[G,z]=d.useState(sI),[U,Q]=d.useState([]),[Z,K]=d.useState(),[te,le]=d.useState(!1),[X,ee]=d.useState([]),[J,ce]=d.useState(),[ue,ge]=d.useState(),[ae,pe]=d.useState(),[oe,re]=d.useState(),[se,he]=d.useState(),[me,W]=d.useState("transparent"),[Y,ye]=d.useState(.8),q=d.useRef(void 0),ne=d.useRef(void 0),Ee=d.useRef(!1),Se=d.useRef(!1),[Le,Je]=d.useState(),[We,ut]=d.useState(),[$e,Ye]=d.useState(),[mt,Ie]=d.useState("terminal"),[ze,Ne]=d.useState([]),[nt,Re]=d.useState({cursorX:0,cursorY:0,cols:0,rows:0}),[Ge,_e]=d.useState(!1),[Ze,st]=d.useState("confirm"),[ht,yt]=d.useState([]),[dt,kt]=d.useState(""),[Pt,Zt]=d.useState(),[Fe,Ue]=d.useState(),[gt,Et]=d.useState(au),St=d.useRef(null),it=d.useRef(void 0),Rt=d.useRef([]),cn=d.useRef(B);cn.current=B;const On=d.useRef(E);On.current=E;const kn=($,be,V)=>{if(be===void 0)return!1;const Ae=Number.parseInt(be.split(":")[1]??"",10);return!$.some(Te=>Te.index===Ae)||be.split(":")[0]!==String(V)},gs=d.useRef(void 0);d.useEffect(()=>{const $=B.iconPath.trim().length>0?B.iconPath.trim():G.iconPath.trim().length>0?G.iconPath.trim():void 0;if(gs.current=$,$===void 0){pe(void 0),he(void 0),q.current=void 0;return}$===q.current&&se!==void 0||(async()=>{try{re(void 0);const be=await Ke("/api/icon-analyze",{path:$});if(!be.ok)throw new Error("analyze failed");const V=await be.json();if(gs.current!==$)return;pe(V),Ee.current=!1,W(V.suggested),Ke("/api/form",{iconBackground:V.suggested});const Ae=await Ke("/api/icon-compose",{foregroundPath:$,background:V.suggested,scale:Y});if(!Ae.ok)throw new Error("compose failed");const Te=await Ae.json();if(gs.current!==$)return;he(Te),q.current=$}catch{pe(void 0),he(void 0),re("图标分析或合成失败,预览不可用")}})()},[B.iconPath,G.iconPath]);const Ja=eu($=>{Ke("/api/form",{iconScale:$});const be=Xa();qa(be,me,$)},250),pp=$=>{ye($),Ja($)},$a=eu($=>{Ke("/api/form",{iconBackground:$});const be=Xa();qa(be,$,Y)},120),hp=$=>{Ee.current=!0,W($),$a($)},Xa=()=>B.iconPath.trim().length>0?B.iconPath.trim():G.iconPath.trim().length>0?G.iconPath.trim():void 0,qa=d.useCallback(async($,be,V)=>{if($===void 0){pe(void 0),he(void 0),q.current=void 0,ne.current=void 0;return}ne.current=$;try{const Ae=await Ke("/api/icon-analyze",{path:$});if(!Ae.ok)throw new Error("analyze failed");const Te=await Ae.json();if(ne.current!==$)return;pe(Te);const xt=await Ke("/api/icon-compose",{foregroundPath:$,background:be,scale:V});if(!xt.ok)throw new Error("compose failed");const Jt=await xt.json();if(ne.current!==$)return;he(Jt),q.current=$}catch{pe(void 0),he(void 0),re("图标合成失败,预览未更新")}},[]);d.useEffect(()=>{Gp()},[]);const Ap=d.useRef(!1);d.useEffect(()=>{t===null||n===t||(r(t),(async()=>{const $=await ef(t);if($.status!==200||"code"in $.data)return;const be=$.data;if(be.command?.executable!==void 0&&s(be.command.executable),be.command?.args!==void 0&&a([...be.command.args]),be.command?.executable!==void 0&&u(V=>({...V,argsMode:"array"})),be.appName!==void 0){const V=be.appName;O(Ae=>({...Ae,appName:V}))}if(be.icons?.imageSmoothingEnabled!==void 0){const V=be.icons.imageSmoothingEnabled;O(Ae=>({...Ae,imageSmoothingEnabled:V}))}if(be.developerMode!==void 0){const V=be.developerMode;O(Ae=>({...Ae,developerMode:V,force:!0}))}if(be.command?.cwd!==void 0){const V=be.command.cwd;u(Ae=>({...Ae,cwd:V}))}if(be.command?.env!==void 0){const V=Object.entries(be.command.env).map(([Ae,Te])=>({key:Ae,value:Te}));u(Ae=>({...Ae,env:V}))}Ap.current=!0})())},[t,n]),d.useEffect(()=>{if(!p)return;let $=!1;return(async()=>{const be=St.current;if(be===null)return;const V=await Yp(be);if($||V===void 0){$||P("ghostty-web 加载失败,输出将以纯文本显示");return}it.current=V,j(!0);const Ae=Rt.current;Rt.current=[];for(const xt of Ae)V.write(xt);V.onData(xt=>{el.current&&Ke("/api/terminal-input",{data:xt})}),V.onResize(({cols:xt,rows:Jt})=>{Ke("/api/terminal-resize",{cols:xt,rows:Jt})});const Te=window.setInterval(()=>{if(!(On.current==="idle"&&!it.current))try{Re(V.readState())}catch{}},300);return()=>window.clearInterval(Te)})(),()=>{$=!0,it.current?.dispose(),it.current=void 0}},[p]);const el=d.useRef(!0);d.useEffect(()=>{el.current=D},[D]),d.useEffect(()=>{const $=DC();return $.onmessage=be=>{const V=JSON.parse(be.data);switch(V.type){case"snapshot":{k(V.state),R(V.runAlive),b(V.urlSource),s(V.command),M(V.command),u(V.commandOptions),L(V.interactive),O(V.form),z(V.defaults),A(V.targetDirExists),Q(V.services),K(V.selectedPort),ee(V.icons??[]),ce(V.iconsPort),Ne(V.urlSource!==void 0?[{port:0,url:V.urlSource,history:[V.urlSource],historyIndex:0}]:V.services.map(Te=>({port:Te.port,url:Te.url,history:[Te.url],historyIndex:0})));const Ae=V.runAlive||V.services.length>0||V.urlSource!==void 0;x(Ae),Ie(V.urlSource!==void 0?"svc-0":Ae&&V.services.length>0?`svc-${V.services[0].port}`:"terminal");break}case"state":k(V.state),V.state==="failed"&&T(V.reason),V.state==="frozen"&&(st("confirm"),_e(!0)),V.state==="materializing"&&(st("pending"),yt([])),V.state==="success"&&st("success"),V.state==="failed"&&nl.current&&(st("failed"),Zt(V.reason));break;case"log":{it.current!==void 0?it.current.write(V.chunk):tl.current!==void 0?P(Ae=>(Ae??"")+V.chunk):Rt.current.push(V.chunk);break}case"term-mode":if(L(V.interactive),!V.interactive&&V.message!==void 0){const Ae=`\x1B[33m${V.message}\x1B[0m\r
|
|
24
|
-
`;
|
|
17
|
+
`}return r}render(e,t,n){let r="";const o=this.rules;for(let s=0,i=e.length;s<i;s++){const a=e[s].type;a==="inline"?r+=this.renderInline(e[s].children,t,n):typeof o[a]<"u"?r+=o[a](e,s,t,n,this):r+=this.renderToken(e,s,t)}return r}},Zf=class{constructor(e,t,n){xe(this,"tokens",[]),xe(this,"inlineMode",!1),xe(this,"Token",jn),this.src=e,this.env=n,this.md=t}},$v=/\r\n?|\n/g,Xv=/\0/g;function qv(e){let t;t=e.src.replace($v,`
|
|
18
|
+
`),t=t.replace(Xv,"�"),e.src=t}function ey(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function ty(e){const t=e.tokens;let n=0;for(let r=0;r<t.length;r++)t[r].type!=="reference_definition"&&(r!==n&&(t[n]=t[r]),n++);t.length!==n&&(t.length=n)}function ny(e){const t=e.tokens;for(let n=0,r=t.length;n<r;n++){const o=t[n];o.type==="inline"&&e.md.inline.parse(o.content,e.md,e.env,o.children)}}function ry(e){return/^<a[>\s]/i.test(e)}function oy(e){return/^<\/a\s*>/i.test(e)}function sy(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if(t[n].type!=="inline"||!e.md.linkify.test(t[n].content))continue;let o=t[n].children,s=0;for(let i=o.length-1;i>=0;i--){const a=o[i];if(a.type==="link_close"){for(i--;o[i].level!==a.level&&o[i].type!=="link_open";)i--;continue}if(a.type==="html_inline"&&(ry(a.content)&&s>0&&s--,oy(a.content)&&s++),!(s>0)&&a.type==="text"&&e.md.linkify.test(a.content)){const c=a.content;let u=e.md.linkify.match(c);const f=[];let h=a.level,A=0;u.length>0&&u[0].index===0&&i>0&&o[i-1].type==="text_special"&&(u=u.slice(1));for(let g=0;g<u.length;g++){const p=u[g].url,x=e.md.normalizeLink(p);if(!e.md.validateLink(x))continue;let m=u[g].text;u[g].schema?u[g].schema==="mailto:"&&!/^mailto:/i.test(m)?m=e.md.normalizeLinkText(`mailto:${m}`).replace(/^mailto:/,""):m=e.md.normalizeLinkText(m):m=e.md.normalizeLinkText(`http://${m}`).replace(/^http:\/\//,"");const v=u[g].index;if(v>A){const I=new e.Token("text","",0);I.content=c.slice(A,v),I.level=h,f.push(I)}const b=new e.Token("link_open","a",1);b.attrs=[["href",x]],b.level=h++,b.markup="linkify",b.info="auto",f.push(b);const y=new e.Token("text","",0);y.content=m,y.level=h,f.push(y);const C=new e.Token("link_close","a",-1);C.level=--h,C.markup="linkify",C.info="auto",f.push(C),A=u[g].lastIndex}if(A<c.length){const g=new e.Token("text","",0);g.content=c.slice(A),g.level=h,f.push(g)}t[n].children=o=zf(o,i,f)}}}}var Jf=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,iy=/\((c|tm|r)\)/i,ay=/\((c|tm|r)\)/gi,ly={c:"©",r:"®",tm:"™"};function cy(e,t){return ly[t.toLowerCase()]}function uy(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&(r.content=r.content.replace(ay,cy)),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function dy(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&Jf.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function fy(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(iy.test(e.tokens[t].content)&&uy(e.tokens[t].children),Jf.test(e.tokens[t].content)&&dy(e.tokens[t].children))}var py=/['"]/,Lc=/['"]/g,Kc="’";function uo(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function hy(e,t){let n="",r=0;t.sort((o,s)=>o.pos-s.pos);for(let o=0;o<t.length;o++){const s=t[o];n+=e.slice(r,s.pos)+s.ch,r=s.pos+1}return n+e.slice(r)}function gy(e,t){let n;const r=[],o={};for(let s=0;s<e.length;s++){const i=e[s],a=e[s].level;for(n=r.length-1;n>=0&&!(r[n].level<=a);n--);if(r.length=n+1,i.type!=="text")continue;const c=i.content;let u=0;const f=c.length;e:for(;u<f;){Lc.lastIndex=u;const h=Lc.exec(c);if(!h)break;let A=!0,g=!0;u=h.index+1;const p=h[0]==="'";let x=32;if(h.index-1>=0)x=c.charCodeAt(h.index-1);else for(n=s-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){x=e[n].content.charCodeAt(e[n].content.length-1);break}let m=32;if(u<f)m=c.charCodeAt(u);else for(n=s+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){m=e[n].content.charCodeAt(0);break}const v=_r(x)||Nr(x),b=_r(m)||Nr(m),y=Tr(x),C=Tr(m);if(C?A=!1:b&&(y||v||(A=!1)),y?g=!1:v&&(C||b||(g=!1)),m===34&&h[0]==='"'&&x>=48&&x<=57&&(g=A=!1),A&&g&&(A=v,g=b),!A&&!g){p&&uo(o,s,h.index,Kc);continue}if(g)for(n=r.length-1;n>=0;n--){let I=r[n];if(r[n].level<a)break;if(I.single===p&&r[n].level===a){I=r[n];let w,S;p?(w=t.md.options.quotes[2],S=t.md.options.quotes[3]):(w=t.md.options.quotes[0],S=t.md.options.quotes[1]),uo(o,s,h.index,S),uo(o,I.token,I.pos,w),r.length=n;continue e}}A?r.push({token:s,pos:h.index,single:p,level:a}):g&&p&&uo(o,s,h.index,Kc)}}Object.keys(o).forEach(function(s){const i=Number(s);e[i].content=hy(e[i].content,o[s])})}function Ay(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!py.test(e.tokens[t].content)||gy(e.tokens[t].children,e)}function my(e){let t,n;const r=e.length;for(t=0;t<r;t++)e[t].type==="text_special"&&(e[t].type="text");for(t=n=0;t<r;t++)e[t].type==="text"&&t+1<r&&e[t+1].type==="text"?e[t+1].content=e[t].content+e[t+1].content:(t!==n&&(e[n]=e[t]),n++);t!==n&&(e.length=n)}function xy(e){let t,n;const r=e.tokens,o=r.length;for(let s=0;s<o;s++){if(r[s].type!=="inline")continue;const i=r[s].children,a=i.length;for(t=0;t<a;t++)i[t].type==="text_special"&&(i[t].type="text"),i[t].children&&my(i[t].children);for(t=n=0;t<a;t++)i[t].type==="text"&&t+1<a&&i[t+1].type==="text"?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}var Ys=[["normalize",qv],["block",ey],["strip_references",ty],["inline",ny],["linkify",sy],["replacements",fy],["smartquotes",Ay],["text_join",xy]],$f=class{constructor(){xe(this,"ruler",new Hr),xe(this,"State",Zf);for(let e=0;e<Ys.length;e++)this.ruler.push(Ys[e][0],Ys[e][1])}process(e){const t=this.ruler.getRules("");for(let n=0,r=t.length;n<r;n++)t[n](e)}},Xf=class{constructor(e,t,n,r){xe(this,"bMarks",[]),xe(this,"eMarks",[]),xe(this,"tShift",[]),xe(this,"sCount",[]),xe(this,"bsCount",[]),xe(this,"blkIndent",0),xe(this,"line",0),xe(this,"lineMax",0),xe(this,"tight",!1),xe(this,"listIndent",-1),xe(this,"parentType","root"),xe(this,"level",0),xe(this,"Token",jn),this.src=e,this.md=t,this.env=n,this.tokens=r;const o=this.src;for(let s=0,i=0,a=0,c=0,u=o.length,f=!1;i<u;i++){const h=o.charCodeAt(i);if(!f)if(Ye(h)){a++,h===9?c+=4-c%4:c++;continue}else f=!0;(h===10||i===u-1)&&(h!==10&&i++,this.bMarks.push(s),this.eMarks.push(i),this.tShift.push(a),this.sCount.push(c),this.bsCount.push(0),f=!1,a=0,c=0,s=i+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){const r=new jn(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e}skipSpaces(e){for(let t=this.src.length;e<t&&Ye(this.src.charCodeAt(e));e++);return e}skipSpacesBack(e,t){if(e<=t)return e;for(;e>t;)if(!Ye(this.src.charCodeAt(--e)))return e+1;return e}skipChars(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e}getLines(e,t,n,r){if(e>=t)return"";const o=new Array(t-e);for(let s=0,i=e;i<t;i++,s++){let a=0;const c=this.bMarks[i];let u=c,f;for(i+1<t||r?f=this.eMarks[i]+1:f=this.eMarks[i];u<f&&a<n;){const h=this.src.charCodeAt(u);if(Ye(h))h===9?a+=4-(a+this.bsCount[i])%4:a++;else if(u-c<this.tShift[i])a++;else break;u++}a>n?o[s]=new Array(a-n+1).join(" ")+this.src.slice(u,f):o[s]=this.src.slice(u,f)}return o.join("")}},by=65536;function Us(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function Wc(e){const t=[],n=e.length;let r=0,o=e.charCodeAt(r),s=!1,i=0,a="";for(;r<n;)o===124&&(s?(a+=e.substring(i,r-1),i=r):(t.push(a+e.substring(i,r)),a="",i=r+1)),s=o===92,r++,o=e.charCodeAt(r);return t.push(a+e.substring(i)),t}function vy(e,t,n,r){if(t+2>n)return!1;let o=t+1;if(e.sCount[o]<e.blkIndent||e.sCount[o]-e.blkIndent>=4)return!1;let s=e.bMarks[o]+e.tShift[o];if(s>=e.eMarks[o])return!1;const i=e.src.charCodeAt(s++);if(i!==124&&i!==45&&i!==58||s>=e.eMarks[o])return!1;const a=e.src.charCodeAt(s++);if(a!==124&&a!==45&&a!==58&&!Ye(a)||i===45&&Ye(a))return!1;for(;s<e.eMarks[o];){const C=e.src.charCodeAt(s);if(C!==124&&C!==45&&C!==58&&!Ye(C))return!1;s++}let c=Us(e,t+1),u=c.split("|");const f=[];for(let C=0;C<u.length;C++){const I=u[C].trim();if(!I){if(C===0||C===u.length-1)continue;return!1}if(!/^:?-+:?$/.test(I))return!1;I.charCodeAt(I.length-1)===58?f.push(I.charCodeAt(0)===58?"center":"right"):I.charCodeAt(0)===58?f.push("left"):f.push("")}if(c=Us(e,t).trim(),c.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;u=Wc(c),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const h=u.length;if(h===0||h!==f.length)return!1;if(r)return!0;const A=e.parentType;e.parentType="table";const g=e.md.block.ruler.getRules("blockquote"),p=e.push("table_open","table",1),x=[t,0];p.map=x;const m=e.push("thead_open","thead",1);m.map=[t,t+1];const v=e.push("tr_open","tr",1);v.map=[t,t+1];for(let C=0;C<u.length;C++){const I=e.push("th_open","th",1);f[C]&&(I.attrs=[["style",`text-align:${f[C]}`]]);const w=e.push("inline","",0);w.content=u[C].trim(),w.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let b,y=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let C=!1;for(let w=0,S=g.length;w<S;w++)if(g[w](e,o,n,!0)){C=!0;break}if(C||(c=Us(e,o).trim(),!c)||e.sCount[o]-e.blkIndent>=4||(u=Wc(c),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),y+=h-u.length,y>by))break;if(o===t+2){const w=e.push("tbody_open","tbody",1);w.map=b=[t+2,0]}const I=e.push("tr_open","tr",1);I.map=[o,o+1];for(let w=0;w<h;w++){const S=e.push("td_open","td",1);f[w]&&(S.attrs=[["style",`text-align:${f[w]}`]]);const R=e.push("inline","",0);R.content=u[w]?u[w].trim():"",R.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return b&&(e.push("tbody_close","tbody",-1),b[1]=o),e.push("table_close","table",-1),x[1]=o,e.parentType=A,e.line=o,!0}function yy(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,o=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,o=r;continue}break}e.line=o;const s=e.push("code_block","code",0);return s.content=e.getLines(t,o,4+e.blkIndent,!1)+`
|
|
19
|
+
`,s.map=[t,e.line],!0}function Cy(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>s)return!1;const i=e.src.charCodeAt(o);if(i!==126&&i!==96)return!1;let a=o;o=e.skipChars(o,i);let c=o-a;if(c<3)return!1;const u=e.src.slice(a,o),f=e.src.slice(o,s);if(i===96&&f.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;let h=t,A=!1;for(;h++,!(h>=n||(o=a=e.bMarks[h]+e.tShift[h],s=e.eMarks[h],o<s&&e.sCount[h]<e.blkIndent));)if(e.src.charCodeAt(o)===i&&!(e.sCount[h]-e.blkIndent>=4)&&(o=e.skipChars(o,i),!(o-a<c)&&(o=e.skipSpaces(o),!(o<s)))){A=!0;break}c=e.sCount[t],e.line=h+(A?1:0);const g=e.push("fence","code",0);return g.info=f,g.content=e.getLines(t+1,h,c,!0),g.markup=u,g.map=[t,e.line],!0}function Iy(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];const i=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==62)return!1;if(r)return!0;const a=[],c=[],u=[],f=[],h=e.md.block.ruler.getRules("blockquote"),A=e.parentType;e.parentType="blockquote";let g=!1,p;for(p=t;p<n;p++){const y=e.sCount[p]<e.blkIndent;if(o=e.bMarks[p]+e.tShift[p],s=e.eMarks[p],o>=s)break;if(e.src.charCodeAt(o++)===62&&!y){let I=e.sCount[p]+1,w,S;e.src.charCodeAt(o)===32?(o++,I++,S=!1,w=!0):e.src.charCodeAt(o)===9?(w=!0,(e.bsCount[p]+I)%4===3?(o++,I++,S=!1):S=!0):w=!1;let R=I;for(a.push(e.bMarks[p]),e.bMarks[p]=o;o<s;){const E=e.src.charCodeAt(o);if(Ye(E))E===9?R+=4-(R+e.bsCount[p]+(S?1:0))%4:R++;else break;o++}g=o>=s,c.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(w?1:0),u.push(e.sCount[p]),e.sCount[p]=R-I,f.push(e.tShift[p]),e.tShift[p]=o-e.bMarks[p];continue}if(g)break;let C=!1;for(let I=0,w=h.length;I<w;I++)if(h[I](e,p,n,!0)){C=!0;break}if(C){e.lineMax=p,e.blkIndent!==0&&(a.push(e.bMarks[p]),c.push(e.bsCount[p]),f.push(e.tShift[p]),u.push(e.sCount[p]),e.sCount[p]-=e.blkIndent);break}a.push(e.bMarks[p]),c.push(e.bsCount[p]),f.push(e.tShift[p]),u.push(e.sCount[p]),e.sCount[p]=-1}const x=e.blkIndent;e.blkIndent=0;const m=e.push("blockquote_open","blockquote",1);m.markup=">";const v=[t,0];m.map=v,e.md.block.tokenize(e,t,p);const b=e.push("blockquote_close","blockquote",-1);b.markup=">",e.lineMax=i,e.parentType=A,v[1]=e.line;for(let y=0;y<f.length;y++)e.bMarks[y+t]=a[y],e.tShift[y+t]=f[y],e.sCount[y+t]=u[y],e.bsCount[y+t]=c[y];return e.blkIndent=x,!0}function wy(e,t,n,r){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.bMarks[t]+e.tShift[t];const i=e.src.charCodeAt(s++);if(i!==42&&i!==45&&i!==95)return!1;let a=1;for(;s<o;){const u=e.src.charCodeAt(s++);if(u!==i&&!Ye(u))return!1;u===i&&a++}if(a<3)return!1;if(r)return!0;e.line=t+1;const c=e.push("hr","hr",0);return c.map=[t,e.line],c.markup=Array(a+1).join(String.fromCharCode(i)),!0}function Qc(e,t){const n=e.eMarks[t];let r=e.bMarks[t]+e.tShift[t];const o=e.src.charCodeAt(r++);return o!==42&&o!==45&&o!==43||r<n&&!Ye(e.src.charCodeAt(r))?-1:r}function Gc(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];let o=n;if(o+1>=r)return-1;let s=e.src.charCodeAt(o++);if(s<48||s>57)return-1;for(;;){if(o>=r)return-1;if(s=e.src.charCodeAt(o++),s>=48&&s<=57){if(o-n>=10)return-1;continue}if(s===41||s===46)break;return-1}return o<r&&(s=e.src.charCodeAt(o),!Ye(s))?-1:o}function ky(e,t){const n=e.level+2;for(let r=t+2,o=e.tokens.length-2;r<o;r++)e.tokens[r].level===n&&e.tokens[r].type==="paragraph_open"&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function Ey(e,t,n,r){let o,s,i,a,c=t,u=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let f=!1;r&&e.parentType==="paragraph"&&e.sCount[c]>=e.blkIndent&&(f=!0);let h,A,g;if((g=Gc(e,c))>=0){if(h=!0,i=e.bMarks[c]+e.tShift[c],A=Number(e.src.slice(i,g-1)),f&&A!==1)return!1}else if((g=Qc(e,c))>=0)h=!1;else return!1;if(f&&e.skipSpaces(g)>=e.eMarks[c])return!1;if(r)return!0;const p=e.src.charCodeAt(g-1),x=e.tokens.length;h?(a=e.push("ordered_list_open","ol",1),A!==1&&(a.attrs=[["start",A]])):a=e.push("bullet_list_open","ul",1);const m=[c,0];a.map=m,a.markup=String.fromCharCode(p);let v=!1;const b=e.md.block.ruler.getRules("list"),y=e.parentType;for(e.parentType="list";c<n;){s=g,o=e.eMarks[c];const C=e.sCount[c]+g-(e.bMarks[c]+e.tShift[c]);let I=C;for(;s<o;){const D=e.src.charCodeAt(s);if(D===9)I+=4-(I+e.bsCount[c])%4;else if(D===32)I++;else break;s++}const w=s;let S;w>=o?S=1:S=I-C,S>4&&(S=1);const R=C+S;a=e.push("list_item_open","li",1),a.markup=String.fromCharCode(p);const E=[c,0];a.map=E,h&&(a.info=e.src.slice(i,g-1));const k=e.tight,B=e.tShift[c],T=e.sCount[c],F=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=R,e.tight=!0,e.tShift[c]=w-e.bMarks[c],e.sCount[c]=I,w>=o&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n),(!e.tight||v)&&(u=!1),v=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=F,e.tShift[c]=B,e.sCount[c]=T,e.tight=k,a=e.push("list_item_close","li",-1),a.markup=String.fromCharCode(p),c=e.line,E[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let j=!1;for(let D=0,H=b.length;D<H;D++)if(b[D](e,c,n,!0)){j=!0;break}if(j)break;if(h){if(g=Gc(e,c),g<0)break;i=e.bMarks[c]+e.tShift[c]}else if(g=Qc(e,c),g<0)break;if(p!==e.src.charCodeAt(g-1))break}return h?a=e.push("ordered_list_close","ol",-1):a=e.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(p),m[1]=c,e.line=c,e.parentType=y,u&&ky(e,x),!0}function Sy(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t],i=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==91)return!1;function a(C){const I=e.lineMax;if(C>=I||e.isEmpty(C))return null;let w=!1;if(e.sCount[C]-e.blkIndent>3&&(w=!0),e.sCount[C]<0&&(w=!0),!w){const E=e.md.block.ruler.getRules("reference"),k=e.parentType;e.parentType="reference";let B=!1;for(let T=0,F=E.length;T<F;T++)if(E[T](e,C,I,!0)){B=!0;break}if(e.parentType=k,B)return null}const S=e.bMarks[C]+e.tShift[C],R=e.eMarks[C];return e.src.slice(S,R+1)}let c=e.src.slice(o,s+1);s=c.length;let u=-1;for(o=1;o<s;o++){const C=c.charCodeAt(o);if(C===91)return!1;if(C===93){u=o;break}else if(C===10){const I=a(i);I!==null&&(c+=I,s=c.length,i++)}else if(C===92&&(o++,o<s&&c.charCodeAt(o)===10)){const I=a(i);I!==null&&(c+=I,s=c.length,i++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(o=u+2;o<s;o++){const C=c.charCodeAt(o);if(C===10){const I=a(i);I!==null&&(c+=I,s=c.length,i++)}else if(!Ye(C))break}const f=e.md.helpers.parseLinkDestination(c,o,s);if(!f.ok)return!1;const h=e.md.normalizeLink(f.str);if(!e.md.validateLink(h))return!1;o=f.pos;const A=o,g=i,p=o;for(;o<s;o++){const C=c.charCodeAt(o);if(C===10){const I=a(i);I!==null&&(c+=I,s=c.length,i++)}else if(!Ye(C))break}let x=e.md.helpers.parseLinkTitle(c,o,s);for(;x.can_continue;){const C=a(i);if(C===null)break;c+=C,o=s,s=c.length,i++,x=e.md.helpers.parseLinkTitle(c,o,s,x)}let m;for(o<s&&p!==o&&x.ok?(m=x.str,o=x.pos):(m="",o=A,i=g);o<s&&Ye(c.charCodeAt(o));)o++;if(o<s&&c.charCodeAt(o)!==10&&m)for(m="",o=A,i=g;o<s&&Ye(c.charCodeAt(o));)o++;if(o<s&&c.charCodeAt(o)!==10)return!1;const v=xs(c.slice(1,u));if(!v)return!1;if(r)return!0;typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[v]>"u"&&(e.env.references[v]={title:m,href:h});const b=e.push("reference_definition","",0);b.map=[t,i],b.hidden=!0;const y=Object.create(null);return y.label=v,b.meta=y,e.line=i,!0}var Ry=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],qf=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,ep="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Dy=new RegExp(`^(?:${qf}|${ep}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),Fy=new RegExp(`^(?:${qf}|${ep})`),Sn=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Za-z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp(`^</?(${Ry.join("|")})(?=(\\s|/?>|$))`,"i"),/^$/,!0],[new RegExp(`${Fy.source}\\s*$`),/^$/,!1]];function By(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let i=e.src.slice(o,s),a=0;for(;a<Sn.length&&!Sn[a][0].test(i);a++);if(a===Sn.length)return!1;if(r)return Sn[a][2];let c=t+1;const u=Sn[a][1].test("");if(!Sn[a][1].test(i)){for(;c<n&&!(e.sCount[c]<e.blkIndent&&(u||!e.isEmpty(c)));c++)if(o=e.bMarks[c]+e.tShift[c],s=e.eMarks[c],i=e.src.slice(o,s),Sn[a][1].test(i)){i.length!==0&&c++;break}}e.line=c;const f=e.push("html_block","",0);return f.map=[t,c],f.content=e.getLines(t,c,e.blkIndent,!0),!0}function jy(e,t,n,r){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.src.charCodeAt(o);if(i!==35||o>=s)return!1;let a=1;for(i=e.src.charCodeAt(++o);i===35&&o<s&&a<=6;)a++,i=e.src.charCodeAt(++o);if(a>6||o<s&&!Ye(i))return!1;if(r)return!0;s=e.skipSpacesBack(s,o);const c=e.skipCharsBack(s,35,o);c>o&&Ye(e.src.charCodeAt(c-1))&&(s=c),e.line=t+1;const u=e.push("heading_open",`h${a}`,1);u.markup="########".slice(0,a),u.map=[t,e.line];const f=e.push("inline","",0);f.content=bs(e.src.slice(o,s)),f.map=[t,e.line],f.children=[];const h=e.push("heading_close",`h${a}`,-1);return h.markup="########".slice(0,a),!0}function My(e,t,n){const r=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const o=e.parentType;e.parentType="paragraph";let s=0,i,a=t+1;for(;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3)continue;if(e.sCount[a]>=e.blkIndent){let g=e.bMarks[a]+e.tShift[a];const p=e.eMarks[a];if(g<p&&(i=e.src.charCodeAt(g),(i===45||i===61)&&(g=e.skipChars(g,i),g=e.skipSpaces(g),g>=p))){s=i===61?1:2;break}}if(e.sCount[a]<0)continue;let A=!1;for(let g=0,p=r.length;g<p;g++)if(r[g](e,a,n,!0)){A=!0;break}if(A)break}if(!s)return e.parentType=o,!1;const c=bs(e.getLines(t,a,e.blkIndent,!1));e.line=a+1;const u=e.push("heading_open",`h${s}`,1);u.markup=String.fromCharCode(i),u.map=[t,e.line];const f=e.push("inline","",0);f.content=c,f.map=[t,e.line-1],f.children=[];const h=e.push("heading_close",`h${s}`,-1);return h.markup=String.fromCharCode(i),e.parentType=o,!0}function Py(e,t,n){const r=e.md.block.ruler.getRules("paragraph"),o=e.parentType;let s=t+1;for(e.parentType="paragraph";s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3||e.sCount[s]<0)continue;let u=!1;for(let f=0,h=r.length;f<h;f++)if(r[f](e,s,n,!0)){u=!0;break}if(u)break}const i=bs(e.getLines(t,s,e.blkIndent,!1));e.line=s;const a=e.push("paragraph_open","p",1);a.map=[t,e.line];const c=e.push("inline","",0);return c.content=i,c.map=[t,e.line],c.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}var fo=[["table",vy,["paragraph","reference"]],["code",yy],["fence",Cy,["paragraph","reference","blockquote","list"]],["blockquote",Iy,["paragraph","reference","blockquote","list"]],["hr",wy,["paragraph","reference","blockquote","list"]],["list",Ey,["paragraph","reference","blockquote"]],["reference",Sy],["html_block",By,["paragraph","reference","blockquote"]],["heading",jy,["paragraph","reference","blockquote"]],["lheading",My],["paragraph",Py]],tp=class{constructor(){xe(this,"ruler",new Hr),xe(this,"State",Xf);for(let e=0;e<fo.length;e++)this.ruler.push(fo[e][0],fo[e][1],{alt:(fo[e][2]||[]).slice()})}tokenize(e,t,n){const r=this.ruler.getRules(""),o=r.length,s=e.md.options.maxNesting;let i=t,a=!1;for(;i<n&&(e.line=i=e.skipEmptyLines(i),!(i>=n||e.sCount[i]<e.blkIndent));){if(e.level>=s){e.line=n;break}const c=e.line;let u=!1;for(let f=0;f<o;f++)if(u=r[f](e,i,n,!1),u){if(c>=e.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),i=e.line,i<n&&e.isEmpty(i)&&(a=!0,i++,e.line=i)}}parse(e,t,n,r){if(!e)return;const o=new this.State(e,t,n,r);this.tokenize(o,o.line,o.lineMax)}},np=class{constructor(e,t,n,r){xe(this,"pos",0),xe(this,"level",0),xe(this,"pending",""),xe(this,"pendingLevel",0),xe(this,"cache",{}),xe(this,"backticks",{}),xe(this,"backticksScanned",!1),xe(this,"linkLevel",0),xe(this,"delimiters",[]),xe(this,"_prev_delimiters",[]),xe(this,"Token",jn),this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.posMax=this.src.length}pushPending(){const e=new jn("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}push(e,t,n){this.pending&&this.pushPending();const r=new jn(e,t,n);let o;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(o),r}scanDelims(e,t){const n=this.posMax,r=this.src.charCodeAt(e);let o;if(e===0)o=32;else if(e===1)o=this.src.charCodeAt(0),(o&63488)===55296&&(o=65533);else if(o=this.src.charCodeAt(e-1),(o&64512)===56320){const p=this.src.charCodeAt(e-2);o=(p&64512)===55296?65536+(p-55296<<10)+(o-56320):65533}else(o&64512)===55296&&(o=65533);let s=e;for(;s<n&&this.src.charCodeAt(s)===r;)s++;const i=s-e;let a=s<n?this.src.charCodeAt(s):32;if((a&64512)===55296){const p=this.src.charCodeAt(s+1);a=(p&64512)===56320?65536+(a-55296<<10)+(p-56320):65533}else(a&64512)===56320&&(a=65533);const c=_r(o)||Nr(o),u=_r(a)||Nr(a),f=Tr(o),h=Tr(a),A=!h&&(!u||f||c),g=!f&&(!c||h||u);return{can_open:A&&(t||!g||c),can_close:g&&(t||!A||u),length:i}}};function Ty(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function Ny(e,t){let n=e.pos;for(;n<e.posMax&&!Ty(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}var _y=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function Oy(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=e.pending.match(_y);if(!o)return!1;const s=o[1],i=e.md.linkify.matchAtStart(e.src.slice(n-s.length));if(!i)return!1;let a=i.url;if(a.length<=s.length)return!1;let c=a.length;for(;c>0&&a.charCodeAt(c-1)===42;)c--;c!==a.length&&(a=a.slice(0,c));const u=e.md.normalizeLink(a);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-s.length);const f=e.push("link_open","a",1);f.attrs=[["href",u]],f.markup="linkify",f.info="auto";const h=e.push("text","",0);h.content=e.md.normalizeLinkText(a);const A=e.push("link_close","a",-1);A.markup="linkify",A.info="auto"}return e.pos+=a.length-s.length,!0}function Hy(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const r=e.pending.length-1,o=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let s=r-1;for(;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<o&&Ye(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var Xa=[];for(let e=0;e<256;e++)Xa.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){Xa[e.charCodeAt(0)]=1});function Ly(e,t){let n=e.pos;const r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let o=e.src.charCodeAt(n);if(o===10){for(t||e.push("hardbreak","br",0),n++;n<r&&(o=e.src.charCodeAt(n),!!Ye(o));)n++;return e.pos=n,!0}if(o===32){if(!t){const a=e.push("text_special","",0);a.content="\\",a.markup="\\",a.info="escape"}return e.pos=n,!0}let s=e.src[n];if(o>=55296&&o<=56319&&n+1<r){const a=e.src.charCodeAt(n+1);a>=56320&&a<=57343&&(s+=e.src[n+1],n++)}const i="\\"+s;if(!t){const a=e.push("text_special","",0);o<256&&Xa[o]!==0?a.content=s:a.content=i,a.markup=i,a.info="escape"}return e.pos=n+1,!0}function Ky(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const r=n;n++;const o=e.posMax;for(;n<o&&e.src.charCodeAt(n)===96;)n++;const s=e.src.slice(r,n),i=s.length;if(e.backticksScanned&&(e.backticks[i]||0)<=r)return t||(e.pending+=s),e.pos+=i,!0;let a=n,c;for(;(c=e.src.indexOf("`",a))!==-1;){for(a=c+1;a<o&&e.src.charCodeAt(a)===96;)a++;const u=a-c;if(u===i){if(!t){const f=e.push("code_inline","code",0);f.markup=s,f.content=e.src.slice(n,c).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=s),e.pos+=i,!0}function Wy(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;const o=e.scanDelims(e.pos,!0);let s=o.length;const i=String.fromCharCode(r);if(s<2)return!1;let a;s%2&&(a=e.push("text","",0),a.content=i,s--);for(let c=0;c<s;c+=2)a=e.push("text","",0),a.content=i+i,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0}function zc(e,t){let n;const r=[],o=t.length;for(let s=0;s<o;s++){const i=t[s];if(i.marker!==126||i.end===-1)continue;const a=t[i.end];n=e.tokens[i.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[a.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[a.token-1].type==="text"&&e.tokens[a.token-1].content==="~"&&r.push(a.token-1)}for(;r.length;){const s=r.pop();let i=s+1;for(;i<e.tokens.length&&e.tokens[i].type==="s_close";)i++;i--,s!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[s],e.tokens[s]=n)}}function Qy(e){const t=e.tokens_meta,n=e.tokens_meta.length;zc(e,e.delimiters);for(let o=0;o<n;o++){var r;const s=(r=t[o])===null||r===void 0?void 0:r.delimiters;s&&zc(e,s)}}var rp={tokenize:Wy,postProcess:Qy};function Gy(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;const o=e.scanDelims(e.pos,r===42);for(let s=0;s<o.length;s++){const i=e.push("text","",0);i.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:o.length,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return e.pos+=o.length,!0}function Yc(e,t){const n=t.length;for(let r=n-1;r>=0;r--){const o=t[r];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;const s=t[o.end],i=r>0&&t[r-1].end===o.end+1&&t[r-1].marker===o.marker&&t[r-1].token===o.token-1&&t[o.end+1].token===s.token+1,a=String.fromCharCode(o.marker),c=e.tokens[o.token];c.type=i?"strong_open":"em_open",c.tag=i?"strong":"em",c.nesting=1,c.markup=i?a+a:a,c.content="";const u=e.tokens[s.token];u.type=i?"strong_close":"em_close",u.tag=i?"strong":"em",u.nesting=-1,u.markup=i?a+a:a,u.content="",i&&(e.tokens[t[r-1].token].content="",e.tokens[t[o.end+1].token].content="",r--)}}function zy(e){const t=e.tokens_meta,n=e.tokens_meta.length;Yc(e,e.delimiters);for(let o=0;o<n;o++){var r;const s=(r=t[o])===null||r===void 0?void 0:r.delimiters;s&&Yc(e,s)}}var op={tokenize:Gy,postProcess:zy};function Yy(e,t){let n,r,o,s,i="",a="",c=e.pos,u=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const f=e.pos,h=e.posMax,A=e.pos+1,g=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(g<0)return!1;let p=g+1;if(p<h&&e.src.charCodeAt(p)===40){for(u=!1,p++;p<h&&(n=e.src.charCodeAt(p),!(!Ye(n)&&n!==10));p++);if(p>=h)return!1;if(c=p,o=e.md.helpers.parseLinkDestination(e.src,p,e.posMax),o.ok){for(i=e.md.normalizeLink(o.str),e.md.validateLink(i)?p=o.pos:i="",c=p;p<h&&(n=e.src.charCodeAt(p),!(!Ye(n)&&n!==10));p++);if(o=e.md.helpers.parseLinkTitle(e.src,p,e.posMax),p<h&&c!==p&&o.ok)for(a=o.str,p=o.pos;p<h&&(n=e.src.charCodeAt(p),!(!Ye(n)&&n!==10));p++);}(p>=h||e.src.charCodeAt(p)!==41)&&(u=!0),p++}if(u){if(typeof e.env.references>"u")return!1;if(p<h&&e.src.charCodeAt(p)===91?(c=p+1,p=e.md.helpers.parseLinkLabel(e,p),p>=0?r=e.src.slice(c,p++):p=g+1):p=g+1,r||(r=e.src.slice(A,g)),r=xs(r),s=e.env.references[r],!s)return e.pos=f,!1;i=s.href,a=s.title}if(!t){e.pos=A,e.posMax=g;const x=e.push("link_open","a",1),m=[["href",i]];if(x.attrs=m,a&&m.push(["title",a]),r){const v=Object.create(null);v.label=r,x.meta=v}e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=h,!0}function Uy(e,t){let n,r,o,s,i,a,c,u,f="";const h=e.pos,A=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const g=e.pos+2,p=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(p<0)return!1;if(s=p+1,s<A&&e.src.charCodeAt(s)===40){for(s++;s<A&&(n=e.src.charCodeAt(s),!(!Ye(n)&&n!==10));s++);if(s>=A)return!1;for(u=s,a=e.md.helpers.parseLinkDestination(e.src,s,e.posMax),a.ok&&(f=e.md.normalizeLink(a.str),e.md.validateLink(f)?s=a.pos:f=""),u=s;s<A&&(n=e.src.charCodeAt(s),!(!Ye(n)&&n!==10));s++);if(a=e.md.helpers.parseLinkTitle(e.src,s,e.posMax),s<A&&u!==s&&a.ok)for(c=a.str,s=a.pos;s<A&&(n=e.src.charCodeAt(s),!(!Ye(n)&&n!==10));s++);else c="";if(s>=A||e.src.charCodeAt(s)!==41)return e.pos=h,!1;s++}else{if(typeof e.env.references>"u")return!1;if(s<A&&e.src.charCodeAt(s)===91?(u=s+1,s=e.md.helpers.parseLinkLabel(e,s),s>=0?o=e.src.slice(u,s++):s=p+1):s=p+1,o||(o=e.src.slice(g,p)),o=xs(o),i=e.env.references[o],!i)return e.pos=h,!1;f=i.href,c=i.title}if(!t){r=e.src.slice(g,p);const x=[];e.md.inline.parse(r,e.md,e.env,x);const m=e.push("image","img",0),v=[["src",f],["alt",""]];if(m.attrs=v,m.children=x,m.content=r,c&&v.push(["title",c]),o){const b=Object.create(null);b.label=o,m.meta=b}}return e.pos=s,e.posMax=A,!0}var Vy=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,Zy=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Jy(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const r=e.pos,o=e.posMax;for(;;){if(++n>=o)return!1;const i=e.src.charCodeAt(n);if(i===60)return!1;if(i===62)break}const s=e.src.slice(r+1,n);if(Zy.test(s)){const i=e.md.normalizeLink(s);if(!e.md.validateLink(i))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",i]],a.markup="autolink",a.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(s);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=s.length+2,!0}if(Vy.test(s)){const i=e.md.normalizeLink(`mailto:${s}`);if(!e.md.validateLink(i))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",i]],a.markup="autolink",a.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(s);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=s.length+2,!0}return!1}function $y(e){return/^<a[>\s]/i.test(e)}function Xy(e){return/^<\/a\s*>/i.test(e)}function qy(e){const t=e|32;return t>=97&&t<=122}function e1(e,t){if(!e.md.options.html)return!1;const n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;const o=e.src.charCodeAt(r+1);if(o!==33&&o!==63&&o!==47&&!qy(o))return!1;const s=e.src.slice(r).match(Dy);if(!s)return!1;if(!t){const i=e.push("html_inline","",0);i.content=s[0],$y(i.content)&&e.linkLevel++,Xy(i.content)&&e.linkLevel--}return e.pos+=s[0].length,!0}var t1=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,n1=/^&([a-z][a-z0-9]{1,31});/i;function r1(e,t){const n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){const o=e.src.slice(n).match(t1);if(o){if(!t){const s=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),i=e.push("text_special","",0);i.content=$a(s)?Pr(s):Pr(65533),i.markup=o[0],i.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(n).match(n1);if(o){const s=Pf(o[0]);if(s!==o[0]){if(!t){const i=e.push("text_special","",0);i.content=s,i.markup=o[0],i.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function Uc(e){const t={},n=e.length;if(!n)return;let r=0,o=-2;const s=[];for(let i=0;i<n;i++){const a=e[i];if(s.push(0),(e[r].marker!==a.marker||o!==a.token-1)&&(r=i),o=a.token,a.length=a.length||0,!a.close)continue;t.hasOwnProperty(a.marker)||(t[a.marker]=[-1,-1,-1,-1,-1,-1]);const c=t[a.marker][(a.open?3:0)+a.length%3];let u=r-s[r]-1,f=u;for(;u>c;u-=s[u]+1){const h=e[u];if(h.marker===a.marker&&h.open&&h.end<0){let A=!1;if((h.close||a.open)&&(h.length+a.length)%3===0&&(h.length%3!==0||a.length%3!==0)&&(A=!0),!A){const g=u>0&&!e[u-1].open?s[u-1]+1:0;s[i]=i-u+g,s[u]=g,a.open=!1,h.end=i,h.close=!1,f=-1,o=-2;break}}}f!==-1&&(t[a.marker][(a.open?3:0)+(a.length||0)%3]=f)}}function o1(e){const t=e.tokens_meta,n=e.tokens_meta.length;Uc(e.delimiters);for(let o=0;o<n;o++){var r;const s=(r=t[o])===null||r===void 0?void 0:r.delimiters;s&&Uc(s)}}function s1(e){let t,n,r=0;const o=e.tokens,s=e.tokens.length;for(t=n=0;t<s;t++)o[t].nesting<0&&r--,o[t].level=r,o[t].nesting>0&&r++,o[t].type==="text"&&t+1<s&&o[t+1].type==="text"?o[t+1].content=o[t].content+o[t+1].content:(t!==n&&(o[n]=o[t]),n++);t!==n&&(o.length=n)}var Vs=[["text",Ny],["linkify",Oy],["newline",Hy],["escape",Ly],["backticks",Ky],["strikethrough",rp.tokenize],["emphasis",op.tokenize],["link",Yy],["image",Uy],["autolink",Jy],["html_inline",e1],["entity",r1]],Zs=[["balance_pairs",o1],["strikethrough",rp.postProcess],["emphasis",op.postProcess],["fragments_join",s1]],sp=class{constructor(){xe(this,"ruler",new Hr),xe(this,"ruler2",new Hr),xe(this,"State",np);for(let e=0;e<Vs.length;e++)this.ruler.push(Vs[e][0],Vs[e][1]);for(let e=0;e<Zs.length;e++)this.ruler2.push(Zs[e][0],Zs[e][1])}skipToken(e){const t=e.pos,n=this.ruler.getRules(""),r=n.length,o=e.md.options.maxNesting,s=e.cache;if(typeof s[t]<"u"){e.pos=s[t];return}let i=!1;if(e.level<o){for(let a=0;a<r;a++)if(e.level++,i=n[a](e,!0),e.level--,i){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;i||e.pos++,s[t]=e.pos}tokenize(e){const t=this.ruler.getRules(""),n=t.length,r=e.posMax,o=e.md.options.maxNesting;for(;e.pos<r;){const s=e.pos;let i=!1;if(e.level<o){for(let a=0;a<n;a++)if(i=t[a](e,!1),i){if(s>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(i){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()}parse(e,t,n,r){const o=new this.State(e,t,n,r);this.tokenize(o);const s=this.ruler2.getRules(""),i=s.length;for(let a=0;a<i;a++)s[a](o)}},i1={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","strip_references","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","strip_references","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},a1=/^(vbscript|javascript|file|data):/,l1=/^data:image\/(gif|png|jpeg|webp);/,Vc=["http:","https:","mailto:"],Zt=class{validateLink(e){const t=e.trim().toLowerCase();return a1.test(t)?l1.test(t):!0}normalizeLink(e){const t=Si(e,!0);if(t.hostname&&(!t.protocol||Vc.indexOf(t.protocol)>=0))try{t.hostname=_c.toASCII(t.hostname)}catch{}return Zr(Ei(t))}normalizeLinkText(e){const t=Si(e,!0);if(t.hostname&&(!t.protocol||Vc.indexOf(t.protocol)>=0))try{t.hostname=_c.toUnicode(t.hostname)}catch{}return rr(Ei(t),rr.defaultChars+"%")}constructor(...e){xe(this,"inline",new sp),xe(this,"block",new tp),xe(this,"core",new $f),xe(this,"renderer",new Vf),xe(this,"linkify",new yv),xe(this,"utils",Mv),xe(this,"helpers",Object.assign({},Vv));const[t,n]=e;typeof t=="string"?(this.configure(t),n&&this.set(n)):(this.configure("default"),this.set(t||{}))}set(e){return Object.assign(this.options,e),this}configure(e){let t;if(typeof e=="string"){const o=e;if(t=i1[o],!t)throw new Error(`Wrong 'markdown-it' preset "${o}", check name`)}else t=e;if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");t.options&&(this.options={...t.options});const n=t.components;if(n){var r;["core","block","inline"].forEach(s=>{var i;const a=(i=n[s])===null||i===void 0?void 0:i.rules;a&&this[s].ruler.enableOnly(a)});const o=(r=n.inline)===null||r===void 0?void 0:r.rules2;o&&this.inline.ruler2.enableOnly(o)}return this}enable(e,t=!1){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(o=>{n=n.concat(this[o].ruler.enable(e,!0))}),n=n.concat(this.inline.ruler2.enable(e,!0));const r=e.filter(o=>n.indexOf(o)<0);if(r.length&&!t)throw new Error(`MarkdownIt. Failed to enable unknown rule(s): ${r}`);return this}disable(e,t=!1){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(o=>{n=n.concat(this[o].ruler.disable(e,!0))}),n=n.concat(this.inline.ruler2.disable(e,!0));const r=e.filter(o=>n.indexOf(o)<0);if(r.length&&!t)throw new Error(`MarkdownIt. Failed to disable unknown rule(s): ${r}`);return this}use(e,...t){return e.apply(e,[this,...t]),this}parse(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens}render(e,t={}){return this.renderer.render(this.parse(e,t),this.options,t)}parseInline(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens}renderInline(e,t={}){return this.renderer.render(this.parseInline(e,t),this.options,t)}};xe(Zt,"Token",jn);xe(Zt,"Ruler",Hr);xe(Zt,"Renderer",Vf);xe(Zt,"ParserCore",$f);xe(Zt,"StateCore",Zf);xe(Zt,"ParserBlock",tp);xe(Zt,"StateBlock",Xf);xe(Zt,"ParserInline",sp);xe(Zt,"StateInline",np);var c1=Gf(Zt),Js,Zc;function u1(){return Zc||(Zc=1,Js=function(t,n){var r=3,o="-",s=o.charCodeAt(0),i=o.length;function a(c,u,f,h){var A,g,p,x,m,v,b,y=!1,C=c.bMarks[u]+c.tShift[u],I=c.eMarks[u];if(u!==0||s!==c.src.charCodeAt(0))return!1;for(A=C+1;A<=I;A++)if(o[(A-C)%i]!==c.src[A]){b=A+1;break}if(p=Math.floor((A-C)/i),p<r)return!1;if(A-=(A-C)%i,h)return!0;for(g=u;g++,!(g>=f||c.src.slice(C,I)==="..."||(C=c.bMarks[g]+c.tShift[g],I=c.eMarks[g],C<I&&c.sCount[g]<c.blkIndent));)if(s===c.src.charCodeAt(C)&&!(c.sCount[g]-c.blkIndent>=4)){for(A=C+1;A<=I&&o[(A-C)%i]===c.src[A];A++);if(!(Math.floor((A-C)/i)<p)&&(A-=(A-C)%i,A=c.skipSpaces(A),!(A<I))){y=!0;break}}return m=c.parentType,v=c.lineMax,c.parentType="container",c.lineMax=g,x=c.push("front_matter",null,0),x.hidden=!0,x.markup=c.src.slice(u,A),x.block=!0,x.map=[u,g+(y?1:0)],x.meta=c.src.slice(b,C-1),c.parentType=m,c.lineMax=v,c.line=g+(y?1:0),n(x.meta),!0}t.block.ruler.before("table","front_matter",a,{alt:["paragraph","reference","blockquote","list"]})}),Js}var d1=u1();const f1=$p(d1);var p1=Object.defineProperty,h1=Object.defineProperties,g1=Object.getOwnPropertyDescriptors,Jc=Object.getOwnPropertySymbols,A1=Object.prototype.hasOwnProperty,m1=Object.prototype.propertyIsEnumerable,$c=(e,t,n)=>t in e?p1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lt=(e,t)=>{for(var n in t||(t={}))A1.call(t,n)&&$c(e,n,t[n]);if(Jc)for(var n of Jc(t))m1.call(t,n)&&$c(e,n,t[n]);return e},Lr=(e,t)=>h1(e,g1(t)),Ho=(e,t,n)=>new Promise((r,o)=>{var s=c=>{try{a(n.next(c))}catch(u){o(u)}},i=c=>{try{a(n.throw(c))}catch(u){o(u)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,i);a((n=n.apply(e,t)).next())});function x1(e,t){return typeof e=="function"?e(t):e}function Kr(e,t){return n=>{t.setState(r=>Lr(lt({},r),{[e]:x1(n,r[e])}))}}var Xc=(e,t=100,n=1e3)=>new Promise(r=>{let o;const s=setInterval(()=>{e()&&(r(),clearInterval(s),clearTimeout(o))},t);o=setTimeout(()=>{clearInterval(s),r()},n)}),ip="Headless Tree: ",Di=e=>Error(ip+e),b1=e=>console.warn(ip+e),v1={key:"tree",getInitialState:e=>lt({expandedItems:[],focusedItem:null},e),getDefaultConfig:(e,t)=>lt({setExpandedItems:Kr("expandedItems",t),setFocusedItem:Kr("focusedItem",t)},e),stateHandlerNames:{expandedItems:"setExpandedItems",focusedItem:"setFocusedItem"},treeInstance:{getItemsMeta:({tree:e})=>{const{rootItemId:t}=e.getConfig(),{expandedItems:n}=e.getState(),r=[],o=new Set(n),s=(c,u,f,h,A)=>{var g;if(u.includes(c)){b1(`Circular reference for ${u.join(".")}`);return}if(r.push({itemId:c,level:f,index:r.length,parentId:u.at(-1),setSize:h,posInSet:A}),o.has(c)){const p=(g=e.retrieveChildrenIds(c))!=null?g:[];let x=0;for(const m of p)s(m,u.concat(c),f+1,p.length,x++)}},i=e.retrieveChildrenIds(t);let a=0;for(const c of i)s(c,[t],0,i.length,a++);return r},getFocusedItem:({tree:e})=>{var t;const n=e.getState().focusedItem;return(t=n!==null?e.getItemInstance(n):null)!=null?t:e.getItems()[0]},getRootItem:({tree:e})=>{const{rootItemId:t}=e.getConfig();return e.getItemInstance(t)},focusNextItem:({tree:e})=>{var t;const n=e.getFocusedItem().getItemMeta();if(!n)return;const r=Math.min(n.index+1,e.getItems().length-1);(t=e.getItems()[r])==null||t.setFocused()},focusPreviousItem:({tree:e})=>{var t;const n=e.getFocusedItem().getItemMeta();if(!n)return;const r=Math.max(n.index-1,0);(t=e.getItems()[r])==null||t.setFocused()},updateDomFocus:({tree:e})=>{setTimeout(()=>Ho(null,null,function*(){var t,n,r,o,s;const i=e.getFocusedItem();(n=(t=e.getConfig()).scrollToItem)==null||n.call(t,i),yield Xc(()=>i.getElement()!==null,20,500);const a=i.getElement();if(!a){(r=e.getItems()[0])==null||r.setFocused(),(s=(o=e.getItems()[0])==null?void 0:o.getElement())==null||s.focus();return}a.focus()}))},getContainerProps:({prev:e,tree:t},n)=>Lr(lt({},e?.()),{role:"tree","aria-label":n??"",ref:t.registerElement}),isSearchOpen:()=>!1},itemInstance:{scrollTo:(e,t)=>Ho(null,[e,t],function*({tree:n,item:r},o){var s,i,a;(i=(s=n.getConfig()).scrollToItem)==null||i.call(s,r),yield Xc(()=>r.getElement()!==null,20),(a=r.getElement())==null||a.scrollIntoView(o)}),getId:({itemId:e})=>e,getKey:({itemId:e})=>e,getProps:({item:e,prev:t})=>{const n=e.getItemMeta();return Lr(lt({},t?.()),{ref:e.registerElement,role:"treeitem","aria-setsize":n.setSize,"aria-posinset":n.posInSet+1,"aria-selected":"false","aria-label":e.getItemName(),"aria-level":n.level+1,"aria-expanded":e.isFolder()?e.isExpanded():void 0,tabIndex:e.isFocused()?0:-1,onClick:r=>{e.setFocused(),e.primaryAction(),!(r.ctrlKey||r.shiftKey||r.metaKey)&&e.isFolder()&&(e.isExpanded()?e.collapse():e.expand())}})},expand:({tree:e,item:t,itemId:n})=>{var r;t.isFolder()&&((r=e.getState().loadingItemChildrens)!=null&&r.includes(n)||(e.applySubStateUpdate("expandedItems",o=>[...o,n]),e.rebuildTree()))},collapse:({tree:e,item:t,itemId:n})=>{t.isFolder()&&(e.applySubStateUpdate("expandedItems",r=>r.filter(o=>o!==n)),e.rebuildTree())},getItemData:({tree:e,itemId:t})=>e.retrieveItemData(t),equals:({item:e},t)=>e.getId()===t?.getId(),isExpanded:({tree:e,itemId:t})=>e.getState().expandedItems.includes(t),isDescendentOf:({item:e},t)=>{const n=e.getParent();return!!(n?.getId()===t||n?.isDescendentOf(t))},isFocused:({tree:e,item:t,itemId:n})=>e.getState().focusedItem===n||e.getState().focusedItem===null&&t.getItemMeta().index===0,isFolder:({tree:e,item:t,itemId:n})=>n===e.getConfig().rootItemId||e.getConfig().isItemFolder(t),getItemName:({tree:e,item:t})=>e.getConfig().getItemName(t),setFocused:({tree:e,itemId:t})=>{e.applySubStateUpdate("focusedItem",t)},primaryAction:({tree:e,item:t})=>{var n,r;return(r=(n=e.getConfig()).onPrimaryAction)==null?void 0:r.call(n,t)},getParent:({tree:e,item:t})=>t.getItemMeta().parentId?e.getItemInstance(t.getItemMeta().parentId):void 0,getIndexInParent:({item:e})=>e.getItemMeta().posInSet,getChildren:({tree:e,itemId:t})=>e.retrieveChildrenIds(t).map(n=>e.getItemInstance(n)),getTree:({tree:e})=>e,getItemAbove:({tree:e,item:t})=>e.getItems()[t.getItemMeta().index-1],getItemBelow:({tree:e,item:t})=>e.getItems()[t.getItemMeta().index+1]},hotkeys:{focusNextItem:{hotkey:"ArrowDown",canRepeat:!0,preventDefault:!0,isEnabled:e=>{var t,n;return!((n=(t=e.isSearchOpen)==null?void 0:t.call(e))!=null&&n)&&!e.getState().dnd},handler:(e,t)=>{t.focusNextItem(),t.updateDomFocus()}},focusPreviousItem:{hotkey:"ArrowUp",canRepeat:!0,preventDefault:!0,isEnabled:e=>{var t,n;return!((n=(t=e.isSearchOpen)==null?void 0:t.call(e))!=null&&n)&&!e.getState().dnd},handler:(e,t)=>{t.focusPreviousItem(),t.updateDomFocus()}},expandOrDown:{hotkey:"ArrowRight",canRepeat:!0,handler:(e,t)=>{const n=t.getFocusedItem();n.isExpanded()||!n.isFolder()?(t.focusNextItem(),t.updateDomFocus()):n.expand()}},collapseOrUp:{hotkey:"ArrowLeft",canRepeat:!0,handler:(e,t)=>{var n;const r=t.getFocusedItem();(!r.isExpanded()||!r.isFolder())&&r.getItemMeta().level!==0?((n=r.getParent())==null||n.setFocused(),t.updateDomFocus()):r.collapse()}},focusFirstItem:{hotkey:"Home",handler:(e,t)=>{var n;(n=t.getItems()[0])==null||n.setFocused(),t.updateDomFocus()}},focusLastItem:{hotkey:"End",handler:(e,t)=>{var n;(n=t.getItems()[t.getItems().length-1])==null||n.setFocused(),t.updateDomFocus()}}}},y1=(e,t,n)=>{const r={};return[r,()=>{const s=n(r);e:for(let i=0;i<e.length;i++){const a=e[i][t];if(!a)continue e;t:for(const[c,u]of Object.entries(a)){if(!u)continue t;const f=r[c];r[c]=(...h)=>u(Lr(lt({},s),{prev:f}),...h)}}}]},C1=e=>{var t;const n=e?.map(r=>r.key);for(const r of e??[]){const o=(t=r.deps)==null?void 0:t.find(s=>!n?.includes(s));if(o)throw Di(`${r.key} needs ${o}`)}},I1=(e,t)=>{const n=e.length;for(let r=0;r<n;r++)for(let o=r+1;o<n;o++)t(e[o],e[r])<0&&([e[r],e[o]]=[e[o],e[r]]);return e},w1=e=>(t,n)=>{var r,o;return n.key&&((r=t.overwrites)!=null&&r.includes(n.key))?1:t.key&&((o=n.overwrites)!=null&&o.includes(t.key))?-1:e.indexOf(t)-e.indexOf(n)},k1=(e=[])=>I1(e,w1(e)),E1=e=>{var t,n,r,o;const s=(t=e.instanceBuilder)!=null?t:y1,i=[v1,...k1(e.features)];C1(i);const a=[...i],[c,u]=s(a,"treeInstance",E=>({tree:E}));let f=i.reduce((E,k)=>{var B,T;return(T=(B=k.getInitialState)==null?void 0:B.call(k,E,c))!=null?T:E},(r=(n=e.initialState)!=null?n:e.state)!=null?r:{}),h=i.reduce((E,k)=>{var B,T;return(T=(B=k.getDefaultConfig)==null?void 0:B.call(k,E,c))!=null?T:E},e);const A=i.reduce((E,k)=>lt(lt({},E),k.stateHandlerNames),{});let g;const p={current:{}};let x=!1;const m={};let v=[];const b={},y={};let C={};const I={},w=()=>{v=[],C={};const[E,k]=s(a,"itemInstance",B=>({item:B,tree:c,itemId:h.rootItemId}));k(),m[h.rootItemId]=E,C[h.rootItemId]={itemId:h.rootItemId,index:-1,parentId:null,level:-1,posInSet:0,setSize:1};for(const B of c.getItemsMeta())if(C[B.itemId]=B,m[B.itemId])v.push(m[B.itemId]);else{const[T,F]=s(a,"itemInstance",j=>({item:j,tree:c,itemId:B.itemId}));F(),m[B.itemId]=T,v.push(T)}x=!1},S=E=>{for(const k of i)E(k)},R={key:"main",treeInstance:{getState:()=>f,setState:({},E)=>{var k;(k=h.setState)==null||k.call(h,f)},setMounted:({},E)=>{var k;const B=p.current;B.isMounted=E,E&&((k=B.waitingForMount)==null||k.forEach(T=>T()),B.waitingForMount=[])},applySubStateUpdate:({},E,k)=>{var B;const T=()=>{f[E]=typeof k=="function"?k(f[E]):k;const j=h[A[E]];j?.(f[E])},F=p.current;F.isMounted?T():((B=F.waitingForMount)!=null||(F.waitingForMount=[]),F.waitingForMount.push(T))},rebuildTree:()=>{var E,k;const B=p.current;B.isMounted?(w(),(E=h.setState)==null||E.call(h,f)):((k=B.waitingForMount)!=null||(B.waitingForMount=[]),B.waitingForMount.push(()=>{var T;w(),(T=h.setState)==null||T.call(h,f)}))},scheduleRebuildTree:()=>{x=!0},getConfig:()=>h,setConfig:(E,k)=>{var B,T,F;const j=typeof k=="function"?k(h):k,D=((B=j.state)==null?void 0:B.expandedItems)&&((T=j.state)==null?void 0:T.expandedItems)!==f.expandedItems;h=j,j.state&&(f=lt(lt({},f),j.state)),D&&(w(),(F=h.setState)==null||F.call(h,f))},getItemInstance:({},E)=>{const k=m[E];if(!k){const[B,T]=s(a,"itemInstance",F=>({item:F,tree:c,itemId:E}));return T(),B}return k},getItems:()=>(x&&w(),v),registerElement:({},E)=>{g!==E&&(g&&!E?S(k=>{var B;return(B=k.onTreeUnmount)==null?void 0:B.call(k,c,g)}):!g&&E&&S(k=>{var B;return(B=k.onTreeMount)==null?void 0:B.call(k,c,E)}),g=E)},getElement:()=>g,getDataRef:()=>p,getHotkeyPresets:()=>I},itemInstance:{registerElement:({itemId:E,item:k},B)=>{if(b[E]===B)return;const T=b[E];T&&!B?S(F=>{var j;return(j=F.onItemUnmount)==null?void 0:j.call(F,k,T,c)}):!T&&B&&S(F=>{var j;return(j=F.onItemMount)==null?void 0:j.call(F,k,B,c)}),b[E]=B},getElement:({itemId:E})=>b[E],getDataRef:({itemId:E})=>{var k;return(k=y[E])!=null?k:y[E]={current:{}}},getItemMeta:({itemId:E})=>{var k;return(k=C[E])!=null?k:{itemId:E,parentId:null,level:-1,index:-1,posInSet:0,setSize:1}}}};a.unshift(R);for(const E of a)Object.assign(I,(o=E.hotkeys)!=null?o:{});return u(),c},S1={key:"selection",getInitialState:e=>lt({selectedItems:[]},e),getDefaultConfig:(e,t)=>lt({setSelectedItems:Kr("selectedItems",t)},e),stateHandlerNames:{selectedItems:"setSelectedItems"},treeInstance:{setSelectedItems:({tree:e},t)=>{e.applySubStateUpdate("selectedItems",t)},getSelectedItems:({tree:e})=>e.getState().selectedItems.map(e.getItemInstance)},itemInstance:{select:({tree:e,itemId:t})=>{const{selectedItems:n}=e.getState();e.setSelectedItems(n.includes(t)?n:[...n,t])},deselect:({tree:e,itemId:t})=>{const{selectedItems:n}=e.getState();e.setSelectedItems(n.filter(r=>r!==t))},isSelected:({tree:e,itemId:t})=>{const{selectedItems:n}=e.getState();return n.includes(t)},selectUpTo:({tree:e,item:t,itemId:n},r)=>{const o=t.getItemMeta().index,s=e.getDataRef();if(!s.current.selectUpToAnchorId){s.current.selectUpToAnchorId=n,e.setSelectedItems([n]);return}const a=e.getItemInstance(s.current.selectUpToAnchorId).getItemMeta().index,[c,u]=o<a?[o,a]:[a,o],f=e.getItems().slice(c,u+1).map(g=>g.getItemMeta().itemId);if(!r){e.setSelectedItems(f);return}const{selectedItems:h}=e.getState(),A=[...new Set([...h,...f])];e.setSelectedItems(A)},toggleSelect:({item:e})=>{e.isSelected()?e.deselect():e.select()},getProps:({tree:e,item:t,itemId:n,prev:r})=>Lr(lt({},r?.()),{"aria-selected":t.isSelected()?"true":"false",onClick:o=>{var s,i;o.shiftKey?t.selectUpTo(o.ctrlKey||o.metaKey):o.ctrlKey||o.metaKey?t.toggleSelect():e.setSelectedItems([n]),o.shiftKey||(e.getDataRef().current.selectUpToAnchorId=n),(i=(s=r?.())==null?void 0:s.onClick)==null||i.call(s,o)}})},hotkeys:{toggleSelectedItem:{hotkey:"Control+Space",preventDefault:!0,handler:(e,t)=>{t.getFocusedItem().toggleSelect()}},selectUpwards:{hotkey:"Shift+ArrowUp",handler:(e,t)=>{const n=t.getFocusedItem(),r=n.getItemAbove();r&&(n.isSelected()&&r.isSelected()?n.deselect():r.select(),r.setFocused(),t.updateDomFocus())}},selectDownwards:{hotkey:"Shift+ArrowDown",handler:(e,t)=>{const n=t.getFocusedItem(),r=n.getItemBelow();r&&(n.isSelected()&&r.isSelected()?n.deselect():r.select(),r.setFocused(),t.updateDomFocus())}},selectAll:{hotkey:"Control+KeyA",preventDefault:!0,handler:(e,t)=>{t.setSelectedItems(t.getItems().map(n=>n.getId()))}}}},qc=e=>e.code!==""&&e.code!=="Unidentified"?e.code:e.key,eu={letter:/^Key[A-Z]$/,letterornumber:/^(Key[A-Z]|Digit[0-9])$/,plus:/^(NumpadAdd|Plus)$/,minus:/^(NumpadSubtract|Minus)$/,control:/^(ControlLeft|ControlRight)$/,shift:/^(ShiftLeft|ShiftRight)$/,metaorcontrol:/^(MetaLeft|MetaRight|ControlLeft|ControlRight)$/,enter:/^(Enter|NumpadEnter)$/},tu=new Set(["MetaLeft","MetaRight","Meta","ControlLeft","ControlRight","Control","AltLeft","AltRight","Alt","ShiftLeft","ShiftRight","Shift"]),R1=(e,t,n)=>{const r=n.hotkey.toLowerCase().split("+"),o=r.every(i=>{if(i in eu)return[...e].some(c=>eu[i].test(c));const a=[...e].map(c=>c.toLowerCase());return a.includes(i.toLowerCase())||a.includes(`key${i.toLowerCase()}`)}),s=!n.isEnabled||n.isEnabled(t);return o&&s&&e.size===r.length},D1=(e,t,n,r)=>{var o;return(o=Object.entries(lt(lt({},n),r)).find(([,s])=>R1(e,t,s)))==null?void 0:o[0]},$s={clearPressedKeys:e=>{e.current.pressedKeys=new Set},dispatchKeyDown:(e,t,n,r={})=>{var o,s,i,a,c;const{isInputFocused:u=!1,releaseAfterDispatch:f=!1}=r,{ignoreHotkeysOnInputs:h,onTreeHotkey:A,hotkeys:g}=e.getConfig();if(u&&h)return;const p=qc({code:(o=n.code)!=null?o:"",key:(s=n.key)!=null?s:""});(a=(i=t.current).pressedKeys)!=null||(i.pressedKeys=new Set);const x=!t.current.pressedKeys.has(p);p&&t.current.pressedKeys.add(p);const m=D1(t.current.pressedKeys,e,e.getHotkeyPresets(),g);if(f&&p&&t.current.pressedKeys.delete(p),!m)return;const v=lt(lt({},e.getHotkeyPresets()[m]),g?.[m]);v&&(!v.allowWhenInputFocused&&u||!v.canRepeat&&!x||(v.preventDefault&&((c=n.preventDefault)==null||c.call(n)),v.handler(n,e),A?.(m,n)))},dispatchKeyUp:(e,t)=>{var n,r,o,s;const i=qc({code:(n=t.code)!=null?n:"",key:(r=t.key)!=null?r:""});i&&((s=(o=e.current).pressedKeys)!=null||(o.pressedKeys=new Set),tu.has(i)&&(e.current.pressedKeys=new Set([...e.current.pressedKeys].filter(a=>tu.has(a)))),e.current.pressedKeys.delete(i))}},F1={key:"hotkeys-core",onTreeMount:(e,t)=>{const n=e.getDataRef(),r=i=>{const a=i.target instanceof HTMLInputElement;$s.dispatchKeyDown(e,n,i,{isInputFocused:a,releaseAfterDispatch:a})},o=i=>{$s.dispatchKeyUp(n,i)},s=()=>{$s.clearPressedKeys(n)};t.addEventListener("keydown",r),document.addEventListener("keyup",o),window.addEventListener("focus",s),n.current.keydownHandler=r,n.current.keyupHandler=o,n.current.resetHandler=s},onTreeUnmount:(e,t)=>{const n=e.getDataRef();n.current.keyupHandler&&(document.removeEventListener("keyup",n.current.keyupHandler),delete n.current.keyupHandler),n.current.keydownHandler&&(t.removeEventListener("keydown",n.current.keydownHandler),delete n.current.keydownHandler),n.current.resetHandler&&(window.removeEventListener("focus",n.current.resetHandler),delete n.current.resetHandler)}},B1="sync dataLoader returned undefined",j1="sync dataLoader returned promise",Xs=e=>{if(!e)throw Di(B1);if(typeof e=="object"&&"then"in e)throw Di(j1);return e},M1={key:"sync-data-loader",getInitialState:e=>lt({loadingItemData:[],loadingItemChildrens:[]},e),getDefaultConfig:(e,t)=>lt({setLoadingItemData:Kr("loadingItemData",t),setLoadingItemChildrens:Kr("loadingItemChildrens",t)},e),stateHandlerNames:{loadingItemData:"setLoadingItemData",loadingItemChildrens:"setLoadingItemChildrens"},treeInstance:{waitForItemDataLoaded:()=>Ho(null,null,function*(){}),waitForItemChildrenLoaded:()=>Ho(null,null,function*(){}),retrieveItemData:({tree:e},t)=>Xs(e.getConfig().dataLoader.getItem(t)),retrieveChildrenIds:({tree:e},t)=>{const{dataLoader:n}=e.getConfig();return"getChildren"in n?Xs(n.getChildren(t)):Xs(n.getChildrenWithData(t)).map(r=>r.data)},loadItemData:({tree:e},t)=>e.retrieveItemData(t),loadChildrenIds:({tree:e},t)=>e.retrieveChildrenIds(t)},itemInstance:{isLoading:()=>!1,hasLoadedData:()=>!0}},P1=Object.defineProperty,T1=Object.defineProperties,N1=Object.getOwnPropertyDescriptors,nu=Object.getOwnPropertySymbols,_1=Object.prototype.hasOwnProperty,O1=Object.prototype.propertyIsEnumerable,ru=(e,t,n)=>t in e?P1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,po=(e,t)=>{for(var n in t||(t={}))_1.call(t,n)&&ru(e,n,t[n]);if(nu)for(var n of nu(t))O1.call(t,n)&&ru(e,n,t[n]);return e},H1=(e,t)=>T1(e,N1(t)),L1=e=>{const[t]=d.useState(()=>({current:E1(e)})),[n,r]=d.useState(()=>t.current.getState());return d.useEffect(()=>(t.current.setMounted(!0),t.current.rebuildTree(),()=>{t.current.setMounted(!1)}),[t]),t.current.setConfig(o=>H1(po(po({},o),e),{state:po(po({},n),e.state),setState:s=>{var i;r(s),(i=e.setState)==null||i.call(e,s)}})),t.current};const K1=/^(https?:|mailto:|#|\.\/|#\/)/iu,W1=e=>e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',"""),Tn=c1({html:!1,linkify:!0,typographer:!1,breaks:!1});f1(Tn,()=>{});Tn.core.ruler.push("render_front_matter",e=>{for(const t of e.tokens)t.type==="front_matter"&&(t.type="fence",t.tag="code",t.info="yaml",t.content=String(t.meta??"").replace(/\n$/,""),t.block=!0);return!0});Tn.validateLink=e=>K1.test(e.trim());const ap=e=>{for(const t of e)t.type==="link_open"&&(t.attrSet("rel","noreferrer noopener"),t.attrSet("target","_blank")),t.children!==null&&ap(t.children)};Tn.core.ruler.push("external_links",e=>(ap(e.tokens),!0));Tn.renderer.rules.fence=(e,t)=>{const n=e[t];return`<pre class="tech-ltr"><code${n.info.trim().length>0?` class="language-${W1(n.info.trim())}"`:""}>${Tn.utils.escapeHtml(n.content)}</code></pre>
|
|
20
|
+
`};const Q1=e=>Tn.render(e),G1=["prose prose-sm","dark:prose-invert","max-w-[75ch]","prose-headings:font-semibold prose-headings:tracking-tight","prose-h1:text-xl prose-h2:text-lg prose-h3:text-base","prose-p:my-2 prose-li:my-0.5","prose-code:before:content-none prose-code:after:content-none","prose-code:font-mono prose-code:text-[0.85em]","prose-pre:bg-muted prose-pre:text-foreground prose-pre:rounded-lg","prose-a:text-primary prose-a:decoration-primary/40 hover:prose-a:decoration-primary","prose-table:border-collapse prose-table:text-xs","prose-th:border prose-th:border-border prose-th:bg-muted prose-th:px-2 prose-th:py-1 prose-th:text-start prose-th:font-semibold","prose-td:border prose-td:border-border prose-td:px-2 prose-td:py-1 prose-td:align-top","prose-td:font-mono","prose-hr:border-border prose-blockquote:border-primary/40"].join(" "),z1=(e,t)=>e.children!==void 0?t?l.jsx(Sh,{"aria-hidden":!0,className:"pointer-events-none size-4 text-amber-500"}):l.jsx(Dh,{"aria-hidden":!0,className:"pointer-events-none size-4 text-amber-500"}):l.jsx(kh,{"aria-hidden":!0,className:"pointer-events-none size-4 text-muted-foreground"}),ou=16,Y1=({entries:e,selected:t,onSelect:n})=>{const r=d.useMemo(()=>{const c=new Map;for(const f of e){const h=f.path.split("/"),A=h[h.length-1]??f.path;f.type==="directory"?c.set(f.path,{name:A,path:f.path,children:[]}):c.set(f.path,{name:A,path:f.path})}for(const f of e){const h=f.path.split("/");for(let A=1;A<h.length;A+=1){const g=h.slice(0,A).join("/");c.has(g)||c.set(g,{name:h[A-1]??g,path:g,children:[]})}}for(const f of c.values())f.children!==void 0&&(f.children=[...c.values()].filter(h=>h.path!==""&&h.path.split("/").slice(0,-1).join("/")===f.path).map(h=>h.path));const u={name:"skill",path:"",children:[]};return u.children=[...c.values()].filter(f=>f.path!==""&&f.path.split("/").length===1).map(f=>f.path),c.set("root",u),Object.fromEntries(c)},[e]),o=d.useMemo(()=>Object.values(r).filter(c=>c.children!==void 0&&c.path!=="").map(c=>c.path),[r]),[s,i]=d.useState([t]),a=L1({initialState:{selectedItems:[t],expandedItems:o},setSelectedItems:c=>{i(u=>{const f=typeof c=="function"?c(u):c,h=f[0];return h!==void 0&&r[h]?.children===void 0&&h!=="root"&&n(h),f})},indent:ou,rootItemId:"root",getItemName:c=>c.getItemData().name,isItemFolder:c=>(c.getItemData()?.children?.length??0)>0,dataLoader:{getItem:c=>r[c]??{name:c,path:""},getChildren:c=>r[c]?.children??[]},features:[M1,S1,F1]});return l.jsx(Wb,{indent:ou,tree:a,children:a.getItems().map(c=>{const u=c.getItemData(),f=u.children===void 0&&u.path!=="";return l.jsx(Qb,{item:c,onClick:()=>{f&&n(u.path)},children:l.jsx(Gb,{className:"tech-ltr relative before:bg-background before:absolute before:inset-x-0 before:-inset-y-0.5 before:-z-10",children:l.jsxs("span",{className:"flex items-center gap-2",children:[z1(u,c.isExpanded()),c.getItemName()]})})},c.getId())})})},U1=()=>{const{messages:e}=ms(),[t,n]=d.useState([]),[r,o]=d.useState("SKILL.md"),[s,i]=d.useState(null),[a,c]=d.useState(null),[u,f]=d.useState(!0),[h,A]=d.useState(!1);d.useEffect(()=>{(async()=>{const p=await Yx();p.status===200?n(p.data):c(e.help.readError),f(!1)})()},[e.help.readError]),d.useEffect(()=>{A(!0),c(null),(async()=>{const p=await Ux(r);p.status===200&&"content"in p.data?i(p.data.content):(i(null),c(e.help.readError)),A(!1)})()},[r,e.help.readError]);const g=d.useMemo(()=>s===null?"":Q1(s),[s]);return l.jsxs("section",{className:"flex h-full min-h-0 overflow-hidden","aria-label":e.help.title,children:[l.jsx("nav",{className:"w-64 shrink-0 overflow-y-auto border-e border-border p-2","aria-label":e.help.listTitle,children:u?l.jsxs("div",{className:"space-y-2",children:[l.jsx(en,{className:"h-5 w-full"}),l.jsx(en,{className:"h-5 w-4/5"}),l.jsx(en,{className:"h-5 w-3/5"})]}):t.length===0?l.jsx("p",{className:"text-muted-foreground px-2 text-xs",children:e.help.empty}):l.jsx(Y1,{entries:t,selected:r,onSelect:o})}),l.jsx("article",{className:"min-h-0 min-w-0 flex-1 overflow-y-auto p-6","aria-live":"polite",children:h?l.jsxs("div",{className:"space-y-2",children:[l.jsx(en,{className:"h-6 w-1/2"}),l.jsx(en,{className:"h-4 w-full"}),l.jsx(en,{className:"h-4 w-5/6"})]}):a!==null?l.jsx("p",{className:"text-destructive text-sm",children:a}):l.jsx("div",{className:G1,dangerouslySetInnerHTML:{__html:g}})})]})},lp=e=>`/api/icon-composed/${e}?token=${encodeURIComponent(new URLSearchParams(location.search).get("token")??"")}`,V1={cwd:"",env:[],argsMode:"string",family:null},qa=new URLSearchParams(location.search).get("token")??"",Ne=(e,t={})=>fetch(e,{method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${qa}`},body:JSON.stringify(t)}),Z1=()=>new EventSource(`/api/events?token=${encodeURIComponent(qa)}`),Dn=(e,t,n=0)=>`/api/icon-data/${e}/${t}?g=${n}&token=${encodeURIComponent(qa)}`,Fi=e=>{try{return new URL(e).hostname}catch{return e}};function J1({values:e,defaults:t,frozen:n,iconCandidates:r,iconCandidatesPort:o,iconCandidatesGeneration:s,uploadedIconUrl:i,selectedIconRef:a,iconAnalysis:c,iconComposition:u,iconComposeError:f,iconBackground:h,iconScale:A,subjectExtracting:g,subjectStage:p,subjectSettings:x,onSubjectSettingsChange:m,onIconBackgroundChange:v,onIconScaleChange:b,onPickIconCandidate:y,onUploadIcon:C,onClearIcon:I,onPatch:w}){const S=n,R=d.useRef(null),[E,k]=d.useState(!1),[B,T]=d.useState(!1);return l.jsxs("div",{className:"grid grid-cols-1 gap-y-1",children:[l.jsxs("div",{children:[l.jsx(Pe,{children:"应用图标"}),l.jsxs("div",{className:"mt-1.5 flex flex-wrap items-start gap-3",children:[l.jsx("button",{type:"button",disabled:S,"aria-label":"选择本地图片作为应用图标",onClick:()=>R.current?.click(),onDragOver:F=>{F.preventDefault(),S||k(!0)},onDragLeave:()=>k(!1),onDrop:F=>{if(F.preventDefault(),k(!1),S)return;const j=F.dataTransfer.files[0];j!==void 0&&C(j)},className:he("flex size-20 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-dashed border-border bg-popover transition-colors",S?"opacity-50":"hover:border-primary",E&&"border-primary bg-primary/10"),children:i!==void 0?l.jsx("img",{src:i,alt:"已选图标",className:"icon-checker size-full rounded object-contain"}):l.jsxs("span",{className:"flex flex-col items-center gap-1 text-muted-foreground",children:[l.jsx(ju,{className:"size-4"}),l.jsx("span",{className:"text-[10px] leading-tight",children:"点击或拖入图片"})]})}),l.jsx("input",{ref:R,type:"file",accept:"image/png,image/jpeg,image/svg+xml,image/webp,image/gif",className:"hidden",disabled:S,onChange:F=>{const j=F.target.files?.[0];j!==void 0&&C(j),F.target.value=""}}),l.jsxs("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:[r.length===0?l.jsx("span",{className:"text-xs text-muted-foreground",children:"未抓取到候选图标;将使用首字母图标"}):r.filter(F=>F.variant==="original"||F.variant==="subject").map(F=>{const j=o===void 0?void 0:Dn(o,F.index,s),D=a===`${o}:${F.index}`,H=a===void 0&&F.variant==="original"&&F.index===(r.find(_=>_.variant==="original")?.index??-1);return l.jsx("button",{type:"button",disabled:S,title:F.variant==="subject"?`AI 主体提取 ${F.width}×${F.height} ${F.format.toUpperCase()}`:`${F.width}×${F.height} ${F.format.toUpperCase()}`,onClick:()=>y(F),className:he("icon-checker flex size-14 items-center justify-center overflow-hidden rounded-lg border p-1 transition-all",D||H?"border-primary ring-2 ring-primary/60":"border-border hover:border-primary/60",S&&"opacity-50"),children:j!==void 0?l.jsx("img",{src:j,alt:F.variant==="subject"?`主体提取候选 ${F.width}×${F.height}`:`候选图标 ${F.width}×${F.height}`,className:"size-full object-contain"}):null},F.index)}),g?l.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",role:"status",children:[l.jsx("span",{className:"inline-block size-3 animate-spin rounded-full border-2 border-muted-foreground/40 border-t-muted-foreground"}),p??"AI 提取主体中…"]}):null,l.jsx("button",{type:"button",disabled:S,"aria-expanded":B,onClick:()=>T(F=>!F),className:"text-[11px] text-muted-foreground underline-offset-2 hover:underline",children:"AI 提取设置"})]}),B?l.jsxs("div",{className:"mt-2 grid grid-cols-1 gap-2.5 rounded-lg border border-border p-3",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsx("span",{className:"text-[11px] text-muted-foreground",children:"模型精度"}),l.jsx("div",{className:"flex gap-1.5",children:[["isnet","高精"],["isnet_fp16","标准"],["isnet_quint8","轻量"]].map(([F,j])=>l.jsx("button",{type:"button",disabled:S,"aria-pressed":x.model===F,onClick:()=>m({...x,model:F}),className:he("h-7 rounded-md border px-2.5 text-[11px] transition-colors",x.model===F?"border-foreground bg-secondary text-secondary-foreground":"border-border text-muted-foreground hover:border-foreground/40"),children:j},F))})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[11px] text-muted-foreground",children:"去除半透明残留(alpha 阈值)"}),l.jsx("span",{className:"text-[11px] tabular-nums text-muted-foreground",children:x.alphaThreshold===0?"关闭":x.alphaThreshold})]}),l.jsx("input",{type:"range",min:0,max:128,step:8,value:x.alphaThreshold,disabled:S,onChange:F=>m({...x,alphaThreshold:Number(F.target.value)}),className:"mt-1 w-full accent-foreground","aria-label":"主体提取 alpha 阈值"})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[11px] text-muted-foreground",children:"边缘收缩(去白边/光晕)"}),l.jsx("span",{className:"text-[11px] tabular-nums text-muted-foreground",children:x.shrink===0?"关闭":`${x.shrink}px`})]}),l.jsx("input",{type:"range",min:0,max:6,step:1,value:x.shrink,disabled:S,onChange:F=>m({...x,shrink:Number(F.target.value)}),className:"mt-1 w-full accent-foreground","aria-label":"主体提取边缘收缩"})]}),l.jsx("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:"调整设置会自动重新提取,并替换现有主体候选及其托盘剪影。"})]}):null,a!==void 0||i!==void 0?l.jsx("button",{type:"button",disabled:S,onClick:I,className:"text-[11px] text-muted-foreground underline-offset-2 hover:underline",children:"清除选择(回到默认)"}):null]}),(a!==void 0||i!==void 0)&&l.jsx("div",{className:"mt-3 rounded-lg border border-border p-3",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{role:"img",className:"icon-checker size-14 shrink-0 overflow-hidden rounded-[10px]","aria-label":"图标合成预览",children:u!==void 0?l.jsx("img",{src:lp(u.key),alt:"图标合成预览",className:"size-full object-contain",onError:F=>{F.currentTarget.style.display="none"}}):l.jsx("span",{className:"flex size-full items-center justify-center text-[10px] text-muted-foreground",children:"预览"})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx(Pe,{children:"图标背景"}),l.jsx("div",{className:"mt-1.5 flex gap-1.5",children:["black","white","transparent"].map(F=>l.jsxs("button",{type:"button",disabled:S,"aria-pressed":h===F,onClick:()=>v(F),className:he("flex h-7 items-center gap-1.5 rounded-md border px-2.5 text-[11px] transition-colors",h===F?"border-foreground bg-secondary text-secondary-foreground":"border-border text-muted-foreground hover:border-foreground/40"),children:[F==="black"?"黑色":F==="white"?"白色":"透明",c!==void 0&&c.suggested===F?l.jsx("span",{className:"text-[10px] text-muted-foreground/70",children:"自动"}):null]},F))}),l.jsxs("div",{className:"mt-2.5",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(Pe,{className:"text-[11px]",children:"前景缩放"}),l.jsxs("span",{className:"text-[11px] tabular-nums text-muted-foreground",children:[Math.round(A*100),"%"]})]}),l.jsx("input",{type:"range",min:50,max:95,step:5,value:Math.round(A*100),disabled:S,onChange:F=>b(Number(F.target.value)/100),className:"mt-1 w-full accent-foreground","aria-label":"前景图标缩放"})]}),f!==void 0?l.jsx("p",{role:"alert",className:"mt-1.5 text-[11px] font-medium text-red-400",children:f}):null,c!==void 0?l.jsx("p",{className:"mt-1.5 text-[11px] leading-relaxed text-muted-foreground",children:h==="transparent"?"透明背景:原始像素直接透出。":`已按明暗自动选择${c.suggested===h?"":"(已手动覆盖)"}:${c.luminance===void 0?"无法分析明暗":`前景明度 ${c.luminance.toFixed(2)}、覆盖率 ${(c.coverage*100).toFixed(0)}%`}。`}):null]})]})})]}),l.jsxs("div",{children:[l.jsx(Pe,{htmlFor:"appId",children:"App ID"}),l.jsx(Xe,{id:"appId",className:"mt-1 font-mono",disabled:S,value:e.appId,placeholder:t.appId||"由命令推导(如 start.somecommand.npx)",onChange:F=>w({appId:F.target.value})})]}),l.jsxs("div",{children:[l.jsx(Pe,{htmlFor:"appName",children:"应用名称"}),l.jsx(Xe,{id:"appName",className:"mt-1",disabled:S,value:e.appName,placeholder:t.appName||"从服务页面标题抓取",onChange:F=>w({appName:F.target.value})})]})]})}function $1({candidates:e,port:t,generation:n,disabled:r,selectedRef:o,uploadedUrl:s,includeVariants:i,defaultLabel:a,onPick:c,onUpload:u,onClear:f}){const h=d.useRef(null),[A,g]=d.useState(!1),p=i?e:e.filter(m=>m.variant==="original"),x=e.filter(m=>m.variant==="original");return l.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[l.jsx("button",{type:"button",disabled:r,"aria-label":"选择本地图片",onClick:()=>h.current?.click(),onDragOver:m=>{m.preventDefault(),r||g(!0)},onDragLeave:()=>g(!1),onDrop:m=>{if(m.preventDefault(),g(!1),r)return;const v=m.dataTransfer.files[0];v!==void 0&&u(v)},className:he("flex size-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-dashed border-border bg-popover transition-colors",r?"opacity-50":"hover:border-primary",A&&"border-primary bg-primary/10"),children:s!==void 0?l.jsx("img",{src:s,alt:"已选图标",className:"icon-checker size-full rounded object-contain"}):l.jsxs("span",{className:"flex flex-col items-center gap-1 text-muted-foreground",children:[l.jsx(ju,{className:"size-4"}),l.jsx("span",{className:"text-[10px] leading-tight",children:"上传"})]})}),l.jsx("input",{ref:h,type:"file",accept:"image/png,image/jpeg,image/svg+xml,image/webp,image/gif",className:"hidden",disabled:r,onChange:m=>{const v=m.target.files?.[0];v!==void 0&&u(v),m.target.value=""}}),l.jsxs("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:[p.length===0?l.jsx("span",{className:"text-xs text-muted-foreground",children:"暂无候选图标"}):p.map(m=>{const v=t===void 0?void 0:Dn(t,m.index,n),b=o===`${t}:${m.index}`,y=o===void 0&&m.variant==="original"&&m.index===(x[0]?.index??-1);return l.jsx("button",{type:"button",disabled:r,title:m.variant==="original"?`${m.width}×${m.height} ${m.format.toUpperCase()}`:m.variant==="subject"?`AI 主体提取 ${m.width}×${m.height} ${m.format.toUpperCase()}`:`${m.variant==="solid-black"?"黑色":"白色"}纯色 ${m.format.toUpperCase()}`,onClick:()=>c(m),className:he("icon-checker flex size-12 items-center justify-center overflow-hidden rounded-lg border p-1 transition-all",b||y?"border-primary ring-2 ring-primary/60":"border-border hover:border-primary/60",r&&"opacity-50"),children:v!==void 0?l.jsx("img",{src:v,alt:`候选 ${m.variant}`,className:"size-full object-contain"}):null},`${m.variant}:${m.index}`)}),a!==void 0&&o===void 0&&p.length>0?l.jsx("span",{className:"text-[11px] text-muted-foreground",children:a}):null]}),o!==void 0||s!==void 0?l.jsx("button",{type:"button",disabled:r,onClick:f,className:"text-[11px] text-muted-foreground underline-offset-2 hover:underline",children:"清除"}):null]})}function X1(e){const t=d.useRef(!0);t.current&&(t.current=!1,e())}const cp=d.createContext(null);function Jt(){const e=d.useContext(cp);if(e===null)throw new Error(st(60));return e}const q1=(e,t)=>Object.is(e,t);function sr(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Co(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:sr(r,t,n))}function eC(e,t,n){return e.filter(r=>!sr(t,r,n))}function Bi(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function up(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function tC(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(up(t)){for(const n of t)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of t)if(n&&n.value==null&&n.label!=null)return!0;return!1}function dp(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Bi(e)}function Wn(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Bi(e.value):Bi(e)}function fp(e,t,n){function r(){return dp(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const o=t,s=up(o)?o.flatMap(i=>i.items):o;if(e==null||typeof e!="object"){const i=s.find(a=>a.value===e);return i&&i.label!=null?i.label:r()}if("value"in e){const i=s.find(a=>a&&a.value===e.value);if(i&&i.label!=null)return i.label}}return r()}function nC(e,t,n){return e.reduce((r,o,s)=>(s>0&&r.push(", "),r.push(l.jsx(d.Fragment,{children:fp(o,t,n)},s)),r),[])}const we={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Wn(t,r)!==""},hasNullItemLabel:(e,t)=>t?tC(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{const n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(o=>sr(t,o,n)):sr(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function rC(e,t,n=(r,o)=>r===o){return e.length===t.length&&e.every((r,o)=>n(r,t[o]))}function yr(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const _t=1;function el(e,t){return Math.max(0,e-t)}function Lo(e,t){if(t<=0)return 0;const n=yr(e,0,t),r=n,o=t-n,s=r<=_t,i=o<=_t;return s&&i?r<=o?0:t:s?0:i?t:n}function oC(e){const{id:t,value:n,defaultValue:r=null,onValueChange:o,open:s,defaultOpen:i=!1,onOpenChange:a,name:c,form:u,autoComplete:f,disabled:h=!1,readOnly:A=!1,required:g=!1,modal:p=!0,actionsRef:x,inputRef:m,onOpenChangeComplete:v,items:b,multiple:y=!1,itemToStringLabel:C,itemToStringValue:I,isItemEqualToValue:w=q1,highlightItemOnHover:S=!0,children:R}=e,{clearErrors:E}=Qi(),{setDirty:k,setTouched:B,setFocused:T,validityData:F,setFilled:j,name:D,disabled:H,validation:_,validationMode:P}=Uo(),L=Yi({id:t}),N=H||h,M=D??c,[O,G]=sn({controlled:n,default:y?r??Ot:r,name:"Select",state:"value"}),[Z,J]=sn({controlled:s,default:i,name:"Select",state:"open"}),Q=d.useRef([]),$=d.useRef([]),K=d.useRef(null),te=d.useRef(null),le=d.useRef(0),X=d.useRef(null),ee=d.useRef([]),U=d.useRef(!1),ue=d.useRef(null),se=d.useRef(null),be=d.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),re=d.useRef(!1),{mounted:Ae,setMounted:ie,transitionStatus:oe}=ir(Z),{openMethod:ce,triggerProps:me}=Od(Z),ge=Rt(()=>new zr({id:L,labelId:void 0,modal:p,multiple:y,itemToStringLabel:C,itemToStringValue:I,isItemEqualToValue:w,value:O,open:Z,mounted:Ae,transitionStatus:oe,items:b,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,W=Ie(ge,we.activeIndex),V=Ie(ge,we.selectedIndex),ye=Ie(ge,we.triggerElement),q=Ie(ge,we.positionerElement),ne=S0(ce),ke=ce??ne,Se=d.useMemo(()=>y?"":Wn(O,I),[y,O,I]),Qe=d.useMemo(()=>y&&Array.isArray(O)?O.map(Be=>Wn(Be,I)):Wn(O,I),[y,O,I]),tt=et(ye),Le=de(()=>Qe);zi(tt,L,O,Le,!N,c);const ht=d.useRef(O),Ke=y?Array.isArray(O)&&O.length>0:O!=null&&Se!=="";ae(()=>{j(Ke)},[Ke,j]),ae(function(){let ze=O,bt=!1;if(y){const Pt=Array.isArray(O)?O:[];bt=Pt.length===0,ze=Pt[Pt.length-1]}const Et=bt?-1:Co(ee.current,ze,w),St=Et===-1?null:Et;St===null&&(se.current=null),!Z&&ge.set("selectedIndex",St)},[y,Z,O,w,ge]);function Ge(Be){const ze=F.initialValue;return Array.isArray(Be)&&Array.isArray(ze)?!rC(Be,ze,(bt,Et)=>sr(bt,Et,w)):Be!==ze}cs(O,()=>{E(M),k(Ge(O)),_.change(O)});const ut=de((Be,ze)=>{a?.(Be,ze),!ze.isCanceled&&(J(Be),!Be&&(ze.reason===Mn||ze.reason===Go)&&(B(!0),T(!1),P==="onBlur"&&_.commit(O)))}),Re=de(()=>{ie(!1),ge.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),v?.(!1)});Ut({enabled:!x,open:Z,ref:K,onComplete(){Z||Re()}}),d.useImperativeHandle(x,()=>({unmount:Re}),[Re]);const Ue=de((Be,ze)=>{o?.(Be,ze),!ze.isCanceled&&G(Be)}),_e=de(Be=>{const ze=el(Be.scrollHeight,Be.clientHeight),bt=Lo(Be.scrollTop,ze),Et=bt>0,St=bt<ze;ge.set("scrollUpArrowVisible",Et),ge.set("scrollDownArrowVisible",St)}),nt=km({open:Z,onOpenChange:ut,elements:{reference:ye,floating:q}}),Ee=ud(nt,{enabled:!A&&!N,event:"mousedown"}),Ve=ns(nt),Ze=Bd(nt,{enabled:!A&&!N,listRef:Q,activeIndex:W,selectedIndex:V,disabledIndices:Ot,onNavigate(Be){Be===null&&!Z||ge.set("activeIndex",Be)},focusItemOnHover:S}),Je=jd(nt,{enabled:!A&&!N&&(Z||!y),listRef:$,activeIndex:W,selectedIndex:V,disabledIndices:Be=>of(Q.current[Be]),onMatch(Be){Z?ge.set("activeIndex",Be):Ue(ee.current[Be],Ce(jt))},onTyping(Be){U.current=Be}}),rt=d.useMemo(()=>Ft(Je.reference,Ze.reference,Ve.reference,Ee.reference,me),[Ee.reference,Je.reference,Ze.reference,Ve.reference,me]),it=d.useMemo(()=>Ft(ss,Je.floating,Ze.floating,Ve.floating),[Je.floating,Ze.floating,Ve.floating]),At=Ze.item??ct;X1(()=>{ge.update({popupProps:it,triggerProps:rt})}),ge.useSyncedValues({id:L,modal:p,multiple:y,value:O,open:Z,mounted:Ae,transitionStatus:oe,popupProps:it,triggerProps:rt,items:b,itemToStringLabel:C,itemToStringValue:I,isItemEqualToValue:w,openMethod:ke});const dt=d.useMemo(()=>({store:ge,floatingContext:nt,required:g,disabled:N,readOnly:A,multiple:y,highlightItemOnHover:S,setValue:Ue,setOpen:ut,listRef:Q,popupRef:K,scrollHandlerRef:te,handleScrollArrowVisibility:_e,scrollArrowsMountedCountRef:le,itemProps:At,valueRef:X,valuesRef:ee,labelsRef:$,typingRef:U,selectionRef:be,firstItemTextRef:ue,selectedItemTextRef:se,validation:_,onOpenChangeComplete:v,alignItemWithTriggerActiveRef:re,initialValueRef:ht}),[ge,nt,g,N,A,y,S,Ue,ut,At,_,v,_e]),xt=zt(m,_.inputRef),Mt=y?void 0:M,$t=d.useMemo(()=>!y||!Array.isArray(O)||!M?null:O.map(Be=>{const ze=Wn(Be,I);return l.jsx("input",{type:"hidden",form:u,name:M,value:ze,disabled:N},ze)}),[y,O,u,M,I,N]);return l.jsxs(cp.Provider,{value:dt,children:[R,l.jsx("input",{..._.getValidationProps(N,{onFocus(){ge.state.triggerElement?.focus({focusVisible:!0})},onChange(Be){if(Be.nativeEvent.defaultPrevented||N||A)return;const ze=Be.currentTarget.value,bt=Ce(jt,Be.nativeEvent);function Et(){if(y)return;const St=ze.toLowerCase();let Pt=ee.current.findIndex(vt=>Wn(vt,I).toLowerCase()===St||dp(vt,C).toLowerCase()===St);Pt===-1&&(Pt=ee.current.findIndex((vt,un)=>{const En=$.current[un];return En!=null&&En.toLowerCase()===St}));const Tt=ee.current[Pt];Tt!=null&&Ue(Tt,bt)}ge.set("forceMount",!0),queueMicrotask(Et)}}),id:L&&Mt==null?`${L}-hidden-input`:void 0,form:u,name:Mt,autoComplete:f,value:Se,disabled:N,required:g&&!(y&&Ke),readOnly:A,ref:xt,style:M?da:ts,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),$t]})}function sC(e,t){return e??t}const iC=400,aC={...hi,...Wi,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},lC=d.forwardRef(function(t,n){const{render:r,className:o,id:s,disabled:i=!1,nativeButton:a=!0,style:c,...u}=t,{setTouched:f,setFocused:h,validationMode:A,state:g,disabled:p}=Uo(),{labelId:x}=Gi(),{store:m,setOpen:v,selectionRef:b,validation:y,readOnly:C,required:I,alignItemWithTriggerActiveRef:w,disabled:S}=Jt(),R=p||S||i,E=Ie(m,we.open),k=Ie(m,we.mounted),B=Ie(m,we.value),T=Ie(m,we.triggerProps),F=Ie(m,we.positionerElement),j=Ie(m,we.listElement),D=Ie(m,we.popupSide),H=Ie(m,we.id),_=Ie(m,we.labelId),P=Ie(m,we.hasSelectedValue),L=k&&F?D:null,N=s??H,M=sC(x,_);Yi({id:N});const O=et(F),G=d.useRef(null),{getButtonProps:Z,buttonRef:J}=Yt({disabled:R,native:a}),Q=m.useStateSetter("triggerElement"),$=pt(),K=pt(),te=pt();d.useEffect(()=>{if(E)return te.start(iC,()=>{b.current.allowUnselectedMouseUp=!0,b.current.allowSelectedMouseUp=!0}),()=>{te.clear()};b.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},K.clear()},[E,b,K,te]);const le=Ft(T,{id:N,role:"combobox","aria-expanded":E,"aria-haspopup":"listbox","aria-controls":E?j?.id??ko(F)?.id:void 0,"aria-labelledby":M,"aria-readonly":C||void 0,"aria-required":I||void 0,tabIndex:R?-1:0,onFocus(U){h(!0),E&&w.current&&v(!1,Ce(jt,U.nativeEvent)),$.start(0,()=>{m.set("forceMount",!0)})},onBlur(U){ve(F,U.relatedTarget)||(f(!0),h(!1),A==="onBlur"&&y.commit(B))},onMouseDown(U){if(E)return;const ue=je(U.currentTarget);function se(be){if(!G.current)return;const re=be.target;ve(G.current,re)||ve(O.current,re)||ef(be,G.current)||v(!1,Ce(Su,be))}K.start(0,()=>{ue.addEventListener("mouseup",se,{once:!0})})}},u,Z),X=y.getValidationProps(R,le);X.role="combobox";const ee={...g,open:E,disabled:R,value:B,readOnly:C,popupSide:L,placeholder:!P};return Me("button",t,{ref:[n,G,J,Q],state:ee,stateAttributesMapping:aC,props:X})}),cC={value:()=>null},uC=d.forwardRef(function(t,n){const{className:r,render:o,children:s,placeholder:i,style:a,...c}=t,{store:u,valueRef:f}=Jt(),h=Ie(u,we.value),A=Ie(u,we.items),g=Ie(u,we.itemToStringLabel),p=Ie(u,we.hasSelectedValue),x=!p&&i!=null&&s==null,m=Ie(u,we.hasNullItemLabel,x),v={value:h,placeholder:!p};let b=null;return typeof s=="function"?b=s(h):s!=null?b=s:x&&!m?b=i:Array.isArray(h)?b=nC(h,A,g):b=fp(h,A,g),Me("span",t,{state:v,ref:[n,f],props:[{children:b},c],stateAttributesMapping:cC})}),dC=d.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,{store:a}=Jt(),u={open:Ie(a,we.open)};return Me("span",t,{state:u,ref:n,props:[{"aria-hidden":!0,children:"▼"},i],stateAttributesMapping:$u})}),fC=d.forwardRef(function(t,n){const{store:r}=Jt(),o=Ie(r,we.mounted),s=Ie(r,we.forceMount);return o||s?l.jsx(fa,{ref:n,...t}):null}),pp=d.createContext(void 0);function tl(){const e=d.useContext(pp);if(!e)throw new Error(st(59));return e}function Ko(e,t){e&&Object.assign(e.style,t)}const hp={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},pC={position:"fixed"},hC=d.forwardRef(function(t,n){const{anchor:r,className:o,render:s,positionMethod:i,side:a,align:c,sideOffset:u,alignOffset:f,collisionBoundary:h="clipping-ancestors",collisionPadding:A,arrowPadding:g,sticky:p,disableAnchorTracking:x,alignItemWithTrigger:m=!0,collisionAvoidance:v=td,style:b,...y}=t,{store:C,listRef:I,labelsRef:w,alignItemWithTriggerActiveRef:S,selectedItemTextRef:R,valuesRef:E,initialValueRef:k,popupRef:B,setValue:T,floatingContext:F}=Jt(),j=Ie(C,we.open),D=Ie(C,we.mounted),H=Ie(C,we.modal),_=Ie(C,we.value),P=Ie(C,we.openMethod),L=Ie(C,we.positionerElement),N=Ie(C,we.triggerElement),M=Ie(C,we.isItemEqualToValue),O=Ie(C,we.transitionStatus),G=d.useRef(null),Z=d.useRef(null),[J,Q]=d.useState(m),$=D&&J&&P!=="touch";!D&&J!==m&&Q(m),d.useImperativeHandle(S,()=>$),Xd(($||H)&&j,P==="touch",L,N);const K=Ma({anchor:r,floatingRootContext:F,positionMethod:i,mounted:D,side:a,sideOffset:u,align:c,alignOffset:f,arrowPadding:g,collisionBoundary:h,collisionPadding:A,sticky:p,disableAnchorTracking:x??$,collisionAvoidance:v,keepMounted:!0}),te=$?"none":K.side,le=$?pC:K.positionerStyles,X={open:j,side:te,align:K.align,anchorHidden:K.anchorHidden};ae(()=>{C.set("popupSide",K.side)},[C,K.side]);const ee=C.useStateSetter("positionerElement"),U=Pa(t,X,{styles:le,transitionStatus:O,props:y,refs:[n,ee],hidden:!D,inert:!j}),ue=d.useRef(0),se=de(re=>{if(E.current.length===0)return;const Ae=ue.current;if(ue.current=re.size,re.size===Ae)return;const ie=Ce(jt);if(Ae!==0&&!C.state.multiple&&_!==null&&Co(E.current,_,M)===-1){const ce=k.current,ge=ce!=null&&Co(E.current,ce,M)!==-1?ce:null;T(ge,ie),ge===null&&(C.set("selectedIndex",null),R.current=null)}if(Ae!==0&&C.state.multiple&&Array.isArray(_)){const oe=_.filter(ce=>Co(E.current,ce,M)!==-1);oe.length!==_.length&&(T(oe,ie),oe.length===0&&(C.set("selectedIndex",null),R.current=null))}if(j&&$){C.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const oe={height:""};Ko(L,oe),Ko(B.current,oe)}}),be=d.useMemo(()=>({...K,side:te,alignItemWithTriggerActive:$,setControlledAlignItemWithTrigger:Q,scrollUpArrowRef:G,scrollDownArrowRef:Z}),[K,te,$,Q]);return l.jsx(Vr,{elementsRef:I,labelsRef:w,onMapChange:se,children:l.jsxs(pp.Provider,{value:be,children:[D&&H&&l.jsx(Fa,{inert:Da(!j),cutout:N}),U]})})}),ho="base-ui-disable-scrollbar",ji={className:ho,getElement(e){return l.jsx("style",{nonce:e,href:ho,precedence:"base-ui:low",children:`.${ho}{scrollbar-width:none}.${ho}::-webkit-scrollbar{display:none}`})}},gC=d.createContext(void 0),AC={disableStyleElements:!1};function mC(){return d.useContext(gC)??AC}const xC={...Qr,...On},bC=d.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:i,...a}=t,{store:c,popupRef:u,onOpenChangeComplete:f,setOpen:h,valueRef:A,firstItemTextRef:g,selectedItemTextRef:p,multiple:x,handleScrollArrowVisibility:m,scrollHandlerRef:v,listRef:b,highlightItemOnHover:y,floatingContext:C}=Jt(),{side:I,align:w,alignItemWithTriggerActive:S,isPositioned:R,setControlledAlignItemWithTrigger:E}=tl(),k=Na()!=null,B=us(),{nonce:T,disableStyleElements:F}=mC(),j=Ie(c,we.id),D=Ie(c,we.open),H=Ie(c,we.openMethod),_=Ie(c,we.mounted),P=Ie(c,we.popupProps),L=Ie(c,we.transitionStatus),N=Ie(c,we.triggerElement),M=Ie(c,we.positionerElement),O=Ie(c,we.listElement),G=d.useRef(!1),Z=d.useRef(!1),J=d.useRef({}),Q=er(),$=de(X=>{if(!M||!u.current||!Z.current)return;const ee=M.style.top==="0px",U=M.style.bottom==="0px";if(G.current||!S||!ee&&!U){m(X);return}const ue=iu(M),se=Cr(M.getBoundingClientRect().height,"y",ue),be=je(M),re=ot(M),Ae=re.getComputedStyle(M),ie=parseFloat(Ae.marginTop),oe=parseFloat(Ae.marginBottom),ce=su(re.getComputedStyle(u.current)),me=Math.min(be.documentElement.clientHeight-ie-oe,ce),ge=X.scrollTop,W=go(X);let V=null;const ye=Se=>{M.style.height=`${Se}px`},q=ee?W-ge:ge,ne=Math.min(se+q,me);if(q<=_t){const Se=yr(q,0,me-se);Se>0&&ye(se+Se),X.scrollTop=ee?W:0,me-(se+Se)<=_t&&(G.current=!0),m(X);return}if(me-ne>_t)V=ee?1/0:0;else if(U&&ge<W){const Se=se+q-me;V=ge-(q-Se)}const ke=Math.ceil(ne);if(ke!==0&&ye(ke),V!=null){const Se=yr(V,0,go(X));Math.abs(X.scrollTop-Se)>_t&&(X.scrollTop=Se)}ke>=me-_t&&(G.current=!0),m(X)});d.useImperativeHandle(v,()=>$,[$]),Ut({open:D,ref:u,onComplete(){D&&f?.(!0)}});const K={open:D,transitionStatus:L,side:I,align:w};ae(()=>{!M||!u.current||Object.keys(J.current).length||(J.current={top:M.style.top||"0",left:M.style.left||"0",right:M.style.right,height:M.style.height,bottom:M.style.bottom,minHeight:M.style.minHeight,maxHeight:M.style.maxHeight,marginTop:M.style.marginTop,marginBottom:M.style.marginBottom})},[u,M]),ae(()=>{D||S||(Z.current=!1,G.current=!1,Ko(M,J.current))},[D,S,M,u]),ae(()=>{const X=u.current;if(!D||!N||!M||!X||S&&!R||c.state.transitionStatus==="ending")return;if(Z.current=!0,X.style.removeProperty("--transform-origin"),!S){Q.request(()=>m(O||X));return}const ee=vC(X);try{let U=p.current;U?.isConnected||(U=!we.hasSelectedValue(c.state)&&g.current?.isConnected?g.current:null);const ue=A.current,se=ot(M),be=se.getComputedStyle(M),re=se.getComputedStyle(X),Ae=je(N),ie=iu(N),oe=Ao(N.getBoundingClientRect(),ie),ce=Ao(M.getBoundingClientRect(),ie),me=oe.height,ge=O||X,W=ge.scrollHeight,V=parseFloat(re.borderBottomWidth),ye=parseFloat(be.marginTop)||10,q=parseFloat(be.marginBottom)||10,ne=parseFloat(be.minHeight)||100,ke=su(re),Se=5,Qe=5,tt=20,Le=Ae.documentElement.clientHeight-ye-q,ht=Ae.documentElement.clientWidth,Ke=Le-oe.bottom+me;let Ge,ut=B==="rtl"?oe.right-ce.width:oe.left,Re=0;if(U&&ue){const dt=Ao(ue.getBoundingClientRect(),ie);Ge=Ao(U.getBoundingClientRect(),ie),ut=ce.left+(B==="rtl"?dt.right-Ge.right:dt.left-Ge.left);const xt=dt.top-oe.top+dt.height/2;Re=Ge.top-ce.top+Ge.height/2-xt}const Ue=Ke+Re+q+V;let _e=Math.min(Le,Ue);const nt=Le-ye-q,Ee=Ue-_e,Ve=ht-Qe;M.style.left=`${yr(ut,Se,Ve-ce.width)}px`,M.style.height=`${_e}px`,M.style.maxHeight="none",M.style.marginTop=`${ye}px`,M.style.marginBottom=`${q}px`,X.style.height="100%";const Ze=go(ge),Je=Ee>=Ze-_t;Je&&(_e=Math.min(Le,ce.height)-(Ee-Ze));const rt=oe.top<tt||oe.bottom>Le-tt||Math.ceil(_e)+_t<Math.min(W,ne),it=(se.visualViewport?.scale??1)!==1&&ln;if(rt||it){Ko(M,J.current),E(!1);return}const At=Math.max(ne,_e);if(Je){const dt=Math.max(0,Le-Ue);M.style.top=ce.height>=nt?"0":`${dt}px`,M.style.height=`${_e}px`,ge.scrollTop=go(ge)}else M.style.bottom="0",ge.scrollTop=Ee;if(Ge){const dt=ce.top,xt=ce.height,Mt=Ge.top+Ge.height/2,$t=yr(xt>0?(Mt-dt)/xt*100:50,0,100);X.style.setProperty("--transform-origin",`50% ${$t}%`)}(At===Le||_e>=ke)&&(G.current=!0),m(ge),y&&c.state.selectedIndex===null&&c.state.activeIndex===null&&b.current[0]!=null&&c.set("activeIndex",0)}finally{ee()}},[c,D,M,N,A,g,p,u,m,S,E,Q,O,b,y,B,R]),d.useEffect(()=>{if(!S||!M||!D)return;const X=ot(M);function ee(U){h(!1,Ce(sh,U))}return De(X,"resize",ee)},[h,S,M,D]);const te={...O?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":x||void 0,id:`${j}-list`},onKeyDown(X){k&&as.has(X.key)&&X.stopPropagation()},onScroll(X){O||$(X.currentTarget)},...S&&{style:O?{height:"100%"}:hp},className:!O&&S?ji.className:void 0},le=Me("div",t,{ref:[n,u],state:K,stateAttributesMapping:xC,props:[P,te,ds(L),a]});return l.jsxs(d.Fragment,{children:[!F&&ji.getElement(T),l.jsx(ga,{context:C,modal:!1,disabled:!_,openInteractionType:H,returnFocus:i,restoreFocus:!0,children:le})]})});function su(e){const t=e.maxHeight;return t.endsWith("px")&&parseFloat(t)||1/0}function go(e){return el(e.scrollHeight,e.clientHeight)}function iu(e){return Ad.getScale(e)}function Cr(e,t,n){return e/n[t]}function Ao(e,t){return Fr({x:Cr(e.x,"x",t),y:Cr(e.y,"y",t),width:Cr(e.width,"x",t),height:Cr(e.height,"y",t)})}const au=[["transform","none"],["scale","1"],["translate","0 0"]];function vC(e){const{style:t}=e,n={};for(const[r,o]of au)n[r]=t.getPropertyValue(r),t.setProperty(r,o,"important");return()=>{for(const[r]of au){const o=n[r];o?t.setProperty(r,o):t.removeProperty(r)}}}const yC=d.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,{store:a,scrollHandlerRef:c,multiple:u}=Jt(),{alignItemWithTriggerActive:f}=tl(),h=Ie(a,we.hasScrollArrows),A=Ie(a,we.openMethod),p={id:`${Ie(a,we.id)}-list`,role:"listbox","aria-multiselectable":u||void 0,onScroll(m){c.current?.(m.currentTarget)},...f&&{style:hp},className:h&&A!=="touch"?ji.className:void 0},x=a.useStateSetter("listElement");return Me("div",t,{ref:[n,x],props:[p,i]})}),gp=d.createContext(void 0);function nl(){const e=d.useContext(gp);if(!e)throw new Error(st(57));return e}const CC=d.memo(d.forwardRef(function(t,n){const{render:r,className:o,style:s,value:i=null,label:a,disabled:c=!1,nativeButton:u=!1,...f}=t,h=d.useRef(null),A=As({guess:!0,label:a,textRef:h}),{store:g,itemProps:p,setOpen:x,setValue:m,selectionRef:v,typingRef:b,valuesRef:y,multiple:C,selectedItemTextRef:I,disabled:w,readOnly:S}=Jt(),R=w||c,E=Ie(g,we.isActive,A.index),k=Ie(g,we.open),B=Ie(g,we.isSelected,i),T=Ie(g,we.isSelectedByFocus,A.index),F=Ie(g,we.isItemEqualToValue),j=A.index,D=d.useRef(null);ae(()=>{const Q=y.current;return Q[j]=i,()=>{delete Q[j]}},[j,i,y]),ae(()=>{const Q=g.state.value;let $=Q;C&&Array.isArray(Q)&&($=Q.length>0?Q[Q.length-1]:void 0),$!==void 0&&sr(i,$,F)&&(g.set("selectedIndex",j),h.current&&(I.current=h.current))},[j,C,F,g,i,I]);const H=d.useRef("mouse"),_=d.useRef(!1),{getButtonProps:P,buttonRef:L}=Yt({disabled:R,focusableWhenDisabled:!0,native:u,composite:!0}),N={disabled:R,selected:B,highlighted:E};function M(Q){if(w||S)return;const $=g.state.value;if(C){const K=Array.isArray($)?$:[],te=B?eC(K,i,F):[...K,i];m(te,Ce(Ir,Q))}else m(i,Ce(Ir,Q)),x(!1,Ce(Ir,Q))}function O(){v.current.dragY=0}const G={role:"option","aria-selected":B,tabIndex:k&&E?0:-1,onKeyDown(Q){g.set("activeIndex",j),Q.key===" "&&b.current&&Q.preventDefault()},onClick(Q){const $=H.current!=="touch",K=Q.nativeEvent.pointerType,te=$&&qi(Q.nativeEvent)&&(K!==void 0||E),le=$&&!te&&!_.current;_.current=!1,!(R||le)&&M(Q.nativeEvent)},onPointerEnter(Q){H.current=Q.pointerType},onPointerMove(Q){if(Q.pointerType==="mouse"&&Q.buttons===1){const $=v.current;$.dragY+=Q.movementY,$.dragY**2>=64&&($.allowUnselectedMouseUp=!0)}},onPointerDown(Q){H.current=Q.pointerType,_.current=!0,O()},onMouseUp(){if(O(),R||H.current==="touch"||_.current)return;const Q=!v.current.allowSelectedMouseUp&&B,$=!v.current.allowUnselectedMouseUp&&!B;Q||$||(_.current=!0,D.current?.click(),_.current=!1)}},Z=Me("div",t,{ref:[L,n,A.ref,D],state:N,props:[p,G,f,P]}),J=d.useMemo(()=>({selected:B,index:j,textRef:h,selectedByFocus:T}),[B,j,h,T]);return l.jsx(gp.Provider,{value:J,children:Z})})),IC=d.forwardRef(function(t,n){const{selected:r}=nl();return t.keepMounted||r?l.jsx(wC,{...t,ref:n}):null}),wC=d.memo(d.forwardRef((e,t)=>{const{render:n,className:r,style:o,keepMounted:s,...i}=e,{selected:a}=nl(),c=d.useRef(null),{transitionStatus:u,setMounted:f}=ir(a),A=Me("span",e,{ref:[t,c],state:{selected:a,transitionStatus:u},props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:On});return Ut({open:a,ref:c,onComplete(){a||f(!1)}}),A})),kC=d.memo(d.forwardRef(function(t,n){const{index:r,textRef:o,selectedByFocus:s}=nl(),{firstItemTextRef:i,selectedItemTextRef:a}=Jt(),{render:c,className:u,style:f,...h}=t,A=d.useCallback(p=>{p&&(r===0&&(i.current=p),s&&(a.current=p))},[i,a,r,s]);return Me("div",t,{ref:[A,n,o],props:h})})),Ap=d.forwardRef(function(t,n){const{render:r,className:o,style:s,direction:i,keepMounted:a,...c}=t,u=i==="up",{store:f,popupRef:h,listRef:A,handleScrollArrowVisibility:g,scrollArrowsMountedCountRef:p}=Jt(),{side:x,scrollDownArrowRef:m,scrollUpArrowRef:v}=tl(),b=u?we.scrollUpArrowVisible:we.scrollDownArrowVisible,y=Ie(f,b),C=Ie(f,we.openMethod),I=y&&C!=="touch",w=pt(),S=u?v:m,{mounted:R,transitionStatus:E,setMounted:k}=ir(I);ae(()=>(p.current+=1,f.set("hasScrollArrows",!0),()=>{p.current=Math.max(0,p.current-1),p.current===0&&f.set("hasScrollArrows",!1)}),[f,p]),Ut({open:I,ref:S,onComplete(){I||k(!1)}});const F=Me("div",t,{ref:[n,S],state:{direction:i,visible:I,side:x,transitionStatus:E},props:[{"aria-hidden":!0,children:u?"▲":"▼",style:{position:"absolute"},onMouseMove(D){if(D.movementX===0&&D.movementY===0||w.isStarted())return;f.set("activeIndex",null);function H(){const _=f.state.listElement??h.current;if(!_)return;f.set("activeIndex",null),g(_);const P=el(_.scrollHeight,_.clientHeight),L=Lo(_.scrollTop,P),N=L===(u?0:P),M=A.current;if(L!==_.scrollTop&&(_.scrollTop=L),N){w.clear();return}if(M.length>0){const O=S.current?.offsetHeight||0;_.scrollTop=EC(M,u,L,_.clientHeight,O,P)}w.start(40,H)}w.start(40,H)},onMouseLeave(){w.clear()}},c],stateAttributesMapping:On});return R||a?F:null});function EC(e,t,n,r,o,s){if(t){let f=0;const h=n+o-_t;for(let p=0;p<e.length;p+=1){const x=e[p];if(x&&x.offsetTop>=h){f=p;break}}const A=Math.max(0,f-1),g=e[A];return A<f&&g?Lo(g.offsetTop-o,s):0}let i=e.length-1;const a=n+r-o+_t;for(let f=0;f<e.length;f+=1){const h=e[f];if(h&&h.offsetTop+h.offsetHeight>a){i=Math.max(0,f-1);break}}const c=Math.min(e.length-1,i+1),u=e[c];return c>i&&u?Lo(u.offsetTop+u.offsetHeight-r+o,s):s}const SC=d.forwardRef(function(t,n){return l.jsx(Ap,{...t,ref:n,direction:"down"})}),RC=d.forwardRef(function(t,n){return l.jsx(Ap,{...t,ref:n,direction:"up"})}),DC=oC;function FC({className:e,...t}){return l.jsx(uC,{"data-slot":"select-value",className:he("flex flex-1 text-left",e),...t})}function BC({className:e,size:t="default",children:n,...r}){return l.jsxs(lC,{"data-slot":"select-trigger","data-size":t,className:he("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,l.jsx(dC,{render:l.jsx(_n,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function jC({className:e,children:t,side:n="bottom",sideOffset:r=4,align:o="center",alignOffset:s=0,alignItemWithTrigger:i=!0,...a}){return l.jsx(fC,{children:l.jsx(hC,{side:n,sideOffset:r,align:o,alignOffset:s,alignItemWithTrigger:i,className:"isolate z-50",children:l.jsxs(bC,{"data-slot":"select-content","data-align-trigger":i,className:he("cn-menu-target cn-menu-translucent relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...a,children:[l.jsx(MC,{}),l.jsx(yC,{children:t}),l.jsx(PC,{})]})})})}function qs({className:e,children:t,...n}){return l.jsxs(CC,{"data-slot":"select-item",className:he("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[l.jsx(kC,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:t}),l.jsx(IC,{render:l.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:l.jsx(Ui,{className:"pointer-events-none"})})]})}function MC({className:e,...t}){return l.jsx(RC,{"data-slot":"select-scroll-up-button",className:he("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:l.jsx(Vi,{})})}function PC({className:e,...t}){return l.jsx(SC,{"data-slot":"select-scroll-down-button",className:he("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:l.jsx(_n,{})})}const mp=d.createContext(void 0);function TC(){const e=d.useContext(mp);if(e===void 0)throw new Error(st(63));return e}const xp={...Wi,checked(e){return e?{"data-checked":""}:{"data-unchecked":""}}},NC=d.forwardRef(function(t,n){const{checked:r,className:o,defaultChecked:s,"aria-labelledby":i,form:a,id:c,inputRef:u,name:f,nativeButton:h=!1,onCheckedChange:A,readOnly:g=!1,required:p=!1,disabled:x=!1,render:m,uncheckedValue:v,value:b,style:y,...C}=t,{clearErrors:I}=Qi(),{state:w,setTouched:S,setDirty:R,validityData:E,setFilled:k,setFocused:B,validationMode:T,disabled:F,name:j,validation:D}=Uo(),{labelId:H}=Gi(),_=F||x,P=j??f,L=d.useRef(null),N=zt(L,u,D.inputRef),M=d.useRef(null),O=wt(),G=Yi({id:c,implicit:!1,controlRef:M}),Z=h?void 0:G,[J,Q]=sn({controlled:r,default:!!s,name:"Switch",state:"checked"});zi(M,O,J,void 0,!_,f),ae(()=>{L.current&&k(L.current.checked)},[k]),cs(J,()=>{I(P),R(J!==E.initialValue),k(J),D.change(J)});const{getButtonProps:$,buttonRef:K}=Yt({disabled:_,native:h}),te=Mu(i,H,L,!h,Z),le={id:h?G:O,role:"switch","aria-checked":J,"aria-readonly":g||void 0,"aria-required":p||void 0,"aria-labelledby":te,onFocus(){_||B(!0)},onBlur(){const ue=L.current;!ue||_||(S(!0),B(!1),T==="onBlur"&&D.commit(ue.checked))},onClick(ue){if(g||_)return;ue.preventDefault();const se=L.current;se&&Li(se,ue)}},X={...D.getValidationProps(_),checked:J,disabled:_,form:a,id:Z,name:P,required:p,style:P?da:ts,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:N,onChange(ue){if(ue.nativeEvent.defaultPrevented)return;if(g){ue.preventDefault();return}const se=ue.currentTarget.checked,be=Ce(jt,ue.nativeEvent);A?.(se,be),!be.isCanceled&&Q(se)},onClick(ue){ue.stopPropagation()},onFocus(){M.current?.focus()},...b!==void 0?{value:b}:ct},ee=d.useMemo(()=>({...w,checked:J,disabled:_,readOnly:g,required:p}),[w,J,_,g,p]),U=Me("span",t,{state:ee,ref:[n,M,K],props:[le,C,$,ue=>D.getValidationProps(_,ue)],stateAttributesMapping:xp});return l.jsxs(mp.Provider,{value:ee,children:[U,!J&&P&&v!==void 0&&l.jsx("input",{type:"hidden",form:a,name:P,value:v,disabled:_}),l.jsx("input",{...X,suppressHydrationWarning:!0})]})}),_C=d.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,a=TC();return Me("span",t,{state:a,ref:n,stateAttributesMapping:xp,props:i})});function dr({className:e,size:t="default",...n}){return l.jsx(NC,{"data-slot":"switch","data-size":t,className:he("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...n,children:l.jsx(_C,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}function OC({frozen:e,values:t,defaults:n,candidates:r,candidatesPort:o,candidatesGeneration:s,selectedIconRef:i,uploadedIconUrl:a,iconAnalysis:c,iconComposition:u,iconComposeError:f,iconBackground:h,iconScale:A,subjectExtracting:g,subjectStage:p,subjectSettings:x,onSubjectSettingsChange:m,onIconBackgroundChange:v,onIconScaleChange:b,selectedTrayRef:y,uploadedTrayUrl:C,selectedPort:I,targetDirExists:w,onPickIconCandidate:S,onUploadIcon:R,onClearIcon:E,onPickTray:k,onUploadTray:B,onClearTray:T,onPatch:F,onConfirm:j}){return l.jsxs("section",{className:"rounded-xl border border-border bg-card p-4",children:[l.jsx(J1,{values:t,defaults:n,frozen:e,iconCandidates:r,iconCandidatesPort:o,iconCandidatesGeneration:s,uploadedIconUrl:a,selectedIconRef:i,iconAnalysis:c,iconComposition:u,iconComposeError:f,iconBackground:h,iconScale:A,subjectExtracting:g,...p===void 0?{}:{subjectStage:p},subjectSettings:x,onSubjectSettingsChange:m,onIconBackgroundChange:v,onIconScaleChange:b,onPickIconCandidate:S,onUploadIcon:R,onClearIcon:E,onPatch:F}),l.jsx(La,{className:"mt-4 border-t border-border pt-1",children:l.jsxs(Ka,{value:"advanced",className:"border-b-0",children:[l.jsx(Wa,{children:"高级选项"}),l.jsxs(Qa,{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[l.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border p-3",children:[l.jsx(dr,{id:"showStartupTerminal",checked:t.showStartupTerminal,disabled:e,onCheckedChange:D=>F({showStartupTerminal:D})}),l.jsxs("div",{children:[l.jsx(Pe,{htmlFor:"showStartupTerminal",className:"text-foreground",children:"显示启动终端"}),l.jsxs("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:[l.jsx(Rr,{className:"mr-0.5 inline size-3"}),"应用启动时打开独立终端窗口,实时显示命令的 PTY 输出(可交互)。"]})]})]}),l.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border p-3",children:[l.jsx(dr,{id:"showAddressBar",checked:t.showAddressBar,disabled:e,onCheckedChange:D=>F({showAddressBar:D})}),l.jsxs("div",{children:[l.jsx(Pe,{htmlFor:"showAddressBar",className:"text-foreground",children:"显示地址栏"}),l.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:"服务窗口顶部显示地址栏(Web Navigation API 管理导航)。"})]})]}),l.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border p-3",children:[l.jsx(dr,{id:"imageSmoothingEnabled",checked:t.imageSmoothingEnabled,disabled:e,onCheckedChange:D=>F({imageSmoothingEnabled:D})}),l.jsxs("div",{children:[l.jsx(Pe,{htmlFor:"imageSmoothingEnabled",className:"text-foreground",children:"平滑缩放(imageSmoothingEnabled)"}),l.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:"默认开启高质量缩放;上传低分辨率像素风图标时关闭可保留硬边锯齿(等比放大应用到应用图标前景与托盘图标)。"})]})]}),l.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border p-3",children:[l.jsx(dr,{id:"developerMode",checked:t.developerMode,disabled:e,onCheckedChange:D=>F({developerMode:D})}),l.jsxs("div",{children:[l.jsx(Pe,{htmlFor:"developerMode",className:"text-foreground",children:"允许开发者模式"}),l.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:"仅表示生成应用内的 WebView DevTools 准入;不改变其它行为。"})]})]})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"托盘图标"}),l.jsx("p",{className:"mb-1.5 mt-0.5 text-[11px] text-muted-foreground",children:"默认与应用图标一致;纯色候选适合系统托盘(macOS 模板风格)。"}),l.jsx($1,{candidates:r,port:o,generation:s,disabled:e,selectedRef:y,uploadedUrl:C,includeVariants:!0,defaultLabel:"默认跟随应用图标",onPick:k,onUpload:B,onClear:T})]}),l.jsxs("div",{children:[l.jsx(Pe,{htmlFor:"pm",children:"包管理器"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] leading-relaxed text-muted-foreground",children:"仅为生成的应用安装依赖时使用的工具(决定 install 命令与锁文件形态),不影响应用本身的运行方式——生成的应用始终以 Node 启动。默认自动跟随你启动向导所用的包管理器,一般无需修改。"}),l.jsxs(DC,{value:t.pm,disabled:e,onValueChange:D=>F({pm:D}),children:[l.jsx(BC,{id:"pm",className:"mt-0",children:l.jsx(FC,{})}),l.jsxs(jC,{children:[l.jsx(qs,{value:"npm",children:"npm"}),l.jsx(qs,{value:"pnpm",children:"pnpm"}),l.jsx(qs,{value:"bun",children:"bun"})]})]})]}),l.jsxs("div",{className:"rounded-lg border border-border p-3",children:[l.jsx(Pe,{children:"生成位置"}),l.jsx("p",{className:"mt-1 font-mono text-[11px] break-all text-muted-foreground",children:n.targetDir||"~/.opentray/create/<应用名>"}),l.jsx("p",{className:"mt-1.5 text-[11px] leading-relaxed text-muted-foreground",children:"生成的项目默认落在 OpenTray 主目录下,同一命令重复创建会落到同一位置; 也可在启动向导时通过位置参数指定其他目录。"}),w?l.jsx("p",{className:"mt-2 text-[11px] font-medium text-amber-400",children:"目标目录已存在且非空——继续生成会失败,或开启下方强制覆盖。"}):null,l.jsxs("div",{className:"mt-3 flex items-start gap-3",children:[l.jsx(dr,{id:"force-overwrite",checked:t.force,disabled:e,onCheckedChange:D=>F({force:D})}),l.jsxs("div",{children:[l.jsx(Pe,{htmlFor:"force-overwrite",className:"text-foreground",children:"强制覆盖已存在的目录"}),l.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:"开启后将清空目标目录内的现有内容并重新生成(等同 --force)。请确认目录中没有你需要的文件。"})]})]})]})]})]})}),l.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[l.jsx(Oe,{onClick:j,disabled:e,children:"确定创建应用"}),l.jsx("span",{className:"text-xs text-muted-foreground",children:I!==void 0?`已选服务 :${I}(点击状态栏服务可切换)`:"未运行也不影响:应用启动时会自行嗅探命令的监听端口"})]})]})}var mo={},ei,lu;function HC(){if(lu)return ei;lu=1;var e=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],t=/[\n\r\u2028\u2029]/,n=/[\s#!"$&'():;<=>@\\^`|]/g;return ei=function(o){return o.map(function(s){if(s==="")return"''";if(s&&typeof s=="object"){if("op"in s&&s.op==="glob"){if(typeof s.pattern!="string")throw new TypeError("glob token requires a string `pattern`");if(t.test(s.pattern))throw new TypeError("glob `pattern` must not contain line terminators");return s.pattern.replace(n,"\\$&")}if("op"in s&&typeof s.op=="string"){if(e.indexOf(s.op)<0)throw new TypeError("invalid `op` value: "+JSON.stringify(s.op));return s.op.replace(/[\s\S]/g,"\\$&")}if("comment"in s&&typeof s.comment=="string"){if(t.test(s.comment))throw new TypeError("`comment` must not contain line terminators");return"#"+s.comment}throw new TypeError("unrecognized object token shape")}return/["\s\\]/.test(s)&&!/'/.test(s)?"'"+s.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(s)?'"'+s.replace(/(["\\$`!])/g,"\\$1")+'"':String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")},ei}var ti,cu;function LC(){if(cu)return ti;cu=1;for(var e="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",t=new RegExp("^"+e+"$"),n="|&;()<> \\t",r="'([^']*?)'",o='"((\\\\"|[^"])*?)"',s=/^#$/,i="'",a='"',c="$",u="",f=4294967296,h=0;h<4;h++)u+=(f*Math.random()).toString(16);var A=new RegExp("^"+u);function g(m,v){for(var b=v.lastIndex,y=[],C;C=v.exec(m);)y[y.length]=C,v.lastIndex===C.index&&(v.lastIndex+=1);return v.lastIndex=b,y}function p(m,v,b){var y=typeof m=="function"?m(b):m[b];return typeof y>"u"&&b!=""?y="":typeof y>"u"&&(y="$"),typeof y=="object"?v+u+JSON.stringify(y)+u:v+y}function x(m,v,b){b||(b={});var y=b.escape||"\\",C=b.splitUnquoted===!0?`
|
|
21
|
+
`:typeof b.splitUnquoted=="string"?b.splitUnquoted:"",I="(\\"+y+`['"`+n+`]|[^\\s'"`+n+"])+",w=new RegExp(["("+e+")","("+I+"|"+o+"|"+r+")+"].join("|"),"g"),S=g(m,w);if(S.length===0)return[];v||(v={});var R=!1;return S.map(function(E){var k=E[0];if(!k||R)return;if(t.test(k))return{op:k};var B=!1,T=!1,F="",j=[],D=!1,H=null,_=!1,P;function L(){P+=1;var $,K,te=k.charAt(P);if(te==="{"){if(P+=1,k.charAt(P)==="}")throw new Error("Bad substitution: "+k.slice(P-2,P+1));var le=1;for($=P;le>0&&$<k.length;)k.charAt($)==="{"&&k.charAt($-1)==="$"?le+=1:k.charAt($)==="}"&&(le-=1),$+=1;if(le!==0)throw new Error("Bad substitution: "+k.slice(P));$-=1,K=k.slice(P,$),P=$}else if(/[*@#?$!_-]/.test(te))K=te,P+=1;else{var X=k.slice(P);$=X.match(/[^\w\d_]/),$?(K=X.slice(0,$.index),P+=$.index-1):(K=X,P=k.length)}return p(v,"",K)}function N(){if(H!==null){if(H===0)F!==""&&(j[j.length]=F,F="");else{j[j.length]=F,F="";for(var $=1;$<H;$+=1)j[j.length]=""}H=null}}for(P=0;P<k.length;P++){var M=k.charAt(P);if(C&&M!==c&&N(),_=_||!B&&(M==="*"||M==="?"),T)F+=M,T=!1;else if(B)M===B?B=!1:B==i?F+=M:M===y?(P+=1,M=k.charAt(P),M===a||M===y||M===c?F+=M:F+=y+M):M===c?F+=L():F+=M;else if(M===a||M===i)B=M,D=!0;else{if(t.test(M))return{op:k};if(s.test(M)){R=!0;var O={comment:m.slice(E.index+P+1)};return F.length?[F,O]:[O]}else if(M===y)T=!0;else if(M===c){var G=L();if(!C)F+=G;else for(var Z=0;Z<G.length;Z+=1){var J=G.charAt(Z);C.indexOf(J)<0?(N(),F+=J):H===null?H=J===" "||J===" "||J===`
|
|
22
|
+
`?0:1:J!==" "&&J!==" "&&J!==`
|
|
23
|
+
`&&(H+=1)}}else F+=M}}if(_)return{op:"glob",pattern:F};if(C){if(H!==null&&H>0){j[j.length]=F,F="";for(var Q=1;Q<H;Q+=1)j[j.length]=""}return(F!==""||D&&j.length===0)&&(j[j.length]=F),j}return F}).reduce(function(E,k){return typeof k>"u"||[].concat(k).forEach(function(B){E[E.length]=B}),E},[])}return ti=function(v,b,y){var C=x(v,b,y);return typeof b!="function"?C:C.reduce(function(I,w){if(typeof w=="object")return I[I.length]=w,I;var S=w.split(RegExp("("+u+".*?"+u+")","g"));return S.length===1?(I[I.length]=S[0],I):(S.filter(Boolean).forEach(function(R){I[I.length]=A.test(R)?JSON.parse(R.split(u)[1]):R}),I)},[])},ti}var uu;function KC(){return uu||(uu=1,mo.quote=HC(),mo.parse=LC()),mo}var WC=KC();const bp=["npm","go","rust","python","dotnet","custom"],hn={npm:"npm",go:"Go",rust:"Rust",python:"Python",dotnet:".NET",custom:"自定义"},QC={npm:"npmjs",go:"golang",rust:"rust",python:"python",dotnet:"dotnet"},vp=["npx","pnpx","bunx","yarn dlx","nubx","deno run","vpx"],GC=["uvx","pipx run"],yp={family:"npm",runner:"npx",runnerFlags:"",pkg:"",version:"",args:"",binary:"",raw:""},rl=e=>{if(/["']/.test(e)){const r=(e.match(/'/gu)??[]).length,o=(e.match(/"/gu)??[]).length;if(r%2===1||o%2===1)return[]}const t=WC.parse(e),n=[];for(const r of t){if(typeof r!="string")return[];n.push(r)}return n.length===0?[]:n},ol=e=>e.startsWith("-")&&e.length>1,Fn=e=>{const t=e.lastIndexOf("@");return t>0?{base:e.slice(0,t),version:e.slice(t+1)}:{base:e,version:""}},zn=e=>e.map(t=>t.trim()).filter(t=>t.length>0).join(" "),fr=(e,t)=>{if(t.trim().length===0)return e;const{version:n}=Fn(e);return n.length>0?e:`${e}@${t.trim()}`},zC=e=>/^(npm|jsr):/.test(e)?e:`npm:${e}`,YC=/^[A-Za-z0-9@._/:+=-]+$/u,UC=e=>YC.test(e)&&e.length>0?e:`'${e.replaceAll("'","'\\''")}'`,Rn=e=>e.map(UC).join(" "),pr=e=>{const t=[];let n=0;for(;n<e.length&&ol(e[n]??"");)t.push(e[n]??""),n+=1;return{flags:t,rest:e.slice(n)}},VC=[new Set(["-A","--allow-all","--allow-read","--allow-write","--allow-net","--allow-env","--allow-run","--allow-sys","--allow-ffi","--allow-hrtime","--no-check","--no-remote","--quiet","-q","--cached-only"]),new Set(["-y","--yes"])],ZC=e=>e.includes("=")?!1:VC.some(t=>t.has(e)),hr=e=>e.every(t=>ZC(t)),JC=(e,t)=>{const n=t.split(" ");if(e.length<n.length)return-1;for(let r=0;r<n.length;r+=1)if((e[r]??"")!==(n[r]??""))return-1;return n.length},gn=e=>({...yp,...e}),gr=e=>gn({family:"custom",raw:Rn(e)}),$C=e=>{const t=e[0]??"",n=e[1]??"";for(const r of vp){const o=JC(e,r);if(o>0){const{flags:s,rest:i}=pr(e.slice(o));if(!hr(s))return gr(e);const a=i[0]??"",{base:c,version:u}=a.length>0?Fn(a):{base:"",version:""};return gn({family:"npm",runner:r,runnerFlags:s.join(" "),pkg:c,version:u,args:Rn(i.slice(1)),raw:e.join(" ")})}}if(t==="go"&&n==="run"){const{flags:r,rest:o}=pr(e.slice(2));if(!hr(r))return gr(e);const s=o[0]??"",{base:i,version:a}=s.length>0?Fn(s):{base:"",version:""};return gn({family:"go",runner:"",runnerFlags:r.join(" "),pkg:i,version:a,args:Rn(o.slice(1)),raw:e.join(" ")})}if(t==="cargo"&&n==="install"){const{flags:r,rest:o}=pr(e.slice(2));if(!hr(r))return gr(e);const s=o[0]??"",i=s.length>0?Fn(s).base:"";return gn({family:"rust",runner:"",runnerFlags:r.join(" "),pkg:i,args:Rn(o.slice(1)),raw:e.join(" ")})}if(t==="uvx"||t==="pipx"&&n==="run"){const r=t==="uvx"?1:2,{flags:o,rest:s}=pr(e.slice(r));if(!hr(o))return gr(e);const i=s[0]??"",{base:a,version:c}=i.length>0?Fn(i):{base:"",version:""};return gn({family:"python",runner:t==="uvx"?"uvx":"pipx run",runnerFlags:o.join(" "),pkg:a,version:c,args:Rn(s.slice(1)),raw:e.join(" ")})}if(t==="dnx"){const{flags:r,rest:o}=pr(e.slice(1));if(!hr(r))return gr(e);const s=o[0]??"",{base:i,version:a}=s.length>0?Fn(s):{base:"",version:""};return gn({family:"dotnet",runner:"",runnerFlags:r.join(" "),pkg:i,version:a,args:Rn(o.slice(1)),raw:e.join(" ")})}return gn({family:"custom",raw:Rn(e)})},XC=e=>{const t=rl(e);return t.length===0?gn({family:"custom",raw:e}):$C(t)},Cp=e=>{const t=e.pkg.trim(),n=e.binary.trim().length>0?e.binary.trim():t;return{install:zn(["cargo","install",e.runnerFlags,t]),run:zn([n,e.args])}},Mi=e=>{switch(e.family){case"custom":return e.raw.trim();case"rust":return Cp(e).run;case"npm":{const t=e.runner==="deno run"?zC(fr(e.pkg.trim(),e.version)):fr(e.pkg.trim(),e.version);return zn([e.runner,e.runnerFlags,t,e.args])}case"go":return zn(["go","run",e.runnerFlags,fr(e.pkg.trim(),e.version),e.args]);case"python":return zn([e.runner,e.runnerFlags,fr(e.pkg.trim(),e.version),e.args]);case"dotnet":return zn(["dnx",e.runnerFlags,fr(e.pkg.trim(),e.version),e.args])}},Ar=(e,t)=>{const n=e.trim().replace(/^(npm|jsr):/,""),r=n.split(/[/\\]/).filter(i=>i.length>0&&!i.startsWith("@")),o=r[r.length-1]??n;let s=Fn(o).base.toLowerCase();return t==="python"&&(s=s.replace(/[._]/g,"-")),s.replace(/[^a-z0-9-]/g,"")},mr=e=>{const t=[];for(const n of rl(e)){if(ol(n))break;const r=n.toLowerCase().replace(/[^a-z0-9-]/g,"");if(r.length===0)break;t.push(r)}return t},qC=e=>{if(e.family==="custom"){const i=[];for(const u of rl(e.raw)){if(ol(u))break;i.push(u)}const a=i.map(u=>{const f=u.split(/[/\\]/).filter(h=>h.length>0);if(f.some(h=>h.startsWith("@"))){const h=f.filter(A=>!A.startsWith("@"));return(h[h.length-1]??"").split("@")[0]??""}return(f[f.length-1]??u).split("@")[0]??""}).filter(u=>u.length>0).reverse(),c=a.length>0?a.join("."):"app.opentray";return{appId:c,appName:c==="app.opentray"?"Opentray App":c.split(".").filter(u=>u.length>0).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join(" "),identitySegments:a,tail:""}}const t=QC[e.family];let n;switch(e.family){case"npm":n=[...mr(e.args),Ar(e.pkg,"npm")];break;case"go":n=[...mr(e.args),Ar(e.pkg,"go")];break;case"rust":{const i=Ar(e.pkg,"rust"),a=e.binary.trim().length>0?e.binary.trim().toLowerCase().replace(/[^a-z0-9-]/g,""):i;n=[...mr(e.args),a];break}case"python":n=[...mr(e.args),Ar(e.pkg,"python")];break;case"dotnet":n=[...mr(e.args),Ar(e.pkg,"dotnet")];break}const r=n.filter(i=>i.length>0),o=r.length>0?`${r.join(".")}.${t}`:"app.opentray",s=r.length>0?r.map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "):"Opentray App";return{appId:o,appName:s,identitySegments:r,tail:t}},eI=e=>{const t=e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return t.length>0?t:"opentray-app"},tI=(e,t)=>{let n;for(const r of e)r.key.trim()===t&&(n=r.value);return n},nI=e=>e.family==="npm"&&(e.runner==="npx"||e.runner==="pnpx")?[{key:"npm_config_yes",value:"true",note:"跳过 npm 安装确认(等效 -y),首次运行无需交互"}]:[],rI='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>.NET</title><path d="M24 8.77h-2.468v7.565h-1.425V8.77h-2.462V7.53H24zm-6.852 7.565h-4.821V7.53h4.63v1.24h-3.205v2.494h2.953v1.234h-2.953v2.604h3.396zm-6.708 0H8.882L4.78 9.863a2.896 2.896 0 0 1-.258-.51h-.036c.032.189.048.592.048 1.21v5.772H3.157V7.53h1.659l3.965 6.32c.167.261.275.442.323.54h.024c-.04-.233-.06-.629-.06-1.185V7.529h1.372zm-8.703-.693a.868.829 0 0 1-.869.829.868.829 0 0 1-.868-.83.868.829 0 0 1 .868-.828.868.829 0 0 1 .869.829Z"/></svg>',oI='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Go</title><path d="M1.811 10.231c-.047 0-.058-.023-.035-.059l.246-.315c.023-.035.081-.058.128-.058h4.172c.046 0 .058.035.035.07l-.199.303c-.023.036-.082.07-.117.07zM.047 11.306c-.047 0-.059-.023-.035-.058l.245-.316c.023-.035.082-.058.129-.058h5.328c.047 0 .07.035.058.07l-.093.28c-.012.047-.058.07-.105.07zm2.828 1.075c-.047 0-.059-.035-.035-.07l.163-.292c.023-.035.07-.07.117-.07h2.337c.047 0 .07.035.07.082l-.023.28c0 .047-.047.082-.082.082zm12.129-2.36c-.736.187-1.239.327-1.963.514-.176.046-.187.058-.34-.117-.174-.199-.303-.327-.548-.444-.737-.362-1.45-.257-2.115.175-.795.514-1.204 1.274-1.192 2.22.011.935.654 1.706 1.577 1.835.795.105 1.46-.175 1.987-.77.105-.13.198-.27.315-.434H10.47c-.245 0-.304-.152-.222-.35.152-.362.432-.97.596-1.274a.315.315 0 01.292-.187h4.253c-.023.316-.023.631-.07.947a4.983 4.983 0 01-.958 2.29c-.841 1.11-1.94 1.8-3.33 1.986-1.145.152-2.209-.07-3.143-.77-.865-.655-1.356-1.52-1.484-2.595-.152-1.274.222-2.419.993-3.424.83-1.086 1.928-1.776 3.272-2.02 1.098-.2 2.15-.07 3.096.571.62.41 1.063.97 1.356 1.648.07.105.023.164-.117.2m3.868 6.461c-1.064-.024-2.034-.328-2.852-1.029a3.665 3.665 0 01-1.262-2.255c-.21-1.32.152-2.489.947-3.529.853-1.122 1.881-1.706 3.272-1.95 1.192-.21 2.314-.095 3.33.595.923.63 1.496 1.484 1.648 2.605.198 1.578-.257 2.863-1.344 3.962-.771.783-1.718 1.273-2.805 1.495-.315.06-.63.07-.934.106zm2.78-4.72c-.011-.153-.011-.27-.034-.387-.21-1.157-1.274-1.81-2.384-1.554-1.087.245-1.788.935-2.045 2.033-.21.912.234 1.835 1.075 2.21.643.28 1.285.244 1.905-.07.923-.48 1.425-1.228 1.484-2.233z"/></svg>',sI='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>npm</title><path d="M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z"/></svg>',iI='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Python</title><path d="M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02 1.27.05zm-6.3 1.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09 3.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14 1.04.05 1.23-.06 1.23-.16 1.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01 2.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01zm-6.47 14.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z"/></svg>',aI='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Rust</title><path d="M23.8346 11.7033l-1.0073-.6236a13.7268 13.7268 0 00-.0283-.2936l.8656-.8069a.3483.3483 0 00-.1154-.578l-1.1066-.414a8.4958 8.4958 0 00-.087-.2856l.6904-.9587a.3462.3462 0 00-.2257-.5446l-1.1663-.1894a9.3574 9.3574 0 00-.1407-.2622l.49-1.0761a.3437.3437 0 00-.0274-.3361.3486.3486 0 00-.3006-.154l-1.1845.0416a6.7444 6.7444 0 00-.1873-.2268l.2723-1.153a.3472.3472 0 00-.417-.4172l-1.1532.2724a14.0183 14.0183 0 00-.2278-.1873l.0415-1.1845a.3442.3442 0 00-.49-.328l-1.076.491c-.0872-.0476-.1742-.0952-.2623-.1407l-.1903-1.1673A.3483.3483 0 0016.256.955l-.9597.6905a8.4867 8.4867 0 00-.2855-.086l-.414-1.1066a.3483.3483 0 00-.5781-.1154l-.8069.8666a9.2936 9.2936 0 00-.2936-.0284L12.2946.1683a.3462.3462 0 00-.5892 0l-.6236 1.0073a13.7383 13.7383 0 00-.2936.0284L9.9803.3374a.3462.3462 0 00-.578.1154l-.4141 1.1065c-.0962.0274-.1903.0567-.2855.086L7.744.955a.3483.3483 0 00-.5447.2258L7.009 2.348a9.3574 9.3574 0 00-.2622.1407l-1.0762-.491a.3462.3462 0 00-.49.328l.0416 1.1845a7.9826 7.9826 0 00-.2278.1873L3.8413 3.425a.3472.3472 0 00-.4171.4171l.2713 1.1531c-.0628.075-.1255.1509-.1863.2268l-1.1845-.0415a.3462.3462 0 00-.328.49l.491 1.0761a9.167 9.167 0 00-.1407.2622l-1.1662.1894a.3483.3483 0 00-.2258.5446l.6904.9587a13.303 13.303 0 00-.087.2855l-1.1065.414a.3483.3483 0 00-.1155.5781l.8656.807a9.2936 9.2936 0 00-.0283.2935l-1.0073.6236a.3442.3442 0 000 .5892l1.0073.6236c.008.0982.0182.1964.0283.2936l-.8656.8079a.3462.3462 0 00.1155.578l1.1065.4141c.0273.0962.0567.1914.087.2855l-.6904.9587a.3452.3452 0 00.2268.5447l1.1662.1893c.0456.088.0922.1751.1408.2622l-.491 1.0762a.3462.3462 0 00.328.49l1.1834-.0415c.0618.0769.1235.1528.1873.2277l-.2713 1.1541a.3462.3462 0 00.4171.4161l1.153-.2713c.075.0638.151.1255.2279.1863l-.0415 1.1845a.3442.3442 0 00.49.327l1.0761-.49c.087.0486.1741.0951.2622.1407l.1903 1.1662a.3483.3483 0 00.5447.2268l.9587-.6904a9.299 9.299 0 00.2855.087l.414 1.1066a.3452.3452 0 00.5781.1154l.8079-.8656c.0972.0111.1954.0203.2936.0294l.6236 1.0073a.3472.3472 0 00.5892 0l.6236-1.0073c.0982-.0091.1964-.0183.2936-.0294l.8069.8656a.3483.3483 0 00.578-.1154l.4141-1.1066a8.4626 8.4626 0 00.2855-.087l.9587.6904a.3452.3452 0 00.5447-.2268l.1903-1.1662c.088-.0456.1751-.0931.2622-.1407l1.0762.49a.3472.3472 0 00.49-.327l-.0415-1.1845a6.7267 6.7267 0 00.2267-.1863l1.1531.2713a.3472.3472 0 00.4171-.416l-.2713-1.1542c.0628-.0749.1255-.1508.1863-.2278l1.1845.0415a.3442.3442 0 00.328-.49l-.49-1.076c.0475-.0872.0951-.1742.1407-.2623l1.1662-.1893a.3483.3483 0 00.2258-.5447l-.6904-.9587.087-.2855 1.1066-.414a.3462.3462 0 00.1154-.5781l-.8656-.8079c.0101-.0972.0202-.1954.0283-.2936l1.0073-.6236a.3442.3442 0 000-.5892zm-6.7413 8.3551a.7138.7138 0 01.2986-1.396.714.714 0 11-.2997 1.396zm-.3422-2.3142a.649.649 0 00-.7715.5l-.3573 1.6685c-1.1035.501-2.3285.7795-3.6193.7795a8.7368 8.7368 0 01-3.6951-.814l-.3574-1.6684a.648.648 0 00-.7714-.499l-1.473.3158a8.7216 8.7216 0 01-.7613-.898h7.1676c.081 0 .1356-.0141.1356-.088v-2.536c0-.074-.0536-.0881-.1356-.0881h-2.0966v-1.6077h2.2677c.2065 0 1.1065.0587 1.394 1.2088.0901.3533.2875 1.5044.4232 1.8729.1346.413.6833 1.2381 1.2685 1.2381h3.5716a.7492.7492 0 00.1296-.0131 8.7874 8.7874 0 01-.8119.9526zM6.8369 20.024a.714.714 0 11-.2997-1.396.714.714 0 01.2997 1.396zM4.1177 8.9972a.7137.7137 0 11-1.304.5791.7137.7137 0 011.304-.579zm-.8352 1.9813l1.5347-.6824a.65.65 0 00.33-.8585l-.3158-.7147h1.2432v5.6025H3.5669a8.7753 8.7753 0 01-.2834-3.348zm6.7343-.5437V8.7836h2.9601c.153 0 1.0792.1772 1.0792.8697 0 .575-.7107.7815-1.2948.7815zm10.7574 1.4862c0 .2187-.008.4363-.0243.651h-.9c-.09 0-.1265.0586-.1265.1477v.413c0 .973-.5487 1.1846-1.0296 1.2382-.4576.0517-.9648-.1913-1.0275-.4717-.2704-1.5186-.7198-1.8436-1.4305-2.4034.8817-.5599 1.799-1.386 1.799-2.4915 0-1.1936-.819-1.9458-1.3769-2.3153-.7825-.5163-1.6491-.6195-1.883-.6195H5.4682a8.7651 8.7651 0 014.907-2.7699l1.0974 1.151a.648.648 0 00.9182.0213l1.227-1.1743a8.7753 8.7753 0 016.0044 4.2762l-.8403 1.8982a.652.652 0 00.33.8585l1.6178.7188c.0283.2875.0425.577.0425.8717zm-9.3006-9.5993a.7128.7128 0 11.984 1.0316.7137.7137 0 01-.984-1.0316zm8.3389 6.71a.7107.7107 0 01.9395-.3625.7137.7137 0 11-.9405.3635z"/></svg>',xr=e=>{const t=e.replace(/<title>[\s\S]*?<\/title>/g,"");return({className:r})=>l.jsx("span",{"aria-hidden":"true",className:he("inline-flex size-4 shrink-0 [&_svg]:size-full [&_svg]:fill-current",r),dangerouslySetInnerHTML:{__html:t}})},Wo={npm:xr(sI),go:xr(oI),rust:xr(aI),python:xr(iI),dotnet:xr(rI),custom:Fu},lI=bp.filter(e=>e!=="custom"),du=(e,t,n)=>l.jsx(Ga,{variant:"outline",size:"sm",className:"flex max-w-full flex-wrap",value:[t],onValueChange:r=>{const o=r[0];o!==void 0&&e.includes(o)&&n(o)},children:e.map(r=>l.jsx(jr,{value:r,className:"px-2.5 text-xs",children:r},r))});function cI({open:e,draft:t,envPreset:n,onEnvPresetChange:r,onDraftChange:o,onFamilyChange:s,onCancel:i,onApply:a}){const c=p=>{p||i()},u=p=>o({...t,...p}),f=qC(t),h=Mi(t),A=t.family==="rust"?Cp(t):null,g=Wo[t.family];return l.jsx(za,{open:e,onOpenChange:c,children:l.jsxs(Ya,{className:"max-h-[85vh] overflow-y-auto sm:max-w-md",children:[l.jsxs(Qn,{children:[l.jsxs(Gn,{className:"flex items-center gap-2",children:[l.jsxs(Mo,{children:[l.jsxs(Po,{className:"flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring","aria-label":"切换命令系列",title:"切换命令系列",children:[l.jsx(g,{className:"size-4"}),l.jsx(_n,{className:"size-3"})]}),l.jsx(To,{align:"start",className:"w-36",children:lI.map(p=>{const x=Wo[p];return l.jsxs(No,{onClick:()=>s(p),className:p===t.family?"bg-accent/60":void 0,children:[l.jsx(x,{className:"text-muted-foreground"}),hn[p]]},p)})})]}),"配置 ",hn[t.family]," 系列命令"]}),l.jsx(Ua,{children:"修改字段实时预览命令与默认应用标识;确定后写回命令行。"})]}),l.jsxs("div",{className:"space-y-4",children:[t.family==="npm"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx(Pe,{children:"Runner"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"同一包换 runner 推导结果不变;deno run 自动补 npm: 前缀。"}),du(vp,t.runner,p=>u({runner:p}))]}),t.runnerFlags.length>0||t.runner==="deno run"?l.jsxs("div",{children:[l.jsx(Pe,{children:"Runner 参数"}),l.jsx(Xe,{className:"mt-1.5 font-mono text-xs",placeholder:"-A",value:t.runnerFlags,onChange:p=>u({runnerFlags:p.target.value})})]}):null,l.jsxs("div",{className:"grid grid-cols-[1fr_110px] gap-3",children:[l.jsxs("div",{children:[l.jsx(Pe,{children:"包名"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"支持 @scope/name 与 npm: 前缀。"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"@deepseek-ai/dsh",value:t.pkg,onChange:p=>u({pkg:p.target.value})})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"版本"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"留空 = latest。"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"latest",value:t.version,onChange:p=>u({version:p.target.value})})]})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"运行参数"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"追加在包名之后;子命令参与 appId 推导。"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"web --port 3000",value:t.args,onChange:p=>u({args:p.target.value})})]})]}):null,t.family==="go"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid grid-cols-[1fr_110px] gap-3",children:[l.jsxs("div",{children:[l.jsx(Pe,{children:"Module 路径"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"取末段作为身份,如 rsc.io/fortune → fortune。"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"rsc.io/fortune",value:t.pkg,onChange:p=>u({pkg:p.target.value})})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"版本"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"留空 = 本地/默认。"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"latest",value:t.version,onChange:p=>u({version:p.target.value})})]})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"运行参数"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"serve --port 8080",value:t.args,onChange:p=>u({args:p.target.value})})]})]}):null,t.family==="rust"&&A!==null?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx(Pe,{children:"安装 crate"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"cargo install 目标;Rust 不能直跑,需先安装。"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"ripgrep",value:t.pkg,onChange:p=>u({pkg:p.target.value})})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"运行二进制"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"留空默认与 crate 同名。"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:t.pkg.trim().length>0?t.pkg.trim():"二进制名",value:t.binary,onChange:p=>u({binary:p.target.value})})]})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"运行参数"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"--json .",value:t.args,onChange:p=>u({args:p.target.value})})]}),l.jsxs("div",{className:"space-y-1 rounded-lg bg-muted/60 p-2.5 font-mono text-xs",children:[l.jsxs("p",{className:"text-muted-foreground",children:[l.jsx("span",{className:"mr-1.5 select-none",children:"$"}),A.install]}),l.jsxs("p",{children:[l.jsx("span",{className:"mr-1.5 select-none text-muted-foreground",children:"$"}),A.run]})]})]}):null,t.family==="python"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx(Pe,{children:"Runner"}),du(GC,t.runner,p=>u({runner:p}))]}),l.jsxs("div",{className:"grid grid-cols-[1fr_110px] gap-3",children:[l.jsxs("div",{children:[l.jsx(Pe,{children:"包名"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"包名中的 . _ 归一为 - 参与推导。"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"ruff",value:t.pkg,onChange:p=>u({pkg:p.target.value})})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"版本"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"latest",value:t.version,onChange:p=>u({version:p.target.value})})]})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"运行参数"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"format --check .",value:t.args,onChange:p=>u({args:p.target.value})})]})]}):null,t.family==="dotnet"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid grid-cols-[1fr_110px] gap-3",children:[l.jsxs("div",{children:[l.jsx(Pe,{children:"工具 ID"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:".NET 10 dnx:NuGet 工具临时运行,无需安装。"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"dotnet-format",value:t.pkg,onChange:p=>u({pkg:p.target.value})})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"版本"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"latest",value:t.version,onChange:p=>u({version:p.target.value})})]})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"运行参数"}),l.jsx(Xe,{className:"mt-0 font-mono text-xs",placeholder:"--verify-no-changes",value:t.args,onChange:p=>u({args:p.target.value})})]})]}):null]},t.family),l.jsx("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/60 px-3 py-2",children:l.jsx("code",{className:"min-w-0 flex-1 font-mono text-xs break-all",children:h.length>0?h:l.jsx("span",{className:"text-muted-foreground",children:"填写后生成命令…"})})}),n!==null?l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[l.jsx("span",{className:"text-[11px] text-muted-foreground",children:"环境变量预设"}),n.state==="off"?l.jsxs("button",{type:"button",className:"rounded-md px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground underline-offset-2 transition-colors hover:bg-accent hover:text-foreground hover:underline",title:n.defaultNote,onClick:()=>r("enable"),children:["+ ",n.key,"=true(启用)"]}):l.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-md border border-border bg-secondary/60 py-0.5 pr-1 pl-1.5 font-mono text-[11px]",title:"来自下方「命令选项 → 环境变量」配置(唯一可信源),两侧同步",children:[n.key,"=",n.explicitValue??"",l.jsx("span",{className:"font-sans text-[10px] text-muted-foreground",children:"env 已配置"}),l.jsx("button",{type:"button","aria-label":"移除环境变量预设",title:n.defaultNote,className:"rounded px-1 text-muted-foreground transition-colors hover:text-foreground",onClick:()=>r("disable"),children:"×"})]})]}):l.jsx("p",{className:"text-[11px] text-muted-foreground",children:"此系列/runner 无需注入环境变量。"}),l.jsxs("div",{className:"space-y-1 rounded-lg border border-border bg-muted/40 p-3",children:[l.jsx("p",{className:"text-[11px] text-muted-foreground",children:"默认应用标识(由命令推导,可在下方应用配置中覆盖)"}),l.jsx("code",{className:"font-mono text-sm font-medium break-all",children:f.appId}),l.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["名称 ",f.appName," · ~/.opentray/create/",eI(f.appId),"/"]})]}),l.jsxs(jb,{children:[l.jsx(Fb,{render:l.jsx(Oe,{variant:"outline"}),children:"取消"}),l.jsxs(Oe,{onClick:()=>{a(t)},children:[l.jsx(Ui,{}),"确定"]})]})]})})}const fu=e=>({...yp,family:e,runner:e==="python"?"uvx":e==="npm"?"npx":""}),pu=e=>e!=="custom",ni=(e,t)=>e.family===t.family&&e.runner===t.runner&&e.runnerFlags===t.runnerFlags&&e.pkg===t.pkg&&e.version===t.version&&e.args===t.args&&e.binary===t.binary&&e.raw===t.raw;function uI({command:e,onCommandChange:t,commandOptions:n,onCommandOptionsChange:r,disabled:o,onRun:s}){const i=d.useMemo(()=>XC(e),[e]),a=n.family,c=d.useRef({}),[u,f]=d.useState(null),[h,A]=d.useState(a?.family??null);d.useEffect(()=>{if(a!==null){if(c.current[a.family]=a,u===null){A(N=>N===a.family?N:a.family);return}!pu(a.family)||u.currentFamily!==a.family||f(N=>{if(N===null||N.currentFamily!==a.family)return N;const M=N.drafts[a.family],O=N.bases[a.family];return M===void 0||O===void 0||!ni(M,O)?N:{...N,drafts:{...N.drafts,[a.family]:a},bases:{...N.bases,[a.family]:a}}})}},[a,u===null]);const g=h??i.family,p=N=>{if(a!==null&&a.family===N)return a;const M=c.current[N];return M!==void 0?M:i.family===N?i:fu(N)},[x,m]=d.useState(!1),[v,b]=d.useState(!1),[y,C]=d.useState(!1),I=u===null?void 0:u.drafts[u.currentFamily],w=I??n.family??i,S=nI(w)[0],R=S===void 0?void 0:tI(n.env,S.key),E=S===void 0?null:{key:S.key,defaultNote:S.note,state:R!==void 0?"explicit":"off",...R!==void 0?{explicitValue:R}:{}},k=R!==void 0,B=N=>{const M=S?.key??"npm_config_yes",O=N==="enable"?[...n.env.filter(G=>G.key.trim()!==M),{key:M,value:"true"}]:n.env.filter(G=>G.key.trim()!==M);r({...n,env:O})},T=N=>{if(N===g)return;A(N);const M={...n,...n.argsMode==="array"?{argsMode:"string"}:{}},O=p(N);c.current[N]===void 0&&(c.current[N]=O),r({...M,family:N==="custom"?null:O}),t(Mi(O))},F=()=>{if(!pu(g))return;const N=p(g);f({snapshot:{family:g,state:N},currentFamily:g,drafts:{[g]:N},bases:{[g]:N}})},j=N=>{f(M=>M===null||M.currentFamily!==N.family?M:{...M,drafts:{...M.drafts,[N.family]:N}})},D=N=>{f(M=>{if(M===null||M.currentFamily===N)return M;const O=M.drafts[N],G=M.bases[N],Z=p(N),J=O!==void 0&&G!==void 0&&!ni(O,G),Q=J?O:Z;return{...M,currentFamily:N,drafts:{...M.drafts,[N]:Q},bases:{...M.bases,[N]:J?G:Z}}})},H=()=>{f(N=>{if(N===null)return N;const M=c.current[N.snapshot.family];return(M===void 0||ni(M,N.snapshot.state))&&(c.current[N.snapshot.family]=N.snapshot.state),null})},_=N=>{c.current[N.family]=N,A(N.family),t(Mi(N)),r({...n,...n.argsMode==="array"?{argsMode:"string"}:{},family:N}),f(null)},P=Wo[g],L=g==="custom";return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex h-8 w-full min-w-0 items-stretch rounded-lg border border-input bg-transparent transition-colors outline-none focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 disabled:opacity-50 dark:bg-input/30",children:[l.jsxs(Mo,{children:[l.jsxs(Po,{disabled:o,className:"flex w-11 items-center justify-between gap-1 rounded-l-lg border-r border-input transition-colors outline-none hover:bg-accent focus-visible:z-10 focus-visible:border-ring","aria-label":`命令系列:${hn[g]},点击切换`,title:`命令系列:${hn[g]}`,children:[l.jsx(P,{className:"size-4 text-muted-foreground ms-2"}),l.jsx(_n,{className:"size-3 text-muted-foreground/70 me-0.75"})]}),l.jsx(To,{align:"start",className:"w-36",children:bp.map(N=>{const M=Wo[N];return l.jsxs(No,{onClick:()=>T(N),className:N===g?"bg-accent/60":void 0,children:[l.jsx(M,{className:"text-muted-foreground"}),hn[N]]},N)})})]}),L?l.jsx("input",{className:"h-full w-full min-w-0 flex-1 bg-transparent px-2.5 font-mono text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed",placeholder:"npx somecommand start --xx",disabled:o,value:e,onChange:N=>t(N.target.value),onKeyDown:N=>{N.key==="Enter"&&!o&&s()}}):l.jsx("button",{type:"button",className:"h-full min-w-0 flex-1 cursor-pointer truncate px-2.5 text-left font-mono text-sm outline-none select-none disabled:cursor-not-allowed disabled:opacity-60",disabled:o,title:e.length>0?e:`点击配置 ${hn[g]} 系列命令`,"aria-label":`配置 ${hn[g]} 系列命令`,onClick:F,children:e.length>0?e:l.jsxs("span",{className:"text-muted-foreground",children:["点击配置 ",hn[g]," 系列命令…"]})}),k&&S!==void 0?l.jsxs(fs,{open:x||v||y,onOpenChange:N=>{N||C(!1)},children:[l.jsx(ps,{render:l.jsx("span",{tabIndex:0,className:"mr-1 flex size-6 shrink-0 self-center cursor-help items-center justify-center rounded-md text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring","aria-label":"命令将携带 npm_config_yes 环境变量,悬停或点击查看",onPointerEnter:()=>m(!0),onPointerLeave:()=>m(!1),onFocus:()=>b(!0),onBlur:()=>b(!1),onClick:()=>C(N=>!N)}),children:l.jsx(Rr,{className:"size-3.5"})}),l.jsx(hs,{side:"top",children:l.jsxs("div",{className:"space-y-1 text-left",children:[l.jsx("p",{className:"text-[11px] opacity-70",children:"环境变量预设"}),l.jsxs("p",{className:"font-mono text-xs",children:[S.key,"=",R]}),l.jsx("p",{className:"text-[11px] opacity-70",children:"来自「命令选项 → 环境变量」配置(唯一可信源,两侧同步)"})]})})]}):null]}),l.jsx(cI,{open:u!==null,draft:I??fu(g),envPreset:E,onEnvPresetChange:B,onDraftChange:j,onFamilyChange:D,onCancel:H,onApply:_})]})}function dI({tags:e,onTagsChange:t,disabled:n=!1,placeholder:r,className:o,...s}){const[i,a]=d.useState(""),c=()=>{i.length!==0&&(t([...e,i]),a(""))};return l.jsxs("div",{className:he("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((u,f)=>l.jsxs("span",{className:"flex items-center gap-1 rounded bg-accent px-1.5 py-0.5 text-accent-foreground",children:[l.jsx("span",{className:"max-w-56 truncate",title:u,children:u}),n?null:l.jsx("button",{type:"button","aria-label":`移除参数 ${f+1}`,className:"text-muted-foreground hover:text-foreground",onClick:()=>{t(e.filter((h,A)=>A!==f))},children:l.jsx(Zi,{className:"size-3"})})]},`${f}:${u}`)),l.jsx("input",{className:"min-w-24 flex-1 bg-transparent font-mono text-xs outline-none placeholder:text-muted-foreground",value:i,disabled:n,placeholder:r??(e.length===0?"程序(如 npx)":"参数,回车添加"),onChange:u=>a(u.target.value),onKeyDown:u=>{if(u.key==="Enter"){u.preventDefault(),c();return}u.key==="Backspace"&&i.length===0&&e.length>0&&(u.preventDefault(),t(e.slice(0,-1)))},onBlur:c,...s})]})}function fI({command:e,onCommandChange:t,argv:n,onArgvChange:r,runAlive:o,frozen:s,failedReason:i,commandOptions:a,defaultCwd:c,onCommandOptionsChange:u,onRun:f,onStop:h}){const A=g=>{u({...a,...g})};return l.jsxs("section",{className:"rounded-xl border border-border bg-card p-4",children:[l.jsxs("div",{className:"flex gap-2",children:[a.argsMode==="array"?l.jsx(dI,{tags:n,onTagsChange:r,disabled:o,"aria-label":"命令参数(argv)"}):l.jsx(uI,{command:e,onCommandChange:t,commandOptions:a,onCommandOptionsChange:u,disabled:o||s,onRun:f}),o?l.jsxs(Oe,{variant:"destructive",onClick:h,"aria-label":"中断命令",children:[l.jsx(eg,{}),"中断"]}):l.jsxs(Oe,{disabled:s,onClick:f,"aria-label":"运行命令",children:[l.jsx(zh,{}),"运行"]})]}),i!==void 0?l.jsx("p",{className:"mt-2 font-mono text-xs text-red-400",children:i}):null,l.jsx(La,{defaultValue:["command"],className:"mt-3 border-t border-border pt-1",children:l.jsxs(Ka,{value:"command",className:"border-b-0",children:[l.jsx(Wa,{children:l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx(Jh,{className:"size-4 text-muted-foreground"}),"命令选项"]})}),l.jsxs(Qa,{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[l.jsxs("div",{children:[l.jsx(Pe,{children:"参数输入模式"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"数组模式逐个输入参数(回车添加),原样传递、绝不拆分。"}),l.jsxs(Ga,{variant:"outline",size:"sm",spacing:0,value:[a.argsMode],onValueChange:g=>{const p=g[0];(p==="string"||p==="array")&&A({argsMode:p})},disabled:s,children:[l.jsx(jr,{value:"string",children:"字符串"}),l.jsx(jr,{value:"array",children:"数组 (argv)"})]})]}),l.jsxs("div",{children:[l.jsx(Pe,{htmlFor:"cmd-cwd",children:"工作目录 (cwd)"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"留空使用用户主目录(下方完整路径);相对路径按主目录解析。"}),l.jsx(Xe,{id:"cmd-cwd",className:"mt-0 font-mono text-xs",disabled:s,value:a.cwd,placeholder:c.length>0?`默认:${c}`:"默认:用户主目录",title:c,onChange:g=>A({cwd:g.target.value})}),c.length>0&&a.cwd.trim().length===0?l.jsx("p",{className:"mt-1 font-mono text-[11px] break-all text-muted-foreground",children:c}):null]})]}),l.jsxs("div",{children:[l.jsx(Pe,{children:"环境变量 (env)"}),l.jsx("p",{className:"mt-0.5 mb-1.5 text-[11px] text-muted-foreground",children:"启动命令时叠加在当前环境之上;同时写入生成的应用。"}),l.jsxs("div",{className:"space-y-1.5",children:[a.env.length===0?l.jsx("p",{className:"text-xs text-muted-foreground",children:"未配置"}):a.env.map((g,p)=>l.jsxs("div",{className:"flex gap-1.5",children:[l.jsx(Xe,{className:"font-mono text-xs",disabled:s,"aria-label":`env 名称 ${p+1}`,value:g.key,placeholder:"NAME",onChange:x=>{const m=[...a.env];m[p]={...g,key:x.target.value},A({env:m})}}),l.jsx(Xe,{className:"font-mono text-xs",disabled:s,"aria-label":`env 值 ${p+1}`,value:g.value,placeholder:"value",onChange:x=>{const m=[...a.env];m[p]={...g,value:x.target.value},A({env:m})}}),l.jsx(Oe,{variant:"ghost",size:"icon-sm",disabled:s,"aria-label":"删除环境变量",onClick:()=>{A({env:a.env.filter((x,m)=>m!==p)})},children:"×"})]},p)),l.jsxs(Oe,{variant:"outline",size:"sm",disabled:s,onClick:()=>A({env:[...a.env,{key:"",value:""}]}),children:[l.jsx(Rr,{className:"size-3.5"}),"添加变量"]})]})]})]})]})})]})}const hu=e=>{const t=e.trim();return t.length===0?"":/^https?:\/\//iu.test(t)?t:`https://${t}`};function pI({value:e,onChange:t,activeSource:n,frozen:r,loading:o,failedReason:s,onSubmit:i}){return l.jsxs("section",{className:"rounded-xl border border-border bg-card p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 pb-3 text-sm font-medium text-muted-foreground",children:[l.jsx(Bh,{className:"size-4"}),"网页地址"]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx(ai,{className:"pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),l.jsx(Xe,{className:"pl-8 font-mono text-xs",value:e,placeholder:"https://example.com",disabled:r,onChange:a=>t(a.target.value),onKeyDown:a=>{if(a.key!=="Enter"||r||o)return;const c=hu(e);t(c),i(c)},"aria-label":"网页地址"})]}),l.jsxs(Oe,{size:"sm",disabled:r||o||e.trim().length===0,onClick:()=>{const a=hu(e);t(a),i(a)},children:[o?l.jsx(Th,{className:"size-4 animate-spin"}):null,"获取预设"]})]}),s!==void 0?l.jsx("p",{className:"pt-2 text-xs text-destructive",role:"alert",children:s}):null,n!==void 0?l.jsxs("p",{className:"pt-2 text-xs text-muted-foreground",children:["源地址:",l.jsx("span",{className:"font-mono",children:n}),"——标题/图标预设来自该页面,均可在下方修改。"]}):l.jsx("p",{className:"pt-2 text-xs text-muted-foreground",children:"直接把网页打包成应用:不需要命令,创建时抓取页面标题与图标作为预设。"})]})}const ri=["scaffold","icon","install"];function hI({open:e,phase:t,frozenValues:n,iconSrc:r,iconLabel:o,traySrc:s,trayLabel:i,selectedPort:a,currentStep:c,logs:u,error:f,result:h,onBack:A,onCreate:g,onShare:p,onOpenApp:x,onClose:m,confirmError:v,onOpenChange:b}){const y=d.useRef(null);d.useEffect(()=>{y.current?.scrollTo({top:y.current.scrollHeight})},[u.length]);const C=I=>{const w=ri.indexOf(I),S=ri.indexOf(c);return t==="success"||w<S?"done":w===S?"active":""};return l.jsx(za,{open:e,onOpenChange:I=>{t==="pending"&&I===!1||b(I)},children:l.jsx(Ya,{className:"max-w-xl",children:t==="confirm"?l.jsxs(l.Fragment,{children:[l.jsxs(Qn,{children:[l.jsx(Gn,{children:"确认应用信息"}),l.jsx(Ua,{children:"表单已固定,以下值将用于生成应用。"})]}),l.jsxs("dl",{className:"grid grid-cols-[110px_1fr] gap-x-3 gap-y-2 text-sm",children:[l.jsx("dt",{className:"text-muted-foreground",children:"App ID"}),l.jsx("dd",{className:"font-mono break-all",children:n.appId}),l.jsx("dt",{className:"text-muted-foreground",children:"应用名称"}),l.jsx("dd",{className:"break-all",children:n.appName}),l.jsx("dt",{className:"text-muted-foreground",children:"图标"}),l.jsxs("dd",{className:"flex flex-wrap items-center gap-4",children:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"icon-checker flex size-10 items-center justify-center overflow-hidden rounded-md","aria-label":"应用图标预览",children:r!==void 0?l.jsx("img",{src:r,alt:"应用图标",className:"size-full object-contain"}):l.jsx("span",{className:"text-[10px] text-muted-foreground",children:"无"})}),l.jsxs("span",{className:"flex flex-col",children:[l.jsx("span",{className:"text-xs leading-tight",children:"应用图标"}),l.jsx("span",{className:"font-mono text-[10px] leading-tight text-muted-foreground",children:o})]})]}),l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"icon-checker flex size-10 items-center justify-center overflow-hidden rounded-md","aria-label":"托盘图标预览",children:s!==void 0?l.jsx("img",{src:s,alt:"托盘图标",className:"size-full object-contain"}):l.jsx("span",{className:"text-[10px] text-muted-foreground",children:"文字"})}),l.jsxs("span",{className:"flex flex-col",children:[l.jsx("span",{className:"text-xs leading-tight",children:"托盘图标"}),l.jsx("span",{className:"font-mono text-[10px] leading-tight text-muted-foreground",children:i})]})]})]}),l.jsx("dt",{className:"text-muted-foreground",children:"服务端口"}),l.jsx("dd",{className:"font-mono",children:a!==void 0?`:${a}(生成后运行时重新嗅探)`:"运行时嗅探"}),l.jsx("dt",{className:"text-muted-foreground",children:"包管理器"}),l.jsx("dd",{children:n.pm})]}),v!==void 0?l.jsx("p",{className:"text-xs font-medium text-red-400",children:v}):null,l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx(Oe,{variant:"outline",onClick:A,children:"返回修改"}),l.jsx(Oe,{variant:"outline",onClick:p,children:"分享"}),l.jsx(Oe,{onClick:g,children:"确认生成"})]})]}):t==="pending"?l.jsxs(l.Fragment,{children:[l.jsx(Qn,{children:l.jsx(Gn,{children:"正在生成应用…"})}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:ri.map(I=>l.jsx(Io,{variant:C(I)==="done"?"default":"secondary",children:I},I))}),l.jsx("div",{ref:y,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:u.join(`
|
|
24
|
+
`)})]}):t==="success"&&h!==void 0?l.jsxs(l.Fragment,{children:[l.jsx(Qn,{children:l.jsxs(Gn,{className:"flex items-center gap-2",children:[l.jsx(Ah,{className:"size-5 text-emerald-400"}),"应用已生成"]})}),l.jsxs("dl",{className:"grid grid-cols-[110px_1fr] gap-x-3 gap-y-2 text-sm",children:[l.jsx("dt",{className:"text-muted-foreground",children:"项目目录"}),l.jsx("dd",{className:"font-mono break-all",children:h.projectDir}),h.bundlePath?l.jsxs(l.Fragment,{children:[l.jsx("dt",{className:"text-muted-foreground",children:"macOS Bundle"}),l.jsx("dd",{className:"font-mono break-all",children:h.bundlePath})]}):null]}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx(Oe,{variant:"outline",onClick:m,children:"完成"}),l.jsxs(Oe,{onClick:x,children:[l.jsx(Du,{}),"打开应用"]})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:h.pinHint})]}):l.jsxs(l.Fragment,{children:[l.jsx(Qn,{children:l.jsxs(Gn,{className:"flex items-center gap-2",children:[l.jsx(ig,{className:"size-5 text-red-400"}),"生成失败"]})}),l.jsx("p",{className:"break-all font-mono text-xs text-red-400",children:f??"未知错误"}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Oe,{variant:"outline",onClick:A,children:"返回重试"})})]})})})}const oi=(e,t)=>{const n=d.useRef(e);n.current=e;const r=d.useRef(void 0),o=d.useRef(void 0),s=d.useCallback(()=>{r.current!==void 0&&(clearTimeout(r.current),r.current=void 0);const f=o.current;o.current=void 0,f!==void 0&&n.current(...f)},[]),i=d.useCallback(()=>{r.current!==void 0&&(clearTimeout(r.current),r.current=void 0),o.current=void 0},[]),a=d.useCallback((...f)=>{o.current=f,r.current!==void 0&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=void 0;const h=o.current;o.current=void 0,h!==void 0&&n.current(...h)},t)},[t]);d.useEffect(()=>s,[s]);const c=d.useRef(a);c.current=a;const u=d.useCallback((...f)=>{c.current(...f)},[]);return u.flush=s,u.cancel=i,u},Ip=d.createContext(void 0);function wp(){const e=d.useContext(Ip);if(e===void 0)throw new Error(st(64));return e}const sl={tabActivationDirection:e=>({"data-activation-direction":e})},gI=d.forwardRef(function(t,n){const{className:r,defaultValue:o=0,onValueChange:s,orientation:i="horizontal",render:a,value:c,style:u,...f}=t,h=t.defaultValue!==void 0,A=d.useRef([]),[g,p]=d.useState(()=>new Map),[x,m]=sn({controlled:c,default:o,name:"Tabs",state:"value"}),v=c!==void 0,[b,y]=d.useState(()=>new Map),C=d.useRef(void 0),I=d.useCallback(K=>Pi(b,K),[b]),[w,S]=d.useState(()=>({previousValue:x,tabActivationDirection:"none"})),{previousValue:R,tabActivationDirection:E}=w;let k=E,B=!1;R!==x&&(k=gu(R,x,i,b),B=R!=null&&x!=null&&I(x)==null);const T=B?R:x,F=R!==T||E!==k;ae(()=>{F&&S({previousValue:T,tabActivationDirection:k})},[T,F,k]);const j=de((K,te)=>{const le=gu(x,K,i,b);te.activationDirection=le,s?.(K,te),!te.isCanceled&&m(K)}),D=de((K,te)=>{s?.(K,Ce(te,void 0,void 0,{activationDirection:"none"}))}),H=de((K,te)=>(p(le=>{const X=new Map(le);return X.set(K,te),X}),()=>{p(le=>{if(le.get(K)!==te)return le;const X=new Map(le);return X.delete(K),X})})),_=d.useCallback(K=>g.get(K),[g]),P=d.useCallback(K=>{for(const te of b.values())if(K===te.value)return te.id},[b]),L=d.useMemo(()=>({getTabElementBySelectedValue:I,getTabIdByPanelValue:P,getTabPanelIdByValue:_,onValueChange:j,orientation:i,registerMountedTabPanel:H,setTabMap:y,tabActivationDirection:k,value:x}),[I,P,_,j,i,H,y,k,x]),N=d.useMemo(()=>{for(const K of b.values())if(K.value===x)return K},[b,x]),M=d.useMemo(()=>{for(const K of b.values())if(!K.disabled)return K.value},[b]),O=d.useRef(!h),G=d.useRef(o),Z=d.useRef(h),J=d.useRef(!1);ae(()=>{if(v)return;function K(ee,U){m(ee),S({previousValue:ee,tabActivationDirection:"none"}),D(ee,U),O.current=!1}if(b.size===0){J.current&&x!==null&&!C.current?.isConnected&&K(null,Cl);return}J.current=!0,C.current=b.keys().next().value;const te=N?.disabled,le=N==null&&x!==null;if(!te&&x===G.current&&(Z.current=!1),Z.current&&te&&x===G.current)return;const X=O.current;if(te||le){const ee=M??null;if(x===ee){O.current=!1;return}let U=Cl;X?U=yl:te&&(U=Eu),K(ee,U);return}X&&N!=null&&(D(x,yl),O.current=!1)},[M,v,D,N,m,b,x]);const $=Me("div",t,{state:{orientation:i,tabActivationDirection:k},ref:n,props:f,stateAttributesMapping:sl});return l.jsx(Ip.Provider,{value:L,children:l.jsx(Vr,{elementsRef:A,children:$})})});function Pi(e,t){for(const[n,r]of e.entries())if(t===r.value)return n;return null}function gu(e,t,n,r){if(e==null||t==null)return"none";const[o,s,i]=n==="horizontal"?["left","left","right"]:["top","up","down"],a=Pi(r,e),c=Pi(r,t);if(a==null||c==null)return a!==c&&(typeof e=="number"||typeof e=="string")&&typeof e==typeof t?t>e?i:s:"none";const u=a.getBoundingClientRect()[o],f=c.getBoundingClientRect()[o];return f<u?s:f>u?i:"none"}const kp=d.createContext(void 0);function AI(){const e=d.useContext(kp);if(e===void 0)throw new Error(st(65));return e}const mI=d.forwardRef(function(t,n){const{className:r,disabled:o=!1,render:s,value:i,id:a,nativeButton:c=!0,style:u,...f}=t,{value:h,getTabPanelIdByValue:A,onValueChange:g,orientation:p,tabActivationDirection:x}=wp(),{activateOnFocus:m,registerTabResizeObserverElement:v,tabsListElement:b}=AI(),{highlightedIndex:y,onHighlightedIndexChange:C}=Ki(),I=wt(a),w=d.useMemo(()=>({disabled:o,id:I,value:i}),[o,I,i]),{compositeProps:S,compositeRef:R,index:E}=tf({metadata:w}),k=i===h,B=d.useRef(!1),T=d.useRef(null),F=de(J=>{T.current?.(),T.current=J?v(J):null});ae(()=>{if(B.current){B.current=!1;return}if(!(k&&E>-1&&y!==E))return;const J=b;if(J!=null){const Q=Ct(je(J));if(Q&&ve(J,Q))return}o||C(E)},[k,E,y,C,o,b]);const{getButtonProps:j,buttonRef:D}=Yt({disabled:o,native:c,focusableWhenDisabled:!0}),H=A(i),_=d.useRef(!1),P=d.useRef(!1);function L(J){g(i,Ce(jt,J.nativeEvent,void 0,{activationDirection:"none"}))}function N(J){k||o||L(J)}function M(J){k||o||m&&(!_.current||P.current)&&L(J)}function O(J){if(k||o)return;_.current=!0,P.current=J.button===0;const Q=je(J.currentTarget);function $(){_.current=!1,P.current=!1,Q.removeEventListener("pointerup",$),Q.removeEventListener("pointercancel",$)}Q.addEventListener("pointerup",$),Q.addEventListener("pointercancel",$)}return Me("button",t,{state:{disabled:o,active:k,orientation:p,tabActivationDirection:x},ref:[n,D,R,F],props:[S,{role:"tab","aria-controls":H,"aria-selected":k,id:I,onClick:N,onFocus:M,onPointerDown:O,[wf]:k?"":void 0,onKeyDownCapture(){B.current=!0}},f,j],stateAttributesMapping:sl})}),xI=d.forwardRef(function(t,n){const{activateOnFocus:r=!1,className:o,loopFocus:s=!0,render:i,style:a,...c}=t,{orientation:u,setTabMap:f,tabActivationDirection:h}=wp(),[A,g]=d.useState(0),[p,x]=d.useState(null),m=d.useRef(new Set),v=d.useRef(new Set),b=d.useRef(null);ae(()=>{if(typeof ResizeObserver>"u")return;const R=new ResizeObserver(()=>{m.current.forEach(E=>{E()})});return b.current=R,p&&R.observe(p),v.current.forEach(E=>{R.observe(E)}),()=>{R.disconnect(),b.current=null}},[p]);const y=de(R=>(m.current.add(R),()=>{m.current.delete(R)})),C=de(R=>(v.current.add(R),b.current?.observe(R),()=>{v.current.delete(R),b.current?.unobserve(R)})),I={orientation:u,tabActivationDirection:h},w={"aria-orientation":u==="vertical"?"vertical":void 0,role:"tablist"},S=d.useMemo(()=>({activateOnFocus:r,registerIndicatorUpdateListener:y,registerTabResizeObserverElement:C,tabsListElement:p}),[r,y,C,p]);return l.jsx(kp.Provider,{value:S,children:l.jsx(kf,{render:i,className:o,style:a,state:I,refs:[n,x],props:[w,c],stateAttributesMapping:sl,highlightedIndex:A,enableHomeAndEndKeys:!0,loopFocus:s,orientation:u,onHighlightedIndexChange:g,onMapChange:f,disabledIndices:Ot})})});function bI({className:e,orientation:t="horizontal",...n}){return l.jsx(gI,{"data-slot":"tabs","data-orientation":t,className:he("group/tabs flex gap-2 data-horizontal:flex-col",e),...n})}const vI=Ti("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function yI({className:e,variant:t="default",...n}){return l.jsx(xI,{"data-slot":"tabs-list","data-variant":t,className:he(vI({variant:t}),e),...n})}function Au({className:e,...t}){return l.jsx(mI,{"data-slot":"tabs-trigger",className:he("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}function mu({className:e,size:t="default",...n}){return l.jsx("div",{"data-slot":"card","data-size":t,className:he("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...n})}function xu({className:e,...t}){return l.jsx("div",{"data-slot":"card-header",className:he("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",e),...t})}function bu({className:e,...t}){return l.jsx("div",{"data-slot":"card-content",className:he("px-(--card-spacing)",e),...t})}function CI({className:e,...t}){return l.jsx("div",{"data-slot":"card-footer",className:he("flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",e),...t})}const Ep=d.memo(({port:e,url:t,visible:n,className:r})=>{const o=d.useRef(null),s=d.useRef(t);return d.useEffect(()=>{const i=o.current;if(i===null){s.current=t;return}s.current!==t&&(s.current=t,i.src=t)},[t]),l.jsx("iframe",{ref:o,title:`service-${e}`,src:t,className:r,style:{width:"100%",height:"100%",border:0,background:"#fff",display:n?"block":"none"},sandbox:"allow-same-origin allow-scripts allow-forms"})});Ep.displayName="StableIframe";const II=e=>{const t=e.trim();if(t.length!==0)try{return new URL(/^https?:\/\//iu.test(t)?t:`http://${t}`).href}catch{return}},vu=({status:e,services:t,activeTab:n,onJumpToService:r})=>l.jsxs(CI,{className:"h-8 shrink-0 gap-3 overflow-x-auto px-3 py-0 text-[11px] text-muted-foreground",children:[l.jsxs("span",{className:"font-mono whitespace-nowrap",children:["光标 ",e.cursorY,":",e.cursorX]}),l.jsxs("span",{className:"font-mono whitespace-nowrap",children:[e.cols,"×",e.rows]}),l.jsx("span",{className:"font-mono whitespace-nowrap",children:e.selection===void 0?"无选区":`选区 ${e.selection.start.y}:${e.selection.start.x} – ${e.selection.end.y}:${e.selection.end.x}`}),l.jsx("span",{className:"h-3 w-px bg-border"}),t.length===0?l.jsx("span",{children:"嗅探 HTTP 服务中…(未发现不影响创建应用)"}):t.map(o=>l.jsxs(Io,{variant:n===`svc-${o.port}`?"default":"secondary",className:"cursor-pointer font-mono whitespace-nowrap",onClick:()=>r(o.port),children:[":",o.port,o.title?` · ${o.title}`:""]},o.port))]});function wI({command:e,terminalHostRef:t,terminalReady:n,interactive:r,status:o,services:s,iframeTabs:i,activeTab:a,onActiveTabChange:c,onIframeNavigate:u,onIframeHistoryMove:f,onJumpToService:h,hideTerminal:A=!1,className:g}){return l.jsxs("div",{className:he("flex min-h-0 flex-col gap-2",g),children:[l.jsx(bI,{value:a,onValueChange:c,children:l.jsxs(yI,{variant:"line",className:"w-full justify-start border-b px-2",children:[A?null:l.jsxs(Au,{value:"terminal",children:[l.jsx(Rr,{className:"size-3.5"}),"终端",!r&&n?l.jsx("span",{className:"text-[10px] text-amber-400",children:"非交互"}):null]}),i.map(p=>l.jsxs(Au,{value:`svc-${p.port}`,children:[l.jsx(ai,{className:"size-3.5"}),new URL(p.url).port===""?Fi(p.url):`${Fi(p.url)}:${new URL(p.url).port}`]},p.port))]})}),l.jsx("div",{className:"flex min-h-0 flex-1 flex-col",hidden:A||a!=="terminal",children:l.jsxs(mu,{size:"sm",className:"min-h-0 flex-1 gap-0",children:[l.jsx(xu,{className:"border-b [.border-b]:pb-2",children:l.jsxs("span",{className:"tech-ltr flex min-w-0 items-center gap-2 font-mono text-xs text-muted-foreground",children:[l.jsx(Rr,{className:"size-4 shrink-0"}),l.jsx("span",{className:"truncate",children:e||"尚未运行命令"})]})}),l.jsxs(bu,{className:"min-h-0 flex-1 p-0",children:[l.jsx("div",{ref:t,className:"min-h-0 min-w-0 h-full bg-[#05070b] px-1"}),n?null:l.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:"正在加载终端渲染器…"})]}),l.jsx(vu,{status:o,services:s,activeTab:a,onJumpToService:h})]})}),i.map(p=>l.jsx("div",{className:"flex min-h-0 flex-1 flex-col",hidden:a!==`svc-${p.port}`,children:l.jsxs(mu,{size:"sm",className:"min-h-0 flex-1 gap-0",children:[l.jsx(xu,{className:"border-b [.border-b]:pb-2",children:l.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[l.jsx(Oe,{variant:"ghost",size:"icon-sm",disabled:p.historyIndex===0,onClick:()=>f(p.port,-1),"aria-label":"后退",children:l.jsx(ih,{})}),l.jsx(Oe,{variant:"ghost",size:"icon-sm",disabled:p.historyIndex>=p.history.length-1,onClick:()=>f(p.port,1),"aria-label":"前进",children:l.jsx(ah,{})}),l.jsx(Oe,{variant:"ghost",size:"icon-sm",onClick:()=>u(p.port,p.url,"replace"),"aria-label":"重新加载",children:l.jsx(lh,{})}),l.jsx(ai,{className:"size-4 shrink-0 text-muted-foreground"}),l.jsx(Xe,{className:"tech-ltr h-7 font-mono text-xs",defaultValue:p.url,placeholder:"输入 URL 跳转",onKeyDown:x=>{if(x.key!=="Enter")return;const m=x.target.value,v=II(m);v!==void 0&&u(p.port,v,"push")}},`${p.port}:${p.historyIndex}:${p.url}`)]})}),l.jsx(bu,{className:"min-h-0 flex-1 p-0",children:l.jsx(Ep,{port:p.port,url:p.url,visible:a===`svc-${p.port}`})}),l.jsx(vu,{status:o,services:s,activeTab:a,onJumpToService:h})]})},p.port))]})}const Sp={model:"isnet_fp16",alphaThreshold:0,shrink:0},kI="1.7.0";let xo;const EI=async()=>(xo!==void 0||(xo=(await ch(()=>import("./index2.js"),__vite__mapDeps([0,1,2,3]))).removeBackground),xo),SI=()=>new URL(`/imgly-data/${kI}/`,window.location.origin).toString(),RI=(e,t)=>{if(t.alphaThreshold<=0&&t.shrink<=0)return e;const{width:n,height:r}=e;let o=new Uint8ClampedArray(n*r);for(let i=0;i<o.length;i+=1){const a=e.data[i*4+3]??0;o[i]=t.alphaThreshold>0&&a<t.alphaThreshold?0:a}for(let i=0;i<t.shrink;i+=1){const a=new Uint8ClampedArray(o.length);for(let c=0;c<r;c+=1)for(let u=0;u<n;u+=1){let f=o[c*n+u]??0;for(let h=-1;h<=1&&f>0;h+=1)for(let A=-1;A<=1&&f>0;A+=1){const g=c+h,p=u+A,x=g<0||g>=r||p<0||p>=n?0:o[g*n+p]??0;x<f&&(f=x)}a[c*n+u]=f}o=a}const s={data:new Uint8ClampedArray(e.data),width:n,height:r};for(let i=0;i<o.length;i+=1)s.data[i*4+3]=o[i]??0;return s},DI=async(e,t=Sp,n)=>{try{const r=await EI(),o=(c,u,f)=>{if(f<=0)return;const h=Math.min(100,Math.round(u/f*100));n?.(c.startsWith("fetch:")?`AI 提取主体中(下载模型 ${h}%)`:"AI 提取主体中(推理中)")},s=await r(e,{model:t.model,device:"gpu",publicPath:SI(),progress:o});let i=s;const a=await createImageBitmap(s);try{if(t.alphaThreshold>0||t.shrink>0){const c=document.createElement("canvas");c.width=a.width,c.height=a.height;const u=c.getContext("2d");if(u!==null){u.drawImage(a,0,0);const f=u.getImageData(0,0,c.width,c.height),h=RI(f,t);f.data.set(h.data),u.putImageData(f,0,0);const A=await new Promise(g=>c.toBlob(g,"image/png"));A!==null&&(i=A)}}return{bytes:i,width:a.width,height:a.height}}finally{a.close()}}catch{return}},yu={appId:"",appName:"",iconPath:"",iconBackground:"transparent",iconScale:.8,trayIconPath:"",force:!1,pm:"npm",showStartupTerminal:!1,showAddressBar:!1,imageSmoothingEnabled:!0,developerMode:!1},FI={appId:"",appName:"",targetDir:"",iconPath:""};function BI(){const{query:e}=pf(),t=e.get("edit"),[n,r]=d.useState(void 0),[o,s]=d.useState(""),[i,a]=d.useState([]),[c,u]=d.useState(V1),[f,h]=d.useState(""),[A,g]=d.useState(!1),[p,x]=d.useState(!1),m=d.useCallback(z=>{x(z),Jn.set(z)},[]);d.useEffect(()=>(Jn.set(p),()=>Jn.set(!1)),[p]);const[v,b]=d.useState(void 0),[y,C]=d.useState(!1),[I,w]=d.useState(""),[S,R]=d.useState(!1),[E,k]=d.useState("idle"),[B,T]=d.useState(),[F,j]=d.useState(""),[D,H]=d.useState(!0),[_,P]=d.useState(!1),[L,N]=d.useState(),[M,O]=d.useState(yu),[G,Z]=d.useState(FI),[J,Q]=d.useState([]),[$,K]=d.useState(),[te,le]=d.useState(!1),[X,ee]=d.useState([]),[U,ue]=d.useState(),[se,be]=d.useState(0),[re,Ae]=d.useState(),[ie,oe]=d.useState(),[ce,me]=d.useState(),[ge,W]=d.useState(),[V,ye]=d.useState("transparent"),[q,ne]=d.useState(.8),ke=d.useRef(void 0),Se=d.useRef(void 0),Qe=d.useRef(!1),tt=d.useRef(!1),[Le,ht]=d.useState(),[Ke,Ge]=d.useState(),[ut,Re]=d.useState(),[Ue,_e]=d.useState("terminal"),[nt,Ee]=d.useState([]),[Ve,Ze]=d.useState({cursorX:0,cursorY:0,cols:0,rows:0}),[Je,rt]=d.useState(!1),[it,At]=d.useState("confirm"),[dt,xt]=d.useState([]),[Mt,$t]=d.useState(""),[Be,ze]=d.useState(),[bt,Et]=d.useState(),[St,Pt]=d.useState(yu),Tt=d.useRef(null),vt=d.useRef(void 0),un=d.useRef([]),En=d.useRef(M);En.current=M;const il=d.useRef(E);il.current=E;const Jr=(z,pe,Y)=>{if(pe===void 0)return!1;const fe=Number.parseInt(pe.split(":")[1]??"",10);return!z.some(Fe=>Fe.index===fe)||pe.split(":")[0]!==String(Y)},vs=d.useRef(void 0);d.useEffect(()=>{const z=M.iconPath.trim().length>0?M.iconPath.trim():G.iconPath.trim().length>0?G.iconPath.trim():void 0;if(vs.current=z,z===void 0){oe(void 0),W(void 0),ke.current=void 0;return}z===ke.current&&ge!==void 0||(async()=>{try{me(void 0);const pe=await Ne("/api/icon-analyze",{path:z});if(!pe.ok)throw new Error("analyze failed");const Y=await pe.json();if(vs.current!==z)return;oe(Y),Qe.current=!1,ye(Y.suggested),Ne("/api/form",{iconBackground:Y.suggested});const fe=await Ne("/api/icon-compose",{foregroundPath:z,background:Y.suggested,scale:q});if(!fe.ok)throw new Error("compose failed");const Fe=await fe.json();if(vs.current!==z)return;W(Fe),ke.current=z}catch{oe(void 0),W(void 0),me("图标分析或合成失败,预览不可用")}})()},[M.iconPath,G.iconPath]);const[Rp,al]=d.useState(!1),[Dp,ll]=d.useState(void 0),[ys,Fp]=d.useState(Sp),cl=d.useRef(ys);cl.current=ys;const $r=d.useRef(new Set),Cs=d.useRef(0),Is=d.useRef(!1),ws=d.useRef(!1),ks=d.useCallback(async(z,pe,Y)=>{Is.current=!0,al(!0);try{const fe=await(await fetch(Dn(pe,z.index,Y))).blob(),Fe=await DI(fe,cl.current,ll);if(Fe===void 0||Cs.current!==Y)return;const Nt=`token=${encodeURIComponent(new URLSearchParams(location.search).get("token")??"")}&port=${pe}&variantOf=${z.index}&width=${Fe.width}&height=${Fe.height}`;await fetch(`/api/icon-candidate?${Nt}`,{method:"POST",headers:{"content-type":"application/octet-stream"},body:Fe.bytes})}catch{}finally{Is.current=!1,al(!1),ll(void 0),ws.current&&(ws.current=!1,ul())}},[]),ul=oi(()=>{if(E==="frozen"||E==="materializing"||E==="success")return;const z=U,pe=X.find(Y=>Y.variant==="original");if(!(z===void 0||pe===void 0)){if(Is.current){ws.current=!0;return}ks(pe,z,se)}},500),Bp=z=>{Fp(z),ul()},Ln=d.useRef(void 0);d.useEffect(()=>{if(!(re===void 0&&Ke===void 0)&&U!==void 0){if(Ln.current===void 0){Ln.current=se;return}Ln.current!==se&&(Ln.current=se,re!==void 0&&!Jr(X,re,U)&&Ne("/api/icon-select",{port:U,index:Number.parseInt(re.split(":")[1]??"",10)}),Ke!==void 0&&!Jr(X,Ke,U)&&Ne("/api/tray-icon-select",{port:U,index:Number.parseInt(Ke.split(":")[1]??"",10)}))}},[se,re,Ke,X,U]),d.useEffect(()=>{const z=U,pe=X.find(fe=>fe.variant==="original");if(z===void 0||pe===void 0||E==="frozen"||E==="materializing"||E==="success")return;Cs.current!==se&&(Cs.current=se,$r.current=new Set);const Y=`${z}:${pe.index}`;$r.current.has(Y)||X.some(fe=>fe.variant==="subject"&&fe.variantOf===pe.index)||($r.current=new Set([...$r.current,Y]),ks(pe,z,se))},[X,U,se,E,ks]);const dl=oi(z=>{Ne("/api/form",{iconScale:z});const pe=pl();hl(pe,V,z)},250),jp=z=>{ne(z),dl(z)},fl=oi(z=>{Ne("/api/form",{iconBackground:z});const pe=pl();hl(pe,z,q)},120),Mp=z=>{Qe.current=!0,ye(z),fl(z)},pl=()=>M.iconPath.trim().length>0?M.iconPath.trim():G.iconPath.trim().length>0?G.iconPath.trim():void 0,hl=d.useCallback(async(z,pe,Y)=>{if(z===void 0){oe(void 0),W(void 0),ke.current=void 0,Se.current=void 0;return}Se.current=z;try{const fe=await Ne("/api/icon-analyze",{path:z});if(!fe.ok)throw new Error("analyze failed");const Fe=await fe.json();if(Se.current!==z)return;oe(Fe);const mt=await Ne("/api/icon-compose",{foregroundPath:z,background:pe,scale:Y});if(!mt.ok)throw new Error("compose failed");const Nt=await mt.json();if(Se.current!==z)return;W(Nt),ke.current=z}catch{oe(void 0),W(void 0),me("图标合成失败,预览未更新")}},[]);d.useEffect(()=>{uh()},[]);const Pp=d.useRef(!1);d.useEffect(()=>{t===null||n===t||(r(t),(async()=>{const z=await gf(t);if(z.status!==200||"code"in z.data)return;const pe=z.data;if(pe.command?.executable!==void 0&&s(pe.command.executable),pe.command?.args!==void 0&&a([...pe.command.args]),pe.command?.executable!==void 0&&u(Y=>({...Y,argsMode:"array"})),pe.appName!==void 0){const Y=pe.appName;O(fe=>({...fe,appName:Y}))}if(pe.icons?.imageSmoothingEnabled!==void 0){const Y=pe.icons.imageSmoothingEnabled;O(fe=>({...fe,imageSmoothingEnabled:Y}))}if(pe.developerMode!==void 0){const Y=pe.developerMode;O(fe=>({...fe,developerMode:Y,force:!0}))}if(pe.command?.cwd!==void 0){const Y=pe.command.cwd;u(fe=>({...fe,cwd:Y}))}if(pe.command?.env!==void 0){const Y=Object.entries(pe.command.env).map(([fe,Fe])=>({key:fe,value:Fe}));u(fe=>({...fe,env:Y}))}Pp.current=!0})())},[t,n]),d.useEffect(()=>{if(!p)return;let z=!1;return(async()=>{const pe=Tt.current;if(pe===null)return;const Y=await dh(pe);if(z||Y===void 0){z||N("ghostty-web 加载失败,输出将以纯文本显示");return}vt.current=Y,P(!0);const fe=un.current;un.current=[];for(const mt of fe)Y.write(mt);Y.onData(mt=>{gl.current&&Ne("/api/terminal-input",{data:mt})}),Y.onResize(({cols:mt,rows:Nt})=>{Ne("/api/terminal-resize",{cols:mt,rows:Nt})});const Fe=window.setInterval(()=>{if(!(il.current==="idle"&&!vt.current))try{Ze(Y.readState())}catch{}},300);return()=>window.clearInterval(Fe)})(),()=>{z=!0,vt.current?.dispose(),vt.current=void 0}},[p]);const gl=d.useRef(!0);d.useEffect(()=>{gl.current=D},[D]),d.useEffect(()=>{const z=Z1();return z.onmessage=pe=>{const Y=JSON.parse(pe.data);switch(Y.type){case"snapshot":{k(Y.state),R(Y.runAlive),b(Y.urlSource),s(Y.command),j(Y.command),u(Y.commandOptions),H(Y.interactive),O(Y.form),Z(Y.defaults),g(Y.targetDirExists),Q(Y.services),K(Y.selectedPort),ee(Y.icons??[]),ue(Y.iconsPort),be(Y.iconsGeneration??0),Ee(Y.urlSource!==void 0?[{port:0,url:Y.urlSource,history:[Y.urlSource],historyIndex:0}]:Y.services.map(Fe=>({port:Fe.port,url:Fe.url,history:[Fe.url],historyIndex:0})));const fe=Y.runAlive||Y.services.length>0||Y.urlSource!==void 0;m(fe),_e(Y.urlSource!==void 0?"svc-0":fe&&Y.services.length>0?`svc-${Y.services[0].port}`:"terminal");break}case"state":k(Y.state),Y.state==="failed"&&T(Y.reason),Y.state==="frozen"&&(At("confirm"),rt(!0)),Y.state==="materializing"&&(At("pending"),xt([])),Y.state==="success"&&At("success"),Y.state==="failed"&&ml.current&&(At("failed"),ze(Y.reason));break;case"log":{vt.current!==void 0?vt.current.write(Y.chunk):Al.current!==void 0?N(fe=>(fe??"")+Y.chunk):un.current.push(Y.chunk);break}case"term-mode":if(H(Y.interactive),!Y.interactive&&Y.message!==void 0){const fe=`\x1B[33m${Y.message}\x1B[0m\r
|
|
25
|
+
`;vt.current!==void 0?vt.current.write(fe):un.current.push(fe)}break;case"run-status":R(Y.running);break;case"command-display":j(Y.command);break;case"command-options":u(Y.options),h(Y.defaultCwd);break;case"services":{Q(Y.services),K(Y.selectedPort),Ee(fe=>{const Fe=[...fe];let mt;for(const Nt of Y.services)Fe.find(Vp=>Vp.port===Nt.port)===void 0&&(Fe.push({port:Nt.port,url:Nt.url,history:[Nt.url],historyIndex:0}),mt=Nt.port);return mt!==void 0&&_e(`svc-${mt}`),Fe});break}case"icons":ee(Y.icons),ue(Y.port),be(Y.generation),Jr(Y.icons,re,Y.port)&&Ae(void 0),Jr(Y.icons,Ke,Y.port)&&Ge(void 0);break;case"scrape":le(Y.hasIcon);break;case"form":{O(t!==null?Fe=>Fe:Y.values),Z(Y.defaults),g(Y.targetDirExists),tt.current||(tt.current=!0,ye(Y.values.iconBackground),ne(Y.values.iconScale));break}case"materialize-step":$t(Y.step),xt(fe=>[...fe,`[${Y.step}] ${Y.message}`]);break;case"materialize-log":xt(fe=>[...fe,Y.message]);break;case"success":Et({projectDir:Y.projectDir,...Y.bundlePath===void 0?{}:{bundlePath:Y.bundlePath},pinHint:Y.pinHint}),window.dispatchEvent(new Event("create-opentray:apps-changed"));break}},()=>z.close()},[]);const Al=d.useRef(void 0);d.useEffect(()=>{Al.current=L},[L]);const ml=d.useRef(!1);d.useEffect(()=>{ml.current=Je},[Je]);const Es=re===void 0?void 0:Number.parseInt(re.split(":")[1]??"",10),Tp=ge!==void 0?lp(ge.key):Le!==void 0?Le:U!==void 0&&Es!==void 0&&X.some(z=>z.index===Es)?Dn(U,Es,se):U!==void 0&&X!==void 0&&X[0]!==void 0&&re===void 0?Dn(U,X[0].index,se):void 0,Np=ge!==void 0?`合成 ${ge.background==="transparent"?"透明底":ge.background==="black"?"黑底":"白底"}`:Le!==void 0?"本地图片":X[0]!==void 0?`${X[0].width}×${X[0].height} ${X[0].format.toUpperCase()}`:"首字母图标",xl=(()=>{if(ut!==void 0)return ut;const z=M.trayIconPath.trim();if(z.length>0&&U!==void 0){const Y=X.find(fe=>fe.path===z);if(Y!==void 0)return Dn(U,Y.index,se)}const pe=/^([^:]+):(\d+)$/.exec(Ke??"");if(pe!==null){const Y=Number(pe[1]),fe=Number(pe[2]);if(Number.isInteger(Y)&&Number.isInteger(fe))return Dn(Y,fe,se)}z.length})(),_p=ut!==void 0?"本地图片":xl!==void 0?"跟随源图":"跟随应用图标";d.useEffect(()=>{const z=o.trim();if(z.length===0)return;const pe=window.setTimeout(()=>{Ne("/api/prime",{command:z})},400);return()=>window.clearTimeout(pe)},[o]);const Op=async()=>{const z=o.trim();if(!(c.argsMode==="string"&&z.length===0)){if(m(!0),_e("terminal"),vt.current?.reset(),Ee([]),Q([]),le(!1),ee([]),ue(void 0),Ae(void 0),ht(void 0),Ge(void 0),Re(void 0),c.argsMode==="array"){if(i.length===0||(i[0]??"").trim().length===0)return;await Ne("/api/command",{argv:i});return}await Ne("/api/command",{command:z})}},Hp=z=>{if(nt.find(Y=>Y.port===z)===void 0){Ne("/api/select-service",{port:z});return}Ne("/api/select-service",{port:z}),_e(`svc-${z}`)},Lp=(z,pe,Y)=>{Ee(fe=>fe.map(Fe=>{if(Fe.port!==z)return Fe;if(Y==="replace")return{...Fe,url:pe};const mt=[...Fe.history.slice(0,Fe.historyIndex+1),pe];return{...Fe,url:pe,history:mt,historyIndex:mt.length-1}}))},Kp=(z,pe)=>{Ee(Y=>Y.map(fe=>{if(fe.port!==z)return fe;const Fe=fe.historyIndex+pe;return Fe<0||Fe>=fe.history.length?fe:{...fe,historyIndex:Fe,url:fe.history[Fe]}}))},[Wp,Ss]=d.useState(),Qp=async()=>{dl.flush(),fl.flush(),At("confirm"),rt(!0);try{const z=await Ne("/api/confirm",{});if(!z.ok){const pe=await z.json().catch(()=>({}));Ss(pe.error??`确认失败(${z.status})`);return}Ss(void 0)}catch{Ss("确认请求失败")}};d.useEffect(()=>{E==="frozen"&&Pt({...En.current,...M})},[E]);const Gp=async()=>{await Ne("/api/create",{})},[zp,bl]=d.useState(!1),Yp=z=>Jx(z),Rs=async()=>{rt(!1),(await Ne("/api/cancel",{})).ok||k(pe=>pe==="frozen"?"discovered":pe)},Up=p?"minmax(0, 520px) minmax(0, 1fr) minmax(0, 0fr)":"minmax(0, 1fr) minmax(0, var(--list-w)) minmax(0, 1fr)";return l.jsxs("div",{className:"grid h-full w-full overflow-hidden",style:{"--list-w":"min(520px, 100vw - 40px)",gridTemplateColumns:Up,transition:"grid-template-columns 450ms cubic-bezier(0.4, 0, 0.2, 1)"},children:[l.jsxs("div",{className:"flex w-full flex-col gap-4 overflow-y-auto p-5 pr-2 max-md:min-h-full "+(p?"md:border-r md:border-border":""),style:{gridColumn:p?"1":"2",gridRow:"1",transition:"border-color 450ms",scrollbarGutter:"stable"},children:[l.jsx("div",{className:"flex items-center justify-center",children:l.jsxs("div",{className:"inline-flex rounded-lg border border-border bg-card p-0.5 text-xs",children:[l.jsx("button",{type:"button",className:"rounded-md px-3 py-1.5 transition-colors "+(v===void 0&&!y?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),disabled:E==="materializing"||E==="success",onClick:()=>{C(!1),v!==void 0&&(w(""),b(void 0),Ee([]),m(!1),Ne("/api/url",{url:"",exit:!0}))},children:"启动命令"}),l.jsx("button",{type:"button",className:"rounded-md px-3 py-1.5 transition-colors "+(v!==void 0||y?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),disabled:E==="materializing"||E==="success",onClick:()=>C(!0),children:"网页地址"})]})}),v!==void 0||y?l.jsx(pI,{value:I,onChange:w,activeSource:v,frozen:E==="materializing"||E==="frozen"||E==="success",loading:!1,failedReason:E==="failed"?B:void 0,onSubmit:z=>{Ne("/api/url",{url:z}).then(pe=>{pe.ok&&(b(z),Ee([{port:0,url:z,history:[z],historyIndex:0}]),m(!0),_e("svc-0"))})}}):l.jsx(l.Fragment,{children:l.jsx(fI,{command:o,onCommandChange:s,argv:i,onArgvChange:z=>a([...z]),runAlive:S,frozen:E==="materializing"||E==="frozen"||E==="success",failedReason:E==="failed"?B:void 0,commandOptions:c,defaultCwd:f,onCommandOptionsChange:z=>{u(z),Ne("/api/command-options",{cwd:z.cwd,env:z.env,argsMode:z.argsMode,family:z.family})},onRun:()=>{Op()},onStop:()=>{Ne("/api/stop",{})}})}),l.jsx(OC,{frozen:E==="frozen"||E==="materializing"||E==="success",values:M,defaults:G,candidates:X,candidatesPort:U,candidatesGeneration:se,selectedIconRef:re,uploadedIconUrl:Le,iconAnalysis:ie,iconComposition:ge,iconComposeError:ce,iconBackground:V,iconScale:q,subjectExtracting:Rp,subjectStage:Dp,subjectSettings:ys,onSubjectSettingsChange:Bp,onIconBackgroundChange:Mp,onIconScaleChange:jp,selectedTrayRef:Ke,uploadedTrayUrl:ut,selectedPort:$,targetDirExists:A,onPickIconCandidate:z=>{U!==void 0&&(Ae(`${U}:${z.index}`),ht(void 0),Ln.current=se,Ne("/api/icon-select",{port:U,index:z.index}))},onUploadIcon:z=>{const pe=URL.createObjectURL(z);ht(pe),Ae(void 0),z.arrayBuffer().then(Y=>{fetch("/api/icon-upload",{method:"POST",headers:{"content-type":z.type||"application/octet-stream",authorization:`Bearer ${new URLSearchParams(location.search).get("token")??""}`},body:Y}).then(fe=>fe.json()).then(({path:fe})=>{fe===void 0||fe.length===0||(O(Fe=>({...Fe,iconPath:fe})),Ne("/api/form",{iconPath:fe}))}).catch(()=>{})})},onClearIcon:()=>{Ae(void 0),ht(void 0),O(z=>({...z,iconPath:""})),Ne("/api/form",{iconPath:""})},onPickTray:z=>{U!==void 0&&(Ge(`${U}:${z.index}`),Re(void 0),Ln.current=se,Ne("/api/tray-icon-select",{port:U,index:z.index}))},onUploadTray:z=>{const pe=URL.createObjectURL(z);Re(pe),Ge(void 0),z.arrayBuffer().then(Y=>{fetch("/api/icon-upload",{method:"POST",headers:{"content-type":z.type||"application/octet-stream",authorization:`Bearer ${new URLSearchParams(location.search).get("token")??""}`},body:Y}).then(fe=>fe.json()).then(({path:fe})=>{fe===void 0||fe.length===0||(O(Fe=>({...Fe,trayIconPath:fe})),Ne("/api/form",{trayIconPath:fe}))}).catch(()=>{})})},onClearTray:()=>{Ge(void 0),Re(void 0),O(z=>({...z,trayIconPath:""})),Ne("/api/form",{trayIconPath:""})},onPatch:z=>{O(pe=>({...pe,...z})),Ne("/api/form",z)},onConfirm:()=>{Qp()}})]}),l.jsx("div",{className:"flex min-h-0 min-w-0 flex-col gap-4 overflow-y-auto p-4 pr-1 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?l.jsxs(l.Fragment,{children:[l.jsx(wI,{command:F,terminalHostRef:Tt,terminalReady:_,interactive:D,status:Ve,services:v!==void 0?[{port:0,url:v,firstSeenAt:0,title:Fi(v)}]:[...J],hideTerminal:v!==void 0,iframeTabs:nt,activeTab:Ue,onActiveTabChange:_e,onIframeNavigate:Lp,onIframeHistoryMove:Kp,onJumpToService:Hp,className:"min-h-[480px] flex-1"}),L!==void 0?l.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:L}):null]}):null}),l.jsx(hI,{open:Je,onOpenChange:z=>{if(z){rt(!0);return}if(it==="confirm"){Rs();return}rt(!1)},phase:it,frozenValues:St,iconSrc:Tp,iconLabel:Np,traySrc:xl,trayLabel:_p,selectedPort:$,currentStep:Mt,logs:dt,error:Be??B,result:bt,onBack:()=>{Rs()},onCreate:()=>{Gp()},onShare:()=>bl(!0),onOpenApp:()=>{Ne("/api/open-app",{})},confirmError:Wp,onClose:()=>{if(it==="confirm"){Rs();return}rt(!1)}}),l.jsx(Rf,{open:zp,subtitle:St?.appId??F,hasEnv:c.env.some(z=>z.key.trim().length>0),share:!0,runner:Yp,onClose:()=>bl(!1)})]})}function jI(){const{route:e}=hf();return l.jsxs(l.Fragment,{children:[l.jsx("div",{hidden:e!=="add",className:"min-h-0 flex-1",children:l.jsx(BI,{})}),l.jsx("div",{hidden:e!=="applications",className:"min-h-0 flex-1",children:l.jsx(Kb,{})}),l.jsx("div",{hidden:e!=="help",className:"min-h-0 flex-1",children:l.jsx(U1,{})})]})}const Jn={open:!1,listeners:new Set,set(e){if(this.open!==e){this.open=e;for(const t of this.listeners)t()}},subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}},MI=()=>{const[e,t]=d.useState(Jn.open);return d.useEffect(()=>Jn.subscribe(()=>t(Jn.open)),[]),e};function PI(){return l.jsx(Kx,{panelOpen:MI(),children:l.jsx(jI,{})})}const Qo=_x();wi(Qo.locale,Qo.theme);Xp.createRoot(document.getElementById("root")).render(l.jsx(qp.StrictMode,{children:l.jsx(Ox,{initialLocale:Qo.locale,initialTheme:Qo.theme,children:l.jsx(PI,{})})}));
|