@olonjs/core 1.0.101 → 1.0.102
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/olonjs-core.js +16958 -6472
- package/dist/olonjs-core.umd.cjs +67 -50
- package/package.json +11 -10
package/dist/olonjs-core.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(ce,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("react-router-dom"),require("zod"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-router-dom","zod","react-dom"],g):(ce=typeof globalThis<"u"?globalThis:ce||self,g(ce.OlonJsCore={},ce.React,ce.ReactRouterDOM,ce.z,ce.ReactDOM))})(this,(function(ce,g,Je,Pe,vt){"use strict";function zi(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const b=zi(g),Kr=zi(vt);function Pi(e,t){return t.header!=null&&e["global-header"]!==!1}const ye={UPDATE_DRAFTS:"jsonpages:update-drafts",SYNC_SELECTION:"jsonpages:sync-selection",SECTION_SELECT:"jsonpages:section-select",INLINE_FIELD_UPDATE:"jsonpages:inline-field-update",INLINE_FLUSHED:"jsonpages:inline-flushed",REQUEST_SCROLL_TO_SECTION:"jsonpages:request-scroll-to-section",REQUEST_INLINE_FLUSH:"jsonpages:request-inline-flush",ACTIVE_SECTION_CHANGED:"jsonpages:active-section-changed",STAGE_READY:"jsonpages:stage-ready",WEBMCP_TOOL_CALL:"olonjs:webmcp:tool-call",WEBMCP_TOOL_RESULT:"olonjs:webmcp:tool-result"};function Oi(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=Oi(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Mc(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Oi(e))&&(n&&(n+=" "),n+=t);return n}const Rc=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},Lc=(e,t)=>({classGroupId:e,validator:t}),Ii=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Gr="-",Di=[],$c="arbitrary..",Fc=e=>{const t=Uc(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Wc(s);const a=s.split(Gr),l=a[0]===""&&a.length>1?1:0;return _i(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=n[s],d=r[s];return l?d?Rc(d,l):l:d||Di}return r[s]||Di}}},_i=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],i=r.nextPart.get(o);if(i){const d=_i(e,t+1,i);if(d)return d}const s=r.validators;if(s===null)return;const a=t===0?e.join(Gr):e.slice(t).join(Gr),l=s.length;for(let d=0;d<l;d++){const u=s[d];if(u.validator(a))return u.classGroupId}},Wc=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?$c+n:void 0})(),Uc=e=>{const{theme:t,classGroups:r}=e;return Bc(r,t)},Bc=(e,t)=>{const r=Ii();for(const n in e){const o=e[n];oo(o,r,n,t)}return r},oo=(e,t,r,n)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];Hc(s,t,r,n)}},Hc=(e,t,r,n)=>{if(typeof e=="string"){Vc(e,t,r);return}if(typeof e=="function"){Kc(e,t,r,n);return}Gc(e,t,r,n)},Vc=(e,t,r)=>{const n=e===""?t:Mi(t,e);n.classGroupId=r},Kc=(e,t,r,n)=>{if(Yc(e)){oo(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Lc(r,e))},Gc=(e,t,r,n)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];oo(l,Mi(t,a),r,n)}},Mi=(e,t)=>{let r=e;const n=t.split(Gr),o=n.length;for(let i=0;i<o;i++){const s=n[i];let a=r.nextPart.get(s);a||(a=Ii(),r.nextPart.set(s,a)),r=a}return r},Yc=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,qc=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(i,s)=>{r[i]=s,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(i){let s=r[i];if(s!==void 0)return s;if((s=n[i])!==void 0)return o(i,s),s},set(i,s){i in r?r[i]=s:o(i,s)}}},io="!",Ri=":",Xc=[],Li=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),Jc=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const i=[];let s=0,a=0,l=0,d;const u=o.length;for(let m=0;m<u;m++){const v=o[m];if(s===0&&a===0){if(v===Ri){i.push(o.slice(l,m)),l=m+1;continue}if(v==="/"){d=m;continue}}v==="["?s++:v==="]"?s--:v==="("?a++:v===")"&&a--}const f=i.length===0?o:o.slice(l);let h=f,p=!1;f.endsWith(io)?(h=f.slice(0,-1),p=!0):f.startsWith(io)&&(h=f.slice(1),p=!0);const w=d&&d>l?d-l:void 0;return Li(i,p,h,w)};if(t){const o=t+Ri,i=n;n=s=>s.startsWith(o)?i(s.slice(o.length)):Li(Xc,!1,s,void 0,!0)}if(r){const o=n;n=i=>r({className:i,parseClassName:o})}return n},Zc=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let o=[];for(let i=0;i<r.length;i++){const s=r[i],a=s[0]==="[",l=t.has(s);a||l?(o.length>0&&(o.sort(),n.push(...o),o=[]),n.push(s)):o.push(s)}return o.length>0&&(o.sort(),n.push(...o)),n}},Qc=e=>({cache:qc(e.cacheSize),parseClassName:Jc(e),sortModifiers:Zc(e),...Fc(e)}),ed=/\s+/,td=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(ed);let l="";for(let d=a.length-1;d>=0;d-=1){const u=a[d],{isExternal:f,modifiers:h,hasImportantModifier:p,baseClassName:w,maybePostfixModifierPosition:m}=r(u);if(f){l=u+(l.length>0?" "+l:l);continue}let v=!!m,y=n(v?w.substring(0,m):w);if(!y){if(!v){l=u+(l.length>0?" "+l:l);continue}if(y=n(w),!y){l=u+(l.length>0?" "+l:l);continue}v=!1}const k=h.length===0?"":h.length===1?h[0]:i(h).join(":"),x=p?k+io:k,S=x+y;if(s.indexOf(S)>-1)continue;s.push(S);const C=o(y,v);for(let E=0;E<C.length;++E){const N=C[E];s.push(x+N)}l=u+(l.length>0?" "+l:l)}return l},rd=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=$i(r))&&(o&&(o+=" "),o+=n);return o},$i=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=$i(e[n]))&&(r&&(r+=" "),r+=t);return r},nd=(e,...t)=>{let r,n,o,i;const s=l=>{const d=t.reduce((u,f)=>f(u),e());return r=Qc(d),n=r.cache.get,o=r.cache.set,i=a,a(l)},a=l=>{const d=n(l);if(d)return d;const u=td(l,r);return o(l,u),u};return i=s,(...l)=>i(rd(...l))},od=[],Oe=e=>{const t=r=>r[e]||od;return t.isThemeGetter=!0,t},Fi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Wi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,id=/^\d+\/\d+$/,sd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ad=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ld=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,cd=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Lt=e=>id.test(e),de=e=>!!e&&!Number.isNaN(Number(e)),xt=e=>!!e&&Number.isInteger(Number(e)),so=e=>e.endsWith("%")&&de(e.slice(0,-1)),pt=e=>sd.test(e),ud=()=>!0,fd=e=>ad.test(e)&&!ld.test(e),Ui=()=>!1,pd=e=>cd.test(e),hd=e=>dd.test(e),md=e=>!H(e)&&!V(e),gd=e=>$t(e,Gi,Ui),H=e=>Fi.test(e),zt=e=>$t(e,Yi,fd),ao=e=>$t(e,yd,de),Bi=e=>$t(e,Vi,Ui),bd=e=>$t(e,Ki,hd),Yr=e=>$t(e,qi,pd),V=e=>Wi.test(e),ur=e=>Ft(e,Yi),vd=e=>Ft(e,kd),Hi=e=>Ft(e,Vi),xd=e=>Ft(e,Gi),wd=e=>Ft(e,Ki),qr=e=>Ft(e,qi,!0),$t=(e,t,r)=>{const n=Fi.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Ft=(e,t,r=!1)=>{const n=Wi.exec(e);return n?n[1]?t(n[1]):r:!1},Vi=e=>e==="position"||e==="percentage",Ki=e=>e==="image"||e==="url",Gi=e=>e==="length"||e==="size"||e==="bg-size",Yi=e=>e==="length",yd=e=>e==="number",kd=e=>e==="family-name",qi=e=>e==="shadow",Sd=nd(()=>{const e=Oe("color"),t=Oe("font"),r=Oe("text"),n=Oe("font-weight"),o=Oe("tracking"),i=Oe("leading"),s=Oe("breakpoint"),a=Oe("container"),l=Oe("spacing"),d=Oe("radius"),u=Oe("shadow"),f=Oe("inset-shadow"),h=Oe("text-shadow"),p=Oe("drop-shadow"),w=Oe("blur"),m=Oe("perspective"),v=Oe("aspect"),y=Oe("ease"),k=Oe("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...S(),V,H],E=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],j=()=>[V,H,l],D=()=>[Lt,"full","auto",...j()],M=()=>[xt,"none","subgrid",V,H],I=()=>["auto",{span:["full",xt,V,H]},xt,V,H],R=()=>[xt,"auto",V,H],L=()=>["auto","min","max","fr",V,H],K=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],B=()=>["start","end","center","stretch","center-safe","end-safe"],W=()=>["auto",...j()],U=()=>[Lt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],A=()=>[e,V,H],J=()=>[...S(),Hi,Bi,{position:[V,H]}],oe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],T=()=>["auto","cover","contain",xd,gd,{size:[V,H]}],F=()=>[so,ur,zt],X=()=>["","none","full",d,V,H],G=()=>["",de,ur,zt],ve=()=>["solid","dashed","dotted","double"],le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],P=()=>[de,so,Hi,Bi],Q=()=>["","none",w,V,H],ee=()=>["none",de,V,H],$=()=>["none",de,V,H],ie=()=>[de,V,H],te=()=>[Lt,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[pt],breakpoint:[pt],color:[ud],container:[pt],"drop-shadow":[pt],ease:["in","out","in-out"],font:[md],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[pt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[pt],shadow:[pt],spacing:["px",de],text:[pt],"text-shadow":[pt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Lt,H,V,v]}],container:["container"],columns:[{columns:[de,H,V,a]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{start:D()}],end:[{end:D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[xt,"auto",V,H]}],basis:[{basis:[Lt,"full","auto",a,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[de,Lt,"auto","initial","none",H]}],grow:[{grow:["",de,V,H]}],shrink:[{shrink:["",de,V,H]}],order:[{order:[xt,"first","last","none",V,H]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...K(),"normal"]}],"justify-items":[{"justify-items":[...B(),"normal"]}],"justify-self":[{"justify-self":["auto",...B()]}],"align-content":[{content:["normal",...K()]}],"align-items":[{items:[...B(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...B(),{baseline:["","last"]}]}],"place-content":[{"place-content":K()}],"place-items":[{"place-items":[...B(),"baseline"]}],"place-self":[{"place-self":["auto",...B()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:W()}],mx:[{mx:W()}],my:[{my:W()}],ms:[{ms:W()}],me:[{me:W()}],mt:[{mt:W()}],mr:[{mr:W()}],mb:[{mb:W()}],ml:[{ml:W()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:U()}],w:[{w:[a,"screen",...U()]}],"min-w":[{"min-w":[a,"screen","none",...U()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...U()]}],h:[{h:["screen","lh",...U()]}],"min-h":[{"min-h":["screen","lh","none",...U()]}],"max-h":[{"max-h":["screen","lh",...U()]}],"font-size":[{text:["base",r,ur,zt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,V,ao]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",so,H]}],"font-family":[{font:[vd,H,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,V,H]}],"line-clamp":[{"line-clamp":[de,"none",V,ao]}],leading:[{leading:[i,...j()]}],"list-image":[{"list-image":["none",V,H]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",V,H]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ve(),"wavy"]}],"text-decoration-thickness":[{decoration:[de,"from-font","auto",V,zt]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[de,"auto",V,H]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",V,H]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",V,H]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:J()}],"bg-repeat":[{bg:oe()}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xt,V,H],radial:["",V,H],conic:[xt,V,H]},wd,bd]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:G()}],"border-w-x":[{"border-x":G()}],"border-w-y":[{"border-y":G()}],"border-w-s":[{"border-s":G()}],"border-w-e":[{"border-e":G()}],"border-w-t":[{"border-t":G()}],"border-w-r":[{"border-r":G()}],"border-w-b":[{"border-b":G()}],"border-w-l":[{"border-l":G()}],"divide-x":[{"divide-x":G()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":G()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ve(),"hidden","none"]}],"divide-style":[{divide:[...ve(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...ve(),"none","hidden"]}],"outline-offset":[{"outline-offset":[de,V,H]}],"outline-w":[{outline:["",de,ur,zt]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",u,qr,Yr]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",f,qr,Yr]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[de,zt]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":G()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",h,qr,Yr]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[de,V,H]}],"mix-blend":[{"mix-blend":[...le(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":le()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[de]}],"mask-image-linear-from-pos":[{"mask-linear-from":P()}],"mask-image-linear-to-pos":[{"mask-linear-to":P()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":P()}],"mask-image-t-to-pos":[{"mask-t-to":P()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":P()}],"mask-image-r-to-pos":[{"mask-r-to":P()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":P()}],"mask-image-b-to-pos":[{"mask-b-to":P()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":P()}],"mask-image-l-to-pos":[{"mask-l-to":P()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":P()}],"mask-image-x-to-pos":[{"mask-x-to":P()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":P()}],"mask-image-y-to-pos":[{"mask-y-to":P()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[V,H]}],"mask-image-radial-from-pos":[{"mask-radial-from":P()}],"mask-image-radial-to-pos":[{"mask-radial-to":P()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[de]}],"mask-image-conic-from-pos":[{"mask-conic-from":P()}],"mask-image-conic-to-pos":[{"mask-conic-to":P()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:J()}],"mask-repeat":[{mask:oe()}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",V,H]}],filter:[{filter:["","none",V,H]}],blur:[{blur:Q()}],brightness:[{brightness:[de,V,H]}],contrast:[{contrast:[de,V,H]}],"drop-shadow":[{"drop-shadow":["","none",p,qr,Yr]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",de,V,H]}],"hue-rotate":[{"hue-rotate":[de,V,H]}],invert:[{invert:["",de,V,H]}],saturate:[{saturate:[de,V,H]}],sepia:[{sepia:["",de,V,H]}],"backdrop-filter":[{"backdrop-filter":["","none",V,H]}],"backdrop-blur":[{"backdrop-blur":Q()}],"backdrop-brightness":[{"backdrop-brightness":[de,V,H]}],"backdrop-contrast":[{"backdrop-contrast":[de,V,H]}],"backdrop-grayscale":[{"backdrop-grayscale":["",de,V,H]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[de,V,H]}],"backdrop-invert":[{"backdrop-invert":["",de,V,H]}],"backdrop-opacity":[{"backdrop-opacity":[de,V,H]}],"backdrop-saturate":[{"backdrop-saturate":[de,V,H]}],"backdrop-sepia":[{"backdrop-sepia":["",de,V,H]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",V,H]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[de,"initial",V,H]}],ease:[{ease:["linear","initial",y,V,H]}],delay:[{delay:[de,V,H]}],animate:[{animate:["none",k,V,H]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,V,H]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:ee()}],"rotate-x":[{"rotate-x":ee()}],"rotate-y":[{"rotate-y":ee()}],"rotate-z":[{"rotate-z":ee()}],scale:[{scale:$()}],"scale-x":[{"scale-x":$()}],"scale-y":[{"scale-y":$()}],"scale-z":[{"scale-z":$()}],"scale-3d":["scale-3d"],skew:[{skew:ie()}],"skew-x":[{"skew-x":ie()}],"skew-y":[{"skew-y":ie()}],transform:[{transform:[V,H,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:te()}],"translate-x":[{"translate-x":te()}],"translate-y":[{"translate-y":te()}],"translate-z":[{"translate-z":te()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",V,H]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",V,H]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[de,ur,zt,ao]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function se(...e){return Sd(Mc(e))}var Xr={exports:{}},fr={};/**
|
|
1
|
+
(function(Le,z){typeof exports=="object"&&typeof module<"u"?z(exports,require("react"),require("react-router-dom"),require("zod"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-router-dom","zod","react-dom"],z):(Le=typeof globalThis<"u"?globalThis:Le||self,z(Le.OlonJsCore={},Le.React,Le.ReactRouterDOM,Le.z,Le.ReactDOM))})(this,(function(Le,z,Ze,lt,Bt){"use strict";var HE=Object.defineProperty;var Rm=Le=>{throw TypeError(Le)};var VE=(Le,z,Ze)=>z in Le?HE(Le,z,{enumerable:!0,configurable:!0,writable:!0,value:Ze}):Le[z]=Ze;var Ne=(Le,z,Ze)=>VE(Le,typeof z!="symbol"?z+"":z,Ze),Hc=(Le,z,Ze)=>z.has(Le)||Rm("Cannot "+Ze);var Z=(Le,z,Ze)=>(Hc(Le,z,"read from private field"),Ze?Ze.call(Le):z.get(Le)),Xe=(Le,z,Ze)=>z.has(Le)?Rm("Cannot add the same private member more than once"):z instanceof WeakSet?z.add(Le):z.set(Le,Ze),Ve=(Le,z,Ze,lt)=>(Hc(Le,z,"write to private field"),lt?lt.call(Le,Ze):z.set(Le,Ze),Ze),ze=(Le,z,Ze)=>(Hc(Le,z,"access private method"),Ze);var ss=(Le,z,Ze,lt)=>({set _(Bt){Ve(Le,z,Bt,Ze)},get _(){return Z(Le,z,lt)}});function Qc(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const q=Qc(z),ho=Qc(Bt);function Xc(e,t){return t.header!=null&&e["global-header"]!==!1}const it={UPDATE_DRAFTS:"jsonpages:update-drafts",SYNC_SELECTION:"jsonpages:sync-selection",SECTION_SELECT:"jsonpages:section-select",INLINE_FIELD_UPDATE:"jsonpages:inline-field-update",INLINE_FLUSHED:"jsonpages:inline-flushed",REQUEST_SCROLL_TO_SECTION:"jsonpages:request-scroll-to-section",REQUEST_INLINE_FLUSH:"jsonpages:request-inline-flush",ACTIVE_SECTION_CHANGED:"jsonpages:active-section-changed",STAGE_READY:"jsonpages:stage-ready",WEBMCP_TOOL_CALL:"olonjs:webmcp:tool-call",WEBMCP_TOOL_RESULT:"olonjs:webmcp:tool-result"};function Zc(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Zc(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Hm(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Zc(e))&&(n&&(n+=" "),n+=t);return n}const Vm=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},Km=(e,t)=>({classGroupId:e,validator:t}),eu=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),po="-",tu=[],Gm="arbitrary..",Ym=e=>{const t=Qm(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Jm(i);const a=i.split(po),l=a[0]===""&&a.length>1?1:0;return ru(a,l,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const l=n[i],c=r[i];return l?c?Vm(c,l):l:c||tu}return r[i]||tu}}},ru=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],o=r.nextPart.get(s);if(o){const c=ru(e,t+1,o);if(c)return c}const i=r.validators;if(i===null)return;const a=t===0?e.join(po):e.slice(t).join(po),l=i.length;for(let c=0;c<l;c++){const u=i[c];if(u.validator(a))return u.classGroupId}},Jm=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?Gm+n:void 0})(),Qm=e=>{const{theme:t,classGroups:r}=e;return Xm(r,t)},Xm=(e,t)=>{const r=eu();for(const n in e){const s=e[n];cs(s,r,n,t)}return r},cs=(e,t,r,n)=>{const s=e.length;for(let o=0;o<s;o++){const i=e[o];Zm(i,t,r,n)}},Zm=(e,t,r,n)=>{if(typeof e=="string"){eb(e,t,r);return}if(typeof e=="function"){tb(e,t,r,n);return}rb(e,t,r,n)},eb=(e,t,r)=>{const n=e===""?t:nu(t,e);n.classGroupId=r},tb=(e,t,r,n)=>{if(nb(e)){cs(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Km(r,e))},rb=(e,t,r,n)=>{const s=Object.entries(e),o=s.length;for(let i=0;i<o;i++){const[a,l]=s[i];cs(l,nu(t,a),r,n)}},nu=(e,t)=>{let r=e;const n=t.split(po),s=n.length;for(let o=0;o<s;o++){const i=n[o];let a=r.nextPart.get(i);a||(a=eu(),r.nextPart.set(i,a)),r=a}return r},nb=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,ob=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const s=(o,i)=>{r[o]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(o){let i=r[o];if(i!==void 0)return i;if((i=n[o])!==void 0)return s(o,i),i},set(o,i){o in r?r[o]=i:s(o,i)}}},us="!",ou=":",ib=[],iu=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),sb=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=s=>{const o=[];let i=0,a=0,l=0,c;const u=s.length;for(let m=0;m<u;m++){const b=s[m];if(i===0&&a===0){if(b===ou){o.push(s.slice(l,m)),l=m+1;continue}if(b==="/"){c=m;continue}}b==="["?i++:b==="]"?i--:b==="("?a++:b===")"&&a--}const d=o.length===0?s:s.slice(l);let f=d,h=!1;d.endsWith(us)?(f=d.slice(0,-1),h=!0):d.startsWith(us)&&(f=d.slice(1),h=!0);const y=c&&c>l?c-l:void 0;return iu(o,h,f,y)};if(t){const s=t+ou,o=n;n=i=>i.startsWith(s)?o(i.slice(s.length)):iu(ib,!1,i,void 0,!0)}if(r){const s=n;n=o=>r({className:o,parseClassName:s})}return n},ab=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let s=[];for(let o=0;o<r.length;o++){const i=r[o],a=i[0]==="[",l=t.has(i);a||l?(s.length>0&&(s.sort(),n.push(...s),s=[]),n.push(i)):s.push(i)}return s.length>0&&(s.sort(),n.push(...s)),n}},lb=e=>({cache:ob(e.cacheSize),parseClassName:sb(e),sortModifiers:ab(e),...Ym(e)}),cb=/\s+/,ub=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:o}=t,i=[],a=e.trim().split(cb);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:d,modifiers:f,hasImportantModifier:h,baseClassName:y,maybePostfixModifierPosition:m}=r(u);if(d){l=u+(l.length>0?" "+l:l);continue}let b=!!m,S=n(b?y.substring(0,m):y);if(!S){if(!b){l=u+(l.length>0?" "+l:l);continue}if(S=n(y),!S){l=u+(l.length>0?" "+l:l);continue}b=!1}const g=f.length===0?"":f.length===1?f[0]:o(f).join(":"),w=h?g+us:g,_=w+S;if(i.indexOf(_)>-1)continue;i.push(_);const x=s(S,b);for(let I=0;I<x.length;++I){const C=x[I];i.push(w+C)}l=u+(l.length>0?" "+l:l)}return l},db=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=su(r))&&(s&&(s+=" "),s+=n);return s},su=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=su(e[n]))&&(r&&(r+=" "),r+=t);return r},fb=(e,...t)=>{let r,n,s,o;const i=l=>{const c=t.reduce((u,d)=>d(u),e());return r=lb(c),n=r.cache.get,s=r.cache.set,o=a,a(l)},a=l=>{const c=n(l);if(c)return c;const u=ub(l,r);return s(l,u),u};return o=i,(...l)=>o(db(...l))},hb=[],gt=e=>{const t=r=>r[e]||hb;return t.isThemeGetter=!0,t},au=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,lu=/^\((?:(\w[\w-]*):)?(.+)\)$/i,pb=/^\d+\/\d+$/,gb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,mb=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,bb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,yb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Hr=e=>pb.test(e),Je=e=>!!e&&!Number.isNaN(Number(e)),cr=e=>!!e&&Number.isInteger(Number(e)),ds=e=>e.endsWith("%")&&Je(e.slice(0,-1)),Yt=e=>gb.test(e),wb=()=>!0,xb=e=>mb.test(e)&&!bb.test(e),cu=()=>!1,_b=e=>yb.test(e),Sb=e=>vb.test(e),Eb=e=>!Be(e)&&!Ue(e),kb=e=>Vr(e,pu,cu),Be=e=>au.test(e),Ir=e=>Vr(e,gu,xb),fs=e=>Vr(e,jb,Je),uu=e=>Vr(e,fu,cu),Ab=e=>Vr(e,hu,Sb),go=e=>Vr(e,mu,_b),Ue=e=>lu.test(e),En=e=>Kr(e,gu),Cb=e=>Kr(e,Ob),du=e=>Kr(e,fu),Ib=e=>Kr(e,pu),Tb=e=>Kr(e,hu),mo=e=>Kr(e,mu,!0),Vr=(e,t,r)=>{const n=au.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Kr=(e,t,r=!1)=>{const n=lu.exec(e);return n?n[1]?t(n[1]):r:!1},fu=e=>e==="position"||e==="percentage",hu=e=>e==="image"||e==="url",pu=e=>e==="length"||e==="size"||e==="bg-size",gu=e=>e==="length",jb=e=>e==="number",Ob=e=>e==="family-name",mu=e=>e==="shadow",Pb=fb(()=>{const e=gt("color"),t=gt("font"),r=gt("text"),n=gt("font-weight"),s=gt("tracking"),o=gt("leading"),i=gt("breakpoint"),a=gt("container"),l=gt("spacing"),c=gt("radius"),u=gt("shadow"),d=gt("inset-shadow"),f=gt("text-shadow"),h=gt("drop-shadow"),y=gt("blur"),m=gt("perspective"),b=gt("aspect"),S=gt("ease"),g=gt("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],x=()=>[..._(),Ue,Be],I=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],A=()=>[Ue,Be,l],O=()=>[Hr,"full","auto",...A()],j=()=>[cr,"none","subgrid",Ue,Be],R=()=>["auto",{span:["full",cr,Ue,Be]},cr,Ue,Be],T=()=>[cr,"auto",Ue,Be],D=()=>["auto","min","max","fr",Ue,Be],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],ae=()=>["auto",...A()],J=()=>[Hr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],M=()=>[e,Ue,Be],ce=()=>[..._(),du,uu,{position:[Ue,Be]}],Q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",Ib,kb,{size:[Ue,Be]}],N=()=>[ds,En,Ir],Y=()=>["","none","full",c,Ue,Be],ue=()=>["",Je,En,Ir],X=()=>["solid","dashed","dotted","double"],we=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],L=()=>[Je,ds,du,uu],W=()=>["","none",y,Ue,Be],le=()=>["none",Je,Ue,Be],$=()=>["none",Je,Ue,Be],ee=()=>[Je,Ue,Be],ne=()=>[Hr,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Yt],breakpoint:[Yt],color:[wb],container:[Yt],"drop-shadow":[Yt],ease:["in","out","in-out"],font:[Eb],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Yt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Yt],shadow:[Yt],spacing:["px",Je],text:[Yt],"text-shadow":[Yt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Hr,Be,Ue,b]}],container:["container"],columns:[{columns:[Je,Be,Ue,a]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:x()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{start:O()}],end:[{end:O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[cr,"auto",Ue,Be]}],basis:[{basis:[Hr,"full","auto",a,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Je,Hr,"auto","initial","none",Be]}],grow:[{grow:["",Je,Ue,Be]}],shrink:[{shrink:["",Je,Ue,Be]}],order:[{order:[cr,"first","last","none",Ue,Be]}],"grid-cols":[{"grid-cols":j()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":j()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":D()}],"auto-rows":[{"auto-rows":D()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:ae()}],mx:[{mx:ae()}],my:[{my:ae()}],ms:[{ms:ae()}],me:[{me:ae()}],mt:[{mt:ae()}],mr:[{mr:ae()}],mb:[{mb:ae()}],ml:[{ml:ae()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],w:[{w:[a,"screen",...J()]}],"min-w":[{"min-w":[a,"screen","none",...J()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",r,En,Ir]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Ue,fs]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ds,Be]}],"font-family":[{font:[Cb,Be,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Ue,Be]}],"line-clamp":[{"line-clamp":[Je,"none",Ue,fs]}],leading:[{leading:[o,...A()]}],"list-image":[{"list-image":["none",Ue,Be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ue,Be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:[Je,"from-font","auto",Ue,Ir]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[Je,"auto",Ue,Be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ue,Be]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ue,Be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ce()}],"bg-repeat":[{bg:Q()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},cr,Ue,Be],radial:["",Ue,Be],conic:[cr,Ue,Be]},Tb,Ab]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:N()}],"gradient-via-pos":[{via:N()}],"gradient-to-pos":[{to:N()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...X(),"hidden","none"]}],"divide-style":[{divide:[...X(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...X(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Je,Ue,Be]}],"outline-w":[{outline:["",Je,En,Ir]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",u,mo,go]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",d,mo,go]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[Je,Ir]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",f,mo,go]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[Je,Ue,Be]}],"mix-blend":[{"mix-blend":[...we(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":we()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Je]}],"mask-image-linear-from-pos":[{"mask-linear-from":L()}],"mask-image-linear-to-pos":[{"mask-linear-to":L()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":L()}],"mask-image-t-to-pos":[{"mask-t-to":L()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":L()}],"mask-image-r-to-pos":[{"mask-r-to":L()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":L()}],"mask-image-b-to-pos":[{"mask-b-to":L()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":L()}],"mask-image-l-to-pos":[{"mask-l-to":L()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":L()}],"mask-image-x-to-pos":[{"mask-x-to":L()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":L()}],"mask-image-y-to-pos":[{"mask-y-to":L()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Ue,Be]}],"mask-image-radial-from-pos":[{"mask-radial-from":L()}],"mask-image-radial-to-pos":[{"mask-radial-to":L()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[Je]}],"mask-image-conic-from-pos":[{"mask-conic-from":L()}],"mask-image-conic-to-pos":[{"mask-conic-to":L()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ce()}],"mask-repeat":[{mask:Q()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ue,Be]}],filter:[{filter:["","none",Ue,Be]}],blur:[{blur:W()}],brightness:[{brightness:[Je,Ue,Be]}],contrast:[{contrast:[Je,Ue,Be]}],"drop-shadow":[{"drop-shadow":["","none",h,mo,go]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",Je,Ue,Be]}],"hue-rotate":[{"hue-rotate":[Je,Ue,Be]}],invert:[{invert:["",Je,Ue,Be]}],saturate:[{saturate:[Je,Ue,Be]}],sepia:[{sepia:["",Je,Ue,Be]}],"backdrop-filter":[{"backdrop-filter":["","none",Ue,Be]}],"backdrop-blur":[{"backdrop-blur":W()}],"backdrop-brightness":[{"backdrop-brightness":[Je,Ue,Be]}],"backdrop-contrast":[{"backdrop-contrast":[Je,Ue,Be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Je,Ue,Be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Je,Ue,Be]}],"backdrop-invert":[{"backdrop-invert":["",Je,Ue,Be]}],"backdrop-opacity":[{"backdrop-opacity":[Je,Ue,Be]}],"backdrop-saturate":[{"backdrop-saturate":[Je,Ue,Be]}],"backdrop-sepia":[{"backdrop-sepia":["",Je,Ue,Be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ue,Be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Je,"initial",Ue,Be]}],ease:[{ease:["linear","initial",S,Ue,Be]}],delay:[{delay:[Je,Ue,Be]}],animate:[{animate:["none",g,Ue,Be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,Ue,Be]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:$()}],"scale-x":[{"scale-x":$()}],"scale-y":[{"scale-y":$()}],"scale-z":[{"scale-z":$()}],"scale-3d":["scale-3d"],skew:[{skew:ee()}],"skew-x":[{"skew-x":ee()}],"skew-y":[{"skew-y":ee()}],transform:[{transform:[Ue,Be,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ne()}],"translate-x":[{"translate-x":ne()}],"translate-y":[{"translate-y":ne()}],"translate-z":[{"translate-z":ne()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ue,Be]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ue,Be]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[Je,En,Ir,fs]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Ke(...e){return Pb(Hm(e))}var bo={exports:{}},kn={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var bu;function Nb(){if(bu)return kn;bu=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,s,o){var i=null;if(o!==void 0&&(i=""+o),s.key!==void 0&&(i=""+s.key),"key"in s){o={};for(var a in s)a!=="key"&&(o[a]=s[a])}else o=s;return s=o.ref,{$$typeof:e,type:n,key:i,ref:s!==void 0?s:null,props:o}}return kn.Fragment=t,kn.jsx=r,kn.jsxs=r,kn}var An={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,213 +14,230 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var yu;function Rb(){return yu||(yu=1,process.env.NODE_ENV!=="production"&&(function(){function e(B){if(B==null)return null;if(typeof B=="function")return B.$$typeof===R?null:B.displayName||B.name||null;if(typeof B=="string")return B;switch(B){case b:return"Fragment";case g:return"Profiler";case S:return"StrictMode";case I:return"Suspense";case C:return"SuspenseList";case j:return"Activity"}if(typeof B=="object")switch(typeof B.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),B.$$typeof){case m:return"Portal";case _:return B.displayName||"Context";case w:return(B._context.displayName||"Context")+".Consumer";case x:var N=B.render;return B=B.displayName,B||(B=N.displayName||N.name||"",B=B!==""?"ForwardRef("+B+")":"ForwardRef"),B;case A:return N=B.displayName||null,N!==null?N:e(B.type)||"Memo";case O:N=B._payload,B=B._init;try{return e(B(N))}catch{}}return null}function t(B){return""+B}function r(B){try{t(B);var N=!1}catch{N=!0}if(N){N=console;var Y=N.error,ue=typeof Symbol=="function"&&Symbol.toStringTag&&B[Symbol.toStringTag]||B.constructor.name||"Object";return Y.call(N,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",ue),t(B)}}function n(B){if(B===b)return"<>";if(typeof B=="object"&&B!==null&&B.$$typeof===O)return"<...>";try{var N=e(B);return N?"<"+N+">":"<...>"}catch{return"<...>"}}function s(){var B=T.A;return B===null?null:B.getOwner()}function o(){return Error("react-stack-top-frame")}function i(B){if(D.call(B,"key")){var N=Object.getOwnPropertyDescriptor(B,"key").get;if(N&&N.isReactWarning)return!1}return B.key!==void 0}function a(B,N){function Y(){ae||(ae=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",N))}Y.isReactWarning=!0,Object.defineProperty(B,"key",{get:Y,configurable:!0})}function l(){var B=e(this.type);return J[B]||(J[B]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),B=this.props.ref,B!==void 0?B:null}function c(B,N,Y,ue,X,we){var L=Y.ref;return B={$$typeof:y,type:B,key:N,props:Y,_owner:ue},(L!==void 0?L:null)!==null?Object.defineProperty(B,"ref",{enumerable:!1,get:l}):Object.defineProperty(B,"ref",{enumerable:!1,value:null}),B._store={},Object.defineProperty(B._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(B,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(B,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.defineProperty(B,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:we}),Object.freeze&&(Object.freeze(B.props),Object.freeze(B)),B}function u(B,N,Y,ue,X,we){var L=N.children;if(L!==void 0)if(ue)if(H(L)){for(ue=0;ue<L.length;ue++)d(L[ue]);Object.freeze&&Object.freeze(L)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(L);if(D.call(N,"key")){L=e(B);var W=Object.keys(N).filter(function($){return $!=="key"});ue=0<W.length?"{key: someKey, "+W.join(": ..., ")+": ...}":"{key: someKey}",Q[L+ue]||(W=0<W.length?"{"+W.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,
|
|
22
|
+
<%s key={someKey} {...props} />`,ue,L,W,L),Q[L+ue]=!0)}if(L=null,Y!==void 0&&(r(Y),L=""+Y),i(N)&&(r(N.key),L=""+N.key),"key"in N){Y={};for(var le in N)le!=="key"&&(Y[le]=N[le])}else Y=N;return L&&a(Y,typeof B=="function"?B.displayName||B.name||"Unknown":B),c(B,L,Y,s(),X,we)}function d(B){f(B)?B._store&&(B._store.validated=1):typeof B=="object"&&B!==null&&B.$$typeof===O&&(B._payload.status==="fulfilled"?f(B._payload.value)&&B._payload.value._store&&(B._payload.value._store.validated=1):B._store&&(B._store.validated=1))}function f(B){return typeof B=="object"&&B!==null&&B.$$typeof===y}var h=z,y=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),_=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),R=Symbol.for("react.client.reference"),T=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=Object.prototype.hasOwnProperty,H=Array.isArray,U=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(B){return B()}};var ae,J={},M=h.react_stack_bottom_frame.bind(h,o)(),ce=U(n(o)),Q={};An.Fragment=b,An.jsx=function(B,N,Y){var ue=1e4>T.recentlyCreatedOwnerStacks++;return u(B,N,Y,!1,ue?Error("react-stack-top-frame"):M,ue?U(n(B)):ce)},An.jsxs=function(B,N,Y){var ue=1e4>T.recentlyCreatedOwnerStacks++;return u(B,N,Y,!0,ue?Error("react-stack-top-frame"):M,ue?U(n(B)):ce)}})()),An}var vu;function Mb(){return vu||(vu=1,process.env.NODE_ENV==="production"?bo.exports=Nb():bo.exports=Rb()),bo.exports}var k=Mb();const wu=z.createContext(void 0),xu=({config:e,children:t})=>k.jsx(wu.Provider,{value:{registry:e.registry,schemas:e.schemas,tenantId:e.tenantId,assets:e.assets,overlayDisabledSectionTypes:e.overlayDisabledSectionTypes},children:t});function Cn(){const e=z.useContext(wu);if(e===void 0)throw new Error("useConfig must be used within ConfigProvider");return e}const _u=z.createContext(void 0),yo=({mode:e,children:t})=>(z.useEffect(()=>{if(e!=="studio")return;const r=new MutationObserver(n=>{n.forEach(s=>{s.addedNodes.forEach(o=>{o instanceof HTMLElement&&o.hasAttribute("data-radix-portal")&&o.setAttribute("data-jp-studio-portal","true")})})});return r.observe(document.body,{childList:!0}),()=>r.disconnect()},[e]),k.jsx(_u.Provider,{value:{mode:e},children:t})),Su=()=>{const e=z.useContext(_u);if(e===void 0)throw new Error("useStudio must be used within a StudioProvider");return e};/**
|
|
23
23
|
* @license lucide-react v0.474.0 - ISC
|
|
24
24
|
*
|
|
25
25
|
* This source code is licensed under the ISC license.
|
|
26
26
|
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/const
|
|
27
|
+
*/const Db=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Eu=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
|
|
28
28
|
* @license lucide-react v0.474.0 - ISC
|
|
29
29
|
*
|
|
30
30
|
* This source code is licensed under the ISC license.
|
|
31
31
|
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/var
|
|
32
|
+
*/var Lb={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
33
33
|
* @license lucide-react v0.474.0 - ISC
|
|
34
34
|
*
|
|
35
35
|
* This source code is licensed under the ISC license.
|
|
36
36
|
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/const
|
|
37
|
+
*/const zb=z.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:i,...a},l)=>z.createElement("svg",{ref:l,...Lb,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Eu("lucide",s),...a},[...i.map(([c,u])=>z.createElement(c,u)),...Array.isArray(o)?o:[o]]));/**
|
|
38
38
|
* @license lucide-react v0.474.0 - ISC
|
|
39
39
|
*
|
|
40
40
|
* This source code is licensed under the ISC license.
|
|
41
41
|
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/const
|
|
42
|
+
*/const rt=(e,t)=>{const r=z.forwardRef(({className:n,...s},o)=>z.createElement(zb,{ref:o,iconNode:t,className:Eu(`lucide-${Db(e)}`,n),...s}));return r.displayName=`${e}`,r};/**
|
|
43
43
|
* @license lucide-react v0.474.0 - ISC
|
|
44
44
|
*
|
|
45
45
|
* This source code is licensed under the ISC license.
|
|
46
46
|
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
-
*/const
|
|
47
|
+
*/const Bb=rt("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
48
48
|
* @license lucide-react v0.474.0 - ISC
|
|
49
49
|
*
|
|
50
50
|
* This source code is licensed under the ISC license.
|
|
51
51
|
* See the LICENSE file in the root directory of this source tree.
|
|
52
|
-
*/const
|
|
52
|
+
*/const Ub=rt("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
53
53
|
* @license lucide-react v0.474.0 - ISC
|
|
54
54
|
*
|
|
55
55
|
* This source code is licensed under the ISC license.
|
|
56
56
|
* See the LICENSE file in the root directory of this source tree.
|
|
57
|
-
*/const
|
|
57
|
+
*/const Fb=rt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
58
58
|
* @license lucide-react v0.474.0 - ISC
|
|
59
59
|
*
|
|
60
60
|
* This source code is licensed under the ISC license.
|
|
61
61
|
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
-
*/const
|
|
62
|
+
*/const Wb=rt("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
|
|
63
63
|
* @license lucide-react v0.474.0 - ISC
|
|
64
64
|
*
|
|
65
65
|
* This source code is licensed under the ISC license.
|
|
66
66
|
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
-
*/const
|
|
67
|
+
*/const hs=rt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
68
68
|
* @license lucide-react v0.474.0 - ISC
|
|
69
69
|
*
|
|
70
70
|
* This source code is licensed under the ISC license.
|
|
71
71
|
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
-
*/const
|
|
72
|
+
*/const vo=rt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
73
73
|
* @license lucide-react v0.474.0 - ISC
|
|
74
74
|
*
|
|
75
75
|
* This source code is licensed under the ISC license.
|
|
76
76
|
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
-
*/const
|
|
77
|
+
*/const $b=rt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
78
78
|
* @license lucide-react v0.474.0 - ISC
|
|
79
79
|
*
|
|
80
80
|
* This source code is licensed under the ISC license.
|
|
81
81
|
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
-
*/const
|
|
82
|
+
*/const ps=rt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
83
83
|
* @license lucide-react v0.474.0 - ISC
|
|
84
84
|
*
|
|
85
85
|
* This source code is licensed under the ISC license.
|
|
86
86
|
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
-
*/const
|
|
87
|
+
*/const qb=rt("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
88
88
|
* @license lucide-react v0.474.0 - ISC
|
|
89
89
|
*
|
|
90
90
|
* This source code is licensed under the ISC license.
|
|
91
91
|
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
-
*/const
|
|
92
|
+
*/const Hb=rt("FileText",[["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"}]]);/**
|
|
93
93
|
* @license lucide-react v0.474.0 - ISC
|
|
94
94
|
*
|
|
95
95
|
* This source code is licensed under the ISC license.
|
|
96
96
|
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
-
*/const
|
|
97
|
+
*/const Vb=rt("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
|
|
98
98
|
* @license lucide-react v0.474.0 - ISC
|
|
99
99
|
*
|
|
100
100
|
* This source code is licensed under the ISC license.
|
|
101
101
|
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
-
*/const
|
|
102
|
+
*/const ku=rt("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
|
103
103
|
* @license lucide-react v0.474.0 - ISC
|
|
104
104
|
*
|
|
105
105
|
* This source code is licensed under the ISC license.
|
|
106
106
|
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
-
*/const
|
|
107
|
+
*/const wo=rt("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
|
|
108
108
|
* @license lucide-react v0.474.0 - ISC
|
|
109
109
|
*
|
|
110
110
|
* This source code is licensed under the ISC license.
|
|
111
111
|
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
-
*/const
|
|
112
|
+
*/const gs=rt("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
|
|
113
113
|
* @license lucide-react v0.474.0 - ISC
|
|
114
114
|
*
|
|
115
115
|
* This source code is licensed under the ISC license.
|
|
116
116
|
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
-
*/const
|
|
117
|
+
*/const Au=rt("Link2",[["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"}]]);/**
|
|
118
118
|
* @license lucide-react v0.474.0 - ISC
|
|
119
119
|
*
|
|
120
120
|
* This source code is licensed under the ISC license.
|
|
121
121
|
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
-
*/const
|
|
122
|
+
*/const Kb=rt("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
123
123
|
* @license lucide-react v0.474.0 - ISC
|
|
124
124
|
*
|
|
125
125
|
* This source code is licensed under the ISC license.
|
|
126
126
|
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
-
*/const
|
|
127
|
+
*/const Gb=rt("Pencil",[["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"}]]);/**
|
|
128
128
|
* @license lucide-react v0.474.0 - ISC
|
|
129
129
|
*
|
|
130
130
|
* This source code is licensed under the ISC license.
|
|
131
131
|
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
-
*/const
|
|
132
|
+
*/const ms=rt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
133
133
|
* @license lucide-react v0.474.0 - ISC
|
|
134
134
|
*
|
|
135
135
|
* This source code is licensed under the ISC license.
|
|
136
136
|
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
-
*/const
|
|
137
|
+
*/const Cu=rt("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
138
138
|
* @license lucide-react v0.474.0 - ISC
|
|
139
139
|
*
|
|
140
140
|
* This source code is licensed under the ISC license.
|
|
141
141
|
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
-
*/const
|
|
142
|
+
*/const Yb=rt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
143
143
|
* @license lucide-react v0.474.0 - ISC
|
|
144
144
|
*
|
|
145
145
|
* This source code is licensed under the ISC license.
|
|
146
146
|
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
-
*/const
|
|
147
|
+
*/const Jb=rt("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
148
148
|
* @license lucide-react v0.474.0 - ISC
|
|
149
149
|
*
|
|
150
150
|
* This source code is licensed under the ISC license.
|
|
151
151
|
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
-
*/const
|
|
152
|
+
*/const Qb=rt("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
153
153
|
* @license lucide-react v0.474.0 - ISC
|
|
154
154
|
*
|
|
155
155
|
* This source code is licensed under the ISC license.
|
|
156
156
|
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
-
*/const
|
|
157
|
+
*/const Xb=rt("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
158
158
|
* @license lucide-react v0.474.0 - ISC
|
|
159
159
|
*
|
|
160
160
|
* This source code is licensed under the ISC license.
|
|
161
161
|
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
-
*/const
|
|
162
|
+
*/const xo=rt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
163
163
|
* @license lucide-react v0.474.0 - ISC
|
|
164
164
|
*
|
|
165
165
|
* This source code is licensed under the ISC license.
|
|
166
166
|
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
-
*/const
|
|
167
|
+
*/const Zb=rt("TriangleAlert",[["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"}]]);/**
|
|
168
168
|
* @license lucide-react v0.474.0 - ISC
|
|
169
169
|
*
|
|
170
170
|
* This source code is licensed under the ISC license.
|
|
171
171
|
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
-
*/const
|
|
172
|
+
*/const Iu=rt("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
173
173
|
* @license lucide-react v0.474.0 - ISC
|
|
174
174
|
*
|
|
175
175
|
* This source code is licensed under the ISC license.
|
|
176
176
|
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
-
*/const
|
|
177
|
+
*/const Gr=rt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
178
178
|
* @license lucide-react v0.474.0 - ISC
|
|
179
179
|
*
|
|
180
180
|
* This source code is licensed under the ISC license.
|
|
181
181
|
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
-
*/const Vd=be("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);class Kd extends g.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,r){console.error(`[JsonPages] Component Crash [${this.props.type}]:`,t,r)}render(){return this.state.hasError?c.jsxs("div",{className:"p-8 m-4 bg-amber-500/5 border-2 border-dashed border-amber-500/20 rounded-xl flex flex-col items-center text-center gap-3",children:[c.jsx(Hd,{className:"text-amber-500",size:32}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("h4",{className:"text-sm font-bold text-amber-200 uppercase tracking-tight",children:"Component Error"}),c.jsxs("p",{className:"text-xs text-amber-500/70 font-mono",children:["Type: ",this.props.type]})]}),c.jsx("p",{className:"text-xs text-zinc-400 max-w-[280px] leading-relaxed",children:"This section failed to render. Check the console for details or verify the JSON data structure."})]}):this.props.children}}const Gd=({type:e,scope:t,isSelected:r,sectionId:n,sectionIndex:o=0,totalSections:i=0,onReorder:s})=>{const a=typeof o=="number"&&o>0&&s,l=typeof o=="number"&&o<i-1&&s;return c.jsx("div",{"data-jp-section-overlay":!0,"aria-hidden":!0,className:se("absolute inset-0 pointer-events-none transition-all duration-200 z-[50]","border-2 border-transparent group-hover:border-blue-400/50 group-hover:border-dashed",r&&"border-2 border-blue-600 border-solid bg-blue-500/5"),children:c.jsxs("div",{className:se("absolute top-0 right-0 flex flex-nowrap items-center gap-1 pl-1 pr-2 py-1 text-[9px] font-black uppercase tracking-widest transition-opacity pointer-events-auto","bg-blue-600 text-white",r||"group-hover:opacity-100 opacity-0"),children:[s&&n!=null&&c.jsxs("span",{className:"shrink-0 flex items-center gap-0.5",children:[c.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),a&&s(n,o-1)},disabled:!a,className:"inline-flex items-center justify-center min-w-[18px] min-h-[18px] rounded bg-white/20 hover:bg-white/30 disabled:opacity-30 disabled:pointer-events-none",title:"Move section up","aria-label":"Move section up",children:c.jsx(co,{size:12,strokeWidth:2.5})}),c.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),l&&s(n,o+2)},disabled:!l,className:"inline-flex items-center justify-center min-w-[18px] min-h-[18px] rounded bg-white/20 hover:bg-white/30 disabled:opacity-30 disabled:pointer-events-none",title:"Move section down","aria-label":"Move section down",children:c.jsx(Zr,{size:12,strokeWidth:2.5})})]}),c.jsx("span",{className:"shrink-0",children:e}),c.jsx("span",{className:"opacity-50 shrink-0",children:"|"}),c.jsx("span",{className:"shrink-0",children:t})]})})},mr=({section:e,menu:t,selectedId:r,reorderable:n,sectionIndex:o,totalSections:i,onReorder:s})=>{var k,x;const{mode:a}=rs(),{registry:l,overlayDisabledSectionTypes:d}=hr(),u=a==="studio",f=u&&r===e.id,h=l[e.type],p=e.type==="header"||e.type==="footer"?"global":"local",w=Array.isArray(d)?d.includes(e.type):!1,m=e.type==="header"&&((k=e.settings)==null?void 0:k.sticky);if(!h)return c.jsxs("div",{className:"p-6 m-4 bg-red-500/10 text-red-400 border border-red-500/20 rounded-lg text-sm font-mono",children:[c.jsx("strong",{children:"Missing Component:"})," ",e.type]});const v=()=>{const S=h;return e.type==="header"&&t?c.jsx(S,{data:e.data,settings:e.settings,menu:t}):c.jsx(S,{data:e.data,settings:e.settings})},y=(x=e.data)==null?void 0:x.anchorId;return c.jsxs("div",{id:y||void 0,"data-section-id":u?e.id:void 0,"data-section-type":u?e.type:void 0,"data-section-scope":u?p:void 0,...u&&f?{"data-jp-selected":!0}:{},className:se("relative w-full",u&&!w&&"group cursor-pointer",u&&m?"sticky top-0 z-[60]":e.type==="header"?"relative":"relative z-0",f&&"z-[70]"),children:[c.jsx("div",{className:e.type==="header"?"relative":"relative z-0",children:c.jsx(Kd,{type:e.type,children:v()})}),u&&!w&&c.jsx(Gd,{type:e.type,scope:p,isSelected:!!f,sectionId:n&&p==="local"?e.id:void 0,sectionIndex:n&&p==="local"?o:void 0,totalSections:n&&p==="local"?i:void 0,onReorder:n&&p==="local"?s:void 0})]})},Yd=e=>{g.useEffect(()=>{document.title=e.title;let t=document.querySelector('meta[name="description"]');t||(t=document.createElement("meta"),t.setAttribute("name","description"),document.head.appendChild(t)),t.setAttribute("content",e.description)},[e.title,e.description])};function gr(e){return typeof e=="object"&&e!==null}function tn(e){if(!gr(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function qd(e){return gr(e)&&typeof e.$ref=="string"&&e.$ref.trim().length>0}function Xd(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function ls(e,t){if(!t||t==="#")return e;const r=t.startsWith("#")?t.slice(1):t;if(!r||r==="/")return e;let n=e;for(const o of r.replace(/^\//,"").split("/")){const i=Xd(o);if(Array.isArray(n)){const s=Number(i);if(!Number.isInteger(s)||s<0||s>=n.length)return;n=n[s];continue}if(!gr(n)||!(i in n))return;n=n[i]}return n}function Ut(e){const n=e.trim().replace(/\\/g,"/").replace(/^\/+/,"").split("/"),o=[];for(const i of n)if(!(!i||i===".")){if(i===".."){o.length>0&&o.pop();continue}o.push(i)}return o.join("/")}function Jd(e){const t=Ut(e),r=t.lastIndexOf("/");return r===-1?"":t.slice(0,r)}function Zd(e,t){const r=new Set,n=Ut(e);n&&r.add(n);const o=Jd(t),i=Ut(o?`${o}/${e}`:e);return i&&r.add(i),Array.from(r)}function br(e){return Array.isArray(e)?e.map(t=>br(t)):tn(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,br(r)])):e}function vr(e,t,r){for(const n of t){const o=Ut(n);o&&e.set(o,r)}}function Qd({pages:e,siteConfig:t,themeConfig:r,menuConfig:n,refDocuments:o}){const i=new Map;vr(i,["site.json","config/site.json","src/data/config/site.json"],t),vr(i,["theme.json","config/theme.json","src/data/config/theme.json"],r),vr(i,["menu.json","config/menu.json","src/data/config/menu.json"],n);for(const[s,a]of Object.entries(e)){const l=s.replace(/^\/+|\/+$/g,"")||"home";vr(i,[`pages/${l}.json`,`src/data/pages/${l}.json`],a)}for(const[s,a]of Object.entries(o??{}))vr(i,[s],a);return i}function eu(e,t,r){const[n,o=""]=e.split("#"),i=o?`/${o.replace(/^\//,"")}`:"";if(!n){const s=Ut(t),a=r.documents.get(s);if(a===void 0)return null;const l=ls(a,i);return l===void 0?null:{value:l,documentPath:s}}for(const s of Zd(n,t)){const a=r.documents.get(s);if(a===void 0)continue;const l=ls(a,i);if(l!==void 0)return{value:l,documentPath:s}}return null}function Pt(e,t,r){if(Array.isArray(e))return e.map(n=>Pt(n,t,r));if(!tn(e))return e;if(qd(e)){const n=`${Ut(t)}::${e.$ref}`;if(r.stack.includes(n))return console.warn("[JsonPages] Circular $ref skipped",e.$ref),br(e);if(r.cache.has(n)){const l=br(r.cache.get(n)),d=Object.entries(e).filter(([f])=>f!=="$ref");if(d.length===0)return l;const u=Object.fromEntries(d.map(([f,h])=>[f,Pt(h,t,r)]));return tn(l)?{...l,...u}:l}const o=eu(e.$ref,t,r);if(!o)return console.warn("[JsonPages] Unresolved $ref",e.$ref),Object.fromEntries(Object.entries(e).map(([l,d])=>[l,Pt(d,t,r)]));r.stack.push(n);const i=Pt(o.value,o.documentPath,r);r.stack.pop(),r.cache.set(n,br(i));const s=Object.entries(e).filter(([l])=>l!=="$ref");if(s.length===0)return i;const a=Object.fromEntries(s.map(([l,d])=>[l,Pt(d,t,r)]));return tn(i)?{...i,...a}:i}return Object.fromEntries(Object.entries(e).map(([n,o])=>[n,Pt(o,t,r)]))}function rn(e,t,r){return Pt(e,t,{documents:r,cache:new Map,stack:[]})}function po(e){return gr(e)?typeof e.label=="string"&&typeof e.href=="string":!1}function tu(e){if(!gr(e))return null;const t=e.links;if(Array.isArray(t)&&t.every(po))return t;const r=e.menu;if(Array.isArray(r)&&r.every(po))return r;const n=e.menuConfig;return Array.isArray(n)&&n.every(po)?n:null}function nn(e,t){const r=tu(e);return r||(Array.isArray(t)?t:[])}function on(e,t){if(e.type==="header")return nn(e.data,t)}function Ot(e){const t=Qd(e);return{pages:Object.fromEntries(Object.entries(e.pages).map(([r,n])=>[r,rn(n,`pages/${r.replace(/^\/+|\/+$/g,"")||"home"}.json`,t)])),siteConfig:rn(e.siteConfig,"config/site.json",t),themeConfig:rn(e.themeConfig,"config/theme.json",t),menuConfig:rn(e.menuConfig,"config/menu.json",t)}}const ru="application/json",ho=({pageConfig:e,siteConfig:t,menuConfig:r,selectedId:n,onReorder:o,scrollToSectionId:i,onActiveSectionChange:s})=>{var y,k;Yd(e.meta);const[a,l]=g.useState(null),d=g.useRef({}),u=g.useRef(s);u.current=s;const f=Pi(e,t),h=x=>{var S;(S=u.current)==null||S.call(u,x)};g.useEffect(()=>{if(!i)return;const x=d.current[i];x&&x.scrollIntoView({behavior:"smooth",block:"center"})},[i]),g.useEffect(()=>{if(!u.current)return;const S=[...f&&t.header?[t.header.id]:[],...e.sections.map(j=>j.id),...t.footer?[t.footer.id]:[]],C=new IntersectionObserver(j=>{j.forEach(D=>{var M;if(D.isIntersecting&&D.intersectionRatio>.5){const I=D.target.getAttribute("data-section-id");I&&((M=u.current)==null||M.call(u,I))}})},{threshold:[0,.5,1],rootMargin:"-20% 0px -20% 0px"});let E=!1;const N=requestAnimationFrame(()=>{E||S.forEach(j=>{const D=d.current[j];D&&C.observe(D)})});return()=>{E=!0,cancelAnimationFrame(N),C.disconnect()}},[e.sections,e["global-header"],f,(y=t.header)==null?void 0:y.id,(k=t.footer)==null?void 0:k.id]);const p=(x,S)=>{x.preventDefault(),x.dataTransfer.dropEffect="move",l(S)},w=()=>{l(null)},m=(x,S)=>{if(x.preventDefault(),l(null),!!o)try{const C=x.dataTransfer.getData(ru),{sectionId:E}=JSON.parse(C);typeof E=="string"&&o(E,S)}catch{}},v=()=>{const x=typeof o=="function",S=e.sections.map((C,E)=>{const N=a===E;return x?c.jsxs("div",{ref:j=>{d.current[C.id]=j},"data-section-id":C.id,style:{position:"relative"},onMouseEnter:()=>h(C.id),children:[c.jsx("div",{"data-jp-drop-zone":!0,style:{position:"absolute",left:0,right:0,top:-1,height:12,zIndex:55,pointerEvents:"auto",backgroundColor:N?"rgba(59, 130, 246, 0.4)":"transparent",borderTop:N?"2px solid rgb(96, 165, 250)":"2px solid transparent"},onDragOver:j=>p(j,E),onDragLeave:w,onDrop:j=>m(j,E)}),c.jsx(mr,{section:C,menu:on(C,r.main),selectedId:n,reorderable:!0,sectionIndex:E,totalSections:e.sections.length,onReorder:o})]},C.id):c.jsx("div",{ref:j=>{d.current[C.id]=j},"data-section-id":C.id,onMouseEnter:()=>h(C.id),children:c.jsx(mr,{section:C,menu:on(C,r.main),selectedId:n})},C.id)});if(x&&S.length>0){const C=e.sections.length,E=a===C;S.push(c.jsx("div",{"data-jp-drop-zone":!0,style:{position:"relative",left:0,right:0,height:24,minHeight:24,zIndex:55,pointerEvents:"auto",backgroundColor:E?"rgba(59, 130, 246, 0.4)":"transparent",borderTop:E?"2px solid rgb(96, 165, 250)":"2px solid transparent"},onDragOver:N=>p(N,C),onDragLeave:w,onDrop:N=>m(N,C)},"jp-drop-after-last"))}return S};return c.jsxs("div",{className:"min-h-screen flex flex-col bg-[var(--color-background)]",children:[f&&t.header!=null&&c.jsx("div",{ref:x=>{d.current[t.header.id]=x},"data-section-id":t.header.id,onMouseEnter:()=>h(t.header.id),children:c.jsx(mr,{section:t.header,menu:on(t.header,r.main),selectedId:n})}),c.jsx("main",{className:"flex-1",children:v()}),t.footer!=null&&c.jsx("div",{ref:x=>{d.current[t.footer.id]=x},"data-section-id":t.footer.id,onMouseEnter:()=>h(t.footer.id),children:c.jsx(mr,{section:t.footer,selectedId:n})})]})},sn=({mode:e,tenantCss:t,adminCss:r,children:n})=>(g.useLayoutEffect(()=>{const o=`jp-theme-${e}`,i=e==="tenant"?t:r;if(!document.getElementById(o)&&i){const s=document.createElement("style");s.id=o,s.innerHTML=i,document.head.appendChild(s)}return()=>{const s=document.getElementById(o);s&&s.remove()}},[e,t,r]),c.jsx(c.Fragment,{children:n}));function nu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return g.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const an=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Bt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function mo(e){return"nodeType"in e}function We(e){var t,r;return e?Bt(e)?e:mo(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function go(e){const{Document:t}=We(e);return e instanceof t}function xr(e){return Bt(e)?!1:e instanceof We(e).HTMLElement}function cs(e){return e instanceof We(e).SVGElement}function Ht(e){return e?Bt(e)?e.document:mo(e)?go(e)?e:xr(e)||cs(e)?e.ownerDocument:document:document:document}const et=an?g.useLayoutEffect:g.useEffect;function ln(e){const t=g.useRef(e);return et(()=>{t.current=e}),g.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function ou(){const e=g.useRef(null),t=g.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=g.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function wr(e,t){t===void 0&&(t=[e]);const r=g.useRef(e);return et(()=>{r.current!==e&&(r.current=e)},t),r}function yr(e,t){const r=g.useRef();return g.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function cn(e){const t=ln(e),r=g.useRef(null),n=g.useCallback(o=>{o!==r.current&&(t==null||t(o,r.current)),r.current=o},[]);return[r,n]}function dn(e){const t=g.useRef();return g.useEffect(()=>{t.current=e},[e]),t.current}let bo={};function kr(e,t){return g.useMemo(()=>{if(t)return t;const r=bo[e]==null?0:bo[e]+1;return bo[e]=r,e+"-"+r},[e,t])}function ds(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((i,s)=>{const a=Object.entries(s);for(const[l,d]of a){const u=i[l];u!=null&&(i[l]=u+e*d)}return i},{...t})}}const Vt=ds(1),Sr=ds(-1);function iu(e){return"clientX"in e&&"clientY"in e}function un(e){if(!e)return!1;const{KeyboardEvent:t}=We(e.target);return t&&e instanceof t}function su(e){if(!e)return!1;const{TouchEvent:t}=We(e.target);return t&&e instanceof t}function fn(e){if(su(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return iu(e)?{x:e.clientX,y:e.clientY}:null}const wt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[wt.Translate.toString(e),wt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),us="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function au(e){return e.matches(us)?e:e.querySelector(us)}const lu={display:"none"};function cu(e){let{id:t,value:r}=e;return g.createElement("div",{id:t,style:lu},r)}function du(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return g.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function uu(){const[e,t]=g.useState("");return{announce:g.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const fs=g.createContext(null);function fu(e){const t=g.useContext(fs);g.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function pu(){const[e]=g.useState(()=>new Set),t=g.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[g.useCallback(n=>{let{type:o,event:i}=n;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const hu={draggable:`
|
|
182
|
+
*/const ey=rt("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);class ty extends z.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,r){console.error(`[JsonPages] Component Crash [${this.props.type}]:`,t,r)}render(){return this.state.hasError?k.jsxs("div",{className:"p-8 m-4 bg-amber-500/5 border-2 border-dashed border-amber-500/20 rounded-xl flex flex-col items-center text-center gap-3",children:[k.jsx(Zb,{className:"text-amber-500",size:32}),k.jsxs("div",{className:"space-y-1",children:[k.jsx("h4",{className:"text-sm font-bold text-amber-200 uppercase tracking-tight",children:"Component Error"}),k.jsxs("p",{className:"text-xs text-amber-500/70 font-mono",children:["Type: ",this.props.type]})]}),k.jsx("p",{className:"text-xs text-zinc-400 max-w-[280px] leading-relaxed",children:"This section failed to render. Check the console for details or verify the JSON data structure."})]}):this.props.children}}const ry=({type:e,scope:t,isSelected:r,sectionId:n,sectionIndex:s=0,totalSections:o=0,onReorder:i})=>{const a=typeof s=="number"&&s>0&&i,l=typeof s=="number"&&s<o-1&&i;return k.jsx("div",{"data-jp-section-overlay":!0,"aria-hidden":!0,className:Ke("absolute inset-0 pointer-events-none transition-all duration-200 z-[50]","border-2 border-transparent group-hover:border-blue-400/50 group-hover:border-dashed",r&&"border-2 border-blue-600 border-solid bg-blue-500/5"),children:k.jsxs("div",{className:Ke("absolute top-0 right-0 flex flex-nowrap items-center gap-1 pl-1 pr-2 py-1 text-[9px] font-black uppercase tracking-widest transition-opacity pointer-events-auto","bg-blue-600 text-white",r||"group-hover:opacity-100 opacity-0"),children:[i&&n!=null&&k.jsxs("span",{className:"shrink-0 flex items-center gap-0.5",children:[k.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),a&&i(n,s-1)},disabled:!a,className:"inline-flex items-center justify-center min-w-[18px] min-h-[18px] rounded bg-white/20 hover:bg-white/30 disabled:opacity-30 disabled:pointer-events-none",title:"Move section up","aria-label":"Move section up",children:k.jsx(ps,{size:12,strokeWidth:2.5})}),k.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),l&&i(n,s+2)},disabled:!l,className:"inline-flex items-center justify-center min-w-[18px] min-h-[18px] rounded bg-white/20 hover:bg-white/30 disabled:opacity-30 disabled:pointer-events-none",title:"Move section down","aria-label":"Move section down",children:k.jsx(vo,{size:12,strokeWidth:2.5})})]}),k.jsx("span",{className:"shrink-0",children:e}),k.jsx("span",{className:"opacity-50 shrink-0",children:"|"}),k.jsx("span",{className:"shrink-0",children:t})]})})},In=({section:e,menu:t,selectedId:r,reorderable:n,sectionIndex:s,totalSections:o,onReorder:i})=>{var g,w;const{mode:a}=Su(),{registry:l,overlayDisabledSectionTypes:c}=Cn(),u=a==="studio",d=u&&r===e.id,f=l[e.type],h=e.type==="header"||e.type==="footer"?"global":"local",y=Array.isArray(c)?c.includes(e.type):!1,m=e.type==="header"&&((g=e.settings)==null?void 0:g.sticky);if(!f)return k.jsxs("div",{className:"p-6 m-4 bg-red-500/10 text-red-400 border border-red-500/20 rounded-lg text-sm font-mono",children:[k.jsx("strong",{children:"Missing Component:"})," ",e.type]});const b=()=>{const _=f;return e.type==="header"&&t?k.jsx(_,{data:e.data,settings:e.settings,menu:t}):k.jsx(_,{data:e.data,settings:e.settings})},S=(w=e.data)==null?void 0:w.anchorId;return k.jsxs("div",{id:S||void 0,"data-section-id":u?e.id:void 0,"data-section-type":u?e.type:void 0,"data-section-scope":u?h:void 0,...u&&d?{"data-jp-selected":!0}:{},className:Ke("relative w-full",u&&!y&&"group cursor-pointer",u&&m?"sticky top-0 z-[60]":e.type==="header"?"relative":"relative z-0",d&&"z-[70]"),children:[k.jsx("div",{className:e.type==="header"?"relative":"relative z-0",children:k.jsx(ty,{type:e.type,children:b()})}),u&&!y&&k.jsx(ry,{type:e.type,scope:h,isSelected:!!d,sectionId:n&&h==="local"?e.id:void 0,sectionIndex:n&&h==="local"?s:void 0,totalSections:n&&h==="local"?o:void 0,onReorder:n&&h==="local"?i:void 0})]})},ny=e=>{z.useEffect(()=>{document.title=e.title;let t=document.querySelector('meta[name="description"]');t||(t=document.createElement("meta"),t.setAttribute("name","description"),document.head.appendChild(t)),t.setAttribute("content",e.description)},[e.title,e.description])};function Tn(e){return typeof e=="object"&&e!==null}function _o(e){if(!Tn(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function oy(e){return Tn(e)&&typeof e.$ref=="string"&&e.$ref.trim().length>0}function iy(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Tu(e,t){if(!t||t==="#")return e;const r=t.startsWith("#")?t.slice(1):t;if(!r||r==="/")return e;let n=e;for(const s of r.replace(/^\//,"").split("/")){const o=iy(s);if(Array.isArray(n)){const i=Number(o);if(!Number.isInteger(i)||i<0||i>=n.length)return;n=n[i];continue}if(!Tn(n)||!(o in n))return;n=n[o]}return n}function Yr(e){const n=e.trim().replace(/\\/g,"/").replace(/^\/+/,"").split("/"),s=[];for(const o of n)if(!(!o||o===".")){if(o===".."){s.length>0&&s.pop();continue}s.push(o)}return s.join("/")}function sy(e){const t=Yr(e),r=t.lastIndexOf("/");return r===-1?"":t.slice(0,r)}function ay(e,t){const r=new Set,n=Yr(e);n&&r.add(n);const s=sy(t),o=Yr(s?`${s}/${e}`:e);return o&&r.add(o),Array.from(r)}function jn(e){return Array.isArray(e)?e.map(t=>jn(t)):_o(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,jn(r)])):e}function On(e,t,r){for(const n of t){const s=Yr(n);s&&e.set(s,r)}}function ly({pages:e,siteConfig:t,themeConfig:r,menuConfig:n,refDocuments:s}){const o=new Map;On(o,["site.json","config/site.json","src/data/config/site.json"],t),On(o,["theme.json","config/theme.json","src/data/config/theme.json"],r),On(o,["menu.json","config/menu.json","src/data/config/menu.json"],n);for(const[i,a]of Object.entries(e)){const l=i.replace(/^\/+|\/+$/g,"")||"home";On(o,[`pages/${l}.json`,`src/data/pages/${l}.json`],a)}for(const[i,a]of Object.entries(s??{}))On(o,[i],a);return o}function cy(e,t,r){const[n,s=""]=e.split("#"),o=s?`/${s.replace(/^\//,"")}`:"";if(!n){const i=Yr(t),a=r.documents.get(i);if(a===void 0)return null;const l=Tu(a,o);return l===void 0?null:{value:l,documentPath:i}}for(const i of ay(n,t)){const a=r.documents.get(i);if(a===void 0)continue;const l=Tu(a,o);if(l!==void 0)return{value:l,documentPath:i}}return null}function Tr(e,t,r){if(Array.isArray(e))return e.map(n=>Tr(n,t,r));if(!_o(e))return e;if(oy(e)){const n=`${Yr(t)}::${e.$ref}`;if(r.stack.includes(n))return console.warn("[JsonPages] Circular $ref skipped",e.$ref),jn(e);if(r.cache.has(n)){const l=jn(r.cache.get(n)),c=Object.entries(e).filter(([d])=>d!=="$ref");if(c.length===0)return l;const u=Object.fromEntries(c.map(([d,f])=>[d,Tr(f,t,r)]));return _o(l)?{...l,...u}:l}const s=cy(e.$ref,t,r);if(!s)return console.warn("[JsonPages] Unresolved $ref",e.$ref),Object.fromEntries(Object.entries(e).map(([l,c])=>[l,Tr(c,t,r)]));r.stack.push(n);const o=Tr(s.value,s.documentPath,r);r.stack.pop(),r.cache.set(n,jn(o));const i=Object.entries(e).filter(([l])=>l!=="$ref");if(i.length===0)return o;const a=Object.fromEntries(i.map(([l,c])=>[l,Tr(c,t,r)]));return _o(o)?{...o,...a}:o}return Object.fromEntries(Object.entries(e).map(([n,s])=>[n,Tr(s,t,r)]))}function So(e,t,r){return Tr(e,t,{documents:r,cache:new Map,stack:[]})}function bs(e){return Tn(e)?typeof e.label=="string"&&typeof e.href=="string":!1}function uy(e){if(!Tn(e))return null;const t=e.links;if(Array.isArray(t)&&t.every(bs))return t;const r=e.menu;if(Array.isArray(r)&&r.every(bs))return r;const n=e.menuConfig;return Array.isArray(n)&&n.every(bs)?n:null}function Eo(e,t){const r=uy(e);return r||(Array.isArray(t)?t:[])}function ko(e,t){if(e.type==="header")return Eo(e.data,t)}function jr(e){const t=ly(e);return{pages:Object.fromEntries(Object.entries(e.pages).map(([r,n])=>[r,So(n,`pages/${r.replace(/^\/+|\/+$/g,"")||"home"}.json`,t)])),siteConfig:So(e.siteConfig,"config/site.json",t),themeConfig:So(e.themeConfig,"config/theme.json",t),menuConfig:So(e.menuConfig,"config/menu.json",t)}}const dy="application/json",ys=({pageConfig:e,siteConfig:t,menuConfig:r,selectedId:n,onReorder:s,scrollToSectionId:o,onActiveSectionChange:i})=>{var S,g;ny(e.meta);const[a,l]=z.useState(null),c=z.useRef({}),u=z.useRef(i);u.current=i;const d=Xc(e,t),f=w=>{var _;(_=u.current)==null||_.call(u,w)};z.useEffect(()=>{if(!o)return;const w=c.current[o];w&&w.scrollIntoView({behavior:"smooth",block:"center"})},[o]),z.useEffect(()=>{if(!u.current)return;const _=[...d&&t.header?[t.header.id]:[],...e.sections.map(A=>A.id),...t.footer?[t.footer.id]:[]],x=new IntersectionObserver(A=>{A.forEach(O=>{var j;if(O.isIntersecting&&O.intersectionRatio>.5){const R=O.target.getAttribute("data-section-id");R&&((j=u.current)==null||j.call(u,R))}})},{threshold:[0,.5,1],rootMargin:"-20% 0px -20% 0px"});let I=!1;const C=requestAnimationFrame(()=>{I||_.forEach(A=>{const O=c.current[A];O&&x.observe(O)})});return()=>{I=!0,cancelAnimationFrame(C),x.disconnect()}},[e.sections,e["global-header"],d,(S=t.header)==null?void 0:S.id,(g=t.footer)==null?void 0:g.id]);const h=(w,_)=>{w.preventDefault(),w.dataTransfer.dropEffect="move",l(_)},y=()=>{l(null)},m=(w,_)=>{if(w.preventDefault(),l(null),!!s)try{const x=w.dataTransfer.getData(dy),{sectionId:I}=JSON.parse(x);typeof I=="string"&&s(I,_)}catch{}},b=()=>{const w=typeof s=="function",_=e.sections.map((x,I)=>{const C=a===I;return w?k.jsxs("div",{ref:A=>{c.current[x.id]=A},"data-section-id":x.id,style:{position:"relative"},onMouseEnter:()=>f(x.id),children:[k.jsx("div",{"data-jp-drop-zone":!0,style:{position:"absolute",left:0,right:0,top:-1,height:12,zIndex:55,pointerEvents:"auto",backgroundColor:C?"rgba(59, 130, 246, 0.4)":"transparent",borderTop:C?"2px solid rgb(96, 165, 250)":"2px solid transparent"},onDragOver:A=>h(A,I),onDragLeave:y,onDrop:A=>m(A,I)}),k.jsx(In,{section:x,menu:ko(x,r.main),selectedId:n,reorderable:!0,sectionIndex:I,totalSections:e.sections.length,onReorder:s})]},x.id):k.jsx("div",{ref:A=>{c.current[x.id]=A},"data-section-id":x.id,onMouseEnter:()=>f(x.id),children:k.jsx(In,{section:x,menu:ko(x,r.main),selectedId:n})},x.id)});if(w&&_.length>0){const x=e.sections.length,I=a===x;_.push(k.jsx("div",{"data-jp-drop-zone":!0,style:{position:"relative",left:0,right:0,height:24,minHeight:24,zIndex:55,pointerEvents:"auto",backgroundColor:I?"rgba(59, 130, 246, 0.4)":"transparent",borderTop:I?"2px solid rgb(96, 165, 250)":"2px solid transparent"},onDragOver:C=>h(C,x),onDragLeave:y,onDrop:C=>m(C,x)},"jp-drop-after-last"))}return _};return k.jsxs("div",{className:"min-h-screen flex flex-col bg-[var(--color-background)]",children:[d&&t.header!=null&&k.jsx("div",{ref:w=>{c.current[t.header.id]=w},"data-section-id":t.header.id,onMouseEnter:()=>f(t.header.id),children:k.jsx(In,{section:t.header,menu:ko(t.header,r.main),selectedId:n})}),k.jsx("main",{className:"flex-1",children:b()}),t.footer!=null&&k.jsx("div",{ref:w=>{c.current[t.footer.id]=w},"data-section-id":t.footer.id,onMouseEnter:()=>f(t.footer.id),children:k.jsx(In,{section:t.footer,selectedId:n})})]})},Ao=({mode:e,tenantCss:t,adminCss:r,children:n})=>(z.useLayoutEffect(()=>{const s=`jp-theme-${e}`,o=e==="tenant"?t:r;if(!document.getElementById(s)&&o){const i=document.createElement("style");i.id=s,i.innerHTML=o,document.head.appendChild(i)}return()=>{const i=document.getElementById(s);i&&i.remove()}},[e,t,r]),k.jsx(k.Fragment,{children:n}));function fy(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return z.useMemo(()=>n=>{t.forEach(s=>s(n))},t)}const Co=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Jr(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function vs(e){return"nodeType"in e}function Et(e){var t,r;return e?Jr(e)?e:vs(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function ws(e){const{Document:t}=Et(e);return e instanceof t}function Pn(e){return Jr(e)?!1:e instanceof Et(e).HTMLElement}function ju(e){return e instanceof Et(e).SVGElement}function Qr(e){return e?Jr(e)?e.document:vs(e)?ws(e)?e:Pn(e)||ju(e)?e.ownerDocument:document:document:document}const Nt=Co?z.useLayoutEffect:z.useEffect;function Io(e){const t=z.useRef(e);return Nt(()=>{t.current=e}),z.useCallback(function(){for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];return t.current==null?void 0:t.current(...n)},[])}function hy(){const e=z.useRef(null),t=z.useCallback((n,s)=>{e.current=setInterval(n,s)},[]),r=z.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function Nn(e,t){t===void 0&&(t=[e]);const r=z.useRef(e);return Nt(()=>{r.current!==e&&(r.current=e)},t),r}function Rn(e,t){const r=z.useRef();return z.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function To(e){const t=Io(e),r=z.useRef(null),n=z.useCallback(s=>{s!==r.current&&(t==null||t(s,r.current)),r.current=s},[]);return[r,n]}function jo(e){const t=z.useRef();return z.useEffect(()=>{t.current=e},[e]),t.current}let xs={};function Mn(e,t){return z.useMemo(()=>{if(t)return t;const r=xs[e]==null?0:xs[e]+1;return xs[e]=r,e+"-"+r},[e,t])}function Ou(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return n.reduce((o,i)=>{const a=Object.entries(i);for(const[l,c]of a){const u=o[l];u!=null&&(o[l]=u+e*c)}return o},{...t})}}const Xr=Ou(1),Dn=Ou(-1);function py(e){return"clientX"in e&&"clientY"in e}function Oo(e){if(!e)return!1;const{KeyboardEvent:t}=Et(e.target);return t&&e instanceof t}function gy(e){if(!e)return!1;const{TouchEvent:t}=Et(e.target);return t&&e instanceof t}function Po(e){if(gy(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return py(e)?{x:e.clientX,y:e.clientY}:null}const ur=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[ur.Translate.toString(e),ur.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),Pu="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function my(e){return e.matches(Pu)?e:e.querySelector(Pu)}const by={display:"none"};function yy(e){let{id:t,value:r}=e;return z.createElement("div",{id:t,style:by},r)}function vy(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return z.createElement("div",{id:t,style:s,role:"status","aria-live":n,"aria-atomic":!0},r)}function wy(){const[e,t]=z.useState("");return{announce:z.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const Nu=z.createContext(null);function xy(e){const t=z.useContext(Nu);z.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function _y(){const[e]=z.useState(()=>new Set),t=z.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[z.useCallback(n=>{let{type:s,event:o}=n;e.forEach(i=>{var a;return(a=i[s])==null?void 0:a.call(i,o)})},[e]),t]}const Sy={draggable:`
|
|
183
183
|
To pick up a draggable item, press the space bar.
|
|
184
184
|
While dragging, use the arrow keys to move the item.
|
|
185
185
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
186
|
-
`},mu={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function gu(e){let{announcements:t=mu,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=hu}=e;const{announce:i,announcement:s}=uu(),a=kr("DndLiveRegion"),[l,d]=g.useState(!1);if(g.useEffect(()=>{d(!0)},[]),fu(g.useMemo(()=>({onDragStart(f){let{active:h}=f;i(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:p}=f;t.onDragMove&&i(t.onDragMove({active:h,over:p}))},onDragOver(f){let{active:h,over:p}=f;i(t.onDragOver({active:h,over:p}))},onDragEnd(f){let{active:h,over:p}=f;i(t.onDragEnd({active:h,over:p}))},onDragCancel(f){let{active:h,over:p}=f;i(t.onDragCancel({active:h,over:p}))}}),[i,t])),!l)return null;const u=g.createElement(g.Fragment,null,g.createElement(cu,{id:n,value:o.draggable}),g.createElement(du,{id:a,announcement:s}));return r?vt.createPortal(u,r):u}var Ie;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Ie||(Ie={}));function pn(){}function vo(e,t){return g.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function bu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return g.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const tt=Object.freeze({x:0,y:0});function ps(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function vu(e,t){const r=fn(e);if(!r)return"0 0";const n={x:(r.x-t.left)/t.width*100,y:(r.y-t.top)/t.height*100};return n.x+"% "+n.y+"%"}function hs(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function xu(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function ms(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function gs(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function bs(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const wu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=bs(t,t.left,t.top),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const d=ps(bs(l),o);i.push({id:a,data:{droppableContainer:s,value:d}})}}return i.sort(hs)},yu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=ms(t),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const d=ms(l),u=o.reduce((h,p,w)=>h+ps(d[w],p),0),f=Number((u/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:f}})}}return i.sort(hs)};function ku(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-n,a=i-r;if(n<o&&r<i){const l=t.width*t.height,d=e.width*e.height,u=s*a,f=u/(l+d-u);return Number(f.toFixed(4))}return 0}const Su=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const i of n){const{id:s}=i,a=r.get(s);if(a){const l=ku(a,t);l>0&&o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(xu)};function Cu(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function vs(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:tt}function Eu(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...r})}}const ju=Eu(1);function xs(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Nu(e,t,r){const n=xs(t);if(!n)return e;const{scaleX:o,scaleY:i,x:s,y:a}=n,l=e.left-s-(1-o)*parseFloat(r),d=e.top-a-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),u=o?e.width/o:e.width,f=i?e.height/i:e.height;return{width:u,height:f,top:d,right:l+u,bottom:d+f,left:l}}const Tu={ignoreTransform:!1};function Kt(e,t){t===void 0&&(t=Tu);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:u}=We(e).getComputedStyle(e);d&&(r=Nu(r,d,u))}const{top:n,left:o,width:i,height:s,bottom:a,right:l}=r;return{top:n,left:o,width:i,height:s,bottom:a,right:l}}function ws(e){return Kt(e,{ignoreTransform:!0})}function Au(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function zu(e,t){return t===void 0&&(t=We(e).getComputedStyle(e)),t.position==="fixed"}function Pu(e,t){t===void 0&&(t=We(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?r.test(i):!1})}function hn(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(go(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!xr(o)||cs(o)||r.includes(o))return r;const i=We(e).getComputedStyle(o);return o!==e&&Pu(o,i)&&r.push(o),zu(o,i)?r:n(o.parentNode)}return e?n(e):r}function ys(e){const[t]=hn(e,1);return t??null}function xo(e){return!an||!e?null:Bt(e)?e:mo(e)?go(e)||e===Ht(e).scrollingElement?window:xr(e)?e:null:null}function ks(e){return Bt(e)?e.scrollX:e.scrollLeft}function Ss(e){return Bt(e)?e.scrollY:e.scrollTop}function wo(e){return{x:ks(e),y:Ss(e)}}var Me;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Me||(Me={}));function Cs(e){return!an||!e?!1:e===document.scrollingElement}function Es(e){const t={x:0,y:0},r=Cs(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=n.y,a=e.scrollLeft>=n.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:n,minScroll:t}}const Ou={x:.2,y:.2};function Iu(e,t,r,n,o){let{top:i,left:s,right:a,bottom:l}=r;n===void 0&&(n=10),o===void 0&&(o=Ou);const{isTop:d,isBottom:u,isLeft:f,isRight:h}=Es(e),p={x:0,y:0},w={x:0,y:0},m={height:t.height*o.y,width:t.width*o.x};return!d&&i<=t.top+m.height?(p.y=Me.Backward,w.y=n*Math.abs((t.top+m.height-i)/m.height)):!u&&l>=t.bottom-m.height&&(p.y=Me.Forward,w.y=n*Math.abs((t.bottom-m.height-l)/m.height)),!h&&a>=t.right-m.width?(p.x=Me.Forward,w.x=n*Math.abs((t.right-m.width-a)/m.width)):!f&&s<=t.left+m.width&&(p.x=Me.Backward,w.x=n*Math.abs((t.left+m.width-s)/m.width)),{direction:p,speed:w}}function Du(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:t,left:r,right:n,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:o,width:e.clientWidth,height:e.clientHeight}}function js(e){return e.reduce((t,r)=>Vt(t,wo(r)),tt)}function _u(e){return e.reduce((t,r)=>t+ks(r),0)}function Mu(e){return e.reduce((t,r)=>t+Ss(r),0)}function Ns(e,t){if(t===void 0&&(t=Kt),!e)return;const{top:r,left:n,bottom:o,right:i}=t(e);ys(e)&&(o<=0||i<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Ru=[["x",["left","right"],_u],["y",["top","bottom"],Mu]];class yo{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=hn(r),o=js(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of Ru)for(const l of s)Object.defineProperty(this,l,{get:()=>{const d=a(n),u=o[i]-d;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Cr{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var o;(o=this.target)==null||o.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function Lu(e){const{EventTarget:t}=We(e);return e instanceof t?e:Ht(e)}function ko(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var Ze;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ze||(Ze={}));function Ts(e){e.preventDefault()}function $u(e){e.stopPropagation()}var fe;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(fe||(fe={}));const As={start:[fe.Space,fe.Enter],cancel:[fe.Esc],end:[fe.Space,fe.Enter,fe.Tab]},Fu=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case fe.Right:return{...r,x:r.x+25};case fe.Left:return{...r,x:r.x-25};case fe.Down:return{...r,y:r.y+25};case fe.Up:return{...r,y:r.y-25}}};class So{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new Cr(Ht(r)),this.windowListeners=new Cr(We(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ze.Resize,this.handleCancel),this.windowListeners.add(Ze.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ze.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Ns(n),r(tt)}handleKeyDown(t){if(un(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:i=As,coordinateGetter:s=Fu,scrollBehavior:a="smooth"}=o,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:d}=n.current,u=d?{x:d.left,y:d.top}:tt;this.referenceCoordinates||(this.referenceCoordinates=u);const f=s(t,{active:r,context:n.current,currentCoordinates:u});if(f){const h=Sr(f,u),p={x:0,y:0},{scrollableAncestors:w}=n.current;for(const m of w){const v=t.code,{isTop:y,isRight:k,isLeft:x,isBottom:S,maxScroll:C,minScroll:E}=Es(m),N=Du(m),j={x:Math.min(v===fe.Right?N.right-N.width/2:N.right,Math.max(v===fe.Right?N.left:N.left+N.width/2,f.x)),y:Math.min(v===fe.Down?N.bottom-N.height/2:N.bottom,Math.max(v===fe.Down?N.top:N.top+N.height/2,f.y))},D=v===fe.Right&&!k||v===fe.Left&&!x,M=v===fe.Down&&!S||v===fe.Up&&!y;if(D&&j.x!==f.x){const I=m.scrollLeft+h.x,R=v===fe.Right&&I<=C.x||v===fe.Left&&I>=E.x;if(R&&!h.y){m.scrollTo({left:I,behavior:a});return}R?p.x=m.scrollLeft-I:p.x=v===fe.Right?m.scrollLeft-C.x:m.scrollLeft-E.x,p.x&&m.scrollBy({left:-p.x,behavior:a});break}else if(M&&j.y!==f.y){const I=m.scrollTop+h.y,R=v===fe.Down&&I<=C.y||v===fe.Up&&I>=E.y;if(R&&!h.x){m.scrollTo({top:I,behavior:a});return}R?p.y=m.scrollTop-I:p.y=v===fe.Down?m.scrollTop-C.y:m.scrollTop-E.y,p.y&&m.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(t,Vt(Sr(f,this.referenceCoordinates),p))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}So.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=As,onActivation:o}=t,{active:i}=r;const{code:s}=e.nativeEvent;if(n.start.includes(s)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function zs(e){return!!(e&&"distance"in e)}function Ps(e){return!!(e&&"delay"in e)}class Co{constructor(t,r,n){var o;n===void 0&&(n=Lu(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:i}=t,{target:s}=i;this.props=t,this.events=r,this.document=Ht(s),this.documentListeners=new Cr(this.document),this.listeners=new Cr(n),this.windowListeners=new Cr(We(s)),this.initialCoordinates=(o=fn(i))!=null?o:tt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ze.Resize,this.handleCancel),this.windowListeners.add(Ze.DragStart,Ts),this.windowListeners.add(Ze.VisibilityChange,this.handleCancel),this.windowListeners.add(Ze.ContextMenu,Ts),this.documentListeners.add(Ze.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ps(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(zs(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:o}=this.props;o(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ze.Click,$u,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ze.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;const l=(r=fn(t))!=null?r:tt,d=Sr(o,l);if(!n&&a){if(zs(a)){if(a.tolerance!=null&&ko(d,a.tolerance))return this.handleCancel();if(ko(d,a.distance))return this.handleStart()}if(Ps(a)&&ko(d,a.tolerance))return this.handleCancel();this.handlePending(a,d);return}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===fe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Wu={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Eo extends Co{constructor(t){const{event:r}=t,n=Ht(r.target);super(t,Wu,n)}}Eo.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const Uu={move:{name:"mousemove"},end:{name:"mouseup"}};var jo;(function(e){e[e.RightClick=2]="RightClick"})(jo||(jo={}));class Bu extends Co{constructor(t){super(t,Uu,Ht(t.event.target))}}Bu.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===jo.RightClick?!1:(n==null||n({event:r}),!0)}}];const No={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Os extends Co{constructor(t){super(t,No)}static setup(){return window.addEventListener(No.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(No.move.name,t)};function t(){}}}Os.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:o}=r;return o.length>1?!1:(n==null||n({event:r}),!0)}}];var Er;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Er||(Er={}));var mn;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(mn||(mn={}));function Hu(e){let{acceleration:t,activator:r=Er.Pointer,canScroll:n,draggingRect:o,enabled:i,interval:s=5,order:a=mn.TreeOrder,pointerCoordinates:l,scrollableAncestors:d,scrollableAncestorRects:u,delta:f,threshold:h}=e;const p=Ku({delta:f,disabled:!i}),[w,m]=ou(),v=g.useRef({x:0,y:0}),y=g.useRef({x:0,y:0}),k=g.useMemo(()=>{switch(r){case Er.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Er.DraggableRect:return o}},[r,o,l]),x=g.useRef(null),S=g.useCallback(()=>{const E=x.current;if(!E)return;const N=v.current.x*y.current.x,j=v.current.y*y.current.y;E.scrollBy(N,j)},[]),C=g.useMemo(()=>a===mn.TreeOrder?[...d].reverse():d,[a,d]);g.useEffect(()=>{if(!i||!d.length||!k){m();return}for(const E of C){if((n==null?void 0:n(E))===!1)continue;const N=d.indexOf(E),j=u[N];if(!j)continue;const{direction:D,speed:M}=Iu(E,j,k,t,h);for(const I of["x","y"])p[I][D[I]]||(M[I]=0,D[I]=0);if(M.x>0||M.y>0){m(),x.current=E,w(S,s),v.current=M,y.current=D;return}}v.current={x:0,y:0},y.current={x:0,y:0},m()},[t,S,n,m,i,s,JSON.stringify(k),JSON.stringify(p),w,d,C,u,JSON.stringify(h)])}const Vu={x:{[Me.Backward]:!1,[Me.Forward]:!1},y:{[Me.Backward]:!1,[Me.Forward]:!1}};function Ku(e){let{delta:t,disabled:r}=e;const n=dn(t);return yr(o=>{if(r||!n||!o)return Vu;const i={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Me.Backward]:o.x[Me.Backward]||i.x===-1,[Me.Forward]:o.x[Me.Forward]||i.x===1},y:{[Me.Backward]:o.y[Me.Backward]||i.y===-1,[Me.Forward]:o.y[Me.Forward]||i.y===1}}},[r,t,n])}function Gu(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return yr(o=>{var i;return t==null?null:(i=n??o)!=null?i:null},[n,t])}function Yu(e,t){return g.useMemo(()=>e.reduce((r,n)=>{const{sensor:o}=n,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,n)}));return[...r,...i]},[]),[e,t])}var jr;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(jr||(jr={}));var To;(function(e){e.Optimized="optimized"})(To||(To={}));const Is=new Map;function qu(e,t){let{dragging:r,dependencies:n,config:o}=t;const[i,s]=g.useState(null),{frequency:a,measure:l,strategy:d}=o,u=g.useRef(e),f=v(),h=wr(f),p=g.useCallback(function(y){y===void 0&&(y=[]),!h.current&&s(k=>k===null?y:k.concat(y.filter(x=>!k.includes(x))))},[h]),w=g.useRef(null),m=yr(y=>{if(f&&!r)return Is;if(!y||y===Is||u.current!==e||i!=null){const k=new Map;for(let x of e){if(!x)continue;if(i&&i.length>0&&!i.includes(x.id)&&x.rect.current){k.set(x.id,x.rect.current);continue}const S=x.node.current,C=S?new yo(l(S),S):null;x.rect.current=C,C&&k.set(x.id,C)}return k}return y},[e,i,r,f,l]);return g.useEffect(()=>{u.current=e},[e]),g.useEffect(()=>{f||p()},[r,f]),g.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),g.useEffect(()=>{f||typeof a!="number"||w.current!==null||(w.current=setTimeout(()=>{p(),w.current=null},a))},[a,f,p,...n]),{droppableRects:m,measureDroppableContainers:p,measuringScheduled:i!=null};function v(){switch(d){case jr.Always:return!1;case jr.BeforeDragging:return r;default:return!r}}}function Ao(e,t){return yr(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Xu(e,t){return Ao(e,t)}function Ju(e){let{callback:t,disabled:r}=e;const n=ln(t),o=g.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(n)},[n,r]);return g.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function gn(e){let{callback:t,disabled:r}=e;const n=ln(t),o=g.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(n)},[r]);return g.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Zu(e){return new yo(Kt(e),e)}function Ds(e,t,r){t===void 0&&(t=Zu);const[n,o]=g.useState(null);function i(){o(l=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=l??r)!=null?d:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u})}const s=Ju({callback(l){if(e)for(const d of l){const{type:u,target:f}=d;if(u==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),a=gn({callback:i});return et(()=>{i(),e?(a==null||a.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),s==null||s.disconnect())},[e]),n}function Qu(e){const t=Ao(e);return vs(e,t)}const _s=[];function ef(e){const t=g.useRef(e),r=yr(n=>e?n&&n!==_s&&e&&t.current&&e.parentNode===t.current.parentNode?n:hn(e):_s,[e]);return g.useEffect(()=>{t.current=e},[e]),r}function tf(e){const[t,r]=g.useState(null),n=g.useRef(e),o=g.useCallback(i=>{const s=xo(i.target);s&&r(a=>a?(a.set(s,wo(s)),new Map(a)):null)},[]);return g.useEffect(()=>{const i=n.current;if(e!==i){s(i);const a=e.map(l=>{const d=xo(l);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,wo(d)]):null}).filter(l=>l!=null);r(a.length?new Map(a):null),n.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(l=>{const d=xo(l);d==null||d.removeEventListener("scroll",o)})}},[o,e]),g.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>Vt(i,s),tt):js(e):tt,[e,t])}function Ms(e,t){t===void 0&&(t=[]);const r=g.useRef(null);return g.useEffect(()=>{r.current=null},t),g.useEffect(()=>{const n=e!==tt;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?Sr(e,r.current):tt}function rf(e){g.useEffect(()=>{if(!an)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function nf(e,t){return g.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:i}=n;return r[o]=s=>{i(s,t)},r},{}),[e,t])}function Rs(e){return g.useMemo(()=>e?Au(e):null,[e])}const Ls=[];function of(e,t){t===void 0&&(t=Kt);const[r]=e,n=Rs(r?We(r):null),[o,i]=g.useState(Ls);function s(){i(()=>e.length?e.map(l=>Cs(l)?n:new yo(t(l),l)):Ls)}const a=gn({callback:s});return et(()=>{a==null||a.disconnect(),s(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),o}function $s(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return xr(t)?t:e}function sf(e){let{measure:t}=e;const[r,n]=g.useState(null),o=g.useCallback(d=>{for(const{target:u}of d)if(xr(u)){n(f=>{const h=t(u);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),i=gn({callback:o}),s=g.useCallback(d=>{const u=$s(d);i==null||i.disconnect(),u&&(i==null||i.observe(u)),n(u?t(u):null)},[t,i]),[a,l]=cn(s);return g.useMemo(()=>({nodeRef:a,rect:r,setRef:l}),[r,a,l])}const af=[{sensor:Eo,options:{}},{sensor:So,options:{}}],lf={current:{}},bn={draggable:{measure:ws},droppable:{measure:ws,strategy:jr.WhileDragging,frequency:To.Optimized},dragOverlay:{measure:Kt}};class Nr extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const cf={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Nr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:pn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:bn,measureDroppableContainers:pn,windowRect:null,measuringScheduled:!1},Fs={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:pn,draggableNodes:new Map,over:null,measureDroppableContainers:pn},Tr=g.createContext(Fs),Ws=g.createContext(cf);function df(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Nr}}}function uf(e,t){switch(t.type){case Ie.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Ie.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Ie.DragEnd:case Ie.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ie.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new Nr(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case Ie.SetDroppableDisabled:{const{id:r,key:n,disabled:o}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const s=new Nr(e.droppable.containers);return s.set(r,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case Ie.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const i=new Nr(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function ff(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=g.useContext(Tr),i=dn(n),s=dn(r==null?void 0:r.id);return g.useEffect(()=>{if(!t&&!n&&i&&s!=null){if(!un(i)||document.activeElement===i.target)return;const a=o.get(s);if(!a)return;const{activatorNode:l,node:d}=a;if(!l.current&&!d.current)return;requestAnimationFrame(()=>{for(const u of[l.current,d.current]){if(!u)continue;const f=au(u);if(f){f.focus();break}}})}},[n,t,o,s,i]),null}function Us(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...n}),r):r}function pf(e){return g.useMemo(()=>({draggable:{...bn.draggable,...e==null?void 0:e.draggable},droppable:{...bn.droppable,...e==null?void 0:e.droppable},dragOverlay:{...bn.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function hf(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const i=g.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;et(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!n)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const u=r(d),f=vs(u,n);if(s||(f.x=0),a||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=ys(d);h&&h.scrollBy({top:f.y,left:f.x})}},[t,s,a,n,r])}const vn=g.createContext({...tt,scaleX:1,scaleY:1});var yt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(yt||(yt={}));const mf=g.memo(function(t){var r,n,o,i;let{id:s,accessibility:a,autoScroll:l=!0,children:d,sensors:u=af,collisionDetection:f=Su,measuring:h,modifiers:p,...w}=t;const m=g.useReducer(uf,void 0,df),[v,y]=m,[k,x]=pu(),[S,C]=g.useState(yt.Uninitialized),E=S===yt.Initialized,{draggable:{active:N,nodes:j,translate:D},droppable:{containers:M}}=v,I=N!=null?j.get(N):null,R=g.useRef({initial:null,translated:null}),L=g.useMemo(()=>{var pe;return N!=null?{id:N,data:(pe=I==null?void 0:I.data)!=null?pe:lf,rect:R}:null},[N,I]),K=g.useRef(null),[B,W]=g.useState(null),[U,A]=g.useState(null),J=wr(w,Object.values(w)),oe=kr("DndDescribedBy",s),T=g.useMemo(()=>M.getEnabled(),[M]),F=pf(h),{droppableRects:X,measureDroppableContainers:G,measuringScheduled:ve}=qu(T,{dragging:E,dependencies:[D.x,D.y],config:F.droppable}),le=Gu(j,N),P=g.useMemo(()=>U?fn(U):null,[U]),Q=ge(),ee=Xu(le,F.draggable.measure);hf({activeNode:N!=null?j.get(N):null,config:Q.layoutShiftCompensation,initialRect:ee,measure:F.draggable.measure});const $=Ds(le,F.draggable.measure,ee),ie=Ds(le?le.parentElement:null),te=g.useRef({activatorEvent:null,active:null,activeNode:le,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:M,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ke=M.getNodeFor((r=te.current.over)==null?void 0:r.id),we=sf({measure:F.dragOverlay.measure}),De=(n=we.nodeRef.current)!=null?n:le,Re=E?(o=we.rect)!=null?o:$:null,Be=!!(we.nodeRef.current&&we.rect),Ne=Qu(Be?null:$),Xe=Rs(De?We(De):null),He=ef(E?ke??le:null),Ve=of(He),gt=Us(p,{transform:{x:D.x-Ne.x,y:D.y-Ne.y,scaleX:1,scaleY:1},activatorEvent:U,active:L,activeNodeRect:$,containerNodeRect:ie,draggingNodeRect:Re,over:te.current.over,overlayNodeRect:we.rect,scrollableAncestors:He,scrollableAncestorRects:Ve,windowRect:Xe}),Tt=P?Vt(P,D):null,Qe=tf(He),cr=Ms(Qe),_=Ms(Qe,[$]),re=Vt(gt,cr),ne=Re?ju(Re,gt):null,he=L&&ne?f({active:L,collisionRect:ne,droppableRects:X,droppableContainers:T,pointerCoordinates:Tt}):null,Le=gs(he,"id"),[Ce,_e]=g.useState(null),dr=Be?gt:Vt(gt,_),Ee=Cu(dr,(i=Ce==null?void 0:Ce.rect)!=null?i:null,$),z=g.useRef(null),O=g.useCallback((pe,ue)=>{let{sensor:ze,options:it}=ue;if(K.current==null)return;const xe=j.get(K.current);if(!xe)return;const Te=pe.nativeEvent,Ke=new ze({active:K.current,activeNode:xe,event:Te,options:it,context:te,onAbort(Ae){if(!j.get(Ae))return;const{onDragAbort:ft}=J.current,bt={id:Ae};ft==null||ft(bt),k({type:"onDragAbort",event:bt})},onPending(Ae,$e,ft,bt){if(!j.get(Ae))return;const{onDragPending:Hr}=J.current,At={id:Ae,constraint:$e,initialCoordinates:ft,offset:bt};Hr==null||Hr(At),k({type:"onDragPending",event:At})},onStart(Ae){const $e=K.current;if($e==null)return;const ft=j.get($e);if(!ft)return;const{onDragStart:bt}=J.current,Br={activatorEvent:Te,active:{id:$e,data:ft.data,rect:R}};vt.unstable_batchedUpdates(()=>{bt==null||bt(Br),C(yt.Initializing),y({type:Ie.DragStart,initialCoordinates:Ae,active:$e}),k({type:"onDragStart",event:Br}),W(z.current),A(Te)})},onMove(Ae){y({type:Ie.DragMove,coordinates:Ae})},onEnd:ut(Ie.DragEnd),onCancel:ut(Ie.DragCancel)});z.current=Ke;function ut(Ae){return async function(){const{active:ft,collisions:bt,over:Br,scrollAdjustedTranslate:Hr}=te.current;let At=null;if(ft&&Hr){const{cancelDrop:Vr}=J.current;At={activatorEvent:Te,active:ft,collisions:bt,delta:Hr,over:Br},Ae===Ie.DragEnd&&typeof Vr=="function"&&await Promise.resolve(Vr(At))&&(Ae=Ie.DragCancel)}K.current=null,vt.unstable_batchedUpdates(()=>{y({type:Ae}),C(yt.Uninitialized),_e(null),W(null),A(null),z.current=null;const Vr=Ae===Ie.DragEnd?"onDragEnd":"onDragCancel";if(At){const Ai=J.current[Vr];Ai==null||Ai(At),k({type:Vr,event:At})}})}}},[j]),Y=g.useCallback((pe,ue)=>(ze,it)=>{const xe=ze.nativeEvent,Te=j.get(it);if(K.current!==null||!Te||xe.dndKit||xe.defaultPrevented)return;const Ke={active:Te};pe(ze,ue.options,Ke)===!0&&(xe.dndKit={capturedBy:ue.sensor},K.current=it,O(ze,ue))},[j,O]),q=Yu(u,Y);rf(u),et(()=>{$&&S===yt.Initializing&&C(yt.Initialized)},[$,S]),g.useEffect(()=>{const{onDragMove:pe}=J.current,{active:ue,activatorEvent:ze,collisions:it,over:xe}=te.current;if(!ue||!ze)return;const Te={active:ue,activatorEvent:ze,collisions:it,delta:{x:re.x,y:re.y},over:xe};vt.unstable_batchedUpdates(()=>{pe==null||pe(Te),k({type:"onDragMove",event:Te})})},[re.x,re.y]),g.useEffect(()=>{const{active:pe,activatorEvent:ue,collisions:ze,droppableContainers:it,scrollAdjustedTranslate:xe}=te.current;if(!pe||K.current==null||!ue||!xe)return;const{onDragOver:Te}=J.current,Ke=it.get(Le),ut=Ke&&Ke.rect.current?{id:Ke.id,rect:Ke.rect.current,data:Ke.data,disabled:Ke.disabled}:null,Ae={active:pe,activatorEvent:ue,collisions:ze,delta:{x:xe.x,y:xe.y},over:ut};vt.unstable_batchedUpdates(()=>{_e(ut),Te==null||Te(Ae),k({type:"onDragOver",event:Ae})})},[Le]),et(()=>{te.current={activatorEvent:U,active:L,activeNode:le,collisionRect:ne,collisions:he,droppableRects:X,draggableNodes:j,draggingNode:De,draggingNodeRect:Re,droppableContainers:M,over:Ce,scrollableAncestors:He,scrollAdjustedTranslate:re},R.current={initial:Re,translated:ne}},[L,le,he,ne,j,De,Re,X,M,Ce,He,re]),Hu({...Q,delta:D,draggingRect:ne,pointerCoordinates:Tt,scrollableAncestors:He,scrollableAncestorRects:Ve});const Z=g.useMemo(()=>({active:L,activeNode:le,activeNodeRect:$,activatorEvent:U,collisions:he,containerNodeRect:ie,dragOverlay:we,draggableNodes:j,droppableContainers:M,droppableRects:X,over:Ce,measureDroppableContainers:G,scrollableAncestors:He,scrollableAncestorRects:Ve,measuringConfiguration:F,measuringScheduled:ve,windowRect:Xe}),[L,le,$,U,he,ie,we,j,M,X,Ce,G,He,Ve,F,ve,Xe]),ae=g.useMemo(()=>({activatorEvent:U,activators:q,active:L,activeNodeRect:$,ariaDescribedById:{draggable:oe},dispatch:y,draggableNodes:j,over:Ce,measureDroppableContainers:G}),[U,q,L,$,y,oe,j,Ce,G]);return g.createElement(fs.Provider,{value:x},g.createElement(Tr.Provider,{value:ae},g.createElement(Ws.Provider,{value:Z},g.createElement(vn.Provider,{value:Ee},d)),g.createElement(ff,{disabled:(a==null?void 0:a.restoreFocus)===!1})),g.createElement(gu,{...a,hiddenTextDescribedById:oe}));function ge(){const pe=(B==null?void 0:B.autoScrollEnabled)===!1,ue=typeof l=="object"?l.enabled===!1:l===!1,ze=E&&!pe&&!ue;return typeof l=="object"?{...l,enabled:ze}:{enabled:ze}}}),gf=g.createContext(null),Bs="button",bf="Draggable";function vf(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const i=kr(bf),{activators:s,activatorEvent:a,active:l,activeNodeRect:d,ariaDescribedById:u,draggableNodes:f,over:h}=g.useContext(Tr),{role:p=Bs,roleDescription:w="draggable",tabIndex:m=0}=o??{},v=(l==null?void 0:l.id)===t,y=g.useContext(v?vn:gf),[k,x]=cn(),[S,C]=cn(),E=nf(s,t),N=wr(r);et(()=>(f.set(t,{id:t,key:i,node:k,activatorNode:S,data:N}),()=>{const D=f.get(t);D&&D.key===i&&f.delete(t)}),[f,t]);const j=g.useMemo(()=>({role:p,tabIndex:m,"aria-disabled":n,"aria-pressed":v&&p===Bs?!0:void 0,"aria-roledescription":w,"aria-describedby":u.draggable}),[n,p,m,v,w,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:d,attributes:j,isDragging:v,listeners:n?void 0:E,node:k,over:h,setNodeRef:x,setActivatorNodeRef:C,transform:y}}function Hs(){return g.useContext(Ws)}const xf="Droppable",wf={timeout:25};function yf(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const i=kr(xf),{active:s,dispatch:a,over:l,measureDroppableContainers:d}=g.useContext(Tr),u=g.useRef({disabled:r}),f=g.useRef(!1),h=g.useRef(null),p=g.useRef(null),{disabled:w,updateMeasurementsFor:m,timeout:v}={...wf,...o},y=wr(m??n),k=g.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{d(Array.isArray(y.current)?y.current:[y.current]),p.current=null},v)},[v]),x=gn({callback:k,disabled:w||!s}),S=g.useCallback((j,D)=>{x&&(D&&(x.unobserve(D),f.current=!1),j&&x.observe(j))},[x]),[C,E]=cn(S),N=wr(t);return g.useEffect(()=>{!x||!C.current||(x.disconnect(),f.current=!1,x.observe(C.current))},[C,x]),g.useEffect(()=>(a({type:Ie.RegisterDroppable,element:{id:n,key:i,disabled:r,node:C,rect:h,data:N}}),()=>a({type:Ie.UnregisterDroppable,key:i,id:n})),[n]),g.useEffect(()=>{r!==u.current.disabled&&(a({type:Ie.SetDroppableDisabled,id:n,key:i,disabled:r}),u.current.disabled=r)},[n,i,r,a]),{active:s,rect:h,isOver:(l==null?void 0:l.id)===n,node:C,over:l,setNodeRef:E}}function kf(e){let{animation:t,children:r}=e;const[n,o]=g.useState(null),[i,s]=g.useState(null),a=dn(r);return!r&&!n&&a&&o(a),et(()=>{if(!i)return;const l=n==null?void 0:n.key,d=n==null?void 0:n.props.id;if(l==null||d==null){o(null);return}Promise.resolve(t(d,i)).then(()=>{o(null)})},[t,n,i]),g.createElement(g.Fragment,null,r,n?g.cloneElement(n,{ref:s}):null)}const Sf={x:0,y:0,scaleX:1,scaleY:1};function Cf(e){let{children:t}=e;return g.createElement(Tr.Provider,{value:Fs},g.createElement(vn.Provider,{value:Sf},t))}const Ef={position:"fixed",touchAction:"none"},jf=e=>un(e)?"transform 250ms ease":void 0,Nf=g.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:o,children:i,className:s,rect:a,style:l,transform:d,transition:u=jf}=e;if(!a)return null;const f=o?d:{...d,scaleX:1,scaleY:1},h={...Ef,width:a.width,height:a.height,top:a.top,left:a.left,transform:wt.Transform.toString(f),transformOrigin:o&&n?vu(n,a):void 0,transition:typeof u=="function"?u(n):u,...l};return g.createElement(r,{className:s,style:h,ref:t},i)}),Tf={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:wt.Transform.toString(t)},{transform:wt.Transform.toString(r)}]},sideEffects:(e=>t=>{let{active:r,dragOverlay:n}=t;const o={},{styles:i,className:s}=e;if(i!=null&&i.active)for(const[a,l]of Object.entries(i.active))l!==void 0&&(o[a]=r.node.style.getPropertyValue(a),r.node.style.setProperty(a,l));if(i!=null&&i.dragOverlay)for(const[a,l]of Object.entries(i.dragOverlay))l!==void 0&&n.node.style.setProperty(a,l);return s!=null&&s.active&&r.node.classList.add(s.active),s!=null&&s.dragOverlay&&n.node.classList.add(s.dragOverlay),function(){for(const[l,d]of Object.entries(o))r.node.style.setProperty(l,d);s!=null&&s.active&&r.node.classList.remove(s.active)}})({styles:{active:{opacity:"0"}}})};function Af(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:o}=e;return ln((i,s)=>{if(t===null)return;const a=r.get(i);if(!a)return;const l=a.node.current;if(!l)return;const d=$s(s);if(!d)return;const{transform:u}=We(s).getComputedStyle(s),f=xs(u);if(!f)return;const h=typeof t=="function"?t:zf(t);return Ns(l,o.draggable.measure),h({active:{id:i,data:a.data,node:l,rect:o.draggable.measure(l)},draggableNodes:r,dragOverlay:{node:s,rect:o.dragOverlay.measure(d)},droppableContainers:n,measuringConfiguration:o,transform:f})})}function zf(e){const{duration:t,easing:r,sideEffects:n,keyframes:o}={...Tf,...e};return i=>{let{active:s,dragOverlay:a,transform:l,...d}=i;if(!t)return;const u={x:a.rect.left-s.rect.left,y:a.rect.top-s.rect.top},f={scaleX:l.scaleX!==1?s.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?s.rect.height*l.scaleY/a.rect.height:1},h={x:l.x-u.x,y:l.y-u.y,...f},p=o({...d,active:s,dragOverlay:a,transform:{initial:l,final:h}}),[w]=p,m=p[p.length-1];if(JSON.stringify(w)===JSON.stringify(m))return;const v=n==null?void 0:n({active:s,dragOverlay:a,...d}),y=a.node.animate(p,{duration:t,easing:r,fill:"forwards"});return new Promise(k=>{y.onfinish=()=>{v==null||v(),k()}})}}let Vs=0;function Pf(e){return g.useMemo(()=>{if(e!=null)return Vs++,Vs},[e])}const Of=g.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:o,transition:i,modifiers:s,wrapperElement:a="div",className:l,zIndex:d=999}=e;const{activatorEvent:u,active:f,activeNodeRect:h,containerNodeRect:p,draggableNodes:w,droppableContainers:m,dragOverlay:v,over:y,measuringConfiguration:k,scrollableAncestors:x,scrollableAncestorRects:S,windowRect:C}=Hs(),E=g.useContext(vn),N=Pf(f==null?void 0:f.id),j=Us(s,{activatorEvent:u,active:f,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:v.rect,over:y,overlayNodeRect:v.rect,scrollableAncestors:x,scrollableAncestorRects:S,transform:E,windowRect:C}),D=Ao(h),M=Af({config:n,draggableNodes:w,droppableContainers:m,measuringConfiguration:k}),I=D?v.setRef:void 0;return g.createElement(Cf,null,g.createElement(kf,{animation:M},f&&N?g.createElement(Nf,{key:N,id:f.id,ref:I,as:a,activatorEvent:u,adjustScale:t,className:l,transition:i,rect:D,style:{zIndex:d,...o},transform:j},r):null))}),If=e=>{let{transform:t}=e;return{...t,x:0}};function Ks(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function Df(e,t){return e.reduce((r,n,o)=>{const i=t.get(n);return i&&(r[o]=i),r},Array(e.length))}function xn(e){return e!==null&&e>=0}function _f(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function Mf(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Gs=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const i=Ks(t,n,r),s=t[o],a=i[o];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},wn={scaleX:1,scaleY:1},Rf=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:o,rects:i,overIndex:s}=e;const a=(t=i[r])!=null?t:n;if(!a)return null;if(o===r){const d=i[s];return d?{x:0,y:r<s?d.top+d.height-(a.top+a.height):d.top-a.top,...wn}:null}const l=Lf(i,o,r);return o>r&&o<=s?{x:0,y:-a.height-l,...wn}:o<r&&o>=s?{x:0,y:a.height+l,...wn}:{x:0,y:0,...wn}};function Lf(e,t,r){const n=e[t],o=e[t-1],i=e[t+1];return n?r<t?o?n.top-(o.top+o.height):i?i.top-(n.top+n.height):0:i?i.top-(n.top+n.height):o?n.top-(o.top+o.height):0:0}const Ys="Sortable",qs=g.createContext({activeIndex:-1,containerId:Ys,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Gs,disabled:{draggable:!1,droppable:!1}});function $f(e){let{children:t,id:r,items:n,strategy:o=Gs,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:d,measureDroppableContainers:u}=Hs(),f=kr(Ys,r),h=a.rect!==null,p=g.useMemo(()=>n.map(E=>typeof E=="object"&&"id"in E?E.id:E),[n]),w=s!=null,m=s?p.indexOf(s.id):-1,v=d?p.indexOf(d.id):-1,y=g.useRef(p),k=!_f(p,y.current),x=v!==-1&&m===-1||k,S=Mf(i);et(()=>{k&&w&&u(p)},[k,p,w,u]),g.useEffect(()=>{y.current=p},[p]);const C=g.useMemo(()=>({activeIndex:m,containerId:f,disabled:S,disableTransforms:x,items:p,overIndex:v,useDragOverlay:h,sortedRects:Df(p,l),strategy:o}),[m,f,S.draggable,S.droppable,x,p,v,l,h,o]);return g.createElement(qs.Provider,{value:C},t)}const Ff=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return Ks(r,n,o).indexOf(t)},Wf=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:l,transition:d}=e;return!d||!n||a!==i&&o===s?!1:r?!0:s!==o&&t===l},Uf={duration:200,easing:"ease"},Xs="transform",Bf=wt.Transition.toString({property:Xs,duration:0,easing:"linear"}),Hf={roleDescription:"sortable"};function Vf(e){let{disabled:t,index:r,node:n,rect:o}=e;const[i,s]=g.useState(null),a=g.useRef(r);return et(()=>{if(!t&&r!==a.current&&n.current){const l=o.current;if(l){const d=Kt(n.current,{ignoreTransform:!0}),u={x:l.left-d.left,y:l.top-d.top,scaleX:l.width/d.width,scaleY:l.height/d.height};(u.x||u.y)&&s(u)}}r!==a.current&&(a.current=r)},[t,r,n,o]),g.useEffect(()=>{i&&s(null)},[i]),i}function Kf(e){let{animateLayoutChanges:t=Wf,attributes:r,disabled:n,data:o,getNewIndex:i=Ff,id:s,strategy:a,resizeObserverConfig:l,transition:d=Uf}=e;const{items:u,containerId:f,activeIndex:h,disabled:p,disableTransforms:w,sortedRects:m,overIndex:v,useDragOverlay:y,strategy:k}=g.useContext(qs),x=Gf(n,p),S=u.indexOf(s),C=g.useMemo(()=>({sortable:{containerId:f,index:S,items:u},...o}),[f,o,S,u]),E=g.useMemo(()=>u.slice(u.indexOf(s)),[u,s]),{rect:N,node:j,isOver:D,setNodeRef:M}=yf({id:s,data:C,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...l}}),{active:I,activatorEvent:R,activeNodeRect:L,attributes:K,setNodeRef:B,listeners:W,isDragging:U,over:A,setActivatorNodeRef:J,transform:oe}=vf({id:s,data:C,attributes:{...Hf,...r},disabled:x.draggable}),T=nu(M,B),F=!!I,X=F&&!w&&xn(h)&&xn(v),G=!y&&U,ve=G&&X?oe:null,P=X?ve??(a??k)({rects:m,activeNodeRect:L,activeIndex:h,overIndex:v,index:S}):null,Q=xn(h)&&xn(v)?i({id:s,items:u,activeIndex:h,overIndex:v}):S,ee=I==null?void 0:I.id,$=g.useRef({activeId:ee,items:u,newIndex:Q,containerId:f}),ie=u!==$.current.items,te=t({active:I,containerId:f,isDragging:U,isSorting:F,id:s,index:S,items:u,newIndex:$.current.newIndex,previousItems:$.current.items,previousContainerId:$.current.containerId,transition:d,wasDragging:$.current.activeId!=null}),ke=Vf({disabled:!te,index:S,node:j,rect:N});return g.useEffect(()=>{F&&$.current.newIndex!==Q&&($.current.newIndex=Q),f!==$.current.containerId&&($.current.containerId=f),u!==$.current.items&&($.current.items=u)},[F,Q,f,u]),g.useEffect(()=>{if(ee===$.current.activeId)return;if(ee!=null&&$.current.activeId==null){$.current.activeId=ee;return}const De=setTimeout(()=>{$.current.activeId=ee},50);return()=>clearTimeout(De)},[ee]),{active:I,activeIndex:h,attributes:K,data:C,rect:N,index:S,newIndex:Q,items:u,isOver:D,isSorting:F,isDragging:U,listeners:W,node:j,overIndex:v,over:A,setNodeRef:T,setActivatorNodeRef:J,setDroppableNodeRef:M,setDraggableNodeRef:B,transform:ke??P,transition:we()};function we(){if(ke||ie&&$.current.newIndex===S)return Bf;if(!(G&&!un(R)||!d)&&(F||te))return wt.Transition.toString({...d,property:Xs})}}function Gf(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function yn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Yf=[fe.Down,fe.Right,fe.Up,fe.Left],qf=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:i,over:s,scrollableAncestors:a}}=t;if(Yf.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];i.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const h=o.get(f.id);if(h)switch(e.code){case fe.Down:n.top<h.top&&l.push(f);break;case fe.Up:n.top>h.top&&l.push(f);break;case fe.Left:n.left>h.left&&l.push(f);break;case fe.Right:n.left<h.left&&l.push(f);break}});const d=yu({collisionRect:n,droppableRects:o,droppableContainers:l});let u=gs(d,"id");if(u===(s==null?void 0:s.id)&&d.length>1&&(u=d[1].id),u!=null){const f=i.get(r.id),h=i.get(u),p=h?o.get(h.id):null,w=h==null?void 0:h.node.current;if(w&&p&&f&&h){const v=hn(w).some((E,N)=>a[N]!==E),y=Js(f,h),k=Xf(f,h),x=v||!y?{x:0,y:0}:{x:k?n.width-p.width:0,y:k?n.height-p.height:0},S={x:p.left,y:p.top};return x.x&&x.y?S:Sr(S,x)}}}};function Js(e,t){return!yn(e)||!yn(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Xf(e,t){return!yn(e)||!yn(t)||!Js(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function zo({className:e,type:t,...r}){return c.jsx("input",{type:t,className:se("h-8 rounded-lg border border-zinc-800 bg-zinc-900/50 px-2.5 py-1 text-sm outline-none transition-colors focus:ring-2 focus:ring-blue-600",e),...r})}function Jf({className:e,...t}){return c.jsx("textarea",{className:se("min-h-16 w-full rounded-lg border border-zinc-800 bg-zinc-900/50 px-2.5 py-2 text-sm outline-none transition-colors focus:ring-2 focus:ring-blue-600 resize-none",e),...t})}function Zf({className:e,checked:t,onCheckedChange:r,...n}){return c.jsx("input",{type:"checkbox",checked:t,onChange:o=>r==null?void 0:r(o.target.checked),className:se("size-4 rounded border border-zinc-700 bg-zinc-900 text-blue-600 focus:ring-2 focus:ring-blue-600",e),...n})}function It({className:e,...t}){return c.jsx("label",{className:se("text-sm font-medium leading-none select-none",e),...t})}function Zs(e,[t,r]){return Math.min(r,Math.max(t,e))}function me(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Ar(e,t=[]){let r=[];function n(i,s){const a=b.createContext(s),l=r.length;r=[...r,s];const d=f=>{var y;const{scope:h,children:p,...w}=f,m=((y=h==null?void 0:h[e])==null?void 0:y[l])||a,v=b.useMemo(()=>w,Object.values(w));return c.jsx(m.Provider,{value:v,children:p})};d.displayName=i+"Provider";function u(f,h){var m;const p=((m=h==null?void 0:h[e])==null?void 0:m[l])||a,w=b.useContext(p);if(w)return w;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[d,u]}const o=()=>{const i=r.map(s=>b.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return b.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[n,Qf(o,...t)]}function Qf(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((a,{useScope:l,scopeName:d})=>{const f=l(i)[`__scope${d}`];return{...a,...f}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}function Qs(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ea(...e){return t=>{let r=!1;const n=e.map(o=>{const i=Qs(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():Qs(e[o],null)}}}}function je(...e){return b.useCallback(ea(...e),e)}function Gt(e){const t=tp(e),r=b.forwardRef((n,o)=>{const{children:i,...s}=n,a=b.Children.toArray(i),l=a.find(np);if(l){const d=l.props.children,u=a.map(f=>f===l?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...s,ref:o,children:b.isValidElement(d)?b.cloneElement(d,void 0,u):null})}return c.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var ep=Gt("Slot");function tp(e){const t=b.forwardRef((r,n)=>{const{children:o,...i}=r;if(b.isValidElement(o)){const s=ip(o),a=op(i,o.props);return o.type!==b.Fragment&&(a.ref=n?ea(n,s):s),b.cloneElement(o,a)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ta=Symbol("radix.slottable");function rp(e){const t=({children:r})=>c.jsx(c.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=ta,t}function np(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ta}function op(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function ip(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function sp(e){const t=e+"CollectionProvider",[r,n]=Ar(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:v,children:y}=m,k=g.useRef(null),x=g.useRef(new Map).current;return c.jsx(o,{scope:v,itemMap:x,collectionRef:k,children:y})};s.displayName=t;const a=e+"CollectionSlot",l=Gt(a),d=g.forwardRef((m,v)=>{const{scope:y,children:k}=m,x=i(a,y),S=je(v,x.collectionRef);return c.jsx(l,{ref:S,children:k})});d.displayName=a;const u=e+"CollectionItemSlot",f="data-radix-collection-item",h=Gt(u),p=g.forwardRef((m,v)=>{const{scope:y,children:k,...x}=m,S=g.useRef(null),C=je(v,S),E=i(u,y);return g.useEffect(()=>(E.itemMap.set(S,{ref:S,...x}),()=>void E.itemMap.delete(S))),c.jsx(h,{[f]:"",ref:C,children:k})});p.displayName=u;function w(m){const v=i(e+"CollectionConsumer",m);return g.useCallback(()=>{const k=v.collectionRef.current;if(!k)return[];const x=Array.from(k.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((E,N)=>x.indexOf(E.ref.current)-x.indexOf(N.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:d,ItemSlot:p},w,n]}var ap=b.createContext(void 0);function lp(e){const t=b.useContext(ap);return e||t||"ltr"}var cp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Se=cp.reduce((e,t)=>{const r=Gt(`Primitive.${t}`),n=b.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function dp(e,t){e&&Kr.flushSync(()=>e.dispatchEvent(t))}function Dt(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function up(e,t=globalThis==null?void 0:globalThis.document){const r=Dt(e);b.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var fp="DismissableLayer",Po="dismissableLayer.update",pp="dismissableLayer.pointerDownOutside",hp="dismissableLayer.focusOutside",ra,na=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),kn=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,d=b.useContext(na),[u,f]=b.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=b.useState({}),w=je(t,N=>f(N)),m=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(v),k=u?m.indexOf(u):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,S=k>=y,C=bp(N=>{const j=N.target,D=[...d.branches].some(M=>M.contains(j));!S||D||(o==null||o(N),s==null||s(N),N.defaultPrevented||a==null||a())},h),E=vp(N=>{const j=N.target;[...d.branches].some(M=>M.contains(j))||(i==null||i(N),s==null||s(N),N.defaultPrevented||a==null||a())},h);return up(N=>{k===d.layers.size-1&&(n==null||n(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},h),b.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ra=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),oa(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=ra)}},[u,h,r,d]),b.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),oa())},[u,d]),b.useEffect(()=>{const N=()=>p({});return document.addEventListener(Po,N),()=>document.removeEventListener(Po,N)},[]),c.jsx(Se.div,{...l,ref:w,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:me(e.onFocusCapture,E.onFocusCapture),onBlurCapture:me(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:me(e.onPointerDownCapture,C.onPointerDownCapture)})});kn.displayName=fp;var mp="DismissableLayerBranch",gp=b.forwardRef((e,t)=>{const r=b.useContext(na),n=b.useRef(null),o=je(t,n);return b.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),c.jsx(Se.div,{...e,ref:o})});gp.displayName=mp;function bp(e,t=globalThis==null?void 0:globalThis.document){const r=Dt(e),n=b.useRef(!1),o=b.useRef(()=>{});return b.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let l=function(){ia(pp,r,d,{discrete:!0})};const d={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function vp(e,t=globalThis==null?void 0:globalThis.document){const r=Dt(e),n=b.useRef(!1);return b.useEffect(()=>{const o=i=>{i.target&&!n.current&&ia(hp,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function oa(){const e=new CustomEvent(Po);document.dispatchEvent(e)}function ia(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?dp(o,i):o.dispatchEvent(i)}var Oo=0;function sa(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??aa()),document.body.insertAdjacentElement("beforeend",e[1]??aa()),Oo++,()=>{Oo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Oo--}},[])}function aa(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Io="focusScope.autoFocusOnMount",Do="focusScope.autoFocusOnUnmount",la={bubbles:!1,cancelable:!0},xp="FocusScope",_o=b.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=b.useState(null),d=Dt(o),u=Dt(i),f=b.useRef(null),h=je(t,m=>l(m)),p=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(n){let m=function(x){if(p.paused||!a)return;const S=x.target;a.contains(S)?f.current=S:kt(f.current,{select:!0})},v=function(x){if(p.paused||!a)return;const S=x.relatedTarget;S!==null&&(a.contains(S)||kt(f.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const C of x)C.removedNodes.length>0&&kt(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const k=new MutationObserver(y);return a&&k.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),k.disconnect()}}},[n,a,p.paused]),b.useEffect(()=>{if(a){ua.add(p);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(Io,la);a.addEventListener(Io,d),a.dispatchEvent(y),y.defaultPrevented||(wp(Ep(ca(a)),{select:!0}),document.activeElement===m&&kt(a))}return()=>{a.removeEventListener(Io,d),setTimeout(()=>{const y=new CustomEvent(Do,la);a.addEventListener(Do,u),a.dispatchEvent(y),y.defaultPrevented||kt(m??document.body,{select:!0}),a.removeEventListener(Do,u),ua.remove(p)},0)}}},[a,d,u,p]);const w=b.useCallback(m=>{if(!r&&!n||p.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(v&&y){const k=m.currentTarget,[x,S]=yp(k);x&&S?!m.shiftKey&&y===S?(m.preventDefault(),r&&kt(x,{select:!0})):m.shiftKey&&y===x&&(m.preventDefault(),r&&kt(S,{select:!0})):y===k&&m.preventDefault()}},[r,n,p.paused]);return c.jsx(Se.div,{tabIndex:-1,...s,ref:h,onKeyDown:w})});_o.displayName=xp;function wp(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(kt(n,{select:t}),document.activeElement!==r)return}function yp(e){const t=ca(e),r=da(t,e),n=da(t.reverse(),e);return[r,n]}function ca(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function da(e,t){for(const r of e)if(!kp(r,{upTo:t}))return r}function kp(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Sp(e){return e instanceof HTMLInputElement&&"select"in e}function kt(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Sp(e)&&t&&e.select()}}var ua=Cp();function Cp(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=fa(e,t),e.unshift(t)},remove(t){var r;e=fa(e,t),(r=e[0])==null||r.resume()}}}function fa(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Ep(e){return e.filter(t=>t.tagName!=="A")}var Fe=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},jp=b[" useId ".trim().toString()]||(()=>{}),Np=0;function zr(e){const[t,r]=b.useState(jp());return Fe(()=>{r(n=>n??String(Np++))},[e]),t?`radix-${t}`:""}const Tp=["top","right","bottom","left"],St=Math.min,Ge=Math.max,Sn=Math.round,Cn=Math.floor,st=e=>({x:e,y:e}),Ap={left:"right",right:"left",bottom:"top",top:"bottom"},zp={start:"end",end:"start"};function Mo(e,t,r){return Ge(e,St(t,r))}function ht(e,t){return typeof e=="function"?e(t):e}function mt(e){return e.split("-")[0]}function Yt(e){return e.split("-")[1]}function Ro(e){return e==="x"?"y":"x"}function Lo(e){return e==="y"?"height":"width"}const Pp=new Set(["top","bottom"]);function at(e){return Pp.has(mt(e))?"y":"x"}function $o(e){return Ro(at(e))}function Op(e,t,r){r===void 0&&(r=!1);const n=Yt(e),o=$o(e),i=Lo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=En(s)),[s,En(s)]}function Ip(e){const t=En(e);return[Fo(e),t,Fo(t)]}function Fo(e){return e.replace(/start|end/g,t=>zp[t])}const pa=["left","right"],ha=["right","left"],Dp=["top","bottom"],_p=["bottom","top"];function Mp(e,t,r){switch(e){case"top":case"bottom":return r?t?ha:pa:t?pa:ha;case"left":case"right":return t?Dp:_p;default:return[]}}function Rp(e,t,r,n){const o=Yt(e);let i=Mp(mt(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Fo)))),i}function En(e){return e.replace(/left|right|bottom|top/g,t=>Ap[t])}function Lp(e){return{top:0,right:0,bottom:0,left:0,...e}}function ma(e){return typeof e!="number"?Lp(e):{top:e,right:e,bottom:e,left:e}}function jn(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function ga(e,t,r){let{reference:n,floating:o}=e;const i=at(t),s=$o(t),a=Lo(s),l=mt(t),d=i==="y",u=n.x+n.width/2-o.width/2,f=n.y+n.height/2-o.height/2,h=n[a]/2-o[a]/2;let p;switch(l){case"top":p={x:u,y:n.y-o.height};break;case"bottom":p={x:u,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:f};break;case"left":p={x:n.x-o.width,y:f};break;default:p={x:n.x,y:n.y}}switch(Yt(t)){case"start":p[s]-=h*(r&&d?-1:1);break;case"end":p[s]+=h*(r&&d?-1:1);break}return p}async function $p(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=ht(t,e),w=ma(p),v=a[h?f==="floating"?"reference":"floating":f],y=jn(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(v)))==null||r?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:d,rootBoundary:u,strategy:l})),k=f==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=jn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:k,offsetParent:x,strategy:l}):k);return{top:(y.top-C.top+w.top)/S.y,bottom:(C.bottom-y.bottom+w.bottom)/S.y,left:(y.left-C.left+w.left)/S.x,right:(C.right-y.right+w.right)/S.x}}const Fp=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=ga(d,n,l),h=n,p={},w=0;for(let v=0;v<a.length;v++){var m;const{name:y,fn:k}=a[v],{x,y:S,data:C,reset:E}=await k({x:u,y:f,initialPlacement:n,placement:h,strategy:o,middlewareData:p,rects:d,platform:{...s,detectOverflow:(m=s.detectOverflow)!=null?m:$p},elements:{reference:e,floating:t}});u=x??u,f=S??f,p={...p,[y]:{...p[y],...C}},E&&w<=50&&(w++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(d=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:f}=ga(d,h,l)),v=-1)}return{x:u,y:f,placement:h,strategy:o,middlewareData:p}},Wp=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:d,padding:u=0}=ht(e,t)||{};if(d==null)return{};const f=ma(u),h={x:r,y:n},p=$o(o),w=Lo(p),m=await s.getDimensions(d),v=p==="y",y=v?"top":"left",k=v?"bottom":"right",x=v?"clientHeight":"clientWidth",S=i.reference[w]+i.reference[p]-h[p]-i.floating[w],C=h[p]-i.reference[p],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let N=E?E[x]:0;(!N||!await(s.isElement==null?void 0:s.isElement(E)))&&(N=a.floating[x]||i.floating[w]);const j=S/2-C/2,D=N/2-m[w]/2-1,M=St(f[y],D),I=St(f[k],D),R=M,L=N-m[w]-I,K=N/2-m[w]/2+j,B=Mo(R,K,L),W=!l.arrow&&Yt(o)!=null&&K!==B&&i.reference[w]/2-(K<R?M:I)-m[w]/2<0,U=W?K<R?K-R:K-L:0;return{[p]:h[p]+U,data:{[p]:B,centerOffset:K-B-U,...W&&{alignmentOffset:U}},reset:W}}}),Up=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:d}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:m=!0,...v}=ht(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const y=mt(o),k=at(a),x=mt(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(d.floating)),C=h||(x||!m?[En(a)]:Ip(a)),E=w!=="none";!h&&E&&C.push(...Rp(a,m,w,S));const N=[a,...C],j=await l.detectOverflow(t,v),D=[];let M=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&D.push(j[y]),f){const K=Op(o,s,S);D.push(j[K[0]],j[K[1]])}if(M=[...M,{placement:o,overflows:D}],!D.every(K=>K<=0)){var I,R;const K=(((I=i.flip)==null?void 0:I.index)||0)+1,B=N[K];if(B&&(!(f==="alignment"?k!==at(B):!1)||M.every(A=>at(A.placement)===k?A.overflows[0]>0:!0)))return{data:{index:K,overflows:M},reset:{placement:B}};let W=(R=M.filter(U=>U.overflows[0]<=0).sort((U,A)=>U.overflows[1]-A.overflows[1])[0])==null?void 0:R.placement;if(!W)switch(p){case"bestFit":{var L;const U=(L=M.filter(A=>{if(E){const J=at(A.placement);return J===k||J==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(J=>J>0).reduce((J,oe)=>J+oe,0)]).sort((A,J)=>A[1]-J[1])[0])==null?void 0:L[0];U&&(W=U);break}case"initialPlacement":W=a;break}if(o!==W)return{reset:{placement:W}}}return{}}}};function ba(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function va(e){return Tp.some(t=>e[t]>=0)}const Bp=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:o="referenceHidden",...i}=ht(e,t);switch(o){case"referenceHidden":{const s=await n.detectOverflow(t,{...i,elementContext:"reference"}),a=ba(s,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:va(a)}}}case"escaped":{const s=await n.detectOverflow(t,{...i,altBoundary:!0}),a=ba(s,r.floating);return{data:{escapedOffsets:a,escaped:va(a)}}}default:return{}}}}},xa=new Set(["left","top"]);async function Hp(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=mt(r),a=Yt(r),l=at(r)==="y",d=xa.has(s)?-1:1,u=i&&l?-1:1,f=ht(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:w}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof w=="number"&&(p=a==="end"?w*-1:w),l?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const Vp=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await Hp(t,e);return s===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Kp=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:k,y:x}=y;return{x:k,y:x}}},...d}=ht(e,t),u={x:r,y:n},f=await i.detectOverflow(t,d),h=at(mt(o)),p=Ro(h);let w=u[p],m=u[h];if(s){const y=p==="y"?"top":"left",k=p==="y"?"bottom":"right",x=w+f[y],S=w-f[k];w=Mo(x,w,S)}if(a){const y=h==="y"?"top":"left",k=h==="y"?"bottom":"right",x=m+f[y],S=m-f[k];m=Mo(x,m,S)}const v=l.fn({...t,[p]:w,[h]:m});return{...v,data:{x:v.x-r,y:v.y-n,enabled:{[p]:s,[h]:a}}}}}},Gp=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:d=!0}=ht(e,t),u={x:r,y:n},f=at(o),h=Ro(f);let p=u[h],w=u[f];const m=ht(a,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const x=h==="y"?"height":"width",S=i.reference[h]-i.floating[x]+v.mainAxis,C=i.reference[h]+i.reference[x]-v.mainAxis;p<S?p=S:p>C&&(p=C)}if(d){var y,k;const x=h==="y"?"width":"height",S=xa.has(mt(o)),C=i.reference[f]-i.floating[x]+(S&&((y=s.offset)==null?void 0:y[f])||0)+(S?0:v.crossAxis),E=i.reference[f]+i.reference[x]+(S?0:((k=s.offset)==null?void 0:k[f])||0)-(S?v.crossAxis:0);w<C?w=C:w>E&&(w=E)}return{[h]:p,[f]:w}}}},Yp=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...d}=ht(e,t),u=await s.detectOverflow(t,d),f=mt(o),h=Yt(o),p=at(o)==="y",{width:w,height:m}=i.floating;let v,y;f==="top"||f==="bottom"?(v=f,y=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=f,v=h==="end"?"top":"bottom");const k=m-u.top-u.bottom,x=w-u.left-u.right,S=St(m-u[v],k),C=St(w-u[y],x),E=!t.middlewareData.shift;let N=S,j=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(j=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(N=k),E&&!h){const M=Ge(u.left,0),I=Ge(u.right,0),R=Ge(u.top,0),L=Ge(u.bottom,0);p?j=w-2*(M!==0||I!==0?M+I:Ge(u.left,u.right)):N=m-2*(R!==0||L!==0?R+L:Ge(u.top,u.bottom))}await l({...t,availableWidth:j,availableHeight:N});const D=await s.getDimensions(a.floating);return w!==D.width||m!==D.height?{reset:{rects:!0}}:{}}}};function Nn(){return typeof window<"u"}function qt(e){return wa(e)?(e.nodeName||"").toLowerCase():"#document"}function Ye(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function lt(e){var t;return(t=(wa(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function wa(e){return Nn()?e instanceof Node||e instanceof Ye(e).Node:!1}function rt(e){return Nn()?e instanceof Element||e instanceof Ye(e).Element:!1}function ct(e){return Nn()?e instanceof HTMLElement||e instanceof Ye(e).HTMLElement:!1}function ya(e){return!Nn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ye(e).ShadowRoot}const qp=new Set(["inline","contents"]);function Pr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=nt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!qp.has(o)}const Xp=new Set(["table","td","th"]);function Jp(e){return Xp.has(qt(e))}const Zp=[":popover-open",":modal"];function Tn(e){return Zp.some(t=>{try{return e.matches(t)}catch{return!1}})}const Qp=["transform","translate","scale","rotate","perspective"],eh=["transform","translate","scale","rotate","perspective","filter"],th=["paint","layout","strict","content"];function Wo(e){const t=Uo(),r=rt(e)?nt(e):e;return Qp.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||eh.some(n=>(r.willChange||"").includes(n))||th.some(n=>(r.contain||"").includes(n))}function rh(e){let t=Ct(e);for(;ct(t)&&!Xt(t);){if(Wo(t))return t;if(Tn(t))return null;t=Ct(t)}return null}function Uo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const nh=new Set(["html","body","#document"]);function Xt(e){return nh.has(qt(e))}function nt(e){return Ye(e).getComputedStyle(e)}function An(e){return rt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ct(e){if(qt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ya(e)&&e.host||lt(e);return ya(t)?t.host:t}function ka(e){const t=Ct(e);return Xt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ct(t)&&Pr(t)?t:ka(t)}function Or(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=ka(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=Ye(o);if(i){const a=Bo(s);return t.concat(s,s.visualViewport||[],Pr(o)?o:[],a&&r?Or(a):[])}return t.concat(o,Or(o,[],r))}function Bo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Sa(e){const t=nt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=ct(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,a=Sn(r)!==i||Sn(n)!==s;return a&&(r=i,n=s),{width:r,height:n,$:a}}function Ho(e){return rt(e)?e:e.contextElement}function Jt(e){const t=Ho(e);if(!ct(t))return st(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=Sa(t);let s=(i?Sn(r.width):r.width)/n,a=(i?Sn(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const oh=st(0);function Ca(e){const t=Ye(e);return!Uo()||!t.visualViewport?oh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ih(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Ye(e)?!1:t}function _t(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=Ho(e);let s=st(1);t&&(n?rt(n)&&(s=Jt(n)):s=Jt(e));const a=ih(i,r,n)?Ca(i):st(0);let l=(o.left+a.x)/s.x,d=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const h=Ye(i),p=n&&rt(n)?Ye(n):n;let w=h,m=Bo(w);for(;m&&n&&p!==w;){const v=Jt(m),y=m.getBoundingClientRect(),k=nt(m),x=y.left+(m.clientLeft+parseFloat(k.paddingLeft))*v.x,S=y.top+(m.clientTop+parseFloat(k.paddingTop))*v.y;l*=v.x,d*=v.y,u*=v.x,f*=v.y,l+=x,d+=S,w=Ye(m),m=Bo(w)}}return jn({width:u,height:f,x:l,y:d})}function zn(e,t){const r=An(e).scrollLeft;return t?t.left+r:_t(lt(e)).left+r}function Ea(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-zn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function sh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=lt(n),a=t?Tn(t.floating):!1;if(n===s||a&&i)return r;let l={scrollLeft:0,scrollTop:0},d=st(1);const u=st(0),f=ct(n);if((f||!f&&!i)&&((qt(n)!=="body"||Pr(s))&&(l=An(n)),ct(n))){const p=_t(n);d=Jt(n),u.x=p.x+n.clientLeft,u.y=p.y+n.clientTop}const h=s&&!f&&!i?Ea(s,l):st(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-l.scrollLeft*d.x+u.x+h.x,y:r.y*d.y-l.scrollTop*d.y+u.y+h.y}}function ah(e){return Array.from(e.getClientRects())}function lh(e){const t=lt(e),r=An(e),n=e.ownerDocument.body,o=Ge(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Ge(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+zn(e);const a=-r.scrollTop;return nt(n).direction==="rtl"&&(s+=Ge(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:a}}const ja=25;function ch(e,t){const r=Ye(e),n=lt(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=Uo();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const d=zn(n);if(d<=0){const u=n.ownerDocument,f=u.body,h=getComputedStyle(f),p=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,w=Math.abs(n.clientWidth-f.clientWidth-p);w<=ja&&(i-=w)}else d<=ja&&(i+=d);return{width:i,height:s,x:a,y:l}}const dh=new Set(["absolute","fixed"]);function uh(e,t){const r=_t(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=ct(e)?Jt(e):st(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,d=n*i.y;return{width:s,height:a,x:l,y:d}}function Na(e,t,r){let n;if(t==="viewport")n=ch(e,r);else if(t==="document")n=lh(lt(e));else if(rt(t))n=uh(t,r);else{const o=Ca(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return jn(n)}function Ta(e,t){const r=Ct(e);return r===t||!rt(r)||Xt(r)?!1:nt(r).position==="fixed"||Ta(r,t)}function fh(e,t){const r=t.get(e);if(r)return r;let n=Or(e,[],!1).filter(a=>rt(a)&&qt(a)!=="body"),o=null;const i=nt(e).position==="fixed";let s=i?Ct(e):e;for(;rt(s)&&!Xt(s);){const a=nt(s),l=Wo(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&dh.has(o.position)||Pr(s)&&!l&&Ta(e,s))?n=n.filter(u=>u!==s):o=a,s=Ct(s)}return t.set(e,n),n}function ph(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?Tn(t)?[]:fh(t,this._c):[].concat(r),n],a=s[0],l=s.reduce((d,u)=>{const f=Na(t,u,o);return d.top=Ge(f.top,d.top),d.right=St(f.right,d.right),d.bottom=St(f.bottom,d.bottom),d.left=Ge(f.left,d.left),d},Na(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function hh(e){const{width:t,height:r}=Sa(e);return{width:t,height:r}}function mh(e,t,r){const n=ct(t),o=lt(t),i=r==="fixed",s=_t(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=st(0);function d(){l.x=zn(o)}if(n||!n&&!i)if((qt(t)!=="body"||Pr(o))&&(a=An(t)),n){const p=_t(t,!0,i,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&d();i&&!n&&o&&d();const u=o&&!n&&!i?Ea(o,a):st(0),f=s.left+a.scrollLeft-l.x-u.x,h=s.top+a.scrollTop-l.y-u.y;return{x:f,y:h,width:s.width,height:s.height}}function Vo(e){return nt(e).position==="static"}function Aa(e,t){if(!ct(e)||nt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return lt(e)===r&&(r=r.ownerDocument.body),r}function za(e,t){const r=Ye(e);if(Tn(e))return r;if(!ct(e)){let o=Ct(e);for(;o&&!Xt(o);){if(rt(o)&&!Vo(o))return o;o=Ct(o)}return r}let n=Aa(e,t);for(;n&&Jp(n)&&Vo(n);)n=Aa(n,t);return n&&Xt(n)&&Vo(n)&&!Wo(n)?r:n||rh(e)||r}const gh=async function(e){const t=this.getOffsetParent||za,r=this.getDimensions,n=await r(e.floating);return{reference:mh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function bh(e){return nt(e).direction==="rtl"}const vh={convertOffsetParentRelativeRectToViewportRelativeRect:sh,getDocumentElement:lt,getClippingRect:ph,getOffsetParent:za,getElementRects:gh,getClientRects:ah,getDimensions:hh,getScale:Jt,isElement:rt,isRTL:bh};function Pa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xh(e,t){let r=null,n;const o=lt(e);function i(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const d=e.getBoundingClientRect(),{left:u,top:f,width:h,height:p}=d;if(a||t(),!h||!p)return;const w=Cn(f),m=Cn(o.clientWidth-(u+h)),v=Cn(o.clientHeight-(f+p)),y=Cn(u),x={rootMargin:-w+"px "+-m+"px "+-v+"px "+-y+"px",threshold:Ge(0,St(1,l))||1};let S=!0;function C(E){const N=E[0].intersectionRatio;if(N!==l){if(!S)return s();N?s(!1,N):n=setTimeout(()=>{s(!1,1e-7)},1e3)}N===1&&!Pa(d,e.getBoundingClientRect())&&s(),S=!1}try{r=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,x)}r.observe(e)}return s(!0),i}function wh(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,d=Ho(e),u=o||i?[...d?Or(d):[],...Or(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",r,{passive:!0}),i&&y.addEventListener("resize",r)});const f=d&&a?xh(d,r):null;let h=-1,p=null;s&&(p=new ResizeObserver(y=>{let[k]=y;k&&k.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),r()}),d&&!l&&p.observe(d),p.observe(t));let w,m=l?_t(e):null;l&&v();function v(){const y=_t(e);m&&!Pa(m,y)&&r(),m=y,w=requestAnimationFrame(v)}return r(),()=>{var y;u.forEach(k=>{o&&k.removeEventListener("scroll",r),i&&k.removeEventListener("resize",r)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,l&&cancelAnimationFrame(w)}}const yh=Vp,kh=Kp,Sh=Up,Ch=Yp,Eh=Bp,Oa=Wp,jh=Gp,Nh=(e,t,r)=>{const n=new Map,o={platform:vh,...r},i={...o.platform,_c:n};return Fp(e,t,{...o,platform:i})};var Th=typeof document<"u",Ah=function(){},Pn=Th?g.useLayoutEffect:Ah;function On(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 r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!On(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!On(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Ia(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Da(e,t){const r=Ia(e);return Math.round(t*r)/r}function Ko(e){const t=b.useRef(e);return Pn(()=>{t.current=e}),t}function zh(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:d}=e,[u,f]=b.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=b.useState(n);On(h,n)||p(n);const[w,m]=b.useState(null),[v,y]=b.useState(null),k=b.useCallback(A=>{A!==E.current&&(E.current=A,m(A))},[]),x=b.useCallback(A=>{A!==N.current&&(N.current=A,y(A))},[]),S=i||w,C=s||v,E=b.useRef(null),N=b.useRef(null),j=b.useRef(u),D=l!=null,M=Ko(l),I=Ko(o),R=Ko(d),L=b.useCallback(()=>{if(!E.current||!N.current)return;const A={placement:t,strategy:r,middleware:h};I.current&&(A.platform=I.current),Nh(E.current,N.current,A).then(J=>{const oe={...J,isPositioned:R.current!==!1};K.current&&!On(j.current,oe)&&(j.current=oe,Kr.flushSync(()=>{f(oe)}))})},[h,t,r,I,R]);Pn(()=>{d===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,f(A=>({...A,isPositioned:!1})))},[d]);const K=b.useRef(!1);Pn(()=>(K.current=!0,()=>{K.current=!1}),[]),Pn(()=>{if(S&&(E.current=S),C&&(N.current=C),S&&C){if(M.current)return M.current(S,C,L);L()}},[S,C,L,M,D]);const B=b.useMemo(()=>({reference:E,floating:N,setReference:k,setFloating:x}),[k,x]),W=b.useMemo(()=>({reference:S,floating:C}),[S,C]),U=b.useMemo(()=>{const A={position:r,left:0,top:0};if(!W.floating)return A;const J=Da(W.floating,u.x),oe=Da(W.floating,u.y);return a?{...A,transform:"translate("+J+"px, "+oe+"px)",...Ia(W.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:J,top:oe}},[r,a,W.floating,u.x,u.y]);return b.useMemo(()=>({...u,update:L,refs:B,elements:W,floatingStyles:U}),[u,L,B,W,U])}const Ph=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Oa({element:n.current,padding:o}).fn(r):{}:n?Oa({element:n,padding:o}).fn(r):{}}}},Oh=(e,t)=>({...yh(e),options:[e,t]}),Ih=(e,t)=>({...kh(e),options:[e,t]}),Dh=(e,t)=>({...jh(e),options:[e,t]}),_h=(e,t)=>({...Sh(e),options:[e,t]}),Mh=(e,t)=>({...Ch(e),options:[e,t]}),Rh=(e,t)=>({...Eh(e),options:[e,t]}),Lh=(e,t)=>({...Ph(e),options:[e,t]});var $h="Arrow",_a=b.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return c.jsx(Se.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});_a.displayName=$h;var Fh=_a;function Wh(e){const[t,r]=b.useState(void 0);return Fe(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,d=Array.isArray(l)?l[0]:l;s=d.inlineSize,a=d.blockSize}else s=e.offsetWidth,a=e.offsetHeight;r({width:s,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Go="Popper",[Ma,Zt]=Ar(Go),[Uh,Ra]=Ma(Go),La=e=>{const{__scopePopper:t,children:r}=e,[n,o]=b.useState(null);return c.jsx(Uh,{scope:t,anchor:n,onAnchorChange:o,children:r})};La.displayName=Go;var $a="PopperAnchor",Fa=b.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Ra($a,r),s=b.useRef(null),a=je(t,s),l=b.useRef(null);return b.useEffect(()=>{const d=l.current;l.current=(n==null?void 0:n.current)||s.current,d!==l.current&&i.onAnchorChange(l.current)}),n?null:c.jsx(Se.div,{...o,ref:a})});Fa.displayName=$a;var Yo="PopperContent",[Bh,Hh]=Ma(Yo),Wa=b.forwardRef((e,t)=>{var P,Q,ee,$,ie,te;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:w,...m}=e,v=Ra(Yo,r),[y,k]=b.useState(null),x=je(t,ke=>k(ke)),[S,C]=b.useState(null),E=Wh(S),N=(E==null?void 0:E.width)??0,j=(E==null?void 0:E.height)??0,D=n+(i!=="center"?"-"+i:""),M=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},I=Array.isArray(d)?d:[d],R=I.length>0,L={padding:M,boundary:I.filter(Kh),altBoundary:R},{refs:K,floatingStyles:B,placement:W,isPositioned:U,middlewareData:A}=zh({strategy:"fixed",placement:D,whileElementsMounted:(...ke)=>wh(...ke,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[Oh({mainAxis:o+j,alignmentAxis:s}),l&&Ih({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Dh():void 0,...L}),l&&_h({...L}),Mh({...L,apply:({elements:ke,rects:we,availableWidth:De,availableHeight:Re})=>{const{width:Be,height:Ne}=we.reference,Xe=ke.floating.style;Xe.setProperty("--radix-popper-available-width",`${De}px`),Xe.setProperty("--radix-popper-available-height",`${Re}px`),Xe.setProperty("--radix-popper-anchor-width",`${Be}px`),Xe.setProperty("--radix-popper-anchor-height",`${Ne}px`)}}),S&&Lh({element:S,padding:a}),Gh({arrowWidth:N,arrowHeight:j}),h&&Rh({strategy:"referenceHidden",...L})]}),[J,oe]=Ha(W),T=Dt(w);Fe(()=>{U&&(T==null||T())},[U,T]);const F=(P=A.arrow)==null?void 0:P.x,X=(Q=A.arrow)==null?void 0:Q.y,G=((ee=A.arrow)==null?void 0:ee.centerOffset)!==0,[ve,le]=b.useState();return Fe(()=>{y&&le(window.getComputedStyle(y).zIndex)},[y]),c.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:U?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[($=A.transformOrigin)==null?void 0:$.x,(ie=A.transformOrigin)==null?void 0:ie.y].join(" "),...((te=A.hide)==null?void 0:te.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Bh,{scope:r,placedSide:J,onArrowChange:C,arrowX:F,arrowY:X,shouldHideArrow:G,children:c.jsx(Se.div,{"data-side":J,"data-align":oe,...m,ref:x,style:{...m.style,animation:U?void 0:"none"}})})})});Wa.displayName=Yo;var Ua="PopperArrow",Vh={top:"bottom",right:"left",bottom:"top",left:"right"},Ba=b.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Hh(Ua,n),s=Vh[i.placedSide];return c.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:c.jsx(Fh,{...o,ref:r,style:{...o.style,display:"block"}})})});Ba.displayName=Ua;function Kh(e){return e!==null}var Gh=e=>({name:"transformOrigin",options:e,fn(t){var v,y,k;const{placement:r,rects:n,middlewareData:o}=t,s=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[d,u]=Ha(r),f={start:"0%",center:"50%",end:"100%"}[u],h=(((y=o.arrow)==null?void 0:y.x)??0)+a/2,p=(((k=o.arrow)==null?void 0:k.y)??0)+l/2;let w="",m="";return d==="bottom"?(w=s?f:`${h}px`,m=`${-l}px`):d==="top"?(w=s?f:`${h}px`,m=`${n.floating.height+l}px`):d==="right"?(w=`${-l}px`,m=s?f:`${p}px`):d==="left"&&(w=`${n.floating.width+l}px`,m=s?f:`${p}px`),{data:{x:w,y:m}}}});function Ha(e){const[t,r="center"]=e.split("-");return[t,r]}var qo=La,In=Fa,Xo=Wa,Jo=Ba,Yh="Portal",Dn=b.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[o,i]=b.useState(!1);Fe(()=>i(!0),[]);const s=r||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?vt.createPortal(c.jsx(Se.div,{...n,ref:t}),s):null});Dn.displayName=Yh;var qh=b[" useInsertionEffect ".trim().toString()]||Fe;function _n({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Xh({defaultProp:t,onChange:r}),a=e!==void 0,l=a?e:o;{const u=b.useRef(e!==void 0);b.useEffect(()=>{const f=u.current;f!==a&&console.warn(`${n} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,n])}const d=b.useCallback(u=>{var f;if(a){const h=Jh(u)?u(e):u;h!==e&&((f=s.current)==null||f.call(s,h))}else i(u)},[a,e,i,s]);return[l,d]}function Xh({defaultProp:e,onChange:t}){const[r,n]=b.useState(e),o=b.useRef(r),i=b.useRef(t);return qh(()=>{i.current=t},[t]),b.useEffect(()=>{var s;o.current!==r&&((s=i.current)==null||s.call(i,r),o.current=r)},[r,o]),[r,n,i]}function Jh(e){return typeof e=="function"}function Zh(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Va=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Qh="VisuallyHidden",Ka=b.forwardRef((e,t)=>c.jsx(Se.span,{...e,ref:t,style:{...Va,...e.style}}));Ka.displayName=Qh;var em=Ka,tm=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Qt=new WeakMap,Mn=new WeakMap,Rn={},Zo=0,Ga=function(e){return e&&(e.host||Ga(e.parentNode))},rm=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Ga(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},nm=function(e,t,r,n){var o=rm(t,Array.isArray(e)?e:[e]);Rn[r]||(Rn[r]=new WeakMap);var i=Rn[r],s=[],a=new Set,l=new Set(o),d=function(f){!f||a.has(f)||(a.add(f),d(f.parentNode))};o.forEach(d);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))u(h);else try{var p=h.getAttribute(n),w=p!==null&&p!=="false",m=(Qt.get(h)||0)+1,v=(i.get(h)||0)+1;Qt.set(h,m),i.set(h,v),s.push(h),m===1&&w&&Mn.set(h,!0),v===1&&h.setAttribute(r,"true"),w||h.setAttribute(n,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return u(t),a.clear(),Zo++,function(){s.forEach(function(f){var h=Qt.get(f)-1,p=i.get(f)-1;Qt.set(f,h),i.set(f,p),h||(Mn.has(f)||f.removeAttribute(n),Mn.delete(f)),p||f.removeAttribute(r)}),Zo--,Zo||(Qt=new WeakMap,Qt=new WeakMap,Mn=new WeakMap,Rn={})}},Ya=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=tm(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),nm(n,o,r,"aria-hidden")):function(){return null}},dt=function(){return dt=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},dt.apply(this,arguments)};function qa(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function om(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Ln="right-scroll-bar-position",$n="width-before-scroll-bar",im="with-scroll-bars-hidden",sm="--removed-body-scroll-bar-size";function Qo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function am(e,t){var r=g.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var lm=typeof window<"u"?b.useLayoutEffect:b.useEffect,Xa=new WeakMap;function cm(e,t){var r=am(null,function(n){return e.forEach(function(o){return Qo(o,n)})});return lm(function(){var n=Xa.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(a){i.has(a)||Qo(a,null)}),i.forEach(function(a){o.has(a)||Qo(a,s)})}Xa.set(r,e)},[e]),r}function dm(e){return e}function um(e,t){t===void 0&&(t=dm);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(a){return i(a)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var a=r;r=[],a.forEach(i),s=r}var l=function(){var u=s;s=[],u.forEach(i)},d=function(){return Promise.resolve().then(l)};d(),r={push:function(u){s.push(u),d()},filter:function(u){return s=s.filter(u),r}}}};return o}function fm(e){e===void 0&&(e={});var t=um(null);return t.options=dt({async:!0,ssr:!1},e),t}var Ja=function(e){var t=e.sideCar,r=qa(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return b.createElement(n,dt({},r))};Ja.isSideCarExport=!0;function pm(e,t){return e.useMedium(t),Ja}var Za=fm(),ei=function(){},Fn=b.forwardRef(function(e,t){var r=b.useRef(null),n=b.useState({onScrollCapture:ei,onWheelCapture:ei,onTouchMoveCapture:ei}),o=n[0],i=n[1],s=e.forwardProps,a=e.children,l=e.className,d=e.removeScrollBar,u=e.enabled,f=e.shards,h=e.sideCar,p=e.noRelative,w=e.noIsolation,m=e.inert,v=e.allowPinchZoom,y=e.as,k=y===void 0?"div":y,x=e.gapMode,S=qa(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,E=cm([r,t]),N=dt(dt({},S),o);return b.createElement(b.Fragment,null,u&&b.createElement(C,{sideCar:Za,removeScrollBar:d,shards:f,noRelative:p,noIsolation:w,inert:m,setCallbacks:i,allowPinchZoom:!!v,lockRef:r,gapMode:x}),s?b.cloneElement(b.Children.only(a),dt(dt({},N),{ref:E})):b.createElement(k,dt({},N,{className:l,ref:E}),a))});Fn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Fn.classNames={fullWidth:$n,zeroRight:Ln};var hm=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function mm(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=hm();return t&&e.setAttribute("nonce",t),e}function gm(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function bm(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var vm=function(){var e=0,t=null;return{add:function(r){e==0&&(t=mm())&&(gm(t,r),bm(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},xm=function(){var e=vm();return function(t,r){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Qa=function(){var e=xm(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},wm={left:0,top:0,right:0,gap:0},ti=function(e){return parseInt(e||"",10)||0},ym=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ti(r),ti(n),ti(o)]},km=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return wm;var t=ym(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Sm=Qa(),er="data-scroll-locked",Cm=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,a=e.gap;return r===void 0&&(r="margin"),`
|
|
187
|
-
.`.concat(
|
|
186
|
+
`},Ey={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function ky(e){let{announcements:t=Ey,container:r,hiddenTextDescribedById:n,screenReaderInstructions:s=Sy}=e;const{announce:o,announcement:i}=wy(),a=Mn("DndLiveRegion"),[l,c]=z.useState(!1);if(z.useEffect(()=>{c(!0)},[]),xy(z.useMemo(()=>({onDragStart(d){let{active:f}=d;o(t.onDragStart({active:f}))},onDragMove(d){let{active:f,over:h}=d;t.onDragMove&&o(t.onDragMove({active:f,over:h}))},onDragOver(d){let{active:f,over:h}=d;o(t.onDragOver({active:f,over:h}))},onDragEnd(d){let{active:f,over:h}=d;o(t.onDragEnd({active:f,over:h}))},onDragCancel(d){let{active:f,over:h}=d;o(t.onDragCancel({active:f,over:h}))}}),[o,t])),!l)return null;const u=z.createElement(z.Fragment,null,z.createElement(yy,{id:n,value:s.draggable}),z.createElement(vy,{id:a,announcement:i}));return r?Bt.createPortal(u,r):u}var mt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(mt||(mt={}));function No(){}function _s(e,t){return z.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Ay(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return z.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const Rt=Object.freeze({x:0,y:0});function Ru(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Cy(e,t){const r=Po(e);if(!r)return"0 0";const n={x:(r.x-t.left)/t.width*100,y:(r.y-t.top)/t.height*100};return n.x+"% "+n.y+"%"}function Mu(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function Iy(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function Du(e){let{left:t,top:r,height:n,width:s}=e;return[{x:t,y:r},{x:t+s,y:r},{x:t,y:r+n},{x:t+s,y:r+n}]}function Lu(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function zu(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const Ty=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=zu(t,t.left,t.top),o=[];for(const i of n){const{id:a}=i,l=r.get(a);if(l){const c=Ru(zu(l),s);o.push({id:a,data:{droppableContainer:i,value:c}})}}return o.sort(Mu)},jy=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=Du(t),o=[];for(const i of n){const{id:a}=i,l=r.get(a);if(l){const c=Du(l),u=s.reduce((f,h,y)=>f+Ru(c[y],h),0),d=Number((u/4).toFixed(4));o.push({id:a,data:{droppableContainer:i,value:d}})}}return o.sort(Mu)};function Oy(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),i=s-n,a=o-r;if(n<s&&r<o){const l=t.width*t.height,c=e.width*e.height,u=i*a,d=u/(l+c-u);return Number(d.toFixed(4))}return 0}const Py=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=[];for(const o of n){const{id:i}=o,a=r.get(i);if(a){const l=Oy(a,t);l>0&&s.push({id:i,data:{droppableContainer:o,value:l}})}}return s.sort(Iy)};function Ny(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function Bu(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Rt}function Ry(e){return function(r){for(var n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];return s.reduce((i,a)=>({...i,top:i.top+e*a.y,bottom:i.bottom+e*a.y,left:i.left+e*a.x,right:i.right+e*a.x}),{...r})}}const My=Ry(1);function Uu(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Dy(e,t,r){const n=Uu(t);if(!n)return e;const{scaleX:s,scaleY:o,x:i,y:a}=n,l=e.left-i-(1-s)*parseFloat(r),c=e.top-a-(1-o)*parseFloat(r.slice(r.indexOf(" ")+1)),u=s?e.width/s:e.width,d=o?e.height/o:e.height;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l}}const Ly={ignoreTransform:!1};function Zr(e,t){t===void 0&&(t=Ly);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:u}=Et(e).getComputedStyle(e);c&&(r=Dy(r,c,u))}const{top:n,left:s,width:o,height:i,bottom:a,right:l}=r;return{top:n,left:s,width:o,height:i,bottom:a,right:l}}function Fu(e){return Zr(e,{ignoreTransform:!0})}function zy(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function By(e,t){return t===void 0&&(t=Et(e).getComputedStyle(e)),t.position==="fixed"}function Uy(e,t){t===void 0&&(t=Et(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const o=t[s];return typeof o=="string"?r.test(o):!1})}function Ro(e,t){const r=[];function n(s){if(t!=null&&r.length>=t||!s)return r;if(ws(s)&&s.scrollingElement!=null&&!r.includes(s.scrollingElement))return r.push(s.scrollingElement),r;if(!Pn(s)||ju(s)||r.includes(s))return r;const o=Et(e).getComputedStyle(s);return s!==e&&Uy(s,o)&&r.push(s),By(s,o)?r:n(s.parentNode)}return e?n(e):r}function Wu(e){const[t]=Ro(e,1);return t??null}function Ss(e){return!Co||!e?null:Jr(e)?e:vs(e)?ws(e)||e===Qr(e).scrollingElement?window:Pn(e)?e:null:null}function $u(e){return Jr(e)?e.scrollX:e.scrollLeft}function qu(e){return Jr(e)?e.scrollY:e.scrollTop}function Es(e){return{x:$u(e),y:qu(e)}}var bt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(bt||(bt={}));function Hu(e){return!Co||!e?!1:e===document.scrollingElement}function Vu(e){const t={x:0,y:0},r=Hu(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},s=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,i=e.scrollTop>=n.y,a=e.scrollLeft>=n.x;return{isTop:s,isLeft:o,isBottom:i,isRight:a,maxScroll:n,minScroll:t}}const Fy={x:.2,y:.2};function Wy(e,t,r,n,s){let{top:o,left:i,right:a,bottom:l}=r;n===void 0&&(n=10),s===void 0&&(s=Fy);const{isTop:c,isBottom:u,isLeft:d,isRight:f}=Vu(e),h={x:0,y:0},y={x:0,y:0},m={height:t.height*s.y,width:t.width*s.x};return!c&&o<=t.top+m.height?(h.y=bt.Backward,y.y=n*Math.abs((t.top+m.height-o)/m.height)):!u&&l>=t.bottom-m.height&&(h.y=bt.Forward,y.y=n*Math.abs((t.bottom-m.height-l)/m.height)),!f&&a>=t.right-m.width?(h.x=bt.Forward,y.x=n*Math.abs((t.right-m.width-a)/m.width)):!d&&i<=t.left+m.width&&(h.x=bt.Backward,y.x=n*Math.abs((t.left+m.width-i)/m.width)),{direction:h,speed:y}}function $y(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:i}=window;return{top:0,left:0,right:o,bottom:i,width:o,height:i}}const{top:t,left:r,right:n,bottom:s}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:s,width:e.clientWidth,height:e.clientHeight}}function Ku(e){return e.reduce((t,r)=>Xr(t,Es(r)),Rt)}function qy(e){return e.reduce((t,r)=>t+$u(r),0)}function Hy(e){return e.reduce((t,r)=>t+qu(r),0)}function Gu(e,t){if(t===void 0&&(t=Zr),!e)return;const{top:r,left:n,bottom:s,right:o}=t(e);Wu(e)&&(s<=0||o<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Vy=[["x",["left","right"],qy],["y",["top","bottom"],Hy]];class ks{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Ro(r),s=Ku(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,i,a]of Vy)for(const l of i)Object.defineProperty(this,l,{get:()=>{const c=a(n),u=s[o]-c;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ln{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var s;(s=this.target)==null||s.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function Ky(e){const{EventTarget:t}=Et(e);return e instanceof t?e:Qr(e)}function As(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var Pt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Pt||(Pt={}));function Yu(e){e.preventDefault()}function Gy(e){e.stopPropagation()}var Qe;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Qe||(Qe={}));const Ju={start:[Qe.Space,Qe.Enter],cancel:[Qe.Esc],end:[Qe.Space,Qe.Enter,Qe.Tab]},Yy=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Qe.Right:return{...r,x:r.x+25};case Qe.Left:return{...r,x:r.x-25};case Qe.Down:return{...r,y:r.y+25};case Qe.Up:return{...r,y:r.y-25}}};class Cs{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new Ln(Qr(r)),this.windowListeners=new Ln(Et(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Pt.Resize,this.handleCancel),this.windowListeners.add(Pt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Pt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Gu(n),r(Rt)}handleKeyDown(t){if(Oo(t)){const{active:r,context:n,options:s}=this.props,{keyboardCodes:o=Ju,coordinateGetter:i=Yy,scrollBehavior:a="smooth"}=s,{code:l}=t;if(o.end.includes(l)){this.handleEnd(t);return}if(o.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=n.current,u=c?{x:c.left,y:c.top}:Rt;this.referenceCoordinates||(this.referenceCoordinates=u);const d=i(t,{active:r,context:n.current,currentCoordinates:u});if(d){const f=Dn(d,u),h={x:0,y:0},{scrollableAncestors:y}=n.current;for(const m of y){const b=t.code,{isTop:S,isRight:g,isLeft:w,isBottom:_,maxScroll:x,minScroll:I}=Vu(m),C=$y(m),A={x:Math.min(b===Qe.Right?C.right-C.width/2:C.right,Math.max(b===Qe.Right?C.left:C.left+C.width/2,d.x)),y:Math.min(b===Qe.Down?C.bottom-C.height/2:C.bottom,Math.max(b===Qe.Down?C.top:C.top+C.height/2,d.y))},O=b===Qe.Right&&!g||b===Qe.Left&&!w,j=b===Qe.Down&&!_||b===Qe.Up&&!S;if(O&&A.x!==d.x){const R=m.scrollLeft+f.x,T=b===Qe.Right&&R<=x.x||b===Qe.Left&&R>=I.x;if(T&&!f.y){m.scrollTo({left:R,behavior:a});return}T?h.x=m.scrollLeft-R:h.x=b===Qe.Right?m.scrollLeft-x.x:m.scrollLeft-I.x,h.x&&m.scrollBy({left:-h.x,behavior:a});break}else if(j&&A.y!==d.y){const R=m.scrollTop+f.y,T=b===Qe.Down&&R<=x.y||b===Qe.Up&&R>=I.y;if(T&&!f.x){m.scrollTo({top:R,behavior:a});return}T?h.y=m.scrollTop-R:h.y=b===Qe.Down?m.scrollTop-x.y:m.scrollTop-I.y,h.y&&m.scrollBy({top:-h.y,behavior:a});break}}this.handleMove(t,Xr(Dn(d,this.referenceCoordinates),h))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Cs.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=Ju,onActivation:s}=t,{active:o}=r;const{code:i}=e.nativeEvent;if(n.start.includes(i)){const a=o.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function Qu(e){return!!(e&&"distance"in e)}function Xu(e){return!!(e&&"delay"in e)}class Is{constructor(t,r,n){var s;n===void 0&&(n=Ky(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:o}=t,{target:i}=o;this.props=t,this.events=r,this.document=Qr(i),this.documentListeners=new Ln(this.document),this.listeners=new Ln(n),this.windowListeners=new Ln(Et(i)),this.initialCoordinates=(s=Po(o))!=null?s:Rt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Pt.Resize,this.handleCancel),this.windowListeners.add(Pt.DragStart,Yu),this.windowListeners.add(Pt.VisibilityChange,this.handleCancel),this.windowListeners.add(Pt.ContextMenu,Yu),this.documentListeners.add(Pt.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Xu(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Qu(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:s}=this.props;s(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Pt.Click,Gy,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Pt.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:s,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!s)return;const l=(r=Po(t))!=null?r:Rt,c=Dn(s,l);if(!n&&a){if(Qu(a)){if(a.tolerance!=null&&As(c,a.tolerance))return this.handleCancel();if(As(c,a.distance))return this.handleStart()}if(Xu(a)&&As(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}t.cancelable&&t.preventDefault(),i(l)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Qe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Jy={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ts extends Is{constructor(t){const{event:r}=t,n=Qr(r.target);super(t,Jy,n)}}Ts.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const Qy={move:{name:"mousemove"},end:{name:"mouseup"}};var js;(function(e){e[e.RightClick=2]="RightClick"})(js||(js={}));class Xy extends Is{constructor(t){super(t,Qy,Qr(t.event.target))}}Xy.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===js.RightClick?!1:(n==null||n({event:r}),!0)}}];const Os={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Zu extends Is{constructor(t){super(t,Os)}static setup(){return window.addEventListener(Os.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Os.move.name,t)};function t(){}}}Zu.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:s}=r;return s.length>1?!1:(n==null||n({event:r}),!0)}}];var zn;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(zn||(zn={}));var Mo;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Mo||(Mo={}));function Zy(e){let{acceleration:t,activator:r=zn.Pointer,canScroll:n,draggingRect:s,enabled:o,interval:i=5,order:a=Mo.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:d,threshold:f}=e;const h=tv({delta:d,disabled:!o}),[y,m]=hy(),b=z.useRef({x:0,y:0}),S=z.useRef({x:0,y:0}),g=z.useMemo(()=>{switch(r){case zn.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case zn.DraggableRect:return s}},[r,s,l]),w=z.useRef(null),_=z.useCallback(()=>{const I=w.current;if(!I)return;const C=b.current.x*S.current.x,A=b.current.y*S.current.y;I.scrollBy(C,A)},[]),x=z.useMemo(()=>a===Mo.TreeOrder?[...c].reverse():c,[a,c]);z.useEffect(()=>{if(!o||!c.length||!g){m();return}for(const I of x){if((n==null?void 0:n(I))===!1)continue;const C=c.indexOf(I),A=u[C];if(!A)continue;const{direction:O,speed:j}=Wy(I,A,g,t,f);for(const R of["x","y"])h[R][O[R]]||(j[R]=0,O[R]=0);if(j.x>0||j.y>0){m(),w.current=I,y(_,i),b.current=j,S.current=O;return}}b.current={x:0,y:0},S.current={x:0,y:0},m()},[t,_,n,m,o,i,JSON.stringify(g),JSON.stringify(h),y,c,x,u,JSON.stringify(f)])}const ev={x:{[bt.Backward]:!1,[bt.Forward]:!1},y:{[bt.Backward]:!1,[bt.Forward]:!1}};function tv(e){let{delta:t,disabled:r}=e;const n=jo(t);return Rn(s=>{if(r||!n||!s)return ev;const o={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[bt.Backward]:s.x[bt.Backward]||o.x===-1,[bt.Forward]:s.x[bt.Forward]||o.x===1},y:{[bt.Backward]:s.y[bt.Backward]||o.y===-1,[bt.Forward]:s.y[bt.Forward]||o.y===1}}},[r,t,n])}function rv(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return Rn(s=>{var o;return t==null?null:(o=n??s)!=null?o:null},[n,t])}function nv(e,t){return z.useMemo(()=>e.reduce((r,n)=>{const{sensor:s}=n,o=s.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,n)}));return[...r,...o]},[]),[e,t])}var Bn;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Bn||(Bn={}));var Ps;(function(e){e.Optimized="optimized"})(Ps||(Ps={}));const ed=new Map;function ov(e,t){let{dragging:r,dependencies:n,config:s}=t;const[o,i]=z.useState(null),{frequency:a,measure:l,strategy:c}=s,u=z.useRef(e),d=b(),f=Nn(d),h=z.useCallback(function(S){S===void 0&&(S=[]),!f.current&&i(g=>g===null?S:g.concat(S.filter(w=>!g.includes(w))))},[f]),y=z.useRef(null),m=Rn(S=>{if(d&&!r)return ed;if(!S||S===ed||u.current!==e||o!=null){const g=new Map;for(let w of e){if(!w)continue;if(o&&o.length>0&&!o.includes(w.id)&&w.rect.current){g.set(w.id,w.rect.current);continue}const _=w.node.current,x=_?new ks(l(_),_):null;w.rect.current=x,x&&g.set(w.id,x)}return g}return S},[e,o,r,d,l]);return z.useEffect(()=>{u.current=e},[e]),z.useEffect(()=>{d||h()},[r,d]),z.useEffect(()=>{o&&o.length>0&&i(null)},[JSON.stringify(o)]),z.useEffect(()=>{d||typeof a!="number"||y.current!==null||(y.current=setTimeout(()=>{h(),y.current=null},a))},[a,d,h,...n]),{droppableRects:m,measureDroppableContainers:h,measuringScheduled:o!=null};function b(){switch(c){case Bn.Always:return!1;case Bn.BeforeDragging:return r;default:return!r}}}function Ns(e,t){return Rn(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function iv(e,t){return Ns(e,t)}function sv(e){let{callback:t,disabled:r}=e;const n=Io(t),s=z.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(n)},[n,r]);return z.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Do(e){let{callback:t,disabled:r}=e;const n=Io(t),s=z.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(n)},[r]);return z.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function av(e){return new ks(Zr(e),e)}function td(e,t,r){t===void 0&&(t=av);const[n,s]=z.useState(null);function o(){s(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??r)!=null?c:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u})}const i=sv({callback(l){if(e)for(const c of l){const{type:u,target:d}=c;if(u==="childList"&&d instanceof HTMLElement&&d.contains(e)){o();break}}}}),a=Do({callback:o});return Nt(()=>{o(),e?(a==null||a.observe(e),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),i==null||i.disconnect())},[e]),n}function lv(e){const t=Ns(e);return Bu(e,t)}const rd=[];function cv(e){const t=z.useRef(e),r=Rn(n=>e?n&&n!==rd&&e&&t.current&&e.parentNode===t.current.parentNode?n:Ro(e):rd,[e]);return z.useEffect(()=>{t.current=e},[e]),r}function uv(e){const[t,r]=z.useState(null),n=z.useRef(e),s=z.useCallback(o=>{const i=Ss(o.target);i&&r(a=>a?(a.set(i,Es(i)),new Map(a)):null)},[]);return z.useEffect(()=>{const o=n.current;if(e!==o){i(o);const a=e.map(l=>{const c=Ss(l);return c?(c.addEventListener("scroll",s,{passive:!0}),[c,Es(c)]):null}).filter(l=>l!=null);r(a.length?new Map(a):null),n.current=e}return()=>{i(e),i(o)};function i(a){a.forEach(l=>{const c=Ss(l);c==null||c.removeEventListener("scroll",s)})}},[s,e]),z.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,i)=>Xr(o,i),Rt):Ku(e):Rt,[e,t])}function nd(e,t){t===void 0&&(t=[]);const r=z.useRef(null);return z.useEffect(()=>{r.current=null},t),z.useEffect(()=>{const n=e!==Rt;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?Dn(e,r.current):Rt}function dv(e){z.useEffect(()=>{if(!Co)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function fv(e,t){return z.useMemo(()=>e.reduce((r,n)=>{let{eventName:s,handler:o}=n;return r[s]=i=>{o(i,t)},r},{}),[e,t])}function od(e){return z.useMemo(()=>e?zy(e):null,[e])}const id=[];function hv(e,t){t===void 0&&(t=Zr);const[r]=e,n=od(r?Et(r):null),[s,o]=z.useState(id);function i(){o(()=>e.length?e.map(l=>Hu(l)?n:new ks(t(l),l)):id)}const a=Do({callback:i});return Nt(()=>{a==null||a.disconnect(),i(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),s}function sd(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Pn(t)?t:e}function pv(e){let{measure:t}=e;const[r,n]=z.useState(null),s=z.useCallback(c=>{for(const{target:u}of c)if(Pn(u)){n(d=>{const f=t(u);return d?{...d,width:f.width,height:f.height}:f});break}},[t]),o=Do({callback:s}),i=z.useCallback(c=>{const u=sd(c);o==null||o.disconnect(),u&&(o==null||o.observe(u)),n(u?t(u):null)},[t,o]),[a,l]=To(i);return z.useMemo(()=>({nodeRef:a,rect:r,setRef:l}),[r,a,l])}const gv=[{sensor:Ts,options:{}},{sensor:Cs,options:{}}],mv={current:{}},Lo={draggable:{measure:Fu},droppable:{measure:Fu,strategy:Bn.WhileDragging,frequency:Ps.Optimized},dragOverlay:{measure:Zr}};class Un extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const bv={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Un,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:No},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Lo,measureDroppableContainers:No,windowRect:null,measuringScheduled:!1},ad={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:No,draggableNodes:new Map,over:null,measureDroppableContainers:No},Fn=z.createContext(ad),ld=z.createContext(bv);function yv(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Un}}}function vv(e,t){switch(t.type){case mt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case mt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case mt.DragEnd:case mt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case mt.RegisterDroppable:{const{element:r}=t,{id:n}=r,s=new Un(e.droppable.containers);return s.set(n,r),{...e,droppable:{...e.droppable,containers:s}}}case mt.SetDroppableDisabled:{const{id:r,key:n,disabled:s}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const i=new Un(e.droppable.containers);return i.set(r,{...o,disabled:s}),{...e,droppable:{...e.droppable,containers:i}}}case mt.UnregisterDroppable:{const{id:r,key:n}=t,s=e.droppable.containers.get(r);if(!s||n!==s.key)return e;const o=new Un(e.droppable.containers);return o.delete(r),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function wv(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:s}=z.useContext(Fn),o=jo(n),i=jo(r==null?void 0:r.id);return z.useEffect(()=>{if(!t&&!n&&o&&i!=null){if(!Oo(o)||document.activeElement===o.target)return;const a=s.get(i);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const u of[l.current,c.current]){if(!u)continue;const d=my(u);if(d){d.focus();break}}})}},[n,t,s,i,o]),null}function cd(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((s,o)=>o({transform:s,...n}),r):r}function xv(e){return z.useMemo(()=>({draggable:{...Lo.draggable,...e==null?void 0:e.draggable},droppable:{...Lo.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Lo.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function _v(e){let{activeNode:t,measure:r,initialRect:n,config:s=!0}=e;const o=z.useRef(!1),{x:i,y:a}=typeof s=="boolean"?{x:s,y:s}:s;Nt(()=>{if(!i&&!a||!t){o.current=!1;return}if(o.current||!n)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const u=r(c),d=Bu(u,n);if(i||(d.x=0),a||(d.y=0),o.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const f=Wu(c);f&&f.scrollBy({top:d.y,left:d.x})}},[t,i,a,n,r])}const zo=z.createContext({...Rt,scaleX:1,scaleY:1});var dr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(dr||(dr={}));const Sv=z.memo(function(t){var r,n,s,o;let{id:i,accessibility:a,autoScroll:l=!0,children:c,sensors:u=gv,collisionDetection:d=Py,measuring:f,modifiers:h,...y}=t;const m=z.useReducer(vv,void 0,yv),[b,S]=m,[g,w]=_y(),[_,x]=z.useState(dr.Uninitialized),I=_===dr.Initialized,{draggable:{active:C,nodes:A,translate:O},droppable:{containers:j}}=b,R=C!=null?A.get(C):null,T=z.useRef({initial:null,translated:null}),D=z.useMemo(()=>{var We;return C!=null?{id:C,data:(We=R==null?void 0:R.data)!=null?We:mv,rect:T}:null},[C,R]),H=z.useRef(null),[U,ae]=z.useState(null),[J,M]=z.useState(null),ce=Nn(y,Object.values(y)),Q=Mn("DndDescribedBy",i),B=z.useMemo(()=>j.getEnabled(),[j]),N=xv(f),{droppableRects:Y,measureDroppableContainers:ue,measuringScheduled:X}=ov(B,{dragging:I,dependencies:[O.x,O.y],config:N.droppable}),we=rv(A,C),L=z.useMemo(()=>J?Po(J):null,[J]),W=De(),le=iv(we,N.draggable.measure);_v({activeNode:C!=null?A.get(C):null,config:W.layoutShiftCompensation,initialRect:le,measure:N.draggable.measure});const $=td(we,N.draggable.measure,le),ee=td(we?we.parentElement:null),ne=z.useRef({activatorEvent:null,active:null,activeNode:we,collisionRect:null,collisions:null,droppableRects:Y,draggableNodes:A,draggingNode:null,draggingNodeRect:null,droppableContainers:j,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),me=j.getNodeFor((r=ne.current.over)==null?void 0:r.id),pe=pv({measure:N.dragOverlay.measure}),G=(n=pe.nodeRef.current)!=null?n:we,ie=I?(s=pe.rect)!=null?s:$:null,he=!!(pe.nodeRef.current&&pe.rect),be=lv(he?null:$),ve=od(G?Et(G):null),Ae=cv(I?me??we:null),se=hv(Ae),Ee=cd(h,{transform:{x:O.x-be.x,y:O.y-be.y,scaleX:1,scaleY:1},activatorEvent:J,active:D,activeNodeRect:$,containerNodeRect:ee,draggingNodeRect:ie,over:ne.current.over,overlayNodeRect:pe.rect,scrollableAncestors:Ae,scrollableAncestorRects:se,windowRect:ve}),je=L?Xr(L,O):null,ye=uv(Ae),$e=nd(ye),p=nd(ye,[$]),v=Xr(Ee,$e),E=ie?My(ie,Ee):null,P=D&&E?d({active:D,collisionRect:E,droppableRects:Y,droppableContainers:B,pointerCoordinates:je}):null,V=Lu(P,"id"),[te,fe]=z.useState(null),re=he?Ee:Xr(Ee,p),oe=Ny(re,(o=te==null?void 0:te.rect)!=null?o:null,$),de=z.useRef(null),ge=z.useCallback((We,Oe)=>{let{sensor:qe,options:Ge}=Oe;if(H.current==null)return;const He=A.get(H.current);if(!He)return;const Ye=We.nativeEvent,ot=new qe({active:H.current,activeNode:He,event:Ye,options:Ge,context:ne,onAbort(K){if(!A.get(K))return;const{onDragAbort:Pe}=ce.current,Me={id:K};Pe==null||Pe(Me),g({type:"onDragAbort",event:Me})},onPending(K,Ie,Pe,Me){if(!A.get(K))return;const{onDragPending:ht}=ce.current,pt={id:K,constraint:Ie,initialCoordinates:Pe,offset:Me};ht==null||ht(pt),g({type:"onDragPending",event:pt})},onStart(K){const Ie=H.current;if(Ie==null)return;const Pe=A.get(Ie);if(!Pe)return;const{onDragStart:Me}=ce.current,st={activatorEvent:Ye,active:{id:Ie,data:Pe.data,rect:T}};Bt.unstable_batchedUpdates(()=>{Me==null||Me(st),x(dr.Initializing),S({type:mt.DragStart,initialCoordinates:K,active:Ie}),g({type:"onDragStart",event:st}),ae(de.current),M(Ye)})},onMove(K){S({type:mt.DragMove,coordinates:K})},onEnd:F(mt.DragEnd),onCancel:F(mt.DragCancel)});de.current=ot;function F(K){return async function(){const{active:Pe,collisions:Me,over:st,scrollAdjustedTranslate:ht}=ne.current;let pt=null;if(Pe&&ht){const{cancelDrop:zt}=ce.current;pt={activatorEvent:Ye,active:Pe,collisions:Me,delta:ht,over:st},K===mt.DragEnd&&typeof zt=="function"&&await Promise.resolve(zt(pt))&&(K=mt.DragCancel)}H.current=null,Bt.unstable_batchedUpdates(()=>{S({type:K}),x(dr.Uninitialized),fe(null),ae(null),M(null),de.current=null;const zt=K===mt.DragEnd?"onDragEnd":"onDragCancel";if(pt){const ar=ce.current[zt];ar==null||ar(pt),g({type:zt,event:pt})}})}}},[A]),ke=z.useCallback((We,Oe)=>(qe,Ge)=>{const He=qe.nativeEvent,Ye=A.get(Ge);if(H.current!==null||!Ye||He.dndKit||He.defaultPrevented)return;const ot={active:Ye};We(qe,Oe.options,ot)===!0&&(He.dndKit={capturedBy:Oe.sensor},H.current=Ge,ge(qe,Oe))},[A,ge]),Te=nv(u,ke);dv(u),Nt(()=>{$&&_===dr.Initializing&&x(dr.Initialized)},[$,_]),z.useEffect(()=>{const{onDragMove:We}=ce.current,{active:Oe,activatorEvent:qe,collisions:Ge,over:He}=ne.current;if(!Oe||!qe)return;const Ye={active:Oe,activatorEvent:qe,collisions:Ge,delta:{x:v.x,y:v.y},over:He};Bt.unstable_batchedUpdates(()=>{We==null||We(Ye),g({type:"onDragMove",event:Ye})})},[v.x,v.y]),z.useEffect(()=>{const{active:We,activatorEvent:Oe,collisions:qe,droppableContainers:Ge,scrollAdjustedTranslate:He}=ne.current;if(!We||H.current==null||!Oe||!He)return;const{onDragOver:Ye}=ce.current,ot=Ge.get(V),F=ot&&ot.rect.current?{id:ot.id,rect:ot.rect.current,data:ot.data,disabled:ot.disabled}:null,K={active:We,activatorEvent:Oe,collisions:qe,delta:{x:He.x,y:He.y},over:F};Bt.unstable_batchedUpdates(()=>{fe(F),Ye==null||Ye(K),g({type:"onDragOver",event:K})})},[V]),Nt(()=>{ne.current={activatorEvent:J,active:D,activeNode:we,collisionRect:E,collisions:P,droppableRects:Y,draggableNodes:A,draggingNode:G,draggingNodeRect:ie,droppableContainers:j,over:te,scrollableAncestors:Ae,scrollAdjustedTranslate:v},T.current={initial:ie,translated:E}},[D,we,P,E,A,G,ie,Y,j,te,Ae,v]),Zy({...W,delta:O,draggingRect:E,pointerCoordinates:je,scrollableAncestors:Ae,scrollableAncestorRects:se});const Re=z.useMemo(()=>({active:D,activeNode:we,activeNodeRect:$,activatorEvent:J,collisions:P,containerNodeRect:ee,dragOverlay:pe,draggableNodes:A,droppableContainers:j,droppableRects:Y,over:te,measureDroppableContainers:ue,scrollableAncestors:Ae,scrollableAncestorRects:se,measuringConfiguration:N,measuringScheduled:X,windowRect:ve}),[D,we,$,J,P,ee,pe,A,j,Y,te,ue,Ae,se,N,X,ve]),Fe=z.useMemo(()=>({activatorEvent:J,activators:Te,active:D,activeNodeRect:$,ariaDescribedById:{draggable:Q},dispatch:S,draggableNodes:A,over:te,measureDroppableContainers:ue}),[J,Te,D,$,S,Q,A,te,ue]);return z.createElement(Nu.Provider,{value:w},z.createElement(Fn.Provider,{value:Fe},z.createElement(ld.Provider,{value:Re},z.createElement(zo.Provider,{value:oe},c)),z.createElement(wv,{disabled:(a==null?void 0:a.restoreFocus)===!1})),z.createElement(ky,{...a,hiddenTextDescribedById:Q}));function De(){const We=(U==null?void 0:U.autoScrollEnabled)===!1,Oe=typeof l=="object"?l.enabled===!1:l===!1,qe=I&&!We&&!Oe;return typeof l=="object"?{...l,enabled:qe}:{enabled:qe}}}),Ev=z.createContext(null),ud="button",kv="Draggable";function Av(e){let{id:t,data:r,disabled:n=!1,attributes:s}=e;const o=Mn(kv),{activators:i,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:d,over:f}=z.useContext(Fn),{role:h=ud,roleDescription:y="draggable",tabIndex:m=0}=s??{},b=(l==null?void 0:l.id)===t,S=z.useContext(b?zo:Ev),[g,w]=To(),[_,x]=To(),I=fv(i,t),C=Nn(r);Nt(()=>(d.set(t,{id:t,key:o,node:g,activatorNode:_,data:C}),()=>{const O=d.get(t);O&&O.key===o&&d.delete(t)}),[d,t]);const A=z.useMemo(()=>({role:h,tabIndex:m,"aria-disabled":n,"aria-pressed":b&&h===ud?!0:void 0,"aria-roledescription":y,"aria-describedby":u.draggable}),[n,h,m,b,y,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:A,isDragging:b,listeners:n?void 0:I,node:g,over:f,setNodeRef:w,setActivatorNodeRef:x,transform:S}}function dd(){return z.useContext(ld)}const Cv="Droppable",Iv={timeout:25};function Tv(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:s}=e;const o=Mn(Cv),{active:i,dispatch:a,over:l,measureDroppableContainers:c}=z.useContext(Fn),u=z.useRef({disabled:r}),d=z.useRef(!1),f=z.useRef(null),h=z.useRef(null),{disabled:y,updateMeasurementsFor:m,timeout:b}={...Iv,...s},S=Nn(m??n),g=z.useCallback(()=>{if(!d.current){d.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{c(Array.isArray(S.current)?S.current:[S.current]),h.current=null},b)},[b]),w=Do({callback:g,disabled:y||!i}),_=z.useCallback((A,O)=>{w&&(O&&(w.unobserve(O),d.current=!1),A&&w.observe(A))},[w]),[x,I]=To(_),C=Nn(t);return z.useEffect(()=>{!w||!x.current||(w.disconnect(),d.current=!1,w.observe(x.current))},[x,w]),z.useEffect(()=>(a({type:mt.RegisterDroppable,element:{id:n,key:o,disabled:r,node:x,rect:f,data:C}}),()=>a({type:mt.UnregisterDroppable,key:o,id:n})),[n]),z.useEffect(()=>{r!==u.current.disabled&&(a({type:mt.SetDroppableDisabled,id:n,key:o,disabled:r}),u.current.disabled=r)},[n,o,r,a]),{active:i,rect:f,isOver:(l==null?void 0:l.id)===n,node:x,over:l,setNodeRef:I}}function jv(e){let{animation:t,children:r}=e;const[n,s]=z.useState(null),[o,i]=z.useState(null),a=jo(r);return!r&&!n&&a&&s(a),Nt(()=>{if(!o)return;const l=n==null?void 0:n.key,c=n==null?void 0:n.props.id;if(l==null||c==null){s(null);return}Promise.resolve(t(c,o)).then(()=>{s(null)})},[t,n,o]),z.createElement(z.Fragment,null,r,n?z.cloneElement(n,{ref:i}):null)}const Ov={x:0,y:0,scaleX:1,scaleY:1};function Pv(e){let{children:t}=e;return z.createElement(Fn.Provider,{value:ad},z.createElement(zo.Provider,{value:Ov},t))}const Nv={position:"fixed",touchAction:"none"},Rv=e=>Oo(e)?"transform 250ms ease":void 0,Mv=z.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:s,children:o,className:i,rect:a,style:l,transform:c,transition:u=Rv}=e;if(!a)return null;const d=s?c:{...c,scaleX:1,scaleY:1},f={...Nv,width:a.width,height:a.height,top:a.top,left:a.left,transform:ur.Transform.toString(d),transformOrigin:s&&n?Cy(n,a):void 0,transition:typeof u=="function"?u(n):u,...l};return z.createElement(r,{className:i,style:f,ref:t},o)}),Dv={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:ur.Transform.toString(t)},{transform:ur.Transform.toString(r)}]},sideEffects:(e=>t=>{let{active:r,dragOverlay:n}=t;const s={},{styles:o,className:i}=e;if(o!=null&&o.active)for(const[a,l]of Object.entries(o.active))l!==void 0&&(s[a]=r.node.style.getPropertyValue(a),r.node.style.setProperty(a,l));if(o!=null&&o.dragOverlay)for(const[a,l]of Object.entries(o.dragOverlay))l!==void 0&&n.node.style.setProperty(a,l);return i!=null&&i.active&&r.node.classList.add(i.active),i!=null&&i.dragOverlay&&n.node.classList.add(i.dragOverlay),function(){for(const[l,c]of Object.entries(s))r.node.style.setProperty(l,c);i!=null&&i.active&&r.node.classList.remove(i.active)}})({styles:{active:{opacity:"0"}}})};function Lv(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:s}=e;return Io((o,i)=>{if(t===null)return;const a=r.get(o);if(!a)return;const l=a.node.current;if(!l)return;const c=sd(i);if(!c)return;const{transform:u}=Et(i).getComputedStyle(i),d=Uu(u);if(!d)return;const f=typeof t=="function"?t:zv(t);return Gu(l,s.draggable.measure),f({active:{id:o,data:a.data,node:l,rect:s.draggable.measure(l)},draggableNodes:r,dragOverlay:{node:i,rect:s.dragOverlay.measure(c)},droppableContainers:n,measuringConfiguration:s,transform:d})})}function zv(e){const{duration:t,easing:r,sideEffects:n,keyframes:s}={...Dv,...e};return o=>{let{active:i,dragOverlay:a,transform:l,...c}=o;if(!t)return;const u={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},d={scaleX:l.scaleX!==1?i.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?i.rect.height*l.scaleY/a.rect.height:1},f={x:l.x-u.x,y:l.y-u.y,...d},h=s({...c,active:i,dragOverlay:a,transform:{initial:l,final:f}}),[y]=h,m=h[h.length-1];if(JSON.stringify(y)===JSON.stringify(m))return;const b=n==null?void 0:n({active:i,dragOverlay:a,...c}),S=a.node.animate(h,{duration:t,easing:r,fill:"forwards"});return new Promise(g=>{S.onfinish=()=>{b==null||b(),g()}})}}let fd=0;function Bv(e){return z.useMemo(()=>{if(e!=null)return fd++,fd},[e])}const Uv=z.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:s,transition:o,modifiers:i,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:h,draggableNodes:y,droppableContainers:m,dragOverlay:b,over:S,measuringConfiguration:g,scrollableAncestors:w,scrollableAncestorRects:_,windowRect:x}=dd(),I=z.useContext(zo),C=Bv(d==null?void 0:d.id),A=cd(i,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:h,draggingNodeRect:b.rect,over:S,overlayNodeRect:b.rect,scrollableAncestors:w,scrollableAncestorRects:_,transform:I,windowRect:x}),O=Ns(f),j=Lv({config:n,draggableNodes:y,droppableContainers:m,measuringConfiguration:g}),R=O?b.setRef:void 0;return z.createElement(Pv,null,z.createElement(jv,{animation:j},d&&C?z.createElement(Mv,{key:C,id:d.id,ref:R,as:a,activatorEvent:u,adjustScale:t,className:l,transition:o,rect:O,style:{zIndex:c,...s},transform:A},r):null))}),Fv=e=>{let{transform:t}=e;return{...t,x:0}};function hd(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function Wv(e,t){return e.reduce((r,n,s)=>{const o=t.get(n);return o&&(r[s]=o),r},Array(e.length))}function Bo(e){return e!==null&&e>=0}function $v(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function qv(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const pd=e=>{let{rects:t,activeIndex:r,overIndex:n,index:s}=e;const o=hd(t,n,r),i=t[s],a=o[s];return!a||!i?null:{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}},Uo={scaleX:1,scaleY:1},Hv=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:s,rects:o,overIndex:i}=e;const a=(t=o[r])!=null?t:n;if(!a)return null;if(s===r){const c=o[i];return c?{x:0,y:r<i?c.top+c.height-(a.top+a.height):c.top-a.top,...Uo}:null}const l=Vv(o,s,r);return s>r&&s<=i?{x:0,y:-a.height-l,...Uo}:s<r&&s>=i?{x:0,y:a.height+l,...Uo}:{x:0,y:0,...Uo}};function Vv(e,t,r){const n=e[t],s=e[t-1],o=e[t+1];return n?r<t?s?n.top-(s.top+s.height):o?o.top-(n.top+n.height):0:o?o.top-(n.top+n.height):s?n.top-(s.top+s.height):0:0}const gd="Sortable",md=z.createContext({activeIndex:-1,containerId:gd,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:pd,disabled:{draggable:!1,droppable:!1}});function Kv(e){let{children:t,id:r,items:n,strategy:s=pd,disabled:o=!1}=e;const{active:i,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:u}=dd(),d=Mn(gd,r),f=a.rect!==null,h=z.useMemo(()=>n.map(I=>typeof I=="object"&&"id"in I?I.id:I),[n]),y=i!=null,m=i?h.indexOf(i.id):-1,b=c?h.indexOf(c.id):-1,S=z.useRef(h),g=!$v(h,S.current),w=b!==-1&&m===-1||g,_=qv(o);Nt(()=>{g&&y&&u(h)},[g,h,y,u]),z.useEffect(()=>{S.current=h},[h]);const x=z.useMemo(()=>({activeIndex:m,containerId:d,disabled:_,disableTransforms:w,items:h,overIndex:b,useDragOverlay:f,sortedRects:Wv(h,l),strategy:s}),[m,d,_.draggable,_.droppable,w,h,b,l,f,s]);return z.createElement(md.Provider,{value:x},t)}const Gv=e=>{let{id:t,items:r,activeIndex:n,overIndex:s}=e;return hd(r,n,s).indexOf(t)},Yv=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:s,items:o,newIndex:i,previousItems:a,previousContainerId:l,transition:c}=e;return!c||!n||a!==o&&s===i?!1:r?!0:i!==s&&t===l},Jv={duration:200,easing:"ease"},bd="transform",Qv=ur.Transition.toString({property:bd,duration:0,easing:"linear"}),Xv={roleDescription:"sortable"};function Zv(e){let{disabled:t,index:r,node:n,rect:s}=e;const[o,i]=z.useState(null),a=z.useRef(r);return Nt(()=>{if(!t&&r!==a.current&&n.current){const l=s.current;if(l){const c=Zr(n.current,{ignoreTransform:!0}),u={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(u.x||u.y)&&i(u)}}r!==a.current&&(a.current=r)},[t,r,n,s]),z.useEffect(()=>{o&&i(null)},[o]),o}function e0(e){let{animateLayoutChanges:t=Yv,attributes:r,disabled:n,data:s,getNewIndex:o=Gv,id:i,strategy:a,resizeObserverConfig:l,transition:c=Jv}=e;const{items:u,containerId:d,activeIndex:f,disabled:h,disableTransforms:y,sortedRects:m,overIndex:b,useDragOverlay:S,strategy:g}=z.useContext(md),w=t0(n,h),_=u.indexOf(i),x=z.useMemo(()=>({sortable:{containerId:d,index:_,items:u},...s}),[d,s,_,u]),I=z.useMemo(()=>u.slice(u.indexOf(i)),[u,i]),{rect:C,node:A,isOver:O,setNodeRef:j}=Tv({id:i,data:x,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...l}}),{active:R,activatorEvent:T,activeNodeRect:D,attributes:H,setNodeRef:U,listeners:ae,isDragging:J,over:M,setActivatorNodeRef:ce,transform:Q}=Av({id:i,data:x,attributes:{...Xv,...r},disabled:w.draggable}),B=fy(j,U),N=!!R,Y=N&&!y&&Bo(f)&&Bo(b),ue=!S&&J,X=ue&&Y?Q:null,L=Y?X??(a??g)({rects:m,activeNodeRect:D,activeIndex:f,overIndex:b,index:_}):null,W=Bo(f)&&Bo(b)?o({id:i,items:u,activeIndex:f,overIndex:b}):_,le=R==null?void 0:R.id,$=z.useRef({activeId:le,items:u,newIndex:W,containerId:d}),ee=u!==$.current.items,ne=t({active:R,containerId:d,isDragging:J,isSorting:N,id:i,index:_,items:u,newIndex:$.current.newIndex,previousItems:$.current.items,previousContainerId:$.current.containerId,transition:c,wasDragging:$.current.activeId!=null}),me=Zv({disabled:!ne,index:_,node:A,rect:C});return z.useEffect(()=>{N&&$.current.newIndex!==W&&($.current.newIndex=W),d!==$.current.containerId&&($.current.containerId=d),u!==$.current.items&&($.current.items=u)},[N,W,d,u]),z.useEffect(()=>{if(le===$.current.activeId)return;if(le!=null&&$.current.activeId==null){$.current.activeId=le;return}const G=setTimeout(()=>{$.current.activeId=le},50);return()=>clearTimeout(G)},[le]),{active:R,activeIndex:f,attributes:H,data:x,rect:C,index:_,newIndex:W,items:u,isOver:O,isSorting:N,isDragging:J,listeners:ae,node:A,overIndex:b,over:M,setNodeRef:B,setActivatorNodeRef:ce,setDroppableNodeRef:j,setDraggableNodeRef:U,transform:me??L,transition:pe()};function pe(){if(me||ee&&$.current.newIndex===_)return Qv;if(!(ue&&!Oo(T)||!c)&&(N||ne))return ur.Transition.toString({...c,property:bd})}}function t0(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function Fo(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const r0=[Qe.Down,Qe.Right,Qe.Up,Qe.Left],n0=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:s,droppableContainers:o,over:i,scrollableAncestors:a}}=t;if(r0.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];o.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const f=s.get(d.id);if(f)switch(e.code){case Qe.Down:n.top<f.top&&l.push(d);break;case Qe.Up:n.top>f.top&&l.push(d);break;case Qe.Left:n.left>f.left&&l.push(d);break;case Qe.Right:n.left<f.left&&l.push(d);break}});const c=jy({collisionRect:n,droppableRects:s,droppableContainers:l});let u=Lu(c,"id");if(u===(i==null?void 0:i.id)&&c.length>1&&(u=c[1].id),u!=null){const d=o.get(r.id),f=o.get(u),h=f?s.get(f.id):null,y=f==null?void 0:f.node.current;if(y&&h&&d&&f){const b=Ro(y).some((I,C)=>a[C]!==I),S=yd(d,f),g=o0(d,f),w=b||!S?{x:0,y:0}:{x:g?n.width-h.width:0,y:g?n.height-h.height:0},_={x:h.left,y:h.top};return w.x&&w.y?_:Dn(_,w)}}}};function yd(e,t){return!Fo(e)||!Fo(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function o0(e,t){return!Fo(e)||!Fo(t)||!yd(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function Rs({className:e,type:t,...r}){return k.jsx("input",{type:t,className:Ke("h-8 rounded-lg border border-zinc-800 bg-zinc-900/50 px-2.5 py-1 text-sm outline-none transition-colors focus:ring-2 focus:ring-blue-600",e),...r})}function i0({className:e,...t}){return k.jsx("textarea",{className:Ke("min-h-16 w-full rounded-lg border border-zinc-800 bg-zinc-900/50 px-2.5 py-2 text-sm outline-none transition-colors focus:ring-2 focus:ring-blue-600 resize-none",e),...t})}function s0({className:e,checked:t,onCheckedChange:r,...n}){return k.jsx("input",{type:"checkbox",checked:t,onChange:s=>r==null?void 0:r(s.target.checked),className:Ke("size-4 rounded border border-zinc-700 bg-zinc-900 text-blue-600 focus:ring-2 focus:ring-blue-600",e),...n})}function Or({className:e,...t}){return k.jsx("label",{className:Ke("text-sm font-medium leading-none select-none",e),...t})}function vd(e,[t,r]){return Math.min(r,Math.max(t,e))}function tt(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function Wn(e,t=[]){let r=[];function n(o,i){const a=q.createContext(i),l=r.length;r=[...r,i];const c=d=>{var S;const{scope:f,children:h,...y}=d,m=((S=f==null?void 0:f[e])==null?void 0:S[l])||a,b=q.useMemo(()=>y,Object.values(y));return k.jsx(m.Provider,{value:b,children:h})};c.displayName=o+"Provider";function u(d,f){var m;const h=((m=f==null?void 0:f[e])==null?void 0:m[l])||a,y=q.useContext(h);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,u]}const s=()=>{const o=r.map(i=>q.createContext(i));return function(a){const l=(a==null?void 0:a[e])||o;return q.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[n,a0(s,...t)]}function a0(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=n.reduce((a,{useScope:l,scopeName:c})=>{const d=l(o)[`__scope${c}`];return{...a,...d}},{});return q.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function wd(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xd(...e){return t=>{let r=!1;const n=e.map(s=>{const o=wd(s,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():wd(e[s],null)}}}}function ft(...e){return q.useCallback(xd(...e),e)}function en(e){const t=c0(e),r=q.forwardRef((n,s)=>{const{children:o,...i}=n,a=q.Children.toArray(o),l=a.find(d0);if(l){const c=l.props.children,u=a.map(d=>d===l?q.Children.count(c)>1?q.Children.only(null):q.isValidElement(c)?c.props.children:null:d);return k.jsx(t,{...i,ref:s,children:q.isValidElement(c)?q.cloneElement(c,void 0,u):null})}return k.jsx(t,{...i,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}var l0=en("Slot");function c0(e){const t=q.forwardRef((r,n)=>{const{children:s,...o}=r;if(q.isValidElement(s)){const i=h0(s),a=f0(o,s.props);return s.type!==q.Fragment&&(a.ref=n?xd(n,i):i),q.cloneElement(s,a)}return q.Children.count(s)>1?q.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _d=Symbol("radix.slottable");function u0(e){const t=({children:r})=>k.jsx(k.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=_d,t}function d0(e){return q.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_d}function f0(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...a)=>{const l=o(...a);return s(...a),l}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function h0(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function p0(e){const t=e+"CollectionProvider",[r,n]=Wn(t),[s,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:b,children:S}=m,g=z.useRef(null),w=z.useRef(new Map).current;return k.jsx(s,{scope:b,itemMap:w,collectionRef:g,children:S})};i.displayName=t;const a=e+"CollectionSlot",l=en(a),c=z.forwardRef((m,b)=>{const{scope:S,children:g}=m,w=o(a,S),_=ft(b,w.collectionRef);return k.jsx(l,{ref:_,children:g})});c.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=en(u),h=z.forwardRef((m,b)=>{const{scope:S,children:g,...w}=m,_=z.useRef(null),x=ft(b,_),I=o(u,S);return z.useEffect(()=>(I.itemMap.set(_,{ref:_,...w}),()=>void I.itemMap.delete(_))),k.jsx(f,{[d]:"",ref:x,children:g})});h.displayName=u;function y(m){const b=o(e+"CollectionConsumer",m);return z.useCallback(()=>{const g=b.collectionRef.current;if(!g)return[];const w=Array.from(g.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((I,C)=>w.indexOf(I.ref.current)-w.indexOf(C.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:c,ItemSlot:h},y,n]}var g0=q.createContext(void 0);function m0(e){const t=q.useContext(g0);return e||t||"ltr"}var b0=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ct=b0.reduce((e,t)=>{const r=en(`Primitive.${t}`),n=q.forwardRef((s,o)=>{const{asChild:i,...a}=s,l=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),k.jsx(l,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function y0(e,t){e&&ho.flushSync(()=>e.dispatchEvent(t))}function Pr(e){const t=q.useRef(e);return q.useEffect(()=>{t.current=e}),q.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function v0(e,t=globalThis==null?void 0:globalThis.document){const r=Pr(e);q.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var w0="DismissableLayer",Ms="dismissableLayer.update",x0="dismissableLayer.pointerDownOutside",_0="dismissableLayer.focusOutside",Sd,Ed=q.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wo=q.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...l}=e,c=q.useContext(Ed),[u,d]=q.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=q.useState({}),y=ft(t,C=>d(C)),m=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),S=m.indexOf(b),g=u?m.indexOf(u):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,_=g>=S,x=k0(C=>{const A=C.target,O=[...c.branches].some(j=>j.contains(A));!_||O||(s==null||s(C),i==null||i(C),C.defaultPrevented||a==null||a())},f),I=A0(C=>{const A=C.target;[...c.branches].some(j=>j.contains(A))||(o==null||o(C),i==null||i(C),C.defaultPrevented||a==null||a())},f);return v0(C=>{g===c.layers.size-1&&(n==null||n(C),!C.defaultPrevented&&a&&(C.preventDefault(),a()))},f),q.useEffect(()=>{if(u)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Sd=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),kd(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Sd)}},[u,f,r,c]),q.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),kd())},[u,c]),q.useEffect(()=>{const C=()=>h({});return document.addEventListener(Ms,C),()=>document.removeEventListener(Ms,C)},[]),k.jsx(ct.div,{...l,ref:y,style:{pointerEvents:w?_?"auto":"none":void 0,...e.style},onFocusCapture:tt(e.onFocusCapture,I.onFocusCapture),onBlurCapture:tt(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:tt(e.onPointerDownCapture,x.onPointerDownCapture)})});Wo.displayName=w0;var S0="DismissableLayerBranch",E0=q.forwardRef((e,t)=>{const r=q.useContext(Ed),n=q.useRef(null),s=ft(t,n);return q.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),k.jsx(ct.div,{...e,ref:s})});E0.displayName=S0;function k0(e,t=globalThis==null?void 0:globalThis.document){const r=Pr(e),n=q.useRef(!1),s=q.useRef(()=>{});return q.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let l=function(){Ad(x0,r,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=l,t.addEventListener("click",s.current,{once:!0})):l()}else t.removeEventListener("click",s.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function A0(e,t=globalThis==null?void 0:globalThis.document){const r=Pr(e),n=q.useRef(!1);return q.useEffect(()=>{const s=o=>{o.target&&!n.current&&Ad(_0,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function kd(){const e=new CustomEvent(Ms);document.dispatchEvent(e)}function Ad(e,t,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?y0(s,o):s.dispatchEvent(o)}var Ds=0;function Cd(){q.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Id()),document.body.insertAdjacentElement("beforeend",e[1]??Id()),Ds++,()=>{Ds===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ds--}},[])}function Id(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ls="focusScope.autoFocusOnMount",zs="focusScope.autoFocusOnUnmount",Td={bubbles:!1,cancelable:!0},C0="FocusScope",Bs=q.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[a,l]=q.useState(null),c=Pr(s),u=Pr(o),d=q.useRef(null),f=ft(t,m=>l(m)),h=q.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;q.useEffect(()=>{if(n){let m=function(w){if(h.paused||!a)return;const _=w.target;a.contains(_)?d.current=_:fr(d.current,{select:!0})},b=function(w){if(h.paused||!a)return;const _=w.relatedTarget;_!==null&&(a.contains(_)||fr(d.current,{select:!0}))},S=function(w){if(document.activeElement===document.body)for(const x of w)x.removedNodes.length>0&&fr(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",b);const g=new MutationObserver(S);return a&&g.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",b),g.disconnect()}}},[n,a,h.paused]),q.useEffect(()=>{if(a){Pd.add(h);const m=document.activeElement;if(!a.contains(m)){const S=new CustomEvent(Ls,Td);a.addEventListener(Ls,c),a.dispatchEvent(S),S.defaultPrevented||(I0(N0(jd(a)),{select:!0}),document.activeElement===m&&fr(a))}return()=>{a.removeEventListener(Ls,c),setTimeout(()=>{const S=new CustomEvent(zs,Td);a.addEventListener(zs,u),a.dispatchEvent(S),S.defaultPrevented||fr(m??document.body,{select:!0}),a.removeEventListener(zs,u),Pd.remove(h)},0)}}},[a,c,u,h]);const y=q.useCallback(m=>{if(!r&&!n||h.paused)return;const b=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,S=document.activeElement;if(b&&S){const g=m.currentTarget,[w,_]=T0(g);w&&_?!m.shiftKey&&S===_?(m.preventDefault(),r&&fr(w,{select:!0})):m.shiftKey&&S===w&&(m.preventDefault(),r&&fr(_,{select:!0})):S===g&&m.preventDefault()}},[r,n,h.paused]);return k.jsx(ct.div,{tabIndex:-1,...i,ref:f,onKeyDown:y})});Bs.displayName=C0;function I0(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(fr(n,{select:t}),document.activeElement!==r)return}function T0(e){const t=jd(e),r=Od(t,e),n=Od(t.reverse(),e);return[r,n]}function jd(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Od(e,t){for(const r of e)if(!j0(r,{upTo:t}))return r}function j0(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function O0(e){return e instanceof HTMLInputElement&&"select"in e}function fr(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&O0(e)&&t&&e.select()}}var Pd=P0();function P0(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Nd(e,t),e.unshift(t)},remove(t){var r;e=Nd(e,t),(r=e[0])==null||r.resume()}}}function Nd(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function N0(e){return e.filter(t=>t.tagName!=="A")}var wt=globalThis!=null&&globalThis.document?q.useLayoutEffect:()=>{},R0=q[" useId ".trim().toString()]||(()=>{}),M0=0;function $n(e){const[t,r]=q.useState(R0());return wt(()=>{r(n=>n??String(M0++))},[e]),t?`radix-${t}`:""}const D0=["top","right","bottom","left"],hr=Math.min,Tt=Math.max,$o=Math.round,qo=Math.floor,Ut=e=>({x:e,y:e}),L0={left:"right",right:"left",bottom:"top",top:"bottom"},z0={start:"end",end:"start"};function Us(e,t,r){return Tt(e,hr(t,r))}function Jt(e,t){return typeof e=="function"?e(t):e}function Qt(e){return e.split("-")[0]}function tn(e){return e.split("-")[1]}function Fs(e){return e==="x"?"y":"x"}function Ws(e){return e==="y"?"height":"width"}const B0=new Set(["top","bottom"]);function Ft(e){return B0.has(Qt(e))?"y":"x"}function $s(e){return Fs(Ft(e))}function U0(e,t,r){r===void 0&&(r=!1);const n=tn(e),s=$s(e),o=Ws(s);let i=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=Ho(i)),[i,Ho(i)]}function F0(e){const t=Ho(e);return[qs(e),t,qs(t)]}function qs(e){return e.replace(/start|end/g,t=>z0[t])}const Rd=["left","right"],Md=["right","left"],W0=["top","bottom"],$0=["bottom","top"];function q0(e,t,r){switch(e){case"top":case"bottom":return r?t?Md:Rd:t?Rd:Md;case"left":case"right":return t?W0:$0;default:return[]}}function H0(e,t,r,n){const s=tn(e);let o=q0(Qt(e),r==="start",n);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(qs)))),o}function Ho(e){return e.replace(/left|right|bottom|top/g,t=>L0[t])}function V0(e){return{top:0,right:0,bottom:0,left:0,...e}}function Dd(e){return typeof e!="number"?V0(e):{top:e,right:e,bottom:e,left:e}}function Vo(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function Ld(e,t,r){let{reference:n,floating:s}=e;const o=Ft(t),i=$s(t),a=Ws(i),l=Qt(t),c=o==="y",u=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,f=n[a]/2-s[a]/2;let h;switch(l){case"top":h={x:u,y:n.y-s.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:d};break;case"left":h={x:n.x-s.width,y:d};break;default:h={x:n.x,y:n.y}}switch(tn(t)){case"start":h[i]-=f*(r&&c?-1:1);break;case"end":h[i]+=f*(r&&c?-1:1);break}return h}async function K0(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:o,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Jt(t,e),y=Dd(h),b=a[f?d==="floating"?"reference":"floating":d],S=Vo(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(b)))==null||r?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),g=d==="floating"?{x:n,y:s,width:i.floating.width,height:i.floating.height}:i.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),_=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},x=Vo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:w,strategy:l}):g);return{top:(S.top-x.top+y.top)/_.y,bottom:(x.bottom-S.bottom+y.bottom)/_.y,left:(S.left-x.left+y.left)/_.x,right:(x.right-S.right+y.right)/_.x}}const G0=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:i}=r,a=o.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:d}=Ld(c,n,l),f=n,h={},y=0;for(let b=0;b<a.length;b++){var m;const{name:S,fn:g}=a[b],{x:w,y:_,data:x,reset:I}=await g({x:u,y:d,initialPlacement:n,placement:f,strategy:s,middlewareData:h,rects:c,platform:{...i,detectOverflow:(m=i.detectOverflow)!=null?m:K0},elements:{reference:e,floating:t}});u=w??u,d=_??d,h={...h,[S]:{...h[S],...x}},I&&y<=50&&(y++,typeof I=="object"&&(I.placement&&(f=I.placement),I.rects&&(c=I.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):I.rects),{x:u,y:d}=Ld(c,f,l)),b=-1)}return{x:u,y:d,placement:f,strategy:s,middlewareData:h}},Y0=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:o,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Jt(e,t)||{};if(c==null)return{};const d=Dd(u),f={x:r,y:n},h=$s(s),y=Ws(h),m=await i.getDimensions(c),b=h==="y",S=b?"top":"left",g=b?"bottom":"right",w=b?"clientHeight":"clientWidth",_=o.reference[y]+o.reference[h]-f[h]-o.floating[y],x=f[h]-o.reference[h],I=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let C=I?I[w]:0;(!C||!await(i.isElement==null?void 0:i.isElement(I)))&&(C=a.floating[w]||o.floating[y]);const A=_/2-x/2,O=C/2-m[y]/2-1,j=hr(d[S],O),R=hr(d[g],O),T=j,D=C-m[y]-R,H=C/2-m[y]/2+A,U=Us(T,H,D),ae=!l.arrow&&tn(s)!=null&&H!==U&&o.reference[y]/2-(H<T?j:R)-m[y]/2<0,J=ae?H<T?H-T:H-D:0;return{[h]:f[h]+J,data:{[h]:U,centerOffset:H-U-J,...ae&&{alignmentOffset:J}},reset:ae}}}),J0=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:o,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:m=!0,...b}=Jt(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const S=Qt(s),g=Ft(a),w=Qt(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),x=f||(w||!m?[Ho(a)]:F0(a)),I=y!=="none";!f&&I&&x.push(...H0(a,m,y,_));const C=[a,...x],A=await l.detectOverflow(t,b),O=[];let j=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&O.push(A[S]),d){const H=U0(s,i,_);O.push(A[H[0]],A[H[1]])}if(j=[...j,{placement:s,overflows:O}],!O.every(H=>H<=0)){var R,T;const H=(((R=o.flip)==null?void 0:R.index)||0)+1,U=C[H];if(U&&(!(d==="alignment"?g!==Ft(U):!1)||j.every(M=>Ft(M.placement)===g?M.overflows[0]>0:!0)))return{data:{index:H,overflows:j},reset:{placement:U}};let ae=(T=j.filter(J=>J.overflows[0]<=0).sort((J,M)=>J.overflows[1]-M.overflows[1])[0])==null?void 0:T.placement;if(!ae)switch(h){case"bestFit":{var D;const J=(D=j.filter(M=>{if(I){const ce=Ft(M.placement);return ce===g||ce==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(ce=>ce>0).reduce((ce,Q)=>ce+Q,0)]).sort((M,ce)=>M[1]-ce[1])[0])==null?void 0:D[0];J&&(ae=J);break}case"initialPlacement":ae=a;break}if(s!==ae)return{reset:{placement:ae}}}return{}}}};function zd(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Bd(e){return D0.some(t=>e[t]>=0)}const Q0=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:s="referenceHidden",...o}=Jt(e,t);switch(s){case"referenceHidden":{const i=await n.detectOverflow(t,{...o,elementContext:"reference"}),a=zd(i,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Bd(a)}}}case"escaped":{const i=await n.detectOverflow(t,{...o,altBoundary:!0}),a=zd(i,r.floating);return{data:{escapedOffsets:a,escaped:Bd(a)}}}default:return{}}}}},Ud=new Set(["left","top"]);async function X0(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),i=Qt(r),a=tn(r),l=Ft(r)==="y",c=Ud.has(i)?-1:1,u=o&&l?-1:1,d=Jt(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof y=="number"&&(h=a==="end"?y*-1:y),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const Z0=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:o,placement:i,middlewareData:a}=t,l=await X0(t,e);return i===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:i}}}}},ew=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s,platform:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:S=>{let{x:g,y:w}=S;return{x:g,y:w}}},...c}=Jt(e,t),u={x:r,y:n},d=await o.detectOverflow(t,c),f=Ft(Qt(s)),h=Fs(f);let y=u[h],m=u[f];if(i){const S=h==="y"?"top":"left",g=h==="y"?"bottom":"right",w=y+d[S],_=y-d[g];y=Us(w,y,_)}if(a){const S=f==="y"?"top":"left",g=f==="y"?"bottom":"right",w=m+d[S],_=m-d[g];m=Us(w,m,_)}const b=l.fn({...t,[h]:y,[f]:m});return{...b,data:{x:b.x-r,y:b.y-n,enabled:{[h]:i,[f]:a}}}}}},tw=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:o,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Jt(e,t),u={x:r,y:n},d=Ft(s),f=Fs(d);let h=u[f],y=u[d];const m=Jt(a,t),b=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const w=f==="y"?"height":"width",_=o.reference[f]-o.floating[w]+b.mainAxis,x=o.reference[f]+o.reference[w]-b.mainAxis;h<_?h=_:h>x&&(h=x)}if(c){var S,g;const w=f==="y"?"width":"height",_=Ud.has(Qt(s)),x=o.reference[d]-o.floating[w]+(_&&((S=i.offset)==null?void 0:S[d])||0)+(_?0:b.crossAxis),I=o.reference[d]+o.reference[w]+(_?0:((g=i.offset)==null?void 0:g[d])||0)-(_?b.crossAxis:0);y<x?y=x:y>I&&(y=I)}return{[f]:h,[d]:y}}}},rw=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:o,platform:i,elements:a}=t,{apply:l=()=>{},...c}=Jt(e,t),u=await i.detectOverflow(t,c),d=Qt(s),f=tn(s),h=Ft(s)==="y",{width:y,height:m}=o.floating;let b,S;d==="top"||d==="bottom"?(b=d,S=f===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(S=d,b=f==="end"?"top":"bottom");const g=m-u.top-u.bottom,w=y-u.left-u.right,_=hr(m-u[b],g),x=hr(y-u[S],w),I=!t.middlewareData.shift;let C=_,A=x;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(A=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(C=g),I&&!f){const j=Tt(u.left,0),R=Tt(u.right,0),T=Tt(u.top,0),D=Tt(u.bottom,0);h?A=y-2*(j!==0||R!==0?j+R:Tt(u.left,u.right)):C=m-2*(T!==0||D!==0?T+D:Tt(u.top,u.bottom))}await l({...t,availableWidth:A,availableHeight:C});const O=await i.getDimensions(a.floating);return y!==O.width||m!==O.height?{reset:{rects:!0}}:{}}}};function Ko(){return typeof window<"u"}function rn(e){return Fd(e)?(e.nodeName||"").toLowerCase():"#document"}function jt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Wt(e){var t;return(t=(Fd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Fd(e){return Ko()?e instanceof Node||e instanceof jt(e).Node:!1}function Mt(e){return Ko()?e instanceof Element||e instanceof jt(e).Element:!1}function $t(e){return Ko()?e instanceof HTMLElement||e instanceof jt(e).HTMLElement:!1}function Wd(e){return!Ko()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof jt(e).ShadowRoot}const nw=new Set(["inline","contents"]);function qn(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=Dt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!nw.has(s)}const ow=new Set(["table","td","th"]);function iw(e){return ow.has(rn(e))}const sw=[":popover-open",":modal"];function Go(e){return sw.some(t=>{try{return e.matches(t)}catch{return!1}})}const aw=["transform","translate","scale","rotate","perspective"],lw=["transform","translate","scale","rotate","perspective","filter"],cw=["paint","layout","strict","content"];function Hs(e){const t=Vs(),r=Mt(e)?Dt(e):e;return aw.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||lw.some(n=>(r.willChange||"").includes(n))||cw.some(n=>(r.contain||"").includes(n))}function uw(e){let t=pr(e);for(;$t(t)&&!nn(t);){if(Hs(t))return t;if(Go(t))return null;t=pr(t)}return null}function Vs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const dw=new Set(["html","body","#document"]);function nn(e){return dw.has(rn(e))}function Dt(e){return jt(e).getComputedStyle(e)}function Yo(e){return Mt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function pr(e){if(rn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Wd(e)&&e.host||Wt(e);return Wd(t)?t.host:t}function $d(e){const t=pr(e);return nn(t)?e.ownerDocument?e.ownerDocument.body:e.body:$t(t)&&qn(t)?t:$d(t)}function Hn(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=$d(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),i=jt(s);if(o){const a=Ks(i);return t.concat(i,i.visualViewport||[],qn(s)?s:[],a&&r?Hn(a):[])}return t.concat(s,Hn(s,[],r))}function Ks(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qd(e){const t=Dt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=$t(e),o=s?e.offsetWidth:r,i=s?e.offsetHeight:n,a=$o(r)!==o||$o(n)!==i;return a&&(r=o,n=i),{width:r,height:n,$:a}}function Gs(e){return Mt(e)?e:e.contextElement}function on(e){const t=Gs(e);if(!$t(t))return Ut(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=qd(t);let i=(o?$o(r.width):r.width)/n,a=(o?$o(r.height):r.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const fw=Ut(0);function Hd(e){const t=jt(e);return!Vs()||!t.visualViewport?fw:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function hw(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==jt(e)?!1:t}function Nr(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=Gs(e);let i=Ut(1);t&&(n?Mt(n)&&(i=on(n)):i=on(e));const a=hw(o,r,n)?Hd(o):Ut(0);let l=(s.left+a.x)/i.x,c=(s.top+a.y)/i.y,u=s.width/i.x,d=s.height/i.y;if(o){const f=jt(o),h=n&&Mt(n)?jt(n):n;let y=f,m=Ks(y);for(;m&&n&&h!==y;){const b=on(m),S=m.getBoundingClientRect(),g=Dt(m),w=S.left+(m.clientLeft+parseFloat(g.paddingLeft))*b.x,_=S.top+(m.clientTop+parseFloat(g.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=w,c+=_,y=jt(m),m=Ks(y)}}return Vo({width:u,height:d,x:l,y:c})}function Jo(e,t){const r=Yo(e).scrollLeft;return t?t.left+r:Nr(Wt(e)).left+r}function Vd(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Jo(e,r),s=r.top+t.scrollTop;return{x:n,y:s}}function pw(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",i=Wt(n),a=t?Go(t.floating):!1;if(n===i||a&&o)return r;let l={scrollLeft:0,scrollTop:0},c=Ut(1);const u=Ut(0),d=$t(n);if((d||!d&&!o)&&((rn(n)!=="body"||qn(i))&&(l=Yo(n)),$t(n))){const h=Nr(n);c=on(n),u.x=h.x+n.clientLeft,u.y=h.y+n.clientTop}const f=i&&!d&&!o?Vd(i,l):Ut(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:r.y*c.y-l.scrollTop*c.y+u.y+f.y}}function gw(e){return Array.from(e.getClientRects())}function mw(e){const t=Wt(e),r=Yo(e),n=e.ownerDocument.body,s=Tt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Tt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Jo(e);const a=-r.scrollTop;return Dt(n).direction==="rtl"&&(i+=Tt(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:i,y:a}}const Kd=25;function bw(e,t){const r=jt(e),n=Wt(e),s=r.visualViewport;let o=n.clientWidth,i=n.clientHeight,a=0,l=0;if(s){o=s.width,i=s.height;const u=Vs();(!u||u&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}const c=Jo(n);if(c<=0){const u=n.ownerDocument,d=u.body,f=getComputedStyle(d),h=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,y=Math.abs(n.clientWidth-d.clientWidth-h);y<=Kd&&(o-=y)}else c<=Kd&&(o+=c);return{width:o,height:i,x:a,y:l}}const yw=new Set(["absolute","fixed"]);function vw(e,t){const r=Nr(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=$t(e)?on(e):Ut(1),i=e.clientWidth*o.x,a=e.clientHeight*o.y,l=s*o.x,c=n*o.y;return{width:i,height:a,x:l,y:c}}function Gd(e,t,r){let n;if(t==="viewport")n=bw(e,r);else if(t==="document")n=mw(Wt(e));else if(Mt(t))n=vw(t,r);else{const s=Hd(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Vo(n)}function Yd(e,t){const r=pr(e);return r===t||!Mt(r)||nn(r)?!1:Dt(r).position==="fixed"||Yd(r,t)}function ww(e,t){const r=t.get(e);if(r)return r;let n=Hn(e,[],!1).filter(a=>Mt(a)&&rn(a)!=="body"),s=null;const o=Dt(e).position==="fixed";let i=o?pr(e):e;for(;Mt(i)&&!nn(i);){const a=Dt(i),l=Hs(i);!l&&a.position==="fixed"&&(s=null),(o?!l&&!s:!l&&a.position==="static"&&!!s&&yw.has(s.position)||qn(i)&&!l&&Yd(e,i))?n=n.filter(u=>u!==i):s=a,i=pr(i)}return t.set(e,n),n}function xw(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const i=[...r==="clippingAncestors"?Go(t)?[]:ww(t,this._c):[].concat(r),n],a=i[0],l=i.reduce((c,u)=>{const d=Gd(t,u,s);return c.top=Tt(d.top,c.top),c.right=hr(d.right,c.right),c.bottom=hr(d.bottom,c.bottom),c.left=Tt(d.left,c.left),c},Gd(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function _w(e){const{width:t,height:r}=qd(e);return{width:t,height:r}}function Sw(e,t,r){const n=$t(t),s=Wt(t),o=r==="fixed",i=Nr(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=Ut(0);function c(){l.x=Jo(s)}if(n||!n&&!o)if((rn(t)!=="body"||qn(s))&&(a=Yo(t)),n){const h=Nr(t,!0,o,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else s&&c();o&&!n&&s&&c();const u=s&&!n&&!o?Vd(s,a):Ut(0),d=i.left+a.scrollLeft-l.x-u.x,f=i.top+a.scrollTop-l.y-u.y;return{x:d,y:f,width:i.width,height:i.height}}function Ys(e){return Dt(e).position==="static"}function Jd(e,t){if(!$t(e)||Dt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Wt(e)===r&&(r=r.ownerDocument.body),r}function Qd(e,t){const r=jt(e);if(Go(e))return r;if(!$t(e)){let s=pr(e);for(;s&&!nn(s);){if(Mt(s)&&!Ys(s))return s;s=pr(s)}return r}let n=Jd(e,t);for(;n&&iw(n)&&Ys(n);)n=Jd(n,t);return n&&nn(n)&&Ys(n)&&!Hs(n)?r:n||uw(e)||r}const Ew=async function(e){const t=this.getOffsetParent||Qd,r=this.getDimensions,n=await r(e.floating);return{reference:Sw(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function kw(e){return Dt(e).direction==="rtl"}const Aw={convertOffsetParentRelativeRectToViewportRelativeRect:pw,getDocumentElement:Wt,getClippingRect:xw,getOffsetParent:Qd,getElementRects:Ew,getClientRects:gw,getDimensions:_w,getScale:on,isElement:Mt,isRTL:kw};function Xd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Cw(e,t){let r=null,n;const s=Wt(e);function o(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=c;if(a||t(),!f||!h)return;const y=qo(d),m=qo(s.clientWidth-(u+f)),b=qo(s.clientHeight-(d+h)),S=qo(u),w={rootMargin:-y+"px "+-m+"px "+-b+"px "+-S+"px",threshold:Tt(0,hr(1,l))||1};let _=!0;function x(I){const C=I[0].intersectionRatio;if(C!==l){if(!_)return i();C?i(!1,C):n=setTimeout(()=>{i(!1,1e-7)},1e3)}C===1&&!Xd(c,e.getBoundingClientRect())&&i(),_=!1}try{r=new IntersectionObserver(x,{...w,root:s.ownerDocument})}catch{r=new IntersectionObserver(x,w)}r.observe(e)}return i(!0),o}function Iw(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=Gs(e),u=s||o?[...c?Hn(c):[],...Hn(t)]:[];u.forEach(S=>{s&&S.addEventListener("scroll",r,{passive:!0}),o&&S.addEventListener("resize",r)});const d=c&&a?Cw(c,r):null;let f=-1,h=null;i&&(h=new ResizeObserver(S=>{let[g]=S;g&&g.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),r()}),c&&!l&&h.observe(c),h.observe(t));let y,m=l?Nr(e):null;l&&b();function b(){const S=Nr(e);m&&!Xd(m,S)&&r(),m=S,y=requestAnimationFrame(b)}return r(),()=>{var S;u.forEach(g=>{s&&g.removeEventListener("scroll",r),o&&g.removeEventListener("resize",r)}),d==null||d(),(S=h)==null||S.disconnect(),h=null,l&&cancelAnimationFrame(y)}}const Tw=Z0,jw=ew,Ow=J0,Pw=rw,Nw=Q0,Zd=Y0,Rw=tw,Mw=(e,t,r)=>{const n=new Map,s={platform:Aw,...r},o={...s.platform,_c:n};return G0(e,t,{...s,platform:o})};var Dw=typeof document<"u",Lw=function(){},Qo=Dw?z.useLayoutEffect:Lw;function Xo(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 r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Xo(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const o=s[n];if(!(o==="_owner"&&e.$$typeof)&&!Xo(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function ef(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tf(e,t){const r=ef(e);return Math.round(t*r)/r}function Js(e){const t=q.useRef(e);return Qo(()=>{t.current=e}),t}function zw(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:o,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=q.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=q.useState(n);Xo(f,n)||h(n);const[y,m]=q.useState(null),[b,S]=q.useState(null),g=q.useCallback(M=>{M!==I.current&&(I.current=M,m(M))},[]),w=q.useCallback(M=>{M!==C.current&&(C.current=M,S(M))},[]),_=o||y,x=i||b,I=q.useRef(null),C=q.useRef(null),A=q.useRef(u),O=l!=null,j=Js(l),R=Js(s),T=Js(c),D=q.useCallback(()=>{if(!I.current||!C.current)return;const M={placement:t,strategy:r,middleware:f};R.current&&(M.platform=R.current),Mw(I.current,C.current,M).then(ce=>{const Q={...ce,isPositioned:T.current!==!1};H.current&&!Xo(A.current,Q)&&(A.current=Q,ho.flushSync(()=>{d(Q)}))})},[f,t,r,R,T]);Qo(()=>{c===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(M=>({...M,isPositioned:!1})))},[c]);const H=q.useRef(!1);Qo(()=>(H.current=!0,()=>{H.current=!1}),[]),Qo(()=>{if(_&&(I.current=_),x&&(C.current=x),_&&x){if(j.current)return j.current(_,x,D);D()}},[_,x,D,j,O]);const U=q.useMemo(()=>({reference:I,floating:C,setReference:g,setFloating:w}),[g,w]),ae=q.useMemo(()=>({reference:_,floating:x}),[_,x]),J=q.useMemo(()=>{const M={position:r,left:0,top:0};if(!ae.floating)return M;const ce=tf(ae.floating,u.x),Q=tf(ae.floating,u.y);return a?{...M,transform:"translate("+ce+"px, "+Q+"px)",...ef(ae.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:ce,top:Q}},[r,a,ae.floating,u.x,u.y]);return q.useMemo(()=>({...u,update:D,refs:U,elements:ae,floatingStyles:J}),[u,D,U,ae,J])}const Bw=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Zd({element:n.current,padding:s}).fn(r):{}:n?Zd({element:n,padding:s}).fn(r):{}}}},Uw=(e,t)=>({...Tw(e),options:[e,t]}),Fw=(e,t)=>({...jw(e),options:[e,t]}),Ww=(e,t)=>({...Rw(e),options:[e,t]}),$w=(e,t)=>({...Ow(e),options:[e,t]}),qw=(e,t)=>({...Pw(e),options:[e,t]}),Hw=(e,t)=>({...Nw(e),options:[e,t]}),Vw=(e,t)=>({...Bw(e),options:[e,t]});var Kw="Arrow",rf=q.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return k.jsx(ct.svg,{...o,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:k.jsx("polygon",{points:"0,0 30,0 15,10"})})});rf.displayName=Kw;var Gw=rf;function Yw(e){const[t,r]=q.useState(void 0);return wt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let i,a;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;r({width:i,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Qs="Popper",[nf,sn]=Wn(Qs),[Jw,of]=nf(Qs),sf=e=>{const{__scopePopper:t,children:r}=e,[n,s]=q.useState(null);return k.jsx(Jw,{scope:t,anchor:n,onAnchorChange:s,children:r})};sf.displayName=Qs;var af="PopperAnchor",lf=q.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=of(af,r),i=q.useRef(null),a=ft(t,i),l=q.useRef(null);return q.useEffect(()=>{const c=l.current;l.current=(n==null?void 0:n.current)||i.current,c!==l.current&&o.onAnchorChange(l.current)}),n?null:k.jsx(ct.div,{...s,ref:a})});lf.displayName=af;var Xs="PopperContent",[Qw,Xw]=nf(Xs),cf=q.forwardRef((e,t)=>{var L,W,le,$,ee,ne;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:y,...m}=e,b=of(Xs,r),[S,g]=q.useState(null),w=ft(t,me=>g(me)),[_,x]=q.useState(null),I=Yw(_),C=(I==null?void 0:I.width)??0,A=(I==null?void 0:I.height)??0,O=n+(o!=="center"?"-"+o:""),j=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},R=Array.isArray(c)?c:[c],T=R.length>0,D={padding:j,boundary:R.filter(ex),altBoundary:T},{refs:H,floatingStyles:U,placement:ae,isPositioned:J,middlewareData:M}=zw({strategy:"fixed",placement:O,whileElementsMounted:(...me)=>Iw(...me,{animationFrame:h==="always"}),elements:{reference:b.anchor},middleware:[Uw({mainAxis:s+A,alignmentAxis:i}),l&&Fw({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Ww():void 0,...D}),l&&$w({...D}),qw({...D,apply:({elements:me,rects:pe,availableWidth:G,availableHeight:ie})=>{const{width:he,height:be}=pe.reference,ve=me.floating.style;ve.setProperty("--radix-popper-available-width",`${G}px`),ve.setProperty("--radix-popper-available-height",`${ie}px`),ve.setProperty("--radix-popper-anchor-width",`${he}px`),ve.setProperty("--radix-popper-anchor-height",`${be}px`)}}),_&&Vw({element:_,padding:a}),tx({arrowWidth:C,arrowHeight:A}),f&&Hw({strategy:"referenceHidden",...D})]}),[ce,Q]=ff(ae),B=Pr(y);wt(()=>{J&&(B==null||B())},[J,B]);const N=(L=M.arrow)==null?void 0:L.x,Y=(W=M.arrow)==null?void 0:W.y,ue=((le=M.arrow)==null?void 0:le.centerOffset)!==0,[X,we]=q.useState();return wt(()=>{S&&we(window.getComputedStyle(S).zIndex)},[S]),k.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:J?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[($=M.transformOrigin)==null?void 0:$.x,(ee=M.transformOrigin)==null?void 0:ee.y].join(" "),...((ne=M.hide)==null?void 0:ne.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:k.jsx(Qw,{scope:r,placedSide:ce,onArrowChange:x,arrowX:N,arrowY:Y,shouldHideArrow:ue,children:k.jsx(ct.div,{"data-side":ce,"data-align":Q,...m,ref:w,style:{...m.style,animation:J?void 0:"none"}})})})});cf.displayName=Xs;var uf="PopperArrow",Zw={top:"bottom",right:"left",bottom:"top",left:"right"},df=q.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=Xw(uf,n),i=Zw[o.placedSide];return k.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:k.jsx(Gw,{...s,ref:r,style:{...s.style,display:"block"}})})});df.displayName=uf;function ex(e){return e!==null}var tx=e=>({name:"transformOrigin",options:e,fn(t){var b,S,g;const{placement:r,rects:n,middlewareData:s}=t,i=((b=s.arrow)==null?void 0:b.centerOffset)!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,u]=ff(r),d={start:"0%",center:"50%",end:"100%"}[u],f=(((S=s.arrow)==null?void 0:S.x)??0)+a/2,h=(((g=s.arrow)==null?void 0:g.y)??0)+l/2;let y="",m="";return c==="bottom"?(y=i?d:`${f}px`,m=`${-l}px`):c==="top"?(y=i?d:`${f}px`,m=`${n.floating.height+l}px`):c==="right"?(y=`${-l}px`,m=i?d:`${h}px`):c==="left"&&(y=`${n.floating.width+l}px`,m=i?d:`${h}px`),{data:{x:y,y:m}}}});function ff(e){const[t,r="center"]=e.split("-");return[t,r]}var Zs=sf,Zo=lf,ea=cf,ta=df,rx="Portal",ei=q.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[s,o]=q.useState(!1);wt(()=>o(!0),[]);const i=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Bt.createPortal(k.jsx(ct.div,{...n,ref:t}),i):null});ei.displayName=rx;var nx=q[" useInsertionEffect ".trim().toString()]||wt;function ti({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,o,i]=ox({defaultProp:t,onChange:r}),a=e!==void 0,l=a?e:s;{const u=q.useRef(e!==void 0);q.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,n])}const c=q.useCallback(u=>{var d;if(a){const f=ix(u)?u(e):u;f!==e&&((d=i.current)==null||d.call(i,f))}else o(u)},[a,e,o,i]);return[l,c]}function ox({defaultProp:e,onChange:t}){const[r,n]=q.useState(e),s=q.useRef(r),o=q.useRef(t);return nx(()=>{o.current=t},[t]),q.useEffect(()=>{var i;s.current!==r&&((i=o.current)==null||i.call(o,r),s.current=r)},[r,s]),[r,n,o]}function ix(e){return typeof e=="function"}function sx(e){const t=q.useRef({value:e,previous:e});return q.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var hf=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ax="VisuallyHidden",pf=q.forwardRef((e,t)=>k.jsx(ct.span,{...e,ref:t,style:{...hf,...e.style}}));pf.displayName=ax;var lx=pf,cx=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},an=new WeakMap,ri=new WeakMap,ni={},ra=0,gf=function(e){return e&&(e.host||gf(e.parentNode))},ux=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=gf(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},dx=function(e,t,r,n){var s=ux(t,Array.isArray(e)?e:[e]);ni[r]||(ni[r]=new WeakMap);var o=ni[r],i=[],a=new Set,l=new Set(s),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};s.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var h=f.getAttribute(n),y=h!==null&&h!=="false",m=(an.get(f)||0)+1,b=(o.get(f)||0)+1;an.set(f,m),o.set(f,b),i.push(f),m===1&&y&&ri.set(f,!0),b===1&&f.setAttribute(r,"true"),y||f.setAttribute(n,"true")}catch(S){console.error("aria-hidden: cannot operate on ",f,S)}})};return u(t),a.clear(),ra++,function(){i.forEach(function(d){var f=an.get(d)-1,h=o.get(d)-1;an.set(d,f),o.set(d,h),f||(ri.has(d)||d.removeAttribute(n),ri.delete(d)),h||d.removeAttribute(r)}),ra--,ra||(an=new WeakMap,an=new WeakMap,ri=new WeakMap,ni={})}},mf=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=cx(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live], script"))),dx(n,s,r,"aria-hidden")):function(){return null}},qt=function(){return qt=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},qt.apply(this,arguments)};function bf(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function fx(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,o;n<s;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var oi="right-scroll-bar-position",ii="width-before-scroll-bar",hx="with-scroll-bars-hidden",px="--removed-body-scroll-bar-size";function na(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gx(e,t){var r=z.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var mx=typeof window<"u"?q.useLayoutEffect:q.useEffect,yf=new WeakMap;function bx(e,t){var r=gx(null,function(n){return e.forEach(function(s){return na(s,n)})});return mx(function(){var n=yf.get(r);if(n){var s=new Set(n),o=new Set(e),i=r.current;s.forEach(function(a){o.has(a)||na(a,null)}),o.forEach(function(a){s.has(a)||na(a,i)})}yf.set(r,e)},[e]),r}function yx(e){return e}function vx(e,t){t===void 0&&(t=yx);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(o){var i=t(o,n);return r.push(i),function(){r=r.filter(function(a){return a!==i})}},assignSyncMedium:function(o){for(n=!0;r.length;){var i=r;r=[],i.forEach(o)}r={push:function(a){return o(a)},filter:function(){return r}}},assignMedium:function(o){n=!0;var i=[];if(r.length){var a=r;r=[],a.forEach(o),i=r}var l=function(){var u=i;i=[],u.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),r={push:function(u){i.push(u),c()},filter:function(u){return i=i.filter(u),r}}}};return s}function xx(e){e===void 0&&(e={});var t=vx(null);return t.options=qt({async:!0,ssr:!1},e),t}var vf=function(e){var t=e.sideCar,r=bf(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return q.createElement(n,qt({},r))};vf.isSideCarExport=!0;function _x(e,t){return e.useMedium(t),vf}var wf=xx(),oa=function(){},si=q.forwardRef(function(e,t){var r=q.useRef(null),n=q.useState({onScrollCapture:oa,onWheelCapture:oa,onTouchMoveCapture:oa}),s=n[0],o=n[1],i=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,h=e.noRelative,y=e.noIsolation,m=e.inert,b=e.allowPinchZoom,S=e.as,g=S===void 0?"div":S,w=e.gapMode,_=bf(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=f,I=bx([r,t]),C=qt(qt({},_),s);return q.createElement(q.Fragment,null,u&&q.createElement(x,{sideCar:wf,removeScrollBar:c,shards:d,noRelative:h,noIsolation:y,inert:m,setCallbacks:o,allowPinchZoom:!!b,lockRef:r,gapMode:w}),i?q.cloneElement(q.Children.only(a),qt(qt({},C),{ref:I})):q.createElement(g,qt({},C,{className:l,ref:I}),a))});si.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},si.classNames={fullWidth:ii,zeroRight:oi};var Sx=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ex(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Sx();return t&&e.setAttribute("nonce",t),e}function kx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ax(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Cx=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Ex())&&(kx(t,r),Ax(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ix=function(){var e=Cx();return function(t,r){q.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},xf=function(){var e=Ix(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},Tx={left:0,top:0,right:0,gap:0},ia=function(e){return parseInt(e||"",10)||0},jx=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[ia(r),ia(n),ia(s)]},Ox=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Tx;var t=jx(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Px=xf(),ln="data-scroll-locked",Nx=function(e,t,r,n){var s=e.left,o=e.top,i=e.right,a=e.gap;return r===void 0&&(r="margin"),`
|
|
187
|
+
.`.concat(hx,` {
|
|
188
188
|
overflow: hidden `).concat(n,`;
|
|
189
189
|
padding-right: `).concat(a,"px ").concat(n,`;
|
|
190
190
|
}
|
|
191
|
-
body[`).concat(
|
|
191
|
+
body[`).concat(ln,`] {
|
|
192
192
|
overflow: hidden `).concat(n,`;
|
|
193
193
|
overscroll-behavior: contain;
|
|
194
194
|
`).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
|
|
195
|
-
padding-left: `.concat(
|
|
196
|
-
padding-top: `).concat(
|
|
197
|
-
padding-right: `).concat(
|
|
195
|
+
padding-left: `.concat(s,`px;
|
|
196
|
+
padding-top: `).concat(o,`px;
|
|
197
|
+
padding-right: `).concat(i,`px;
|
|
198
198
|
margin-left:0;
|
|
199
199
|
margin-top:0;
|
|
200
200
|
margin-right: `).concat(a,"px ").concat(n,`;
|
|
201
201
|
`),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),`
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
.`).concat(
|
|
204
|
+
.`).concat(oi,` {
|
|
205
205
|
right: `).concat(a,"px ").concat(n,`;
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
.`).concat(
|
|
208
|
+
.`).concat(ii,` {
|
|
209
209
|
margin-right: `).concat(a,"px ").concat(n,`;
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
.`).concat(
|
|
212
|
+
.`).concat(oi," .").concat(oi,` {
|
|
213
213
|
right: 0 `).concat(n,`;
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
-
.`).concat(
|
|
216
|
+
.`).concat(ii," .").concat(ii,` {
|
|
217
217
|
margin-right: 0 `).concat(n,`;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
body[`).concat(
|
|
221
|
-
`).concat(
|
|
220
|
+
body[`).concat(ln,`] {
|
|
221
|
+
`).concat(px,": ").concat(a,`px;
|
|
222
222
|
}
|
|
223
|
-
`)},
|
|
223
|
+
`)},_f=function(){var e=parseInt(document.body.getAttribute(ln)||"0",10);return isFinite(e)?e:0},Rx=function(){q.useEffect(function(){return document.body.setAttribute(ln,(_f()+1).toString()),function(){var e=_f()-1;e<=0?document.body.removeAttribute(ln):document.body.setAttribute(ln,e.toString())}},[])},Mx=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;Rx();var o=q.useMemo(function(){return Ox(s)},[s]);return q.createElement(Px,{styles:Nx(o,!t,s,r?"":"!important")})},sa=!1;if(typeof window<"u")try{var ai=Object.defineProperty({},"passive",{get:function(){return sa=!0,!0}});window.addEventListener("test",ai,ai),window.removeEventListener("test",ai,ai)}catch{sa=!1}var cn=sa?{passive:!1}:!1,Dx=function(e){return e.tagName==="TEXTAREA"},Sf=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Dx(e)&&r[t]==="visible")},Lx=function(e){return Sf(e,"overflowY")},zx=function(e){return Sf(e,"overflowX")},Ef=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=kf(e,n);if(s){var o=Af(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Bx=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Ux=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},kf=function(e,t){return e==="v"?Lx(t):zx(t)},Af=function(e,t){return e==="v"?Bx(t):Ux(t)},Fx=function(e,t){return e==="h"&&t==="rtl"?-1:1},Wx=function(e,t,r,n,s){var o=Fx(e,window.getComputedStyle(t).direction),i=o*n,a=r.target,l=t.contains(a),c=!1,u=i>0,d=0,f=0;do{if(!a)break;var h=Af(e,a),y=h[0],m=h[1],b=h[2],S=m-b-o*y;(y||S)&&kf(e,a)&&(d+=S,f+=y);var g=a.parentNode;a=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&Math.abs(d)<1||!u&&Math.abs(f)<1)&&(c=!0),c},li=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Cf=function(e){return[e.deltaX,e.deltaY]},If=function(e){return e&&"current"in e?e.current:e},$x=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qx=function(e){return`
|
|
224
224
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
225
225
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
226
|
-
`)},Mm=0,rr=[];function Rm(e){var t=b.useRef([]),r=b.useRef([0,0]),n=b.useRef(),o=b.useState(Mm++)[0],i=b.useState(Qa)[0],s=b.useRef(e);b.useEffect(function(){s.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=om([e.lockRef.current],(e.shards||[]).map(sl),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=b.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var y=Un(m),k=r.current,x="deltaX"in m?m.deltaX:k[0]-y[0],S="deltaY"in m?m.deltaY:k[1]-y[1],C,E=m.target,N=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in m&&N==="h"&&E.type==="range")return!1;var j=window.getSelection(),D=j&&j.anchorNode,M=D?D===E||D.contains(E):!1;if(M)return!1;var I=rl(N,E);if(!I)return!0;if(I?C=N:(C=N==="v"?"h":"v",I=rl(N,E)),!I)return!1;if(!n.current&&"changedTouches"in m&&(x||S)&&(n.current=C),!C)return!0;var R=n.current||C;return Im(R,v,m,R==="h"?x:S)},[]),l=b.useCallback(function(m){var v=m;if(!(!rr.length||rr[rr.length-1]!==i)){var y="deltaY"in v?il(v):Un(v),k=t.current.filter(function(C){return C.name===v.type&&(C.target===v.target||v.target===C.shadowParent)&&Dm(C.delta,y)})[0];if(k&&k.should){v.cancelable&&v.preventDefault();return}if(!k){var x=(s.current.shards||[]).map(sl).filter(Boolean).filter(function(C){return C.contains(v.target)}),S=x.length>0?a(v,x[0]):!s.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),d=b.useCallback(function(m,v,y,k){var x={name:m,delta:v,target:y,should:k,shadowParent:Lm(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),u=b.useCallback(function(m){r.current=Un(m),n.current=void 0},[]),f=b.useCallback(function(m){d(m.type,il(m),m.target,a(m,e.lockRef.current))},[]),h=b.useCallback(function(m){d(m.type,Un(m),m.target,a(m,e.lockRef.current))},[]);b.useEffect(function(){return rr.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,tr),document.addEventListener("touchmove",l,tr),document.addEventListener("touchstart",u,tr),function(){rr=rr.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,tr),document.removeEventListener("touchmove",l,tr),document.removeEventListener("touchstart",u,tr)}},[]);var p=e.removeScrollBar,w=e.inert;return b.createElement(b.Fragment,null,w?b.createElement(i,{styles:_m(o)}):null,p?b.createElement(jm,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Lm(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const $m=pm(Za,Rm);var ni=b.forwardRef(function(e,t){return b.createElement(Fn,dt({},e,{ref:t,sideCar:$m}))});ni.classNames=Fn.classNames;var Fm=[" ","Enter","ArrowUp","ArrowDown"],Wm=[" ","Enter"],Mt="Select",[Bn,Hn,Um]=sp(Mt),[nr]=Ar(Mt,[Um,Zt]),Vn=Zt(),[Bm,Et]=nr(Mt),[Hm,Vm]=nr(Mt),al=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:d,name:u,autoComplete:f,disabled:h,required:p,form:w}=e,m=Vn(t),[v,y]=b.useState(null),[k,x]=b.useState(null),[S,C]=b.useState(!1),E=lp(d),[N,j]=_n({prop:n,defaultProp:o??!1,onChange:i,caller:Mt}),[D,M]=_n({prop:s,defaultProp:a,onChange:l,caller:Mt}),I=b.useRef(null),R=v?w||!!v.closest("form"):!0,[L,K]=b.useState(new Set),B=Array.from(L).map(W=>W.props.value).join(";");return c.jsx(qo,{...m,children:c.jsxs(Bm,{required:p,scope:t,trigger:v,onTriggerChange:y,valueNode:k,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:zr(),value:D,onValueChange:M,open:N,onOpenChange:j,dir:E,triggerPointerDownPosRef:I,disabled:h,children:[c.jsx(Bn.Provider,{scope:t,children:c.jsx(Hm,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(W=>{K(U=>new Set(U).add(W))},[]),onNativeOptionRemove:b.useCallback(W=>{K(U=>{const A=new Set(U);return A.delete(W),A})},[]),children:r})}),R?c.jsxs(Nl,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:f,value:D,onChange:W=>M(W.target.value),disabled:h,form:w,children:[D===void 0?c.jsx("option",{value:""}):null,Array.from(L)]},B):null]})})};al.displayName=Mt;var ll="SelectTrigger",cl=b.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=Vn(r),s=Et(ll,r),a=s.disabled||n,l=je(t,s.onTriggerChange),d=Hn(r),u=b.useRef("touch"),[f,h,p]=Al(m=>{const v=d().filter(x=>!x.disabled),y=v.find(x=>x.value===s.value),k=zl(v,m,y);k!==void 0&&s.onValueChange(k.value)}),w=m=>{a||(s.onOpenChange(!0),p()),m&&(s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return c.jsx(In,{asChild:!0,...i,children:c.jsx(Se.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Tl(s.value)?"":void 0,...o,ref:l,onClick:me(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&w(m)}),onPointerDown:me(o.onPointerDown,m=>{u.current=m.pointerType;const v=m.target;v.hasPointerCapture(m.pointerId)&&v.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(w(m),m.preventDefault())}),onKeyDown:me(o.onKeyDown,m=>{const v=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&h(m.key),!(v&&m.key===" ")&&Fm.includes(m.key)&&(w(),m.preventDefault())})})})});cl.displayName=ll;var dl="SelectValue",ul=b.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...a}=e,l=Et(dl,r),{onValueNodeHasChildrenChange:d}=l,u=i!==void 0,f=je(t,l.onValueNodeChange);return Fe(()=>{d(u)},[d,u]),c.jsx(Se.span,{...a,ref:f,style:{pointerEvents:"none"},children:Tl(l.value)?c.jsx(c.Fragment,{children:s}):i})});ul.displayName=dl;var Km="SelectIcon",fl=b.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return c.jsx(Se.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});fl.displayName=Km;var Gm="SelectPortal",pl=e=>c.jsx(Dn,{asChild:!0,...e});pl.displayName=Gm;var Rt="SelectContent",hl=b.forwardRef((e,t)=>{const r=Et(Rt,e.__scopeSelect),[n,o]=b.useState();if(Fe(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?Kr.createPortal(c.jsx(ml,{scope:e.__scopeSelect,children:c.jsx(Bn.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),i):null}return c.jsx(gl,{...e,ref:t})});hl.displayName=Rt;var ot=10,[ml,jt]=nr(Rt),Ym="SelectContentImpl",qm=Gt("SelectContent.RemoveScroll"),gl=b.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:w,hideWhenDetached:m,avoidCollisions:v,...y}=e,k=Et(Rt,r),[x,S]=b.useState(null),[C,E]=b.useState(null),N=je(t,P=>S(P)),[j,D]=b.useState(null),[M,I]=b.useState(null),R=Hn(r),[L,K]=b.useState(!1),B=b.useRef(!1);b.useEffect(()=>{if(x)return Ya(x)},[x]),sa();const W=b.useCallback(P=>{const[Q,...ee]=R().map(te=>te.ref.current),[$]=ee.slice(-1),ie=document.activeElement;for(const te of P)if(te===ie||(te==null||te.scrollIntoView({block:"nearest"}),te===Q&&C&&(C.scrollTop=0),te===$&&C&&(C.scrollTop=C.scrollHeight),te==null||te.focus(),document.activeElement!==ie))return},[R,C]),U=b.useCallback(()=>W([j,x]),[W,j,x]);b.useEffect(()=>{L&&U()},[L,U]);const{onOpenChange:A,triggerPointerDownPosRef:J}=k;b.useEffect(()=>{if(x){let P={x:0,y:0};const Q=$=>{var ie,te;P={x:Math.abs(Math.round($.pageX)-(((ie=J.current)==null?void 0:ie.x)??0)),y:Math.abs(Math.round($.pageY)-(((te=J.current)==null?void 0:te.y)??0))}},ee=$=>{P.x<=10&&P.y<=10?$.preventDefault():x.contains($.target)||A(!1),document.removeEventListener("pointermove",Q),J.current=null};return J.current!==null&&(document.addEventListener("pointermove",Q),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",ee,{capture:!0})}}},[x,A,J]),b.useEffect(()=>{const P=()=>A(!1);return window.addEventListener("blur",P),window.addEventListener("resize",P),()=>{window.removeEventListener("blur",P),window.removeEventListener("resize",P)}},[A]);const[oe,T]=Al(P=>{const Q=R().filter(ie=>!ie.disabled),ee=Q.find(ie=>ie.ref.current===document.activeElement),$=zl(Q,P,ee);$&&setTimeout(()=>$.ref.current.focus())}),F=b.useCallback((P,Q,ee)=>{const $=!B.current&&!ee;(k.value!==void 0&&k.value===Q||$)&&(D(P),$&&(B.current=!0))},[k.value]),X=b.useCallback(()=>x==null?void 0:x.focus(),[x]),G=b.useCallback((P,Q,ee)=>{const $=!B.current&&!ee;(k.value!==void 0&&k.value===Q||$)&&I(P)},[k.value]),ve=n==="popper"?oi:bl,le=ve===oi?{side:a,sideOffset:l,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:w,hideWhenDetached:m,avoidCollisions:v}:{};return c.jsx(ml,{scope:r,content:x,viewport:C,onViewportChange:E,itemRefCallback:F,selectedItem:j,onItemLeave:X,itemTextRefCallback:G,focusSelectedItem:U,selectedItemText:M,position:n,isPositioned:L,searchRef:oe,children:c.jsx(ni,{as:qm,allowPinchZoom:!0,children:c.jsx(_o,{asChild:!0,trapped:k.open,onMountAutoFocus:P=>{P.preventDefault()},onUnmountAutoFocus:me(o,P=>{var Q;(Q=k.trigger)==null||Q.focus({preventScroll:!0}),P.preventDefault()}),children:c.jsx(kn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:P=>P.preventDefault(),onDismiss:()=>k.onOpenChange(!1),children:c.jsx(ve,{role:"listbox",id:k.contentId,"data-state":k.open?"open":"closed",dir:k.dir,onContextMenu:P=>P.preventDefault(),...y,...le,onPlaced:()=>K(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:me(y.onKeyDown,P=>{const Q=P.ctrlKey||P.altKey||P.metaKey;if(P.key==="Tab"&&P.preventDefault(),!Q&&P.key.length===1&&T(P.key),["ArrowUp","ArrowDown","Home","End"].includes(P.key)){let $=R().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);if(["ArrowUp","End"].includes(P.key)&&($=$.slice().reverse()),["ArrowUp","ArrowDown"].includes(P.key)){const ie=P.target,te=$.indexOf(ie);$=$.slice(te+1)}setTimeout(()=>W($)),P.preventDefault()}})})})})})})});gl.displayName=Ym;var Xm="SelectItemAlignedPosition",bl=b.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=Et(Rt,r),s=jt(Rt,r),[a,l]=b.useState(null),[d,u]=b.useState(null),f=je(t,N=>u(N)),h=Hn(r),p=b.useRef(!1),w=b.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:y,focusSelectedItem:k}=s,x=b.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&d&&m&&v&&y){const N=i.trigger.getBoundingClientRect(),j=d.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),M=y.getBoundingClientRect();if(i.dir!=="rtl"){const ie=M.left-j.left,te=D.left-ie,ke=N.left-te,we=N.width+ke,De=Math.max(we,j.width),Re=window.innerWidth-ot,Be=Zs(te,[ot,Math.max(ot,Re-De)]);a.style.minWidth=we+"px",a.style.left=Be+"px"}else{const ie=j.right-M.right,te=window.innerWidth-D.right-ie,ke=window.innerWidth-N.right-te,we=N.width+ke,De=Math.max(we,j.width),Re=window.innerWidth-ot,Be=Zs(te,[ot,Math.max(ot,Re-De)]);a.style.minWidth=we+"px",a.style.right=Be+"px"}const I=h(),R=window.innerHeight-ot*2,L=m.scrollHeight,K=window.getComputedStyle(d),B=parseInt(K.borderTopWidth,10),W=parseInt(K.paddingTop,10),U=parseInt(K.borderBottomWidth,10),A=parseInt(K.paddingBottom,10),J=B+W+L+A+U,oe=Math.min(v.offsetHeight*5,J),T=window.getComputedStyle(m),F=parseInt(T.paddingTop,10),X=parseInt(T.paddingBottom,10),G=N.top+N.height/2-ot,ve=R-G,le=v.offsetHeight/2,P=v.offsetTop+le,Q=B+W+P,ee=J-Q;if(Q<=G){const ie=I.length>0&&v===I[I.length-1].ref.current;a.style.bottom="0px";const te=d.clientHeight-m.offsetTop-m.offsetHeight,ke=Math.max(ve,le+(ie?X:0)+te+U),we=Q+ke;a.style.height=we+"px"}else{const ie=I.length>0&&v===I[0].ref.current;a.style.top="0px";const ke=Math.max(G,B+m.offsetTop+(ie?F:0)+le)+ee;a.style.height=ke+"px",m.scrollTop=Q-G+m.offsetTop}a.style.margin=`${ot}px 0`,a.style.minHeight=oe+"px",a.style.maxHeight=R+"px",n==null||n(),requestAnimationFrame(()=>p.current=!0)}},[h,i.trigger,i.valueNode,a,d,m,v,y,i.dir,n]);Fe(()=>x(),[x]);const[S,C]=b.useState();Fe(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);const E=b.useCallback(N=>{N&&w.current===!0&&(x(),k==null||k(),w.current=!1)},[x,k]);return c.jsx(Zm,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:E,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:c.jsx(Se.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});bl.displayName=Xm;var Jm="SelectPopperPosition",oi=b.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=ot,...i}=e,s=Vn(r);return c.jsx(Xo,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});oi.displayName=Jm;var[Zm,ii]=nr(Rt,{}),si="SelectViewport",vl=b.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=jt(si,r),s=ii(si,r),a=je(t,i.onViewportChange),l=b.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),c.jsx(Bn.Slot,{scope:r,children:c.jsx(Se.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:me(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=s;if(h!=null&&h.current&&f){const p=Math.abs(l.current-u.scrollTop);if(p>0){const w=window.innerHeight-ot*2,m=parseFloat(f.style.minHeight),v=parseFloat(f.style.height),y=Math.max(m,v);if(y<w){const k=y+p,x=Math.min(w,k),S=k-x;f.style.height=x+"px",f.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});vl.displayName=si;var xl="SelectGroup",[Qm,eg]=nr(xl),tg=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=zr();return c.jsx(Qm,{scope:r,id:o,children:c.jsx(Se.div,{role:"group","aria-labelledby":o,...n,ref:t})})});tg.displayName=xl;var wl="SelectLabel",rg=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=eg(wl,r);return c.jsx(Se.div,{id:o.id,...n,ref:t})});rg.displayName=wl;var Kn="SelectItem",[ng,yl]=nr(Kn),kl=b.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,a=Et(Kn,r),l=jt(Kn,r),d=a.value===n,[u,f]=b.useState(i??""),[h,p]=b.useState(!1),w=je(t,k=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,k,n,o)}),m=zr(),v=b.useRef("touch"),y=()=>{o||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(ng,{scope:r,value:n,disabled:o,textId:m,isSelected:d,onItemTextChange:b.useCallback(k=>{f(x=>x||((k==null?void 0:k.textContent)??"").trim())},[]),children:c.jsx(Bn.ItemSlot,{scope:r,value:n,disabled:o,textValue:u,children:c.jsx(Se.div,{role:"option","aria-labelledby":m,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:w,onFocus:me(s.onFocus,()=>p(!0)),onBlur:me(s.onBlur,()=>p(!1)),onClick:me(s.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:me(s.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:me(s.onPointerDown,k=>{v.current=k.pointerType}),onPointerMove:me(s.onPointerMove,k=>{var x;v.current=k.pointerType,o?(x=l.onItemLeave)==null||x.call(l):v.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:me(s.onPointerLeave,k=>{var x;k.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:me(s.onKeyDown,k=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&k.key===" "||(Wm.includes(k.key)&&y(),k.key===" "&&k.preventDefault())})})})})});kl.displayName=Kn;var Ir="SelectItemText",Sl=b.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=Et(Ir,r),a=jt(Ir,r),l=yl(Ir,r),d=Vm(Ir,r),[u,f]=b.useState(null),h=je(t,y=>f(y),l.onItemTextChange,y=>{var k;return(k=a.itemTextRefCallback)==null?void 0:k.call(a,y,l.value,l.disabled)}),p=u==null?void 0:u.textContent,w=b.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=d;return Fe(()=>(m(w),()=>v(w)),[m,v,w]),c.jsxs(c.Fragment,{children:[c.jsx(Se.span,{id:l.textId,...i,ref:h}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Kr.createPortal(i.children,s.valueNode):null]})});Sl.displayName=Ir;var Cl="SelectItemIndicator",El=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return yl(Cl,r).isSelected?c.jsx(Se.span,{"aria-hidden":!0,...n,ref:t}):null});El.displayName=Cl;var ai="SelectScrollUpButton",og=b.forwardRef((e,t)=>{const r=jt(ai,e.__scopeSelect),n=ii(ai,e.__scopeSelect),[o,i]=b.useState(!1),s=je(t,n.onScrollButtonChange);return Fe(()=>{if(r.viewport&&r.isPositioned){let a=function(){const d=l.scrollTop>0;i(d)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),o?c.jsx(jl,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});og.displayName=ai;var li="SelectScrollDownButton",ig=b.forwardRef((e,t)=>{const r=jt(li,e.__scopeSelect),n=ii(li,e.__scopeSelect),[o,i]=b.useState(!1),s=je(t,n.onScrollButtonChange);return Fe(()=>{if(r.viewport&&r.isPositioned){let a=function(){const d=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<d;i(u)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),o?c.jsx(jl,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});ig.displayName=li;var jl=b.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=jt("SelectScrollButton",r),s=b.useRef(null),a=Hn(r),l=b.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return b.useEffect(()=>()=>l(),[l]),Fe(()=>{var u;const d=a().find(f=>f.ref.current===document.activeElement);(u=d==null?void 0:d.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),c.jsx(Se.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:me(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:me(o.onPointerMove,()=>{var d;(d=i.onItemLeave)==null||d.call(i),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:me(o.onPointerLeave,()=>{l()})})}),sg="SelectSeparator",ag=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return c.jsx(Se.div,{"aria-hidden":!0,...n,ref:t})});ag.displayName=sg;var ci="SelectArrow",lg=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Vn(r),i=Et(ci,r),s=jt(ci,r);return i.open&&s.position==="popper"?c.jsx(Jo,{...o,...n,ref:t}):null});lg.displayName=ci;var cg="SelectBubbleInput",Nl=b.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=b.useRef(null),i=je(n,o),s=Zh(t);return b.useEffect(()=>{const a=o.current;if(!a)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&u){const f=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(f)}},[s,t]),c.jsx(Se.select,{...r,style:{...Va,...r.style},ref:i,defaultValue:t})});Nl.displayName=cg;function Tl(e){return e===""||e===void 0}function Al(e){const t=Dt(e),r=b.useRef(""),n=b.useRef(0),o=b.useCallback(s=>{const a=r.current+s;t(a),(function l(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>l(""),1e3))})(a)},[t]),i=b.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function zl(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=dg(e,Math.max(i,0));o.length===1&&(s=s.filter(d=>d!==r));const l=s.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==r?l:void 0}function dg(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var ug=al,Pl=cl,fg=ul,pg=fl,hg=pl,Ol=hl,mg=vl,Il=kl,gg=Sl,bg=El;const vg=ug,xg=fg,Dl=b.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(Pl,{ref:n,className:se("flex h-8 w-full items-center justify-between gap-2 rounded-md border border-zinc-800 bg-black px-3 py-1.5 text-left text-xs font-medium text-white outline-none","hover:bg-zinc-900 focus-visible:ring-2 focus-visible:ring-blue-500/80 focus-visible:ring-inset focus-visible:border-zinc-600","disabled:pointer-events-none disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:flex [&>span]:items-center [&>span]:gap-2",e),style:{boxShadow:"none",WebkitBoxShadow:"none",MozBoxShadow:"none"},...r,children:[t,c.jsx(pg,{asChild:!0,children:c.jsx(Zr,{className:"h-3 w-3 shrink-0 text-zinc-400",strokeWidth:2})})]}));Dl.displayName=Pl.displayName;const _l=b.forwardRef(({className:e,children:t,position:r="popper",...n},o)=>c.jsx(hg,{children:c.jsx(Ol,{ref:o,className:se("relative z-[9999] max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-zinc-800 bg-zinc-950 text-white shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:c.jsx(mg,{className:se("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));_l.displayName=Ol.displayName;const Ml=b.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(Il,{ref:n,className:se("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-xs outline-none","focus:bg-zinc-800 focus:text-white data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(bg,{children:c.jsx(lo,{className:"h-3 w-3",strokeWidth:2})})}),c.jsx(gg,{children:t})]}));Ml.displayName=Il.displayName;const Rl=b.createContext(null);function Ll(){const e=b.useContext(Rl);if(!e)throw new Error("Dialog components must be used within Dialog");return e}function $l({open:e,onOpenChange:t,children:r}){const[n,o]=b.useState(!1),i=e!==void 0,s=i?e:n,a=b.useCallback(d=>{i||o(d),t==null||t(d)},[i,t]),l=b.useMemo(()=>({open:s,onOpenChange:a}),[s,a]);return c.jsx(Rl.Provider,{value:l,children:r})}function wg({asChild:e,children:t}){const{onOpenChange:r}=Ll(),n=b.Children.only(t);return e&&b.isValidElement(n)?b.cloneElement(n,{onClick:o=>{var i,s;(s=(i=n.props).onClick)==null||s.call(i,o),r(!0)}}):c.jsx("button",{type:"button",onClick:()=>r(!0),children:t})}function Fl({className:e,children:t,preventCloseOnBackdropClick:r,...n}){const{open:o,onOpenChange:i}=Ll();if(b.useEffect(()=>{const a=l=>{l.key==="Escape"&&i(!1)};return o&&(document.addEventListener("keydown",a),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",a),document.body.style.overflow=""}},[o,i]),!o)return null;const s=a=>{a.preventDefault(),a.stopPropagation()};return vt.createPortal(c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 z-[9998] bg-black/60","aria-hidden":!0,onClick:()=>!r&&i(!1),onDragOver:s,onDrop:s}),c.jsx("div",{role:"dialog","aria-modal":!0,className:se("fixed left-1/2 top-1/2 z-[9999] w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 rounded-lg border border-zinc-700 bg-zinc-900 p-4 shadow-xl",e),onClick:a=>a.stopPropagation(),...n,children:t})]}),document.body)}function Wl({className:e,...t}){return c.jsx("div",{className:se("flex flex-col gap-1.5 pb-4",e),...t})}function yg({className:e,...t}){return c.jsx("div",{className:se("flex justify-end gap-2 pt-4",e),...t})}function Ul({className:e,...t}){return c.jsx("h2",{className:se("text-sm font-semibold text-white",e),...t})}function Bl({className:e,...t}){return c.jsx("p",{className:se("text-xs text-zinc-400",e),...t})}const qe=b.forwardRef(({className:e,variant:t="default",size:r="default",asChild:n=!1,...o},i)=>{const s="inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:shrink-0 cursor-pointer",a={default:"bg-primary text-primary-foreground shadow-lg shadow-primary/20 hover:bg-primary/90",outline:"border border-zinc-700 bg-zinc-900 text-zinc-200 hover:bg-zinc-800 hover:border-zinc-600",ghost:"text-zinc-500 hover:text-zinc-200 hover:bg-zinc-800",destructive:"bg-destructive/15 text-destructive hover:bg-destructive/25"},l={sm:"h-7 px-2.5 text-[11px]",default:"h-8 px-3 py-1.5 text-xs",lg:"h-9 px-5 text-sm",icon:"h-8 w-8","icon-sm":"h-7 w-7","icon-xs":"h-6 w-6"},d=n?ep:"button";return c.jsx(d,{ref:i,type:"button",className:se(s,a[t],l[r],e),...o})});qe.displayName="Button";const kg=["library","upload","url"];function Sg({library:e,selectedId:t,onSelect:r}){const[n,o]=g.useState(""),[i,s]=g.useState("all"),a=["all",...new Set(e.flatMap(d=>d.tags??[]))],l=e.filter(d=>{const u=i==="all"||(d.tags??[]).includes(i),f=!n||(d.alt??"").toLowerCase().includes(n.toLowerCase());return u&&f});return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"relative",children:[c.jsx(Fd,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-zinc-600 pointer-events-none"}),c.jsx(zo,{value:n,onChange:d=>o(d.target.value),placeholder:"Cerca immagini...",className:"pl-9 h-8 text-xs bg-zinc-900/50 border-zinc-800"})]}),c.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.map(d=>c.jsx("button",{type:"button",onClick:()=>s(d),className:se("px-2.5 py-1 rounded text-[10px] font-medium border transition-colors",i===d?"border-blue-500 bg-blue-500/20 text-blue-400":"border-zinc-700 text-zinc-500 hover:border-zinc-600 hover:text-zinc-400"),children:d==="all"?"Tutte":d},d))}),l.length>0?c.jsx("div",{className:"grid grid-cols-3 gap-2.5 max-h-[45vh] overflow-y-auto",children:l.map(d=>{const u=t===d.id;return c.jsxs("button",{type:"button",onClick:()=>r(u?null:d.id),className:se("group relative aspect-[4/3] rounded-lg overflow-hidden","ring-1 transition-all duration-150",u?"ring-blue-500 ring-2 ring-offset-1 ring-offset-zinc-900":"ring-zinc-800 hover:ring-zinc-600 hover:scale-[1.02]"),children:[c.jsx("img",{src:d.url,alt:d.alt,loading:"lazy",className:se("w-full h-full object-cover transition-[filter] duration-150",u?"brightness-[0.6]":"brightness-[0.85] group-hover:brightness-100")}),c.jsx("div",{className:se("absolute inset-x-0 bottom-0 px-2 py-1.5","bg-gradient-to-t from-black/70 to-transparent","opacity-0 group-hover:opacity-100 transition-opacity",u&&"opacity-100"),children:c.jsx("span",{className:"text-[10px] text-white font-medium leading-tight line-clamp-2",children:d.alt})}),u&&c.jsx("div",{className:"absolute top-2 right-2 w-6 h-6 rounded-full bg-blue-600 flex items-center justify-center",children:c.jsx(lo,{size:14,className:"text-white"})})]},d.id)})}):c.jsx("div",{className:"text-center py-12 text-zinc-600 text-xs",children:"Nessuna immagine in libreria. Configura assets.assetsManifest nel tenant (es. da public/assets)."})]})}function Cg({preview:e,onPreviewChange:t,onAssetUpload:r}){const[n,o]=g.useState(!1),i=g.useRef(null),s=g.useCallback(async u=>{if(fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:handleFile",message:"handleFile called",data:{fileName:u.name,hasOnAssetUpload:!!r},timestamp:Date.now(),hypothesisId:"H5"})}).catch(()=>{}),!u.type.startsWith("image/"))return;if(r){try{const h=await r(u);fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:handleFile",message:"onAssetUpload resolved",data:{url:h==null?void 0:h.slice(0,50)},timestamp:Date.now(),hypothesisId:"H2,H5"})}).catch(()=>{}),t({name:u.name,size:u.size,dataUrl:h})}catch{const h=new FileReader;h.onload=p=>{var w;t({name:u.name,size:u.size,dataUrl:(w=p.target)==null?void 0:w.result})},h.readAsDataURL(u)}return}const f=new FileReader;f.onload=h=>{var p;t({name:u.name,size:u.size,dataUrl:(p=h.target)==null?void 0:p.result})},f.readAsDataURL(u)},[t,r]),a=g.useCallback(u=>{var h,p;u.preventDefault(),u.stopPropagation(),o(!1);const f=(p=(h=u.dataTransfer)==null?void 0:h.files)==null?void 0:p[0];f&&s(f)},[s]),l=g.useCallback(u=>{u.preventDefault(),u.stopPropagation(),o(!0)},[]),d=g.useCallback(u=>{var h;const f=(h=u.target.files)==null?void 0:h[0];f&&s(f)},[s]);return c.jsxs("div",{onDragOver:l,onDragEnter:l,onDragLeave:u=>{u.preventDefault(),u.stopPropagation(),o(!1)},onDrop:a,onClick:()=>{var u;return!e&&((u=i.current)==null?void 0:u.click())},className:se("rounded-xl border-2 border-dashed transition-all min-h-[240px]","flex flex-col items-center justify-center overflow-hidden cursor-pointer relative",n?"border-blue-500/50 bg-blue-500/[0.04]":e?"border-zinc-800 bg-transparent cursor-default":"border-zinc-800 bg-white/[0.01] hover:border-zinc-600 hover:bg-white/[0.02]"),children:[e?c.jsxs(c.Fragment,{children:[c.jsx("img",{src:e.dataUrl,alt:"Upload preview",className:"w-full max-h-[320px] object-contain"}),c.jsxs("div",{className:"absolute bottom-0 inset-x-0 bg-gradient-to-t from-black/80 to-transparent p-4 flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-white",children:e.name}),c.jsxs("p",{className:"text-[10px] text-zinc-400",children:[(e.size/1024).toFixed(1)," KB"]})]}),c.jsx(qe,{type:"button",variant:"ghost",className:"text-zinc-400 hover:text-red-400 hover:bg-red-500/10 h-8 w-8 p-0",onClick:u=>{u.stopPropagation(),t(null)},children:c.jsx(en,{size:14})})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/10 flex items-center justify-center text-blue-500 mb-3",children:c.jsx(as,{size:22})}),c.jsx("p",{className:"text-sm font-medium text-white mb-1",children:"Trascina un'immagine qui"}),c.jsx("p",{className:"text-[11px] text-zinc-500 mb-3",children:"oppure clicca per selezionare un file"}),c.jsx("span",{className:"text-[10px] text-zinc-600 bg-white/[0.03] px-3 py-1 rounded",children:"PNG, JPG, WebP — max 5MB"})]}),c.jsx("input",{ref:i,type:"file",accept:"image/*",className:"hidden",onChange:d})]})}function Eg({urlPreview:e,onUrlPreviewChange:t}){const[r,n]=g.useState(""),[o,i]=g.useState(!1),s=()=>{if(r.trim())try{new URL(r),t(r),i(!1)}catch{i(!0),t(null)}};return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(It,{className:"block text-[10px] font-bold uppercase tracking-[0.08em] text-zinc-500 mb-1.5",children:"URL immagine"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(zo,{value:r,onChange:a=>{n(a.target.value),i(!1)},onKeyDown:a=>a.key==="Enter"&&s(),placeholder:"https://images.unsplash.com/photo-...",className:se("h-8 text-xs bg-zinc-900/50 border-zinc-800",o&&"border-red-500/50")}),c.jsx(qe,{type:"button",variant:"outline",onClick:s,className:"shrink-0 h-8",children:"Anteprima"})]}),o&&c.jsx("p",{className:"text-[11px] text-red-400 mt-1.5",children:"URL non valido. Inserisci un URL completo (https://…)"})]}),e?c.jsxs("div",{className:"rounded-lg overflow-hidden ring-1 ring-zinc-800",children:[c.jsx("img",{src:e,alt:"URL preview",className:"w-full max-h-[320px] object-contain bg-black/30",onError:()=>{i(!0),t(null)}}),c.jsxs("div",{className:"px-3.5 py-2.5 bg-white/[0.02] border-t border-zinc-800 flex items-center gap-2",children:[c.jsx(lo,{size:14,className:"text-emerald-400"}),c.jsx("span",{className:"text-[11px] text-zinc-500",children:"Immagine caricata correttamente"})]})]}):o?null:c.jsxs("div",{className:"flex flex-col items-center py-12 text-zinc-600",children:[c.jsx(is,{size:32,className:"mb-3 opacity-40"}),c.jsx("p",{className:"text-xs",children:"Incolla un URL e premi Anteprima per verificare"})]})]})}const jg=({open:e,onOpenChange:t,onSelect:r})=>{const{assets:n}=hr(),o=(n==null?void 0:n.assetsManifest)??[],[i,s]=g.useState("library"),[a,l]=g.useState(null),[d,u]=g.useState(null),[f,h]=g.useState(null);g.useEffect(()=>{e&&(s("library"),l(null),u(null),h(null))},[e]),g.useEffect(()=>{if(!e||i!=="upload")return;const y=()=>{fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:beforeunload",message:"beforeunload fired",data:{},timestamp:Date.now(),hypothesisId:"H1"})}).catch(()=>{})};return window.addEventListener("beforeunload",y),()=>window.removeEventListener("beforeunload",y)},[e,i]),g.useEffect(()=>{if(!e||i!=="upload")return;const y=x=>{x.preventDefault()},k={capture:!0};return document.addEventListener("dragover",y,k),document.addEventListener("drop",y,k),window.addEventListener("dragover",y,k),window.addEventListener("drop",y,k),()=>{document.removeEventListener("dragover",y,k),document.removeEventListener("drop",y,k),window.removeEventListener("dragover",y,k),window.removeEventListener("drop",y,k)}},[e,i]);const p=i==="library"&&a!=null||i==="upload"&&d!=null||i==="url"&&f!=null,w=()=>{if(i==="library"&&a){const y=o.find(k=>k.id===a);y&&r({url:y.url,alt:y.alt})}else i==="upload"&&d?r({url:d.dataUrl,alt:d.name}):i==="url"&&f&&r({url:f,alt:""});setTimeout(()=>t(!1),0)},m=i==="library"&&a?"1 immagine selezionata":i==="upload"&&d?d.name:i==="url"&&f?"URL pronto":"Nessuna selezione",v=y=>{y.preventDefault(),y.stopPropagation()};return c.jsx($l,{open:e,onOpenChange:t,children:c.jsxs(Fl,{className:"max-w-2xl p-0 gap-0 max-h-[90vh] flex flex-col",preventCloseOnBackdropClick:i==="upload",onDragOver:v,onDrop:v,children:[c.jsxs(Wl,{className:"px-5 py-4 flex flex-row items-start justify-between gap-4 border-b border-zinc-800",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/15 text-blue-500",children:c.jsx(Qr,{size:18})}),c.jsxs("div",{children:[c.jsx(Ul,{children:"Image Picker"}),c.jsx(Bl,{children:"Scegli dalla libreria, carica dal disco o inserisci un link"})]})]}),c.jsx("button",{type:"button",onClick:()=>t(!1),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Chiudi",children:c.jsx(Wt,{size:18})})]}),c.jsx("div",{className:"flex border-b border-zinc-800",children:kg.map(y=>c.jsxs("button",{type:"button",onClick:()=>s(y),className:se("flex items-center gap-2 px-4 py-3 text-xs font-medium border-b-2 transition-colors",i===y?"border-blue-500 text-blue-400":"border-transparent text-zinc-500 hover:text-zinc-300"),children:[y==="library"&&c.jsx(Qr,{size:14}),y==="upload"&&c.jsx(as,{size:14}),y==="url"&&c.jsx(is,{size:14}),y==="library"?"Libreria":y==="upload"?"Upload":"URL"]},y))}),c.jsxs("div",{className:"flex-1 overflow-y-auto p-5 min-h-0",children:[i==="library"&&c.jsx(Sg,{library:o,selectedId:a,onSelect:l}),i==="upload"&&c.jsx(Cg,{preview:d,onPreviewChange:u,onAssetUpload:n==null?void 0:n.onAssetUpload}),i==="url"&&c.jsx(Eg,{urlPreview:f,onUrlPreviewChange:h})]}),c.jsxs(yg,{className:"px-5 py-4 border-t border-zinc-800 flex-row justify-between",children:[c.jsx("span",{className:"text-[10px] uppercase tracking-[0.05em] text-zinc-600",children:m}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(qe,{type:"button",variant:"outline",size:"sm",onClick:()=>t(!1),children:"Annulla"}),c.jsx(qe,{type:"button",size:"sm",disabled:!p,onClick:w,className:se(!p&&"opacity-40"),children:"Inserisci immagine"})]})]})]})})},Hl=(e,t="default")=>{if(e.startsWith("http")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/assets/"))return e;if(e.startsWith("assets/"))return`/${e}`;if(e.startsWith("/uploaded-assets/"))return e;if(!/\.(jpg|jpeg|png|gif|svg|pdf|webp|mp4|webm|ogg)$/i.test(e))return e.startsWith("/")?e:`/${e}`;const n=e.replace(/^\//,"");return`/assets/${t}/${n}`},Ng=({value:e,onChange:t,label:r="IMAGE",className:n})=>{const{tenantId:o="default"}=hr(),[i,s]=g.useState(!1),[a,l]=g.useState(!1),d=!!(e!=null&&e.url),u=e!=null&&e.url?Hl(e.url,o):"",f=p=>{t(p),s(!1)},h=p=>{p.stopPropagation(),t({url:"",alt:""})};return c.jsxs("div",{className:se("space-y-1.5",n),children:[c.jsx(It,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:r}),d?c.jsxs("div",{role:"button",tabIndex:0,onClick:()=>s(!0),onKeyDown:p=>p.key==="Enter"&&s(!0),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:se("relative rounded-lg overflow-hidden cursor-pointer","ring-1 ring-zinc-800 transition-all",a&&"ring-blue-500/40"),children:[c.jsx("img",{src:u,alt:(e==null?void 0:e.alt)??"",className:"w-full h-40 object-cover block",onError:p=>{p.target.style.display="none"}}),c.jsx("div",{className:se("absolute inset-0 flex items-center justify-center gap-2 transition-all duration-150",a?"bg-black/50":"bg-black/0"),children:a&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center gap-1.5 bg-white/15 backdrop-blur-md rounded-lg px-3.5 py-2 text-white text-xs font-medium",children:[c.jsx($d,{size:13}),c.jsx("span",{children:"Cambia"})]}),c.jsx(qe,{type:"button",variant:"ghost",className:"h-8 w-8 p-0 bg-red-500/15 backdrop-blur-md text-red-300 hover:text-red-200 hover:bg-red-500/25",onClick:h,children:c.jsx(en,{size:13})})]})}),c.jsx("div",{className:"px-2.5 py-1.5 bg-black/50 text-[10px] text-zinc-500 truncate",children:((e==null?void 0:e.url)??"").length>50?"…"+((e==null?void 0:e.url)??"").slice(-47):(e==null?void 0:e.url)??""})]}):c.jsxs("button",{type:"button",onClick:()=>s(!0),className:se("w-full rounded-lg border-2 border-dashed border-zinc-800 py-7","flex flex-col items-center gap-2","bg-white/[0.01] transition-all","hover:border-blue-500/30 hover:bg-blue-500/[0.03]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500"),children:[c.jsx("div",{className:"w-9 h-9 rounded-lg bg-blue-500/10 flex items-center justify-center text-blue-500",children:c.jsx(Qr,{size:18})}),c.jsx("span",{className:"text-xs text-zinc-400 font-medium",children:"Clicca per aggiungere un'immagine"}),c.jsx("span",{className:"text-[10px] text-zinc-600",children:"Libreria · Upload · URL"})]}),c.jsx(jg,{open:i,onOpenChange:s,onSelect:f})]})},Vl=[{name:"layers",Icon:uo},{name:"github",Icon:Rd},{name:"arrow-right",Icon:Pd},{name:"box",Icon:Id},{name:"terminal",Icon:Bd},{name:"chevron-right",Icon:Dd},{name:"menu",Icon:Ld},{name:"x",Icon:Wt},{name:"sparkles",Icon:Ud},{name:"zap",Icon:Vd}],Gn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),or={"ui:text":({label:e,value:t,onChange:r})=>c.jsxs("div",{className:"grid w-full items-center gap-2 mb-4",children:[c.jsx(It,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Gn(e)}),c.jsx(zo,{type:"text",className:"h-9 text-[13px] bg-zinc-900/50 border-zinc-700 focus-visible:ring-blue-600",value:t||"",onChange:n=>r(n.target.value)})]}),"ui:textarea":({label:e,value:t,onChange:r})=>c.jsxs("div",{className:"grid w-full gap-2 mb-4",children:[c.jsx(It,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Gn(e)}),c.jsx(Jf,{className:"min-h-[96px] text-[13px] bg-zinc-900/50 border-zinc-700 focus-visible:ring-blue-600 resize-none",value:t||"",onChange:n=>r(n.target.value)})]}),"ui:select":({label:e,value:t,onChange:r,options:n=[]})=>c.jsxs("div",{className:"grid w-full gap-2 mb-4",children:[c.jsx(It,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Gn(e)}),c.jsxs(vg,{value:t||"",onValueChange:r,children:[c.jsx(Dl,{className:"w-full h-9 text-[13px] bg-zinc-900/50 border-zinc-700 focus:ring-blue-600",children:c.jsx(xg,{placeholder:"Select..."})}),c.jsx(_l,{className:"dark",children:n.map(o=>c.jsx(Ml,{value:o,className:"text-[13px]",children:o},o))})]})]}),"ui:checkbox":({label:e,value:t,onChange:r})=>c.jsxs("div",{className:"flex items-center space-x-2 mb-4 p-2.5 rounded border border-zinc-700/60 bg-zinc-900/20",children:[c.jsx(Zf,{id:e,checked:!!t,onCheckedChange:n=>r(n===!0)}),c.jsx(It,{htmlFor:e,className:"text-[13px] font-medium cursor-pointer select-none text-zinc-200",children:Gn(e)})]}),"ui:image-picker":({label:e,value:t,onChange:r})=>{const n=t!=null&&typeof t=="object"&&"url"in t?{url:String(t.url??""),alt:String(t.alt??"")}:{url:typeof t=="string"?t:"",alt:""},o=i=>{r(i)};return c.jsx("div",{className:"mb-4",children:c.jsx(Ng,{label:e,value:n,onChange:o})})},"ui:icon-picker":({label:e,value:t,onChange:r})=>{const[n,o]=g.useState(!1),i=Vl.find(s=>s.name===(t||""));return c.jsxs("div",{className:"grid w-full gap-1.5 mb-4",children:[c.jsx(It,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),c.jsxs($l,{open:n,onOpenChange:o,children:[c.jsx(wg,{asChild:!0,children:c.jsx(qe,{variant:"outline",className:"w-full h-9 rounded-md border border-zinc-800 bg-zinc-900/50 hover:bg-zinc-800/50 flex items-center gap-2 text-left",children:i?c.jsxs(c.Fragment,{children:[c.jsx(i.Icon,{size:16,className:"text-zinc-400 shrink-0"}),c.jsx("span",{className:"text-[11px] text-zinc-300 capitalize truncate",children:i.name})]}):c.jsxs(c.Fragment,{children:[c.jsx(Qr,{size:16,className:"text-zinc-500 shrink-0"}),c.jsx("span",{className:"text-[11px] text-zinc-500",children:"Choose icon..."})]})})}),c.jsxs(Fl,{className:"sm:max-w-[280px] p-4",children:[c.jsxs(Wl,{children:[c.jsx(Ul,{className:"text-sm",children:"Choose icon"}),c.jsx(Bl,{className:"text-xs",children:"Click an icon to select it."})]}),c.jsx("div",{className:"grid grid-cols-5 gap-2 py-2",children:Vl.map(({name:s,Icon:a})=>c.jsx("button",{type:"button",onClick:()=>{r(s),o(!1)},className:se("flex items-center justify-center w-10 h-10 rounded-md border transition-colors",t===s?"border-blue-500 bg-blue-500/20 text-blue-400":"border-zinc-800 bg-zinc-900/50 hover:bg-zinc-800/50 text-zinc-400 hover:text-zinc-200"),title:s,children:c.jsx(a,{size:20})},s))})]})]})]})}},di=e=>{if(e instanceof Pe.z.ZodOptional||e instanceof Pe.z.ZodDefault)return di(e._def.innerType);if(e instanceof Pe.z.ZodObject){const t={id:crypto.randomUUID()};for(const r in e.shape)r!=="id"&&(t[r]=di(e.shape[r]));return t}return e instanceof Pe.z.ZodArray?[]:e instanceof Pe.z.ZodString?"":e instanceof Pe.z.ZodNumber?0:e instanceof Pe.z.ZodBoolean?!1:e instanceof Pe.z.ZodEnum?e._def.values[0]:null},Yn=e=>e instanceof Pe.z.ZodOptional||e instanceof Pe.z.ZodDefault||e instanceof Pe.z.ZodNullable?Yn(e._def.innerType):e,Kl=e=>{var n;const t=e;if(typeof e.description=="string"&&e.description.length>0)return e.description;if(typeof((n=t._def)==null?void 0:n.description)=="string"&&t._def.description.length>0)return t._def.description;const r=Yn(e);return r!==e?Kl(r):null},qn=(e,t)=>e&&!t?"opacity-10":"opacity-100",ir=(e,t)=>e!=null&&t.toLowerCase()===e.toLowerCase(),ui=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),Dr=({schema:e,data:t,onChange:r,keys:n,expandedItemPath:o,onSidebarExpandedItemChange:i})=>{const s=e.shape,a=n!=null?Object.keys(s).filter(f=>n.includes(f)):Object.keys(s),l=o==null?void 0:o[0],d=(l==null?void 0:l.fieldKey)??null,u=d!=null;return c.jsx("div",{className:"space-y-4",children:a.map(f=>{const h=s[f];if(!h)return null;const p=Yn(h),w=Kl(h)||"ui:text",m=t[f];if(w==="ui:editorial-markdown")return null;if(w==="ui:image-picker"&&p instanceof Pe.z.ZodObject){const S=ir(d,f),C=or["ui:image-picker"]||or["ui:text"];return c.jsx("div",{className:`transition-opacity duration-200 ${qn(u,S)}`,...S?{"data-jp-focused-field":f}:{},children:c.jsx(C,{label:f,value:m,onChange:E=>r({...t,[f]:E})})},f)}if(p instanceof Pe.z.ZodObject){const S=m||{},C=ir(d,f);return c.jsxs("div",{className:`group/obj mb-6 p-4 border border-zinc-800 rounded-lg bg-zinc-900/20 hover:border-zinc-700 transition-[border-color,opacity] duration-200 ${qn(u,C)}`,...C?{"data-jp-focused-field":f}:{},children:[c.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[c.jsx("div",{className:"w-1 h-3 bg-blue-500 rounded-full"}),c.jsx("h4",{className:"text-[11px] font-semibold text-zinc-300 tracking-[0.02em]",children:ui(f)})]}),c.jsx(Dr,{schema:p,data:S,onChange:E=>r({...t,[f]:E}),expandedItemPath:o&&ir(l==null?void 0:l.fieldKey,f)?o.slice(1):void 0})]},f)}if(p instanceof Pe.z.ZodArray){const S=Array.isArray(m)?m:[],C=Yn(p.element),E=(M,I)=>{if(I<0||I>=S.length)return;const R=[...S],[L]=R.splice(M,1);R.splice(I,0,L),r({...t,[f]:R})},N=ir(d,f),D=ir(l==null?void 0:l.fieldKey,f)?l==null?void 0:l.itemId:void 0;return c.jsxs("div",{className:`mb-8 transition-opacity duration-200 ${qn(u,N)}`,...N?{"data-jp-focused-field":f}:{},children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsxs("label",{className:"text-[12px] font-semibold text-zinc-300 tracking-[0.01em]",children:[ui(f)," (",S.length,")"]}),c.jsxs("button",{type:"button",onClick:()=>{const M=di(C);r({...t,[f]:[...S,M]})},className:"flex items-center gap-1 px-2.5 py-1.5 bg-blue-600/10 hover:bg-blue-600/20 text-blue-400 rounded text-[11px] font-semibold transition-colors",children:[c.jsx(fo,{size:12})," Add Item"]})]}),c.jsx("div",{className:"space-y-2",children:S.map((M,I)=>{const R=M,L=R.id||`legacy-${I}`,K=(typeof R.title=="string"?R.title:null)||(typeof R.label=="string"?R.label:null)||(typeof R.name=="string"?R.name:null)||(typeof R.content=="string"?R.content:null)||(typeof R.text=="string"?R.text:null)||`${ui(f)} #${I+1}`,B=D,W=String(R.id??L),U=B!=null&&String(B)===W,A=U&&o&&o.length>1?o.slice(1):void 0,J=u&&N&&B!=null&&!U;return c.jsx(Tg,{itemId:W,openItemId:B!=null?String(B):void 0,isFaded:J,index:I,isFirst:I===0,isLast:I===S.length-1,label:K,onExpandedChange:i?oe=>i(oe?{fieldKey:f,itemId:W}:null):void 0,onRemove:()=>{const oe=S.filter((T,F)=>F!==I);r({...t,[f]:oe})},onMoveUp:()=>E(I,I-1),onMoveDown:()=>E(I,I+1),children:C instanceof Pe.z.ZodObject?c.jsx(Dr,{schema:C,data:R||{},expandedItemPath:A,onChange:oe=>{const T=[...S];T[I]=oe,r({...t,[f]:T})}}):c.jsx("div",{className:"text-[10px] text-red-400",children:"Primitive arrays not supported."})},L)})})]},f)}const v=w in or?w:"ui:text",y=or[v]||or["ui:text"],k=p instanceof Pe.z.ZodEnum?p._def.values:void 0,x=ir(d,f);return c.jsx("div",{className:`transition-opacity duration-200 ${qn(u,x)}`,...x?{"data-jp-focused-field":f}:{},children:c.jsx(y,{label:f,value:m,options:k,onChange:S=>r({...t,[f]:S})})},f)})})},Tg=({itemId:e,openItemId:t,isFaded:r=!1,label:n,onExpandedChange:o,onRemove:i,onMoveUp:s,onMoveDown:a,isFirst:l,isLast:d,children:u})=>{const f=t!=null&&String(t)===String(e),[h,p]=g.useState(f);g.useEffect(()=>{t!=null&&(f&&!h&&p(!0),!f&&h&&p(!1))},[t,f,h]);const w=()=>{const v=!h;p(v),o==null||o(v)},m=f&&h;return c.jsxs("div",{className:`border border-zinc-800 rounded-md bg-zinc-900/40 overflow-hidden transition-opacity duration-200 ${r?"opacity-10":"opacity-100"}`,...m?{"data-jp-expanded-item":e}:{},children:[c.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-zinc-900/60",children:[c.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:c.jsxs("button",{type:"button",onClick:w,className:"flex items-center gap-2 text-[12px] font-semibold text-zinc-200 tracking-[0.01em] truncate",children:[h?c.jsx(co,{size:12,className:"shrink-0"}):c.jsx(Zr,{size:12,className:"shrink-0"}),c.jsx("span",{className:"truncate",children:n})]})}),c.jsxs("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[c.jsx("button",{type:"button",disabled:l,onClick:s,className:"text-zinc-500 hover:text-blue-400 disabled:opacity-20 p-1 transition-colors",children:c.jsx(Od,{size:12})}),c.jsx("button",{type:"button",disabled:d,onClick:a,className:"text-zinc-500 hover:text-blue-400 disabled:opacity-20 p-1 transition-colors",children:c.jsx(zd,{size:12})}),c.jsx("div",{className:"w-px h-3 bg-zinc-800 mx-1"}),c.jsx("button",{type:"button",onClick:i,className:"text-zinc-600 hover:text-red-500 transition-colors p-1",children:c.jsx(en,{size:12})})]})]}),h&&c.jsx("div",{className:"p-4 border-t border-zinc-800 bg-black/20",children:u})]})};function Ag(e,t){return b.useReducer((r,n)=>t[r][n]??r,e)}var _r=e=>{const{present:t,children:r}=e,n=zg(t),o=typeof r=="function"?r({present:n.isPresent}):b.Children.only(r),i=je(n.ref,Pg(o));return typeof r=="function"||n.isPresent?b.cloneElement(o,{ref:i}):null};_r.displayName="Presence";function zg(e){const[t,r]=b.useState(),n=b.useRef(null),o=b.useRef(e),i=b.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Ag(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const d=Xn(n.current);i.current=a==="mounted"?d:"none"},[a]),Fe(()=>{const d=n.current,u=o.current;if(u!==e){const h=i.current,p=Xn(d);e?l("MOUNT"):p==="none"||(d==null?void 0:d.display)==="none"?l("UNMOUNT"):l(u&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Fe(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,f=p=>{const m=Xn(n.current).includes(CSS.escape(p.animationName));if(p.target===t&&m&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=p=>{p.target===t&&(i.current=Xn(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:b.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function Xn(e){return(e==null?void 0:e.animationName)||"none"}function Pg(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var[Jn]=Ar("Tooltip",[Zt]),Zn=Zt(),Gl="TooltipProvider",Og=700,fi="tooltip.open",[Ig,pi]=Jn(Gl),Yl=e=>{const{__scopeTooltip:t,delayDuration:r=Og,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:i}=e,s=b.useRef(!0),a=b.useRef(!1),l=b.useRef(0);return b.useEffect(()=>{const d=l.current;return()=>window.clearTimeout(d)},[]),c.jsx(Ig,{scope:t,isOpenDelayedRef:s,delayDuration:r,onOpen:b.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:b.useCallback(d=>{a.current=d},[]),disableHoverableContent:o,children:i})};Yl.displayName=Gl;var Mr="Tooltip",[Dg,Rr]=Jn(Mr),ql=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=pi(Mr,e.__scopeTooltip),d=Zn(t),[u,f]=b.useState(null),h=zr(),p=b.useRef(0),w=s??l.disableHoverableContent,m=a??l.delayDuration,v=b.useRef(!1),[y,k]=_n({prop:n,defaultProp:o??!1,onChange:N=>{N?(l.onOpen(),document.dispatchEvent(new CustomEvent(fi))):l.onClose(),i==null||i(N)},caller:Mr}),x=b.useMemo(()=>y?v.current?"delayed-open":"instant-open":"closed",[y]),S=b.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v.current=!1,k(!0)},[k]),C=b.useCallback(()=>{window.clearTimeout(p.current),p.current=0,k(!1)},[k]),E=b.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{v.current=!0,k(!0),p.current=0},m)},[m,k]);return b.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),c.jsx(qo,{...d,children:c.jsx(Dg,{scope:t,contentId:h,open:y,stateAttribute:x,trigger:u,onTriggerChange:f,onTriggerEnter:b.useCallback(()=>{l.isOpenDelayedRef.current?E():S()},[l.isOpenDelayedRef,E,S]),onTriggerLeave:b.useCallback(()=>{w?C():(window.clearTimeout(p.current),p.current=0)},[C,w]),onOpen:S,onClose:C,disableHoverableContent:w,children:r})})};ql.displayName=Mr;var hi="TooltipTrigger",Xl=b.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Rr(hi,r),i=pi(hi,r),s=Zn(r),a=b.useRef(null),l=je(t,a,o.onTriggerChange),d=b.useRef(!1),u=b.useRef(!1),f=b.useCallback(()=>d.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),c.jsx(In,{asChild:!0,...s,children:c.jsx(Se.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:l,onPointerMove:me(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:me(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:me(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:me(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:me(e.onBlur,o.onClose),onClick:me(e.onClick,o.onClose)})})});Xl.displayName=hi;var mi="TooltipPortal",[_g,Mg]=Jn(mi,{forceMount:void 0}),Jl=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,i=Rr(mi,t);return c.jsx(_g,{scope:t,forceMount:r,children:c.jsx(_r,{present:r||i.open,children:c.jsx(Dn,{asChild:!0,container:o,children:n})})})};Jl.displayName=mi;var sr="TooltipContent",Zl=b.forwardRef((e,t)=>{const r=Mg(sr,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...i}=e,s=Rr(sr,e.__scopeTooltip);return c.jsx(_r,{present:n||s.open,children:s.disableHoverableContent?c.jsx(Ql,{side:o,...i,ref:t}):c.jsx(Rg,{side:o,...i,ref:t})})}),Rg=b.forwardRef((e,t)=>{const r=Rr(sr,e.__scopeTooltip),n=pi(sr,e.__scopeTooltip),o=b.useRef(null),i=je(t,o),[s,a]=b.useState(null),{trigger:l,onClose:d}=r,u=o.current,{onPointerInTransitChange:f}=n,h=b.useCallback(()=>{a(null),f(!1)},[f]),p=b.useCallback((w,m)=>{const v=w.currentTarget,y={x:w.clientX,y:w.clientY},k=Ug(y,v.getBoundingClientRect()),x=Bg(y,k),S=Hg(m.getBoundingClientRect()),C=Kg([...x,...S]);a(C),f(!0)},[f]);return b.useEffect(()=>()=>h(),[h]),b.useEffect(()=>{if(l&&u){const w=v=>p(v,u),m=v=>p(v,l);return l.addEventListener("pointerleave",w),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",w),u.removeEventListener("pointerleave",m)}}},[l,u,p,h]),b.useEffect(()=>{if(s){const w=m=>{const v=m.target,y={x:m.clientX,y:m.clientY},k=(l==null?void 0:l.contains(v))||(u==null?void 0:u.contains(v)),x=!Vg(y,s);k?h():x&&(h(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[l,u,s,d,h]),c.jsx(Ql,{...e,ref:i})}),[Lg,$g]=Jn(Mr,{isInside:!1}),Fg=rp("TooltipContent"),Ql=b.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=Rr(sr,r),d=Zn(r),{onClose:u}=l;return b.useEffect(()=>(document.addEventListener(fi,u),()=>document.removeEventListener(fi,u)),[u]),b.useEffect(()=>{if(l.trigger){const f=h=>{const p=h.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),c.jsx(kn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:c.jsxs(Xo,{"data-state":l.stateAttribute,...d,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(Fg,{children:n}),c.jsx(Lg,{scope:r,isInside:!0,children:c.jsx(em,{id:l.contentId,role:"tooltip",children:o||n})})]})})});Zl.displayName=sr;var ec="TooltipArrow",Wg=b.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Zn(r);return $g(ec,r).isInside?null:c.jsx(Jo,{...o,...n,ref:t})});Wg.displayName=ec;function Ug(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,o,i)){case i:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Bg(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Hg(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function Vg(e,t){const{x:r,y:n}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i],l=t[s],d=a.x,u=a.y,f=l.x,h=l.y;u>n!=h>n&&r<(f-d)*(n-u)/(h-u)+d&&(o=!o)}return o}function Kg(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),Gg(t)}function Gg(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const i=r[r.length-1],s=r[r.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Yg=Yl,qg=ql,Xg=Xl,Jg=Jl,tc=Zl;const Zg=Yg,Lr=qg,$r=Xg,ar=b.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(Jg,{children:c.jsx(tc,{ref:n,sideOffset:t,className:se("z-50 rounded-md bg-zinc-800 px-2.5 py-1.5 text-[11px] text-zinc-200 shadow-md","animate-in fade-in-0 zoom-in-95",e),...r})}));ar.displayName=tc.displayName;var Qn="Popover",[rc]=Ar(Qn,[Zt]),Fr=Zt(),[Qg,Nt]=rc(Qn),nc=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=Fr(t),l=b.useRef(null),[d,u]=b.useState(!1),[f,h]=_n({prop:n,defaultProp:o??!1,onChange:i,caller:Qn});return c.jsx(qo,{...a,children:c.jsx(Qg,{scope:t,contentId:zr(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:b.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:d,onCustomAnchorAdd:b.useCallback(()=>u(!0),[]),onCustomAnchorRemove:b.useCallback(()=>u(!1),[]),modal:s,children:r})})};nc.displayName=Qn;var oc="PopoverAnchor",e0=b.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Nt(oc,r),i=Fr(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return b.useEffect(()=>(s(),()=>a()),[s,a]),c.jsx(In,{...i,...n,ref:t})});e0.displayName=oc;var ic="PopoverTrigger",sc=b.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Nt(ic,r),i=Fr(r),s=je(t,o.triggerRef),a=c.jsx(Se.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":uc(o.open),...n,ref:s,onClick:me(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:c.jsx(In,{asChild:!0,...i,children:a})});sc.displayName=ic;var gi="PopoverPortal",[t0,r0]=rc(gi,{forceMount:void 0}),ac=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Nt(gi,t);return c.jsx(t0,{scope:t,forceMount:r,children:c.jsx(_r,{present:r||i.open,children:c.jsx(Dn,{asChild:!0,container:o,children:n})})})};ac.displayName=gi;var lr="PopoverContent",lc=b.forwardRef((e,t)=>{const r=r0(lr,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Nt(lr,e.__scopePopover);return c.jsx(_r,{present:n||i.open,children:i.modal?c.jsx(o0,{...o,ref:t}):c.jsx(i0,{...o,ref:t})})});lc.displayName=lr;var n0=Gt("PopoverContent.RemoveScroll"),o0=b.forwardRef((e,t)=>{const r=Nt(lr,e.__scopePopover),n=b.useRef(null),o=je(t,n),i=b.useRef(!1);return b.useEffect(()=>{const s=n.current;if(s)return Ya(s)},[]),c.jsx(ni,{as:n0,allowPinchZoom:!0,children:c.jsx(cc,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:me(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:me(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,d=a.button===2||l;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:me(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),i0=b.forwardRef((e,t)=>{const r=Nt(lr,e.__scopePopover),n=b.useRef(!1),o=b.useRef(!1);return c.jsx(cc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{var l,d;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),cc=b.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:u,...f}=e,h=Nt(lr,r),p=Fr(r);return sa(),c.jsx(_o,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:c.jsx(kn,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),children:c.jsx(Xo,{"data-state":uc(h.open),role:"dialog",id:h.contentId,...p,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),dc="PopoverClose",s0=b.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Nt(dc,r);return c.jsx(Se.button,{type:"button",...n,ref:t,onClick:me(e.onClick,()=>o.onOpenChange(!1))})});s0.displayName=dc;var a0="PopoverArrow",l0=b.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Fr(r);return c.jsx(Jo,{...o,...n,ref:t})});l0.displayName=a0;function uc(e){return e?"open":"closed"}var c0=nc,d0=sc,u0=ac,fc=lc;const f0=c0,p0=d0,pc=b.forwardRef(({className:e,align:t="start",sideOffset:r=6,...n},o)=>c.jsx(u0,{children:c.jsx(fc,{ref:o,align:t,sideOffset:r,className:se("z-50 w-[var(--radix-popover-trigger-width)] rounded-lg border border-zinc-700/80 bg-zinc-950 p-1 text-white shadow-xl shadow-black/30","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2",e),...n})}));pc.displayName=fc.displayName;const hc=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"Select page",h0=({pageSlugs:e,currentSlug:t,onPageChange:r,sectionCount:n,onNewPage:o,className:i,currentPageLabel:s})=>{const[a,l]=g.useState(!1),d=s??hc(t),u=f=>{r(f),l(!1)};return c.jsx("div",{className:se("mx-3 mt-2 mb-2",i),children:c.jsxs(f0,{open:a,onOpenChange:l,children:[c.jsx(p0,{asChild:!0,children:c.jsxs("button",{type:"button","aria-haspopup":"listbox","aria-label":`Select page, current: ${d}`,className:se("flex items-center gap-2 w-full pl-3 pr-4 py-2 rounded-lg border text-left transition-all duration-150 cursor-pointer","bg-transparent border-zinc-800 text-zinc-400 hover:text-zinc-200 hover:bg-zinc-800/50 hover:border-zinc-700","data-[state=open]:bg-zinc-950 data-[state=open]:border-zinc-800 data-[state=open]:text-zinc-100","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-zinc-950"),children:[c.jsx(Md,{size:14,className:"shrink-0 text-zinc-500","aria-hidden":!0}),c.jsx("span",{className:"text-xs font-medium flex-1 truncate",children:d}),c.jsx(Zr,{size:13,className:"shrink-0 text-zinc-500","aria-hidden":!0})]})}),c.jsxs(pc,{align:"start",sideOffset:4,className:"min-w-[var(--radix-popover-trigger-width)] bg-zinc-950 border-zinc-800 p-1",role:"listbox","aria-label":"Page list",children:[e.map(f=>{const h=f===t,p=hc(f);return c.jsxs("button",{type:"button",role:"option","aria-selected":h,onClick:()=>u(f),className:se("flex items-center justify-between w-full px-2.5 py-2 rounded-md text-xs transition-colors cursor-pointer",h?"bg-primary/10 text-primary font-semibold":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"),children:[c.jsx("span",{children:p}),n!=null&&c.jsxs("span",{className:"text-[10px] text-zinc-600 tabular-nums","aria-hidden":!0,children:[n,"s"]})]},f)}),o!=null&&c.jsx("div",{className:"border-t border-zinc-800 mt-1 pt-1",children:c.jsxs("button",{type:"button",onClick:()=>{o(),l(!1)},className:"flex items-center gap-1.5 w-full px-2.5 py-2 rounded-md text-[11px] text-zinc-600 hover:text-zinc-300 hover:bg-zinc-800 transition-colors cursor-pointer","aria-label":"New page",children:[c.jsx(fo,{size:12,"aria-hidden":!0}),c.jsx("span",{children:"New page"})]})})]})]})})},bi=new Set(["anchorId","paddingTop","paddingBottom","theme","container"]),mc=new Set(["ui:editorial-markdown"]),gc=e=>e instanceof Pe.z.ZodOptional||e instanceof Pe.z.ZodDefault||e instanceof Pe.z.ZodNullable?gc(e._def.innerType):e,vi=e=>{var i;if(!e)return"";const t=e,r=typeof e.description=="string"?e.description:null;if(r)return r;const n=typeof((i=t._def)==null?void 0:i.description)=="string"?t._def.description:null;if(n)return n;const o=gc(e);return o!==e?vi(o):""},xi=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),m0={activationConstraint:{distance:8}},g0={activationConstraint:{delay:200,tolerance:5}};function wi({layer:e,opts:t,dragHandleProps:r}){const{isSelected:n,isActive:o,isDragging:i,canDelete:s,onSelect:a,onOpenSettings:l,onDelete:d}=t,u=!!r;return c.jsxs("div",{className:se("group flex items-center gap-2 pl-1 pr-2 py-2.5 rounded-lg text-left transition-all duration-200 cursor-pointer border-l-2",n?"bg-primary/[0.08] border-primary":o?"bg-zinc-800/30 border-emerald-500/60":"border-transparent hover:bg-zinc-800/40",i&&"opacity-50 shadow-lg",u?"cursor-grab active:cursor-grabbing":"cursor-default"),children:[u?c.jsx("span",{className:"shrink-0 w-5 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-150 cursor-grab touch-none","aria-label":"Trascina per riordinare",...r,children:c.jsx(os,{size:12,className:"text-zinc-600"})}):c.jsx("span",{className:"shrink-0 w-5 flex items-center justify-center opacity-0 group-hover:opacity-100 pointer-events-none",children:c.jsx(os,{size:12,className:"text-zinc-600/50"})}),c.jsxs("button",{type:"button",onClick:a,className:"flex-1 min-w-0 text-left",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:se("text-xs font-bold uppercase tracking-[0.06em] truncate",n?"text-primary":"text-zinc-500"),children:e.type}),o&&c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 shrink-0","aria-hidden":!0})]}),c.jsx("span",{className:"text-[11px] text-zinc-600 block truncate leading-snug mt-0.5",children:e.title??`${e.type} section`})]}),c.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity duration-150",children:[c.jsxs(Lr,{children:[c.jsx($r,{asChild:!0,children:c.jsx(qe,{variant:"ghost",size:"icon-xs",className:"text-zinc-600 hover:text-zinc-300",onClick:f=>{f.stopPropagation(),l(f)},children:c.jsx(Wd,{size:12})})}),c.jsx(ar,{children:"Settings"})]}),s&&c.jsxs(Lr,{children:[c.jsx($r,{asChild:!0,children:c.jsx(qe,{variant:"ghost",size:"icon-xs",className:"text-zinc-600 hover:text-destructive",onClick:f=>{f.stopPropagation(),d()},children:c.jsx(en,{size:12})})}),c.jsx(ar,{children:"Delete section"})]})]})]})}function b0({layer:e,opts:t}){const{attributes:r,listeners:n,setNodeRef:o,transform:i,transition:s,isDragging:a}=Kf({id:e.id,disabled:!t.canReorder}),l={transform:wt.Transform.toString(i),transition:s};return c.jsx("div",{ref:o,style:l,className:se(a&&"z-10"),children:c.jsx(wi,{layer:e,opts:{...t,isDragging:a},dragHandleProps:t.canReorder?{...r,...n,"aria-roledescription":"elemento trascinabile"}:void 0})})}const bc=({selectedSection:e,pageData:t,allSectionsData:r=[],onUpdate:n,onUpdateSection:o,onClose:i,expandedItemPath:s=null,onReorderSection:a,allLayers:l=[],activeSectionId:d,onRequestScrollToSection:u,onDeleteSection:f,onAddSection:h,hasChanges:p=!1,onSaveToFile:w,onHotSave:m,saveSuccessFeedback:v=!1,hotSaveSuccessFeedback:y=!1,hotSaveInProgress:k=!1,showLegacySave:x=!0,showHotSave:S=!1,onResetToFile:C,showResetToFile:E=!1,pageSlugs:N=[],currentSlug:j="home",onPageChange:D})=>{const{schemas:M}=hr(),[I,R]=g.useState(!0),[L,K]=g.useState(null),[B,W]=g.useState(null),[U,A]=g.useState(null),[J,oe]=g.useState(null),T=g.useRef(null),F=g.useRef(null),X=bu(vo(Eo,m0),vo(Os,g0),vo(So,{coordinateGetter:qf})),G=g.useDeferredValue(e),ve=e!=null&&(G==null?void 0:G.id)!==e.id,le=s&&s.length>0?s:U?[U]:null,P=le!=null&&le.length?{fieldKey:le[le.length-1].fieldKey,itemId:le[le.length-1].itemId}:null,Q=g.useRef(s);g.useEffect(()=>{Q.current!=null&&s==null&&A(null),Q.current=s},[s]),g.useEffect(()=>{(e==null?void 0:e.id)!=null&&R(!1)},[e==null?void 0:e.id]);const ee=()=>{const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{const re=T.current;re&&re.scrollTo({top:0,behavior:"smooth"})})});return()=>cancelAnimationFrame(_)},$=g.useRef(I);g.useEffect(()=>{if(I&&!$.current){const _=ee();return $.current=I,_}$.current=I},[I]),g.useEffect(()=>{if(!P)return;const _=T.current;if(!_)return;const re=requestAnimationFrame(()=>{const ne=_.querySelector("[data-jp-expanded-item]")??_.querySelector("[data-jp-focused-field]");ne&&ne.scrollIntoView({behavior:"smooth",block:"start"})});return()=>cancelAnimationFrame(re)},[P]);const ie=_=>{R(!1),u==null||u(_)},te=()=>{R(_=>{const re=!_;return re&&ee(),re})},ke=(_,re)=>{re.stopPropagation(),r.length>0&&o?oe(_):(R(!1),u==null||u(_))};g.useEffect(()=>{if(J==null)return;const _=re=>{re.key==="Escape"&&oe(null)};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[J]);const we=_=>{L===_?(f==null||f(_),K(null)):(K(_),setTimeout(()=>K(null),3e3))},De=g.useMemo(()=>l.filter(_=>_.scope==="local").map(_=>_.id),[l]),Re=!!a&&De.length>0,Be=_=>{W(_.active.id)},Ne=_=>{W(null);const{active:re,over:ne}=_;if(!ne||re.id===ne.id||!a)return;const he=l.findIndex(_e=>_e.id===re.id),Le=l.findIndex(_e=>_e.id===ne.id);if(he===-1||Le===-1)return;const Ce=he<Le?Le:Le-1;a(re.id,Ce)},Xe=e?t.sections.find(_=>_.id===e.id):void 0,He=G?t.sections.find(_=>_.id===G.id):void 0,Ve=G?M[G.type]:void 0,gt=g.useMemo(()=>{if(!Ve)return!1;const _=Ve.shape,re=Object.keys(_).filter(ne=>!bi.has(ne));return re.length===0?!1:re.every(ne=>mc.has(vi(_[ne])))},[Ve]);g.useEffect(()=>{(e==null?void 0:e.id)!=null&>&&R(!0)},[e==null?void 0:e.id,gt]);const Tt=l.length>0&&(I||!e),Qe=j?j.charAt(0).toUpperCase()+j.slice(1):"Select page",cr=g.useMemo(()=>{const _=[];let re=null;for(const ne of l){const he=ne.type.toUpperCase(),Le=re!==null&&(re==="HEADER"&&he!=="HEADER"||re!=="HEADER"&&re!=="FOOTER"&&he==="FOOTER");_.push({layer:ne,showSeparatorAbove:Le}),re=he}return _},[l]);return c.jsx(Zg,{children:c.jsxs("aside",{className:"relative w-full h-full bg-zinc-950 border-l border-zinc-800 flex flex-col shadow-2xl shrink-0 min-w-0 animate-in slide-in-from-right duration-300",children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800 shrink-0",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("h2",{className:"text-sm font-bold text-white",children:"Inspector"}),c.jsx("p",{className:"text-[10px] tracking-[0.06em] text-zinc-600 mt-0.5",children:e?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-primary font-bold",children:e.type}),c.jsx("span",{className:"text-zinc-700 mx-1.5",children:"|"}),c.jsx("span",{className:"uppercase",children:e.scope})]}):c.jsxs("span",{className:"text-zinc-600",children:[Qe," · ",l.length," sections"]})})]}),c.jsx(qe,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":"Close Inspector",children:c.jsx(Wt,{size:14})})]}),N.length>0&&D&&c.jsx(h0,{pageSlugs:N,currentSlug:j,onPageChange:D,sectionCount:l.length,currentPageLabel:Qe}),l.length>0&&c.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-t border-zinc-800/50",children:[c.jsxs("button",{type:"button",onClick:te,className:"flex items-center gap-2 flex-1 cursor-pointer min-w-0 text-left","aria-expanded":Tt,"aria-label":Tt?"Collapse Page Layers":"Expand Page Layers",children:[c.jsx(uo,{size:14,className:"text-zinc-500 shrink-0"}),c.jsx("span",{className:"text-[11px] font-semibold tracking-[0.04em] text-zinc-400",children:"Page Layers"}),c.jsxs("span",{className:"text-[10px] text-zinc-600",children:["(",l.length,")"]}),c.jsx(co,{size:13,className:se("ml-auto text-zinc-600 transition-transform duration-200 shrink-0",!I&&"rotate-180")})]}),h!=null&&c.jsxs(Lr,{children:[c.jsx($r,{asChild:!0,children:c.jsx(qe,{variant:"ghost",size:"icon-sm",className:"text-zinc-500 hover:text-primary",onClick:h,children:c.jsx(fo,{size:14})})}),c.jsx(ar,{children:"Add section"})]})]}),c.jsx("div",{className:"relative flex-1 min-h-0 min-w-0 flex flex-col overflow-hidden",children:c.jsxs("div",{ref:T,className:"min-h-0 min-w-0 flex-1 overflow-y-auto overflow-x-hidden flex flex-col",role:"region","aria-label":"Inspector content",children:[c.jsx("div",{className:"flex flex-col min-h-0",children:Tt&&c.jsxs("div",{className:"py-1",children:[c.jsxs(mf,{sensors:X,collisionDetection:wu,modifiers:[If],onDragStart:Be,onDragEnd:Ne,accessibility:{announcements:{onDragStart:()=>"Sezione presa in carico. Usa i tasti freccia per spostare, Spazio per rilasciare.",onDragOver:({over:_})=>_?`Posizione ${De.indexOf(String(_.id))+1} di ${De.length}.`:void 0,onDragEnd:({over:_})=>_?"Sezione rilasciata in nuova posizione.":"Riposizionamento annullato.",onDragCancel:()=>"Riposizionamento annullato."}},children:[c.jsx($f,{items:De,strategy:Rf,children:c.jsx("div",{className:"px-2 space-y-0.5",children:cr.map(({layer:_,showSeparatorAbove:re})=>c.jsxs(g.Fragment,{children:[re&&c.jsx("div",{className:"mx-3 border-t border-zinc-800/60 my-1"}),_.scope==="local"&&Re?c.jsx(b0,{layer:_,opts:{isSelected:(e==null?void 0:e.id)===_.id,isActive:d===_.id,isDragging:!1,canReorder:!0,canDelete:!!f,deleteConfirm:L===_.id,onSelect:()=>ie(_.id),onDelete:()=>we(_.id),onOpenSettings:ne=>ke(_.id,ne)}}):c.jsx("div",{children:c.jsx(wi,{layer:_,opts:{isSelected:(e==null?void 0:e.id)===_.id,isActive:d===_.id,isDragging:!1,canDelete:_.scope==="local"&&!!f,deleteConfirm:L===_.id,onSelect:()=>ie(_.id),onDelete:()=>we(_.id),onOpenSettings:ne=>ke(_.id,ne)}})})]},_.id))})}),c.jsx(Of,{dropAnimation:{duration:200,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:B?(()=>{const _=l.find(re=>re.id===B);return _?c.jsx("div",{className:"px-2 w-full max-w-[var(--inspector-width,280px)]",children:c.jsx(wi,{layer:_,opts:{isSelected:!1,isActive:!1,isDragging:!0,canDelete:!1,deleteConfirm:!1,onSelect:()=>{},onDelete:()=>{},onOpenSettings:()=>{}},dragHandleProps:{"aria-hidden":!0}})}):null})():null})]}),L&&c.jsxs("div",{className:"flex items-center gap-2 py-2 px-3 mt-1 mx-2 rounded-md bg-amber-500/10 border border-amber-500/30",children:[c.jsx(_d,{size:12,className:"text-amber-500 shrink-0"}),c.jsx("p",{className:"text-[10px] text-amber-500 font-medium",children:"Click delete again to confirm"})]})]})}),P&&Xe&&(()=>{const _=Xe.data||{};let re;if(le&&le.length>0){let ne=_;for(const Ce of le){const _e=ne==null?void 0:ne[Ce.fieldKey];Ce.itemId!=null&&Array.isArray(_e)?ne=_e.find(Ee=>String(Ee==null?void 0:Ee.id)===String(Ce.itemId))??null:ne=_e}const he=ne||{},Le=P.fieldKey;re=(typeof he.name=="string"?he.name:null)??(typeof he.title=="string"?he.title:null)??(typeof he.label=="string"?he.label:null)??xi(Le)}else{const ne=P.fieldKey;if(P.itemId!=null){const Ce=(Array.isArray(_[ne])?_[ne]:[]).find(_e=>String(_e==null?void 0:_e.id)===String(P.itemId))||{};re=(typeof Ce.name=="string"?Ce.name:null)??(typeof Ce.title=="string"?Ce.title:null)??(typeof Ce.label=="string"?Ce.label:null)??xi(ne)}else re=xi(ne)}return c.jsxs("div",{className:"px-4 py-2 border-b border-zinc-800 bg-zinc-900/50",children:[c.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-zinc-500",children:"Editing"}),c.jsx("p",{className:"text-xs font-medium text-white truncate mt-0.5",children:re})]})})(),c.jsx("div",{className:"flex-1 p-4",onFocusCapture:()=>e!=null&&R(!1),children:e?ve?c.jsxs("div",{className:"space-y-4 animate-pulse",role:"status","aria-label":"Loading form",children:[c.jsx("div",{className:"h-4 w-3/4 rounded bg-zinc-800"}),c.jsx("div",{className:"h-10 rounded bg-zinc-800/80"}),c.jsx("div",{className:"h-10 rounded bg-zinc-800/80"}),c.jsx("div",{className:"h-20 rounded bg-zinc-800/80"}),c.jsx("div",{className:"h-10 rounded bg-zinc-800/60"})]}):Ve?(()=>{const re=Object.keys(Ve.shape).filter(he=>!bi.has(he)&&!mc.has(vi(Ve.shape[he]))),ne=(He==null?void 0:He.data)||{};return re.length===0?c.jsx("p",{className:"text-xs text-zinc-500",children:"Inline editorial section: edit content directly on the canvas."}):c.jsx(Dr,{schema:Ve,data:ne,onChange:he=>n(he),keys:re,expandedItemPath:le,onSidebarExpandedItemChange:A})})():c.jsxs("div",{className:"text-xs text-red-400 p-4 border border-dashed border-red-900/30 rounded bg-red-900/10",children:["No schema found for ",(G==null?void 0:G.type)??e.type]}):c.jsx("p",{className:"text-xs text-zinc-600 text-center py-10",children:"Select a layer above or on the stage to edit."})})]})}),c.jsx("div",{className:"px-4 py-2.5 border-t border-zinc-800 bg-zinc-900/50 flex items-center justify-between gap-3 opacity-100 shrink-0",children:(x&&w!=null||S&&m!=null||C!=null)&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx("div",{className:se("w-2 h-2 rounded-full transition-colors duration-300 shrink-0",p?"bg-amber-500 shadow-[0_0_8px_rgba(245,158,11,0.5)]":"bg-emerald-500")}),c.jsx("span",{className:se("text-sm font-medium transition-colors duration-300 truncate",v||y?"text-emerald-400":p?"text-amber-500":"text-zinc-500"),children:v||y?"Saved":p?"Unsaved Changes":"All Changes Saved"})]}),x&&w!=null&&c.jsxs(Lr,{children:[c.jsx($r,{asChild:!0,children:c.jsxs(qe,{size:"default",disabled:!p,className:"h-9 min-w-[156px] px-5 text-sm gap-2 ml-auto",onClick:_=>{_.preventDefault(),_.stopPropagation(),w()},children:[c.jsx(ss,{size:14}),c.jsx("span",{children:"Save"})]})}),c.jsx(ar,{children:"Save to file"})]}),S&&m!=null&&c.jsxs(Lr,{children:[c.jsx($r,{asChild:!0,children:c.jsxs(qe,{size:"default",disabled:!p||k,className:"h-9 min-w-[156px] px-5 text-sm gap-2 ml-auto",onClick:_=>{_.preventDefault(),_.stopPropagation(),m()},children:[c.jsx(ss,{size:14}),c.jsx("span",{children:k?"Saving...":"Hot Save"})]})}),c.jsx(ar,{children:"Hot save to edge"})]}),C!=null&&E&&c.jsx("button",{type:"button",onClick:C,className:"shrink-0 flex items-center gap-1.5 px-2 py-1 rounded text-[11px] font-medium transition-all border border-zinc-700 bg-zinc-900 text-zinc-400 hover:bg-zinc-800 hover:border-zinc-600 hover:text-zinc-300",title:"Ripristina la pagina dal file (elimina le modifiche in memoria)",children:c.jsx("span",{children:"Ripristina da file"})})]})}),J!=null&&r.length>0&&o!=null&&(()=>{const _=r.find(Ee=>Ee.id===J),re=l.find(Ee=>Ee.id===J);if(!_)return null;const ne=(re==null?void 0:re.scope)==="global"?"global":"local",he=_.type,Le=M[he],_e=(Le?Object.keys(Le.shape):[]).filter(Ee=>bi.has(Ee)),dr=_.data??{};return _e.length===0?c.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"section-settings-modal-title",onClick:()=>oe(null),children:c.jsxs("div",{ref:F,className:"relative rounded-lg border border-zinc-700 bg-zinc-900 shadow-xl max-w-md w-full overflow-hidden",onClick:Ee=>Ee.stopPropagation(),children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800",children:[c.jsxs("h2",{id:"section-settings-modal-title",className:"text-sm font-bold text-white",children:["Settings — ",he]}),c.jsx("button",{type:"button",onClick:()=>oe(null),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close settings",children:c.jsx(Wt,{size:18})})]}),c.jsx("div",{className:"p-4",children:c.jsx("p",{className:"text-xs text-zinc-500",children:"No settings fields for this section."})})]})}):c.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"section-settings-modal-title",onClick:Ee=>Ee.target===Ee.currentTarget&&oe(null),children:c.jsxs("div",{ref:F,className:"relative rounded-lg border border-zinc-700 bg-zinc-900 shadow-xl max-w-md w-full max-h-[85vh] flex flex-col overflow-hidden",onClick:Ee=>Ee.stopPropagation(),children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800 shrink-0",children:[c.jsxs("h2",{id:"section-settings-modal-title",className:"text-sm font-bold text-white",children:["Settings — ",he]}),c.jsx("button",{type:"button",onClick:()=>oe(null),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close settings (Escape)",children:c.jsx(Wt,{size:18})})]}),c.jsx("div",{className:"flex-1 overflow-y-auto p-4 custom-scrollbar",children:c.jsx(Dr,{schema:Le,data:dr,onChange:Ee=>{const z={..._.data,...Ee};o(J,ne,he,z)},keys:_e})})]})})})()]})})},vc=({draft:e,globalDraft:t,menuConfig:r,themeConfig:n,slug:o,selectedId:i,scrollToSectionId:s,onScrollRequested:a})=>{const l=g.useRef(null),d=g.useCallback(()=>{var u;(u=l.current)!=null&&u.contentWindow&&l.current.contentWindow.postMessage({type:ye.UPDATE_DRAFTS,draft:e,globalDraft:t,menuConfig:r,themeConfig:n},"*")},[e,t,r,n]);return g.useEffect(()=>{d()},[d]),g.useEffect(()=>{const u=f=>{f.data.type===ye.STAGE_READY&&d()};return window.addEventListener("message",u),()=>window.removeEventListener("message",u)},[d]),g.useEffect(()=>{var u;(u=l.current)!=null&&u.contentWindow&&l.current.contentWindow.postMessage({type:ye.SYNC_SELECTION,selectedId:i},"*")},[i]),g.useEffect(()=>{var u;!s||!((u=l.current)!=null&&u.contentWindow)||(l.current.contentWindow.postMessage({type:ye.REQUEST_SCROLL_TO_SECTION,sectionId:s},"*"),a==null||a())},[s,a]),c.jsx("div",{className:"w-full h-full bg-background overflow-hidden",children:c.jsx("iframe",{ref:l,src:`/admin/preview/${o}`,className:"w-full h-full border-none",title:"JsonPages Stage"})})},yi=new Set;function v0(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function xc(e,t=[],r={}){return Object.entries(e).forEach(([n,o])=>{const i=[...t,v0(n)];if(typeof o=="string"||typeof o=="number"){r[`--theme-${i.join("-")}`]=String(o);return}o&&typeof o=="object"&&!Array.isArray(o)&&xc(o,i,r)}),r}function Ue(e,t,r,n){n&&(e[t]=`var(${r})`)}function x0(e){const t=xc(e.tokens),r={...t};return Ue(r,"--theme-primary","--theme-colors-primary",t["--theme-colors-primary"]),Ue(r,"--theme-secondary","--theme-colors-secondary",t["--theme-colors-secondary"]),Ue(r,"--theme-accent","--theme-colors-accent",t["--theme-colors-accent"]),Ue(r,"--theme-background","--theme-colors-background",t["--theme-colors-background"]),Ue(r,"--theme-surface","--theme-colors-surface",t["--theme-colors-surface"]),Ue(r,"--theme-surface-alt","--theme-colors-surface-alt",t["--theme-colors-surface-alt"]),Ue(r,"--theme-text","--theme-colors-text",t["--theme-colors-text"]),Ue(r,"--theme-text-muted","--theme-colors-text-muted",t["--theme-colors-text-muted"]),Ue(r,"--theme-border","--theme-colors-border",t["--theme-colors-border"]),Ue(r,"--theme-font-primary","--theme-typography-font-family-primary",t["--theme-typography-font-family-primary"]),Ue(r,"--theme-font-mono","--theme-typography-font-family-mono",t["--theme-typography-font-family-mono"]),Ue(r,"--theme-font-display","--theme-typography-font-family-display",t["--theme-typography-font-family-display"]),Ue(r,"--theme-radius-sm","--theme-border-radius-sm",t["--theme-border-radius-sm"]),Ue(r,"--theme-radius-md","--theme-border-radius-md",t["--theme-border-radius-md"]),Ue(r,"--theme-radius-lg","--theme-border-radius-lg",t["--theme-border-radius-lg"]),r}const eo={setTheme:e=>{const t=document.documentElement,r=x0(e);yi.forEach(n=>{t.style.removeProperty(n)}),yi.clear(),Object.entries(r).forEach(([n,o])=>{t.style.setProperty(n,o),yi.add(n)})}};function w0(e,t){if(!t)return e;const r=e[e.length-1];return r&&r.itemId==null&&r.fieldKey===t?e:[...e,{fieldKey:t}]}function wc(e,t){var i,s,a;const r=[];let n=null,o=e;for(;o&&o!==t;){const l=(i=o.getAttribute)==null?void 0:i.call(o,"data-jp-item-id"),d=(s=o.getAttribute)==null?void 0:s.call(o,"data-jp-item-field");if(l&&d&&r.push({fieldKey:d,itemId:l}),n==null){const u=(a=o.getAttribute)==null?void 0:a.call(o,"data-jp-field");u&&(n=u)}o=o.parentElement}return r.reverse(),w0(r,n)}const y0='[data-jp-ignore-select="true"],[data-jp-interactive="true"],.ProseMirror,[contenteditable="true"],button,input,textarea,select,[role="button"],[role="menuitem"]',k0="[data-jp-field],[data-jp-item-id],[data-jp-item-field]",yc=()=>{var h;const[e,t]=g.useState(null),[r,n]=g.useState(null),[o,i]=g.useState({main:[]}),[s,a]=g.useState(null),[l,d]=g.useState(null);if(g.useEffect(()=>{const p=w=>{var m;if(!(w.origin!==window.location.origin||w.source!==window.parent)&&(w.data.type===ye.UPDATE_DRAFTS&&(t(w.data.draft),n(w.data.globalDraft),(m=w.data.menuConfig)!=null&&m.main&&i({main:w.data.menuConfig.main}),w.data.themeConfig&&eo.setTheme(w.data.themeConfig)),w.data.type===ye.SYNC_SELECTION&&a(w.data.selectedId),w.data.type===ye.REQUEST_SCROLL_TO_SECTION&&d(w.data.sectionId??null),w.data.type===ye.REQUEST_INLINE_FLUSH)){const v=typeof w.data.requestId=="string"?w.data.requestId:null;window.dispatchEvent(new CustomEvent(ye.REQUEST_INLINE_FLUSH,{detail:{requestId:v}})),setTimeout(()=>{window.parent.postMessage({type:ye.INLINE_FLUSHED,requestId:v},window.location.origin)},0)}};return window.addEventListener("message",p),window.parent.postMessage({type:ye.STAGE_READY},"*"),()=>window.removeEventListener("message",p)},[]),g.useEffect(()=>{const p=v=>!!v.closest(k0),w=v=>!!(v.closest('[data-jp-ignore-select="true"]')||v.closest(y0)&&!p(v)||v.closest("a[href]")&&!p(v)),m=v=>{var L,K,B;const y=v.target;if(w(y)){y.closest("a[href]")&&v.preventDefault();return}const k=v.clientX,x=v.clientY;let S=null,C=y;for(;C&&C!==document.body;){const W=(L=C.getAttribute)==null?void 0:L.call(C,"data-section-id"),U=(K=C.getAttribute)==null?void 0:K.call(C,"data-section-type"),A=(B=C.getAttribute)==null?void 0:B.call(C,"data-section-scope");if(W&&U&&A){S=C;break}C=C.parentElement}if(!S)return;v.preventDefault(),v.stopPropagation();const E=S.getAttribute("data-section-id"),N=S.getAttribute("data-section-type"),j=S.getAttribute("data-section-scope");if(!E||!N||!j)return;const D={id:E,type:N,scope:j};if(y===S){window.parent.postMessage({type:ye.SECTION_SELECT,section:D},"*");return}const M=document.elementFromPoint(k,x)??y;if(!M||!S.contains(M)){window.parent.postMessage({type:ye.SECTION_SELECT,section:D},"*");return}if(M===S){window.parent.postMessage({type:ye.SECTION_SELECT,section:D},"*");return}let I=wc(M,S);if(I.length===0&&M){let W=null;const U=A=>{var oe,T;const J=A.getBoundingClientRect();if(J.left<=k&&k<=J.right&&J.top<=x&&x<=J.bottom){for(let F=0;F<A.children.length;F++)U(A.children[F]);((oe=A.getAttribute)!=null&&oe.call(A,"data-jp-item-id")||(T=A.getAttribute)!=null&&T.call(A,"data-jp-field"))&&(W=A)}};U(M),W&&(I=wc(W,S))}const R={type:ye.SECTION_SELECT,section:D};I.length>0&&(R.itemPath=I),window.parent.postMessage(R,"*")};return document.addEventListener("click",m,!0),()=>document.removeEventListener("click",m,!0)},[]),g.useEffect(()=>{if(!l)return;const p=setTimeout(()=>d(null),600);return()=>clearTimeout(p)},[l]),!e||!r)return c.jsx("div",{className:"flex items-center justify-center h-screen w-full bg-zinc-950 text-zinc-500 font-mono text-xs uppercase tracking-widest animate-pulse",children:"Waiting for Studio Signal..."});const u={main:nn((h=r.header)==null?void 0:h.data,o.main)},f=p=>{window.parent.postMessage({type:ye.ACTIVE_SECTION_CHANGED,activeSectionId:p},"*")};return c.jsx(Jr,{mode:"studio",children:c.jsx("div",{className:"jp-ice-active",children:c.jsx(ho,{pageConfig:e,siteConfig:r,menuConfig:u,selectedId:s,scrollToSectionId:l,onActiveSectionChange:f})})})};function S0(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const kc=({open:e,onClose:t,sectionTypes:r,sectionTypeLabels:n,onSelect:o})=>{if(g.useEffect(()=>{if(!e)return;const s=a=>{a.key==="Escape"&&t()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,t]),!e)return null;const i=s=>(n==null?void 0:n[s])??S0(s);return c.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",role:"dialog","aria-modal":"true","aria-labelledby":"jp-add-section-title",children:[c.jsx("div",{className:"absolute inset-0 bg-zinc-950/80 backdrop-blur-sm",onClick:t,"aria-hidden":"true"}),c.jsxs("div",{className:"relative w-full max-w-md max-h-[85vh] flex flex-col rounded-xl border border-zinc-700 bg-zinc-900 shadow-2xl overflow-hidden",children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-zinc-800 shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/20 text-blue-400",children:c.jsx(uo,{size:18})}),c.jsx("h2",{id:"jp-add-section-title",className:"text-sm font-bold text-white",children:"Add section"})]}),c.jsx("button",{type:"button",onClick:t,className:"p-1.5 rounded-md text-zinc-400 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close",children:c.jsx(Wt,{size:18})})]}),c.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:r.length===0?c.jsx("p",{className:"text-xs text-zinc-500 text-center py-8",children:"No section types available. Configure addableSectionTypes or schemas."}):c.jsx("ul",{className:"grid gap-2",role:"listbox",children:r.map(s=>c.jsx("li",{role:"option",children:c.jsxs("button",{type:"button",onClick:()=>{o(s),t()},className:se("w-full flex items-center gap-3 px-4 py-3 rounded-lg text-left","border border-zinc-700/80 bg-zinc-800/50","hover:border-blue-500/40 hover:bg-zinc-800 transition-colors","focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:ring-offset-2 focus:ring-offset-zinc-900"),children:[c.jsx("span",{className:"flex items-center justify-center w-9 h-9 rounded-md bg-zinc-700/80 text-zinc-400 text-xs font-mono shrink-0",children:s}),c.jsx("span",{className:"text-sm font-medium text-zinc-200",children:i(s)})]})},s))})}),c.jsx("div",{className:"px-5 py-3 border-t border-zinc-800 shrink-0",children:c.jsx("p",{className:"text-[10px] text-zinc-500 uppercase tracking-wider",children:"Choose a section type to add to the bottom of this page"})})]})]})},Sc=()=>c.jsxs("div",{style:{"--local-bg":"var(--color-background)","--local-text":"var(--color-text)","--local-text-muted":"var(--color-text-muted)","--local-primary":"var(--color-primary)","--local-radius-md":"var(--radius-md)"},className:"min-h-screen flex flex-col items-center justify-center bg-[var(--local-bg)] px-6",children:[c.jsx("h1",{className:"text-6xl font-bold text-[var(--local-text)] mb-4",children:"404"}),c.jsx("p",{className:"text-xl text-[var(--local-text-muted)] mb-8",children:"Page not found"}),c.jsx("a",{href:"/",className:"inline-flex items-center gap-2 px-6 py-3 rounded-[var(--local-radius-md)] bg-[var(--local-primary)] text-[var(--local-bg)] font-semibold text-sm hover:opacity-90 transition-opacity",children:"Back to Home"})]});function ki(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Cc(e){return e==null?e:JSON.parse(JSON.stringify(e))}function Ec(){if(typeof window>"u")return null;const e=window;return e.__olonWebMcpTools__||(e.__olonWebMcpTools__=new Map),e.__olonWebMcpTools__}const Wr="update-section-draft",to="save-project-state";function jc(){return{type:"object",additionalProperties:!1,properties:{slug:{type:"string"},sectionId:{type:"string",description:"The unique ID of the section to update (found via data-jp-section-id or MCP read)."},sectionType:{type:"string",description:'The type of the section being updated (e.g. "olon-hero"). Used to pick the correct validation schema.'},scope:{type:"string",enum:["local","global"],default:"local"},data:{type:"object",description:"Full replacement payload validated against the section's schema."},itemPath:{type:"array",description:"Optional root-to-leaf path for targeted field updates.",items:{type:"object",additionalProperties:!1,properties:{fieldKey:{type:"string"},itemId:{type:"string"}},required:["fieldKey"]}},fieldKey:{type:"string",description:"Shorthand for a top-level scalar field update when itemPath is omitted."},value:{description:"Value written to the targeted field or array item."}},required:["sectionId"],oneOf:[{required:["data"]},{required:["itemPath","value"]},{required:["fieldKey","value"]}]}}function Nc(){return{type:"object",additionalProperties:!1,properties:{message:{type:"string",description:"Optional save reason or commit message equivalent."}}}}function Si(e,t,r){if(t.length===0)throw new Error("Selection path is empty.");const n=Cc(e);let o=n;for(let i=0;i<t.length;i+=1){const s=t[i],a=i===t.length-1;if(!ki(o))throw new Error(`Cannot navigate path segment "${s.fieldKey}" on a non-object value.`);if(s.itemId!=null){const l=o[s.fieldKey];if(!Array.isArray(l))throw new Error(`Field "${s.fieldKey}" is not an array.`);const d=l.findIndex(u=>ki(u)&&String(u.id??"")===String(s.itemId));if(d===-1)throw new Error(`Array item "${s.itemId}" not found under "${s.fieldKey}".`);if(a)return l[d]=r,n;o=l[d];continue}if(a)return o[s.fieldKey]=r,n;o=o[s.fieldKey]}return n}function Ci(e,t){if(t.data&&ki(t.data))return Cc(t.data);if(Array.isArray(t.itemPath)&&t.itemPath.length>0)return Si(e,t.itemPath,t.value);if(typeof t.fieldKey=="string"&&t.fieldKey.trim().length>0)return Si(e,[{fieldKey:t.fieldKey}],t.value);throw new Error('WebMCP mutation requires either "data", "itemPath", or "fieldKey".')}async function Tc(e){if(e.startsWith("olon://pages/")){const t=e.replace("olon://pages/",""),r=window.location.pathname.replace(/\/admin(\/.*)?$/,"").replace(/\/$/,""),n=await fetch(`${r}/pages/${t}.json`);if(!n.ok)throw new Error(`Resource not found: ${e} (at ${r}/pages/${t}.json)`);return await n.json()}throw new Error(`Unsupported URI scheme: ${e}`)}function ro(){if(typeof window>"u"||typeof navigator>"u")return;const e=Ec();if(!e)return;const t=navigator;t.modelContext||(t.modelContext={}),t.modelContext.registerTool=function(r){e.set(r.name,r)},t.modelContext.unregisterTool=function(r){e.delete(r)},t.modelContext.readResource=Tc,t.modelContextProtocol||(t.modelContextProtocol={}),t.modelContextProtocol.listTools=function(){return Array.from(e.values()).map(({execute:r,...n})=>n)},t.modelContextProtocol.executeTool=async function(r,n){const o=e.get(r);if(!o)throw new Error(`Unknown WebMCP tool: ${r}`);const i=n?JSON.parse(n):{},s=await o.execute(i);return JSON.stringify(s)},t.modelContextProtocol.readResource=async function(r){const n=await Tc(r);return JSON.stringify(n)}}function Ei(e){var n,o;if(typeof navigator>"u")return()=>{};ro();const t=navigator,r=Ec();return!t.modelContext||!r?()=>{}:((o=(n=t.modelContext).registerTool)==null||o.call(n,e),r.set(e.name,e),()=>{var i,s;r.delete(e.name),(s=(i=t.modelContext)==null?void 0:i.unregisterTool)==null||s.call(i,e.name)})}function C0(e){if(typeof window>"u")return{emitUpdate:()=>{},disconnect:()=>{}};let t=null,r=!1,n;const i="ws://localhost:5174",s=()=>{if(!r)try{t=new WebSocket(i),t.onopen=()=>{console.debug("[OlonJs WebMCP] Socket connected")},t.onmessage=d=>{try{const u=JSON.parse(d.data);u.type==="SYNC_DRAFT_UPDATE"&&u.draft&&u.globalDraft&&e(u.draft,u.globalDraft)}catch(u){console.warn("[OlonJs WebMCP] Failed to parse socket message",u)}},t.onerror=()=>{},t.onclose=()=>{r||(n=window.setTimeout(s,3e3))}}catch(d){console.warn("[OlonJs WebMCP] Socket connection failed",d),r||(n=window.setTimeout(s,3e3))}};return s(),{emitUpdate:(d,u)=>{(t==null?void 0:t.readyState)===WebSocket.OPEN&&t.send(JSON.stringify({type:"SYNC_DRAFT_UPDATE",draft:d,globalDraft:u}))},disconnect:()=>{r=!0,n&&clearTimeout(n),t&&(t.close(),t=null)}}}const E0='/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-900:oklch(39.6% .141 25.723);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-200:oklch(92% .004 286.32);--color-zinc-300:oklch(87.1% .006 286.286);--color-zinc-400:oklch(70.5% .015 286.067);--color-zinc-500:oklch(55.2% .016 285.938);--color-zinc-600:oklch(44.2% .017 285.786);--color-zinc-700:oklch(37% .013 285.805);--color-zinc-800:oklch(27.4% .006 286.033);--color-zinc-900:oklch(21% .006 285.885);--color-zinc-950:oklch(14.1% .005 285.823);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-black:900;--tracking-tight:-.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-background:var(--background);--color-foreground:var(--foreground);--color-primary:var(--primary);--color-primary-foreground:var(--primary-foreground);--color-destructive:var(--destructive);--color-ring:var(--ring)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border)}body{background-color:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.left-1\\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-3{left:calc(var(--spacing)*3)}.z-0{z-index:0}.z-10{z-index:10}.z-50,.z-\\[50\\]{z-index:50}.z-\\[60\\]{z-index:60}.z-\\[70\\]{z-index:70}.z-\\[100\\]{z-index:100}.z-\\[9998\\]{z-index:9998}.z-\\[9999\\]{z-index:9999}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-4{margin:calc(var(--spacing)*4)}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-1\\.5{margin-inline:calc(var(--spacing)*1.5)}.mx-2{margin-inline:calc(var(--spacing)*2)}.mx-3{margin-inline:calc(var(--spacing)*3)}.my-1{margin-block:calc(var(--spacing)*1)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.aspect-\\[4\\/3\\]{aspect-ratio:4/3}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.h-1\\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-3\\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-20{height:calc(var(--spacing)*20)}.h-40{height:calc(var(--spacing)*40)}.h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-screen{height:100vh}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\\[45vh\\]{max-height:45vh}.max-h-\\[85vh\\]{max-height:85vh}.max-h-\\[90vh\\]{max-height:90vh}.max-h-\\[320px\\]{max-height:320px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-16{min-height:calc(var(--spacing)*16)}.min-h-\\[18px\\]{min-height:18px}.min-h-\\[96px\\]{min-height:96px}.min-h-\\[240px\\]{min-height:240px}.min-h-screen{min-height:100vh}.w-1{width:calc(var(--spacing)*1)}.w-1\\.5{width:calc(var(--spacing)*1.5)}.w-2{width:calc(var(--spacing)*2)}.w-3{width:calc(var(--spacing)*3)}.w-3\\.5{width:calc(var(--spacing)*3.5)}.w-3\\/4{width:75%}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-7{width:calc(var(--spacing)*7)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-\\[calc\\(100\\%-2rem\\)\\]{width:calc(100% - 2rem)}.w-\\[var\\(--radix-popover-trigger-width\\)\\]{width:var(--radix-popover-trigger-width)}.w-full{width:100%}.w-px{width:1px}.w-screen{width:100vw}.max-w-2xl{max-width:var(--container-2xl)}.max-w-\\[280px\\]{max-width:280px}.max-w-\\[var\\(--inspector-width\\,280px\\)\\]{max-width:var(--inspector-width,280px)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[18px\\]{min-width:18px}.min-w-\\[156px\\]{min-width:156px}.min-w-\\[var\\(--radix-popover-trigger-width\\)\\]{min-width:var(--radix-popover-trigger-width)}.min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-0\\.5{--tw-translate-x:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-3{--tw-translate-x:calc(var(--spacing)*3);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize-none{resize:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-nowrap{flex-wrap:nowrap}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing)*0)}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-\\[var\\(--local-radius-md\\)\\]{border-radius:var(--local-radius-md)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-amber-500\\/20{border-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.border-amber-500\\/20{border-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.border-amber-500\\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\\/30{border-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.border-blue-500{border-color:var(--color-blue-500)}.border-blue-500\\/50{border-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.border-blue-500\\/50{border-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.border-blue-600{border-color:var(--color-blue-600)}.border-emerald-500\\/60{border-color:#00bb7f99}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\\/60{border-color:color-mix(in oklab,var(--color-emerald-500)60%,transparent)}}.border-primary{border-color:var(--color-primary)}.border-red-500\\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\\/20{border-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.border-red-500\\/50{border-color:#fb2c3680}@supports (color:color-mix(in lab,red,red)){.border-red-500\\/50{border-color:color-mix(in oklab,var(--color-red-500)50%,transparent)}}.border-red-900\\/30{border-color:#82181a4d}@supports (color:color-mix(in lab,red,red)){.border-red-900\\/30{border-color:color-mix(in oklab,var(--color-red-900)30%,transparent)}}.border-transparent{border-color:#0000}.border-zinc-700{border-color:var(--color-zinc-700)}.border-zinc-700\\/60{border-color:#3f3f4699}@supports (color:color-mix(in lab,red,red)){.border-zinc-700\\/60{border-color:color-mix(in oklab,var(--color-zinc-700)60%,transparent)}}.border-zinc-700\\/80{border-color:#3f3f46cc}@supports (color:color-mix(in lab,red,red)){.border-zinc-700\\/80{border-color:color-mix(in oklab,var(--color-zinc-700)80%,transparent)}}.border-zinc-800{border-color:var(--color-zinc-800)}.border-zinc-800\\/50{border-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.border-zinc-800\\/50{border-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.border-zinc-800\\/60{border-color:#27272a99}@supports (color:color-mix(in lab,red,red)){.border-zinc-800\\/60{border-color:color-mix(in oklab,var(--color-zinc-800)60%,transparent)}}.border-l-transparent{border-left-color:#0000}.bg-\\[var\\(--color-background\\)\\]{background-color:var(--color-background)}.bg-\\[var\\(--local-bg\\)\\]{background-color:var(--local-bg)}.bg-\\[var\\(--local-primary\\)\\]{background-color:var(--local-primary)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\\/5{background-color:#f99c000d}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\\/5{background-color:color-mix(in oklab,var(--color-amber-500)5%,transparent)}}.bg-amber-500\\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-background{background-color:var(--color-background)}.bg-black{background-color:var(--color-black)}.bg-black\\/0{background-color:#0000}@supports (color:color-mix(in lab,red,red)){.bg-black\\/0{background-color:color-mix(in oklab,var(--color-black)0%,transparent)}}.bg-black\\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\\/20{background-color:color-mix(in oklab,var(--color-black)20%,transparent)}}.bg-black\\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\\/30{background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\\/60{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-500\\/5{background-color:#3080ff0d}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/5{background-color:color-mix(in oklab,var(--color-blue-500)5%,transparent)}}.bg-blue-500\\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.bg-blue-500\\/15{background-color:#3080ff26}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/15{background-color:color-mix(in oklab,var(--color-blue-500)15%,transparent)}}.bg-blue-500\\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-blue-500\\/\\[0\\.04\\]{background-color:#3080ff0a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/\\[0\\.04\\]{background-color:color-mix(in oklab,var(--color-blue-500)4%,transparent)}}.bg-blue-600{background-color:var(--color-blue-600)}.bg-blue-600\\/10{background-color:#155dfc1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-600\\/10{background-color:color-mix(in oklab,var(--color-blue-600)10%,transparent)}}.bg-destructive\\/15{background-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\\/15{background-color:color-mix(in oklab,var(--color-destructive)15%,transparent)}}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-primary,.bg-primary\\/10{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\\/10{background-color:color-mix(in oklab,var(--color-primary)10%,transparent)}}.bg-primary\\/\\[0\\.08\\]{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\\/\\[0\\.08\\]{background-color:color-mix(in oklab,var(--color-primary)8%,transparent)}}.bg-red-500\\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\\/15{background-color:#fb2c3626}@supports (color:color-mix(in lab,red,red)){.bg-red-500\\/15{background-color:color-mix(in oklab,var(--color-red-500)15%,transparent)}}.bg-red-900\\/10{background-color:#82181a1a}@supports (color:color-mix(in lab,red,red)){.bg-red-900\\/10{background-color:color-mix(in oklab,var(--color-red-900)10%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/15{background-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.bg-white\\/15{background-color:color-mix(in oklab,var(--color-white)15%,transparent)}}.bg-white\\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-white\\/\\[0\\.01\\]{background-color:#ffffff03}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.01\\]{background-color:color-mix(in oklab,var(--color-white)1%,transparent)}}.bg-white\\/\\[0\\.02\\]{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.02\\]{background-color:color-mix(in oklab,var(--color-white)2%,transparent)}}.bg-white\\/\\[0\\.03\\]{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.03\\]{background-color:color-mix(in oklab,var(--color-white)3%,transparent)}}.bg-zinc-700{background-color:var(--color-zinc-700)}.bg-zinc-700\\/80{background-color:#3f3f46cc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-700\\/80{background-color:color-mix(in oklab,var(--color-zinc-700)80%,transparent)}}.bg-zinc-800{background-color:var(--color-zinc-800)}.bg-zinc-800\\/30{background-color:#27272a4d}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/30{background-color:color-mix(in oklab,var(--color-zinc-800)30%,transparent)}}.bg-zinc-800\\/50{background-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/50{background-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.bg-zinc-800\\/60{background-color:#27272a99}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/60{background-color:color-mix(in oklab,var(--color-zinc-800)60%,transparent)}}.bg-zinc-800\\/80{background-color:#27272acc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/80{background-color:color-mix(in oklab,var(--color-zinc-800)80%,transparent)}}.bg-zinc-900{background-color:var(--color-zinc-900)}.bg-zinc-900\\/20{background-color:#18181b33}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/20{background-color:color-mix(in oklab,var(--color-zinc-900)20%,transparent)}}.bg-zinc-900\\/40{background-color:#18181b66}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/40{background-color:color-mix(in oklab,var(--color-zinc-900)40%,transparent)}}.bg-zinc-900\\/50{background-color:#18181b80}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/50{background-color:color-mix(in oklab,var(--color-zinc-900)50%,transparent)}}.bg-zinc-900\\/60{background-color:#18181b99}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/60{background-color:color-mix(in oklab,var(--color-zinc-900)60%,transparent)}}.bg-zinc-950{background-color:var(--color-zinc-950)}.bg-zinc-950\\/80{background-color:#09090bcc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-950\\/80{background-color:color-mix(in oklab,var(--color-zinc-950)80%,transparent)}}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-black\\/70{--tw-gradient-from:#000000b3}@supports (color:color-mix(in lab,red,red)){.from-black\\/70{--tw-gradient-from:color-mix(in oklab,var(--color-black)70%,transparent)}}.from-black\\/70{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-black\\/80{--tw-gradient-from:#000c}@supports (color:color-mix(in lab,red,red)){.from-black\\/80{--tw-gradient-from:color-mix(in oklab,var(--color-black)80%,transparent)}}.from-black\\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-1\\.5{padding:calc(var(--spacing)*1.5)}.p-2\\.5{padding:calc(var(--spacing)*2.5)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.p-px{padding:1px}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-3\\.5{padding-inline:calc(var(--spacing)*3.5)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-7{padding-block:calc(var(--spacing)*7)}.py-8{padding-block:calc(var(--spacing)*8)}.py-10{padding-block:calc(var(--spacing)*10)}.py-12{padding-block:calc(var(--spacing)*12)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-4{padding-top:calc(var(--spacing)*4)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-1{padding-left:calc(var(--spacing)*1)}.pl-3{padding-left:calc(var(--spacing)*3)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-9{padding-left:calc(var(--spacing)*9)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[0\\.01em\\]{--tw-tracking:.01em;letter-spacing:.01em}.tracking-\\[0\\.02em\\]{--tw-tracking:.02em;letter-spacing:.02em}.tracking-\\[0\\.04em\\]{--tw-tracking:.04em;letter-spacing:.04em}.tracking-\\[0\\.05em\\]{--tw-tracking:.05em;letter-spacing:.05em}.tracking-\\[0\\.06em\\]{--tw-tracking:.06em;letter-spacing:.06em}.tracking-\\[0\\.08em\\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.whitespace-nowrap{white-space:nowrap}.text-\\[var\\(--local-bg\\)\\]{color:var(--local-bg)}.text-\\[var\\(--local-text\\)\\]{color:var(--local-text)}.text-\\[var\\(--local-text-muted\\)\\]{color:var(--local-text-muted)}.text-amber-200{color:var(--color-amber-200)}.text-amber-500{color:var(--color-amber-500)}.text-amber-500\\/70{color:#f99c00b3}@supports (color:color-mix(in lab,red,red)){.text-amber-500\\/70{color:color-mix(in oklab,var(--color-amber-500)70%,transparent)}}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-destructive{color:var(--color-destructive)}.text-emerald-400{color:var(--color-emerald-400)}.text-foreground{color:var(--color-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-red-300{color:var(--color-red-300)}.text-red-400{color:var(--color-red-400)}.text-white{color:var(--color-white)}.text-zinc-200{color:var(--color-zinc-200)}.text-zinc-300{color:var(--color-zinc-300)}.text-zinc-400{color:var(--color-zinc-400)}.text-zinc-500{color:var(--color-zinc-500)}.text-zinc-600{color:var(--color-zinc-600)}.text-zinc-600\\/50{color:#52525c80}@supports (color:color-mix(in lab,red,red)){.text-zinc-600\\/50{color:color-mix(in oklab,var(--color-zinc-600)50%,transparent)}}.text-zinc-700{color:var(--color-zinc-700)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.opacity-0{opacity:0}.opacity-10{opacity:.1}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_8px_rgba\\(245\\,158\\,11\\,0\\.5\\)\\]{--tw-shadow:0 0 8px var(--tw-shadow-color,#f59e0b80);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-black\\/30{--tw-shadow-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.shadow-black\\/30{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-black)30%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-primary\\/20{--tw-shadow-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.shadow-primary\\/20{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-primary)20%,transparent)var(--tw-shadow-alpha),transparent)}}.ring-blue-500{--tw-ring-color:var(--color-blue-500)}.ring-blue-500\\/40{--tw-ring-color:#3080ff66}@supports (color:color-mix(in lab,red,red)){.ring-blue-500\\/40{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)40%,transparent)}}.ring-zinc-800{--tw-ring-color:var(--color-zinc-800)}.ring-offset-1{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.ring-offset-zinc-900{--tw-ring-offset-color:var(--color-zinc-900)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.brightness-\\[0\\.6\\]{--tw-brightness:brightness(.6);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.brightness-\\[0\\.85\\]{--tw-brightness:brightness(.85);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition-\\[border-color\\,opacity\\]{transition-property:border-color,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[filter\\]{transition-property:filter;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\\:border-dashed:is(:where(.group):hover *){--tw-border-style:dashed;border-style:dashed}.group-hover\\:border-blue-400\\/50:is(:where(.group):hover *){border-color:#54a2ff80}@supports (color:color-mix(in lab,red,red)){.group-hover\\:border-blue-400\\/50:is(:where(.group):hover *){border-color:color-mix(in oklab,var(--color-blue-400)50%,transparent)}}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}.group-hover\\:brightness-100:is(:where(.group):hover *){--tw-brightness:brightness(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.hover\\:scale-\\[1\\.02\\]:hover{scale:1.02}.hover\\:border-blue-500\\/30:hover{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.hover\\:border-blue-500\\/30:hover{border-color:color-mix(in oklab,var(--color-blue-500)30%,transparent)}}.hover\\:border-blue-500\\/40:hover{border-color:#3080ff66}@supports (color:color-mix(in lab,red,red)){.hover\\:border-blue-500\\/40:hover{border-color:color-mix(in oklab,var(--color-blue-500)40%,transparent)}}.hover\\:border-zinc-600:hover{border-color:var(--color-zinc-600)}.hover\\:border-zinc-700:hover{border-color:var(--color-zinc-700)}.hover\\:bg-blue-500\\/\\[0\\.03\\]:hover{background-color:#3080ff08}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-blue-500\\/\\[0\\.03\\]:hover{background-color:color-mix(in oklab,var(--color-blue-500)3%,transparent)}}.hover\\:bg-blue-600\\/20:hover{background-color:#155dfc33}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-blue-600\\/20:hover{background-color:color-mix(in oklab,var(--color-blue-600)20%,transparent)}}.hover\\:bg-destructive\\/25:hover{background-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-destructive\\/25:hover{background-color:color-mix(in oklab,var(--color-destructive)25%,transparent)}}.hover\\:bg-primary\\/40:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/40:hover{background-color:color-mix(in oklab,var(--color-primary)40%,transparent)}}.hover\\:bg-primary\\/90:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--color-primary)90%,transparent)}}.hover\\:bg-red-500\\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-red-500\\/10:hover{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.hover\\:bg-red-500\\/25:hover{background-color:#fb2c3640}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-red-500\\/25:hover{background-color:color-mix(in oklab,var(--color-red-500)25%,transparent)}}.hover\\:bg-white\\/30:hover{background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/30:hover{background-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.hover\\:bg-white\\/\\[0\\.02\\]:hover{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/\\[0\\.02\\]:hover{background-color:color-mix(in oklab,var(--color-white)2%,transparent)}}.hover\\:bg-zinc-600:hover{background-color:var(--color-zinc-600)}.hover\\:bg-zinc-800:hover{background-color:var(--color-zinc-800)}.hover\\:bg-zinc-800\\/40:hover{background-color:#27272a66}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-zinc-800\\/40:hover{background-color:color-mix(in oklab,var(--color-zinc-800)40%,transparent)}}.hover\\:bg-zinc-800\\/50:hover{background-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-zinc-800\\/50:hover{background-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.hover\\:bg-zinc-900:hover{background-color:var(--color-zinc-900)}.hover\\:text-blue-400:hover{color:var(--color-blue-400)}.hover\\:text-destructive:hover{color:var(--color-destructive)}.hover\\:text-primary:hover{color:var(--color-primary)}.hover\\:text-red-200:hover{color:var(--color-red-200)}.hover\\:text-red-400:hover{color:var(--color-red-400)}.hover\\:text-red-500:hover{color:var(--color-red-500)}.hover\\:text-white:hover{color:var(--color-white)}.hover\\:text-zinc-200:hover{color:var(--color-zinc-200)}.hover\\:text-zinc-300:hover{color:var(--color-zinc-300)}.hover\\:text-zinc-400:hover{color:var(--color-zinc-400)}.hover\\:opacity-90:hover{opacity:.9}.hover\\:ring-zinc-600:hover{--tw-ring-color:var(--color-zinc-600)}}.focus\\:bg-zinc-800:focus{background-color:var(--color-zinc-800)}.focus\\:text-white:focus{color:var(--color-white)}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-blue-500\\/50:focus{--tw-ring-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.focus\\:ring-blue-500\\/50:focus{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.focus\\:ring-blue-600:focus{--tw-ring-color:var(--color-blue-600)}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\\:ring-offset-zinc-900:focus{--tw-ring-offset-color:var(--color-zinc-900)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:border-zinc-600:focus-visible{border-color:var(--color-zinc-600)}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-blue-500:focus-visible{--tw-ring-color:var(--color-blue-500)}.focus-visible\\:ring-blue-500\\/80:focus-visible{--tw-ring-color:#3080ffcc}@supports (color:color-mix(in lab,red,red)){.focus-visible\\:ring-blue-500\\/80:focus-visible{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)80%,transparent)}}.focus-visible\\:ring-blue-600:focus-visible{--tw-ring-color:var(--color-blue-600)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color:var(--color-ring)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\\:ring-offset-zinc-900:focus-visible{--tw-ring-offset-color:var(--color-zinc-900)}.focus-visible\\:ring-offset-zinc-950:focus-visible{--tw-ring-offset-color:var(--color-zinc-950)}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.focus-visible\\:ring-inset:focus-visible{--tw-ring-inset:inset}.active\\:cursor-grabbing:active{cursor:grabbing}.active\\:bg-primary\\/60:active{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-primary\\/60:active{background-color:color-mix(in oklab,var(--color-primary)60%,transparent)}}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-20:disabled{opacity:.2}.disabled\\:opacity-30:disabled{opacity:.3}.disabled\\:opacity-50:disabled{opacity:.5}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[state\\=open\\]\\:border-zinc-800[data-state=open]{border-color:var(--color-zinc-800)}.data-\\[state\\=open\\]\\:bg-zinc-950[data-state=open]{background-color:var(--color-zinc-950)}.data-\\[state\\=open\\]\\:text-zinc-100[data-state=open]{color:var(--color-zinc-100)}@media(min-width:40rem){.sm\\:max-w-\\[280px\\]{max-width:280px}}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&\\>span\\]\\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\\[\\&\\>span\\]\\:flex>span{display:flex}.\\[\\&\\>span\\]\\:items-center>span{align-items:center}.\\[\\&\\>span\\]\\:gap-2>span{gap:calc(var(--spacing)*2)}}:root{--background:oklch(14.1% .005 285.823);--foreground:oklch(98.5% 0 0);--card:oklch(21% .006 285.885);--card-foreground:oklch(98.5% 0 0);--popover:oklch(21% .006 285.885);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(42% .18 266);--primary-foreground:oklch(97% .014 254.604);--secondary:oklch(27.4% .006 286.033);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(27.4% .006 286.033);--muted-foreground:oklch(70.5% .015 286.067);--accent:oklch(42% .18 266);--accent-foreground:oklch(97% .014 254.604);--destructive:oklch(70.4% .191 22.216);--destructive-foreground:oklch(97% .014 254.604);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.2% .016 285.938);--radius:.5rem;--jp-inspector-label-size:11px;--jp-inspector-field-size:13px;font-family:ui-sans-serif,system-ui,sans-serif}[data-radix-portal]{z-index:9999!important}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}';class j0 extends g.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error("[JsonPages Engine]",t,r)}render(){return this.state.hasError&&this.state.error?c.jsxs("div",{style:{minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:24,backgroundColor:"#0f172a",color:"#e2e8f0",fontFamily:"ui-sans-serif, system-ui, sans-serif"},children:[c.jsx("h1",{style:{fontSize:"1.25rem",fontWeight:700,marginBottom:8},children:"JsonPages Engine Error"}),c.jsx("pre",{style:{maxWidth:"100%",overflow:"auto",padding:16,backgroundColor:"rgba(0,0,0,0.3)",borderRadius:8,fontSize:12,marginTop:8},children:this.state.error.message})]}):this.props.children}}function Ur(e){return e.split("/").map(t=>t.trim()).filter(Boolean).join("/")}function Ac(e,t=""){const r=Ur(t);let o=e.replace(/\/+/g,"/");if(r){const s=`/${r}`;o===s?o="/":o.startsWith(`${s}/`)&&(o=o.slice(s.length))}return Ur(o)||"home"}function ji(e,t){const r=Ur(t)||"home";return e[r]}function Ni(e,t){return nn(e,t)}function Ti(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function no(e,t){if(typeof document>"u")return;const r=`link[rel="${e}"]`;let n=document.head.querySelector(r);n||(n=document.createElement("link"),n.rel=e,document.head.appendChild(n)),n.href=t}function zc(e,t,r){if(typeof document>"u")return;const n="olonjs-webmcp-jsonld";let o=document.getElementById(n);o||(o=document.createElement("script"),o.type="application/ld+json",o.id=n,document.head.appendChild(o)),o.textContent=JSON.stringify({"@context":"https://schema.org","@type":"WebPage",name:e,description:t,url:r})}function Pc(e){return`/mcp-manifests/${e}.json`}function Oc(e){return`/schemas/${e}.schema.json`}const Ic=({pageRegistry:e,siteConfig:t,menuConfig:r,themeConfig:n,refDocuments:o,tenantCss:i,adminCss:s,NotFoundComponent:a})=>{const l=Je.useLocation(),d=Ac(l.pathname),u=g.useMemo(()=>Ot({pages:e,siteConfig:t,themeConfig:n,menuConfig:r,refDocuments:o}),[e,t,n,r,o]),f=ji(u.pages,d);return g.useEffect(()=>{var h;try{(h=u.themeConfig)!=null&&h.tokens&&eo.setTheme(u.themeConfig)}catch(p){console.warn("[JsonPages] visitor theme resolution failed",p)}},[u.themeConfig]),g.useEffect(()=>{var w,m;if(!f)return;const h=typeof((w=f.meta)==null?void 0:w.title)=="string"?f.meta.title:d,p=typeof((m=f.meta)==null?void 0:m.description)=="string"?f.meta.description:"";no("mcp-manifest",Pc(d)),no("olon-contract",Oc(d)),zc(h,p,d==="home"?"/":`/${d}`)},[f,d]),f?c.jsx(sn,{mode:"tenant",tenantCss:i,adminCss:s,children:c.jsx(Jr,{mode:"visitor",children:c.jsx(ho,{pageConfig:f,siteConfig:u.siteConfig,menuConfig:u.menuConfig})})}):c.jsx(a,{})},Dc=({pageRegistry:e,schemas:t,siteConfig:r,menuConfig:n,themeConfig:o,refDocuments:i,tenantCss:s,adminCss:a,addSectionConfig:l,addableSectionTypes:d,webMcp:u,saveToFile:f,hotSave:h,showLegacySave:p=!0,showHotSave:w=!1})=>{var Ee;const m=Je.useLocation(),v=Ac(m.pathname,"admin"),y=Je.useNavigate(),k=Object.keys(e).sort((z,O)=>z==="home"?-1:O==="home"?1:z.localeCompare(O)),[x,S]=g.useState(null),[C,E]=g.useState(!1),[N,j]=g.useState(!1),[D,M]=g.useState(!1),[I,R]=g.useState(!1),[L,K]=g.useState(()=>{try{const z=JSON.parse(JSON.stringify(r??{}));return z.identity||(z.identity={title:"Site"}),z.pages||(z.pages=[]),z}catch{return{identity:{title:"Site"},pages:[]}}}),[B,W]=g.useState(null),[U,A]=g.useState(null),[J,oe]=g.useState(null),[T,F]=g.useState(null),[X,G]=g.useState(!1),[ve,le]=g.useState(400),P=g.useMemo(()=>Ot({pages:x?{[v]:x}:{},siteConfig:L,themeConfig:o,menuConfig:n,refDocuments:i}),[x,L,o,n,i,v]),Q=x?P.pages[v]??x:null,ee=g.useRef(x),$=g.useRef(L),ie=360,te=920;g.useEffect(()=>{ee.current=x},[x]),g.useEffect(()=>{$.current=L},[L]);const ke=g.useCallback(z=>{z.preventDefault();const O=z.currentTarget;O.setPointerCapture(z.pointerId);const Y=z.clientX,q=ve,Z=ge=>{const pe=Y-ge.clientX,ue=Math.min(te,Math.max(ie,q+pe));le(ue)},ae=()=>{O.releasePointerCapture(z.pointerId),O.removeEventListener("pointermove",Z),O.removeEventListener("pointerup",ae),O.removeEventListener("pointercancel",ae),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",O.addEventListener("pointermove",Z),O.addEventListener("pointerup",ae),O.addEventListener("pointercancel",ae)},[ve]),we=x?[...L.header?[{id:L.header.id,type:L.header.type,scope:"global",title:"Header"}]:[],...x.sections.map(z=>{var O,Y;return{id:z.id,type:z.type,scope:"local",title:((O=z.data)==null?void 0:O.title)??((Y=z.data)==null?void 0:Y.titleHighlight)}}),...L.footer?[{id:L.footer.id,type:L.footer.type,scope:"global",title:"Footer"}]:[]]:[];g.useEffect(()=>{const z=ji(e,v);z&&S(JSON.parse(JSON.stringify(z))),W(null),A(null),E(!1)},[v,e]);const De=g.useCallback(()=>{const z=ji(e,v);z&&S(JSON.parse(JSON.stringify(z))),W(null),A(null),E(!1)},[v,e]),Re=g.useCallback((z,O,Y)=>{const q=[...Y.sections],Z=q.findIndex(ue=>ue.id===z);if(Z===-1||O<0||O>=q.length)return;const[ae]=q.splice(Z,1),ge=O>Z?O-1:O;q.splice(Math.min(ge,q.length),0,ae);const pe={...Y,sections:q};S(pe),E(!0),Ne.current&&Ne.current.emitUpdate(pe,$.current)},[]),Be=g.useCallback(z=>{if(z.origin!==window.location.origin)return;if(z.data.type===ye.SECTION_SELECT){W(z.data.section);const Y=z.data.itemPath;Array.isArray(Y)&&Y.length>0?A(Y.map(q=>({fieldKey:q.fieldKey,...q.itemId!=null?{itemId:String(q.itemId)}:{}}))):A(null)}const O=(Y,q)=>{Ne.current&&Y&&Ne.current.emitUpdate(Y,q)};if(z.data.type===ye.INLINE_FIELD_UPDATE){const Y=typeof z.data.sectionId=="string"?z.data.sectionId:null,q=typeof z.data.fieldKey=="string"?z.data.fieldKey:null;Y&&q&&(S(Z=>{if(!Z)return Z;const ae={...Z,sections:Z.sections.map(ge=>ge.id===Y?{...ge,data:{...ge.data,[q]:z.data.value}}:ge)};return ee.current=ae,O(ae,$.current),ae}),E(!0))}if(z.data.type===ye.ACTIVE_SECTION_CHANGED&&oe(z.data.activeSectionId??null),z.data.type==="jsonpages:section-reorder"&&ee.current){const{sectionId:Y,newIndex:q}=z.data;typeof Y=="string"&&typeof q=="number"&&q>=0&&Re(Y,q,ee.current)}if(z.data.type===ye.WEBMCP_TOOL_CALL){const Y=typeof z.data.requestId=="string"?z.data.requestId:crypto.randomUUID(),q=typeof z.data.toolName=="string"?z.data.toolName:"";ne(q,z.data.args).then(Z=>{window.postMessage({type:ye.WEBMCP_TOOL_RESULT,requestId:Y,toolName:q,result:Z,ok:!0},window.location.origin)}).catch(Z=>{const ae=Z instanceof Error?Z.message:String(Z);window.postMessage({type:ye.WEBMCP_TOOL_RESULT,requestId:Y,toolName:q,ok:!1,error:ae},window.location.origin)})}},[Re,ne]);g.useEffect(()=>(window.addEventListener("message",Be),()=>window.removeEventListener("message",Be)),[Be]);const Ne=g.useRef(null);g.useEffect(()=>{if(!(u!=null&&u.enabled))return;const{emitUpdate:z,disconnect:O}=C0((Y,q)=>{S(Y),K(q),E(!0)});return Ne.current={emitUpdate:z,disconnect:O},()=>{O(),Ne.current=null}},[u==null?void 0:u.enabled]),g.useEffect(()=>{if(!(u!=null&&u.enabled)||(ro(),!ee.current))return;const O=Ei({name:Wr,description:`Update any section in OlonJS Studio's in-memory draft state. Does NOT persist to disk. Use "sectionType" in input args to ensure correct schema validation.`,inputSchema:jc(),execute:q=>ne(Wr,q)}),Y=Ei({name:to,description:`Persist the current in-memory draft state to disk. Call this after making one or more updates via ${Wr}.`,inputSchema:Nc(),execute:q=>ne(to,q)});return()=>{O(),Y()}},[u==null?void 0:u.enabled,v,x,L,ne]);const Xe=g.useCallback(z=>{const O=we.find(Y=>Y.id===z);O&&W({id:O.id,type:O.type,scope:O.scope}),A(null),F(z)},[we]),He=g.useCallback(()=>{F(null)},[]),Ve=g.useCallback(z=>{S(O=>{if(!O)return O;const Y={...O,sections:O.sections.filter(q=>q.id!==z)};return Ne.current&&Ne.current.emitUpdate(Y,$.current),Y}),E(!0),W(O=>(O==null?void 0:O.id)===z?null:O)},[]),gt=z=>{if(!B||!x)return;E(!0);let O=x,Y=L;if(B.scope==="global")B.type==="header"&&L.header!=null?(Y={...L,header:{...L.header,data:z}},K(Y)):B.type==="footer"&&L.footer!=null&&(Y={...L,footer:{...L.footer,data:z}},K(Y));else{const q=x.sections.map(Z=>Z.id===B.id?{...Z,data:z}:Z);O={...x,sections:q},S(O)}Ne.current&&Ne.current.emitUpdate(O,Y)},Tt=g.useCallback((z,O,Y,q)=>{var ge,pe;E(!0);let Z=ee.current,ae=$.current;if(O==="global")((ge=ae.header)==null?void 0:ge.id)===z?(ae={...ae,header:{...ae.header,data:q}},K(ae)):((pe=ae.footer)==null?void 0:pe.id)===z&&(ae={...ae,footer:{...ae.footer,data:q}},K(ae));else if(Z){const ue=Z.sections.map(ze=>ze.id===z?{...ze,data:q}:ze);Z={...Z,sections:ue},S(Z)}Ne.current&&Z&&Ne.current.emitUpdate(Z,ae)},[]),Qe=g.useCallback(async()=>{const z=document.querySelector("iframe");if(!(z!=null&&z.contentWindow))return;const O=crypto.randomUUID();await new Promise(Y=>{var ae;let q=!1;const Z=ge=>{var pe,ue;ge.origin===window.location.origin&&((pe=ge.data)==null?void 0:pe.type)===ye.INLINE_FLUSHED&&((ue=ge.data)==null?void 0:ue.requestId)===O&&(q=!0,window.removeEventListener("message",Z),Y())};window.addEventListener("message",Z),(ae=z.contentWindow)==null||ae.postMessage({type:ye.REQUEST_INLINE_FLUSH,requestId:O},"*"),window.setTimeout(()=>{q||(window.removeEventListener("message",Z),Y())},400)})},[]),cr=g.useCallback(async(z,O)=>{var ae;if(!f)throw new Error("saveToFile is not configured for this tenant.");const Y=Ot({pages:{[v]:z},siteConfig:O,themeConfig:o,menuConfig:n,refDocuments:i}),q=(ae=Y.siteConfig.header)==null?void 0:ae.data,Z={page:z,site:O,menu:{main:Ni(q,n.main)},theme:Y.themeConfig};await f(Z,v),E(!1),j(!0),typeof window<"u"&&window.setTimeout(()=>j(!1),2500)},[f,v,o,n,i]),_=g.useCallback(async z=>{var ze,it;if(!f)throw new Error("WebMCP requires saveToFile persistence in Studio mode.");if(!Ti(z)||typeof z.sectionId!="string")throw new Error("WebMCP mutation requires a sectionId.");const O=z,Y=typeof O.slug=="string"?Ur(O.slug):v;if(Y!==v)throw new Error(`WebMCP slug mismatch. Active Studio slug is "${v}", received "${Y}".`);await Qe();const q=ee.current,Z=$.current;if(!q)throw new Error("Studio draft is not ready yet.");const ae=O.scope==="global"?"global":"local";let ge=q,pe=Z,ue=O.sectionType;if(ae==="global"){const xe=((ze=Z.header)==null?void 0:ze.id)===O.sectionId?Z.header:((it=Z.footer)==null?void 0:it.id)===O.sectionId?Z.footer:null;if(!xe)throw new Error(`Global section "${O.sectionId}" was not found.`);if(!ue)ue=xe.type;else if(xe.type!==ue)throw new Error(`Section "${O.sectionId}" is type "${xe.type}", not "${ue}".`);const Te=t[ue];if(!Te||typeof Te.parse!="function")throw new Error(`Missing schema for section type "${ue}".`);const Ke=Ti(xe.data)?xe.data:{},ut=Ci(Ke,O),Ae=Te.parse(ut),$e={...xe,data:Ae};pe={...Z,...xe.type==="header"?{header:$e}:{footer:$e}},$.current=pe,K(pe)}else{const xe=q.sections.find($e=>$e.id===O.sectionId);if(!xe)throw new Error(`Local section "${O.sectionId}" was not found in page "${v}".`);if(!ue)ue=xe.type;else if(xe.type!==ue)throw new Error(`Section "${O.sectionId}" is type "${xe.type}", not "${ue}".`);const Te=t[ue];if(!Te||typeof Te.parse!="function")throw new Error(`Missing schema for section type "${ue}".`);const Ke=Ti(xe.data)?xe.data:{},ut=Ci(Ke,O),Ae=Te.parse(ut);ge={...q,sections:q.sections.map($e=>$e.id===O.sectionId?{...$e,data:Ae}:$e)},ee.current=ge,S(ge)}return W({id:O.sectionId,type:ue,scope:ae}),A(Array.isArray(O.itemPath)?O.itemPath:null),E(!0),{content:[{type:"text",text:JSON.stringify({ok:!0,slug:v,sectionId:O.sectionId,sectionType:ue,scope:ae,action:"draft_updated"})}],isError:!1}},[f,v,Qe,t]),re=g.useCallback(async z=>{if(!f)throw new Error("WebMCP requires saveToFile persistence in Studio mode.");await Qe();const O=ee.current,Y=$.current;if(!O)throw new Error("Studio draft is not ready yet.");return await cr(O,Y),{content:[{type:"text",text:JSON.stringify({ok:!0,slug:v,action:"saved_to_disk"})}],isError:!1}},[f,v,Qe,cr]);async function ne(z,O){if(z===Wr)return _(O);if(z===to)return re(O);throw new Error(`Unknown WebMCP tool "${z}".`)}const he=async()=>{var ae;if(!f)return;await Qe();const z=ee.current,O=$.current;if(!z)return;const Y=Ot({pages:{[v]:z},siteConfig:O,themeConfig:o,menuConfig:n,refDocuments:i}),q=(ae=Y.siteConfig.header)==null?void 0:ae.data,Z={page:z,site:O,menu:{main:Ni(q,n.main)},theme:Y.themeConfig};f(Z,v).then(()=>{E(!1),j(!0),typeof window<"u"&&window.setTimeout(()=>j(!1),2500)}).catch(ge=>{console.error("[JsonPages] saveToFile failed",ge);const pe=ge instanceof Error?ge.message:String(ge);alert(`Save to file failed: ${pe}`)})},Le=async()=>{var ae;if(!h)return;await Qe();const z=ee.current,O=$.current;if(!z)return;const Y=Ot({pages:{[v]:z},siteConfig:O,themeConfig:o,menuConfig:n,refDocuments:i}),q=(ae=Y.siteConfig.header)==null?void 0:ae.data,Z={page:z,site:O,menu:{main:Ni(q,n.main)},theme:Y.themeConfig};R(!0),h(Z,v).then(()=>{E(!1),M(!0),typeof window<"u"&&window.setTimeout(()=>M(!1),2500)}).catch(ge=>{console.error("[JsonPages] hotSave failed",ge);const pe=ge instanceof Error?ge.message:String(ge);alert(`Hot save failed: ${pe}`)}).finally(()=>{R(!1)})},Ce=z=>{var Z;if(!x)return;const O=((Z=l==null?void 0:l.getDefaultSectionData)==null?void 0:Z.call(l,z))??{},Y={id:crypto.randomUUID(),type:z,data:O,settings:void 0},q={...x,sections:[...x.sections,Y]};S(q),E(!0),W({id:Y.id,type:z,scope:"local"}),Ne.current&&Ne.current.emitUpdate(q,$.current)};if(g.useEffect(()=>{var q,Z;const z=Q??x,O=typeof((q=z==null?void 0:z.meta)==null?void 0:q.title)=="string"?z.meta.title:v,Y=typeof((Z=z==null?void 0:z.meta)==null?void 0:Z.description)=="string"?z.meta.description:"";no("mcp-manifest",Pc(v)),no("olon-contract",Oc(v)),zc(O,Y,`/admin${v==="home"?"":`/${v}`}`)},[x,Q,v]),!x)return c.jsx("div",{children:"Loading Studio..."});const _e=(B==null?void 0:B.scope)==="global"?{sections:[P.siteConfig.header,P.siteConfig.footer].filter(z=>z!=null)}:Q??x,dr=[...P.siteConfig.header?[P.siteConfig.header]:[],...((Ee=Q??x)==null?void 0:Ee.sections)??[],...P.siteConfig.footer?[P.siteConfig.footer]:[]];return c.jsx(sn,{mode:"admin",tenantCss:s,adminCss:a,children:c.jsx(Jr,{mode:"studio",children:c.jsxs("div",{className:"flex flex-col h-screen w-screen bg-background text-foreground overflow-hidden",children:[c.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[c.jsx("main",{className:"flex-1 min-w-0 relative bg-zinc-900/50 overflow-hidden",children:c.jsx(vc,{draft:Q??x,globalDraft:P.siteConfig,menuConfig:P.menuConfig,themeConfig:P.themeConfig,slug:v,selectedId:B==null?void 0:B.id,scrollToSectionId:T,onScrollRequested:He})}),c.jsxs("div",{className:"flex shrink-0 relative h-full z-10",style:{width:ve,minWidth:ie,maxWidth:te},children:[c.jsx("div",{role:"separator","aria-label":"Resize inspector",className:"absolute left-0 top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-primary/40 active:bg-primary/60 transition-colors shrink-0",style:{zIndex:9999},onPointerDown:ke}),c.jsx(bc,{selectedSection:B,pageData:_e,allSectionsData:dr,onUpdate:gt,onUpdateSection:Tt,onClose:()=>{W(null),A(null)},expandedItemPath:U,onReorderSection:x?(z,O)=>Re(z,O,x):void 0,allLayers:we,activeSectionId:J,onRequestScrollToSection:Xe,onDeleteSection:x?Ve:void 0,onAddSection:d.length>0?()=>G(!0):void 0,hasChanges:C,onSaveToFile:f!=null?he:void 0,saveSuccessFeedback:N,onHotSave:h!=null?Le:void 0,hotSaveSuccessFeedback:D,hotSaveInProgress:I,showLegacySave:p,showHotSave:w,onResetToFile:De,pageSlugs:k,currentSlug:v,onPageChange:k.length>1?z=>{const O=Ur(z);y(O==="home"?"/admin":`/admin/${O}`)}:void 0})]})]}),c.jsx(kc,{open:X,onClose:()=>G(!1),sectionTypes:d,sectionTypeLabels:l==null?void 0:l.sectionTypeLabels,onSelect:Ce})]})})})},_c=({tenantCss:e,adminCss:t})=>c.jsx(sn,{mode:"tenant",tenantCss:e,adminCss:t,children:c.jsx(yc,{})});function N0({config:e}){var k,x,S,C,E;const{registry:t={},schemas:r={},pages:n={},siteConfig:o,themeConfig:i,menuConfig:s,refDocuments:a,themeCss:l,addSection:d,NotFoundComponent:u=Sc}=e,f=(d==null?void 0:d.addableSectionTypes)??Object.keys(r).filter(N=>N!=="header"&&N!=="footer"),h={saveToFile:(k=e.persistence)==null?void 0:k.saveToFile,hotSave:(x=e.persistence)==null?void 0:x.hotSave,showLegacySave:((S=e.persistence)==null?void 0:S.showLegacySave)??!0,showHotSave:((C=e.persistence)==null?void 0:C.showHotSave)??!1},p=typeof(l==null?void 0:l.tenant)=="string"?l.tenant:"",w=typeof(l==null?void 0:l.admin)=="string"?l.admin:E0,m=g.useMemo(()=>Ot({pages:n,siteConfig:o,themeConfig:i,menuConfig:s,refDocuments:a}),[n,o,i,s,a]),[v,y]=g.useState(!1);return g.useEffect(()=>{var N,j;try{(N=m.themeConfig)!=null&&N.tokens&&eo.setTheme(m.themeConfig)}catch(D){console.warn("[JsonPages] setTheme failed",D)}(j=e.webmcp)!=null&&j.enabled&&ro(),y(!0)},[m.themeConfig,(E=e.webmcp)==null?void 0:E.enabled]),v?c.jsx(j0,{children:c.jsx(es,{config:{registry:t,schemas:r,tenantId:e.tenantId??"default",assets:e.assets,overlayDisabledSectionTypes:e.overlayDisabledSectionTypes},children:c.jsx(Je.BrowserRouter,{children:c.jsxs(Je.Routes,{children:[c.jsx(Je.Route,{path:"/",element:c.jsx(Ic,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:m.themeConfig,refDocuments:a,tenantCss:p,adminCss:w,NotFoundComponent:u})}),c.jsx(Je.Route,{path:"/*",element:c.jsx(Ic,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:m.themeConfig,refDocuments:a,tenantCss:p,adminCss:w,NotFoundComponent:u})}),c.jsx(Je.Route,{path:"/admin",element:c.jsx(Dc,{pageRegistry:n,schemas:r,siteConfig:o,menuConfig:s,themeConfig:m.themeConfig,refDocuments:a,tenantCss:p,adminCss:w,addSectionConfig:d,addableSectionTypes:f,webMcp:e.webmcp,saveToFile:h.saveToFile,hotSave:h.hotSave,showLegacySave:h.showLegacySave,showHotSave:h.showHotSave})}),c.jsx(Je.Route,{path:"/admin/*",element:c.jsx(Dc,{pageRegistry:n,schemas:r,siteConfig:o,menuConfig:s,themeConfig:m.themeConfig,refDocuments:a,tenantCss:p,adminCss:w,addSectionConfig:d,addableSectionTypes:f,webMcp:e.webmcp,saveToFile:h.saveToFile,hotSave:h.hotSave,showLegacySave:h.showLegacySave,showHotSave:h.showHotSave})}),c.jsx(Je.Route,{path:"/admin/preview",element:c.jsx(_c,{tenantCss:p,adminCss:w})}),c.jsx(Je.Route,{path:"/admin/preview/*",element:c.jsx(_c,{tenantCss:p,adminCss:w})}),c.jsx(Je.Route,{path:"*",element:c.jsx(u,{})})]})})})}):c.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#0f172a",color:"#94a3b8",fontFamily:"ui-sans-serif, system-ui, sans-serif",fontSize:14},children:"Loading..."})}ce.AddSectionLibrary=kc,ce.AdminSidebar=bc,ce.ConfigProvider=es,ce.DefaultNotFound=Sc,ce.FormFactory=Dr,ce.InputWidgets=or,ce.JsonPagesEngine=N0,ce.PageRenderer=ho,ce.PreviewEntry=yc,ce.STUDIO_EVENTS=ye,ce.SectionRenderer=mr,ce.StudioProvider=Jr,ce.StudioStage=vc,ce.ThemeLoader=sn,ce.WEBMCP_TOOL_SAVE=to,ce.WEBMCP_TOOL_UPDATE=Wr,ce.applyValueAtSelectionPath=Si,ce.cn=se,ce.createWebMcpSaveToolInputSchema=Nc,ce.createWebMcpUpdateToolInputSchema=jc,ce.ensureWebMcpRuntime=ro,ce.registerWebMcpTool=Ei,ce.resolveAssetUrl=Hl,ce.resolveHeaderMenuItems=nn,ce.resolveRuntimeConfig=Ot,ce.resolveSectionMenuItems=on,ce.resolveWebMcpMutationData=Ci,ce.shouldRenderSiteGlobalHeader=Pi,ce.themeManager=eo,ce.useConfig=hr,ce.useStudio=rs,Object.defineProperty(ce,Symbol.toStringTag,{value:"Module"})}));
|
|
226
|
+
`)},Hx=0,un=[];function Vx(e){var t=q.useRef([]),r=q.useRef([0,0]),n=q.useRef(),s=q.useState(Hx++)[0],o=q.useState(xf)[0],i=q.useRef(e);q.useEffect(function(){i.current=e},[e]),q.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=fx([e.lockRef.current],(e.shards||[]).map(If),!0).filter(Boolean);return m.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=q.useCallback(function(m,b){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var S=li(m),g=r.current,w="deltaX"in m?m.deltaX:g[0]-S[0],_="deltaY"in m?m.deltaY:g[1]-S[1],x,I=m.target,C=Math.abs(w)>Math.abs(_)?"h":"v";if("touches"in m&&C==="h"&&I.type==="range")return!1;var A=window.getSelection(),O=A&&A.anchorNode,j=O?O===I||O.contains(I):!1;if(j)return!1;var R=Ef(C,I);if(!R)return!0;if(R?x=C:(x=C==="v"?"h":"v",R=Ef(C,I)),!R)return!1;if(!n.current&&"changedTouches"in m&&(w||_)&&(n.current=x),!x)return!0;var T=n.current||x;return Wx(T,b,m,T==="h"?w:_)},[]),l=q.useCallback(function(m){var b=m;if(!(!un.length||un[un.length-1]!==o)){var S="deltaY"in b?Cf(b):li(b),g=t.current.filter(function(x){return x.name===b.type&&(x.target===b.target||b.target===x.shadowParent)&&$x(x.delta,S)})[0];if(g&&g.should){b.cancelable&&b.preventDefault();return}if(!g){var w=(i.current.shards||[]).map(If).filter(Boolean).filter(function(x){return x.contains(b.target)}),_=w.length>0?a(b,w[0]):!i.current.noIsolation;_&&b.cancelable&&b.preventDefault()}}},[]),c=q.useCallback(function(m,b,S,g){var w={name:m,delta:b,target:S,should:g,shadowParent:Kx(S)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(_){return _!==w})},1)},[]),u=q.useCallback(function(m){r.current=li(m),n.current=void 0},[]),d=q.useCallback(function(m){c(m.type,Cf(m),m.target,a(m,e.lockRef.current))},[]),f=q.useCallback(function(m){c(m.type,li(m),m.target,a(m,e.lockRef.current))},[]);q.useEffect(function(){return un.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,cn),document.addEventListener("touchmove",l,cn),document.addEventListener("touchstart",u,cn),function(){un=un.filter(function(m){return m!==o}),document.removeEventListener("wheel",l,cn),document.removeEventListener("touchmove",l,cn),document.removeEventListener("touchstart",u,cn)}},[]);var h=e.removeScrollBar,y=e.inert;return q.createElement(q.Fragment,null,y?q.createElement(o,{styles:qx(s)}):null,h?q.createElement(Mx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Kx(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Gx=_x(wf,Vx);var aa=q.forwardRef(function(e,t){return q.createElement(si,qt({},e,{ref:t,sideCar:Gx}))});aa.classNames=si.classNames;var Yx=[" ","Enter","ArrowUp","ArrowDown"],Jx=[" ","Enter"],Rr="Select",[ci,ui,Qx]=p0(Rr),[dn]=Wn(Rr,[Qx,sn]),di=sn(),[Xx,gr]=dn(Rr),[Zx,e1]=dn(Rr),Tf=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:o,value:i,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:f,required:h,form:y}=e,m=di(t),[b,S]=q.useState(null),[g,w]=q.useState(null),[_,x]=q.useState(!1),I=m0(c),[C,A]=ti({prop:n,defaultProp:s??!1,onChange:o,caller:Rr}),[O,j]=ti({prop:i,defaultProp:a,onChange:l,caller:Rr}),R=q.useRef(null),T=b?y||!!b.closest("form"):!0,[D,H]=q.useState(new Set),U=Array.from(D).map(ae=>ae.props.value).join(";");return k.jsx(Zs,{...m,children:k.jsxs(Xx,{required:h,scope:t,trigger:b,onTriggerChange:S,valueNode:g,onValueNodeChange:w,valueNodeHasChildren:_,onValueNodeHasChildrenChange:x,contentId:$n(),value:O,onValueChange:j,open:C,onOpenChange:A,dir:I,triggerPointerDownPosRef:R,disabled:f,children:[k.jsx(ci.Provider,{scope:t,children:k.jsx(Zx,{scope:e.__scopeSelect,onNativeOptionAdd:q.useCallback(ae=>{H(J=>new Set(J).add(ae))},[]),onNativeOptionRemove:q.useCallback(ae=>{H(J=>{const M=new Set(J);return M.delete(ae),M})},[]),children:r})}),T?k.jsxs(Yf,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:O,onChange:ae=>j(ae.target.value),disabled:f,form:y,children:[O===void 0?k.jsx("option",{value:""}):null,Array.from(D)]},U):null]})})};Tf.displayName=Rr;var jf="SelectTrigger",Of=q.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=di(r),i=gr(jf,r),a=i.disabled||n,l=ft(t,i.onTriggerChange),c=ui(r),u=q.useRef("touch"),[d,f,h]=Qf(m=>{const b=c().filter(w=>!w.disabled),S=b.find(w=>w.value===i.value),g=Xf(b,m,S);g!==void 0&&i.onValueChange(g.value)}),y=m=>{a||(i.onOpenChange(!0),h()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return k.jsx(Zo,{asChild:!0,...o,children:k.jsx(ct.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Jf(i.value)?"":void 0,...s,ref:l,onClick:tt(s.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&y(m)}),onPointerDown:tt(s.onPointerDown,m=>{u.current=m.pointerType;const b=m.target;b.hasPointerCapture(m.pointerId)&&b.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(y(m),m.preventDefault())}),onKeyDown:tt(s.onKeyDown,m=>{const b=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&f(m.key),!(b&&m.key===" ")&&Yx.includes(m.key)&&(y(),m.preventDefault())})})})});Of.displayName=jf;var Pf="SelectValue",Nf=q.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:i="",...a}=e,l=gr(Pf,r),{onValueNodeHasChildrenChange:c}=l,u=o!==void 0,d=ft(t,l.onValueNodeChange);return wt(()=>{c(u)},[c,u]),k.jsx(ct.span,{...a,ref:d,style:{pointerEvents:"none"},children:Jf(l.value)?k.jsx(k.Fragment,{children:i}):o})});Nf.displayName=Pf;var t1="SelectIcon",Rf=q.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return k.jsx(ct.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});Rf.displayName=t1;var r1="SelectPortal",Mf=e=>k.jsx(ei,{asChild:!0,...e});Mf.displayName=r1;var Mr="SelectContent",Df=q.forwardRef((e,t)=>{const r=gr(Mr,e.__scopeSelect),[n,s]=q.useState();if(wt(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?ho.createPortal(k.jsx(Lf,{scope:e.__scopeSelect,children:k.jsx(ci.Slot,{scope:e.__scopeSelect,children:k.jsx("div",{children:e.children})})}),o):null}return k.jsx(zf,{...e,ref:t})});Df.displayName=Mr;var Lt=10,[Lf,mr]=dn(Mr),n1="SelectContentImpl",o1=en("SelectContent.RemoveScroll"),zf=q.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:y,hideWhenDetached:m,avoidCollisions:b,...S}=e,g=gr(Mr,r),[w,_]=q.useState(null),[x,I]=q.useState(null),C=ft(t,L=>_(L)),[A,O]=q.useState(null),[j,R]=q.useState(null),T=ui(r),[D,H]=q.useState(!1),U=q.useRef(!1);q.useEffect(()=>{if(w)return mf(w)},[w]),Cd();const ae=q.useCallback(L=>{const[W,...le]=T().map(ne=>ne.ref.current),[$]=le.slice(-1),ee=document.activeElement;for(const ne of L)if(ne===ee||(ne==null||ne.scrollIntoView({block:"nearest"}),ne===W&&x&&(x.scrollTop=0),ne===$&&x&&(x.scrollTop=x.scrollHeight),ne==null||ne.focus(),document.activeElement!==ee))return},[T,x]),J=q.useCallback(()=>ae([A,w]),[ae,A,w]);q.useEffect(()=>{D&&J()},[D,J]);const{onOpenChange:M,triggerPointerDownPosRef:ce}=g;q.useEffect(()=>{if(w){let L={x:0,y:0};const W=$=>{var ee,ne;L={x:Math.abs(Math.round($.pageX)-(((ee=ce.current)==null?void 0:ee.x)??0)),y:Math.abs(Math.round($.pageY)-(((ne=ce.current)==null?void 0:ne.y)??0))}},le=$=>{L.x<=10&&L.y<=10?$.preventDefault():w.contains($.target)||M(!1),document.removeEventListener("pointermove",W),ce.current=null};return ce.current!==null&&(document.addEventListener("pointermove",W),document.addEventListener("pointerup",le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",le,{capture:!0})}}},[w,M,ce]),q.useEffect(()=>{const L=()=>M(!1);return window.addEventListener("blur",L),window.addEventListener("resize",L),()=>{window.removeEventListener("blur",L),window.removeEventListener("resize",L)}},[M]);const[Q,B]=Qf(L=>{const W=T().filter(ee=>!ee.disabled),le=W.find(ee=>ee.ref.current===document.activeElement),$=Xf(W,L,le);$&&setTimeout(()=>$.ref.current.focus())}),N=q.useCallback((L,W,le)=>{const $=!U.current&&!le;(g.value!==void 0&&g.value===W||$)&&(O(L),$&&(U.current=!0))},[g.value]),Y=q.useCallback(()=>w==null?void 0:w.focus(),[w]),ue=q.useCallback((L,W,le)=>{const $=!U.current&&!le;(g.value!==void 0&&g.value===W||$)&&R(L)},[g.value]),X=n==="popper"?la:Bf,we=X===la?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:y,hideWhenDetached:m,avoidCollisions:b}:{};return k.jsx(Lf,{scope:r,content:w,viewport:x,onViewportChange:I,itemRefCallback:N,selectedItem:A,onItemLeave:Y,itemTextRefCallback:ue,focusSelectedItem:J,selectedItemText:j,position:n,isPositioned:D,searchRef:Q,children:k.jsx(aa,{as:o1,allowPinchZoom:!0,children:k.jsx(Bs,{asChild:!0,trapped:g.open,onMountAutoFocus:L=>{L.preventDefault()},onUnmountAutoFocus:tt(s,L=>{var W;(W=g.trigger)==null||W.focus({preventScroll:!0}),L.preventDefault()}),children:k.jsx(Wo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:L=>L.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:k.jsx(X,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:L=>L.preventDefault(),...S,...we,onPlaced:()=>H(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:tt(S.onKeyDown,L=>{const W=L.ctrlKey||L.altKey||L.metaKey;if(L.key==="Tab"&&L.preventDefault(),!W&&L.key.length===1&&B(L.key),["ArrowUp","ArrowDown","Home","End"].includes(L.key)){let $=T().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);if(["ArrowUp","End"].includes(L.key)&&($=$.slice().reverse()),["ArrowUp","ArrowDown"].includes(L.key)){const ee=L.target,ne=$.indexOf(ee);$=$.slice(ne+1)}setTimeout(()=>ae($)),L.preventDefault()}})})})})})})});zf.displayName=n1;var i1="SelectItemAlignedPosition",Bf=q.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=gr(Mr,r),i=mr(Mr,r),[a,l]=q.useState(null),[c,u]=q.useState(null),d=ft(t,C=>u(C)),f=ui(r),h=q.useRef(!1),y=q.useRef(!0),{viewport:m,selectedItem:b,selectedItemText:S,focusSelectedItem:g}=i,w=q.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&m&&b&&S){const C=o.trigger.getBoundingClientRect(),A=c.getBoundingClientRect(),O=o.valueNode.getBoundingClientRect(),j=S.getBoundingClientRect();if(o.dir!=="rtl"){const ee=j.left-A.left,ne=O.left-ee,me=C.left-ne,pe=C.width+me,G=Math.max(pe,A.width),ie=window.innerWidth-Lt,he=vd(ne,[Lt,Math.max(Lt,ie-G)]);a.style.minWidth=pe+"px",a.style.left=he+"px"}else{const ee=A.right-j.right,ne=window.innerWidth-O.right-ee,me=window.innerWidth-C.right-ne,pe=C.width+me,G=Math.max(pe,A.width),ie=window.innerWidth-Lt,he=vd(ne,[Lt,Math.max(Lt,ie-G)]);a.style.minWidth=pe+"px",a.style.right=he+"px"}const R=f(),T=window.innerHeight-Lt*2,D=m.scrollHeight,H=window.getComputedStyle(c),U=parseInt(H.borderTopWidth,10),ae=parseInt(H.paddingTop,10),J=parseInt(H.borderBottomWidth,10),M=parseInt(H.paddingBottom,10),ce=U+ae+D+M+J,Q=Math.min(b.offsetHeight*5,ce),B=window.getComputedStyle(m),N=parseInt(B.paddingTop,10),Y=parseInt(B.paddingBottom,10),ue=C.top+C.height/2-Lt,X=T-ue,we=b.offsetHeight/2,L=b.offsetTop+we,W=U+ae+L,le=ce-W;if(W<=ue){const ee=R.length>0&&b===R[R.length-1].ref.current;a.style.bottom="0px";const ne=c.clientHeight-m.offsetTop-m.offsetHeight,me=Math.max(X,we+(ee?Y:0)+ne+J),pe=W+me;a.style.height=pe+"px"}else{const ee=R.length>0&&b===R[0].ref.current;a.style.top="0px";const me=Math.max(ue,U+m.offsetTop+(ee?N:0)+we)+le;a.style.height=me+"px",m.scrollTop=W-ue+m.offsetTop}a.style.margin=`${Lt}px 0`,a.style.minHeight=Q+"px",a.style.maxHeight=T+"px",n==null||n(),requestAnimationFrame(()=>h.current=!0)}},[f,o.trigger,o.valueNode,a,c,m,b,S,o.dir,n]);wt(()=>w(),[w]);const[_,x]=q.useState();wt(()=>{c&&x(window.getComputedStyle(c).zIndex)},[c]);const I=q.useCallback(C=>{C&&y.current===!0&&(w(),g==null||g(),y.current=!1)},[w,g]);return k.jsx(a1,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:I,children:k.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:k.jsx(ct.div,{...s,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Bf.displayName=i1;var s1="SelectPopperPosition",la=q.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=Lt,...o}=e,i=di(r);return k.jsx(ea,{...i,...o,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});la.displayName=s1;var[a1,ca]=dn(Mr,{}),ua="SelectViewport",Uf=q.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=mr(ua,r),i=ca(ua,r),a=ft(t,o.onViewportChange),l=q.useRef(0);return k.jsxs(k.Fragment,{children:[k.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),k.jsx(ci.Slot,{scope:r,children:k.jsx(ct.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:tt(s.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=i;if(f!=null&&f.current&&d){const h=Math.abs(l.current-u.scrollTop);if(h>0){const y=window.innerHeight-Lt*2,m=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),S=Math.max(m,b);if(S<y){const g=S+h,w=Math.min(y,g),_=g-w;d.style.height=w+"px",d.style.bottom==="0px"&&(u.scrollTop=_>0?_:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});Uf.displayName=ua;var Ff="SelectGroup",[l1,c1]=dn(Ff),u1=q.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=$n();return k.jsx(l1,{scope:r,id:s,children:k.jsx(ct.div,{role:"group","aria-labelledby":s,...n,ref:t})})});u1.displayName=Ff;var Wf="SelectLabel",d1=q.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=c1(Wf,r);return k.jsx(ct.div,{id:s.id,...n,ref:t})});d1.displayName=Wf;var fi="SelectItem",[f1,$f]=dn(fi),qf=q.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...i}=e,a=gr(fi,r),l=mr(fi,r),c=a.value===n,[u,d]=q.useState(o??""),[f,h]=q.useState(!1),y=ft(t,g=>{var w;return(w=l.itemRefCallback)==null?void 0:w.call(l,g,n,s)}),m=$n(),b=q.useRef("touch"),S=()=>{s||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return k.jsx(f1,{scope:r,value:n,disabled:s,textId:m,isSelected:c,onItemTextChange:q.useCallback(g=>{d(w=>w||((g==null?void 0:g.textContent)??"").trim())},[]),children:k.jsx(ci.ItemSlot,{scope:r,value:n,disabled:s,textValue:u,children:k.jsx(ct.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:y,onFocus:tt(i.onFocus,()=>h(!0)),onBlur:tt(i.onBlur,()=>h(!1)),onClick:tt(i.onClick,()=>{b.current!=="mouse"&&S()}),onPointerUp:tt(i.onPointerUp,()=>{b.current==="mouse"&&S()}),onPointerDown:tt(i.onPointerDown,g=>{b.current=g.pointerType}),onPointerMove:tt(i.onPointerMove,g=>{var w;b.current=g.pointerType,s?(w=l.onItemLeave)==null||w.call(l):b.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:tt(i.onPointerLeave,g=>{var w;g.currentTarget===document.activeElement&&((w=l.onItemLeave)==null||w.call(l))}),onKeyDown:tt(i.onKeyDown,g=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&g.key===" "||(Jx.includes(g.key)&&S(),g.key===" "&&g.preventDefault())})})})})});qf.displayName=fi;var Vn="SelectItemText",Hf=q.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,i=gr(Vn,r),a=mr(Vn,r),l=$f(Vn,r),c=e1(Vn,r),[u,d]=q.useState(null),f=ft(t,S=>d(S),l.onItemTextChange,S=>{var g;return(g=a.itemTextRefCallback)==null?void 0:g.call(a,S,l.value,l.disabled)}),h=u==null?void 0:u.textContent,y=q.useMemo(()=>k.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:b}=c;return wt(()=>(m(y),()=>b(y)),[m,b,y]),k.jsxs(k.Fragment,{children:[k.jsx(ct.span,{id:l.textId,...o,ref:f}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?ho.createPortal(o.children,i.valueNode):null]})});Hf.displayName=Vn;var Vf="SelectItemIndicator",Kf=q.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return $f(Vf,r).isSelected?k.jsx(ct.span,{"aria-hidden":!0,...n,ref:t}):null});Kf.displayName=Vf;var da="SelectScrollUpButton",h1=q.forwardRef((e,t)=>{const r=mr(da,e.__scopeSelect),n=ca(da,e.__scopeSelect),[s,o]=q.useState(!1),i=ft(t,n.onScrollButtonChange);return wt(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollTop>0;o(c)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?k.jsx(Gf,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});h1.displayName=da;var fa="SelectScrollDownButton",p1=q.forwardRef((e,t)=>{const r=mr(fa,e.__scopeSelect),n=ca(fa,e.__scopeSelect),[s,o]=q.useState(!1),i=ft(t,n.onScrollButtonChange);return wt(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;o(u)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?k.jsx(Gf,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});p1.displayName=fa;var Gf=q.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=mr("SelectScrollButton",r),i=q.useRef(null),a=ui(r),l=q.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return q.useEffect(()=>()=>l(),[l]),wt(()=>{var u;const c=a().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),k.jsx(ct.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:tt(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:tt(s.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:tt(s.onPointerLeave,()=>{l()})})}),g1="SelectSeparator",m1=q.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return k.jsx(ct.div,{"aria-hidden":!0,...n,ref:t})});m1.displayName=g1;var ha="SelectArrow",b1=q.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=di(r),o=gr(ha,r),i=mr(ha,r);return o.open&&i.position==="popper"?k.jsx(ta,{...s,...n,ref:t}):null});b1.displayName=ha;var y1="SelectBubbleInput",Yf=q.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const s=q.useRef(null),o=ft(n,s),i=sx(t);return q.useEffect(()=>{const a=s.current;if(!a)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==t&&u){const d=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(d)}},[i,t]),k.jsx(ct.select,{...r,style:{...hf,...r.style},ref:o,defaultValue:t})});Yf.displayName=y1;function Jf(e){return e===""||e===void 0}function Qf(e){const t=Pr(e),r=q.useRef(""),n=q.useRef(0),s=q.useCallback(i=>{const a=r.current+i;t(a),(function l(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3))})(a)},[t]),o=q.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return q.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function Xf(e,t,r){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let i=v1(e,Math.max(o,0));s.length===1&&(i=i.filter(c=>c!==r));const l=i.find(c=>c.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==r?l:void 0}function v1(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var w1=Tf,Zf=Of,x1=Nf,_1=Rf,S1=Mf,eh=Df,E1=Uf,th=qf,k1=Hf,A1=Kf;const C1=w1,I1=x1,rh=q.forwardRef(({className:e,children:t,...r},n)=>k.jsxs(Zf,{ref:n,className:Ke("flex h-8 w-full items-center justify-between gap-2 rounded-md border border-zinc-800 bg-black px-3 py-1.5 text-left text-xs font-medium text-white outline-none","hover:bg-zinc-900 focus-visible:ring-2 focus-visible:ring-blue-500/80 focus-visible:ring-inset focus-visible:border-zinc-600","disabled:pointer-events-none disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:flex [&>span]:items-center [&>span]:gap-2",e),style:{boxShadow:"none",WebkitBoxShadow:"none",MozBoxShadow:"none"},...r,children:[t,k.jsx(_1,{asChild:!0,children:k.jsx(vo,{className:"h-3 w-3 shrink-0 text-zinc-400",strokeWidth:2})})]}));rh.displayName=Zf.displayName;const nh=q.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>k.jsx(S1,{children:k.jsx(eh,{ref:s,className:Ke("relative z-[9999] max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-zinc-800 bg-zinc-950 text-white shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:k.jsx(E1,{className:Ke("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));nh.displayName=eh.displayName;const oh=q.forwardRef(({className:e,children:t,...r},n)=>k.jsxs(th,{ref:n,className:Ke("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-xs outline-none","focus:bg-zinc-800 focus:text-white data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[k.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:k.jsx(A1,{children:k.jsx(hs,{className:"h-3 w-3",strokeWidth:2})})}),k.jsx(k1,{children:t})]}));oh.displayName=th.displayName;const ih=q.createContext(null);function sh(){const e=q.useContext(ih);if(!e)throw new Error("Dialog components must be used within Dialog");return e}function ah({open:e,onOpenChange:t,children:r}){const[n,s]=q.useState(!1),o=e!==void 0,i=o?e:n,a=q.useCallback(c=>{o||s(c),t==null||t(c)},[o,t]),l=q.useMemo(()=>({open:i,onOpenChange:a}),[i,a]);return k.jsx(ih.Provider,{value:l,children:r})}function T1({asChild:e,children:t}){const{onOpenChange:r}=sh(),n=q.Children.only(t);return e&&q.isValidElement(n)?q.cloneElement(n,{onClick:s=>{var o,i;(i=(o=n.props).onClick)==null||i.call(o,s),r(!0)}}):k.jsx("button",{type:"button",onClick:()=>r(!0),children:t})}function lh({className:e,children:t,preventCloseOnBackdropClick:r,...n}){const{open:s,onOpenChange:o}=sh();if(q.useEffect(()=>{const a=l=>{l.key==="Escape"&&o(!1)};return s&&(document.addEventListener("keydown",a),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",a),document.body.style.overflow=""}},[s,o]),!s)return null;const i=a=>{a.preventDefault(),a.stopPropagation()};return Bt.createPortal(k.jsxs(k.Fragment,{children:[k.jsx("div",{className:"fixed inset-0 z-[9998] bg-black/60","aria-hidden":!0,onClick:()=>!r&&o(!1),onDragOver:i,onDrop:i}),k.jsx("div",{role:"dialog","aria-modal":!0,className:Ke("fixed left-1/2 top-1/2 z-[9999] w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 rounded-lg border border-zinc-700 bg-zinc-900 p-4 shadow-xl",e),onClick:a=>a.stopPropagation(),...n,children:t})]}),document.body)}function ch({className:e,...t}){return k.jsx("div",{className:Ke("flex flex-col gap-1.5 pb-4",e),...t})}function j1({className:e,...t}){return k.jsx("div",{className:Ke("flex justify-end gap-2 pt-4",e),...t})}function uh({className:e,...t}){return k.jsx("h2",{className:Ke("text-sm font-semibold text-white",e),...t})}function dh({className:e,...t}){return k.jsx("p",{className:Ke("text-xs text-zinc-400",e),...t})}const Ot=q.forwardRef(({className:e,variant:t="default",size:r="default",asChild:n=!1,...s},o)=>{const i="inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:shrink-0 cursor-pointer",a={default:"bg-primary text-primary-foreground shadow-lg shadow-primary/20 hover:bg-primary/90",outline:"border border-zinc-700 bg-zinc-900 text-zinc-200 hover:bg-zinc-800 hover:border-zinc-600",ghost:"text-zinc-500 hover:text-zinc-200 hover:bg-zinc-800",destructive:"bg-destructive/15 text-destructive hover:bg-destructive/25"},l={sm:"h-7 px-2.5 text-[11px]",default:"h-8 px-3 py-1.5 text-xs",lg:"h-9 px-5 text-sm",icon:"h-8 w-8","icon-sm":"h-7 w-7","icon-xs":"h-6 w-6"},c=n?l0:"button";return k.jsx(c,{ref:o,type:"button",className:Ke(i,a[t],l[r],e),...s})});Ot.displayName="Button";const O1=["library","upload","url"];function P1({library:e,selectedId:t,onSelect:r}){const[n,s]=z.useState(""),[o,i]=z.useState("all"),a=["all",...new Set(e.flatMap(c=>c.tags??[]))],l=e.filter(c=>{const u=o==="all"||(c.tags??[]).includes(o),d=!n||(c.alt??"").toLowerCase().includes(n.toLowerCase());return u&&d});return k.jsxs("div",{className:"space-y-4",children:[k.jsxs("div",{className:"relative",children:[k.jsx(Yb,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-zinc-600 pointer-events-none"}),k.jsx(Rs,{value:n,onChange:c=>s(c.target.value),placeholder:"Cerca immagini...",className:"pl-9 h-8 text-xs bg-zinc-900/50 border-zinc-800"})]}),k.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.map(c=>k.jsx("button",{type:"button",onClick:()=>i(c),className:Ke("px-2.5 py-1 rounded text-[10px] font-medium border transition-colors",o===c?"border-blue-500 bg-blue-500/20 text-blue-400":"border-zinc-700 text-zinc-500 hover:border-zinc-600 hover:text-zinc-400"),children:c==="all"?"Tutte":c},c))}),l.length>0?k.jsx("div",{className:"grid grid-cols-3 gap-2.5 max-h-[45vh] overflow-y-auto",children:l.map(c=>{const u=t===c.id;return k.jsxs("button",{type:"button",onClick:()=>r(u?null:c.id),className:Ke("group relative aspect-[4/3] rounded-lg overflow-hidden","ring-1 transition-all duration-150",u?"ring-blue-500 ring-2 ring-offset-1 ring-offset-zinc-900":"ring-zinc-800 hover:ring-zinc-600 hover:scale-[1.02]"),children:[k.jsx("img",{src:c.url,alt:c.alt,loading:"lazy",className:Ke("w-full h-full object-cover transition-[filter] duration-150",u?"brightness-[0.6]":"brightness-[0.85] group-hover:brightness-100")}),k.jsx("div",{className:Ke("absolute inset-x-0 bottom-0 px-2 py-1.5","bg-gradient-to-t from-black/70 to-transparent","opacity-0 group-hover:opacity-100 transition-opacity",u&&"opacity-100"),children:k.jsx("span",{className:"text-[10px] text-white font-medium leading-tight line-clamp-2",children:c.alt})}),u&&k.jsx("div",{className:"absolute top-2 right-2 w-6 h-6 rounded-full bg-blue-600 flex items-center justify-center",children:k.jsx(hs,{size:14,className:"text-white"})})]},c.id)})}):k.jsx("div",{className:"text-center py-12 text-zinc-600 text-xs",children:"Nessuna immagine in libreria. Configura assets.assetsManifest nel tenant (es. da public/assets)."})]})}function N1({preview:e,onPreviewChange:t,onAssetUpload:r}){const[n,s]=z.useState(!1),o=z.useRef(null),i=z.useCallback(async u=>{if(fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:handleFile",message:"handleFile called",data:{fileName:u.name,hasOnAssetUpload:!!r},timestamp:Date.now(),hypothesisId:"H5"})}).catch(()=>{}),!u.type.startsWith("image/"))return;if(r){try{const f=await r(u);fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:handleFile",message:"onAssetUpload resolved",data:{url:f==null?void 0:f.slice(0,50)},timestamp:Date.now(),hypothesisId:"H2,H5"})}).catch(()=>{}),t({name:u.name,size:u.size,dataUrl:f})}catch{const f=new FileReader;f.onload=h=>{var y;t({name:u.name,size:u.size,dataUrl:(y=h.target)==null?void 0:y.result})},f.readAsDataURL(u)}return}const d=new FileReader;d.onload=f=>{var h;t({name:u.name,size:u.size,dataUrl:(h=f.target)==null?void 0:h.result})},d.readAsDataURL(u)},[t,r]),a=z.useCallback(u=>{var f,h;u.preventDefault(),u.stopPropagation(),s(!1);const d=(h=(f=u.dataTransfer)==null?void 0:f.files)==null?void 0:h[0];d&&i(d)},[i]),l=z.useCallback(u=>{u.preventDefault(),u.stopPropagation(),s(!0)},[]),c=z.useCallback(u=>{var f;const d=(f=u.target.files)==null?void 0:f[0];d&&i(d)},[i]);return k.jsxs("div",{onDragOver:l,onDragEnter:l,onDragLeave:u=>{u.preventDefault(),u.stopPropagation(),s(!1)},onDrop:a,onClick:()=>{var u;return!e&&((u=o.current)==null?void 0:u.click())},className:Ke("rounded-xl border-2 border-dashed transition-all min-h-[240px]","flex flex-col items-center justify-center overflow-hidden cursor-pointer relative",n?"border-blue-500/50 bg-blue-500/[0.04]":e?"border-zinc-800 bg-transparent cursor-default":"border-zinc-800 bg-white/[0.01] hover:border-zinc-600 hover:bg-white/[0.02]"),children:[e?k.jsxs(k.Fragment,{children:[k.jsx("img",{src:e.dataUrl,alt:"Upload preview",className:"w-full max-h-[320px] object-contain"}),k.jsxs("div",{className:"absolute bottom-0 inset-x-0 bg-gradient-to-t from-black/80 to-transparent p-4 flex items-center justify-between",children:[k.jsxs("div",{children:[k.jsx("p",{className:"text-xs font-medium text-white",children:e.name}),k.jsxs("p",{className:"text-[10px] text-zinc-400",children:[(e.size/1024).toFixed(1)," KB"]})]}),k.jsx(Ot,{type:"button",variant:"ghost",className:"text-zinc-400 hover:text-red-400 hover:bg-red-500/10 h-8 w-8 p-0",onClick:u=>{u.stopPropagation(),t(null)},children:k.jsx(xo,{size:14})})]})]}):k.jsxs(k.Fragment,{children:[k.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/10 flex items-center justify-center text-blue-500 mb-3",children:k.jsx(Iu,{size:22})}),k.jsx("p",{className:"text-sm font-medium text-white mb-1",children:"Trascina un'immagine qui"}),k.jsx("p",{className:"text-[11px] text-zinc-500 mb-3",children:"oppure clicca per selezionare un file"}),k.jsx("span",{className:"text-[10px] text-zinc-600 bg-white/[0.03] px-3 py-1 rounded",children:"PNG, JPG, WebP — max 5MB"})]}),k.jsx("input",{ref:o,type:"file",accept:"image/*",className:"hidden",onChange:c})]})}function R1({urlPreview:e,onUrlPreviewChange:t}){const[r,n]=z.useState(""),[s,o]=z.useState(!1),i=()=>{if(r.trim())try{new URL(r),t(r),o(!1)}catch{o(!0),t(null)}};return k.jsxs("div",{className:"space-y-4",children:[k.jsxs("div",{children:[k.jsx(Or,{className:"block text-[10px] font-bold uppercase tracking-[0.08em] text-zinc-500 mb-1.5",children:"URL immagine"}),k.jsxs("div",{className:"flex gap-2",children:[k.jsx(Rs,{value:r,onChange:a=>{n(a.target.value),o(!1)},onKeyDown:a=>a.key==="Enter"&&i(),placeholder:"https://images.unsplash.com/photo-...",className:Ke("h-8 text-xs bg-zinc-900/50 border-zinc-800",s&&"border-red-500/50")}),k.jsx(Ot,{type:"button",variant:"outline",onClick:i,className:"shrink-0 h-8",children:"Anteprima"})]}),s&&k.jsx("p",{className:"text-[11px] text-red-400 mt-1.5",children:"URL non valido. Inserisci un URL completo (https://…)"})]}),e?k.jsxs("div",{className:"rounded-lg overflow-hidden ring-1 ring-zinc-800",children:[k.jsx("img",{src:e,alt:"URL preview",className:"w-full max-h-[320px] object-contain bg-black/30",onError:()=>{o(!0),t(null)}}),k.jsxs("div",{className:"px-3.5 py-2.5 bg-white/[0.02] border-t border-zinc-800 flex items-center gap-2",children:[k.jsx(hs,{size:14,className:"text-emerald-400"}),k.jsx("span",{className:"text-[11px] text-zinc-500",children:"Immagine caricata correttamente"})]})]}):s?null:k.jsxs("div",{className:"flex flex-col items-center py-12 text-zinc-600",children:[k.jsx(Au,{size:32,className:"mb-3 opacity-40"}),k.jsx("p",{className:"text-xs",children:"Incolla un URL e premi Anteprima per verificare"})]})]})}const M1=({open:e,onOpenChange:t,onSelect:r})=>{const{assets:n}=Cn(),s=(n==null?void 0:n.assetsManifest)??[],[o,i]=z.useState("library"),[a,l]=z.useState(null),[c,u]=z.useState(null),[d,f]=z.useState(null);z.useEffect(()=>{e&&(i("library"),l(null),u(null),f(null))},[e]),z.useEffect(()=>{if(!e||o!=="upload")return;const S=()=>{fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:beforeunload",message:"beforeunload fired",data:{},timestamp:Date.now(),hypothesisId:"H1"})}).catch(()=>{})};return window.addEventListener("beforeunload",S),()=>window.removeEventListener("beforeunload",S)},[e,o]),z.useEffect(()=>{if(!e||o!=="upload")return;const S=w=>{w.preventDefault()},g={capture:!0};return document.addEventListener("dragover",S,g),document.addEventListener("drop",S,g),window.addEventListener("dragover",S,g),window.addEventListener("drop",S,g),()=>{document.removeEventListener("dragover",S,g),document.removeEventListener("drop",S,g),window.removeEventListener("dragover",S,g),window.removeEventListener("drop",S,g)}},[e,o]);const h=o==="library"&&a!=null||o==="upload"&&c!=null||o==="url"&&d!=null,y=()=>{if(o==="library"&&a){const S=s.find(g=>g.id===a);S&&r({url:S.url,alt:S.alt})}else o==="upload"&&c?r({url:c.dataUrl,alt:c.name}):o==="url"&&d&&r({url:d,alt:""});setTimeout(()=>t(!1),0)},m=o==="library"&&a?"1 immagine selezionata":o==="upload"&&c?c.name:o==="url"&&d?"URL pronto":"Nessuna selezione",b=S=>{S.preventDefault(),S.stopPropagation()};return k.jsx(ah,{open:e,onOpenChange:t,children:k.jsxs(lh,{className:"max-w-2xl p-0 gap-0 max-h-[90vh] flex flex-col",preventCloseOnBackdropClick:o==="upload",onDragOver:b,onDrop:b,children:[k.jsxs(ch,{className:"px-5 py-4 flex flex-row items-start justify-between gap-4 border-b border-zinc-800",children:[k.jsxs("div",{className:"flex items-center gap-3",children:[k.jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/15 text-blue-500",children:k.jsx(wo,{size:18})}),k.jsxs("div",{children:[k.jsx(uh,{children:"Image Picker"}),k.jsx(dh,{children:"Scegli dalla libreria, carica dal disco o inserisci un link"})]})]}),k.jsx("button",{type:"button",onClick:()=>t(!1),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Chiudi",children:k.jsx(Gr,{size:18})})]}),k.jsx("div",{className:"flex border-b border-zinc-800",children:O1.map(S=>k.jsxs("button",{type:"button",onClick:()=>i(S),className:Ke("flex items-center gap-2 px-4 py-3 text-xs font-medium border-b-2 transition-colors",o===S?"border-blue-500 text-blue-400":"border-transparent text-zinc-500 hover:text-zinc-300"),children:[S==="library"&&k.jsx(wo,{size:14}),S==="upload"&&k.jsx(Iu,{size:14}),S==="url"&&k.jsx(Au,{size:14}),S==="library"?"Libreria":S==="upload"?"Upload":"URL"]},S))}),k.jsxs("div",{className:"flex-1 overflow-y-auto p-5 min-h-0",children:[o==="library"&&k.jsx(P1,{library:s,selectedId:a,onSelect:l}),o==="upload"&&k.jsx(N1,{preview:c,onPreviewChange:u,onAssetUpload:n==null?void 0:n.onAssetUpload}),o==="url"&&k.jsx(R1,{urlPreview:d,onUrlPreviewChange:f})]}),k.jsxs(j1,{className:"px-5 py-4 border-t border-zinc-800 flex-row justify-between",children:[k.jsx("span",{className:"text-[10px] uppercase tracking-[0.05em] text-zinc-600",children:m}),k.jsxs("div",{className:"flex gap-2",children:[k.jsx(Ot,{type:"button",variant:"outline",size:"sm",onClick:()=>t(!1),children:"Annulla"}),k.jsx(Ot,{type:"button",size:"sm",disabled:!h,onClick:y,className:Ke(!h&&"opacity-40"),children:"Inserisci immagine"})]})]})]})})},fh=(e,t="default")=>{if(e.startsWith("http")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/assets/"))return e;if(e.startsWith("assets/"))return`/${e}`;if(e.startsWith("/uploaded-assets/"))return e;if(!/\.(jpg|jpeg|png|gif|svg|pdf|webp|mp4|webm|ogg)$/i.test(e))return e.startsWith("/")?e:`/${e}`;const n=e.replace(/^\//,"");return`/assets/${t}/${n}`},D1=({value:e,onChange:t,label:r="IMAGE",className:n})=>{const{tenantId:s="default"}=Cn(),[o,i]=z.useState(!1),[a,l]=z.useState(!1),c=!!(e!=null&&e.url),u=e!=null&&e.url?fh(e.url,s):"",d=h=>{t(h),i(!1)},f=h=>{h.stopPropagation(),t({url:"",alt:""})};return k.jsxs("div",{className:Ke("space-y-1.5",n),children:[k.jsx(Or,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:r}),c?k.jsxs("div",{role:"button",tabIndex:0,onClick:()=>i(!0),onKeyDown:h=>h.key==="Enter"&&i(!0),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:Ke("relative rounded-lg overflow-hidden cursor-pointer","ring-1 ring-zinc-800 transition-all",a&&"ring-blue-500/40"),children:[k.jsx("img",{src:u,alt:(e==null?void 0:e.alt)??"",className:"w-full h-40 object-cover block",onError:h=>{h.target.style.display="none"}}),k.jsx("div",{className:Ke("absolute inset-0 flex items-center justify-center gap-2 transition-all duration-150",a?"bg-black/50":"bg-black/0"),children:a&&k.jsxs(k.Fragment,{children:[k.jsxs("div",{className:"flex items-center gap-1.5 bg-white/15 backdrop-blur-md rounded-lg px-3.5 py-2 text-white text-xs font-medium",children:[k.jsx(Gb,{size:13}),k.jsx("span",{children:"Cambia"})]}),k.jsx(Ot,{type:"button",variant:"ghost",className:"h-8 w-8 p-0 bg-red-500/15 backdrop-blur-md text-red-300 hover:text-red-200 hover:bg-red-500/25",onClick:f,children:k.jsx(xo,{size:13})})]})}),k.jsx("div",{className:"px-2.5 py-1.5 bg-black/50 text-[10px] text-zinc-500 truncate",children:((e==null?void 0:e.url)??"").length>50?"…"+((e==null?void 0:e.url)??"").slice(-47):(e==null?void 0:e.url)??""})]}):k.jsxs("button",{type:"button",onClick:()=>i(!0),className:Ke("w-full rounded-lg border-2 border-dashed border-zinc-800 py-7","flex flex-col items-center gap-2","bg-white/[0.01] transition-all","hover:border-blue-500/30 hover:bg-blue-500/[0.03]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500"),children:[k.jsx("div",{className:"w-9 h-9 rounded-lg bg-blue-500/10 flex items-center justify-center text-blue-500",children:k.jsx(wo,{size:18})}),k.jsx("span",{className:"text-xs text-zinc-400 font-medium",children:"Clicca per aggiungere un'immagine"}),k.jsx("span",{className:"text-[10px] text-zinc-600",children:"Libreria · Upload · URL"})]}),k.jsx(M1,{open:o,onOpenChange:i,onSelect:d})]})},hh=[{name:"layers",Icon:gs},{name:"github",Icon:Vb},{name:"arrow-right",Icon:Ub},{name:"box",Icon:Wb},{name:"terminal",Icon:Xb},{name:"chevron-right",Icon:$b},{name:"menu",Icon:Kb},{name:"x",Icon:Gr},{name:"sparkles",Icon:Qb},{name:"zap",Icon:ey}],hi=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),fn={"ui:text":({label:e,value:t,onChange:r})=>k.jsxs("div",{className:"grid w-full items-center gap-2 mb-4",children:[k.jsx(Or,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:hi(e)}),k.jsx(Rs,{type:"text",className:"h-9 text-[13px] bg-zinc-900/50 border-zinc-700 focus-visible:ring-blue-600",value:t||"",onChange:n=>r(n.target.value)})]}),"ui:textarea":({label:e,value:t,onChange:r})=>k.jsxs("div",{className:"grid w-full gap-2 mb-4",children:[k.jsx(Or,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:hi(e)}),k.jsx(i0,{className:"min-h-[96px] text-[13px] bg-zinc-900/50 border-zinc-700 focus-visible:ring-blue-600 resize-none",value:t||"",onChange:n=>r(n.target.value)})]}),"ui:select":({label:e,value:t,onChange:r,options:n=[]})=>k.jsxs("div",{className:"grid w-full gap-2 mb-4",children:[k.jsx(Or,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:hi(e)}),k.jsxs(C1,{value:t||"",onValueChange:r,children:[k.jsx(rh,{className:"w-full h-9 text-[13px] bg-zinc-900/50 border-zinc-700 focus:ring-blue-600",children:k.jsx(I1,{placeholder:"Select..."})}),k.jsx(nh,{className:"dark",children:n.map(s=>k.jsx(oh,{value:s,className:"text-[13px]",children:s},s))})]})]}),"ui:checkbox":({label:e,value:t,onChange:r})=>k.jsxs("div",{className:"flex items-center space-x-2 mb-4 p-2.5 rounded border border-zinc-700/60 bg-zinc-900/20",children:[k.jsx(s0,{id:e,checked:!!t,onCheckedChange:n=>r(n===!0)}),k.jsx(Or,{htmlFor:e,className:"text-[13px] font-medium cursor-pointer select-none text-zinc-200",children:hi(e)})]}),"ui:image-picker":({label:e,value:t,onChange:r})=>{const n=t!=null&&typeof t=="object"&&"url"in t?{url:String(t.url??""),alt:String(t.alt??"")}:{url:typeof t=="string"?t:"",alt:""},s=o=>{r(o)};return k.jsx("div",{className:"mb-4",children:k.jsx(D1,{label:e,value:n,onChange:s})})},"ui:icon-picker":({label:e,value:t,onChange:r})=>{const[n,s]=z.useState(!1),o=hh.find(i=>i.name===(t||""));return k.jsxs("div",{className:"grid w-full gap-1.5 mb-4",children:[k.jsx(Or,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),k.jsxs(ah,{open:n,onOpenChange:s,children:[k.jsx(T1,{asChild:!0,children:k.jsx(Ot,{variant:"outline",className:"w-full h-9 rounded-md border border-zinc-800 bg-zinc-900/50 hover:bg-zinc-800/50 flex items-center gap-2 text-left",children:o?k.jsxs(k.Fragment,{children:[k.jsx(o.Icon,{size:16,className:"text-zinc-400 shrink-0"}),k.jsx("span",{className:"text-[11px] text-zinc-300 capitalize truncate",children:o.name})]}):k.jsxs(k.Fragment,{children:[k.jsx(wo,{size:16,className:"text-zinc-500 shrink-0"}),k.jsx("span",{className:"text-[11px] text-zinc-500",children:"Choose icon..."})]})})}),k.jsxs(lh,{className:"sm:max-w-[280px] p-4",children:[k.jsxs(ch,{children:[k.jsx(uh,{className:"text-sm",children:"Choose icon"}),k.jsx(dh,{className:"text-xs",children:"Click an icon to select it."})]}),k.jsx("div",{className:"grid grid-cols-5 gap-2 py-2",children:hh.map(({name:i,Icon:a})=>k.jsx("button",{type:"button",onClick:()=>{r(i),s(!1)},className:Ke("flex items-center justify-center w-10 h-10 rounded-md border transition-colors",t===i?"border-blue-500 bg-blue-500/20 text-blue-400":"border-zinc-800 bg-zinc-900/50 hover:bg-zinc-800/50 text-zinc-400 hover:text-zinc-200"),title:i,children:k.jsx(a,{size:20})},i))})]})]})]})}},pa=e=>{if(e instanceof lt.z.ZodOptional||e instanceof lt.z.ZodDefault)return pa(e._def.innerType);if(e instanceof lt.z.ZodObject){const t={id:crypto.randomUUID()};for(const r in e.shape)r!=="id"&&(t[r]=pa(e.shape[r]));return t}return e instanceof lt.z.ZodArray?[]:e instanceof lt.z.ZodString?"":e instanceof lt.z.ZodNumber?0:e instanceof lt.z.ZodBoolean?!1:e instanceof lt.z.ZodEnum?e._def.values[0]:null},pi=e=>e instanceof lt.z.ZodOptional||e instanceof lt.z.ZodDefault||e instanceof lt.z.ZodNullable?pi(e._def.innerType):e,ph=e=>{var n;const t=e;if(typeof e.description=="string"&&e.description.length>0)return e.description;if(typeof((n=t._def)==null?void 0:n.description)=="string"&&t._def.description.length>0)return t._def.description;const r=pi(e);return r!==e?ph(r):null},gi=(e,t)=>e&&!t?"opacity-10":"opacity-100",hn=(e,t)=>e!=null&&t.toLowerCase()===e.toLowerCase(),ga=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),Kn=({schema:e,data:t,onChange:r,keys:n,expandedItemPath:s,onSidebarExpandedItemChange:o})=>{const i=e.shape,a=n!=null?Object.keys(i).filter(d=>n.includes(d)):Object.keys(i),l=s==null?void 0:s[0],c=(l==null?void 0:l.fieldKey)??null,u=c!=null;return k.jsx("div",{className:"space-y-4",children:a.map(d=>{const f=i[d];if(!f)return null;const h=pi(f),y=ph(f)||"ui:text",m=t[d];if(y==="ui:editorial-markdown")return null;if(y==="ui:image-picker"&&h instanceof lt.z.ZodObject){const _=hn(c,d),x=fn["ui:image-picker"]||fn["ui:text"];return k.jsx("div",{className:`transition-opacity duration-200 ${gi(u,_)}`,..._?{"data-jp-focused-field":d}:{},children:k.jsx(x,{label:d,value:m,onChange:I=>r({...t,[d]:I})})},d)}if(h instanceof lt.z.ZodObject){const _=m||{},x=hn(c,d);return k.jsxs("div",{className:`group/obj mb-6 p-4 border border-zinc-800 rounded-lg bg-zinc-900/20 hover:border-zinc-700 transition-[border-color,opacity] duration-200 ${gi(u,x)}`,...x?{"data-jp-focused-field":d}:{},children:[k.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[k.jsx("div",{className:"w-1 h-3 bg-blue-500 rounded-full"}),k.jsx("h4",{className:"text-[11px] font-semibold text-zinc-300 tracking-[0.02em]",children:ga(d)})]}),k.jsx(Kn,{schema:h,data:_,onChange:I=>r({...t,[d]:I}),expandedItemPath:s&&hn(l==null?void 0:l.fieldKey,d)?s.slice(1):void 0})]},d)}if(h instanceof lt.z.ZodArray){const _=Array.isArray(m)?m:[],x=pi(h.element),I=(j,R)=>{if(R<0||R>=_.length)return;const T=[..._],[D]=T.splice(j,1);T.splice(R,0,D),r({...t,[d]:T})},C=hn(c,d),O=hn(l==null?void 0:l.fieldKey,d)?l==null?void 0:l.itemId:void 0;return k.jsxs("div",{className:`mb-8 transition-opacity duration-200 ${gi(u,C)}`,...C?{"data-jp-focused-field":d}:{},children:[k.jsxs("div",{className:"flex items-center justify-between mb-3",children:[k.jsxs("label",{className:"text-[12px] font-semibold text-zinc-300 tracking-[0.01em]",children:[ga(d)," (",_.length,")"]}),k.jsxs("button",{type:"button",onClick:()=>{const j=pa(x);r({...t,[d]:[..._,j]})},className:"flex items-center gap-1 px-2.5 py-1.5 bg-blue-600/10 hover:bg-blue-600/20 text-blue-400 rounded text-[11px] font-semibold transition-colors",children:[k.jsx(ms,{size:12})," Add Item"]})]}),k.jsx("div",{className:"space-y-2",children:_.map((j,R)=>{const T=j,D=T.id||`legacy-${R}`,H=(typeof T.title=="string"?T.title:null)||(typeof T.label=="string"?T.label:null)||(typeof T.name=="string"?T.name:null)||(typeof T.content=="string"?T.content:null)||(typeof T.text=="string"?T.text:null)||`${ga(d)} #${R+1}`,U=O,ae=String(T.id??D),J=U!=null&&String(U)===ae,M=J&&s&&s.length>1?s.slice(1):void 0,ce=u&&C&&U!=null&&!J;return k.jsx(L1,{itemId:ae,openItemId:U!=null?String(U):void 0,isFaded:ce,index:R,isFirst:R===0,isLast:R===_.length-1,label:H,onExpandedChange:o?Q=>o(Q?{fieldKey:d,itemId:ae}:null):void 0,onRemove:()=>{const Q=_.filter((B,N)=>N!==R);r({...t,[d]:Q})},onMoveUp:()=>I(R,R-1),onMoveDown:()=>I(R,R+1),children:x instanceof lt.z.ZodObject?k.jsx(Kn,{schema:x,data:T||{},expandedItemPath:M,onChange:Q=>{const B=[..._];B[R]=Q,r({...t,[d]:B})}}):k.jsx("div",{className:"text-[10px] text-red-400",children:"Primitive arrays not supported."})},D)})})]},d)}const b=y in fn?y:"ui:text",S=fn[b]||fn["ui:text"],g=h instanceof lt.z.ZodEnum?h._def.values:void 0,w=hn(c,d);return k.jsx("div",{className:`transition-opacity duration-200 ${gi(u,w)}`,...w?{"data-jp-focused-field":d}:{},children:k.jsx(S,{label:d,value:m,options:g,onChange:_=>r({...t,[d]:_})})},d)})})},L1=({itemId:e,openItemId:t,isFaded:r=!1,label:n,onExpandedChange:s,onRemove:o,onMoveUp:i,onMoveDown:a,isFirst:l,isLast:c,children:u})=>{const d=t!=null&&String(t)===String(e),[f,h]=z.useState(d);z.useEffect(()=>{t!=null&&(d&&!f&&h(!0),!d&&f&&h(!1))},[t,d,f]);const y=()=>{const b=!f;h(b),s==null||s(b)},m=d&&f;return k.jsxs("div",{className:`border border-zinc-800 rounded-md bg-zinc-900/40 overflow-hidden transition-opacity duration-200 ${r?"opacity-10":"opacity-100"}`,...m?{"data-jp-expanded-item":e}:{},children:[k.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-zinc-900/60",children:[k.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:k.jsxs("button",{type:"button",onClick:y,className:"flex items-center gap-2 text-[12px] font-semibold text-zinc-200 tracking-[0.01em] truncate",children:[f?k.jsx(ps,{size:12,className:"shrink-0"}):k.jsx(vo,{size:12,className:"shrink-0"}),k.jsx("span",{className:"truncate",children:n})]})}),k.jsxs("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[k.jsx("button",{type:"button",disabled:l,onClick:i,className:"text-zinc-500 hover:text-blue-400 disabled:opacity-20 p-1 transition-colors",children:k.jsx(Fb,{size:12})}),k.jsx("button",{type:"button",disabled:c,onClick:a,className:"text-zinc-500 hover:text-blue-400 disabled:opacity-20 p-1 transition-colors",children:k.jsx(Bb,{size:12})}),k.jsx("div",{className:"w-px h-3 bg-zinc-800 mx-1"}),k.jsx("button",{type:"button",onClick:o,className:"text-zinc-600 hover:text-red-500 transition-colors p-1",children:k.jsx(xo,{size:12})})]})]}),f&&k.jsx("div",{className:"p-4 border-t border-zinc-800 bg-black/20",children:u})]})};function z1(e,t){return q.useReducer((r,n)=>t[r][n]??r,e)}var Gn=e=>{const{present:t,children:r}=e,n=B1(t),s=typeof r=="function"?r({present:n.isPresent}):q.Children.only(r),o=ft(n.ref,U1(s));return typeof r=="function"||n.isPresent?q.cloneElement(s,{ref:o}):null};Gn.displayName="Presence";function B1(e){const[t,r]=q.useState(),n=q.useRef(null),s=q.useRef(e),o=q.useRef("none"),i=e?"mounted":"unmounted",[a,l]=z1(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return q.useEffect(()=>{const c=mi(n.current);o.current=a==="mounted"?c:"none"},[a]),wt(()=>{const c=n.current,u=s.current;if(u!==e){const f=o.current,h=mi(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),wt(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=h=>{const m=mi(n.current).includes(CSS.escape(h.animationName));if(h.target===t&&m&&(l("ANIMATION_END"),!s.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},f=h=>{h.target===t&&(o.current=mi(n.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:q.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function mi(e){return(e==null?void 0:e.animationName)||"none"}function U1(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var[bi]=Wn("Tooltip",[sn]),yi=sn(),gh="TooltipProvider",F1=700,ma="tooltip.open",[W1,ba]=bi(gh),mh=e=>{const{__scopeTooltip:t,delayDuration:r=F1,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=e,i=q.useRef(!0),a=q.useRef(!1),l=q.useRef(0);return q.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),k.jsx(W1,{scope:t,isOpenDelayedRef:i,delayDuration:r,onOpen:q.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:q.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:q.useCallback(c=>{a.current=c},[]),disableHoverableContent:s,children:o})};mh.displayName=gh;var Yn="Tooltip",[$1,Jn]=bi(Yn),bh=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s,onOpenChange:o,disableHoverableContent:i,delayDuration:a}=e,l=ba(Yn,e.__scopeTooltip),c=yi(t),[u,d]=q.useState(null),f=$n(),h=q.useRef(0),y=i??l.disableHoverableContent,m=a??l.delayDuration,b=q.useRef(!1),[S,g]=ti({prop:n,defaultProp:s??!1,onChange:C=>{C?(l.onOpen(),document.dispatchEvent(new CustomEvent(ma))):l.onClose(),o==null||o(C)},caller:Yn}),w=q.useMemo(()=>S?b.current?"delayed-open":"instant-open":"closed",[S]),_=q.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b.current=!1,g(!0)},[g]),x=q.useCallback(()=>{window.clearTimeout(h.current),h.current=0,g(!1)},[g]),I=q.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{b.current=!0,g(!0),h.current=0},m)},[m,g]);return q.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),k.jsx(Zs,{...c,children:k.jsx($1,{scope:t,contentId:f,open:S,stateAttribute:w,trigger:u,onTriggerChange:d,onTriggerEnter:q.useCallback(()=>{l.isOpenDelayedRef.current?I():_()},[l.isOpenDelayedRef,I,_]),onTriggerLeave:q.useCallback(()=>{y?x():(window.clearTimeout(h.current),h.current=0)},[x,y]),onOpen:_,onClose:x,disableHoverableContent:y,children:r})})};bh.displayName=Yn;var ya="TooltipTrigger",yh=q.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Jn(ya,r),o=ba(ya,r),i=yi(r),a=q.useRef(null),l=ft(t,a,s.onTriggerChange),c=q.useRef(!1),u=q.useRef(!1),d=q.useCallback(()=>c.current=!1,[]);return q.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),k.jsx(Zo,{asChild:!0,...i,children:k.jsx(ct.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:l,onPointerMove:tt(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:tt(e.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:tt(e.onPointerDown,()=>{s.open&&s.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:tt(e.onFocus,()=>{c.current||s.onOpen()}),onBlur:tt(e.onBlur,s.onClose),onClick:tt(e.onClick,s.onClose)})})});yh.displayName=ya;var va="TooltipPortal",[q1,H1]=bi(va,{forceMount:void 0}),vh=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:s}=e,o=Jn(va,t);return k.jsx(q1,{scope:t,forceMount:r,children:k.jsx(Gn,{present:r||o.open,children:k.jsx(ei,{asChild:!0,container:s,children:n})})})};vh.displayName=va;var pn="TooltipContent",wh=q.forwardRef((e,t)=>{const r=H1(pn,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,i=Jn(pn,e.__scopeTooltip);return k.jsx(Gn,{present:n||i.open,children:i.disableHoverableContent?k.jsx(xh,{side:s,...o,ref:t}):k.jsx(V1,{side:s,...o,ref:t})})}),V1=q.forwardRef((e,t)=>{const r=Jn(pn,e.__scopeTooltip),n=ba(pn,e.__scopeTooltip),s=q.useRef(null),o=ft(t,s),[i,a]=q.useState(null),{trigger:l,onClose:c}=r,u=s.current,{onPointerInTransitChange:d}=n,f=q.useCallback(()=>{a(null),d(!1)},[d]),h=q.useCallback((y,m)=>{const b=y.currentTarget,S={x:y.clientX,y:y.clientY},g=Q1(S,b.getBoundingClientRect()),w=X1(S,g),_=Z1(m.getBoundingClientRect()),x=t_([...w,..._]);a(x),d(!0)},[d]);return q.useEffect(()=>()=>f(),[f]),q.useEffect(()=>{if(l&&u){const y=b=>h(b,u),m=b=>h(b,l);return l.addEventListener("pointerleave",y),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",y),u.removeEventListener("pointerleave",m)}}},[l,u,h,f]),q.useEffect(()=>{if(i){const y=m=>{const b=m.target,S={x:m.clientX,y:m.clientY},g=(l==null?void 0:l.contains(b))||(u==null?void 0:u.contains(b)),w=!e_(S,i);g?f():w&&(f(),c())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,u,i,c,f]),k.jsx(xh,{...e,ref:o})}),[K1,G1]=bi(Yn,{isInside:!1}),Y1=u0("TooltipContent"),xh=q.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:i,...a}=e,l=Jn(pn,r),c=yi(r),{onClose:u}=l;return q.useEffect(()=>(document.addEventListener(ma,u),()=>document.removeEventListener(ma,u)),[u]),q.useEffect(()=>{if(l.trigger){const d=f=>{const h=f.target;h!=null&&h.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),k.jsx(Wo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:k.jsxs(ea,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[k.jsx(Y1,{children:n}),k.jsx(K1,{scope:r,isInside:!0,children:k.jsx(lx,{id:l.contentId,role:"tooltip",children:s||n})})]})})});wh.displayName=pn;var _h="TooltipArrow",J1=q.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=yi(r);return G1(_h,r).isInside?null:k.jsx(ta,{...s,...n,ref:t})});J1.displayName=_h;function Q1(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function X1(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Z1(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function e_(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const a=t[o],l=t[i],c=a.x,u=a.y,d=l.x,f=l.y;u>n!=f>n&&r<(d-c)*(n-u)/(f-u)+c&&(s=!s)}return s}function t_(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),r_(t)}function r_(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const o=t[t.length-1],i=t[t.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const o=r[r.length-1],i=r[r.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var n_=mh,o_=bh,i_=yh,s_=vh,Sh=wh;const a_=n_,Qn=o_,Xn=i_,gn=q.forwardRef(({className:e,sideOffset:t=4,...r},n)=>k.jsx(s_,{children:k.jsx(Sh,{ref:n,sideOffset:t,className:Ke("z-50 rounded-md bg-zinc-800 px-2.5 py-1.5 text-[11px] text-zinc-200 shadow-md","animate-in fade-in-0 zoom-in-95",e),...r})}));gn.displayName=Sh.displayName;var vi="Popover",[Eh]=Wn(vi,[sn]),Zn=sn(),[l_,br]=Eh(vi),kh=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:i=!1}=e,a=Zn(t),l=q.useRef(null),[c,u]=q.useState(!1),[d,f]=ti({prop:n,defaultProp:s??!1,onChange:o,caller:vi});return k.jsx(Zs,{...a,children:k.jsx(l_,{scope:t,contentId:$n(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:q.useCallback(()=>f(h=>!h),[f]),hasCustomAnchor:c,onCustomAnchorAdd:q.useCallback(()=>u(!0),[]),onCustomAnchorRemove:q.useCallback(()=>u(!1),[]),modal:i,children:r})})};kh.displayName=vi;var Ah="PopoverAnchor",c_=q.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=br(Ah,r),o=Zn(r),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=s;return q.useEffect(()=>(i(),()=>a()),[i,a]),k.jsx(Zo,{...o,...n,ref:t})});c_.displayName=Ah;var Ch="PopoverTrigger",Ih=q.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=br(Ch,r),o=Zn(r),i=ft(t,s.triggerRef),a=k.jsx(ct.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Nh(s.open),...n,ref:i,onClick:tt(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?a:k.jsx(Zo,{asChild:!0,...o,children:a})});Ih.displayName=Ch;var wa="PopoverPortal",[u_,d_]=Eh(wa,{forceMount:void 0}),Th=e=>{const{__scopePopover:t,forceMount:r,children:n,container:s}=e,o=br(wa,t);return k.jsx(u_,{scope:t,forceMount:r,children:k.jsx(Gn,{present:r||o.open,children:k.jsx(ei,{asChild:!0,container:s,children:n})})})};Th.displayName=wa;var mn="PopoverContent",jh=q.forwardRef((e,t)=>{const r=d_(mn,e.__scopePopover),{forceMount:n=r.forceMount,...s}=e,o=br(mn,e.__scopePopover);return k.jsx(Gn,{present:n||o.open,children:o.modal?k.jsx(h_,{...s,ref:t}):k.jsx(p_,{...s,ref:t})})});jh.displayName=mn;var f_=en("PopoverContent.RemoveScroll"),h_=q.forwardRef((e,t)=>{const r=br(mn,e.__scopePopover),n=q.useRef(null),s=ft(t,n),o=q.useRef(!1);return q.useEffect(()=>{const i=n.current;if(i)return mf(i)},[]),k.jsx(aa,{as:f_,allowPinchZoom:!0,children:k.jsx(Oh,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:tt(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),o.current||(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:tt(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:tt(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),p_=q.forwardRef((e,t)=>{const r=br(mn,e.__scopePopover),n=q.useRef(!1),s=q.useRef(!1);return k.jsx(Oh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;((c=r.triggerRef.current)==null?void 0:c.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),Oh=q.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,f=br(mn,r),h=Zn(r);return Cd(),k.jsx(Bs,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:k.jsx(Wo,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:k.jsx(ea,{"data-state":Nh(f.open),role:"dialog",id:f.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Ph="PopoverClose",g_=q.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=br(Ph,r);return k.jsx(ct.button,{type:"button",...n,ref:t,onClick:tt(e.onClick,()=>s.onOpenChange(!1))})});g_.displayName=Ph;var m_="PopoverArrow",b_=q.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=Zn(r);return k.jsx(ta,{...s,...n,ref:t})});b_.displayName=m_;function Nh(e){return e?"open":"closed"}var y_=kh,v_=Ih,w_=Th,Rh=jh;const x_=y_,__=v_,Mh=q.forwardRef(({className:e,align:t="start",sideOffset:r=6,...n},s)=>k.jsx(w_,{children:k.jsx(Rh,{ref:s,align:t,sideOffset:r,className:Ke("z-50 w-[var(--radix-popover-trigger-width)] rounded-lg border border-zinc-700/80 bg-zinc-950 p-1 text-white shadow-xl shadow-black/30","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2",e),...n})}));Mh.displayName=Rh.displayName;const Dh=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"Select page",S_=({pageSlugs:e,currentSlug:t,onPageChange:r,sectionCount:n,onNewPage:s,className:o,currentPageLabel:i})=>{const[a,l]=z.useState(!1),c=i??Dh(t),u=d=>{r(d),l(!1)};return k.jsx("div",{className:Ke("mx-3 mt-2 mb-2",o),children:k.jsxs(x_,{open:a,onOpenChange:l,children:[k.jsx(__,{asChild:!0,children:k.jsxs("button",{type:"button","aria-haspopup":"listbox","aria-label":`Select page, current: ${c}`,className:Ke("flex items-center gap-2 w-full pl-3 pr-4 py-2 rounded-lg border text-left transition-all duration-150 cursor-pointer","bg-transparent border-zinc-800 text-zinc-400 hover:text-zinc-200 hover:bg-zinc-800/50 hover:border-zinc-700","data-[state=open]:bg-zinc-950 data-[state=open]:border-zinc-800 data-[state=open]:text-zinc-100","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-zinc-950"),children:[k.jsx(Hb,{size:14,className:"shrink-0 text-zinc-500","aria-hidden":!0}),k.jsx("span",{className:"text-xs font-medium flex-1 truncate",children:c}),k.jsx(vo,{size:13,className:"shrink-0 text-zinc-500","aria-hidden":!0})]})}),k.jsxs(Mh,{align:"start",sideOffset:4,className:"min-w-[var(--radix-popover-trigger-width)] bg-zinc-950 border-zinc-800 p-1",role:"listbox","aria-label":"Page list",children:[e.map(d=>{const f=d===t,h=Dh(d);return k.jsxs("button",{type:"button",role:"option","aria-selected":f,onClick:()=>u(d),className:Ke("flex items-center justify-between w-full px-2.5 py-2 rounded-md text-xs transition-colors cursor-pointer",f?"bg-primary/10 text-primary font-semibold":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"),children:[k.jsx("span",{children:h}),n!=null&&k.jsxs("span",{className:"text-[10px] text-zinc-600 tabular-nums","aria-hidden":!0,children:[n,"s"]})]},d)}),s!=null&&k.jsx("div",{className:"border-t border-zinc-800 mt-1 pt-1",children:k.jsxs("button",{type:"button",onClick:()=>{s(),l(!1)},className:"flex items-center gap-1.5 w-full px-2.5 py-2 rounded-md text-[11px] text-zinc-600 hover:text-zinc-300 hover:bg-zinc-800 transition-colors cursor-pointer","aria-label":"New page",children:[k.jsx(ms,{size:12,"aria-hidden":!0}),k.jsx("span",{children:"New page"})]})})]})]})})},xa=new Set(["anchorId","paddingTop","paddingBottom","theme","container"]),Lh=new Set(["ui:editorial-markdown"]),zh=e=>e instanceof lt.z.ZodOptional||e instanceof lt.z.ZodDefault||e instanceof lt.z.ZodNullable?zh(e._def.innerType):e,_a=e=>{var o;if(!e)return"";const t=e,r=typeof e.description=="string"?e.description:null;if(r)return r;const n=typeof((o=t._def)==null?void 0:o.description)=="string"?t._def.description:null;if(n)return n;const s=zh(e);return s!==e?_a(s):""},Sa=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),E_={activationConstraint:{distance:8}},k_={activationConstraint:{delay:200,tolerance:5}};function Ea({layer:e,opts:t,dragHandleProps:r}){const{isSelected:n,isActive:s,isDragging:o,canDelete:i,onSelect:a,onOpenSettings:l,onDelete:c}=t,u=!!r;return k.jsxs("div",{className:Ke("group flex items-center gap-2 pl-1 pr-2 py-2.5 rounded-lg text-left transition-all duration-200 cursor-pointer border-l-2",n?"bg-primary/[0.08] border-primary":s?"bg-zinc-800/30 border-emerald-500/60":"border-transparent hover:bg-zinc-800/40",o&&"opacity-50 shadow-lg",u?"cursor-grab active:cursor-grabbing":"cursor-default"),children:[u?k.jsx("span",{className:"shrink-0 w-5 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-150 cursor-grab touch-none","aria-label":"Trascina per riordinare",...r,children:k.jsx(ku,{size:12,className:"text-zinc-600"})}):k.jsx("span",{className:"shrink-0 w-5 flex items-center justify-center opacity-0 group-hover:opacity-100 pointer-events-none",children:k.jsx(ku,{size:12,className:"text-zinc-600/50"})}),k.jsxs("button",{type:"button",onClick:a,className:"flex-1 min-w-0 text-left",children:[k.jsxs("div",{className:"flex items-center gap-1.5",children:[k.jsx("span",{className:Ke("text-xs font-bold uppercase tracking-[0.06em] truncate",n?"text-primary":"text-zinc-500"),children:e.type}),s&&k.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 shrink-0","aria-hidden":!0})]}),k.jsx("span",{className:"text-[11px] text-zinc-600 block truncate leading-snug mt-0.5",children:e.title??`${e.type} section`})]}),k.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity duration-150",children:[k.jsxs(Qn,{children:[k.jsx(Xn,{asChild:!0,children:k.jsx(Ot,{variant:"ghost",size:"icon-xs",className:"text-zinc-600 hover:text-zinc-300",onClick:d=>{d.stopPropagation(),l(d)},children:k.jsx(Jb,{size:12})})}),k.jsx(gn,{children:"Settings"})]}),i&&k.jsxs(Qn,{children:[k.jsx(Xn,{asChild:!0,children:k.jsx(Ot,{variant:"ghost",size:"icon-xs",className:"text-zinc-600 hover:text-destructive",onClick:d=>{d.stopPropagation(),c()},children:k.jsx(xo,{size:12})})}),k.jsx(gn,{children:"Delete section"})]})]})]})}function A_({layer:e,opts:t}){const{attributes:r,listeners:n,setNodeRef:s,transform:o,transition:i,isDragging:a}=e0({id:e.id,disabled:!t.canReorder}),l={transform:ur.Transform.toString(o),transition:i};return k.jsx("div",{ref:s,style:l,className:Ke(a&&"z-10"),children:k.jsx(Ea,{layer:e,opts:{...t,isDragging:a},dragHandleProps:t.canReorder?{...r,...n,"aria-roledescription":"elemento trascinabile"}:void 0})})}const Bh=({selectedSection:e,pageData:t,allSectionsData:r=[],onUpdate:n,onUpdateSection:s,onClose:o,expandedItemPath:i=null,onReorderSection:a,allLayers:l=[],activeSectionId:c,onRequestScrollToSection:u,onDeleteSection:d,onAddSection:f,hasChanges:h=!1,onSaveToFile:y,onHotSave:m,saveSuccessFeedback:b=!1,hotSaveSuccessFeedback:S=!1,hotSaveInProgress:g=!1,showLegacySave:w=!0,showHotSave:_=!1,onResetToFile:x,showResetToFile:I=!1,pageSlugs:C=[],currentSlug:A="home",onPageChange:O})=>{const{schemas:j}=Cn(),[R,T]=z.useState(!0),[D,H]=z.useState(null),[U,ae]=z.useState(null),[J,M]=z.useState(null),[ce,Q]=z.useState(null),B=z.useRef(null),N=z.useRef(null),Y=Ay(_s(Ts,E_),_s(Zu,k_),_s(Cs,{coordinateGetter:n0})),ue=z.useDeferredValue(e),X=e!=null&&(ue==null?void 0:ue.id)!==e.id,we=i&&i.length>0?i:J?[J]:null,L=we!=null&&we.length?{fieldKey:we[we.length-1].fieldKey,itemId:we[we.length-1].itemId}:null,W=z.useRef(i);z.useEffect(()=>{W.current!=null&&i==null&&M(null),W.current=i},[i]),z.useEffect(()=>{(e==null?void 0:e.id)!=null&&T(!1)},[e==null?void 0:e.id]);const le=()=>{const p=requestAnimationFrame(()=>{requestAnimationFrame(()=>{const v=B.current;v&&v.scrollTo({top:0,behavior:"smooth"})})});return()=>cancelAnimationFrame(p)},$=z.useRef(R);z.useEffect(()=>{if(R&&!$.current){const p=le();return $.current=R,p}$.current=R},[R]),z.useEffect(()=>{if(!L)return;const p=B.current;if(!p)return;const v=requestAnimationFrame(()=>{const E=p.querySelector("[data-jp-expanded-item]")??p.querySelector("[data-jp-focused-field]");E&&E.scrollIntoView({behavior:"smooth",block:"start"})});return()=>cancelAnimationFrame(v)},[L]);const ee=p=>{T(!1),u==null||u(p)},ne=()=>{T(p=>{const v=!p;return v&&le(),v})},me=(p,v)=>{v.stopPropagation(),r.length>0&&s?Q(p):(T(!1),u==null||u(p))};z.useEffect(()=>{if(ce==null)return;const p=v=>{v.key==="Escape"&&Q(null)};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[ce]);const pe=p=>{D===p?(d==null||d(p),H(null)):(H(p),setTimeout(()=>H(null),3e3))},G=z.useMemo(()=>l.filter(p=>p.scope==="local").map(p=>p.id),[l]),ie=!!a&&G.length>0,he=p=>{ae(p.active.id)},be=p=>{ae(null);const{active:v,over:E}=p;if(!E||v.id===E.id||!a)return;const P=l.findIndex(fe=>fe.id===v.id),V=l.findIndex(fe=>fe.id===E.id);if(P===-1||V===-1)return;const te=P<V?V:V-1;a(v.id,te)},ve=e?t.sections.find(p=>p.id===e.id):void 0,Ae=ue?t.sections.find(p=>p.id===ue.id):void 0,se=ue?j[ue.type]:void 0,Ee=z.useMemo(()=>{if(!se)return!1;const p=se.shape,v=Object.keys(p).filter(E=>!xa.has(E));return v.length===0?!1:v.every(E=>Lh.has(_a(p[E])))},[se]);z.useEffect(()=>{(e==null?void 0:e.id)!=null&&Ee&&T(!0)},[e==null?void 0:e.id,Ee]);const je=l.length>0&&(R||!e),ye=A?A.charAt(0).toUpperCase()+A.slice(1):"Select page",$e=z.useMemo(()=>{const p=[];let v=null;for(const E of l){const P=E.type.toUpperCase(),V=v!==null&&(v==="HEADER"&&P!=="HEADER"||v!=="HEADER"&&v!=="FOOTER"&&P==="FOOTER");p.push({layer:E,showSeparatorAbove:V}),v=P}return p},[l]);return k.jsx(a_,{children:k.jsxs("aside",{className:"relative w-full h-full bg-zinc-950 border-l border-zinc-800 flex flex-col shadow-2xl shrink-0 min-w-0 animate-in slide-in-from-right duration-300",children:[k.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800 shrink-0",children:[k.jsxs("div",{className:"min-w-0",children:[k.jsx("h2",{className:"text-sm font-bold text-white",children:"Inspector"}),k.jsx("p",{className:"text-[10px] tracking-[0.06em] text-zinc-600 mt-0.5",children:e?k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"text-primary font-bold",children:e.type}),k.jsx("span",{className:"text-zinc-700 mx-1.5",children:"|"}),k.jsx("span",{className:"uppercase",children:e.scope})]}):k.jsxs("span",{className:"text-zinc-600",children:[ye," · ",l.length," sections"]})})]}),k.jsx(Ot,{variant:"ghost",size:"icon-sm",onClick:o,"aria-label":"Close Inspector",children:k.jsx(Gr,{size:14})})]}),C.length>0&&O&&k.jsx(S_,{pageSlugs:C,currentSlug:A,onPageChange:O,sectionCount:l.length,currentPageLabel:ye}),l.length>0&&k.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-t border-zinc-800/50",children:[k.jsxs("button",{type:"button",onClick:ne,className:"flex items-center gap-2 flex-1 cursor-pointer min-w-0 text-left","aria-expanded":je,"aria-label":je?"Collapse Page Layers":"Expand Page Layers",children:[k.jsx(gs,{size:14,className:"text-zinc-500 shrink-0"}),k.jsx("span",{className:"text-[11px] font-semibold tracking-[0.04em] text-zinc-400",children:"Page Layers"}),k.jsxs("span",{className:"text-[10px] text-zinc-600",children:["(",l.length,")"]}),k.jsx(ps,{size:13,className:Ke("ml-auto text-zinc-600 transition-transform duration-200 shrink-0",!R&&"rotate-180")})]}),f!=null&&k.jsxs(Qn,{children:[k.jsx(Xn,{asChild:!0,children:k.jsx(Ot,{variant:"ghost",size:"icon-sm",className:"text-zinc-500 hover:text-primary",onClick:f,children:k.jsx(ms,{size:14})})}),k.jsx(gn,{children:"Add section"})]})]}),k.jsx("div",{className:"relative flex-1 min-h-0 min-w-0 flex flex-col overflow-hidden",children:k.jsxs("div",{ref:B,className:"min-h-0 min-w-0 flex-1 overflow-y-auto overflow-x-hidden flex flex-col",role:"region","aria-label":"Inspector content",children:[k.jsx("div",{className:"flex flex-col min-h-0",children:je&&k.jsxs("div",{className:"py-1",children:[k.jsxs(Sv,{sensors:Y,collisionDetection:Ty,modifiers:[Fv],onDragStart:he,onDragEnd:be,accessibility:{announcements:{onDragStart:()=>"Sezione presa in carico. Usa i tasti freccia per spostare, Spazio per rilasciare.",onDragOver:({over:p})=>p?`Posizione ${G.indexOf(String(p.id))+1} di ${G.length}.`:void 0,onDragEnd:({over:p})=>p?"Sezione rilasciata in nuova posizione.":"Riposizionamento annullato.",onDragCancel:()=>"Riposizionamento annullato."}},children:[k.jsx(Kv,{items:G,strategy:Hv,children:k.jsx("div",{className:"px-2 space-y-0.5",children:$e.map(({layer:p,showSeparatorAbove:v})=>k.jsxs(z.Fragment,{children:[v&&k.jsx("div",{className:"mx-3 border-t border-zinc-800/60 my-1"}),p.scope==="local"&&ie?k.jsx(A_,{layer:p,opts:{isSelected:(e==null?void 0:e.id)===p.id,isActive:c===p.id,isDragging:!1,canReorder:!0,canDelete:!!d,deleteConfirm:D===p.id,onSelect:()=>ee(p.id),onDelete:()=>pe(p.id),onOpenSettings:E=>me(p.id,E)}}):k.jsx("div",{children:k.jsx(Ea,{layer:p,opts:{isSelected:(e==null?void 0:e.id)===p.id,isActive:c===p.id,isDragging:!1,canDelete:p.scope==="local"&&!!d,deleteConfirm:D===p.id,onSelect:()=>ee(p.id),onDelete:()=>pe(p.id),onOpenSettings:E=>me(p.id,E)}})})]},p.id))})}),k.jsx(Uv,{dropAnimation:{duration:200,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:U?(()=>{const p=l.find(v=>v.id===U);return p?k.jsx("div",{className:"px-2 w-full max-w-[var(--inspector-width,280px)]",children:k.jsx(Ea,{layer:p,opts:{isSelected:!1,isActive:!1,isDragging:!0,canDelete:!1,deleteConfirm:!1,onSelect:()=>{},onDelete:()=>{},onOpenSettings:()=>{}},dragHandleProps:{"aria-hidden":!0}})}):null})():null})]}),D&&k.jsxs("div",{className:"flex items-center gap-2 py-2 px-3 mt-1 mx-2 rounded-md bg-amber-500/10 border border-amber-500/30",children:[k.jsx(qb,{size:12,className:"text-amber-500 shrink-0"}),k.jsx("p",{className:"text-[10px] text-amber-500 font-medium",children:"Click delete again to confirm"})]})]})}),L&&ve&&(()=>{const p=ve.data||{};let v;if(we&&we.length>0){let E=p;for(const te of we){const fe=E==null?void 0:E[te.fieldKey];te.itemId!=null&&Array.isArray(fe)?E=fe.find(oe=>String(oe==null?void 0:oe.id)===String(te.itemId))??null:E=fe}const P=E||{},V=L.fieldKey;v=(typeof P.name=="string"?P.name:null)??(typeof P.title=="string"?P.title:null)??(typeof P.label=="string"?P.label:null)??Sa(V)}else{const E=L.fieldKey;if(L.itemId!=null){const te=(Array.isArray(p[E])?p[E]:[]).find(fe=>String(fe==null?void 0:fe.id)===String(L.itemId))||{};v=(typeof te.name=="string"?te.name:null)??(typeof te.title=="string"?te.title:null)??(typeof te.label=="string"?te.label:null)??Sa(E)}else v=Sa(E)}return k.jsxs("div",{className:"px-4 py-2 border-b border-zinc-800 bg-zinc-900/50",children:[k.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-zinc-500",children:"Editing"}),k.jsx("p",{className:"text-xs font-medium text-white truncate mt-0.5",children:v})]})})(),k.jsx("div",{className:"flex-1 p-4",onFocusCapture:()=>e!=null&&T(!1),children:e?X?k.jsxs("div",{className:"space-y-4 animate-pulse",role:"status","aria-label":"Loading form",children:[k.jsx("div",{className:"h-4 w-3/4 rounded bg-zinc-800"}),k.jsx("div",{className:"h-10 rounded bg-zinc-800/80"}),k.jsx("div",{className:"h-10 rounded bg-zinc-800/80"}),k.jsx("div",{className:"h-20 rounded bg-zinc-800/80"}),k.jsx("div",{className:"h-10 rounded bg-zinc-800/60"})]}):se?(()=>{const v=Object.keys(se.shape).filter(P=>!xa.has(P)&&!Lh.has(_a(se.shape[P]))),E=(Ae==null?void 0:Ae.data)||{};return v.length===0?k.jsx("p",{className:"text-xs text-zinc-500",children:"Inline editorial section: edit content directly on the canvas."}):k.jsx(Kn,{schema:se,data:E,onChange:P=>n(P),keys:v,expandedItemPath:we,onSidebarExpandedItemChange:M})})():k.jsxs("div",{className:"text-xs text-red-400 p-4 border border-dashed border-red-900/30 rounded bg-red-900/10",children:["No schema found for ",(ue==null?void 0:ue.type)??e.type]}):k.jsx("p",{className:"text-xs text-zinc-600 text-center py-10",children:"Select a layer above or on the stage to edit."})})]})}),k.jsx("div",{className:"px-4 py-2.5 border-t border-zinc-800 bg-zinc-900/50 flex items-center justify-between gap-3 opacity-100 shrink-0",children:(w&&y!=null||_&&m!=null||x!=null)&&k.jsxs(k.Fragment,{children:[k.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[k.jsx("div",{className:Ke("w-2 h-2 rounded-full transition-colors duration-300 shrink-0",h?"bg-amber-500 shadow-[0_0_8px_rgba(245,158,11,0.5)]":"bg-emerald-500")}),k.jsx("span",{className:Ke("text-sm font-medium transition-colors duration-300 truncate",b||S?"text-emerald-400":h?"text-amber-500":"text-zinc-500"),children:b||S?"Saved":h?"Unsaved Changes":"All Changes Saved"})]}),w&&y!=null&&k.jsxs(Qn,{children:[k.jsx(Xn,{asChild:!0,children:k.jsxs(Ot,{size:"default",disabled:!h,className:"h-9 min-w-[156px] px-5 text-sm gap-2 ml-auto",onClick:p=>{p.preventDefault(),p.stopPropagation(),y()},children:[k.jsx(Cu,{size:14}),k.jsx("span",{children:"Save"})]})}),k.jsx(gn,{children:"Save to file"})]}),_&&m!=null&&k.jsxs(Qn,{children:[k.jsx(Xn,{asChild:!0,children:k.jsxs(Ot,{size:"default",disabled:!h||g,className:"h-9 min-w-[156px] px-5 text-sm gap-2 ml-auto",onClick:p=>{p.preventDefault(),p.stopPropagation(),m()},children:[k.jsx(Cu,{size:14}),k.jsx("span",{children:g?"Saving...":"Hot Save"})]})}),k.jsx(gn,{children:"Hot save to edge"})]}),x!=null&&I&&k.jsx("button",{type:"button",onClick:x,className:"shrink-0 flex items-center gap-1.5 px-2 py-1 rounded text-[11px] font-medium transition-all border border-zinc-700 bg-zinc-900 text-zinc-400 hover:bg-zinc-800 hover:border-zinc-600 hover:text-zinc-300",title:"Ripristina la pagina dal file (elimina le modifiche in memoria)",children:k.jsx("span",{children:"Ripristina da file"})})]})}),ce!=null&&r.length>0&&s!=null&&(()=>{const p=r.find(oe=>oe.id===ce),v=l.find(oe=>oe.id===ce);if(!p)return null;const E=(v==null?void 0:v.scope)==="global"?"global":"local",P=p.type,V=j[P],fe=(V?Object.keys(V.shape):[]).filter(oe=>xa.has(oe)),re=p.data??{};return fe.length===0?k.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"section-settings-modal-title",onClick:()=>Q(null),children:k.jsxs("div",{ref:N,className:"relative rounded-lg border border-zinc-700 bg-zinc-900 shadow-xl max-w-md w-full overflow-hidden",onClick:oe=>oe.stopPropagation(),children:[k.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800",children:[k.jsxs("h2",{id:"section-settings-modal-title",className:"text-sm font-bold text-white",children:["Settings — ",P]}),k.jsx("button",{type:"button",onClick:()=>Q(null),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close settings",children:k.jsx(Gr,{size:18})})]}),k.jsx("div",{className:"p-4",children:k.jsx("p",{className:"text-xs text-zinc-500",children:"No settings fields for this section."})})]})}):k.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"section-settings-modal-title",onClick:oe=>oe.target===oe.currentTarget&&Q(null),children:k.jsxs("div",{ref:N,className:"relative rounded-lg border border-zinc-700 bg-zinc-900 shadow-xl max-w-md w-full max-h-[85vh] flex flex-col overflow-hidden",onClick:oe=>oe.stopPropagation(),children:[k.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800 shrink-0",children:[k.jsxs("h2",{id:"section-settings-modal-title",className:"text-sm font-bold text-white",children:["Settings — ",P]}),k.jsx("button",{type:"button",onClick:()=>Q(null),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close settings (Escape)",children:k.jsx(Gr,{size:18})})]}),k.jsx("div",{className:"flex-1 overflow-y-auto p-4 custom-scrollbar",children:k.jsx(Kn,{schema:V,data:re,onChange:oe=>{const de={...p.data,...oe};s(ce,E,P,de)},keys:fe})})]})})})()]})})},Uh=({draft:e,globalDraft:t,menuConfig:r,themeConfig:n,slug:s,selectedId:o,scrollToSectionId:i,onScrollRequested:a})=>{const l=z.useRef(null),c=z.useCallback(()=>{var u;(u=l.current)!=null&&u.contentWindow&&l.current.contentWindow.postMessage({type:it.UPDATE_DRAFTS,draft:e,globalDraft:t,menuConfig:r,themeConfig:n},"*")},[e,t,r,n]);return z.useEffect(()=>{c()},[c]),z.useEffect(()=>{const u=d=>{d.data.type===it.STAGE_READY&&c()};return window.addEventListener("message",u),()=>window.removeEventListener("message",u)},[c]),z.useEffect(()=>{var u;(u=l.current)!=null&&u.contentWindow&&l.current.contentWindow.postMessage({type:it.SYNC_SELECTION,selectedId:o},"*")},[o]),z.useEffect(()=>{var u;!i||!((u=l.current)!=null&&u.contentWindow)||(l.current.contentWindow.postMessage({type:it.REQUEST_SCROLL_TO_SECTION,sectionId:i},"*"),a==null||a())},[i,a]),k.jsx("div",{className:"w-full h-full bg-background overflow-hidden",children:k.jsx("iframe",{ref:l,src:`/admin/preview/${s}`,className:"w-full h-full border-none",title:"JsonPages Stage"})})},ka=new Set;function C_(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function Fh(e,t=[],r={}){return Object.entries(e).forEach(([n,s])=>{const o=[...t,C_(n)];if(typeof s=="string"||typeof s=="number"){r[`--theme-${o.join("-")}`]=String(s);return}s&&typeof s=="object"&&!Array.isArray(s)&&Fh(s,o,r)}),r}function kt(e,t,r,n){n&&(e[t]=`var(${r})`)}function I_(e){const t=Fh(e.tokens),r={...t};return kt(r,"--theme-primary","--theme-colors-primary",t["--theme-colors-primary"]),kt(r,"--theme-secondary","--theme-colors-secondary",t["--theme-colors-secondary"]),kt(r,"--theme-accent","--theme-colors-accent",t["--theme-colors-accent"]),kt(r,"--theme-background","--theme-colors-background",t["--theme-colors-background"]),kt(r,"--theme-surface","--theme-colors-surface",t["--theme-colors-surface"]),kt(r,"--theme-surface-alt","--theme-colors-surface-alt",t["--theme-colors-surface-alt"]),kt(r,"--theme-text","--theme-colors-text",t["--theme-colors-text"]),kt(r,"--theme-text-muted","--theme-colors-text-muted",t["--theme-colors-text-muted"]),kt(r,"--theme-border","--theme-colors-border",t["--theme-colors-border"]),kt(r,"--theme-font-primary","--theme-typography-font-family-primary",t["--theme-typography-font-family-primary"]),kt(r,"--theme-font-mono","--theme-typography-font-family-mono",t["--theme-typography-font-family-mono"]),kt(r,"--theme-font-display","--theme-typography-font-family-display",t["--theme-typography-font-family-display"]),kt(r,"--theme-radius-sm","--theme-border-radius-sm",t["--theme-border-radius-sm"]),kt(r,"--theme-radius-md","--theme-border-radius-md",t["--theme-border-radius-md"]),kt(r,"--theme-radius-lg","--theme-border-radius-lg",t["--theme-border-radius-lg"]),r}const wi={setTheme:e=>{const t=document.documentElement,r=I_(e);ka.forEach(n=>{t.style.removeProperty(n)}),ka.clear(),Object.entries(r).forEach(([n,s])=>{t.style.setProperty(n,s),ka.add(n)})}};function T_(e,t){if(!t)return e;const r=e[e.length-1];return r&&r.itemId==null&&r.fieldKey===t?e:[...e,{fieldKey:t}]}function Wh(e,t){var o,i,a;const r=[];let n=null,s=e;for(;s&&s!==t;){const l=(o=s.getAttribute)==null?void 0:o.call(s,"data-jp-item-id"),c=(i=s.getAttribute)==null?void 0:i.call(s,"data-jp-item-field");if(l&&c&&r.push({fieldKey:c,itemId:l}),n==null){const u=(a=s.getAttribute)==null?void 0:a.call(s,"data-jp-field");u&&(n=u)}s=s.parentElement}return r.reverse(),T_(r,n)}const j_='[data-jp-ignore-select="true"],[data-jp-interactive="true"],.ProseMirror,[contenteditable="true"],button,input,textarea,select,[role="button"],[role="menuitem"]',O_="[data-jp-field],[data-jp-item-id],[data-jp-item-field]",$h=()=>{var f;const[e,t]=z.useState(null),[r,n]=z.useState(null),[s,o]=z.useState({main:[]}),[i,a]=z.useState(null),[l,c]=z.useState(null);if(z.useEffect(()=>{const h=y=>{var m;if(!(y.origin!==window.location.origin||y.source!==window.parent)&&(y.data.type===it.UPDATE_DRAFTS&&(t(y.data.draft),n(y.data.globalDraft),(m=y.data.menuConfig)!=null&&m.main&&o({main:y.data.menuConfig.main}),y.data.themeConfig&&wi.setTheme(y.data.themeConfig)),y.data.type===it.SYNC_SELECTION&&a(y.data.selectedId),y.data.type===it.REQUEST_SCROLL_TO_SECTION&&c(y.data.sectionId??null),y.data.type===it.REQUEST_INLINE_FLUSH)){const b=typeof y.data.requestId=="string"?y.data.requestId:null;window.dispatchEvent(new CustomEvent(it.REQUEST_INLINE_FLUSH,{detail:{requestId:b}})),setTimeout(()=>{window.parent.postMessage({type:it.INLINE_FLUSHED,requestId:b},window.location.origin)},0)}};return window.addEventListener("message",h),window.parent.postMessage({type:it.STAGE_READY},"*"),()=>window.removeEventListener("message",h)},[]),z.useEffect(()=>{const h=b=>!!b.closest(O_),y=b=>!!(b.closest('[data-jp-ignore-select="true"]')||b.closest(j_)&&!h(b)||b.closest("a[href]")&&!h(b)),m=b=>{var D,H,U;const S=b.target;if(y(S)){S.closest("a[href]")&&b.preventDefault();return}const g=b.clientX,w=b.clientY;let _=null,x=S;for(;x&&x!==document.body;){const ae=(D=x.getAttribute)==null?void 0:D.call(x,"data-section-id"),J=(H=x.getAttribute)==null?void 0:H.call(x,"data-section-type"),M=(U=x.getAttribute)==null?void 0:U.call(x,"data-section-scope");if(ae&&J&&M){_=x;break}x=x.parentElement}if(!_)return;b.preventDefault(),b.stopPropagation();const I=_.getAttribute("data-section-id"),C=_.getAttribute("data-section-type"),A=_.getAttribute("data-section-scope");if(!I||!C||!A)return;const O={id:I,type:C,scope:A};if(S===_){window.parent.postMessage({type:it.SECTION_SELECT,section:O},"*");return}const j=document.elementFromPoint(g,w)??S;if(!j||!_.contains(j)){window.parent.postMessage({type:it.SECTION_SELECT,section:O},"*");return}if(j===_){window.parent.postMessage({type:it.SECTION_SELECT,section:O},"*");return}let R=Wh(j,_);if(R.length===0&&j){let ae=null;const J=M=>{var Q,B;const ce=M.getBoundingClientRect();if(ce.left<=g&&g<=ce.right&&ce.top<=w&&w<=ce.bottom){for(let N=0;N<M.children.length;N++)J(M.children[N]);((Q=M.getAttribute)!=null&&Q.call(M,"data-jp-item-id")||(B=M.getAttribute)!=null&&B.call(M,"data-jp-field"))&&(ae=M)}};J(j),ae&&(R=Wh(ae,_))}const T={type:it.SECTION_SELECT,section:O};R.length>0&&(T.itemPath=R),window.parent.postMessage(T,"*")};return document.addEventListener("click",m,!0),()=>document.removeEventListener("click",m,!0)},[]),z.useEffect(()=>{if(!l)return;const h=setTimeout(()=>c(null),600);return()=>clearTimeout(h)},[l]),!e||!r)return k.jsx("div",{className:"flex items-center justify-center h-screen w-full bg-zinc-950 text-zinc-500 font-mono text-xs uppercase tracking-widest animate-pulse",children:"Waiting for Studio Signal..."});const u={main:Eo((f=r.header)==null?void 0:f.data,s.main)},d=h=>{window.parent.postMessage({type:it.ACTIVE_SECTION_CHANGED,activeSectionId:h},"*")};return k.jsx(yo,{mode:"studio",children:k.jsx("div",{className:"jp-ice-active",children:k.jsx(ys,{pageConfig:e,siteConfig:r,menuConfig:u,selectedId:i,scrollToSectionId:l,onActiveSectionChange:d})})})};function P_(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const qh=({open:e,onClose:t,sectionTypes:r,sectionTypeLabels:n,onSelect:s})=>{if(z.useEffect(()=>{if(!e)return;const i=a=>{a.key==="Escape"&&t()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[e,t]),!e)return null;const o=i=>(n==null?void 0:n[i])??P_(i);return k.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",role:"dialog","aria-modal":"true","aria-labelledby":"jp-add-section-title",children:[k.jsx("div",{className:"absolute inset-0 bg-zinc-950/80 backdrop-blur-sm",onClick:t,"aria-hidden":"true"}),k.jsxs("div",{className:"relative w-full max-w-md max-h-[85vh] flex flex-col rounded-xl border border-zinc-700 bg-zinc-900 shadow-2xl overflow-hidden",children:[k.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-zinc-800 shrink-0",children:[k.jsxs("div",{className:"flex items-center gap-2",children:[k.jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/20 text-blue-400",children:k.jsx(gs,{size:18})}),k.jsx("h2",{id:"jp-add-section-title",className:"text-sm font-bold text-white",children:"Add section"})]}),k.jsx("button",{type:"button",onClick:t,className:"p-1.5 rounded-md text-zinc-400 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close",children:k.jsx(Gr,{size:18})})]}),k.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:r.length===0?k.jsx("p",{className:"text-xs text-zinc-500 text-center py-8",children:"No section types available. Configure addableSectionTypes or schemas."}):k.jsx("ul",{className:"grid gap-2",role:"listbox",children:r.map(i=>k.jsx("li",{role:"option",children:k.jsxs("button",{type:"button",onClick:()=>{s(i),t()},className:Ke("w-full flex items-center gap-3 px-4 py-3 rounded-lg text-left","border border-zinc-700/80 bg-zinc-800/50","hover:border-blue-500/40 hover:bg-zinc-800 transition-colors","focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:ring-offset-2 focus:ring-offset-zinc-900"),children:[k.jsx("span",{className:"flex items-center justify-center w-9 h-9 rounded-md bg-zinc-700/80 text-zinc-400 text-xs font-mono shrink-0",children:i}),k.jsx("span",{className:"text-sm font-medium text-zinc-200",children:o(i)})]})},i))})}),k.jsx("div",{className:"px-5 py-3 border-t border-zinc-800 shrink-0",children:k.jsx("p",{className:"text-[10px] text-zinc-500 uppercase tracking-wider",children:"Choose a section type to add to the bottom of this page"})})]})]})},Hh=()=>k.jsxs("div",{style:{"--local-bg":"var(--color-background)","--local-text":"var(--color-text)","--local-text-muted":"var(--color-text-muted)","--local-primary":"var(--color-primary)","--local-radius-md":"var(--radius-md)"},className:"min-h-screen flex flex-col items-center justify-center bg-[var(--local-bg)] px-6",children:[k.jsx("h1",{className:"text-6xl font-bold text-[var(--local-text)] mb-4",children:"404"}),k.jsx("p",{className:"text-xl text-[var(--local-text-muted)] mb-8",children:"Page not found"}),k.jsx("a",{href:"/",className:"inline-flex items-center gap-2 px-6 py-3 rounded-[var(--local-radius-md)] bg-[var(--local-primary)] text-[var(--local-bg)] font-semibold text-sm hover:opacity-90 transition-opacity",children:"Back to Home"})]});var Aa=Object.defineProperty,N_=Object.getOwnPropertyDescriptor,R_=Object.getOwnPropertyNames,M_=Object.prototype.hasOwnProperty,Ct=(e,t)=>()=>(e&&(t=e(e=0)),t),Ce=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bn=(e,t)=>{for(var r in t)Aa(e,r,{get:t[r],enumerable:!0})},D_=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of R_(t))!M_.call(e,s)&&s!==r&&Aa(e,s,{get:()=>t[s],enumerable:!(n=N_(t,s))||n.enumerable});return e},nt=e=>D_(Aa({},"__esModule",{value:!0}),e),xe=Ct(()=>{}),et={};bn(et,{_debugEnd:()=>al,_debugProcess:()=>sl,_events:()=>Sl,_eventsCount:()=>El,_exiting:()=>Va,_fatalExceptions:()=>nl,_getActiveHandles:()=>Xh,_getActiveRequests:()=>Qh,_kill:()=>Ya,_linkedBinding:()=>Yh,_maxListeners:()=>_l,_preload_modules:()=>vl,_rawDebug:()=>$a,_startProfilerIdleNotifier:()=>ll,_stopProfilerIdleNotifier:()=>cl,_tickCallback:()=>il,abort:()=>hl,addListener:()=>kl,allowedNodeEnvironmentFlags:()=>tl,arch:()=>Ta,argv:()=>Pa,argv0:()=>yl,assert:()=>Zh,binding:()=>La,browser:()=>Wa,chdir:()=>Ua,config:()=>Ka,cpuUsage:()=>to,cwd:()=>Ba,debugPort:()=>bl,default:()=>Nl,dlopen:()=>Jh,domain:()=>Ha,emit:()=>jl,emitWarning:()=>Da,env:()=>Oa,execArgv:()=>Na,execPath:()=>ml,exit:()=>Za,features:()=>rl,hasUncaughtExceptionCaptureCallback:()=>ep,hrtime:()=>xi,kill:()=>Xa,listeners:()=>rp,memoryUsage:()=>Qa,moduleLoadList:()=>qa,nextTick:()=>Kh,off:()=>Cl,on:()=>Xt,once:()=>Al,openStdin:()=>el,pid:()=>pl,platform:()=>ja,ppid:()=>gl,prependListener:()=>Ol,prependOnceListener:()=>Pl,reallyExit:()=>Ga,release:()=>Fa,removeAllListeners:()=>Tl,removeListener:()=>Il,resourceUsage:()=>Ja,setSourceMapsEnabled:()=>wl,setUncaughtExceptionCaptureCallback:()=>ol,stderr:()=>dl,stdin:()=>fl,stdout:()=>ul,title:()=>Ia,umask:()=>za,uptime:()=>tp,version:()=>Ra,versions:()=>Ma});function Ca(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function L_(){!Dr||!Lr||(Dr=!1,Lr.length?Ht=Lr.concat(Ht):eo=-1,Ht.length&&Vh())}function Vh(){if(!Dr){var e=setTimeout(L_,0);Dr=!0;for(var t=Ht.length;t;){for(Lr=Ht,Ht=[];++eo<t;)Lr&&Lr[eo].run();eo=-1,t=Ht.length}Lr=null,Dr=!1,clearTimeout(e)}}function Kh(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];Ht.push(new Gh(e,t)),Ht.length===1&&!Dr&&setTimeout(Vh,0)}function Gh(e,t){this.fun=e,this.array=t}function xt(){}function Yh(e){Ca("_linkedBinding")}function Jh(e){Ca("dlopen")}function Qh(){return[]}function Xh(){return[]}function Zh(e,t){if(!e)throw new Error(t||"assertion error")}function ep(){return!1}function tp(){return Zt.now()/1e3}function xi(e){var t=Math.floor((Date.now()-Zt.now())*.001),r=Zt.now()*.001,n=Math.floor(r)+t,s=Math.floor(r%1*1e9);return e&&(n=n-e[0],s=s-e[1],s<0&&(n--,s+=_i)),[n,s]}function Xt(){return Nl}function rp(e){return[]}var Ht,Dr,Lr,eo,Ia,Ta,ja,Oa,Pa,Na,Ra,Ma,Da,La,za,Ba,Ua,Fa,Wa,$a,qa,Ha,Va,Ka,Ga,Ya,to,Ja,Qa,Xa,Za,el,tl,rl,nl,ol,il,sl,al,ll,cl,ul,dl,fl,hl,pl,gl,ml,bl,yl,vl,wl,Zt,xl,_i,_l,Sl,El,kl,Al,Cl,Il,Tl,jl,Ol,Pl,Nl,z_=Ct(()=>{xe(),Se(),_e(),Ht=[],Dr=!1,eo=-1,Gh.prototype.run=function(){this.fun.apply(null,this.array)},Ia="browser",Ta="x64",ja="browser",Oa={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},Pa=["/usr/bin/node"],Na=[],Ra="v16.8.0",Ma={},Da=function(e,t){console.warn((t?t+": ":"")+e)},La=function(e){Ca("binding")},za=function(e){return 0},Ba=function(){return"/"},Ua=function(e){},Fa={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},Wa=!0,$a=xt,qa=[],Ha={},Va=!1,Ka={},Ga=xt,Ya=xt,to=function(){return{}},Ja=to,Qa=to,Xa=xt,Za=xt,el=xt,tl={},rl={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},nl=xt,ol=xt,il=xt,sl=xt,al=xt,ll=xt,cl=xt,ul=void 0,dl=void 0,fl=void 0,hl=xt,pl=2,gl=1,ml="/bin/usr/node",bl=9229,yl="node",vl=[],wl=xt,Zt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},Zt.now===void 0&&(xl=Date.now(),Zt.timing&&Zt.timing.navigationStart&&(xl=Zt.timing.navigationStart),Zt.now=()=>Date.now()-xl),_i=1e9,xi.bigint=function(e){var t=xi(e);return typeof BigInt>"u"?t[0]*_i+t[1]:BigInt(t[0]*_i)+BigInt(t[1])},_l=10,Sl={},El=0,kl=Xt,Al=Xt,Cl=Xt,Il=Xt,Tl=Xt,jl=xt,Ol=Xt,Pl=Xt,Nl={version:Ra,versions:Ma,arch:Ta,platform:ja,browser:Wa,release:Fa,_rawDebug:$a,moduleLoadList:qa,binding:La,_linkedBinding:Yh,_events:Sl,_eventsCount:El,_maxListeners:_l,on:Xt,addListener:kl,once:Al,off:Cl,removeListener:Il,removeAllListeners:Tl,emit:jl,prependListener:Ol,prependOnceListener:Pl,listeners:rp,domain:Ha,_exiting:Va,config:Ka,dlopen:Jh,uptime:tp,_getActiveRequests:Qh,_getActiveHandles:Xh,reallyExit:Ga,_kill:Ya,cpuUsage:to,resourceUsage:Ja,memoryUsage:Qa,kill:Xa,exit:Za,openStdin:el,allowedNodeEnvironmentFlags:tl,assert:Zh,features:rl,_fatalExceptions:nl,setUncaughtExceptionCaptureCallback:ol,hasUncaughtExceptionCaptureCallback:ep,emitWarning:Da,nextTick:Kh,_tickCallback:il,_debugProcess:sl,_debugEnd:al,_startProfilerIdleNotifier:ll,_stopProfilerIdleNotifier:cl,stdout:ul,stdin:fl,stderr:dl,abort:hl,umask:za,chdir:Ua,cwd:Ba,env:Oa,title:Ia,argv:Pa,execArgv:Na,pid:pl,ppid:gl,execPath:ml,debugPort:bl,hrtime:xi,argv0:yl,_preload_modules:vl,setSourceMapsEnabled:wl}}),_e=Ct(()=>{z_()});function B_(){if(Rl)return yn;Rl=!0,yn.byteLength=a,yn.toByteArray=c,yn.fromByteArray=f;for(var e=[],t=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,o=n.length;s<o;++s)e[s]=n[s],t[n.charCodeAt(s)]=s;t[45]=62,t[95]=63;function i(h){var y=h.length;if(y%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var m=h.indexOf("=");m===-1&&(m=y);var b=m===y?0:4-m%4;return[m,b]}function a(h){var y=i(h),m=y[0],b=y[1];return(m+b)*3/4-b}function l(h,y,m){return(y+m)*3/4-m}function c(h){var y,m=i(h),b=m[0],S=m[1],g=new r(l(h,b,S)),w=0,_=S>0?b-4:b,x;for(x=0;x<_;x+=4)y=t[h.charCodeAt(x)]<<18|t[h.charCodeAt(x+1)]<<12|t[h.charCodeAt(x+2)]<<6|t[h.charCodeAt(x+3)],g[w++]=y>>16&255,g[w++]=y>>8&255,g[w++]=y&255;return S===2&&(y=t[h.charCodeAt(x)]<<2|t[h.charCodeAt(x+1)]>>4,g[w++]=y&255),S===1&&(y=t[h.charCodeAt(x)]<<10|t[h.charCodeAt(x+1)]<<4|t[h.charCodeAt(x+2)]>>2,g[w++]=y>>8&255,g[w++]=y&255),g}function u(h){return e[h>>18&63]+e[h>>12&63]+e[h>>6&63]+e[h&63]}function d(h,y,m){for(var b,S=[],g=y;g<m;g+=3)b=(h[g]<<16&16711680)+(h[g+1]<<8&65280)+(h[g+2]&255),S.push(u(b));return S.join("")}function f(h){for(var y,m=h.length,b=m%3,S=[],g=16383,w=0,_=m-b;w<_;w+=g)S.push(d(h,w,w+g>_?_:w+g));return b===1?(y=h[m-1],S.push(e[y>>2]+e[y<<4&63]+"==")):b===2&&(y=(h[m-2]<<8)+h[m-1],S.push(e[y>>10]+e[y>>4&63]+e[y<<2&63]+"=")),S.join("")}return yn}function U_(){return Ml?ro:(Ml=!0,ro.read=function(e,t,r,n,s){var o,i,a=s*8-n-1,l=(1<<a)-1,c=l>>1,u=-7,d=r?s-1:0,f=r?-1:1,h=e[t+d];for(d+=f,o=h&(1<<-u)-1,h>>=-u,u+=a;u>0;o=o*256+e[t+d],d+=f,u-=8);for(i=o&(1<<-u)-1,o>>=-u,u+=n;u>0;i=i*256+e[t+d],d+=f,u-=8);if(o===0)o=1-c;else{if(o===l)return i?NaN:(h?-1:1)*(1/0);i=i+Math.pow(2,n),o=o-c}return(h?-1:1)*i*Math.pow(2,o-n)},ro.write=function(e,t,r,n,s,o){var i,a,l,c=o*8-s-1,u=(1<<c)-1,d=u>>1,f=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,y=n?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,i=u):(i=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-i))<1&&(i--,l*=2),i+d>=1?t+=f/l:t+=f*Math.pow(2,1-d),t*l>=2&&(i++,l/=2),i+d>=u?(a=0,i=u):i+d>=1?(a=(t*l-1)*Math.pow(2,s),i=i+d):(a=t*Math.pow(2,d-1)*Math.pow(2,s),i=0));s>=8;e[r+h]=a&255,h+=y,a/=256,s-=8);for(i=i<<s|a,c+=s;c>0;e[r+h]=i&255,h+=y,i/=256,c-=8);e[r+h-y]|=m*128},ro)}function F_(){if(Dl)return yr;Dl=!0;let e=B_(),t=U_(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;yr.Buffer=i,yr.SlowBuffer=S,yr.INSPECT_MAX_BYTES=50;let n=2147483647;yr.kMaxLength=n,i.TYPED_ARRAY_SUPPORT=s(),!i.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{let p=new Uint8Array(1),v={foo:function(){return 42}};return Object.setPrototypeOf(v,Uint8Array.prototype),Object.setPrototypeOf(p,v),p.foo()===42}catch{return!1}}Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}});function o(p){if(p>n)throw new RangeError('The value "'+p+'" is invalid for option "size"');let v=new Uint8Array(p);return Object.setPrototypeOf(v,i.prototype),v}function i(p,v,E){if(typeof p=="number"){if(typeof v=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return u(p)}return a(p,v,E)}i.poolSize=8192;function a(p,v,E){if(typeof p=="string")return d(p,v);if(ArrayBuffer.isView(p))return h(p);if(p==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof p);if(se(p,ArrayBuffer)||p&&se(p.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(se(p,SharedArrayBuffer)||p&&se(p.buffer,SharedArrayBuffer)))return y(p,v,E);if(typeof p=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let P=p.valueOf&&p.valueOf();if(P!=null&&P!==p)return i.from(P,v,E);let V=m(p);if(V)return V;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof p[Symbol.toPrimitive]=="function")return i.from(p[Symbol.toPrimitive]("string"),v,E);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof p)}i.from=function(p,v,E){return a(p,v,E)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function l(p){if(typeof p!="number")throw new TypeError('"size" argument must be of type number');if(p<0)throw new RangeError('The value "'+p+'" is invalid for option "size"')}function c(p,v,E){return l(p),p<=0?o(p):v!==void 0?typeof E=="string"?o(p).fill(v,E):o(p).fill(v):o(p)}i.alloc=function(p,v,E){return c(p,v,E)};function u(p){return l(p),o(p<0?0:b(p)|0)}i.allocUnsafe=function(p){return u(p)},i.allocUnsafeSlow=function(p){return u(p)};function d(p,v){if((typeof v!="string"||v==="")&&(v="utf8"),!i.isEncoding(v))throw new TypeError("Unknown encoding: "+v);let E=g(p,v)|0,P=o(E),V=P.write(p,v);return V!==E&&(P=P.slice(0,V)),P}function f(p){let v=p.length<0?0:b(p.length)|0,E=o(v);for(let P=0;P<v;P+=1)E[P]=p[P]&255;return E}function h(p){if(se(p,Uint8Array)){let v=new Uint8Array(p);return y(v.buffer,v.byteOffset,v.byteLength)}return f(p)}function y(p,v,E){if(v<0||p.byteLength<v)throw new RangeError('"offset" is outside of buffer bounds');if(p.byteLength<v+(E||0))throw new RangeError('"length" is outside of buffer bounds');let P;return v===void 0&&E===void 0?P=new Uint8Array(p):E===void 0?P=new Uint8Array(p,v):P=new Uint8Array(p,v,E),Object.setPrototypeOf(P,i.prototype),P}function m(p){if(i.isBuffer(p)){let v=b(p.length)|0,E=o(v);return E.length===0||p.copy(E,0,0,v),E}if(p.length!==void 0)return typeof p.length!="number"||Ee(p.length)?o(0):f(p);if(p.type==="Buffer"&&Array.isArray(p.data))return f(p.data)}function b(p){if(p>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return p|0}function S(p){return+p!=p&&(p=0),i.alloc(+p)}i.isBuffer=function(p){return p!=null&&p._isBuffer===!0&&p!==i.prototype},i.compare=function(p,v){if(se(p,Uint8Array)&&(p=i.from(p,p.offset,p.byteLength)),se(v,Uint8Array)&&(v=i.from(v,v.offset,v.byteLength)),!i.isBuffer(p)||!i.isBuffer(v))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(p===v)return 0;let E=p.length,P=v.length;for(let V=0,te=Math.min(E,P);V<te;++V)if(p[V]!==v[V]){E=p[V],P=v[V];break}return E<P?-1:P<E?1:0},i.isEncoding=function(p){switch(String(p).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(p,v){if(!Array.isArray(p))throw new TypeError('"list" argument must be an Array of Buffers');if(p.length===0)return i.alloc(0);let E;if(v===void 0)for(v=0,E=0;E<p.length;++E)v+=p[E].length;let P=i.allocUnsafe(v),V=0;for(E=0;E<p.length;++E){let te=p[E];if(se(te,Uint8Array))V+te.length>P.length?(i.isBuffer(te)||(te=i.from(te)),te.copy(P,V)):Uint8Array.prototype.set.call(P,te,V);else if(i.isBuffer(te))te.copy(P,V);else throw new TypeError('"list" argument must be an Array of Buffers');V+=te.length}return P};function g(p,v){if(i.isBuffer(p))return p.length;if(ArrayBuffer.isView(p)||se(p,ArrayBuffer))return p.byteLength;if(typeof p!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof p);let E=p.length,P=arguments.length>2&&arguments[2]===!0;if(!P&&E===0)return 0;let V=!1;for(;;)switch(v){case"ascii":case"latin1":case"binary":return E;case"utf8":case"utf-8":return ie(p).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E*2;case"hex":return E>>>1;case"base64":return ve(p).length;default:if(V)return P?-1:ie(p).length;v=(""+v).toLowerCase(),V=!0}}i.byteLength=g;function w(p,v,E){let P=!1;if((v===void 0||v<0)&&(v=0),v>this.length||((E===void 0||E>this.length)&&(E=this.length),E<=0)||(E>>>=0,v>>>=0,E<=v))return"";for(p||(p="utf8");;)switch(p){case"hex":return M(this,v,E);case"utf8":case"utf-8":return D(this,v,E);case"ascii":return ae(this,v,E);case"latin1":case"binary":return J(this,v,E);case"base64":return T(this,v,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ce(this,v,E);default:if(P)throw new TypeError("Unknown encoding: "+p);p=(p+"").toLowerCase(),P=!0}}i.prototype._isBuffer=!0;function _(p,v,E){let P=p[v];p[v]=p[E],p[E]=P}i.prototype.swap16=function(){let p=this.length;if(p%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let v=0;v<p;v+=2)_(this,v,v+1);return this},i.prototype.swap32=function(){let p=this.length;if(p%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let v=0;v<p;v+=4)_(this,v,v+3),_(this,v+1,v+2);return this},i.prototype.swap64=function(){let p=this.length;if(p%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let v=0;v<p;v+=8)_(this,v,v+7),_(this,v+1,v+6),_(this,v+2,v+5),_(this,v+3,v+4);return this},i.prototype.toString=function(){let p=this.length;return p===0?"":arguments.length===0?D(this,0,p):w.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(p){if(!i.isBuffer(p))throw new TypeError("Argument must be a Buffer");return this===p?!0:i.compare(this,p)===0},i.prototype.inspect=function(){let p="",v=yr.INSPECT_MAX_BYTES;return p=this.toString("hex",0,v).replace(/(.{2})/g,"$1 ").trim(),this.length>v&&(p+=" ... "),"<Buffer "+p+">"},r&&(i.prototype[r]=i.prototype.inspect),i.prototype.compare=function(p,v,E,P,V){if(se(p,Uint8Array)&&(p=i.from(p,p.offset,p.byteLength)),!i.isBuffer(p))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof p);if(v===void 0&&(v=0),E===void 0&&(E=p?p.length:0),P===void 0&&(P=0),V===void 0&&(V=this.length),v<0||E>p.length||P<0||V>this.length)throw new RangeError("out of range index");if(P>=V&&v>=E)return 0;if(P>=V)return-1;if(v>=E)return 1;if(v>>>=0,E>>>=0,P>>>=0,V>>>=0,this===p)return 0;let te=V-P,fe=E-v,re=Math.min(te,fe),oe=this.slice(P,V),de=p.slice(v,E);for(let ge=0;ge<re;++ge)if(oe[ge]!==de[ge]){te=oe[ge],fe=de[ge];break}return te<fe?-1:fe<te?1:0};function x(p,v,E,P,V){if(p.length===0)return-1;if(typeof E=="string"?(P=E,E=0):E>2147483647?E=2147483647:E<-2147483648&&(E=-2147483648),E=+E,Ee(E)&&(E=V?0:p.length-1),E<0&&(E=p.length+E),E>=p.length){if(V)return-1;E=p.length-1}else if(E<0)if(V)E=0;else return-1;if(typeof v=="string"&&(v=i.from(v,P)),i.isBuffer(v))return v.length===0?-1:I(p,v,E,P,V);if(typeof v=="number")return v=v&255,typeof Uint8Array.prototype.indexOf=="function"?V?Uint8Array.prototype.indexOf.call(p,v,E):Uint8Array.prototype.lastIndexOf.call(p,v,E):I(p,[v],E,P,V);throw new TypeError("val must be string, number or Buffer")}function I(p,v,E,P,V){let te=1,fe=p.length,re=v.length;if(P!==void 0&&(P=String(P).toLowerCase(),P==="ucs2"||P==="ucs-2"||P==="utf16le"||P==="utf-16le")){if(p.length<2||v.length<2)return-1;te=2,fe/=2,re/=2,E/=2}function oe(ge,ke){return te===1?ge[ke]:ge.readUInt16BE(ke*te)}let de;if(V){let ge=-1;for(de=E;de<fe;de++)if(oe(p,de)===oe(v,ge===-1?0:de-ge)){if(ge===-1&&(ge=de),de-ge+1===re)return ge*te}else ge!==-1&&(de-=de-ge),ge=-1}else for(E+re>fe&&(E=fe-re),de=E;de>=0;de--){let ge=!0;for(let ke=0;ke<re;ke++)if(oe(p,de+ke)!==oe(v,ke)){ge=!1;break}if(ge)return de}return-1}i.prototype.includes=function(p,v,E){return this.indexOf(p,v,E)!==-1},i.prototype.indexOf=function(p,v,E){return x(this,p,v,E,!0)},i.prototype.lastIndexOf=function(p,v,E){return x(this,p,v,E,!1)};function C(p,v,E,P){E=Number(E)||0;let V=p.length-E;P?(P=Number(P),P>V&&(P=V)):P=V;let te=v.length;P>te/2&&(P=te/2);let fe;for(fe=0;fe<P;++fe){let re=parseInt(v.substr(fe*2,2),16);if(Ee(re))return fe;p[E+fe]=re}return fe}function A(p,v,E,P){return Ae(ie(v,p.length-E),p,E,P)}function O(p,v,E,P){return Ae(he(v),p,E,P)}function j(p,v,E,P){return Ae(ve(v),p,E,P)}function R(p,v,E,P){return Ae(be(v,p.length-E),p,E,P)}i.prototype.write=function(p,v,E,P){if(v===void 0)P="utf8",E=this.length,v=0;else if(E===void 0&&typeof v=="string")P=v,E=this.length,v=0;else if(isFinite(v))v=v>>>0,isFinite(E)?(E=E>>>0,P===void 0&&(P="utf8")):(P=E,E=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let V=this.length-v;if((E===void 0||E>V)&&(E=V),p.length>0&&(E<0||v<0)||v>this.length)throw new RangeError("Attempt to write outside buffer bounds");P||(P="utf8");let te=!1;for(;;)switch(P){case"hex":return C(this,p,v,E);case"utf8":case"utf-8":return A(this,p,v,E);case"ascii":case"latin1":case"binary":return O(this,p,v,E);case"base64":return j(this,p,v,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,p,v,E);default:if(te)throw new TypeError("Unknown encoding: "+P);P=(""+P).toLowerCase(),te=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(p,v,E){return v===0&&E===p.length?e.fromByteArray(p):e.fromByteArray(p.slice(v,E))}function D(p,v,E){E=Math.min(p.length,E);let P=[],V=v;for(;V<E;){let te=p[V],fe=null,re=te>239?4:te>223?3:te>191?2:1;if(V+re<=E){let oe,de,ge,ke;switch(re){case 1:te<128&&(fe=te);break;case 2:oe=p[V+1],(oe&192)===128&&(ke=(te&31)<<6|oe&63,ke>127&&(fe=ke));break;case 3:oe=p[V+1],de=p[V+2],(oe&192)===128&&(de&192)===128&&(ke=(te&15)<<12|(oe&63)<<6|de&63,ke>2047&&(ke<55296||ke>57343)&&(fe=ke));break;case 4:oe=p[V+1],de=p[V+2],ge=p[V+3],(oe&192)===128&&(de&192)===128&&(ge&192)===128&&(ke=(te&15)<<18|(oe&63)<<12|(de&63)<<6|ge&63,ke>65535&&ke<1114112&&(fe=ke))}}fe===null?(fe=65533,re=1):fe>65535&&(fe-=65536,P.push(fe>>>10&1023|55296),fe=56320|fe&1023),P.push(fe),V+=re}return U(P)}let H=4096;function U(p){let v=p.length;if(v<=H)return String.fromCharCode.apply(String,p);let E="",P=0;for(;P<v;)E+=String.fromCharCode.apply(String,p.slice(P,P+=H));return E}function ae(p,v,E){let P="";E=Math.min(p.length,E);for(let V=v;V<E;++V)P+=String.fromCharCode(p[V]&127);return P}function J(p,v,E){let P="";E=Math.min(p.length,E);for(let V=v;V<E;++V)P+=String.fromCharCode(p[V]);return P}function M(p,v,E){let P=p.length;(!v||v<0)&&(v=0),(!E||E<0||E>P)&&(E=P);let V="";for(let te=v;te<E;++te)V+=je[p[te]];return V}function ce(p,v,E){let P=p.slice(v,E),V="";for(let te=0;te<P.length-1;te+=2)V+=String.fromCharCode(P[te]+P[te+1]*256);return V}i.prototype.slice=function(p,v){let E=this.length;p=~~p,v=v===void 0?E:~~v,p<0?(p+=E,p<0&&(p=0)):p>E&&(p=E),v<0?(v+=E,v<0&&(v=0)):v>E&&(v=E),v<p&&(v=p);let P=this.subarray(p,v);return Object.setPrototypeOf(P,i.prototype),P};function Q(p,v,E){if(p%1!==0||p<0)throw new RangeError("offset is not uint");if(p+v>E)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUintLE=i.prototype.readUIntLE=function(p,v,E){p=p>>>0,v=v>>>0,E||Q(p,v,this.length);let P=this[p],V=1,te=0;for(;++te<v&&(V*=256);)P+=this[p+te]*V;return P},i.prototype.readUintBE=i.prototype.readUIntBE=function(p,v,E){p=p>>>0,v=v>>>0,E||Q(p,v,this.length);let P=this[p+--v],V=1;for(;v>0&&(V*=256);)P+=this[p+--v]*V;return P},i.prototype.readUint8=i.prototype.readUInt8=function(p,v){return p=p>>>0,v||Q(p,1,this.length),this[p]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(p,v){return p=p>>>0,v||Q(p,2,this.length),this[p]|this[p+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(p,v){return p=p>>>0,v||Q(p,2,this.length),this[p]<<8|this[p+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(p,v){return p=p>>>0,v||Q(p,4,this.length),(this[p]|this[p+1]<<8|this[p+2]<<16)+this[p+3]*16777216},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(p,v){return p=p>>>0,v||Q(p,4,this.length),this[p]*16777216+(this[p+1]<<16|this[p+2]<<8|this[p+3])},i.prototype.readBigUInt64LE=ye(function(p){p=p>>>0,ne(p,"offset");let v=this[p],E=this[p+7];(v===void 0||E===void 0)&&me(p,this.length-8);let P=v+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24,V=this[++p]+this[++p]*2**8+this[++p]*2**16+E*2**24;return BigInt(P)+(BigInt(V)<<BigInt(32))}),i.prototype.readBigUInt64BE=ye(function(p){p=p>>>0,ne(p,"offset");let v=this[p],E=this[p+7];(v===void 0||E===void 0)&&me(p,this.length-8);let P=v*2**24+this[++p]*2**16+this[++p]*2**8+this[++p],V=this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+E;return(BigInt(P)<<BigInt(32))+BigInt(V)}),i.prototype.readIntLE=function(p,v,E){p=p>>>0,v=v>>>0,E||Q(p,v,this.length);let P=this[p],V=1,te=0;for(;++te<v&&(V*=256);)P+=this[p+te]*V;return V*=128,P>=V&&(P-=Math.pow(2,8*v)),P},i.prototype.readIntBE=function(p,v,E){p=p>>>0,v=v>>>0,E||Q(p,v,this.length);let P=v,V=1,te=this[p+--P];for(;P>0&&(V*=256);)te+=this[p+--P]*V;return V*=128,te>=V&&(te-=Math.pow(2,8*v)),te},i.prototype.readInt8=function(p,v){return p=p>>>0,v||Q(p,1,this.length),this[p]&128?(255-this[p]+1)*-1:this[p]},i.prototype.readInt16LE=function(p,v){p=p>>>0,v||Q(p,2,this.length);let E=this[p]|this[p+1]<<8;return E&32768?E|4294901760:E},i.prototype.readInt16BE=function(p,v){p=p>>>0,v||Q(p,2,this.length);let E=this[p+1]|this[p]<<8;return E&32768?E|4294901760:E},i.prototype.readInt32LE=function(p,v){return p=p>>>0,v||Q(p,4,this.length),this[p]|this[p+1]<<8|this[p+2]<<16|this[p+3]<<24},i.prototype.readInt32BE=function(p,v){return p=p>>>0,v||Q(p,4,this.length),this[p]<<24|this[p+1]<<16|this[p+2]<<8|this[p+3]},i.prototype.readBigInt64LE=ye(function(p){p=p>>>0,ne(p,"offset");let v=this[p],E=this[p+7];(v===void 0||E===void 0)&&me(p,this.length-8);let P=this[p+4]+this[p+5]*2**8+this[p+6]*2**16+(E<<24);return(BigInt(P)<<BigInt(32))+BigInt(v+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24)}),i.prototype.readBigInt64BE=ye(function(p){p=p>>>0,ne(p,"offset");let v=this[p],E=this[p+7];(v===void 0||E===void 0)&&me(p,this.length-8);let P=(v<<24)+this[++p]*2**16+this[++p]*2**8+this[++p];return(BigInt(P)<<BigInt(32))+BigInt(this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+E)}),i.prototype.readFloatLE=function(p,v){return p=p>>>0,v||Q(p,4,this.length),t.read(this,p,!0,23,4)},i.prototype.readFloatBE=function(p,v){return p=p>>>0,v||Q(p,4,this.length),t.read(this,p,!1,23,4)},i.prototype.readDoubleLE=function(p,v){return p=p>>>0,v||Q(p,8,this.length),t.read(this,p,!0,52,8)},i.prototype.readDoubleBE=function(p,v){return p=p>>>0,v||Q(p,8,this.length),t.read(this,p,!1,52,8)};function B(p,v,E,P,V,te){if(!i.isBuffer(p))throw new TypeError('"buffer" argument must be a Buffer instance');if(v>V||v<te)throw new RangeError('"value" argument is out of bounds');if(E+P>p.length)throw new RangeError("Index out of range")}i.prototype.writeUintLE=i.prototype.writeUIntLE=function(p,v,E,P){if(p=+p,v=v>>>0,E=E>>>0,!P){let fe=Math.pow(2,8*E)-1;B(this,p,v,E,fe,0)}let V=1,te=0;for(this[v]=p&255;++te<E&&(V*=256);)this[v+te]=p/V&255;return v+E},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(p,v,E,P){if(p=+p,v=v>>>0,E=E>>>0,!P){let fe=Math.pow(2,8*E)-1;B(this,p,v,E,fe,0)}let V=E-1,te=1;for(this[v+V]=p&255;--V>=0&&(te*=256);)this[v+V]=p/te&255;return v+E},i.prototype.writeUint8=i.prototype.writeUInt8=function(p,v,E){return p=+p,v=v>>>0,E||B(this,p,v,1,255,0),this[v]=p&255,v+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(p,v,E){return p=+p,v=v>>>0,E||B(this,p,v,2,65535,0),this[v]=p&255,this[v+1]=p>>>8,v+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(p,v,E){return p=+p,v=v>>>0,E||B(this,p,v,2,65535,0),this[v]=p>>>8,this[v+1]=p&255,v+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(p,v,E){return p=+p,v=v>>>0,E||B(this,p,v,4,4294967295,0),this[v+3]=p>>>24,this[v+2]=p>>>16,this[v+1]=p>>>8,this[v]=p&255,v+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(p,v,E){return p=+p,v=v>>>0,E||B(this,p,v,4,4294967295,0),this[v]=p>>>24,this[v+1]=p>>>16,this[v+2]=p>>>8,this[v+3]=p&255,v+4};function N(p,v,E,P,V){ee(v,P,V,p,E,7);let te=Number(v&BigInt(4294967295));p[E++]=te,te=te>>8,p[E++]=te,te=te>>8,p[E++]=te,te=te>>8,p[E++]=te;let fe=Number(v>>BigInt(32)&BigInt(4294967295));return p[E++]=fe,fe=fe>>8,p[E++]=fe,fe=fe>>8,p[E++]=fe,fe=fe>>8,p[E++]=fe,E}function Y(p,v,E,P,V){ee(v,P,V,p,E,7);let te=Number(v&BigInt(4294967295));p[E+7]=te,te=te>>8,p[E+6]=te,te=te>>8,p[E+5]=te,te=te>>8,p[E+4]=te;let fe=Number(v>>BigInt(32)&BigInt(4294967295));return p[E+3]=fe,fe=fe>>8,p[E+2]=fe,fe=fe>>8,p[E+1]=fe,fe=fe>>8,p[E]=fe,E+8}i.prototype.writeBigUInt64LE=ye(function(p,v=0){return N(this,p,v,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=ye(function(p,v=0){return Y(this,p,v,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(p,v,E,P){if(p=+p,v=v>>>0,!P){let re=Math.pow(2,8*E-1);B(this,p,v,E,re-1,-re)}let V=0,te=1,fe=0;for(this[v]=p&255;++V<E&&(te*=256);)p<0&&fe===0&&this[v+V-1]!==0&&(fe=1),this[v+V]=(p/te>>0)-fe&255;return v+E},i.prototype.writeIntBE=function(p,v,E,P){if(p=+p,v=v>>>0,!P){let re=Math.pow(2,8*E-1);B(this,p,v,E,re-1,-re)}let V=E-1,te=1,fe=0;for(this[v+V]=p&255;--V>=0&&(te*=256);)p<0&&fe===0&&this[v+V+1]!==0&&(fe=1),this[v+V]=(p/te>>0)-fe&255;return v+E},i.prototype.writeInt8=function(p,v,E){return p=+p,v=v>>>0,E||B(this,p,v,1,127,-128),p<0&&(p=255+p+1),this[v]=p&255,v+1},i.prototype.writeInt16LE=function(p,v,E){return p=+p,v=v>>>0,E||B(this,p,v,2,32767,-32768),this[v]=p&255,this[v+1]=p>>>8,v+2},i.prototype.writeInt16BE=function(p,v,E){return p=+p,v=v>>>0,E||B(this,p,v,2,32767,-32768),this[v]=p>>>8,this[v+1]=p&255,v+2},i.prototype.writeInt32LE=function(p,v,E){return p=+p,v=v>>>0,E||B(this,p,v,4,2147483647,-2147483648),this[v]=p&255,this[v+1]=p>>>8,this[v+2]=p>>>16,this[v+3]=p>>>24,v+4},i.prototype.writeInt32BE=function(p,v,E){return p=+p,v=v>>>0,E||B(this,p,v,4,2147483647,-2147483648),p<0&&(p=4294967295+p+1),this[v]=p>>>24,this[v+1]=p>>>16,this[v+2]=p>>>8,this[v+3]=p&255,v+4},i.prototype.writeBigInt64LE=ye(function(p,v=0){return N(this,p,v,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=ye(function(p,v=0){return Y(this,p,v,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ue(p,v,E,P,V,te){if(E+P>p.length)throw new RangeError("Index out of range");if(E<0)throw new RangeError("Index out of range")}function X(p,v,E,P,V){return v=+v,E=E>>>0,V||ue(p,v,E,4),t.write(p,v,E,P,23,4),E+4}i.prototype.writeFloatLE=function(p,v,E){return X(this,p,v,!0,E)},i.prototype.writeFloatBE=function(p,v,E){return X(this,p,v,!1,E)};function we(p,v,E,P,V){return v=+v,E=E>>>0,V||ue(p,v,E,8),t.write(p,v,E,P,52,8),E+8}i.prototype.writeDoubleLE=function(p,v,E){return we(this,p,v,!0,E)},i.prototype.writeDoubleBE=function(p,v,E){return we(this,p,v,!1,E)},i.prototype.copy=function(p,v,E,P){if(!i.isBuffer(p))throw new TypeError("argument should be a Buffer");if(E||(E=0),!P&&P!==0&&(P=this.length),v>=p.length&&(v=p.length),v||(v=0),P>0&&P<E&&(P=E),P===E||p.length===0||this.length===0)return 0;if(v<0)throw new RangeError("targetStart out of bounds");if(E<0||E>=this.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("sourceEnd out of bounds");P>this.length&&(P=this.length),p.length-v<P-E&&(P=p.length-v+E);let V=P-E;return this===p&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(v,E,P):Uint8Array.prototype.set.call(p,this.subarray(E,P),v),V},i.prototype.fill=function(p,v,E,P){if(typeof p=="string"){if(typeof v=="string"?(P=v,v=0,E=this.length):typeof E=="string"&&(P=E,E=this.length),P!==void 0&&typeof P!="string")throw new TypeError("encoding must be a string");if(typeof P=="string"&&!i.isEncoding(P))throw new TypeError("Unknown encoding: "+P);if(p.length===1){let te=p.charCodeAt(0);(P==="utf8"&&te<128||P==="latin1")&&(p=te)}}else typeof p=="number"?p=p&255:typeof p=="boolean"&&(p=Number(p));if(v<0||this.length<v||this.length<E)throw new RangeError("Out of range index");if(E<=v)return this;v=v>>>0,E=E===void 0?this.length:E>>>0,p||(p=0);let V;if(typeof p=="number")for(V=v;V<E;++V)this[V]=p;else{let te=i.isBuffer(p)?p:i.from(p,P),fe=te.length;if(fe===0)throw new TypeError('The value "'+p+'" is invalid for argument "value"');for(V=0;V<E-v;++V)this[V+v]=te[V%fe]}return this};let L={};function W(p,v,E){L[p]=class extends E{constructor(){super(),Object.defineProperty(this,"message",{value:v.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${p}]`,this.stack,delete this.name}get code(){return p}set code(P){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:P,writable:!0})}toString(){return`${this.name} [${p}]: ${this.message}`}}}W("ERR_BUFFER_OUT_OF_BOUNDS",function(p){return p?`${p} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),W("ERR_INVALID_ARG_TYPE",function(p,v){return`The "${p}" argument must be of type number. Received type ${typeof v}`},TypeError),W("ERR_OUT_OF_RANGE",function(p,v,E){let P=`The value of "${p}" is out of range.`,V=E;return Number.isInteger(E)&&Math.abs(E)>2**32?V=le(String(E)):typeof E=="bigint"&&(V=String(E),(E>BigInt(2)**BigInt(32)||E<-(BigInt(2)**BigInt(32)))&&(V=le(V)),V+="n"),P+=` It must be ${v}. Received ${V}`,P},RangeError);function le(p){let v="",E=p.length,P=p[0]==="-"?1:0;for(;E>=P+4;E-=3)v=`_${p.slice(E-3,E)}${v}`;return`${p.slice(0,E)}${v}`}function $(p,v,E){ne(v,"offset"),(p[v]===void 0||p[v+E]===void 0)&&me(v,p.length-(E+1))}function ee(p,v,E,P,V,te){if(p>E||p<v){let fe=typeof v=="bigint"?"n":"",re;throw v===0||v===BigInt(0)?re=`>= 0${fe} and < 2${fe} ** ${(te+1)*8}${fe}`:re=`>= -(2${fe} ** ${(te+1)*8-1}${fe}) and < 2 ** ${(te+1)*8-1}${fe}`,new L.ERR_OUT_OF_RANGE("value",re,p)}$(P,V,te)}function ne(p,v){if(typeof p!="number")throw new L.ERR_INVALID_ARG_TYPE(v,"number",p)}function me(p,v,E){throw Math.floor(p)!==p?(ne(p,E),new L.ERR_OUT_OF_RANGE("offset","an integer",p)):v<0?new L.ERR_BUFFER_OUT_OF_BOUNDS:new L.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${v}`,p)}let pe=/[^+/0-9A-Za-z-_]/g;function G(p){if(p=p.split("=")[0],p=p.trim().replace(pe,""),p.length<2)return"";for(;p.length%4!==0;)p=p+"=";return p}function ie(p,v){v=v||1/0;let E,P=p.length,V=null,te=[];for(let fe=0;fe<P;++fe){if(E=p.charCodeAt(fe),E>55295&&E<57344){if(!V){if(E>56319){(v-=3)>-1&&te.push(239,191,189);continue}else if(fe+1===P){(v-=3)>-1&&te.push(239,191,189);continue}V=E;continue}if(E<56320){(v-=3)>-1&&te.push(239,191,189),V=E;continue}E=(V-55296<<10|E-56320)+65536}else V&&(v-=3)>-1&&te.push(239,191,189);if(V=null,E<128){if((v-=1)<0)break;te.push(E)}else if(E<2048){if((v-=2)<0)break;te.push(E>>6|192,E&63|128)}else if(E<65536){if((v-=3)<0)break;te.push(E>>12|224,E>>6&63|128,E&63|128)}else if(E<1114112){if((v-=4)<0)break;te.push(E>>18|240,E>>12&63|128,E>>6&63|128,E&63|128)}else throw new Error("Invalid code point")}return te}function he(p){let v=[];for(let E=0;E<p.length;++E)v.push(p.charCodeAt(E)&255);return v}function be(p,v){let E,P,V,te=[];for(let fe=0;fe<p.length&&!((v-=2)<0);++fe)E=p.charCodeAt(fe),P=E>>8,V=E%256,te.push(V),te.push(P);return te}function ve(p){return e.toByteArray(G(p))}function Ae(p,v,E,P){let V;for(V=0;V<P&&!(V+E>=v.length||V>=p.length);++V)v[V+E]=p[V];return V}function se(p,v){return p instanceof v||p!=null&&p.constructor!=null&&p.constructor.name!=null&&p.constructor.name===v.name}function Ee(p){return p!==p}let je=(function(){let p="0123456789abcdef",v=new Array(256);for(let E=0;E<16;++E){let P=E*16;for(let V=0;V<16;++V)v[P+V]=p[E]+p[V]}return v})();function ye(p){return typeof BigInt>"u"?$e:p}function $e(){throw new Error("BigInt not supported")}return yr}var yn,Rl,ro,Ml,yr,Dl,W_=Ct(()=>{xe(),Se(),_e(),yn={},Rl=!1,ro={},Ml=!1,yr={},Dl=!1}),yt={};bn(yt,{Buffer:()=>Si,INSPECT_MAX_BYTES:()=>np,default:()=>er,kMaxLength:()=>op});var er,Si,np,op,vt=Ct(()=>{xe(),Se(),_e(),W_(),er=F_(),er.Buffer,er.SlowBuffer,er.INSPECT_MAX_BYTES,er.kMaxLength,Si=er.Buffer,np=er.INSPECT_MAX_BYTES,op=er.kMaxLength}),Se=Ct(()=>{vt()}),dt=Ce((e,t)=>{xe(),Se(),_e();var r=class extends Error{constructor(n){if(!Array.isArray(n))throw new TypeError(`Expected input to be an Array, got ${typeof n}`);let s="";for(let o=0;o<n.length;o++)s+=` ${n[o].stack}
|
|
227
|
+
`;super(s),this.name="AggregateError",this.errors=n}};t.exports={AggregateError:r,ArrayIsArray(n){return Array.isArray(n)},ArrayPrototypeIncludes(n,s){return n.includes(s)},ArrayPrototypeIndexOf(n,s){return n.indexOf(s)},ArrayPrototypeJoin(n,s){return n.join(s)},ArrayPrototypeMap(n,s){return n.map(s)},ArrayPrototypePop(n,s){return n.pop(s)},ArrayPrototypePush(n,s){return n.push(s)},ArrayPrototypeSlice(n,s,o){return n.slice(s,o)},Error,FunctionPrototypeCall(n,s,...o){return n.call(s,...o)},FunctionPrototypeSymbolHasInstance(n,s){return Function.prototype[Symbol.hasInstance].call(n,s)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(n,s){return Object.defineProperties(n,s)},ObjectDefineProperty(n,s,o){return Object.defineProperty(n,s,o)},ObjectGetOwnPropertyDescriptor(n,s){return Object.getOwnPropertyDescriptor(n,s)},ObjectKeys(n){return Object.keys(n)},ObjectSetPrototypeOf(n,s){return Object.setPrototypeOf(n,s)},Promise,PromisePrototypeCatch(n,s){return n.catch(s)},PromisePrototypeThen(n,s,o){return n.then(s,o)},PromiseReject(n){return Promise.reject(n)},PromiseResolve(n){return Promise.resolve(n)},ReflectApply:Reflect.apply,RegExpPrototypeTest(n,s){return n.test(s)},SafeSet:Set,String,StringPrototypeSlice(n,s,o){return n.slice(s,o)},StringPrototypeToLowerCase(n){return n.toLowerCase()},StringPrototypeToUpperCase(n){return n.toUpperCase()},StringPrototypeTrim(n){return n.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(n,s,o){return n.set(s,o)},Boolean,Uint8Array}}),ip=Ce((e,t)=>{xe(),Se(),_e(),t.exports={format(r,...n){return r.replace(/%([sdifj])/g,function(...[s,o]){let i=n.shift();return o==="f"?i.toFixed(6):o==="j"?JSON.stringify(i):o==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(r){switch(typeof r){case"string":if(r.includes("'"))if(r.includes('"')){if(!r.includes("`")&&!r.includes("${"))return`\`${r}\``}else return`"${r}"`;return`'${r}'`;case"number":return isNaN(r)?"NaN":Object.is(r,-0)?String(r):r;case"bigint":return`${String(r)}n`;case"boolean":case"undefined":return String(r);case"object":return"{}"}}}}),At=Ce((e,t)=>{xe(),Se(),_e();var{format:r,inspect:n}=ip(),{AggregateError:s}=dt(),o=globalThis.AggregateError||s,i=Symbol("kIsNodeError"),a=["string","function","number","object","Function","Object","boolean","bigint","symbol"],l=/^([A-Z][a-z0-9]*)+$/,c="__node_internal_",u={};function d(g,w){if(!g)throw new u.ERR_INTERNAL_ASSERTION(w)}function f(g){let w="",_=g.length,x=g[0]==="-"?1:0;for(;_>=x+4;_-=3)w=`_${g.slice(_-3,_)}${w}`;return`${g.slice(0,_)}${w}`}function h(g,w,_){if(typeof w=="function")return d(w.length<=_.length,`Code: ${g}; The provided arguments length (${_.length}) does not match the required ones (${w.length}).`),w(..._);let x=(w.match(/%[dfijoOs]/g)||[]).length;return d(x===_.length,`Code: ${g}; The provided arguments length (${_.length}) does not match the required ones (${x}).`),_.length===0?w:r(w,..._)}function y(g,w,_){_||(_=Error);class x extends _{constructor(...C){super(h(g,w,C))}toString(){return`${this.name} [${g}]: ${this.message}`}}Object.defineProperties(x.prototype,{name:{value:_.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${g}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),x.prototype.code=g,x.prototype[i]=!0,u[g]=x}function m(g){let w=c+g.name;return Object.defineProperty(g,"name",{value:w}),g}function b(g,w){if(g&&w&&g!==w){if(Array.isArray(w.errors))return w.errors.push(g),w;let _=new o([w,g],w.message);return _.code=w.code,_}return g||w}var S=class extends Error{constructor(g="The operation was aborted",w=void 0){if(w!==void 0&&typeof w!="object")throw new u.ERR_INVALID_ARG_TYPE("options","Object",w);super(g,w),this.code="ABORT_ERR",this.name="AbortError"}};y("ERR_ASSERTION","%s",Error),y("ERR_INVALID_ARG_TYPE",(g,w,_)=>{d(typeof g=="string","'name' must be a string"),Array.isArray(w)||(w=[w]);let x="The ";g.endsWith(" argument")?x+=`${g} `:x+=`"${g}" ${g.includes(".")?"property":"argument"} `,x+="must be ";let I=[],C=[],A=[];for(let j of w)d(typeof j=="string","All expected entries have to be of type string"),a.includes(j)?I.push(j.toLowerCase()):l.test(j)?C.push(j):(d(j!=="object",'The value "object" should be written as "Object"'),A.push(j));if(C.length>0){let j=I.indexOf("object");j!==-1&&(I.splice(I,j,1),C.push("Object"))}if(I.length>0){switch(I.length){case 1:x+=`of type ${I[0]}`;break;case 2:x+=`one of type ${I[0]} or ${I[1]}`;break;default:{let j=I.pop();x+=`one of type ${I.join(", ")}, or ${j}`}}(C.length>0||A.length>0)&&(x+=" or ")}if(C.length>0){switch(C.length){case 1:x+=`an instance of ${C[0]}`;break;case 2:x+=`an instance of ${C[0]} or ${C[1]}`;break;default:{let j=C.pop();x+=`an instance of ${C.join(", ")}, or ${j}`}}A.length>0&&(x+=" or ")}switch(A.length){case 0:break;case 1:A[0].toLowerCase()!==A[0]&&(x+="an "),x+=`${A[0]}`;break;case 2:x+=`one of ${A[0]} or ${A[1]}`;break;default:{let j=A.pop();x+=`one of ${A.join(", ")}, or ${j}`}}if(_==null)x+=`. Received ${_}`;else if(typeof _=="function"&&_.name)x+=`. Received function ${_.name}`;else if(typeof _=="object"){var O;if((O=_.constructor)!==null&&O!==void 0&&O.name)x+=`. Received an instance of ${_.constructor.name}`;else{let j=n(_,{depth:-1});x+=`. Received ${j}`}}else{let j=n(_,{colors:!1});j.length>25&&(j=`${j.slice(0,25)}...`),x+=`. Received type ${typeof _} (${j})`}return x},TypeError),y("ERR_INVALID_ARG_VALUE",(g,w,_="is invalid")=>{let x=n(w);return x.length>128&&(x=x.slice(0,128)+"..."),`The ${g.includes(".")?"property":"argument"} '${g}' ${_}. Received ${x}`},TypeError),y("ERR_INVALID_RETURN_VALUE",(g,w,_)=>{var x;let I=_!=null&&(x=_.constructor)!==null&&x!==void 0&&x.name?`instance of ${_.constructor.name}`:`type ${typeof _}`;return`Expected ${g} to be returned from the "${w}" function but got ${I}.`},TypeError),y("ERR_MISSING_ARGS",(...g)=>{d(g.length>0,"At least one arg needs to be specified");let w,_=g.length;switch(g=(Array.isArray(g)?g:[g]).map(x=>`"${x}"`).join(" or "),_){case 1:w+=`The ${g[0]} argument`;break;case 2:w+=`The ${g[0]} and ${g[1]} arguments`;break;default:{let x=g.pop();w+=`The ${g.join(", ")}, and ${x} arguments`}break}return`${w} must be specified`},TypeError),y("ERR_OUT_OF_RANGE",(g,w,_)=>{d(w,'Missing "range" argument');let x;if(Number.isInteger(_)&&Math.abs(_)>2**32)x=f(String(_));else if(typeof _=="bigint"){x=String(_);let I=BigInt(2)**BigInt(32);(_>I||_<-I)&&(x=f(x)),x+="n"}else x=n(_);return`The value of "${g}" is out of range. It must be ${w}. Received ${x}`},RangeError),y("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),y("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),y("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),y("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),y("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),y("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),y("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),y("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),y("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),y("ERR_STREAM_WRITE_AFTER_END","write after end",Error),y("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),t.exports={AbortError:S,aggregateTwoErrors:m(b),hideStackFrames:m,codes:u}}),no=Ce((e,t)=>{xe(),Se(),_e();var{AbortController:r,AbortSignal:n}=typeof self<"u"?self:typeof window<"u"?window:void 0;t.exports=r,t.exports.AbortSignal=n,t.exports.default=r}),vr={};bn(vr,{EventEmitter:()=>sp,default:()=>vn,defaultMaxListeners:()=>ap,init:()=>lp,listenerCount:()=>cp,on:()=>up,once:()=>dp});function $_(){if(Ll)return oo;Ll=!0;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(_,x,I){return Function.prototype.apply.call(_,x,I)},r;e&&typeof e.ownKeys=="function"?r=e.ownKeys:Object.getOwnPropertySymbols?r=function(_){return Object.getOwnPropertyNames(_).concat(Object.getOwnPropertySymbols(_))}:r=function(_){return Object.getOwnPropertyNames(_)};function n(_){console&&console.warn&&console.warn(_)}var s=Number.isNaN||function(_){return _!==_};function o(){o.init.call(this)}oo=o,oo.once=S,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var i=10;function a(_){if(typeof _!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof _)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(_){if(typeof _!="number"||_<0||s(_))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+_+".");i=_}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(_){if(typeof _!="number"||_<0||s(_))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+_+".");return this._maxListeners=_,this};function l(_){return _._maxListeners===void 0?o.defaultMaxListeners:_._maxListeners}o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(_){for(var x=[],I=1;I<arguments.length;I++)x.push(arguments[I]);var C=_==="error",A=this._events;if(A!==void 0)C=C&&A.error===void 0;else if(!C)return!1;if(C){var O;if(x.length>0&&(O=x[0]),O instanceof Error)throw O;var j=new Error("Unhandled error."+(O?" ("+O.message+")":""));throw j.context=O,j}var R=A[_];if(R===void 0)return!1;if(typeof R=="function")t(R,this,x);else for(var T=R.length,D=y(R,T),I=0;I<T;++I)t(D[I],this,x);return!0};function c(_,x,I,C){var A,O,j;if(a(I),O=_._events,O===void 0?(O=_._events=Object.create(null),_._eventsCount=0):(O.newListener!==void 0&&(_.emit("newListener",x,I.listener?I.listener:I),O=_._events),j=O[x]),j===void 0)j=O[x]=I,++_._eventsCount;else if(typeof j=="function"?j=O[x]=C?[I,j]:[j,I]:C?j.unshift(I):j.push(I),A=l(_),A>0&&j.length>A&&!j.warned){j.warned=!0;var R=new Error("Possible EventEmitter memory leak detected. "+j.length+" "+String(x)+" listeners added. Use emitter.setMaxListeners() to increase limit");R.name="MaxListenersExceededWarning",R.emitter=_,R.type=x,R.count=j.length,n(R)}return _}o.prototype.addListener=function(_,x){return c(this,_,x,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(_,x){return c(this,_,x,!0)};function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(_,x,I){var C={fired:!1,wrapFn:void 0,target:_,type:x,listener:I},A=u.bind(C);return A.listener=I,C.wrapFn=A,A}o.prototype.once=function(_,x){return a(x),this.on(_,d(this,_,x)),this},o.prototype.prependOnceListener=function(_,x){return a(x),this.prependListener(_,d(this,_,x)),this},o.prototype.removeListener=function(_,x){var I,C,A,O,j;if(a(x),C=this._events,C===void 0)return this;if(I=C[_],I===void 0)return this;if(I===x||I.listener===x)--this._eventsCount===0?this._events=Object.create(null):(delete C[_],C.removeListener&&this.emit("removeListener",_,I.listener||x));else if(typeof I!="function"){for(A=-1,O=I.length-1;O>=0;O--)if(I[O]===x||I[O].listener===x){j=I[O].listener,A=O;break}if(A<0)return this;A===0?I.shift():m(I,A),I.length===1&&(C[_]=I[0]),C.removeListener!==void 0&&this.emit("removeListener",_,j||x)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(_){var x,I,C;if(I=this._events,I===void 0)return this;if(I.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):I[_]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete I[_]),this;if(arguments.length===0){var A=Object.keys(I),O;for(C=0;C<A.length;++C)O=A[C],O!=="removeListener"&&this.removeAllListeners(O);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(x=I[_],typeof x=="function")this.removeListener(_,x);else if(x!==void 0)for(C=x.length-1;C>=0;C--)this.removeListener(_,x[C]);return this};function f(_,x,I){var C=_._events;if(C===void 0)return[];var A=C[x];return A===void 0?[]:typeof A=="function"?I?[A.listener||A]:[A]:I?b(A):y(A,A.length)}o.prototype.listeners=function(_){return f(this,_,!0)},o.prototype.rawListeners=function(_){return f(this,_,!1)},o.listenerCount=function(_,x){return typeof _.listenerCount=="function"?_.listenerCount(x):h.call(_,x)},o.prototype.listenerCount=h;function h(_){var x=this._events;if(x!==void 0){var I=x[_];if(typeof I=="function")return 1;if(I!==void 0)return I.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function y(_,x){for(var I=new Array(x),C=0;C<x;++C)I[C]=_[C];return I}function m(_,x){for(;x+1<_.length;x++)_[x]=_[x+1];_.pop()}function b(_){for(var x=new Array(_.length),I=0;I<x.length;++I)x[I]=_[I].listener||_[I];return x}function S(_,x){return new Promise(function(I,C){function A(j){_.removeListener(x,O),C(j)}function O(){typeof _.removeListener=="function"&&_.removeListener("error",A),I([].slice.call(arguments))}w(_,x,O,{once:!0}),x!=="error"&&g(_,A,{once:!0})})}function g(_,x,I){typeof _.on=="function"&&w(_,"error",x,I)}function w(_,x,I,C){if(typeof _.on=="function")C.once?_.once(x,I):_.on(x,I);else if(typeof _.addEventListener=="function")_.addEventListener(x,function A(O){C.once&&_.removeEventListener(x,A),I(O)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof _)}return oo}var oo,Ll,vn,sp,ap,lp,cp,up,dp,zr=Ct(()=>{xe(),Se(),_e(),oo={},Ll=!1,vn=$_(),vn.once,vn.once=function(e,t){return new Promise((r,n)=>{function s(...i){o!==void 0&&e.removeListener("error",o),r(i)}let o;t!=="error"&&(o=i=>{e.removeListener(name,s),n(i)},e.once("error",o)),e.once(t,s)})},vn.on=function(e,t){let r=[],n=[],s=null,o=!1,i={async next(){let c=r.shift();if(c)return createIterResult(c,!1);if(s){let u=Promise.reject(s);return s=null,u}return o?createIterResult(void 0,!0):new Promise((u,d)=>n.push({resolve:u,reject:d}))},async return(){e.removeListener(t,a),e.removeListener("error",l),o=!0;for(let c of n)c.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(c){s=c,e.removeListener(t,a),e.removeListener("error",l)},[Symbol.asyncIterator](){return this}};return e.on(t,a),e.on("error",l),i;function a(...c){let u=n.shift();u?u.resolve(createIterResult(c,!1)):r.push(c)}function l(c){o=!0;let u=n.shift();u?u.reject(c):s=c,i.return()}},{EventEmitter:sp,defaultMaxListeners:ap,init:lp,listenerCount:cp,on:up,once:dp}=vn}),It=Ce((e,t)=>{xe(),Se(),_e();var r=(vt(),nt(yt)),{format:n,inspect:s}=ip(),{codes:{ERR_INVALID_ARG_TYPE:o}}=At(),{kResistStopPropagation:i,AggregateError:a,SymbolDispose:l}=dt(),c=globalThis.AbortSignal||no().AbortSignal,u=globalThis.AbortController||no().AbortController,d=Object.getPrototypeOf(async function(){}).constructor,f=globalThis.Blob||r.Blob,h=typeof f<"u"?function(b){return b instanceof f}:function(b){return!1},y=(b,S)=>{if(b!==void 0&&(b===null||typeof b!="object"||!("aborted"in b)))throw new o(S,"AbortSignal",b)},m=(b,S)=>{if(typeof b!="function")throw new o(S,"Function",b)};t.exports={AggregateError:a,kEmptyObject:Object.freeze({}),once(b){let S=!1;return function(...g){S||(S=!0,b.apply(this,g))}},createDeferredPromise:function(){let b,S;return{promise:new Promise((g,w)=>{b=g,S=w}),resolve:b,reject:S}},promisify(b){return new Promise((S,g)=>{b((w,..._)=>w?g(w):S(..._))})},debuglog(){return function(){}},format:n,inspect:s,types:{isAsyncFunction(b){return b instanceof d},isArrayBufferView(b){return ArrayBuffer.isView(b)}},isBlob:h,deprecate(b,S){return b},addAbortListener:(zr(),nt(vr)).addAbortListener||function(b,S){if(b===void 0)throw new o("signal","AbortSignal",b);y(b,"signal"),m(S,"listener");let g;return b.aborted?queueMicrotask(()=>S()):(b.addEventListener("abort",S,{__proto__:null,once:!0,[i]:!0}),g=()=>{b.removeEventListener("abort",S)}),{__proto__:null,[l](){var w;(w=g)===null||w===void 0||w()}}},AbortSignalAny:c.any||function(b){if(b.length===1)return b[0];let S=new u,g=()=>S.abort();return b.forEach(w=>{y(w,"signals"),w.addEventListener("abort",g,{once:!0})}),S.signal.addEventListener("abort",()=>{b.forEach(w=>w.removeEventListener("abort",g))},{once:!0}),S.signal}},t.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),io=Ce((e,t)=>{xe(),Se(),_e();var{ArrayIsArray:r,ArrayPrototypeIncludes:n,ArrayPrototypeJoin:s,ArrayPrototypeMap:o,NumberIsInteger:i,NumberIsNaN:a,NumberMAX_SAFE_INTEGER:l,NumberMIN_SAFE_INTEGER:c,NumberParseInt:u,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:f,String:h,StringPrototypeToUpperCase:y,StringPrototypeTrim:m}=dt(),{hideStackFrames:b,codes:{ERR_SOCKET_BAD_PORT:S,ERR_INVALID_ARG_TYPE:g,ERR_INVALID_ARG_VALUE:w,ERR_OUT_OF_RANGE:_,ERR_UNKNOWN_SIGNAL:x}}=At(),{normalizeEncoding:I}=It(),{isAsyncFunction:C,isArrayBufferView:A}=It().types,O={};function j(se){return se===(se|0)}function R(se){return se===se>>>0}var T=/^[0-7]+$/,D="must be a 32-bit unsigned integer or an octal string";function H(se,Ee,je){if(typeof se>"u"&&(se=je),typeof se=="string"){if(f(T,se)===null)throw new w(Ee,se,D);se=u(se,8)}return J(se,Ee),se}var U=b((se,Ee,je=c,ye=l)=>{if(typeof se!="number")throw new g(Ee,"number",se);if(!i(se))throw new _(Ee,"an integer",se);if(se<je||se>ye)throw new _(Ee,`>= ${je} && <= ${ye}`,se)}),ae=b((se,Ee,je=-2147483648,ye=2147483647)=>{if(typeof se!="number")throw new g(Ee,"number",se);if(!i(se))throw new _(Ee,"an integer",se);if(se<je||se>ye)throw new _(Ee,`>= ${je} && <= ${ye}`,se)}),J=b((se,Ee,je=!1)=>{if(typeof se!="number")throw new g(Ee,"number",se);if(!i(se))throw new _(Ee,"an integer",se);let ye=je?1:0,$e=4294967295;if(se<ye||se>$e)throw new _(Ee,`>= ${ye} && <= ${$e}`,se)});function M(se,Ee){if(typeof se!="string")throw new g(Ee,"string",se)}function ce(se,Ee,je=void 0,ye){if(typeof se!="number")throw new g(Ee,"number",se);if(je!=null&&se<je||ye!=null&&se>ye||(je!=null||ye!=null)&&a(se))throw new _(Ee,`${je!=null?`>= ${je}`:""}${je!=null&&ye!=null?" && ":""}${ye!=null?`<= ${ye}`:""}`,se)}var Q=b((se,Ee,je)=>{if(!n(je,se)){let ye="must be one of: "+s(o(je,$e=>typeof $e=="string"?`'${$e}'`:h($e)),", ");throw new w(Ee,se,ye)}});function B(se,Ee){if(typeof se!="boolean")throw new g(Ee,"boolean",se)}function N(se,Ee,je){return se==null||!d(se,Ee)?je:se[Ee]}var Y=b((se,Ee,je=null)=>{let ye=N(je,"allowArray",!1),$e=N(je,"allowFunction",!1);if(!N(je,"nullable",!1)&&se===null||!ye&&r(se)||typeof se!="object"&&(!$e||typeof se!="function"))throw new g(Ee,"Object",se)}),ue=b((se,Ee)=>{if(se!=null&&typeof se!="object"&&typeof se!="function")throw new g(Ee,"a dictionary",se)}),X=b((se,Ee,je=0)=>{if(!r(se))throw new g(Ee,"Array",se);if(se.length<je){let ye=`must be longer than ${je}`;throw new w(Ee,se,ye)}});function we(se,Ee){X(se,Ee);for(let je=0;je<se.length;je++)M(se[je],`${Ee}[${je}]`)}function L(se,Ee){X(se,Ee);for(let je=0;je<se.length;je++)B(se[je],`${Ee}[${je}]`)}function W(se,Ee){X(se,Ee);for(let je=0;je<se.length;je++){let ye=se[je],$e=`${Ee}[${je}]`;if(ye==null)throw new g($e,"AbortSignal",ye);me(ye,$e)}}function le(se,Ee="signal"){if(M(se,Ee),O[se]===void 0)throw O[y(se)]!==void 0?new x(se+" (signals must use all capital letters)"):new x(se)}var $=b((se,Ee="buffer")=>{if(!A(se))throw new g(Ee,["Buffer","TypedArray","DataView"],se)});function ee(se,Ee){let je=I(Ee),ye=se.length;if(je==="hex"&&ye%2!==0)throw new w("encoding",Ee,`is invalid for data of length ${ye}`)}function ne(se,Ee="Port",je=!0){if(typeof se!="number"&&typeof se!="string"||typeof se=="string"&&m(se).length===0||+se!==+se>>>0||se>65535||se===0&&!je)throw new S(Ee,se,je);return se|0}var me=b((se,Ee)=>{if(se!==void 0&&(se===null||typeof se!="object"||!("aborted"in se)))throw new g(Ee,"AbortSignal",se)}),pe=b((se,Ee)=>{if(typeof se!="function")throw new g(Ee,"Function",se)}),G=b((se,Ee)=>{if(typeof se!="function"||C(se))throw new g(Ee,"Function",se)}),ie=b((se,Ee)=>{if(se!==void 0)throw new g(Ee,"undefined",se)});function he(se,Ee,je){if(!n(je,se))throw new g(Ee,`('${s(je,"|")}')`,se)}var be=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function ve(se,Ee){if(typeof se>"u"||!f(be,se))throw new w(Ee,se,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Ae(se){if(typeof se=="string")return ve(se,"hints"),se;if(r(se)){let Ee=se.length,je="";if(Ee===0)return je;for(let ye=0;ye<Ee;ye++){let $e=se[ye];ve($e,"hints"),je+=$e,ye!==Ee-1&&(je+=", ")}return je}throw new w("hints",se,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}t.exports={isInt32:j,isUint32:R,parseFileMode:H,validateArray:X,validateStringArray:we,validateBooleanArray:L,validateAbortSignalArray:W,validateBoolean:B,validateBuffer:$,validateDictionary:ue,validateEncoding:ee,validateFunction:pe,validateInt32:ae,validateInteger:U,validateNumber:ce,validateObject:Y,validateOneOf:Q,validatePlainFunction:G,validatePort:ne,validateSignalName:le,validateString:M,validateUint32:J,validateUndefined:ie,validateUnion:he,validateAbortSignal:me,validateLinkHeaderValue:Ae}}),Br=Ce((e,t)=>{xe(),Se(),_e();var r=t.exports={},n,s;function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?n=setTimeout:n=o}catch{n=o}try{typeof clearTimeout=="function"?s=clearTimeout:s=i}catch{s=i}})();function a(S){if(n===setTimeout)return setTimeout(S,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(S,0);try{return n(S,0)}catch{try{return n.call(null,S,0)}catch{return n.call(this,S,0)}}}function l(S){if(s===clearTimeout)return clearTimeout(S);if((s===i||!s)&&clearTimeout)return s=clearTimeout,clearTimeout(S);try{return s(S)}catch{try{return s.call(null,S)}catch{return s.call(this,S)}}}var c=[],u=!1,d,f=-1;function h(){!u||!d||(u=!1,d.length?c=d.concat(c):f=-1,c.length&&y())}function y(){if(!u){var S=a(h);u=!0;for(var g=c.length;g;){for(d=c,c=[];++f<g;)d&&d[f].run();f=-1,g=c.length}d=null,u=!1,l(S)}}r.nextTick=function(S){var g=new Array(arguments.length-1);if(arguments.length>1)for(var w=1;w<arguments.length;w++)g[w-1]=arguments[w];c.push(new m(S,g)),c.length===1&&!u&&a(y)};function m(S,g){this.fun=S,this.array=g}m.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={};function b(){}r.on=b,r.addListener=b,r.once=b,r.off=b,r.removeListener=b,r.removeAllListeners=b,r.emit=b,r.prependListener=b,r.prependOnceListener=b,r.listeners=function(S){return[]},r.binding=function(S){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(S){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}}),tr=Ce((e,t)=>{xe(),Se(),_e();var{SymbolAsyncIterator:r,SymbolIterator:n,SymbolFor:s}=dt(),o=s("nodejs.stream.destroyed"),i=s("nodejs.stream.errored"),a=s("nodejs.stream.readable"),l=s("nodejs.stream.writable"),c=s("nodejs.stream.disturbed"),u=s("nodejs.webstream.isClosedPromise"),d=s("nodejs.webstream.controllerErrorFunction");function f(N,Y=!1){var ue;return!!(N&&typeof N.pipe=="function"&&typeof N.on=="function"&&(!Y||typeof N.pause=="function"&&typeof N.resume=="function")&&(!N._writableState||((ue=N._readableState)===null||ue===void 0?void 0:ue.readable)!==!1)&&(!N._writableState||N._readableState))}function h(N){var Y;return!!(N&&typeof N.write=="function"&&typeof N.on=="function"&&(!N._readableState||((Y=N._writableState)===null||Y===void 0?void 0:Y.writable)!==!1))}function y(N){return!!(N&&typeof N.pipe=="function"&&N._readableState&&typeof N.on=="function"&&typeof N.write=="function")}function m(N){return N&&(N._readableState||N._writableState||typeof N.write=="function"&&typeof N.on=="function"||typeof N.pipe=="function"&&typeof N.on=="function")}function b(N){return!!(N&&!m(N)&&typeof N.pipeThrough=="function"&&typeof N.getReader=="function"&&typeof N.cancel=="function")}function S(N){return!!(N&&!m(N)&&typeof N.getWriter=="function"&&typeof N.abort=="function")}function g(N){return!!(N&&!m(N)&&typeof N.readable=="object"&&typeof N.writable=="object")}function w(N){return b(N)||S(N)||g(N)}function _(N,Y){return N==null?!1:Y===!0?typeof N[r]=="function":Y===!1?typeof N[n]=="function":typeof N[r]=="function"||typeof N[n]=="function"}function x(N){if(!m(N))return null;let Y=N._writableState,ue=N._readableState,X=Y||ue;return!!(N.destroyed||N[o]||X!=null&&X.destroyed)}function I(N){if(!h(N))return null;if(N.writableEnded===!0)return!0;let Y=N._writableState;return Y!=null&&Y.errored?!1:typeof(Y==null?void 0:Y.ended)!="boolean"?null:Y.ended}function C(N,Y){if(!h(N))return null;if(N.writableFinished===!0)return!0;let ue=N._writableState;return ue!=null&&ue.errored?!1:typeof(ue==null?void 0:ue.finished)!="boolean"?null:!!(ue.finished||Y===!1&&ue.ended===!0&&ue.length===0)}function A(N){if(!f(N))return null;if(N.readableEnded===!0)return!0;let Y=N._readableState;return!Y||Y.errored?!1:typeof(Y==null?void 0:Y.ended)!="boolean"?null:Y.ended}function O(N,Y){if(!f(N))return null;let ue=N._readableState;return ue!=null&&ue.errored?!1:typeof(ue==null?void 0:ue.endEmitted)!="boolean"?null:!!(ue.endEmitted||Y===!1&&ue.ended===!0&&ue.length===0)}function j(N){return N&&N[a]!=null?N[a]:typeof(N==null?void 0:N.readable)!="boolean"?null:x(N)?!1:f(N)&&N.readable&&!O(N)}function R(N){return N&&N[l]!=null?N[l]:typeof(N==null?void 0:N.writable)!="boolean"?null:x(N)?!1:h(N)&&N.writable&&!I(N)}function T(N,Y){return m(N)?x(N)?!0:!((Y==null?void 0:Y.readable)!==!1&&j(N)||(Y==null?void 0:Y.writable)!==!1&&R(N)):null}function D(N){var Y,ue;return m(N)?N.writableErrored?N.writableErrored:(Y=(ue=N._writableState)===null||ue===void 0?void 0:ue.errored)!==null&&Y!==void 0?Y:null:null}function H(N){var Y,ue;return m(N)?N.readableErrored?N.readableErrored:(Y=(ue=N._readableState)===null||ue===void 0?void 0:ue.errored)!==null&&Y!==void 0?Y:null:null}function U(N){if(!m(N))return null;if(typeof N.closed=="boolean")return N.closed;let Y=N._writableState,ue=N._readableState;return typeof(Y==null?void 0:Y.closed)=="boolean"||typeof(ue==null?void 0:ue.closed)=="boolean"?(Y==null?void 0:Y.closed)||(ue==null?void 0:ue.closed):typeof N._closed=="boolean"&&ae(N)?N._closed:null}function ae(N){return typeof N._closed=="boolean"&&typeof N._defaultKeepAlive=="boolean"&&typeof N._removedConnection=="boolean"&&typeof N._removedContLen=="boolean"}function J(N){return typeof N._sent100=="boolean"&&ae(N)}function M(N){var Y;return typeof N._consuming=="boolean"&&typeof N._dumped=="boolean"&&((Y=N.req)===null||Y===void 0?void 0:Y.upgradeOrConnect)===void 0}function ce(N){if(!m(N))return null;let Y=N._writableState,ue=N._readableState,X=Y||ue;return!X&&J(N)||!!(X&&X.autoDestroy&&X.emitClose&&X.closed===!1)}function Q(N){var Y;return!!(N&&((Y=N[c])!==null&&Y!==void 0?Y:N.readableDidRead||N.readableAborted))}function B(N){var Y,ue,X,we,L,W,le,$,ee,ne;return!!(N&&((Y=(ue=(X=(we=(L=(W=N[i])!==null&&W!==void 0?W:N.readableErrored)!==null&&L!==void 0?L:N.writableErrored)!==null&&we!==void 0?we:(le=N._readableState)===null||le===void 0?void 0:le.errorEmitted)!==null&&X!==void 0?X:($=N._writableState)===null||$===void 0?void 0:$.errorEmitted)!==null&&ue!==void 0?ue:(ee=N._readableState)===null||ee===void 0?void 0:ee.errored)!==null&&Y!==void 0?Y:!((ne=N._writableState)===null||ne===void 0)&&ne.errored))}t.exports={isDestroyed:x,kIsDestroyed:o,isDisturbed:Q,kIsDisturbed:c,isErrored:B,kIsErrored:i,isReadable:j,kIsReadable:a,kIsClosedPromise:u,kControllerErrorFunction:d,kIsWritable:l,isClosed:U,isDuplexNodeStream:y,isFinished:T,isIterable:_,isReadableNodeStream:f,isReadableStream:b,isReadableEnded:A,isReadableFinished:O,isReadableErrored:H,isNodeStream:m,isWebStream:w,isWritable:R,isWritableNodeStream:h,isWritableStream:S,isWritableEnded:I,isWritableFinished:C,isWritableErrored:D,isServerRequest:M,isServerResponse:J,willEmitClose:ce,isTransformStream:g}}),wr=Ce((e,t)=>{xe(),Se(),_e();var r=Br(),{AbortError:n,codes:s}=At(),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_PREMATURE_CLOSE:i}=s,{kEmptyObject:a,once:l}=It(),{validateAbortSignal:c,validateFunction:u,validateObject:d,validateBoolean:f}=io(),{Promise:h,PromisePrototypeThen:y,SymbolDispose:m}=dt(),{isClosed:b,isReadable:S,isReadableNodeStream:g,isReadableStream:w,isReadableFinished:_,isReadableErrored:x,isWritable:I,isWritableNodeStream:C,isWritableStream:A,isWritableFinished:O,isWritableErrored:j,isNodeStream:R,willEmitClose:T,kIsClosedPromise:D}=tr(),H;function U(Q){return Q.setHeader&&typeof Q.abort=="function"}var ae=()=>{};function J(Q,B,N){var Y,ue;if(arguments.length===2?(N=B,B=a):B==null?B=a:d(B,"options"),u(N,"callback"),c(B.signal,"options.signal"),N=l(N),w(Q)||A(Q))return M(Q,B,N);if(!R(Q))throw new o("stream",["ReadableStream","WritableStream","Stream"],Q);let X=(Y=B.readable)!==null&&Y!==void 0?Y:g(Q),we=(ue=B.writable)!==null&&ue!==void 0?ue:C(Q),L=Q._writableState,W=Q._readableState,le=()=>{Q.writable||ne()},$=T(Q)&&g(Q)===X&&C(Q)===we,ee=O(Q,!1),ne=()=>{ee=!0,Q.destroyed&&($=!1),!($&&(!Q.readable||X))&&(!X||me)&&N.call(Q)},me=_(Q,!1),pe=()=>{me=!0,Q.destroyed&&($=!1),!($&&(!Q.writable||we))&&(!we||ee)&&N.call(Q)},G=se=>{N.call(Q,se)},ie=b(Q),he=()=>{ie=!0;let se=j(Q)||x(Q);if(se&&typeof se!="boolean")return N.call(Q,se);if(X&&!me&&g(Q,!0)&&!_(Q,!1))return N.call(Q,new i);if(we&&!ee&&!O(Q,!1))return N.call(Q,new i);N.call(Q)},be=()=>{ie=!0;let se=j(Q)||x(Q);if(se&&typeof se!="boolean")return N.call(Q,se);N.call(Q)},ve=()=>{Q.req.on("finish",ne)};U(Q)?(Q.on("complete",ne),$||Q.on("abort",he),Q.req?ve():Q.on("request",ve)):we&&!L&&(Q.on("end",le),Q.on("close",le)),!$&&typeof Q.aborted=="boolean"&&Q.on("aborted",he),Q.on("end",pe),Q.on("finish",ne),B.error!==!1&&Q.on("error",G),Q.on("close",he),ie?r.nextTick(he):L!=null&&L.errorEmitted||W!=null&&W.errorEmitted?$||r.nextTick(be):(!X&&(!$||S(Q))&&(ee||I(Q)===!1)||!we&&(!$||I(Q))&&(me||S(Q)===!1)||W&&Q.req&&Q.aborted)&&r.nextTick(be);let Ae=()=>{N=ae,Q.removeListener("aborted",he),Q.removeListener("complete",ne),Q.removeListener("abort",he),Q.removeListener("request",ve),Q.req&&Q.req.removeListener("finish",ne),Q.removeListener("end",le),Q.removeListener("close",le),Q.removeListener("finish",ne),Q.removeListener("end",pe),Q.removeListener("error",G),Q.removeListener("close",he)};if(B.signal&&!ie){let se=()=>{let Ee=N;Ae(),Ee.call(Q,new n(void 0,{cause:B.signal.reason}))};if(B.signal.aborted)r.nextTick(se);else{H=H||It().addAbortListener;let Ee=H(B.signal,se),je=N;N=l((...ye)=>{Ee[m](),je.apply(Q,ye)})}}return Ae}function M(Q,B,N){let Y=!1,ue=ae;if(B.signal)if(ue=()=>{Y=!0,N.call(Q,new n(void 0,{cause:B.signal.reason}))},B.signal.aborted)r.nextTick(ue);else{H=H||It().addAbortListener;let we=H(B.signal,ue),L=N;N=l((...W)=>{we[m](),L.apply(Q,W)})}let X=(...we)=>{Y||r.nextTick(()=>N.apply(Q,we))};return y(Q[D].promise,X,X),ae}function ce(Q,B){var N;let Y=!1;return B===null&&(B=a),(N=B)!==null&&N!==void 0&&N.cleanup&&(f(B.cleanup,"cleanup"),Y=B.cleanup),new h((ue,X)=>{let we=J(Q,B,L=>{Y&&we(),L?X(L):ue()})})}t.exports=J,t.exports.finished=ce}),wn=Ce((e,t)=>{xe(),Se(),_e();var r=Br(),{aggregateTwoErrors:n,codes:{ERR_MULTIPLE_CALLBACK:s},AbortError:o}=At(),{Symbol:i}=dt(),{kIsDestroyed:a,isDestroyed:l,isFinished:c,isServerRequest:u}=tr(),d=i("kDestroy"),f=i("kConstruct");function h(T,D,H){T&&(T.stack,D&&!D.errored&&(D.errored=T),H&&!H.errored&&(H.errored=T))}function y(T,D){let H=this._readableState,U=this._writableState,ae=U||H;return U!=null&&U.destroyed||H!=null&&H.destroyed?(typeof D=="function"&&D(),this):(h(T,U,H),U&&(U.destroyed=!0),H&&(H.destroyed=!0),ae.constructed?m(this,T,D):this.once(d,function(J){m(this,n(J,T),D)}),this)}function m(T,D,H){let U=!1;function ae(J){if(U)return;U=!0;let M=T._readableState,ce=T._writableState;h(J,ce,M),ce&&(ce.closed=!0),M&&(M.closed=!0),typeof H=="function"&&H(J),J?r.nextTick(b,T,J):r.nextTick(S,T)}try{T._destroy(D||null,ae)}catch(J){ae(J)}}function b(T,D){g(T,D),S(T)}function S(T){let D=T._readableState,H=T._writableState;H&&(H.closeEmitted=!0),D&&(D.closeEmitted=!0),(H!=null&&H.emitClose||D!=null&&D.emitClose)&&T.emit("close")}function g(T,D){let H=T._readableState,U=T._writableState;U!=null&&U.errorEmitted||H!=null&&H.errorEmitted||(U&&(U.errorEmitted=!0),H&&(H.errorEmitted=!0),T.emit("error",D))}function w(){let T=this._readableState,D=this._writableState;T&&(T.constructed=!0,T.closed=!1,T.closeEmitted=!1,T.destroyed=!1,T.errored=null,T.errorEmitted=!1,T.reading=!1,T.ended=T.readable===!1,T.endEmitted=T.readable===!1),D&&(D.constructed=!0,D.destroyed=!1,D.closed=!1,D.closeEmitted=!1,D.errored=null,D.errorEmitted=!1,D.finalCalled=!1,D.prefinished=!1,D.ended=D.writable===!1,D.ending=D.writable===!1,D.finished=D.writable===!1)}function _(T,D,H){let U=T._readableState,ae=T._writableState;if(ae!=null&&ae.destroyed||U!=null&&U.destroyed)return this;U!=null&&U.autoDestroy||ae!=null&&ae.autoDestroy?T.destroy(D):D&&(D.stack,ae&&!ae.errored&&(ae.errored=D),U&&!U.errored&&(U.errored=D),H?r.nextTick(g,T,D):g(T,D))}function x(T,D){if(typeof T._construct!="function")return;let H=T._readableState,U=T._writableState;H&&(H.constructed=!1),U&&(U.constructed=!1),T.once(f,D),!(T.listenerCount(f)>1)&&r.nextTick(I,T)}function I(T){let D=!1;function H(U){if(D){_(T,U??new s);return}D=!0;let ae=T._readableState,J=T._writableState,M=J||ae;ae&&(ae.constructed=!0),J&&(J.constructed=!0),M.destroyed?T.emit(d,U):U?_(T,U,!0):r.nextTick(C,T)}try{T._construct(U=>{r.nextTick(H,U)})}catch(U){r.nextTick(H,U)}}function C(T){T.emit(f)}function A(T){return(T==null?void 0:T.setHeader)&&typeof T.abort=="function"}function O(T){T.emit("close")}function j(T,D){T.emit("error",D),r.nextTick(O,T)}function R(T,D){!T||l(T)||(!D&&!c(T)&&(D=new o),u(T)?(T.socket=null,T.destroy(D)):A(T)?T.abort():A(T.req)?T.req.abort():typeof T.destroy=="function"?T.destroy(D):typeof T.close=="function"?T.close():D?r.nextTick(j,T,D):r.nextTick(O,T),T.destroyed||(T[a]=!0))}t.exports={construct:x,destroyer:R,destroy:y,undestroy:w,errorOrDestroy:_}}),zl=Ce((e,t)=>{xe(),Se(),_e();var{ArrayIsArray:r,ObjectSetPrototypeOf:n}=dt(),{EventEmitter:s}=(zr(),nt(vr));function o(a){s.call(this,a)}n(o.prototype,s.prototype),n(o,s),o.prototype.pipe=function(a,l){let c=this;function u(S){a.writable&&a.write(S)===!1&&c.pause&&c.pause()}c.on("data",u);function d(){c.readable&&c.resume&&c.resume()}a.on("drain",d),!a._isStdio&&(!l||l.end!==!1)&&(c.on("end",h),c.on("close",y));let f=!1;function h(){f||(f=!0,a.end())}function y(){f||(f=!0,typeof a.destroy=="function"&&a.destroy())}function m(S){b(),s.listenerCount(this,"error")===0&&this.emit("error",S)}i(c,"error",m),i(a,"error",m);function b(){c.removeListener("data",u),a.removeListener("drain",d),c.removeListener("end",h),c.removeListener("close",y),c.removeListener("error",m),a.removeListener("error",m),c.removeListener("end",b),c.removeListener("close",b),a.removeListener("close",b)}return c.on("end",b),c.on("close",b),a.on("close",b),a.emit("pipe",c),a};function i(a,l,c){if(typeof a.prependListener=="function")return a.prependListener(l,c);!a._events||!a._events[l]?a.on(l,c):r(a._events[l])?a._events[l].unshift(c):a._events[l]=[c,a._events[l]]}t.exports={Stream:o,prependListener:i}}),Ei=Ce((e,t)=>{xe(),Se(),_e();var{SymbolDispose:r}=dt(),{AbortError:n,codes:s}=At(),{isNodeStream:o,isWebStream:i,kControllerErrorFunction:a}=tr(),l=wr(),{ERR_INVALID_ARG_TYPE:c}=s,u,d=(f,h)=>{if(typeof f!="object"||!("aborted"in f))throw new c(h,"AbortSignal",f)};t.exports.addAbortSignal=function(f,h){if(d(f,"signal"),!o(h)&&!i(h))throw new c("stream",["ReadableStream","WritableStream","Stream"],h);return t.exports.addAbortSignalNoValidate(f,h)},t.exports.addAbortSignalNoValidate=function(f,h){if(typeof f!="object"||!("aborted"in f))return h;let y=o(h)?()=>{h.destroy(new n(void 0,{cause:f.reason}))}:()=>{h[a](new n(void 0,{cause:f.reason}))};if(f.aborted)y();else{u=u||It().addAbortListener;let m=u(f,y);l(h,m[r])}return h}}),q_=Ce((e,t)=>{xe(),Se(),_e();var{StringPrototypeSlice:r,SymbolIterator:n,TypedArrayPrototypeSet:s,Uint8Array:o}=dt(),{Buffer:i}=(vt(),nt(yt)),{inspect:a}=It();t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(l){let c={data:l,next:null};this.length>0?this.tail.next=c:this.head=c,this.tail=c,++this.length}unshift(l){let c={data:l,next:this.head};this.length===0&&(this.tail=c),this.head=c,++this.length}shift(){if(this.length===0)return;let l=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,l}clear(){this.head=this.tail=null,this.length=0}join(l){if(this.length===0)return"";let c=this.head,u=""+c.data;for(;(c=c.next)!==null;)u+=l+c.data;return u}concat(l){if(this.length===0)return i.alloc(0);let c=i.allocUnsafe(l>>>0),u=this.head,d=0;for(;u;)s(c,u.data,d),d+=u.data.length,u=u.next;return c}consume(l,c){let u=this.head.data;if(l<u.length){let d=u.slice(0,l);return this.head.data=u.slice(l),d}return l===u.length?this.shift():c?this._getString(l):this._getBuffer(l)}first(){return this.head.data}*[n](){for(let l=this.head;l;l=l.next)yield l.data}_getString(l){let c="",u=this.head,d=0;do{let f=u.data;if(l>f.length)c+=f,l-=f.length;else{l===f.length?(c+=f,++d,u.next?this.head=u.next:this.head=this.tail=null):(c+=r(f,0,l),this.head=u,u.data=r(f,l));break}++d}while((u=u.next)!==null);return this.length-=d,c}_getBuffer(l){let c=i.allocUnsafe(l),u=l,d=this.head,f=0;do{let h=d.data;if(l>h.length)s(c,h,u-l),l-=h.length;else{l===h.length?(s(c,h,u-l),++f,d.next?this.head=d.next:this.head=this.tail=null):(s(c,new o(h.buffer,h.byteOffset,l),u-l),this.head=d,d.data=h.slice(l));break}++f}while((d=d.next)!==null);return this.length-=f,c}[Symbol.for("nodejs.util.inspect.custom")](l,c){return a(this,{...c,depth:0,customInspect:!1})}}}),ki=Ce((e,t)=>{xe(),Se(),_e();var{MathFloor:r,NumberIsInteger:n}=dt(),{validateInteger:s}=io(),{ERR_INVALID_ARG_VALUE:o}=At().codes,i=16*1024,a=16;function l(f,h,y){return f.highWaterMark!=null?f.highWaterMark:h?f[y]:null}function c(f){return f?a:i}function u(f,h){s(h,"value",0),f?a=h:i=h}function d(f,h,y,m){let b=l(h,m,y);if(b!=null){if(!n(b)||b<0){let S=m?`options.${y}`:"options.highWaterMark";throw new o(S,b)}return r(b)}return c(f.objectMode)}t.exports={getHighWaterMark:d,getDefaultHighWaterMark:c,setDefaultHighWaterMark:u}}),H_=Ce((e,t)=>{xe(),Se(),_e();var r=(vt(),nt(yt)),n=r.Buffer;function s(i,a){for(var l in i)a[l]=i[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(s(r,e),e.Buffer=o);function o(i,a,l){return n(i,a,l)}o.prototype=Object.create(n.prototype),s(n,o),o.from=function(i,a,l){if(typeof i=="number")throw new TypeError("Argument must not be a number");return n(i,a,l)},o.alloc=function(i,a,l){if(typeof i!="number")throw new TypeError("Argument must be a number");var c=n(i);return a!==void 0?typeof l=="string"?c.fill(a,l):c.fill(a):c.fill(0),c},o.allocUnsafe=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return n(i)},o.allocUnsafeSlow=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(i)}}),V_=Ce(e=>{xe(),Se(),_e();var t=H_().Buffer,r=t.isEncoding||function(g){switch(g=""+g,g&&g.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(g){if(!g)return"utf8";for(var w;;)switch(g){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return g;default:if(w)return;g=(""+g).toLowerCase(),w=!0}}function s(g){var w=n(g);if(typeof w!="string"&&(t.isEncoding===r||!r(g)))throw new Error("Unknown encoding: "+g);return w||g}e.StringDecoder=o;function o(g){this.encoding=s(g);var w;switch(this.encoding){case"utf16le":this.text=f,this.end=h,w=4;break;case"utf8":this.fillLast=c,w=4;break;case"base64":this.text=y,this.end=m,w=3;break;default:this.write=b,this.end=S;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(w)}o.prototype.write=function(g){if(g.length===0)return"";var w,_;if(this.lastNeed){if(w=this.fillLast(g),w===void 0)return"";_=this.lastNeed,this.lastNeed=0}else _=0;return _<g.length?w?w+this.text(g,_):this.text(g,_):w||""},o.prototype.end=d,o.prototype.text=u,o.prototype.fillLast=function(g){if(this.lastNeed<=g.length)return g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,g.length),this.lastNeed-=g.length};function i(g){return g<=127?0:g>>5===6?2:g>>4===14?3:g>>3===30?4:g>>6===2?-1:-2}function a(g,w,_){var x=w.length-1;if(x<_)return 0;var I=i(w[x]);return I>=0?(I>0&&(g.lastNeed=I-1),I):--x<_||I===-2?0:(I=i(w[x]),I>=0?(I>0&&(g.lastNeed=I-2),I):--x<_||I===-2?0:(I=i(w[x]),I>=0?(I>0&&(I===2?I=0:g.lastNeed=I-3),I):0))}function l(g,w,_){if((w[0]&192)!==128)return g.lastNeed=0,"�";if(g.lastNeed>1&&w.length>1){if((w[1]&192)!==128)return g.lastNeed=1,"�";if(g.lastNeed>2&&w.length>2&&(w[2]&192)!==128)return g.lastNeed=2,"�"}}function c(g){var w=this.lastTotal-this.lastNeed,_=l(this,g);if(_!==void 0)return _;if(this.lastNeed<=g.length)return g.copy(this.lastChar,w,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);g.copy(this.lastChar,w,0,g.length),this.lastNeed-=g.length}function u(g,w){var _=a(this,g,w);if(!this.lastNeed)return g.toString("utf8",w);this.lastTotal=_;var x=g.length-(_-this.lastNeed);return g.copy(this.lastChar,0,x),g.toString("utf8",w,x)}function d(g){var w=g&&g.length?this.write(g):"";return this.lastNeed?w+"�":w}function f(g,w){if((g.length-w)%2===0){var _=g.toString("utf16le",w);if(_){var x=_.charCodeAt(_.length-1);if(x>=55296&&x<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1],_.slice(0,-1)}return _}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=g[g.length-1],g.toString("utf16le",w,g.length-1)}function h(g){var w=g&&g.length?this.write(g):"";if(this.lastNeed){var _=this.lastTotal-this.lastNeed;return w+this.lastChar.toString("utf16le",0,_)}return w}function y(g,w){var _=(g.length-w)%3;return _===0?g.toString("base64",w):(this.lastNeed=3-_,this.lastTotal=3,_===1?this.lastChar[0]=g[g.length-1]:(this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1]),g.toString("base64",w,g.length-_))}function m(g){var w=g&&g.length?this.write(g):"";return this.lastNeed?w+this.lastChar.toString("base64",0,3-this.lastNeed):w}function b(g){return g.toString(this.encoding)}function S(g){return g&&g.length?this.write(g):""}}),fp=Ce((e,t)=>{xe(),Se(),_e();var r=Br(),{PromisePrototypeThen:n,SymbolAsyncIterator:s,SymbolIterator:o}=dt(),{Buffer:i}=(vt(),nt(yt)),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_NULL_VALUES:l}=At().codes;function c(u,d,f){let h;if(typeof d=="string"||d instanceof i)return new u({objectMode:!0,...f,read(){this.push(d),this.push(null)}});let y;if(d&&d[s])y=!0,h=d[s]();else if(d&&d[o])y=!1,h=d[o]();else throw new a("iterable",["Iterable"],d);let m=new u({objectMode:!0,highWaterMark:1,...f}),b=!1;m._read=function(){b||(b=!0,g())},m._destroy=function(w,_){n(S(w),()=>r.nextTick(_,w),x=>r.nextTick(_,x||w))};async function S(w){let _=w!=null,x=typeof h.throw=="function";if(_&&x){let{value:I,done:C}=await h.throw(w);if(await I,C)return}if(typeof h.return=="function"){let{value:I}=await h.return();await I}}async function g(){for(;;){try{let{value:w,done:_}=y?await h.next():h.next();if(_)m.push(null);else{let x=w&&typeof w.then=="function"?await w:w;if(x===null)throw b=!1,new l;if(m.push(x))continue;b=!1}}catch(w){m.destroy(w)}break}}return m}t.exports=c}),Ai=Ce((e,t)=>{xe(),Se(),_e();var r=Br(),{ArrayPrototypeIndexOf:n,NumberIsInteger:s,NumberIsNaN:o,NumberParseInt:i,ObjectDefineProperties:a,ObjectKeys:l,ObjectSetPrototypeOf:c,Promise:u,SafeSet:d,SymbolAsyncDispose:f,SymbolAsyncIterator:h,Symbol:y}=dt();t.exports=ye,ye.ReadableState=je;var{EventEmitter:m}=(zr(),nt(vr)),{Stream:b,prependListener:S}=zl(),{Buffer:g}=(vt(),nt(yt)),{addAbortSignal:w}=Ei(),_=wr(),x=It().debuglog("stream",F=>{x=F}),I=q_(),C=wn(),{getHighWaterMark:A,getDefaultHighWaterMark:O}=ki(),{aggregateTwoErrors:j,codes:{ERR_INVALID_ARG_TYPE:R,ERR_METHOD_NOT_IMPLEMENTED:T,ERR_OUT_OF_RANGE:D,ERR_STREAM_PUSH_AFTER_EOF:H,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:U},AbortError:ae}=At(),{validateObject:J}=io(),M=y("kPaused"),{StringDecoder:ce}=V_(),Q=fp();c(ye.prototype,b.prototype),c(ye,b);var B=()=>{},{errorOrDestroy:N}=C,Y=1,ue=2,X=4,we=8,L=16,W=32,le=64,$=128,ee=256,ne=512,me=1024,pe=2048,G=4096,ie=8192,he=16384,be=32768,ve=65536,Ae=1<<17,se=1<<18;function Ee(F){return{enumerable:!1,get(){return(this.state&F)!==0},set(K){K?this.state|=F:this.state&=~F}}}a(je.prototype,{objectMode:Ee(Y),ended:Ee(ue),endEmitted:Ee(X),reading:Ee(we),constructed:Ee(L),sync:Ee(W),needReadable:Ee(le),emittedReadable:Ee($),readableListening:Ee(ee),resumeScheduled:Ee(ne),errorEmitted:Ee(me),emitClose:Ee(pe),autoDestroy:Ee(G),destroyed:Ee(ie),closed:Ee(he),closeEmitted:Ee(be),multiAwaitDrain:Ee(ve),readingMore:Ee(Ae),dataEmitted:Ee(se)});function je(F,K,Ie){typeof Ie!="boolean"&&(Ie=K instanceof rr()),this.state=pe|G|L|W,F&&F.objectMode&&(this.state|=Y),Ie&&F&&F.readableObjectMode&&(this.state|=Y),this.highWaterMark=F?A(this,F,"readableHighWaterMark",Ie):O(!1),this.buffer=new I,this.length=0,this.pipes=[],this.flowing=null,this[M]=null,F&&F.emitClose===!1&&(this.state&=~pe),F&&F.autoDestroy===!1&&(this.state&=~G),this.errored=null,this.defaultEncoding=F&&F.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,F&&F.encoding&&(this.decoder=new ce(F.encoding),this.encoding=F.encoding)}function ye(F){if(!(this instanceof ye))return new ye(F);let K=this instanceof rr();this._readableState=new je(F,this,K),F&&(typeof F.read=="function"&&(this._read=F.read),typeof F.destroy=="function"&&(this._destroy=F.destroy),typeof F.construct=="function"&&(this._construct=F.construct),F.signal&&!K&&w(F.signal,this)),b.call(this,F),C.construct(this,()=>{this._readableState.needReadable&&re(this,this._readableState)})}ye.prototype.destroy=C.destroy,ye.prototype._undestroy=C.undestroy,ye.prototype._destroy=function(F,K){K(F)},ye.prototype[m.captureRejectionSymbol]=function(F){this.destroy(F)},ye.prototype[f]=function(){let F;return this.destroyed||(F=this.readableEnded?null:new ae,this.destroy(F)),new u((K,Ie)=>_(this,Pe=>Pe&&Pe!==F?Ie(Pe):K(null)))},ye.prototype.push=function(F,K){return $e(this,F,K,!1)},ye.prototype.unshift=function(F,K){return $e(this,F,K,!0)};function $e(F,K,Ie,Pe){x("readableAddChunk",K);let Me=F._readableState,st;if((Me.state&Y)===0&&(typeof K=="string"?(Ie=Ie||Me.defaultEncoding,Me.encoding!==Ie&&(Pe&&Me.encoding?K=g.from(K,Ie).toString(Me.encoding):(K=g.from(K,Ie),Ie=""))):K instanceof g?Ie="":b._isUint8Array(K)?(K=b._uint8ArrayToBuffer(K),Ie=""):K!=null&&(st=new R("chunk",["string","Buffer","Uint8Array"],K))),st)N(F,st);else if(K===null)Me.state&=~we,V(F,Me);else if((Me.state&Y)!==0||K&&K.length>0)if(Pe)if((Me.state&X)!==0)N(F,new U);else{if(Me.destroyed||Me.errored)return!1;p(F,Me,K,!0)}else if(Me.ended)N(F,new H);else{if(Me.destroyed||Me.errored)return!1;Me.state&=~we,Me.decoder&&!Ie?(K=Me.decoder.write(K),Me.objectMode||K.length!==0?p(F,Me,K,!1):re(F,Me)):p(F,Me,K,!1)}else Pe||(Me.state&=~we,re(F,Me));return!Me.ended&&(Me.length<Me.highWaterMark||Me.length===0)}function p(F,K,Ie,Pe){K.flowing&&K.length===0&&!K.sync&&F.listenerCount("data")>0?((K.state&ve)!==0?K.awaitDrainWriters.clear():K.awaitDrainWriters=null,K.dataEmitted=!0,F.emit("data",Ie)):(K.length+=K.objectMode?1:Ie.length,Pe?K.buffer.unshift(Ie):K.buffer.push(Ie),(K.state&le)!==0&&te(F)),re(F,K)}ye.prototype.isPaused=function(){let F=this._readableState;return F[M]===!0||F.flowing===!1},ye.prototype.setEncoding=function(F){let K=new ce(F);this._readableState.decoder=K,this._readableState.encoding=this._readableState.decoder.encoding;let Ie=this._readableState.buffer,Pe="";for(let Me of Ie)Pe+=K.write(Me);return Ie.clear(),Pe!==""&&Ie.push(Pe),this._readableState.length=Pe.length,this};var v=1073741824;function E(F){if(F>v)throw new D("size","<= 1GiB",F);return F--,F|=F>>>1,F|=F>>>2,F|=F>>>4,F|=F>>>8,F|=F>>>16,F++,F}function P(F,K){return F<=0||K.length===0&&K.ended?0:(K.state&Y)!==0?1:o(F)?K.flowing&&K.length?K.buffer.first().length:K.length:F<=K.length?F:K.ended?K.length:0}ye.prototype.read=function(F){x("read",F),F===void 0?F=NaN:s(F)||(F=i(F,10));let K=this._readableState,Ie=F;if(F>K.highWaterMark&&(K.highWaterMark=E(F)),F!==0&&(K.state&=~$),F===0&&K.needReadable&&((K.highWaterMark!==0?K.length>=K.highWaterMark:K.length>0)||K.ended))return x("read: emitReadable",K.length,K.ended),K.length===0&&K.ended?qe(this):te(this),null;if(F=P(F,K),F===0&&K.ended)return K.length===0&&qe(this),null;let Pe=(K.state&le)!==0;if(x("need readable",Pe),(K.length===0||K.length-F<K.highWaterMark)&&(Pe=!0,x("length less than watermark",Pe)),K.ended||K.reading||K.destroyed||K.errored||!K.constructed)Pe=!1,x("reading, ended or constructing",Pe);else if(Pe){x("do read"),K.state|=we|W,K.length===0&&(K.state|=le);try{this._read(K.highWaterMark)}catch(st){N(this,st)}K.state&=~W,K.reading||(F=P(Ie,K))}let Me;return F>0?Me=Oe(F,K):Me=null,Me===null?(K.needReadable=K.length<=K.highWaterMark,F=0):(K.length-=F,K.multiAwaitDrain?K.awaitDrainWriters.clear():K.awaitDrainWriters=null),K.length===0&&(K.ended||(K.needReadable=!0),Ie!==F&&K.ended&&qe(this)),Me!==null&&!K.errorEmitted&&!K.closeEmitted&&(K.dataEmitted=!0,this.emit("data",Me)),Me};function V(F,K){if(x("onEofChunk"),!K.ended){if(K.decoder){let Ie=K.decoder.end();Ie&&Ie.length&&(K.buffer.push(Ie),K.length+=K.objectMode?1:Ie.length)}K.ended=!0,K.sync?te(F):(K.needReadable=!1,K.emittedReadable=!0,fe(F))}}function te(F){let K=F._readableState;x("emitReadable",K.needReadable,K.emittedReadable),K.needReadable=!1,K.emittedReadable||(x("emitReadable",K.flowing),K.emittedReadable=!0,r.nextTick(fe,F))}function fe(F){let K=F._readableState;x("emitReadable_",K.destroyed,K.length,K.ended),!K.destroyed&&!K.errored&&(K.length||K.ended)&&(F.emit("readable"),K.emittedReadable=!1),K.needReadable=!K.flowing&&!K.ended&&K.length<=K.highWaterMark,Fe(F)}function re(F,K){!K.readingMore&&K.constructed&&(K.readingMore=!0,r.nextTick(oe,F,K))}function oe(F,K){for(;!K.reading&&!K.ended&&(K.length<K.highWaterMark||K.flowing&&K.length===0);){let Ie=K.length;if(x("maybeReadMore read 0"),F.read(0),Ie===K.length)break}K.readingMore=!1}ye.prototype._read=function(F){throw new T("_read()")},ye.prototype.pipe=function(F,K){let Ie=this,Pe=this._readableState;Pe.pipes.length===1&&(Pe.multiAwaitDrain||(Pe.multiAwaitDrain=!0,Pe.awaitDrainWriters=new d(Pe.awaitDrainWriters?[Pe.awaitDrainWriters]:[]))),Pe.pipes.push(F),x("pipe count=%d opts=%j",Pe.pipes.length,K);let Me=(!K||K.end!==!1)&&F!==r.stdout&&F!==r.stderr?ht:qr;Pe.endEmitted?r.nextTick(Me):Ie.once("end",Me),F.on("unpipe",st);function st(Gt,lr){x("onunpipe"),Gt===Ie&&lr&&lr.hasUnpiped===!1&&(lr.hasUnpiped=!0,ar())}function ht(){x("onend"),F.end()}let pt,zt=!1;function ar(){x("cleanup"),F.removeListener("close",Kt),F.removeListener("finish",Er),pt&&F.removeListener("drain",pt),F.removeListener("error",$r),F.removeListener("unpipe",st),Ie.removeListener("end",ht),Ie.removeListener("end",qr),Ie.removeListener("data",is),zt=!0,pt&&Pe.awaitDrainWriters&&(!F._writableState||F._writableState.needDrain)&&pt()}function uo(){zt||(Pe.pipes.length===1&&Pe.pipes[0]===F?(x("false write response, pause",0),Pe.awaitDrainWriters=F,Pe.multiAwaitDrain=!1):Pe.pipes.length>1&&Pe.pipes.includes(F)&&(x("false write response, pause",Pe.awaitDrainWriters.size),Pe.awaitDrainWriters.add(F)),Ie.pause()),pt||(pt=de(Ie,F),F.on("drain",pt))}Ie.on("data",is);function is(Gt){x("ondata");let lr=F.write(Gt);x("dest.write",lr),lr===!1&&uo()}function $r(Gt){if(x("onerror",Gt),qr(),F.removeListener("error",$r),F.listenerCount("error")===0){let lr=F._writableState||F._readableState;lr&&!lr.errorEmitted?N(F,Gt):F.emit("error",Gt)}}S(F,"error",$r);function Kt(){F.removeListener("finish",Er),qr()}F.once("close",Kt);function Er(){x("onfinish"),F.removeListener("close",Kt),qr()}F.once("finish",Er);function qr(){x("unpipe"),Ie.unpipe(F)}return F.emit("pipe",Ie),F.writableNeedDrain===!0?uo():Pe.flowing||(x("pipe resume"),Ie.resume()),F};function de(F,K){return function(){let Ie=F._readableState;Ie.awaitDrainWriters===K?(x("pipeOnDrain",1),Ie.awaitDrainWriters=null):Ie.multiAwaitDrain&&(x("pipeOnDrain",Ie.awaitDrainWriters.size),Ie.awaitDrainWriters.delete(K)),(!Ie.awaitDrainWriters||Ie.awaitDrainWriters.size===0)&&F.listenerCount("data")&&F.resume()}}ye.prototype.unpipe=function(F){let K=this._readableState,Ie={hasUnpiped:!1};if(K.pipes.length===0)return this;if(!F){let Me=K.pipes;K.pipes=[],this.pause();for(let st=0;st<Me.length;st++)Me[st].emit("unpipe",this,{hasUnpiped:!1});return this}let Pe=n(K.pipes,F);return Pe===-1?this:(K.pipes.splice(Pe,1),K.pipes.length===0&&this.pause(),F.emit("unpipe",this,Ie),this)},ye.prototype.on=function(F,K){let Ie=b.prototype.on.call(this,F,K),Pe=this._readableState;return F==="data"?(Pe.readableListening=this.listenerCount("readable")>0,Pe.flowing!==!1&&this.resume()):F==="readable"&&!Pe.endEmitted&&!Pe.readableListening&&(Pe.readableListening=Pe.needReadable=!0,Pe.flowing=!1,Pe.emittedReadable=!1,x("on readable",Pe.length,Pe.reading),Pe.length?te(this):Pe.reading||r.nextTick(ke,this)),Ie},ye.prototype.addListener=ye.prototype.on,ye.prototype.removeListener=function(F,K){let Ie=b.prototype.removeListener.call(this,F,K);return F==="readable"&&r.nextTick(ge,this),Ie},ye.prototype.off=ye.prototype.removeListener,ye.prototype.removeAllListeners=function(F){let K=b.prototype.removeAllListeners.apply(this,arguments);return(F==="readable"||F===void 0)&&r.nextTick(ge,this),K};function ge(F){let K=F._readableState;K.readableListening=F.listenerCount("readable")>0,K.resumeScheduled&&K[M]===!1?K.flowing=!0:F.listenerCount("data")>0?F.resume():K.readableListening||(K.flowing=null)}function ke(F){x("readable nexttick read 0"),F.read(0)}ye.prototype.resume=function(){let F=this._readableState;return F.flowing||(x("resume"),F.flowing=!F.readableListening,Te(this,F)),F[M]=!1,this};function Te(F,K){K.resumeScheduled||(K.resumeScheduled=!0,r.nextTick(Re,F,K))}function Re(F,K){x("resume",K.reading),K.reading||F.read(0),K.resumeScheduled=!1,F.emit("resume"),Fe(F),K.flowing&&!K.reading&&F.read(0)}ye.prototype.pause=function(){return x("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(x("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[M]=!0,this};function Fe(F){let K=F._readableState;for(x("flow",K.flowing);K.flowing&&F.read()!==null;);}ye.prototype.wrap=function(F){let K=!1;F.on("data",Pe=>{!this.push(Pe)&&F.pause&&(K=!0,F.pause())}),F.on("end",()=>{this.push(null)}),F.on("error",Pe=>{N(this,Pe)}),F.on("close",()=>{this.destroy()}),F.on("destroy",()=>{this.destroy()}),this._read=()=>{K&&F.resume&&(K=!1,F.resume())};let Ie=l(F);for(let Pe=1;Pe<Ie.length;Pe++){let Me=Ie[Pe];this[Me]===void 0&&typeof F[Me]=="function"&&(this[Me]=F[Me].bind(F))}return this},ye.prototype[h]=function(){return De(this)},ye.prototype.iterator=function(F){return F!==void 0&&J(F,"options"),De(this,F)};function De(F,K){typeof F.read!="function"&&(F=ye.wrap(F,{objectMode:!0}));let Ie=We(F,K);return Ie.stream=F,Ie}async function*We(F,K){let Ie=B;function Pe(ht){this===F?(Ie(),Ie=B):Ie=ht}F.on("readable",Pe);let Me,st=_(F,{writable:!1},ht=>{Me=ht?j(Me,ht):null,Ie(),Ie=B});try{for(;;){let ht=F.destroyed?null:F.read();if(ht!==null)yield ht;else{if(Me)throw Me;if(Me===null)return;await new u(Pe)}}}catch(ht){throw Me=j(Me,ht),Me}finally{(Me||(K==null?void 0:K.destroyOnReturn)!==!1)&&(Me===void 0||F._readableState.autoDestroy)?C.destroyer(F,null):(F.off("readable",Pe),st())}}a(ye.prototype,{readable:{__proto__:null,get(){let F=this._readableState;return!!F&&F.readable!==!1&&!F.destroyed&&!F.errorEmitted&&!F.endEmitted},set(F){this._readableState&&(this._readableState.readable=!!F)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(F){this._readableState&&(this._readableState.flowing=F)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(F){this._readableState&&(this._readableState.destroyed=F)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),a(je.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[M]!==!1},set(F){this[M]=!!F}}}),ye._fromList=Oe;function Oe(F,K){if(K.length===0)return null;let Ie;return K.objectMode?Ie=K.buffer.shift():!F||F>=K.length?(K.decoder?Ie=K.buffer.join(""):K.buffer.length===1?Ie=K.buffer.first():Ie=K.buffer.concat(K.length),K.buffer.clear()):Ie=K.buffer.consume(F,K.decoder),Ie}function qe(F){let K=F._readableState;x("endReadable",K.endEmitted),K.endEmitted||(K.ended=!0,r.nextTick(Ge,K,F))}function Ge(F,K){if(x("endReadableNT",F.endEmitted,F.length),!F.errored&&!F.closeEmitted&&!F.endEmitted&&F.length===0){if(F.endEmitted=!0,K.emit("end"),K.writable&&K.allowHalfOpen===!1)r.nextTick(He,K);else if(F.autoDestroy){let Ie=K._writableState;(!Ie||Ie.autoDestroy&&(Ie.finished||Ie.writable===!1))&&K.destroy()}}}function He(F){F.writable&&!F.writableEnded&&!F.destroyed&&F.end()}ye.from=function(F,K){return Q(ye,F,K)};var Ye;function ot(){return Ye===void 0&&(Ye={}),Ye}ye.fromWeb=function(F,K){return ot().newStreamReadableFromReadableStream(F,K)},ye.toWeb=function(F,K){return ot().newReadableStreamFromStreamReadable(F,K)},ye.wrap=function(F,K){var Ie,Pe;return new ye({objectMode:(Ie=(Pe=F.readableObjectMode)!==null&&Pe!==void 0?Pe:F.objectMode)!==null&&Ie!==void 0?Ie:!0,...K,destroy(Me,st){C.destroyer(F,Me),st(Me)}}).wrap(F)}}),Bl=Ce((e,t)=>{xe(),Se(),_e();var r=Br(),{ArrayPrototypeSlice:n,Error:s,FunctionPrototypeSymbolHasInstance:o,ObjectDefineProperty:i,ObjectDefineProperties:a,ObjectSetPrototypeOf:l,StringPrototypeToLowerCase:c,Symbol:u,SymbolHasInstance:d}=dt();t.exports=J,J.WritableState=U;var{EventEmitter:f}=(zr(),nt(vr)),h=zl().Stream,{Buffer:y}=(vt(),nt(yt)),m=wn(),{addAbortSignal:b}=Ei(),{getHighWaterMark:S,getDefaultHighWaterMark:g}=ki(),{ERR_INVALID_ARG_TYPE:w,ERR_METHOD_NOT_IMPLEMENTED:_,ERR_MULTIPLE_CALLBACK:x,ERR_STREAM_CANNOT_PIPE:I,ERR_STREAM_DESTROYED:C,ERR_STREAM_ALREADY_FINISHED:A,ERR_STREAM_NULL_VALUES:O,ERR_STREAM_WRITE_AFTER_END:j,ERR_UNKNOWN_ENCODING:R}=At().codes,{errorOrDestroy:T}=m;l(J.prototype,h.prototype),l(J,h);function D(){}var H=u("kOnFinished");function U(G,ie,he){typeof he!="boolean"&&(he=ie instanceof rr()),this.objectMode=!!(G&&G.objectMode),he&&(this.objectMode=this.objectMode||!!(G&&G.writableObjectMode)),this.highWaterMark=G?S(this,G,"writableHighWaterMark",he):g(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let be=!!(G&&G.decodeStrings===!1);this.decodeStrings=!be,this.defaultEncoding=G&&G.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=N.bind(void 0,ie),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,ae(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!G||G.emitClose!==!1,this.autoDestroy=!G||G.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[H]=[]}function ae(G){G.buffered=[],G.bufferedIndex=0,G.allBuffers=!0,G.allNoop=!0}U.prototype.getBuffer=function(){return n(this.buffered,this.bufferedIndex)},i(U.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function J(G){let ie=this instanceof rr();if(!ie&&!o(J,this))return new J(G);this._writableState=new U(G,this,ie),G&&(typeof G.write=="function"&&(this._write=G.write),typeof G.writev=="function"&&(this._writev=G.writev),typeof G.destroy=="function"&&(this._destroy=G.destroy),typeof G.final=="function"&&(this._final=G.final),typeof G.construct=="function"&&(this._construct=G.construct),G.signal&&b(G.signal,this)),h.call(this,G),m.construct(this,()=>{let he=this._writableState;he.writing||we(this,he),$(this,he)})}i(J,d,{__proto__:null,value:function(G){return o(this,G)?!0:this!==J?!1:G&&G._writableState instanceof U}}),J.prototype.pipe=function(){T(this,new I)};function M(G,ie,he,be){let ve=G._writableState;if(typeof he=="function")be=he,he=ve.defaultEncoding;else{if(!he)he=ve.defaultEncoding;else if(he!=="buffer"&&!y.isEncoding(he))throw new R(he);typeof be!="function"&&(be=D)}if(ie===null)throw new O;if(!ve.objectMode)if(typeof ie=="string")ve.decodeStrings!==!1&&(ie=y.from(ie,he),he="buffer");else if(ie instanceof y)he="buffer";else if(h._isUint8Array(ie))ie=h._uint8ArrayToBuffer(ie),he="buffer";else throw new w("chunk",["string","Buffer","Uint8Array"],ie);let Ae;return ve.ending?Ae=new j:ve.destroyed&&(Ae=new C("write")),Ae?(r.nextTick(be,Ae),T(G,Ae,!0),Ae):(ve.pendingcb++,ce(G,ve,ie,he,be))}J.prototype.write=function(G,ie,he){return M(this,G,ie,he)===!0},J.prototype.cork=function(){this._writableState.corked++},J.prototype.uncork=function(){let G=this._writableState;G.corked&&(G.corked--,G.writing||we(this,G))},J.prototype.setDefaultEncoding=function(G){if(typeof G=="string"&&(G=c(G)),!y.isEncoding(G))throw new R(G);return this._writableState.defaultEncoding=G,this};function ce(G,ie,he,be,ve){let Ae=ie.objectMode?1:he.length;ie.length+=Ae;let se=ie.length<ie.highWaterMark;return se||(ie.needDrain=!0),ie.writing||ie.corked||ie.errored||!ie.constructed?(ie.buffered.push({chunk:he,encoding:be,callback:ve}),ie.allBuffers&&be!=="buffer"&&(ie.allBuffers=!1),ie.allNoop&&ve!==D&&(ie.allNoop=!1)):(ie.writelen=Ae,ie.writecb=ve,ie.writing=!0,ie.sync=!0,G._write(he,be,ie.onwrite),ie.sync=!1),se&&!ie.errored&&!ie.destroyed}function Q(G,ie,he,be,ve,Ae,se){ie.writelen=be,ie.writecb=se,ie.writing=!0,ie.sync=!0,ie.destroyed?ie.onwrite(new C("write")):he?G._writev(ve,ie.onwrite):G._write(ve,Ae,ie.onwrite),ie.sync=!1}function B(G,ie,he,be){--ie.pendingcb,be(he),X(ie),T(G,he)}function N(G,ie){let he=G._writableState,be=he.sync,ve=he.writecb;if(typeof ve!="function"){T(G,new x);return}he.writing=!1,he.writecb=null,he.length-=he.writelen,he.writelen=0,ie?(ie.stack,he.errored||(he.errored=ie),G._readableState&&!G._readableState.errored&&(G._readableState.errored=ie),be?r.nextTick(B,G,he,ie,ve):B(G,he,ie,ve)):(he.buffered.length>he.bufferedIndex&&we(G,he),be?he.afterWriteTickInfo!==null&&he.afterWriteTickInfo.cb===ve?he.afterWriteTickInfo.count++:(he.afterWriteTickInfo={count:1,cb:ve,stream:G,state:he},r.nextTick(Y,he.afterWriteTickInfo)):ue(G,he,1,ve))}function Y({stream:G,state:ie,count:he,cb:be}){return ie.afterWriteTickInfo=null,ue(G,ie,he,be)}function ue(G,ie,he,be){for(!ie.ending&&!G.destroyed&&ie.length===0&&ie.needDrain&&(ie.needDrain=!1,G.emit("drain"));he-- >0;)ie.pendingcb--,be();ie.destroyed&&X(ie),$(G,ie)}function X(G){if(G.writing)return;for(let ve=G.bufferedIndex;ve<G.buffered.length;++ve){var ie;let{chunk:Ae,callback:se}=G.buffered[ve],Ee=G.objectMode?1:Ae.length;G.length-=Ee,se((ie=G.errored)!==null&&ie!==void 0?ie:new C("write"))}let he=G[H].splice(0);for(let ve=0;ve<he.length;ve++){var be;he[ve]((be=G.errored)!==null&&be!==void 0?be:new C("end"))}ae(G)}function we(G,ie){if(ie.corked||ie.bufferProcessing||ie.destroyed||!ie.constructed)return;let{buffered:he,bufferedIndex:be,objectMode:ve}=ie,Ae=he.length-be;if(!Ae)return;let se=be;if(ie.bufferProcessing=!0,Ae>1&&G._writev){ie.pendingcb-=Ae-1;let Ee=ie.allNoop?D:ye=>{for(let $e=se;$e<he.length;++$e)he[$e].callback(ye)},je=ie.allNoop&&se===0?he:n(he,se);je.allBuffers=ie.allBuffers,Q(G,ie,!0,ie.length,je,"",Ee),ae(ie)}else{do{let{chunk:Ee,encoding:je,callback:ye}=he[se];he[se++]=null;let $e=ve?1:Ee.length;Q(G,ie,!1,$e,Ee,je,ye)}while(se<he.length&&!ie.writing);se===he.length?ae(ie):se>256?(he.splice(0,se),ie.bufferedIndex=0):ie.bufferedIndex=se}ie.bufferProcessing=!1}J.prototype._write=function(G,ie,he){if(this._writev)this._writev([{chunk:G,encoding:ie}],he);else throw new _("_write()")},J.prototype._writev=null,J.prototype.end=function(G,ie,he){let be=this._writableState;typeof G=="function"?(he=G,G=null,ie=null):typeof ie=="function"&&(he=ie,ie=null);let ve;if(G!=null){let Ae=M(this,G,ie);Ae instanceof s&&(ve=Ae)}return be.corked&&(be.corked=1,this.uncork()),ve||(!be.errored&&!be.ending?(be.ending=!0,$(this,be,!0),be.ended=!0):be.finished?ve=new A("end"):be.destroyed&&(ve=new C("end"))),typeof he=="function"&&(ve||be.finished?r.nextTick(he,ve):be[H].push(he)),this};function L(G){return G.ending&&!G.destroyed&&G.constructed&&G.length===0&&!G.errored&&G.buffered.length===0&&!G.finished&&!G.writing&&!G.errorEmitted&&!G.closeEmitted}function W(G,ie){let he=!1;function be(ve){if(he){T(G,ve??x());return}if(he=!0,ie.pendingcb--,ve){let Ae=ie[H].splice(0);for(let se=0;se<Ae.length;se++)Ae[se](ve);T(G,ve,ie.sync)}else L(ie)&&(ie.prefinished=!0,G.emit("prefinish"),ie.pendingcb++,r.nextTick(ee,G,ie))}ie.sync=!0,ie.pendingcb++;try{G._final(be)}catch(ve){be(ve)}ie.sync=!1}function le(G,ie){!ie.prefinished&&!ie.finalCalled&&(typeof G._final=="function"&&!ie.destroyed?(ie.finalCalled=!0,W(G,ie)):(ie.prefinished=!0,G.emit("prefinish")))}function $(G,ie,he){L(ie)&&(le(G,ie),ie.pendingcb===0&&(he?(ie.pendingcb++,r.nextTick((be,ve)=>{L(ve)?ee(be,ve):ve.pendingcb--},G,ie)):L(ie)&&(ie.pendingcb++,ee(G,ie))))}function ee(G,ie){ie.pendingcb--,ie.finished=!0;let he=ie[H].splice(0);for(let be=0;be<he.length;be++)he[be]();if(G.emit("finish"),ie.autoDestroy){let be=G._readableState;(!be||be.autoDestroy&&(be.endEmitted||be.readable===!1))&&G.destroy()}}a(J.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(G){this._writableState&&(this._writableState.destroyed=G)}},writable:{__proto__:null,get(){let G=this._writableState;return!!G&&G.writable!==!1&&!G.destroyed&&!G.errored&&!G.ending&&!G.ended},set(G){this._writableState&&(this._writableState.writable=!!G)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let G=this._writableState;return G?!G.destroyed&&!G.ending&&G.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var ne=m.destroy;J.prototype.destroy=function(G,ie){let he=this._writableState;return!he.destroyed&&(he.bufferedIndex<he.buffered.length||he[H].length)&&r.nextTick(X,he),ne.call(this,G,ie),this},J.prototype._undestroy=m.undestroy,J.prototype._destroy=function(G,ie){ie(G)},J.prototype[f.captureRejectionSymbol]=function(G){this.destroy(G)};var me;function pe(){return me===void 0&&(me={}),me}J.fromWeb=function(G,ie){return pe().newStreamWritableFromWritableStream(G,ie)},J.toWeb=function(G){return pe().newWritableStreamFromStreamWritable(G)}}),K_=Ce((e,t)=>{xe(),Se(),_e();var r=Br(),n=(vt(),nt(yt)),{isReadable:s,isWritable:o,isIterable:i,isNodeStream:a,isReadableNodeStream:l,isWritableNodeStream:c,isDuplexNodeStream:u,isReadableStream:d,isWritableStream:f}=tr(),h=wr(),{AbortError:y,codes:{ERR_INVALID_ARG_TYPE:m,ERR_INVALID_RETURN_VALUE:b}}=At(),{destroyer:S}=wn(),g=rr(),w=Ai(),_=Bl(),{createDeferredPromise:x}=It(),I=fp(),C=globalThis.Blob||n.Blob,A=typeof C<"u"?function(H){return H instanceof C}:function(H){return!1},O=globalThis.AbortController||no().AbortController,{FunctionPrototypeCall:j}=dt(),R=class extends g{constructor(H){super(H),(H==null?void 0:H.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(H==null?void 0:H.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};t.exports=function H(U,ae){if(u(U))return U;if(l(U))return D({readable:U});if(c(U))return D({writable:U});if(a(U))return D({writable:!1,readable:!1});if(d(U))return D({readable:w.fromWeb(U)});if(f(U))return D({writable:_.fromWeb(U)});if(typeof U=="function"){let{value:M,write:ce,final:Q,destroy:B}=T(U);if(i(M))return I(R,M,{objectMode:!0,write:ce,final:Q,destroy:B});let N=M==null?void 0:M.then;if(typeof N=="function"){let Y,ue=j(N,M,X=>{if(X!=null)throw new b("nully","body",X)},X=>{S(Y,X)});return Y=new R({objectMode:!0,readable:!1,write:ce,final(X){Q(async()=>{try{await ue,r.nextTick(X,null)}catch(we){r.nextTick(X,we)}})},destroy:B})}throw new b("Iterable, AsyncIterable or AsyncFunction",ae,M)}if(A(U))return H(U.arrayBuffer());if(i(U))return I(R,U,{objectMode:!0,writable:!1});if(d(U==null?void 0:U.readable)&&f(U==null?void 0:U.writable))return R.fromWeb(U);if(typeof(U==null?void 0:U.writable)=="object"||typeof(U==null?void 0:U.readable)=="object"){let M=U!=null&&U.readable?l(U==null?void 0:U.readable)?U==null?void 0:U.readable:H(U.readable):void 0,ce=U!=null&&U.writable?c(U==null?void 0:U.writable)?U==null?void 0:U.writable:H(U.writable):void 0;return D({readable:M,writable:ce})}let J=U==null?void 0:U.then;if(typeof J=="function"){let M;return j(J,U,ce=>{ce!=null&&M.push(ce),M.push(null)},ce=>{S(M,ce)}),M=new R({objectMode:!0,writable:!1,read(){}})}throw new m(ae,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],U)};function T(H){let{promise:U,resolve:ae}=x(),J=new O,M=J.signal;return{value:H((async function*(){for(;;){let ce=U;U=null;let{chunk:Q,done:B,cb:N}=await ce;if(r.nextTick(N),B)return;if(M.aborted)throw new y(void 0,{cause:M.reason});({promise:U,resolve:ae}=x()),yield Q}})(),{signal:M}),write(ce,Q,B){let N=ae;ae=null,N({chunk:ce,done:!1,cb:B})},final(ce){let Q=ae;ae=null,Q({done:!0,cb:ce})},destroy(ce,Q){J.abort(),Q(ce)}}}function D(H){let U=H.readable&&typeof H.readable.read!="function"?w.wrap(H.readable):H.readable,ae=H.writable,J=!!s(U),M=!!o(ae),ce,Q,B,N,Y;function ue(X){let we=N;N=null,we?we(X):X&&Y.destroy(X)}return Y=new R({readableObjectMode:!!(U!=null&&U.readableObjectMode),writableObjectMode:!!(ae!=null&&ae.writableObjectMode),readable:J,writable:M}),M&&(h(ae,X=>{M=!1,X&&S(U,X),ue(X)}),Y._write=function(X,we,L){ae.write(X,we)?L():ce=L},Y._final=function(X){ae.end(),Q=X},ae.on("drain",function(){if(ce){let X=ce;ce=null,X()}}),ae.on("finish",function(){if(Q){let X=Q;Q=null,X()}})),J&&(h(U,X=>{J=!1,X&&S(U,X),ue(X)}),U.on("readable",function(){if(B){let X=B;B=null,X()}}),U.on("end",function(){Y.push(null)}),Y._read=function(){for(;;){let X=U.read();if(X===null){B=Y._read;return}if(!Y.push(X))return}}),Y._destroy=function(X,we){!X&&N!==null&&(X=new y),B=null,ce=null,Q=null,N===null?we(X):(N=we,S(ae,X),S(U,X))},Y}}),rr=Ce((e,t)=>{xe(),Se(),_e();var{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:n,ObjectKeys:s,ObjectSetPrototypeOf:o}=dt();t.exports=l;var i=Ai(),a=Bl();o(l.prototype,i.prototype),o(l,i);{let f=s(a.prototype);for(let h=0;h<f.length;h++){let y=f[h];l.prototype[y]||(l.prototype[y]=a.prototype[y])}}function l(f){if(!(this instanceof l))return new l(f);i.call(this,f),a.call(this,f),f?(this.allowHalfOpen=f.allowHalfOpen!==!1,f.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),f.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}r(l.prototype,{writable:{__proto__:null,...n(a.prototype,"writable")},writableHighWaterMark:{__proto__:null,...n(a.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...n(a.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...n(a.prototype,"writableBuffer")},writableLength:{__proto__:null,...n(a.prototype,"writableLength")},writableFinished:{__proto__:null,...n(a.prototype,"writableFinished")},writableCorked:{__proto__:null,...n(a.prototype,"writableCorked")},writableEnded:{__proto__:null,...n(a.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...n(a.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(f){this._readableState&&this._writableState&&(this._readableState.destroyed=f,this._writableState.destroyed=f)}}});var c;function u(){return c===void 0&&(c={}),c}l.fromWeb=function(f,h){return u().newStreamDuplexFromReadableWritablePair(f,h)},l.toWeb=function(f){return u().newReadableWritablePairFromDuplex(f)};var d;l.from=function(f){return d||(d=K_()),d(f,"body")}}),hp=Ce((e,t)=>{xe(),Se(),_e();var{ObjectSetPrototypeOf:r,Symbol:n}=dt();t.exports=l;var{ERR_METHOD_NOT_IMPLEMENTED:s}=At().codes,o=rr(),{getHighWaterMark:i}=ki();r(l.prototype,o.prototype),r(l,o);var a=n("kCallback");function l(d){if(!(this instanceof l))return new l(d);let f=d?i(this,d,"readableHighWaterMark",!0):null;f===0&&(d={...d,highWaterMark:null,readableHighWaterMark:f,writableHighWaterMark:d.writableHighWaterMark||0}),o.call(this,d),this._readableState.sync=!1,this[a]=null,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",u)}function c(d){typeof this._flush=="function"&&!this.destroyed?this._flush((f,h)=>{if(f){d?d(f):this.destroy(f);return}h!=null&&this.push(h),this.push(null),d&&d()}):(this.push(null),d&&d())}function u(){this._final!==c&&c.call(this)}l.prototype._final=c,l.prototype._transform=function(d,f,h){throw new s("_transform()")},l.prototype._write=function(d,f,h){let y=this._readableState,m=this._writableState,b=y.length;this._transform(d,f,(S,g)=>{if(S){h(S);return}g!=null&&this.push(g),m.ended||b===y.length||y.length<y.highWaterMark?h():this[a]=h})},l.prototype._read=function(){if(this[a]){let d=this[a];this[a]=null,d()}}}),pp=Ce((e,t)=>{xe(),Se(),_e();var{ObjectSetPrototypeOf:r}=dt();t.exports=s;var n=hp();r(s.prototype,n.prototype),r(s,n);function s(o){if(!(this instanceof s))return new s(o);n.call(this,o)}s.prototype._transform=function(o,i,a){a(null,o)}}),Ul=Ce((e,t)=>{xe(),Se(),_e();var r=Br(),{ArrayIsArray:n,Promise:s,SymbolAsyncIterator:o,SymbolDispose:i}=dt(),a=wr(),{once:l}=It(),c=wn(),u=rr(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:f,ERR_INVALID_RETURN_VALUE:h,ERR_MISSING_ARGS:y,ERR_STREAM_DESTROYED:m,ERR_STREAM_PREMATURE_CLOSE:b},AbortError:S}=At(),{validateFunction:g,validateAbortSignal:w}=io(),{isIterable:_,isReadable:x,isReadableNodeStream:I,isNodeStream:C,isTransformStream:A,isWebStream:O,isReadableStream:j,isReadableFinished:R}=tr(),T=globalThis.AbortController||no().AbortController,D,H,U;function ae(X,we,L){let W=!1;X.on("close",()=>{W=!0});let le=a(X,{readable:we,writable:L},$=>{W=!$});return{destroy:$=>{W||(W=!0,c.destroyer(X,$||new m("pipe")))},cleanup:le}}function J(X){return g(X[X.length-1],"streams[stream.length - 1]"),X.pop()}function M(X){if(_(X))return X;if(I(X))return ce(X);throw new f("val",["Readable","Iterable","AsyncIterable"],X)}async function*ce(X){H||(H=Ai()),yield*H.prototype[o].call(X)}async function Q(X,we,L,{end:W}){let le,$=null,ee=pe=>{if(pe&&(le=pe),$){let G=$;$=null,G()}},ne=()=>new s((pe,G)=>{le?G(le):$=()=>{le?G(le):pe()}});we.on("drain",ee);let me=a(we,{readable:!1},ee);try{we.writableNeedDrain&&await ne();for await(let pe of X)we.write(pe)||await ne();W&&(we.end(),await ne()),L()}catch(pe){L(le!==pe?d(le,pe):pe)}finally{me(),we.off("drain",ee)}}async function B(X,we,L,{end:W}){A(we)&&(we=we.writable);let le=we.getWriter();try{for await(let $ of X)await le.ready,le.write($).catch(()=>{});await le.ready,W&&await le.close(),L()}catch($){try{await le.abort($),L($)}catch(ee){L(ee)}}}function N(...X){return Y(X,l(J(X)))}function Y(X,we,L){if(X.length===1&&n(X[0])&&(X=X[0]),X.length<2)throw new y("streams");let W=new T,le=W.signal,$=L==null?void 0:L.signal,ee=[];w($,"options.signal");function ne(){ve(new S)}U=U||It().addAbortListener;let me;$&&(me=U($,ne));let pe,G,ie=[],he=0;function be(je){ve(je,--he===0)}function ve(je,ye){var $e;if(je&&(!pe||pe.code==="ERR_STREAM_PREMATURE_CLOSE")&&(pe=je),!(!pe&&!ye)){for(;ie.length;)ie.shift()(pe);($e=me)===null||$e===void 0||$e[i](),W.abort(),ye&&(pe||ee.forEach(p=>p()),r.nextTick(we,pe,G))}}let Ae;for(let je=0;je<X.length;je++){let ye=X[je],$e=je<X.length-1,p=je>0,v=$e||(L==null?void 0:L.end)!==!1,E=je===X.length-1;if(C(ye)){let P=function(V){V&&V.name!=="AbortError"&&V.code!=="ERR_STREAM_PREMATURE_CLOSE"&&be(V)};if(v){let{destroy:V,cleanup:te}=ae(ye,$e,p);ie.push(V),x(ye)&&E&&ee.push(te)}ye.on("error",P),x(ye)&&E&&ee.push(()=>{ye.removeListener("error",P)})}if(je===0)if(typeof ye=="function"){if(Ae=ye({signal:le}),!_(Ae))throw new h("Iterable, AsyncIterable or Stream","source",Ae)}else _(ye)||I(ye)||A(ye)?Ae=ye:Ae=u.from(ye);else if(typeof ye=="function"){if(A(Ae)){var se;Ae=M((se=Ae)===null||se===void 0?void 0:se.readable)}else Ae=M(Ae);if(Ae=ye(Ae,{signal:le}),$e){if(!_(Ae,!0))throw new h("AsyncIterable",`transform[${je-1}]`,Ae)}else{var Ee;D||(D=pp());let P=new D({objectMode:!0}),V=(Ee=Ae)===null||Ee===void 0?void 0:Ee.then;if(typeof V=="function")he++,V.call(Ae,re=>{G=re,re!=null&&P.write(re),v&&P.end(),r.nextTick(be)},re=>{P.destroy(re),r.nextTick(be,re)});else if(_(Ae,!0))he++,Q(Ae,P,be,{end:v});else if(j(Ae)||A(Ae)){let re=Ae.readable||Ae;he++,Q(re,P,be,{end:v})}else throw new h("AsyncIterable or Promise","destination",Ae);Ae=P;let{destroy:te,cleanup:fe}=ae(Ae,!1,!0);ie.push(te),E&&ee.push(fe)}}else if(C(ye)){if(I(Ae)){he+=2;let P=ue(Ae,ye,be,{end:v});x(ye)&&E&&ee.push(P)}else if(A(Ae)||j(Ae)){let P=Ae.readable||Ae;he++,Q(P,ye,be,{end:v})}else if(_(Ae))he++,Q(Ae,ye,be,{end:v});else throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Ae);Ae=ye}else if(O(ye)){if(I(Ae))he++,B(M(Ae),ye,be,{end:v});else if(j(Ae)||_(Ae))he++,B(Ae,ye,be,{end:v});else if(A(Ae))he++,B(Ae.readable,ye,be,{end:v});else throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Ae);Ae=ye}else Ae=u.from(ye)}return(le!=null&&le.aborted||$!=null&&$.aborted)&&r.nextTick(ne),Ae}function ue(X,we,L,{end:W}){let le=!1;if(we.on("close",()=>{le||L(new b)}),X.pipe(we,{end:!1}),W){let $=function(){le=!0,we.end()};R(X)?r.nextTick($):X.once("end",$)}else L();return a(X,{readable:!0,writable:!1},$=>{let ee=X._readableState;$&&$.code==="ERR_STREAM_PREMATURE_CLOSE"&&ee&&ee.ended&&!ee.errored&&!ee.errorEmitted?X.once("end",L).once("error",L):L($)}),a(we,{readable:!1,writable:!0},L)}t.exports={pipelineImpl:Y,pipeline:N}}),gp=Ce((e,t)=>{xe(),Se(),_e();var{pipeline:r}=Ul(),n=rr(),{destroyer:s}=wn(),{isNodeStream:o,isReadable:i,isWritable:a,isWebStream:l,isTransformStream:c,isWritableStream:u,isReadableStream:d}=tr(),{AbortError:f,codes:{ERR_INVALID_ARG_VALUE:h,ERR_MISSING_ARGS:y}}=At(),m=wr();t.exports=function(...b){if(b.length===0)throw new y("streams");if(b.length===1)return n.from(b[0]);let S=[...b];if(typeof b[0]=="function"&&(b[0]=n.from(b[0])),typeof b[b.length-1]=="function"){let T=b.length-1;b[T]=n.from(b[T])}for(let T=0;T<b.length;++T)if(!(!o(b[T])&&!l(b[T]))){if(T<b.length-1&&!(i(b[T])||d(b[T])||c(b[T])))throw new h(`streams[${T}]`,S[T],"must be readable");if(T>0&&!(a(b[T])||u(b[T])||c(b[T])))throw new h(`streams[${T}]`,S[T],"must be writable")}let g,w,_,x,I;function C(T){let D=x;x=null,D?D(T):T?I.destroy(T):!R&&!j&&I.destroy()}let A=b[0],O=r(b,C),j=!!(a(A)||u(A)||c(A)),R=!!(i(O)||d(O)||c(O));if(I=new n({writableObjectMode:!!(A!=null&&A.writableObjectMode),readableObjectMode:!!(O!=null&&O.readableObjectMode),writable:j,readable:R}),j){if(o(A))I._write=function(D,H,U){A.write(D,H)?U():g=U},I._final=function(D){A.end(),w=D},A.on("drain",function(){if(g){let D=g;g=null,D()}});else if(l(A)){let D=(c(A)?A.writable:A).getWriter();I._write=async function(H,U,ae){try{await D.ready,D.write(H).catch(()=>{}),ae()}catch(J){ae(J)}},I._final=async function(H){try{await D.ready,D.close().catch(()=>{}),w=H}catch(U){H(U)}}}let T=c(O)?O.readable:O;m(T,()=>{if(w){let D=w;w=null,D()}})}if(R){if(o(O))O.on("readable",function(){if(_){let T=_;_=null,T()}}),O.on("end",function(){I.push(null)}),I._read=function(){for(;;){let T=O.read();if(T===null){_=I._read;return}if(!I.push(T))return}};else if(l(O)){let T=(c(O)?O.readable:O).getReader();I._read=async function(){for(;;)try{let{value:D,done:H}=await T.read();if(!I.push(D))return;if(H){I.push(null);return}}catch{return}}}}return I._destroy=function(T,D){!T&&x!==null&&(T=new f),_=null,g=null,w=null,x===null?D(T):(x=D,o(O)&&s(O,T))},I}}),G_=Ce((e,t)=>{xe(),Se(),_e();var r=globalThis.AbortController||no().AbortController,{codes:{ERR_INVALID_ARG_VALUE:n,ERR_INVALID_ARG_TYPE:s,ERR_MISSING_ARGS:o,ERR_OUT_OF_RANGE:i},AbortError:a}=At(),{validateAbortSignal:l,validateInteger:c,validateObject:u}=io(),d=dt().Symbol("kWeak"),f=dt().Symbol("kResistStopPropagation"),{finished:h}=wr(),y=gp(),{addAbortSignalNoValidate:m}=Ei(),{isWritable:b,isNodeStream:S}=tr(),{deprecate:g}=It(),{ArrayPrototypePush:w,Boolean:_,MathFloor:x,Number:I,NumberIsNaN:C,Promise:A,PromiseReject:O,PromiseResolve:j,PromisePrototypeThen:R,Symbol:T}=dt(),D=T("kEmpty"),H=T("kEof");function U($,ee){if(ee!=null&&u(ee,"options"),(ee==null?void 0:ee.signal)!=null&&l(ee.signal,"options.signal"),S($)&&!b($))throw new n("stream",$,"must be writable");let ne=y(this,$);return ee!=null&&ee.signal&&m(ee.signal,ne),ne}function ae($,ee){if(typeof $!="function")throw new s("fn",["Function","AsyncFunction"],$);ee!=null&&u(ee,"options"),(ee==null?void 0:ee.signal)!=null&&l(ee.signal,"options.signal");let ne=1;(ee==null?void 0:ee.concurrency)!=null&&(ne=x(ee.concurrency));let me=ne-1;return(ee==null?void 0:ee.highWaterMark)!=null&&(me=x(ee.highWaterMark)),c(ne,"options.concurrency",1),c(me,"options.highWaterMark",0),me+=ne,(async function*(){let pe=It().AbortSignalAny([ee==null?void 0:ee.signal].filter(_)),G=this,ie=[],he={signal:pe},be,ve,Ae=!1,se=0;function Ee(){Ae=!0,je()}function je(){se-=1,ye()}function ye(){ve&&!Ae&&se<ne&&ie.length<me&&(ve(),ve=null)}async function $e(){try{for await(let p of G){if(Ae)return;if(pe.aborted)throw new a;try{if(p=$(p,he),p===D)continue;p=j(p)}catch(v){p=O(v)}se+=1,R(p,je,Ee),ie.push(p),be&&(be(),be=null),!Ae&&(ie.length>=me||se>=ne)&&await new A(v=>{ve=v})}ie.push(H)}catch(p){let v=O(p);R(v,je,Ee),ie.push(v)}finally{Ae=!0,be&&(be(),be=null)}}$e();try{for(;;){for(;ie.length>0;){let p=await ie[0];if(p===H)return;if(pe.aborted)throw new a;p!==D&&(yield p),ie.shift(),ye()}await new A(p=>{be=p})}}finally{Ae=!0,ve&&(ve(),ve=null)}}).call(this)}function J($=void 0){return $!=null&&u($,"options"),($==null?void 0:$.signal)!=null&&l($.signal,"options.signal"),(async function*(){let ee=0;for await(let me of this){var ne;if($!=null&&(ne=$.signal)!==null&&ne!==void 0&&ne.aborted)throw new a({cause:$.signal.reason});yield[ee++,me]}}).call(this)}async function M($,ee=void 0){for await(let ne of N.call(this,$,ee))return!0;return!1}async function ce($,ee=void 0){if(typeof $!="function")throw new s("fn",["Function","AsyncFunction"],$);return!await M.call(this,async(...ne)=>!await $(...ne),ee)}async function Q($,ee){for await(let ne of N.call(this,$,ee))return ne}async function B($,ee){if(typeof $!="function")throw new s("fn",["Function","AsyncFunction"],$);async function ne(me,pe){return await $(me,pe),D}for await(let me of ae.call(this,ne,ee));}function N($,ee){if(typeof $!="function")throw new s("fn",["Function","AsyncFunction"],$);async function ne(me,pe){return await $(me,pe)?me:D}return ae.call(this,ne,ee)}var Y=class extends o{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function ue($,ee,ne){var me;if(typeof $!="function")throw new s("reducer",["Function","AsyncFunction"],$);ne!=null&&u(ne,"options"),(ne==null?void 0:ne.signal)!=null&&l(ne.signal,"options.signal");let pe=arguments.length>1;if(ne!=null&&(me=ne.signal)!==null&&me!==void 0&&me.aborted){let ve=new a(void 0,{cause:ne.signal.reason});throw this.once("error",()=>{}),await h(this.destroy(ve)),ve}let G=new r,ie=G.signal;if(ne!=null&&ne.signal){let ve={once:!0,[d]:this,[f]:!0};ne.signal.addEventListener("abort",()=>G.abort(),ve)}let he=!1;try{for await(let ve of this){var be;if(he=!0,ne!=null&&(be=ne.signal)!==null&&be!==void 0&&be.aborted)throw new a;pe?ee=await $(ee,ve,{signal:ie}):(ee=ve,pe=!0)}if(!he&&!pe)throw new Y}finally{G.abort()}return ee}async function X($){$!=null&&u($,"options"),($==null?void 0:$.signal)!=null&&l($.signal,"options.signal");let ee=[];for await(let me of this){var ne;if($!=null&&(ne=$.signal)!==null&&ne!==void 0&&ne.aborted)throw new a(void 0,{cause:$.signal.reason});w(ee,me)}return ee}function we($,ee){let ne=ae.call(this,$,ee);return(async function*(){for await(let me of ne)yield*me}).call(this)}function L($){if($=I($),C($))return 0;if($<0)throw new i("number",">= 0",$);return $}function W($,ee=void 0){return ee!=null&&u(ee,"options"),(ee==null?void 0:ee.signal)!=null&&l(ee.signal,"options.signal"),$=L($),(async function*(){var ne;if(ee!=null&&(ne=ee.signal)!==null&&ne!==void 0&&ne.aborted)throw new a;for await(let pe of this){var me;if(ee!=null&&(me=ee.signal)!==null&&me!==void 0&&me.aborted)throw new a;$--<=0&&(yield pe)}}).call(this)}function le($,ee=void 0){return ee!=null&&u(ee,"options"),(ee==null?void 0:ee.signal)!=null&&l(ee.signal,"options.signal"),$=L($),(async function*(){var ne;if(ee!=null&&(ne=ee.signal)!==null&&ne!==void 0&&ne.aborted)throw new a;for await(let pe of this){var me;if(ee!=null&&(me=ee.signal)!==null&&me!==void 0&&me.aborted)throw new a;if($-- >0&&(yield pe),$<=0)return}}).call(this)}t.exports.streamReturningOperators={asIndexedPairs:g(J,"readable.asIndexedPairs will be removed in a future version."),drop:W,filter:N,flatMap:we,map:ae,take:le,compose:U},t.exports.promiseReturningOperators={every:ce,forEach:B,reduce:ue,toArray:X,some:M,find:Q}}),mp=Ce((e,t)=>{xe(),Se(),_e();var{ArrayPrototypePop:r,Promise:n}=dt(),{isIterable:s,isNodeStream:o,isWebStream:i}=tr(),{pipelineImpl:a}=Ul(),{finished:l}=wr();bp();function c(...u){return new n((d,f)=>{let h,y,m=u[u.length-1];if(m&&typeof m=="object"&&!o(m)&&!s(m)&&!i(m)){let b=r(u);h=b.signal,y=b.end}a(u,(b,S)=>{b?f(b):d(S)},{signal:h,end:y})})}t.exports={finished:l,pipeline:c}}),bp=Ce((e,t)=>{xe(),Se(),_e();var{Buffer:r}=(vt(),nt(yt)),{ObjectDefineProperty:n,ObjectKeys:s,ReflectApply:o}=dt(),{promisify:{custom:i}}=It(),{streamReturningOperators:a,promiseReturningOperators:l}=G_(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:c}}=At(),u=gp(),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:f}=ki(),{pipeline:h}=Ul(),{destroyer:y}=wn(),m=wr(),b=mp(),S=tr(),g=t.exports=zl().Stream;g.isDestroyed=S.isDestroyed,g.isDisturbed=S.isDisturbed,g.isErrored=S.isErrored,g.isReadable=S.isReadable,g.isWritable=S.isWritable,g.Readable=Ai();for(let _ of s(a)){let x=function(...C){if(new.target)throw c();return g.Readable.from(o(I,this,C))},I=a[_];n(x,"name",{__proto__:null,value:I.name}),n(x,"length",{__proto__:null,value:I.length}),n(g.Readable.prototype,_,{__proto__:null,value:x,enumerable:!1,configurable:!0,writable:!0})}for(let _ of s(l)){let x=function(...C){if(new.target)throw c();return o(I,this,C)},I=l[_];n(x,"name",{__proto__:null,value:I.name}),n(x,"length",{__proto__:null,value:I.length}),n(g.Readable.prototype,_,{__proto__:null,value:x,enumerable:!1,configurable:!0,writable:!0})}g.Writable=Bl(),g.Duplex=rr(),g.Transform=hp(),g.PassThrough=pp(),g.pipeline=h;var{addAbortSignal:w}=Ei();g.addAbortSignal=w,g.finished=m,g.destroy=y,g.compose=u,g.setDefaultHighWaterMark=d,g.getDefaultHighWaterMark=f,n(g,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return b}}),n(h,i,{__proto__:null,enumerable:!0,get(){return b.pipeline}}),n(m,i,{__proto__:null,enumerable:!0,get(){return b.finished}}),g.Stream=g,g._isUint8Array=function(_){return _ instanceof Uint8Array},g._uint8ArrayToBuffer=function(_){return r.from(_.buffer,_.byteOffset,_.byteLength)}}),Ur=Ce((e,t)=>{xe(),Se(),_e();var r=bp(),n=mp(),s=r.Readable.destroy;t.exports=r.Readable,t.exports._uint8ArrayToBuffer=r._uint8ArrayToBuffer,t.exports._isUint8Array=r._isUint8Array,t.exports.isDisturbed=r.isDisturbed,t.exports.isErrored=r.isErrored,t.exports.isReadable=r.isReadable,t.exports.Readable=r.Readable,t.exports.Writable=r.Writable,t.exports.Duplex=r.Duplex,t.exports.Transform=r.Transform,t.exports.PassThrough=r.PassThrough,t.exports.addAbortSignal=r.addAbortSignal,t.exports.finished=r.finished,t.exports.destroy=r.destroy,t.exports.destroy=s,t.exports.pipeline=r.pipeline,t.exports.compose=r.compose,Object.defineProperty(r,"promises",{configurable:!0,enumerable:!0,get(){return n}}),t.exports.Stream=r.Stream,t.exports.default=t.exports}),Y_=Ce((e,t)=>{xe(),Se(),_e(),typeof Object.create=="function"?t.exports=function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(r,n){if(n){r.super_=n;var s=function(){};s.prototype=n.prototype,r.prototype=new s,r.prototype.constructor=r}}}),J_=Ce((e,t)=>{xe(),Se(),_e();var{Buffer:r}=(vt(),nt(yt)),n=Symbol.for("BufferList");function s(o){if(!(this instanceof s))return new s(o);s._init.call(this,o)}s._init=function(o){Object.defineProperty(this,n,{value:!0}),this._bufs=[],this.length=0,o&&this.append(o)},s.prototype._new=function(o){return new s(o)},s.prototype._offset=function(o){if(o===0)return[0,0];let i=0;for(let a=0;a<this._bufs.length;a++){let l=i+this._bufs[a].length;if(o<l||a===this._bufs.length-1)return[a,o-i];i=l}},s.prototype._reverseOffset=function(o){let i=o[0],a=o[1];for(let l=0;l<i;l++)a+=this._bufs[l].length;return a},s.prototype.getBuffers=function(){return this._bufs},s.prototype.get=function(o){if(o>this.length||o<0)return;let i=this._offset(o);return this._bufs[i[0]][i[1]]},s.prototype.slice=function(o,i){return typeof o=="number"&&o<0&&(o+=this.length),typeof i=="number"&&i<0&&(i+=this.length),this.copy(null,0,o,i)},s.prototype.copy=function(o,i,a,l){if((typeof a!="number"||a<0)&&(a=0),(typeof l!="number"||l>this.length)&&(l=this.length),a>=this.length||l<=0)return o||r.alloc(0);let c=!!o,u=this._offset(a),d=l-a,f=d,h=c&&i||0,y=u[1];if(a===0&&l===this.length){if(!c)return this._bufs.length===1?this._bufs[0]:r.concat(this._bufs,this.length);for(let m=0;m<this._bufs.length;m++)this._bufs[m].copy(o,h),h+=this._bufs[m].length;return o}if(f<=this._bufs[u[0]].length-y)return c?this._bufs[u[0]].copy(o,i,y,y+f):this._bufs[u[0]].slice(y,y+f);c||(o=r.allocUnsafe(d));for(let m=u[0];m<this._bufs.length;m++){let b=this._bufs[m].length-y;if(f>b)this._bufs[m].copy(o,h,y),h+=b;else{this._bufs[m].copy(o,h,y,y+f),h+=b;break}f-=b,y&&(y=0)}return o.length>h?o.slice(0,h):o},s.prototype.shallowSlice=function(o,i){if(o=o||0,i=typeof i!="number"?this.length:i,o<0&&(o+=this.length),i<0&&(i+=this.length),o===i)return this._new();let a=this._offset(o),l=this._offset(i),c=this._bufs.slice(a[0],l[0]+1);return l[1]===0?c.pop():c[c.length-1]=c[c.length-1].slice(0,l[1]),a[1]!==0&&(c[0]=c[0].slice(a[1])),this._new(c)},s.prototype.toString=function(o,i,a){return this.slice(i,a).toString(o)},s.prototype.consume=function(o){if(o=Math.trunc(o),Number.isNaN(o)||o<=0)return this;for(;this._bufs.length;)if(o>=this._bufs[0].length)o-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(o),this.length-=o;break}return this},s.prototype.duplicate=function(){let o=this._new();for(let i=0;i<this._bufs.length;i++)o.append(this._bufs[i]);return o},s.prototype.append=function(o){return this._attach(o,s.prototype._appendBuffer)},s.prototype.prepend=function(o){return this._attach(o,s.prototype._prependBuffer,!0)},s.prototype._attach=function(o,i,a){if(o==null)return this;if(o.buffer)i.call(this,r.from(o.buffer,o.byteOffset,o.byteLength));else if(Array.isArray(o)){let[l,c]=a?[o.length-1,-1]:[0,1];for(let u=l;u>=0&&u<o.length;u+=c)this._attach(o[u],i,a)}else if(this._isBufferList(o)){let[l,c]=a?[o._bufs.length-1,-1]:[0,1];for(let u=l;u>=0&&u<o._bufs.length;u+=c)this._attach(o._bufs[u],i,a)}else typeof o=="number"&&(o=o.toString()),i.call(this,r.from(o));return this},s.prototype._appendBuffer=function(o){this._bufs.push(o),this.length+=o.length},s.prototype._prependBuffer=function(o){this._bufs.unshift(o),this.length+=o.length},s.prototype.indexOf=function(o,i,a){if(a===void 0&&typeof i=="string"&&(a=i,i=void 0),typeof o=="function"||Array.isArray(o))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof o=="number"?o=r.from([o]):typeof o=="string"?o=r.from(o,a):this._isBufferList(o)?o=o.slice():Array.isArray(o.buffer)?o=r.from(o.buffer,o.byteOffset,o.byteLength):r.isBuffer(o)||(o=r.from(o)),i=Number(i||0),isNaN(i)&&(i=0),i<0&&(i=this.length+i),i<0&&(i=0),o.length===0)return i>this.length?this.length:i;let l=this._offset(i),c=l[0],u=l[1];for(;c<this._bufs.length;c++){let d=this._bufs[c];for(;u<d.length;)if(d.length-u>=o.length){let f=d.indexOf(o,u);if(f!==-1)return this._reverseOffset([c,f]);u=d.length-o.length+1}else{let f=this._reverseOffset([c,u]);if(this._match(f,o))return f;u++}u=0}return-1},s.prototype._match=function(o,i){if(this.length-o<i.length)return!1;for(let a=0;a<i.length;a++)if(this.get(o+a)!==i[a])return!1;return!0},(function(){let o={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readBigInt64BE:8,readBigInt64LE:8,readBigUInt64BE:8,readBigUInt64LE:8,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let i in o)(function(a){o[a]===null?s.prototype[a]=function(l,c){return this.slice(l,l+c)[a](0,c)}:s.prototype[a]=function(l=0){return this.slice(l,l+o[a])[a](0)}})(i)})(),s.prototype._isBufferList=function(o){return o instanceof s||s.isBufferList(o)},s.isBufferList=function(o){return o!=null&&o[n]},t.exports=s}),Q_=Ce((e,t)=>{xe(),Se(),_e();var r=Ur().Duplex,n=Y_(),s=J_();function o(i){if(!(this instanceof o))return new o(i);if(typeof i=="function"){this._callback=i;let a=(function(l){this._callback&&(this._callback(l),this._callback=null)}).bind(this);this.on("pipe",function(l){l.on("error",a)}),this.on("unpipe",function(l){l.removeListener("error",a)}),i=null}s._init.call(this,i),r.call(this)}n(o,r),Object.assign(o.prototype,s.prototype),o.prototype._new=function(i){return new o(i)},o.prototype._write=function(i,a,l){this._appendBuffer(i),typeof l=="function"&&l()},o.prototype._read=function(i){if(!this.length)return this.push(null);i=Math.min(i,this.length),this.push(this.slice(0,i)),this.consume(i)},o.prototype.end=function(i){r.prototype.end.call(this,i),this._callback&&(this._callback(null,this.slice()),this._callback=null)},o.prototype._destroy=function(i,a){this._bufs.length=0,this.length=0,a(i)},o.prototype._isBufferList=function(i){return i instanceof o||i instanceof s||o.isBufferList(i)},o.isBufferList=s.isBufferList,t.exports=o,t.exports.BufferListStream=o,t.exports.BufferList=s}),X_=Ce((e,t)=>{xe(),Se(),_e();var r=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}};t.exports=r}),yp=Ce((e,t)=>{xe(),Se(),_e();var r=t.exports,{Buffer:n}=(vt(),nt(yt));r.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},r.requiredHeaderFlags={1:0,2:0,4:0,5:0,6:2,7:0,8:2,9:0,10:2,11:0,12:0,13:0,14:0,15:0},r.requiredHeaderFlagsErrors={};for(let o in r.requiredHeaderFlags){let i=r.requiredHeaderFlags[o];r.requiredHeaderFlagsErrors[o]="Invalid header flag bits, must be 0x"+i.toString(16)+" for "+r.types[o]+" packet"}r.codes={};for(let o in r.types){let i=r.types[o];r.codes[i]=o}r.CMD_SHIFT=4,r.CMD_MASK=240,r.DUP_MASK=8,r.QOS_MASK=3,r.QOS_SHIFT=1,r.RETAIN_MASK=1,r.VARBYTEINT_MASK=127,r.VARBYTEINT_FIN_MASK=128,r.VARBYTEINT_MAX=268435455,r.SESSIONPRESENT_MASK=1,r.SESSIONPRESENT_HEADER=n.from([r.SESSIONPRESENT_MASK]),r.CONNACK_HEADER=n.from([r.codes.connack<<r.CMD_SHIFT]),r.USERNAME_MASK=128,r.PASSWORD_MASK=64,r.WILL_RETAIN_MASK=32,r.WILL_QOS_MASK=24,r.WILL_QOS_SHIFT=3,r.WILL_FLAG_MASK=4,r.CLEAN_SESSION_MASK=2,r.CONNECT_HEADER=n.from([r.codes.connect<<r.CMD_SHIFT]),r.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},r.propertiesCodes={};for(let o in r.properties){let i=r.properties[o];r.propertiesCodes[i]=o}r.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"};function s(o){return[0,1,2].map(i=>[0,1].map(a=>[0,1].map(l=>{let c=n.alloc(1);return c.writeUInt8(r.codes[o]<<r.CMD_SHIFT|(a?r.DUP_MASK:0)|i<<r.QOS_SHIFT|l,0,!0),c})))}r.PUBLISH_HEADER=s("publish"),r.SUBSCRIBE_HEADER=s("subscribe"),r.SUBSCRIBE_OPTIONS_QOS_MASK=3,r.SUBSCRIBE_OPTIONS_NL_MASK=1,r.SUBSCRIBE_OPTIONS_NL_SHIFT=2,r.SUBSCRIBE_OPTIONS_RAP_MASK=1,r.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,r.SUBSCRIBE_OPTIONS_RH_MASK=3,r.SUBSCRIBE_OPTIONS_RH_SHIFT=4,r.SUBSCRIBE_OPTIONS_RH=[0,16,32],r.SUBSCRIBE_OPTIONS_NL=4,r.SUBSCRIBE_OPTIONS_RAP=8,r.SUBSCRIBE_OPTIONS_QOS=[0,1,2],r.UNSUBSCRIBE_HEADER=s("unsubscribe"),r.ACKS={unsuback:s("unsuback"),puback:s("puback"),pubcomp:s("pubcomp"),pubrel:s("pubrel"),pubrec:s("pubrec")},r.SUBACK_HEADER=n.from([r.codes.suback<<r.CMD_SHIFT]),r.VERSION3=n.from([3]),r.VERSION4=n.from([4]),r.VERSION5=n.from([5]),r.VERSION131=n.from([131]),r.VERSION132=n.from([132]),r.QOS=[0,1,2].map(o=>n.from([o])),r.EMPTY={pingreq:n.from([r.codes.pingreq<<4,0]),pingresp:n.from([r.codes.pingresp<<4,0]),disconnect:n.from([r.codes.disconnect<<4,0])},r.MQTT5_PUBACK_PUBREC_CODES={0:"Success",16:"No matching subscribers",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",144:"Topic Name invalid",145:"Packet identifier in use",151:"Quota exceeded",153:"Payload format invalid"},r.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},r.MQTT5_SUBACK_CODES={0:"Granted QoS 0",1:"Granted QoS 1",2:"Granted QoS 2",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use",151:"Quota exceeded",158:"Shared Subscriptions not supported",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},r.MQTT5_UNSUBACK_CODES={0:"Success",17:"No subscription existed",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use"},r.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},r.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}}),Z_=Ce((e,t)=>{xe(),Se(),_e();var r=1e3,n=r*60,s=n*60,o=s*24,i=o*7,a=o*365.25;t.exports=function(f,h){h=h||{};var y=typeof f;if(y==="string"&&f.length>0)return l(f);if(y==="number"&&isFinite(f))return h.long?u(f):c(f);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(f))};function l(f){if(f=String(f),!(f.length>100)){var h=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(f);if(h){var y=parseFloat(h[1]),m=(h[2]||"ms").toLowerCase();switch(m){case"years":case"year":case"yrs":case"yr":case"y":return y*a;case"weeks":case"week":case"w":return y*i;case"days":case"day":case"d":return y*o;case"hours":case"hour":case"hrs":case"hr":case"h":return y*s;case"minutes":case"minute":case"mins":case"min":case"m":return y*n;case"seconds":case"second":case"secs":case"sec":case"s":return y*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return y;default:return}}}}function c(f){var h=Math.abs(f);return h>=o?Math.round(f/o)+"d":h>=s?Math.round(f/s)+"h":h>=n?Math.round(f/n)+"m":h>=r?Math.round(f/r)+"s":f+"ms"}function u(f){var h=Math.abs(f);return h>=o?d(f,h,o,"day"):h>=s?d(f,h,s,"hour"):h>=n?d(f,h,n,"minute"):h>=r?d(f,h,r,"second"):f+" ms"}function d(f,h,y,m){var b=h>=y*1.5;return Math.round(f/y)+" "+m+(b?"s":"")}}),eS=Ce((e,t)=>{xe(),Se(),_e();function r(n){o.debug=o,o.default=o,o.coerce=d,o.disable=c,o.enable=a,o.enabled=u,o.humanize=Z_(),o.destroy=f,Object.keys(n).forEach(h=>{o[h]=n[h]}),o.names=[],o.skips=[],o.formatters={};function s(h){let y=0;for(let m=0;m<h.length;m++)y=(y<<5)-y+h.charCodeAt(m),y|=0;return o.colors[Math.abs(y)%o.colors.length]}o.selectColor=s;function o(h){let y,m=null,b,S;function g(...w){if(!g.enabled)return;let _=g,x=Number(new Date),I=x-(y||x);_.diff=I,_.prev=y,_.curr=x,y=x,w[0]=o.coerce(w[0]),typeof w[0]!="string"&&w.unshift("%O");let C=0;w[0]=w[0].replace(/%([a-zA-Z%])/g,(A,O)=>{if(A==="%%")return"%";C++;let j=o.formatters[O];if(typeof j=="function"){let R=w[C];A=j.call(_,R),w.splice(C,1),C--}return A}),o.formatArgs.call(_,w),(_.log||o.log).apply(_,w)}return g.namespace=h,g.useColors=o.useColors(),g.color=o.selectColor(h),g.extend=i,g.destroy=o.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(b!==o.namespaces&&(b=o.namespaces,S=o.enabled(h)),S),set:w=>{m=w}}),typeof o.init=="function"&&o.init(g),g}function i(h,y){let m=o(this.namespace+(typeof y>"u"?":":y)+h);return m.log=this.log,m}function a(h){o.save(h),o.namespaces=h,o.names=[],o.skips=[];let y=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of y)m[0]==="-"?o.skips.push(m.slice(1)):o.names.push(m)}function l(h,y){let m=0,b=0,S=-1,g=0;for(;m<h.length;)if(b<y.length&&(y[b]===h[m]||y[b]==="*"))y[b]==="*"?(S=b,g=m,b++):(m++,b++);else if(S!==-1)b=S+1,g++,m=g;else return!1;for(;b<y.length&&y[b]==="*";)b++;return b===y.length}function c(){let h=[...o.names,...o.skips.map(y=>"-"+y)].join(",");return o.enable(""),h}function u(h){for(let y of o.skips)if(l(h,y))return!1;for(let y of o.names)if(l(h,y))return!0;return!1}function d(h){return h instanceof Error?h.stack||h.message:h}function f(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o.enable(o.load()),o}t.exports=r}),nr=Ce((e,t)=>{xe(),Se(),_e(),e.formatArgs=n,e.save=s,e.load=o,e.useColors=r,e.storage=i(),e.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let l;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(l=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(l[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function n(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let c="color: "+this.color;l.splice(1,0,c,"color: inherit");let u=0,d=0;l[0].replace(/%[a-zA-Z%]/g,f=>{f!=="%%"&&(u++,f==="%c"&&(d=u))}),l.splice(d,0,c)}e.log=console.debug||console.log||(()=>{});function s(l){try{l?e.storage.setItem("debug",l):e.storage.removeItem("debug")}catch{}}function o(){let l;try{l=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!l&&typeof et<"u"&&"env"in et&&(l=et.env.DEBUG),l}function i(){try{return localStorage}catch{}}t.exports=eS()(e);var{formatters:a}=t.exports;a.j=function(l){try{return JSON.stringify(l)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}}),tS=Ce((e,t)=>{xe(),Se(),_e();var r=Q_(),{EventEmitter:n}=(zr(),nt(vr)),s=X_(),o=yp(),i=nr()("mqtt-packet:parser"),a=class Vc extends n{constructor(){super(),this.parser=this.constructor.parser}static parser(c){return this instanceof Vc?(this.settings=c||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new Vc().parser(c)}_resetState(){i("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new s,this.error=null,this._list=r(),this._stateCounter=0}parse(c){for(this.error&&this._resetState(),this._list.append(c),i("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,i("parse: state complete. _stateCounter is now: %d",this._stateCounter),i("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return i("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let c=this._list.readUInt8(0),u=c>>o.CMD_SHIFT;this.packet.cmd=o.types[u];let d=c&15,f=o.requiredHeaderFlags[u];return f!=null&&d!==f?this._emitError(new Error(o.requiredHeaderFlagsErrors[u])):(this.packet.retain=(c&o.RETAIN_MASK)!==0,this.packet.qos=c>>o.QOS_SHIFT&o.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(c&o.DUP_MASK)!==0,i("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let c=this._parseVarByteNum(!0);return c&&(this.packet.length=c.value,this._list.consume(c.bytes)),i("_parseLength %d",c.value),!!c}_parsePayload(){i("_parsePayload: payload %O",this._list);let c=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}c=!0}return i("_parsePayload complete result: %s",c),c}_parseConnect(){i("_parseConnect");let c,u,d,f,h={},y=this.packet,m=this._parseString();if(m===null)return this._emitError(new Error("Cannot parse protocolId"));if(m!=="MQTT"&&m!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(y.protocolId=m,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(y.protocolVersion=this._list.readUInt8(this._pos),y.protocolVersion>=128&&(y.bridgeMode=!0,y.protocolVersion=y.protocolVersion-128),y.protocolVersion!==3&&y.protocolVersion!==4&&y.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(this._list.readUInt8(this._pos)&1)return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));h.username=this._list.readUInt8(this._pos)&o.USERNAME_MASK,h.password=this._list.readUInt8(this._pos)&o.PASSWORD_MASK,h.will=this._list.readUInt8(this._pos)&o.WILL_FLAG_MASK;let b=!!(this._list.readUInt8(this._pos)&o.WILL_RETAIN_MASK),S=(this._list.readUInt8(this._pos)&o.WILL_QOS_MASK)>>o.WILL_QOS_SHIFT;if(h.will)y.will={},y.will.retain=b,y.will.qos=S;else{if(b)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(S)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(y.clean=(this._list.readUInt8(this._pos)&o.CLEAN_SESSION_MASK)!==0,this._pos++,y.keepalive=this._parseNum(),y.keepalive===-1)return this._emitError(new Error("Packet too short"));if(y.protocolVersion===5){let w=this._parseProperties();Object.getOwnPropertyNames(w).length&&(y.properties=w)}let g=this._parseString();if(g===null)return this._emitError(new Error("Packet too short"));if(y.clientId=g,i("_parseConnect: packet.clientId: %s",y.clientId),h.will){if(y.protocolVersion===5){let w=this._parseProperties();Object.getOwnPropertyNames(w).length&&(y.will.properties=w)}if(c=this._parseString(),c===null)return this._emitError(new Error("Cannot parse will topic"));if(y.will.topic=c,i("_parseConnect: packet.will.topic: %s",y.will.topic),u=this._parseBuffer(),u===null)return this._emitError(new Error("Cannot parse will payload"));y.will.payload=u,i("_parseConnect: packet.will.paylaod: %s",y.will.payload)}if(h.username){if(f=this._parseString(),f===null)return this._emitError(new Error("Cannot parse username"));y.username=f,i("_parseConnect: packet.username: %s",y.username)}if(h.password){if(d=this._parseBuffer(),d===null)return this._emitError(new Error("Cannot parse password"));y.password=d}return this.settings=y,i("_parseConnect: complete"),y}_parseConnack(){i("_parseConnack");let c=this.packet;if(this._list.length<1)return null;let u=this._list.readUInt8(this._pos++);if(u>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(c.sessionPresent=!!(u&o.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?c.reasonCode=this._list.readUInt8(this._pos++):c.reasonCode=0;else{if(this._list.length<2)return null;c.returnCode=this._list.readUInt8(this._pos++)}if(c.returnCode===-1||c.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let d=this._parseProperties();Object.getOwnPropertyNames(d).length&&(c.properties=d)}i("_parseConnack: complete")}_parsePublish(){i("_parsePublish");let c=this.packet;if(c.topic=this._parseString(),c.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(c.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(c.properties=u)}c.payload=this._list.slice(this._pos,c.length),i("_parsePublish: payload from buffer list: %o",c.payload)}}_parseSubscribe(){i("_parseSubscribe");let c=this.packet,u,d,f,h,y,m,b;if(c.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let S=this._parseProperties();Object.getOwnPropertyNames(S).length&&(c.properties=S)}if(c.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<c.length;){if(u=this._parseString(),u===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=c.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(d=this._parseByte(),this.settings.protocolVersion===5){if(d&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(d&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(f=d&o.SUBSCRIBE_OPTIONS_QOS_MASK,f>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(m=(d>>o.SUBSCRIBE_OPTIONS_NL_SHIFT&o.SUBSCRIBE_OPTIONS_NL_MASK)!==0,y=(d>>o.SUBSCRIBE_OPTIONS_RAP_SHIFT&o.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,h=d>>o.SUBSCRIBE_OPTIONS_RH_SHIFT&o.SUBSCRIBE_OPTIONS_RH_MASK,h>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));b={topic:u,qos:f},this.settings.protocolVersion===5?(b.nl=m,b.rap=y,b.rh=h):this.settings.bridgeMode&&(b.rh=0,b.rap=!0,b.nl=!0),i("_parseSubscribe: push subscription `%s` to subscription",b),c.subscriptions.push(b)}}}_parseSuback(){i("_parseSuback");let c=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(c.properties=u)}if(c.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let u=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!o.MQTT5_SUBACK_CODES[u])return this._emitError(new Error("Invalid suback code"))}else if(u>2&&u!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(u)}}}_parseUnsubscribe(){i("_parseUnsubscribe");let c=this.packet;if(c.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(c.properties=u)}if(c.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<c.length;){let u=this._parseString();if(u===null)return this._emitError(new Error("Cannot parse topic"));i("_parseUnsubscribe: push topic `%s` to unsubscriptions",u),c.unsubscriptions.push(u)}}}_parseUnsuback(){i("_parseUnsuback");let c=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&c.length!==2)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(c.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(this.settings.protocolVersion===5){let u=this._parseProperties();for(Object.getOwnPropertyNames(u).length&&(c.properties=u),c.granted=[];this._pos<this.packet.length;){let d=this._list.readUInt8(this._pos++);if(!o.MQTT5_UNSUBACK_CODES[d])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(d)}}}_parseConfirmation(){i("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let c=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(c.length>2){switch(c.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!o.MQTT5_PUBACK_PUBREC_CODES[c.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!o.MQTT5_PUBREL_PUBCOMP_CODES[c.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}i("_parseConfirmation: packet.reasonCode `%d`",c.reasonCode)}else c.reasonCode=0;if(c.length>3){let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(c.properties=u)}}return!0}_parseDisconnect(){let c=this.packet;if(i("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(c.reasonCode=this._parseByte(),o.MQTT5_DISCONNECT_CODES[c.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):c.reasonCode=0;let u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(c.properties=u)}return i("_parseDisconnect result: true"),!0}_parseAuth(){i("_parseAuth");let c=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(c.reasonCode=this._parseByte(),!o.MQTT5_AUTH_CODES[c.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let u=this._parseProperties();return Object.getOwnPropertyNames(u).length&&(c.properties=u),i("_parseAuth: result: true"),!0}_parseMessageId(){let c=this.packet;return c.messageId=this._parseNum(),c.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(i("_parseMessageId: packet.messageId %d",c.messageId),!0)}_parseString(c){let u=this._parseNum(),d=u+this._pos;if(u===-1||d>this._list.length||d>this.packet.length)return null;let f=this._list.toString("utf8",this._pos,d);return this._pos+=u,i("_parseString: result: %s",f),f}_parseStringPair(){return i("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let c=this._parseNum(),u=c+this._pos;if(c===-1||u>this._list.length||u>this.packet.length)return null;let d=this._list.slice(this._pos,u);return this._pos+=c,i("_parseBuffer: result: %o",d),d}_parseNum(){if(this._list.length-this._pos<2)return-1;let c=this._list.readUInt16BE(this._pos);return this._pos+=2,i("_parseNum: result: %s",c),c}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let c=this._list.readUInt32BE(this._pos);return this._pos+=4,i("_parse4ByteNum: result: %s",c),c}_parseVarByteNum(c){i("_parseVarByteNum");let u=4,d=0,f=1,h=0,y=!1,m,b=this._pos?this._pos:0;for(;d<u&&b+d<this._list.length;){if(m=this._list.readUInt8(b+d++),h+=f*(m&o.VARBYTEINT_MASK),f*=128,(m&o.VARBYTEINT_FIN_MASK)===0){y=!0;break}if(this._list.length<=d)break}return!y&&d===u&&this._list.length>=d&&this._emitError(new Error("Invalid variable byte integer")),b&&(this._pos+=d),y?c?y={bytes:d,value:h}:y=h:y=!1,i("_parseVarByteNum: result: %o",y),y}_parseByte(){let c;return this._pos<this._list.length&&(c=this._list.readUInt8(this._pos),this._pos++),i("_parseByte: result: %o",c),c}_parseByType(c){switch(i("_parseByType: type: %s",c),c){case"byte":return this._parseByte()!==0;case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){i("_parseProperties");let c=this._parseVarByteNum(),u=this._pos+c,d={};for(;this._pos<u;){let f=this._parseByte();if(!f)return this._emitError(new Error("Cannot parse property code type")),!1;let h=o.propertiesCodes[f];if(!h)return this._emitError(new Error("Unknown property")),!1;if(h==="userProperties"){d[h]||(d[h]=Object.create(null));let y=this._parseByType(o.propertiesTypes[h]);if(d[h][y.name])if(Array.isArray(d[h][y.name]))d[h][y.name].push(y.value);else{let m=d[h][y.name];d[h][y.name]=[m],d[h][y.name].push(y.value)}else d[h][y.name]=y.value;continue}d[h]?Array.isArray(d[h])?d[h].push(this._parseByType(o.propertiesTypes[h])):(d[h]=[d[h]],d[h].push(this._parseByType(o.propertiesTypes[h]))):d[h]=this._parseByType(o.propertiesTypes[h])}return d}_newPacket(){return i("_newPacket"),this.packet&&(this._list.consume(this.packet.length),i("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),i("_newPacket: new packet"),this.packet=new s,this._pos=0,!0}_emitError(c){i("_emitError",c),this.error=c,this.emit("error",c)}};t.exports=a}),rS=Ce((e,t)=>{xe(),Se(),_e();var{Buffer:r}=(vt(),nt(yt)),n=65536,s={},o=r.isBuffer(r.from([1,2]).subarray(0,1));function i(u){let d=r.allocUnsafe(2);return d.writeUInt8(u>>8,0),d.writeUInt8(u&255,1),d}function a(){for(let u=0;u<n;u++)s[u]=i(u)}function l(u){let d=0,f=0,h=r.allocUnsafe(4);do d=u%128|0,u=u/128|0,u>0&&(d=d|128),h.writeUInt8(d,f++);while(u>0&&f<4);return u>0&&(f=0),o?h.subarray(0,f):h.slice(0,f)}function c(u){let d=r.allocUnsafe(4);return d.writeUInt32BE(u,0),d}t.exports={cache:s,generateCache:a,generateNumber:i,genBufVariableByteInt:l,generate4ByteBuffer:c}}),nS=Ce((e,t)=>{xe(),Se(),_e(),typeof et>"u"||!et.version||et.version.indexOf("v0.")===0||et.version.indexOf("v1.")===0&&et.version.indexOf("v1.8.")!==0?t.exports={nextTick:r}:t.exports=et;function r(n,s,o,i){if(typeof n!="function")throw new TypeError('"callback" argument must be a function');var a=arguments.length,l,c;switch(a){case 0:case 1:return et.nextTick(n);case 2:return et.nextTick(function(){n.call(null,s)});case 3:return et.nextTick(function(){n.call(null,s,o)});case 4:return et.nextTick(function(){n.call(null,s,o,i)});default:for(l=new Array(a-1),c=0;c<l.length;)l[c++]=arguments[c];return et.nextTick(function(){n.apply(null,l)})}}}),vp=Ce((e,t)=>{xe(),Se(),_e();var r=yp(),{Buffer:n}=(vt(),nt(yt)),s=n.allocUnsafe(0),o=n.from([0]),i=rS(),a=nS().nextTick,l=nr()("mqtt-packet:writeToStream"),c=i.cache,u=i.generateNumber,d=i.generateCache,f=i.genBufVariableByteInt,h=i.generate4ByteBuffer,y=J,m=!0;function b(L,W,le){switch(l("generate called"),W.cork&&(W.cork(),a(S,W)),m&&(m=!1,d()),l("generate: packet.cmd: %s",L.cmd),L.cmd){case"connect":return g(L,W);case"connack":return w(L,W,le);case"publish":return _(L,W,le);case"puback":case"pubrec":case"pubrel":case"pubcomp":return x(L,W,le);case"subscribe":return I(L,W,le);case"suback":return C(L,W,le);case"unsubscribe":return A(L,W,le);case"unsuback":return O(L,W,le);case"pingreq":case"pingresp":return j(L,W);case"disconnect":return R(L,W,le);case"auth":return T(L,W,le);default:return W.destroy(new Error("Unknown command")),!1}}Object.defineProperty(b,"cacheNumbers",{get(){return y===J},set(L){L?((!c||Object.keys(c).length===0)&&(m=!0),y=J):(m=!1,y=M)}});function S(L){L.uncork()}function g(L,W,le){let $=L||{},ee=$.protocolId||"MQTT",ne=$.protocolVersion||4,me=$.will,pe=$.clean,G=$.keepalive||0,ie=$.clientId||"",he=$.username,be=$.password,ve=$.properties;pe===void 0&&(pe=!0);let Ae=0;if(typeof ee!="string"&&!n.isBuffer(ee))return W.destroy(new Error("Invalid protocolId")),!1;if(Ae+=ee.length+2,ne!==3&&ne!==4&&ne!==5)return W.destroy(new Error("Invalid protocol version")),!1;if(Ae+=1,(typeof ie=="string"||n.isBuffer(ie))&&(ie||ne>=4)&&(ie||pe))Ae+=n.byteLength(ie)+2;else{if(ne<4)return W.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(pe*1===0)return W.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof G!="number"||G<0||G>65535||G%1!==0)return W.destroy(new Error("Invalid keepalive")),!1;Ae+=2,Ae+=1;let se,Ee;if(ne===5){if(se=B(W,ve),!se)return!1;Ae+=se.length}if(me){if(typeof me!="object")return W.destroy(new Error("Invalid will")),!1;if(!me.topic||typeof me.topic!="string")return W.destroy(new Error("Invalid will topic")),!1;if(Ae+=n.byteLength(me.topic)+2,Ae+=2,me.payload)if(me.payload.length>=0)typeof me.payload=="string"?Ae+=n.byteLength(me.payload):Ae+=me.payload.length;else return W.destroy(new Error("Invalid will payload")),!1;if(Ee={},ne===5){if(Ee=B(W,me.properties),!Ee)return!1;Ae+=Ee.length}}let je=!1;if(he!=null)if(we(he))je=!0,Ae+=n.byteLength(he)+2;else return W.destroy(new Error("Invalid username")),!1;if(be!=null){if(!je)return W.destroy(new Error("Username is required to use password")),!1;if(we(be))Ae+=X(be)+2;else return W.destroy(new Error("Invalid password")),!1}W.write(r.CONNECT_HEADER),H(W,Ae),Q(W,ee),$.bridgeMode&&(ne+=128),W.write(ne===131?r.VERSION131:ne===132?r.VERSION132:ne===4?r.VERSION4:ne===5?r.VERSION5:r.VERSION3);let ye=0;return ye|=he!=null?r.USERNAME_MASK:0,ye|=be!=null?r.PASSWORD_MASK:0,ye|=me&&me.retain?r.WILL_RETAIN_MASK:0,ye|=me&&me.qos?me.qos<<r.WILL_QOS_SHIFT:0,ye|=me?r.WILL_FLAG_MASK:0,ye|=pe?r.CLEAN_SESSION_MASK:0,W.write(n.from([ye])),y(W,G),ne===5&&se.write(),Q(W,ie),me&&(ne===5&&Ee.write(),U(W,me.topic),Q(W,me.payload)),he!=null&&Q(W,he),be!=null&&Q(W,be),!0}function w(L,W,le){let $=le?le.protocolVersion:4,ee=L||{},ne=$===5?ee.reasonCode:ee.returnCode,me=ee.properties,pe=2;if(typeof ne!="number")return W.destroy(new Error("Invalid return code")),!1;let G=null;if($===5){if(G=B(W,me),!G)return!1;pe+=G.length}return W.write(r.CONNACK_HEADER),H(W,pe),W.write(ee.sessionPresent?r.SESSIONPRESENT_HEADER:o),W.write(n.from([ne])),G==null||G.write(),!0}function _(L,W,le){l("publish: packet: %o",L);let $=le?le.protocolVersion:4,ee=L||{},ne=ee.qos||0,me=ee.retain?r.RETAIN_MASK:0,pe=ee.topic,G=ee.payload||s,ie=ee.messageId,he=ee.properties,be=0;if(typeof pe=="string")be+=n.byteLength(pe)+2;else if(n.isBuffer(pe))be+=pe.length+2;else return W.destroy(new Error("Invalid topic")),!1;if(n.isBuffer(G)?be+=G.length:be+=n.byteLength(G),ne&&typeof ie!="number")return W.destroy(new Error("Invalid messageId")),!1;ne&&(be+=2);let ve=null;if($===5){if(ve=B(W,he),!ve)return!1;be+=ve.length}return W.write(r.PUBLISH_HEADER[ne][ee.dup?1:0][me?1:0]),H(W,be),y(W,X(pe)),W.write(pe),ne>0&&y(W,ie),ve==null||ve.write(),l("publish: payload: %o",G),W.write(G)}function x(L,W,le){let $=le?le.protocolVersion:4,ee=L||{},ne=ee.cmd||"puback",me=ee.messageId,pe=ee.dup&&ne==="pubrel"?r.DUP_MASK:0,G=0,ie=ee.reasonCode,he=ee.properties,be=$===5?3:2;if(ne==="pubrel"&&(G=1),typeof me!="number")return W.destroy(new Error("Invalid messageId")),!1;let ve=null;if($===5&&typeof he=="object"){if(ve=N(W,he,le,be),!ve)return!1;be+=ve.length}return W.write(r.ACKS[ne][G][pe][0]),be===3&&(be+=ie!==0?1:-1),H(W,be),y(W,me),$===5&&be!==2&&W.write(n.from([ie])),ve!==null?ve.write():be===4&&W.write(n.from([0])),!0}function I(L,W,le){l("subscribe: packet: ");let $=le?le.protocolVersion:4,ee=L||{},ne=ee.dup?r.DUP_MASK:0,me=ee.messageId,pe=ee.subscriptions,G=ee.properties,ie=0;if(typeof me!="number")return W.destroy(new Error("Invalid messageId")),!1;ie+=2;let he=null;if($===5){if(he=B(W,G),!he)return!1;ie+=he.length}if(typeof pe=="object"&&pe.length)for(let ve=0;ve<pe.length;ve+=1){let Ae=pe[ve].topic,se=pe[ve].qos;if(typeof Ae!="string")return W.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof se!="number")return W.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if($===5){if(typeof(pe[ve].nl||!1)!="boolean")return W.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(pe[ve].rap||!1)!="boolean")return W.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let Ee=pe[ve].rh||0;if(typeof Ee!="number"||Ee>2)return W.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}ie+=n.byteLength(Ae)+2+1}else return W.destroy(new Error("Invalid subscriptions")),!1;l("subscribe: writing to stream: %o",r.SUBSCRIBE_HEADER),W.write(r.SUBSCRIBE_HEADER[1][ne?1:0][0]),H(W,ie),y(W,me),he!==null&&he.write();let be=!0;for(let ve of pe){let Ae=ve.topic,se=ve.qos,Ee=+ve.nl,je=+ve.rap,ye=ve.rh,$e;U(W,Ae),$e=r.SUBSCRIBE_OPTIONS_QOS[se],$===5&&($e|=Ee?r.SUBSCRIBE_OPTIONS_NL:0,$e|=je?r.SUBSCRIBE_OPTIONS_RAP:0,$e|=ye?r.SUBSCRIBE_OPTIONS_RH[ye]:0),be=W.write(n.from([$e]))}return be}function C(L,W,le){let $=le?le.protocolVersion:4,ee=L||{},ne=ee.messageId,me=ee.granted,pe=ee.properties,G=0;if(typeof ne!="number")return W.destroy(new Error("Invalid messageId")),!1;if(G+=2,typeof me=="object"&&me.length)for(let he=0;he<me.length;he+=1){if(typeof me[he]!="number")return W.destroy(new Error("Invalid qos vector")),!1;G+=1}else return W.destroy(new Error("Invalid qos vector")),!1;let ie=null;if($===5){if(ie=N(W,pe,le,G),!ie)return!1;G+=ie.length}return W.write(r.SUBACK_HEADER),H(W,G),y(W,ne),ie!==null&&ie.write(),W.write(n.from(me))}function A(L,W,le){let $=le?le.protocolVersion:4,ee=L||{},ne=ee.messageId,me=ee.dup?r.DUP_MASK:0,pe=ee.unsubscriptions,G=ee.properties,ie=0;if(typeof ne!="number")return W.destroy(new Error("Invalid messageId")),!1;if(ie+=2,typeof pe=="object"&&pe.length)for(let ve=0;ve<pe.length;ve+=1){if(typeof pe[ve]!="string")return W.destroy(new Error("Invalid unsubscriptions")),!1;ie+=n.byteLength(pe[ve])+2}else return W.destroy(new Error("Invalid unsubscriptions")),!1;let he=null;if($===5){if(he=B(W,G),!he)return!1;ie+=he.length}W.write(r.UNSUBSCRIBE_HEADER[1][me?1:0][0]),H(W,ie),y(W,ne),he!==null&&he.write();let be=!0;for(let ve=0;ve<pe.length;ve++)be=U(W,pe[ve]);return be}function O(L,W,le){let $=le?le.protocolVersion:4,ee=L||{},ne=ee.messageId,me=ee.dup?r.DUP_MASK:0,pe=ee.granted,G=ee.properties,ie=ee.cmd,he=0,be=2;if(typeof ne!="number")return W.destroy(new Error("Invalid messageId")),!1;if($===5)if(typeof pe=="object"&&pe.length)for(let Ae=0;Ae<pe.length;Ae+=1){if(typeof pe[Ae]!="number")return W.destroy(new Error("Invalid qos vector")),!1;be+=1}else return W.destroy(new Error("Invalid qos vector")),!1;let ve=null;if($===5){if(ve=N(W,G,le,be),!ve)return!1;be+=ve.length}return W.write(r.ACKS[ie][he][me][0]),H(W,be),y(W,ne),ve!==null&&ve.write(),$===5&&W.write(n.from(pe)),!0}function j(L,W,le){return W.write(r.EMPTY[L.cmd])}function R(L,W,le){let $=le?le.protocolVersion:4,ee=L||{},ne=ee.reasonCode,me=ee.properties,pe=$===5?1:0,G=null;if($===5){if(G=N(W,me,le,pe),!G)return!1;pe+=G.length}return W.write(n.from([r.codes.disconnect<<4])),H(W,pe),$===5&&W.write(n.from([ne])),G!==null&&G.write(),!0}function T(L,W,le){let $=le?le.protocolVersion:4,ee=L||{},ne=ee.reasonCode,me=ee.properties,pe=$===5?1:0;$!==5&&W.destroy(new Error("Invalid mqtt version for auth packet"));let G=N(W,me,le,pe);return G?(pe+=G.length,W.write(n.from([r.codes.auth<<4])),H(W,pe),W.write(n.from([ne])),G!==null&&G.write(),!0):!1}var D={};function H(L,W){if(W>r.VARBYTEINT_MAX)return L.destroy(new Error(`Invalid variable byte integer: ${W}`)),!1;let le=D[W];return le||(le=f(W),W<16384&&(D[W]=le)),l("writeVarByteInt: writing to stream: %o",le),L.write(le)}function U(L,W){let le=n.byteLength(W);return y(L,le),l("writeString: %s",W),L.write(W,"utf8")}function ae(L,W,le){U(L,W),U(L,le)}function J(L,W){return l("writeNumberCached: number: %d",W),l("writeNumberCached: %o",c[W]),L.write(c[W])}function M(L,W){let le=u(W);return l("writeNumberGenerated: %o",le),L.write(le)}function ce(L,W){let le=h(W);return l("write4ByteNumber: %o",le),L.write(le)}function Q(L,W){typeof W=="string"?U(L,W):W?(y(L,W.length),L.write(W)):y(L,0)}function B(L,W){if(typeof W!="object"||W.length!=null)return{length:1,write(){ue(L,{},0)}};let le=0;function $(ee,ne){let me=r.propertiesTypes[ee],pe=0;switch(me){case"byte":{if(typeof ne!="boolean")return L.destroy(new Error(`Invalid ${ee}: ${ne}`)),!1;pe+=2;break}case"int8":{if(typeof ne!="number"||ne<0||ne>255)return L.destroy(new Error(`Invalid ${ee}: ${ne}`)),!1;pe+=2;break}case"binary":{if(ne&&ne===null)return L.destroy(new Error(`Invalid ${ee}: ${ne}`)),!1;pe+=1+n.byteLength(ne)+2;break}case"int16":{if(typeof ne!="number"||ne<0||ne>65535)return L.destroy(new Error(`Invalid ${ee}: ${ne}`)),!1;pe+=3;break}case"int32":{if(typeof ne!="number"||ne<0||ne>4294967295)return L.destroy(new Error(`Invalid ${ee}: ${ne}`)),!1;pe+=5;break}case"var":{if(typeof ne!="number"||ne<0||ne>268435455)return L.destroy(new Error(`Invalid ${ee}: ${ne}`)),!1;pe+=1+n.byteLength(f(ne));break}case"string":{if(typeof ne!="string")return L.destroy(new Error(`Invalid ${ee}: ${ne}`)),!1;pe+=3+n.byteLength(ne.toString());break}case"pair":{if(typeof ne!="object")return L.destroy(new Error(`Invalid ${ee}: ${ne}`)),!1;pe+=Object.getOwnPropertyNames(ne).reduce((G,ie)=>{let he=ne[ie];return Array.isArray(he)?G+=he.reduce((be,ve)=>(be+=3+n.byteLength(ie.toString())+2+n.byteLength(ve.toString()),be),0):G+=3+n.byteLength(ie.toString())+2+n.byteLength(ne[ie].toString()),G},0);break}default:return L.destroy(new Error(`Invalid property ${ee}: ${ne}`)),!1}return pe}if(W)for(let ee in W){let ne=0,me=0,pe=W[ee];if(pe!==void 0){if(Array.isArray(pe))for(let G=0;G<pe.length;G++){if(me=$(ee,pe[G]),!me)return!1;ne+=me}else{if(me=$(ee,pe),!me)return!1;ne=me}if(!ne)return!1;le+=ne}}return{length:n.byteLength(f(le))+le,write(){ue(L,W,le)}}}function N(L,W,le,$){let ee=["reasonString","userProperties"],ne=le&&le.properties&&le.properties.maximumPacketSize?le.properties.maximumPacketSize:0,me=B(L,W);if(ne)for(;$+me.length>ne;){let pe=ee.shift();if(pe&&W[pe])delete W[pe],me=B(L,W);else return!1}return me}function Y(L,W,le){switch(r.propertiesTypes[W]){case"byte":{L.write(n.from([r.properties[W]])),L.write(n.from([+le]));break}case"int8":{L.write(n.from([r.properties[W]])),L.write(n.from([le]));break}case"binary":{L.write(n.from([r.properties[W]])),Q(L,le);break}case"int16":{L.write(n.from([r.properties[W]])),y(L,le);break}case"int32":{L.write(n.from([r.properties[W]])),ce(L,le);break}case"var":{L.write(n.from([r.properties[W]])),H(L,le);break}case"string":{L.write(n.from([r.properties[W]])),U(L,le);break}case"pair":{Object.getOwnPropertyNames(le).forEach($=>{let ee=le[$];Array.isArray(ee)?ee.forEach(ne=>{L.write(n.from([r.properties[W]])),ae(L,$.toString(),ne.toString())}):(L.write(n.from([r.properties[W]])),ae(L,$.toString(),ee.toString()))});break}default:return L.destroy(new Error(`Invalid property ${W} value: ${le}`)),!1}}function ue(L,W,le){H(L,le);for(let $ in W)if(Object.prototype.hasOwnProperty.call(W,$)&&W[$]!=null){let ee=W[$];if(Array.isArray(ee))for(let ne=0;ne<ee.length;ne++)Y(L,$,ee[ne]);else Y(L,$,ee)}}function X(L){return L?L instanceof n?L.length:n.byteLength(L):0}function we(L){return typeof L=="string"||L instanceof n}t.exports=b}),oS=Ce((e,t)=>{xe(),Se(),_e();var r=vp(),{EventEmitter:n}=(zr(),nt(vr)),{Buffer:s}=(vt(),nt(yt));function o(a,l){let c=new i;return r(a,c,l),c.concat()}var i=class extends n{constructor(){super(),this._array=new Array(20),this._i=0}write(a){return this._array[this._i++]=a,!0}concat(){let a=0,l=new Array(this._array.length),c=this._array,u=0,d;for(d=0;d<c.length&&c[d]!==void 0;d++)typeof c[d]!="string"?l[d]=c[d].length:l[d]=s.byteLength(c[d]),a+=l[d];let f=s.allocUnsafe(a);for(d=0;d<c.length&&c[d]!==void 0;d++)typeof c[d]!="string"?(c[d].copy(f,u),u+=l[d]):(f.write(c[d],u),u+=l[d]);return f}destroy(a){a&&this.emit("error",a)}};t.exports=o}),iS=Ce(e=>{xe(),Se(),_e(),e.parser=tS().parser,e.generate=oS(),e.writeToStream=vp()}),sS=Ce((e,t)=>{xe(),Se(),_e(),t.exports=n;function r(o){return o instanceof Si?Si.from(o):new o.constructor(o.buffer.slice(),o.byteOffset,o.length)}function n(o){if(o=o||{},o.circles)return s(o);let i=new Map;if(i.set(Date,d=>new Date(d)),i.set(Map,(d,f)=>new Map(l(Array.from(d),f))),i.set(Set,(d,f)=>new Set(l(Array.from(d),f))),o.constructorHandlers)for(let d of o.constructorHandlers)i.set(d[0],d[1]);let a=null;return o.proto?u:c;function l(d,f){let h=Object.keys(d),y=new Array(h.length);for(let m=0;m<h.length;m++){let b=h[m],S=d[b];typeof S!="object"||S===null?y[b]=S:S.constructor!==Object&&(a=i.get(S.constructor))?y[b]=a(S,f):ArrayBuffer.isView(S)?y[b]=r(S):y[b]=f(S)}return y}function c(d){if(typeof d!="object"||d===null)return d;if(Array.isArray(d))return l(d,c);if(d.constructor!==Object&&(a=i.get(d.constructor)))return a(d,c);let f={};for(let h in d){if(Object.hasOwnProperty.call(d,h)===!1)continue;let y=d[h];typeof y!="object"||y===null?f[h]=y:y.constructor!==Object&&(a=i.get(y.constructor))?f[h]=a(y,c):ArrayBuffer.isView(y)?f[h]=r(y):f[h]=c(y)}return f}function u(d){if(typeof d!="object"||d===null)return d;if(Array.isArray(d))return l(d,u);if(d.constructor!==Object&&(a=i.get(d.constructor)))return a(d,u);let f={};for(let h in d){let y=d[h];typeof y!="object"||y===null?f[h]=y:y.constructor!==Object&&(a=i.get(y.constructor))?f[h]=a(y,u):ArrayBuffer.isView(y)?f[h]=r(y):f[h]=u(y)}return f}}function s(o){let i=[],a=[],l=new Map;if(l.set(Date,h=>new Date(h)),l.set(Map,(h,y)=>new Map(u(Array.from(h),y))),l.set(Set,(h,y)=>new Set(u(Array.from(h),y))),o.constructorHandlers)for(let h of o.constructorHandlers)l.set(h[0],h[1]);let c=null;return o.proto?f:d;function u(h,y){let m=Object.keys(h),b=new Array(m.length);for(let S=0;S<m.length;S++){let g=m[S],w=h[g];if(typeof w!="object"||w===null)b[g]=w;else if(w.constructor!==Object&&(c=l.get(w.constructor)))b[g]=c(w,y);else if(ArrayBuffer.isView(w))b[g]=r(w);else{let _=i.indexOf(w);_!==-1?b[g]=a[_]:b[g]=y(w)}}return b}function d(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return u(h,d);if(h.constructor!==Object&&(c=l.get(h.constructor)))return c(h,d);let y={};i.push(h),a.push(y);for(let m in h){if(Object.hasOwnProperty.call(h,m)===!1)continue;let b=h[m];if(typeof b!="object"||b===null)y[m]=b;else if(b.constructor!==Object&&(c=l.get(b.constructor)))y[m]=c(b,d);else if(ArrayBuffer.isView(b))y[m]=r(b);else{let S=i.indexOf(b);S!==-1?y[m]=a[S]:y[m]=d(b)}}return i.pop(),a.pop(),y}function f(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return u(h,f);if(h.constructor!==Object&&(c=l.get(h.constructor)))return c(h,f);let y={};i.push(h),a.push(y);for(let m in h){let b=h[m];if(typeof b!="object"||b===null)y[m]=b;else if(b.constructor!==Object&&(c=l.get(b.constructor)))y[m]=c(b,f);else if(ArrayBuffer.isView(b))y[m]=r(b);else{let S=i.indexOf(b);S!==-1?y[m]=a[S]:y[m]=f(b)}}return i.pop(),a.pop(),y}}}),aS=Ce((e,t)=>{xe(),Se(),_e(),t.exports=sS()()}),wp=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"__esModule",{value:!0}),e.validateTopic=t,e.validateTopics=r;function t(n){let s=n.split("/");for(let o=0;o<s.length;o++)if(s[o]!=="+"){if(s[o]==="#")return o===s.length-1;if(s[o].indexOf("+")!==-1||s[o].indexOf("#")!==-1)return!1}return!0}function r(n){if(n.length===0)return"empty_topic_list";for(let s=0;s<n.length;s++)if(!t(n[s]))return n[s];return null}}),xp=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"__esModule",{value:!0});var t=Ur(),r={objectMode:!0},n={clean:!0},s=class{constructor(o){Ne(this,"options");Ne(this,"_inflights");this.options=o||{},this.options={...n,...o},this._inflights=new Map}put(o,i){return this._inflights.set(o.messageId,o),i&&i(),this}createStream(){let o=new t.Readable(r),i=[],a=!1,l=0;return this._inflights.forEach((c,u)=>{i.push(c)}),o._read=()=>{!a&&l<i.length?o.push(i[l++]):o.push(null)},o.destroy=c=>{if(!a)return a=!0,setTimeout(()=>{o.emit("close")},0),o},o}del(o,i){let a=this._inflights.get(o.messageId);return a?(this._inflights.delete(o.messageId),i(null,a)):i&&i(new Error("missing packet")),this}get(o,i){let a=this._inflights.get(o.messageId);return a?i(null,a):i&&i(new Error("missing packet")),this}close(o){this.options.clean&&(this._inflights=null),o&&o()}};e.default=s}),lS=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"__esModule",{value:!0});var t=[0,16,128,131,135,144,145,151,153],r=(n,s,o)=>{n.log("handlePublish: packet %o",s),o=typeof o<"u"?o:n.noop;let i=s.topic.toString(),a=s.payload,{qos:l}=s,{messageId:c}=s,{options:u}=n;if(n.options.protocolVersion===5){let d;if(s.properties&&(d=s.properties.topicAlias),typeof d<"u")if(i.length===0)if(d>0&&d<=65535){let f=n.topicAliasRecv.getTopicByAlias(d);if(f)i=f,n.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",i,d);else{n.log("handlePublish :: unregistered topic alias. alias: %d",d),n.emit("error",new Error("Received unregistered Topic Alias"));return}}else{n.log("handlePublish :: topic alias out of range. alias: %d",d),n.emit("error",new Error("Received Topic Alias is out of range"));return}else if(n.topicAliasRecv.put(i,d))n.log("handlePublish :: registered topic: %s - alias: %d",i,d);else{n.log("handlePublish :: topic alias out of range. alias: %d",d),n.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(n.log("handlePublish: qos %d",l),l){case 2:{u.customHandleAcks(i,a,s,(d,f)=>{if(typeof d=="number"&&(f=d,d=null),d)return n.emit("error",d);if(t.indexOf(f)===-1)return n.emit("error",new Error("Wrong reason code for pubrec"));f?n._sendPacket({cmd:"pubrec",messageId:c,reasonCode:f},o):n.incomingStore.put(s,()=>{n._sendPacket({cmd:"pubrec",messageId:c},o)})});break}case 1:{u.customHandleAcks(i,a,s,(d,f)=>{if(typeof d=="number"&&(f=d,d=null),d)return n.emit("error",d);if(t.indexOf(f)===-1)return n.emit("error",new Error("Wrong reason code for puback"));f||n.emit("message",i,a,s),n.handleMessage(s,h=>{if(h)return o&&o(h);n._sendPacket({cmd:"puback",messageId:c,reasonCode:f},o)})});break}case 0:n.emit("message",i,a,s),n.handleMessage(s,o);break;default:n.log("handlePublish: unknown QoS. Doing nothing.");break}};e.default=r}),cS=Ce((e,t)=>{t.exports={version:"5.15.1"}}),xn=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"__esModule",{value:!0}),e.MQTTJS_VERSION=e.nextTick=e.ErrorWithSubackPacket=e.ErrorWithReasonCode=void 0,e.applyMixin=n;var t=class Mm extends Error{constructor(i,a){super(i);Ne(this,"code");this.code=a,Object.setPrototypeOf(this,Mm.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};e.ErrorWithReasonCode=t;var r=class Dm extends Error{constructor(i,a){super(i);Ne(this,"packet");this.packet=a,Object.setPrototypeOf(this,Dm.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}};e.ErrorWithSubackPacket=r;function n(s,o,i=!1){let a=[o];for(;;){let l=a[0],c=Object.getPrototypeOf(l);if(c!=null&&c.prototype)a.unshift(c);else break}for(let l of a)for(let c of Object.getOwnPropertyNames(l.prototype))(i||c!=="constructor")&&Object.defineProperty(s.prototype,c,Object.getOwnPropertyDescriptor(l.prototype,c)??Object.create(null))}e.nextTick=typeof(et==null?void 0:et.nextTick)=="function"?et.nextTick:s=>{setTimeout(s,0)},e.MQTTJS_VERSION=cS().version}),Ci=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=void 0;var t=xn();e.ReasonCodes={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};var r=(n,s)=>{let{messageId:o}=s,i=s.cmd,a=null,l=n.outgoing[o]?n.outgoing[o].cb:null,c=null;if(!l){n.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(n.log("_handleAck :: packet type",i),i){case"pubcomp":case"puback":{let u=s.reasonCode;u&&u>0&&u!==16?(c=new t.ErrorWithReasonCode(`Publish error: ${e.ReasonCodes[u]}`,u),n._removeOutgoingAndStoreMessage(o,()=>{l(c,s)})):n._removeOutgoingAndStoreMessage(o,l);break}case"pubrec":{a={cmd:"pubrel",qos:2,messageId:o};let u=s.reasonCode;u&&u>0&&u!==16?(c=new t.ErrorWithReasonCode(`Publish error: ${e.ReasonCodes[u]}`,u),n._removeOutgoingAndStoreMessage(o,()=>{l(c,s)})):n._sendPacket(a);break}case"suback":{delete n.outgoing[o],n.messageIdProvider.deallocate(o);let u=s.granted;for(let d=0;d<u.length;d++){let f=u[d];if((f&128)!==0){c=new Error(`Subscribe error: ${e.ReasonCodes[f]}`),c.code=f;let h=n.messageIdToTopic[o];h&&h.forEach(y=>{delete n._resubscribeTopics[y]})}}delete n.messageIdToTopic[o],n._invokeStoreProcessingQueue(),l(c,s);break}case"unsuback":{delete n.outgoing[o],n.messageIdProvider.deallocate(o),n._invokeStoreProcessingQueue(),l(null,s);break}default:n.emit("error",new Error("unrecognized packet type"))}n.disconnecting&&Object.keys(n.outgoing).length===0&&n.emit("outgoingEmpty")};e.default=r}),uS=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"__esModule",{value:!0});var t=xn(),r=Ci(),n=(s,o)=>{let{options:i}=s,a=i.protocolVersion,l=a===5?o.reasonCode:o.returnCode;if(a!==5){let c=new t.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${a}`,l);s.emit("error",c);return}s.handleAuth(o,(c,u)=>{if(c){s.emit("error",c);return}if(l===24)s.reconnecting=!1,s._sendPacket(u);else{let d=new t.ErrorWithReasonCode(`Connection refused: ${r.ReasonCodes[l]}`,l);s.emit("error",d)}})};e.default=n}),dS=Ce(e=>{var h,y,m,b,S,g,w,_,x,I,C,A,O,j,R,T,D,H,U,ae,J,M,ce,Q,B,N,Y,ue,X,Kc,L,W,le,$,Lm,ne,me,pe,kr,Ar,Gc,as,ls,at,Yc,fo,Cr,Jc,$e;xe(),Se(),_e(),Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=void 0;var t=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,r=new Set,n=typeof et=="object"&&et?et:{},s=(p,v,E,P)=>{typeof n.emitWarning=="function"?n.emitWarning(p,v,E,P):console.error(`[${E}] ${v}: ${p}`)},o=globalThis.AbortController,i=globalThis.AbortSignal;if(typeof o>"u"){i=class{constructor(){Ne(this,"onabort");Ne(this,"_onabort",[]);Ne(this,"reason");Ne(this,"aborted",!1)}addEventListener(E,P){this._onabort.push(P)}},o=class{constructor(){Ne(this,"signal",new i);v()}abort(E){var P,V;if(!this.signal.aborted){this.signal.reason=E,this.signal.aborted=!0;for(let te of this.signal._onabort)te(E);(V=(P=this.signal).onabort)==null||V.call(P,E)}}};let p=((h=n.env)==null?void 0:h.LRU_CACHE_IGNORE_AC_WARNING)!=="1",v=()=>{p&&(p=!1,s("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",v))}}var a=p=>!r.has(p),l=p=>p&&p===Math.floor(p)&&p>0&&isFinite(p),c=p=>l(p)?p<=Math.pow(2,8)?Uint8Array:p<=Math.pow(2,16)?Uint16Array:p<=Math.pow(2,32)?Uint32Array:p<=Number.MAX_SAFE_INTEGER?u:null:null,u=class extends Array{constructor(p){super(p),this.fill(0)}},d=(y=class{constructor(v,E){Ne(this,"heap");Ne(this,"length");if(!Z(y,m))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new E(v),this.length=0}static create(v){let E=c(v);if(!E)return[];Ve(y,m,!0);let P=new y(v,E);return Ve(y,m,!1),P}push(v){this.heap[this.length++]=v}pop(){return this.heap[--this.length]}},m=new WeakMap,Xe(y,m,!1),y),f=($e=class{constructor(v){Xe(this,X);Xe(this,g);Xe(this,w);Xe(this,_);Xe(this,x);Xe(this,I);Xe(this,C);Ne(this,"ttl");Ne(this,"ttlResolution");Ne(this,"ttlAutopurge");Ne(this,"updateAgeOnGet");Ne(this,"updateAgeOnHas");Ne(this,"allowStale");Ne(this,"noDisposeOnSet");Ne(this,"noUpdateTTL");Ne(this,"maxEntrySize");Ne(this,"sizeCalculation");Ne(this,"noDeleteOnFetchRejection");Ne(this,"noDeleteOnStaleGet");Ne(this,"allowStaleOnFetchAbort");Ne(this,"allowStaleOnFetchRejection");Ne(this,"ignoreFetchAbort");Xe(this,A);Xe(this,O);Xe(this,j);Xe(this,R);Xe(this,T);Xe(this,D);Xe(this,H);Xe(this,U);Xe(this,ae);Xe(this,J);Xe(this,M);Xe(this,ce);Xe(this,Q);Xe(this,B);Xe(this,N);Xe(this,Y);Xe(this,ue);Xe(this,L,()=>{});Xe(this,W,()=>{});Xe(this,le,()=>{});Xe(this,$,()=>!1);Xe(this,ne,v=>{});Xe(this,me,(v,E,P)=>{});Xe(this,pe,(v,E,P,V)=>{if(P||V)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Ne(this,b,"LRUCache");let{max:E=0,ttl:P,ttlResolution:V=1,ttlAutopurge:te,updateAgeOnGet:fe,updateAgeOnHas:re,allowStale:oe,dispose:de,disposeAfter:ge,noDisposeOnSet:ke,noUpdateTTL:Te,maxSize:Re=0,maxEntrySize:Fe=0,sizeCalculation:De,fetchMethod:We,memoMethod:Oe,noDeleteOnFetchRejection:qe,noDeleteOnStaleGet:Ge,allowStaleOnFetchRejection:He,allowStaleOnFetchAbort:Ye,ignoreFetchAbort:ot}=v;if(E!==0&&!l(E))throw new TypeError("max option must be a nonnegative integer");let F=E?c(E):Array;if(!F)throw new Error("invalid max value: "+E);if(Ve(this,g,E),Ve(this,w,Re),this.maxEntrySize=Fe||Z(this,w),this.sizeCalculation=De,this.sizeCalculation){if(!Z(this,w)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(Oe!==void 0&&typeof Oe!="function")throw new TypeError("memoMethod must be a function if defined");if(Ve(this,C,Oe),We!==void 0&&typeof We!="function")throw new TypeError("fetchMethod must be a function if specified");if(Ve(this,I,We),Ve(this,Y,!!We),Ve(this,j,new Map),Ve(this,R,new Array(E).fill(void 0)),Ve(this,T,new Array(E).fill(void 0)),Ve(this,D,new F(E)),Ve(this,H,new F(E)),Ve(this,U,0),Ve(this,ae,0),Ve(this,J,d.create(E)),Ve(this,A,0),Ve(this,O,0),typeof de=="function"&&Ve(this,_,de),typeof ge=="function"?(Ve(this,x,ge),Ve(this,M,[])):(Ve(this,x,void 0),Ve(this,M,void 0)),Ve(this,N,!!Z(this,_)),Ve(this,ue,!!Z(this,x)),this.noDisposeOnSet=!!ke,this.noUpdateTTL=!!Te,this.noDeleteOnFetchRejection=!!qe,this.allowStaleOnFetchRejection=!!He,this.allowStaleOnFetchAbort=!!Ye,this.ignoreFetchAbort=!!ot,this.maxEntrySize!==0){if(Z(this,w)!==0&&!l(Z(this,w)))throw new TypeError("maxSize must be a positive integer if specified");if(!l(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");ze(this,X,Lm).call(this)}if(this.allowStale=!!oe,this.noDeleteOnStaleGet=!!Ge,this.updateAgeOnGet=!!fe,this.updateAgeOnHas=!!re,this.ttlResolution=l(V)||V===0?V:1,this.ttlAutopurge=!!te,this.ttl=P||0,this.ttl){if(!l(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ze(this,X,Kc).call(this)}if(Z(this,g)===0&&this.ttl===0&&Z(this,w)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!Z(this,g)&&!Z(this,w)){let K="LRU_CACHE_UNBOUNDED";a(K)&&(r.add(K),s("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",K,$e))}}static unsafeExposeInternals(v){return{starts:Z(v,Q),ttls:Z(v,B),sizes:Z(v,ce),keyMap:Z(v,j),keyList:Z(v,R),valList:Z(v,T),next:Z(v,D),prev:Z(v,H),get head(){return Z(v,U)},get tail(){return Z(v,ae)},free:Z(v,J),isBackgroundFetch:E=>{var P;return ze(P=v,X,at).call(P,E)},backgroundFetch:(E,P,V,te)=>{var fe;return ze(fe=v,X,ls).call(fe,E,P,V,te)},moveToTail:E=>{var P;return ze(P=v,X,fo).call(P,E)},indexes:E=>{var P;return ze(P=v,X,kr).call(P,E)},rindexes:E=>{var P;return ze(P=v,X,Ar).call(P,E)},isStale:E=>{var P;return Z(P=v,$).call(P,E)}}}get max(){return Z(this,g)}get maxSize(){return Z(this,w)}get calculatedSize(){return Z(this,O)}get size(){return Z(this,A)}get fetchMethod(){return Z(this,I)}get memoMethod(){return Z(this,C)}get dispose(){return Z(this,_)}get disposeAfter(){return Z(this,x)}getRemainingTTL(v){return Z(this,j).has(v)?1/0:0}*entries(){for(let v of ze(this,X,kr).call(this))Z(this,T)[v]!==void 0&&Z(this,R)[v]!==void 0&&!ze(this,X,at).call(this,Z(this,T)[v])&&(yield[Z(this,R)[v],Z(this,T)[v]])}*rentries(){for(let v of ze(this,X,Ar).call(this))Z(this,T)[v]!==void 0&&Z(this,R)[v]!==void 0&&!ze(this,X,at).call(this,Z(this,T)[v])&&(yield[Z(this,R)[v],Z(this,T)[v]])}*keys(){for(let v of ze(this,X,kr).call(this)){let E=Z(this,R)[v];E!==void 0&&!ze(this,X,at).call(this,Z(this,T)[v])&&(yield E)}}*rkeys(){for(let v of ze(this,X,Ar).call(this)){let E=Z(this,R)[v];E!==void 0&&!ze(this,X,at).call(this,Z(this,T)[v])&&(yield E)}}*values(){for(let v of ze(this,X,kr).call(this))Z(this,T)[v]!==void 0&&!ze(this,X,at).call(this,Z(this,T)[v])&&(yield Z(this,T)[v])}*rvalues(){for(let v of ze(this,X,Ar).call(this))Z(this,T)[v]!==void 0&&!ze(this,X,at).call(this,Z(this,T)[v])&&(yield Z(this,T)[v])}[(S=Symbol.iterator,b=Symbol.toStringTag,S)](){return this.entries()}find(v,E={}){for(let P of ze(this,X,kr).call(this)){let V=Z(this,T)[P],te=ze(this,X,at).call(this,V)?V.__staleWhileFetching:V;if(te!==void 0&&v(te,Z(this,R)[P],this))return this.get(Z(this,R)[P],E)}}forEach(v,E=this){for(let P of ze(this,X,kr).call(this)){let V=Z(this,T)[P],te=ze(this,X,at).call(this,V)?V.__staleWhileFetching:V;te!==void 0&&v.call(E,te,Z(this,R)[P],this)}}rforEach(v,E=this){for(let P of ze(this,X,Ar).call(this)){let V=Z(this,T)[P],te=ze(this,X,at).call(this,V)?V.__staleWhileFetching:V;te!==void 0&&v.call(E,te,Z(this,R)[P],this)}}purgeStale(){let v=!1;for(let E of ze(this,X,Ar).call(this,{allowStale:!0}))Z(this,$).call(this,E)&&(ze(this,X,Cr).call(this,Z(this,R)[E],"expire"),v=!0);return v}info(v){let E=Z(this,j).get(v);if(E===void 0)return;let P=Z(this,T)[E],V=ze(this,X,at).call(this,P)?P.__staleWhileFetching:P;if(V===void 0)return;let te={value:V};if(Z(this,B)&&Z(this,Q)){let fe=Z(this,B)[E],re=Z(this,Q)[E];if(fe&&re){let oe=fe-(t.now()-re);te.ttl=oe,te.start=Date.now()}}return Z(this,ce)&&(te.size=Z(this,ce)[E]),te}dump(){let v=[];for(let E of ze(this,X,kr).call(this,{allowStale:!0})){let P=Z(this,R)[E],V=Z(this,T)[E],te=ze(this,X,at).call(this,V)?V.__staleWhileFetching:V;if(te===void 0||P===void 0)continue;let fe={value:te};if(Z(this,B)&&Z(this,Q)){fe.ttl=Z(this,B)[E];let re=t.now()-Z(this,Q)[E];fe.start=Math.floor(Date.now()-re)}Z(this,ce)&&(fe.size=Z(this,ce)[E]),v.unshift([P,fe])}return v}load(v){this.clear();for(let[E,P]of v){if(P.start){let V=Date.now()-P.start;P.start=t.now()-V}this.set(E,P.value,P)}}set(v,E,P={}){var Te,Re,Fe,De,We;if(E===void 0)return this.delete(v),this;let{ttl:V=this.ttl,start:te,noDisposeOnSet:fe=this.noDisposeOnSet,sizeCalculation:re=this.sizeCalculation,status:oe}=P,{noUpdateTTL:de=this.noUpdateTTL}=P,ge=Z(this,pe).call(this,v,E,P.size||0,re);if(this.maxEntrySize&&ge>this.maxEntrySize)return oe&&(oe.set="miss",oe.maxEntrySizeExceeded=!0),ze(this,X,Cr).call(this,v,"set"),this;let ke=Z(this,A)===0?void 0:Z(this,j).get(v);if(ke===void 0)ke=Z(this,A)===0?Z(this,ae):Z(this,J).length!==0?Z(this,J).pop():Z(this,A)===Z(this,g)?ze(this,X,as).call(this,!1):Z(this,A),Z(this,R)[ke]=v,Z(this,T)[ke]=E,Z(this,j).set(v,ke),Z(this,D)[Z(this,ae)]=ke,Z(this,H)[ke]=Z(this,ae),Ve(this,ae,ke),ss(this,A)._++,Z(this,me).call(this,ke,ge,oe),oe&&(oe.set="add"),de=!1;else{ze(this,X,fo).call(this,ke);let Oe=Z(this,T)[ke];if(E!==Oe){if(Z(this,Y)&&ze(this,X,at).call(this,Oe)){Oe.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:qe}=Oe;qe!==void 0&&!fe&&(Z(this,N)&&((Te=Z(this,_))==null||Te.call(this,qe,v,"set")),Z(this,ue)&&((Re=Z(this,M))==null||Re.push([qe,v,"set"])))}else fe||(Z(this,N)&&((Fe=Z(this,_))==null||Fe.call(this,Oe,v,"set")),Z(this,ue)&&((De=Z(this,M))==null||De.push([Oe,v,"set"])));if(Z(this,ne).call(this,ke),Z(this,me).call(this,ke,ge,oe),Z(this,T)[ke]=E,oe){oe.set="replace";let qe=Oe&&ze(this,X,at).call(this,Oe)?Oe.__staleWhileFetching:Oe;qe!==void 0&&(oe.oldValue=qe)}}else oe&&(oe.set="update")}if(V!==0&&!Z(this,B)&&ze(this,X,Kc).call(this),Z(this,B)&&(de||Z(this,le).call(this,ke,V,te),oe&&Z(this,W).call(this,oe,ke)),!fe&&Z(this,ue)&&Z(this,M)){let Oe=Z(this,M),qe;for(;qe=Oe==null?void 0:Oe.shift();)(We=Z(this,x))==null||We.call(this,...qe)}return this}pop(){var v;try{for(;Z(this,A);){let E=Z(this,T)[Z(this,U)];if(ze(this,X,as).call(this,!0),ze(this,X,at).call(this,E)){if(E.__staleWhileFetching)return E.__staleWhileFetching}else if(E!==void 0)return E}}finally{if(Z(this,ue)&&Z(this,M)){let E=Z(this,M),P;for(;P=E==null?void 0:E.shift();)(v=Z(this,x))==null||v.call(this,...P)}}}has(v,E={}){let{updateAgeOnHas:P=this.updateAgeOnHas,status:V}=E,te=Z(this,j).get(v);if(te!==void 0){let fe=Z(this,T)[te];if(ze(this,X,at).call(this,fe)&&fe.__staleWhileFetching===void 0)return!1;if(Z(this,$).call(this,te))V&&(V.has="stale",Z(this,W).call(this,V,te));else return P&&Z(this,L).call(this,te),V&&(V.has="hit",Z(this,W).call(this,V,te)),!0}else V&&(V.has="miss");return!1}peek(v,E={}){let{allowStale:P=this.allowStale}=E,V=Z(this,j).get(v);if(V===void 0||!P&&Z(this,$).call(this,V))return;let te=Z(this,T)[V];return ze(this,X,at).call(this,te)?te.__staleWhileFetching:te}async fetch(v,E={}){let{allowStale:P=this.allowStale,updateAgeOnGet:V=this.updateAgeOnGet,noDeleteOnStaleGet:te=this.noDeleteOnStaleGet,ttl:fe=this.ttl,noDisposeOnSet:re=this.noDisposeOnSet,size:oe=0,sizeCalculation:de=this.sizeCalculation,noUpdateTTL:ge=this.noUpdateTTL,noDeleteOnFetchRejection:ke=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Te=this.allowStaleOnFetchRejection,ignoreFetchAbort:Re=this.ignoreFetchAbort,allowStaleOnFetchAbort:Fe=this.allowStaleOnFetchAbort,context:De,forceRefresh:We=!1,status:Oe,signal:qe}=E;if(!Z(this,Y))return Oe&&(Oe.fetch="get"),this.get(v,{allowStale:P,updateAgeOnGet:V,noDeleteOnStaleGet:te,status:Oe});let Ge={allowStale:P,updateAgeOnGet:V,noDeleteOnStaleGet:te,ttl:fe,noDisposeOnSet:re,size:oe,sizeCalculation:de,noUpdateTTL:ge,noDeleteOnFetchRejection:ke,allowStaleOnFetchRejection:Te,allowStaleOnFetchAbort:Fe,ignoreFetchAbort:Re,status:Oe,signal:qe},He=Z(this,j).get(v);if(He===void 0){Oe&&(Oe.fetch="miss");let Ye=ze(this,X,ls).call(this,v,He,Ge,De);return Ye.__returned=Ye}else{let Ye=Z(this,T)[He];if(ze(this,X,at).call(this,Ye)){let Ie=P&&Ye.__staleWhileFetching!==void 0;return Oe&&(Oe.fetch="inflight",Ie&&(Oe.returnedStale=!0)),Ie?Ye.__staleWhileFetching:Ye.__returned=Ye}let ot=Z(this,$).call(this,He);if(!We&&!ot)return Oe&&(Oe.fetch="hit"),ze(this,X,fo).call(this,He),V&&Z(this,L).call(this,He),Oe&&Z(this,W).call(this,Oe,He),Ye;let F=ze(this,X,ls).call(this,v,He,Ge,De),K=F.__staleWhileFetching!==void 0&&P;return Oe&&(Oe.fetch=ot?"stale":"refresh",K&&ot&&(Oe.returnedStale=!0)),K?F.__staleWhileFetching:F.__returned=F}}async forceFetch(v,E={}){let P=await this.fetch(v,E);if(P===void 0)throw new Error("fetch() returned undefined");return P}memo(v,E={}){let P=Z(this,C);if(!P)throw new Error("no memoMethod provided to constructor");let{context:V,forceRefresh:te,...fe}=E,re=this.get(v,fe);if(!te&&re!==void 0)return re;let oe=P(v,re,{options:fe,context:V});return this.set(v,oe,fe),oe}get(v,E={}){let{allowStale:P=this.allowStale,updateAgeOnGet:V=this.updateAgeOnGet,noDeleteOnStaleGet:te=this.noDeleteOnStaleGet,status:fe}=E,re=Z(this,j).get(v);if(re!==void 0){let oe=Z(this,T)[re],de=ze(this,X,at).call(this,oe);return fe&&Z(this,W).call(this,fe,re),Z(this,$).call(this,re)?(fe&&(fe.get="stale"),de?(fe&&P&&oe.__staleWhileFetching!==void 0&&(fe.returnedStale=!0),P?oe.__staleWhileFetching:void 0):(te||ze(this,X,Cr).call(this,v,"expire"),fe&&P&&(fe.returnedStale=!0),P?oe:void 0)):(fe&&(fe.get="hit"),de?oe.__staleWhileFetching:(ze(this,X,fo).call(this,re),V&&Z(this,L).call(this,re),oe))}else fe&&(fe.get="miss")}delete(v){return ze(this,X,Cr).call(this,v,"delete")}clear(){return ze(this,X,Jc).call(this,"delete")}},g=new WeakMap,w=new WeakMap,_=new WeakMap,x=new WeakMap,I=new WeakMap,C=new WeakMap,A=new WeakMap,O=new WeakMap,j=new WeakMap,R=new WeakMap,T=new WeakMap,D=new WeakMap,H=new WeakMap,U=new WeakMap,ae=new WeakMap,J=new WeakMap,M=new WeakMap,ce=new WeakMap,Q=new WeakMap,B=new WeakMap,N=new WeakMap,Y=new WeakMap,ue=new WeakMap,X=new WeakSet,Kc=function(){let v=new u(Z(this,g)),E=new u(Z(this,g));Ve(this,B,v),Ve(this,Q,E),Ve(this,le,(te,fe,re=t.now())=>{if(E[te]=fe!==0?re:0,v[te]=fe,fe!==0&&this.ttlAutopurge){let oe=setTimeout(()=>{Z(this,$).call(this,te)&&ze(this,X,Cr).call(this,Z(this,R)[te],"expire")},fe+1);oe.unref&&oe.unref()}}),Ve(this,L,te=>{E[te]=v[te]!==0?t.now():0}),Ve(this,W,(te,fe)=>{if(v[fe]){let re=v[fe],oe=E[fe];if(!re||!oe)return;te.ttl=re,te.start=oe,te.now=P||V();let de=te.now-oe;te.remainingTTL=re-de}});let P=0,V=()=>{let te=t.now();if(this.ttlResolution>0){P=te;let fe=setTimeout(()=>P=0,this.ttlResolution);fe.unref&&fe.unref()}return te};this.getRemainingTTL=te=>{let fe=Z(this,j).get(te);if(fe===void 0)return 0;let re=v[fe],oe=E[fe];if(!re||!oe)return 1/0;let de=(P||V())-oe;return re-de},Ve(this,$,te=>{let fe=E[te],re=v[te];return!!re&&!!fe&&(P||V())-fe>re})},L=new WeakMap,W=new WeakMap,le=new WeakMap,$=new WeakMap,Lm=function(){let v=new u(Z(this,g));Ve(this,O,0),Ve(this,ce,v),Ve(this,ne,E=>{Ve(this,O,Z(this,O)-v[E]),v[E]=0}),Ve(this,pe,(E,P,V,te)=>{if(ze(this,X,at).call(this,P))return 0;if(!l(V))if(te){if(typeof te!="function")throw new TypeError("sizeCalculation must be a function");if(V=te(P,E),!l(V))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return V}),Ve(this,me,(E,P,V)=>{if(v[E]=P,Z(this,w)){let te=Z(this,w)-v[E];for(;Z(this,O)>te;)ze(this,X,as).call(this,!0)}Ve(this,O,Z(this,O)+v[E]),V&&(V.entrySize=P,V.totalCalculatedSize=Z(this,O))})},ne=new WeakMap,me=new WeakMap,pe=new WeakMap,kr=function*({allowStale:v=this.allowStale}={}){if(Z(this,A))for(let E=Z(this,ae);!(!ze(this,X,Gc).call(this,E)||((v||!Z(this,$).call(this,E))&&(yield E),E===Z(this,U)));)E=Z(this,H)[E]},Ar=function*({allowStale:v=this.allowStale}={}){if(Z(this,A))for(let E=Z(this,U);!(!ze(this,X,Gc).call(this,E)||((v||!Z(this,$).call(this,E))&&(yield E),E===Z(this,ae)));)E=Z(this,D)[E]},Gc=function(v){return v!==void 0&&Z(this,j).get(Z(this,R)[v])===v},as=function(v){var te,fe;let E=Z(this,U),P=Z(this,R)[E],V=Z(this,T)[E];return Z(this,Y)&&ze(this,X,at).call(this,V)?V.__abortController.abort(new Error("evicted")):(Z(this,N)||Z(this,ue))&&(Z(this,N)&&((te=Z(this,_))==null||te.call(this,V,P,"evict")),Z(this,ue)&&((fe=Z(this,M))==null||fe.push([V,P,"evict"]))),Z(this,ne).call(this,E),v&&(Z(this,R)[E]=void 0,Z(this,T)[E]=void 0,Z(this,J).push(E)),Z(this,A)===1?(Ve(this,U,Ve(this,ae,0)),Z(this,J).length=0):Ve(this,U,Z(this,D)[E]),Z(this,j).delete(P),ss(this,A)._--,E},ls=function(v,E,P,V){let te=E===void 0?void 0:Z(this,T)[E];if(ze(this,X,at).call(this,te))return te;let fe=new o,{signal:re}=P;re==null||re.addEventListener("abort",()=>fe.abort(re.reason),{signal:fe.signal});let oe={signal:fe.signal,options:P,context:V},de=(De,We=!1)=>{let{aborted:Oe}=fe.signal,qe=P.ignoreFetchAbort&&De!==void 0;if(P.status&&(Oe&&!We?(P.status.fetchAborted=!0,P.status.fetchError=fe.signal.reason,qe&&(P.status.fetchAbortIgnored=!0)):P.status.fetchResolved=!0),Oe&&!qe&&!We)return ke(fe.signal.reason);let Ge=Re;return Z(this,T)[E]===Re&&(De===void 0?Ge.__staleWhileFetching?Z(this,T)[E]=Ge.__staleWhileFetching:ze(this,X,Cr).call(this,v,"fetch"):(P.status&&(P.status.fetchUpdated=!0),this.set(v,De,oe.options))),De},ge=De=>(P.status&&(P.status.fetchRejected=!0,P.status.fetchError=De),ke(De)),ke=De=>{let{aborted:We}=fe.signal,Oe=We&&P.allowStaleOnFetchAbort,qe=Oe||P.allowStaleOnFetchRejection,Ge=qe||P.noDeleteOnFetchRejection,He=Re;if(Z(this,T)[E]===Re&&(!Ge||He.__staleWhileFetching===void 0?ze(this,X,Cr).call(this,v,"fetch"):Oe||(Z(this,T)[E]=He.__staleWhileFetching)),qe)return P.status&&He.__staleWhileFetching!==void 0&&(P.status.returnedStale=!0),He.__staleWhileFetching;if(He.__returned===He)throw De},Te=(De,We)=>{var qe;let Oe=(qe=Z(this,I))==null?void 0:qe.call(this,v,te,oe);Oe&&Oe instanceof Promise&&Oe.then(Ge=>De(Ge===void 0?void 0:Ge),We),fe.signal.addEventListener("abort",()=>{(!P.ignoreFetchAbort||P.allowStaleOnFetchAbort)&&(De(void 0),P.allowStaleOnFetchAbort&&(De=Ge=>de(Ge,!0)))})};P.status&&(P.status.fetchDispatched=!0);let Re=new Promise(Te).then(de,ge),Fe=Object.assign(Re,{__abortController:fe,__staleWhileFetching:te,__returned:void 0});return E===void 0?(this.set(v,Fe,{...oe.options,status:void 0}),E=Z(this,j).get(v)):Z(this,T)[E]=Fe,Fe},at=function(v){if(!Z(this,Y))return!1;let E=v;return!!E&&E instanceof Promise&&E.hasOwnProperty("__staleWhileFetching")&&E.__abortController instanceof o},Yc=function(v,E){Z(this,H)[E]=v,Z(this,D)[v]=E},fo=function(v){v!==Z(this,ae)&&(v===Z(this,U)?Ve(this,U,Z(this,D)[v]):ze(this,X,Yc).call(this,Z(this,H)[v],Z(this,D)[v]),ze(this,X,Yc).call(this,Z(this,ae),v),Ve(this,ae,v))},Cr=function(v,E){var V,te,fe,re;let P=!1;if(Z(this,A)!==0){let oe=Z(this,j).get(v);if(oe!==void 0)if(P=!0,Z(this,A)===1)ze(this,X,Jc).call(this,E);else{Z(this,ne).call(this,oe);let de=Z(this,T)[oe];if(ze(this,X,at).call(this,de)?de.__abortController.abort(new Error("deleted")):(Z(this,N)||Z(this,ue))&&(Z(this,N)&&((V=Z(this,_))==null||V.call(this,de,v,E)),Z(this,ue)&&((te=Z(this,M))==null||te.push([de,v,E]))),Z(this,j).delete(v),Z(this,R)[oe]=void 0,Z(this,T)[oe]=void 0,oe===Z(this,ae))Ve(this,ae,Z(this,H)[oe]);else if(oe===Z(this,U))Ve(this,U,Z(this,D)[oe]);else{let ge=Z(this,H)[oe];Z(this,D)[ge]=Z(this,D)[oe];let ke=Z(this,D)[oe];Z(this,H)[ke]=Z(this,H)[oe]}ss(this,A)._--,Z(this,J).push(oe)}}if(Z(this,ue)&&((fe=Z(this,M))!=null&&fe.length)){let oe=Z(this,M),de;for(;de=oe==null?void 0:oe.shift();)(re=Z(this,x))==null||re.call(this,...de)}return P},Jc=function(v){var E,P,V;for(let te of ze(this,X,Ar).call(this,{allowStale:!0})){let fe=Z(this,T)[te];if(ze(this,X,at).call(this,fe))fe.__abortController.abort(new Error("deleted"));else{let re=Z(this,R)[te];Z(this,N)&&((E=Z(this,_))==null||E.call(this,fe,re,v)),Z(this,ue)&&((P=Z(this,M))==null||P.push([fe,re,v]))}}if(Z(this,j).clear(),Z(this,T).fill(void 0),Z(this,R).fill(void 0),Z(this,B)&&Z(this,Q)&&(Z(this,B).fill(0),Z(this,Q).fill(0)),Z(this,ce)&&Z(this,ce).fill(0),Ve(this,U,0),Ve(this,ae,0),Z(this,J).length=0,Ve(this,O,0),Ve(this,A,0),Z(this,ue)&&Z(this,M)){let te=Z(this,M),fe;for(;fe=te==null?void 0:te.shift();)(V=Z(this,x))==null||V.call(this,...fe)}},$e);e.LRUCache=f}),or=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"t",{value:!0}),e.ContainerIterator=e.Container=e.Base=void 0;var t=class{constructor(s=0){this.iteratorType=s}equals(s){return this.o===s.o}};e.ContainerIterator=t;var r=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}};e.Base=r;var n=class extends r{};e.Container=n}),fS=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=or(),r=class extends t.Base{constructor(s=[]){super(),this.S=[];let o=this;s.forEach((function(i){o.push(i)}))}clear(){this.i=0,this.S=[]}push(s){return this.S.push(s),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}},n=r;e.default=n}),hS=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=or(),r=class extends t.Base{constructor(s=[]){super(),this.j=0,this.q=[];let o=this;s.forEach((function(i){o.push(i)}))}clear(){this.q=[],this.i=this.j=0}push(s){let o=this.q.length;if(this.j/o>.5&&this.j+this.i>=o&&o>4096){let i=this.i;for(let a=0;a<i;++a)this.q[a]=this.q[this.j+a];this.j=0,this.q[this.i]=s}else this.q[this.j+this.i]=s;return++this.i}pop(){if(this.i===0)return;let s=this.q[this.j++];return this.i-=1,s}front(){if(this.i!==0)return this.q[this.j]}},n=r;e.default=n}),pS=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=or(),r=class extends t.Base{constructor(s=[],o=function(a,l){return a>l?-1:a<l?1:0},i=!0){if(super(),this.v=o,Array.isArray(s))this.C=i?[...s]:s;else{this.C=[];let l=this;s.forEach((function(c){l.C.push(c)}))}this.i=this.C.length;let a=this.i>>1;for(let l=this.i-1>>1;l>=0;--l)this.k(l,a)}m(s){let o=this.C[s];for(;s>0;){let i=s-1>>1,a=this.C[i];if(this.v(a,o)<=0)break;this.C[s]=a,s=i}this.C[s]=o}k(s,o){let i=this.C[s];for(;s<o;){let a=s<<1|1,l=a+1,c=this.C[a];if(l<this.i&&this.v(c,this.C[l])>0&&(a=l,c=this.C[l]),this.v(c,i)>=0)break;this.C[s]=c,s=a}this.C[s]=i}clear(){this.i=0,this.C.length=0}push(s){this.C.push(s),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;let s=this.C[0],o=this.C.pop();return this.i-=1,this.i&&(this.C[0]=o,this.k(0,this.i>>1)),s}top(){return this.C[0]}find(s){return this.C.indexOf(s)>=0}remove(s){let o=this.C.indexOf(s);return o<0?!1:(o===0?this.pop():o===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(o,1,this.C.pop()),this.i-=1,this.m(o),this.k(o,this.i>>1)),!0)}updateItem(s){let o=this.C.indexOf(s);return o<0?!1:(this.m(o),this.k(o,this.i>>1),!0)}toArray(){return[...this.C]}},n=r;e.default=n}),Fl=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=or(),r=class extends t.Container{},n=r;e.default=n}),ir=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"t",{value:!0}),e.throwIteratorAccessError=t;function t(){throw new RangeError("Iterator access denied!")}}),_p=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"t",{value:!0}),e.RandomIterator=void 0;var t=or(),r=ir(),n=class extends t.ContainerIterator{constructor(s,o){super(o),this.o=s,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0,r.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,r.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,r.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0,r.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(s){this.container.setElementByPos(this.o,s)}};e.RandomIterator=n}),gS=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=n(Fl()),r=_p();function n(a){return a&&a.t?a:{default:a}}var s=class zm extends r.RandomIterator{constructor(l,c,u){super(l,u),this.container=c}copy(){return new zm(this.o,this.container,this.iteratorType)}},o=class extends t.default{constructor(a=[],l=!0){if(super(),Array.isArray(a))this.J=l?[...a]:a,this.i=a.length;else{this.J=[];let c=this;a.forEach((function(u){c.pushBack(u)}))}}clear(){this.i=0,this.J.length=0}begin(){return new s(0,this)}end(){return new s(this.i,this)}rBegin(){return new s(this.i-1,this,1)}rEnd(){return new s(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(a){if(a<0||a>this.i-1)throw new RangeError;return this.J[a]}eraseElementByPos(a){if(a<0||a>this.i-1)throw new RangeError;return this.J.splice(a,1),this.i-=1,this.i}eraseElementByValue(a){let l=0;for(let c=0;c<this.i;++c)this.J[c]!==a&&(this.J[l++]=this.J[c]);return this.i=this.J.length=l,this.i}eraseElementByIterator(a){let l=a.o;return a=a.next(),this.eraseElementByPos(l),a}pushBack(a){return this.J.push(a),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(a,l){if(a<0||a>this.i-1)throw new RangeError;this.J[a]=l}insert(a,l,c=1){if(a<0||a>this.i)throw new RangeError;return this.J.splice(a,0,...new Array(c).fill(l)),this.i+=c,this.i}find(a){for(let l=0;l<this.i;++l)if(this.J[l]===a)return new s(l,this);return this.end()}reverse(){this.J.reverse()}unique(){let a=1;for(let l=1;l<this.i;++l)this.J[l]!==this.J[l-1]&&(this.J[a++]=this.J[l]);return this.i=this.J.length=a,this.i}sort(a){this.J.sort(a)}forEach(a){for(let l=0;l<this.i;++l)a(this.J[l],l,this)}[Symbol.iterator](){return(function*(){yield*this.J}).bind(this)()}},i=o;e.default=i}),mS=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=s(Fl()),r=or(),n=ir();function s(l){return l&&l.t?l:{default:l}}var o=class Bm extends r.ContainerIterator{constructor(c,u,d,f){super(f),this.o=c,this.h=u,this.container=d,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,n.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,n.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,n.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,n.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,n.throwIteratorAccessError)(),this.o.l}set pointer(c){this.o===this.h&&(0,n.throwIteratorAccessError)(),this.o.l=c}copy(){return new Bm(this.o,this.h,this.container,this.iteratorType)}},i=class extends t.default{constructor(l=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let c=this;l.forEach((function(u){c.pushBack(u)}))}V(l){let{L:c,B:u}=l;c.B=u,u.L=c,l===this.p&&(this.p=u),l===this._&&(this._=c),this.i-=1}G(l,c){let u=c.B,d={l,L:c,B:u};c.B=d,u.L=d,c===this.h&&(this.p=d),u===this.h&&(this._=d),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new o(this.p,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this._,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(l){if(l<0||l>this.i-1)throw new RangeError;let c=this.p;for(;l--;)c=c.B;return c.l}eraseElementByPos(l){if(l<0||l>this.i-1)throw new RangeError;let c=this.p;for(;l--;)c=c.B;return this.V(c),this.i}eraseElementByValue(l){let c=this.p;for(;c!==this.h;)c.l===l&&this.V(c),c=c.B;return this.i}eraseElementByIterator(l){let c=l.o;return c===this.h&&(0,n.throwIteratorAccessError)(),l=l.next(),this.V(c),l}pushBack(l){return this.G(l,this._),this.i}popBack(){if(this.i===0)return;let l=this._.l;return this.V(this._),l}pushFront(l){return this.G(l,this.h),this.i}popFront(){if(this.i===0)return;let l=this.p.l;return this.V(this.p),l}setElementByPos(l,c){if(l<0||l>this.i-1)throw new RangeError;let u=this.p;for(;l--;)u=u.B;u.l=c}insert(l,c,u=1){if(l<0||l>this.i)throw new RangeError;if(u<=0)return this.i;if(l===0)for(;u--;)this.pushFront(c);else if(l===this.i)for(;u--;)this.pushBack(c);else{let d=this.p;for(let h=1;h<l;++h)d=d.B;let f=d.B;for(this.i+=u;u--;)d.B={l:c,L:d},d.B.L=d,d=d.B;d.B=f,f.L=d}return this.i}find(l){let c=this.p;for(;c!==this.h;){if(c.l===l)return new o(c,this.h,this);c=c.B}return this.end()}reverse(){if(this.i<=1)return;let l=this.p,c=this._,u=0;for(;u<<1<this.i;){let d=l.l;l.l=c.l,c.l=d,l=l.B,c=c.L,u+=1}}unique(){if(this.i<=1)return this.i;let l=this.p;for(;l!==this.h;){let c=l;for(;c.B!==this.h&&c.l===c.B.l;)c=c.B,this.i-=1;l.B=c.B,l.B.L=l,l=l.B}return this.i}sort(l){if(this.i<=1)return;let c=[];this.forEach((function(d){c.push(d)})),c.sort(l);let u=this.p;c.forEach((function(d){u.l=d,u=u.B}))}merge(l){let c=this;if(this.i===0)l.forEach((function(u){c.pushBack(u)}));else{let u=this.p;l.forEach((function(d){for(;u!==c.h&&u.l<=d;)u=u.B;c.G(d,u.L)}))}return this.i}forEach(l){let c=this.p,u=0;for(;c!==this.h;)l(c.l,u++,this),c=c.B}[Symbol.iterator](){return(function*(){if(this.i===0)return;let l=this.p;for(;l!==this.h;)yield l.l,l=l.B}).bind(this)()}},a=i;e.default=a}),bS=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=n(Fl()),r=_p();function n(a){return a&&a.t?a:{default:a}}var s=class Um extends r.RandomIterator{constructor(l,c,u){super(l,u),this.container=c}copy(){return new Um(this.o,this.container,this.iteratorType)}},o=class extends t.default{constructor(a=[],l=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let c=(()=>{if(typeof a.length=="number")return a.length;if(typeof a.size=="number")return a.size;if(typeof a.size=="function")return a.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=l,this.P=Math.max(Math.ceil(c/this.F),1);for(let f=0;f<this.P;++f)this.A.push(new Array(this.F));let u=Math.ceil(c/this.F);this.j=this.R=(this.P>>1)-(u>>1),this.D=this.N=this.F-c%this.F>>1;let d=this;a.forEach((function(f){d.pushBack(f)}))}T(){let a=[],l=Math.max(this.P>>1,1);for(let c=0;c<l;++c)a[c]=new Array(this.F);for(let c=this.j;c<this.P;++c)a[a.length]=this.A[c];for(let c=0;c<this.R;++c)a[a.length]=this.A[c];a[a.length]=[...this.A[this.R]],this.j=l,this.R=a.length-1;for(let c=0;c<l;++c)a[a.length]=new Array(this.F);this.A=a,this.P=a.length}O(a){let l=this.D+a+1,c=l%this.F,u=c-1,d=this.j+(l-c)/this.F;return c===0&&(d-=1),d%=this.P,u<0&&(u+=this.F),{curNodeBucketIndex:d,curNodePointerIndex:u}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new s(0,this)}end(){return new s(this.i,this)}rBegin(){return new s(this.i-1,this,1)}rEnd(){return new s(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(a){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=a,this.i}popBack(){if(this.i===0)return;let a=this.A[this.R][this.N];return this.i!==1&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,a}pushFront(a){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=a,this.i}popFront(){if(this.i===0)return;let a=this.A[this.j][this.D];return this.i!==1&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,a}getElementByPos(a){if(a<0||a>this.i-1)throw new RangeError;let{curNodeBucketIndex:l,curNodePointerIndex:c}=this.O(a);return this.A[l][c]}setElementByPos(a,l){if(a<0||a>this.i-1)throw new RangeError;let{curNodeBucketIndex:c,curNodePointerIndex:u}=this.O(a);this.A[c][u]=l}insert(a,l,c=1){if(a<0||a>this.i)throw new RangeError;if(a===0)for(;c--;)this.pushFront(l);else if(a===this.i)for(;c--;)this.pushBack(l);else{let u=[];for(let d=a;d<this.i;++d)u.push(this.getElementByPos(d));this.cut(a-1);for(let d=0;d<c;++d)this.pushBack(l);for(let d=0;d<u.length;++d)this.pushBack(u[d])}return this.i}cut(a){if(a<0)return this.clear(),0;let{curNodeBucketIndex:l,curNodePointerIndex:c}=this.O(a);return this.R=l,this.N=c,this.i=a+1,this.i}eraseElementByPos(a){if(a<0||a>this.i-1)throw new RangeError;if(a===0)this.popFront();else if(a===this.i-1)this.popBack();else{let l=[];for(let u=a+1;u<this.i;++u)l.push(this.getElementByPos(u));this.cut(a),this.popBack();let c=this;l.forEach((function(u){c.pushBack(u)}))}return this.i}eraseElementByValue(a){if(this.i===0)return 0;let l=[];for(let u=0;u<this.i;++u){let d=this.getElementByPos(u);d!==a&&l.push(d)}let c=l.length;for(let u=0;u<c;++u)this.setElementByPos(u,l[u]);return this.cut(c-1)}eraseElementByIterator(a){let l=a.o;return this.eraseElementByPos(l),a=a.next(),a}find(a){for(let l=0;l<this.i;++l)if(this.getElementByPos(l)===a)return new s(l,this);return this.end()}reverse(){let a=0,l=this.i-1;for(;a<l;){let c=this.getElementByPos(a);this.setElementByPos(a,this.getElementByPos(l)),this.setElementByPos(l,c),a+=1,l-=1}}unique(){if(this.i<=1)return this.i;let a=1,l=this.getElementByPos(0);for(let c=1;c<this.i;++c){let u=this.getElementByPos(c);u!==l&&(l=u,this.setElementByPos(a++,u))}for(;this.i>a;)this.popBack();return this.i}sort(a){let l=[];for(let c=0;c<this.i;++c)l.push(this.getElementByPos(c));l.sort(a);for(let c=0;c<this.i;++c)this.setElementByPos(c,l[c])}shrinkToFit(){if(this.i===0)return;let a=[];this.forEach((function(l){a.push(l)})),this.P=Math.max(Math.ceil(this.i/this.F),1),this.i=this.j=this.R=this.D=this.N=0,this.A=[];for(let l=0;l<this.P;++l)this.A.push(new Array(this.F));for(let l=0;l<a.length;++l)this.pushBack(a[l])}forEach(a){for(let l=0;l<this.i;++l)a(this.getElementByPos(l),l,this)}[Symbol.iterator](){return(function*(){for(let a=0;a<this.i;++a)yield this.getElementByPos(a)}).bind(this)()}},i=o;e.default=i}),yS=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"t",{value:!0}),e.TreeNodeEnableIndex=e.TreeNode=void 0;var t=class{constructor(n,s){this.ee=1,this.u=void 0,this.l=void 0,this.U=void 0,this.W=void 0,this.tt=void 0,this.u=n,this.l=s}L(){let n=this;if(n.ee===1&&n.tt.tt===n)n=n.W;else if(n.U)for(n=n.U;n.W;)n=n.W;else{let s=n.tt;for(;s.U===n;)n=s,s=n.tt;n=s}return n}B(){let n=this;if(n.W){for(n=n.W;n.U;)n=n.U;return n}else{let s=n.tt;for(;s.W===n;)n=s,s=n.tt;return n.W!==s?s:n}}te(){let n=this.tt,s=this.W,o=s.U;return n.tt===this?n.tt=s:n.U===this?n.U=s:n.W=s,s.tt=n,s.U=this,this.tt=s,this.W=o,o&&(o.tt=this),s}se(){let n=this.tt,s=this.U,o=s.W;return n.tt===this?n.tt=s:n.U===this?n.U=s:n.W=s,s.tt=n,s.W=this,this.tt=s,this.U=o,o&&(o.tt=this),s}};e.TreeNode=t;var r=class extends t{constructor(){super(...arguments),this.rt=1}te(){let n=super.te();return this.ie(),n.ie(),n}se(){let n=super.se();return this.ie(),n.ie(),n}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}};e.TreeNodeEnableIndex=r}),Sp=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=yS(),r=or(),n=ir(),s=class extends r.Container{constructor(i=function(l,c){return l<c?-1:l>c?1:0},a=!1){super(),this.Y=void 0,this.v=i,a?(this.re=t.TreeNodeEnableIndex,this.M=function(l,c,u){let d=this.ne(l,c,u);if(d){let f=d.tt;for(;f!==this.h;)f.rt+=1,f=f.tt;let h=this.he(d);if(h){let{parentNode:y,grandParent:m,curNode:b}=h;y.ie(),m.ie(),b.ie()}}return this.i},this.V=function(l){let c=this.fe(l);for(;c!==this.h;)c.rt-=1,c=c.tt}):(this.re=t.TreeNode,this.M=function(l,c,u){let d=this.ne(l,c,u);return d&&this.he(d),this.i},this.V=this.fe),this.h=new this.re}X(i,a){let l=this.h;for(;i;){let c=this.v(i.u,a);if(c<0)i=i.W;else if(c>0)l=i,i=i.U;else return i}return l}Z(i,a){let l=this.h;for(;i;)this.v(i.u,a)<=0?i=i.W:(l=i,i=i.U);return l}$(i,a){let l=this.h;for(;i;){let c=this.v(i.u,a);if(c<0)l=i,i=i.W;else if(c>0)i=i.U;else return i}return l}rr(i,a){let l=this.h;for(;i;)this.v(i.u,a)<0?(l=i,i=i.W):i=i.U;return l}ue(i){for(;;){let a=i.tt;if(a===this.h)return;if(i.ee===1){i.ee=0;return}if(i===a.U){let l=a.W;if(l.ee===1)l.ee=0,a.ee=1,a===this.Y?this.Y=a.te():a.te();else if(l.W&&l.W.ee===1){l.ee=a.ee,a.ee=0,l.W.ee=0,a===this.Y?this.Y=a.te():a.te();return}else l.U&&l.U.ee===1?(l.ee=1,l.U.ee=0,l.se()):(l.ee=1,i=a)}else{let l=a.U;if(l.ee===1)l.ee=0,a.ee=1,a===this.Y?this.Y=a.se():a.se();else if(l.U&&l.U.ee===1){l.ee=a.ee,a.ee=0,l.U.ee=0,a===this.Y?this.Y=a.se():a.se();return}else l.W&&l.W.ee===1?(l.ee=1,l.W.ee=0,l.te()):(l.ee=1,i=a)}}}fe(i){if(this.i===1)return this.clear(),this.h;let a=i;for(;a.U||a.W;){if(a.W)for(a=a.W;a.U;)a=a.U;else a=a.U;[i.u,a.u]=[a.u,i.u],[i.l,a.l]=[a.l,i.l],i=a}this.h.U===a?this.h.U=a.tt:this.h.W===a&&(this.h.W=a.tt),this.ue(a);let l=a.tt;return a===l.U?l.U=void 0:l.W=void 0,this.i-=1,this.Y.ee=0,l}oe(i,a){return i===void 0?!1:this.oe(i.U,a)||a(i)?!0:this.oe(i.W,a)}he(i){for(;;){let a=i.tt;if(a.ee===0)return;let l=a.tt;if(a===l.U){let c=l.W;if(c&&c.ee===1){if(c.ee=a.ee=0,l===this.Y)return;l.ee=1,i=l;continue}else if(i===a.W){if(i.ee=0,i.U&&(i.U.tt=a),i.W&&(i.W.tt=l),a.W=i.U,l.U=i.W,i.U=a,i.W=l,l===this.Y)this.Y=i,this.h.tt=i;else{let u=l.tt;u.U===l?u.U=i:u.W=i}return i.tt=l.tt,a.tt=i,l.tt=i,l.ee=1,{parentNode:a,grandParent:l,curNode:i}}else a.ee=0,l===this.Y?this.Y=l.se():l.se(),l.ee=1}else{let c=l.U;if(c&&c.ee===1){if(c.ee=a.ee=0,l===this.Y)return;l.ee=1,i=l;continue}else if(i===a.U){if(i.ee=0,i.U&&(i.U.tt=l),i.W&&(i.W.tt=a),l.W=i.U,a.U=i.W,i.U=l,i.W=a,l===this.Y)this.Y=i,this.h.tt=i;else{let u=l.tt;u.U===l?u.U=i:u.W=i}return i.tt=l.tt,a.tt=i,l.tt=i,l.ee=1,{parentNode:a,grandParent:l,curNode:i}}else a.ee=0,l===this.Y?this.Y=l.te():l.te(),l.ee=1}return}}ne(i,a,l){if(this.Y===void 0){this.i+=1,this.Y=new this.re(i,a),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,this.h.W=this.Y;return}let c,u=this.h.U,d=this.v(u.u,i);if(d===0){u.l=a;return}else if(d>0)u.U=new this.re(i,a),u.U.tt=u,c=u.U,this.h.U=c;else{let f=this.h.W,h=this.v(f.u,i);if(h===0){f.l=a;return}else if(h<0)f.W=new this.re(i,a),f.W.tt=f,c=f.W,this.h.W=c;else{if(l!==void 0){let y=l.o;if(y!==this.h){let m=this.v(y.u,i);if(m===0){y.l=a;return}else if(m>0){let b=y.L(),S=this.v(b.u,i);if(S===0){b.l=a;return}else S<0&&(c=new this.re(i,a),b.W===void 0?(b.W=c,c.tt=b):(y.U=c,c.tt=y))}}}if(c===void 0)for(c=this.Y;;){let y=this.v(c.u,i);if(y>0){if(c.U===void 0){c.U=new this.re(i,a),c.U.tt=c,c=c.U;break}c=c.U}else if(y<0){if(c.W===void 0){c.W=new this.re(i,a),c.W.tt=c,c=c.W;break}c=c.W}else{c.l=a;return}}}}return this.i+=1,c}I(i,a){for(;i;){let l=this.v(i.u,a);if(l<0)i=i.W;else if(l>0)i=i.U;else return i}return i||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(i,a){let l=i.o;if(l===this.h&&(0,n.throwIteratorAccessError)(),this.i===1)return l.u=a,!0;if(l===this.h.U)return this.v(l.B().u,a)>0?(l.u=a,!0):!1;if(l===this.h.W)return this.v(l.L().u,a)<0?(l.u=a,!0):!1;let c=l.L().u;if(this.v(c,a)>=0)return!1;let u=l.B().u;return this.v(u,a)<=0?!1:(l.u=a,!0)}eraseElementByPos(i){if(i<0||i>this.i-1)throw new RangeError;let a=0,l=this;return this.oe(this.Y,(function(c){return i===a?(l.V(c),!0):(a+=1,!1)})),this.i}eraseElementByKey(i){if(this.i===0)return!1;let a=this.I(this.Y,i);return a===this.h?!1:(this.V(a),!0)}eraseElementByIterator(i){let a=i.o;a===this.h&&(0,n.throwIteratorAccessError)();let l=a.W===void 0;return i.iteratorType===0?l&&i.next():(!l||a.U===void 0)&&i.next(),this.V(a),i}forEach(i){let a=0;for(let l of this)i(l,a++,this)}getElementByPos(i){if(i<0||i>this.i-1)throw new RangeError;let a,l=0;for(let c of this){if(l===i){a=c;break}l+=1}return a}getHeight(){if(this.i===0)return 0;let i=function(a){return a?Math.max(i(a.U),i(a.W))+1:0};return i(this.Y)}},o=s;e.default=o}),Ep=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=or(),r=ir(),n=class extends t.ContainerIterator{constructor(o,i,a){super(a),this.o=o,this.h=i,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0,r.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,r.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let o=this.o,i=this.h.tt;if(o===this.h)return i?i.rt-1:0;let a=0;for(o.U&&(a+=o.U.rt);o!==i;){let l=o.tt;o===l.W&&(a+=1,l.U&&(a+=l.U.rt)),o=l}return a}},s=n;e.default=s}),vS=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=s(Sp()),r=s(Ep()),n=ir();function s(l){return l&&l.t?l:{default:l}}var o=class Fm extends r.default{constructor(c,u,d,f){super(c,u,f),this.container=d}get pointer(){return this.o===this.h&&(0,n.throwIteratorAccessError)(),this.o.u}copy(){return new Fm(this.o,this.h,this.container,this.iteratorType)}},i=class extends t.default{constructor(l=[],c,u){super(c,u);let d=this;l.forEach((function(f){d.insert(f)}))}*K(l){l!==void 0&&(yield*this.K(l.U),yield l.u,yield*this.K(l.W))}begin(){return new o(this.h.U||this.h,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this.h.W||this.h,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(l,c){return this.M(l,void 0,c)}find(l){let c=this.I(this.Y,l);return new o(c,this.h,this)}lowerBound(l){let c=this.X(this.Y,l);return new o(c,this.h,this)}upperBound(l){let c=this.Z(this.Y,l);return new o(c,this.h,this)}reverseLowerBound(l){let c=this.$(this.Y,l);return new o(c,this.h,this)}reverseUpperBound(l){let c=this.rr(this.Y,l);return new o(c,this.h,this)}union(l){let c=this;return l.forEach((function(u){c.insert(u)})),this.i}[Symbol.iterator](){return this.K(this.Y)}},a=i;e.default=a}),wS=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=s(Sp()),r=s(Ep()),n=ir();function s(l){return l&&l.t?l:{default:l}}var o=class Wm extends r.default{constructor(c,u,d,f){super(c,u,f),this.container=d}get pointer(){this.o===this.h&&(0,n.throwIteratorAccessError)();let c=this;return new Proxy([],{get(u,d){if(d==="0")return c.o.u;if(d==="1")return c.o.l},set(u,d,f){if(d!=="1")throw new TypeError("props must be 1");return c.o.l=f,!0}})}copy(){return new Wm(this.o,this.h,this.container,this.iteratorType)}},i=class extends t.default{constructor(l=[],c,u){super(c,u);let d=this;l.forEach((function(f){d.setElement(f[0],f[1])}))}*K(l){l!==void 0&&(yield*this.K(l.U),yield[l.u,l.l],yield*this.K(l.W))}begin(){return new o(this.h.U||this.h,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this.h.W||this.h,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){if(this.i===0)return;let l=this.h.U;return[l.u,l.l]}back(){if(this.i===0)return;let l=this.h.W;return[l.u,l.l]}lowerBound(l){let c=this.X(this.Y,l);return new o(c,this.h,this)}upperBound(l){let c=this.Z(this.Y,l);return new o(c,this.h,this)}reverseLowerBound(l){let c=this.$(this.Y,l);return new o(c,this.h,this)}reverseUpperBound(l){let c=this.rr(this.Y,l);return new o(c,this.h,this)}setElement(l,c,u){return this.M(l,c,u)}find(l){let c=this.I(this.Y,l);return new o(c,this.h,this)}getElementByKey(l){return this.I(this.Y,l).l}union(l){let c=this;return l.forEach((function(u){c.setElement(u[0],u[1])})),this.i}[Symbol.iterator](){return this.K(this.Y)}},a=i;e.default=a}),kp=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"t",{value:!0}),e.default=t;function t(r){let n=typeof r;return n==="object"&&r!==null||n==="function"}}),Ap=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"t",{value:!0}),e.HashContainerIterator=e.HashContainer=void 0;var t=or(),r=s(kp()),n=ir();function s(a){return a&&a.t?a:{default:a}}var o=class extends t.ContainerIterator{constructor(a,l,c){super(c),this.o=a,this.h=l,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,n.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,n.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,n.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,n.throwIteratorAccessError)(),this.o=this.o.L,this})}};e.HashContainerIterator=o;var i=class extends t.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(a){let{L:l,B:c}=a;l.B=c,c.L=l,a===this.p&&(this.p=c),a===this._&&(this._=l),this.i-=1}M(a,l,c){c===void 0&&(c=(0,r.default)(a));let u;if(c){let d=a[this.HASH_TAG];if(d!==void 0)return this.H[d].l=l,this.i;Object.defineProperty(a,this.HASH_TAG,{value:this.H.length,configurable:!0}),u={u:a,l,L:this._,B:this.h},this.H.push(u)}else{let d=this.g[a];if(d)return d.l=l,this.i;u={u:a,l,L:this._,B:this.h},this.g[a]=u}return this.i===0?(this.p=u,this.h.B=u):this._.B=u,this._=u,this.h.L=u,++this.i}I(a,l){if(l===void 0&&(l=(0,r.default)(a)),l){let c=a[this.HASH_TAG];return c===void 0?this.h:this.H[c]}else return this.g[a]||this.h}clear(){let a=this.HASH_TAG;this.H.forEach((function(l){delete l.u[a]})),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(a,l){let c;if(l===void 0&&(l=(0,r.default)(a)),l){let u=a[this.HASH_TAG];if(u===void 0)return!1;delete a[this.HASH_TAG],c=this.H[u],delete this.H[u]}else{if(c=this.g[a],c===void 0)return!1;delete this.g[a]}return this.V(c),!0}eraseElementByIterator(a){let l=a.o;return l===this.h&&(0,n.throwIteratorAccessError)(),this.V(l),a.next()}eraseElementByPos(a){if(a<0||a>this.i-1)throw new RangeError;let l=this.p;for(;a--;)l=l.B;return this.V(l),this.i}};e.HashContainer=i}),xS=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=Ap(),r=ir(),n=class $m extends t.HashContainerIterator{constructor(a,l,c,u){super(a,l,u),this.container=c}get pointer(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o.u}copy(){return new $m(this.o,this.h,this.container,this.iteratorType)}},s=class extends t.HashContainer{constructor(i=[]){super();let a=this;i.forEach((function(l){a.insert(l)}))}begin(){return new n(this.p,this.h,this)}end(){return new n(this.h,this.h,this)}rBegin(){return new n(this._,this.h,this,1)}rEnd(){return new n(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(i,a){return this.M(i,void 0,a)}getElementByPos(i){if(i<0||i>this.i-1)throw new RangeError;let a=this.p;for(;i--;)a=a.B;return a.u}find(i,a){let l=this.I(i,a);return new n(l,this.h,this)}forEach(i){let a=0,l=this.p;for(;l!==this.h;)i(l.u,a++,this),l=l.B}[Symbol.iterator](){return(function*(){let i=this.p;for(;i!==this.h;)yield i.u,i=i.B}).bind(this)()}},o=s;e.default=o}),_S=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=Ap(),r=s(kp()),n=ir();function s(l){return l&&l.t?l:{default:l}}var o=class qm extends t.HashContainerIterator{constructor(c,u,d,f){super(c,u,f),this.container=d}get pointer(){this.o===this.h&&(0,n.throwIteratorAccessError)();let c=this;return new Proxy([],{get(u,d){if(d==="0")return c.o.u;if(d==="1")return c.o.l},set(u,d,f){if(d!=="1")throw new TypeError("props must be 1");return c.o.l=f,!0}})}copy(){return new qm(this.o,this.h,this.container,this.iteratorType)}},i=class extends t.HashContainer{constructor(l=[]){super();let c=this;l.forEach((function(u){c.setElement(u[0],u[1])}))}begin(){return new o(this.p,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this._,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){if(this.i!==0)return[this.p.u,this.p.l]}back(){if(this.i!==0)return[this._.u,this._.l]}setElement(l,c,u){return this.M(l,c,u)}getElementByKey(l,c){if(c===void 0&&(c=(0,r.default)(l)),c){let d=l[this.HASH_TAG];return d!==void 0?this.H[d].l:void 0}let u=this.g[l];return u?u.l:void 0}getElementByPos(l){if(l<0||l>this.i-1)throw new RangeError;let c=this.p;for(;l--;)c=c.B;return[c.u,c.l]}find(l,c){let u=this.I(l,c);return new o(u,this.h,this)}forEach(l){let c=0,u=this.p;for(;u!==this.h;)l([u.u,u.l],c++,this),u=u.B}[Symbol.iterator](){return(function*(){let l=this.p;for(;l!==this.h;)yield[l.u,l.l],l=l.B}).bind(this)()}},a=i;e.default=a}),SS=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"t",{value:!0}),Object.defineProperty(e,"Deque",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"HashMap",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"HashSet",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"LinkList",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"OrderedMap",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"OrderedSet",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"PriorityQueue",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"Queue",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"Stack",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"Vector",{enumerable:!0,get:function(){return s.default}});var t=d(fS()),r=d(hS()),n=d(pS()),s=d(gS()),o=d(mS()),i=d(bS()),a=d(vS()),l=d(wS()),c=d(xS()),u=d(_S());function d(f){return f&&f.t?f:{default:f}}}),ES=Ce((e,t)=>{xe(),Se(),_e();var r=SS().OrderedSet,n=nr()("number-allocator:trace"),s=nr()("number-allocator:error");function o(a,l){this.low=a,this.high=l}o.prototype.equals=function(a){return this.low===a.low&&this.high===a.high},o.prototype.compare=function(a){return this.low<a.low&&this.high<a.low?-1:a.low<this.low&&a.high<this.low?1:0};function i(a,l){if(!(this instanceof i))return new i(a,l);this.min=a,this.max=l,this.ss=new r([],(c,u)=>c.compare(u)),n("Create"),this.clear()}i.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},i.prototype.alloc=function(){if(this.ss.size()===0)return n("alloc():empty"),null;let a=this.ss.begin(),l=a.pointer.low,c=a.pointer.high,u=l;return u+1<=c?this.ss.updateKeyByIterator(a,new o(l+1,c)):this.ss.eraseElementByPos(0),n("alloc():"+u),u},i.prototype.use=function(a){let l=new o(a,a),c=this.ss.lowerBound(l);if(!c.equals(this.ss.end())){let u=c.pointer.low,d=c.pointer.high;return c.pointer.equals(l)?(this.ss.eraseElementByIterator(c),n("use():"+a),!0):u>a?!1:u===a?(this.ss.updateKeyByIterator(c,new o(u+1,d)),n("use():"+a),!0):d===a?(this.ss.updateKeyByIterator(c,new o(u,d-1)),n("use():"+a),!0):(this.ss.updateKeyByIterator(c,new o(a+1,d)),this.ss.insert(new o(u,a-1)),n("use():"+a),!0)}return n("use():failed"),!1},i.prototype.free=function(a){if(a<this.min||a>this.max){s("free():"+a+" is out of range");return}let l=new o(a,a),c=this.ss.upperBound(l);if(c.equals(this.ss.end())){if(c.equals(this.ss.begin())){this.ss.insert(l);return}c.pre();let u=c.pointer.high;c.pointer.high+1===a?this.ss.updateKeyByIterator(c,new o(u,a)):this.ss.insert(l)}else if(c.equals(this.ss.begin()))if(a+1===c.pointer.low){let u=c.pointer.high;this.ss.updateKeyByIterator(c,new o(a,u))}else this.ss.insert(l);else{let u=c.pointer.low,d=c.pointer.high;c.pre();let f=c.pointer.low;c.pointer.high+1===a?a+1===u?(this.ss.eraseElementByIterator(c),this.ss.updateKeyByIterator(c,new o(f,d))):this.ss.updateKeyByIterator(c,new o(f,a)):a+1===u?(this.ss.eraseElementByIterator(c.next()),this.ss.insert(new o(a,d))):this.ss.insert(l)}n("free():"+a)},i.prototype.clear=function(){n("clear()"),this.ss.clear(),this.ss.insert(new o(this.min,this.max))},i.prototype.intervalCount=function(){return this.ss.size()},i.prototype.dump=function(){console.log("length:"+this.ss.size());for(let a of this.ss)console.log(a)},t.exports=i}),Cp=Ce((e,t)=>{xe(),Se(),_e();var r=ES();t.exports.NumberAllocator=r}),kS=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"__esModule",{value:!0});var t=dS(),r=Cp(),n=class{constructor(s){Ne(this,"aliasToTopic");Ne(this,"topicToAlias");Ne(this,"max");Ne(this,"numberAllocator");Ne(this,"length");s>0&&(this.aliasToTopic=new t.LRUCache({max:s}),this.topicToAlias={},this.numberAllocator=new r.NumberAllocator(1,s),this.max=s,this.length=0)}put(s,o){if(o===0||o>this.max)return!1;let i=this.aliasToTopic.get(o);return i&&delete this.topicToAlias[i],this.aliasToTopic.set(o,s),this.topicToAlias[s]=o,this.numberAllocator.use(o),this.length=this.aliasToTopic.size,!0}getTopicByAlias(s){return this.aliasToTopic.get(s)}getAliasByTopic(s){let o=this.topicToAlias[s];return typeof o<"u"&&this.aliasToTopic.get(o),o}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){return this.numberAllocator.firstVacant()||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}};e.default=n}),AS=Ce(e=>{xe(),Se(),_e();var t=e&&e.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0});var r=Ci(),n=t(kS()),s=xn(),o=(i,a)=>{i.log("_handleConnack");let{options:l}=i,c=l.protocolVersion===5?a.reasonCode:a.returnCode;if(clearTimeout(i.connackTimer),delete i.topicAliasSend,a.properties){if(a.properties.topicAliasMaximum){if(a.properties.topicAliasMaximum>65535){i.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}a.properties.topicAliasMaximum>0&&(i.topicAliasSend=new n.default(a.properties.topicAliasMaximum))}a.properties.serverKeepAlive&&l.keepalive&&(l.keepalive=a.properties.serverKeepAlive),a.properties.maximumPacketSize&&(l.properties||(l.properties={}),l.properties.maximumPacketSize=a.properties.maximumPacketSize)}if(c===0)i.reconnecting=!1,i._onConnect(a);else if(c>0){let u=new s.ErrorWithReasonCode(`Connection refused: ${r.ReasonCodes[c]}`,c);i.emit("error",u),i.options.reconnectOnConnackError&&i._cleanUp(!0)}};e.default=o}),CS=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"__esModule",{value:!0});var t=(r,n,s)=>{r.log("handling pubrel packet");let o=typeof s<"u"?s:r.noop,{messageId:i}=n,a={cmd:"pubcomp",messageId:i};r.incomingStore.get(n,(l,c)=>{l?r._sendPacket(a,o):(r.emit("message",c.topic,c.payload,c),r.handleMessage(c,u=>{if(u)return o(u);r.incomingStore.del(c,r.noop),r._sendPacket(a,o)}))})};e.default=t}),IS=Ce(e=>{xe(),Se(),_e();var t=e&&e.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e,"__esModule",{value:!0});var r=t(lS()),n=t(uS()),s=t(AS()),o=t(Ci()),i=t(CS()),a=(l,c,u)=>{let{options:d}=l;if(d.protocolVersion===5&&d.properties&&d.properties.maximumPacketSize&&d.properties.maximumPacketSize<c.length)return l.emit("error",new Error(`exceeding packets size ${c.cmd}`)),l.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),l;switch(l.log("_handlePacket :: emitting packetreceive"),l.emit("packetreceive",c),c.cmd){case"publish":(0,r.default)(l,c,u);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":l.reschedulePing(),(0,o.default)(l,c),u();break;case"pubrel":l.reschedulePing(),(0,i.default)(l,c,u);break;case"connack":(0,s.default)(l,c),u();break;case"auth":l.reschedulePing(),(0,n.default)(l,c),u();break;case"pingresp":l.log("_handlePacket :: received pingresp"),l.reschedulePing(!0),u();break;case"disconnect":l.emit("disconnect",c),u();break;default:l.log("_handlePacket :: unknown command"),u();break}};e.default=a}),Ip=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"__esModule",{value:!0});var t=class{constructor(){Ne(this,"nextId");this.nextId=Math.max(1,Math.floor(Math.random()*65535))}allocate(){let r=this.nextId++;return this.nextId===65536&&(this.nextId=1),r}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(r){return!0}deallocate(r){}clear(){}};e.default=t}),TS=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"__esModule",{value:!0});var t=class{constructor(r){Ne(this,"aliasToTopic");Ne(this,"max");Ne(this,"length");this.aliasToTopic={},this.max=r}put(r,n){return n===0||n>this.max?!1:(this.aliasToTopic[n]=r,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(r){return this.aliasToTopic[r]}clear(){this.aliasToTopic={}}};e.default=t}),jS=Ce(e=>{xe(),Se(),_e();var t=e&&e.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.TypedEventEmitter=void 0;var r=t((zr(),nt(vr))),n=xn(),s=class{};e.TypedEventEmitter=s,(0,n.applyMixin)(s,r.default)}),Tp=Ce((e,t)=>{xe(),Se(),_e(),(function(r,n){typeof e=="object"&&typeof t<"u"?n(e):typeof define=="function"&&define.amd?define(["exports"],n):(r=typeof globalThis<"u"?globalThis:r||self,n(r.fastUniqueNumbers={}))})(e,(function(r){var n=function(h){return function(y){var m=h(y);return y.add(m),m}},s=function(h){return function(y,m){return h.set(y,m),m}},o=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,i=536870912,a=i*2,l=function(h,y){return function(m){var b=y.get(m),S=b===void 0?m.size:b<a?b+1:0;if(!m.has(S))return h(m,S);if(m.size<i){for(;m.has(S);)S=Math.floor(Math.random()*a);return h(m,S)}if(m.size>o)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;m.has(S);)S=Math.floor(Math.random()*o);return h(m,S)}},c=new WeakMap,u=s(c),d=l(u,c),f=n(d);r.addUniqueNumber=f,r.generateUniqueNumber=d}))}),Ii=Ce((e,t)=>{xe(),Se(),_e();function r(n){"@babel/helpers - typeof";return t.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},t.exports.__esModule=!0,t.exports.default=t.exports,r(n)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),OS=Ce((e,t)=>{xe(),Se(),_e();var r=Ii().default;function n(s,o){if(r(s)!="object"||!s)return s;var i=s[Symbol.toPrimitive];if(i!==void 0){var a=i.call(s,o||"default");if(r(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(s)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}),PS=Ce((e,t)=>{xe(),Se(),_e();var r=Ii().default,n=OS();function s(o){var i=n(o,"string");return r(i)=="symbol"?i:i+""}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}),NS=Ce((e,t)=>{xe(),Se(),_e();var r=PS();function n(s,o,i){return(o=r(o))in s?Object.defineProperty(s,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):s[o]=i,s}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}),RS=Ce((e,t)=>{xe(),Se(),_e();function r(n){if(Array.isArray(n))return n}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),MS=Ce((e,t)=>{xe(),Se(),_e();function r(n,s){var o=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(o!=null){var i,a,l,c,u=[],d=!0,f=!1;try{if(l=(o=o.call(n)).next,s===0){if(Object(o)!==o)return;d=!1}else for(;!(d=(i=l.call(o)).done)&&(u.push(i.value),u.length!==s);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&o.return!=null&&(c=o.return(),Object(c)!==c))return}finally{if(f)throw a}}return u}}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),DS=Ce((e,t)=>{xe(),Se(),_e();function r(n,s){(s==null||s>n.length)&&(s=n.length);for(var o=0,i=Array(s);o<s;o++)i[o]=n[o];return i}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),LS=Ce((e,t)=>{xe(),Se(),_e();var r=DS();function n(s,o){if(s){if(typeof s=="string")return r(s,o);var i={}.toString.call(s).slice(8,-1);return i==="Object"&&s.constructor&&(i=s.constructor.name),i==="Map"||i==="Set"?Array.from(s):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?r(s,o):void 0}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}),zS=Ce((e,t)=>{xe(),Se(),_e();function r(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
228
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),BS=Ce((e,t)=>{xe(),Se(),_e();var r=RS(),n=MS(),s=LS(),o=zS();function i(a,l){return r(a)||n(a,l)||s(a,l)||o()}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}),US=Ce((e,t)=>{xe(),Se(),_e();function r(s,o,i,a,l,c,u){try{var d=s[c](u),f=d.value}catch(h){return void i(h)}d.done?o(f):Promise.resolve(f).then(a,l)}function n(s){return function(){var o=this,i=arguments;return new Promise(function(a,l){var c=s.apply(o,i);function u(f){r(c,a,l,u,d,"next",f)}function d(f){r(c,a,l,u,d,"throw",f)}u(void 0)})}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}),jp=Ce((e,t)=>{xe(),Se(),_e();function r(n,s){this.v=n,this.k=s}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),Op=Ce((e,t)=>{xe(),Se(),_e();function r(n,s,o,i){var a=Object.defineProperty;try{a({},"",{})}catch{a=0}t.exports=r=function(l,c,u,d){function f(h,y){r(l,h,function(m){return this._invoke(h,y,m)})}c?a?a(l,c,{value:u,enumerable:!d,configurable:!d,writable:!d}):l[c]=u:(f("next",0),f("throw",1),f("return",2))},t.exports.__esModule=!0,t.exports.default=t.exports,r(n,s,o,i)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),Pp=Ce((e,t)=>{xe(),Se(),_e();var r=Op();function n(){var s,o,i=typeof Symbol=="function"?Symbol:{},a=i.iterator||"@@iterator",l=i.toStringTag||"@@toStringTag";function c(S,g,w,_){var x=g&&g.prototype instanceof d?g:d,I=Object.create(x.prototype);return r(I,"_invoke",(function(C,A,O){var j,R,T,D=0,H=O||[],U=!1,ae={p:0,n:0,v:s,a:J,f:J.bind(s,4),d:function(M,ce){return j=M,R=0,T=s,ae.n=ce,u}};function J(M,ce){for(R=M,T=ce,o=0;!U&&D&&!Q&&o<H.length;o++){var Q,B=H[o],N=ae.p,Y=B[2];M>3?(Q=Y===ce)&&(T=B[(R=B[4])?5:(R=3,3)],B[4]=B[5]=s):B[0]<=N&&((Q=M<2&&N<B[1])?(R=0,ae.v=ce,ae.n=B[1]):N<Y&&(Q=M<3||B[0]>ce||ce>Y)&&(B[4]=M,B[5]=ce,ae.n=Y,R=0))}if(Q||M>1)return u;throw U=!0,ce}return function(M,ce,Q){if(D>1)throw TypeError("Generator is already running");for(U&&ce===1&&J(ce,Q),R=ce,T=Q;(o=R<2?s:T)||!U;){j||(R?R<3?(R>1&&(ae.n=-1),J(R,T)):ae.n=T:ae.v=T);try{if(D=2,j){if(R||(M="next"),o=j[M]){if(!(o=o.call(j,T)))throw TypeError("iterator result is not an object");if(!o.done)return o;T=o.value,R<2&&(R=0)}else R===1&&(o=j.return)&&o.call(j),R<2&&(T=TypeError("The iterator does not provide a '"+M+"' method"),R=1);j=s}else if((o=(U=ae.n<0)?T:C.call(A,ae))!==u)break}catch(B){j=s,R=1,T=B}finally{D=1}}return{value:o,done:U}}})(S,w,_),!0),I}var u={};function d(){}function f(){}function h(){}o=Object.getPrototypeOf;var y=[][a]?o(o([][a]())):(r(o={},a,function(){return this}),o),m=h.prototype=d.prototype=Object.create(y);function b(S){return Object.setPrototypeOf?Object.setPrototypeOf(S,h):(S.__proto__=h,r(S,l,"GeneratorFunction")),S.prototype=Object.create(m),S}return f.prototype=h,r(m,"constructor",h),r(h,"constructor",f),f.displayName="GeneratorFunction",r(h,l,"GeneratorFunction"),r(m),r(m,l,"Generator"),r(m,a,function(){return this}),r(m,"toString",function(){return"[object Generator]"}),(t.exports=n=function(){return{w:c,m:b}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}),Np=Ce((e,t)=>{xe(),Se(),_e();var r=jp(),n=Op();function s(o,i){function a(c,u,d,f){try{var h=o[c](u),y=h.value;return y instanceof r?i.resolve(y.v).then(function(m){a("next",m,d,f)},function(m){a("throw",m,d,f)}):i.resolve(y).then(function(m){h.value=m,d(h)},function(m){return a("throw",m,d,f)})}catch(m){f(m)}}var l;this.next||(n(s.prototype),n(s.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),n(this,"_invoke",function(c,u,d){function f(){return new i(function(h,y){a(c,d,h,y)})}return l=l?l.then(f,f):f()},!0)}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}),Rp=Ce((e,t)=>{xe(),Se(),_e();var r=Pp(),n=Np();function s(o,i,a,l,c){return new n(r().w(o,i,a,l),c||Promise)}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}),FS=Ce((e,t)=>{xe(),Se(),_e();var r=Rp();function n(s,o,i,a,l){var c=r(s,o,i,a,l);return c.next().then(function(u){return u.done?u.value:c.next()})}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}),WS=Ce((e,t)=>{xe(),Se(),_e();function r(n){var s=Object(n),o=[];for(var i in s)o.unshift(i);return function a(){for(;o.length;)if((i=o.pop())in s)return a.value=i,a.done=!1,a;return a.done=!0,a}}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),$S=Ce((e,t)=>{xe(),Se(),_e();var r=Ii().default;function n(s){if(s!=null){var o=s[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],i=0;if(o)return o.call(s);if(typeof s.next=="function")return s;if(!isNaN(s.length))return{next:function(){return s&&i>=s.length&&(s=void 0),{value:s&&s[i++],done:!s}}}}throw new TypeError(r(s)+" is not iterable")}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}),qS=Ce((e,t)=>{xe(),Se(),_e();var r=jp(),n=Pp(),s=FS(),o=Rp(),i=Np(),a=WS(),l=$S();function c(){var u=n(),d=u.m(c),f=(Object.getPrototypeOf?Object.getPrototypeOf(d):d.__proto__).constructor;function h(b){var S=typeof b=="function"&&b.constructor;return!!S&&(S===f||(S.displayName||S.name)==="GeneratorFunction")}var y={throw:1,return:2,break:3,continue:3};function m(b){var S,g;return function(w){S||(S={stop:function(){return g(w.a,2)},catch:function(){return w.v},abrupt:function(_,x){return g(w.a,y[_],x)},delegateYield:function(_,x,I){return S.resultName=x,g(w.d,l(_),I)},finish:function(_){return g(w.f,_)}},g=function(_,x,I){w.p=S.prev,w.n=S.next;try{return _(x,I)}finally{S.next=w.n}}),S.resultName&&(S[S.resultName]=w.v,S.resultName=void 0),S.sent=w.v,S.next=w.n;try{return b.call(this,S)}finally{w.p=S.prev,w.n=S.next}}}return(t.exports=c=function(){return{wrap:function(b,S,g,w){return u.w(m(b),S,g,w&&w.reverse())},isGeneratorFunction:h,mark:u.m,awrap:function(b,S){return new r(b,S)},AsyncIterator:i,async:function(b,S,g,w,_){return(h(S)?o:s)(m(b),S,g,w,_)},keys:a,values:l}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports}),HS=Ce((e,t)=>{xe(),Se(),_e();var r=qS()();t.exports=r;try{regeneratorRuntime=r}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),VS=Ce((e,t)=>{xe(),Se(),_e(),(function(r,n){typeof e=="object"&&typeof t<"u"?n(e,Tp(),NS(),BS(),US(),HS()):typeof define=="function"&&define.amd?define(["exports","fast-unique-numbers","@babel/runtime/helpers/defineProperty","@babel/runtime/helpers/slicedToArray","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/regenerator"],n):(r=typeof globalThis<"u"?globalThis:r||self,n(r.brokerFactory={},r.fastUniqueNumbers,r._defineProperty,r._slicedToArray,r._asyncToGenerator,r._regeneratorRuntime))})(e,(function(r,n,s,o,i,a){function l(S,g){var w=Object.keys(S);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(S);g&&(_=_.filter(function(x){return Object.getOwnPropertyDescriptor(S,x).enumerable})),w.push.apply(w,_)}return w}function c(S){for(var g=1;g<arguments.length;g++){var w=arguments[g]!=null?arguments[g]:{};g%2?l(Object(w),!0).forEach(function(_){s(S,_,w[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(w)):l(Object(w)).forEach(function(_){Object.defineProperty(S,_,Object.getOwnPropertyDescriptor(w,_))})}return S}var u=function(S,g,w,_){return function(x){var I=g(x);return function(C){var A=S(C);C.addEventListener("message",function(J){var M=J.data,ce=M.id;if(ce!==null&&A.has(ce)){var Q=A.get(ce),B=Q.reject,N=Q.resolve;A.delete(ce),M.error===void 0?N(M.result):B(new Error(M.error.message))}}),_(C)&&C.start();for(var O=function(J){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return new Promise(function(Q,B){var N=w(A);A.set(N,{reject:B,resolve:Q}),M===null?C.postMessage({id:N,method:J},ce):C.postMessage({id:N,method:J,params:M},ce)})},j=function(J,M){var ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];C.postMessage({id:null,method:J,params:M},ce)},R={},T=0,D=Object.entries(I);T<D.length;T++){var H=o(D[T],2),U=H[0],ae=H[1];R=c(c({},R),{},s({},U,ae({call:O,notify:j})))}return c({},R)}}},d=function(S){return function(g){if(S.has(g))return S.get(g);var w=new Map;return S.set(g,w),w}};function f(S,g){var w=Object.keys(S);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(S);g&&(_=_.filter(function(x){return Object.getOwnPropertyDescriptor(S,x).enumerable})),w.push.apply(w,_)}return w}function h(S){for(var g=1;g<arguments.length;g++){var w=arguments[g]!=null?arguments[g]:{};g%2?f(Object(w),!0).forEach(function(_){s(S,_,w[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(w)):f(Object(w)).forEach(function(_){Object.defineProperty(S,_,Object.getOwnPropertyDescriptor(w,_))})}return S}var y=function(S){return function(g){return h(h({},g),{},{connect:function(w){var _=w.call;return i(a.mark(function x(){var I,C,A,O;return a.wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return I=new MessageChannel,C=I.port1,A=I.port2,j.next=1,_("connect",{port:C},[C]);case 1:return O=j.sent,S.set(A,O),j.abrupt("return",A);case 2:case"end":return j.stop()}},x)}))},disconnect:function(w){var _=w.call;return(function(){var x=i(a.mark(function I(C){var A;return a.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:if(A=S.get(C),A!==void 0){O.next=1;break}throw new Error("The given port is not connected.");case 1:return O.next=2,_("disconnect",{portId:A});case 2:case"end":return O.stop()}},I)}));return function(I){return x.apply(this,arguments)}})()},isSupported:function(w){var _=w.call;return function(){return _("isSupported")}}})}},m=function(S){return typeof S.start=="function"},b=u(d(new WeakMap),y(new WeakMap),n.generateUniqueNumber,m);r.createBroker=b}))}),KS=Ce((e,t)=>{xe(),Se(),_e(),(function(r,n){typeof e=="object"&&typeof t<"u"?n(e,VS(),Tp(),Ii()):typeof define=="function"&&define.amd?define(["exports","broker-factory","fast-unique-numbers","@babel/runtime/helpers/typeof"],n):(r=typeof globalThis<"u"?globalThis:r||self,n(r.workerTimersBroker={},r.brokerFactory,r.fastUniqueNumbers,r._typeof))})(e,(function(r,n,s,o){var i=function(g){return function(w){return function(_){o(g.get(_))==="symbol"&&(g.set(_,null),w(_).then(function(){g.delete(_)}))}}},a=function(g){return function(w){return function(_){o(g.get(_))==="symbol"&&(g.set(_,null),w(_).then(function(){g.delete(_)}))}}},l=function(g,w){return function(_){return function(x){for(var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,C=arguments.length,A=new Array(C>2?C-2:0),O=2;O<C;O++)A[O-2]=arguments[O];var j=Symbol(),R=g(w);w.set(R,j);var T=function(){return _(I,R).then(function(){var D=w.get(R);if(D===void 0)throw new Error("The timer is in an undefined state.");D===j&&(x.apply(void 0,A),w.get(R)===j&&T())})};return T(),R}}},c=function(g,w){return function(_){return function(x){for(var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,C=arguments.length,A=new Array(C>2?C-2:0),O=2;O<C;O++)A[O-2]=arguments[O];var j=Symbol(),R=g(w);return w.set(R,j),_(I,R).then(function(){var T=w.get(R);if(T===void 0)throw new Error("The timer is in an undefined state.");T===j&&(w.delete(R),x.apply(void 0,A))}),R}}},u=new Map([[0,null]]),d=new Map([[0,null]]),f=i(u),h=a(d),y=l(s.generateUniqueNumber,u),m=c(s.generateUniqueNumber,d),b=n.createBroker({clearInterval:function(g){var w=g.call;return f(function(_){return w("clear",{timerId:_,timerType:"interval"})})},clearTimeout:function(g){var w=g.call;return h(function(_){return w("clear",{timerId:_,timerType:"timeout"})})},setInterval:function(g){var w=g.call;return y(function(_,x){return w("set",{delay:_,now:performance.timeOrigin+performance.now(),timerId:x,timerType:"interval"})})},setTimeout:function(g){var w=g.call;return m(function(_,x){return w("set",{delay:_,now:performance.timeOrigin+performance.now(),timerId:x,timerType:"timeout"})})}}),S=function(g){var w=new Worker(g);return b(w)};r.load=S,r.wrap=b}))}),GS=Ce((e,t)=>{xe(),Se(),_e(),(function(r,n){typeof e=="object"&&typeof t<"u"?n(e,KS()):typeof define=="function"&&define.amd?define(["exports","worker-timers-broker"],n):(r=typeof globalThis<"u"?globalThis:r||self,n(r.workerTimers={},r.workerTimersBroker))})(e,(function(r,n){var s=function(d,f){var h=null;return function(){if(h!==null)return h;var y=new Blob([f],{type:"application/javascript; charset=utf-8"}),m=URL.createObjectURL(y);return h=d(m),setTimeout(function(){return URL.revokeObjectURL(m)}),h}},o=`(()=>{var e={389(e,t){!function(e){"use strict";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,u=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<u?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*u);return e(r,i)}if(r.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,s=r(i),c=a(s,i),f=t(c);e.addUniqueNumber=f,e.generateUniqueNumber=c}(t)},623(e,t,r){!function(e,t,r,n,o){"use strict";var u={INTERNAL_ERROR:-32603,INVALID_PARAMS:-32602,METHOD_NOT_FOUND:-32601},a=function(e,t){return Object.assign(new Error(e),{status:t})},i=function(e){return a('The requested method called "'.concat(e,'" is not supported.'),u.METHOD_NOT_FOUND)},s=function(e){return a('The handler of the method called "'.concat(e,'" returned no required result.'),u.INTERNAL_ERROR)},c=function(e){return a('The handler of the method called "'.concat(e,'" returned an unexpected result.'),u.INTERNAL_ERROR)},f=function(e){return a('The specified parameter called "portId" with the given value "'.concat(e,'" does not identify a port connected to this worker.'),u.INVALID_PARAMS)},l=function(e,n){return function(){var o=t(r.mark(function t(o){var u,a,f,l,p,d,v,x,y,b,h,m,_,g,w;return r.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(u=o.data,a=u.id,f=u.method,l=u.params,p=n[f],t.prev=1,void 0!==p){t.next=2;break}throw i(f);case 2:if(void 0!==(d=void 0===l?p():p(l))){t.next=3;break}throw s(f);case 3:if(!(d instanceof Promise)){t.next=5;break}return t.next=4,d;case 4:g=t.sent,t.next=6;break;case 5:g=d;case 6:if(v=g,null!==a){t.next=8;break}if(void 0===v.result){t.next=7;break}throw c(f);case 7:t.next=10;break;case 8:if(void 0!==v.result){t.next=9;break}throw c(f);case 9:x=v.result,y=v.transferables,b=void 0===y?[]:y,e.postMessage({id:a,result:x},b);case 10:t.next=12;break;case 11:t.prev=11,w=t.catch(1),h=w.message,m=w.status,_=void 0===m?-32603:m,e.postMessage({error:{code:_,message:h},id:a});case 12:case"end":return t.stop()}},t,null,[[1,11]])}));return function(e){return o.apply(this,arguments)}}()},p=function(){return new Promise(function(e){var t=new ArrayBuffer(0),r=new MessageChannel,n=r.port1,o=r.port2;n.onmessage=function(t){var r=t.data;return e(null!==r)},o.postMessage(t,[t])})};function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var x=new Map,y=function(e,n,u){return v(v({},n),{},{connect:function(t){var r=t.port;r.start();var u=e(r,n),a=o.generateUniqueNumber(x);return x.set(a,function(){u(),r.close(),x.delete(a)}),{result:a}},disconnect:function(e){var t=e.portId,r=x.get(t);if(void 0===r)throw f(t);return r(),{result:null}},isSupported:function(){var e=t(r.mark(function e(){var t,n,o;return r.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,p();case 1:if(!e.sent){e.next=5;break}if(!((t=u())instanceof Promise)){e.next=3;break}return e.next=2,t;case 2:o=e.sent,e.next=4;break;case 3:o=t;case 4:return n=o,e.abrupt("return",{result:n});case 5:return e.abrupt("return",{result:!1});case 6:case"end":return e.stop()}},e)}));function n(){return e.apply(this,arguments)}return n}()})},b=function(e,t){var r=y(b,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0}),n=l(e,r);return e.addEventListener("message",n),function(){return e.removeEventListener("message",n)}};e.createWorker=b,e.isSupported=p}(t,r(293),r(756),r(693),r(389))},472(e,t,r){!function(e,t,r,n){"use strict";var o=function(e,t){return function(r){var o=t.get(r);if(void 0===o)return Promise.resolve(!1);var u=n(o,2),a=u[0],i=u[1];return e(a),t.delete(r),i(!1),Promise.resolve(!0)}},u=function(e,t){var r=function(n,o,u,a){var i=n-e.now();i>0?o.set(a,[t(r,i,n,o,u,a),u]):(o.delete(a),u(!0))};return r},a=function(e,t,r,n){return function(o,u,a){var i=o+u-t.timeOrigin,s=i-t.now();return new Promise(function(t){e.set(a,[r(n,s,i,e,t,a),t])})}},i=new Map,s=o(globalThis.clearTimeout,i),c=new Map,f=o(globalThis.clearTimeout,c),l=u(performance,globalThis.setTimeout),p=a(i,performance,globalThis.setTimeout,l),d=a(c,performance,globalThis.setTimeout,l);r.createWorker(self,{clear:function(){var r=e(t.mark(function e(r){var n,o,u;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.timerId,o=r.timerType,e.next=1,"interval"===o?s(n):f(n);case 1:return u=e.sent,e.abrupt("return",{result:u});case 2:case"end":return e.stop()}},e)}));function n(e){return r.apply(this,arguments)}return n}(),set:function(){var r=e(t.mark(function e(r){var n,o,u,a,i;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.delay,o=r.now,u=r.timerId,a=r.timerType,e.next=1,("interval"===a?p:d)(n,o,u);case 1:return i=e.sent,e.abrupt("return",{result:i});case 2:case"end":return e.stop()}},e)}));function n(e){return r.apply(this,arguments)}return n}()})}(r(293),r(756),r(623),r(715))},172(e){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},79(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},987(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},293(e){function t(e,t,r,n,o,u,a){try{var i=e[u](a),s=i.value}catch(e){return void r(e)}i.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise(function(o,u){var a=e.apply(r,n);function i(e){t(a,o,u,i,s,"next",e)}function s(e){t(a,o,u,i,s,"throw",e)}i(void 0)})}},e.exports.__esModule=!0,e.exports.default=e.exports},693(e,t,r){var n=r(736);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},156(e){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,u,a,i=[],s=!0,c=!1;try{if(u=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=u.call(r)).done)&&(i.push(n.value),i.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return i}},e.exports.__esModule=!0,e.exports.default=e.exports},752(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},993(e,t,r){var n=r(546);function o(){var t,r,u="function"==typeof Symbol?Symbol:{},a=u.iterator||"@@iterator",i=u.toStringTag||"@@toStringTag";function s(e,o,u,a){var i=o&&o.prototype instanceof f?o:f,s=Object.create(i.prototype);return n(s,"_invoke",function(e,n,o){var u,a,i,s=0,f=o||[],l=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return u=e,a=0,i=t,p.n=r,c}};function d(e,n){for(a=e,i=n,r=0;!l&&s&&!o&&r<f.length;r++){var o,u=f[r],d=p.p,v=u[2];e>3?(o=v===n)&&(i=u[(a=u[4])?5:(a=3,3)],u[4]=u[5]=t):u[0]<=d&&((o=e<2&&d<u[1])?(a=0,p.v=n,p.n=u[1]):d<v&&(o=e<3||u[0]>n||n>v)&&(u[4]=e,u[5]=n,p.n=v,a=0))}if(o||e>1)return c;throw l=!0,n}return function(o,f,v){if(s>1)throw TypeError("Generator is already running");for(l&&1===f&&d(f,v),a=f,i=v;(r=a<2?t:i)||!l;){u||(a?a<3?(a>1&&(p.n=-1),d(a,i)):p.n=i:p.v=i);try{if(s=2,u){if(a||(o="next"),r=u[o]){if(!(r=r.call(u,i)))throw TypeError("iterator result is not an object");if(!r.done)return r;i=r.value,a<2&&(a=0)}else 1===a&&(r=u.return)&&r.call(u),a<2&&(i=TypeError("The iterator does not provide a '"+o+"' method"),a=1);u=t}else if((r=(l=p.n<0)?i:e.call(n,p))!==c)break}catch(e){u=t,a=1,i=e}finally{s=1}}return{value:r,done:l}}}(e,u,a),!0),s}var c={};function f(){}function l(){}function p(){}r=Object.getPrototypeOf;var d=[][a]?r(r([][a]())):(n(r={},a,function(){return this}),r),v=p.prototype=f.prototype=Object.create(d);function x(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,n(e,i,"GeneratorFunction")),e.prototype=Object.create(v),e}return l.prototype=p,n(v,"constructor",p),n(p,"constructor",l),l.displayName="GeneratorFunction",n(p,i,"GeneratorFunction"),n(v),n(v,i,"Generator"),n(v,a,function(){return this}),n(v,"toString",function(){return"[object Generator]"}),(e.exports=o=function(){return{w:s,m:x}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},869(e,t,r){var n=r(887);e.exports=function(e,t,r,o,u){var a=n(e,t,r,o,u);return a.next().then(function(e){return e.done?e.value:a.next()})},e.exports.__esModule=!0,e.exports.default=e.exports},887(e,t,r){var n=r(993),o=r(791);e.exports=function(e,t,r,u,a){return new o(n().w(e,t,r,u),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},791(e,t,r){var n=r(172),o=r(546);e.exports=function e(t,r){function u(e,o,a,i){try{var s=t[e](o),c=s.value;return c instanceof n?r.resolve(c.v).then(function(e){u("next",e,a,i)},function(e){u("throw",e,a,i)}):r.resolve(c).then(function(e){s.value=e,a(s)},function(e){return u("throw",e,a,i)})}catch(e){i(e)}}var a;this.next||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),o(this,"_invoke",function(e,t,n){function o(){return new r(function(t,r){u(e,n,t,r)})}return a=a?a.then(o,o):o()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},546(e){function t(r,n,o,u){var a=Object.defineProperty;try{a({},"",{})}catch(r){a=0}e.exports=t=function(e,r,n,o){function u(r,n){t(e,r,function(e){return this._invoke(r,n,e)})}r?a?a(e,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[r]=n:(u("next",0),u("throw",1),u("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n,o,u)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},373(e){e.exports=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},633(e,t,r){var n=r(172),o=r(993),u=r(869),a=r(887),i=r(791),s=r(373),c=r(579);function f(){"use strict";var t=o(),r=t.m(f),l=(Object.getPrototypeOf?Object.getPrototypeOf(r):r.__proto__).constructor;function p(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===l||"GeneratorFunction"===(t.displayName||t.name))}var d={throw:1,return:2,break:3,continue:3};function v(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,d[e],t)},delegateYield:function(e,o,u){return t.resultName=o,r(n.d,c(e),u)},finish:function(e){return r(n.f,e)}},r=function(e,r,o){n.p=t.prev,n.n=t.next;try{return e(r,o)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(e.exports=f=function(){return{wrap:function(e,r,n,o){return t.w(v(e),r,n,o&&o.reverse())},isGeneratorFunction:p,mark:t.m,awrap:function(e,t){return new n(e,t)},AsyncIterator:i,async:function(e,t,r,n,o){return(p(t)?a:u)(v(e),t,r,n,o)},keys:s,values:c}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=f,e.exports.__esModule=!0,e.exports.default=e.exports},579(e,t,r){var n=r(738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(n(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},715(e,t,r){var n=r(987),o=r(156),u=r(122),a=r(752);e.exports=function(e,t){return n(e)||o(e,t)||u(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},45(e,t,r){var n=r(738).default;e.exports=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},736(e,t,r){var n=r(738).default,o=r(45);e.exports=function(e){var t=o(e,"string");return"symbol"==n(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},738(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},122(e,t,r){var n=r(79);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},756(e,t,r){var n=r(633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var u=t[n]={exports:{}};return e[n].call(u.exports,u,u.exports,r),u.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(472)})()})();`,i=s(n.load,o),a=function(d){return i().clearInterval(d)},l=function(d){return i().clearTimeout(d)},c=function(){var d;return(d=i()).setInterval.apply(d,arguments)},u=function(){var d;return(d=i()).setTimeout.apply(d,arguments)};r.clearInterval=a,r.clearTimeout=l,r.setInterval=c,r.setTimeout=u}))}),Ti=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"__esModule",{value:!0}),e.isReactNativeBrowser=e.isWebWorker=void 0;var t=()=>{var o;return typeof window<"u"?typeof navigator<"u"&&((o=navigator.userAgent)==null?void 0:o.toLowerCase().indexOf(" electron/"))>-1&&(et!=null&&et.versions)?!Object.prototype.hasOwnProperty.call(et.versions,"electron"):typeof window.document<"u":!1},r=()=>{var o,i;return!!(typeof self=="object"&&((i=(o=self==null?void 0:self.constructor)==null?void 0:o.name)!=null&&i.includes("WorkerGlobalScope"))&&typeof Deno>"u")},n=()=>typeof navigator<"u"&&navigator.product==="ReactNative",s=t()||r()||n();e.isWebWorker=r(),e.isReactNativeBrowser=n(),e.default=s}),YS=Ce(e=>{xe(),Se(),_e();var t=e&&e.__createBinding||(Object.create?(function(c,u,d,f){f===void 0&&(f=d);var h=Object.getOwnPropertyDescriptor(u,d);(!h||("get"in h?!u.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return u[d]}}),Object.defineProperty(c,f,h)}):(function(c,u,d,f){f===void 0&&(f=d),c[f]=u[d]})),r=e&&e.__setModuleDefault||(Object.create?(function(c,u){Object.defineProperty(c,"default",{enumerable:!0,value:u})}):function(c,u){c.default=u}),n=e&&e.__importStar||(function(){var c=function(u){return c=Object.getOwnPropertyNames||function(d){var f=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(f[f.length]=h);return f},c(u)};return function(u){if(u&&u.__esModule)return u;var d={};if(u!=null)for(var f=c(u),h=0;h<f.length;h++)f[h]!=="default"&&t(d,u,f[h]);return r(d,u),d}})();Object.defineProperty(e,"__esModule",{value:!0});var s=GS(),o=n(Ti()),i={set:s.setInterval,clear:s.clearInterval},a={set:(c,u)=>setInterval(c,u),clear:c=>clearInterval(c)},l=c=>{switch(c){case"native":return a;case"worker":return i;case"auto":default:return o.default&&!o.isWebWorker&&!o.isReactNativeBrowser?i:a}};e.default=l}),Mp=Ce(e=>{xe(),Se(),_e();var t=e&&e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0});var r=t(YS()),n=class{constructor(s,o){Ne(this,"_keepalive");Ne(this,"timerId");Ne(this,"timer");Ne(this,"destroyed",!1);Ne(this,"counter");Ne(this,"client");Ne(this,"_keepaliveTimeoutTimestamp");Ne(this,"_intervalEvery");this.client=s,this.timer=typeof o=="object"&&"set"in o&&"clear"in o?o:(0,r.default)(o),this.setKeepalive(s.options.keepalive)}get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(s){if(s*=1e3,isNaN(s)||s<=0||s>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${s}`);this._keepalive=s,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${s}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let s=Math.ceil(this._keepalive*1.5);this._keepaliveTimeoutTimestamp=Date.now()+s,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set(()=>{this.destroyed||(this.counter+=1,this.counter===2?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout())},this._intervalEvery)}};e.default=n}),Wl=Ce(e=>{var x;xe(),Se(),_e();var t=e&&e.__createBinding||(Object.create?(function(I,C,A,O){O===void 0&&(O=A);var j=Object.getOwnPropertyDescriptor(C,A);(!j||("get"in j?!C.__esModule:j.writable||j.configurable))&&(j={enumerable:!0,get:function(){return C[A]}}),Object.defineProperty(I,O,j)}):(function(I,C,A,O){O===void 0&&(O=A),I[O]=C[A]})),r=e&&e.__setModuleDefault||(Object.create?(function(I,C){Object.defineProperty(I,"default",{enumerable:!0,value:C})}):function(I,C){I.default=C}),n=e&&e.__importStar||(function(){var I=function(C){return I=Object.getOwnPropertyNames||function(A){var O=[];for(var j in A)Object.prototype.hasOwnProperty.call(A,j)&&(O[O.length]=j);return O},I(C)};return function(C){if(C&&C.__esModule)return C;var A={};if(C!=null)for(var O=I(C),j=0;j<O.length;j++)O[j]!=="default"&&t(A,C,O[j]);return r(A,C),A}})(),s=e&&e.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(e,"__esModule",{value:!0});var o=s(iS()),i=Ur(),a=s(aS()),l=s(nr()),c=n(wp()),u=s(xp()),d=s(IS()),f=s(Ip()),h=s(TS()),y=xn(),m=jS(),b=s(Mp()),S=n(Ti()),g=globalThis.setImmediate||((...I)=>{let C=I.shift();(0,y.nextTick)(()=>{C(...I)})}),w={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"},_=(x=class extends m.TypedEventEmitter{constructor(A,O){super();Ne(this,"connected");Ne(this,"disconnecting");Ne(this,"disconnected");Ne(this,"reconnecting");Ne(this,"incomingStore");Ne(this,"outgoingStore");Ne(this,"options");Ne(this,"queueQoSZero");Ne(this,"_reconnectCount");Ne(this,"log");Ne(this,"messageIdProvider");Ne(this,"outgoing");Ne(this,"messageIdToTopic");Ne(this,"noop");Ne(this,"keepaliveManager");Ne(this,"stream");Ne(this,"queue");Ne(this,"streamBuilder");Ne(this,"_resubscribeTopics");Ne(this,"connackTimer");Ne(this,"reconnectTimer");Ne(this,"_storeProcessing");Ne(this,"_packetIdsDuringStoreProcessing");Ne(this,"_storeProcessingQueue");Ne(this,"_firstConnection");Ne(this,"topicAliasRecv");Ne(this,"topicAliasSend");Ne(this,"_deferredReconnect");Ne(this,"connackPacket");this.options=O||{};for(let j in w)typeof this.options[j]>"u"?this.options[j]=w[j]:this.options[j]=O[j];this.log=this.options.log||(0,l.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",x.VERSION),S.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",S.default?"browser":"node"),this.log("MqttClient :: options.protocol",O.protocol),this.log("MqttClient :: options.protocolVersion",O.protocolVersion),this.log("MqttClient :: options.username",O.username),this.log("MqttClient :: options.keepalive",O.keepalive),this.log("MqttClient :: options.reconnectPeriod",O.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",O.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",O.properties?O.properties.topicAliasMaximum:void 0),this.options.clientId=typeof O.clientId=="string"?O.clientId:x.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=O.protocolVersion===5&&O.customHandleAcks?O.customHandleAcks:(...j)=>{j[3](null,0)},this.options.writeCache||(o.default.writeToStream.cacheNumbers=!1),this.streamBuilder=A,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new f.default:this.options.messageIdProvider,this.outgoingStore=O.outgoingStore||new u.default,this.incomingStore=O.incomingStore||new u.default,this.queueQoSZero=O.queueQoSZero===void 0?!0:O.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.keepaliveManager=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,O.properties&&O.properties.topicAliasMaximum>0&&(O.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new h.default(O.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:j}=this,R=()=>{let T=j.shift();this.log("deliver :: entry %o",T);let D=null;if(!T){this._resubscribe();return}D=T.packet,this.log("deliver :: call _sendPacket for %o",D);let H=!0;D.messageId&&D.messageId!==0&&(this.messageIdProvider.register(D.messageId)||(H=!1)),H?this._sendPacket(D,U=>{T.cb&&T.cb(U),R()}):(this.log("messageId: %d has already used. The message is skipped and removed.",D.messageId),R())};this.log("connect :: sending queued packets"),R()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this._destroyKeepaliveManager(),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}handleAuth(A,O){O()}handleMessage(A,O){O()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var ae;let A=new i.Writable,O=o.default.parser(this.options),j=null,R=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new u.default,this.outgoingStore=this.options.outgoingStore||new u.default,this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),O.on("packet",J=>{this.log("parser :: on packet push to packets array."),R.push(J)});let T=()=>{this.log("work :: getting next packet in queue");let J=R.shift();if(J)this.log("work :: packet pulled from queue"),(0,d.default)(this,J,D);else{this.log("work :: no packets in queue");let M=j;j=null,this.log("work :: done flag is %s",!!M),M&&M()}},D=()=>{if(R.length)(0,y.nextTick)(T);else{let J=j;j=null,J()}};A._write=(J,M,ce)=>{j=ce,this.log("writable stream :: parsing buffer"),O.parse(J),T()};let H=J=>{this.log("streamErrorHandler :: error",J.message),J.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",J)):this.noop(J)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(A),this.stream.on("error",H),this.stream.on("close",()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close")}),this.log("connect: sending packet `connect`");let U={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&(U.will={...this.options.will,payload:(ae=this.options.will)==null?void 0:ae.payload}),this.topicAliasRecv&&(U.properties||(U.properties={}),this.topicAliasRecv&&(U.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(U),O.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&typeof this.options.authPacket=="object"){let J={cmd:"auth",reasonCode:0,...this.options.authPacket};this._writePacket(J)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this.emit("error",new Error("connack timeout")),this._cleanUp(!0)},this.options.connectTimeout),this}publish(A,O,j,R){this.log("publish :: message `%s` to topic `%s`",O,A);let{options:T}=this;typeof j=="function"&&(R=j,j=null),j=j||{},j={qos:0,retain:!1,dup:!1,...j};let{qos:D,retain:H,dup:U,properties:ae,cbStorePut:J}=j;if(this._checkDisconnecting(R))return this;let M=()=>{let ce=0;if((D===1||D===2)&&(ce=this._nextId(),ce===null))return this.log("No messageId left"),!1;let Q={cmd:"publish",topic:A,payload:O,qos:D,retain:H,messageId:ce,dup:U};switch(T.protocolVersion===5&&(Q.properties=ae),this.log("publish :: qos",D),D){case 1:case 2:this.outgoing[Q.messageId]={volatile:!1,cb:R||this.noop},this.log("MqttClient:publish: packet cmd: %s",Q.cmd),this._sendPacket(Q,void 0,J);break;default:this.log("MqttClient:publish: packet cmd: %s",Q.cmd),this._sendPacket(Q,R,J);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!M())&&this._storeProcessingQueue.push({invoke:M,cbStorePut:j.cbStorePut,callback:R}),this}publishAsync(A,O,j){return new Promise((R,T)=>{this.publish(A,O,j,(D,H)=>{D?T(D):R(H)})})}subscribe(A,O,j){let R=this.options.protocolVersion;typeof O=="function"&&(j=O),j=j||this.noop;let T=!1,D=[];typeof A=="string"?(A=[A],D=A):Array.isArray(A)?D=A:typeof A=="object"&&(T=A.resubscribe,delete A.resubscribe,D=Object.keys(A));let H=c.validateTopics(D);if(H!==null)return g(j,new Error(`Invalid topic ${H}`)),this;if(this._checkDisconnecting(j))return this.log("subscribe: discconecting true"),this;let U={qos:0};R===5&&(U.nl=!1,U.rap=!1,U.rh=0),O={...U,...O};let{properties:ae}=O,J=[],M=(B,N)=>{if(N=N||O,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,B)||this._resubscribeTopics[B].qos<N.qos||T){let Y={topic:B,qos:N.qos};R===5&&(Y.nl=N.nl,Y.rap=N.rap,Y.rh=N.rh,Y.properties=ae),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",Y.topic,Y.qos),J.push(Y)}};if(Array.isArray(A)?A.forEach(B=>{this.log("subscribe: array topic %s",B),M(B)}):Object.keys(A).forEach(B=>{this.log("subscribe: object topic %s, %o",B,A[B]),M(B,A[B])}),!J.length)return j(null,[]),this;let ce=(B,N)=>{let Y={cmd:"subscribe",subscriptions:B,messageId:N};if(ae&&(Y.properties=ae),this.options.resubscribe){this.log("subscribe :: resubscribe true");let X=[];B.forEach(we=>{if(this.options.reconnectPeriod>0){let L={qos:we.qos};R===5&&(L.nl=we.nl||!1,L.rap=we.rap||!1,L.rh=we.rh||0,L.properties=we.properties),this._resubscribeTopics[we.topic]=L,X.push(we.topic)}}),this.messageIdToTopic[Y.messageId]=X}let ue=new Promise((X,we)=>{this.outgoing[Y.messageId]={volatile:!0,cb(L,W){if(!L){let{granted:le}=W;for(let $=0;$<le.length;$+=1)B[$].qos=le[$]}L?we(new y.ErrorWithSubackPacket(L.message,W)):X(W)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(Y),ue},Q=()=>{let B=this.options.subscribeBatchSize??J.length,N=[];for(let Y=0;Y<J.length;Y+=B){let ue=J.slice(Y,Y+B),X=this._nextId();if(X===null)return this.log("No messageId left"),!1;N.push(ce(ue,X))}return Promise.all(N).then(Y=>{j(null,J,Y.at(-1))}).catch(Y=>{j(Y,J,Y.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!Q())&&this._storeProcessingQueue.push({invoke:Q,callback:j}),this}subscribeAsync(A,O){return new Promise((j,R)=>{this.subscribe(A,O,(T,D)=>{T?R(T):j(D)})})}unsubscribe(A,O,j){typeof A=="string"&&(A=[A]),typeof O=="function"&&(j=O),j=j||this.noop;let R=c.validateTopics(A);if(R!==null)return g(j,new Error(`Invalid topic ${R}`)),this;if(this._checkDisconnecting(j))return this;let T=()=>{let D=this._nextId();if(D===null)return this.log("No messageId left"),!1;let H={cmd:"unsubscribe",messageId:D,unsubscriptions:[]};return typeof A=="string"?H.unsubscriptions=[A]:Array.isArray(A)&&(H.unsubscriptions=A),this.options.resubscribe&&H.unsubscriptions.forEach(U=>{delete this._resubscribeTopics[U]}),typeof O=="object"&&O.properties&&(H.properties=O.properties),this.outgoing[H.messageId]={volatile:!0,cb:j},this.log("unsubscribe: call _sendPacket"),this._sendPacket(H),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!T())&&this._storeProcessingQueue.push({invoke:T,callback:j}),this}unsubscribeAsync(A,O){return new Promise((j,R)=>{this.unsubscribe(A,O,(T,D)=>{T?R(T):j(D)})})}end(A,O,j){this.log("end :: (%s)",this.options.clientId),(A==null||typeof A!="boolean")&&(j=j||O,O=A,A=!1),typeof O!="object"&&(j=j||O,O=null),this.log("end :: cb? %s",!!j),(!j||typeof j!="function")&&(j=this.noop);let R=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(D=>{this.outgoingStore.close(H=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),j){let U=D||H;this.log("end :: closeStores: invoking callback with args"),j(U)}})}),this._deferredReconnect?this._deferredReconnect():(this.options.reconnectPeriod===0||this.options.manualConnect)&&(this.disconnecting=!1)},T=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,A),this._cleanUp(A,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,y.nextTick)(R)},O)};return this.disconnecting?(j(),this):(this._clearReconnect(),this.disconnecting=!0,!A&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,T,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),T()),this)}endAsync(A,O){return new Promise((j,R)=>{this.end(A,O,T=>{T?R(T):j()})})}removeOutgoingMessage(A){if(this.outgoing[A]){let{cb:O}=this.outgoing[A];this._removeOutgoingAndStoreMessage(A,()=>{O(new Error("Message removed"))})}return this}reconnect(A){this.log("client reconnect");let O=()=>{A?(this.options.incomingStore=A.incomingStore,this.options.outgoingStore=A.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new u.default,this.outgoingStore=this.options.outgoingStore||new u.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=O:O(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach(A=>{this.outgoing[A].volatile&&typeof this.outgoing[A].cb=="function"&&(this.outgoing[A].cb(new Error("Connection closed")),delete this.outgoing[A])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(A=>{typeof this.outgoing[A].cb=="function"&&(this.outgoing[A].cb(new Error("Connection closed")),delete this.outgoing[A])}))}_removeTopicAliasAndRecoverTopicName(A){let O;A.properties&&(O=A.properties.topicAlias);let j=A.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",O,j),j.length===0){if(typeof O>"u")return new Error("Unregistered Topic Alias");if(j=this.topicAliasSend.getTopicByAlias(O),typeof j>"u")return new Error("Unregistered Topic Alias");A.topic=j}O&&delete A.properties.topicAlias}_checkDisconnecting(A){return this.disconnecting&&(A&&A!==this.noop?A(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(A,O,j={}){if(O&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",O)),this.log("_cleanUp :: forced? %s",A),A)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let R={cmd:"disconnect",...j};this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(R,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),g(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)})})})}!this.disconnecting&&!this.reconnecting&&(this.log("_cleanUp :: client not disconnecting/reconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this._destroyKeepaliveManager(),O&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",O),O())}_storeAndSend(A,O,j){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",A.cmd);let R=A,T;if(R.cmd==="publish"&&(R=(0,a.default)(A),T=this._removeTopicAliasAndRecoverTopicName(R),T))return O&&O(T);this.outgoingStore.put(R,D=>{if(D)return O&&O(D);j(),this._writePacket(A,O)})}_applyTopicAlias(A){if(this.options.protocolVersion===5&&A.cmd==="publish"){let O;A.properties&&(O=A.properties.topicAlias);let j=A.topic.toString();if(this.topicAliasSend)if(O){if(j.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",j,O),!this.topicAliasSend.put(j,O)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",j,O),new Error("Sending Topic Alias out of range")}else j.length!==0&&(this.options.autoAssignTopicAlias?(O=this.topicAliasSend.getAliasByTopic(j),O?(A.topic="",A.properties={...A.properties,topicAlias:O},this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",j,O)):(O=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(j,O),A.properties={...A.properties,topicAlias:O},this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",j,O))):this.options.autoUseTopicAlias&&(O=this.topicAliasSend.getAliasByTopic(j),O&&(A.topic="",A.properties={...A.properties,topicAlias:O},this.log("applyTopicAlias :: auto use topic: %s - alias: %d",j,O))));else if(O)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",j,O),new Error("Sending Topic Alias out of range")}}_noop(A){this.log("noop ::",A)}_writePacket(A,O){this.log("_writePacket :: packet: %O",A),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",A),this.log("_writePacket :: writing to stream");let j=o.default.writeToStream(A,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",j),!j&&O&&O!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",O)):O&&(this.log("_writePacket :: invoking cb"),O())}_sendPacket(A,O,j,R){this.log("_sendPacket :: (%s) :: start",this.options.clientId),j=j||this.noop,O=O||this.noop;let T=this._applyTopicAlias(A);if(T){O(T);return}if(!this.connected){if(A.cmd==="auth"){this._writePacket(A,O);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(A,O,j);return}if(R){this._writePacket(A,O);return}switch(A.cmd){case"publish":break;case"pubrel":this._storeAndSend(A,O,j);return;default:this._writePacket(A,O);return}switch(A.qos){case 2:case 1:this._storeAndSend(A,O,j);break;case 0:default:this._writePacket(A,O);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(A,O,j){this.log("_storePacket :: packet: %o",A),this.log("_storePacket :: cb? %s",!!O),j=j||this.noop;let R=A;if(R.cmd==="publish"){R=(0,a.default)(A);let D=this._removeTopicAliasAndRecoverTopicName(R);if(D)return O&&O(D)}let T=R.qos||0;T===0&&this.queueQoSZero||R.cmd!=="publish"?this.queue.push({packet:R,cb:O}):T>0?(O=this.outgoing[R.messageId]?this.outgoing[R.messageId].cb:null,this.outgoingStore.put(R,D=>{if(D)return O&&O(D);j()})):O&&O(new Error("No connection to broker"))}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.options.keepalive),!this.keepaliveManager&&this.options.keepalive&&(this.keepaliveManager=new b.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(A=!1){this.keepaliveManager&&this.options.keepalive&&(A||this.options.reschedulePings)&&this._reschedulePing()}_reschedulePing(){this.log("_reschedulePing :: rescheduling ping"),this.keepaliveManager.reschedule()}sendPing(){this.log("_sendPing :: sending pingreq"),this._sendPacket({cmd:"pingreq"})}onKeepaliveTimeout(){this.emit("error",new Error("Keepalive timeout")),this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0)}_resubscribe(){this.log("_resubscribe");let A=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&A.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let O=0;O<A.length;O++){let j={};j[A[O]]=this._resubscribeTopics[A[O]],j.resubscribe=!0,this.subscribe(j,{properties:j[A[O]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(A){if(this.disconnected){this.emit("connect",A);return}this.connackPacket=A,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;let O=()=>{let j=this.outgoingStore.createStream(),R=()=>{j.destroy(),j=null,this._flushStoreProcessingQueue(),T()},T=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",R),j.on("error",H=>{T(),this._flushStoreProcessingQueue(),this.removeListener("close",R),this.emit("error",H)});let D=()=>{if(!j)return;let H=j.read(1),U;if(!H){j.once("readable",D);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[H.messageId]){D();return}!this.disconnecting&&!this.reconnectTimer?(U=this.outgoing[H.messageId]?this.outgoing[H.messageId].cb:null,this.outgoing[H.messageId]={volatile:!1,cb(ae,J){U&&U(ae,J),D()}},this._packetIdsDuringStoreProcessing[H.messageId]=!0,this.messageIdProvider.register(H.messageId)?this._sendPacket(H,void 0,void 0,!0):this.log("messageId: %d has already used.",H.messageId)):j.destroy&&j.destroy()};j.on("end",()=>{let H=!0;for(let U in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[U]){H=!1;break}this.removeListener("close",R),H?(T(),this._invokeAllStoreProcessingQueue(),this.emit("connect",A)):O()}),D()};O()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let A=this._storeProcessingQueue[0];if(A&&A.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let A of this._storeProcessingQueue)A.cbStorePut&&A.cbStorePut(new Error("Connection closed")),A.callback&&A.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(A,O){delete this.outgoing[A],this.outgoingStore.del({messageId:A},(j,R)=>{O(j,R),this.messageIdProvider.deallocate(A),this._invokeStoreProcessingQueue()})}},Ne(x,"VERSION",y.MQTTJS_VERSION),x);e.default=_}),JS=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"__esModule",{value:!0});var t=Cp(),r=class{constructor(){Ne(this,"numberAllocator");Ne(this,"lastId");this.numberAllocator=new t.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(n){return this.numberAllocator.use(n)}deallocate(n){this.numberAllocator.free(n)}clear(){this.numberAllocator.clear()}};e.default=r});function QS(){if($l)return ji;$l=!0;let e=2147483647,t=36,r=1,n=26,s=38,o=700,i=72,a=128,l="-",c=/^xn--/,u=/[^\0-\x7F]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=t-r,y=Math.floor,m=String.fromCharCode;function b(j){throw new RangeError(f[j])}function S(j,R){let T=[],D=j.length;for(;D--;)T[D]=R(j[D]);return T}function g(j,R){let T=j.split("@"),D="";T.length>1&&(D=T[0]+"@",j=T[1]),j=j.replace(d,".");let H=j.split("."),U=S(H,R).join(".");return D+U}function w(j){let R=[],T=0,D=j.length;for(;T<D;){let H=j.charCodeAt(T++);if(H>=55296&&H<=56319&&T<D){let U=j.charCodeAt(T++);(U&64512)==56320?R.push(((H&1023)<<10)+(U&1023)+65536):(R.push(H),T--)}else R.push(H)}return R}let _=j=>String.fromCodePoint(...j),x=function(j){return j>=48&&j<58?26+(j-48):j>=65&&j<91?j-65:j>=97&&j<123?j-97:t},I=function(j,R){return j+22+75*(j<26)-((R!=0)<<5)},C=function(j,R,T){let D=0;for(j=T?y(j/o):j>>1,j+=y(j/R);j>h*n>>1;D+=t)j=y(j/h);return y(D+(h+1)*j/(j+s))},A=function(j){let R=[],T=j.length,D=0,H=a,U=i,ae=j.lastIndexOf(l);ae<0&&(ae=0);for(let J=0;J<ae;++J)j.charCodeAt(J)>=128&&b("not-basic"),R.push(j.charCodeAt(J));for(let J=ae>0?ae+1:0;J<T;){let M=D;for(let Q=1,B=t;;B+=t){J>=T&&b("invalid-input");let N=x(j.charCodeAt(J++));N>=t&&b("invalid-input"),N>y((e-D)/Q)&&b("overflow"),D+=N*Q;let Y=B<=U?r:B>=U+n?n:B-U;if(N<Y)break;let ue=t-Y;Q>y(e/ue)&&b("overflow"),Q*=ue}let ce=R.length+1;U=C(D-M,ce,M==0),y(D/ce)>e-H&&b("overflow"),H+=y(D/ce),D%=ce,R.splice(D++,0,H)}return String.fromCodePoint(...R)},O=function(j){let R=[];j=w(j);let T=j.length,D=a,H=0,U=i;for(let M of j)M<128&&R.push(m(M));let ae=R.length,J=ae;for(ae&&R.push(l);J<T;){let M=e;for(let Q of j)Q>=D&&Q<M&&(M=Q);let ce=J+1;M-D>y((e-H)/ce)&&b("overflow"),H+=(M-D)*ce,D=M;for(let Q of j)if(Q<D&&++H>e&&b("overflow"),Q===D){let B=H;for(let N=t;;N+=t){let Y=N<=U?r:N>=U+n?n:N-U;if(B<Y)break;let ue=B-Y,X=t-Y;R.push(m(I(Y+ue%X,0))),B=y(ue/X)}R.push(m(I(B,0))),U=C(H,ce,J===ae),H=0,++J}++H,++D}return R.join("")};return ji={version:"2.3.1",ucs2:{decode:w,encode:_},decode:A,encode:O,toASCII:function(j){return g(j,function(R){return u.test(R)?"xn--"+O(R):R})},toUnicode:function(j){return g(j,function(R){return c.test(R)?A(R.slice(4).toLowerCase()):R})}},ji}var ji,$l,xr,XS=Ct(()=>{xe(),Se(),_e(),ji={},$l=!1,xr=QS(),xr.decode,xr.encode,xr.toASCII,xr.toUnicode,xr.ucs2,xr.version});function ZS(){return Kl||(Kl=!0,Vl=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),r=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var n=42;e[t]=n;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==n||o.enumerable!==!0)return!1}return!0}),Vl}function eE(){return Yl||(Yl=!0,Gl=Error),Gl}function tE(){return Ql||(Ql=!0,Jl=EvalError),Jl}function rE(){return Zl||(Zl=!0,Xl=RangeError),Xl}function nE(){return tc||(tc=!0,ec=ReferenceError),ec}function Dp(){return nc||(nc=!0,rc=SyntaxError),rc}function so(){return ic||(ic=!0,oc=TypeError),oc}function oE(){return ac||(ac=!0,sc=URIError),sc}function iE(){if(lc)return Oi;lc=!0;var e=typeof Symbol<"u"&&Symbol,t=ZS();return Oi=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Oi}function sE(){if(cc)return Pi;cc=!0;var e={__proto__:null,foo:{}},t=Object;return Pi=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof t)},Pi}function aE(){if(uc)return Ni;uc=!0;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",s=function(a,l){for(var c=[],u=0;u<a.length;u+=1)c[u]=a[u];for(var d=0;d<l.length;d+=1)c[d+a.length]=l[d];return c},o=function(a,l){for(var c=[],u=l,d=0;u<a.length;u+=1,d+=1)c[d]=a[u];return c},i=function(a,l){for(var c="",u=0;u<a.length;u+=1)c+=a[u],u+1<a.length&&(c+=l);return c};return Ni=function(a){var l=this;if(typeof l!="function"||t.apply(l)!==n)throw new TypeError(e+l);for(var c=o(arguments,1),u,d=function(){if(this instanceof u){var b=l.apply(this,s(c,arguments));return Object(b)===b?b:this}return l.apply(a,s(c,arguments))},f=r(0,l.length-c.length),h=[],y=0;y<f;y++)h[y]="$"+y;if(u=Function("binder","return function ("+i(h,",")+"){ return binder.apply(this,arguments); }")(d),l.prototype){var m=function(){};m.prototype=l.prototype,u.prototype=new m,m.prototype=null}return u},Ni}function ql(){if(dc)return Ri;dc=!0;var e=aE();return Ri=Function.prototype.bind||e,Ri}function lE(){if(fc)return Mi;fc=!0;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=ql();return Mi=r.call(e,t),Mi}function _n(){if(hc)return Di;hc=!0;var e,t=eE(),r=tE(),n=rE(),s=nE(),o=Dp(),i=so(),a=oE(),l=Function,c=function(J){try{return l('"use strict"; return ('+J+").constructor;")()}catch{}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch{u=null}var d=function(){throw new i},f=u?(function(){try{return arguments.callee,d}catch{try{return u(arguments,"callee").get}catch{return d}}})():d,h=iE()(),y=sE()(),m=Object.getPrototypeOf||(y?function(J){return J.__proto__}:null),b={},S=typeof Uint8Array>"u"||!m?e:m(Uint8Array),g={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":h&&m?m([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":b,"%AsyncGenerator%":b,"%AsyncGeneratorFunction%":b,"%AsyncIteratorPrototype%":b,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":b,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h&&m?m(m([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!h||!m?e:m(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":n,"%ReferenceError%":s,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!h||!m?e:m(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h&&m?m(""[Symbol.iterator]()):e,"%Symbol%":h?Symbol:e,"%SyntaxError%":o,"%ThrowTypeError%":f,"%TypedArray%":S,"%TypeError%":i,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":a,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet};if(m)try{null.error}catch(J){var w=m(m(J));g["%Error.prototype%"]=w}var _=function J(M){var ce;if(M==="%AsyncFunction%")ce=c("async function () {}");else if(M==="%GeneratorFunction%")ce=c("function* () {}");else if(M==="%AsyncGeneratorFunction%")ce=c("async function* () {}");else if(M==="%AsyncGenerator%"){var Q=J("%AsyncGeneratorFunction%");Q&&(ce=Q.prototype)}else if(M==="%AsyncIteratorPrototype%"){var B=J("%AsyncGenerator%");B&&m&&(ce=m(B.prototype))}return g[M]=ce,ce},x={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},I=ql(),C=lE(),A=I.call(Function.call,Array.prototype.concat),O=I.call(Function.apply,Array.prototype.splice),j=I.call(Function.call,String.prototype.replace),R=I.call(Function.call,String.prototype.slice),T=I.call(Function.call,RegExp.prototype.exec),D=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H=/\\(\\)?/g,U=function(J){var M=R(J,0,1),ce=R(J,-1);if(M==="%"&&ce!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(ce==="%"&&M!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var Q=[];return j(J,D,function(B,N,Y,ue){Q[Q.length]=Y?j(ue,H,"$1"):N||B}),Q},ae=function(J,M){var ce=J,Q;if(C(x,ce)&&(Q=x[ce],ce="%"+Q[0]+"%"),C(g,ce)){var B=g[ce];if(B===b&&(B=_(ce)),typeof B>"u"&&!M)throw new i("intrinsic "+J+" exists, but is not available. Please file an issue!");return{alias:Q,name:ce,value:B}}throw new o("intrinsic "+J+" does not exist!")};return Di=function(J,M){if(typeof J!="string"||J.length===0)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof M!="boolean")throw new i('"allowMissing" argument must be a boolean');if(T(/^%?[^%]*%?$/,J)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var ce=U(J),Q=ce.length>0?ce[0]:"",B=ae("%"+Q+"%",M),N=B.name,Y=B.value,ue=!1,X=B.alias;X&&(Q=X[0],O(ce,A([0,1],X)));for(var we=1,L=!0;we<ce.length;we+=1){var W=ce[we],le=R(W,0,1),$=R(W,-1);if((le==='"'||le==="'"||le==="`"||$==='"'||$==="'"||$==="`")&&le!==$)throw new o("property names with quotes must have matching quotes");if((W==="constructor"||!L)&&(ue=!0),Q+="."+W,N="%"+Q+"%",C(g,N))Y=g[N];else if(Y!=null){if(!(W in Y)){if(!M)throw new i("base intrinsic for "+J+" exists, but the property is not available.");return}if(u&&we+1>=ce.length){var ee=u(Y,W);L=!!ee,L&&"get"in ee&&!("originalValue"in ee.get)?Y=ee.get:Y=Y[W]}else L=C(Y,W),Y=Y[W];L&&!ue&&(g[N]=Y)}}return Y},Di}function Hl(){if(pc)return Li;pc=!0;var e=_n(),t=e("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return Li=t,Li}function Lp(){if(gc)return zi;gc=!0;var e=_n(),t=e("%Object.getOwnPropertyDescriptor%",!0);if(t)try{t([],"length")}catch{t=null}return zi=t,zi}function cE(){if(mc)return Bi;mc=!0;var e=Hl(),t=Dp(),r=so(),n=Lp();return Bi=function(s,o,i){if(!s||typeof s!="object"&&typeof s!="function")throw new r("`obj` must be an object or a function`");if(typeof o!="string"&&typeof o!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,d=!!n&&n(s,o);if(e)e(s,o,{configurable:c===null&&d?d.configurable:!c,enumerable:a===null&&d?d.enumerable:!a,value:i,writable:l===null&&d?d.writable:!l});else if(u||!a&&!l&&!c)s[o]=i;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Bi}function uE(){if(bc)return Ui;bc=!0;var e=Hl(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},Ui=t,Ui}function dE(){if(yc)return Fi;yc=!0;var e=_n(),t=cE(),r=uE()(),n=Lp(),s=so(),o=e("%Math.floor%");return Fi=function(i,a){if(typeof i!="function")throw new s("`fn` is not a function");if(typeof a!="number"||a<0||a>4294967295||o(a)!==a)throw new s("`length` must be a positive 32-bit integer");var l=arguments.length>2&&!!arguments[2],c=!0,u=!0;if("length"in i&&n){var d=n(i,"length");d&&!d.configurable&&(c=!1),d&&!d.writable&&(u=!1)}return(c||u||!l)&&(r?t(i,"length",a,!0,!0):t(i,"length",a)),i},Fi}function fE(){if(vc)return Sn;vc=!0;var e=ql(),t=_n(),r=dE(),n=so(),s=t("%Function.prototype.apply%"),o=t("%Function.prototype.call%"),i=t("%Reflect.apply%",!0)||e.call(o,s),a=Hl(),l=t("%Math.max%");Sn=function(u){if(typeof u!="function")throw new n("a function is required");var d=i(e,o,arguments);return r(d,1+l(0,u.length-(arguments.length-1)),!0)};var c=function(){return i(e,s,arguments)};return a?a(Sn,"apply",{value:c}):Sn.apply=c,Sn}function hE(){if(wc)return Wi;wc=!0;var e=_n(),t=fE(),r=t(e("String.prototype.indexOf"));return Wi=function(n,s){var o=e(n,!!s);return typeof o=="function"&&r(n,".prototype.")>-1?t(o):o},Wi}var Vl,Kl,Gl,Yl,Jl,Ql,Xl,Zl,ec,tc,rc,nc,oc,ic,sc,ac,Oi,lc,Pi,cc,Ni,uc,Ri,dc,Mi,fc,Di,hc,Li,pc,zi,gc,Bi,mc,Ui,bc,Fi,yc,Sn,vc,Wi,wc,pE=Ct(()=>{xe(),Se(),_e(),Vl={},Kl=!1,Gl={},Yl=!1,Jl={},Ql=!1,Xl={},Zl=!1,ec={},tc=!1,rc={},nc=!1,oc={},ic=!1,sc={},ac=!1,Oi={},lc=!1,Pi={},cc=!1,Ni={},uc=!1,Ri={},dc=!1,Mi={},fc=!1,Di={},hc=!1,Li={},pc=!1,zi={},gc=!1,Bi={},mc=!1,Ui={},bc=!1,Fi={},yc=!1,Sn={},vc=!1,Wi={},wc=!1});function xc(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function gE(){!Fr||!Wr||(Fr=!1,Wr.length?Vt=Wr.concat(Vt):ao=-1,Vt.length&&zp())}function zp(){if(!Fr){var e=setTimeout(gE,0);Fr=!0;for(var t=Vt.length;t;){for(Wr=Vt,Vt=[];++ao<t;)Wr&&Wr[ao].run();ao=-1,t=Vt.length}Wr=null,Fr=!1,clearTimeout(e)}}function mE(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];Vt.push(new Bp(e,t)),Vt.length===1&&!Fr&&setTimeout(zp,0)}function Bp(e,t){this.fun=e,this.array=t}function _t(){}function bE(e){xc("_linkedBinding")}function yE(e){xc("dlopen")}function vE(){return[]}function wE(){return[]}function xE(e,t){if(!e)throw new Error(t||"assertion error")}function _E(){return!1}function SE(){return sr.now()/1e3}function _c(e){var t=Math.floor((Date.now()-sr.now())*.001),r=sr.now()*.001,n=Math.floor(r)+t,s=Math.floor(r%1*1e9);return e&&(n=n-e[0],s=s-e[1],s<0&&(n--,s+=qi)),[n,s]}function _r(){return Ec}function EE(e){return[]}var Vt,Fr,Wr,ao,Up,Fp,Wp,$p,qp,Hp,Vp,Kp,Gp,Yp,Jp,Qp,Xp,Zp,eg,tg,rg,ng,og,ig,sg,$i,ag,lg,cg,ug,dg,fg,hg,pg,gg,mg,bg,yg,vg,wg,xg,_g,Sg,Eg,kg,Ag,Cg,Ig,Tg,jg,Og,sr,Sc,qi,Pg,Ng,Rg,Mg,Dg,Lg,zg,Bg,Ug,Fg,Wg,Ec,$g=Ct(()=>{xe(),Se(),_e(),Vt=[],Fr=!1,ao=-1,Bp.prototype.run=function(){this.fun.apply(null,this.array)},Up="browser",Fp="x64",Wp="browser",$p={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},qp=["/usr/bin/node"],Hp=[],Vp="v16.8.0",Kp={},Gp=function(e,t){console.warn((t?t+": ":"")+e)},Yp=function(e){xc("binding")},Jp=function(e){return 0},Qp=function(){return"/"},Xp=function(e){},Zp={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},eg=_t,tg=[],rg={},ng=!1,og={},ig=_t,sg=_t,$i=function(){return{}},ag=$i,lg=$i,cg=_t,ug=_t,dg=_t,fg={},hg={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},pg=_t,gg=_t,mg=_t,bg=_t,yg=_t,vg=_t,wg=_t,xg=void 0,_g=void 0,Sg=void 0,Eg=_t,kg=2,Ag=1,Cg="/bin/usr/node",Ig=9229,Tg="node",jg=[],Og=_t,sr={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},sr.now===void 0&&(Sc=Date.now(),sr.timing&&sr.timing.navigationStart&&(Sc=sr.timing.navigationStart),sr.now=()=>Date.now()-Sc),qi=1e9,_c.bigint=function(e){var t=_c(e);return typeof BigInt>"u"?t[0]*qi+t[1]:BigInt(t[0]*qi)+BigInt(t[1])},Pg=10,Ng={},Rg=0,Mg=_r,Dg=_r,Lg=_r,zg=_r,Bg=_r,Ug=_t,Fg=_r,Wg=_r,Ec={version:Vp,versions:Kp,arch:Fp,platform:Wp,release:Zp,_rawDebug:eg,moduleLoadList:tg,binding:Yp,_linkedBinding:bE,_events:Ng,_eventsCount:Rg,_maxListeners:Pg,on:_r,addListener:Mg,once:Dg,off:Lg,removeListener:zg,removeAllListeners:Bg,emit:Ug,prependListener:Fg,prependOnceListener:Wg,listeners:EE,domain:rg,_exiting:ng,config:og,dlopen:yE,uptime:SE,_getActiveRequests:vE,_getActiveHandles:wE,reallyExit:ig,_kill:sg,cpuUsage:$i,resourceUsage:ag,memoryUsage:lg,kill:cg,exit:ug,openStdin:dg,allowedNodeEnvironmentFlags:fg,assert:xE,features:hg,_fatalExceptions:pg,setUncaughtExceptionCaptureCallback:gg,hasUncaughtExceptionCaptureCallback:_E,emitWarning:Gp,nextTick:mE,_tickCallback:mg,_debugProcess:bg,_debugEnd:yg,_startProfilerIdleNotifier:vg,_stopProfilerIdleNotifier:wg,stdout:xg,stdin:Sg,stderr:_g,abort:Eg,umask:Jp,chdir:Xp,cwd:Qp,env:$p,title:Up,argv:qp,execArgv:Hp,pid:kg,ppid:Ag,execPath:Cg,debugPort:Ig,hrtime:_c,argv0:Tg,_preload_modules:jg,setSourceMapsEnabled:Og}});function kE(){if(kc)return Hi;kc=!0;var e=Ec;function t(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function r(o,i){for(var a="",l=0,c=-1,u=0,d,f=0;f<=o.length;++f){if(f<o.length)d=o.charCodeAt(f);else{if(d===47)break;d=47}if(d===47){if(!(c===f-1||u===1))if(c!==f-1&&u===2){if(a.length<2||l!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var h=a.lastIndexOf("/");if(h!==a.length-1){h===-1?(a="",l=0):(a=a.slice(0,h),l=a.length-1-a.lastIndexOf("/")),c=f,u=0;continue}}else if(a.length===2||a.length===1){a="",l=0,c=f,u=0;continue}}i&&(a.length>0?a+="/..":a="..",l=2)}else a.length>0?a+="/"+o.slice(c+1,f):a=o.slice(c+1,f),l=f-c-1;c=f,u=0}else d===46&&u!==-1?++u:u=-1}return a}function n(o,i){var a=i.dir||i.root,l=i.base||(i.name||"")+(i.ext||"");return a?a===i.root?a+l:a+o+l:l}var s={resolve:function(){for(var o="",i=!1,a,l=arguments.length-1;l>=-1&&!i;l--){var c;l>=0?c=arguments[l]:(a===void 0&&(a=e.cwd()),c=a),t(c),c.length!==0&&(o=c+"/"+o,i=c.charCodeAt(0)===47)}return o=r(o,!i),i?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(o){if(t(o),o.length===0)return".";var i=o.charCodeAt(0)===47,a=o.charCodeAt(o.length-1)===47;return o=r(o,!i),o.length===0&&!i&&(o="."),o.length>0&&a&&(o+="/"),i?"/"+o:o},isAbsolute:function(o){return t(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,i=0;i<arguments.length;++i){var a=arguments[i];t(a),a.length>0&&(o===void 0?o=a:o+="/"+a)}return o===void 0?".":s.normalize(o)},relative:function(o,i){if(t(o),t(i),o===i||(o=s.resolve(o),i=s.resolve(i),o===i))return"";for(var a=1;a<o.length&&o.charCodeAt(a)===47;++a);for(var l=o.length,c=l-a,u=1;u<i.length&&i.charCodeAt(u)===47;++u);for(var d=i.length,f=d-u,h=c<f?c:f,y=-1,m=0;m<=h;++m){if(m===h){if(f>h){if(i.charCodeAt(u+m)===47)return i.slice(u+m+1);if(m===0)return i.slice(u+m)}else c>h&&(o.charCodeAt(a+m)===47?y=m:m===0&&(y=0));break}var b=o.charCodeAt(a+m),S=i.charCodeAt(u+m);if(b!==S)break;b===47&&(y=m)}var g="";for(m=a+y+1;m<=l;++m)(m===l||o.charCodeAt(m)===47)&&(g.length===0?g+="..":g+="/..");return g.length>0?g+i.slice(u+y):(u+=y,i.charCodeAt(u)===47&&++u,i.slice(u))},_makeLong:function(o){return o},dirname:function(o){if(t(o),o.length===0)return".";for(var i=o.charCodeAt(0),a=i===47,l=-1,c=!0,u=o.length-1;u>=1;--u)if(i=o.charCodeAt(u),i===47){if(!c){l=u;break}}else c=!1;return l===-1?a?"/":".":a&&l===1?"//":o.slice(0,l)},basename:function(o,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');t(o);var a=0,l=-1,c=!0,u;if(i!==void 0&&i.length>0&&i.length<=o.length){if(i.length===o.length&&i===o)return"";var d=i.length-1,f=-1;for(u=o.length-1;u>=0;--u){var h=o.charCodeAt(u);if(h===47){if(!c){a=u+1;break}}else f===-1&&(c=!1,f=u+1),d>=0&&(h===i.charCodeAt(d)?--d===-1&&(l=u):(d=-1,l=f))}return a===l?l=f:l===-1&&(l=o.length),o.slice(a,l)}else{for(u=o.length-1;u>=0;--u)if(o.charCodeAt(u)===47){if(!c){a=u+1;break}}else l===-1&&(c=!1,l=u+1);return l===-1?"":o.slice(a,l)}},extname:function(o){t(o);for(var i=-1,a=0,l=-1,c=!0,u=0,d=o.length-1;d>=0;--d){var f=o.charCodeAt(d);if(f===47){if(!c){a=d+1;break}continue}l===-1&&(c=!1,l=d+1),f===46?i===-1?i=d:u!==1&&(u=1):i!==-1&&(u=-1)}return i===-1||l===-1||u===0||u===1&&i===l-1&&i===a+1?"":o.slice(i,l)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return n("/",o)},parse:function(o){t(o);var i={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return i;var a=o.charCodeAt(0),l=a===47,c;l?(i.root="/",c=1):c=0;for(var u=-1,d=0,f=-1,h=!0,y=o.length-1,m=0;y>=c;--y){if(a=o.charCodeAt(y),a===47){if(!h){d=y+1;break}continue}f===-1&&(h=!1,f=y+1),a===46?u===-1?u=y:m!==1&&(m=1):u!==-1&&(m=-1)}return u===-1||f===-1||m===0||m===1&&u===f-1&&u===d+1?f!==-1&&(d===0&&l?i.base=i.name=o.slice(1,f):i.base=i.name=o.slice(d,f)):(d===0&&l?(i.name=o.slice(1,u),i.base=o.slice(1,f)):(i.name=o.slice(d,u),i.base=o.slice(d,f)),i.ext=o.slice(u,f)),d>0?i.dir=o.slice(0,d-1):l&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};return s.posix=s,Hi=s,Hi}var Hi,kc,Ac,AE=Ct(()=>{xe(),Se(),_e(),$g(),Hi={},kc=!1,Ac=kE()}),qg={};bn(qg,{URL:()=>tm,Url:()=>Jg,default:()=>St,fileURLToPath:()=>Vg,format:()=>Qg,parse:()=>em,pathToFileURL:()=>Kg,resolve:()=>Xg,resolveObject:()=>Zg});function CE(){if(Ic)return Vi;Ic=!0;var e=typeof Map=="function"&&Map.prototype,t=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=e&&t&&typeof t.get=="function"?t.get:null,n=e&&Map.prototype.forEach,s=typeof Set=="function"&&Set.prototype,o=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,i=s&&o&&typeof o.get=="function"?o.get:null,a=s&&Set.prototype.forEach,l=typeof WeakMap=="function"&&WeakMap.prototype,c=l?WeakMap.prototype.has:null,u=typeof WeakSet=="function"&&WeakSet.prototype,d=u?WeakSet.prototype.has:null,f=typeof WeakRef=="function"&&WeakRef.prototype,h=f?WeakRef.prototype.deref:null,y=Boolean.prototype.valueOf,m=Object.prototype.toString,b=Function.prototype.toString,S=String.prototype.match,g=String.prototype.slice,w=String.prototype.replace,_=String.prototype.toUpperCase,x=String.prototype.toLowerCase,I=RegExp.prototype.test,C=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,j=Math.floor,R=typeof BigInt=="function"?BigInt.prototype.valueOf:null,T=Object.getOwnPropertySymbols,D=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,H=typeof Symbol=="function"&&typeof Symbol.iterator=="object",U=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===H||!0)?Symbol.toStringTag:null,ae=Object.prototype.propertyIsEnumerable,J=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(re){return re.__proto__}:null);function M(re,oe){if(re===1/0||re===-1/0||re!==re||re&&re>-1e3&&re<1e3||I.call(/e/,oe))return oe;var de=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof re=="number"){var ge=re<0?-j(-re):j(re);if(ge!==re){var ke=String(ge),Te=g.call(oe,ke.length+1);return w.call(ke,de,"$&_")+"."+w.call(w.call(Te,/([0-9]{3})/g,"$&_"),/_$/,"")}}return w.call(oe,de,"$&_")}var ce=Gg,Q=ce.custom,B=ee(Q)?Q:null;Vi=function re(oe,de,ge,ke){var Te=de||{};if(pe(Te,"quoteStyle")&&Te.quoteStyle!=="single"&&Te.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(pe(Te,"maxStringLength")&&(typeof Te.maxStringLength=="number"?Te.maxStringLength<0&&Te.maxStringLength!==1/0:Te.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Re=pe(Te,"customInspect")?Te.customInspect:!0;if(typeof Re!="boolean"&&Re!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(pe(Te,"indent")&&Te.indent!==null&&Te.indent!==" "&&!(parseInt(Te.indent,10)===Te.indent&&Te.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(pe(Te,"numericSeparator")&&typeof Te.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Fe=Te.numericSeparator;if(typeof oe>"u")return"undefined";if(oe===null)return"null";if(typeof oe=="boolean")return oe?"true":"false";if(typeof oe=="string")return ye(oe,Te);if(typeof oe=="number"){if(oe===0)return 1/0/oe>0?"0":"-0";var De=String(oe);return Fe?M(oe,De):De}if(typeof oe=="bigint"){var We=String(oe)+"n";return Fe?M(oe,We):We}var Oe=typeof Te.depth>"u"?5:Te.depth;if(typeof ge>"u"&&(ge=0),ge>=Oe&&Oe>0&&typeof oe=="object")return ue(oe)?"[Array]":"[Object]";var qe=V(Te,ge);if(typeof ke>"u")ke=[];else if(he(ke,oe)>=0)return"[Circular]";function Ge(Kt,Er,qr){if(Er&&(ke=O.call(ke),ke.push(Er)),qr){var Gt={depth:Te.depth};return pe(Te,"quoteStyle")&&(Gt.quoteStyle=Te.quoteStyle),re(Kt,Gt,ge+1,ke)}return re(Kt,Te,ge+1,ke)}if(typeof oe=="function"&&!we(oe)){var He=ie(oe),Ye=fe(oe,Ge);return"[Function"+(He?": "+He:" (anonymous)")+"]"+(Ye.length>0?" { "+A.call(Ye,", ")+" }":"")}if(ee(oe)){var ot=H?w.call(String(oe),/^(Symbol\(.*\))_[^)]*$/,"$1"):D.call(oe);return typeof oe=="object"&&!H?p(ot):ot}if(je(oe)){for(var F="<"+x.call(String(oe.nodeName)),K=oe.attributes||[],Ie=0;Ie<K.length;Ie++)F+=" "+K[Ie].name+"="+N(Y(K[Ie].value),"double",Te);return F+=">",oe.childNodes&&oe.childNodes.length&&(F+="..."),F+="</"+x.call(String(oe.nodeName))+">",F}if(ue(oe)){if(oe.length===0)return"[]";var Pe=fe(oe,Ge);return qe&&!P(Pe)?"["+te(Pe,qe)+"]":"[ "+A.call(Pe,", ")+" ]"}if(L(oe)){var Me=fe(oe,Ge);return!("cause"in Error.prototype)&&"cause"in oe&&!ae.call(oe,"cause")?"{ ["+String(oe)+"] "+A.call(C.call("[cause]: "+Ge(oe.cause),Me),", ")+" }":Me.length===0?"["+String(oe)+"]":"{ ["+String(oe)+"] "+A.call(Me,", ")+" }"}if(typeof oe=="object"&&Re){if(B&&typeof oe[B]=="function"&&ce)return ce(oe,{depth:Oe-ge});if(Re!=="symbol"&&typeof oe.inspect=="function")return oe.inspect()}if(be(oe)){var st=[];return n&&n.call(oe,function(Kt,Er){st.push(Ge(Er,oe,!0)+" => "+Ge(Kt,oe))}),E("Map",r.call(oe),st,qe)}if(se(oe)){var ht=[];return a&&a.call(oe,function(Kt){ht.push(Ge(Kt,oe))}),E("Set",i.call(oe),ht,qe)}if(ve(oe))return v("WeakMap");if(Ee(oe))return v("WeakSet");if(Ae(oe))return v("WeakRef");if(le(oe))return p(Ge(Number(oe)));if(ne(oe))return p(Ge(R.call(oe)));if($(oe))return p(y.call(oe));if(W(oe))return p(Ge(String(oe)));if(typeof window<"u"&&oe===window)return"{ [object Window] }";if(typeof globalThis<"u"&&oe===globalThis||typeof Ki<"u"&&oe===Ki)return"{ [object globalThis] }";if(!X(oe)&&!we(oe)){var pt=fe(oe,Ge),zt=J?J(oe)===Object.prototype:oe instanceof Object||oe.constructor===Object,ar=oe instanceof Object?"":"null prototype",uo=!zt&&U&&Object(oe)===oe&&U in oe?g.call(G(oe),8,-1):ar?"Object":"",is=zt||typeof oe.constructor!="function"?"":oe.constructor.name?oe.constructor.name+" ":"",$r=is+(uo||ar?"["+A.call(C.call([],uo||[],ar||[]),": ")+"] ":"");return pt.length===0?$r+"{}":qe?$r+"{"+te(pt,qe)+"}":$r+"{ "+A.call(pt,", ")+" }"}return String(oe)};function N(re,oe,de){var ge=(de.quoteStyle||oe)==="double"?'"':"'";return ge+re+ge}function Y(re){return w.call(String(re),/"/g,""")}function ue(re){return G(re)==="[object Array]"&&(!U||!(typeof re=="object"&&U in re))}function X(re){return G(re)==="[object Date]"&&(!U||!(typeof re=="object"&&U in re))}function we(re){return G(re)==="[object RegExp]"&&(!U||!(typeof re=="object"&&U in re))}function L(re){return G(re)==="[object Error]"&&(!U||!(typeof re=="object"&&U in re))}function W(re){return G(re)==="[object String]"&&(!U||!(typeof re=="object"&&U in re))}function le(re){return G(re)==="[object Number]"&&(!U||!(typeof re=="object"&&U in re))}function $(re){return G(re)==="[object Boolean]"&&(!U||!(typeof re=="object"&&U in re))}function ee(re){if(H)return re&&typeof re=="object"&&re instanceof Symbol;if(typeof re=="symbol")return!0;if(!re||typeof re!="object"||!D)return!1;try{return D.call(re),!0}catch{}return!1}function ne(re){if(!re||typeof re!="object"||!R)return!1;try{return R.call(re),!0}catch{}return!1}var me=Object.prototype.hasOwnProperty||function(re){return re in(this||Ki)};function pe(re,oe){return me.call(re,oe)}function G(re){return m.call(re)}function ie(re){if(re.name)return re.name;var oe=S.call(b.call(re),/^function\s*([\w$]+)/);return oe?oe[1]:null}function he(re,oe){if(re.indexOf)return re.indexOf(oe);for(var de=0,ge=re.length;de<ge;de++)if(re[de]===oe)return de;return-1}function be(re){if(!r||!re||typeof re!="object")return!1;try{r.call(re);try{i.call(re)}catch{return!0}return re instanceof Map}catch{}return!1}function ve(re){if(!c||!re||typeof re!="object")return!1;try{c.call(re,c);try{d.call(re,d)}catch{return!0}return re instanceof WeakMap}catch{}return!1}function Ae(re){if(!h||!re||typeof re!="object")return!1;try{return h.call(re),!0}catch{}return!1}function se(re){if(!i||!re||typeof re!="object")return!1;try{i.call(re);try{r.call(re)}catch{return!0}return re instanceof Set}catch{}return!1}function Ee(re){if(!d||!re||typeof re!="object")return!1;try{d.call(re,d);try{c.call(re,c)}catch{return!0}return re instanceof WeakSet}catch{}return!1}function je(re){return!re||typeof re!="object"?!1:typeof HTMLElement<"u"&&re instanceof HTMLElement?!0:typeof re.nodeName=="string"&&typeof re.getAttribute=="function"}function ye(re,oe){if(re.length>oe.maxStringLength){var de=re.length-oe.maxStringLength,ge="... "+de+" more character"+(de>1?"s":"");return ye(g.call(re,0,oe.maxStringLength),oe)+ge}var ke=w.call(w.call(re,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,$e);return N(ke,"single",oe)}function $e(re){var oe=re.charCodeAt(0),de={8:"b",9:"t",10:"n",12:"f",13:"r"}[oe];return de?"\\"+de:"\\x"+(oe<16?"0":"")+_.call(oe.toString(16))}function p(re){return"Object("+re+")"}function v(re){return re+" { ? }"}function E(re,oe,de,ge){var ke=ge?te(de,ge):A.call(de,", ");return re+" ("+oe+") {"+ke+"}"}function P(re){for(var oe=0;oe<re.length;oe++)if(he(re[oe],`
|
|
229
|
+
`)>=0)return!1;return!0}function V(re,oe){var de;if(re.indent===" ")de=" ";else if(typeof re.indent=="number"&&re.indent>0)de=A.call(Array(re.indent+1)," ");else return null;return{base:de,prev:A.call(Array(oe+1),de)}}function te(re,oe){if(re.length===0)return"";var de=`
|
|
230
|
+
`+oe.prev+oe.base;return de+A.call(re,","+de)+`
|
|
231
|
+
`+oe.prev}function fe(re,oe){var de=ue(re),ge=[];if(de){ge.length=re.length;for(var ke=0;ke<re.length;ke++)ge[ke]=pe(re,ke)?oe(re[ke],re):""}var Te=typeof T=="function"?T(re):[],Re;if(H){Re={};for(var Fe=0;Fe<Te.length;Fe++)Re["$"+Te[Fe]]=Te[Fe]}for(var De in re)pe(re,De)&&(de&&String(Number(De))===De&&De<re.length||H&&Re["$"+De]instanceof Symbol||(I.call(/[^\w$]/,De)?ge.push(oe(De,re)+": "+oe(re[De],re)):ge.push(De+": "+oe(re[De],re))));if(typeof T=="function")for(var We=0;We<Te.length;We++)ae.call(re,Te[We])&&ge.push("["+oe(Te[We])+"]: "+oe(re[Te[We]],re));return ge}return Vi}function IE(){if(Tc)return Gi;Tc=!0;var e=_n(),t=hE(),r=CE(),n=so(),s=e("%WeakMap%",!0),o=e("%Map%",!0),i=t("WeakMap.prototype.get",!0),a=t("WeakMap.prototype.set",!0),l=t("WeakMap.prototype.has",!0),c=t("Map.prototype.get",!0),u=t("Map.prototype.set",!0),d=t("Map.prototype.has",!0),f=function(b,S){for(var g=b,w;(w=g.next)!==null;g=w)if(w.key===S)return g.next=w.next,w.next=b.next,b.next=w,w},h=function(b,S){var g=f(b,S);return g&&g.value},y=function(b,S,g){var w=f(b,S);w?w.value=g:b.next={key:S,next:b.next,value:g}},m=function(b,S){return!!f(b,S)};return Gi=function(){var b,S,g,w={assert:function(_){if(!w.has(_))throw new n("Side channel does not contain "+r(_))},get:function(_){if(s&&_&&(typeof _=="object"||typeof _=="function")){if(b)return i(b,_)}else if(o){if(S)return c(S,_)}else if(g)return h(g,_)},has:function(_){if(s&&_&&(typeof _=="object"||typeof _=="function")){if(b)return l(b,_)}else if(o){if(S)return d(S,_)}else if(g)return m(g,_);return!1},set:function(_,x){s&&_&&(typeof _=="object"||typeof _=="function")?(b||(b=new s),a(b,_,x)):o?(S||(S=new o),u(S,_,x)):(g||(g={key:{},next:null}),y(g,_,x))}};return w},Gi}function Cc(){if(jc)return Yi;jc=!0;var e=String.prototype.replace,t=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Yi={default:r.RFC3986,formatters:{RFC1738:function(n){return e.call(n,t,"+")},RFC3986:function(n){return String(n)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},Yi}function Hg(){if(Oc)return Ji;Oc=!0;var e=Cc(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n=(function(){for(var b=[],S=0;S<256;++S)b.push("%"+((S<16?"0":"")+S.toString(16)).toUpperCase());return b})(),s=function(b){for(;b.length>1;){var S=b.pop(),g=S.obj[S.prop];if(r(g)){for(var w=[],_=0;_<g.length;++_)typeof g[_]<"u"&&w.push(g[_]);S.obj[S.prop]=w}}},o=function(b,S){for(var g=S&&S.plainObjects?Object.create(null):{},w=0;w<b.length;++w)typeof b[w]<"u"&&(g[w]=b[w]);return g},i=function b(S,g,w){if(!g)return S;if(typeof g!="object"){if(r(S))S.push(g);else if(S&&typeof S=="object")(w&&(w.plainObjects||w.allowPrototypes)||!t.call(Object.prototype,g))&&(S[g]=!0);else return[S,g];return S}if(!S||typeof S!="object")return[S].concat(g);var _=S;return r(S)&&!r(g)&&(_=o(S,w)),r(S)&&r(g)?(g.forEach(function(x,I){if(t.call(S,I)){var C=S[I];C&&typeof C=="object"&&x&&typeof x=="object"?S[I]=b(C,x,w):S.push(x)}else S[I]=x}),S):Object.keys(g).reduce(function(x,I){var C=g[I];return t.call(x,I)?x[I]=b(x[I],C,w):x[I]=C,x},_)},a=function(b,S){return Object.keys(S).reduce(function(g,w){return g[w]=S[w],g},b)},l=function(b,S,g){var w=b.replace(/\+/g," ");if(g==="iso-8859-1")return w.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(w)}catch{return w}},c=1024,u=function(b,S,g,w,_){if(b.length===0)return b;var x=b;if(typeof b=="symbol"?x=Symbol.prototype.toString.call(b):typeof b!="string"&&(x=String(b)),g==="iso-8859-1")return escape(x).replace(/%u[0-9a-f]{4}/gi,function(T){return"%26%23"+parseInt(T.slice(2),16)+"%3B"});for(var I="",C=0;C<x.length;C+=c){for(var A=x.length>=c?x.slice(C,C+c):x,O=[],j=0;j<A.length;++j){var R=A.charCodeAt(j);if(R===45||R===46||R===95||R===126||R>=48&&R<=57||R>=65&&R<=90||R>=97&&R<=122||_===e.RFC1738&&(R===40||R===41)){O[O.length]=A.charAt(j);continue}if(R<128){O[O.length]=n[R];continue}if(R<2048){O[O.length]=n[192|R>>6]+n[128|R&63];continue}if(R<55296||R>=57344){O[O.length]=n[224|R>>12]+n[128|R>>6&63]+n[128|R&63];continue}j+=1,R=65536+((R&1023)<<10|A.charCodeAt(j)&1023),O[O.length]=n[240|R>>18]+n[128|R>>12&63]+n[128|R>>6&63]+n[128|R&63]}I+=O.join("")}return I},d=function(b){for(var S=[{obj:{o:b},prop:"o"}],g=[],w=0;w<S.length;++w)for(var _=S[w],x=_.obj[_.prop],I=Object.keys(x),C=0;C<I.length;++C){var A=I[C],O=x[A];typeof O=="object"&&O!==null&&g.indexOf(O)===-1&&(S.push({obj:x,prop:A}),g.push(O))}return s(S),b},f=function(b){return Object.prototype.toString.call(b)==="[object RegExp]"},h=function(b){return!b||typeof b!="object"?!1:!!(b.constructor&&b.constructor.isBuffer&&b.constructor.isBuffer(b))},y=function(b,S){return[].concat(b,S)},m=function(b,S){if(r(b)){for(var g=[],w=0;w<b.length;w+=1)g.push(S(b[w]));return g}return S(b)};return Ji={arrayToObject:o,assign:a,combine:y,compact:d,decode:l,encode:u,isBuffer:h,isRegExp:f,maybeMap:m,merge:i},Ji}function TE(){if(Pc)return Qi;Pc=!0;var e=IE(),t=Hg(),r=Cc(),n=Object.prototype.hasOwnProperty,s={brackets:function(m){return m+"[]"},comma:"comma",indices:function(m,b){return m+"["+b+"]"},repeat:function(m){return m}},o=Array.isArray,i=Array.prototype.push,a=function(m,b){i.apply(m,o(b)?b:[b])},l=Date.prototype.toISOString,c=r.default,u={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:t.encode,encodeValuesOnly:!1,format:c,formatter:r.formatters[c],indices:!1,serializeDate:function(m){return l.call(m)},skipNulls:!1,strictNullHandling:!1},d=function(m){return typeof m=="string"||typeof m=="number"||typeof m=="boolean"||typeof m=="symbol"||typeof m=="bigint"},f={},h=function m(b,S,g,w,_,x,I,C,A,O,j,R,T,D,H,U,ae,J){for(var M=b,ce=J,Q=0,B=!1;(ce=ce.get(f))!==void 0&&!B;){var N=ce.get(b);if(Q+=1,typeof N<"u"){if(N===Q)throw new RangeError("Cyclic object value");B=!0}typeof ce.get(f)>"u"&&(Q=0)}if(typeof O=="function"?M=O(S,M):M instanceof Date?M=T(M):g==="comma"&&o(M)&&(M=t.maybeMap(M,function(G){return G instanceof Date?T(G):G})),M===null){if(x)return A&&!U?A(S,u.encoder,ae,"key",D):S;M=""}if(d(M)||t.isBuffer(M)){if(A){var Y=U?S:A(S,u.encoder,ae,"key",D);return[H(Y)+"="+H(A(M,u.encoder,ae,"value",D))]}return[H(S)+"="+H(String(M))]}var ue=[];if(typeof M>"u")return ue;var X;if(g==="comma"&&o(M))U&&A&&(M=t.maybeMap(M,A)),X=[{value:M.length>0?M.join(",")||null:void 0}];else if(o(O))X=O;else{var we=Object.keys(M);X=j?we.sort(j):we}var L=C?S.replace(/\./g,"%2E"):S,W=w&&o(M)&&M.length===1?L+"[]":L;if(_&&o(M)&&M.length===0)return W+"[]";for(var le=0;le<X.length;++le){var $=X[le],ee=typeof $=="object"&&typeof $.value<"u"?$.value:M[$];if(!(I&&ee===null)){var ne=R&&C?$.replace(/\./g,"%2E"):$,me=o(M)?typeof g=="function"?g(W,ne):W:W+(R?"."+ne:"["+ne+"]");J.set(b,Q);var pe=e();pe.set(f,J),a(ue,m(ee,me,g,w,_,x,I,C,g==="comma"&&U&&o(M)?null:A,O,j,R,T,D,H,U,ae,pe))}}return ue},y=function(m){if(!m)return u;if(typeof m.allowEmptyArrays<"u"&&typeof m.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof m.encodeDotInKeys<"u"&&typeof m.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(m.encoder!==null&&typeof m.encoder<"u"&&typeof m.encoder!="function")throw new TypeError("Encoder has to be a function.");var b=m.charset||u.charset;if(typeof m.charset<"u"&&m.charset!=="utf-8"&&m.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var S=r.default;if(typeof m.format<"u"){if(!n.call(r.formatters,m.format))throw new TypeError("Unknown format option provided.");S=m.format}var g=r.formatters[S],w=u.filter;(typeof m.filter=="function"||o(m.filter))&&(w=m.filter);var _;if(m.arrayFormat in s?_=m.arrayFormat:"indices"in m?_=m.indices?"indices":"repeat":_=u.arrayFormat,"commaRoundTrip"in m&&typeof m.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var x=typeof m.allowDots>"u"?m.encodeDotInKeys===!0?!0:u.allowDots:!!m.allowDots;return{addQueryPrefix:typeof m.addQueryPrefix=="boolean"?m.addQueryPrefix:u.addQueryPrefix,allowDots:x,allowEmptyArrays:typeof m.allowEmptyArrays=="boolean"?!!m.allowEmptyArrays:u.allowEmptyArrays,arrayFormat:_,charset:b,charsetSentinel:typeof m.charsetSentinel=="boolean"?m.charsetSentinel:u.charsetSentinel,commaRoundTrip:m.commaRoundTrip,delimiter:typeof m.delimiter>"u"?u.delimiter:m.delimiter,encode:typeof m.encode=="boolean"?m.encode:u.encode,encodeDotInKeys:typeof m.encodeDotInKeys=="boolean"?m.encodeDotInKeys:u.encodeDotInKeys,encoder:typeof m.encoder=="function"?m.encoder:u.encoder,encodeValuesOnly:typeof m.encodeValuesOnly=="boolean"?m.encodeValuesOnly:u.encodeValuesOnly,filter:w,format:S,formatter:g,serializeDate:typeof m.serializeDate=="function"?m.serializeDate:u.serializeDate,skipNulls:typeof m.skipNulls=="boolean"?m.skipNulls:u.skipNulls,sort:typeof m.sort=="function"?m.sort:null,strictNullHandling:typeof m.strictNullHandling=="boolean"?m.strictNullHandling:u.strictNullHandling}};return Qi=function(m,b){var S=m,g=y(b),w,_;typeof g.filter=="function"?(_=g.filter,S=_("",S)):o(g.filter)&&(_=g.filter,w=_);var x=[];if(typeof S!="object"||S===null)return"";var I=s[g.arrayFormat],C=I==="comma"&&g.commaRoundTrip;w||(w=Object.keys(S)),g.sort&&w.sort(g.sort);for(var A=e(),O=0;O<w.length;++O){var j=w[O];g.skipNulls&&S[j]===null||a(x,h(S[j],j,I,C,g.allowEmptyArrays,g.strictNullHandling,g.skipNulls,g.encodeDotInKeys,g.encode?g.encoder:null,g.filter,g.sort,g.allowDots,g.serializeDate,g.format,g.formatter,g.encodeValuesOnly,g.charset,A))}var R=x.join(g.delimiter),T=g.addQueryPrefix===!0?"?":"";return g.charsetSentinel&&(g.charset==="iso-8859-1"?T+="utf8=%26%2310003%3B&":T+="utf8=%E2%9C%93&"),R.length>0?T+R:""},Qi}function jE(){if(Nc)return Xi;Nc=!0;var e=Hg(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},s=function(f){return f.replace(/&#(\d+);/g,function(h,y){return String.fromCharCode(parseInt(y,10))})},o=function(f,h){return f&&typeof f=="string"&&h.comma&&f.indexOf(",")>-1?f.split(","):f},i="utf8=%26%2310003%3B",a="utf8=%E2%9C%93",l=function(f,h){var y={__proto__:null},m=h.ignoreQueryPrefix?f.replace(/^\?/,""):f;m=m.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var b=h.parameterLimit===1/0?void 0:h.parameterLimit,S=m.split(h.delimiter,b),g=-1,w,_=h.charset;if(h.charsetSentinel)for(w=0;w<S.length;++w)S[w].indexOf("utf8=")===0&&(S[w]===a?_="utf-8":S[w]===i&&(_="iso-8859-1"),g=w,w=S.length);for(w=0;w<S.length;++w)if(w!==g){var x=S[w],I=x.indexOf("]="),C=I===-1?x.indexOf("="):I+1,A,O;C===-1?(A=h.decoder(x,n.decoder,_,"key"),O=h.strictNullHandling?null:""):(A=h.decoder(x.slice(0,C),n.decoder,_,"key"),O=e.maybeMap(o(x.slice(C+1),h),function(R){return h.decoder(R,n.decoder,_,"value")})),O&&h.interpretNumericEntities&&_==="iso-8859-1"&&(O=s(O)),x.indexOf("[]=")>-1&&(O=r(O)?[O]:O);var j=t.call(y,A);j&&h.duplicates==="combine"?y[A]=e.combine(y[A],O):(!j||h.duplicates==="last")&&(y[A]=O)}return y},c=function(f,h,y,m){for(var b=m?h:o(h,y),S=f.length-1;S>=0;--S){var g,w=f[S];if(w==="[]"&&y.parseArrays)g=y.allowEmptyArrays&&(b===""||y.strictNullHandling&&b===null)?[]:[].concat(b);else{g=y.plainObjects?Object.create(null):{};var _=w.charAt(0)==="["&&w.charAt(w.length-1)==="]"?w.slice(1,-1):w,x=y.decodeDotInKeys?_.replace(/%2E/g,"."):_,I=parseInt(x,10);!y.parseArrays&&x===""?g={0:b}:!isNaN(I)&&w!==x&&String(I)===x&&I>=0&&y.parseArrays&&I<=y.arrayLimit?(g=[],g[I]=b):x!=="__proto__"&&(g[x]=b)}b=g}return b},u=function(f,h,y,m){if(f){var b=y.allowDots?f.replace(/\.([^.[]+)/g,"[$1]"):f,S=/(\[[^[\]]*])/,g=/(\[[^[\]]*])/g,w=y.depth>0&&S.exec(b),_=w?b.slice(0,w.index):b,x=[];if(_){if(!y.plainObjects&&t.call(Object.prototype,_)&&!y.allowPrototypes)return;x.push(_)}for(var I=0;y.depth>0&&(w=g.exec(b))!==null&&I<y.depth;){if(I+=1,!y.plainObjects&&t.call(Object.prototype,w[1].slice(1,-1))&&!y.allowPrototypes)return;x.push(w[1])}if(w){if(y.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+y.depth+" and strictDepth is true");x.push("["+b.slice(w.index)+"]")}return c(x,h,y,m)}},d=function(f){if(!f)return n;if(typeof f.allowEmptyArrays<"u"&&typeof f.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof f.decodeDotInKeys<"u"&&typeof f.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(f.decoder!==null&&typeof f.decoder<"u"&&typeof f.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof f.charset<"u"&&f.charset!=="utf-8"&&f.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var h=typeof f.charset>"u"?n.charset:f.charset,y=typeof f.duplicates>"u"?n.duplicates:f.duplicates;if(y!=="combine"&&y!=="first"&&y!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var m=typeof f.allowDots>"u"?f.decodeDotInKeys===!0?!0:n.allowDots:!!f.allowDots;return{allowDots:m,allowEmptyArrays:typeof f.allowEmptyArrays=="boolean"?!!f.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof f.allowPrototypes=="boolean"?f.allowPrototypes:n.allowPrototypes,allowSparse:typeof f.allowSparse=="boolean"?f.allowSparse:n.allowSparse,arrayLimit:typeof f.arrayLimit=="number"?f.arrayLimit:n.arrayLimit,charset:h,charsetSentinel:typeof f.charsetSentinel=="boolean"?f.charsetSentinel:n.charsetSentinel,comma:typeof f.comma=="boolean"?f.comma:n.comma,decodeDotInKeys:typeof f.decodeDotInKeys=="boolean"?f.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof f.decoder=="function"?f.decoder:n.decoder,delimiter:typeof f.delimiter=="string"||e.isRegExp(f.delimiter)?f.delimiter:n.delimiter,depth:typeof f.depth=="number"||f.depth===!1?+f.depth:n.depth,duplicates:y,ignoreQueryPrefix:f.ignoreQueryPrefix===!0,interpretNumericEntities:typeof f.interpretNumericEntities=="boolean"?f.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof f.parameterLimit=="number"?f.parameterLimit:n.parameterLimit,parseArrays:f.parseArrays!==!1,plainObjects:typeof f.plainObjects=="boolean"?f.plainObjects:n.plainObjects,strictDepth:typeof f.strictDepth=="boolean"?!!f.strictDepth:n.strictDepth,strictNullHandling:typeof f.strictNullHandling=="boolean"?f.strictNullHandling:n.strictNullHandling}};return Xi=function(f,h){var y=d(h);if(f===""||f===null||typeof f>"u")return y.plainObjects?Object.create(null):{};for(var m=typeof f=="string"?l(f,y):f,b=y.plainObjects?Object.create(null):{},S=Object.keys(m),g=0;g<S.length;++g){var w=S[g],_=u(w,m[w],y,typeof f=="string");b=e.merge(b,_,y)}return y.allowSparse===!0?b:e.compact(b)},Xi}function OE(){if(Rc)return Zi;Rc=!0;var e=TE(),t=jE(),r=Cc();return Zi={formats:r,parse:t,stringify:e},Zi}function PE(){if(Mc)return Sr;Mc=!0;var e=xr;function t(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,o=["<",">",'"',"`"," ","\r",`
|
|
232
|
+
`," "],i=["{","}","|","\\","^","`"].concat(o),a=["'"].concat(i),l=["%","/","?",";","#"].concat(a),c=["/","?","#"],u=255,d=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=OE();function S(x,I,C){if(x&&typeof x=="object"&&x instanceof t)return x;var A=new t;return A.parse(x,I,C),A}t.prototype.parse=function(x,I,C){if(typeof x!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof x);var A=x.indexOf("?"),O=A!==-1&&A<x.indexOf("#")?"?":"#",j=x.split(O),R=/\\/g;j[0]=j[0].replace(R,"/"),x=j.join(O);var T=x;if(T=T.trim(),!C&&x.split("#").length===1){var D=s.exec(T);if(D)return this.path=T,this.href=T,this.pathname=D[1],D[2]?(this.search=D[2],I?this.query=b.parse(this.search.substr(1)):this.query=this.search.substr(1)):I&&(this.search="",this.query={}),this}var H=r.exec(T);if(H){H=H[0];var U=H.toLowerCase();this.protocol=U,T=T.substr(H.length)}if(C||H||T.match(/^\/\/[^@/]+@[^@/]+/)){var ae=T.substr(0,2)==="//";ae&&!(H&&y[H])&&(T=T.substr(2),this.slashes=!0)}if(!y[H]&&(ae||H&&!m[H])){for(var J=-1,M=0;M<c.length;M++){var ce=T.indexOf(c[M]);ce!==-1&&(J===-1||ce<J)&&(J=ce)}var Q,B;J===-1?B=T.lastIndexOf("@"):B=T.lastIndexOf("@",J),B!==-1&&(Q=T.slice(0,B),T=T.slice(B+1),this.auth=decodeURIComponent(Q)),J=-1;for(var M=0;M<l.length;M++){var ce=T.indexOf(l[M]);ce!==-1&&(J===-1||ce<J)&&(J=ce)}J===-1&&(J=T.length),this.host=T.slice(0,J),T=T.slice(J),this.parseHost(),this.hostname=this.hostname||"";var N=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!N)for(var Y=this.hostname.split(/\./),M=0,ue=Y.length;M<ue;M++){var X=Y[M];if(X&&!X.match(d)){for(var we="",L=0,W=X.length;L<W;L++)X.charCodeAt(L)>127?we+="x":we+=X[L];if(!we.match(d)){var le=Y.slice(0,M),$=Y.slice(M+1),ee=X.match(f);ee&&(le.push(ee[1]),$.unshift(ee[2])),$.length&&(T="/"+$.join(".")+T),this.hostname=le.join(".");break}}}this.hostname.length>u?this.hostname="":this.hostname=this.hostname.toLowerCase(),N||(this.hostname=e.toASCII(this.hostname));var ne=this.port?":"+this.port:"",me=this.hostname||"";this.host=me+ne,this.href+=this.host,N&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),T[0]!=="/"&&(T="/"+T))}if(!h[U])for(var M=0,ue=a.length;M<ue;M++){var pe=a[M];if(T.indexOf(pe)!==-1){var G=encodeURIComponent(pe);G===pe&&(G=escape(pe)),T=T.split(pe).join(G)}}var ie=T.indexOf("#");ie!==-1&&(this.hash=T.substr(ie),T=T.slice(0,ie));var he=T.indexOf("?");if(he!==-1?(this.search=T.substr(he),this.query=T.substr(he+1),I&&(this.query=b.parse(this.query)),T=T.slice(0,he)):I&&(this.search="",this.query={}),T&&(this.pathname=T),m[U]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var ne=this.pathname||"",be=this.search||"";this.path=ne+be}return this.href=this.format(),this};function g(x){return typeof x=="string"&&(x=S(x)),x instanceof t?x.format():t.prototype.format.call(x)}t.prototype.format=function(){var x=this.auth||"";x&&(x=encodeURIComponent(x),x=x.replace(/%3A/i,":"),x+="@");var I=this.protocol||"",C=this.pathname||"",A=this.hash||"",O=!1,j="";this.host?O=x+this.host:this.hostname&&(O=x+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(O+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(j=b.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var R=this.search||j&&"?"+j||"";return I&&I.substr(-1)!==":"&&(I+=":"),this.slashes||(!I||m[I])&&O!==!1?(O="//"+(O||""),C&&C.charAt(0)!=="/"&&(C="/"+C)):O||(O=""),A&&A.charAt(0)!=="#"&&(A="#"+A),R&&R.charAt(0)!=="?"&&(R="?"+R),C=C.replace(/[?#]/g,function(T){return encodeURIComponent(T)}),R=R.replace("#","%23"),I+O+C+R+A};function w(x,I){return S(x,!1,!0).resolve(I)}t.prototype.resolve=function(x){return this.resolveObject(S(x,!1,!0)).format()};function _(x,I){return x?S(x,!1,!0).resolveObject(I):I}return t.prototype.resolveObject=function(x){if(typeof x=="string"){var I=new t;I.parse(x,!1,!0),x=I}for(var C=new t,A=Object.keys(this),O=0;O<A.length;O++){var j=A[O];C[j]=this[j]}if(C.hash=x.hash,x.href==="")return C.href=C.format(),C;if(x.slashes&&!x.protocol){for(var R=Object.keys(x),T=0;T<R.length;T++){var D=R[T];D!=="protocol"&&(C[D]=x[D])}return m[C.protocol]&&C.hostname&&!C.pathname&&(C.pathname="/",C.path=C.pathname),C.href=C.format(),C}if(x.protocol&&x.protocol!==C.protocol){if(!m[x.protocol]){for(var H=Object.keys(x),U=0;U<H.length;U++){var ae=H[U];C[ae]=x[ae]}return C.href=C.format(),C}if(C.protocol=x.protocol,!x.host&&!y[x.protocol]){for(var ue=(x.pathname||"").split("/");ue.length&&!(x.host=ue.shift()););x.host||(x.host=""),x.hostname||(x.hostname=""),ue[0]!==""&&ue.unshift(""),ue.length<2&&ue.unshift(""),C.pathname=ue.join("/")}else C.pathname=x.pathname;if(C.search=x.search,C.query=x.query,C.host=x.host||"",C.auth=x.auth,C.hostname=x.hostname||x.host,C.port=x.port,C.pathname||C.search){var J=C.pathname||"",M=C.search||"";C.path=J+M}return C.slashes=C.slashes||x.slashes,C.href=C.format(),C}var ce=C.pathname&&C.pathname.charAt(0)==="/",Q=x.host||x.pathname&&x.pathname.charAt(0)==="/",B=Q||ce||C.host&&x.pathname,N=B,Y=C.pathname&&C.pathname.split("/")||[],ue=x.pathname&&x.pathname.split("/")||[],X=C.protocol&&!m[C.protocol];if(X&&(C.hostname="",C.port=null,C.host&&(Y[0]===""?Y[0]=C.host:Y.unshift(C.host)),C.host="",x.protocol&&(x.hostname=null,x.port=null,x.host&&(ue[0]===""?ue[0]=x.host:ue.unshift(x.host)),x.host=null),B=B&&(ue[0]===""||Y[0]==="")),Q)C.host=x.host||x.host===""?x.host:C.host,C.hostname=x.hostname||x.hostname===""?x.hostname:C.hostname,C.search=x.search,C.query=x.query,Y=ue;else if(ue.length)Y||(Y=[]),Y.pop(),Y=Y.concat(ue),C.search=x.search,C.query=x.query;else if(x.search!=null){if(X){C.host=Y.shift(),C.hostname=C.host;var we=C.host&&C.host.indexOf("@")>0?C.host.split("@"):!1;we&&(C.auth=we.shift(),C.hostname=we.shift(),C.host=C.hostname)}return C.search=x.search,C.query=x.query,(C.pathname!==null||C.search!==null)&&(C.path=(C.pathname?C.pathname:"")+(C.search?C.search:"")),C.href=C.format(),C}if(!Y.length)return C.pathname=null,C.search?C.path="/"+C.search:C.path=null,C.href=C.format(),C;for(var L=Y.slice(-1)[0],W=(C.host||x.host||Y.length>1)&&(L==="."||L==="..")||L==="",le=0,$=Y.length;$>=0;$--)L=Y[$],L==="."?Y.splice($,1):L===".."?(Y.splice($,1),le++):le&&(Y.splice($,1),le--);if(!B&&!N)for(;le--;le)Y.unshift("..");B&&Y[0]!==""&&(!Y[0]||Y[0].charAt(0)!=="/")&&Y.unshift(""),W&&Y.join("/").substr(-1)!=="/"&&Y.push("");var ee=Y[0]===""||Y[0]&&Y[0].charAt(0)==="/";if(X){C.hostname=ee?"":Y.length?Y.shift():"",C.host=C.hostname;var we=C.host&&C.host.indexOf("@")>0?C.host.split("@"):!1;we&&(C.auth=we.shift(),C.hostname=we.shift(),C.host=C.hostname)}return B=B||C.host&&Y.length,B&&!ee&&Y.unshift(""),Y.length>0?C.pathname=Y.join("/"):(C.pathname=null,C.path=null),(C.pathname!==null||C.search!==null)&&(C.path=(C.pathname?C.pathname:"")+(C.search?C.search:"")),C.auth=x.auth||C.auth,C.slashes=C.slashes||x.slashes,C.href=C.format(),C},t.prototype.parseHost=function(){var x=this.host,I=n.exec(x);I&&(I=I[0],I!==":"&&(this.port=I.substr(1)),x=x.substr(0,x.length-I.length)),x&&(this.hostname=x)},Sr.parse=S,Sr.resolve=w,Sr.resolveObject=_,Sr.format=g,Sr.Url=t,Sr}function Vg(e){if(typeof e=="string")e=new URL(e);else if(!(e instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(e.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return es?NE(e):RE(e)}function NE(e){let t=e.hostname,r=e.pathname;for(let n=0;n<r.length;n++)if(r[n]==="%"){let s=r.codePointAt(n+2)||32;if(r[n+1]==="2"&&s===102||r[n+1]==="5"&&s===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(sm,"\\"),r=decodeURIComponent(r),t!=="")return`\\\\${t}${r}`;{let n=r.codePointAt(1)|32,s=r[2];if(n<om||n>im||s!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}function RE(e){if(e.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let t=e.pathname;for(let r=0;r<t.length;r++)if(t[r]==="%"){let n=t.codePointAt(r+2)||32;if(t[r+1]==="2"&&n===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(t)}function Kg(e){let t=Ac.resolve(e),r=e.charCodeAt(e.length-1);(r===nm||es&&r===rm)&&t[t.length-1]!==Ac.sep&&(t+="/");let n=new URL("file://");return t.includes("%")&&(t=t.replace(am,"%25")),!es&&t.includes("\\")&&(t=t.replace(lm,"%5C")),t.includes(`
|
|
233
|
+
`)&&(t=t.replace(cm,"%0A")),t.includes("\r")&&(t=t.replace(um,"%0D")),t.includes(" ")&&(t=t.replace(dm,"%09")),n.pathname=t,n}var Gg,Vi,Ic,Ki,Gi,Tc,Yi,jc,Ji,Oc,Qi,Pc,Xi,Nc,Zi,Rc,Sr,Mc,St,Yg,Jg,Qg,Xg,Zg,em,tm,rm,nm,om,im,es,sm,am,lm,cm,um,dm,ME=Ct(()=>{xe(),Se(),_e(),XS(),pE(),AE(),$g(),Gg=Object.freeze(Object.create(null)),Vi={},Ic=!1,Ki=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Gi={},Tc=!1,Yi={},jc=!1,Ji={},Oc=!1,Qi={},Pc=!1,Xi={},Nc=!1,Zi={},Rc=!1,Sr={},Mc=!1,St=PE(),St.parse,St.resolve,St.resolveObject,St.format,St.Url,Yg=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0,St.URL=typeof URL<"u"?URL:null,St.pathToFileURL=Kg,St.fileURLToPath=Vg,Jg=St.Url,Qg=St.format,Xg=St.resolve,Zg=St.resolveObject,em=St.parse,tm=St.URL,rm=92,nm=47,om=97,im=122,es=Yg==="win32",sm=/\//g,am=/%/g,lm=/\\/g,cm=/\n/g,um=/\r/g,dm=/\t/g}),DE=Ce((e,t)=>{xe(),Se(),_e(),t.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}),Dc=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"__esModule",{value:!0}),e.BufferedDuplex=void 0,e.writev=n;var t=Ur(),r=(vt(),nt(yt));function n(o,i){let a=new Array(o.length);for(let l=0;l<o.length;l++)typeof o[l].chunk=="string"?a[l]=r.Buffer.from(o[l].chunk,"utf8"):a[l]=o[l].chunk;this._write(r.Buffer.concat(a),"binary",i)}var s=class extends t.Duplex{constructor(i,a,l){super({objectMode:!0});Ne(this,"socket");Ne(this,"proxy");Ne(this,"isSocketOpen");Ne(this,"writeQueue");this.proxy=a,this.socket=l,this.writeQueue=[],i.objectMode||(this._writev=n.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",c=>{!this.destroyed&&this.readable&&this.push(c)})}_read(i){this.proxy.read(i)}_write(i,a,l){this.isSocketOpen?this.writeToProxy(i,a,l):this.writeQueue.push({chunk:i,encoding:a,cb:l})}_final(i){this.writeQueue=[],this.proxy.end(i)}_destroy(i,a){this.writeQueue=[],this.proxy.destroy(),a(i)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(i,a,l){this.proxy.write(i,a)===!1?this.proxy.once("drain",l):l()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:i,encoding:a,cb:l}=this.writeQueue.shift();this.writeToProxy(i,a,l)}}};e.BufferedDuplex=s}),ts=Ce(e=>{xe(),Se(),_e();var t=e&&e.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.streamBuilder=e.browserStreamBuilder=void 0;var r=(vt(),nt(yt)),n=t(DE()),s=t(nr()),o=Ur(),i=t(Ti()),a=Dc(),l=(0,s.default)("mqttjs:ws"),c=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function u(S,g){let w=`${S.protocol}://${S.hostname}:${S.port}${S.path}`;return typeof S.transformWsUrl=="function"&&(w=S.transformWsUrl(w,S,g)),w}function d(S){let g=S;return S.port||(S.protocol==="wss"?g.port=443:g.port=80),S.path||(g.path="/"),S.wsOptions||(g.wsOptions={}),!i.default&&!S.forceNativeWebSocket&&S.protocol==="wss"&&c.forEach(w=>{Object.prototype.hasOwnProperty.call(S,w)&&!Object.prototype.hasOwnProperty.call(S.wsOptions,w)&&(g.wsOptions[w]=S[w])}),g}function f(S){let g=d(S);if(g.hostname||(g.hostname=g.host),!g.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let w=new URL(document.URL);g.hostname=w.hostname,g.port||(g.port=Number(w.port))}return g.objectMode===void 0&&(g.objectMode=!(g.binary===!0||g.binary===void 0)),g}function h(S,g,w){l("createWebSocket"),l(`protocol: ${w.protocolId} ${w.protocolVersion}`);let _=w.protocolId==="MQIsdp"&&w.protocolVersion===3?"mqttv3.1":"mqtt";l(`creating new Websocket for url: ${g} and protocol: ${_}`);let x;return w.createWebsocket?x=w.createWebsocket(g,[_],w):x=new n.default(g,[_],w.wsOptions),x}function y(S,g){let w=g.protocolId==="MQIsdp"&&g.protocolVersion===3?"mqttv3.1":"mqtt",_=u(g,S),x;return g.createWebsocket?x=g.createWebsocket(_,[w],g):x=new WebSocket(_,[w]),x.binaryType="arraybuffer",x}var m=(S,g)=>{l("streamBuilder");let w=d(g);w.hostname=w.hostname||w.host||"localhost";let _=u(w,S),x=h(S,_,w),I=n.default.createWebSocketStream(x,w.wsOptions);return I.url=_,x.on("close",()=>{I.destroy()}),I};e.streamBuilder=m;var b=(S,g)=>{l("browserStreamBuilder");let w,_=f(g).browserBufferSize||1024*512,x=g.browserBufferTimeout||1e3,I=!g.objectMode,C=y(S,g),A=j(g,U,ae);g.objectMode||(A._writev=a.writev.bind(A)),A.on("close",()=>{C.close()});let O=typeof C.addEventListener<"u";C.readyState===C.OPEN?(w=A,w.socket=C):(w=new a.BufferedDuplex(g,A,C),O?C.addEventListener("open",R):C.onopen=R),O?(C.addEventListener("close",T),C.addEventListener("error",D),C.addEventListener("message",H)):(C.onclose=T,C.onerror=D,C.onmessage=H);function j(J,M,ce){let Q=new o.Transform({objectMode:J.objectMode});return Q._write=M,Q._flush=ce,Q}function R(){l("WebSocket onOpen"),w instanceof a.BufferedDuplex&&w.socketReady()}function T(J){l("WebSocket onClose",J),w.end(),w.destroy()}function D(J){l("WebSocket onError",J);let M=new Error("WebSocket error");M.event=J,w.destroy(M)}async function H(J){if(!A||!A.readable||!A.writable)return;let{data:M}=J;M instanceof ArrayBuffer?M=r.Buffer.from(M):M instanceof Blob?M=r.Buffer.from(await new Response(M).arrayBuffer()):M=r.Buffer.from(M,"utf8"),A.push(M)}function U(J,M,ce){if(C.bufferedAmount>_){setTimeout(U,x,J,M,ce);return}I&&typeof J=="string"&&(J=r.Buffer.from(J,"utf8"));try{C.send(J)}catch(Q){return ce(Q)}ce()}function ae(J){C.close(),J()}return w};e.browserStreamBuilder=b}),Lc={};bn(Lc,{Server:()=>ut,Socket:()=>ut,Stream:()=>ut,_createServerHandle:()=>ut,_normalizeArgs:()=>ut,_setSimultaneousAccepts:()=>ut,connect:()=>ut,createConnection:()=>ut,createServer:()=>ut,default:()=>fm,isIP:()=>ut,isIPv4:()=>ut,isIPv6:()=>ut});function ut(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}var fm,hm=Ct(()=>{xe(),Se(),_e(),fm={_createServerHandle:ut,_normalizeArgs:ut,_setSimultaneousAccepts:ut,connect:ut,createConnection:ut,createServer:ut,isIP:ut,isIPv4:ut,isIPv6:ut,Server:ut,Socket:ut,Stream:ut}}),pm=Ce((e,t)=>{xe(),Se(),_e(),t.exports={}}),gm=Ce(e=>{xe(),Se(),_e();var t=e&&e.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0});var r=t((hm(),nt(Lc))),n=t(nr()),s=t(pm()),o=(0,n.default)("mqttjs:tcp"),i=(a,l)=>{if(l.port=l.port||1883,l.hostname=l.hostname||l.host||"localhost",l.socksProxy)return(0,s.default)(l.hostname,l.port,l.socksProxy,{timeout:l.socksTimeout});let{port:c,path:u}=l,d=l.hostname;return o("port %d and host %s",c,d),r.default.createConnection({port:c,host:d,path:u})};e.default=i}),mm={};bn(mm,{default:()=>bm});var bm,LE=Ct(()=>{xe(),Se(),_e(),bm={}}),ym=Ce(e=>{xe(),Se(),_e();var t=e&&e.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0});var r=(LE(),nt(mm)),n=t((hm(),nt(Lc))),s=t(nr()),o=t(pm()),i=(0,s.default)("mqttjs:tls");function a(c){let{host:u,port:d,socksProxy:f,...h}=c;if(f!==void 0){let y=(0,o.default)(u,d,f,{timeout:c.socksTimeout});return(0,r.connect)({...h,socket:y})}return(0,r.connect)(c)}var l=(c,u)=>{u.port=u.port||8883,u.host=u.hostname||u.host||"localhost",n.default.isIP(u.host)===0&&(u.servername=u.host),u.rejectUnauthorized=u.rejectUnauthorized!==!1,delete u.path,i("port %d host %s rejectUnauthorized %b",u.port,u.host,u.rejectUnauthorized);let d=a(u);d.on("secureConnect",()=>{u.rejectUnauthorized&&!d.authorized?d.emit("error",new Error("TLS not authorized")):d.removeListener("error",f)});function f(h){u.rejectUnauthorized&&c.emit("error",h),d.end()}return d.on("error",f),d};e.default=l}),vm=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"__esModule",{value:!0});var t=(vt(),nt(yt)),r=Ur(),n=Dc(),s,o,i;function a(){let f=new r.Transform;return f._write=(h,y,m)=>{s.send({data:h.buffer,success(){m()},fail(b){m(new Error(b))}})},f._flush=h=>{s.close({success(){h()}})},f}function l(f){f.hostname||(f.hostname="localhost"),f.path||(f.path="/"),f.wsOptions||(f.wsOptions={})}function c(f,h){let y=f.protocol==="wxs"?"wss":"ws",m=`${y}://${f.hostname}${f.path}`;return f.port&&f.port!==80&&f.port!==443&&(m=`${y}://${f.hostname}:${f.port}${f.path}`),typeof f.transformWsUrl=="function"&&(m=f.transformWsUrl(m,f,h)),m}function u(){s.onOpen(()=>{i.socketReady()}),s.onMessage(f=>{let{data:h}=f;h instanceof ArrayBuffer?h=t.Buffer.from(h):h=t.Buffer.from(h,"utf8"),o.push(h)}),s.onClose(()=>{i.emit("close"),i.end(),i.destroy()}),s.onError(f=>{let h=new Error(f.errMsg);i.destroy(h)})}var d=(f,h)=>{if(h.hostname=h.hostname||h.host,!h.hostname)throw new Error("Could not determine host. Specify host manually.");let y=h.protocolId==="MQIsdp"&&h.protocolVersion===3?"mqttv3.1":"mqtt";l(h);let m=c(h,f);s=wx.connectSocket({url:m,protocols:[y]}),o=a(),i=new n.BufferedDuplex(h,o,s),i._destroy=(S,g)=>{s.close({success(){g&&g(S)}})};let b=i.destroy;return i.destroy=(S,g)=>(i.destroy=b,setTimeout(()=>{s.close({fail(){i._destroy(S,g)}})},0),i),u(),i};e.default=d}),wm=Ce(e=>{xe(),Se(),_e(),Object.defineProperty(e,"__esModule",{value:!0});var t=(vt(),nt(yt)),r=Ur(),n=Dc(),s,o,i,a=!1;function l(){let h=new r.Transform;return h._write=(y,m,b)=>{s.sendSocketMessage({data:y.buffer,success(){b()},fail(){b(new Error)}})},h._flush=y=>{s.closeSocket({success(){y()}})},h}function c(h){h.hostname||(h.hostname="localhost"),h.path||(h.path="/"),h.wsOptions||(h.wsOptions={})}function u(h,y){let m=h.protocol==="alis"?"wss":"ws",b=`${m}://${h.hostname}${h.path}`;return h.port&&h.port!==80&&h.port!==443&&(b=`${m}://${h.hostname}:${h.port}${h.path}`),typeof h.transformWsUrl=="function"&&(b=h.transformWsUrl(b,h,y)),b}function d(){a||(a=!0,s.onSocketOpen(()=>{i.socketReady()}),s.onSocketMessage(h=>{if(typeof h.data=="string"){let y=t.Buffer.from(h.data,"base64");o.push(y)}else{let y=new FileReader;y.addEventListener("load",()=>{if(y.result instanceof ArrayBuffer){o.push(t.Buffer.from(y.result));return}o.push(t.Buffer.from(y.result,"utf-8"))}),y.readAsArrayBuffer(h.data)}}),s.onSocketClose(()=>{i.end(),i.destroy()}),s.onSocketError(h=>{i.destroy(h)}))}var f=(h,y)=>{if(y.hostname=y.hostname||y.host,!y.hostname)throw new Error("Could not determine host. Specify host manually.");let m=y.protocolId==="MQIsdp"&&y.protocolVersion===3?"mqttv3.1":"mqtt";c(y);let b=u(y,h);return s=y.my,s.connectSocket({url:b,protocols:m}),o=l(),i=new n.BufferedDuplex(y,o,s),d(),i};e.default=f}),zE=Ce(e=>{xe(),Se(),_e();var t=e&&e.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.connectAsync=u;var r=t(nr()),n=t((ME(),nt(qg))),s=t(Wl()),o=t(Ti());typeof(et==null?void 0:et.nextTick)!="function"&&(et.nextTick=setImmediate);var i=(0,r.default)("mqttjs"),a=null;function l(d){let f;if(d.auth)if(f=d.auth.match(/^(.+):(.+)$/),f){let[,h,y]=f;d.username=h,d.password=y}else d.username=d.auth}function c(d,f){var m,b,S;if(i("connecting to an MQTT broker..."),typeof d=="object"&&!f&&(f=d,d=""),f=f||{},d&&typeof d=="string"){let g=n.default.parse(d,!0),w={};if(g.port!=null&&(w.port=Number(g.port)),w.host=g.hostname,w.query=g.query,w.auth=g.auth,w.protocol=g.protocol,w.path=g.path,f={...w,...f},!f.protocol)throw new Error("Missing protocol");f.protocol=f.protocol.replace(/:$/,"")}if(f.unixSocket=f.unixSocket||((m=f.protocol)==null?void 0:m.includes("+unix")),f.unixSocket?f.protocol=f.protocol.replace("+unix",""):!((b=f.protocol)!=null&&b.startsWith("ws"))&&!((S=f.protocol)!=null&&S.startsWith("wx"))&&delete f.path,l(f),f.query&&typeof f.query.clientId=="string"&&(f.clientId=f.query.clientId),o.default||f.unixSocket?f.socksProxy=void 0:f.socksProxy===void 0&&typeof et<"u"&&(f.socksProxy=et.env.MQTTJS_SOCKS_PROXY),f.cert&&f.key)if(f.protocol){if(["mqtts","wss","wxs","alis"].indexOf(f.protocol)===-1)switch(f.protocol){case"mqtt":f.protocol="mqtts";break;case"ws":f.protocol="wss";break;case"wx":f.protocol="wxs";break;case"ali":f.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${f.protocol}"!`)}}else throw new Error("Missing secure protocol key");if(a||(a={},!o.default&&!f.forceNativeWebSocket?(a.ws=ts().streamBuilder,a.wss=ts().streamBuilder,a.mqtt=gm().default,a.tcp=gm().default,a.ssl=ym().default,a.tls=a.ssl,a.mqtts=ym().default):(a.ws=ts().browserStreamBuilder,a.wss=ts().browserStreamBuilder,a.wx=vm().default,a.wxs=vm().default,a.ali=wm().default,a.alis=wm().default)),!a[f.protocol]){let g=["mqtts","wss"].indexOf(f.protocol)!==-1;f.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((w,_)=>g&&_%2===0?!1:typeof a[w]=="function")[0]}if(f.clean===!1&&!f.clientId)throw new Error("Missing clientId for unclean clients");f.protocol&&(f.defaultProtocol=f.protocol);function h(g){return f.servers&&((!g._reconnectCount||g._reconnectCount===f.servers.length)&&(g._reconnectCount=0),f.host=f.servers[g._reconnectCount].host,f.port=f.servers[g._reconnectCount].port,f.protocol=f.servers[g._reconnectCount].protocol?f.servers[g._reconnectCount].protocol:f.defaultProtocol,f.hostname=f.host,g._reconnectCount++),i("calling streambuilder for",f.protocol),a[f.protocol](g,f)}let y=new s.default(h,f);return y.on("error",()=>{}),y}function u(d,f,h=!0){return new Promise((y,m)=>{let b=c(d,f),S={connect:w=>{g(),y(b)},end:()=>{g(),y(b)},error:w=>{g(),b.end(),m(w)}};h===!1&&(S.close=()=>{S.error(new Error("Couldn't connect to server"))});function g(){Object.keys(S).forEach(w=>{b.off(w,S[w])})}Object.keys(S).forEach(w=>{b.on(w,S[w])})})}e.default=c}),xm=Ce(e=>{xe(),Se(),_e();var t=e&&e.__createBinding||(Object.create?(function(h,y,m,b){b===void 0&&(b=m);var S=Object.getOwnPropertyDescriptor(y,m);(!S||("get"in S?!y.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return y[m]}}),Object.defineProperty(h,b,S)}):(function(h,y,m,b){b===void 0&&(b=m),h[b]=y[m]})),r=e&&e.__setModuleDefault||(Object.create?(function(h,y){Object.defineProperty(h,"default",{enumerable:!0,value:y})}):function(h,y){h.default=y}),n=e&&e.__importStar||(function(){var h=function(y){return h=Object.getOwnPropertyNames||function(m){var b=[];for(var S in m)Object.prototype.hasOwnProperty.call(m,S)&&(b[b.length]=S);return b},h(y)};return function(y){if(y&&y.__esModule)return y;var m={};if(y!=null)for(var b=h(y),S=0;S<b.length;S++)b[S]!=="default"&&t(m,y,b[S]);return r(m,y),m}})(),s=e&&e.__exportStar||function(h,y){for(var m in h)m!=="default"&&!Object.prototype.hasOwnProperty.call(y,m)&&t(y,h,m)},o=e&&e.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=e.KeepaliveManager=e.UniqueMessageIdProvider=e.DefaultMessageIdProvider=e.Store=e.MqttClient=e.connectAsync=e.connect=e.Client=void 0;var i=o(Wl());e.MqttClient=i.default;var a=o(Ip());e.DefaultMessageIdProvider=a.default;var l=o(JS());e.UniqueMessageIdProvider=l.default;var c=o(xp());e.Store=c.default;var u=n(zE());e.connect=u.default,Object.defineProperty(e,"connectAsync",{enumerable:!0,get:function(){return u.connectAsync}});var d=o(Mp());e.KeepaliveManager=d.default,e.Client=i.default,s(Wl(),e),s(xn(),e),s(wp(),e);var f=Ci();Object.defineProperty(e,"ReasonCodes",{enumerable:!0,get:function(){return f.ReasonCodes}})}),BE=Ce(e=>{xe(),Se(),_e();var t=e&&e.__createBinding||(Object.create?(function(i,a,l,c){c===void 0&&(c=l);var u=Object.getOwnPropertyDescriptor(a,l);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return a[l]}}),Object.defineProperty(i,c,u)}):(function(i,a,l,c){c===void 0&&(c=l),i[c]=a[l]})),r=e&&e.__setModuleDefault||(Object.create?(function(i,a){Object.defineProperty(i,"default",{enumerable:!0,value:a})}):function(i,a){i.default=a}),n=e&&e.__importStar||(function(){var i=function(a){return i=Object.getOwnPropertyNames||function(l){var c=[];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(c[c.length]=u);return c},i(a)};return function(a){if(a&&a.__esModule)return a;var l={};if(a!=null)for(var c=i(a),u=0;u<c.length;u++)c[u]!=="default"&&t(l,a,c[u]);return r(l,a),l}})(),s=e&&e.__exportStar||function(i,a){for(var l in i)l!=="default"&&!Object.prototype.hasOwnProperty.call(a,l)&&t(a,i,l)};Object.defineProperty(e,"__esModule",{value:!0});var o=n(xm());e.default=o,s(xm(),e)});const UE=BE();/*! Bundled license information:
|
|
234
|
+
|
|
235
|
+
@jspm/core/nodelibs/browser/chunk-DtuTasat.js:
|
|
236
|
+
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
237
|
+
|
|
238
|
+
safe-buffer/index.js:
|
|
239
|
+
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
240
|
+
|
|
241
|
+
@babel/runtime/helpers/regenerator.js:
|
|
242
|
+
(*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE *)
|
|
243
|
+
*/function zc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function _m(e){return e==null?e:JSON.parse(JSON.stringify(e))}function Sm(){if(typeof window>"u")return null;const e=window;return e.__olonWebMcpTools__||(e.__olonWebMcpTools__=new Map),e.__olonWebMcpTools__}const lo="update-section-draft",rs="save-project-state";function Em(){return{type:"object",additionalProperties:!1,properties:{slug:{type:"string"},sectionId:{type:"string",description:"The unique ID of the section to update (found via data-jp-section-id or MCP read)."},sectionType:{type:"string",description:'The type of the section being updated (e.g. "olon-hero"). Used to pick the correct validation schema.'},scope:{type:"string",enum:["local","global"],default:"local"},data:{type:"object",description:"Full replacement payload validated against the section's schema."},itemPath:{type:"array",description:"Optional root-to-leaf path for targeted field updates.",items:{type:"object",additionalProperties:!1,properties:{fieldKey:{type:"string"},itemId:{type:"string"}},required:["fieldKey"]}},fieldKey:{type:"string",description:"Shorthand for a top-level scalar field update when itemPath is omitted."},value:{description:"Value written to the targeted field or array item."}},required:["sectionId"],oneOf:[{required:["data"]},{required:["itemPath","value"]},{required:["fieldKey","value"]}]}}function km(){return{type:"object",additionalProperties:!1,properties:{message:{type:"string",description:"Optional save reason or commit message equivalent."}}}}function Bc(e,t,r){if(t.length===0)throw new Error("Selection path is empty.");const n=_m(e);let s=n;for(let o=0;o<t.length;o+=1){const i=t[o],a=o===t.length-1;if(!zc(s))throw new Error(`Cannot navigate path segment "${i.fieldKey}" on a non-object value.`);if(i.itemId!=null){const l=s[i.fieldKey];if(!Array.isArray(l))throw new Error(`Field "${i.fieldKey}" is not an array.`);const c=l.findIndex(u=>zc(u)&&String(u.id??"")===String(i.itemId));if(c===-1)throw new Error(`Array item "${i.itemId}" not found under "${i.fieldKey}".`);if(a)return l[c]=r,n;s=l[c];continue}if(a)return s[i.fieldKey]=r,n;s=s[i.fieldKey]}return n}function Uc(e,t){if(t.data&&zc(t.data))return _m(t.data);if(Array.isArray(t.itemPath)&&t.itemPath.length>0)return Bc(e,t.itemPath,t.value);if(typeof t.fieldKey=="string"&&t.fieldKey.trim().length>0)return Bc(e,[{fieldKey:t.fieldKey}],t.value);throw new Error('WebMCP mutation requires either "data", "itemPath", or "fieldKey".')}async function Am(e){if(e.startsWith("olon://pages/")){const t=e.replace("olon://pages/",""),r=window.location.pathname.replace(/\/admin(\/.*)?$/,"").replace(/\/$/,""),n=await fetch(`${r}/pages/${t}.json`);if(!n.ok)throw new Error(`Resource not found: ${e} (at ${r}/pages/${t}.json)`);return await n.json()}throw new Error(`Unsupported URI scheme: ${e}`)}function ns(){if(typeof window>"u"||typeof navigator>"u")return;const e=Sm();if(!e)return;const t=navigator;t.modelContext||(t.modelContext={}),t.modelContext.registerTool=function(r){e.set(r.name,r)},t.modelContext.unregisterTool=function(r){e.delete(r)},t.modelContext.readResource=Am,t.modelContextProtocol||(t.modelContextProtocol={}),t.modelContextProtocol.listTools=function(){return Array.from(e.values()).map(({execute:r,...n})=>n)},t.modelContextProtocol.executeTool=async function(r,n){const s=e.get(r);if(!s)throw new Error(`Unknown WebMCP tool: ${r}`);const o=n?JSON.parse(n):{},i=await s.execute(o);return JSON.stringify(i)},t.modelContextProtocol.readResource=async function(r){const n=await Am(r);return JSON.stringify(n)}}function Fc(e){var n,s;if(typeof navigator>"u")return()=>{};ns();const t=navigator,r=Sm();return!t.modelContext||!r?()=>{}:((s=(n=t.modelContext).registerTool)==null||s.call(n,e),r.set(e.name,e),()=>{var o,i;r.delete(e.name),(i=(o=t.modelContext)==null?void 0:o.unregisterTool)==null||i.call(o,e.name)})}function FE(e){if(typeof window>"u")return{emitUpdate:()=>{},disconnect:()=>{}};const t=UE.connect("wss://broker.emqx.io:8084/mqtt",{clientId:"olonjs-browser-"+Math.random().toString(16).substring(2,8)}),r=window.location.hostname,n=`olonjs/mcp/req/${r}`,s=`olonjs/mcp/res/${r}`;return t.on("connect",()=>{console.debug(`[OlonJs WebMCP] P2P Cloud Connected. Listening on: ${n}`),t.subscribe(n)}),t.on("message",async(a,l)=>{if(a===n)try{const c=JSON.parse(l.toString()),u=navigator.modelContextProtocol;if(!u){console.warn("[OlonJs WebMCP] Request received but WebMCP is not initialized.");return}if(c.type==="LIST_TOOLS"){const d=u.listTools();t.publish(s,JSON.stringify({id:c.id,result:d}))}if(c.type==="EXECUTE_TOOL")try{const d=await u.executeTool(c.name,c.args);t.publish(s,JSON.stringify({id:c.id,result:d}))}catch(d){t.publish(s,JSON.stringify({id:c.id,error:d.message||"Execute Error"}))}if(c.type==="READ_RESOURCE")try{const d=await u.readResource(c.uri);t.publish(s,JSON.stringify({id:c.id,result:d}))}catch(d){t.publish(s,JSON.stringify({id:c.id,error:d.message||"Read Error"}))}}catch(c){console.warn("[OlonJs WebMCP] Failed to process P2P message",c)}}),t.on("error",a=>{console.warn("[OlonJs WebMCP] Cloud P2P connection error",a)}),{emitUpdate:(a,l)=>{},disconnect:()=>{t.end()}}}const WE='/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-900:oklch(39.6% .141 25.723);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-200:oklch(92% .004 286.32);--color-zinc-300:oklch(87.1% .006 286.286);--color-zinc-400:oklch(70.5% .015 286.067);--color-zinc-500:oklch(55.2% .016 285.938);--color-zinc-600:oklch(44.2% .017 285.786);--color-zinc-700:oklch(37% .013 285.805);--color-zinc-800:oklch(27.4% .006 286.033);--color-zinc-900:oklch(21% .006 285.885);--color-zinc-950:oklch(14.1% .005 285.823);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-black:900;--tracking-tight:-.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-background:var(--background);--color-foreground:var(--foreground);--color-primary:var(--primary);--color-primary-foreground:var(--primary-foreground);--color-destructive:var(--destructive);--color-ring:var(--ring)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border)}body{background-color:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.left-1\\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-3{left:calc(var(--spacing)*3)}.z-0{z-index:0}.z-10{z-index:10}.z-50,.z-\\[50\\]{z-index:50}.z-\\[60\\]{z-index:60}.z-\\[70\\]{z-index:70}.z-\\[100\\]{z-index:100}.z-\\[9998\\]{z-index:9998}.z-\\[9999\\]{z-index:9999}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-4{margin:calc(var(--spacing)*4)}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-1\\.5{margin-inline:calc(var(--spacing)*1.5)}.mx-2{margin-inline:calc(var(--spacing)*2)}.mx-3{margin-inline:calc(var(--spacing)*3)}.my-1{margin-block:calc(var(--spacing)*1)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.aspect-\\[4\\/3\\]{aspect-ratio:4/3}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.h-1\\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-3\\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-20{height:calc(var(--spacing)*20)}.h-40{height:calc(var(--spacing)*40)}.h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-screen{height:100vh}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\\[45vh\\]{max-height:45vh}.max-h-\\[85vh\\]{max-height:85vh}.max-h-\\[90vh\\]{max-height:90vh}.max-h-\\[320px\\]{max-height:320px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-16{min-height:calc(var(--spacing)*16)}.min-h-\\[18px\\]{min-height:18px}.min-h-\\[96px\\]{min-height:96px}.min-h-\\[240px\\]{min-height:240px}.min-h-screen{min-height:100vh}.w-1{width:calc(var(--spacing)*1)}.w-1\\.5{width:calc(var(--spacing)*1.5)}.w-2{width:calc(var(--spacing)*2)}.w-3{width:calc(var(--spacing)*3)}.w-3\\.5{width:calc(var(--spacing)*3.5)}.w-3\\/4{width:75%}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-7{width:calc(var(--spacing)*7)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-\\[calc\\(100\\%-2rem\\)\\]{width:calc(100% - 2rem)}.w-\\[var\\(--radix-popover-trigger-width\\)\\]{width:var(--radix-popover-trigger-width)}.w-full{width:100%}.w-px{width:1px}.w-screen{width:100vw}.max-w-2xl{max-width:var(--container-2xl)}.max-w-\\[280px\\]{max-width:280px}.max-w-\\[var\\(--inspector-width\\,280px\\)\\]{max-width:var(--inspector-width,280px)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[18px\\]{min-width:18px}.min-w-\\[156px\\]{min-width:156px}.min-w-\\[var\\(--radix-popover-trigger-width\\)\\]{min-width:var(--radix-popover-trigger-width)}.min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-0\\.5{--tw-translate-x:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-3{--tw-translate-x:calc(var(--spacing)*3);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize-none{resize:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-nowrap{flex-wrap:nowrap}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing)*0)}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-\\[var\\(--local-radius-md\\)\\]{border-radius:var(--local-radius-md)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-amber-500\\/20{border-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.border-amber-500\\/20{border-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.border-amber-500\\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\\/30{border-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.border-blue-500{border-color:var(--color-blue-500)}.border-blue-500\\/50{border-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.border-blue-500\\/50{border-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.border-blue-600{border-color:var(--color-blue-600)}.border-emerald-500\\/60{border-color:#00bb7f99}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\\/60{border-color:color-mix(in oklab,var(--color-emerald-500)60%,transparent)}}.border-primary{border-color:var(--color-primary)}.border-red-500\\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\\/20{border-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.border-red-500\\/50{border-color:#fb2c3680}@supports (color:color-mix(in lab,red,red)){.border-red-500\\/50{border-color:color-mix(in oklab,var(--color-red-500)50%,transparent)}}.border-red-900\\/30{border-color:#82181a4d}@supports (color:color-mix(in lab,red,red)){.border-red-900\\/30{border-color:color-mix(in oklab,var(--color-red-900)30%,transparent)}}.border-transparent{border-color:#0000}.border-zinc-700{border-color:var(--color-zinc-700)}.border-zinc-700\\/60{border-color:#3f3f4699}@supports (color:color-mix(in lab,red,red)){.border-zinc-700\\/60{border-color:color-mix(in oklab,var(--color-zinc-700)60%,transparent)}}.border-zinc-700\\/80{border-color:#3f3f46cc}@supports (color:color-mix(in lab,red,red)){.border-zinc-700\\/80{border-color:color-mix(in oklab,var(--color-zinc-700)80%,transparent)}}.border-zinc-800{border-color:var(--color-zinc-800)}.border-zinc-800\\/50{border-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.border-zinc-800\\/50{border-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.border-zinc-800\\/60{border-color:#27272a99}@supports (color:color-mix(in lab,red,red)){.border-zinc-800\\/60{border-color:color-mix(in oklab,var(--color-zinc-800)60%,transparent)}}.border-l-transparent{border-left-color:#0000}.bg-\\[var\\(--color-background\\)\\]{background-color:var(--color-background)}.bg-\\[var\\(--local-bg\\)\\]{background-color:var(--local-bg)}.bg-\\[var\\(--local-primary\\)\\]{background-color:var(--local-primary)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\\/5{background-color:#f99c000d}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\\/5{background-color:color-mix(in oklab,var(--color-amber-500)5%,transparent)}}.bg-amber-500\\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-background{background-color:var(--color-background)}.bg-black{background-color:var(--color-black)}.bg-black\\/0{background-color:#0000}@supports (color:color-mix(in lab,red,red)){.bg-black\\/0{background-color:color-mix(in oklab,var(--color-black)0%,transparent)}}.bg-black\\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\\/20{background-color:color-mix(in oklab,var(--color-black)20%,transparent)}}.bg-black\\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\\/30{background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\\/60{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-500\\/5{background-color:#3080ff0d}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/5{background-color:color-mix(in oklab,var(--color-blue-500)5%,transparent)}}.bg-blue-500\\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.bg-blue-500\\/15{background-color:#3080ff26}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/15{background-color:color-mix(in oklab,var(--color-blue-500)15%,transparent)}}.bg-blue-500\\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-blue-500\\/\\[0\\.04\\]{background-color:#3080ff0a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/\\[0\\.04\\]{background-color:color-mix(in oklab,var(--color-blue-500)4%,transparent)}}.bg-blue-600{background-color:var(--color-blue-600)}.bg-blue-600\\/10{background-color:#155dfc1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-600\\/10{background-color:color-mix(in oklab,var(--color-blue-600)10%,transparent)}}.bg-destructive\\/15{background-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\\/15{background-color:color-mix(in oklab,var(--color-destructive)15%,transparent)}}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-primary,.bg-primary\\/10{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\\/10{background-color:color-mix(in oklab,var(--color-primary)10%,transparent)}}.bg-primary\\/\\[0\\.08\\]{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\\/\\[0\\.08\\]{background-color:color-mix(in oklab,var(--color-primary)8%,transparent)}}.bg-red-500\\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\\/15{background-color:#fb2c3626}@supports (color:color-mix(in lab,red,red)){.bg-red-500\\/15{background-color:color-mix(in oklab,var(--color-red-500)15%,transparent)}}.bg-red-900\\/10{background-color:#82181a1a}@supports (color:color-mix(in lab,red,red)){.bg-red-900\\/10{background-color:color-mix(in oklab,var(--color-red-900)10%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/15{background-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.bg-white\\/15{background-color:color-mix(in oklab,var(--color-white)15%,transparent)}}.bg-white\\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-white\\/\\[0\\.01\\]{background-color:#ffffff03}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.01\\]{background-color:color-mix(in oklab,var(--color-white)1%,transparent)}}.bg-white\\/\\[0\\.02\\]{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.02\\]{background-color:color-mix(in oklab,var(--color-white)2%,transparent)}}.bg-white\\/\\[0\\.03\\]{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.03\\]{background-color:color-mix(in oklab,var(--color-white)3%,transparent)}}.bg-zinc-700{background-color:var(--color-zinc-700)}.bg-zinc-700\\/80{background-color:#3f3f46cc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-700\\/80{background-color:color-mix(in oklab,var(--color-zinc-700)80%,transparent)}}.bg-zinc-800{background-color:var(--color-zinc-800)}.bg-zinc-800\\/30{background-color:#27272a4d}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/30{background-color:color-mix(in oklab,var(--color-zinc-800)30%,transparent)}}.bg-zinc-800\\/50{background-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/50{background-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.bg-zinc-800\\/60{background-color:#27272a99}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/60{background-color:color-mix(in oklab,var(--color-zinc-800)60%,transparent)}}.bg-zinc-800\\/80{background-color:#27272acc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/80{background-color:color-mix(in oklab,var(--color-zinc-800)80%,transparent)}}.bg-zinc-900{background-color:var(--color-zinc-900)}.bg-zinc-900\\/20{background-color:#18181b33}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/20{background-color:color-mix(in oklab,var(--color-zinc-900)20%,transparent)}}.bg-zinc-900\\/40{background-color:#18181b66}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/40{background-color:color-mix(in oklab,var(--color-zinc-900)40%,transparent)}}.bg-zinc-900\\/50{background-color:#18181b80}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/50{background-color:color-mix(in oklab,var(--color-zinc-900)50%,transparent)}}.bg-zinc-900\\/60{background-color:#18181b99}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/60{background-color:color-mix(in oklab,var(--color-zinc-900)60%,transparent)}}.bg-zinc-950{background-color:var(--color-zinc-950)}.bg-zinc-950\\/80{background-color:#09090bcc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-950\\/80{background-color:color-mix(in oklab,var(--color-zinc-950)80%,transparent)}}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-black\\/70{--tw-gradient-from:#000000b3}@supports (color:color-mix(in lab,red,red)){.from-black\\/70{--tw-gradient-from:color-mix(in oklab,var(--color-black)70%,transparent)}}.from-black\\/70{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-black\\/80{--tw-gradient-from:#000c}@supports (color:color-mix(in lab,red,red)){.from-black\\/80{--tw-gradient-from:color-mix(in oklab,var(--color-black)80%,transparent)}}.from-black\\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-1\\.5{padding:calc(var(--spacing)*1.5)}.p-2\\.5{padding:calc(var(--spacing)*2.5)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.p-px{padding:1px}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-3\\.5{padding-inline:calc(var(--spacing)*3.5)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-7{padding-block:calc(var(--spacing)*7)}.py-8{padding-block:calc(var(--spacing)*8)}.py-10{padding-block:calc(var(--spacing)*10)}.py-12{padding-block:calc(var(--spacing)*12)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-4{padding-top:calc(var(--spacing)*4)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-1{padding-left:calc(var(--spacing)*1)}.pl-3{padding-left:calc(var(--spacing)*3)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-9{padding-left:calc(var(--spacing)*9)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[0\\.01em\\]{--tw-tracking:.01em;letter-spacing:.01em}.tracking-\\[0\\.02em\\]{--tw-tracking:.02em;letter-spacing:.02em}.tracking-\\[0\\.04em\\]{--tw-tracking:.04em;letter-spacing:.04em}.tracking-\\[0\\.05em\\]{--tw-tracking:.05em;letter-spacing:.05em}.tracking-\\[0\\.06em\\]{--tw-tracking:.06em;letter-spacing:.06em}.tracking-\\[0\\.08em\\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.whitespace-nowrap{white-space:nowrap}.text-\\[var\\(--local-bg\\)\\]{color:var(--local-bg)}.text-\\[var\\(--local-text\\)\\]{color:var(--local-text)}.text-\\[var\\(--local-text-muted\\)\\]{color:var(--local-text-muted)}.text-amber-200{color:var(--color-amber-200)}.text-amber-500{color:var(--color-amber-500)}.text-amber-500\\/70{color:#f99c00b3}@supports (color:color-mix(in lab,red,red)){.text-amber-500\\/70{color:color-mix(in oklab,var(--color-amber-500)70%,transparent)}}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-destructive{color:var(--color-destructive)}.text-emerald-400{color:var(--color-emerald-400)}.text-foreground{color:var(--color-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-red-300{color:var(--color-red-300)}.text-red-400{color:var(--color-red-400)}.text-white{color:var(--color-white)}.text-zinc-200{color:var(--color-zinc-200)}.text-zinc-300{color:var(--color-zinc-300)}.text-zinc-400{color:var(--color-zinc-400)}.text-zinc-500{color:var(--color-zinc-500)}.text-zinc-600{color:var(--color-zinc-600)}.text-zinc-600\\/50{color:#52525c80}@supports (color:color-mix(in lab,red,red)){.text-zinc-600\\/50{color:color-mix(in oklab,var(--color-zinc-600)50%,transparent)}}.text-zinc-700{color:var(--color-zinc-700)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.opacity-0{opacity:0}.opacity-10{opacity:.1}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_8px_rgba\\(245\\,158\\,11\\,0\\.5\\)\\]{--tw-shadow:0 0 8px var(--tw-shadow-color,#f59e0b80);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-black\\/30{--tw-shadow-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.shadow-black\\/30{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-black)30%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-primary\\/20{--tw-shadow-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.shadow-primary\\/20{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-primary)20%,transparent)var(--tw-shadow-alpha),transparent)}}.ring-blue-500{--tw-ring-color:var(--color-blue-500)}.ring-blue-500\\/40{--tw-ring-color:#3080ff66}@supports (color:color-mix(in lab,red,red)){.ring-blue-500\\/40{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)40%,transparent)}}.ring-zinc-800{--tw-ring-color:var(--color-zinc-800)}.ring-offset-1{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.ring-offset-zinc-900{--tw-ring-offset-color:var(--color-zinc-900)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.brightness-\\[0\\.6\\]{--tw-brightness:brightness(.6);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.brightness-\\[0\\.85\\]{--tw-brightness:brightness(.85);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition-\\[border-color\\,opacity\\]{transition-property:border-color,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[filter\\]{transition-property:filter;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\\:border-dashed:is(:where(.group):hover *){--tw-border-style:dashed;border-style:dashed}.group-hover\\:border-blue-400\\/50:is(:where(.group):hover *){border-color:#54a2ff80}@supports (color:color-mix(in lab,red,red)){.group-hover\\:border-blue-400\\/50:is(:where(.group):hover *){border-color:color-mix(in oklab,var(--color-blue-400)50%,transparent)}}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}.group-hover\\:brightness-100:is(:where(.group):hover *){--tw-brightness:brightness(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.hover\\:scale-\\[1\\.02\\]:hover{scale:1.02}.hover\\:border-blue-500\\/30:hover{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.hover\\:border-blue-500\\/30:hover{border-color:color-mix(in oklab,var(--color-blue-500)30%,transparent)}}.hover\\:border-blue-500\\/40:hover{border-color:#3080ff66}@supports (color:color-mix(in lab,red,red)){.hover\\:border-blue-500\\/40:hover{border-color:color-mix(in oklab,var(--color-blue-500)40%,transparent)}}.hover\\:border-zinc-600:hover{border-color:var(--color-zinc-600)}.hover\\:border-zinc-700:hover{border-color:var(--color-zinc-700)}.hover\\:bg-blue-500\\/\\[0\\.03\\]:hover{background-color:#3080ff08}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-blue-500\\/\\[0\\.03\\]:hover{background-color:color-mix(in oklab,var(--color-blue-500)3%,transparent)}}.hover\\:bg-blue-600\\/20:hover{background-color:#155dfc33}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-blue-600\\/20:hover{background-color:color-mix(in oklab,var(--color-blue-600)20%,transparent)}}.hover\\:bg-destructive\\/25:hover{background-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-destructive\\/25:hover{background-color:color-mix(in oklab,var(--color-destructive)25%,transparent)}}.hover\\:bg-primary\\/40:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/40:hover{background-color:color-mix(in oklab,var(--color-primary)40%,transparent)}}.hover\\:bg-primary\\/90:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--color-primary)90%,transparent)}}.hover\\:bg-red-500\\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-red-500\\/10:hover{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.hover\\:bg-red-500\\/25:hover{background-color:#fb2c3640}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-red-500\\/25:hover{background-color:color-mix(in oklab,var(--color-red-500)25%,transparent)}}.hover\\:bg-white\\/30:hover{background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/30:hover{background-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.hover\\:bg-white\\/\\[0\\.02\\]:hover{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/\\[0\\.02\\]:hover{background-color:color-mix(in oklab,var(--color-white)2%,transparent)}}.hover\\:bg-zinc-600:hover{background-color:var(--color-zinc-600)}.hover\\:bg-zinc-800:hover{background-color:var(--color-zinc-800)}.hover\\:bg-zinc-800\\/40:hover{background-color:#27272a66}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-zinc-800\\/40:hover{background-color:color-mix(in oklab,var(--color-zinc-800)40%,transparent)}}.hover\\:bg-zinc-800\\/50:hover{background-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-zinc-800\\/50:hover{background-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.hover\\:bg-zinc-900:hover{background-color:var(--color-zinc-900)}.hover\\:text-blue-400:hover{color:var(--color-blue-400)}.hover\\:text-destructive:hover{color:var(--color-destructive)}.hover\\:text-primary:hover{color:var(--color-primary)}.hover\\:text-red-200:hover{color:var(--color-red-200)}.hover\\:text-red-400:hover{color:var(--color-red-400)}.hover\\:text-red-500:hover{color:var(--color-red-500)}.hover\\:text-white:hover{color:var(--color-white)}.hover\\:text-zinc-200:hover{color:var(--color-zinc-200)}.hover\\:text-zinc-300:hover{color:var(--color-zinc-300)}.hover\\:text-zinc-400:hover{color:var(--color-zinc-400)}.hover\\:opacity-90:hover{opacity:.9}.hover\\:ring-zinc-600:hover{--tw-ring-color:var(--color-zinc-600)}}.focus\\:bg-zinc-800:focus{background-color:var(--color-zinc-800)}.focus\\:text-white:focus{color:var(--color-white)}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-blue-500\\/50:focus{--tw-ring-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.focus\\:ring-blue-500\\/50:focus{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.focus\\:ring-blue-600:focus{--tw-ring-color:var(--color-blue-600)}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\\:ring-offset-zinc-900:focus{--tw-ring-offset-color:var(--color-zinc-900)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:border-zinc-600:focus-visible{border-color:var(--color-zinc-600)}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-blue-500:focus-visible{--tw-ring-color:var(--color-blue-500)}.focus-visible\\:ring-blue-500\\/80:focus-visible{--tw-ring-color:#3080ffcc}@supports (color:color-mix(in lab,red,red)){.focus-visible\\:ring-blue-500\\/80:focus-visible{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)80%,transparent)}}.focus-visible\\:ring-blue-600:focus-visible{--tw-ring-color:var(--color-blue-600)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color:var(--color-ring)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\\:ring-offset-zinc-900:focus-visible{--tw-ring-offset-color:var(--color-zinc-900)}.focus-visible\\:ring-offset-zinc-950:focus-visible{--tw-ring-offset-color:var(--color-zinc-950)}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.focus-visible\\:ring-inset:focus-visible{--tw-ring-inset:inset}.active\\:cursor-grabbing:active{cursor:grabbing}.active\\:bg-primary\\/60:active{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-primary\\/60:active{background-color:color-mix(in oklab,var(--color-primary)60%,transparent)}}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-20:disabled{opacity:.2}.disabled\\:opacity-30:disabled{opacity:.3}.disabled\\:opacity-50:disabled{opacity:.5}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[state\\=open\\]\\:border-zinc-800[data-state=open]{border-color:var(--color-zinc-800)}.data-\\[state\\=open\\]\\:bg-zinc-950[data-state=open]{background-color:var(--color-zinc-950)}.data-\\[state\\=open\\]\\:text-zinc-100[data-state=open]{color:var(--color-zinc-100)}@media(min-width:40rem){.sm\\:max-w-\\[280px\\]{max-width:280px}}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&\\>span\\]\\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\\[\\&\\>span\\]\\:flex>span{display:flex}.\\[\\&\\>span\\]\\:items-center>span{align-items:center}.\\[\\&\\>span\\]\\:gap-2>span{gap:calc(var(--spacing)*2)}}:root{--background:oklch(14.1% .005 285.823);--foreground:oklch(98.5% 0 0);--card:oklch(21% .006 285.885);--card-foreground:oklch(98.5% 0 0);--popover:oklch(21% .006 285.885);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(42% .18 266);--primary-foreground:oklch(97% .014 254.604);--secondary:oklch(27.4% .006 286.033);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(27.4% .006 286.033);--muted-foreground:oklch(70.5% .015 286.067);--accent:oklch(42% .18 266);--accent-foreground:oklch(97% .014 254.604);--destructive:oklch(70.4% .191 22.216);--destructive-foreground:oklch(97% .014 254.604);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.2% .016 285.938);--radius:.5rem;--jp-inspector-label-size:11px;--jp-inspector-field-size:13px;font-family:ui-sans-serif,system-ui,sans-serif}[data-radix-portal]{z-index:9999!important}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}';class $E extends z.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error("[JsonPages Engine]",t,r)}render(){return this.state.hasError&&this.state.error?k.jsxs("div",{style:{minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:24,backgroundColor:"#0f172a",color:"#e2e8f0",fontFamily:"ui-sans-serif, system-ui, sans-serif"},children:[k.jsx("h1",{style:{fontSize:"1.25rem",fontWeight:700,marginBottom:8},children:"JsonPages Engine Error"}),k.jsx("pre",{style:{maxWidth:"100%",overflow:"auto",padding:16,backgroundColor:"rgba(0,0,0,0.3)",borderRadius:8,fontSize:12,marginTop:8},children:this.state.error.message})]}):this.props.children}}function co(e){return e.split("/").map(t=>t.trim()).filter(Boolean).join("/")}function Cm(e,t=""){const r=co(t);let s=e.replace(/\/+/g,"/");if(r){const i=`/${r}`;s===i?s="/":s.startsWith(`${i}/`)&&(s=s.slice(i.length))}return co(s)||"home"}function Wc(e,t){const r=co(t)||"home";return e[r]}function $c(e,t){return Eo(e,t)}function qc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function os(e,t){if(typeof document>"u")return;const r=`link[rel="${e}"]`;let n=document.head.querySelector(r);n||(n=document.createElement("link"),n.rel=e,document.head.appendChild(n)),n.href=t}function Im(e,t,r){if(typeof document>"u")return;const n="olonjs-webmcp-jsonld";let s=document.getElementById(n);s||(s=document.createElement("script"),s.type="application/ld+json",s.id=n,document.head.appendChild(s)),s.textContent=JSON.stringify({"@context":"https://schema.org","@type":"WebPage",name:e,description:t,url:r})}function Tm(e){return`/mcp-manifests/${e}.json`}function jm(e){return`/schemas/${e}.schema.json`}const Om=({pageRegistry:e,siteConfig:t,menuConfig:r,themeConfig:n,refDocuments:s,tenantCss:o,adminCss:i,NotFoundComponent:a})=>{const l=Ze.useLocation(),c=Cm(l.pathname),u=z.useMemo(()=>jr({pages:e,siteConfig:t,themeConfig:n,menuConfig:r,refDocuments:s}),[e,t,n,r,s]),d=Wc(u.pages,c);return z.useEffect(()=>{var f;try{(f=u.themeConfig)!=null&&f.tokens&&wi.setTheme(u.themeConfig)}catch(h){console.warn("[JsonPages] visitor theme resolution failed",h)}},[u.themeConfig]),z.useEffect(()=>{var y,m;if(!d)return;const f=typeof((y=d.meta)==null?void 0:y.title)=="string"?d.meta.title:c,h=typeof((m=d.meta)==null?void 0:m.description)=="string"?d.meta.description:"";os("mcp-manifest",Tm(c)),os("olon-contract",jm(c)),Im(f,h,c==="home"?"/":`/${c}`)},[d,c]),d?k.jsx(Ao,{mode:"tenant",tenantCss:o,adminCss:i,children:k.jsx(yo,{mode:"visitor",children:k.jsx(ys,{pageConfig:d,siteConfig:u.siteConfig,menuConfig:u.menuConfig})})}):k.jsx(a,{})},Pm=({pageRegistry:e,schemas:t,siteConfig:r,menuConfig:n,themeConfig:s,refDocuments:o,tenantCss:i,adminCss:a,addSectionConfig:l,addableSectionTypes:c,webMcp:u,saveToFile:d,hotSave:f,showLegacySave:h=!0,showHotSave:y=!1})=>{var oe;const m=Ze.useLocation(),b=Cm(m.pathname,"admin"),S=Ze.useNavigate(),g=Object.keys(e).sort((de,ge)=>de==="home"?-1:ge==="home"?1:de.localeCompare(ge)),[w,_]=z.useState(null),[x,I]=z.useState(!1),[C,A]=z.useState(!1),[O,j]=z.useState(!1),[R,T]=z.useState(!1),[D,H]=z.useState(()=>{try{const de=JSON.parse(JSON.stringify(r??{}));return de.identity||(de.identity={title:"Site"}),de.pages||(de.pages=[]),de}catch{return{identity:{title:"Site"},pages:[]}}}),[U,ae]=z.useState(null),[J,M]=z.useState(null),[ce,Q]=z.useState(null),[B,N]=z.useState(null),[Y,ue]=z.useState(!1),[X,we]=z.useState(400),L=z.useMemo(()=>jr({pages:w?{[b]:w}:{},siteConfig:D,themeConfig:s,menuConfig:n,refDocuments:o}),[w,D,s,n,o,b]),W=w?L.pages[b]??w:null,le=z.useRef(w),$=z.useRef(D),ee=360,ne=920;z.useEffect(()=>{le.current=w},[w]),z.useEffect(()=>{$.current=D},[D]);const me=z.useCallback(de=>{de.preventDefault();const ge=de.currentTarget;ge.setPointerCapture(de.pointerId);const ke=de.clientX,Te=X,Re=De=>{const We=ke-De.clientX,Oe=Math.min(ne,Math.max(ee,Te+We));we(Oe)},Fe=()=>{ge.releasePointerCapture(de.pointerId),ge.removeEventListener("pointermove",Re),ge.removeEventListener("pointerup",Fe),ge.removeEventListener("pointercancel",Fe),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",ge.addEventListener("pointermove",Re),ge.addEventListener("pointerup",Fe),ge.addEventListener("pointercancel",Fe)},[X]),pe=w?[...D.header?[{id:D.header.id,type:D.header.type,scope:"global",title:"Header"}]:[],...w.sections.map(de=>{var ge,ke;return{id:de.id,type:de.type,scope:"local",title:((ge=de.data)==null?void 0:ge.title)??((ke=de.data)==null?void 0:ke.titleHighlight)}}),...D.footer?[{id:D.footer.id,type:D.footer.type,scope:"global",title:"Footer"}]:[]]:[];z.useEffect(()=>{const de=Wc(e,b);de&&_(JSON.parse(JSON.stringify(de))),ae(null),M(null),I(!1)},[b,e]);const G=z.useCallback(()=>{const de=Wc(e,b);de&&_(JSON.parse(JSON.stringify(de))),ae(null),M(null),I(!1)},[b,e]),ie=z.useCallback((de,ge,ke)=>{const Te=[...ke.sections],Re=Te.findIndex(Oe=>Oe.id===de);if(Re===-1||ge<0||ge>=Te.length)return;const[Fe]=Te.splice(Re,1),De=ge>Re?ge-1:ge;Te.splice(Math.min(De,Te.length),0,Fe);const We={...ke,sections:Te};_(We),I(!0),be.current&&be.current.emitUpdate(We,$.current)},[]),he=z.useCallback(de=>{if(de.origin!==window.location.origin)return;if(de.data.type===it.SECTION_SELECT){ae(de.data.section);const ke=de.data.itemPath;Array.isArray(ke)&&ke.length>0?M(ke.map(Te=>({fieldKey:Te.fieldKey,...Te.itemId!=null?{itemId:String(Te.itemId)}:{}}))):M(null)}const ge=(ke,Te)=>{be.current&&ke&&be.current.emitUpdate(ke,Te)};if(de.data.type===it.INLINE_FIELD_UPDATE){const ke=typeof de.data.sectionId=="string"?de.data.sectionId:null,Te=typeof de.data.fieldKey=="string"?de.data.fieldKey:null;ke&&Te&&(_(Re=>{if(!Re)return Re;const Fe={...Re,sections:Re.sections.map(De=>De.id===ke?{...De,data:{...De.data,[Te]:de.data.value}}:De)};return le.current=Fe,ge(Fe,$.current),Fe}),I(!0))}if(de.data.type===it.ACTIVE_SECTION_CHANGED&&Q(de.data.activeSectionId??null),de.data.type==="jsonpages:section-reorder"&&le.current){const{sectionId:ke,newIndex:Te}=de.data;typeof ke=="string"&&typeof Te=="number"&&Te>=0&&ie(ke,Te,le.current)}if(de.data.type===it.WEBMCP_TOOL_CALL){const ke=typeof de.data.requestId=="string"?de.data.requestId:crypto.randomUUID(),Te=typeof de.data.toolName=="string"?de.data.toolName:"";E(Te,de.data.args).then(Re=>{window.postMessage({type:it.WEBMCP_TOOL_RESULT,requestId:ke,toolName:Te,result:Re,ok:!0},window.location.origin)}).catch(Re=>{const Fe=Re instanceof Error?Re.message:String(Re);window.postMessage({type:it.WEBMCP_TOOL_RESULT,requestId:ke,toolName:Te,ok:!1,error:Fe},window.location.origin)})}},[ie,E]);z.useEffect(()=>(window.addEventListener("message",he),()=>window.removeEventListener("message",he)),[he]);const be=z.useRef(null);z.useEffect(()=>{if(!(u!=null&&u.enabled))return;const{emitUpdate:de,disconnect:ge}=FE();return be.current={emitUpdate:de,disconnect:ge},()=>{ge(),be.current=null}},[u==null?void 0:u.enabled]),z.useEffect(()=>{if(!(u!=null&&u.enabled)||(ns(),!le.current))return;const ge=Fc({name:lo,description:`Update any section in OlonJS Studio's in-memory draft state. Does NOT persist to disk. Use "sectionType" in input args to ensure correct schema validation.`,inputSchema:Em(),execute:Te=>E(lo,Te)}),ke=Fc({name:rs,description:`Persist the current in-memory draft state to disk. Call this after making one or more updates via ${lo}.`,inputSchema:km(),execute:Te=>E(rs,Te)});return()=>{ge(),ke()}},[u==null?void 0:u.enabled,b,w,D,E]);const ve=z.useCallback(de=>{const ge=pe.find(ke=>ke.id===de);ge&&ae({id:ge.id,type:ge.type,scope:ge.scope}),M(null),N(de)},[pe]),Ae=z.useCallback(()=>{N(null)},[]),se=z.useCallback(de=>{_(ge=>{if(!ge)return ge;const ke={...ge,sections:ge.sections.filter(Te=>Te.id!==de)};return be.current&&be.current.emitUpdate(ke,$.current),ke}),I(!0),ae(ge=>(ge==null?void 0:ge.id)===de?null:ge)},[]),Ee=de=>{if(!U||!w)return;I(!0);let ge=w,ke=D;if(U.scope==="global")U.type==="header"&&D.header!=null?(ke={...D,header:{...D.header,data:de}},H(ke)):U.type==="footer"&&D.footer!=null&&(ke={...D,footer:{...D.footer,data:de}},H(ke));else{const Te=w.sections.map(Re=>Re.id===U.id?{...Re,data:de}:Re);ge={...w,sections:Te},_(ge)}be.current&&be.current.emitUpdate(ge,ke)},je=z.useCallback((de,ge,ke,Te)=>{var De,We;I(!0);let Re=le.current,Fe=$.current;if(ge==="global")((De=Fe.header)==null?void 0:De.id)===de?(Fe={...Fe,header:{...Fe.header,data:Te}},H(Fe)):((We=Fe.footer)==null?void 0:We.id)===de&&(Fe={...Fe,footer:{...Fe.footer,data:Te}},H(Fe));else if(Re){const Oe=Re.sections.map(qe=>qe.id===de?{...qe,data:Te}:qe);Re={...Re,sections:Oe},_(Re)}be.current&&Re&&be.current.emitUpdate(Re,Fe)},[]),ye=z.useCallback(async()=>{const de=document.querySelector("iframe");if(!(de!=null&&de.contentWindow))return;const ge=crypto.randomUUID();await new Promise(ke=>{var Fe;let Te=!1;const Re=De=>{var We,Oe;De.origin===window.location.origin&&((We=De.data)==null?void 0:We.type)===it.INLINE_FLUSHED&&((Oe=De.data)==null?void 0:Oe.requestId)===ge&&(Te=!0,window.removeEventListener("message",Re),ke())};window.addEventListener("message",Re),(Fe=de.contentWindow)==null||Fe.postMessage({type:it.REQUEST_INLINE_FLUSH,requestId:ge},"*"),window.setTimeout(()=>{Te||(window.removeEventListener("message",Re),ke())},400)})},[]),$e=z.useCallback(async(de,ge)=>{var Fe;if(!d)throw new Error("saveToFile is not configured for this tenant.");const ke=jr({pages:{[b]:de},siteConfig:ge,themeConfig:s,menuConfig:n,refDocuments:o}),Te=(Fe=ke.siteConfig.header)==null?void 0:Fe.data,Re={page:de,site:ge,menu:{main:$c(Te,n.main)},theme:ke.themeConfig};await d(Re,b),I(!1),A(!0),typeof window<"u"&&window.setTimeout(()=>A(!1),2500)},[d,b,s,n,o]),p=z.useCallback(async de=>{var qe,Ge;if(!d)throw new Error("WebMCP requires saveToFile persistence in Studio mode.");if(!qc(de)||typeof de.sectionId!="string")throw new Error("WebMCP mutation requires a sectionId.");const ge=de,ke=typeof ge.slug=="string"?co(ge.slug):b;if(ke!==b)throw new Error(`WebMCP slug mismatch. Active Studio slug is "${b}", received "${ke}".`);await ye();const Te=le.current,Re=$.current;if(!Te)throw new Error("Studio draft is not ready yet.");const Fe=ge.scope==="global"?"global":"local";let De=Te,We=Re,Oe=ge.sectionType;if(Fe==="global"){const He=((qe=Re.header)==null?void 0:qe.id)===ge.sectionId?Re.header:((Ge=Re.footer)==null?void 0:Ge.id)===ge.sectionId?Re.footer:null;if(!He)throw new Error(`Global section "${ge.sectionId}" was not found.`);if(!Oe)Oe=He.type;else if(He.type!==Oe)throw new Error(`Section "${ge.sectionId}" is type "${He.type}", not "${Oe}".`);const Ye=t[Oe];if(!Ye||typeof Ye.parse!="function")throw new Error(`Missing schema for section type "${Oe}".`);const ot=qc(He.data)?He.data:{},F=Uc(ot,ge),K=Ye.parse(F),Ie={...He,data:K};We={...Re,...He.type==="header"?{header:Ie}:{footer:Ie}},$.current=We,H(We)}else{const He=Te.sections.find(Ie=>Ie.id===ge.sectionId);if(!He)throw new Error(`Local section "${ge.sectionId}" was not found in page "${b}".`);if(!Oe)Oe=He.type;else if(He.type!==Oe)throw new Error(`Section "${ge.sectionId}" is type "${He.type}", not "${Oe}".`);const Ye=t[Oe];if(!Ye||typeof Ye.parse!="function")throw new Error(`Missing schema for section type "${Oe}".`);const ot=qc(He.data)?He.data:{},F=Uc(ot,ge),K=Ye.parse(F);De={...Te,sections:Te.sections.map(Ie=>Ie.id===ge.sectionId?{...Ie,data:K}:Ie)},le.current=De,_(De)}return ae({id:ge.sectionId,type:Oe,scope:Fe}),M(Array.isArray(ge.itemPath)?ge.itemPath:null),I(!0),{content:[{type:"text",text:JSON.stringify({ok:!0,slug:b,sectionId:ge.sectionId,sectionType:Oe,scope:Fe,action:"draft_updated"})}],isError:!1}},[d,b,ye,t]),v=z.useCallback(async de=>{if(!d)throw new Error("WebMCP requires saveToFile persistence in Studio mode.");await ye();const ge=le.current,ke=$.current;if(!ge)throw new Error("Studio draft is not ready yet.");return await $e(ge,ke),{content:[{type:"text",text:JSON.stringify({ok:!0,slug:b,action:"saved_to_disk"})}],isError:!1}},[d,b,ye,$e]);async function E(de,ge){if(de===lo)return p(ge);if(de===rs)return v(ge);throw new Error(`Unknown WebMCP tool "${de}".`)}const P=async()=>{var Fe;if(!d)return;await ye();const de=le.current,ge=$.current;if(!de)return;const ke=jr({pages:{[b]:de},siteConfig:ge,themeConfig:s,menuConfig:n,refDocuments:o}),Te=(Fe=ke.siteConfig.header)==null?void 0:Fe.data,Re={page:de,site:ge,menu:{main:$c(Te,n.main)},theme:ke.themeConfig};d(Re,b).then(()=>{I(!1),A(!0),typeof window<"u"&&window.setTimeout(()=>A(!1),2500)}).catch(De=>{console.error("[JsonPages] saveToFile failed",De);const We=De instanceof Error?De.message:String(De);alert(`Save to file failed: ${We}`)})},V=async()=>{var Fe;if(!f)return;await ye();const de=le.current,ge=$.current;if(!de)return;const ke=jr({pages:{[b]:de},siteConfig:ge,themeConfig:s,menuConfig:n,refDocuments:o}),Te=(Fe=ke.siteConfig.header)==null?void 0:Fe.data,Re={page:de,site:ge,menu:{main:$c(Te,n.main)},theme:ke.themeConfig};T(!0),f(Re,b).then(()=>{I(!1),j(!0),typeof window<"u"&&window.setTimeout(()=>j(!1),2500)}).catch(De=>{console.error("[JsonPages] hotSave failed",De);const We=De instanceof Error?De.message:String(De);alert(`Hot save failed: ${We}`)}).finally(()=>{T(!1)})},te=de=>{var Re;if(!w)return;const ge=((Re=l==null?void 0:l.getDefaultSectionData)==null?void 0:Re.call(l,de))??{},ke={id:crypto.randomUUID(),type:de,data:ge,settings:void 0},Te={...w,sections:[...w.sections,ke]};_(Te),I(!0),ae({id:ke.id,type:de,scope:"local"}),be.current&&be.current.emitUpdate(Te,$.current)};if(z.useEffect(()=>{var Te,Re;const de=W??w,ge=typeof((Te=de==null?void 0:de.meta)==null?void 0:Te.title)=="string"?de.meta.title:b,ke=typeof((Re=de==null?void 0:de.meta)==null?void 0:Re.description)=="string"?de.meta.description:"";os("mcp-manifest",Tm(b)),os("olon-contract",jm(b)),Im(ge,ke,`/admin${b==="home"?"":`/${b}`}`)},[w,W,b]),!w)return k.jsx("div",{children:"Loading Studio..."});const fe=(U==null?void 0:U.scope)==="global"?{sections:[L.siteConfig.header,L.siteConfig.footer].filter(de=>de!=null)}:W??w,re=[...L.siteConfig.header?[L.siteConfig.header]:[],...((oe=W??w)==null?void 0:oe.sections)??[],...L.siteConfig.footer?[L.siteConfig.footer]:[]];return k.jsx(Ao,{mode:"admin",tenantCss:i,adminCss:a,children:k.jsx(yo,{mode:"studio",children:k.jsxs("div",{className:"flex flex-col h-screen w-screen bg-background text-foreground overflow-hidden",children:[k.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[k.jsx("main",{className:"flex-1 min-w-0 relative bg-zinc-900/50 overflow-hidden",children:k.jsx(Uh,{draft:W??w,globalDraft:L.siteConfig,menuConfig:L.menuConfig,themeConfig:L.themeConfig,slug:b,selectedId:U==null?void 0:U.id,scrollToSectionId:B,onScrollRequested:Ae})}),k.jsxs("div",{className:"flex shrink-0 relative h-full z-10",style:{width:X,minWidth:ee,maxWidth:ne},children:[k.jsx("div",{role:"separator","aria-label":"Resize inspector",className:"absolute left-0 top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-primary/40 active:bg-primary/60 transition-colors shrink-0",style:{zIndex:9999},onPointerDown:me}),k.jsx(Bh,{selectedSection:U,pageData:fe,allSectionsData:re,onUpdate:Ee,onUpdateSection:je,onClose:()=>{ae(null),M(null)},expandedItemPath:J,onReorderSection:w?(de,ge)=>ie(de,ge,w):void 0,allLayers:pe,activeSectionId:ce,onRequestScrollToSection:ve,onDeleteSection:w?se:void 0,onAddSection:c.length>0?()=>ue(!0):void 0,hasChanges:x,onSaveToFile:d!=null?P:void 0,saveSuccessFeedback:C,onHotSave:f!=null?V:void 0,hotSaveSuccessFeedback:O,hotSaveInProgress:R,showLegacySave:h,showHotSave:y,onResetToFile:G,pageSlugs:g,currentSlug:b,onPageChange:g.length>1?de=>{const ge=co(de);S(ge==="home"?"/admin":`/admin/${ge}`)}:void 0})]})]}),k.jsx(qh,{open:Y,onClose:()=>ue(!1),sectionTypes:c,sectionTypeLabels:l==null?void 0:l.sectionTypeLabels,onSelect:te})]})})})},Nm=({tenantCss:e,adminCss:t})=>k.jsx(Ao,{mode:"tenant",tenantCss:e,adminCss:t,children:k.jsx($h,{})});function qE({config:e}){var g,w,_,x,I;const{registry:t={},schemas:r={},pages:n={},siteConfig:s,themeConfig:o,menuConfig:i,refDocuments:a,themeCss:l,addSection:c,NotFoundComponent:u=Hh}=e,d=(c==null?void 0:c.addableSectionTypes)??Object.keys(r).filter(C=>C!=="header"&&C!=="footer"),f={saveToFile:(g=e.persistence)==null?void 0:g.saveToFile,hotSave:(w=e.persistence)==null?void 0:w.hotSave,showLegacySave:((_=e.persistence)==null?void 0:_.showLegacySave)??!0,showHotSave:((x=e.persistence)==null?void 0:x.showHotSave)??!1},h=typeof(l==null?void 0:l.tenant)=="string"?l.tenant:"",y=typeof(l==null?void 0:l.admin)=="string"?l.admin:WE,m=z.useMemo(()=>jr({pages:n,siteConfig:s,themeConfig:o,menuConfig:i,refDocuments:a}),[n,s,o,i,a]),[b,S]=z.useState(!1);return z.useEffect(()=>{var C,A;try{(C=m.themeConfig)!=null&&C.tokens&&wi.setTheme(m.themeConfig)}catch(O){console.warn("[JsonPages] setTheme failed",O)}(A=e.webmcp)!=null&&A.enabled&&ns(),S(!0)},[m.themeConfig,(I=e.webmcp)==null?void 0:I.enabled]),b?k.jsx($E,{children:k.jsx(xu,{config:{registry:t,schemas:r,tenantId:e.tenantId??"default",assets:e.assets,overlayDisabledSectionTypes:e.overlayDisabledSectionTypes},children:k.jsx(Ze.BrowserRouter,{children:k.jsxs(Ze.Routes,{children:[k.jsx(Ze.Route,{path:"/",element:k.jsx(Om,{pageRegistry:n,siteConfig:s,menuConfig:i,themeConfig:m.themeConfig,refDocuments:a,tenantCss:h,adminCss:y,NotFoundComponent:u})}),k.jsx(Ze.Route,{path:"/*",element:k.jsx(Om,{pageRegistry:n,siteConfig:s,menuConfig:i,themeConfig:m.themeConfig,refDocuments:a,tenantCss:h,adminCss:y,NotFoundComponent:u})}),k.jsx(Ze.Route,{path:"/admin",element:k.jsx(Pm,{pageRegistry:n,schemas:r,siteConfig:s,menuConfig:i,themeConfig:m.themeConfig,refDocuments:a,tenantCss:h,adminCss:y,addSectionConfig:c,addableSectionTypes:d,webMcp:e.webmcp,saveToFile:f.saveToFile,hotSave:f.hotSave,showLegacySave:f.showLegacySave,showHotSave:f.showHotSave})}),k.jsx(Ze.Route,{path:"/admin/*",element:k.jsx(Pm,{pageRegistry:n,schemas:r,siteConfig:s,menuConfig:i,themeConfig:m.themeConfig,refDocuments:a,tenantCss:h,adminCss:y,addSectionConfig:c,addableSectionTypes:d,webMcp:e.webmcp,saveToFile:f.saveToFile,hotSave:f.hotSave,showLegacySave:f.showLegacySave,showHotSave:f.showHotSave})}),k.jsx(Ze.Route,{path:"/admin/preview",element:k.jsx(Nm,{tenantCss:h,adminCss:y})}),k.jsx(Ze.Route,{path:"/admin/preview/*",element:k.jsx(Nm,{tenantCss:h,adminCss:y})}),k.jsx(Ze.Route,{path:"*",element:k.jsx(u,{})})]})})})}):k.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#0f172a",color:"#94a3b8",fontFamily:"ui-sans-serif, system-ui, sans-serif",fontSize:14},children:"Loading..."})}Le.AddSectionLibrary=qh,Le.AdminSidebar=Bh,Le.ConfigProvider=xu,Le.DefaultNotFound=Hh,Le.FormFactory=Kn,Le.InputWidgets=fn,Le.JsonPagesEngine=qE,Le.PageRenderer=ys,Le.PreviewEntry=$h,Le.STUDIO_EVENTS=it,Le.SectionRenderer=In,Le.StudioProvider=yo,Le.StudioStage=Uh,Le.ThemeLoader=Ao,Le.WEBMCP_TOOL_SAVE=rs,Le.WEBMCP_TOOL_UPDATE=lo,Le.applyValueAtSelectionPath=Bc,Le.cn=Ke,Le.createWebMcpSaveToolInputSchema=km,Le.createWebMcpUpdateToolInputSchema=Em,Le.ensureWebMcpRuntime=ns,Le.registerWebMcpTool=Fc,Le.resolveAssetUrl=fh,Le.resolveHeaderMenuItems=Eo,Le.resolveRuntimeConfig=jr,Le.resolveSectionMenuItems=ko,Le.resolveWebMcpMutationData=Uc,Le.shouldRenderSiteGlobalHeader=Xc,Le.themeManager=wi,Le.useConfig=Cn,Le.useStudio=Su,Object.defineProperty(Le,Symbol.toStringTag,{value:"Module"})}));
|