@olonjs/core 1.0.96 → 1.0.98
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/index.d.ts +3 -4
- package/dist/olonjs-core.js +1239 -1247
- package/dist/olonjs-core.umd.cjs +41 -41
- package/package.json +1 -1
package/dist/olonjs-core.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(ae,b){typeof exports=="object"&&typeof module<"u"?b(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"],b):(ae=typeof globalThis<"u"?globalThis:ae||self,b(ae.OlonJsCore={},ae.React,ae.ReactRouterDOM,ae.z,ae.ReactDOM))})(this,(function(ae,b,Je,Ne,bt){"use strict";function Ai(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 g=Ai(b),Vr=Ai(bt);function Ti(e,t){return t.header!=null&&e["global-header"]!==!1}const ve={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 zi(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=zi(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function _c(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=zi(e))&&(n&&(n+=" "),n+=t);return n}const Mc=(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},Rc=(e,t)=>({classGroupId:e,validator:t}),Pi=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Kr="-",Oi=[],Lc="arbitrary..",$c=e=>{const t=Wc(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Fc(s);const a=s.split(Kr),l=a[0]===""&&a.length>1?1:0;return Ii(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=n[s],d=r[s];return l?d?Mc(d,l):l:d||Oi}return r[s]||Oi}}},Ii=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],i=r.nextPart.get(o);if(i){const d=Ii(e,t+1,i);if(d)return d}const s=r.validators;if(s===null)return;const a=t===0?e.join(Kr):e.slice(t).join(Kr),l=s.length;for(let d=0;d<l;d++){const u=s[d];if(u.validator(a))return u.classGroupId}},Fc=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?Lc+n:void 0})(),Wc=e=>{const{theme:t,classGroups:r}=e;return Uc(r,t)},Uc=(e,t)=>{const r=Pi();for(const n in e){const o=e[n];ro(o,r,n,t)}return r},ro=(e,t,r,n)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];Bc(s,t,r,n)}},Bc=(e,t,r,n)=>{if(typeof e=="string"){Hc(e,t,r);return}if(typeof e=="function"){Vc(e,t,r,n);return}Kc(e,t,r,n)},Hc=(e,t,r)=>{const n=e===""?t:Di(t,e);n.classGroupId=r},Vc=(e,t,r,n)=>{if(Gc(e)){ro(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Rc(r,e))},Kc=(e,t,r,n)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];ro(l,Di(t,a),r,n)}},Di=(e,t)=>{let r=e;const n=t.split(Kr),o=n.length;for(let i=0;i<o;i++){const s=n[i];let a=r.nextPart.get(s);a||(a=Pi(),r.nextPart.set(s,a)),r=a}return r},Gc=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Yc=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)}}},no="!",_i=":",qc=[],Mi=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),Xc=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===_i){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(no)?(h=f.slice(0,-1),p=!0):f.startsWith(no)&&(h=f.slice(1),p=!0);const w=d&&d>l?d-l:void 0;return Mi(i,p,h,w)};if(t){const o=t+_i,i=n;n=s=>s.startsWith(o)?i(s.slice(o.length)):Mi(qc,!1,s,void 0,!0)}if(r){const o=n;n=i=>r({className:i,parseClassName:o})}return n},Jc=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}},Zc=e=>({cache:Yc(e.cacheSize),parseClassName:Xc(e),sortModifiers:Jc(e),...$c(e)}),Qc=/\s+/,ed=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(Qc);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+no:k,S=x+y;if(s.indexOf(S)>-1)continue;s.push(S);const C=o(y,v);for(let j=0;j<C.length;++j){const N=C[j];s.push(x+N)}l=u+(l.length>0?" "+l:l)}return l},td=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=Ri(r))&&(o&&(o+=" "),o+=n);return o},Ri=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Ri(e[n]))&&(r&&(r+=" "),r+=t);return r},rd=(e,...t)=>{let r,n,o,i;const s=l=>{const d=t.reduce((u,f)=>f(u),e());return r=Zc(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=ed(l,r);return o(l,u),u};return i=s,(...l)=>i(td(...l))},nd=[],Ae=e=>{const t=r=>r[e]||nd;return t.isThemeGetter=!0,t},Li=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$i=/^\((?:(\w[\w-]*):)?(.+)\)$/i,od=/^\d+\/\d+$/,id=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sd=/\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$/,ad=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ld=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$t=e=>od.test(e),le=e=>!!e&&!Number.isNaN(Number(e)),vt=e=>!!e&&Number.isInteger(Number(e)),oo=e=>e.endsWith("%")&&le(e.slice(0,-1)),ft=e=>id.test(e),dd=()=>!0,ud=e=>sd.test(e)&&!ad.test(e),Fi=()=>!1,fd=e=>ld.test(e),pd=e=>cd.test(e),hd=e=>!V(e)&&!K(e),md=e=>Ft(e,Vi,Fi),V=e=>Li.test(e),Pt=e=>Ft(e,Ki,ud),io=e=>Ft(e,wd,le),Wi=e=>Ft(e,Bi,Fi),gd=e=>Ft(e,Hi,pd),Gr=e=>Ft(e,Gi,fd),K=e=>$i.test(e),dr=e=>Wt(e,Ki),bd=e=>Wt(e,yd),Ui=e=>Wt(e,Bi),vd=e=>Wt(e,Vi),xd=e=>Wt(e,Hi),Yr=e=>Wt(e,Gi,!0),Ft=(e,t,r)=>{const n=Li.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Wt=(e,t,r=!1)=>{const n=$i.exec(e);return n?n[1]?t(n[1]):r:!1},Bi=e=>e==="position"||e==="percentage",Hi=e=>e==="image"||e==="url",Vi=e=>e==="length"||e==="size"||e==="bg-size",Ki=e=>e==="length",wd=e=>e==="number",yd=e=>e==="family-name",Gi=e=>e==="shadow",kd=rd(()=>{const e=Ae("color"),t=Ae("font"),r=Ae("text"),n=Ae("font-weight"),o=Ae("tracking"),i=Ae("leading"),s=Ae("breakpoint"),a=Ae("container"),l=Ae("spacing"),d=Ae("radius"),u=Ae("shadow"),f=Ae("inset-shadow"),h=Ae("text-shadow"),p=Ae("drop-shadow"),w=Ae("blur"),m=Ae("perspective"),v=Ae("aspect"),y=Ae("ease"),k=Ae("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(),K,V],j=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],E=()=>[K,V,l],D=()=>[$t,"full","auto",...E()],R=()=>[vt,"none","subgrid",K,V],I=()=>["auto",{span:["full",vt,K,V]},vt,K,V],L=()=>[vt,"auto",K,V],M=()=>["auto","min","max","fr",K,V],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...E()],B=()=>[$t,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...E()],T=()=>[e,K,V],X=()=>[...S(),Ui,Wi,{position:[K,V]}],re=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",vd,md,{size:[K,V]}],W=()=>[oo,dr,Pt],q=()=>["","none","full",d,K,V],G=()=>["",le,dr,Pt],me=()=>["solid","dashed","dotted","double"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],P=()=>[le,oo,Ui,Wi],J=()=>["","none",w,K,V],te=()=>["none",le,K,V],F=()=>["none",le,K,V],ne=()=>[le,K,V],Q=()=>[$t,"full",...E()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ft],breakpoint:[ft],color:[dd],container:[ft],"drop-shadow":[ft],ease:["in","out","in-out"],font:[hd],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ft],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ft],shadow:[ft],spacing:["px",le],text:[ft],"text-shadow":[ft],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",$t,V,K,v]}],container:["container"],columns:[{columns:[le,V,K,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:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],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:[vt,"auto",K,V]}],basis:[{basis:[$t,"full","auto",a,...E()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[le,$t,"auto","initial","none",V]}],grow:[{grow:["",le,K,V]}],shrink:[{shrink:["",le,K,V]}],order:[{order:[vt,"first","last","none",K,V]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:E()}],"gap-x":[{"gap-x":E()}],"gap-y":[{"gap-y":E()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:E()}],px:[{px:E()}],py:[{py:E()}],ps:[{ps:E()}],pe:[{pe:E()}],pt:[{pt:E()}],pr:[{pr:E()}],pb:[{pb:E()}],pl:[{pl:E()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":E()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":E()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],w:[{w:[a,"screen",...B()]}],"min-w":[{"min-w":[a,"screen","none",...B()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",r,dr,Pt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,K,io]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",oo,V]}],"font-family":[{font:[bd,V,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,K,V]}],"line-clamp":[{"line-clamp":[le,"none",K,io]}],leading:[{leading:[i,...E()]}],"list-image":[{"list-image":["none",K,V]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",K,V]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...me(),"wavy"]}],"text-decoration-thickness":[{decoration:[le,"from-font","auto",K,Pt]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[le,"auto",K,V]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",K,V]}],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",K,V]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:X()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vt,K,V],radial:["",K,V],conic:[vt,K,V]},xd,gd]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"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:[...me(),"hidden","none"]}],"divide-style":[{divide:[...me(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...me(),"none","hidden"]}],"outline-offset":[{"outline-offset":[le,K,V]}],"outline-w":[{outline:["",le,dr,Pt]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",u,Yr,Gr]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",f,Yr,Gr]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[le,Pt]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":G()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",h,Yr,Gr]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[le,K,V]}],"mix-blend":[{"mix-blend":[...se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":se()}],"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":[le]}],"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":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"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":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"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":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"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":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"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":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"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":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"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":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[K,V]}],"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":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"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":[le]}],"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":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:X()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",K,V]}],filter:[{filter:["","none",K,V]}],blur:[{blur:J()}],brightness:[{brightness:[le,K,V]}],contrast:[{contrast:[le,K,V]}],"drop-shadow":[{"drop-shadow":["","none",p,Yr,Gr]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",le,K,V]}],"hue-rotate":[{"hue-rotate":[le,K,V]}],invert:[{invert:["",le,K,V]}],saturate:[{saturate:[le,K,V]}],sepia:[{sepia:["",le,K,V]}],"backdrop-filter":[{"backdrop-filter":["","none",K,V]}],"backdrop-blur":[{"backdrop-blur":J()}],"backdrop-brightness":[{"backdrop-brightness":[le,K,V]}],"backdrop-contrast":[{"backdrop-contrast":[le,K,V]}],"backdrop-grayscale":[{"backdrop-grayscale":["",le,K,V]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[le,K,V]}],"backdrop-invert":[{"backdrop-invert":["",le,K,V]}],"backdrop-opacity":[{"backdrop-opacity":[le,K,V]}],"backdrop-saturate":[{"backdrop-saturate":[le,K,V]}],"backdrop-sepia":[{"backdrop-sepia":["",le,K,V]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":E()}],"border-spacing-x":[{"border-spacing-x":E()}],"border-spacing-y":[{"border-spacing-y":E()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",K,V]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[le,"initial",K,V]}],ease:[{ease:["linear","initial",y,K,V]}],delay:[{delay:[le,K,V]}],animate:[{animate:["none",k,K,V]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,K,V]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:te()}],"rotate-x":[{"rotate-x":te()}],"rotate-y":[{"rotate-y":te()}],"rotate-z":[{"rotate-z":te()}],scale:[{scale:F()}],"scale-x":[{"scale-x":F()}],"scale-y":[{"scale-y":F()}],"scale-z":[{"scale-z":F()}],"scale-3d":["scale-3d"],skew:[{skew:ne()}],"skew-x":[{"skew-x":ne()}],"skew-y":[{"skew-y":ne()}],transform:[{transform:[K,V,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Q()}],"translate-x":[{"translate-x":Q()}],"translate-y":[{"translate-y":Q()}],"translate-z":[{"translate-z":Q()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"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",K,V]}],"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":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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",K,V]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[le,dr,Pt,io]}],stroke:[{stroke:["none",...T()]}],"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 oe(...e){return kd(_c(e))}var qr={exports:{}},ur={};/**
|
|
1
|
+
(function(le,b){typeof exports=="object"&&typeof module<"u"?b(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"],b):(le=typeof globalThis<"u"?globalThis:le||self,b(le.OlonJsCore={},le.React,le.ReactRouterDOM,le.z,le.ReactDOM))})(this,(function(le,b,Ze,Ne,bt){"use strict";function Ti(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 g=Ti(b),Vr=Ti(bt);function Ai(e,t){return t.header!=null&&e["global-header"]!==!1}const xe={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 zi(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=zi(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Dc(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=zi(e))&&(n&&(n+=" "),n+=t);return n}const _c=(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},Mc=(e,t)=>({classGroupId:e,validator:t}),Pi=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Kr="-",Oi=[],Rc="arbitrary..",Lc=e=>{const t=Fc(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return $c(s);const a=s.split(Kr),l=a[0]===""&&a.length>1?1:0;return Ii(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=n[s],d=r[s];return l?d?_c(d,l):l:d||Oi}return r[s]||Oi}}},Ii=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],i=r.nextPart.get(o);if(i){const d=Ii(e,t+1,i);if(d)return d}const s=r.validators;if(s===null)return;const a=t===0?e.join(Kr):e.slice(t).join(Kr),l=s.length;for(let d=0;d<l;d++){const u=s[d];if(u.validator(a))return u.classGroupId}},$c=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?Rc+n:void 0})(),Fc=e=>{const{theme:t,classGroups:r}=e;return Wc(r,t)},Wc=(e,t)=>{const r=Pi();for(const n in e){const o=e[n];ro(o,r,n,t)}return r},ro=(e,t,r,n)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];Uc(s,t,r,n)}},Uc=(e,t,r,n)=>{if(typeof e=="string"){Bc(e,t,r);return}if(typeof e=="function"){Hc(e,t,r,n);return}Vc(e,t,r,n)},Bc=(e,t,r)=>{const n=e===""?t:Di(t,e);n.classGroupId=r},Hc=(e,t,r,n)=>{if(Kc(e)){ro(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Mc(r,e))},Vc=(e,t,r,n)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];ro(l,Di(t,a),r,n)}},Di=(e,t)=>{let r=e;const n=t.split(Kr),o=n.length;for(let i=0;i<o;i++){const s=n[i];let a=r.nextPart.get(s);a||(a=Pi(),r.nextPart.set(s,a)),r=a}return r},Kc=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Gc=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)}}},no="!",_i=":",Yc=[],Mi=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),qc=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===_i){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(no)?(h=f.slice(0,-1),p=!0):f.startsWith(no)&&(h=f.slice(1),p=!0);const w=d&&d>l?d-l:void 0;return Mi(i,p,h,w)};if(t){const o=t+_i,i=n;n=s=>s.startsWith(o)?i(s.slice(o.length)):Mi(Yc,!1,s,void 0,!0)}if(r){const o=n;n=i=>r({className:i,parseClassName:o})}return n},Xc=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}},Jc=e=>({cache:Gc(e.cacheSize),parseClassName:qc(e),sortModifiers:Xc(e),...Lc(e)}),Zc=/\s+/,Qc=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(Zc);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+no:k,S=x+y;if(s.indexOf(S)>-1)continue;s.push(S);const C=o(y,v);for(let j=0;j<C.length;++j){const N=C[j];s.push(x+N)}l=u+(l.length>0?" "+l:l)}return l},ed=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=Ri(r))&&(o&&(o+=" "),o+=n);return o},Ri=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Ri(e[n]))&&(r&&(r+=" "),r+=t);return r},td=(e,...t)=>{let r,n,o,i;const s=l=>{const d=t.reduce((u,f)=>f(u),e());return r=Jc(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=Qc(l,r);return o(l,u),u};return i=s,(...l)=>i(ed(...l))},rd=[],Te=e=>{const t=r=>r[e]||rd;return t.isThemeGetter=!0,t},Li=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$i=/^\((?:(\w[\w-]*):)?(.+)\)$/i,nd=/^\d+\/\d+$/,od=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,id=/\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$/,sd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ad=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ld=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$t=e=>nd.test(e),ae=e=>!!e&&!Number.isNaN(Number(e)),vt=e=>!!e&&Number.isInteger(Number(e)),oo=e=>e.endsWith("%")&&ae(e.slice(0,-1)),ft=e=>od.test(e),cd=()=>!0,dd=e=>id.test(e)&&!sd.test(e),Fi=()=>!1,ud=e=>ad.test(e),fd=e=>ld.test(e),pd=e=>!H(e)&&!V(e),hd=e=>Ft(e,Vi,Fi),H=e=>Li.test(e),Pt=e=>Ft(e,Ki,dd),io=e=>Ft(e,xd,ae),Wi=e=>Ft(e,Bi,Fi),md=e=>Ft(e,Hi,fd),Gr=e=>Ft(e,Gi,ud),V=e=>$i.test(e),dr=e=>Wt(e,Ki),gd=e=>Wt(e,wd),Ui=e=>Wt(e,Bi),bd=e=>Wt(e,Vi),vd=e=>Wt(e,Hi),Yr=e=>Wt(e,Gi,!0),Ft=(e,t,r)=>{const n=Li.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Wt=(e,t,r=!1)=>{const n=$i.exec(e);return n?n[1]?t(n[1]):r:!1},Bi=e=>e==="position"||e==="percentage",Hi=e=>e==="image"||e==="url",Vi=e=>e==="length"||e==="size"||e==="bg-size",Ki=e=>e==="length",xd=e=>e==="number",wd=e=>e==="family-name",Gi=e=>e==="shadow",yd=td(()=>{const e=Te("color"),t=Te("font"),r=Te("text"),n=Te("font-weight"),o=Te("tracking"),i=Te("leading"),s=Te("breakpoint"),a=Te("container"),l=Te("spacing"),d=Te("radius"),u=Te("shadow"),f=Te("inset-shadow"),h=Te("text-shadow"),p=Te("drop-shadow"),w=Te("blur"),m=Te("perspective"),v=Te("aspect"),y=Te("ease"),k=Te("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],j=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],E=()=>[V,H,l],D=()=>[$t,"full","auto",...E()],R=()=>[vt,"none","subgrid",V,H],I=()=>["auto",{span:["full",vt,V,H]},vt,V,H],L=()=>[vt,"auto",V,H],M=()=>["auto","min","max","fr",V,H],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],B=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...E()],U=()=>[$t,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...E()],A=()=>[e,V,H],X=()=>[...S(),Ui,Wi,{position:[V,H]}],re=()=>["no-repeat",{repeat:["","x","y","space","round"]}],T=()=>["auto","cover","contain",bd,hd,{size:[V,H]}],$=()=>[oo,dr,Pt],q=()=>["","none","full",d,V,H],K=()=>["",ae,dr,Pt],ge=()=>["solid","dashed","dotted","double"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>[ae,oo,Ui,Wi],J=()=>["","none",w,V,H],ee=()=>["none",ae,V,H],W=()=>["none",ae,V,H],ne=()=>[ae,V,H],Z=()=>[$t,"full",...E()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ft],breakpoint:[ft],color:[cd],container:[ft],"drop-shadow":[ft],ease:["in","out","in-out"],font:[pd],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ft],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ft],shadow:[ft],spacing:["px",ae],text:[ft],"text-shadow":[ft],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",$t,H,V,v]}],container:["container"],columns:[{columns:[ae,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:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],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:[vt,"auto",V,H]}],basis:[{basis:[$t,"full","auto",a,...E()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ae,$t,"auto","initial","none",H]}],grow:[{grow:["",ae,V,H]}],shrink:[{shrink:["",ae,V,H]}],order:[{order:[vt,"first","last","none",V,H]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:E()}],"gap-x":[{"gap-x":E()}],"gap-y":[{"gap-y":E()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...B(),"normal"]}],"justify-self":[{"justify-self":["auto",...B()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...B(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...B(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...B(),"baseline"]}],"place-self":[{"place-self":["auto",...B()]}],p:[{p:E()}],px:[{px:E()}],py:[{py:E()}],ps:[{ps:E()}],pe:[{pe:E()}],pt:[{pt:E()}],pr:[{pr:E()}],pb:[{pb:E()}],pl:[{pl:E()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":E()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":E()}],"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,dr,Pt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,V,io]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",oo,H]}],"font-family":[{font:[gd,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":[ae,"none",V,io]}],leading:[{leading:[i,...E()]}],"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:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[ae,"from-font","auto",V,Pt]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[ae,"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:E()}],"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:X()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vt,V,H],radial:["",V,H],conic:[vt,V,H]},vd,md]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"border-w":[{border:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"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:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ae,V,H]}],"outline-w":[{outline:["",ae,dr,Pt]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",u,Yr,Gr]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",f,Yr,Gr]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[ae,Pt]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",h,Yr,Gr]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[ae,V,H]}],"mix-blend":[{"mix-blend":[...se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":se()}],"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":[ae]}],"mask-image-linear-from-pos":[{"mask-linear-from":O()}],"mask-image-linear-to-pos":[{"mask-linear-to":O()}],"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":O()}],"mask-image-t-to-pos":[{"mask-t-to":O()}],"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":O()}],"mask-image-r-to-pos":[{"mask-r-to":O()}],"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":O()}],"mask-image-b-to-pos":[{"mask-b-to":O()}],"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":O()}],"mask-image-l-to-pos":[{"mask-l-to":O()}],"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":O()}],"mask-image-x-to-pos":[{"mask-x-to":O()}],"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":O()}],"mask-image-y-to-pos":[{"mask-y-to":O()}],"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":O()}],"mask-image-radial-to-pos":[{"mask-radial-to":O()}],"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":[ae]}],"mask-image-conic-from-pos":[{"mask-conic-from":O()}],"mask-image-conic-to-pos":[{"mask-conic-to":O()}],"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:X()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",V,H]}],filter:[{filter:["","none",V,H]}],blur:[{blur:J()}],brightness:[{brightness:[ae,V,H]}],contrast:[{contrast:[ae,V,H]}],"drop-shadow":[{"drop-shadow":["","none",p,Yr,Gr]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",ae,V,H]}],"hue-rotate":[{"hue-rotate":[ae,V,H]}],invert:[{invert:["",ae,V,H]}],saturate:[{saturate:[ae,V,H]}],sepia:[{sepia:["",ae,V,H]}],"backdrop-filter":[{"backdrop-filter":["","none",V,H]}],"backdrop-blur":[{"backdrop-blur":J()}],"backdrop-brightness":[{"backdrop-brightness":[ae,V,H]}],"backdrop-contrast":[{"backdrop-contrast":[ae,V,H]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ae,V,H]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ae,V,H]}],"backdrop-invert":[{"backdrop-invert":["",ae,V,H]}],"backdrop-opacity":[{"backdrop-opacity":[ae,V,H]}],"backdrop-saturate":[{"backdrop-saturate":[ae,V,H]}],"backdrop-sepia":[{"backdrop-sepia":["",ae,V,H]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":E()}],"border-spacing-x":[{"border-spacing-x":E()}],"border-spacing-y":[{"border-spacing-y":E()}],"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:[ae,"initial",V,H]}],ease:[{ease:["linear","initial",y,V,H]}],delay:[{delay:[ae,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:W()}],"scale-x":[{"scale-x":W()}],"scale-y":[{"scale-y":W()}],"scale-z":[{"scale-z":W()}],"scale-3d":["scale-3d"],skew:[{skew:ne()}],"skew-x":[{"skew-x":ne()}],"skew-y":[{"skew-y":ne()}],transform:[{transform:[V,H,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Z()}],"translate-x":[{"translate-x":Z()}],"translate-y":[{"translate-y":Z()}],"translate-z":[{"translate-z":Z()}],"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":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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:[ae,dr,Pt,io]}],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 oe(...e){return yd(Dc(e))}var qr={exports:{}},ur={};/**
|
|
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 Yi;function
|
|
9
|
+
*/var Yi;function kd(){if(Yi)return ur;Yi=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,o,i){var s=null;if(i!==void 0&&(s=""+i),o.key!==void 0&&(s=""+o.key),"key"in o){i={};for(var a in o)a!=="key"&&(i[a]=o[a])}else i=o;return o=i.ref,{$$typeof:e,type:n,key:s,ref:o!==void 0?o:null,props:i}}return ur.Fragment=t,ur.jsx=r,ur.jsxs=r,ur}var fr={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,177 +14,177 @@
|
|
|
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 qi;function
|
|
17
|
+
*/var qi;function Sd(){return qi||(qi=1,process.env.NODE_ENV!=="production"&&(function(){function e(T){if(T==null)return null;if(typeof T=="function")return T.$$typeof===I?null:T.displayName||T.name||null;if(typeof T=="string")return T;switch(T){case v:return"Fragment";case k:return"Profiler";case y:return"StrictMode";case j:return"Suspense";case N:return"SuspenseList";case R:return"Activity"}if(typeof T=="object")switch(typeof T.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),T.$$typeof){case m:return"Portal";case S:return T.displayName||"Context";case x:return(T._context.displayName||"Context")+".Consumer";case C:var $=T.render;return T=T.displayName,T||(T=$.displayName||$.name||"",T=T!==""?"ForwardRef("+T+")":"ForwardRef"),T;case E:return $=T.displayName||null,$!==null?$:e(T.type)||"Memo";case D:$=T._payload,T=T._init;try{return e(T($))}catch{}}return null}function t(T){return""+T}function r(T){try{t(T);var $=!1}catch{$=!0}if($){$=console;var q=$.error,K=typeof Symbol=="function"&&Symbol.toStringTag&&T[Symbol.toStringTag]||T.constructor.name||"Object";return q.call($,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",K),t(T)}}function n(T){if(T===v)return"<>";if(typeof T=="object"&&T!==null&&T.$$typeof===D)return"<...>";try{var $=e(T);return $?"<"+$+">":"<...>"}catch{return"<...>"}}function o(){var T=L.A;return T===null?null:T.getOwner()}function i(){return Error("react-stack-top-frame")}function s(T){if(M.call(T,"key")){var $=Object.getOwnPropertyDescriptor(T,"key").get;if($&&$.isReactWarning)return!1}return T.key!==void 0}function a(T,$){function q(){F||(F=!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)",$))}q.isReactWarning=!0,Object.defineProperty(T,"key",{get:q,configurable:!0})}function l(){var T=e(this.type);return U[T]||(U[T]=!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.")),T=this.props.ref,T!==void 0?T:null}function d(T,$,q,K,ge,se){var O=q.ref;return T={$$typeof:w,type:T,key:$,props:q,_owner:K},(O!==void 0?O:null)!==null?Object.defineProperty(T,"ref",{enumerable:!1,get:l}):Object.defineProperty(T,"ref",{enumerable:!1,value:null}),T._store={},Object.defineProperty(T._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(T,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(T,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ge}),Object.defineProperty(T,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:se}),Object.freeze&&(Object.freeze(T.props),Object.freeze(T)),T}function u(T,$,q,K,ge,se){var O=$.children;if(O!==void 0)if(K)if(G(O)){for(K=0;K<O.length;K++)f(O[K]);Object.freeze&&Object.freeze(O)}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 f(O);if(M.call($,"key")){O=e(T);var J=Object.keys($).filter(function(W){return W!=="key"});K=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",re[O+K]||(J=0<J.length?"{"+J.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} />`,K,O,J,O),re[O+K]=!0)}if(O=null,q!==void 0&&(r(q),O=""+q),s($)&&(r($.key),O=""+$.key),"key"in $){q={};for(var ee in $)ee!=="key"&&(q[ee]=$[ee])}else q=$;return O&&a(q,typeof T=="function"?T.displayName||T.name||"Unknown":T),d(T,O,q,o(),ge,se)}function f(T){h(T)?T._store&&(T._store.validated=1):typeof T=="object"&&T!==null&&T.$$typeof===D&&(T._payload.status==="fulfilled"?h(T._payload.value)&&T._payload.value._store&&(T._payload.value._store.validated=1):T._store&&(T._store.validated=1))}function h(T){return typeof T=="object"&&T!==null&&T.$$typeof===w}var p=b,w=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),S=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),I=Symbol.for("react.client.reference"),L=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,G=Array.isArray,B=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(T){return T()}};var F,U={},A=p.react_stack_bottom_frame.bind(p,i)(),X=B(n(i)),re={};fr.Fragment=v,fr.jsx=function(T,$,q){var K=1e4>L.recentlyCreatedOwnerStacks++;return u(T,$,q,!1,K?Error("react-stack-top-frame"):A,K?B(n(T)):X)},fr.jsxs=function(T,$,q){var K=1e4>L.recentlyCreatedOwnerStacks++;return u(T,$,q,!0,K?Error("react-stack-top-frame"):A,K?B(n(T)):X)}})()),fr}var Xi;function Cd(){return Xi||(Xi=1,process.env.NODE_ENV==="production"?qr.exports=kd():qr.exports=Sd()),qr.exports}var c=Cd();const Ji=b.createContext(void 0),Zi=({config:e,children:t})=>c.jsx(Ji.Provider,{value:{registry:e.registry,schemas:e.schemas,tenantId:e.tenantId,assets:e.assets,overlayDisabledSectionTypes:e.overlayDisabledSectionTypes},children:t});function pr(){const e=b.useContext(Ji);if(e===void 0)throw new Error("useConfig must be used within ConfigProvider");return e}const Qi=b.createContext(void 0),Xr=({mode:e,children:t})=>(b.useEffect(()=>{if(e!=="studio")return;const r=new MutationObserver(n=>{n.forEach(o=>{o.addedNodes.forEach(i=>{i instanceof HTMLElement&&i.hasAttribute("data-radix-portal")&&i.setAttribute("data-jp-studio-portal","true")})})});return r.observe(document.body,{childList:!0}),()=>r.disconnect()},[e]),c.jsx(Qi.Provider,{value:{mode:e},children:t})),es=()=>{const e=b.useContext(Qi);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 Ed=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ts=(...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 jd={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 Nd=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:s,...a},l)=>b.createElement("svg",{ref:l,...jd,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:ts("lucide",o),...a},[...s.map(([d,u])=>b.createElement(d,u)),...Array.isArray(i)?i:[i]]));/**
|
|
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 me=(e,t)=>{const r=b.forwardRef(({className:n,...o},i)=>b.createElement(Nd,{ref:i,iconNode:t,className:ts(`lucide-${Ed(e)}`,n),...o}));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 Td=
|
|
47
|
+
*/const Td=me("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 Ad=me("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 zd=me("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 Pd=me("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 so=
|
|
67
|
+
*/const so=me("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 Jr=
|
|
72
|
+
*/const Jr=me("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 Od=me("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 ao=
|
|
82
|
+
*/const ao=me("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 Id=me("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 Dd=me("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 _d=me("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 rs=
|
|
102
|
+
*/const rs=me("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 Zr=
|
|
107
|
+
*/const Zr=me("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 lo=
|
|
112
|
+
*/const lo=me("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 ns=
|
|
117
|
+
*/const ns=me("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 Md=me("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 Rd=me("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 co=
|
|
132
|
+
*/const co=me("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 os=
|
|
137
|
+
*/const os=me("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 Ld=me("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 $d=me("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 Fd=me("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 Wd=me("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 Qr=
|
|
162
|
+
*/const Qr=me("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 Ud=me("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 is=
|
|
172
|
+
*/const is=me("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 Ut=
|
|
177
|
+
*/const Ut=me("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 Hd=he("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 Vd extends b.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(Bd,{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 Kd=({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:oe("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:oe("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(ao,{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(Jr,{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})]})})},hr=({section:e,menu:t,selectedId:r,reorderable:n,sectionIndex:o,totalSections:i,onReorder:s})=>{var k,x;const{mode:a}=es(),{registry:l,overlayDisabledSectionTypes:d}=pr(),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:oe("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(Vd,{type:e.type,children:v()})}),u&&!w&&c.jsx(Kd,{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})]})},Gd=e=>{b.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 mr(e){return typeof e=="object"&&e!==null}function en(e){if(!mr(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Yd(e){return mr(e)&&typeof e.$ref=="string"&&e.$ref.trim().length>0}function qd(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function ss(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=qd(o);if(Array.isArray(n)){const s=Number(i);if(!Number.isInteger(s)||s<0||s>=n.length)return;n=n[s];continue}if(!mr(n)||!(i in n))return;n=n[i]}return n}function Bt(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 Xd(e){const t=Bt(e),r=t.lastIndexOf("/");return r===-1?"":t.slice(0,r)}function Jd(e,t){const r=new Set,n=Bt(e);n&&r.add(n);const o=Xd(t),i=Bt(o?`${o}/${e}`:e);return i&&r.add(i),Array.from(r)}function gr(e){return Array.isArray(e)?e.map(t=>gr(t)):en(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,gr(r)])):e}function br(e,t,r){for(const n of t){const o=Bt(n);o&&e.set(o,r)}}function Zd({pages:e,siteConfig:t,themeConfig:r,menuConfig:n,refDocuments:o}){const i=new Map;br(i,["site.json","config/site.json","src/data/config/site.json"],t),br(i,["theme.json","config/theme.json","src/data/config/theme.json"],r),br(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";br(i,[`pages/${l}.json`,`src/data/pages/${l}.json`],a)}for(const[s,a]of Object.entries(o??{}))br(i,[s],a);return i}function Qd(e,t,r){const[n,o=""]=e.split("#"),i=o?`/${o.replace(/^\//,"")}`:"";if(!n){const s=Bt(t),a=r.documents.get(s);if(a===void 0)return null;const l=ss(a,i);return l===void 0?null:{value:l,documentPath:s}}for(const s of Jd(n,t)){const a=r.documents.get(s);if(a===void 0)continue;const l=ss(a,i);if(l!==void 0)return{value:l,documentPath:s}}return null}function Ot(e,t,r){if(Array.isArray(e))return e.map(n=>Ot(n,t,r));if(!en(e))return e;if(Yd(e)){const n=`${Bt(t)}::${e.$ref}`;if(r.stack.includes(n))return console.warn("[JsonPages] Circular $ref skipped",e.$ref),gr(e);if(r.cache.has(n)){const l=gr(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,Ot(h,t,r)]));return en(l)?{...l,...u}:l}const o=Qd(e.$ref,t,r);if(!o)return console.warn("[JsonPages] Unresolved $ref",e.$ref),Object.fromEntries(Object.entries(e).map(([l,d])=>[l,Ot(d,t,r)]));r.stack.push(n);const i=Ot(o.value,o.documentPath,r);r.stack.pop(),r.cache.set(n,gr(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,Ot(d,t,r)]));return en(i)?{...i,...a}:i}return Object.fromEntries(Object.entries(e).map(([n,o])=>[n,Ot(o,t,r)]))}function tn(e,t,r){return Ot(e,t,{documents:r,cache:new Map,stack:[]})}function uo(e){return mr(e)?typeof e.label=="string"&&typeof e.href=="string":!1}function eu(e){if(!mr(e))return null;const t=e.links;if(Array.isArray(t)&&t.every(uo))return t;const r=e.menu;if(Array.isArray(r)&&r.every(uo))return r;const n=e.menuConfig;return Array.isArray(n)&&n.every(uo)?n:null}function rn(e,t){const r=eu(e);return r||(Array.isArray(t)?t:[])}function nn(e,t){if(e.type==="header")return rn(e.data,t)}function It(e){const t=Zd(e);return{pages:Object.fromEntries(Object.entries(e.pages).map(([r,n])=>[r,tn(n,`pages/${r.replace(/^\/+|\/+$/g,"")||"home"}.json`,t)])),siteConfig:tn(e.siteConfig,"config/site.json",t),themeConfig:tn(e.themeConfig,"config/theme.json",t),menuConfig:tn(e.menuConfig,"config/menu.json",t)}}const tu="application/json",fo=({pageConfig:e,siteConfig:t,menuConfig:r,selectedId:n,onReorder:o,scrollToSectionId:i,onActiveSectionChange:s})=>{var y,k;Gd(e.meta);const[a,l]=b.useState(null),d=b.useRef({}),u=b.useRef(s);u.current=s;const f=Ti(e,t),h=x=>{var S;(S=u.current)==null||S.call(u,x)};b.useEffect(()=>{if(!i)return;const x=d.current[i];x&&x.scrollIntoView({behavior:"smooth",block:"center"})},[i]),b.useEffect(()=>{if(!u.current)return;const S=[...f&&t.header?[t.header.id]:[],...e.sections.map(E=>E.id),...t.footer?[t.footer.id]:[]],C=new IntersectionObserver(E=>{E.forEach(D=>{var R;if(D.isIntersecting&&D.intersectionRatio>.5){const I=D.target.getAttribute("data-section-id");I&&((R=u.current)==null||R.call(u,I))}})},{threshold:[0,.5,1],rootMargin:"-20% 0px -20% 0px"});let j=!1;const N=requestAnimationFrame(()=>{j||S.forEach(E=>{const D=d.current[E];D&&C.observe(D)})});return()=>{j=!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(tu),{sectionId:j}=JSON.parse(C);typeof j=="string"&&o(j,S)}catch{}},v=()=>{const x=typeof o=="function",S=e.sections.map((C,j)=>{const N=a===j;return x?c.jsxs("div",{ref:E=>{d.current[C.id]=E},"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:E=>p(E,j),onDragLeave:w,onDrop:E=>m(E,j)}),c.jsx(hr,{section:C,menu:nn(C,r.main),selectedId:n,reorderable:!0,sectionIndex:j,totalSections:e.sections.length,onReorder:o})]},C.id):c.jsx("div",{ref:E=>{d.current[C.id]=E},"data-section-id":C.id,onMouseEnter:()=>h(C.id),children:c.jsx(hr,{section:C,menu:nn(C,r.main),selectedId:n})},C.id)});if(x&&S.length>0){const C=e.sections.length,j=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:j?"rgba(59, 130, 246, 0.4)":"transparent",borderTop:j?"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(hr,{section:t.header,menu:nn(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(hr,{section:t.footer,selectedId:n})})]})},on=({mode:e,tenantCss:t,adminCss:r,children:n})=>(b.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 ru(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return b.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const sn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ht(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function po(e){return"nodeType"in e}function Fe(e){var t,r;return e?Ht(e)?e:po(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function ho(e){const{Document:t}=Fe(e);return e instanceof t}function vr(e){return Ht(e)?!1:e instanceof Fe(e).HTMLElement}function as(e){return e instanceof Fe(e).SVGElement}function Vt(e){return e?Ht(e)?e.document:po(e)?ho(e)?e:vr(e)||as(e)?e.ownerDocument:document:document:document}const Qe=sn?b.useLayoutEffect:b.useEffect;function an(e){const t=b.useRef(e);return Qe(()=>{t.current=e}),b.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 nu(){const e=b.useRef(null),t=b.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=b.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function xr(e,t){t===void 0&&(t=[e]);const r=b.useRef(e);return Qe(()=>{r.current!==e&&(r.current=e)},t),r}function wr(e,t){const r=b.useRef();return b.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function ln(e){const t=an(e),r=b.useRef(null),n=b.useCallback(o=>{o!==r.current&&(t==null||t(o,r.current)),r.current=o},[]);return[r,n]}function cn(e){const t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current}let mo={};function yr(e,t){return b.useMemo(()=>{if(t)return t;const r=mo[e]==null?0:mo[e]+1;return mo[e]=r,e+"-"+r},[e,t])}function ls(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 Kt=ls(1),kr=ls(-1);function ou(e){return"clientX"in e&&"clientY"in e}function dn(e){if(!e)return!1;const{KeyboardEvent:t}=Fe(e.target);return t&&e instanceof t}function iu(e){if(!e)return!1;const{TouchEvent:t}=Fe(e.target);return t&&e instanceof t}function un(e){if(iu(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 ou(e)?{x:e.clientX,y:e.clientY}:null}const xt=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[xt.Translate.toString(e),xt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),cs="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function su(e){return e.matches(cs)?e:e.querySelector(cs)}const au={display:"none"};function lu(e){let{id:t,value:r}=e;return b.createElement("div",{id:t,style:au},r)}function cu(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 b.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function du(){const[e,t]=b.useState("");return{announce:b.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const ds=b.createContext(null);function uu(e){const t=b.useContext(ds);b.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function fu(){const[e]=b.useState(()=>new Set),t=b.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[b.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 pu={draggable:`
|
|
182
|
+
*/const Bd=me("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 Hd extends b.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(Ud,{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 Vd=({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:oe("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:oe("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(ao,{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(Jr,{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})]})})},hr=({section:e,menu:t,selectedId:r,reorderable:n,sectionIndex:o,totalSections:i,onReorder:s})=>{var k,x;const{mode:a}=es(),{registry:l,overlayDisabledSectionTypes:d}=pr(),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:oe("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(Hd,{type:e.type,children:v()})}),u&&!w&&c.jsx(Vd,{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})]})},Kd=e=>{b.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 mr(e){return typeof e=="object"&&e!==null}function en(e){if(!mr(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Gd(e){return mr(e)&&typeof e.$ref=="string"&&e.$ref.trim().length>0}function Yd(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function ss(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=Yd(o);if(Array.isArray(n)){const s=Number(i);if(!Number.isInteger(s)||s<0||s>=n.length)return;n=n[s];continue}if(!mr(n)||!(i in n))return;n=n[i]}return n}function Bt(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 qd(e){const t=Bt(e),r=t.lastIndexOf("/");return r===-1?"":t.slice(0,r)}function Xd(e,t){const r=new Set,n=Bt(e);n&&r.add(n);const o=qd(t),i=Bt(o?`${o}/${e}`:e);return i&&r.add(i),Array.from(r)}function gr(e){return Array.isArray(e)?e.map(t=>gr(t)):en(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,gr(r)])):e}function br(e,t,r){for(const n of t){const o=Bt(n);o&&e.set(o,r)}}function Jd({pages:e,siteConfig:t,themeConfig:r,menuConfig:n,refDocuments:o}){const i=new Map;br(i,["site.json","config/site.json","src/data/config/site.json"],t),br(i,["theme.json","config/theme.json","src/data/config/theme.json"],r),br(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";br(i,[`pages/${l}.json`,`src/data/pages/${l}.json`],a)}for(const[s,a]of Object.entries(o??{}))br(i,[s],a);return i}function Zd(e,t,r){const[n,o=""]=e.split("#"),i=o?`/${o.replace(/^\//,"")}`:"";if(!n){const s=Bt(t),a=r.documents.get(s);if(a===void 0)return null;const l=ss(a,i);return l===void 0?null:{value:l,documentPath:s}}for(const s of Xd(n,t)){const a=r.documents.get(s);if(a===void 0)continue;const l=ss(a,i);if(l!==void 0)return{value:l,documentPath:s}}return null}function Ot(e,t,r){if(Array.isArray(e))return e.map(n=>Ot(n,t,r));if(!en(e))return e;if(Gd(e)){const n=`${Bt(t)}::${e.$ref}`;if(r.stack.includes(n))return console.warn("[JsonPages] Circular $ref skipped",e.$ref),gr(e);if(r.cache.has(n)){const l=gr(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,Ot(h,t,r)]));return en(l)?{...l,...u}:l}const o=Zd(e.$ref,t,r);if(!o)return console.warn("[JsonPages] Unresolved $ref",e.$ref),Object.fromEntries(Object.entries(e).map(([l,d])=>[l,Ot(d,t,r)]));r.stack.push(n);const i=Ot(o.value,o.documentPath,r);r.stack.pop(),r.cache.set(n,gr(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,Ot(d,t,r)]));return en(i)?{...i,...a}:i}return Object.fromEntries(Object.entries(e).map(([n,o])=>[n,Ot(o,t,r)]))}function tn(e,t,r){return Ot(e,t,{documents:r,cache:new Map,stack:[]})}function uo(e){return mr(e)?typeof e.label=="string"&&typeof e.href=="string":!1}function Qd(e){if(!mr(e))return null;const t=e.links;if(Array.isArray(t)&&t.every(uo))return t;const r=e.menu;if(Array.isArray(r)&&r.every(uo))return r;const n=e.menuConfig;return Array.isArray(n)&&n.every(uo)?n:null}function rn(e,t){const r=Qd(e);return r||(Array.isArray(t)?t:[])}function nn(e,t){if(e.type==="header")return rn(e.data,t)}function It(e){const t=Jd(e);return{pages:Object.fromEntries(Object.entries(e.pages).map(([r,n])=>[r,tn(n,`pages/${r.replace(/^\/+|\/+$/g,"")||"home"}.json`,t)])),siteConfig:tn(e.siteConfig,"config/site.json",t),themeConfig:tn(e.themeConfig,"config/theme.json",t),menuConfig:tn(e.menuConfig,"config/menu.json",t)}}const eu="application/json",fo=({pageConfig:e,siteConfig:t,menuConfig:r,selectedId:n,onReorder:o,scrollToSectionId:i,onActiveSectionChange:s})=>{var y,k;Kd(e.meta);const[a,l]=b.useState(null),d=b.useRef({}),u=b.useRef(s);u.current=s;const f=Ai(e,t),h=x=>{var S;(S=u.current)==null||S.call(u,x)};b.useEffect(()=>{if(!i)return;const x=d.current[i];x&&x.scrollIntoView({behavior:"smooth",block:"center"})},[i]),b.useEffect(()=>{if(!u.current)return;const S=[...f&&t.header?[t.header.id]:[],...e.sections.map(E=>E.id),...t.footer?[t.footer.id]:[]],C=new IntersectionObserver(E=>{E.forEach(D=>{var R;if(D.isIntersecting&&D.intersectionRatio>.5){const I=D.target.getAttribute("data-section-id");I&&((R=u.current)==null||R.call(u,I))}})},{threshold:[0,.5,1],rootMargin:"-20% 0px -20% 0px"});let j=!1;const N=requestAnimationFrame(()=>{j||S.forEach(E=>{const D=d.current[E];D&&C.observe(D)})});return()=>{j=!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(eu),{sectionId:j}=JSON.parse(C);typeof j=="string"&&o(j,S)}catch{}},v=()=>{const x=typeof o=="function",S=e.sections.map((C,j)=>{const N=a===j;return x?c.jsxs("div",{ref:E=>{d.current[C.id]=E},"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:E=>p(E,j),onDragLeave:w,onDrop:E=>m(E,j)}),c.jsx(hr,{section:C,menu:nn(C,r.main),selectedId:n,reorderable:!0,sectionIndex:j,totalSections:e.sections.length,onReorder:o})]},C.id):c.jsx("div",{ref:E=>{d.current[C.id]=E},"data-section-id":C.id,onMouseEnter:()=>h(C.id),children:c.jsx(hr,{section:C,menu:nn(C,r.main),selectedId:n})},C.id)});if(x&&S.length>0){const C=e.sections.length,j=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:j?"rgba(59, 130, 246, 0.4)":"transparent",borderTop:j?"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(hr,{section:t.header,menu:nn(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(hr,{section:t.footer,selectedId:n})})]})},on=({mode:e,tenantCss:t,adminCss:r,children:n})=>(b.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 tu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return b.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const sn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ht(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function po(e){return"nodeType"in e}function We(e){var t,r;return e?Ht(e)?e:po(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function ho(e){const{Document:t}=We(e);return e instanceof t}function vr(e){return Ht(e)?!1:e instanceof We(e).HTMLElement}function as(e){return e instanceof We(e).SVGElement}function Vt(e){return e?Ht(e)?e.document:po(e)?ho(e)?e:vr(e)||as(e)?e.ownerDocument:document:document:document}const et=sn?b.useLayoutEffect:b.useEffect;function an(e){const t=b.useRef(e);return et(()=>{t.current=e}),b.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 ru(){const e=b.useRef(null),t=b.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=b.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function xr(e,t){t===void 0&&(t=[e]);const r=b.useRef(e);return et(()=>{r.current!==e&&(r.current=e)},t),r}function wr(e,t){const r=b.useRef();return b.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function ln(e){const t=an(e),r=b.useRef(null),n=b.useCallback(o=>{o!==r.current&&(t==null||t(o,r.current)),r.current=o},[]);return[r,n]}function cn(e){const t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current}let mo={};function yr(e,t){return b.useMemo(()=>{if(t)return t;const r=mo[e]==null?0:mo[e]+1;return mo[e]=r,e+"-"+r},[e,t])}function ls(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 Kt=ls(1),kr=ls(-1);function nu(e){return"clientX"in e&&"clientY"in e}function dn(e){if(!e)return!1;const{KeyboardEvent:t}=We(e.target);return t&&e instanceof t}function ou(e){if(!e)return!1;const{TouchEvent:t}=We(e.target);return t&&e instanceof t}function un(e){if(ou(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 nu(e)?{x:e.clientX,y:e.clientY}:null}const xt=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[xt.Translate.toString(e),xt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),cs="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function iu(e){return e.matches(cs)?e:e.querySelector(cs)}const su={display:"none"};function au(e){let{id:t,value:r}=e;return b.createElement("div",{id:t,style:su},r)}function lu(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 b.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function cu(){const[e,t]=b.useState("");return{announce:b.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const ds=b.createContext(null);function du(e){const t=b.useContext(ds);b.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function uu(){const[e]=b.useState(()=>new Set),t=b.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[b.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 fu={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
|
-
`},hu={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 mu(e){let{announcements:t=hu,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=pu}=e;const{announce:i,announcement:s}=du(),a=yr("DndLiveRegion"),[l,d]=b.useState(!1);if(b.useEffect(()=>{d(!0)},[]),uu(b.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=b.createElement(b.Fragment,null,b.createElement(lu,{id:n,value:o.draggable}),b.createElement(cu,{id:a,announcement:s}));return r?bt.createPortal(u,r):u}var Te;(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"})(Te||(Te={}));function fn(){}function go(e,t){return b.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function gu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return b.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const et=Object.freeze({x:0,y:0});function us(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function bu(e,t){const r=un(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 fs(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function vu(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function ps(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 hs(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function ms(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 xu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=ms(t,t.left,t.top),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const d=us(ms(l),o);i.push({id:a,data:{droppableContainer:s,value:d}})}}return i.sort(fs)},wu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=ps(t),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const d=ps(l),u=o.reduce((h,p,w)=>h+us(d[w],p),0),f=Number((u/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:f}})}}return i.sort(fs)};function yu(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 ku=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=yu(a,t);l>0&&o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(vu)};function Su(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function gs(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:et}function Cu(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 Eu=Cu(1);function bs(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 ju(e,t,r){const n=bs(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 Nu={ignoreTransform:!1};function Gt(e,t){t===void 0&&(t=Nu);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:u}=Fe(e).getComputedStyle(e);d&&(r=ju(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 vs(e){return Gt(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 Tu(e,t){return t===void 0&&(t=Fe(e).getComputedStyle(e)),t.position==="fixed"}function zu(e,t){t===void 0&&(t=Fe(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 pn(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(ho(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!vr(o)||as(o)||r.includes(o))return r;const i=Fe(e).getComputedStyle(o);return o!==e&&zu(o,i)&&r.push(o),Tu(o,i)?r:n(o.parentNode)}return e?n(e):r}function xs(e){const[t]=pn(e,1);return t??null}function bo(e){return!sn||!e?null:Ht(e)?e:po(e)?ho(e)||e===Vt(e).scrollingElement?window:vr(e)?e:null:null}function ws(e){return Ht(e)?e.scrollX:e.scrollLeft}function ys(e){return Ht(e)?e.scrollY:e.scrollTop}function vo(e){return{x:ws(e),y:ys(e)}}var Pe;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Pe||(Pe={}));function ks(e){return!sn||!e?!1:e===document.scrollingElement}function Ss(e){const t={x:0,y:0},r=ks(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 Pu={x:.2,y:.2};function Ou(e,t,r,n,o){let{top:i,left:s,right:a,bottom:l}=r;n===void 0&&(n=10),o===void 0&&(o=Pu);const{isTop:d,isBottom:u,isLeft:f,isRight:h}=Ss(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=Pe.Backward,w.y=n*Math.abs((t.top+m.height-i)/m.height)):!u&&l>=t.bottom-m.height&&(p.y=Pe.Forward,w.y=n*Math.abs((t.bottom-m.height-l)/m.height)),!h&&a>=t.right-m.width?(p.x=Pe.Forward,w.x=n*Math.abs((t.right-m.width-a)/m.width)):!f&&s<=t.left+m.width&&(p.x=Pe.Backward,w.x=n*Math.abs((t.left+m.width-s)/m.width)),{direction:p,speed:w}}function Iu(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 Cs(e){return e.reduce((t,r)=>Kt(t,vo(r)),et)}function Du(e){return e.reduce((t,r)=>t+ws(r),0)}function _u(e){return e.reduce((t,r)=>t+ys(r),0)}function Es(e,t){if(t===void 0&&(t=Gt),!e)return;const{top:r,left:n,bottom:o,right:i}=t(e);xs(e)&&(o<=0||i<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Mu=[["x",["left","right"],Du],["y",["top","bottom"],_u]];class xo{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=pn(r),o=Cs(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of Mu)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 Sr{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 Ru(e){const{EventTarget:t}=Fe(e);return e instanceof t?e:Vt(e)}function wo(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 js(e){e.preventDefault()}function Lu(e){e.stopPropagation()}var ue;(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"})(ue||(ue={}));const Ns={start:[ue.Space,ue.Enter],cancel:[ue.Esc],end:[ue.Space,ue.Enter,ue.Tab]},$u=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case ue.Right:return{...r,x:r.x+25};case ue.Left:return{...r,x:r.x-25};case ue.Down:return{...r,y:r.y+25};case ue.Up:return{...r,y:r.y-25}}};class yo{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 Sr(Vt(r)),this.windowListeners=new Sr(Fe(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&&Es(n),r(et)}handleKeyDown(t){if(dn(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:i=Ns,coordinateGetter:s=$u,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}:et;this.referenceCoordinates||(this.referenceCoordinates=u);const f=s(t,{active:r,context:n.current,currentCoordinates:u});if(f){const h=kr(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:j}=Ss(m),N=Iu(m),E={x:Math.min(v===ue.Right?N.right-N.width/2:N.right,Math.max(v===ue.Right?N.left:N.left+N.width/2,f.x)),y:Math.min(v===ue.Down?N.bottom-N.height/2:N.bottom,Math.max(v===ue.Down?N.top:N.top+N.height/2,f.y))},D=v===ue.Right&&!k||v===ue.Left&&!x,R=v===ue.Down&&!S||v===ue.Up&&!y;if(D&&E.x!==f.x){const I=m.scrollLeft+h.x,L=v===ue.Right&&I<=C.x||v===ue.Left&&I>=j.x;if(L&&!h.y){m.scrollTo({left:I,behavior:a});return}L?p.x=m.scrollLeft-I:p.x=v===ue.Right?m.scrollLeft-C.x:m.scrollLeft-j.x,p.x&&m.scrollBy({left:-p.x,behavior:a});break}else if(R&&E.y!==f.y){const I=m.scrollTop+h.y,L=v===ue.Down&&I<=C.y||v===ue.Up&&I>=j.y;if(L&&!h.x){m.scrollTo({top:I,behavior:a});return}L?p.y=m.scrollTop-I:p.y=v===ue.Down?m.scrollTop-C.y:m.scrollTop-j.y,p.y&&m.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(t,Kt(kr(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()}}yo.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=Ns,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 As(e){return!!(e&&"distance"in e)}function Ts(e){return!!(e&&"delay"in e)}class ko{constructor(t,r,n){var o;n===void 0&&(n=Ru(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=Vt(s),this.documentListeners=new Sr(this.document),this.listeners=new Sr(n),this.windowListeners=new Sr(Fe(s)),this.initialCoordinates=(o=un(i))!=null?o:et,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,js),this.windowListeners.add(Ze.VisibilityChange,this.handleCancel),this.windowListeners.add(Ze.ContextMenu,js),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(Ts(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(As(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,Lu,{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=un(t))!=null?r:et,d=kr(o,l);if(!n&&a){if(As(a)){if(a.tolerance!=null&&wo(d,a.tolerance))return this.handleCancel();if(wo(d,a.distance))return this.handleStart()}if(Ts(a)&&wo(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===ue.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Fu={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class So extends ko{constructor(t){const{event:r}=t,n=Vt(r.target);super(t,Fu,n)}}So.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 Wu={move:{name:"mousemove"},end:{name:"mouseup"}};var Co;(function(e){e[e.RightClick=2]="RightClick"})(Co||(Co={}));class Uu extends ko{constructor(t){super(t,Wu,Vt(t.event.target))}}Uu.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===Co.RightClick?!1:(n==null||n({event:r}),!0)}}];const Eo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class zs extends ko{constructor(t){super(t,Eo)}static setup(){return window.addEventListener(Eo.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Eo.move.name,t)};function t(){}}}zs.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 Cr;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Cr||(Cr={}));var hn;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(hn||(hn={}));function Bu(e){let{acceleration:t,activator:r=Cr.Pointer,canScroll:n,draggingRect:o,enabled:i,interval:s=5,order:a=hn.TreeOrder,pointerCoordinates:l,scrollableAncestors:d,scrollableAncestorRects:u,delta:f,threshold:h}=e;const p=Vu({delta:f,disabled:!i}),[w,m]=nu(),v=b.useRef({x:0,y:0}),y=b.useRef({x:0,y:0}),k=b.useMemo(()=>{switch(r){case Cr.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Cr.DraggableRect:return o}},[r,o,l]),x=b.useRef(null),S=b.useCallback(()=>{const j=x.current;if(!j)return;const N=v.current.x*y.current.x,E=v.current.y*y.current.y;j.scrollBy(N,E)},[]),C=b.useMemo(()=>a===hn.TreeOrder?[...d].reverse():d,[a,d]);b.useEffect(()=>{if(!i||!d.length||!k){m();return}for(const j of C){if((n==null?void 0:n(j))===!1)continue;const N=d.indexOf(j),E=u[N];if(!E)continue;const{direction:D,speed:R}=Ou(j,E,k,t,h);for(const I of["x","y"])p[I][D[I]]||(R[I]=0,D[I]=0);if(R.x>0||R.y>0){m(),x.current=j,w(S,s),v.current=R,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 Hu={x:{[Pe.Backward]:!1,[Pe.Forward]:!1},y:{[Pe.Backward]:!1,[Pe.Forward]:!1}};function Vu(e){let{delta:t,disabled:r}=e;const n=cn(t);return wr(o=>{if(r||!n||!o)return Hu;const i={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Pe.Backward]:o.x[Pe.Backward]||i.x===-1,[Pe.Forward]:o.x[Pe.Forward]||i.x===1},y:{[Pe.Backward]:o.y[Pe.Backward]||i.y===-1,[Pe.Forward]:o.y[Pe.Forward]||i.y===1}}},[r,t,n])}function Ku(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return wr(o=>{var i;return t==null?null:(i=n??o)!=null?i:null},[n,t])}function Gu(e,t){return b.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 Er;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Er||(Er={}));var jo;(function(e){e.Optimized="optimized"})(jo||(jo={}));const Ps=new Map;function Yu(e,t){let{dragging:r,dependencies:n,config:o}=t;const[i,s]=b.useState(null),{frequency:a,measure:l,strategy:d}=o,u=b.useRef(e),f=v(),h=xr(f),p=b.useCallback(function(y){y===void 0&&(y=[]),!h.current&&s(k=>k===null?y:k.concat(y.filter(x=>!k.includes(x))))},[h]),w=b.useRef(null),m=wr(y=>{if(f&&!r)return Ps;if(!y||y===Ps||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 xo(l(S),S):null;x.rect.current=C,C&&k.set(x.id,C)}return k}return y},[e,i,r,f,l]);return b.useEffect(()=>{u.current=e},[e]),b.useEffect(()=>{f||p()},[r,f]),b.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),b.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 Er.Always:return!1;case Er.BeforeDragging:return r;default:return!r}}}function No(e,t){return wr(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function qu(e,t){return No(e,t)}function Xu(e){let{callback:t,disabled:r}=e;const n=an(t),o=b.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(n)},[n,r]);return b.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function mn(e){let{callback:t,disabled:r}=e;const n=an(t),o=b.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(n)},[r]);return b.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Ju(e){return new xo(Gt(e),e)}function Os(e,t,r){t===void 0&&(t=Ju);const[n,o]=b.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=Xu({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=mn({callback:i});return Qe(()=>{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 Zu(e){const t=No(e);return gs(e,t)}const Is=[];function Qu(e){const t=b.useRef(e),r=wr(n=>e?n&&n!==Is&&e&&t.current&&e.parentNode===t.current.parentNode?n:pn(e):Is,[e]);return b.useEffect(()=>{t.current=e},[e]),r}function ef(e){const[t,r]=b.useState(null),n=b.useRef(e),o=b.useCallback(i=>{const s=bo(i.target);s&&r(a=>a?(a.set(s,vo(s)),new Map(a)):null)},[]);return b.useEffect(()=>{const i=n.current;if(e!==i){s(i);const a=e.map(l=>{const d=bo(l);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,vo(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=bo(l);d==null||d.removeEventListener("scroll",o)})}},[o,e]),b.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>Kt(i,s),et):Cs(e):et,[e,t])}function Ds(e,t){t===void 0&&(t=[]);const r=b.useRef(null);return b.useEffect(()=>{r.current=null},t),b.useEffect(()=>{const n=e!==et;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?kr(e,r.current):et}function tf(e){b.useEffect(()=>{if(!sn)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 rf(e,t){return b.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:i}=n;return r[o]=s=>{i(s,t)},r},{}),[e,t])}function _s(e){return b.useMemo(()=>e?Au(e):null,[e])}const Ms=[];function nf(e,t){t===void 0&&(t=Gt);const[r]=e,n=_s(r?Fe(r):null),[o,i]=b.useState(Ms);function s(){i(()=>e.length?e.map(l=>ks(l)?n:new xo(t(l),l)):Ms)}const a=mn({callback:s});return Qe(()=>{a==null||a.disconnect(),s(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),o}function Rs(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return vr(t)?t:e}function of(e){let{measure:t}=e;const[r,n]=b.useState(null),o=b.useCallback(d=>{for(const{target:u}of d)if(vr(u)){n(f=>{const h=t(u);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),i=mn({callback:o}),s=b.useCallback(d=>{const u=Rs(d);i==null||i.disconnect(),u&&(i==null||i.observe(u)),n(u?t(u):null)},[t,i]),[a,l]=ln(s);return b.useMemo(()=>({nodeRef:a,rect:r,setRef:l}),[r,a,l])}const sf=[{sensor:So,options:{}},{sensor:yo,options:{}}],af={current:{}},gn={draggable:{measure:vs},droppable:{measure:vs,strategy:Er.WhileDragging,frequency:jo.Optimized},dragOverlay:{measure:Gt}};class jr 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 lf={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new jr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:fn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:gn,measureDroppableContainers:fn,windowRect:null,measuringScheduled:!1},Ls={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:fn,draggableNodes:new Map,over:null,measureDroppableContainers:fn},Nr=b.createContext(Ls),$s=b.createContext(lf);function cf(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new jr}}}function df(e,t){switch(t.type){case Te.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Te.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 Te.DragEnd:case Te.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Te.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new jr(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case Te.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 jr(e.droppable.containers);return s.set(r,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case Te.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const i=new jr(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function uf(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=b.useContext(Nr),i=cn(n),s=cn(r==null?void 0:r.id);return b.useEffect(()=>{if(!t&&!n&&i&&s!=null){if(!dn(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=su(u);if(f){f.focus();break}}})}},[n,t,o,s,i]),null}function Fs(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...n}),r):r}function ff(e){return b.useMemo(()=>({draggable:{...gn.draggable,...e==null?void 0:e.draggable},droppable:{...gn.droppable,...e==null?void 0:e.droppable},dragOverlay:{...gn.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 pf(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const i=b.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;Qe(()=>{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=gs(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=xs(d);h&&h.scrollBy({top:f.y,left:f.x})}},[t,s,a,n,r])}const bn=b.createContext({...et,scaleX:1,scaleY:1});var wt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(wt||(wt={}));const hf=b.memo(function(t){var r,n,o,i;let{id:s,accessibility:a,autoScroll:l=!0,children:d,sensors:u=sf,collisionDetection:f=ku,measuring:h,modifiers:p,...w}=t;const m=b.useReducer(df,void 0,cf),[v,y]=m,[k,x]=fu(),[S,C]=b.useState(wt.Uninitialized),j=S===wt.Initialized,{draggable:{active:N,nodes:E,translate:D},droppable:{containers:R}}=v,I=N!=null?E.get(N):null,L=b.useRef({initial:null,translated:null}),M=b.useMemo(()=>{var Ce;return N!=null?{id:N,data:(Ce=I==null?void 0:I.data)!=null?Ce:af,rect:L}:null},[N,I]),Y=b.useRef(null),[H,U]=b.useState(null),[B,T]=b.useState(null),X=xr(w,Object.values(w)),re=yr("DndDescribedBy",s),A=b.useMemo(()=>R.getEnabled(),[R]),W=ff(h),{droppableRects:q,measureDroppableContainers:G,measuringScheduled:me}=Yu(A,{dragging:j,dependencies:[D.x,D.y],config:W.droppable}),se=Ku(E,N),P=b.useMemo(()=>B?un(B):null,[B]),J=it(),te=qu(se,W.draggable.measure);pf({activeNode:N!=null?E.get(N):null,config:J.layoutShiftCompensation,initialRect:te,measure:W.draggable.measure});const F=Os(se,W.draggable.measure,te),ne=Os(se?se.parentElement:null),Q=b.useRef({activatorEvent:null,active:null,activeNode:se,collisionRect:null,collisions:null,droppableRects:q,draggableNodes:E,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),xe=R.getNodeFor((r=Q.current.over)==null?void 0:r.id),ge=of({measure:W.dragOverlay.measure}),ze=(n=ge.nodeRef.current)!=null?n:se,Oe=j?(o=ge.rect)!=null?o:F:null,Be=!!(ge.nodeRef.current&&ge.rect),Nt=Zu(Be?null:F),Xe=_s(ze?Fe(ze):null),He=Qu(j?xe??se:null),Ve=nf(He),mt=Fs(p,{transform:{x:D.x-Nt.x,y:D.y-Nt.y,scaleX:1,scaleY:1},activatorEvent:B,active:M,activeNodeRect:F,containerNodeRect:ne,draggingNodeRect:Oe,over:Q.current.over,overlayNodeRect:ge.rect,scrollableAncestors:He,scrollableAncestorRects:Ve,windowRect:Xe}),ot=P?Kt(P,D):null,At=ef(He),Wr=Ds(At),_=Ds(At,[F]),ee=Kt(mt,Wr),ie=Oe?Eu(Oe,mt):null,fe=M&&ie?f({active:M,collisionRect:ie,droppableRects:q,droppableContainers:A,pointerCoordinates:ot}):null,Ie=hs(fe,"id"),[ye,Ee]=b.useState(null),z=Be?mt:Kt(mt,_),O=Su(z,(i=ye==null?void 0:ye.rect)!=null?i:null,F),$=b.useRef(null),Z=b.useCallback((Ce,Re)=>{let{sensor:Le,options:Se}=Re;if(Y.current==null)return;const $e=E.get(Y.current);if(!$e)return;const De=Ce.nativeEvent,Ke=new Le({active:Y.current,activeNode:$e,event:De,options:Se,context:Q,onAbort(_e){if(!E.get(_e))return;const{onDragAbort:ut}=X.current,gt={id:_e};ut==null||ut(gt),k({type:"onDragAbort",event:gt})},onPending(_e,Tt,ut,gt){if(!E.get(_e))return;const{onDragPending:Br}=X.current,zt={id:_e,constraint:Tt,initialCoordinates:ut,offset:gt};Br==null||Br(zt),k({type:"onDragPending",event:zt})},onStart(_e){const Tt=Y.current;if(Tt==null)return;const ut=E.get(Tt);if(!ut)return;const{onDragStart:gt}=X.current,Ur={activatorEvent:De,active:{id:Tt,data:ut.data,rect:L}};bt.unstable_batchedUpdates(()=>{gt==null||gt(Ur),C(wt.Initializing),y({type:Te.DragStart,initialCoordinates:_e,active:Tt}),k({type:"onDragStart",event:Ur}),U($.current),T(De)})},onMove(_e){y({type:Te.DragMove,coordinates:_e})},onEnd:Ue(Te.DragEnd),onCancel:Ue(Te.DragCancel)});$.current=Ke;function Ue(_e){return async function(){const{active:ut,collisions:gt,over:Ur,scrollAdjustedTranslate:Br}=Q.current;let zt=null;if(ut&&Br){const{cancelDrop:Hr}=X.current;zt={activatorEvent:De,active:ut,collisions:gt,delta:Br,over:Ur},_e===Te.DragEnd&&typeof Hr=="function"&&await Promise.resolve(Hr(zt))&&(_e=Te.DragCancel)}Y.current=null,bt.unstable_batchedUpdates(()=>{y({type:_e}),C(wt.Uninitialized),Ee(null),U(null),T(null),$.current=null;const Hr=_e===Te.DragEnd?"onDragEnd":"onDragCancel";if(zt){const Ni=X.current[Hr];Ni==null||Ni(zt),k({type:Hr,event:zt})}})}}},[E]),ce=b.useCallback((Ce,Re)=>(Le,Se)=>{const $e=Le.nativeEvent,De=E.get(Se);if(Y.current!==null||!De||$e.dndKit||$e.defaultPrevented)return;const Ke={active:De};Ce(Le,Re.options,Ke)===!0&&($e.dndKit={capturedBy:Re.sensor},Y.current=Se,Z(Le,Re))},[E,Z]),de=Gu(u,ce);tf(u),Qe(()=>{F&&S===wt.Initializing&&C(wt.Initialized)},[F,S]),b.useEffect(()=>{const{onDragMove:Ce}=X.current,{active:Re,activatorEvent:Le,collisions:Se,over:$e}=Q.current;if(!Re||!Le)return;const De={active:Re,activatorEvent:Le,collisions:Se,delta:{x:ee.x,y:ee.y},over:$e};bt.unstable_batchedUpdates(()=>{Ce==null||Ce(De),k({type:"onDragMove",event:De})})},[ee.x,ee.y]),b.useEffect(()=>{const{active:Ce,activatorEvent:Re,collisions:Le,droppableContainers:Se,scrollAdjustedTranslate:$e}=Q.current;if(!Ce||Y.current==null||!Re||!$e)return;const{onDragOver:De}=X.current,Ke=Se.get(Ie),Ue=Ke&&Ke.rect.current?{id:Ke.id,rect:Ke.rect.current,data:Ke.data,disabled:Ke.disabled}:null,_e={active:Ce,activatorEvent:Re,collisions:Le,delta:{x:$e.x,y:$e.y},over:Ue};bt.unstable_batchedUpdates(()=>{Ee(Ue),De==null||De(_e),k({type:"onDragOver",event:_e})})},[Ie]),Qe(()=>{Q.current={activatorEvent:B,active:M,activeNode:se,collisionRect:ie,collisions:fe,droppableRects:q,draggableNodes:E,draggingNode:ze,draggingNodeRect:Oe,droppableContainers:R,over:ye,scrollableAncestors:He,scrollAdjustedTranslate:ee},L.current={initial:Oe,translated:ie}},[M,se,fe,ie,E,ze,Oe,q,R,ye,He,ee]),Bu({...J,delta:D,draggingRect:ie,pointerCoordinates:ot,scrollableAncestors:He,scrollableAncestorRects:Ve});const be=b.useMemo(()=>({active:M,activeNode:se,activeNodeRect:F,activatorEvent:B,collisions:fe,containerNodeRect:ne,dragOverlay:ge,draggableNodes:E,droppableContainers:R,droppableRects:q,over:ye,measureDroppableContainers:G,scrollableAncestors:He,scrollableAncestorRects:Ve,measuringConfiguration:W,measuringScheduled:me,windowRect:Xe}),[M,se,F,B,fe,ne,ge,E,R,q,ye,G,He,Ve,W,me,Xe]),je=b.useMemo(()=>({activatorEvent:B,activators:de,active:M,activeNodeRect:F,ariaDescribedById:{draggable:re},dispatch:y,draggableNodes:E,over:ye,measureDroppableContainers:G}),[B,de,M,F,y,re,E,ye,G]);return b.createElement(ds.Provider,{value:x},b.createElement(Nr.Provider,{value:je},b.createElement($s.Provider,{value:be},b.createElement(bn.Provider,{value:O},d)),b.createElement(uf,{disabled:(a==null?void 0:a.restoreFocus)===!1})),b.createElement(mu,{...a,hiddenTextDescribedById:re}));function it(){const Ce=(H==null?void 0:H.autoScrollEnabled)===!1,Re=typeof l=="object"?l.enabled===!1:l===!1,Le=j&&!Ce&&!Re;return typeof l=="object"?{...l,enabled:Le}:{enabled:Le}}}),mf=b.createContext(null),Ws="button",gf="Draggable";function bf(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const i=yr(gf),{activators:s,activatorEvent:a,active:l,activeNodeRect:d,ariaDescribedById:u,draggableNodes:f,over:h}=b.useContext(Nr),{role:p=Ws,roleDescription:w="draggable",tabIndex:m=0}=o??{},v=(l==null?void 0:l.id)===t,y=b.useContext(v?bn:mf),[k,x]=ln(),[S,C]=ln(),j=rf(s,t),N=xr(r);Qe(()=>(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 E=b.useMemo(()=>({role:p,tabIndex:m,"aria-disabled":n,"aria-pressed":v&&p===Ws?!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:E,isDragging:v,listeners:n?void 0:j,node:k,over:h,setNodeRef:x,setActivatorNodeRef:C,transform:y}}function Us(){return b.useContext($s)}const vf="Droppable",xf={timeout:25};function wf(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const i=yr(vf),{active:s,dispatch:a,over:l,measureDroppableContainers:d}=b.useContext(Nr),u=b.useRef({disabled:r}),f=b.useRef(!1),h=b.useRef(null),p=b.useRef(null),{disabled:w,updateMeasurementsFor:m,timeout:v}={...xf,...o},y=xr(m??n),k=b.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=mn({callback:k,disabled:w||!s}),S=b.useCallback((E,D)=>{x&&(D&&(x.unobserve(D),f.current=!1),E&&x.observe(E))},[x]),[C,j]=ln(S),N=xr(t);return b.useEffect(()=>{!x||!C.current||(x.disconnect(),f.current=!1,x.observe(C.current))},[C,x]),b.useEffect(()=>(a({type:Te.RegisterDroppable,element:{id:n,key:i,disabled:r,node:C,rect:h,data:N}}),()=>a({type:Te.UnregisterDroppable,key:i,id:n})),[n]),b.useEffect(()=>{r!==u.current.disabled&&(a({type:Te.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:j}}function yf(e){let{animation:t,children:r}=e;const[n,o]=b.useState(null),[i,s]=b.useState(null),a=cn(r);return!r&&!n&&a&&o(a),Qe(()=>{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]),b.createElement(b.Fragment,null,r,n?b.cloneElement(n,{ref:s}):null)}const kf={x:0,y:0,scaleX:1,scaleY:1};function Sf(e){let{children:t}=e;return b.createElement(Nr.Provider,{value:Ls},b.createElement(bn.Provider,{value:kf},t))}const Cf={position:"fixed",touchAction:"none"},Ef=e=>dn(e)?"transform 250ms ease":void 0,jf=b.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:o,children:i,className:s,rect:a,style:l,transform:d,transition:u=Ef}=e;if(!a)return null;const f=o?d:{...d,scaleX:1,scaleY:1},h={...Cf,width:a.width,height:a.height,top:a.top,left:a.left,transform:xt.Transform.toString(f),transformOrigin:o&&n?bu(n,a):void 0,transition:typeof u=="function"?u(n):u,...l};return b.createElement(r,{className:s,style:h,ref:t},i)}),Nf={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:xt.Transform.toString(t)},{transform:xt.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 an((i,s)=>{if(t===null)return;const a=r.get(i);if(!a)return;const l=a.node.current;if(!l)return;const d=Rs(s);if(!d)return;const{transform:u}=Fe(s).getComputedStyle(s),f=bs(u);if(!f)return;const h=typeof t=="function"?t:Tf(t);return Es(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 Tf(e){const{duration:t,easing:r,sideEffects:n,keyframes:o}={...Nf,...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 Bs=0;function zf(e){return b.useMemo(()=>{if(e!=null)return Bs++,Bs},[e])}const Pf=b.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}=Us(),j=b.useContext(bn),N=zf(f==null?void 0:f.id),E=Fs(s,{activatorEvent:u,active:f,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:v.rect,over:y,overlayNodeRect:v.rect,scrollableAncestors:x,scrollableAncestorRects:S,transform:j,windowRect:C}),D=No(h),R=Af({config:n,draggableNodes:w,droppableContainers:m,measuringConfiguration:k}),I=D?v.setRef:void 0;return b.createElement(Sf,null,b.createElement(yf,{animation:R},f&&N?b.createElement(jf,{key:N,id:f.id,ref:I,as:a,activatorEvent:u,adjustScale:t,className:l,transition:i,rect:D,style:{zIndex:d,...o},transform:E},r):null))}),Of=e=>{let{transform:t}=e;return{...t,x:0}};function Hs(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function If(e,t){return e.reduce((r,n,o)=>{const i=t.get(n);return i&&(r[o]=i),r},Array(e.length))}function vn(e){return e!==null&&e>=0}function Df(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 _f(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Vs=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const i=Hs(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}},xn={scaleX:1,scaleY:1},Mf=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,...xn}:null}const l=Rf(i,o,r);return o>r&&o<=s?{x:0,y:-a.height-l,...xn}:o<r&&o>=s?{x:0,y:a.height+l,...xn}:{x:0,y:0,...xn}};function Rf(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 Ks="Sortable",Gs=b.createContext({activeIndex:-1,containerId:Ks,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Vs,disabled:{draggable:!1,droppable:!1}});function Lf(e){let{children:t,id:r,items:n,strategy:o=Vs,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:d,measureDroppableContainers:u}=Us(),f=yr(Ks,r),h=a.rect!==null,p=b.useMemo(()=>n.map(j=>typeof j=="object"&&"id"in j?j.id:j),[n]),w=s!=null,m=s?p.indexOf(s.id):-1,v=d?p.indexOf(d.id):-1,y=b.useRef(p),k=!Df(p,y.current),x=v!==-1&&m===-1||k,S=_f(i);Qe(()=>{k&&w&&u(p)},[k,p,w,u]),b.useEffect(()=>{y.current=p},[p]);const C=b.useMemo(()=>({activeIndex:m,containerId:f,disabled:S,disableTransforms:x,items:p,overIndex:v,useDragOverlay:h,sortedRects:If(p,l),strategy:o}),[m,f,S.draggable,S.droppable,x,p,v,l,h,o]);return b.createElement(Gs.Provider,{value:C},t)}const $f=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return Hs(r,n,o).indexOf(t)},Ff=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},Wf={duration:200,easing:"ease"},Ys="transform",Uf=xt.Transition.toString({property:Ys,duration:0,easing:"linear"}),Bf={roleDescription:"sortable"};function Hf(e){let{disabled:t,index:r,node:n,rect:o}=e;const[i,s]=b.useState(null),a=b.useRef(r);return Qe(()=>{if(!t&&r!==a.current&&n.current){const l=o.current;if(l){const d=Gt(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]),b.useEffect(()=>{i&&s(null)},[i]),i}function Vf(e){let{animateLayoutChanges:t=Ff,attributes:r,disabled:n,data:o,getNewIndex:i=$f,id:s,strategy:a,resizeObserverConfig:l,transition:d=Wf}=e;const{items:u,containerId:f,activeIndex:h,disabled:p,disableTransforms:w,sortedRects:m,overIndex:v,useDragOverlay:y,strategy:k}=b.useContext(Gs),x=Kf(n,p),S=u.indexOf(s),C=b.useMemo(()=>({sortable:{containerId:f,index:S,items:u},...o}),[f,o,S,u]),j=b.useMemo(()=>u.slice(u.indexOf(s)),[u,s]),{rect:N,node:E,isOver:D,setNodeRef:R}=wf({id:s,data:C,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...l}}),{active:I,activatorEvent:L,activeNodeRect:M,attributes:Y,setNodeRef:H,listeners:U,isDragging:B,over:T,setActivatorNodeRef:X,transform:re}=bf({id:s,data:C,attributes:{...Bf,...r},disabled:x.draggable}),A=ru(R,H),W=!!I,q=W&&!w&&vn(h)&&vn(v),G=!y&&B,me=G&&q?re:null,P=q?me??(a??k)({rects:m,activeNodeRect:M,activeIndex:h,overIndex:v,index:S}):null,J=vn(h)&&vn(v)?i({id:s,items:u,activeIndex:h,overIndex:v}):S,te=I==null?void 0:I.id,F=b.useRef({activeId:te,items:u,newIndex:J,containerId:f}),ne=u!==F.current.items,Q=t({active:I,containerId:f,isDragging:B,isSorting:W,id:s,index:S,items:u,newIndex:F.current.newIndex,previousItems:F.current.items,previousContainerId:F.current.containerId,transition:d,wasDragging:F.current.activeId!=null}),xe=Hf({disabled:!Q,index:S,node:E,rect:N});return b.useEffect(()=>{W&&F.current.newIndex!==J&&(F.current.newIndex=J),f!==F.current.containerId&&(F.current.containerId=f),u!==F.current.items&&(F.current.items=u)},[W,J,f,u]),b.useEffect(()=>{if(te===F.current.activeId)return;if(te!=null&&F.current.activeId==null){F.current.activeId=te;return}const ze=setTimeout(()=>{F.current.activeId=te},50);return()=>clearTimeout(ze)},[te]),{active:I,activeIndex:h,attributes:Y,data:C,rect:N,index:S,newIndex:J,items:u,isOver:D,isSorting:W,isDragging:B,listeners:U,node:E,overIndex:v,over:T,setNodeRef:A,setActivatorNodeRef:X,setDroppableNodeRef:R,setDraggableNodeRef:H,transform:xe??P,transition:ge()};function ge(){if(xe||ne&&F.current.newIndex===S)return Uf;if(!(G&&!dn(L)||!d)&&(W||Q))return xt.Transition.toString({...d,property:Ys})}}function Kf(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 wn(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 Gf=[ue.Down,ue.Right,ue.Up,ue.Left],Yf=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:i,over:s,scrollableAncestors:a}}=t;if(Gf.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 ue.Down:n.top<h.top&&l.push(f);break;case ue.Up:n.top>h.top&&l.push(f);break;case ue.Left:n.left>h.left&&l.push(f);break;case ue.Right:n.left<h.left&&l.push(f);break}});const d=wu({collisionRect:n,droppableRects:o,droppableContainers:l});let u=hs(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=pn(w).some((j,N)=>a[N]!==j),y=qs(f,h),k=qf(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:kr(S,x)}}}};function qs(e,t){return!wn(e)||!wn(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function qf(e,t){return!wn(e)||!wn(t)||!qs(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function Ao({className:e,type:t,...r}){return c.jsx("input",{type:t,className:oe("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 Xf({className:e,...t}){return c.jsx("textarea",{className:oe("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 Jf({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:oe("size-4 rounded border border-zinc-700 bg-zinc-900 text-blue-600 focus:ring-2 focus:ring-blue-600",e),...n})}function Dt({className:e,...t}){return c.jsx("label",{className:oe("text-sm font-medium leading-none select-none",e),...t})}function Xs(e,[t,r]){return Math.min(r,Math.max(t,e))}function pe(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=g.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=g.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=g.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=>g.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return g.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[n,Zf(o,...t)]}function Zf(...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 g.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}function Js(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Zs(...e){return t=>{let r=!1;const n=e.map(o=>{const i=Js(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():Js(e[o],null)}}}}function ke(...e){return g.useCallback(Zs(...e),e)}function Yt(e){const t=ep(e),r=g.forwardRef((n,o)=>{const{children:i,...s}=n,a=g.Children.toArray(i),l=a.find(rp);if(l){const d=l.props.children,u=a.map(f=>f===l?g.Children.count(d)>1?g.Children.only(null):g.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...s,ref:o,children:g.isValidElement(d)?g.cloneElement(d,void 0,u):null})}return c.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var Qf=Yt("Slot");function ep(e){const t=g.forwardRef((r,n)=>{const{children:o,...i}=r;if(g.isValidElement(o)){const s=op(o),a=np(i,o.props);return o.type!==g.Fragment&&(a.ref=n?Zs(n,s):s),g.cloneElement(o,a)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qs=Symbol("radix.slottable");function tp(e){const t=({children:r})=>c.jsx(c.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=Qs,t}function rp(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qs}function np(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 op(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 ip(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=b.useRef(null),x=b.useRef(new Map).current;return c.jsx(o,{scope:v,itemMap:x,collectionRef:k,children:y})};s.displayName=t;const a=e+"CollectionSlot",l=Yt(a),d=b.forwardRef((m,v)=>{const{scope:y,children:k}=m,x=i(a,y),S=ke(v,x.collectionRef);return c.jsx(l,{ref:S,children:k})});d.displayName=a;const u=e+"CollectionItemSlot",f="data-radix-collection-item",h=Yt(u),p=b.forwardRef((m,v)=>{const{scope:y,children:k,...x}=m,S=b.useRef(null),C=ke(v,S),j=i(u,y);return b.useEffect(()=>(j.itemMap.set(S,{ref:S,...x}),()=>void j.itemMap.delete(S))),c.jsx(h,{[f]:"",ref:C,children:k})});p.displayName=u;function w(m){const v=i(e+"CollectionConsumer",m);return b.useCallback(()=>{const k=v.collectionRef.current;if(!k)return[];const x=Array.from(k.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((j,N)=>x.indexOf(j.ref.current)-x.indexOf(N.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:d,ItemSlot:p},w,n]}var sp=g.createContext(void 0);function ap(e){const t=g.useContext(sp);return e||t||"ltr"}var lp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],we=lp.reduce((e,t)=>{const r=Yt(`Primitive.${t}`),n=g.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 cp(e,t){e&&Vr.flushSync(()=>e.dispatchEvent(t))}function _t(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function dp(e,t=globalThis==null?void 0:globalThis.document){const r=_t(e);g.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 up="DismissableLayer",To="dismissableLayer.update",fp="dismissableLayer.pointerDownOutside",pp="dismissableLayer.focusOutside",ea,ta=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yn=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,d=g.useContext(ta),[u,f]=g.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=g.useState({}),w=ke(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=gp(N=>{const E=N.target,D=[...d.branches].some(R=>R.contains(E));!S||D||(o==null||o(N),s==null||s(N),N.defaultPrevented||a==null||a())},h),j=bp(N=>{const E=N.target;[...d.branches].some(R=>R.contains(E))||(i==null||i(N),s==null||s(N),N.defaultPrevented||a==null||a())},h);return dp(N=>{k===d.layers.size-1&&(n==null||n(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},h),g.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ea=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),ra(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=ea)}},[u,h,r,d]),g.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),ra())},[u,d]),g.useEffect(()=>{const N=()=>p({});return document.addEventListener(To,N),()=>document.removeEventListener(To,N)},[]),c.jsx(we.div,{...l,ref:w,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:pe(e.onFocusCapture,j.onFocusCapture),onBlurCapture:pe(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:pe(e.onPointerDownCapture,C.onPointerDownCapture)})});yn.displayName=up;var hp="DismissableLayerBranch",mp=g.forwardRef((e,t)=>{const r=g.useContext(ta),n=g.useRef(null),o=ke(t,n);return g.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),c.jsx(we.div,{...e,ref:o})});mp.displayName=hp;function gp(e,t=globalThis==null?void 0:globalThis.document){const r=_t(e),n=g.useRef(!1),o=g.useRef(()=>{});return g.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let l=function(){na(fp,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 bp(e,t=globalThis==null?void 0:globalThis.document){const r=_t(e),n=g.useRef(!1);return g.useEffect(()=>{const o=i=>{i.target&&!n.current&&na(pp,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 ra(){const e=new CustomEvent(To);document.dispatchEvent(e)}function na(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?cp(o,i):o.dispatchEvent(i)}var zo=0;function oa(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ia()),document.body.insertAdjacentElement("beforeend",e[1]??ia()),zo++,()=>{zo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),zo--}},[])}function ia(){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 Po="focusScope.autoFocusOnMount",Oo="focusScope.autoFocusOnUnmount",sa={bubbles:!1,cancelable:!0},vp="FocusScope",Io=g.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=g.useState(null),d=_t(o),u=_t(i),f=g.useRef(null),h=ke(t,m=>l(m)),p=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(n){let m=function(x){if(p.paused||!a)return;const S=x.target;a.contains(S)?f.current=S:yt(f.current,{select:!0})},v=function(x){if(p.paused||!a)return;const S=x.relatedTarget;S!==null&&(a.contains(S)||yt(f.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const C of x)C.removedNodes.length>0&&yt(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]),g.useEffect(()=>{if(a){ca.add(p);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(Po,sa);a.addEventListener(Po,d),a.dispatchEvent(y),y.defaultPrevented||(xp(Cp(aa(a)),{select:!0}),document.activeElement===m&&yt(a))}return()=>{a.removeEventListener(Po,d),setTimeout(()=>{const y=new CustomEvent(Oo,sa);a.addEventListener(Oo,u),a.dispatchEvent(y),y.defaultPrevented||yt(m??document.body,{select:!0}),a.removeEventListener(Oo,u),ca.remove(p)},0)}}},[a,d,u,p]);const w=g.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]=wp(k);x&&S?!m.shiftKey&&y===S?(m.preventDefault(),r&&yt(x,{select:!0})):m.shiftKey&&y===x&&(m.preventDefault(),r&&yt(S,{select:!0})):y===k&&m.preventDefault()}},[r,n,p.paused]);return c.jsx(we.div,{tabIndex:-1,...s,ref:h,onKeyDown:w})});Io.displayName=vp;function xp(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(yt(n,{select:t}),document.activeElement!==r)return}function wp(e){const t=aa(e),r=la(t,e),n=la(t.reverse(),e);return[r,n]}function aa(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 la(e,t){for(const r of e)if(!yp(r,{upTo:t}))return r}function yp(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 kp(e){return e instanceof HTMLInputElement&&"select"in e}function yt(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&kp(e)&&t&&e.select()}}var ca=Sp();function Sp(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=da(e,t),e.unshift(t)},remove(t){var r;e=da(e,t),(r=e[0])==null||r.resume()}}}function da(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Cp(e){return e.filter(t=>t.tagName!=="A")}var Me=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},Ep=g[" useId ".trim().toString()]||(()=>{}),jp=0;function Tr(e){const[t,r]=g.useState(Ep());return Me(()=>{r(n=>n??String(jp++))},[e]),t?`radix-${t}`:""}const Np=["top","right","bottom","left"],kt=Math.min,Ge=Math.max,kn=Math.round,Sn=Math.floor,st=e=>({x:e,y:e}),Ap={left:"right",right:"left",bottom:"top",top:"bottom"},Tp={start:"end",end:"start"};function Do(e,t,r){return Ge(e,kt(t,r))}function pt(e,t){return typeof e=="function"?e(t):e}function ht(e){return e.split("-")[0]}function qt(e){return e.split("-")[1]}function _o(e){return e==="x"?"y":"x"}function Mo(e){return e==="y"?"height":"width"}const zp=new Set(["top","bottom"]);function at(e){return zp.has(ht(e))?"y":"x"}function Ro(e){return _o(at(e))}function Pp(e,t,r){r===void 0&&(r=!1);const n=qt(e),o=Ro(e),i=Mo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Cn(s)),[s,Cn(s)]}function Op(e){const t=Cn(e);return[Lo(e),t,Lo(t)]}function Lo(e){return e.replace(/start|end/g,t=>Tp[t])}const ua=["left","right"],fa=["right","left"],Ip=["top","bottom"],Dp=["bottom","top"];function _p(e,t,r){switch(e){case"top":case"bottom":return r?t?fa:ua:t?ua:fa;case"left":case"right":return t?Ip:Dp;default:return[]}}function Mp(e,t,r,n){const o=qt(e);let i=_p(ht(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Lo)))),i}function Cn(e){return e.replace(/left|right|bottom|top/g,t=>Ap[t])}function Rp(e){return{top:0,right:0,bottom:0,left:0,...e}}function pa(e){return typeof e!="number"?Rp(e):{top:e,right:e,bottom:e,left:e}}function En(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 ha(e,t,r){let{reference:n,floating:o}=e;const i=at(t),s=Ro(t),a=Mo(s),l=ht(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(qt(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 Lp(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}=pt(t,e),w=pa(p),v=a[h?f==="floating"?"reference":"floating":f],y=En(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=En(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 $p=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}=ha(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:j}=await k({x:u,y:f,initialPlacement:n,placement:h,strategy:o,middlewareData:p,rects:d,platform:{...s,detectOverflow:(m=s.detectOverflow)!=null?m:Lp},elements:{reference:e,floating:t}});u=x??u,f=S??f,p={...p,[y]:{...p[y],...C}},j&&w<=50&&(w++,typeof j=="object"&&(j.placement&&(h=j.placement),j.rects&&(d=j.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):j.rects),{x:u,y:f}=ha(d,h,l)),v=-1)}return{x:u,y:f,placement:h,strategy:o,middlewareData:p}},Fp=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}=pt(e,t)||{};if(d==null)return{};const f=pa(u),h={x:r,y:n},p=Ro(o),w=Mo(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],j=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let N=j?j[x]:0;(!N||!await(s.isElement==null?void 0:s.isElement(j)))&&(N=a.floating[x]||i.floating[w]);const E=S/2-C/2,D=N/2-m[w]/2-1,R=kt(f[y],D),I=kt(f[k],D),L=R,M=N-m[w]-I,Y=N/2-m[w]/2+E,H=Do(L,Y,M),U=!l.arrow&&qt(o)!=null&&Y!==H&&i.reference[w]/2-(Y<L?R:I)-m[w]/2<0,B=U?Y<L?Y-L:Y-M:0;return{[p]:h[p]+B,data:{[p]:H,centerOffset:Y-H-B,...U&&{alignmentOffset:B}},reset:U}}}),Wp=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}=pt(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const y=ht(o),k=at(a),x=ht(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(d.floating)),C=h||(x||!m?[Cn(a)]:Op(a)),j=w!=="none";!h&&j&&C.push(...Mp(a,m,w,S));const N=[a,...C],E=await l.detectOverflow(t,v),D=[];let R=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&D.push(E[y]),f){const Y=Pp(o,s,S);D.push(E[Y[0]],E[Y[1]])}if(R=[...R,{placement:o,overflows:D}],!D.every(Y=>Y<=0)){var I,L;const Y=(((I=i.flip)==null?void 0:I.index)||0)+1,H=N[Y];if(H&&(!(f==="alignment"?k!==at(H):!1)||R.every(T=>at(T.placement)===k?T.overflows[0]>0:!0)))return{data:{index:Y,overflows:R},reset:{placement:H}};let U=(L=R.filter(B=>B.overflows[0]<=0).sort((B,T)=>B.overflows[1]-T.overflows[1])[0])==null?void 0:L.placement;if(!U)switch(p){case"bestFit":{var M;const B=(M=R.filter(T=>{if(j){const X=at(T.placement);return X===k||X==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(X=>X>0).reduce((X,re)=>X+re,0)]).sort((T,X)=>T[1]-X[1])[0])==null?void 0:M[0];B&&(U=B);break}case"initialPlacement":U=a;break}if(o!==U)return{reset:{placement:U}}}return{}}}};function ma(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ga(e){return Np.some(t=>e[t]>=0)}const Up=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:o="referenceHidden",...i}=pt(e,t);switch(o){case"referenceHidden":{const s=await n.detectOverflow(t,{...i,elementContext:"reference"}),a=ma(s,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ga(a)}}}case"escaped":{const s=await n.detectOverflow(t,{...i,altBoundary:!0}),a=ma(s,r.floating);return{data:{escapedOffsets:a,escaped:ga(a)}}}default:return{}}}}},ba=new Set(["left","top"]);async function Bp(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=ht(r),a=qt(r),l=at(r)==="y",d=ba.has(s)?-1:1,u=i&&l?-1:1,f=pt(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 Hp=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 Bp(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}}}}},Vp=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}=pt(e,t),u={x:r,y:n},f=await i.detectOverflow(t,d),h=at(ht(o)),p=_o(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=Do(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=Do(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}}}}}},Kp=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}=pt(e,t),u={x:r,y:n},f=at(o),h=_o(f);let p=u[h],w=u[f];const m=pt(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=ba.has(ht(o)),C=i.reference[f]-i.floating[x]+(S&&((y=s.offset)==null?void 0:y[f])||0)+(S?0:v.crossAxis),j=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>j&&(w=j)}return{[h]:p,[f]:w}}}},Gp=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}=pt(e,t),u=await s.detectOverflow(t,d),f=ht(o),h=qt(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=kt(m-u[v],k),C=kt(w-u[y],x),j=!t.middlewareData.shift;let N=S,E=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(N=k),j&&!h){const R=Ge(u.left,0),I=Ge(u.right,0),L=Ge(u.top,0),M=Ge(u.bottom,0);p?E=w-2*(R!==0||I!==0?R+I:Ge(u.left,u.right)):N=m-2*(L!==0||M!==0?L+M:Ge(u.top,u.bottom))}await l({...t,availableWidth:E,availableHeight:N});const D=await s.getDimensions(a.floating);return w!==D.width||m!==D.height?{reset:{rects:!0}}:{}}}};function jn(){return typeof window<"u"}function Xt(e){return va(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=(va(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function va(e){return jn()?e instanceof Node||e instanceof Ye(e).Node:!1}function tt(e){return jn()?e instanceof Element||e instanceof Ye(e).Element:!1}function ct(e){return jn()?e instanceof HTMLElement||e instanceof Ye(e).HTMLElement:!1}function xa(e){return!jn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ye(e).ShadowRoot}const Yp=new Set(["inline","contents"]);function zr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=rt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Yp.has(o)}const qp=new Set(["table","td","th"]);function Xp(e){return qp.has(Xt(e))}const Jp=[":popover-open",":modal"];function Nn(e){return Jp.some(t=>{try{return e.matches(t)}catch{return!1}})}const Zp=["transform","translate","scale","rotate","perspective"],Qp=["transform","translate","scale","rotate","perspective","filter"],eh=["paint","layout","strict","content"];function $o(e){const t=Fo(),r=tt(e)?rt(e):e;return Zp.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)||Qp.some(n=>(r.willChange||"").includes(n))||eh.some(n=>(r.contain||"").includes(n))}function th(e){let t=St(e);for(;ct(t)&&!Jt(t);){if($o(t))return t;if(Nn(t))return null;t=St(t)}return null}function Fo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const rh=new Set(["html","body","#document"]);function Jt(e){return rh.has(Xt(e))}function rt(e){return Ye(e).getComputedStyle(e)}function An(e){return tt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function St(e){if(Xt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||xa(e)&&e.host||lt(e);return xa(t)?t.host:t}function wa(e){const t=St(e);return Jt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ct(t)&&zr(t)?t:wa(t)}function Pr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=wa(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=Ye(o);if(i){const a=Wo(s);return t.concat(s,s.visualViewport||[],zr(o)?o:[],a&&r?Pr(a):[])}return t.concat(o,Pr(o,[],r))}function Wo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ya(e){const t=rt(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=kn(r)!==i||kn(n)!==s;return a&&(r=i,n=s),{width:r,height:n,$:a}}function Uo(e){return tt(e)?e:e.contextElement}function Zt(e){const t=Uo(e);if(!ct(t))return st(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=ya(t);let s=(i?kn(r.width):r.width)/n,a=(i?kn(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const nh=st(0);function ka(e){const t=Ye(e);return!Fo()||!t.visualViewport?nh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function oh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Ye(e)?!1:t}function Mt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=Uo(e);let s=st(1);t&&(n?tt(n)&&(s=Zt(n)):s=Zt(e));const a=oh(i,r,n)?ka(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&&tt(n)?Ye(n):n;let w=h,m=Wo(w);for(;m&&n&&p!==w;){const v=Zt(m),y=m.getBoundingClientRect(),k=rt(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=Wo(w)}}return En({width:u,height:f,x:l,y:d})}function Tn(e,t){const r=An(e).scrollLeft;return t?t.left+r:Mt(lt(e)).left+r}function Sa(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Tn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function ih(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=lt(n),a=t?Nn(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)&&((Xt(n)!=="body"||zr(s))&&(l=An(n)),ct(n))){const p=Mt(n);d=Zt(n),u.x=p.x+n.clientLeft,u.y=p.y+n.clientTop}const h=s&&!f&&!i?Sa(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 sh(e){return Array.from(e.getClientRects())}function ah(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+Tn(e);const a=-r.scrollTop;return rt(n).direction==="rtl"&&(s+=Ge(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:a}}const Ca=25;function lh(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=Fo();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const d=Tn(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<=Ca&&(i-=w)}else d<=Ca&&(i+=d);return{width:i,height:s,x:a,y:l}}const ch=new Set(["absolute","fixed"]);function dh(e,t){const r=Mt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=ct(e)?Zt(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 Ea(e,t,r){let n;if(t==="viewport")n=lh(e,r);else if(t==="document")n=ah(lt(e));else if(tt(t))n=dh(t,r);else{const o=ka(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return En(n)}function ja(e,t){const r=St(e);return r===t||!tt(r)||Jt(r)?!1:rt(r).position==="fixed"||ja(r,t)}function uh(e,t){const r=t.get(e);if(r)return r;let n=Pr(e,[],!1).filter(a=>tt(a)&&Xt(a)!=="body"),o=null;const i=rt(e).position==="fixed";let s=i?St(e):e;for(;tt(s)&&!Jt(s);){const a=rt(s),l=$o(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&ch.has(o.position)||zr(s)&&!l&&ja(e,s))?n=n.filter(u=>u!==s):o=a,s=St(s)}return t.set(e,n),n}function fh(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?Nn(t)?[]:uh(t,this._c):[].concat(r),n],a=s[0],l=s.reduce((d,u)=>{const f=Ea(t,u,o);return d.top=Ge(f.top,d.top),d.right=kt(f.right,d.right),d.bottom=kt(f.bottom,d.bottom),d.left=Ge(f.left,d.left),d},Ea(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function ph(e){const{width:t,height:r}=ya(e);return{width:t,height:r}}function hh(e,t,r){const n=ct(t),o=lt(t),i=r==="fixed",s=Mt(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=st(0);function d(){l.x=Tn(o)}if(n||!n&&!i)if((Xt(t)!=="body"||zr(o))&&(a=An(t)),n){const p=Mt(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?Sa(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 Bo(e){return rt(e).position==="static"}function Na(e,t){if(!ct(e)||rt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return lt(e)===r&&(r=r.ownerDocument.body),r}function Aa(e,t){const r=Ye(e);if(Nn(e))return r;if(!ct(e)){let o=St(e);for(;o&&!Jt(o);){if(tt(o)&&!Bo(o))return o;o=St(o)}return r}let n=Na(e,t);for(;n&&Xp(n)&&Bo(n);)n=Na(n,t);return n&&Jt(n)&&Bo(n)&&!$o(n)?r:n||th(e)||r}const mh=async function(e){const t=this.getOffsetParent||Aa,r=this.getDimensions,n=await r(e.floating);return{reference:hh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function gh(e){return rt(e).direction==="rtl"}const bh={convertOffsetParentRelativeRectToViewportRelativeRect:ih,getDocumentElement:lt,getClippingRect:fh,getOffsetParent:Aa,getElementRects:mh,getClientRects:sh,getDimensions:ph,getScale:Zt,isElement:tt,isRTL:gh};function Ta(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vh(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=Sn(f),m=Sn(o.clientWidth-(u+h)),v=Sn(o.clientHeight-(f+p)),y=Sn(u),x={rootMargin:-w+"px "+-m+"px "+-v+"px "+-y+"px",threshold:Ge(0,kt(1,l))||1};let S=!0;function C(j){const N=j[0].intersectionRatio;if(N!==l){if(!S)return s();N?s(!1,N):n=setTimeout(()=>{s(!1,1e-7)},1e3)}N===1&&!Ta(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 xh(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=Uo(e),u=o||i?[...d?Pr(d):[],...Pr(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",r,{passive:!0}),i&&y.addEventListener("resize",r)});const f=d&&a?vh(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?Mt(e):null;l&&v();function v(){const y=Mt(e);m&&!Ta(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 wh=Hp,yh=Vp,kh=Wp,Sh=Gp,Ch=Up,za=Fp,Eh=Kp,jh=(e,t,r)=>{const n=new Map,o={platform:bh,...r},i={...o.platform,_c:n};return $p(e,t,{...o,platform:i})};var Nh=typeof document<"u",Ah=function(){},zn=Nh?b.useLayoutEffect:Ah;function Pn(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(!Pn(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)&&!Pn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Pa(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Oa(e,t){const r=Pa(e);return Math.round(t*r)/r}function Ho(e){const t=g.useRef(e);return zn(()=>{t.current=e}),t}function Th(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]=g.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=g.useState(n);Pn(h,n)||p(n);const[w,m]=g.useState(null),[v,y]=g.useState(null),k=g.useCallback(T=>{T!==j.current&&(j.current=T,m(T))},[]),x=g.useCallback(T=>{T!==N.current&&(N.current=T,y(T))},[]),S=i||w,C=s||v,j=g.useRef(null),N=g.useRef(null),E=g.useRef(u),D=l!=null,R=Ho(l),I=Ho(o),L=Ho(d),M=g.useCallback(()=>{if(!j.current||!N.current)return;const T={placement:t,strategy:r,middleware:h};I.current&&(T.platform=I.current),jh(j.current,N.current,T).then(X=>{const re={...X,isPositioned:L.current!==!1};Y.current&&!Pn(E.current,re)&&(E.current=re,Vr.flushSync(()=>{f(re)}))})},[h,t,r,I,L]);zn(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(T=>({...T,isPositioned:!1})))},[d]);const Y=g.useRef(!1);zn(()=>(Y.current=!0,()=>{Y.current=!1}),[]),zn(()=>{if(S&&(j.current=S),C&&(N.current=C),S&&C){if(R.current)return R.current(S,C,M);M()}},[S,C,M,R,D]);const H=g.useMemo(()=>({reference:j,floating:N,setReference:k,setFloating:x}),[k,x]),U=g.useMemo(()=>({reference:S,floating:C}),[S,C]),B=g.useMemo(()=>{const T={position:r,left:0,top:0};if(!U.floating)return T;const X=Oa(U.floating,u.x),re=Oa(U.floating,u.y);return a?{...T,transform:"translate("+X+"px, "+re+"px)",...Pa(U.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:X,top:re}},[r,a,U.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:M,refs:H,elements:U,floatingStyles:B}),[u,M,H,U,B])}const zh=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?za({element:n.current,padding:o}).fn(r):{}:n?za({element:n,padding:o}).fn(r):{}}}},Ph=(e,t)=>({...wh(e),options:[e,t]}),Oh=(e,t)=>({...yh(e),options:[e,t]}),Ih=(e,t)=>({...Eh(e),options:[e,t]}),Dh=(e,t)=>({...kh(e),options:[e,t]}),_h=(e,t)=>({...Sh(e),options:[e,t]}),Mh=(e,t)=>({...Ch(e),options:[e,t]}),Rh=(e,t)=>({...zh(e),options:[e,t]});var Lh="Arrow",Ia=g.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return c.jsx(we.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"})})});Ia.displayName=Lh;var $h=Ia;function Fh(e){const[t,r]=g.useState(void 0);return Me(()=>{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 Vo="Popper",[Da,Qt]=Ar(Vo),[Wh,_a]=Da(Vo),Ma=e=>{const{__scopePopper:t,children:r}=e,[n,o]=g.useState(null);return c.jsx(Wh,{scope:t,anchor:n,onAnchorChange:o,children:r})};Ma.displayName=Vo;var Ra="PopperAnchor",La=g.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=_a(Ra,r),s=g.useRef(null),a=ke(t,s),l=g.useRef(null);return g.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(we.div,{...o,ref:a})});La.displayName=Ra;var Ko="PopperContent",[Uh,Bh]=Da(Ko),$a=g.forwardRef((e,t)=>{var P,J,te,F,ne,Q;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=_a(Ko,r),[y,k]=g.useState(null),x=ke(t,xe=>k(xe)),[S,C]=g.useState(null),j=Fh(S),N=(j==null?void 0:j.width)??0,E=(j==null?void 0:j.height)??0,D=n+(i!=="center"?"-"+i:""),R=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},I=Array.isArray(d)?d:[d],L=I.length>0,M={padding:R,boundary:I.filter(Vh),altBoundary:L},{refs:Y,floatingStyles:H,placement:U,isPositioned:B,middlewareData:T}=Th({strategy:"fixed",placement:D,whileElementsMounted:(...xe)=>xh(...xe,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[Ph({mainAxis:o+E,alignmentAxis:s}),l&&Oh({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Ih():void 0,...M}),l&&Dh({...M}),_h({...M,apply:({elements:xe,rects:ge,availableWidth:ze,availableHeight:Oe})=>{const{width:Be,height:Nt}=ge.reference,Xe=xe.floating.style;Xe.setProperty("--radix-popper-available-width",`${ze}px`),Xe.setProperty("--radix-popper-available-height",`${Oe}px`),Xe.setProperty("--radix-popper-anchor-width",`${Be}px`),Xe.setProperty("--radix-popper-anchor-height",`${Nt}px`)}}),S&&Rh({element:S,padding:a}),Kh({arrowWidth:N,arrowHeight:E}),h&&Mh({strategy:"referenceHidden",...M})]}),[X,re]=Ua(U),A=_t(w);Me(()=>{B&&(A==null||A())},[B,A]);const W=(P=T.arrow)==null?void 0:P.x,q=(J=T.arrow)==null?void 0:J.y,G=((te=T.arrow)==null?void 0:te.centerOffset)!==0,[me,se]=g.useState();return Me(()=>{y&&se(window.getComputedStyle(y).zIndex)},[y]),c.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:B?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[(F=T.transformOrigin)==null?void 0:F.x,(ne=T.transformOrigin)==null?void 0:ne.y].join(" "),...((Q=T.hide)==null?void 0:Q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Uh,{scope:r,placedSide:X,onArrowChange:C,arrowX:W,arrowY:q,shouldHideArrow:G,children:c.jsx(we.div,{"data-side":X,"data-align":re,...m,ref:x,style:{...m.style,animation:B?void 0:"none"}})})})});$a.displayName=Ko;var Fa="PopperArrow",Hh={top:"bottom",right:"left",bottom:"top",left:"right"},Wa=g.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Bh(Fa,n),s=Hh[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($h,{...o,ref:r,style:{...o.style,display:"block"}})})});Wa.displayName=Fa;function Vh(e){return e!==null}var Kh=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]=Ua(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 Ua(e){const[t,r="center"]=e.split("-");return[t,r]}var Go=Ma,On=La,Yo=$a,qo=Wa,Gh="Portal",In=g.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[o,i]=g.useState(!1);Me(()=>i(!0),[]);const s=r||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?bt.createPortal(c.jsx(we.div,{...n,ref:t}),s):null});In.displayName=Gh;var Yh=g[" useInsertionEffect ".trim().toString()]||Me;function Dn({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=qh({defaultProp:t,onChange:r}),a=e!==void 0,l=a?e:o;{const u=g.useRef(e!==void 0);g.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=g.useCallback(u=>{var f;if(a){const h=Xh(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 qh({defaultProp:e,onChange:t}){const[r,n]=g.useState(e),o=g.useRef(r),i=g.useRef(t);return Yh(()=>{i.current=t},[t]),g.useEffect(()=>{var s;o.current!==r&&((s=i.current)==null||s.call(i,r),o.current=r)},[r,o]),[r,n,i]}function Xh(e){return typeof e=="function"}function Jh(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ba=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"}),Zh="VisuallyHidden",Ha=g.forwardRef((e,t)=>c.jsx(we.span,{...e,ref:t,style:{...Ba,...e.style}}));Ha.displayName=Zh;var Qh=Ha,em=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},er=new WeakMap,_n=new WeakMap,Mn={},Xo=0,Va=function(e){return e&&(e.host||Va(e.parentNode))},tm=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Va(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})},rm=function(e,t,r,n){var o=tm(t,Array.isArray(e)?e:[e]);Mn[r]||(Mn[r]=new WeakMap);var i=Mn[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=(er.get(h)||0)+1,v=(i.get(h)||0)+1;er.set(h,m),i.set(h,v),s.push(h),m===1&&w&&_n.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(),Xo++,function(){s.forEach(function(f){var h=er.get(f)-1,p=i.get(f)-1;er.set(f,h),i.set(f,p),h||(_n.has(f)||f.removeAttribute(n),_n.delete(f)),p||f.removeAttribute(r)}),Xo--,Xo||(er=new WeakMap,er=new WeakMap,_n=new WeakMap,Mn={})}},Ka=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=em(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),rm(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 Ga(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 nm(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 Rn="right-scroll-bar-position",Ln="width-before-scroll-bar",om="with-scroll-bars-hidden",im="--removed-body-scroll-bar-size";function Jo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function sm(e,t){var r=b.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 am=typeof window<"u"?g.useLayoutEffect:g.useEffect,Ya=new WeakMap;function lm(e,t){var r=sm(null,function(n){return e.forEach(function(o){return Jo(o,n)})});return am(function(){var n=Ya.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(a){i.has(a)||Jo(a,null)}),i.forEach(function(a){o.has(a)||Jo(a,s)})}Ya.set(r,e)},[e]),r}function cm(e){return e}function dm(e,t){t===void 0&&(t=cm);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 um(e){e===void 0&&(e={});var t=dm(null);return t.options=dt({async:!0,ssr:!1},e),t}var qa=function(e){var t=e.sideCar,r=Ga(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 g.createElement(n,dt({},r))};qa.isSideCarExport=!0;function fm(e,t){return e.useMedium(t),qa}var Xa=um(),Zo=function(){},$n=g.forwardRef(function(e,t){var r=g.useRef(null),n=g.useState({onScrollCapture:Zo,onWheelCapture:Zo,onTouchMoveCapture:Zo}),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=Ga(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,j=lm([r,t]),N=dt(dt({},S),o);return g.createElement(g.Fragment,null,u&&g.createElement(C,{sideCar:Xa,removeScrollBar:d,shards:f,noRelative:p,noIsolation:w,inert:m,setCallbacks:i,allowPinchZoom:!!v,lockRef:r,gapMode:x}),s?g.cloneElement(g.Children.only(a),dt(dt({},N),{ref:j})):g.createElement(k,dt({},N,{className:l,ref:j}),a))});$n.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},$n.classNames={fullWidth:Ln,zeroRight:Rn};var pm=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function hm(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=pm();return t&&e.setAttribute("nonce",t),e}function mm(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function gm(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var bm=function(){var e=0,t=null;return{add:function(r){e==0&&(t=hm())&&(mm(t,r),gm(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},vm=function(){var e=bm();return function(t,r){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Ja=function(){var e=vm(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},xm={left:0,top:0,right:0,gap:0},Qo=function(e){return parseInt(e||"",10)||0},wm=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[Qo(r),Qo(n),Qo(o)]},ym=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return xm;var t=wm(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])}},km=Ja(),tr="data-scroll-locked",Sm=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
|
+
`},pu={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 hu(e){let{announcements:t=pu,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=fu}=e;const{announce:i,announcement:s}=cu(),a=yr("DndLiveRegion"),[l,d]=b.useState(!1);if(b.useEffect(()=>{d(!0)},[]),du(b.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=b.createElement(b.Fragment,null,b.createElement(au,{id:n,value:o.draggable}),b.createElement(lu,{id:a,announcement:s}));return r?bt.createPortal(u,r):u}var Ae;(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"})(Ae||(Ae={}));function fn(){}function go(e,t){return b.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function mu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return b.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const tt=Object.freeze({x:0,y:0});function us(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function gu(e,t){const r=un(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 fs(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function bu(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function ps(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 hs(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function ms(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 vu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=ms(t,t.left,t.top),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const d=us(ms(l),o);i.push({id:a,data:{droppableContainer:s,value:d}})}}return i.sort(fs)},xu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=ps(t),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const d=ps(l),u=o.reduce((h,p,w)=>h+us(d[w],p),0),f=Number((u/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:f}})}}return i.sort(fs)};function wu(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 yu=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=wu(a,t);l>0&&o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(bu)};function ku(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function gs(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:tt}function Su(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 Cu=Su(1);function bs(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 Eu(e,t,r){const n=bs(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 ju={ignoreTransform:!1};function Gt(e,t){t===void 0&&(t=ju);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:u}=We(e).getComputedStyle(e);d&&(r=Eu(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 vs(e){return Gt(e,{ignoreTransform:!0})}function Nu(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function Tu(e,t){return t===void 0&&(t=We(e).getComputedStyle(e)),t.position==="fixed"}function Au(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 pn(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(ho(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!vr(o)||as(o)||r.includes(o))return r;const i=We(e).getComputedStyle(o);return o!==e&&Au(o,i)&&r.push(o),Tu(o,i)?r:n(o.parentNode)}return e?n(e):r}function xs(e){const[t]=pn(e,1);return t??null}function bo(e){return!sn||!e?null:Ht(e)?e:po(e)?ho(e)||e===Vt(e).scrollingElement?window:vr(e)?e:null:null}function ws(e){return Ht(e)?e.scrollX:e.scrollLeft}function ys(e){return Ht(e)?e.scrollY:e.scrollTop}function vo(e){return{x:ws(e),y:ys(e)}}var Oe;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Oe||(Oe={}));function ks(e){return!sn||!e?!1:e===document.scrollingElement}function Ss(e){const t={x:0,y:0},r=ks(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 zu={x:.2,y:.2};function Pu(e,t,r,n,o){let{top:i,left:s,right:a,bottom:l}=r;n===void 0&&(n=10),o===void 0&&(o=zu);const{isTop:d,isBottom:u,isLeft:f,isRight:h}=Ss(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=Oe.Backward,w.y=n*Math.abs((t.top+m.height-i)/m.height)):!u&&l>=t.bottom-m.height&&(p.y=Oe.Forward,w.y=n*Math.abs((t.bottom-m.height-l)/m.height)),!h&&a>=t.right-m.width?(p.x=Oe.Forward,w.x=n*Math.abs((t.right-m.width-a)/m.width)):!f&&s<=t.left+m.width&&(p.x=Oe.Backward,w.x=n*Math.abs((t.left+m.width-s)/m.width)),{direction:p,speed:w}}function Ou(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 Cs(e){return e.reduce((t,r)=>Kt(t,vo(r)),tt)}function Iu(e){return e.reduce((t,r)=>t+ws(r),0)}function Du(e){return e.reduce((t,r)=>t+ys(r),0)}function Es(e,t){if(t===void 0&&(t=Gt),!e)return;const{top:r,left:n,bottom:o,right:i}=t(e);xs(e)&&(o<=0||i<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const _u=[["x",["left","right"],Iu],["y",["top","bottom"],Du]];class xo{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=pn(r),o=Cs(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of _u)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 Sr{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 Mu(e){const{EventTarget:t}=We(e);return e instanceof t?e:Vt(e)}function wo(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 Qe;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Qe||(Qe={}));function js(e){e.preventDefault()}function Ru(e){e.stopPropagation()}var de;(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"})(de||(de={}));const Ns={start:[de.Space,de.Enter],cancel:[de.Esc],end:[de.Space,de.Enter,de.Tab]},Lu=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case de.Right:return{...r,x:r.x+25};case de.Left:return{...r,x:r.x-25};case de.Down:return{...r,y:r.y+25};case de.Up:return{...r,y:r.y-25}}};class yo{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 Sr(Vt(r)),this.windowListeners=new Sr(We(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Qe.Resize,this.handleCancel),this.windowListeners.add(Qe.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Qe.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Es(n),r(tt)}handleKeyDown(t){if(dn(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:i=Ns,coordinateGetter:s=Lu,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=kr(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:j}=Ss(m),N=Ou(m),E={x:Math.min(v===de.Right?N.right-N.width/2:N.right,Math.max(v===de.Right?N.left:N.left+N.width/2,f.x)),y:Math.min(v===de.Down?N.bottom-N.height/2:N.bottom,Math.max(v===de.Down?N.top:N.top+N.height/2,f.y))},D=v===de.Right&&!k||v===de.Left&&!x,R=v===de.Down&&!S||v===de.Up&&!y;if(D&&E.x!==f.x){const I=m.scrollLeft+h.x,L=v===de.Right&&I<=C.x||v===de.Left&&I>=j.x;if(L&&!h.y){m.scrollTo({left:I,behavior:a});return}L?p.x=m.scrollLeft-I:p.x=v===de.Right?m.scrollLeft-C.x:m.scrollLeft-j.x,p.x&&m.scrollBy({left:-p.x,behavior:a});break}else if(R&&E.y!==f.y){const I=m.scrollTop+h.y,L=v===de.Down&&I<=C.y||v===de.Up&&I>=j.y;if(L&&!h.x){m.scrollTo({top:I,behavior:a});return}L?p.y=m.scrollTop-I:p.y=v===de.Down?m.scrollTop-C.y:m.scrollTop-j.y,p.y&&m.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(t,Kt(kr(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()}}yo.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=Ns,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 Ts(e){return!!(e&&"distance"in e)}function As(e){return!!(e&&"delay"in e)}class ko{constructor(t,r,n){var o;n===void 0&&(n=Mu(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=Vt(s),this.documentListeners=new Sr(this.document),this.listeners=new Sr(n),this.windowListeners=new Sr(We(s)),this.initialCoordinates=(o=un(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(Qe.Resize,this.handleCancel),this.windowListeners.add(Qe.DragStart,js),this.windowListeners.add(Qe.VisibilityChange,this.handleCancel),this.windowListeners.add(Qe.ContextMenu,js),this.documentListeners.add(Qe.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(As(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Ts(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(Qe.Click,Ru,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Qe.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=un(t))!=null?r:tt,d=kr(o,l);if(!n&&a){if(Ts(a)){if(a.tolerance!=null&&wo(d,a.tolerance))return this.handleCancel();if(wo(d,a.distance))return this.handleStart()}if(As(a)&&wo(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===de.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const $u={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class So extends ko{constructor(t){const{event:r}=t,n=Vt(r.target);super(t,$u,n)}}So.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 Fu={move:{name:"mousemove"},end:{name:"mouseup"}};var Co;(function(e){e[e.RightClick=2]="RightClick"})(Co||(Co={}));class Wu extends ko{constructor(t){super(t,Fu,Vt(t.event.target))}}Wu.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===Co.RightClick?!1:(n==null||n({event:r}),!0)}}];const Eo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class zs extends ko{constructor(t){super(t,Eo)}static setup(){return window.addEventListener(Eo.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Eo.move.name,t)};function t(){}}}zs.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 Cr;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Cr||(Cr={}));var hn;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(hn||(hn={}));function Uu(e){let{acceleration:t,activator:r=Cr.Pointer,canScroll:n,draggingRect:o,enabled:i,interval:s=5,order:a=hn.TreeOrder,pointerCoordinates:l,scrollableAncestors:d,scrollableAncestorRects:u,delta:f,threshold:h}=e;const p=Hu({delta:f,disabled:!i}),[w,m]=ru(),v=b.useRef({x:0,y:0}),y=b.useRef({x:0,y:0}),k=b.useMemo(()=>{switch(r){case Cr.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Cr.DraggableRect:return o}},[r,o,l]),x=b.useRef(null),S=b.useCallback(()=>{const j=x.current;if(!j)return;const N=v.current.x*y.current.x,E=v.current.y*y.current.y;j.scrollBy(N,E)},[]),C=b.useMemo(()=>a===hn.TreeOrder?[...d].reverse():d,[a,d]);b.useEffect(()=>{if(!i||!d.length||!k){m();return}for(const j of C){if((n==null?void 0:n(j))===!1)continue;const N=d.indexOf(j),E=u[N];if(!E)continue;const{direction:D,speed:R}=Pu(j,E,k,t,h);for(const I of["x","y"])p[I][D[I]]||(R[I]=0,D[I]=0);if(R.x>0||R.y>0){m(),x.current=j,w(S,s),v.current=R,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 Bu={x:{[Oe.Backward]:!1,[Oe.Forward]:!1},y:{[Oe.Backward]:!1,[Oe.Forward]:!1}};function Hu(e){let{delta:t,disabled:r}=e;const n=cn(t);return wr(o=>{if(r||!n||!o)return Bu;const i={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Oe.Backward]:o.x[Oe.Backward]||i.x===-1,[Oe.Forward]:o.x[Oe.Forward]||i.x===1},y:{[Oe.Backward]:o.y[Oe.Backward]||i.y===-1,[Oe.Forward]:o.y[Oe.Forward]||i.y===1}}},[r,t,n])}function Vu(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return wr(o=>{var i;return t==null?null:(i=n??o)!=null?i:null},[n,t])}function Ku(e,t){return b.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 Er;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Er||(Er={}));var jo;(function(e){e.Optimized="optimized"})(jo||(jo={}));const Ps=new Map;function Gu(e,t){let{dragging:r,dependencies:n,config:o}=t;const[i,s]=b.useState(null),{frequency:a,measure:l,strategy:d}=o,u=b.useRef(e),f=v(),h=xr(f),p=b.useCallback(function(y){y===void 0&&(y=[]),!h.current&&s(k=>k===null?y:k.concat(y.filter(x=>!k.includes(x))))},[h]),w=b.useRef(null),m=wr(y=>{if(f&&!r)return Ps;if(!y||y===Ps||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 xo(l(S),S):null;x.rect.current=C,C&&k.set(x.id,C)}return k}return y},[e,i,r,f,l]);return b.useEffect(()=>{u.current=e},[e]),b.useEffect(()=>{f||p()},[r,f]),b.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),b.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 Er.Always:return!1;case Er.BeforeDragging:return r;default:return!r}}}function No(e,t){return wr(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Yu(e,t){return No(e,t)}function qu(e){let{callback:t,disabled:r}=e;const n=an(t),o=b.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(n)},[n,r]);return b.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function mn(e){let{callback:t,disabled:r}=e;const n=an(t),o=b.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(n)},[r]);return b.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Xu(e){return new xo(Gt(e),e)}function Os(e,t,r){t===void 0&&(t=Xu);const[n,o]=b.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=qu({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=mn({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 Ju(e){const t=No(e);return gs(e,t)}const Is=[];function Zu(e){const t=b.useRef(e),r=wr(n=>e?n&&n!==Is&&e&&t.current&&e.parentNode===t.current.parentNode?n:pn(e):Is,[e]);return b.useEffect(()=>{t.current=e},[e]),r}function Qu(e){const[t,r]=b.useState(null),n=b.useRef(e),o=b.useCallback(i=>{const s=bo(i.target);s&&r(a=>a?(a.set(s,vo(s)),new Map(a)):null)},[]);return b.useEffect(()=>{const i=n.current;if(e!==i){s(i);const a=e.map(l=>{const d=bo(l);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,vo(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=bo(l);d==null||d.removeEventListener("scroll",o)})}},[o,e]),b.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>Kt(i,s),tt):Cs(e):tt,[e,t])}function Ds(e,t){t===void 0&&(t=[]);const r=b.useRef(null);return b.useEffect(()=>{r.current=null},t),b.useEffect(()=>{const n=e!==tt;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?kr(e,r.current):tt}function ef(e){b.useEffect(()=>{if(!sn)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 tf(e,t){return b.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:i}=n;return r[o]=s=>{i(s,t)},r},{}),[e,t])}function _s(e){return b.useMemo(()=>e?Nu(e):null,[e])}const Ms=[];function rf(e,t){t===void 0&&(t=Gt);const[r]=e,n=_s(r?We(r):null),[o,i]=b.useState(Ms);function s(){i(()=>e.length?e.map(l=>ks(l)?n:new xo(t(l),l)):Ms)}const a=mn({callback:s});return et(()=>{a==null||a.disconnect(),s(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),o}function Rs(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return vr(t)?t:e}function nf(e){let{measure:t}=e;const[r,n]=b.useState(null),o=b.useCallback(d=>{for(const{target:u}of d)if(vr(u)){n(f=>{const h=t(u);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),i=mn({callback:o}),s=b.useCallback(d=>{const u=Rs(d);i==null||i.disconnect(),u&&(i==null||i.observe(u)),n(u?t(u):null)},[t,i]),[a,l]=ln(s);return b.useMemo(()=>({nodeRef:a,rect:r,setRef:l}),[r,a,l])}const of=[{sensor:So,options:{}},{sensor:yo,options:{}}],sf={current:{}},gn={draggable:{measure:vs},droppable:{measure:vs,strategy:Er.WhileDragging,frequency:jo.Optimized},dragOverlay:{measure:Gt}};class jr 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 af={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new jr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:fn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:gn,measureDroppableContainers:fn,windowRect:null,measuringScheduled:!1},Ls={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:fn,draggableNodes:new Map,over:null,measureDroppableContainers:fn},Nr=b.createContext(Ls),$s=b.createContext(af);function lf(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new jr}}}function cf(e,t){switch(t.type){case Ae.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Ae.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 Ae.DragEnd:case Ae.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ae.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new jr(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case Ae.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 jr(e.droppable.containers);return s.set(r,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case Ae.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const i=new jr(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function df(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=b.useContext(Nr),i=cn(n),s=cn(r==null?void 0:r.id);return b.useEffect(()=>{if(!t&&!n&&i&&s!=null){if(!dn(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=iu(u);if(f){f.focus();break}}})}},[n,t,o,s,i]),null}function Fs(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...n}),r):r}function uf(e){return b.useMemo(()=>({draggable:{...gn.draggable,...e==null?void 0:e.draggable},droppable:{...gn.droppable,...e==null?void 0:e.droppable},dragOverlay:{...gn.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 ff(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const i=b.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=gs(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=xs(d);h&&h.scrollBy({top:f.y,left:f.x})}},[t,s,a,n,r])}const bn=b.createContext({...tt,scaleX:1,scaleY:1});var wt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(wt||(wt={}));const pf=b.memo(function(t){var r,n,o,i;let{id:s,accessibility:a,autoScroll:l=!0,children:d,sensors:u=of,collisionDetection:f=yu,measuring:h,modifiers:p,...w}=t;const m=b.useReducer(cf,void 0,lf),[v,y]=m,[k,x]=uu(),[S,C]=b.useState(wt.Uninitialized),j=S===wt.Initialized,{draggable:{active:N,nodes:E,translate:D},droppable:{containers:R}}=v,I=N!=null?E.get(N):null,L=b.useRef({initial:null,translated:null}),M=b.useMemo(()=>{var Pe;return N!=null?{id:N,data:(Pe=I==null?void 0:I.data)!=null?Pe:sf,rect:L}:null},[N,I]),G=b.useRef(null),[B,F]=b.useState(null),[U,A]=b.useState(null),X=xr(w,Object.values(w)),re=yr("DndDescribedBy",s),T=b.useMemo(()=>R.getEnabled(),[R]),$=uf(h),{droppableRects:q,measureDroppableContainers:K,measuringScheduled:ge}=Gu(T,{dragging:j,dependencies:[D.x,D.y],config:$.droppable}),se=Vu(E,N),O=b.useMemo(()=>U?un(U):null,[U]),J=Ee(),ee=Yu(se,$.draggable.measure);ff({activeNode:N!=null?E.get(N):null,config:J.layoutShiftCompensation,initialRect:ee,measure:$.draggable.measure});const W=Os(se,$.draggable.measure,ee),ne=Os(se?se.parentElement:null),Z=b.useRef({activatorEvent:null,active:null,activeNode:se,collisionRect:null,collisions:null,droppableRects:q,draggableNodes:E,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),we=R.getNodeFor((r=Z.current.over)==null?void 0:r.id),be=nf({measure:$.dragOverlay.measure}),ze=(n=be.nodeRef.current)!=null?n:se,Ie=j?(o=be.rect)!=null?o:W:null,He=!!(be.nodeRef.current&&be.rect),Nt=Ju(He?null:W),Je=_s(ze?We(ze):null),Ve=Zu(j?we??se:null),Ke=rf(Ve),mt=Fs(p,{transform:{x:D.x-Nt.x,y:D.y-Nt.y,scaleX:1,scaleY:1},activatorEvent:U,active:M,activeNodeRect:W,containerNodeRect:ne,draggingNodeRect:Ie,over:Z.current.over,overlayNodeRect:be.rect,scrollableAncestors:Ve,scrollableAncestorRects:Ke,windowRect:Je}),it=O?Kt(O,D):null,Tt=Qu(Ve),Wr=Ds(Tt),_=Ds(Tt,[W]),Q=Kt(mt,Wr),ie=Ie?Cu(Ie,mt):null,fe=M&&ie?f({active:M,collisionRect:ie,droppableRects:q,droppableContainers:T,pointerCoordinates:it}):null,De=hs(fe,"id"),[ke,je]=b.useState(null),P=He?mt:Kt(mt,_),z=ku(P,(i=ke==null?void 0:ke.rect)!=null?i:null,W),Y=b.useRef(null),te=b.useCallback((Pe,Le)=>{let{sensor:he,options:$e}=Le;if(G.current==null)return;const Fe=E.get(G.current);if(!Fe)return;const _e=Pe.nativeEvent,Ge=new he({active:G.current,activeNode:Fe,event:_e,options:$e,context:Z,onAbort(Me){if(!E.get(Me))return;const{onDragAbort:ut}=X.current,gt={id:Me};ut==null||ut(gt),k({type:"onDragAbort",event:gt})},onPending(Me,At,ut,gt){if(!E.get(Me))return;const{onDragPending:Br}=X.current,zt={id:Me,constraint:At,initialCoordinates:ut,offset:gt};Br==null||Br(zt),k({type:"onDragPending",event:zt})},onStart(Me){const At=G.current;if(At==null)return;const ut=E.get(At);if(!ut)return;const{onDragStart:gt}=X.current,Ur={activatorEvent:_e,active:{id:At,data:ut.data,rect:L}};bt.unstable_batchedUpdates(()=>{gt==null||gt(Ur),C(wt.Initializing),y({type:Ae.DragStart,initialCoordinates:Me,active:At}),k({type:"onDragStart",event:Ur}),F(Y.current),A(_e)})},onMove(Me){y({type:Ae.DragMove,coordinates:Me})},onEnd:Be(Ae.DragEnd),onCancel:Be(Ae.DragCancel)});Y.current=Ge;function Be(Me){return async function(){const{active:ut,collisions:gt,over:Ur,scrollAdjustedTranslate:Br}=Z.current;let zt=null;if(ut&&Br){const{cancelDrop:Hr}=X.current;zt={activatorEvent:_e,active:ut,collisions:gt,delta:Br,over:Ur},Me===Ae.DragEnd&&typeof Hr=="function"&&await Promise.resolve(Hr(zt))&&(Me=Ae.DragCancel)}G.current=null,bt.unstable_batchedUpdates(()=>{y({type:Me}),C(wt.Uninitialized),je(null),F(null),A(null),Y.current=null;const Hr=Me===Ae.DragEnd?"onDragEnd":"onDragCancel";if(zt){const Ni=X.current[Hr];Ni==null||Ni(zt),k({type:Hr,event:zt})}})}}},[E]),ce=b.useCallback((Pe,Le)=>(he,$e)=>{const Fe=he.nativeEvent,_e=E.get($e);if(G.current!==null||!_e||Fe.dndKit||Fe.defaultPrevented)return;const Ge={active:_e};Pe(he,Le.options,Ge)===!0&&(Fe.dndKit={capturedBy:Le.sensor},G.current=$e,te(he,Le))},[E,te]),ue=Ku(u,ce);ef(u),et(()=>{W&&S===wt.Initializing&&C(wt.Initialized)},[W,S]),b.useEffect(()=>{const{onDragMove:Pe}=X.current,{active:Le,activatorEvent:he,collisions:$e,over:Fe}=Z.current;if(!Le||!he)return;const _e={active:Le,activatorEvent:he,collisions:$e,delta:{x:Q.x,y:Q.y},over:Fe};bt.unstable_batchedUpdates(()=>{Pe==null||Pe(_e),k({type:"onDragMove",event:_e})})},[Q.x,Q.y]),b.useEffect(()=>{const{active:Pe,activatorEvent:Le,collisions:he,droppableContainers:$e,scrollAdjustedTranslate:Fe}=Z.current;if(!Pe||G.current==null||!Le||!Fe)return;const{onDragOver:_e}=X.current,Ge=$e.get(De),Be=Ge&&Ge.rect.current?{id:Ge.id,rect:Ge.rect.current,data:Ge.data,disabled:Ge.disabled}:null,Me={active:Pe,activatorEvent:Le,collisions:he,delta:{x:Fe.x,y:Fe.y},over:Be};bt.unstable_batchedUpdates(()=>{je(Be),_e==null||_e(Me),k({type:"onDragOver",event:Me})})},[De]),et(()=>{Z.current={activatorEvent:U,active:M,activeNode:se,collisionRect:ie,collisions:fe,droppableRects:q,draggableNodes:E,draggingNode:ze,draggingNodeRect:Ie,droppableContainers:R,over:ke,scrollableAncestors:Ve,scrollAdjustedTranslate:Q},L.current={initial:Ie,translated:ie}},[M,se,fe,ie,E,ze,Ie,q,R,ke,Ve,Q]),Uu({...J,delta:D,draggingRect:ie,pointerCoordinates:it,scrollableAncestors:Ve,scrollableAncestorRects:Ke});const ve=b.useMemo(()=>({active:M,activeNode:se,activeNodeRect:W,activatorEvent:U,collisions:fe,containerNodeRect:ne,dragOverlay:be,draggableNodes:E,droppableContainers:R,droppableRects:q,over:ke,measureDroppableContainers:K,scrollableAncestors:Ve,scrollableAncestorRects:Ke,measuringConfiguration:$,measuringScheduled:ge,windowRect:Je}),[M,se,W,U,fe,ne,be,E,R,q,ke,K,Ve,Ke,$,ge,Je]),Ce=b.useMemo(()=>({activatorEvent:U,activators:ue,active:M,activeNodeRect:W,ariaDescribedById:{draggable:re},dispatch:y,draggableNodes:E,over:ke,measureDroppableContainers:K}),[U,ue,M,W,y,re,E,ke,K]);return b.createElement(ds.Provider,{value:x},b.createElement(Nr.Provider,{value:Ce},b.createElement($s.Provider,{value:ve},b.createElement(bn.Provider,{value:z},d)),b.createElement(df,{disabled:(a==null?void 0:a.restoreFocus)===!1})),b.createElement(hu,{...a,hiddenTextDescribedById:re}));function Ee(){const Pe=(B==null?void 0:B.autoScrollEnabled)===!1,Le=typeof l=="object"?l.enabled===!1:l===!1,he=j&&!Pe&&!Le;return typeof l=="object"?{...l,enabled:he}:{enabled:he}}}),hf=b.createContext(null),Ws="button",mf="Draggable";function gf(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const i=yr(mf),{activators:s,activatorEvent:a,active:l,activeNodeRect:d,ariaDescribedById:u,draggableNodes:f,over:h}=b.useContext(Nr),{role:p=Ws,roleDescription:w="draggable",tabIndex:m=0}=o??{},v=(l==null?void 0:l.id)===t,y=b.useContext(v?bn:hf),[k,x]=ln(),[S,C]=ln(),j=tf(s,t),N=xr(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 E=b.useMemo(()=>({role:p,tabIndex:m,"aria-disabled":n,"aria-pressed":v&&p===Ws?!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:E,isDragging:v,listeners:n?void 0:j,node:k,over:h,setNodeRef:x,setActivatorNodeRef:C,transform:y}}function Us(){return b.useContext($s)}const bf="Droppable",vf={timeout:25};function xf(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const i=yr(bf),{active:s,dispatch:a,over:l,measureDroppableContainers:d}=b.useContext(Nr),u=b.useRef({disabled:r}),f=b.useRef(!1),h=b.useRef(null),p=b.useRef(null),{disabled:w,updateMeasurementsFor:m,timeout:v}={...vf,...o},y=xr(m??n),k=b.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=mn({callback:k,disabled:w||!s}),S=b.useCallback((E,D)=>{x&&(D&&(x.unobserve(D),f.current=!1),E&&x.observe(E))},[x]),[C,j]=ln(S),N=xr(t);return b.useEffect(()=>{!x||!C.current||(x.disconnect(),f.current=!1,x.observe(C.current))},[C,x]),b.useEffect(()=>(a({type:Ae.RegisterDroppable,element:{id:n,key:i,disabled:r,node:C,rect:h,data:N}}),()=>a({type:Ae.UnregisterDroppable,key:i,id:n})),[n]),b.useEffect(()=>{r!==u.current.disabled&&(a({type:Ae.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:j}}function wf(e){let{animation:t,children:r}=e;const[n,o]=b.useState(null),[i,s]=b.useState(null),a=cn(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]),b.createElement(b.Fragment,null,r,n?b.cloneElement(n,{ref:s}):null)}const yf={x:0,y:0,scaleX:1,scaleY:1};function kf(e){let{children:t}=e;return b.createElement(Nr.Provider,{value:Ls},b.createElement(bn.Provider,{value:yf},t))}const Sf={position:"fixed",touchAction:"none"},Cf=e=>dn(e)?"transform 250ms ease":void 0,Ef=b.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:o,children:i,className:s,rect:a,style:l,transform:d,transition:u=Cf}=e;if(!a)return null;const f=o?d:{...d,scaleX:1,scaleY:1},h={...Sf,width:a.width,height:a.height,top:a.top,left:a.left,transform:xt.Transform.toString(f),transformOrigin:o&&n?gu(n,a):void 0,transition:typeof u=="function"?u(n):u,...l};return b.createElement(r,{className:s,style:h,ref:t},i)}),jf={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:xt.Transform.toString(t)},{transform:xt.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 Nf(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:o}=e;return an((i,s)=>{if(t===null)return;const a=r.get(i);if(!a)return;const l=a.node.current;if(!l)return;const d=Rs(s);if(!d)return;const{transform:u}=We(s).getComputedStyle(s),f=bs(u);if(!f)return;const h=typeof t=="function"?t:Tf(t);return Es(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 Tf(e){const{duration:t,easing:r,sideEffects:n,keyframes:o}={...jf,...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 Bs=0;function Af(e){return b.useMemo(()=>{if(e!=null)return Bs++,Bs},[e])}const zf=b.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}=Us(),j=b.useContext(bn),N=Af(f==null?void 0:f.id),E=Fs(s,{activatorEvent:u,active:f,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:v.rect,over:y,overlayNodeRect:v.rect,scrollableAncestors:x,scrollableAncestorRects:S,transform:j,windowRect:C}),D=No(h),R=Nf({config:n,draggableNodes:w,droppableContainers:m,measuringConfiguration:k}),I=D?v.setRef:void 0;return b.createElement(kf,null,b.createElement(wf,{animation:R},f&&N?b.createElement(Ef,{key:N,id:f.id,ref:I,as:a,activatorEvent:u,adjustScale:t,className:l,transition:i,rect:D,style:{zIndex:d,...o},transform:E},r):null))}),Pf=e=>{let{transform:t}=e;return{...t,x:0}};function Hs(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function Of(e,t){return e.reduce((r,n,o)=>{const i=t.get(n);return i&&(r[o]=i),r},Array(e.length))}function vn(e){return e!==null&&e>=0}function If(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 Df(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Vs=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const i=Hs(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}},xn={scaleX:1,scaleY:1},_f=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,...xn}:null}const l=Mf(i,o,r);return o>r&&o<=s?{x:0,y:-a.height-l,...xn}:o<r&&o>=s?{x:0,y:a.height+l,...xn}:{x:0,y:0,...xn}};function Mf(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 Ks="Sortable",Gs=b.createContext({activeIndex:-1,containerId:Ks,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Vs,disabled:{draggable:!1,droppable:!1}});function Rf(e){let{children:t,id:r,items:n,strategy:o=Vs,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:d,measureDroppableContainers:u}=Us(),f=yr(Ks,r),h=a.rect!==null,p=b.useMemo(()=>n.map(j=>typeof j=="object"&&"id"in j?j.id:j),[n]),w=s!=null,m=s?p.indexOf(s.id):-1,v=d?p.indexOf(d.id):-1,y=b.useRef(p),k=!If(p,y.current),x=v!==-1&&m===-1||k,S=Df(i);et(()=>{k&&w&&u(p)},[k,p,w,u]),b.useEffect(()=>{y.current=p},[p]);const C=b.useMemo(()=>({activeIndex:m,containerId:f,disabled:S,disableTransforms:x,items:p,overIndex:v,useDragOverlay:h,sortedRects:Of(p,l),strategy:o}),[m,f,S.draggable,S.droppable,x,p,v,l,h,o]);return b.createElement(Gs.Provider,{value:C},t)}const Lf=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return Hs(r,n,o).indexOf(t)},$f=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},Ff={duration:200,easing:"ease"},Ys="transform",Wf=xt.Transition.toString({property:Ys,duration:0,easing:"linear"}),Uf={roleDescription:"sortable"};function Bf(e){let{disabled:t,index:r,node:n,rect:o}=e;const[i,s]=b.useState(null),a=b.useRef(r);return et(()=>{if(!t&&r!==a.current&&n.current){const l=o.current;if(l){const d=Gt(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]),b.useEffect(()=>{i&&s(null)},[i]),i}function Hf(e){let{animateLayoutChanges:t=$f,attributes:r,disabled:n,data:o,getNewIndex:i=Lf,id:s,strategy:a,resizeObserverConfig:l,transition:d=Ff}=e;const{items:u,containerId:f,activeIndex:h,disabled:p,disableTransforms:w,sortedRects:m,overIndex:v,useDragOverlay:y,strategy:k}=b.useContext(Gs),x=Vf(n,p),S=u.indexOf(s),C=b.useMemo(()=>({sortable:{containerId:f,index:S,items:u},...o}),[f,o,S,u]),j=b.useMemo(()=>u.slice(u.indexOf(s)),[u,s]),{rect:N,node:E,isOver:D,setNodeRef:R}=xf({id:s,data:C,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...l}}),{active:I,activatorEvent:L,activeNodeRect:M,attributes:G,setNodeRef:B,listeners:F,isDragging:U,over:A,setActivatorNodeRef:X,transform:re}=gf({id:s,data:C,attributes:{...Uf,...r},disabled:x.draggable}),T=tu(R,B),$=!!I,q=$&&!w&&vn(h)&&vn(v),K=!y&&U,ge=K&&q?re:null,O=q?ge??(a??k)({rects:m,activeNodeRect:M,activeIndex:h,overIndex:v,index:S}):null,J=vn(h)&&vn(v)?i({id:s,items:u,activeIndex:h,overIndex:v}):S,ee=I==null?void 0:I.id,W=b.useRef({activeId:ee,items:u,newIndex:J,containerId:f}),ne=u!==W.current.items,Z=t({active:I,containerId:f,isDragging:U,isSorting:$,id:s,index:S,items:u,newIndex:W.current.newIndex,previousItems:W.current.items,previousContainerId:W.current.containerId,transition:d,wasDragging:W.current.activeId!=null}),we=Bf({disabled:!Z,index:S,node:E,rect:N});return b.useEffect(()=>{$&&W.current.newIndex!==J&&(W.current.newIndex=J),f!==W.current.containerId&&(W.current.containerId=f),u!==W.current.items&&(W.current.items=u)},[$,J,f,u]),b.useEffect(()=>{if(ee===W.current.activeId)return;if(ee!=null&&W.current.activeId==null){W.current.activeId=ee;return}const ze=setTimeout(()=>{W.current.activeId=ee},50);return()=>clearTimeout(ze)},[ee]),{active:I,activeIndex:h,attributes:G,data:C,rect:N,index:S,newIndex:J,items:u,isOver:D,isSorting:$,isDragging:U,listeners:F,node:E,overIndex:v,over:A,setNodeRef:T,setActivatorNodeRef:X,setDroppableNodeRef:R,setDraggableNodeRef:B,transform:we??O,transition:be()};function be(){if(we||ne&&W.current.newIndex===S)return Wf;if(!(K&&!dn(L)||!d)&&($||Z))return xt.Transition.toString({...d,property:Ys})}}function Vf(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 wn(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 Kf=[de.Down,de.Right,de.Up,de.Left],Gf=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:i,over:s,scrollableAncestors:a}}=t;if(Kf.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 de.Down:n.top<h.top&&l.push(f);break;case de.Up:n.top>h.top&&l.push(f);break;case de.Left:n.left>h.left&&l.push(f);break;case de.Right:n.left<h.left&&l.push(f);break}});const d=xu({collisionRect:n,droppableRects:o,droppableContainers:l});let u=hs(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=pn(w).some((j,N)=>a[N]!==j),y=qs(f,h),k=Yf(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:kr(S,x)}}}};function qs(e,t){return!wn(e)||!wn(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Yf(e,t){return!wn(e)||!wn(t)||!qs(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function To({className:e,type:t,...r}){return c.jsx("input",{type:t,className:oe("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 qf({className:e,...t}){return c.jsx("textarea",{className:oe("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 Xf({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:oe("size-4 rounded border border-zinc-700 bg-zinc-900 text-blue-600 focus:ring-2 focus:ring-blue-600",e),...n})}function Dt({className:e,...t}){return c.jsx("label",{className:oe("text-sm font-medium leading-none select-none",e),...t})}function Xs(e,[t,r]){return Math.min(r,Math.max(t,e))}function pe(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 Tr(e,t=[]){let r=[];function n(i,s){const a=g.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=g.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=g.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=>g.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return g.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[n,Jf(o,...t)]}function Jf(...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 g.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}function Js(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Zs(...e){return t=>{let r=!1;const n=e.map(o=>{const i=Js(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():Js(e[o],null)}}}}function Se(...e){return g.useCallback(Zs(...e),e)}function Yt(e){const t=Qf(e),r=g.forwardRef((n,o)=>{const{children:i,...s}=n,a=g.Children.toArray(i),l=a.find(tp);if(l){const d=l.props.children,u=a.map(f=>f===l?g.Children.count(d)>1?g.Children.only(null):g.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...s,ref:o,children:g.isValidElement(d)?g.cloneElement(d,void 0,u):null})}return c.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var Zf=Yt("Slot");function Qf(e){const t=g.forwardRef((r,n)=>{const{children:o,...i}=r;if(g.isValidElement(o)){const s=np(o),a=rp(i,o.props);return o.type!==g.Fragment&&(a.ref=n?Zs(n,s):s),g.cloneElement(o,a)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qs=Symbol("radix.slottable");function ep(e){const t=({children:r})=>c.jsx(c.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=Qs,t}function tp(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qs}function rp(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 np(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 op(e){const t=e+"CollectionProvider",[r,n]=Tr(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:v,children:y}=m,k=b.useRef(null),x=b.useRef(new Map).current;return c.jsx(o,{scope:v,itemMap:x,collectionRef:k,children:y})};s.displayName=t;const a=e+"CollectionSlot",l=Yt(a),d=b.forwardRef((m,v)=>{const{scope:y,children:k}=m,x=i(a,y),S=Se(v,x.collectionRef);return c.jsx(l,{ref:S,children:k})});d.displayName=a;const u=e+"CollectionItemSlot",f="data-radix-collection-item",h=Yt(u),p=b.forwardRef((m,v)=>{const{scope:y,children:k,...x}=m,S=b.useRef(null),C=Se(v,S),j=i(u,y);return b.useEffect(()=>(j.itemMap.set(S,{ref:S,...x}),()=>void j.itemMap.delete(S))),c.jsx(h,{[f]:"",ref:C,children:k})});p.displayName=u;function w(m){const v=i(e+"CollectionConsumer",m);return b.useCallback(()=>{const k=v.collectionRef.current;if(!k)return[];const x=Array.from(k.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((j,N)=>x.indexOf(j.ref.current)-x.indexOf(N.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:d,ItemSlot:p},w,n]}var ip=g.createContext(void 0);function sp(e){const t=g.useContext(ip);return e||t||"ltr"}var ap=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ye=ap.reduce((e,t)=>{const r=Yt(`Primitive.${t}`),n=g.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 lp(e,t){e&&Vr.flushSync(()=>e.dispatchEvent(t))}function _t(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function cp(e,t=globalThis==null?void 0:globalThis.document){const r=_t(e);g.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 dp="DismissableLayer",Ao="dismissableLayer.update",up="dismissableLayer.pointerDownOutside",fp="dismissableLayer.focusOutside",ea,ta=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yn=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,d=g.useContext(ta),[u,f]=g.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=g.useState({}),w=Se(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=mp(N=>{const E=N.target,D=[...d.branches].some(R=>R.contains(E));!S||D||(o==null||o(N),s==null||s(N),N.defaultPrevented||a==null||a())},h),j=gp(N=>{const E=N.target;[...d.branches].some(R=>R.contains(E))||(i==null||i(N),s==null||s(N),N.defaultPrevented||a==null||a())},h);return cp(N=>{k===d.layers.size-1&&(n==null||n(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},h),g.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ea=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),ra(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=ea)}},[u,h,r,d]),g.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),ra())},[u,d]),g.useEffect(()=>{const N=()=>p({});return document.addEventListener(Ao,N),()=>document.removeEventListener(Ao,N)},[]),c.jsx(ye.div,{...l,ref:w,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:pe(e.onFocusCapture,j.onFocusCapture),onBlurCapture:pe(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:pe(e.onPointerDownCapture,C.onPointerDownCapture)})});yn.displayName=dp;var pp="DismissableLayerBranch",hp=g.forwardRef((e,t)=>{const r=g.useContext(ta),n=g.useRef(null),o=Se(t,n);return g.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),c.jsx(ye.div,{...e,ref:o})});hp.displayName=pp;function mp(e,t=globalThis==null?void 0:globalThis.document){const r=_t(e),n=g.useRef(!1),o=g.useRef(()=>{});return g.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let l=function(){na(up,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 gp(e,t=globalThis==null?void 0:globalThis.document){const r=_t(e),n=g.useRef(!1);return g.useEffect(()=>{const o=i=>{i.target&&!n.current&&na(fp,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 ra(){const e=new CustomEvent(Ao);document.dispatchEvent(e)}function na(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?lp(o,i):o.dispatchEvent(i)}var zo=0;function oa(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ia()),document.body.insertAdjacentElement("beforeend",e[1]??ia()),zo++,()=>{zo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),zo--}},[])}function ia(){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 Po="focusScope.autoFocusOnMount",Oo="focusScope.autoFocusOnUnmount",sa={bubbles:!1,cancelable:!0},bp="FocusScope",Io=g.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=g.useState(null),d=_t(o),u=_t(i),f=g.useRef(null),h=Se(t,m=>l(m)),p=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(n){let m=function(x){if(p.paused||!a)return;const S=x.target;a.contains(S)?f.current=S:yt(f.current,{select:!0})},v=function(x){if(p.paused||!a)return;const S=x.relatedTarget;S!==null&&(a.contains(S)||yt(f.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const C of x)C.removedNodes.length>0&&yt(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]),g.useEffect(()=>{if(a){ca.add(p);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(Po,sa);a.addEventListener(Po,d),a.dispatchEvent(y),y.defaultPrevented||(vp(Sp(aa(a)),{select:!0}),document.activeElement===m&&yt(a))}return()=>{a.removeEventListener(Po,d),setTimeout(()=>{const y=new CustomEvent(Oo,sa);a.addEventListener(Oo,u),a.dispatchEvent(y),y.defaultPrevented||yt(m??document.body,{select:!0}),a.removeEventListener(Oo,u),ca.remove(p)},0)}}},[a,d,u,p]);const w=g.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]=xp(k);x&&S?!m.shiftKey&&y===S?(m.preventDefault(),r&&yt(x,{select:!0})):m.shiftKey&&y===x&&(m.preventDefault(),r&&yt(S,{select:!0})):y===k&&m.preventDefault()}},[r,n,p.paused]);return c.jsx(ye.div,{tabIndex:-1,...s,ref:h,onKeyDown:w})});Io.displayName=bp;function vp(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(yt(n,{select:t}),document.activeElement!==r)return}function xp(e){const t=aa(e),r=la(t,e),n=la(t.reverse(),e);return[r,n]}function aa(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 la(e,t){for(const r of e)if(!wp(r,{upTo:t}))return r}function wp(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 yp(e){return e instanceof HTMLInputElement&&"select"in e}function yt(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&yp(e)&&t&&e.select()}}var ca=kp();function kp(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=da(e,t),e.unshift(t)},remove(t){var r;e=da(e,t),(r=e[0])==null||r.resume()}}}function da(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Sp(e){return e.filter(t=>t.tagName!=="A")}var Re=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},Cp=g[" useId ".trim().toString()]||(()=>{}),Ep=0;function Ar(e){const[t,r]=g.useState(Cp());return Re(()=>{r(n=>n??String(Ep++))},[e]),t?`radix-${t}`:""}const jp=["top","right","bottom","left"],kt=Math.min,Ye=Math.max,kn=Math.round,Sn=Math.floor,st=e=>({x:e,y:e}),Np={left:"right",right:"left",bottom:"top",top:"bottom"},Tp={start:"end",end:"start"};function Do(e,t,r){return Ye(e,kt(t,r))}function pt(e,t){return typeof e=="function"?e(t):e}function ht(e){return e.split("-")[0]}function qt(e){return e.split("-")[1]}function _o(e){return e==="x"?"y":"x"}function Mo(e){return e==="y"?"height":"width"}const Ap=new Set(["top","bottom"]);function at(e){return Ap.has(ht(e))?"y":"x"}function Ro(e){return _o(at(e))}function zp(e,t,r){r===void 0&&(r=!1);const n=qt(e),o=Ro(e),i=Mo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Cn(s)),[s,Cn(s)]}function Pp(e){const t=Cn(e);return[Lo(e),t,Lo(t)]}function Lo(e){return e.replace(/start|end/g,t=>Tp[t])}const ua=["left","right"],fa=["right","left"],Op=["top","bottom"],Ip=["bottom","top"];function Dp(e,t,r){switch(e){case"top":case"bottom":return r?t?fa:ua:t?ua:fa;case"left":case"right":return t?Op:Ip;default:return[]}}function _p(e,t,r,n){const o=qt(e);let i=Dp(ht(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Lo)))),i}function Cn(e){return e.replace(/left|right|bottom|top/g,t=>Np[t])}function Mp(e){return{top:0,right:0,bottom:0,left:0,...e}}function pa(e){return typeof e!="number"?Mp(e):{top:e,right:e,bottom:e,left:e}}function En(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 ha(e,t,r){let{reference:n,floating:o}=e;const i=at(t),s=Ro(t),a=Mo(s),l=ht(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(qt(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 Rp(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}=pt(t,e),w=pa(p),v=a[h?f==="floating"?"reference":"floating":f],y=En(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=En(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 Lp=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}=ha(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:j}=await k({x:u,y:f,initialPlacement:n,placement:h,strategy:o,middlewareData:p,rects:d,platform:{...s,detectOverflow:(m=s.detectOverflow)!=null?m:Rp},elements:{reference:e,floating:t}});u=x??u,f=S??f,p={...p,[y]:{...p[y],...C}},j&&w<=50&&(w++,typeof j=="object"&&(j.placement&&(h=j.placement),j.rects&&(d=j.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):j.rects),{x:u,y:f}=ha(d,h,l)),v=-1)}return{x:u,y:f,placement:h,strategy:o,middlewareData:p}},$p=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}=pt(e,t)||{};if(d==null)return{};const f=pa(u),h={x:r,y:n},p=Ro(o),w=Mo(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],j=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let N=j?j[x]:0;(!N||!await(s.isElement==null?void 0:s.isElement(j)))&&(N=a.floating[x]||i.floating[w]);const E=S/2-C/2,D=N/2-m[w]/2-1,R=kt(f[y],D),I=kt(f[k],D),L=R,M=N-m[w]-I,G=N/2-m[w]/2+E,B=Do(L,G,M),F=!l.arrow&&qt(o)!=null&&G!==B&&i.reference[w]/2-(G<L?R:I)-m[w]/2<0,U=F?G<L?G-L:G-M:0;return{[p]:h[p]+U,data:{[p]:B,centerOffset:G-B-U,...F&&{alignmentOffset:U}},reset:F}}}),Fp=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}=pt(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const y=ht(o),k=at(a),x=ht(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(d.floating)),C=h||(x||!m?[Cn(a)]:Pp(a)),j=w!=="none";!h&&j&&C.push(..._p(a,m,w,S));const N=[a,...C],E=await l.detectOverflow(t,v),D=[];let R=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&D.push(E[y]),f){const G=zp(o,s,S);D.push(E[G[0]],E[G[1]])}if(R=[...R,{placement:o,overflows:D}],!D.every(G=>G<=0)){var I,L;const G=(((I=i.flip)==null?void 0:I.index)||0)+1,B=N[G];if(B&&(!(f==="alignment"?k!==at(B):!1)||R.every(A=>at(A.placement)===k?A.overflows[0]>0:!0)))return{data:{index:G,overflows:R},reset:{placement:B}};let F=(L=R.filter(U=>U.overflows[0]<=0).sort((U,A)=>U.overflows[1]-A.overflows[1])[0])==null?void 0:L.placement;if(!F)switch(p){case"bestFit":{var M;const U=(M=R.filter(A=>{if(j){const X=at(A.placement);return X===k||X==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(X=>X>0).reduce((X,re)=>X+re,0)]).sort((A,X)=>A[1]-X[1])[0])==null?void 0:M[0];U&&(F=U);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function ma(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ga(e){return jp.some(t=>e[t]>=0)}const Wp=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:o="referenceHidden",...i}=pt(e,t);switch(o){case"referenceHidden":{const s=await n.detectOverflow(t,{...i,elementContext:"reference"}),a=ma(s,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ga(a)}}}case"escaped":{const s=await n.detectOverflow(t,{...i,altBoundary:!0}),a=ma(s,r.floating);return{data:{escapedOffsets:a,escaped:ga(a)}}}default:return{}}}}},ba=new Set(["left","top"]);async function Up(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=ht(r),a=qt(r),l=at(r)==="y",d=ba.has(s)?-1:1,u=i&&l?-1:1,f=pt(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 Bp=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 Up(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}}}}},Hp=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}=pt(e,t),u={x:r,y:n},f=await i.detectOverflow(t,d),h=at(ht(o)),p=_o(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=Do(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=Do(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}}}}}},Vp=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}=pt(e,t),u={x:r,y:n},f=at(o),h=_o(f);let p=u[h],w=u[f];const m=pt(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=ba.has(ht(o)),C=i.reference[f]-i.floating[x]+(S&&((y=s.offset)==null?void 0:y[f])||0)+(S?0:v.crossAxis),j=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>j&&(w=j)}return{[h]:p,[f]:w}}}},Kp=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}=pt(e,t),u=await s.detectOverflow(t,d),f=ht(o),h=qt(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=kt(m-u[v],k),C=kt(w-u[y],x),j=!t.middlewareData.shift;let N=S,E=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(N=k),j&&!h){const R=Ye(u.left,0),I=Ye(u.right,0),L=Ye(u.top,0),M=Ye(u.bottom,0);p?E=w-2*(R!==0||I!==0?R+I:Ye(u.left,u.right)):N=m-2*(L!==0||M!==0?L+M:Ye(u.top,u.bottom))}await l({...t,availableWidth:E,availableHeight:N});const D=await s.getDimensions(a.floating);return w!==D.width||m!==D.height?{reset:{rects:!0}}:{}}}};function jn(){return typeof window<"u"}function Xt(e){return va(e)?(e.nodeName||"").toLowerCase():"#document"}function qe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function lt(e){var t;return(t=(va(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function va(e){return jn()?e instanceof Node||e instanceof qe(e).Node:!1}function rt(e){return jn()?e instanceof Element||e instanceof qe(e).Element:!1}function ct(e){return jn()?e instanceof HTMLElement||e instanceof qe(e).HTMLElement:!1}function xa(e){return!jn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof qe(e).ShadowRoot}const Gp=new Set(["inline","contents"]);function zr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=nt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Gp.has(o)}const Yp=new Set(["table","td","th"]);function qp(e){return Yp.has(Xt(e))}const Xp=[":popover-open",":modal"];function Nn(e){return Xp.some(t=>{try{return e.matches(t)}catch{return!1}})}const Jp=["transform","translate","scale","rotate","perspective"],Zp=["transform","translate","scale","rotate","perspective","filter"],Qp=["paint","layout","strict","content"];function $o(e){const t=Fo(),r=rt(e)?nt(e):e;return Jp.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)||Zp.some(n=>(r.willChange||"").includes(n))||Qp.some(n=>(r.contain||"").includes(n))}function eh(e){let t=St(e);for(;ct(t)&&!Jt(t);){if($o(t))return t;if(Nn(t))return null;t=St(t)}return null}function Fo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const th=new Set(["html","body","#document"]);function Jt(e){return th.has(Xt(e))}function nt(e){return qe(e).getComputedStyle(e)}function Tn(e){return rt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function St(e){if(Xt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||xa(e)&&e.host||lt(e);return xa(t)?t.host:t}function wa(e){const t=St(e);return Jt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ct(t)&&zr(t)?t:wa(t)}function Pr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=wa(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=qe(o);if(i){const a=Wo(s);return t.concat(s,s.visualViewport||[],zr(o)?o:[],a&&r?Pr(a):[])}return t.concat(o,Pr(o,[],r))}function Wo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ya(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=kn(r)!==i||kn(n)!==s;return a&&(r=i,n=s),{width:r,height:n,$:a}}function Uo(e){return rt(e)?e:e.contextElement}function Zt(e){const t=Uo(e);if(!ct(t))return st(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=ya(t);let s=(i?kn(r.width):r.width)/n,a=(i?kn(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const rh=st(0);function ka(e){const t=qe(e);return!Fo()||!t.visualViewport?rh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==qe(e)?!1:t}function Mt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=Uo(e);let s=st(1);t&&(n?rt(n)&&(s=Zt(n)):s=Zt(e));const a=nh(i,r,n)?ka(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=qe(i),p=n&&rt(n)?qe(n):n;let w=h,m=Wo(w);for(;m&&n&&p!==w;){const v=Zt(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=qe(m),m=Wo(w)}}return En({width:u,height:f,x:l,y:d})}function An(e,t){const r=Tn(e).scrollLeft;return t?t.left+r:Mt(lt(e)).left+r}function Sa(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-An(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function oh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=lt(n),a=t?Nn(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)&&((Xt(n)!=="body"||zr(s))&&(l=Tn(n)),ct(n))){const p=Mt(n);d=Zt(n),u.x=p.x+n.clientLeft,u.y=p.y+n.clientTop}const h=s&&!f&&!i?Sa(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 ih(e){return Array.from(e.getClientRects())}function sh(e){const t=lt(e),r=Tn(e),n=e.ownerDocument.body,o=Ye(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Ye(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+An(e);const a=-r.scrollTop;return nt(n).direction==="rtl"&&(s+=Ye(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:a}}const Ca=25;function ah(e,t){const r=qe(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=Fo();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const d=An(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<=Ca&&(i-=w)}else d<=Ca&&(i+=d);return{width:i,height:s,x:a,y:l}}const lh=new Set(["absolute","fixed"]);function ch(e,t){const r=Mt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=ct(e)?Zt(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 Ea(e,t,r){let n;if(t==="viewport")n=ah(e,r);else if(t==="document")n=sh(lt(e));else if(rt(t))n=ch(t,r);else{const o=ka(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return En(n)}function ja(e,t){const r=St(e);return r===t||!rt(r)||Jt(r)?!1:nt(r).position==="fixed"||ja(r,t)}function dh(e,t){const r=t.get(e);if(r)return r;let n=Pr(e,[],!1).filter(a=>rt(a)&&Xt(a)!=="body"),o=null;const i=nt(e).position==="fixed";let s=i?St(e):e;for(;rt(s)&&!Jt(s);){const a=nt(s),l=$o(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&lh.has(o.position)||zr(s)&&!l&&ja(e,s))?n=n.filter(u=>u!==s):o=a,s=St(s)}return t.set(e,n),n}function uh(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?Nn(t)?[]:dh(t,this._c):[].concat(r),n],a=s[0],l=s.reduce((d,u)=>{const f=Ea(t,u,o);return d.top=Ye(f.top,d.top),d.right=kt(f.right,d.right),d.bottom=kt(f.bottom,d.bottom),d.left=Ye(f.left,d.left),d},Ea(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function fh(e){const{width:t,height:r}=ya(e);return{width:t,height:r}}function ph(e,t,r){const n=ct(t),o=lt(t),i=r==="fixed",s=Mt(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=st(0);function d(){l.x=An(o)}if(n||!n&&!i)if((Xt(t)!=="body"||zr(o))&&(a=Tn(t)),n){const p=Mt(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?Sa(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 Bo(e){return nt(e).position==="static"}function Na(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 Ta(e,t){const r=qe(e);if(Nn(e))return r;if(!ct(e)){let o=St(e);for(;o&&!Jt(o);){if(rt(o)&&!Bo(o))return o;o=St(o)}return r}let n=Na(e,t);for(;n&&qp(n)&&Bo(n);)n=Na(n,t);return n&&Jt(n)&&Bo(n)&&!$o(n)?r:n||eh(e)||r}const hh=async function(e){const t=this.getOffsetParent||Ta,r=this.getDimensions,n=await r(e.floating);return{reference:ph(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function mh(e){return nt(e).direction==="rtl"}const gh={convertOffsetParentRelativeRectToViewportRelativeRect:oh,getDocumentElement:lt,getClippingRect:uh,getOffsetParent:Ta,getElementRects:hh,getClientRects:ih,getDimensions:fh,getScale:Zt,isElement:rt,isRTL:mh};function Aa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bh(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=Sn(f),m=Sn(o.clientWidth-(u+h)),v=Sn(o.clientHeight-(f+p)),y=Sn(u),x={rootMargin:-w+"px "+-m+"px "+-v+"px "+-y+"px",threshold:Ye(0,kt(1,l))||1};let S=!0;function C(j){const N=j[0].intersectionRatio;if(N!==l){if(!S)return s();N?s(!1,N):n=setTimeout(()=>{s(!1,1e-7)},1e3)}N===1&&!Aa(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 vh(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=Uo(e),u=o||i?[...d?Pr(d):[],...Pr(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",r,{passive:!0}),i&&y.addEventListener("resize",r)});const f=d&&a?bh(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?Mt(e):null;l&&v();function v(){const y=Mt(e);m&&!Aa(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 xh=Bp,wh=Hp,yh=Fp,kh=Kp,Sh=Wp,za=$p,Ch=Vp,Eh=(e,t,r)=>{const n=new Map,o={platform:gh,...r},i={...o.platform,_c:n};return Lp(e,t,{...o,platform:i})};var jh=typeof document<"u",Nh=function(){},zn=jh?b.useLayoutEffect:Nh;function Pn(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(!Pn(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)&&!Pn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Pa(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Oa(e,t){const r=Pa(e);return Math.round(t*r)/r}function Ho(e){const t=g.useRef(e);return zn(()=>{t.current=e}),t}function Th(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]=g.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=g.useState(n);Pn(h,n)||p(n);const[w,m]=g.useState(null),[v,y]=g.useState(null),k=g.useCallback(A=>{A!==j.current&&(j.current=A,m(A))},[]),x=g.useCallback(A=>{A!==N.current&&(N.current=A,y(A))},[]),S=i||w,C=s||v,j=g.useRef(null),N=g.useRef(null),E=g.useRef(u),D=l!=null,R=Ho(l),I=Ho(o),L=Ho(d),M=g.useCallback(()=>{if(!j.current||!N.current)return;const A={placement:t,strategy:r,middleware:h};I.current&&(A.platform=I.current),Eh(j.current,N.current,A).then(X=>{const re={...X,isPositioned:L.current!==!1};G.current&&!Pn(E.current,re)&&(E.current=re,Vr.flushSync(()=>{f(re)}))})},[h,t,r,I,L]);zn(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(A=>({...A,isPositioned:!1})))},[d]);const G=g.useRef(!1);zn(()=>(G.current=!0,()=>{G.current=!1}),[]),zn(()=>{if(S&&(j.current=S),C&&(N.current=C),S&&C){if(R.current)return R.current(S,C,M);M()}},[S,C,M,R,D]);const B=g.useMemo(()=>({reference:j,floating:N,setReference:k,setFloating:x}),[k,x]),F=g.useMemo(()=>({reference:S,floating:C}),[S,C]),U=g.useMemo(()=>{const A={position:r,left:0,top:0};if(!F.floating)return A;const X=Oa(F.floating,u.x),re=Oa(F.floating,u.y);return a?{...A,transform:"translate("+X+"px, "+re+"px)",...Pa(F.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:X,top:re}},[r,a,F.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:M,refs:B,elements:F,floatingStyles:U}),[u,M,B,F,U])}const Ah=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?za({element:n.current,padding:o}).fn(r):{}:n?za({element:n,padding:o}).fn(r):{}}}},zh=(e,t)=>({...xh(e),options:[e,t]}),Ph=(e,t)=>({...wh(e),options:[e,t]}),Oh=(e,t)=>({...Ch(e),options:[e,t]}),Ih=(e,t)=>({...yh(e),options:[e,t]}),Dh=(e,t)=>({...kh(e),options:[e,t]}),_h=(e,t)=>({...Sh(e),options:[e,t]}),Mh=(e,t)=>({...Ah(e),options:[e,t]});var Rh="Arrow",Ia=g.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return c.jsx(ye.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"})})});Ia.displayName=Rh;var Lh=Ia;function $h(e){const[t,r]=g.useState(void 0);return Re(()=>{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 Vo="Popper",[Da,Qt]=Tr(Vo),[Fh,_a]=Da(Vo),Ma=e=>{const{__scopePopper:t,children:r}=e,[n,o]=g.useState(null);return c.jsx(Fh,{scope:t,anchor:n,onAnchorChange:o,children:r})};Ma.displayName=Vo;var Ra="PopperAnchor",La=g.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=_a(Ra,r),s=g.useRef(null),a=Se(t,s),l=g.useRef(null);return g.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(ye.div,{...o,ref:a})});La.displayName=Ra;var Ko="PopperContent",[Wh,Uh]=Da(Ko),$a=g.forwardRef((e,t)=>{var O,J,ee,W,ne,Z;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=_a(Ko,r),[y,k]=g.useState(null),x=Se(t,we=>k(we)),[S,C]=g.useState(null),j=$h(S),N=(j==null?void 0:j.width)??0,E=(j==null?void 0:j.height)??0,D=n+(i!=="center"?"-"+i:""),R=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},I=Array.isArray(d)?d:[d],L=I.length>0,M={padding:R,boundary:I.filter(Hh),altBoundary:L},{refs:G,floatingStyles:B,placement:F,isPositioned:U,middlewareData:A}=Th({strategy:"fixed",placement:D,whileElementsMounted:(...we)=>vh(...we,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[zh({mainAxis:o+E,alignmentAxis:s}),l&&Ph({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Oh():void 0,...M}),l&&Ih({...M}),Dh({...M,apply:({elements:we,rects:be,availableWidth:ze,availableHeight:Ie})=>{const{width:He,height:Nt}=be.reference,Je=we.floating.style;Je.setProperty("--radix-popper-available-width",`${ze}px`),Je.setProperty("--radix-popper-available-height",`${Ie}px`),Je.setProperty("--radix-popper-anchor-width",`${He}px`),Je.setProperty("--radix-popper-anchor-height",`${Nt}px`)}}),S&&Mh({element:S,padding:a}),Vh({arrowWidth:N,arrowHeight:E}),h&&_h({strategy:"referenceHidden",...M})]}),[X,re]=Ua(F),T=_t(w);Re(()=>{U&&(T==null||T())},[U,T]);const $=(O=A.arrow)==null?void 0:O.x,q=(J=A.arrow)==null?void 0:J.y,K=((ee=A.arrow)==null?void 0:ee.centerOffset)!==0,[ge,se]=g.useState();return Re(()=>{y&&se(window.getComputedStyle(y).zIndex)},[y]),c.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:U?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(W=A.transformOrigin)==null?void 0:W.x,(ne=A.transformOrigin)==null?void 0:ne.y].join(" "),...((Z=A.hide)==null?void 0:Z.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Wh,{scope:r,placedSide:X,onArrowChange:C,arrowX:$,arrowY:q,shouldHideArrow:K,children:c.jsx(ye.div,{"data-side":X,"data-align":re,...m,ref:x,style:{...m.style,animation:U?void 0:"none"}})})})});$a.displayName=Ko;var Fa="PopperArrow",Bh={top:"bottom",right:"left",bottom:"top",left:"right"},Wa=g.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Uh(Fa,n),s=Bh[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(Lh,{...o,ref:r,style:{...o.style,display:"block"}})})});Wa.displayName=Fa;function Hh(e){return e!==null}var Vh=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]=Ua(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 Ua(e){const[t,r="center"]=e.split("-");return[t,r]}var Go=Ma,On=La,Yo=$a,qo=Wa,Kh="Portal",In=g.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[o,i]=g.useState(!1);Re(()=>i(!0),[]);const s=r||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?bt.createPortal(c.jsx(ye.div,{...n,ref:t}),s):null});In.displayName=Kh;var Gh=g[" useInsertionEffect ".trim().toString()]||Re;function Dn({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Yh({defaultProp:t,onChange:r}),a=e!==void 0,l=a?e:o;{const u=g.useRef(e!==void 0);g.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=g.useCallback(u=>{var f;if(a){const h=qh(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 Yh({defaultProp:e,onChange:t}){const[r,n]=g.useState(e),o=g.useRef(r),i=g.useRef(t);return Gh(()=>{i.current=t},[t]),g.useEffect(()=>{var s;o.current!==r&&((s=i.current)==null||s.call(i,r),o.current=r)},[r,o]),[r,n,i]}function qh(e){return typeof e=="function"}function Xh(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ba=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"}),Jh="VisuallyHidden",Ha=g.forwardRef((e,t)=>c.jsx(ye.span,{...e,ref:t,style:{...Ba,...e.style}}));Ha.displayName=Jh;var Zh=Ha,Qh=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},er=new WeakMap,_n=new WeakMap,Mn={},Xo=0,Va=function(e){return e&&(e.host||Va(e.parentNode))},em=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Va(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})},tm=function(e,t,r,n){var o=em(t,Array.isArray(e)?e:[e]);Mn[r]||(Mn[r]=new WeakMap);var i=Mn[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=(er.get(h)||0)+1,v=(i.get(h)||0)+1;er.set(h,m),i.set(h,v),s.push(h),m===1&&w&&_n.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(),Xo++,function(){s.forEach(function(f){var h=er.get(f)-1,p=i.get(f)-1;er.set(f,h),i.set(f,p),h||(_n.has(f)||f.removeAttribute(n),_n.delete(f)),p||f.removeAttribute(r)}),Xo--,Xo||(er=new WeakMap,er=new WeakMap,_n=new WeakMap,Mn={})}},Ka=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Qh(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),tm(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 Ga(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 rm(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 Rn="right-scroll-bar-position",Ln="width-before-scroll-bar",nm="with-scroll-bars-hidden",om="--removed-body-scroll-bar-size";function Jo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function im(e,t){var r=b.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 sm=typeof window<"u"?g.useLayoutEffect:g.useEffect,Ya=new WeakMap;function am(e,t){var r=im(null,function(n){return e.forEach(function(o){return Jo(o,n)})});return sm(function(){var n=Ya.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(a){i.has(a)||Jo(a,null)}),i.forEach(function(a){o.has(a)||Jo(a,s)})}Ya.set(r,e)},[e]),r}function lm(e){return e}function cm(e,t){t===void 0&&(t=lm);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 dm(e){e===void 0&&(e={});var t=cm(null);return t.options=dt({async:!0,ssr:!1},e),t}var qa=function(e){var t=e.sideCar,r=Ga(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 g.createElement(n,dt({},r))};qa.isSideCarExport=!0;function um(e,t){return e.useMedium(t),qa}var Xa=dm(),Zo=function(){},$n=g.forwardRef(function(e,t){var r=g.useRef(null),n=g.useState({onScrollCapture:Zo,onWheelCapture:Zo,onTouchMoveCapture:Zo}),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=Ga(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,j=am([r,t]),N=dt(dt({},S),o);return g.createElement(g.Fragment,null,u&&g.createElement(C,{sideCar:Xa,removeScrollBar:d,shards:f,noRelative:p,noIsolation:w,inert:m,setCallbacks:i,allowPinchZoom:!!v,lockRef:r,gapMode:x}),s?g.cloneElement(g.Children.only(a),dt(dt({},N),{ref:j})):g.createElement(k,dt({},N,{className:l,ref:j}),a))});$n.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},$n.classNames={fullWidth:Ln,zeroRight:Rn};var fm=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function pm(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=fm();return t&&e.setAttribute("nonce",t),e}function hm(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function mm(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var gm=function(){var e=0,t=null;return{add:function(r){e==0&&(t=pm())&&(hm(t,r),mm(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bm=function(){var e=gm();return function(t,r){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Ja=function(){var e=bm(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},vm={left:0,top:0,right:0,gap:0},Qo=function(e){return parseInt(e||"",10)||0},xm=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[Qo(r),Qo(n),Qo(o)]},wm=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return vm;var t=xm(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])}},ym=Ja(),tr="data-scroll-locked",km=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(nm,` {
|
|
188
188
|
overflow: hidden `).concat(n,`;
|
|
189
189
|
padding-right: `).concat(a,"px ").concat(n,`;
|
|
190
190
|
}
|
|
@@ -218,9 +218,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
body[`).concat(tr,`] {
|
|
221
|
-
`).concat(
|
|
221
|
+
`).concat(om,": ").concat(a,`px;
|
|
222
222
|
}
|
|
223
|
-
`)},Za=function(){var e=parseInt(document.body.getAttribute(tr)||"0",10);return isFinite(e)?e:0},
|
|
223
|
+
`)},Za=function(){var e=parseInt(document.body.getAttribute(tr)||"0",10);return isFinite(e)?e:0},Sm=function(){g.useEffect(function(){return document.body.setAttribute(tr,(Za()+1).toString()),function(){var e=Za()-1;e<=0?document.body.removeAttribute(tr):document.body.setAttribute(tr,e.toString())}},[])},Cm=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;Sm();var i=g.useMemo(function(){return wm(o)},[o]);return g.createElement(ym,{styles:km(i,!t,o,r?"":"!important")})},ei=!1;if(typeof window<"u")try{var Fn=Object.defineProperty({},"passive",{get:function(){return ei=!0,!0}});window.addEventListener("test",Fn,Fn),window.removeEventListener("test",Fn,Fn)}catch{ei=!1}var rr=ei?{passive:!1}:!1,Em=function(e){return e.tagName==="TEXTAREA"},Qa=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Em(e)&&r[t]==="visible")},jm=function(e){return Qa(e,"overflowY")},Nm=function(e){return Qa(e,"overflowX")},el=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=tl(e,n);if(o){var i=rl(e,n),s=i[1],a=i[2];if(s>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Tm=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Am=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},tl=function(e,t){return e==="v"?jm(t):Nm(t)},rl=function(e,t){return e==="v"?Tm(t):Am(t)},zm=function(e,t){return e==="h"&&t==="rtl"?-1:1},Pm=function(e,t,r,n,o){var i=zm(e,window.getComputedStyle(t).direction),s=i*n,a=r.target,l=t.contains(a),d=!1,u=s>0,f=0,h=0;do{if(!a)break;var p=rl(e,a),w=p[0],m=p[1],v=p[2],y=m-v-i*w;(w||y)&&tl(e,a)&&(f+=y,h+=w);var k=a.parentNode;a=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&Math.abs(f)<1||!u&&Math.abs(h)<1)&&(d=!0),d},Wn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},nl=function(e){return[e.deltaX,e.deltaY]},ol=function(e){return e&&"current"in e?e.current:e},Om=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Im=function(e){return`
|
|
224
224
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
225
225
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
226
|
-
`)},_m=0,nr=[];function Mm(e){var t=g.useRef([]),r=g.useRef([0,0]),n=g.useRef(),o=g.useState(_m++)[0],i=g.useState(Ja)[0],s=g.useRef(e);g.useEffect(function(){s.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=nm([e.lockRef.current],(e.shards||[]).map(ol),!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=g.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var y=Wn(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,j=m.target,N=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in m&&N==="h"&&j.type==="range")return!1;var E=window.getSelection(),D=E&&E.anchorNode,R=D?D===j||D.contains(j):!1;if(R)return!1;var I=el(N,j);if(!I)return!0;if(I?C=N:(C=N==="v"?"h":"v",I=el(N,j)),!I)return!1;if(!n.current&&"changedTouches"in m&&(x||S)&&(n.current=C),!C)return!0;var L=n.current||C;return Om(L,v,m,L==="h"?x:S)},[]),l=g.useCallback(function(m){var v=m;if(!(!nr.length||nr[nr.length-1]!==i)){var y="deltaY"in v?nl(v):Wn(v),k=t.current.filter(function(C){return C.name===v.type&&(C.target===v.target||v.target===C.shadowParent)&&Im(C.delta,y)})[0];if(k&&k.should){v.cancelable&&v.preventDefault();return}if(!k){var x=(s.current.shards||[]).map(ol).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=g.useCallback(function(m,v,y,k){var x={name:m,delta:v,target:y,should:k,shadowParent:Rm(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),u=g.useCallback(function(m){r.current=Wn(m),n.current=void 0},[]),f=g.useCallback(function(m){d(m.type,nl(m),m.target,a(m,e.lockRef.current))},[]),h=g.useCallback(function(m){d(m.type,Wn(m),m.target,a(m,e.lockRef.current))},[]);g.useEffect(function(){return nr.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,rr),document.addEventListener("touchmove",l,rr),document.addEventListener("touchstart",u,rr),function(){nr=nr.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,rr),document.removeEventListener("touchmove",l,rr),document.removeEventListener("touchstart",u,rr)}},[]);var p=e.removeScrollBar,w=e.inert;return g.createElement(g.Fragment,null,w?g.createElement(i,{styles:Dm(o)}):null,p?g.createElement(Em,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Rm(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Lm=fm(Xa,Mm);var ti=g.forwardRef(function(e,t){return g.createElement($n,dt({},e,{ref:t,sideCar:Lm}))});ti.classNames=$n.classNames;var $m=[" ","Enter","ArrowUp","ArrowDown"],Fm=[" ","Enter"],Rt="Select",[Un,Bn,Wm]=ip(Rt),[or]=Ar(Rt,[Wm,Qt]),Hn=Qt(),[Um,Ct]=or(Rt),[Bm,Hm]=or(Rt),il=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=Hn(t),[v,y]=g.useState(null),[k,x]=g.useState(null),[S,C]=g.useState(!1),j=ap(d),[N,E]=Dn({prop:n,defaultProp:o??!1,onChange:i,caller:Rt}),[D,R]=Dn({prop:s,defaultProp:a,onChange:l,caller:Rt}),I=g.useRef(null),L=v?w||!!v.closest("form"):!0,[M,Y]=g.useState(new Set),H=Array.from(M).map(U=>U.props.value).join(";");return c.jsx(Go,{...m,children:c.jsxs(Um,{required:p,scope:t,trigger:v,onTriggerChange:y,valueNode:k,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Tr(),value:D,onValueChange:R,open:N,onOpenChange:E,dir:j,triggerPointerDownPosRef:I,disabled:h,children:[c.jsx(Un.Provider,{scope:t,children:c.jsx(Bm,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(U=>{Y(B=>new Set(B).add(U))},[]),onNativeOptionRemove:g.useCallback(U=>{Y(B=>{const T=new Set(B);return T.delete(U),T})},[]),children:r})}),L?c.jsxs(El,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:f,value:D,onChange:U=>R(U.target.value),disabled:h,form:w,children:[D===void 0?c.jsx("option",{value:""}):null,Array.from(M)]},H):null]})})};il.displayName=Rt;var sl="SelectTrigger",al=g.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=Hn(r),s=Ct(sl,r),a=s.disabled||n,l=ke(t,s.onTriggerChange),d=Bn(r),u=g.useRef("touch"),[f,h,p]=Nl(m=>{const v=d().filter(x=>!x.disabled),y=v.find(x=>x.value===s.value),k=Al(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(On,{asChild:!0,...i,children:c.jsx(we.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":jl(s.value)?"":void 0,...o,ref:l,onClick:pe(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&w(m)}),onPointerDown:pe(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:pe(o.onKeyDown,m=>{const v=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&h(m.key),!(v&&m.key===" ")&&$m.includes(m.key)&&(w(),m.preventDefault())})})})});al.displayName=sl;var ll="SelectValue",cl=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...a}=e,l=Ct(ll,r),{onValueNodeHasChildrenChange:d}=l,u=i!==void 0,f=ke(t,l.onValueNodeChange);return Me(()=>{d(u)},[d,u]),c.jsx(we.span,{...a,ref:f,style:{pointerEvents:"none"},children:jl(l.value)?c.jsx(c.Fragment,{children:s}):i})});cl.displayName=ll;var Vm="SelectIcon",dl=g.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return c.jsx(we.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});dl.displayName=Vm;var Km="SelectPortal",ul=e=>c.jsx(In,{asChild:!0,...e});ul.displayName=Km;var Lt="SelectContent",fl=g.forwardRef((e,t)=>{const r=Ct(Lt,e.__scopeSelect),[n,o]=g.useState();if(Me(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?Vr.createPortal(c.jsx(pl,{scope:e.__scopeSelect,children:c.jsx(Un.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),i):null}return c.jsx(hl,{...e,ref:t})});fl.displayName=Lt;var nt=10,[pl,Et]=or(Lt),Gm="SelectContentImpl",Ym=Yt("SelectContent.RemoveScroll"),hl=g.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=Ct(Lt,r),[x,S]=g.useState(null),[C,j]=g.useState(null),N=ke(t,P=>S(P)),[E,D]=g.useState(null),[R,I]=g.useState(null),L=Bn(r),[M,Y]=g.useState(!1),H=g.useRef(!1);g.useEffect(()=>{if(x)return Ka(x)},[x]),oa();const U=g.useCallback(P=>{const[J,...te]=L().map(Q=>Q.ref.current),[F]=te.slice(-1),ne=document.activeElement;for(const Q of P)if(Q===ne||(Q==null||Q.scrollIntoView({block:"nearest"}),Q===J&&C&&(C.scrollTop=0),Q===F&&C&&(C.scrollTop=C.scrollHeight),Q==null||Q.focus(),document.activeElement!==ne))return},[L,C]),B=g.useCallback(()=>U([E,x]),[U,E,x]);g.useEffect(()=>{M&&B()},[M,B]);const{onOpenChange:T,triggerPointerDownPosRef:X}=k;g.useEffect(()=>{if(x){let P={x:0,y:0};const J=F=>{var ne,Q;P={x:Math.abs(Math.round(F.pageX)-(((ne=X.current)==null?void 0:ne.x)??0)),y:Math.abs(Math.round(F.pageY)-(((Q=X.current)==null?void 0:Q.y)??0))}},te=F=>{P.x<=10&&P.y<=10?F.preventDefault():x.contains(F.target)||T(!1),document.removeEventListener("pointermove",J),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",te,{capture:!0})}}},[x,T,X]),g.useEffect(()=>{const P=()=>T(!1);return window.addEventListener("blur",P),window.addEventListener("resize",P),()=>{window.removeEventListener("blur",P),window.removeEventListener("resize",P)}},[T]);const[re,A]=Nl(P=>{const J=L().filter(ne=>!ne.disabled),te=J.find(ne=>ne.ref.current===document.activeElement),F=Al(J,P,te);F&&setTimeout(()=>F.ref.current.focus())}),W=g.useCallback((P,J,te)=>{const F=!H.current&&!te;(k.value!==void 0&&k.value===J||F)&&(D(P),F&&(H.current=!0))},[k.value]),q=g.useCallback(()=>x==null?void 0:x.focus(),[x]),G=g.useCallback((P,J,te)=>{const F=!H.current&&!te;(k.value!==void 0&&k.value===J||F)&&I(P)},[k.value]),me=n==="popper"?ri:ml,se=me===ri?{side:a,sideOffset:l,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:w,hideWhenDetached:m,avoidCollisions:v}:{};return c.jsx(pl,{scope:r,content:x,viewport:C,onViewportChange:j,itemRefCallback:W,selectedItem:E,onItemLeave:q,itemTextRefCallback:G,focusSelectedItem:B,selectedItemText:R,position:n,isPositioned:M,searchRef:re,children:c.jsx(ti,{as:Ym,allowPinchZoom:!0,children:c.jsx(Io,{asChild:!0,trapped:k.open,onMountAutoFocus:P=>{P.preventDefault()},onUnmountAutoFocus:pe(o,P=>{var J;(J=k.trigger)==null||J.focus({preventScroll:!0}),P.preventDefault()}),children:c.jsx(yn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:P=>P.preventDefault(),onDismiss:()=>k.onOpenChange(!1),children:c.jsx(me,{role:"listbox",id:k.contentId,"data-state":k.open?"open":"closed",dir:k.dir,onContextMenu:P=>P.preventDefault(),...y,...se,onPlaced:()=>Y(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:pe(y.onKeyDown,P=>{const J=P.ctrlKey||P.altKey||P.metaKey;if(P.key==="Tab"&&P.preventDefault(),!J&&P.key.length===1&&A(P.key),["ArrowUp","ArrowDown","Home","End"].includes(P.key)){let F=L().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(P.key)&&(F=F.slice().reverse()),["ArrowUp","ArrowDown"].includes(P.key)){const ne=P.target,Q=F.indexOf(ne);F=F.slice(Q+1)}setTimeout(()=>U(F)),P.preventDefault()}})})})})})})});hl.displayName=Gm;var qm="SelectItemAlignedPosition",ml=g.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=Ct(Lt,r),s=Et(Lt,r),[a,l]=g.useState(null),[d,u]=g.useState(null),f=ke(t,N=>u(N)),h=Bn(r),p=g.useRef(!1),w=g.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:y,focusSelectedItem:k}=s,x=g.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&d&&m&&v&&y){const N=i.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),R=y.getBoundingClientRect();if(i.dir!=="rtl"){const ne=R.left-E.left,Q=D.left-ne,xe=N.left-Q,ge=N.width+xe,ze=Math.max(ge,E.width),Oe=window.innerWidth-nt,Be=Xs(Q,[nt,Math.max(nt,Oe-ze)]);a.style.minWidth=ge+"px",a.style.left=Be+"px"}else{const ne=E.right-R.right,Q=window.innerWidth-D.right-ne,xe=window.innerWidth-N.right-Q,ge=N.width+xe,ze=Math.max(ge,E.width),Oe=window.innerWidth-nt,Be=Xs(Q,[nt,Math.max(nt,Oe-ze)]);a.style.minWidth=ge+"px",a.style.right=Be+"px"}const I=h(),L=window.innerHeight-nt*2,M=m.scrollHeight,Y=window.getComputedStyle(d),H=parseInt(Y.borderTopWidth,10),U=parseInt(Y.paddingTop,10),B=parseInt(Y.borderBottomWidth,10),T=parseInt(Y.paddingBottom,10),X=H+U+M+T+B,re=Math.min(v.offsetHeight*5,X),A=window.getComputedStyle(m),W=parseInt(A.paddingTop,10),q=parseInt(A.paddingBottom,10),G=N.top+N.height/2-nt,me=L-G,se=v.offsetHeight/2,P=v.offsetTop+se,J=H+U+P,te=X-J;if(J<=G){const ne=I.length>0&&v===I[I.length-1].ref.current;a.style.bottom="0px";const Q=d.clientHeight-m.offsetTop-m.offsetHeight,xe=Math.max(me,se+(ne?q:0)+Q+B),ge=J+xe;a.style.height=ge+"px"}else{const ne=I.length>0&&v===I[0].ref.current;a.style.top="0px";const xe=Math.max(G,H+m.offsetTop+(ne?W:0)+se)+te;a.style.height=xe+"px",m.scrollTop=J-G+m.offsetTop}a.style.margin=`${nt}px 0`,a.style.minHeight=re+"px",a.style.maxHeight=L+"px",n==null||n(),requestAnimationFrame(()=>p.current=!0)}},[h,i.trigger,i.valueNode,a,d,m,v,y,i.dir,n]);Me(()=>x(),[x]);const[S,C]=g.useState();Me(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);const j=g.useCallback(N=>{N&&w.current===!0&&(x(),k==null||k(),w.current=!1)},[x,k]);return c.jsx(Jm,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:j,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:c.jsx(we.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});ml.displayName=qm;var Xm="SelectPopperPosition",ri=g.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=nt,...i}=e,s=Hn(r);return c.jsx(Yo,{...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)"}})});ri.displayName=Xm;var[Jm,ni]=or(Lt,{}),oi="SelectViewport",gl=g.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=Et(oi,r),s=ni(oi,r),a=ke(t,i.onViewportChange),l=g.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(Un.Slot,{scope:r,children:c.jsx(we.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:pe(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-nt*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})})})]})});gl.displayName=oi;var bl="SelectGroup",[Zm,Qm]=or(bl),eg=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Tr();return c.jsx(Zm,{scope:r,id:o,children:c.jsx(we.div,{role:"group","aria-labelledby":o,...n,ref:t})})});eg.displayName=bl;var vl="SelectLabel",tg=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Qm(vl,r);return c.jsx(we.div,{id:o.id,...n,ref:t})});tg.displayName=vl;var Vn="SelectItem",[rg,xl]=or(Vn),wl=g.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,a=Ct(Vn,r),l=Et(Vn,r),d=a.value===n,[u,f]=g.useState(i??""),[h,p]=g.useState(!1),w=ke(t,k=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,k,n,o)}),m=Tr(),v=g.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(rg,{scope:r,value:n,disabled:o,textId:m,isSelected:d,onItemTextChange:g.useCallback(k=>{f(x=>x||((k==null?void 0:k.textContent)??"").trim())},[]),children:c.jsx(Un.ItemSlot,{scope:r,value:n,disabled:o,textValue:u,children:c.jsx(we.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:pe(s.onFocus,()=>p(!0)),onBlur:pe(s.onBlur,()=>p(!1)),onClick:pe(s.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:pe(s.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:pe(s.onPointerDown,k=>{v.current=k.pointerType}),onPointerMove:pe(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:pe(s.onPointerLeave,k=>{var x;k.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:pe(s.onKeyDown,k=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&k.key===" "||(Fm.includes(k.key)&&y(),k.key===" "&&k.preventDefault())})})})})});wl.displayName=Vn;var Or="SelectItemText",yl=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=Ct(Or,r),a=Et(Or,r),l=xl(Or,r),d=Hm(Or,r),[u,f]=g.useState(null),h=ke(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=g.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 Me(()=>(m(w),()=>v(w)),[m,v,w]),c.jsxs(c.Fragment,{children:[c.jsx(we.span,{id:l.textId,...i,ref:h}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Vr.createPortal(i.children,s.valueNode):null]})});yl.displayName=Or;var kl="SelectItemIndicator",Sl=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return xl(kl,r).isSelected?c.jsx(we.span,{"aria-hidden":!0,...n,ref:t}):null});Sl.displayName=kl;var ii="SelectScrollUpButton",ng=g.forwardRef((e,t)=>{const r=Et(ii,e.__scopeSelect),n=ni(ii,e.__scopeSelect),[o,i]=g.useState(!1),s=ke(t,n.onScrollButtonChange);return Me(()=>{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(Cl,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});ng.displayName=ii;var si="SelectScrollDownButton",og=g.forwardRef((e,t)=>{const r=Et(si,e.__scopeSelect),n=ni(si,e.__scopeSelect),[o,i]=g.useState(!1),s=ke(t,n.onScrollButtonChange);return Me(()=>{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(Cl,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});og.displayName=si;var Cl=g.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=Et("SelectScrollButton",r),s=g.useRef(null),a=Bn(r),l=g.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return g.useEffect(()=>()=>l(),[l]),Me(()=>{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(we.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:pe(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:pe(o.onPointerMove,()=>{var d;(d=i.onItemLeave)==null||d.call(i),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:pe(o.onPointerLeave,()=>{l()})})}),ig="SelectSeparator",sg=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return c.jsx(we.div,{"aria-hidden":!0,...n,ref:t})});sg.displayName=ig;var ai="SelectArrow",ag=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Hn(r),i=Ct(ai,r),s=Et(ai,r);return i.open&&s.position==="popper"?c.jsx(qo,{...o,...n,ref:t}):null});ag.displayName=ai;var lg="SelectBubbleInput",El=g.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=g.useRef(null),i=ke(n,o),s=Jh(t);return g.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(we.select,{...r,style:{...Ba,...r.style},ref:i,defaultValue:t})});El.displayName=lg;function jl(e){return e===""||e===void 0}function Nl(e){const t=_t(e),r=g.useRef(""),n=g.useRef(0),o=g.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=g.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function Al(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=cg(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 cg(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var dg=il,Tl=al,ug=cl,fg=dl,pg=ul,zl=fl,hg=gl,Pl=wl,mg=yl,gg=Sl;const bg=dg,vg=ug,Ol=g.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(Tl,{ref:n,className:oe("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(fg,{asChild:!0,children:c.jsx(Jr,{className:"h-3 w-3 shrink-0 text-zinc-400",strokeWidth:2})})]}));Ol.displayName=Tl.displayName;const Il=g.forwardRef(({className:e,children:t,position:r="popper",...n},o)=>c.jsx(pg,{children:c.jsx(zl,{ref:o,className:oe("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(hg,{className:oe("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));Il.displayName=zl.displayName;const Dl=g.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(Pl,{ref:n,className:oe("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(gg,{children:c.jsx(so,{className:"h-3 w-3",strokeWidth:2})})}),c.jsx(mg,{children:t})]}));Dl.displayName=Pl.displayName;const _l=g.createContext(null);function Ml(){const e=g.useContext(_l);if(!e)throw new Error("Dialog components must be used within Dialog");return e}function Rl({open:e,onOpenChange:t,children:r}){const[n,o]=g.useState(!1),i=e!==void 0,s=i?e:n,a=g.useCallback(d=>{i||o(d),t==null||t(d)},[i,t]),l=g.useMemo(()=>({open:s,onOpenChange:a}),[s,a]);return c.jsx(_l.Provider,{value:l,children:r})}function xg({asChild:e,children:t}){const{onOpenChange:r}=Ml(),n=g.Children.only(t);return e&&g.isValidElement(n)?g.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 Ll({className:e,children:t,preventCloseOnBackdropClick:r,...n}){const{open:o,onOpenChange:i}=Ml();if(g.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 bt.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:oe("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 $l({className:e,...t}){return c.jsx("div",{className:oe("flex flex-col gap-1.5 pb-4",e),...t})}function wg({className:e,...t}){return c.jsx("div",{className:oe("flex justify-end gap-2 pt-4",e),...t})}function Fl({className:e,...t}){return c.jsx("h2",{className:oe("text-sm font-semibold text-white",e),...t})}function Wl({className:e,...t}){return c.jsx("p",{className:oe("text-xs text-zinc-400",e),...t})}const qe=g.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?Qf:"button";return c.jsx(d,{ref:i,type:"button",className:oe(s,a[t],l[r],e),...o})});qe.displayName="Button";const yg=["library","upload","url"];function kg({library:e,selectedId:t,onSelect:r}){const[n,o]=b.useState(""),[i,s]=b.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($d,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-zinc-600 pointer-events-none"}),c.jsx(Ao,{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:oe("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:oe("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:oe("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:oe("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(so,{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 Sg({preview:e,onPreviewChange:t,onAssetUpload:r}){const[n,o]=b.useState(!1),i=b.useRef(null),s=b.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=b.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=b.useCallback(u=>{u.preventDefault(),u.stopPropagation(),o(!0)},[]),d=b.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:oe("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(Qr,{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(is,{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 Cg({urlPreview:e,onUrlPreviewChange:t}){const[r,n]=b.useState(""),[o,i]=b.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(Dt,{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(Ao,{value:r,onChange:a=>{n(a.target.value),i(!1)},onKeyDown:a=>a.key==="Enter"&&s(),placeholder:"https://images.unsplash.com/photo-...",className:oe("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(so,{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(ns,{size:32,className:"mb-3 opacity-40"}),c.jsx("p",{className:"text-xs",children:"Incolla un URL e premi Anteprima per verificare"})]})]})}const Eg=({open:e,onOpenChange:t,onSelect:r})=>{const{assets:n}=pr(),o=(n==null?void 0:n.assetsManifest)??[],[i,s]=b.useState("library"),[a,l]=b.useState(null),[d,u]=b.useState(null),[f,h]=b.useState(null);b.useEffect(()=>{e&&(s("library"),l(null),u(null),h(null))},[e]),b.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]),b.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(Rl,{open:e,onOpenChange:t,children:c.jsxs(Ll,{className:"max-w-2xl p-0 gap-0 max-h-[90vh] flex flex-col",preventCloseOnBackdropClick:i==="upload",onDragOver:v,onDrop:v,children:[c.jsxs($l,{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(Zr,{size:18})}),c.jsxs("div",{children:[c.jsx(Fl,{children:"Image Picker"}),c.jsx(Wl,{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(Ut,{size:18})})]}),c.jsx("div",{className:"flex border-b border-zinc-800",children:yg.map(y=>c.jsxs("button",{type:"button",onClick:()=>s(y),className:oe("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(Zr,{size:14}),y==="upload"&&c.jsx(is,{size:14}),y==="url"&&c.jsx(ns,{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(kg,{library:o,selectedId:a,onSelect:l}),i==="upload"&&c.jsx(Sg,{preview:d,onPreviewChange:u,onAssetUpload:n==null?void 0:n.onAssetUpload}),i==="url"&&c.jsx(Cg,{urlPreview:f,onUrlPreviewChange:h})]}),c.jsxs(wg,{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:oe(!p&&"opacity-40"),children:"Inserisci immagine"})]})]})]})})},Ul=(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}`},jg=({value:e,onChange:t,label:r="IMAGE",className:n})=>{const{tenantId:o="default"}=pr(),[i,s]=b.useState(!1),[a,l]=b.useState(!1),d=!!(e!=null&&e.url),u=e!=null&&e.url?Ul(e.url,o):"",f=p=>{t(p),s(!1)},h=p=>{p.stopPropagation(),t({url:"",alt:""})};return c.jsxs("div",{className:oe("space-y-1.5",n),children:[c.jsx(Dt,{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:oe("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:oe("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(Ld,{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(Qr,{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:oe("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(Zr,{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(Eg,{open:i,onOpenChange:s,onSelect:f})]})},Bl=[{name:"layers",Icon:lo},{name:"github",Icon:Md},{name:"arrow-right",Icon:zd},{name:"box",Icon:Od},{name:"terminal",Icon:Ud},{name:"chevron-right",Icon:Id},{name:"menu",Icon:Rd},{name:"x",Icon:Ut},{name:"sparkles",Icon:Wd},{name:"zap",Icon:Hd}],Kn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),ir={"ui:text":({label:e,value:t,onChange:r})=>c.jsxs("div",{className:"grid w-full items-center gap-2 mb-4",children:[c.jsx(Dt,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Kn(e)}),c.jsx(Ao,{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(Dt,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Kn(e)}),c.jsx(Xf,{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(Dt,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Kn(e)}),c.jsxs(bg,{value:t||"",onValueChange:r,children:[c.jsx(Ol,{className:"w-full h-9 text-[13px] bg-zinc-900/50 border-zinc-700 focus:ring-blue-600",children:c.jsx(vg,{placeholder:"Select..."})}),c.jsx(Il,{className:"dark",children:n.map(o=>c.jsx(Dl,{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(Jf,{id:e,checked:!!t,onCheckedChange:n=>r(n===!0)}),c.jsx(Dt,{htmlFor:e,className:"text-[13px] font-medium cursor-pointer select-none text-zinc-200",children:Kn(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(jg,{label:e,value:n,onChange:o})})},"ui:icon-picker":({label:e,value:t,onChange:r})=>{const[n,o]=b.useState(!1),i=Bl.find(s=>s.name===(t||""));return c.jsxs("div",{className:"grid w-full gap-1.5 mb-4",children:[c.jsx(Dt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),c.jsxs(Rl,{open:n,onOpenChange:o,children:[c.jsx(xg,{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(Zr,{size:16,className:"text-zinc-500 shrink-0"}),c.jsx("span",{className:"text-[11px] text-zinc-500",children:"Choose icon..."})]})})}),c.jsxs(Ll,{className:"sm:max-w-[280px] p-4",children:[c.jsxs($l,{children:[c.jsx(Fl,{className:"text-sm",children:"Choose icon"}),c.jsx(Wl,{className:"text-xs",children:"Click an icon to select it."})]}),c.jsx("div",{className:"grid grid-cols-5 gap-2 py-2",children:Bl.map(({name:s,Icon:a})=>c.jsx("button",{type:"button",onClick:()=>{r(s),o(!1)},className:oe("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))})]})]})]})}},li=e=>{if(e instanceof Ne.z.ZodOptional||e instanceof Ne.z.ZodDefault)return li(e._def.innerType);if(e instanceof Ne.z.ZodObject){const t={id:crypto.randomUUID()};for(const r in e.shape)r!=="id"&&(t[r]=li(e.shape[r]));return t}return e instanceof Ne.z.ZodArray?[]:e instanceof Ne.z.ZodString?"":e instanceof Ne.z.ZodNumber?0:e instanceof Ne.z.ZodBoolean?!1:e instanceof Ne.z.ZodEnum?e._def.values[0]:null},Gn=e=>e instanceof Ne.z.ZodOptional||e instanceof Ne.z.ZodDefault||e instanceof Ne.z.ZodNullable?Gn(e._def.innerType):e,Hl=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=Gn(e);return r!==e?Hl(r):null},Yn=(e,t)=>e&&!t?"opacity-10":"opacity-100",sr=(e,t)=>e!=null&&t.toLowerCase()===e.toLowerCase(),ci=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),Ir=({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=Gn(h),w=Hl(h)||"ui:text",m=t[f];if(w==="ui:editorial-markdown")return null;if(w==="ui:image-picker"&&p instanceof Ne.z.ZodObject){const S=sr(d,f),C=ir["ui:image-picker"]||ir["ui:text"];return c.jsx("div",{className:`transition-opacity duration-200 ${Yn(u,S)}`,...S?{"data-jp-focused-field":f}:{},children:c.jsx(C,{label:f,value:m,onChange:j=>r({...t,[f]:j})})},f)}if(p instanceof Ne.z.ZodObject){const S=m||{},C=sr(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 ${Yn(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:ci(f)})]}),c.jsx(Ir,{schema:p,data:S,onChange:j=>r({...t,[f]:j}),expandedItemPath:o&&sr(l==null?void 0:l.fieldKey,f)?o.slice(1):void 0})]},f)}if(p instanceof Ne.z.ZodArray){const S=Array.isArray(m)?m:[],C=Gn(p.element),j=(R,I)=>{if(I<0||I>=S.length)return;const L=[...S],[M]=L.splice(R,1);L.splice(I,0,M),r({...t,[f]:L})},N=sr(d,f),D=sr(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 ${Yn(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:[ci(f)," (",S.length,")"]}),c.jsxs("button",{type:"button",onClick:()=>{const R=li(C);r({...t,[f]:[...S,R]})},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(co,{size:12})," Add Item"]})]}),c.jsx("div",{className:"space-y-2",children:S.map((R,I)=>{const L=R,M=L.id||`legacy-${I}`,Y=(typeof L.title=="string"?L.title:null)||(typeof L.label=="string"?L.label:null)||(typeof L.name=="string"?L.name:null)||(typeof L.content=="string"?L.content:null)||(typeof L.text=="string"?L.text:null)||`${ci(f)} #${I+1}`,H=D,U=String(L.id??M),B=H!=null&&String(H)===U,T=B&&o&&o.length>1?o.slice(1):void 0,X=u&&N&&H!=null&&!B;return c.jsx(Ng,{itemId:U,openItemId:H!=null?String(H):void 0,isFaded:X,index:I,isFirst:I===0,isLast:I===S.length-1,label:Y,onExpandedChange:i?re=>i(re?{fieldKey:f,itemId:U}:null):void 0,onRemove:()=>{const re=S.filter((A,W)=>W!==I);r({...t,[f]:re})},onMoveUp:()=>j(I,I-1),onMoveDown:()=>j(I,I+1),children:C instanceof Ne.z.ZodObject?c.jsx(Ir,{schema:C,data:L||{},expandedItemPath:T,onChange:re=>{const A=[...S];A[I]=re,r({...t,[f]:A})}}):c.jsx("div",{className:"text-[10px] text-red-400",children:"Primitive arrays not supported."})},M)})})]},f)}const v=w in ir?w:"ui:text",y=ir[v]||ir["ui:text"],k=p instanceof Ne.z.ZodEnum?p._def.values:void 0,x=sr(d,f);return c.jsx("div",{className:`transition-opacity duration-200 ${Yn(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)})})},Ng=({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]=b.useState(f);b.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(ao,{size:12,className:"shrink-0"}):c.jsx(Jr,{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(Pd,{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(Td,{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(Qr,{size:12})})]})]}),h&&c.jsx("div",{className:"p-4 border-t border-zinc-800 bg-black/20",children:u})]})};function Ag(e,t){return g.useReducer((r,n)=>t[r][n]??r,e)}var Dr=e=>{const{present:t,children:r}=e,n=Tg(t),o=typeof r=="function"?r({present:n.isPresent}):g.Children.only(r),i=ke(n.ref,zg(o));return typeof r=="function"||n.isPresent?g.cloneElement(o,{ref:i}):null};Dr.displayName="Presence";function Tg(e){const[t,r]=g.useState(),n=g.useRef(null),o=g.useRef(e),i=g.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 g.useEffect(()=>{const d=qn(n.current);i.current=a==="mounted"?d:"none"},[a]),Me(()=>{const d=n.current,u=o.current;if(u!==e){const h=i.current,p=qn(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]),Me(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,f=p=>{const m=qn(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=qn(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:g.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function qn(e){return(e==null?void 0:e.animationName)||"none"}function zg(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[Xn]=Ar("Tooltip",[Qt]),Jn=Qt(),Vl="TooltipProvider",Pg=700,di="tooltip.open",[Og,ui]=Xn(Vl),Kl=e=>{const{__scopeTooltip:t,delayDuration:r=Pg,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:i}=e,s=g.useRef(!0),a=g.useRef(!1),l=g.useRef(0);return g.useEffect(()=>{const d=l.current;return()=>window.clearTimeout(d)},[]),c.jsx(Og,{scope:t,isOpenDelayedRef:s,delayDuration:r,onOpen:g.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:g.useCallback(d=>{a.current=d},[]),disableHoverableContent:o,children:i})};Kl.displayName=Vl;var _r="Tooltip",[Ig,Mr]=Xn(_r),Gl=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=ui(_r,e.__scopeTooltip),d=Jn(t),[u,f]=g.useState(null),h=Tr(),p=g.useRef(0),w=s??l.disableHoverableContent,m=a??l.delayDuration,v=g.useRef(!1),[y,k]=Dn({prop:n,defaultProp:o??!1,onChange:N=>{N?(l.onOpen(),document.dispatchEvent(new CustomEvent(di))):l.onClose(),i==null||i(N)},caller:_r}),x=g.useMemo(()=>y?v.current?"delayed-open":"instant-open":"closed",[y]),S=g.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v.current=!1,k(!0)},[k]),C=g.useCallback(()=>{window.clearTimeout(p.current),p.current=0,k(!1)},[k]),j=g.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{v.current=!0,k(!0),p.current=0},m)},[m,k]);return g.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),c.jsx(Go,{...d,children:c.jsx(Ig,{scope:t,contentId:h,open:y,stateAttribute:x,trigger:u,onTriggerChange:f,onTriggerEnter:g.useCallback(()=>{l.isOpenDelayedRef.current?j():S()},[l.isOpenDelayedRef,j,S]),onTriggerLeave:g.useCallback(()=>{w?C():(window.clearTimeout(p.current),p.current=0)},[C,w]),onOpen:S,onClose:C,disableHoverableContent:w,children:r})})};Gl.displayName=_r;var fi="TooltipTrigger",Yl=g.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Mr(fi,r),i=ui(fi,r),s=Jn(r),a=g.useRef(null),l=ke(t,a,o.onTriggerChange),d=g.useRef(!1),u=g.useRef(!1),f=g.useCallback(()=>d.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),c.jsx(On,{asChild:!0,...s,children:c.jsx(we.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:l,onPointerMove:pe(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:pe(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:pe(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:pe(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:pe(e.onBlur,o.onClose),onClick:pe(e.onClick,o.onClose)})})});Yl.displayName=fi;var pi="TooltipPortal",[Dg,_g]=Xn(pi,{forceMount:void 0}),ql=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,i=Mr(pi,t);return c.jsx(Dg,{scope:t,forceMount:r,children:c.jsx(Dr,{present:r||i.open,children:c.jsx(In,{asChild:!0,container:o,children:n})})})};ql.displayName=pi;var ar="TooltipContent",Xl=g.forwardRef((e,t)=>{const r=_g(ar,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...i}=e,s=Mr(ar,e.__scopeTooltip);return c.jsx(Dr,{present:n||s.open,children:s.disableHoverableContent?c.jsx(Jl,{side:o,...i,ref:t}):c.jsx(Mg,{side:o,...i,ref:t})})}),Mg=g.forwardRef((e,t)=>{const r=Mr(ar,e.__scopeTooltip),n=ui(ar,e.__scopeTooltip),o=g.useRef(null),i=ke(t,o),[s,a]=g.useState(null),{trigger:l,onClose:d}=r,u=o.current,{onPointerInTransitChange:f}=n,h=g.useCallback(()=>{a(null),f(!1)},[f]),p=g.useCallback((w,m)=>{const v=w.currentTarget,y={x:w.clientX,y:w.clientY},k=Wg(y,v.getBoundingClientRect()),x=Ug(y,k),S=Bg(m.getBoundingClientRect()),C=Vg([...x,...S]);a(C),f(!0)},[f]);return g.useEffect(()=>()=>h(),[h]),g.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]),g.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=!Hg(y,s);k?h():x&&(h(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[l,u,s,d,h]),c.jsx(Jl,{...e,ref:i})}),[Rg,Lg]=Xn(_r,{isInside:!1}),$g=tp("TooltipContent"),Jl=g.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=Mr(ar,r),d=Jn(r),{onClose:u}=l;return g.useEffect(()=>(document.addEventListener(di,u),()=>document.removeEventListener(di,u)),[u]),g.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(yn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:c.jsxs(Yo,{"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($g,{children:n}),c.jsx(Rg,{scope:r,isInside:!0,children:c.jsx(Qh,{id:l.contentId,role:"tooltip",children:o||n})})]})})});Xl.displayName=ar;var Zl="TooltipArrow",Fg=g.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Jn(r);return Lg(Zl,r).isInside?null:c.jsx(qo,{...o,...n,ref:t})});Fg.displayName=Zl;function Wg(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 Ug(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 Bg(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 Hg(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 Vg(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),Kg(t)}function Kg(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 Gg=Kl,Yg=Gl,qg=Yl,Xg=ql,Ql=Xl;const Jg=Gg,Rr=Yg,Lr=qg,lr=g.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(Xg,{children:c.jsx(Ql,{ref:n,sideOffset:t,className:oe("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})}));lr.displayName=Ql.displayName;var Zn="Popover",[ec]=Ar(Zn,[Qt]),$r=Qt(),[Zg,jt]=ec(Zn),tc=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=$r(t),l=g.useRef(null),[d,u]=g.useState(!1),[f,h]=Dn({prop:n,defaultProp:o??!1,onChange:i,caller:Zn});return c.jsx(Go,{...a,children:c.jsx(Zg,{scope:t,contentId:Tr(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:g.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:d,onCustomAnchorAdd:g.useCallback(()=>u(!0),[]),onCustomAnchorRemove:g.useCallback(()=>u(!1),[]),modal:s,children:r})})};tc.displayName=Zn;var rc="PopoverAnchor",Qg=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=jt(rc,r),i=$r(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return g.useEffect(()=>(s(),()=>a()),[s,a]),c.jsx(On,{...i,...n,ref:t})});Qg.displayName=rc;var nc="PopoverTrigger",oc=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=jt(nc,r),i=$r(r),s=ke(t,o.triggerRef),a=c.jsx(we.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":cc(o.open),...n,ref:s,onClick:pe(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:c.jsx(On,{asChild:!0,...i,children:a})});oc.displayName=nc;var hi="PopoverPortal",[e0,t0]=ec(hi,{forceMount:void 0}),ic=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=jt(hi,t);return c.jsx(e0,{scope:t,forceMount:r,children:c.jsx(Dr,{present:r||i.open,children:c.jsx(In,{asChild:!0,container:o,children:n})})})};ic.displayName=hi;var cr="PopoverContent",sc=g.forwardRef((e,t)=>{const r=t0(cr,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=jt(cr,e.__scopePopover);return c.jsx(Dr,{present:n||i.open,children:i.modal?c.jsx(n0,{...o,ref:t}):c.jsx(o0,{...o,ref:t})})});sc.displayName=cr;var r0=Yt("PopoverContent.RemoveScroll"),n0=g.forwardRef((e,t)=>{const r=jt(cr,e.__scopePopover),n=g.useRef(null),o=ke(t,n),i=g.useRef(!1);return g.useEffect(()=>{const s=n.current;if(s)return Ka(s)},[]),c.jsx(ti,{as:r0,allowPinchZoom:!0,children:c.jsx(ac,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:pe(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:pe(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:pe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),o0=g.forwardRef((e,t)=>{const r=jt(cr,e.__scopePopover),n=g.useRef(!1),o=g.useRef(!1);return c.jsx(ac,{...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()}})}),ac=g.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=jt(cr,r),p=$r(r);return oa(),c.jsx(Io,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:c.jsx(yn,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),children:c.jsx(Yo,{"data-state":cc(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)"}})})})}),lc="PopoverClose",i0=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=jt(lc,r);return c.jsx(we.button,{type:"button",...n,ref:t,onClick:pe(e.onClick,()=>o.onOpenChange(!1))})});i0.displayName=lc;var s0="PopoverArrow",a0=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=$r(r);return c.jsx(qo,{...o,...n,ref:t})});a0.displayName=s0;function cc(e){return e?"open":"closed"}var l0=tc,c0=oc,d0=ic,dc=sc;const u0=l0,f0=c0,uc=g.forwardRef(({className:e,align:t="start",sideOffset:r=6,...n},o)=>c.jsx(d0,{children:c.jsx(dc,{ref:o,align:t,sideOffset:r,className:oe("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})}));uc.displayName=dc.displayName;const fc=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"Select page",p0=({pageSlugs:e,currentSlug:t,onPageChange:r,sectionCount:n,onNewPage:o,className:i,currentPageLabel:s})=>{const[a,l]=b.useState(!1),d=s??fc(t),u=f=>{r(f),l(!1)};return c.jsx("div",{className:oe("mx-3 mt-2 mb-2",i),children:c.jsxs(u0,{open:a,onOpenChange:l,children:[c.jsx(f0,{asChild:!0,children:c.jsxs("button",{type:"button","aria-haspopup":"listbox","aria-label":`Select page, current: ${d}`,className:oe("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(_d,{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(Jr,{size:13,className:"shrink-0 text-zinc-500","aria-hidden":!0})]})}),c.jsxs(uc,{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=fc(f);return c.jsxs("button",{type:"button",role:"option","aria-selected":h,onClick:()=>u(f),className:oe("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(co,{size:12,"aria-hidden":!0}),c.jsx("span",{children:"New page"})]})})]})]})})},mi=new Set(["anchorId","paddingTop","paddingBottom","theme","container"]),pc=new Set(["ui:editorial-markdown"]),hc=e=>e instanceof Ne.z.ZodOptional||e instanceof Ne.z.ZodDefault||e instanceof Ne.z.ZodNullable?hc(e._def.innerType):e,gi=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=hc(e);return o!==e?gi(o):""},bi=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),h0={activationConstraint:{distance:8}},m0={activationConstraint:{delay:200,tolerance:5}};function vi({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:oe("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(rs,{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(rs,{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:oe("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(Rr,{children:[c.jsx(Lr,{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(Fd,{size:12})})}),c.jsx(lr,{children:"Settings"})]}),s&&c.jsxs(Rr,{children:[c.jsx(Lr,{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(Qr,{size:12})})}),c.jsx(lr,{children:"Delete section"})]})]})]})}function g0({layer:e,opts:t}){const{attributes:r,listeners:n,setNodeRef:o,transform:i,transition:s,isDragging:a}=Vf({id:e.id,disabled:!t.canReorder}),l={transform:xt.Transform.toString(i),transition:s};return c.jsx("div",{ref:o,style:l,className:oe(a&&"z-10"),children:c.jsx(vi,{layer:e,opts:{...t,isDragging:a},dragHandleProps:t.canReorder?{...r,...n,"aria-roledescription":"elemento trascinabile"}:void 0})})}const mc=({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:j=!1,pageSlugs:N=[],currentSlug:E="home",onPageChange:D})=>{const{schemas:R}=pr(),[I,L]=b.useState(!0),[M,Y]=b.useState(null),[H,U]=b.useState(null),[B,T]=b.useState(null),[X,re]=b.useState(null),A=b.useRef(null),W=b.useRef(null),q=gu(go(So,h0),go(zs,m0),go(yo,{coordinateGetter:Yf})),G=b.useDeferredValue(e),me=e!=null&&(G==null?void 0:G.id)!==e.id,se=s&&s.length>0?s:B?[B]:null,P=se!=null&&se.length?{fieldKey:se[se.length-1].fieldKey,itemId:se[se.length-1].itemId}:null,J=b.useRef(s);b.useEffect(()=>{J.current!=null&&s==null&&T(null),J.current=s},[s]),b.useEffect(()=>{(e==null?void 0:e.id)!=null&&L(!1)},[e==null?void 0:e.id]);const te=()=>{const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{const ee=A.current;ee&&ee.scrollTo({top:0,behavior:"smooth"})})});return()=>cancelAnimationFrame(_)},F=b.useRef(I);b.useEffect(()=>{if(I&&!F.current){const _=te();return F.current=I,_}F.current=I},[I]),b.useEffect(()=>{if(!P)return;const _=A.current;if(!_)return;const ee=requestAnimationFrame(()=>{const ie=_.querySelector("[data-jp-expanded-item]")??_.querySelector("[data-jp-focused-field]");ie&&ie.scrollIntoView({behavior:"smooth",block:"start"})});return()=>cancelAnimationFrame(ee)},[P]);const ne=_=>{L(!1),u==null||u(_)},Q=()=>{L(_=>{const ee=!_;return ee&&te(),ee})},xe=(_,ee)=>{ee.stopPropagation(),r.length>0&&o?re(_):(L(!1),u==null||u(_))};b.useEffect(()=>{if(X==null)return;const _=ee=>{ee.key==="Escape"&&re(null)};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[X]);const ge=_=>{M===_?(f==null||f(_),Y(null)):(Y(_),setTimeout(()=>Y(null),3e3))},ze=b.useMemo(()=>l.filter(_=>_.scope==="local").map(_=>_.id),[l]),Oe=!!a&&ze.length>0,Be=_=>{U(_.active.id)},Nt=_=>{U(null);const{active:ee,over:ie}=_;if(!ie||ee.id===ie.id||!a)return;const fe=l.findIndex(Ee=>Ee.id===ee.id),Ie=l.findIndex(Ee=>Ee.id===ie.id);if(fe===-1||Ie===-1)return;const ye=fe<Ie?Ie:Ie-1;a(ee.id,ye)},Xe=e?t.sections.find(_=>_.id===e.id):void 0,He=G?t.sections.find(_=>_.id===G.id):void 0,Ve=G?R[G.type]:void 0,mt=b.useMemo(()=>{if(!Ve)return!1;const _=Ve.shape,ee=Object.keys(_).filter(ie=>!mi.has(ie));return ee.length===0?!1:ee.every(ie=>pc.has(gi(_[ie])))},[Ve]);b.useEffect(()=>{(e==null?void 0:e.id)!=null&&mt&&L(!0)},[e==null?void 0:e.id,mt]);const ot=l.length>0&&(I||!e),At=E?E.charAt(0).toUpperCase()+E.slice(1):"Select page",Wr=b.useMemo(()=>{const _=[];let ee=null;for(const ie of l){const fe=ie.type.toUpperCase(),Ie=ee!==null&&(ee==="HEADER"&&fe!=="HEADER"||ee!=="HEADER"&&ee!=="FOOTER"&&fe==="FOOTER");_.push({layer:ie,showSeparatorAbove:Ie}),ee=fe}return _},[l]);return c.jsx(Jg,{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:[At," · ",l.length," sections"]})})]}),c.jsx(qe,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":"Close Inspector",children:c.jsx(Ut,{size:14})})]}),N.length>0&&D&&c.jsx(p0,{pageSlugs:N,currentSlug:E,onPageChange:D,sectionCount:l.length,currentPageLabel:At}),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:Q,className:"flex items-center gap-2 flex-1 cursor-pointer min-w-0 text-left","aria-expanded":ot,"aria-label":ot?"Collapse Page Layers":"Expand Page Layers",children:[c.jsx(lo,{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(ao,{size:13,className:oe("ml-auto text-zinc-600 transition-transform duration-200 shrink-0",!I&&"rotate-180")})]}),h!=null&&c.jsxs(Rr,{children:[c.jsx(Lr,{asChild:!0,children:c.jsx(qe,{variant:"ghost",size:"icon-sm",className:"text-zinc-500 hover:text-primary",onClick:h,children:c.jsx(co,{size:14})})}),c.jsx(lr,{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:A,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:ot&&c.jsxs("div",{className:"py-1",children:[c.jsxs(hf,{sensors:q,collisionDetection:xu,modifiers:[Of],onDragStart:Be,onDragEnd:Nt,accessibility:{announcements:{onDragStart:()=>"Sezione presa in carico. Usa i tasti freccia per spostare, Spazio per rilasciare.",onDragOver:({over:_})=>_?`Posizione ${ze.indexOf(String(_.id))+1} di ${ze.length}.`:void 0,onDragEnd:({over:_})=>_?"Sezione rilasciata in nuova posizione.":"Riposizionamento annullato.",onDragCancel:()=>"Riposizionamento annullato."}},children:[c.jsx(Lf,{items:ze,strategy:Mf,children:c.jsx("div",{className:"px-2 space-y-0.5",children:Wr.map(({layer:_,showSeparatorAbove:ee})=>c.jsxs(b.Fragment,{children:[ee&&c.jsx("div",{className:"mx-3 border-t border-zinc-800/60 my-1"}),_.scope==="local"&&Oe?c.jsx(g0,{layer:_,opts:{isSelected:(e==null?void 0:e.id)===_.id,isActive:d===_.id,isDragging:!1,canReorder:!0,canDelete:!!f,deleteConfirm:M===_.id,onSelect:()=>ne(_.id),onDelete:()=>ge(_.id),onOpenSettings:ie=>xe(_.id,ie)}}):c.jsx("div",{children:c.jsx(vi,{layer:_,opts:{isSelected:(e==null?void 0:e.id)===_.id,isActive:d===_.id,isDragging:!1,canDelete:_.scope==="local"&&!!f,deleteConfirm:M===_.id,onSelect:()=>ne(_.id),onDelete:()=>ge(_.id),onOpenSettings:ie=>xe(_.id,ie)}})})]},_.id))})}),c.jsx(Pf,{dropAnimation:{duration:200,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:H?(()=>{const _=l.find(ee=>ee.id===H);return _?c.jsx("div",{className:"px-2 w-full max-w-[var(--inspector-width,280px)]",children:c.jsx(vi,{layer:_,opts:{isSelected:!1,isActive:!1,isDragging:!0,canDelete:!1,deleteConfirm:!1,onSelect:()=>{},onDelete:()=>{},onOpenSettings:()=>{}},dragHandleProps:{"aria-hidden":!0}})}):null})():null})]}),M&&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(Dd,{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 ee;if(se&&se.length>0){let ie=_;for(const ye of se){const Ee=ie==null?void 0:ie[ye.fieldKey];ye.itemId!=null&&Array.isArray(Ee)?ie=Ee.find(O=>String(O==null?void 0:O.id)===String(ye.itemId))??null:ie=Ee}const fe=ie||{},Ie=P.fieldKey;ee=(typeof fe.name=="string"?fe.name:null)??(typeof fe.title=="string"?fe.title:null)??(typeof fe.label=="string"?fe.label:null)??bi(Ie)}else{const ie=P.fieldKey;if(P.itemId!=null){const ye=(Array.isArray(_[ie])?_[ie]:[]).find(Ee=>String(Ee==null?void 0:Ee.id)===String(P.itemId))||{};ee=(typeof ye.name=="string"?ye.name:null)??(typeof ye.title=="string"?ye.title:null)??(typeof ye.label=="string"?ye.label:null)??bi(ie)}else ee=bi(ie)}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:ee})]})})(),c.jsx("div",{className:"flex-1 p-4",onFocusCapture:()=>e!=null&&L(!1),children:e?me?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 ee=Object.keys(Ve.shape).filter(fe=>!mi.has(fe)&&!pc.has(gi(Ve.shape[fe]))),ie=(He==null?void 0:He.data)||{};return ee.length===0?c.jsx("p",{className:"text-xs text-zinc-500",children:"Inline editorial section: edit content directly on the canvas."}):c.jsx(Ir,{schema:Ve,data:ie,onChange:fe=>n(fe),keys:ee,expandedItemPath:se,onSidebarExpandedItemChange:T})})():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:oe("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:oe("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(Rr,{children:[c.jsx(Lr,{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(os,{size:14}),c.jsx("span",{children:"Save"})]})}),c.jsx(lr,{children:"Save to file"})]}),S&&m!=null&&c.jsxs(Rr,{children:[c.jsx(Lr,{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(os,{size:14}),c.jsx("span",{children:k?"Saving...":"Hot Save"})]})}),c.jsx(lr,{children:"Hot save to edge"})]}),C!=null&&j&&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"})})]})}),X!=null&&r.length>0&&o!=null&&(()=>{const _=r.find(O=>O.id===X),ee=l.find(O=>O.id===X);if(!_)return null;const ie=(ee==null?void 0:ee.scope)==="global"?"global":"local",fe=_.type,Ie=R[fe],Ee=(Ie?Object.keys(Ie.shape):[]).filter(O=>mi.has(O)),z=_.data??{};return Ee.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:()=>re(null),children:c.jsxs("div",{ref:W,className:"relative rounded-lg border border-zinc-700 bg-zinc-900 shadow-xl max-w-md w-full overflow-hidden",onClick:O=>O.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 — ",fe]}),c.jsx("button",{type:"button",onClick:()=>re(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(Ut,{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:O=>O.target===O.currentTarget&&re(null),children:c.jsxs("div",{ref:W,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:O=>O.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 — ",fe]}),c.jsx("button",{type:"button",onClick:()=>re(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(Ut,{size:18})})]}),c.jsx("div",{className:"flex-1 overflow-y-auto p-4 custom-scrollbar",children:c.jsx(Ir,{schema:Ie,data:z,onChange:O=>{const $={..._.data,...O};o(X,ie,fe,$)},keys:Ee})})]})})})()]})})},gc=({draft:e,globalDraft:t,menuConfig:r,themeConfig:n,slug:o,selectedId:i,scrollToSectionId:s,onScrollRequested:a})=>{const l=b.useRef(null),d=b.useCallback(()=>{var u;(u=l.current)!=null&&u.contentWindow&&l.current.contentWindow.postMessage({type:ve.UPDATE_DRAFTS,draft:e,globalDraft:t,menuConfig:r,themeConfig:n},"*")},[e,t,r,n]);return b.useEffect(()=>{d()},[d]),b.useEffect(()=>{const u=f=>{f.data.type===ve.STAGE_READY&&d()};return window.addEventListener("message",u),()=>window.removeEventListener("message",u)},[d]),b.useEffect(()=>{var u;(u=l.current)!=null&&u.contentWindow&&l.current.contentWindow.postMessage({type:ve.SYNC_SELECTION,selectedId:i},"*")},[i]),b.useEffect(()=>{var u;!s||!((u=l.current)!=null&&u.contentWindow)||(l.current.contentWindow.postMessage({type:ve.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"})})},xi=new Set;function b0(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function bc(e,t=[],r={}){return Object.entries(e).forEach(([n,o])=>{const i=[...t,b0(n)];if(typeof o=="string"||typeof o=="number"){r[`--theme-${i.join("-")}`]=String(o);return}o&&typeof o=="object"&&!Array.isArray(o)&&bc(o,i,r)}),r}function We(e,t,r,n){n&&(e[t]=`var(${r})`)}function v0(e){const t=bc(e.tokens),r={...t};return We(r,"--theme-primary","--theme-colors-primary",t["--theme-colors-primary"]),We(r,"--theme-secondary","--theme-colors-secondary",t["--theme-colors-secondary"]),We(r,"--theme-accent","--theme-colors-accent",t["--theme-colors-accent"]),We(r,"--theme-background","--theme-colors-background",t["--theme-colors-background"]),We(r,"--theme-surface","--theme-colors-surface",t["--theme-colors-surface"]),We(r,"--theme-surface-alt","--theme-colors-surface-alt",t["--theme-colors-surface-alt"]),We(r,"--theme-text","--theme-colors-text",t["--theme-colors-text"]),We(r,"--theme-text-muted","--theme-colors-text-muted",t["--theme-colors-text-muted"]),We(r,"--theme-border","--theme-colors-border",t["--theme-colors-border"]),We(r,"--theme-font-primary","--theme-typography-font-family-primary",t["--theme-typography-font-family-primary"]),We(r,"--theme-font-mono","--theme-typography-font-family-mono",t["--theme-typography-font-family-mono"]),We(r,"--theme-font-display","--theme-typography-font-family-display",t["--theme-typography-font-family-display"]),We(r,"--theme-radius-sm","--theme-border-radius-sm",t["--theme-border-radius-sm"]),We(r,"--theme-radius-md","--theme-border-radius-md",t["--theme-border-radius-md"]),We(r,"--theme-radius-lg","--theme-border-radius-lg",t["--theme-border-radius-lg"]),r}const Qn={setTheme:e=>{const t=document.documentElement,r=v0(e);xi.forEach(n=>{t.style.removeProperty(n)}),xi.clear(),Object.entries(r).forEach(([n,o])=>{t.style.setProperty(n,o),xi.add(n)})}};function x0(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 vc(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(),x0(r,n)}const w0='[data-jp-ignore-select="true"],[data-jp-interactive="true"],.ProseMirror,[contenteditable="true"],button,input,textarea,select,[role="button"],[role="menuitem"]',y0="[data-jp-field],[data-jp-item-id],[data-jp-item-field]",xc=()=>{var h;const[e,t]=b.useState(null),[r,n]=b.useState(null),[o,i]=b.useState({main:[]}),[s,a]=b.useState(null),[l,d]=b.useState(null);if(b.useEffect(()=>{const p=w=>{var m;if(!(w.origin!==window.location.origin||w.source!==window.parent)&&(w.data.type===ve.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&&Qn.setTheme(w.data.themeConfig)),w.data.type===ve.SYNC_SELECTION&&a(w.data.selectedId),w.data.type===ve.REQUEST_SCROLL_TO_SECTION&&d(w.data.sectionId??null),w.data.type===ve.REQUEST_INLINE_FLUSH)){const v=typeof w.data.requestId=="string"?w.data.requestId:null;window.dispatchEvent(new CustomEvent(ve.REQUEST_INLINE_FLUSH,{detail:{requestId:v}})),setTimeout(()=>{window.parent.postMessage({type:ve.INLINE_FLUSHED,requestId:v},window.location.origin)},0)}};return window.addEventListener("message",p),window.parent.postMessage({type:ve.STAGE_READY},"*"),()=>window.removeEventListener("message",p)},[]),b.useEffect(()=>{const p=v=>!!v.closest(y0),w=v=>!!(v.closest('[data-jp-ignore-select="true"]')||v.closest(w0)&&!p(v)||v.closest("a[href]")&&!p(v)),m=v=>{var M,Y,H;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 U=(M=C.getAttribute)==null?void 0:M.call(C,"data-section-id"),B=(Y=C.getAttribute)==null?void 0:Y.call(C,"data-section-type"),T=(H=C.getAttribute)==null?void 0:H.call(C,"data-section-scope");if(U&&B&&T){S=C;break}C=C.parentElement}if(!S)return;v.preventDefault(),v.stopPropagation();const j=S.getAttribute("data-section-id"),N=S.getAttribute("data-section-type"),E=S.getAttribute("data-section-scope");if(!j||!N||!E)return;const D={id:j,type:N,scope:E};if(y===S){window.parent.postMessage({type:ve.SECTION_SELECT,section:D},"*");return}const R=document.elementFromPoint(k,x)??y;if(!R||!S.contains(R)){window.parent.postMessage({type:ve.SECTION_SELECT,section:D},"*");return}if(R===S){window.parent.postMessage({type:ve.SECTION_SELECT,section:D},"*");return}let I=vc(R,S);if(I.length===0&&R){let U=null;const B=T=>{var re,A;const X=T.getBoundingClientRect();if(X.left<=k&&k<=X.right&&X.top<=x&&x<=X.bottom){for(let W=0;W<T.children.length;W++)B(T.children[W]);((re=T.getAttribute)!=null&&re.call(T,"data-jp-item-id")||(A=T.getAttribute)!=null&&A.call(T,"data-jp-field"))&&(U=T)}};B(R),U&&(I=vc(U,S))}const L={type:ve.SECTION_SELECT,section:D};I.length>0&&(L.itemPath=I),window.parent.postMessage(L,"*")};return document.addEventListener("click",m,!0),()=>document.removeEventListener("click",m,!0)},[]),b.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:rn((h=r.header)==null?void 0:h.data,o.main)},f=p=>{window.parent.postMessage({type:ve.ACTIVE_SECTION_CHANGED,activeSectionId:p},"*")};return c.jsx(Xr,{mode:"studio",children:c.jsx("div",{className:"jp-ice-active",children:c.jsx(fo,{pageConfig:e,siteConfig:r,menuConfig:u,selectedId:s,scrollToSectionId:l,onActiveSectionChange:f})})})};function k0(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const wc=({open:e,onClose:t,sectionTypes:r,sectionTypeLabels:n,onSelect:o})=>{if(b.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])??k0(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(lo,{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(Ut,{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:oe("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"})})]})]})},yc=()=>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 wi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function kc(e){return e==null?e:JSON.parse(JSON.stringify(e))}function Sc(){if(typeof window>"u")return null;const e=window;return e.__olonWebMcpTools__||(e.__olonWebMcpTools__=new Map),e.__olonWebMcpTools__}function yi(e){return`update-${e}`}function Cc(e){return e.startsWith("update-")?e.slice(7):null}function Ec(e){return{type:"object",additionalProperties:!1,properties:{slug:{type:"string"},sectionId:{type:"string"},scope:{type:"string",enum:["local","global"],default:"local"},data:{type:"object",description:`Full replacement payload validated against the "${e}" section 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 ki(e,t,r){if(t.length===0)throw new Error("Selection path is empty.");const n=kc(e);let o=n;for(let i=0;i<t.length;i+=1){const s=t[i],a=i===t.length-1;if(!wi(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=>wi(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 Si(e,t){if(t.data&&wi(t.data))return kc(t.data);if(Array.isArray(t.itemPath)&&t.itemPath.length>0)return ki(e,t.itemPath,t.value);if(typeof t.fieldKey=="string"&&t.fieldKey.trim().length>0)return ki(e,[{fieldKey:t.fieldKey}],t.value);throw new Error('WebMCP mutation requires either "data", "itemPath", or "fieldKey".')}async function jc(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 eo(){if(typeof window>"u"||typeof navigator>"u")return;const e=Sc();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=jc,t.modelContextTesting||(t.modelContextTesting={}),t.modelContextTesting.listTools=function(){return Array.from(e.values()).map(({execute:r,...n})=>n)},t.modelContextTesting.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.modelContextTesting.readResource=async function(r){const n=await jc(r);return JSON.stringify(n)}}function Nc(e){var n,o;if(typeof navigator>"u")return()=>{};eo();const t=navigator,r=Sc();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)})}const S0='/*! 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 C0 extends b.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 Fr(e){return e.split("/").map(t=>t.trim()).filter(Boolean).join("/")}function Ac(e,t=""){const r=Fr(t);let o=e.replace(/\/+/g,"/");if(r){const s=`/${r}`;o===s?o="/":o.startsWith(`${s}/`)&&(o=o.slice(s.length))}return Fr(o)||"home"}function Ci(e,t){const r=Fr(t)||"home";return e[r]}function Ei(e,t){return rn(e,t)}function ji(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function to(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 Tc(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 zc(e){return`/mcp-manifests/${e}.json`}function Pc(e){return`/schemas/${e}.schema.json`}const Oc=({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=b.useMemo(()=>It({pages:e,siteConfig:t,themeConfig:n,menuConfig:r,refDocuments:o}),[e,t,n,r,o]),f=Ci(u.pages,d);return b.useEffect(()=>{var h;try{(h=u.themeConfig)!=null&&h.tokens&&Qn.setTheme(u.themeConfig)}catch(p){console.warn("[JsonPages] visitor theme resolution failed",p)}},[u.themeConfig]),b.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:"";to("mcp-manifest",zc(d)),to("olon-contract",Pc(d)),Tc(h,p,d==="home"?"/":`/${d}`)},[f,d]),f?c.jsx(on,{mode:"tenant",tenantCss:i,adminCss:s,children:c.jsx(Xr,{mode:"visitor",children:c.jsx(fo,{pageConfig:f,siteConfig:u.siteConfig,menuConfig:u.menuConfig})})}):c.jsx(a,{})},Ic=({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]=b.useState(null),[C,j]=b.useState(!1),[N,E]=b.useState(!1),[D,R]=b.useState(!1),[I,L]=b.useState(!1),[M,Y]=b.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:[]}}}),[H,U]=b.useState(null),[B,T]=b.useState(null),[X,re]=b.useState(null),[A,W]=b.useState(null),[q,G]=b.useState(!1),[me,se]=b.useState(400),P=b.useMemo(()=>It({pages:x?{[v]:x}:{},siteConfig:M,themeConfig:o,menuConfig:n,refDocuments:i}),[x,M,o,n,i,v]),J=x?P.pages[v]??x:null,te=b.useRef(x),F=b.useRef(M),ne=360,Q=920;b.useEffect(()=>{te.current=x},[x]),b.useEffect(()=>{F.current=M},[M]);const xe=b.useCallback(z=>{z.preventDefault();const O=z.currentTarget;O.setPointerCapture(z.pointerId);const $=z.clientX,Z=me,ce=be=>{const je=$-be.clientX,it=Math.min(Q,Math.max(ne,Z+je));se(it)},de=()=>{O.releasePointerCapture(z.pointerId),O.removeEventListener("pointermove",ce),O.removeEventListener("pointerup",de),O.removeEventListener("pointercancel",de),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",O.addEventListener("pointermove",ce),O.addEventListener("pointerup",de),O.addEventListener("pointercancel",de)},[me]),ge=x?[...M.header?[{id:M.header.id,type:M.header.type,scope:"global",title:"Header"}]:[],...x.sections.map(z=>{var O,$;return{id:z.id,type:z.type,scope:"local",title:((O=z.data)==null?void 0:O.title)??(($=z.data)==null?void 0:$.titleHighlight)}}),...M.footer?[{id:M.footer.id,type:M.footer.type,scope:"global",title:"Footer"}]:[]]:[];b.useEffect(()=>{const z=Ci(e,v);z&&S(JSON.parse(JSON.stringify(z))),U(null),T(null),j(!1)},[v,e]);const ze=b.useCallback(()=>{const z=Ci(e,v);z&&S(JSON.parse(JSON.stringify(z))),U(null),T(null),j(!1)},[v,e]),Oe=b.useCallback((z,O,$)=>{const Z=[...$.sections],ce=Z.findIndex(je=>je.id===z);if(ce===-1||O<0||O>=Z.length)return;const[de]=Z.splice(ce,1),be=O>ce?O-1:O;Z.splice(Math.min(be,Z.length),0,de),S({...$,sections:Z}),j(!0)},[]),Be=b.useCallback(z=>{if(z.origin===window.location.origin){if(z.data.type===ve.SECTION_SELECT){U(z.data.section);const O=z.data.itemPath;Array.isArray(O)&&O.length>0?T(O.map($=>({fieldKey:$.fieldKey,...$.itemId!=null?{itemId:String($.itemId)}:{}}))):T(null)}if(z.data.type===ve.INLINE_FIELD_UPDATE){const O=typeof z.data.sectionId=="string"?z.data.sectionId:null,$=typeof z.data.fieldKey=="string"?z.data.fieldKey:null;O&&$&&(S(Z=>{if(!Z)return Z;const ce={...Z,sections:Z.sections.map(de=>de.id===O?{...de,data:{...de.data,[$]:z.data.value}}:de)};return te.current=ce,ce}),j(!0))}if(z.data.type===ve.ACTIVE_SECTION_CHANGED&&re(z.data.activeSectionId??null),z.data.type==="jsonpages:section-reorder"&&te.current){const{sectionId:O,newIndex:$}=z.data;typeof O=="string"&&typeof $=="number"&&$>=0&&Oe(O,$,te.current)}if(z.data.type===ve.WEBMCP_TOOL_CALL){const O=typeof z.data.requestId=="string"?z.data.requestId:crypto.randomUUID(),$=typeof z.data.toolName=="string"?z.data.toolName:"";_($,z.data.args).then(Z=>{window.postMessage({type:ve.WEBMCP_TOOL_RESULT,requestId:O,toolName:$,result:Z,ok:!0},window.location.origin)}).catch(Z=>{const ce=Z instanceof Error?Z.message:String(Z);window.postMessage({type:ve.WEBMCP_TOOL_RESULT,requestId:O,toolName:$,ok:!1,error:ce},window.location.origin)})}}},[Oe,_]);b.useEffect(()=>(window.addEventListener("message",Be),()=>window.removeEventListener("message",Be)),[Be]),b.useEffect(()=>{if(!(u!=null&&u.enabled))return;eo();const z=te.current;if(!z)return;const $=Array.from(new Set([...F.current.header?[F.current.header.type]:[],...F.current.footer?[F.current.footer.type]:[],...z.sections.map(Z=>Z.type)])).map(Z=>Nc({name:yi(Z),description:`Update a ${Z} section in OlonJS Studio and persist immediately to file.`,inputSchema:Ec(Z),execute:ce=>_(yi(Z),ce)}));return()=>{for(const Z of $)Z()}},[u==null?void 0:u.enabled,v,x,M,_]);const Nt=b.useCallback(z=>{const O=ge.find($=>$.id===z);O&&U({id:O.id,type:O.type,scope:O.scope}),T(null),W(z)},[ge]),Xe=b.useCallback(()=>{W(null)},[]),He=b.useCallback(z=>{S(O=>O&&{...O,sections:O.sections.filter($=>$.id!==z)}),j(!0),U(O=>(O==null?void 0:O.id)===z?null:O)},[]),Ve=z=>{if(!(!H||!x))if(j(!0),H.scope==="global")H.type==="header"&&M.header!=null?Y({...M,header:{...M.header,data:z}}):H.type==="footer"&&M.footer!=null&&Y({...M,footer:{...M.footer,data:z}});else{const O=x.sections.map($=>$.id===H.id?{...$,data:z}:$);S({...x,sections:O})}},mt=b.useCallback((z,O,$,Z)=>{var ce,de;if(j(!0),O==="global")((ce=M.header)==null?void 0:ce.id)===z?Y({...M,header:{...M.header,data:Z}}):((de=M.footer)==null?void 0:de.id)===z&&Y({...M,footer:{...M.footer,data:Z}});else if(x){const be=x.sections.map(je=>je.id===z?{...je,data:Z}:je);S({...x,sections:be})}},[x,M]),ot=b.useCallback(async()=>{const z=document.querySelector("iframe");if(!(z!=null&&z.contentWindow))return;const O=crypto.randomUUID();await new Promise($=>{var de;let Z=!1;const ce=be=>{var je,it;be.origin===window.location.origin&&((je=be.data)==null?void 0:je.type)===ve.INLINE_FLUSHED&&((it=be.data)==null?void 0:it.requestId)===O&&(Z=!0,window.removeEventListener("message",ce),$())};window.addEventListener("message",ce),(de=z.contentWindow)==null||de.postMessage({type:ve.REQUEST_INLINE_FLUSH,requestId:O},"*"),window.setTimeout(()=>{Z||(window.removeEventListener("message",ce),$())},400)})},[]),At=b.useCallback(async(z,O)=>{var de;if(!f)throw new Error("saveToFile is not configured for this tenant.");const $=It({pages:{[v]:z},siteConfig:O,themeConfig:o,menuConfig:n,refDocuments:i}),Z=(de=$.siteConfig.header)==null?void 0:de.data,ce={page:z,site:O,menu:{main:Ei(Z,n.main)},theme:$.themeConfig};await f(ce,v),j(!1),E(!0),typeof window<"u"&&window.setTimeout(()=>E(!1),2500)},[f,v,o,n,i]),Wr=b.useCallback(async(z,O)=>{var Re,Le;if(!f)throw new Error("WebMCP requires saveToFile persistence in Studio mode.");if(!ji(O)||typeof O.sectionId!="string")throw new Error("WebMCP mutation requires a sectionId.");const $=O,Z=typeof $.slug=="string"?Fr($.slug):v;if(Z!==v)throw new Error(`WebMCP slug mismatch. Active Studio slug is "${v}", received "${Z}".`);await ot();const ce=te.current,de=F.current;if(!ce)throw new Error("Studio draft is not ready yet.");const be=t[z];if(!be||typeof be.parse!="function")throw new Error(`Missing schema for section type "${z}".`);const je=$.scope==="global"?"global":"local";let it=ce,Ce=de;if(je==="global"){const Se=((Re=de.header)==null?void 0:Re.id)===$.sectionId?de.header:((Le=de.footer)==null?void 0:Le.id)===$.sectionId?de.footer:null;if(!Se)throw new Error(`Global section "${$.sectionId}" was not found.`);if(Se.type!==z)throw new Error(`Section "${$.sectionId}" is type "${Se.type}", not "${z}".`);const $e=ji(Se.data)?Se.data:{},De=Si($e,$),Ke=be.parse(De),Ue={...Se,data:Ke};Ce={...de,...Se.type==="header"?{header:Ue}:{footer:Ue}},F.current=Ce,Y(Ce)}else{const Se=ce.sections.find(Ue=>Ue.id===$.sectionId);if(!Se)throw new Error(`Local section "${$.sectionId}" was not found in page "${v}".`);if(Se.type!==z)throw new Error(`Section "${$.sectionId}" is type "${Se.type}", not "${z}".`);const $e=ji(Se.data)?Se.data:{},De=Si($e,$),Ke=be.parse(De);it={...ce,sections:ce.sections.map(Ue=>Ue.id===$.sectionId?{...Ue,data:Ke}:Ue)},te.current=it,S(it)}return U({id:$.sectionId,type:z,scope:je}),T(Array.isArray($.itemPath)?$.itemPath:null),j(!0),await At(it,Ce),{content:[{type:"text",text:JSON.stringify({ok:!0,slug:v,sectionId:$.sectionId,sectionType:z,scope:je})}],isError:!1}},[f,v,ot,t,At]);async function _(z,O){const $=Cc(z);if(!$)throw new Error(`Unknown WebMCP tool "${z}".`);return Wr($,O)}const ee=async()=>{var de;if(!f)return;await ot();const z=te.current,O=F.current;if(!z)return;const $=It({pages:{[v]:z},siteConfig:O,themeConfig:o,menuConfig:n,refDocuments:i}),Z=(de=$.siteConfig.header)==null?void 0:de.data,ce={page:z,site:O,menu:{main:Ei(Z,n.main)},theme:$.themeConfig};f(ce,v).then(()=>{j(!1),E(!0),typeof window<"u"&&window.setTimeout(()=>E(!1),2500)}).catch(be=>{console.error("[JsonPages] saveToFile failed",be);const je=be instanceof Error?be.message:String(be);alert(`Save to file failed: ${je}`)})},ie=async()=>{var de;if(!h)return;await ot();const z=te.current,O=F.current;if(!z)return;const $=It({pages:{[v]:z},siteConfig:O,themeConfig:o,menuConfig:n,refDocuments:i}),Z=(de=$.siteConfig.header)==null?void 0:de.data,ce={page:z,site:O,menu:{main:Ei(Z,n.main)},theme:$.themeConfig};L(!0),h(ce,v).then(()=>{j(!1),R(!0),typeof window<"u"&&window.setTimeout(()=>R(!1),2500)}).catch(be=>{console.error("[JsonPages] hotSave failed",be);const je=be instanceof Error?be.message:String(be);alert(`Hot save failed: ${je}`)}).finally(()=>{L(!1)})},fe=z=>{var Z;if(!x)return;const O=((Z=l==null?void 0:l.getDefaultSectionData)==null?void 0:Z.call(l,z))??{},$={id:crypto.randomUUID(),type:z,data:O,settings:void 0};S({...x,sections:[...x.sections,$]}),j(!0),U({id:$.id,type:z,scope:"local"})};if(b.useEffect(()=>{var Z,ce;const z=J??x,O=typeof((Z=z==null?void 0:z.meta)==null?void 0:Z.title)=="string"?z.meta.title:v,$=typeof((ce=z==null?void 0:z.meta)==null?void 0:ce.description)=="string"?z.meta.description:"";to("mcp-manifest",zc(v)),to("olon-contract",Pc(v)),Tc(O,$,`/admin${v==="home"?"":`/${v}`}`)},[x,J,v]),!x)return c.jsx("div",{children:"Loading Studio..."});const Ie=(H==null?void 0:H.scope)==="global"?{sections:[P.siteConfig.header,P.siteConfig.footer].filter(z=>z!=null)}:J??x,ye=[...P.siteConfig.header?[P.siteConfig.header]:[],...((Ee=J??x)==null?void 0:Ee.sections)??[],...P.siteConfig.footer?[P.siteConfig.footer]:[]];return c.jsx(on,{mode:"admin",tenantCss:s,adminCss:a,children:c.jsx(Xr,{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(gc,{draft:J??x,globalDraft:P.siteConfig,menuConfig:P.menuConfig,themeConfig:P.themeConfig,slug:v,selectedId:H==null?void 0:H.id,scrollToSectionId:A,onScrollRequested:Xe})}),c.jsxs("div",{className:"flex shrink-0 relative h-full z-10",style:{width:me,minWidth:ne,maxWidth:Q},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:xe}),c.jsx(mc,{selectedSection:H,pageData:Ie,allSectionsData:ye,onUpdate:Ve,onUpdateSection:mt,onClose:()=>{U(null),T(null)},expandedItemPath:B,onReorderSection:x?(z,O)=>Oe(z,O,x):void 0,allLayers:ge,activeSectionId:X,onRequestScrollToSection:Nt,onDeleteSection:x?He:void 0,onAddSection:d.length>0?()=>G(!0):void 0,hasChanges:C,onSaveToFile:f!=null?ee:void 0,saveSuccessFeedback:N,onHotSave:h!=null?ie:void 0,hotSaveSuccessFeedback:D,hotSaveInProgress:I,showLegacySave:p,showHotSave:w,onResetToFile:ze,pageSlugs:k,currentSlug:v,onPageChange:k.length>1?z=>{const O=Fr(z);y(O==="home"?"/admin":`/admin/${O}`)}:void 0})]})]}),c.jsx(wc,{open:q,onClose:()=>G(!1),sectionTypes:d,sectionTypeLabels:l==null?void 0:l.sectionTypeLabels,onSelect:fe})]})})})},Dc=({tenantCss:e,adminCss:t})=>c.jsx(on,{mode:"tenant",tenantCss:e,adminCss:t,children:c.jsx(xc,{})});function E0({config:e}){var k,x,S,C,j;const{registry:t={},schemas:r={},pages:n={},siteConfig:o,themeConfig:i,menuConfig:s,refDocuments:a,themeCss:l,addSection:d,NotFoundComponent:u=yc}=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:S0,m=b.useMemo(()=>It({pages:n,siteConfig:o,themeConfig:i,menuConfig:s,refDocuments:a}),[n,o,i,s,a]),[v,y]=b.useState(!1);return b.useEffect(()=>{var N,E;try{(N=m.themeConfig)!=null&&N.tokens&&Qn.setTheme(m.themeConfig)}catch(D){console.warn("[JsonPages] setTheme failed",D)}(E=e.webmcp)!=null&&E.enabled&&eo(),y(!0)},[m.themeConfig,(j=e.webmcp)==null?void 0:j.enabled]),v?c.jsx(C0,{children:c.jsx(Zi,{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(Oc,{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(Oc,{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(Ic,{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(Ic,{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(Dc,{tenantCss:p,adminCss:w})}),c.jsx(Je.Route,{path:"/admin/preview/*",element:c.jsx(Dc,{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..."})}ae.AddSectionLibrary=wc,ae.AdminSidebar=mc,ae.ConfigProvider=Zi,ae.DefaultNotFound=yc,ae.FormFactory=Ir,ae.InputWidgets=ir,ae.JsonPagesEngine=E0,ae.PageRenderer=fo,ae.PreviewEntry=xc,ae.STUDIO_EVENTS=ve,ae.SectionRenderer=hr,ae.StudioProvider=Xr,ae.StudioStage=gc,ae.ThemeLoader=on,ae.applyValueAtSelectionPath=ki,ae.buildWebMcpToolName=yi,ae.cn=oe,ae.createWebMcpToolInputSchema=Ec,ae.ensureWebMcpRuntime=eo,ae.parseWebMcpToolName=Cc,ae.registerWebMcpTool=Nc,ae.resolveAssetUrl=Ul,ae.resolveHeaderMenuItems=rn,ae.resolveRuntimeConfig=It,ae.resolveSectionMenuItems=nn,ae.resolveWebMcpMutationData=Si,ae.shouldRenderSiteGlobalHeader=Ti,ae.themeManager=Qn,ae.useConfig=pr,ae.useStudio=es,Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"})}));
|
|
226
|
+
`)},Dm=0,nr=[];function _m(e){var t=g.useRef([]),r=g.useRef([0,0]),n=g.useRef(),o=g.useState(Dm++)[0],i=g.useState(Ja)[0],s=g.useRef(e);g.useEffect(function(){s.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=rm([e.lockRef.current],(e.shards||[]).map(ol),!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=g.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var y=Wn(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,j=m.target,N=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in m&&N==="h"&&j.type==="range")return!1;var E=window.getSelection(),D=E&&E.anchorNode,R=D?D===j||D.contains(j):!1;if(R)return!1;var I=el(N,j);if(!I)return!0;if(I?C=N:(C=N==="v"?"h":"v",I=el(N,j)),!I)return!1;if(!n.current&&"changedTouches"in m&&(x||S)&&(n.current=C),!C)return!0;var L=n.current||C;return Pm(L,v,m,L==="h"?x:S)},[]),l=g.useCallback(function(m){var v=m;if(!(!nr.length||nr[nr.length-1]!==i)){var y="deltaY"in v?nl(v):Wn(v),k=t.current.filter(function(C){return C.name===v.type&&(C.target===v.target||v.target===C.shadowParent)&&Om(C.delta,y)})[0];if(k&&k.should){v.cancelable&&v.preventDefault();return}if(!k){var x=(s.current.shards||[]).map(ol).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=g.useCallback(function(m,v,y,k){var x={name:m,delta:v,target:y,should:k,shadowParent:Mm(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),u=g.useCallback(function(m){r.current=Wn(m),n.current=void 0},[]),f=g.useCallback(function(m){d(m.type,nl(m),m.target,a(m,e.lockRef.current))},[]),h=g.useCallback(function(m){d(m.type,Wn(m),m.target,a(m,e.lockRef.current))},[]);g.useEffect(function(){return nr.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,rr),document.addEventListener("touchmove",l,rr),document.addEventListener("touchstart",u,rr),function(){nr=nr.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,rr),document.removeEventListener("touchmove",l,rr),document.removeEventListener("touchstart",u,rr)}},[]);var p=e.removeScrollBar,w=e.inert;return g.createElement(g.Fragment,null,w?g.createElement(i,{styles:Im(o)}):null,p?g.createElement(Cm,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Mm(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Rm=um(Xa,_m);var ti=g.forwardRef(function(e,t){return g.createElement($n,dt({},e,{ref:t,sideCar:Rm}))});ti.classNames=$n.classNames;var Lm=[" ","Enter","ArrowUp","ArrowDown"],$m=[" ","Enter"],Rt="Select",[Un,Bn,Fm]=op(Rt),[or]=Tr(Rt,[Fm,Qt]),Hn=Qt(),[Wm,Ct]=or(Rt),[Um,Bm]=or(Rt),il=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=Hn(t),[v,y]=g.useState(null),[k,x]=g.useState(null),[S,C]=g.useState(!1),j=sp(d),[N,E]=Dn({prop:n,defaultProp:o??!1,onChange:i,caller:Rt}),[D,R]=Dn({prop:s,defaultProp:a,onChange:l,caller:Rt}),I=g.useRef(null),L=v?w||!!v.closest("form"):!0,[M,G]=g.useState(new Set),B=Array.from(M).map(F=>F.props.value).join(";");return c.jsx(Go,{...m,children:c.jsxs(Wm,{required:p,scope:t,trigger:v,onTriggerChange:y,valueNode:k,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Ar(),value:D,onValueChange:R,open:N,onOpenChange:E,dir:j,triggerPointerDownPosRef:I,disabled:h,children:[c.jsx(Un.Provider,{scope:t,children:c.jsx(Um,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(F=>{G(U=>new Set(U).add(F))},[]),onNativeOptionRemove:g.useCallback(F=>{G(U=>{const A=new Set(U);return A.delete(F),A})},[]),children:r})}),L?c.jsxs(El,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:f,value:D,onChange:F=>R(F.target.value),disabled:h,form:w,children:[D===void 0?c.jsx("option",{value:""}):null,Array.from(M)]},B):null]})})};il.displayName=Rt;var sl="SelectTrigger",al=g.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=Hn(r),s=Ct(sl,r),a=s.disabled||n,l=Se(t,s.onTriggerChange),d=Bn(r),u=g.useRef("touch"),[f,h,p]=Nl(m=>{const v=d().filter(x=>!x.disabled),y=v.find(x=>x.value===s.value),k=Tl(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(On,{asChild:!0,...i,children:c.jsx(ye.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":jl(s.value)?"":void 0,...o,ref:l,onClick:pe(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&w(m)}),onPointerDown:pe(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:pe(o.onKeyDown,m=>{const v=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&h(m.key),!(v&&m.key===" ")&&Lm.includes(m.key)&&(w(),m.preventDefault())})})})});al.displayName=sl;var ll="SelectValue",cl=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...a}=e,l=Ct(ll,r),{onValueNodeHasChildrenChange:d}=l,u=i!==void 0,f=Se(t,l.onValueNodeChange);return Re(()=>{d(u)},[d,u]),c.jsx(ye.span,{...a,ref:f,style:{pointerEvents:"none"},children:jl(l.value)?c.jsx(c.Fragment,{children:s}):i})});cl.displayName=ll;var Hm="SelectIcon",dl=g.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return c.jsx(ye.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});dl.displayName=Hm;var Vm="SelectPortal",ul=e=>c.jsx(In,{asChild:!0,...e});ul.displayName=Vm;var Lt="SelectContent",fl=g.forwardRef((e,t)=>{const r=Ct(Lt,e.__scopeSelect),[n,o]=g.useState();if(Re(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?Vr.createPortal(c.jsx(pl,{scope:e.__scopeSelect,children:c.jsx(Un.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),i):null}return c.jsx(hl,{...e,ref:t})});fl.displayName=Lt;var ot=10,[pl,Et]=or(Lt),Km="SelectContentImpl",Gm=Yt("SelectContent.RemoveScroll"),hl=g.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=Ct(Lt,r),[x,S]=g.useState(null),[C,j]=g.useState(null),N=Se(t,O=>S(O)),[E,D]=g.useState(null),[R,I]=g.useState(null),L=Bn(r),[M,G]=g.useState(!1),B=g.useRef(!1);g.useEffect(()=>{if(x)return Ka(x)},[x]),oa();const F=g.useCallback(O=>{const[J,...ee]=L().map(Z=>Z.ref.current),[W]=ee.slice(-1),ne=document.activeElement;for(const Z of O)if(Z===ne||(Z==null||Z.scrollIntoView({block:"nearest"}),Z===J&&C&&(C.scrollTop=0),Z===W&&C&&(C.scrollTop=C.scrollHeight),Z==null||Z.focus(),document.activeElement!==ne))return},[L,C]),U=g.useCallback(()=>F([E,x]),[F,E,x]);g.useEffect(()=>{M&&U()},[M,U]);const{onOpenChange:A,triggerPointerDownPosRef:X}=k;g.useEffect(()=>{if(x){let O={x:0,y:0};const J=W=>{var ne,Z;O={x:Math.abs(Math.round(W.pageX)-(((ne=X.current)==null?void 0:ne.x)??0)),y:Math.abs(Math.round(W.pageY)-(((Z=X.current)==null?void 0:Z.y)??0))}},ee=W=>{O.x<=10&&O.y<=10?W.preventDefault():x.contains(W.target)||A(!1),document.removeEventListener("pointermove",J),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",ee,{capture:!0})}}},[x,A,X]),g.useEffect(()=>{const O=()=>A(!1);return window.addEventListener("blur",O),window.addEventListener("resize",O),()=>{window.removeEventListener("blur",O),window.removeEventListener("resize",O)}},[A]);const[re,T]=Nl(O=>{const J=L().filter(ne=>!ne.disabled),ee=J.find(ne=>ne.ref.current===document.activeElement),W=Tl(J,O,ee);W&&setTimeout(()=>W.ref.current.focus())}),$=g.useCallback((O,J,ee)=>{const W=!B.current&&!ee;(k.value!==void 0&&k.value===J||W)&&(D(O),W&&(B.current=!0))},[k.value]),q=g.useCallback(()=>x==null?void 0:x.focus(),[x]),K=g.useCallback((O,J,ee)=>{const W=!B.current&&!ee;(k.value!==void 0&&k.value===J||W)&&I(O)},[k.value]),ge=n==="popper"?ri:ml,se=ge===ri?{side:a,sideOffset:l,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:w,hideWhenDetached:m,avoidCollisions:v}:{};return c.jsx(pl,{scope:r,content:x,viewport:C,onViewportChange:j,itemRefCallback:$,selectedItem:E,onItemLeave:q,itemTextRefCallback:K,focusSelectedItem:U,selectedItemText:R,position:n,isPositioned:M,searchRef:re,children:c.jsx(ti,{as:Gm,allowPinchZoom:!0,children:c.jsx(Io,{asChild:!0,trapped:k.open,onMountAutoFocus:O=>{O.preventDefault()},onUnmountAutoFocus:pe(o,O=>{var J;(J=k.trigger)==null||J.focus({preventScroll:!0}),O.preventDefault()}),children:c.jsx(yn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:O=>O.preventDefault(),onDismiss:()=>k.onOpenChange(!1),children:c.jsx(ge,{role:"listbox",id:k.contentId,"data-state":k.open?"open":"closed",dir:k.dir,onContextMenu:O=>O.preventDefault(),...y,...se,onPlaced:()=>G(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:pe(y.onKeyDown,O=>{const J=O.ctrlKey||O.altKey||O.metaKey;if(O.key==="Tab"&&O.preventDefault(),!J&&O.key.length===1&&T(O.key),["ArrowUp","ArrowDown","Home","End"].includes(O.key)){let W=L().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(O.key)&&(W=W.slice().reverse()),["ArrowUp","ArrowDown"].includes(O.key)){const ne=O.target,Z=W.indexOf(ne);W=W.slice(Z+1)}setTimeout(()=>F(W)),O.preventDefault()}})})})})})})});hl.displayName=Km;var Ym="SelectItemAlignedPosition",ml=g.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=Ct(Lt,r),s=Et(Lt,r),[a,l]=g.useState(null),[d,u]=g.useState(null),f=Se(t,N=>u(N)),h=Bn(r),p=g.useRef(!1),w=g.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:y,focusSelectedItem:k}=s,x=g.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&d&&m&&v&&y){const N=i.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),R=y.getBoundingClientRect();if(i.dir!=="rtl"){const ne=R.left-E.left,Z=D.left-ne,we=N.left-Z,be=N.width+we,ze=Math.max(be,E.width),Ie=window.innerWidth-ot,He=Xs(Z,[ot,Math.max(ot,Ie-ze)]);a.style.minWidth=be+"px",a.style.left=He+"px"}else{const ne=E.right-R.right,Z=window.innerWidth-D.right-ne,we=window.innerWidth-N.right-Z,be=N.width+we,ze=Math.max(be,E.width),Ie=window.innerWidth-ot,He=Xs(Z,[ot,Math.max(ot,Ie-ze)]);a.style.minWidth=be+"px",a.style.right=He+"px"}const I=h(),L=window.innerHeight-ot*2,M=m.scrollHeight,G=window.getComputedStyle(d),B=parseInt(G.borderTopWidth,10),F=parseInt(G.paddingTop,10),U=parseInt(G.borderBottomWidth,10),A=parseInt(G.paddingBottom,10),X=B+F+M+A+U,re=Math.min(v.offsetHeight*5,X),T=window.getComputedStyle(m),$=parseInt(T.paddingTop,10),q=parseInt(T.paddingBottom,10),K=N.top+N.height/2-ot,ge=L-K,se=v.offsetHeight/2,O=v.offsetTop+se,J=B+F+O,ee=X-J;if(J<=K){const ne=I.length>0&&v===I[I.length-1].ref.current;a.style.bottom="0px";const Z=d.clientHeight-m.offsetTop-m.offsetHeight,we=Math.max(ge,se+(ne?q:0)+Z+U),be=J+we;a.style.height=be+"px"}else{const ne=I.length>0&&v===I[0].ref.current;a.style.top="0px";const we=Math.max(K,B+m.offsetTop+(ne?$:0)+se)+ee;a.style.height=we+"px",m.scrollTop=J-K+m.offsetTop}a.style.margin=`${ot}px 0`,a.style.minHeight=re+"px",a.style.maxHeight=L+"px",n==null||n(),requestAnimationFrame(()=>p.current=!0)}},[h,i.trigger,i.valueNode,a,d,m,v,y,i.dir,n]);Re(()=>x(),[x]);const[S,C]=g.useState();Re(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);const j=g.useCallback(N=>{N&&w.current===!0&&(x(),k==null||k(),w.current=!1)},[x,k]);return c.jsx(Xm,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:j,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:c.jsx(ye.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});ml.displayName=Ym;var qm="SelectPopperPosition",ri=g.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=ot,...i}=e,s=Hn(r);return c.jsx(Yo,{...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)"}})});ri.displayName=qm;var[Xm,ni]=or(Lt,{}),oi="SelectViewport",gl=g.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=Et(oi,r),s=ni(oi,r),a=Se(t,i.onViewportChange),l=g.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(Un.Slot,{scope:r,children:c.jsx(ye.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:pe(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})})})]})});gl.displayName=oi;var bl="SelectGroup",[Jm,Zm]=or(bl),Qm=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ar();return c.jsx(Jm,{scope:r,id:o,children:c.jsx(ye.div,{role:"group","aria-labelledby":o,...n,ref:t})})});Qm.displayName=bl;var vl="SelectLabel",eg=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Zm(vl,r);return c.jsx(ye.div,{id:o.id,...n,ref:t})});eg.displayName=vl;var Vn="SelectItem",[tg,xl]=or(Vn),wl=g.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,a=Ct(Vn,r),l=Et(Vn,r),d=a.value===n,[u,f]=g.useState(i??""),[h,p]=g.useState(!1),w=Se(t,k=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,k,n,o)}),m=Ar(),v=g.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(tg,{scope:r,value:n,disabled:o,textId:m,isSelected:d,onItemTextChange:g.useCallback(k=>{f(x=>x||((k==null?void 0:k.textContent)??"").trim())},[]),children:c.jsx(Un.ItemSlot,{scope:r,value:n,disabled:o,textValue:u,children:c.jsx(ye.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:pe(s.onFocus,()=>p(!0)),onBlur:pe(s.onBlur,()=>p(!1)),onClick:pe(s.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:pe(s.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:pe(s.onPointerDown,k=>{v.current=k.pointerType}),onPointerMove:pe(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:pe(s.onPointerLeave,k=>{var x;k.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:pe(s.onKeyDown,k=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&k.key===" "||($m.includes(k.key)&&y(),k.key===" "&&k.preventDefault())})})})})});wl.displayName=Vn;var Or="SelectItemText",yl=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=Ct(Or,r),a=Et(Or,r),l=xl(Or,r),d=Bm(Or,r),[u,f]=g.useState(null),h=Se(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=g.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 Re(()=>(m(w),()=>v(w)),[m,v,w]),c.jsxs(c.Fragment,{children:[c.jsx(ye.span,{id:l.textId,...i,ref:h}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Vr.createPortal(i.children,s.valueNode):null]})});yl.displayName=Or;var kl="SelectItemIndicator",Sl=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return xl(kl,r).isSelected?c.jsx(ye.span,{"aria-hidden":!0,...n,ref:t}):null});Sl.displayName=kl;var ii="SelectScrollUpButton",rg=g.forwardRef((e,t)=>{const r=Et(ii,e.__scopeSelect),n=ni(ii,e.__scopeSelect),[o,i]=g.useState(!1),s=Se(t,n.onScrollButtonChange);return Re(()=>{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(Cl,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});rg.displayName=ii;var si="SelectScrollDownButton",ng=g.forwardRef((e,t)=>{const r=Et(si,e.__scopeSelect),n=ni(si,e.__scopeSelect),[o,i]=g.useState(!1),s=Se(t,n.onScrollButtonChange);return Re(()=>{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(Cl,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});ng.displayName=si;var Cl=g.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=Et("SelectScrollButton",r),s=g.useRef(null),a=Bn(r),l=g.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return g.useEffect(()=>()=>l(),[l]),Re(()=>{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(ye.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:pe(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:pe(o.onPointerMove,()=>{var d;(d=i.onItemLeave)==null||d.call(i),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:pe(o.onPointerLeave,()=>{l()})})}),og="SelectSeparator",ig=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return c.jsx(ye.div,{"aria-hidden":!0,...n,ref:t})});ig.displayName=og;var ai="SelectArrow",sg=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Hn(r),i=Ct(ai,r),s=Et(ai,r);return i.open&&s.position==="popper"?c.jsx(qo,{...o,...n,ref:t}):null});sg.displayName=ai;var ag="SelectBubbleInput",El=g.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=g.useRef(null),i=Se(n,o),s=Xh(t);return g.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(ye.select,{...r,style:{...Ba,...r.style},ref:i,defaultValue:t})});El.displayName=ag;function jl(e){return e===""||e===void 0}function Nl(e){const t=_t(e),r=g.useRef(""),n=g.useRef(0),o=g.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=g.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function Tl(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=lg(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 lg(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var cg=il,Al=al,dg=cl,ug=dl,fg=ul,zl=fl,pg=gl,Pl=wl,hg=yl,mg=Sl;const gg=cg,bg=dg,Ol=g.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(Al,{ref:n,className:oe("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(ug,{asChild:!0,children:c.jsx(Jr,{className:"h-3 w-3 shrink-0 text-zinc-400",strokeWidth:2})})]}));Ol.displayName=Al.displayName;const Il=g.forwardRef(({className:e,children:t,position:r="popper",...n},o)=>c.jsx(fg,{children:c.jsx(zl,{ref:o,className:oe("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(pg,{className:oe("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));Il.displayName=zl.displayName;const Dl=g.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(Pl,{ref:n,className:oe("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(mg,{children:c.jsx(so,{className:"h-3 w-3",strokeWidth:2})})}),c.jsx(hg,{children:t})]}));Dl.displayName=Pl.displayName;const _l=g.createContext(null);function Ml(){const e=g.useContext(_l);if(!e)throw new Error("Dialog components must be used within Dialog");return e}function Rl({open:e,onOpenChange:t,children:r}){const[n,o]=g.useState(!1),i=e!==void 0,s=i?e:n,a=g.useCallback(d=>{i||o(d),t==null||t(d)},[i,t]),l=g.useMemo(()=>({open:s,onOpenChange:a}),[s,a]);return c.jsx(_l.Provider,{value:l,children:r})}function vg({asChild:e,children:t}){const{onOpenChange:r}=Ml(),n=g.Children.only(t);return e&&g.isValidElement(n)?g.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 Ll({className:e,children:t,preventCloseOnBackdropClick:r,...n}){const{open:o,onOpenChange:i}=Ml();if(g.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 bt.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:oe("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 $l({className:e,...t}){return c.jsx("div",{className:oe("flex flex-col gap-1.5 pb-4",e),...t})}function xg({className:e,...t}){return c.jsx("div",{className:oe("flex justify-end gap-2 pt-4",e),...t})}function Fl({className:e,...t}){return c.jsx("h2",{className:oe("text-sm font-semibold text-white",e),...t})}function Wl({className:e,...t}){return c.jsx("p",{className:oe("text-xs text-zinc-400",e),...t})}const Xe=g.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?Zf:"button";return c.jsx(d,{ref:i,type:"button",className:oe(s,a[t],l[r],e),...o})});Xe.displayName="Button";const wg=["library","upload","url"];function yg({library:e,selectedId:t,onSelect:r}){const[n,o]=b.useState(""),[i,s]=b.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(Ld,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-zinc-600 pointer-events-none"}),c.jsx(To,{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:oe("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:oe("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:oe("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:oe("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(so,{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 kg({preview:e,onPreviewChange:t,onAssetUpload:r}){const[n,o]=b.useState(!1),i=b.useRef(null),s=b.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=b.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=b.useCallback(u=>{u.preventDefault(),u.stopPropagation(),o(!0)},[]),d=b.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:oe("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(Xe,{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(Qr,{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(is,{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 Sg({urlPreview:e,onUrlPreviewChange:t}){const[r,n]=b.useState(""),[o,i]=b.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(Dt,{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(To,{value:r,onChange:a=>{n(a.target.value),i(!1)},onKeyDown:a=>a.key==="Enter"&&s(),placeholder:"https://images.unsplash.com/photo-...",className:oe("h-8 text-xs bg-zinc-900/50 border-zinc-800",o&&"border-red-500/50")}),c.jsx(Xe,{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(so,{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(ns,{size:32,className:"mb-3 opacity-40"}),c.jsx("p",{className:"text-xs",children:"Incolla un URL e premi Anteprima per verificare"})]})]})}const Cg=({open:e,onOpenChange:t,onSelect:r})=>{const{assets:n}=pr(),o=(n==null?void 0:n.assetsManifest)??[],[i,s]=b.useState("library"),[a,l]=b.useState(null),[d,u]=b.useState(null),[f,h]=b.useState(null);b.useEffect(()=>{e&&(s("library"),l(null),u(null),h(null))},[e]),b.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]),b.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(Rl,{open:e,onOpenChange:t,children:c.jsxs(Ll,{className:"max-w-2xl p-0 gap-0 max-h-[90vh] flex flex-col",preventCloseOnBackdropClick:i==="upload",onDragOver:v,onDrop:v,children:[c.jsxs($l,{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(Zr,{size:18})}),c.jsxs("div",{children:[c.jsx(Fl,{children:"Image Picker"}),c.jsx(Wl,{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(Ut,{size:18})})]}),c.jsx("div",{className:"flex border-b border-zinc-800",children:wg.map(y=>c.jsxs("button",{type:"button",onClick:()=>s(y),className:oe("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(Zr,{size:14}),y==="upload"&&c.jsx(is,{size:14}),y==="url"&&c.jsx(ns,{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(yg,{library:o,selectedId:a,onSelect:l}),i==="upload"&&c.jsx(kg,{preview:d,onPreviewChange:u,onAssetUpload:n==null?void 0:n.onAssetUpload}),i==="url"&&c.jsx(Sg,{urlPreview:f,onUrlPreviewChange:h})]}),c.jsxs(xg,{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(Xe,{type:"button",variant:"outline",size:"sm",onClick:()=>t(!1),children:"Annulla"}),c.jsx(Xe,{type:"button",size:"sm",disabled:!p,onClick:w,className:oe(!p&&"opacity-40"),children:"Inserisci immagine"})]})]})]})})},Ul=(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}`},Eg=({value:e,onChange:t,label:r="IMAGE",className:n})=>{const{tenantId:o="default"}=pr(),[i,s]=b.useState(!1),[a,l]=b.useState(!1),d=!!(e!=null&&e.url),u=e!=null&&e.url?Ul(e.url,o):"",f=p=>{t(p),s(!1)},h=p=>{p.stopPropagation(),t({url:"",alt:""})};return c.jsxs("div",{className:oe("space-y-1.5",n),children:[c.jsx(Dt,{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:oe("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:oe("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(Rd,{size:13}),c.jsx("span",{children:"Cambia"})]}),c.jsx(Xe,{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(Qr,{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:oe("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(Zr,{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(Cg,{open:i,onOpenChange:s,onSelect:f})]})},Bl=[{name:"layers",Icon:lo},{name:"github",Icon:_d},{name:"arrow-right",Icon:Ad},{name:"box",Icon:Pd},{name:"terminal",Icon:Wd},{name:"chevron-right",Icon:Od},{name:"menu",Icon:Md},{name:"x",Icon:Ut},{name:"sparkles",Icon:Fd},{name:"zap",Icon:Bd}],Kn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),ir={"ui:text":({label:e,value:t,onChange:r})=>c.jsxs("div",{className:"grid w-full items-center gap-2 mb-4",children:[c.jsx(Dt,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Kn(e)}),c.jsx(To,{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(Dt,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Kn(e)}),c.jsx(qf,{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(Dt,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Kn(e)}),c.jsxs(gg,{value:t||"",onValueChange:r,children:[c.jsx(Ol,{className:"w-full h-9 text-[13px] bg-zinc-900/50 border-zinc-700 focus:ring-blue-600",children:c.jsx(bg,{placeholder:"Select..."})}),c.jsx(Il,{className:"dark",children:n.map(o=>c.jsx(Dl,{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(Xf,{id:e,checked:!!t,onCheckedChange:n=>r(n===!0)}),c.jsx(Dt,{htmlFor:e,className:"text-[13px] font-medium cursor-pointer select-none text-zinc-200",children:Kn(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(Eg,{label:e,value:n,onChange:o})})},"ui:icon-picker":({label:e,value:t,onChange:r})=>{const[n,o]=b.useState(!1),i=Bl.find(s=>s.name===(t||""));return c.jsxs("div",{className:"grid w-full gap-1.5 mb-4",children:[c.jsx(Dt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),c.jsxs(Rl,{open:n,onOpenChange:o,children:[c.jsx(vg,{asChild:!0,children:c.jsx(Xe,{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(Zr,{size:16,className:"text-zinc-500 shrink-0"}),c.jsx("span",{className:"text-[11px] text-zinc-500",children:"Choose icon..."})]})})}),c.jsxs(Ll,{className:"sm:max-w-[280px] p-4",children:[c.jsxs($l,{children:[c.jsx(Fl,{className:"text-sm",children:"Choose icon"}),c.jsx(Wl,{className:"text-xs",children:"Click an icon to select it."})]}),c.jsx("div",{className:"grid grid-cols-5 gap-2 py-2",children:Bl.map(({name:s,Icon:a})=>c.jsx("button",{type:"button",onClick:()=>{r(s),o(!1)},className:oe("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))})]})]})]})}},li=e=>{if(e instanceof Ne.z.ZodOptional||e instanceof Ne.z.ZodDefault)return li(e._def.innerType);if(e instanceof Ne.z.ZodObject){const t={id:crypto.randomUUID()};for(const r in e.shape)r!=="id"&&(t[r]=li(e.shape[r]));return t}return e instanceof Ne.z.ZodArray?[]:e instanceof Ne.z.ZodString?"":e instanceof Ne.z.ZodNumber?0:e instanceof Ne.z.ZodBoolean?!1:e instanceof Ne.z.ZodEnum?e._def.values[0]:null},Gn=e=>e instanceof Ne.z.ZodOptional||e instanceof Ne.z.ZodDefault||e instanceof Ne.z.ZodNullable?Gn(e._def.innerType):e,Hl=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=Gn(e);return r!==e?Hl(r):null},Yn=(e,t)=>e&&!t?"opacity-10":"opacity-100",sr=(e,t)=>e!=null&&t.toLowerCase()===e.toLowerCase(),ci=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),Ir=({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=Gn(h),w=Hl(h)||"ui:text",m=t[f];if(w==="ui:editorial-markdown")return null;if(w==="ui:image-picker"&&p instanceof Ne.z.ZodObject){const S=sr(d,f),C=ir["ui:image-picker"]||ir["ui:text"];return c.jsx("div",{className:`transition-opacity duration-200 ${Yn(u,S)}`,...S?{"data-jp-focused-field":f}:{},children:c.jsx(C,{label:f,value:m,onChange:j=>r({...t,[f]:j})})},f)}if(p instanceof Ne.z.ZodObject){const S=m||{},C=sr(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 ${Yn(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:ci(f)})]}),c.jsx(Ir,{schema:p,data:S,onChange:j=>r({...t,[f]:j}),expandedItemPath:o&&sr(l==null?void 0:l.fieldKey,f)?o.slice(1):void 0})]},f)}if(p instanceof Ne.z.ZodArray){const S=Array.isArray(m)?m:[],C=Gn(p.element),j=(R,I)=>{if(I<0||I>=S.length)return;const L=[...S],[M]=L.splice(R,1);L.splice(I,0,M),r({...t,[f]:L})},N=sr(d,f),D=sr(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 ${Yn(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:[ci(f)," (",S.length,")"]}),c.jsxs("button",{type:"button",onClick:()=>{const R=li(C);r({...t,[f]:[...S,R]})},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(co,{size:12})," Add Item"]})]}),c.jsx("div",{className:"space-y-2",children:S.map((R,I)=>{const L=R,M=L.id||`legacy-${I}`,G=(typeof L.title=="string"?L.title:null)||(typeof L.label=="string"?L.label:null)||(typeof L.name=="string"?L.name:null)||(typeof L.content=="string"?L.content:null)||(typeof L.text=="string"?L.text:null)||`${ci(f)} #${I+1}`,B=D,F=String(L.id??M),U=B!=null&&String(B)===F,A=U&&o&&o.length>1?o.slice(1):void 0,X=u&&N&&B!=null&&!U;return c.jsx(jg,{itemId:F,openItemId:B!=null?String(B):void 0,isFaded:X,index:I,isFirst:I===0,isLast:I===S.length-1,label:G,onExpandedChange:i?re=>i(re?{fieldKey:f,itemId:F}:null):void 0,onRemove:()=>{const re=S.filter((T,$)=>$!==I);r({...t,[f]:re})},onMoveUp:()=>j(I,I-1),onMoveDown:()=>j(I,I+1),children:C instanceof Ne.z.ZodObject?c.jsx(Ir,{schema:C,data:L||{},expandedItemPath:A,onChange:re=>{const T=[...S];T[I]=re,r({...t,[f]:T})}}):c.jsx("div",{className:"text-[10px] text-red-400",children:"Primitive arrays not supported."})},M)})})]},f)}const v=w in ir?w:"ui:text",y=ir[v]||ir["ui:text"],k=p instanceof Ne.z.ZodEnum?p._def.values:void 0,x=sr(d,f);return c.jsx("div",{className:`transition-opacity duration-200 ${Yn(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)})})},jg=({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]=b.useState(f);b.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(ao,{size:12,className:"shrink-0"}):c.jsx(Jr,{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(zd,{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(Td,{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(Qr,{size:12})})]})]}),h&&c.jsx("div",{className:"p-4 border-t border-zinc-800 bg-black/20",children:u})]})};function Ng(e,t){return g.useReducer((r,n)=>t[r][n]??r,e)}var Dr=e=>{const{present:t,children:r}=e,n=Tg(t),o=typeof r=="function"?r({present:n.isPresent}):g.Children.only(r),i=Se(n.ref,Ag(o));return typeof r=="function"||n.isPresent?g.cloneElement(o,{ref:i}):null};Dr.displayName="Presence";function Tg(e){const[t,r]=g.useState(),n=g.useRef(null),o=g.useRef(e),i=g.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Ng(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const d=qn(n.current);i.current=a==="mounted"?d:"none"},[a]),Re(()=>{const d=n.current,u=o.current;if(u!==e){const h=i.current,p=qn(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]),Re(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,f=p=>{const m=qn(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=qn(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:g.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function qn(e){return(e==null?void 0:e.animationName)||"none"}function Ag(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[Xn]=Tr("Tooltip",[Qt]),Jn=Qt(),Vl="TooltipProvider",zg=700,di="tooltip.open",[Pg,ui]=Xn(Vl),Kl=e=>{const{__scopeTooltip:t,delayDuration:r=zg,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:i}=e,s=g.useRef(!0),a=g.useRef(!1),l=g.useRef(0);return g.useEffect(()=>{const d=l.current;return()=>window.clearTimeout(d)},[]),c.jsx(Pg,{scope:t,isOpenDelayedRef:s,delayDuration:r,onOpen:g.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:g.useCallback(d=>{a.current=d},[]),disableHoverableContent:o,children:i})};Kl.displayName=Vl;var _r="Tooltip",[Og,Mr]=Xn(_r),Gl=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=ui(_r,e.__scopeTooltip),d=Jn(t),[u,f]=g.useState(null),h=Ar(),p=g.useRef(0),w=s??l.disableHoverableContent,m=a??l.delayDuration,v=g.useRef(!1),[y,k]=Dn({prop:n,defaultProp:o??!1,onChange:N=>{N?(l.onOpen(),document.dispatchEvent(new CustomEvent(di))):l.onClose(),i==null||i(N)},caller:_r}),x=g.useMemo(()=>y?v.current?"delayed-open":"instant-open":"closed",[y]),S=g.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v.current=!1,k(!0)},[k]),C=g.useCallback(()=>{window.clearTimeout(p.current),p.current=0,k(!1)},[k]),j=g.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{v.current=!0,k(!0),p.current=0},m)},[m,k]);return g.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),c.jsx(Go,{...d,children:c.jsx(Og,{scope:t,contentId:h,open:y,stateAttribute:x,trigger:u,onTriggerChange:f,onTriggerEnter:g.useCallback(()=>{l.isOpenDelayedRef.current?j():S()},[l.isOpenDelayedRef,j,S]),onTriggerLeave:g.useCallback(()=>{w?C():(window.clearTimeout(p.current),p.current=0)},[C,w]),onOpen:S,onClose:C,disableHoverableContent:w,children:r})})};Gl.displayName=_r;var fi="TooltipTrigger",Yl=g.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Mr(fi,r),i=ui(fi,r),s=Jn(r),a=g.useRef(null),l=Se(t,a,o.onTriggerChange),d=g.useRef(!1),u=g.useRef(!1),f=g.useCallback(()=>d.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),c.jsx(On,{asChild:!0,...s,children:c.jsx(ye.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:l,onPointerMove:pe(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:pe(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:pe(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:pe(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:pe(e.onBlur,o.onClose),onClick:pe(e.onClick,o.onClose)})})});Yl.displayName=fi;var pi="TooltipPortal",[Ig,Dg]=Xn(pi,{forceMount:void 0}),ql=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,i=Mr(pi,t);return c.jsx(Ig,{scope:t,forceMount:r,children:c.jsx(Dr,{present:r||i.open,children:c.jsx(In,{asChild:!0,container:o,children:n})})})};ql.displayName=pi;var ar="TooltipContent",Xl=g.forwardRef((e,t)=>{const r=Dg(ar,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...i}=e,s=Mr(ar,e.__scopeTooltip);return c.jsx(Dr,{present:n||s.open,children:s.disableHoverableContent?c.jsx(Jl,{side:o,...i,ref:t}):c.jsx(_g,{side:o,...i,ref:t})})}),_g=g.forwardRef((e,t)=>{const r=Mr(ar,e.__scopeTooltip),n=ui(ar,e.__scopeTooltip),o=g.useRef(null),i=Se(t,o),[s,a]=g.useState(null),{trigger:l,onClose:d}=r,u=o.current,{onPointerInTransitChange:f}=n,h=g.useCallback(()=>{a(null),f(!1)},[f]),p=g.useCallback((w,m)=>{const v=w.currentTarget,y={x:w.clientX,y:w.clientY},k=Fg(y,v.getBoundingClientRect()),x=Wg(y,k),S=Ug(m.getBoundingClientRect()),C=Hg([...x,...S]);a(C),f(!0)},[f]);return g.useEffect(()=>()=>h(),[h]),g.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]),g.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=!Bg(y,s);k?h():x&&(h(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[l,u,s,d,h]),c.jsx(Jl,{...e,ref:i})}),[Mg,Rg]=Xn(_r,{isInside:!1}),Lg=ep("TooltipContent"),Jl=g.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=Mr(ar,r),d=Jn(r),{onClose:u}=l;return g.useEffect(()=>(document.addEventListener(di,u),()=>document.removeEventListener(di,u)),[u]),g.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(yn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:c.jsxs(Yo,{"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(Lg,{children:n}),c.jsx(Mg,{scope:r,isInside:!0,children:c.jsx(Zh,{id:l.contentId,role:"tooltip",children:o||n})})]})})});Xl.displayName=ar;var Zl="TooltipArrow",$g=g.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Jn(r);return Rg(Zl,r).isInside?null:c.jsx(qo,{...o,...n,ref:t})});$g.displayName=Zl;function Fg(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 Wg(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 Ug(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 Bg(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 Hg(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),Vg(t)}function Vg(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 Kg=Kl,Gg=Gl,Yg=Yl,qg=ql,Ql=Xl;const Xg=Kg,Rr=Gg,Lr=Yg,lr=g.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(qg,{children:c.jsx(Ql,{ref:n,sideOffset:t,className:oe("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})}));lr.displayName=Ql.displayName;var Zn="Popover",[ec]=Tr(Zn,[Qt]),$r=Qt(),[Jg,jt]=ec(Zn),tc=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=$r(t),l=g.useRef(null),[d,u]=g.useState(!1),[f,h]=Dn({prop:n,defaultProp:o??!1,onChange:i,caller:Zn});return c.jsx(Go,{...a,children:c.jsx(Jg,{scope:t,contentId:Ar(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:g.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:d,onCustomAnchorAdd:g.useCallback(()=>u(!0),[]),onCustomAnchorRemove:g.useCallback(()=>u(!1),[]),modal:s,children:r})})};tc.displayName=Zn;var rc="PopoverAnchor",Zg=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=jt(rc,r),i=$r(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return g.useEffect(()=>(s(),()=>a()),[s,a]),c.jsx(On,{...i,...n,ref:t})});Zg.displayName=rc;var nc="PopoverTrigger",oc=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=jt(nc,r),i=$r(r),s=Se(t,o.triggerRef),a=c.jsx(ye.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":cc(o.open),...n,ref:s,onClick:pe(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:c.jsx(On,{asChild:!0,...i,children:a})});oc.displayName=nc;var hi="PopoverPortal",[Qg,e0]=ec(hi,{forceMount:void 0}),ic=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=jt(hi,t);return c.jsx(Qg,{scope:t,forceMount:r,children:c.jsx(Dr,{present:r||i.open,children:c.jsx(In,{asChild:!0,container:o,children:n})})})};ic.displayName=hi;var cr="PopoverContent",sc=g.forwardRef((e,t)=>{const r=e0(cr,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=jt(cr,e.__scopePopover);return c.jsx(Dr,{present:n||i.open,children:i.modal?c.jsx(r0,{...o,ref:t}):c.jsx(n0,{...o,ref:t})})});sc.displayName=cr;var t0=Yt("PopoverContent.RemoveScroll"),r0=g.forwardRef((e,t)=>{const r=jt(cr,e.__scopePopover),n=g.useRef(null),o=Se(t,n),i=g.useRef(!1);return g.useEffect(()=>{const s=n.current;if(s)return Ka(s)},[]),c.jsx(ti,{as:t0,allowPinchZoom:!0,children:c.jsx(ac,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:pe(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:pe(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:pe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),n0=g.forwardRef((e,t)=>{const r=jt(cr,e.__scopePopover),n=g.useRef(!1),o=g.useRef(!1);return c.jsx(ac,{...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()}})}),ac=g.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=jt(cr,r),p=$r(r);return oa(),c.jsx(Io,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:c.jsx(yn,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),children:c.jsx(Yo,{"data-state":cc(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)"}})})})}),lc="PopoverClose",o0=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=jt(lc,r);return c.jsx(ye.button,{type:"button",...n,ref:t,onClick:pe(e.onClick,()=>o.onOpenChange(!1))})});o0.displayName=lc;var i0="PopoverArrow",s0=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=$r(r);return c.jsx(qo,{...o,...n,ref:t})});s0.displayName=i0;function cc(e){return e?"open":"closed"}var a0=tc,l0=oc,c0=ic,dc=sc;const d0=a0,u0=l0,uc=g.forwardRef(({className:e,align:t="start",sideOffset:r=6,...n},o)=>c.jsx(c0,{children:c.jsx(dc,{ref:o,align:t,sideOffset:r,className:oe("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})}));uc.displayName=dc.displayName;const fc=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"Select page",f0=({pageSlugs:e,currentSlug:t,onPageChange:r,sectionCount:n,onNewPage:o,className:i,currentPageLabel:s})=>{const[a,l]=b.useState(!1),d=s??fc(t),u=f=>{r(f),l(!1)};return c.jsx("div",{className:oe("mx-3 mt-2 mb-2",i),children:c.jsxs(d0,{open:a,onOpenChange:l,children:[c.jsx(u0,{asChild:!0,children:c.jsxs("button",{type:"button","aria-haspopup":"listbox","aria-label":`Select page, current: ${d}`,className:oe("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(Dd,{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(Jr,{size:13,className:"shrink-0 text-zinc-500","aria-hidden":!0})]})}),c.jsxs(uc,{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=fc(f);return c.jsxs("button",{type:"button",role:"option","aria-selected":h,onClick:()=>u(f),className:oe("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(co,{size:12,"aria-hidden":!0}),c.jsx("span",{children:"New page"})]})})]})]})})},mi=new Set(["anchorId","paddingTop","paddingBottom","theme","container"]),pc=new Set(["ui:editorial-markdown"]),hc=e=>e instanceof Ne.z.ZodOptional||e instanceof Ne.z.ZodDefault||e instanceof Ne.z.ZodNullable?hc(e._def.innerType):e,gi=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=hc(e);return o!==e?gi(o):""},bi=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),p0={activationConstraint:{distance:8}},h0={activationConstraint:{delay:200,tolerance:5}};function vi({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:oe("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(rs,{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(rs,{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:oe("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(Rr,{children:[c.jsx(Lr,{asChild:!0,children:c.jsx(Xe,{variant:"ghost",size:"icon-xs",className:"text-zinc-600 hover:text-zinc-300",onClick:f=>{f.stopPropagation(),l(f)},children:c.jsx($d,{size:12})})}),c.jsx(lr,{children:"Settings"})]}),s&&c.jsxs(Rr,{children:[c.jsx(Lr,{asChild:!0,children:c.jsx(Xe,{variant:"ghost",size:"icon-xs",className:"text-zinc-600 hover:text-destructive",onClick:f=>{f.stopPropagation(),d()},children:c.jsx(Qr,{size:12})})}),c.jsx(lr,{children:"Delete section"})]})]})]})}function m0({layer:e,opts:t}){const{attributes:r,listeners:n,setNodeRef:o,transform:i,transition:s,isDragging:a}=Hf({id:e.id,disabled:!t.canReorder}),l={transform:xt.Transform.toString(i),transition:s};return c.jsx("div",{ref:o,style:l,className:oe(a&&"z-10"),children:c.jsx(vi,{layer:e,opts:{...t,isDragging:a},dragHandleProps:t.canReorder?{...r,...n,"aria-roledescription":"elemento trascinabile"}:void 0})})}const mc=({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:j=!1,pageSlugs:N=[],currentSlug:E="home",onPageChange:D})=>{const{schemas:R}=pr(),[I,L]=b.useState(!0),[M,G]=b.useState(null),[B,F]=b.useState(null),[U,A]=b.useState(null),[X,re]=b.useState(null),T=b.useRef(null),$=b.useRef(null),q=mu(go(So,p0),go(zs,h0),go(yo,{coordinateGetter:Gf})),K=b.useDeferredValue(e),ge=e!=null&&(K==null?void 0:K.id)!==e.id,se=s&&s.length>0?s:U?[U]:null,O=se!=null&&se.length?{fieldKey:se[se.length-1].fieldKey,itemId:se[se.length-1].itemId}:null,J=b.useRef(s);b.useEffect(()=>{J.current!=null&&s==null&&A(null),J.current=s},[s]),b.useEffect(()=>{(e==null?void 0:e.id)!=null&&L(!1)},[e==null?void 0:e.id]);const ee=()=>{const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{const Q=T.current;Q&&Q.scrollTo({top:0,behavior:"smooth"})})});return()=>cancelAnimationFrame(_)},W=b.useRef(I);b.useEffect(()=>{if(I&&!W.current){const _=ee();return W.current=I,_}W.current=I},[I]),b.useEffect(()=>{if(!O)return;const _=T.current;if(!_)return;const Q=requestAnimationFrame(()=>{const ie=_.querySelector("[data-jp-expanded-item]")??_.querySelector("[data-jp-focused-field]");ie&&ie.scrollIntoView({behavior:"smooth",block:"start"})});return()=>cancelAnimationFrame(Q)},[O]);const ne=_=>{L(!1),u==null||u(_)},Z=()=>{L(_=>{const Q=!_;return Q&&ee(),Q})},we=(_,Q)=>{Q.stopPropagation(),r.length>0&&o?re(_):(L(!1),u==null||u(_))};b.useEffect(()=>{if(X==null)return;const _=Q=>{Q.key==="Escape"&&re(null)};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[X]);const be=_=>{M===_?(f==null||f(_),G(null)):(G(_),setTimeout(()=>G(null),3e3))},ze=b.useMemo(()=>l.filter(_=>_.scope==="local").map(_=>_.id),[l]),Ie=!!a&&ze.length>0,He=_=>{F(_.active.id)},Nt=_=>{F(null);const{active:Q,over:ie}=_;if(!ie||Q.id===ie.id||!a)return;const fe=l.findIndex(je=>je.id===Q.id),De=l.findIndex(je=>je.id===ie.id);if(fe===-1||De===-1)return;const ke=fe<De?De:De-1;a(Q.id,ke)},Je=e?t.sections.find(_=>_.id===e.id):void 0,Ve=K?t.sections.find(_=>_.id===K.id):void 0,Ke=K?R[K.type]:void 0,mt=b.useMemo(()=>{if(!Ke)return!1;const _=Ke.shape,Q=Object.keys(_).filter(ie=>!mi.has(ie));return Q.length===0?!1:Q.every(ie=>pc.has(gi(_[ie])))},[Ke]);b.useEffect(()=>{(e==null?void 0:e.id)!=null&&mt&&L(!0)},[e==null?void 0:e.id,mt]);const it=l.length>0&&(I||!e),Tt=E?E.charAt(0).toUpperCase()+E.slice(1):"Select page",Wr=b.useMemo(()=>{const _=[];let Q=null;for(const ie of l){const fe=ie.type.toUpperCase(),De=Q!==null&&(Q==="HEADER"&&fe!=="HEADER"||Q!=="HEADER"&&Q!=="FOOTER"&&fe==="FOOTER");_.push({layer:ie,showSeparatorAbove:De}),Q=fe}return _},[l]);return c.jsx(Xg,{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:[Tt," · ",l.length," sections"]})})]}),c.jsx(Xe,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":"Close Inspector",children:c.jsx(Ut,{size:14})})]}),N.length>0&&D&&c.jsx(f0,{pageSlugs:N,currentSlug:E,onPageChange:D,sectionCount:l.length,currentPageLabel:Tt}),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:Z,className:"flex items-center gap-2 flex-1 cursor-pointer min-w-0 text-left","aria-expanded":it,"aria-label":it?"Collapse Page Layers":"Expand Page Layers",children:[c.jsx(lo,{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(ao,{size:13,className:oe("ml-auto text-zinc-600 transition-transform duration-200 shrink-0",!I&&"rotate-180")})]}),h!=null&&c.jsxs(Rr,{children:[c.jsx(Lr,{asChild:!0,children:c.jsx(Xe,{variant:"ghost",size:"icon-sm",className:"text-zinc-500 hover:text-primary",onClick:h,children:c.jsx(co,{size:14})})}),c.jsx(lr,{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:it&&c.jsxs("div",{className:"py-1",children:[c.jsxs(pf,{sensors:q,collisionDetection:vu,modifiers:[Pf],onDragStart:He,onDragEnd:Nt,accessibility:{announcements:{onDragStart:()=>"Sezione presa in carico. Usa i tasti freccia per spostare, Spazio per rilasciare.",onDragOver:({over:_})=>_?`Posizione ${ze.indexOf(String(_.id))+1} di ${ze.length}.`:void 0,onDragEnd:({over:_})=>_?"Sezione rilasciata in nuova posizione.":"Riposizionamento annullato.",onDragCancel:()=>"Riposizionamento annullato."}},children:[c.jsx(Rf,{items:ze,strategy:_f,children:c.jsx("div",{className:"px-2 space-y-0.5",children:Wr.map(({layer:_,showSeparatorAbove:Q})=>c.jsxs(b.Fragment,{children:[Q&&c.jsx("div",{className:"mx-3 border-t border-zinc-800/60 my-1"}),_.scope==="local"&&Ie?c.jsx(m0,{layer:_,opts:{isSelected:(e==null?void 0:e.id)===_.id,isActive:d===_.id,isDragging:!1,canReorder:!0,canDelete:!!f,deleteConfirm:M===_.id,onSelect:()=>ne(_.id),onDelete:()=>be(_.id),onOpenSettings:ie=>we(_.id,ie)}}):c.jsx("div",{children:c.jsx(vi,{layer:_,opts:{isSelected:(e==null?void 0:e.id)===_.id,isActive:d===_.id,isDragging:!1,canDelete:_.scope==="local"&&!!f,deleteConfirm:M===_.id,onSelect:()=>ne(_.id),onDelete:()=>be(_.id),onOpenSettings:ie=>we(_.id,ie)}})})]},_.id))})}),c.jsx(zf,{dropAnimation:{duration:200,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:B?(()=>{const _=l.find(Q=>Q.id===B);return _?c.jsx("div",{className:"px-2 w-full max-w-[var(--inspector-width,280px)]",children:c.jsx(vi,{layer:_,opts:{isSelected:!1,isActive:!1,isDragging:!0,canDelete:!1,deleteConfirm:!1,onSelect:()=>{},onDelete:()=>{},onOpenSettings:()=>{}},dragHandleProps:{"aria-hidden":!0}})}):null})():null})]}),M&&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(Id,{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"})]})]})}),O&&Je&&(()=>{const _=Je.data||{};let Q;if(se&&se.length>0){let ie=_;for(const ke of se){const je=ie==null?void 0:ie[ke.fieldKey];ke.itemId!=null&&Array.isArray(je)?ie=je.find(z=>String(z==null?void 0:z.id)===String(ke.itemId))??null:ie=je}const fe=ie||{},De=O.fieldKey;Q=(typeof fe.name=="string"?fe.name:null)??(typeof fe.title=="string"?fe.title:null)??(typeof fe.label=="string"?fe.label:null)??bi(De)}else{const ie=O.fieldKey;if(O.itemId!=null){const ke=(Array.isArray(_[ie])?_[ie]:[]).find(je=>String(je==null?void 0:je.id)===String(O.itemId))||{};Q=(typeof ke.name=="string"?ke.name:null)??(typeof ke.title=="string"?ke.title:null)??(typeof ke.label=="string"?ke.label:null)??bi(ie)}else Q=bi(ie)}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:Q})]})})(),c.jsx("div",{className:"flex-1 p-4",onFocusCapture:()=>e!=null&&L(!1),children:e?ge?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"})]}):Ke?(()=>{const Q=Object.keys(Ke.shape).filter(fe=>!mi.has(fe)&&!pc.has(gi(Ke.shape[fe]))),ie=(Ve==null?void 0:Ve.data)||{};return Q.length===0?c.jsx("p",{className:"text-xs text-zinc-500",children:"Inline editorial section: edit content directly on the canvas."}):c.jsx(Ir,{schema:Ke,data:ie,onChange:fe=>n(fe),keys:Q,expandedItemPath:se,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 ",(K==null?void 0:K.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:oe("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:oe("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(Rr,{children:[c.jsx(Lr,{asChild:!0,children:c.jsxs(Xe,{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(os,{size:14}),c.jsx("span",{children:"Save"})]})}),c.jsx(lr,{children:"Save to file"})]}),S&&m!=null&&c.jsxs(Rr,{children:[c.jsx(Lr,{asChild:!0,children:c.jsxs(Xe,{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(os,{size:14}),c.jsx("span",{children:k?"Saving...":"Hot Save"})]})}),c.jsx(lr,{children:"Hot save to edge"})]}),C!=null&&j&&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"})})]})}),X!=null&&r.length>0&&o!=null&&(()=>{const _=r.find(z=>z.id===X),Q=l.find(z=>z.id===X);if(!_)return null;const ie=(Q==null?void 0:Q.scope)==="global"?"global":"local",fe=_.type,De=R[fe],je=(De?Object.keys(De.shape):[]).filter(z=>mi.has(z)),P=_.data??{};return je.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:()=>re(null),children:c.jsxs("div",{ref:$,className:"relative rounded-lg border border-zinc-700 bg-zinc-900 shadow-xl max-w-md w-full overflow-hidden",onClick:z=>z.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 — ",fe]}),c.jsx("button",{type:"button",onClick:()=>re(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(Ut,{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:z=>z.target===z.currentTarget&&re(null),children:c.jsxs("div",{ref:$,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:z=>z.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 — ",fe]}),c.jsx("button",{type:"button",onClick:()=>re(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(Ut,{size:18})})]}),c.jsx("div",{className:"flex-1 overflow-y-auto p-4 custom-scrollbar",children:c.jsx(Ir,{schema:De,data:P,onChange:z=>{const Y={..._.data,...z};o(X,ie,fe,Y)},keys:je})})]})})})()]})})},gc=({draft:e,globalDraft:t,menuConfig:r,themeConfig:n,slug:o,selectedId:i,scrollToSectionId:s,onScrollRequested:a})=>{const l=b.useRef(null),d=b.useCallback(()=>{var u;(u=l.current)!=null&&u.contentWindow&&l.current.contentWindow.postMessage({type:xe.UPDATE_DRAFTS,draft:e,globalDraft:t,menuConfig:r,themeConfig:n},"*")},[e,t,r,n]);return b.useEffect(()=>{d()},[d]),b.useEffect(()=>{const u=f=>{f.data.type===xe.STAGE_READY&&d()};return window.addEventListener("message",u),()=>window.removeEventListener("message",u)},[d]),b.useEffect(()=>{var u;(u=l.current)!=null&&u.contentWindow&&l.current.contentWindow.postMessage({type:xe.SYNC_SELECTION,selectedId:i},"*")},[i]),b.useEffect(()=>{var u;!s||!((u=l.current)!=null&&u.contentWindow)||(l.current.contentWindow.postMessage({type:xe.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"})})},xi=new Set;function g0(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function bc(e,t=[],r={}){return Object.entries(e).forEach(([n,o])=>{const i=[...t,g0(n)];if(typeof o=="string"||typeof o=="number"){r[`--theme-${i.join("-")}`]=String(o);return}o&&typeof o=="object"&&!Array.isArray(o)&&bc(o,i,r)}),r}function Ue(e,t,r,n){n&&(e[t]=`var(${r})`)}function b0(e){const t=bc(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 Qn={setTheme:e=>{const t=document.documentElement,r=b0(e);xi.forEach(n=>{t.style.removeProperty(n)}),xi.clear(),Object.entries(r).forEach(([n,o])=>{t.style.setProperty(n,o),xi.add(n)})}};function v0(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 vc(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(),v0(r,n)}const x0='[data-jp-ignore-select="true"],[data-jp-interactive="true"],.ProseMirror,[contenteditable="true"],button,input,textarea,select,[role="button"],[role="menuitem"]',w0="[data-jp-field],[data-jp-item-id],[data-jp-item-field]",xc=()=>{var h;const[e,t]=b.useState(null),[r,n]=b.useState(null),[o,i]=b.useState({main:[]}),[s,a]=b.useState(null),[l,d]=b.useState(null);if(b.useEffect(()=>{const p=w=>{var m;if(!(w.origin!==window.location.origin||w.source!==window.parent)&&(w.data.type===xe.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&&Qn.setTheme(w.data.themeConfig)),w.data.type===xe.SYNC_SELECTION&&a(w.data.selectedId),w.data.type===xe.REQUEST_SCROLL_TO_SECTION&&d(w.data.sectionId??null),w.data.type===xe.REQUEST_INLINE_FLUSH)){const v=typeof w.data.requestId=="string"?w.data.requestId:null;window.dispatchEvent(new CustomEvent(xe.REQUEST_INLINE_FLUSH,{detail:{requestId:v}})),setTimeout(()=>{window.parent.postMessage({type:xe.INLINE_FLUSHED,requestId:v},window.location.origin)},0)}};return window.addEventListener("message",p),window.parent.postMessage({type:xe.STAGE_READY},"*"),()=>window.removeEventListener("message",p)},[]),b.useEffect(()=>{const p=v=>!!v.closest(w0),w=v=>!!(v.closest('[data-jp-ignore-select="true"]')||v.closest(x0)&&!p(v)||v.closest("a[href]")&&!p(v)),m=v=>{var M,G,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 F=(M=C.getAttribute)==null?void 0:M.call(C,"data-section-id"),U=(G=C.getAttribute)==null?void 0:G.call(C,"data-section-type"),A=(B=C.getAttribute)==null?void 0:B.call(C,"data-section-scope");if(F&&U&&A){S=C;break}C=C.parentElement}if(!S)return;v.preventDefault(),v.stopPropagation();const j=S.getAttribute("data-section-id"),N=S.getAttribute("data-section-type"),E=S.getAttribute("data-section-scope");if(!j||!N||!E)return;const D={id:j,type:N,scope:E};if(y===S){window.parent.postMessage({type:xe.SECTION_SELECT,section:D},"*");return}const R=document.elementFromPoint(k,x)??y;if(!R||!S.contains(R)){window.parent.postMessage({type:xe.SECTION_SELECT,section:D},"*");return}if(R===S){window.parent.postMessage({type:xe.SECTION_SELECT,section:D},"*");return}let I=vc(R,S);if(I.length===0&&R){let F=null;const U=A=>{var re,T;const X=A.getBoundingClientRect();if(X.left<=k&&k<=X.right&&X.top<=x&&x<=X.bottom){for(let $=0;$<A.children.length;$++)U(A.children[$]);((re=A.getAttribute)!=null&&re.call(A,"data-jp-item-id")||(T=A.getAttribute)!=null&&T.call(A,"data-jp-field"))&&(F=A)}};U(R),F&&(I=vc(F,S))}const L={type:xe.SECTION_SELECT,section:D};I.length>0&&(L.itemPath=I),window.parent.postMessage(L,"*")};return document.addEventListener("click",m,!0),()=>document.removeEventListener("click",m,!0)},[]),b.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:rn((h=r.header)==null?void 0:h.data,o.main)},f=p=>{window.parent.postMessage({type:xe.ACTIVE_SECTION_CHANGED,activeSectionId:p},"*")};return c.jsx(Xr,{mode:"studio",children:c.jsx("div",{className:"jp-ice-active",children:c.jsx(fo,{pageConfig:e,siteConfig:r,menuConfig:u,selectedId:s,scrollToSectionId:l,onActiveSectionChange:f})})})};function y0(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const wc=({open:e,onClose:t,sectionTypes:r,sectionTypeLabels:n,onSelect:o})=>{if(b.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])??y0(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(lo,{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(Ut,{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:oe("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"})})]})]})},yc=()=>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 wi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function kc(e){return e==null?e:JSON.parse(JSON.stringify(e))}function Sc(){if(typeof window>"u")return null;const e=window;return e.__olonWebMcpTools__||(e.__olonWebMcpTools__=new Map),e.__olonWebMcpTools__}function yi(){return"update-section"}function Cc(){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 ki(e,t,r){if(t.length===0)throw new Error("Selection path is empty.");const n=kc(e);let o=n;for(let i=0;i<t.length;i+=1){const s=t[i],a=i===t.length-1;if(!wi(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=>wi(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 Si(e,t){if(t.data&&wi(t.data))return kc(t.data);if(Array.isArray(t.itemPath)&&t.itemPath.length>0)return ki(e,t.itemPath,t.value);if(typeof t.fieldKey=="string"&&t.fieldKey.trim().length>0)return ki(e,[{fieldKey:t.fieldKey}],t.value);throw new Error('WebMCP mutation requires either "data", "itemPath", or "fieldKey".')}async function Ec(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 eo(){if(typeof window>"u"||typeof navigator>"u")return;const e=Sc();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=Ec,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 Ec(r);return JSON.stringify(n)}}function jc(e){var n,o;if(typeof navigator>"u")return()=>{};eo();const t=navigator,r=Sc();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)})}const k0='/*! 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 S0 extends b.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 Fr(e){return e.split("/").map(t=>t.trim()).filter(Boolean).join("/")}function Nc(e,t=""){const r=Fr(t);let o=e.replace(/\/+/g,"/");if(r){const s=`/${r}`;o===s?o="/":o.startsWith(`${s}/`)&&(o=o.slice(s.length))}return Fr(o)||"home"}function Ci(e,t){const r=Fr(t)||"home";return e[r]}function Ei(e,t){return rn(e,t)}function ji(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function to(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 Tc(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 Ac(e){return`/mcp-manifests/${e}.json`}function zc(e){return`/schemas/${e}.schema.json`}const Pc=({pageRegistry:e,siteConfig:t,menuConfig:r,themeConfig:n,refDocuments:o,tenantCss:i,adminCss:s,NotFoundComponent:a})=>{const l=Ze.useLocation(),d=Nc(l.pathname),u=b.useMemo(()=>It({pages:e,siteConfig:t,themeConfig:n,menuConfig:r,refDocuments:o}),[e,t,n,r,o]),f=Ci(u.pages,d);return b.useEffect(()=>{var h;try{(h=u.themeConfig)!=null&&h.tokens&&Qn.setTheme(u.themeConfig)}catch(p){console.warn("[JsonPages] visitor theme resolution failed",p)}},[u.themeConfig]),b.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:"";to("mcp-manifest",Ac(d)),to("olon-contract",zc(d)),Tc(h,p,d==="home"?"/":`/${d}`)},[f,d]),f?c.jsx(on,{mode:"tenant",tenantCss:i,adminCss:s,children:c.jsx(Xr,{mode:"visitor",children:c.jsx(fo,{pageConfig:f,siteConfig:u.siteConfig,menuConfig:u.menuConfig})})}):c.jsx(a,{})},Oc=({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 je;const m=Ze.useLocation(),v=Nc(m.pathname,"admin"),y=Ze.useNavigate(),k=Object.keys(e).sort((P,z)=>P==="home"?-1:z==="home"?1:P.localeCompare(z)),[x,S]=b.useState(null),[C,j]=b.useState(!1),[N,E]=b.useState(!1),[D,R]=b.useState(!1),[I,L]=b.useState(!1),[M,G]=b.useState(()=>{try{const P=JSON.parse(JSON.stringify(r??{}));return P.identity||(P.identity={title:"Site"}),P.pages||(P.pages=[]),P}catch{return{identity:{title:"Site"},pages:[]}}}),[B,F]=b.useState(null),[U,A]=b.useState(null),[X,re]=b.useState(null),[T,$]=b.useState(null),[q,K]=b.useState(!1),[ge,se]=b.useState(400),O=b.useMemo(()=>It({pages:x?{[v]:x}:{},siteConfig:M,themeConfig:o,menuConfig:n,refDocuments:i}),[x,M,o,n,i,v]),J=x?O.pages[v]??x:null,ee=b.useRef(x),W=b.useRef(M),ne=360,Z=920;b.useEffect(()=>{ee.current=x},[x]),b.useEffect(()=>{W.current=M},[M]);const we=b.useCallback(P=>{P.preventDefault();const z=P.currentTarget;z.setPointerCapture(P.pointerId);const Y=P.clientX,te=ge,ce=ve=>{const Ce=Y-ve.clientX,Ee=Math.min(Z,Math.max(ne,te+Ce));se(Ee)},ue=()=>{z.releasePointerCapture(P.pointerId),z.removeEventListener("pointermove",ce),z.removeEventListener("pointerup",ue),z.removeEventListener("pointercancel",ue),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",z.addEventListener("pointermove",ce),z.addEventListener("pointerup",ue),z.addEventListener("pointercancel",ue)},[ge]),be=x?[...M.header?[{id:M.header.id,type:M.header.type,scope:"global",title:"Header"}]:[],...x.sections.map(P=>{var z,Y;return{id:P.id,type:P.type,scope:"local",title:((z=P.data)==null?void 0:z.title)??((Y=P.data)==null?void 0:Y.titleHighlight)}}),...M.footer?[{id:M.footer.id,type:M.footer.type,scope:"global",title:"Footer"}]:[]]:[];b.useEffect(()=>{const P=Ci(e,v);P&&S(JSON.parse(JSON.stringify(P))),F(null),A(null),j(!1)},[v,e]);const ze=b.useCallback(()=>{const P=Ci(e,v);P&&S(JSON.parse(JSON.stringify(P))),F(null),A(null),j(!1)},[v,e]),Ie=b.useCallback((P,z,Y)=>{const te=[...Y.sections],ce=te.findIndex(Ce=>Ce.id===P);if(ce===-1||z<0||z>=te.length)return;const[ue]=te.splice(ce,1),ve=z>ce?z-1:z;te.splice(Math.min(ve,te.length),0,ue),S({...Y,sections:te}),j(!0)},[]),He=b.useCallback(P=>{if(P.origin===window.location.origin){if(P.data.type===xe.SECTION_SELECT){F(P.data.section);const z=P.data.itemPath;Array.isArray(z)&&z.length>0?A(z.map(Y=>({fieldKey:Y.fieldKey,...Y.itemId!=null?{itemId:String(Y.itemId)}:{}}))):A(null)}if(P.data.type===xe.INLINE_FIELD_UPDATE){const z=typeof P.data.sectionId=="string"?P.data.sectionId:null,Y=typeof P.data.fieldKey=="string"?P.data.fieldKey:null;z&&Y&&(S(te=>{if(!te)return te;const ce={...te,sections:te.sections.map(ue=>ue.id===z?{...ue,data:{...ue.data,[Y]:P.data.value}}:ue)};return ee.current=ce,ce}),j(!0))}if(P.data.type===xe.ACTIVE_SECTION_CHANGED&&re(P.data.activeSectionId??null),P.data.type==="jsonpages:section-reorder"&&ee.current){const{sectionId:z,newIndex:Y}=P.data;typeof z=="string"&&typeof Y=="number"&&Y>=0&&Ie(z,Y,ee.current)}if(P.data.type===xe.WEBMCP_TOOL_CALL){const z=typeof P.data.requestId=="string"?P.data.requestId:crypto.randomUUID(),Y=typeof P.data.toolName=="string"?P.data.toolName:"";_(Y,P.data.args).then(te=>{window.postMessage({type:xe.WEBMCP_TOOL_RESULT,requestId:z,toolName:Y,result:te,ok:!0},window.location.origin)}).catch(te=>{const ce=te instanceof Error?te.message:String(te);window.postMessage({type:xe.WEBMCP_TOOL_RESULT,requestId:z,toolName:Y,ok:!1,error:ce},window.location.origin)})}}},[Ie,_]);b.useEffect(()=>(window.addEventListener("message",He),()=>window.removeEventListener("message",He)),[He]),b.useEffect(()=>{if(!(u!=null&&u.enabled)||(eo(),!ee.current))return;const z=jc({name:yi(),description:'Update any section in OlonJS Studio and persist immediately to file. Use "sectionType" in input args to ensure correct schema validation.',inputSchema:Cc(),execute:Y=>_(yi(),Y)});return()=>{z()}},[u==null?void 0:u.enabled,v,x,M,_]);const Nt=b.useCallback(P=>{const z=be.find(Y=>Y.id===P);z&&F({id:z.id,type:z.type,scope:z.scope}),A(null),$(P)},[be]),Je=b.useCallback(()=>{$(null)},[]),Ve=b.useCallback(P=>{S(z=>z&&{...z,sections:z.sections.filter(Y=>Y.id!==P)}),j(!0),F(z=>(z==null?void 0:z.id)===P?null:z)},[]),Ke=P=>{if(!(!B||!x))if(j(!0),B.scope==="global")B.type==="header"&&M.header!=null?G({...M,header:{...M.header,data:P}}):B.type==="footer"&&M.footer!=null&&G({...M,footer:{...M.footer,data:P}});else{const z=x.sections.map(Y=>Y.id===B.id?{...Y,data:P}:Y);S({...x,sections:z})}},mt=b.useCallback((P,z,Y,te)=>{var ce,ue;if(j(!0),z==="global")((ce=M.header)==null?void 0:ce.id)===P?G({...M,header:{...M.header,data:te}}):((ue=M.footer)==null?void 0:ue.id)===P&&G({...M,footer:{...M.footer,data:te}});else if(x){const ve=x.sections.map(Ce=>Ce.id===P?{...Ce,data:te}:Ce);S({...x,sections:ve})}},[x,M]),it=b.useCallback(async()=>{const P=document.querySelector("iframe");if(!(P!=null&&P.contentWindow))return;const z=crypto.randomUUID();await new Promise(Y=>{var ue;let te=!1;const ce=ve=>{var Ce,Ee;ve.origin===window.location.origin&&((Ce=ve.data)==null?void 0:Ce.type)===xe.INLINE_FLUSHED&&((Ee=ve.data)==null?void 0:Ee.requestId)===z&&(te=!0,window.removeEventListener("message",ce),Y())};window.addEventListener("message",ce),(ue=P.contentWindow)==null||ue.postMessage({type:xe.REQUEST_INLINE_FLUSH,requestId:z},"*"),window.setTimeout(()=>{te||(window.removeEventListener("message",ce),Y())},400)})},[]),Tt=b.useCallback(async(P,z)=>{var ue;if(!f)throw new Error("saveToFile is not configured for this tenant.");const Y=It({pages:{[v]:P},siteConfig:z,themeConfig:o,menuConfig:n,refDocuments:i}),te=(ue=Y.siteConfig.header)==null?void 0:ue.data,ce={page:P,site:z,menu:{main:Ei(te,n.main)},theme:Y.themeConfig};await f(ce,v),j(!1),E(!0),typeof window<"u"&&window.setTimeout(()=>E(!1),2500)},[f,v,o,n,i]),Wr=b.useCallback(async P=>{var Pe,Le;if(!f)throw new Error("WebMCP requires saveToFile persistence in Studio mode.");if(!ji(P)||typeof P.sectionId!="string")throw new Error("WebMCP mutation requires a sectionId.");const z=P,Y=typeof z.slug=="string"?Fr(z.slug):v;if(Y!==v)throw new Error(`WebMCP slug mismatch. Active Studio slug is "${v}", received "${Y}".`);await it();const te=ee.current,ce=W.current;if(!te)throw new Error("Studio draft is not ready yet.");const ue=z.scope==="global"?"global":"local";let ve=te,Ce=ce,Ee=z.sectionType;if(ue==="global"){const he=((Pe=ce.header)==null?void 0:Pe.id)===z.sectionId?ce.header:((Le=ce.footer)==null?void 0:Le.id)===z.sectionId?ce.footer:null;if(!he)throw new Error(`Global section "${z.sectionId}" was not found.`);if(!Ee)Ee=he.type;else if(he.type!==Ee)throw new Error(`Section "${z.sectionId}" is type "${he.type}", not "${Ee}".`);const $e=t[Ee];if(!$e||typeof $e.parse!="function")throw new Error(`Missing schema for section type "${Ee}".`);const Fe=ji(he.data)?he.data:{},_e=Si(Fe,z),Ge=$e.parse(_e),Be={...he,data:Ge};Ce={...ce,...he.type==="header"?{header:Be}:{footer:Be}},W.current=Ce,G(Ce)}else{const he=te.sections.find(Be=>Be.id===z.sectionId);if(!he)throw new Error(`Local section "${z.sectionId}" was not found in page "${v}".`);if(!Ee)Ee=he.type;else if(he.type!==Ee)throw new Error(`Section "${z.sectionId}" is type "${he.type}", not "${Ee}".`);const $e=t[Ee];if(!$e||typeof $e.parse!="function")throw new Error(`Missing schema for section type "${Ee}".`);const Fe=ji(he.data)?he.data:{},_e=Si(Fe,z),Ge=$e.parse(_e);ve={...te,sections:te.sections.map(Be=>Be.id===z.sectionId?{...Be,data:Ge}:Be)},ee.current=ve,S(ve)}return F({id:z.sectionId,type:Ee,scope:ue}),A(Array.isArray(z.itemPath)?z.itemPath:null),j(!0),await Tt(ve,Ce),{content:[{type:"text",text:JSON.stringify({ok:!0,slug:v,sectionId:z.sectionId,sectionType:Ee,scope:ue})}],isError:!1}},[f,v,it,t,Tt]);async function _(P,z){if(P!=="update-section")throw new Error(`Unknown WebMCP tool "${P}". Expected "update-section".`);return Wr(z)}const Q=async()=>{var ue;if(!f)return;await it();const P=ee.current,z=W.current;if(!P)return;const Y=It({pages:{[v]:P},siteConfig:z,themeConfig:o,menuConfig:n,refDocuments:i}),te=(ue=Y.siteConfig.header)==null?void 0:ue.data,ce={page:P,site:z,menu:{main:Ei(te,n.main)},theme:Y.themeConfig};f(ce,v).then(()=>{j(!1),E(!0),typeof window<"u"&&window.setTimeout(()=>E(!1),2500)}).catch(ve=>{console.error("[JsonPages] saveToFile failed",ve);const Ce=ve instanceof Error?ve.message:String(ve);alert(`Save to file failed: ${Ce}`)})},ie=async()=>{var ue;if(!h)return;await it();const P=ee.current,z=W.current;if(!P)return;const Y=It({pages:{[v]:P},siteConfig:z,themeConfig:o,menuConfig:n,refDocuments:i}),te=(ue=Y.siteConfig.header)==null?void 0:ue.data,ce={page:P,site:z,menu:{main:Ei(te,n.main)},theme:Y.themeConfig};L(!0),h(ce,v).then(()=>{j(!1),R(!0),typeof window<"u"&&window.setTimeout(()=>R(!1),2500)}).catch(ve=>{console.error("[JsonPages] hotSave failed",ve);const Ce=ve instanceof Error?ve.message:String(ve);alert(`Hot save failed: ${Ce}`)}).finally(()=>{L(!1)})},fe=P=>{var te;if(!x)return;const z=((te=l==null?void 0:l.getDefaultSectionData)==null?void 0:te.call(l,P))??{},Y={id:crypto.randomUUID(),type:P,data:z,settings:void 0};S({...x,sections:[...x.sections,Y]}),j(!0),F({id:Y.id,type:P,scope:"local"})};if(b.useEffect(()=>{var te,ce;const P=J??x,z=typeof((te=P==null?void 0:P.meta)==null?void 0:te.title)=="string"?P.meta.title:v,Y=typeof((ce=P==null?void 0:P.meta)==null?void 0:ce.description)=="string"?P.meta.description:"";to("mcp-manifest",Ac(v)),to("olon-contract",zc(v)),Tc(z,Y,`/admin${v==="home"?"":`/${v}`}`)},[x,J,v]),!x)return c.jsx("div",{children:"Loading Studio..."});const De=(B==null?void 0:B.scope)==="global"?{sections:[O.siteConfig.header,O.siteConfig.footer].filter(P=>P!=null)}:J??x,ke=[...O.siteConfig.header?[O.siteConfig.header]:[],...((je=J??x)==null?void 0:je.sections)??[],...O.siteConfig.footer?[O.siteConfig.footer]:[]];return c.jsx(on,{mode:"admin",tenantCss:s,adminCss:a,children:c.jsx(Xr,{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(gc,{draft:J??x,globalDraft:O.siteConfig,menuConfig:O.menuConfig,themeConfig:O.themeConfig,slug:v,selectedId:B==null?void 0:B.id,scrollToSectionId:T,onScrollRequested:Je})}),c.jsxs("div",{className:"flex shrink-0 relative h-full z-10",style:{width:ge,minWidth:ne,maxWidth:Z},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:we}),c.jsx(mc,{selectedSection:B,pageData:De,allSectionsData:ke,onUpdate:Ke,onUpdateSection:mt,onClose:()=>{F(null),A(null)},expandedItemPath:U,onReorderSection:x?(P,z)=>Ie(P,z,x):void 0,allLayers:be,activeSectionId:X,onRequestScrollToSection:Nt,onDeleteSection:x?Ve:void 0,onAddSection:d.length>0?()=>K(!0):void 0,hasChanges:C,onSaveToFile:f!=null?Q:void 0,saveSuccessFeedback:N,onHotSave:h!=null?ie:void 0,hotSaveSuccessFeedback:D,hotSaveInProgress:I,showLegacySave:p,showHotSave:w,onResetToFile:ze,pageSlugs:k,currentSlug:v,onPageChange:k.length>1?P=>{const z=Fr(P);y(z==="home"?"/admin":`/admin/${z}`)}:void 0})]})]}),c.jsx(wc,{open:q,onClose:()=>K(!1),sectionTypes:d,sectionTypeLabels:l==null?void 0:l.sectionTypeLabels,onSelect:fe})]})})})},Ic=({tenantCss:e,adminCss:t})=>c.jsx(on,{mode:"tenant",tenantCss:e,adminCss:t,children:c.jsx(xc,{})});function C0({config:e}){var k,x,S,C,j;const{registry:t={},schemas:r={},pages:n={},siteConfig:o,themeConfig:i,menuConfig:s,refDocuments:a,themeCss:l,addSection:d,NotFoundComponent:u=yc}=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:k0,m=b.useMemo(()=>It({pages:n,siteConfig:o,themeConfig:i,menuConfig:s,refDocuments:a}),[n,o,i,s,a]),[v,y]=b.useState(!1);return b.useEffect(()=>{var N,E;try{(N=m.themeConfig)!=null&&N.tokens&&Qn.setTheme(m.themeConfig)}catch(D){console.warn("[JsonPages] setTheme failed",D)}(E=e.webmcp)!=null&&E.enabled&&eo(),y(!0)},[m.themeConfig,(j=e.webmcp)==null?void 0:j.enabled]),v?c.jsx(S0,{children:c.jsx(Zi,{config:{registry:t,schemas:r,tenantId:e.tenantId??"default",assets:e.assets,overlayDisabledSectionTypes:e.overlayDisabledSectionTypes},children:c.jsx(Ze.BrowserRouter,{children:c.jsxs(Ze.Routes,{children:[c.jsx(Ze.Route,{path:"/",element:c.jsx(Pc,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:m.themeConfig,refDocuments:a,tenantCss:p,adminCss:w,NotFoundComponent:u})}),c.jsx(Ze.Route,{path:"/*",element:c.jsx(Pc,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:m.themeConfig,refDocuments:a,tenantCss:p,adminCss:w,NotFoundComponent:u})}),c.jsx(Ze.Route,{path:"/admin",element:c.jsx(Oc,{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(Ze.Route,{path:"/admin/*",element:c.jsx(Oc,{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(Ze.Route,{path:"/admin/preview",element:c.jsx(Ic,{tenantCss:p,adminCss:w})}),c.jsx(Ze.Route,{path:"/admin/preview/*",element:c.jsx(Ic,{tenantCss:p,adminCss:w})}),c.jsx(Ze.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..."})}le.AddSectionLibrary=wc,le.AdminSidebar=mc,le.ConfigProvider=Zi,le.DefaultNotFound=yc,le.FormFactory=Ir,le.InputWidgets=ir,le.JsonPagesEngine=C0,le.PageRenderer=fo,le.PreviewEntry=xc,le.STUDIO_EVENTS=xe,le.SectionRenderer=hr,le.StudioProvider=Xr,le.StudioStage=gc,le.ThemeLoader=on,le.applyValueAtSelectionPath=ki,le.buildWebMcpToolName=yi,le.cn=oe,le.createWebMcpToolInputSchema=Cc,le.ensureWebMcpRuntime=eo,le.registerWebMcpTool=jc,le.resolveAssetUrl=Ul,le.resolveHeaderMenuItems=rn,le.resolveRuntimeConfig=It,le.resolveSectionMenuItems=nn,le.resolveWebMcpMutationData=Si,le.shouldRenderSiteGlobalHeader=Ai,le.themeManager=Qn,le.useConfig=pr,le.useStudio=es,Object.defineProperty(le,Symbol.toStringTag,{value:"Module"})}));
|