@olonjs/core 1.0.98 → 1.0.99
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 +7 -3
- package/dist/olonjs-core.js +2708 -2672
- package/dist/olonjs-core.umd.cjs +44 -44
- package/package.json +1 -1
package/dist/olonjs-core.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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={};/**
|
|
1
|
+
(function(ae,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("react-router-dom"),require("zod"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-router-dom","zod","react-dom"],g):(ae=typeof globalThis<"u"?globalThis:ae||self,g(ae.OlonJsCore={},ae.React,ae.ReactRouterDOM,ae.z,ae.ReactDOM))})(this,(function(ae,g,Je,Te,gt){"use strict";function zi(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const b=zi(g),Kr=zi(gt);function Pi(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 Oi(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=Oi(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Mc(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Oi(e))&&(n&&(n+=" "),n+=t);return n}const Rc=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},Lc=(e,t)=>({classGroupId:e,validator:t}),Ii=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Gr="-",Di=[],$c="arbitrary..",Fc=e=>{const t=Uc(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Wc(s);const a=s.split(Gr),l=a[0]===""&&a.length>1?1:0;return _i(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=n[s],d=r[s];return l?d?Rc(d,l):l:d||Di}return r[s]||Di}}},_i=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],i=r.nextPart.get(o);if(i){const d=_i(e,t+1,i);if(d)return d}const s=r.validators;if(s===null)return;const a=t===0?e.join(Gr):e.slice(t).join(Gr),l=s.length;for(let d=0;d<l;d++){const u=s[d];if(u.validator(a))return u.classGroupId}},Wc=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?$c+n:void 0})(),Uc=e=>{const{theme:t,classGroups:r}=e;return Bc(r,t)},Bc=(e,t)=>{const r=Ii();for(const n in e){const o=e[n];oo(o,r,n,t)}return r},oo=(e,t,r,n)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];Hc(s,t,r,n)}},Hc=(e,t,r,n)=>{if(typeof e=="string"){Vc(e,t,r);return}if(typeof e=="function"){Kc(e,t,r,n);return}Gc(e,t,r,n)},Vc=(e,t,r)=>{const n=e===""?t:Mi(t,e);n.classGroupId=r},Kc=(e,t,r,n)=>{if(Yc(e)){oo(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Lc(r,e))},Gc=(e,t,r,n)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];oo(l,Mi(t,a),r,n)}},Mi=(e,t)=>{let r=e;const n=t.split(Gr),o=n.length;for(let i=0;i<o;i++){const s=n[i];let a=r.nextPart.get(s);a||(a=Ii(),r.nextPart.set(s,a)),r=a}return r},Yc=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,qc=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(i,s)=>{r[i]=s,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(i){let s=r[i];if(s!==void 0)return s;if((s=n[i])!==void 0)return o(i,s),s},set(i,s){i in r?r[i]=s:o(i,s)}}},io="!",Ri=":",Xc=[],Li=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),Jc=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const i=[];let s=0,a=0,l=0,d;const u=o.length;for(let m=0;m<u;m++){const v=o[m];if(s===0&&a===0){if(v===Ri){i.push(o.slice(l,m)),l=m+1;continue}if(v==="/"){d=m;continue}}v==="["?s++:v==="]"?s--:v==="("?a++:v===")"&&a--}const f=i.length===0?o:o.slice(l);let h=f,p=!1;f.endsWith(io)?(h=f.slice(0,-1),p=!0):f.startsWith(io)&&(h=f.slice(1),p=!0);const w=d&&d>l?d-l:void 0;return Li(i,p,h,w)};if(t){const o=t+Ri,i=n;n=s=>s.startsWith(o)?i(s.slice(o.length)):Li(Xc,!1,s,void 0,!0)}if(r){const o=n;n=i=>r({className:i,parseClassName:o})}return n},Zc=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let o=[];for(let i=0;i<r.length;i++){const s=r[i],a=s[0]==="[",l=t.has(s);a||l?(o.length>0&&(o.sort(),n.push(...o),o=[]),n.push(s)):o.push(s)}return o.length>0&&(o.sort(),n.push(...o)),n}},Qc=e=>({cache:qc(e.cacheSize),parseClassName:Jc(e),sortModifiers:Zc(e),...Fc(e)}),ed=/\s+/,td=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(ed);let l="";for(let d=a.length-1;d>=0;d-=1){const u=a[d],{isExternal:f,modifiers:h,hasImportantModifier:p,baseClassName:w,maybePostfixModifierPosition:m}=r(u);if(f){l=u+(l.length>0?" "+l:l);continue}let v=!!m,y=n(v?w.substring(0,m):w);if(!y){if(!v){l=u+(l.length>0?" "+l:l);continue}if(y=n(w),!y){l=u+(l.length>0?" "+l:l);continue}v=!1}const k=h.length===0?"":h.length===1?h[0]:i(h).join(":"),x=p?k+io:k,S=x+y;if(s.indexOf(S)>-1)continue;s.push(S);const C=o(y,v);for(let j=0;j<C.length;++j){const N=C[j];s.push(x+N)}l=u+(l.length>0?" "+l:l)}return l},rd=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=$i(r))&&(o&&(o+=" "),o+=n);return o},$i=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=$i(e[n]))&&(r&&(r+=" "),r+=t);return r},nd=(e,...t)=>{let r,n,o,i;const s=l=>{const d=t.reduce((u,f)=>f(u),e());return r=Qc(d),n=r.cache.get,o=r.cache.set,i=a,a(l)},a=l=>{const d=n(l);if(d)return d;const u=td(l,r);return o(l,u),u};return i=s,(...l)=>i(rd(...l))},od=[],Ae=e=>{const t=r=>r[e]||od;return t.isThemeGetter=!0,t},Fi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Wi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,id=/^\d+\/\d+$/,sd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ad=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ld=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,cd=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$t=e=>id.test(e),le=e=>!!e&&!Number.isNaN(Number(e)),bt=e=>!!e&&Number.isInteger(Number(e)),so=e=>e.endsWith("%")&&le(e.slice(0,-1)),ut=e=>sd.test(e),ud=()=>!0,fd=e=>ad.test(e)&&!ld.test(e),Ui=()=>!1,pd=e=>cd.test(e),hd=e=>dd.test(e),md=e=>!H(e)&&!V(e),gd=e=>Ft(e,Gi,Ui),H=e=>Fi.test(e),zt=e=>Ft(e,Yi,fd),ao=e=>Ft(e,yd,le),Bi=e=>Ft(e,Vi,Ui),bd=e=>Ft(e,Ki,hd),Yr=e=>Ft(e,qi,pd),V=e=>Wi.test(e),dr=e=>Wt(e,Yi),vd=e=>Wt(e,kd),Hi=e=>Wt(e,Vi),xd=e=>Wt(e,Gi),wd=e=>Wt(e,Ki),qr=e=>Wt(e,qi,!0),Ft=(e,t,r)=>{const n=Fi.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Wt=(e,t,r=!1)=>{const n=Wi.exec(e);return n?n[1]?t(n[1]):r:!1},Vi=e=>e==="position"||e==="percentage",Ki=e=>e==="image"||e==="url",Gi=e=>e==="length"||e==="size"||e==="bg-size",Yi=e=>e==="length",yd=e=>e==="number",kd=e=>e==="family-name",qi=e=>e==="shadow",Sd=nd(()=>{const e=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(),V,H],j=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],E=()=>[V,H,l],D=()=>[$t,"full","auto",...E()],R=()=>[bt,"none","subgrid",V,H],I=()=>["auto",{span:["full",bt,V,H]},bt,V,H],L=()=>[bt,"auto",V,H],_=()=>["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()],z=()=>[e,V,H],X=()=>[...S(),Hi,Bi,{position:[V,H]}],re=()=>["no-repeat",{repeat:["","x","y","space","round"]}],T=()=>["auto","cover","contain",xd,gd,{size:[V,H]}],$=()=>[so,dr,zt],Y=()=>["","none","full",d,V,H],K=()=>["",le,dr,zt],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"],P=()=>[le,so,Hi,Bi],J=()=>["","none",w,V,H],ee=()=>["none",le,V,H],W=()=>["none",le,V,H],ne=()=>[le,V,H],te=()=>[$t,"full",...E()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ut],breakpoint:[ut],color:[ud],container:[ut],"drop-shadow":[ut],ease:["in","out","in-out"],font:[md],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ut],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ut],shadow:[ut],spacing:["px",le],text:[ut],"text-shadow":[ut],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",$t,H,V,v]}],container:["container"],columns:[{columns:[le,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:[bt,"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:[le,$t,"auto","initial","none",H]}],grow:[{grow:["",le,V,H]}],shrink:[{shrink:["",le,V,H]}],order:[{order:[bt,"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":_()}],"auto-rows":[{"auto-rows":_()}],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,zt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,V,ao]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",so,H]}],"font-family":[{font:[vd,H,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,V,H]}],"line-clamp":[{"line-clamp":[le,"none",V,ao]}],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:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[le,"from-font","auto",V,zt]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[le,"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"]},bt,V,H],radial:["",V,H],conic:[bt,V,H]},wd,bd]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border: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:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[le,V,H]}],"outline-w":[{outline:["",le,dr,zt]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",u,qr,Yr]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",f,qr,Yr]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[le,zt]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",h,qr,Yr]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[le,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":[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":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"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":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"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":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"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":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"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":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"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":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"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":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[V,H]}],"mask-image-radial-from-pos":[{"mask-radial-from":P()}],"mask-image-radial-to-pos":[{"mask-radial-to":P()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"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":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"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:[le,V,H]}],contrast:[{contrast:[le,V,H]}],"drop-shadow":[{"drop-shadow":["","none",p,qr,Yr]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",le,V,H]}],"hue-rotate":[{"hue-rotate":[le,V,H]}],invert:[{invert:["",le,V,H]}],saturate:[{saturate:[le,V,H]}],sepia:[{sepia:["",le,V,H]}],"backdrop-filter":[{"backdrop-filter":["","none",V,H]}],"backdrop-blur":[{"backdrop-blur":J()}],"backdrop-brightness":[{"backdrop-brightness":[le,V,H]}],"backdrop-contrast":[{"backdrop-contrast":[le,V,H]}],"backdrop-grayscale":[{"backdrop-grayscale":["",le,V,H]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[le,V,H]}],"backdrop-invert":[{"backdrop-invert":["",le,V,H]}],"backdrop-opacity":[{"backdrop-opacity":[le,V,H]}],"backdrop-saturate":[{"backdrop-saturate":[le,V,H]}],"backdrop-sepia":[{"backdrop-sepia":["",le,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:[le,"initial",V,H]}],ease:[{ease:["linear","initial",y,V,H]}],delay:[{delay:[le,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:te()}],"translate-x":[{"translate-x":te()}],"translate-y":[{"translate-y":te()}],"translate-z":[{"translate-z":te()}],"translate-none":["translate-none"],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"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",...z()]}],"stroke-w":[{stroke:[le,dr,zt,ao]}],stroke:[{stroke:["none",...z()]}],"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 Sd(Mc(e))}var Xr={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
|
|
9
|
+
*/var Xi;function Cd(){if(Xi)return ur;Xi=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,162 +14,162 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var Ji;function Ed(){return Ji||(Ji=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 Y=$.error,K=typeof Symbol=="function"&&Symbol.toStringTag&&T[Symbol.toStringTag]||T.constructor.name||"Object";return Y.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(_.call(T,"key")){var $=Object.getOwnPropertyDescriptor(T,"key").get;if($&&$.isReactWarning)return!1}return T.key!==void 0}function a(T,$){function Y(){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)",$))}Y.isReactWarning=!0,Object.defineProperty(T,"key",{get:Y,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,$,Y,K,ge,se){var P=Y.ref;return T={$$typeof:w,type:T,key:$,props:Y,_owner:K},(P!==void 0?P: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,$,Y,K,ge,se){var P=$.children;if(P!==void 0)if(K)if(G(P)){for(K=0;K<P.length;K++)f(P[K]);Object.freeze&&Object.freeze(P)}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(P);if(_.call($,"key")){P=e(T);var J=Object.keys($).filter(function(W){return W!=="key"});K=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",re[P+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} />`,K,
|
|
22
|
+
<%s key={someKey} {...props} />`,K,P,J,P),re[P+K]=!0)}if(P=null,Y!==void 0&&(r(Y),P=""+Y),s($)&&(r($.key),P=""+$.key),"key"in $){Y={};for(var ee in $)ee!=="key"&&(Y[ee]=$[ee])}else Y=$;return P&&a(Y,typeof T=="function"?T.displayName||T.name||"Unknown":T),d(T,P,Y,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=g,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,_=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={},z=p.react_stack_bottom_frame.bind(p,i)(),X=B(n(i)),re={};fr.Fragment=v,fr.jsx=function(T,$,Y){var K=1e4>L.recentlyCreatedOwnerStacks++;return u(T,$,Y,!1,K?Error("react-stack-top-frame"):z,K?B(n(T)):X)},fr.jsxs=function(T,$,Y){var K=1e4>L.recentlyCreatedOwnerStacks++;return u(T,$,Y,!0,K?Error("react-stack-top-frame"):z,K?B(n(T)):X)}})()),fr}var Zi;function jd(){return Zi||(Zi=1,process.env.NODE_ENV==="production"?Xr.exports=Cd():Xr.exports=Ed()),Xr.exports}var c=jd();const Qi=g.createContext(void 0),es=({config:e,children:t})=>c.jsx(Qi.Provider,{value:{registry:e.registry,schemas:e.schemas,tenantId:e.tenantId,assets:e.assets,overlayDisabledSectionTypes:e.overlayDisabledSectionTypes},children:t});function pr(){const e=g.useContext(Qi);if(e===void 0)throw new Error("useConfig must be used within ConfigProvider");return e}const ts=g.createContext(void 0),Jr=({mode:e,children:t})=>(g.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(ts.Provider,{value:{mode:e},children:t})),rs=()=>{const e=g.useContext(ts);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 Nd=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ns=(...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 Td={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 Ad=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:s,...a},l)=>g.createElement("svg",{ref:l,...Td,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:ns("lucide",o),...a},[...s.map(([d,u])=>g.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 me=(e,t)=>{const r=
|
|
42
|
+
*/const me=(e,t)=>{const r=g.forwardRef(({className:n,...o},i)=>g.createElement(Ad,{ref:i,iconNode:t,className:ns(`lucide-${Nd(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
|
|
47
|
+
*/const zd=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 Pd=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 Od=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 Id=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
|
|
67
|
+
*/const lo=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
|
|
72
|
+
*/const Zr=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 Dd=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
|
|
82
|
+
*/const co=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 _d=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 Md=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 Rd=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
|
|
102
|
+
*/const os=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
|
|
107
|
+
*/const Qr=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
|
|
112
|
+
*/const uo=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
|
|
117
|
+
*/const is=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 Ld=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 $d=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
|
|
132
|
+
*/const fo=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
|
|
137
|
+
*/const ss=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 Fd=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 Wd=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 Ud=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 Bd=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
|
|
162
|
+
*/const en=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 Hd=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
|
|
172
|
+
*/const as=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.
|
|
@@ -179,12 +179,12 @@ React keys must be passed directly to JSX without using spread:
|
|
|
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 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:`
|
|
182
|
+
*/const Vd=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 Kd extends g.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,r){console.error(`[JsonPages] Component Crash [${this.props.type}]:`,t,r)}render(){return this.state.hasError?c.jsxs("div",{className:"p-8 m-4 bg-amber-500/5 border-2 border-dashed border-amber-500/20 rounded-xl flex flex-col items-center text-center gap-3",children:[c.jsx(Hd,{className:"text-amber-500",size:32}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("h4",{className:"text-sm font-bold text-amber-200 uppercase tracking-tight",children:"Component Error"}),c.jsxs("p",{className:"text-xs text-amber-500/70 font-mono",children:["Type: ",this.props.type]})]}),c.jsx("p",{className:"text-xs text-zinc-400 max-w-[280px] leading-relaxed",children:"This section failed to render. Check the console for details or verify the JSON data structure."})]}):this.props.children}}const Gd=({type:e,scope:t,isSelected:r,sectionId:n,sectionIndex:o=0,totalSections:i=0,onReorder:s})=>{const a=typeof o=="number"&&o>0&&s,l=typeof o=="number"&&o<i-1&&s;return c.jsx("div",{"data-jp-section-overlay":!0,"aria-hidden":!0,className: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(co,{size:12,strokeWidth:2.5})}),c.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),l&&s(n,o+2)},disabled:!l,className:"inline-flex items-center justify-center min-w-[18px] min-h-[18px] rounded bg-white/20 hover:bg-white/30 disabled:opacity-30 disabled:pointer-events-none",title:"Move section down","aria-label":"Move section down",children:c.jsx(Zr,{size:12,strokeWidth:2.5})})]}),c.jsx("span",{className:"shrink-0",children:e}),c.jsx("span",{className:"opacity-50 shrink-0",children:"|"}),c.jsx("span",{className:"shrink-0",children:t})]})})},hr=({section:e,menu:t,selectedId:r,reorderable:n,sectionIndex:o,totalSections:i,onReorder:s})=>{var k,x;const{mode:a}=rs(),{registry:l,overlayDisabledSectionTypes:d}=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(Kd,{type:e.type,children:v()})}),u&&!w&&c.jsx(Gd,{type:e.type,scope:p,isSelected:!!f,sectionId:n&&p==="local"?e.id:void 0,sectionIndex:n&&p==="local"?o:void 0,totalSections:n&&p==="local"?i:void 0,onReorder:n&&p==="local"?s:void 0})]})},Yd=e=>{g.useEffect(()=>{document.title=e.title;let t=document.querySelector('meta[name="description"]');t||(t=document.createElement("meta"),t.setAttribute("name","description"),document.head.appendChild(t)),t.setAttribute("content",e.description)},[e.title,e.description])};function mr(e){return typeof e=="object"&&e!==null}function tn(e){if(!mr(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function qd(e){return mr(e)&&typeof e.$ref=="string"&&e.$ref.trim().length>0}function Xd(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function ls(e,t){if(!t||t==="#")return e;const r=t.startsWith("#")?t.slice(1):t;if(!r||r==="/")return e;let n=e;for(const o of r.replace(/^\//,"").split("/")){const i=Xd(o);if(Array.isArray(n)){const s=Number(i);if(!Number.isInteger(s)||s<0||s>=n.length)return;n=n[s];continue}if(!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 Jd(e){const t=Bt(e),r=t.lastIndexOf("/");return r===-1?"":t.slice(0,r)}function Zd(e,t){const r=new Set,n=Bt(e);n&&r.add(n);const o=Jd(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)):tn(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 Qd({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 eu(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=ls(a,i);return l===void 0?null:{value:l,documentPath:s}}for(const s of Zd(n,t)){const a=r.documents.get(s);if(a===void 0)continue;const l=ls(a,i);if(l!==void 0)return{value:l,documentPath:s}}return null}function Pt(e,t,r){if(Array.isArray(e))return e.map(n=>Pt(n,t,r));if(!tn(e))return e;if(qd(e)){const n=`${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,Pt(h,t,r)]));return tn(l)?{...l,...u}:l}const o=eu(e.$ref,t,r);if(!o)return console.warn("[JsonPages] Unresolved $ref",e.$ref),Object.fromEntries(Object.entries(e).map(([l,d])=>[l,Pt(d,t,r)]));r.stack.push(n);const i=Pt(o.value,o.documentPath,r);r.stack.pop(),r.cache.set(n,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,Pt(d,t,r)]));return tn(i)?{...i,...a}:i}return Object.fromEntries(Object.entries(e).map(([n,o])=>[n,Pt(o,t,r)]))}function rn(e,t,r){return Pt(e,t,{documents:r,cache:new Map,stack:[]})}function po(e){return mr(e)?typeof e.label=="string"&&typeof e.href=="string":!1}function tu(e){if(!mr(e))return null;const t=e.links;if(Array.isArray(t)&&t.every(po))return t;const r=e.menu;if(Array.isArray(r)&&r.every(po))return r;const n=e.menuConfig;return Array.isArray(n)&&n.every(po)?n:null}function nn(e,t){const r=tu(e);return r||(Array.isArray(t)?t:[])}function on(e,t){if(e.type==="header")return nn(e.data,t)}function Ot(e){const t=Qd(e);return{pages:Object.fromEntries(Object.entries(e.pages).map(([r,n])=>[r,rn(n,`pages/${r.replace(/^\/+|\/+$/g,"")||"home"}.json`,t)])),siteConfig:rn(e.siteConfig,"config/site.json",t),themeConfig:rn(e.themeConfig,"config/theme.json",t),menuConfig:rn(e.menuConfig,"config/menu.json",t)}}const ru="application/json",ho=({pageConfig:e,siteConfig:t,menuConfig:r,selectedId:n,onReorder:o,scrollToSectionId:i,onActiveSectionChange:s})=>{var y,k;Yd(e.meta);const[a,l]=g.useState(null),d=g.useRef({}),u=g.useRef(s);u.current=s;const f=Pi(e,t),h=x=>{var S;(S=u.current)==null||S.call(u,x)};g.useEffect(()=>{if(!i)return;const x=d.current[i];x&&x.scrollIntoView({behavior:"smooth",block:"center"})},[i]),g.useEffect(()=>{if(!u.current)return;const S=[...f&&t.header?[t.header.id]:[],...e.sections.map(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(ru),{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:on(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:on(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:on(t.header,r.main),selectedId:n})}),c.jsx("main",{className:"flex-1",children:v()}),t.footer!=null&&c.jsx("div",{ref:x=>{d.current[t.footer.id]=x},"data-section-id":t.footer.id,onMouseEnter:()=>h(t.footer.id),children:c.jsx(hr,{section:t.footer,selectedId:n})})]})},sn=({mode:e,tenantCss:t,adminCss:r,children:n})=>(g.useLayoutEffect(()=>{const o=`jp-theme-${e}`,i=e==="tenant"?t:r;if(!document.getElementById(o)&&i){const s=document.createElement("style");s.id=o,s.innerHTML=i,document.head.appendChild(s)}return()=>{const s=document.getElementById(o);s&&s.remove()}},[e,t,r]),c.jsx(c.Fragment,{children:n}));function nu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return g.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const an=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ht(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function mo(e){return"nodeType"in e}function Fe(e){var t,r;return e?Ht(e)?e:mo(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function go(e){const{Document:t}=Fe(e);return e instanceof t}function vr(e){return Ht(e)?!1:e instanceof Fe(e).HTMLElement}function cs(e){return e instanceof Fe(e).SVGElement}function Vt(e){return e?Ht(e)?e.document:mo(e)?go(e)?e:vr(e)||cs(e)?e.ownerDocument:document:document:document}const Qe=an?g.useLayoutEffect:g.useEffect;function ln(e){const t=g.useRef(e);return Qe(()=>{t.current=e}),g.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function ou(){const e=g.useRef(null),t=g.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=g.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function xr(e,t){t===void 0&&(t=[e]);const r=g.useRef(e);return Qe(()=>{r.current!==e&&(r.current=e)},t),r}function wr(e,t){const r=g.useRef();return g.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function cn(e){const t=ln(e),r=g.useRef(null),n=g.useCallback(o=>{o!==r.current&&(t==null||t(o,r.current)),r.current=o},[]);return[r,n]}function dn(e){const t=g.useRef();return g.useEffect(()=>{t.current=e},[e]),t.current}let bo={};function yr(e,t){return g.useMemo(()=>{if(t)return t;const r=bo[e]==null?0:bo[e]+1;return bo[e]=r,e+"-"+r},[e,t])}function ds(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((i,s)=>{const a=Object.entries(s);for(const[l,d]of a){const u=i[l];u!=null&&(i[l]=u+e*d)}return i},{...t})}}const Kt=ds(1),kr=ds(-1);function iu(e){return"clientX"in e&&"clientY"in e}function un(e){if(!e)return!1;const{KeyboardEvent:t}=Fe(e.target);return t&&e instanceof t}function su(e){if(!e)return!1;const{TouchEvent:t}=Fe(e.target);return t&&e instanceof t}function fn(e){if(su(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return iu(e)?{x:e.clientX,y:e.clientY}:null}const vt=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[vt.Translate.toString(e),vt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),us="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function au(e){return e.matches(us)?e:e.querySelector(us)}const lu={display:"none"};function cu(e){let{id:t,value:r}=e;return g.createElement("div",{id:t,style:lu},r)}function du(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return g.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function uu(){const[e,t]=g.useState("");return{announce:g.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const fs=g.createContext(null);function fu(e){const t=g.useContext(fs);g.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function pu(){const[e]=g.useState(()=>new Set),t=g.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[g.useCallback(n=>{let{type:o,event:i}=n;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const hu={draggable:`
|
|
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
|
-
`},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(
|
|
186
|
+
`},mu={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function gu(e){let{announcements:t=mu,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=hu}=e;const{announce:i,announcement:s}=uu(),a=yr("DndLiveRegion"),[l,d]=g.useState(!1);if(g.useEffect(()=>{d(!0)},[]),fu(g.useMemo(()=>({onDragStart(f){let{active:h}=f;i(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:p}=f;t.onDragMove&&i(t.onDragMove({active:h,over:p}))},onDragOver(f){let{active:h,over:p}=f;i(t.onDragOver({active:h,over:p}))},onDragEnd(f){let{active:h,over:p}=f;i(t.onDragEnd({active:h,over:p}))},onDragCancel(f){let{active:h,over:p}=f;i(t.onDragCancel({active:h,over:p}))}}),[i,t])),!l)return null;const u=g.createElement(g.Fragment,null,g.createElement(cu,{id:n,value:o.draggable}),g.createElement(du,{id:a,announcement:s}));return r?gt.createPortal(u,r):u}var ze;(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"})(ze||(ze={}));function pn(){}function vo(e,t){return g.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function bu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return g.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const et=Object.freeze({x:0,y:0});function ps(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function vu(e,t){const r=fn(e);if(!r)return"0 0";const n={x:(r.x-t.left)/t.width*100,y:(r.y-t.top)/t.height*100};return n.x+"% "+n.y+"%"}function hs(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function xu(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function ms(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function gs(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function bs(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const wu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=bs(t,t.left,t.top),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const d=ps(bs(l),o);i.push({id:a,data:{droppableContainer:s,value:d}})}}return i.sort(hs)},yu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=ms(t),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const d=ms(l),u=o.reduce((h,p,w)=>h+ps(d[w],p),0),f=Number((u/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:f}})}}return i.sort(hs)};function ku(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-n,a=i-r;if(n<o&&r<i){const l=t.width*t.height,d=e.width*e.height,u=s*a,f=u/(l+d-u);return Number(f.toFixed(4))}return 0}const Su=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const i of n){const{id:s}=i,a=r.get(s);if(a){const l=ku(a,t);l>0&&o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(xu)};function Cu(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function vs(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:et}function Eu(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...r})}}const ju=Eu(1);function xs(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Nu(e,t,r){const n=xs(t);if(!n)return e;const{scaleX:o,scaleY:i,x:s,y:a}=n,l=e.left-s-(1-o)*parseFloat(r),d=e.top-a-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),u=o?e.width/o:e.width,f=i?e.height/i:e.height;return{width:u,height:f,top:d,right:l+u,bottom:d+f,left:l}}const Tu={ignoreTransform:!1};function Gt(e,t){t===void 0&&(t=Tu);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:u}=Fe(e).getComputedStyle(e);d&&(r=Nu(r,d,u))}const{top:n,left:o,width:i,height:s,bottom:a,right:l}=r;return{top:n,left:o,width:i,height:s,bottom:a,right:l}}function ws(e){return 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 zu(e,t){return t===void 0&&(t=Fe(e).getComputedStyle(e)),t.position==="fixed"}function Pu(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 hn(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(go(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!vr(o)||cs(o)||r.includes(o))return r;const i=Fe(e).getComputedStyle(o);return o!==e&&Pu(o,i)&&r.push(o),zu(o,i)?r:n(o.parentNode)}return e?n(e):r}function ys(e){const[t]=hn(e,1);return t??null}function xo(e){return!an||!e?null:Ht(e)?e:mo(e)?go(e)||e===Vt(e).scrollingElement?window:vr(e)?e:null:null}function ks(e){return Ht(e)?e.scrollX:e.scrollLeft}function Ss(e){return Ht(e)?e.scrollY:e.scrollTop}function wo(e){return{x:ks(e),y:Ss(e)}}var Ie;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Ie||(Ie={}));function Cs(e){return!an||!e?!1:e===document.scrollingElement}function Es(e){const t={x:0,y:0},r=Cs(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=n.y,a=e.scrollLeft>=n.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:n,minScroll:t}}const Ou={x:.2,y:.2};function Iu(e,t,r,n,o){let{top:i,left:s,right:a,bottom:l}=r;n===void 0&&(n=10),o===void 0&&(o=Ou);const{isTop:d,isBottom:u,isLeft:f,isRight:h}=Es(e),p={x:0,y:0},w={x:0,y:0},m={height:t.height*o.y,width:t.width*o.x};return!d&&i<=t.top+m.height?(p.y=Ie.Backward,w.y=n*Math.abs((t.top+m.height-i)/m.height)):!u&&l>=t.bottom-m.height&&(p.y=Ie.Forward,w.y=n*Math.abs((t.bottom-m.height-l)/m.height)),!h&&a>=t.right-m.width?(p.x=Ie.Forward,w.x=n*Math.abs((t.right-m.width-a)/m.width)):!f&&s<=t.left+m.width&&(p.x=Ie.Backward,w.x=n*Math.abs((t.left+m.width-s)/m.width)),{direction:p,speed:w}}function Du(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:t,left:r,right:n,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:o,width:e.clientWidth,height:e.clientHeight}}function js(e){return e.reduce((t,r)=>Kt(t,wo(r)),et)}function _u(e){return e.reduce((t,r)=>t+ks(r),0)}function Mu(e){return e.reduce((t,r)=>t+Ss(r),0)}function Ns(e,t){if(t===void 0&&(t=Gt),!e)return;const{top:r,left:n,bottom:o,right:i}=t(e);ys(e)&&(o<=0||i<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Ru=[["x",["left","right"],_u],["y",["top","bottom"],Mu]];class yo{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=hn(r),o=js(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of Ru)for(const l of s)Object.defineProperty(this,l,{get:()=>{const d=a(n),u=o[i]-d;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class 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 Lu(e){const{EventTarget:t}=Fe(e);return e instanceof t?e:Vt(e)}function ko(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var Ze;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ze||(Ze={}));function Ts(e){e.preventDefault()}function $u(e){e.stopPropagation()}var 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 As={start:[ue.Space,ue.Enter],cancel:[ue.Esc],end:[ue.Space,ue.Enter,ue.Tab]},Fu=(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 So{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new 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&&Ns(n),r(et)}handleKeyDown(t){if(un(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:i=As,coordinateGetter:s=Fu,scrollBehavior:a="smooth"}=o,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:d}=n.current,u=d?{x:d.left,y:d.top}: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}=Es(m),N=Du(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()}}So.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=As,onActivation:o}=t,{active:i}=r;const{code:s}=e.nativeEvent;if(n.start.includes(s)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function zs(e){return!!(e&&"distance"in e)}function Ps(e){return!!(e&&"delay"in e)}class Co{constructor(t,r,n){var o;n===void 0&&(n=Lu(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:i}=t,{target:s}=i;this.props=t,this.events=r,this.document=Vt(s),this.documentListeners=new Sr(this.document),this.listeners=new Sr(n),this.windowListeners=new Sr(Fe(s)),this.initialCoordinates=(o=fn(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,Ts),this.windowListeners.add(Ze.VisibilityChange,this.handleCancel),this.windowListeners.add(Ze.ContextMenu,Ts),this.documentListeners.add(Ze.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ps(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(zs(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:o}=this.props;o(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ze.Click,$u,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ze.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;const l=(r=fn(t))!=null?r:et,d=kr(o,l);if(!n&&a){if(zs(a)){if(a.tolerance!=null&&ko(d,a.tolerance))return this.handleCancel();if(ko(d,a.distance))return this.handleStart()}if(Ps(a)&&ko(d,a.tolerance))return this.handleCancel();this.handlePending(a,d);return}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===ue.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Wu={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Eo extends Co{constructor(t){const{event:r}=t,n=Vt(r.target);super(t,Wu,n)}}Eo.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const Uu={move:{name:"mousemove"},end:{name:"mouseup"}};var jo;(function(e){e[e.RightClick=2]="RightClick"})(jo||(jo={}));class Bu extends Co{constructor(t){super(t,Uu,Vt(t.event.target))}}Bu.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===jo.RightClick?!1:(n==null||n({event:r}),!0)}}];const No={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Os extends Co{constructor(t){super(t,No)}static setup(){return window.addEventListener(No.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(No.move.name,t)};function t(){}}}Os.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:o}=r;return o.length>1?!1:(n==null||n({event:r}),!0)}}];var Cr;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Cr||(Cr={}));var mn;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(mn||(mn={}));function Hu(e){let{acceleration:t,activator:r=Cr.Pointer,canScroll:n,draggingRect:o,enabled:i,interval:s=5,order:a=mn.TreeOrder,pointerCoordinates:l,scrollableAncestors:d,scrollableAncestorRects:u,delta:f,threshold:h}=e;const p=Ku({delta:f,disabled:!i}),[w,m]=ou(),v=g.useRef({x:0,y:0}),y=g.useRef({x:0,y:0}),k=g.useMemo(()=>{switch(r){case 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=g.useRef(null),S=g.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=g.useMemo(()=>a===mn.TreeOrder?[...d].reverse():d,[a,d]);g.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}=Iu(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 Vu={x:{[Ie.Backward]:!1,[Ie.Forward]:!1},y:{[Ie.Backward]:!1,[Ie.Forward]:!1}};function Ku(e){let{delta:t,disabled:r}=e;const n=dn(t);return wr(o=>{if(r||!n||!o)return Vu;const i={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Ie.Backward]:o.x[Ie.Backward]||i.x===-1,[Ie.Forward]:o.x[Ie.Forward]||i.x===1},y:{[Ie.Backward]:o.y[Ie.Backward]||i.y===-1,[Ie.Forward]:o.y[Ie.Forward]||i.y===1}}},[r,t,n])}function Gu(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return wr(o=>{var i;return t==null?null:(i=n??o)!=null?i:null},[n,t])}function Yu(e,t){return g.useMemo(()=>e.reduce((r,n)=>{const{sensor:o}=n,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,n)}));return[...r,...i]},[]),[e,t])}var Er;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Er||(Er={}));var To;(function(e){e.Optimized="optimized"})(To||(To={}));const Is=new Map;function qu(e,t){let{dragging:r,dependencies:n,config:o}=t;const[i,s]=g.useState(null),{frequency:a,measure:l,strategy:d}=o,u=g.useRef(e),f=v(),h=xr(f),p=g.useCallback(function(y){y===void 0&&(y=[]),!h.current&&s(k=>k===null?y:k.concat(y.filter(x=>!k.includes(x))))},[h]),w=g.useRef(null),m=wr(y=>{if(f&&!r)return Is;if(!y||y===Is||u.current!==e||i!=null){const k=new Map;for(let x of e){if(!x)continue;if(i&&i.length>0&&!i.includes(x.id)&&x.rect.current){k.set(x.id,x.rect.current);continue}const S=x.node.current,C=S?new yo(l(S),S):null;x.rect.current=C,C&&k.set(x.id,C)}return k}return y},[e,i,r,f,l]);return g.useEffect(()=>{u.current=e},[e]),g.useEffect(()=>{f||p()},[r,f]),g.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),g.useEffect(()=>{f||typeof a!="number"||w.current!==null||(w.current=setTimeout(()=>{p(),w.current=null},a))},[a,f,p,...n]),{droppableRects:m,measureDroppableContainers:p,measuringScheduled:i!=null};function v(){switch(d){case Er.Always:return!1;case Er.BeforeDragging:return r;default:return!r}}}function Ao(e,t){return wr(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Xu(e,t){return Ao(e,t)}function Ju(e){let{callback:t,disabled:r}=e;const n=ln(t),o=g.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(n)},[n,r]);return g.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function gn(e){let{callback:t,disabled:r}=e;const n=ln(t),o=g.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(n)},[r]);return g.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Zu(e){return new yo(Gt(e),e)}function Ds(e,t,r){t===void 0&&(t=Zu);const[n,o]=g.useState(null);function i(){o(l=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=l??r)!=null?d:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u})}const s=Ju({callback(l){if(e)for(const d of l){const{type:u,target:f}=d;if(u==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),a=gn({callback:i});return 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 Qu(e){const t=Ao(e);return vs(e,t)}const _s=[];function ef(e){const t=g.useRef(e),r=wr(n=>e?n&&n!==_s&&e&&t.current&&e.parentNode===t.current.parentNode?n:hn(e):_s,[e]);return g.useEffect(()=>{t.current=e},[e]),r}function tf(e){const[t,r]=g.useState(null),n=g.useRef(e),o=g.useCallback(i=>{const s=xo(i.target);s&&r(a=>a?(a.set(s,wo(s)),new Map(a)):null)},[]);return g.useEffect(()=>{const i=n.current;if(e!==i){s(i);const a=e.map(l=>{const d=xo(l);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,wo(d)]):null}).filter(l=>l!=null);r(a.length?new Map(a):null),n.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(l=>{const d=xo(l);d==null||d.removeEventListener("scroll",o)})}},[o,e]),g.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>Kt(i,s),et):js(e):et,[e,t])}function Ms(e,t){t===void 0&&(t=[]);const r=g.useRef(null);return g.useEffect(()=>{r.current=null},t),g.useEffect(()=>{const n=e!==et;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?kr(e,r.current):et}function rf(e){g.useEffect(()=>{if(!an)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function nf(e,t){return g.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:i}=n;return r[o]=s=>{i(s,t)},r},{}),[e,t])}function Rs(e){return g.useMemo(()=>e?Au(e):null,[e])}const Ls=[];function of(e,t){t===void 0&&(t=Gt);const[r]=e,n=Rs(r?Fe(r):null),[o,i]=g.useState(Ls);function s(){i(()=>e.length?e.map(l=>Cs(l)?n:new yo(t(l),l)):Ls)}const a=gn({callback:s});return Qe(()=>{a==null||a.disconnect(),s(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),o}function $s(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return vr(t)?t:e}function sf(e){let{measure:t}=e;const[r,n]=g.useState(null),o=g.useCallback(d=>{for(const{target:u}of d)if(vr(u)){n(f=>{const h=t(u);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),i=gn({callback:o}),s=g.useCallback(d=>{const u=$s(d);i==null||i.disconnect(),u&&(i==null||i.observe(u)),n(u?t(u):null)},[t,i]),[a,l]=cn(s);return g.useMemo(()=>({nodeRef:a,rect:r,setRef:l}),[r,a,l])}const af=[{sensor:Eo,options:{}},{sensor:So,options:{}}],lf={current:{}},bn={draggable:{measure:ws},droppable:{measure:ws,strategy:Er.WhileDragging,frequency:To.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 cf={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:pn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:bn,measureDroppableContainers:pn,windowRect:null,measuringScheduled:!1},Fs={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:pn,draggableNodes:new Map,over:null,measureDroppableContainers:pn},Nr=g.createContext(Fs),Ws=g.createContext(cf);function df(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new jr}}}function uf(e,t){switch(t.type){case ze.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ze.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 ze.DragEnd:case ze.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ze.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 ze.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 ze.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 ff(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=g.useContext(Nr),i=dn(n),s=dn(r==null?void 0:r.id);return g.useEffect(()=>{if(!t&&!n&&i&&s!=null){if(!un(i)||document.activeElement===i.target)return;const a=o.get(s);if(!a)return;const{activatorNode:l,node:d}=a;if(!l.current&&!d.current)return;requestAnimationFrame(()=>{for(const u of[l.current,d.current]){if(!u)continue;const f=au(u);if(f){f.focus();break}}})}},[n,t,o,s,i]),null}function Us(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...n}),r):r}function pf(e){return g.useMemo(()=>({draggable:{...bn.draggable,...e==null?void 0:e.draggable},droppable:{...bn.droppable,...e==null?void 0:e.droppable},dragOverlay:{...bn.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function hf(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const i=g.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;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=vs(u,n);if(s||(f.x=0),a||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=ys(d);h&&h.scrollBy({top:f.y,left:f.x})}},[t,s,a,n,r])}const vn=g.createContext({...et,scaleX:1,scaleY:1});var xt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(xt||(xt={}));const mf=g.memo(function(t){var r,n,o,i;let{id:s,accessibility:a,autoScroll:l=!0,children:d,sensors:u=af,collisionDetection:f=Su,measuring:h,modifiers:p,...w}=t;const m=g.useReducer(uf,void 0,df),[v,y]=m,[k,x]=pu(),[S,C]=g.useState(xt.Uninitialized),j=S===xt.Initialized,{draggable:{active:N,nodes:E,translate:D},droppable:{containers:R}}=v,I=N!=null?E.get(N):null,L=g.useRef({initial:null,translated:null}),_=g.useMemo(()=>{var de;return N!=null?{id:N,data:(de=I==null?void 0:I.data)!=null?de:lf,rect:L}:null},[N,I]),G=g.useRef(null),[B,F]=g.useState(null),[U,z]=g.useState(null),X=xr(w,Object.values(w)),re=yr("DndDescribedBy",s),T=g.useMemo(()=>R.getEnabled(),[R]),$=pf(h),{droppableRects:Y,measureDroppableContainers:K,measuringScheduled:ge}=qu(T,{dragging:j,dependencies:[D.x,D.y],config:$.droppable}),se=Gu(E,N),P=g.useMemo(()=>U?fn(U):null,[U]),J=je(),ee=Xu(se,$.draggable.measure);hf({activeNode:N!=null?E.get(N):null,config:J.layoutShiftCompensation,initialRect:ee,measure:$.draggable.measure});const W=Ds(se,$.draggable.measure,ee),ne=Ds(se?se.parentElement:null),te=g.useRef({activatorEvent:null,active:null,activeNode:se,collisionRect:null,collisions:null,droppableRects:Y,draggableNodes:E,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),we=R.getNodeFor((r=te.current.over)==null?void 0:r.id),be=sf({measure:$.dragOverlay.measure}),Pe=(n=be.nodeRef.current)!=null?n:se,De=j?(o=be.rect)!=null?o:W:null,Ue=!!(be.nodeRef.current&&be.rect),jt=Qu(Ue?null:W),qe=Rs(Pe?Fe(Pe):null),Be=ef(j?we??se:null),He=of(Be),ht=Us(p,{transform:{x:D.x-jt.x,y:D.y-jt.y,scaleX:1,scaleY:1},activatorEvent:U,active:_,activeNodeRect:W,containerNodeRect:ne,draggingNodeRect:De,over:te.current.over,overlayNodeRect:be.rect,scrollableAncestors:Be,scrollableAncestorRects:He,windowRect:qe}),Xe=P?Kt(P,D):null,Nt=tf(Be),Ur=Ms(Nt),M=Ms(Nt,[W]),Z=Kt(ht,Ur),ie=De?ju(De,ht):null,fe=_&&ie?f({active:_,collisionRect:ie,droppableRects:Y,droppableContainers:T,pointerCoordinates:Xe}):null,_e=gs(fe,"id"),[Se,Oe]=g.useState(null),Lt=Ue?ht:Kt(ht,M),A=Cu(Lt,(i=Se==null?void 0:Se.rect)!=null?i:null,W),O=g.useRef(null),q=g.useCallback((de,Le)=>{let{sensor:$e,options:Ce}=Le;if(G.current==null)return;const Ne=E.get(G.current);if(!Ne)return;const Me=de.nativeEvent,Ve=new $e({active:G.current,activeNode:Ne,event:Me,options:Ce,context:te,onAbort(ve){if(!E.get(ve))return;const{onDragAbort:dt}=X.current,mt={id:ve};dt==null||dt(mt),k({type:"onDragAbort",event:mt})},onPending(ve,Tt,dt,mt){if(!E.get(ve))return;const{onDragPending:Hr}=X.current,At={id:ve,constraint:Tt,initialCoordinates:dt,offset:mt};Hr==null||Hr(At),k({type:"onDragPending",event:At})},onStart(ve){const Tt=G.current;if(Tt==null)return;const dt=E.get(Tt);if(!dt)return;const{onDragStart:mt}=X.current,Br={activatorEvent:Me,active:{id:Tt,data:dt.data,rect:L}};gt.unstable_batchedUpdates(()=>{mt==null||mt(Br),C(xt.Initializing),y({type:ze.DragStart,initialCoordinates:ve,active:Tt}),k({type:"onDragStart",event:Br}),F(O.current),z(Me)})},onMove(ve){y({type:ze.DragMove,coordinates:ve})},onEnd:ct(ze.DragEnd),onCancel:ct(ze.DragCancel)});O.current=Ve;function ct(ve){return async function(){const{active:dt,collisions:mt,over:Br,scrollAdjustedTranslate:Hr}=te.current;let At=null;if(dt&&Hr){const{cancelDrop:Vr}=X.current;At={activatorEvent:Me,active:dt,collisions:mt,delta:Hr,over:Br},ve===ze.DragEnd&&typeof Vr=="function"&&await Promise.resolve(Vr(At))&&(ve=ze.DragCancel)}G.current=null,gt.unstable_batchedUpdates(()=>{y({type:ve}),C(xt.Uninitialized),Oe(null),F(null),z(null),O.current=null;const Vr=ve===ze.DragEnd?"onDragEnd":"onDragCancel";if(At){const Ai=X.current[Vr];Ai==null||Ai(At),k({type:Vr,event:At})}})}}},[E]),Q=g.useCallback((de,Le)=>($e,Ce)=>{const Ne=$e.nativeEvent,Me=E.get(Ce);if(G.current!==null||!Me||Ne.dndKit||Ne.defaultPrevented)return;const Ve={active:Me};de($e,Le.options,Ve)===!0&&(Ne.dndKit={capturedBy:Le.sensor},G.current=Ce,q($e,Le))},[E,q]),ce=Yu(u,Q);rf(u),Qe(()=>{W&&S===xt.Initializing&&C(xt.Initialized)},[W,S]),g.useEffect(()=>{const{onDragMove:de}=X.current,{active:Le,activatorEvent:$e,collisions:Ce,over:Ne}=te.current;if(!Le||!$e)return;const Me={active:Le,activatorEvent:$e,collisions:Ce,delta:{x:Z.x,y:Z.y},over:Ne};gt.unstable_batchedUpdates(()=>{de==null||de(Me),k({type:"onDragMove",event:Me})})},[Z.x,Z.y]),g.useEffect(()=>{const{active:de,activatorEvent:Le,collisions:$e,droppableContainers:Ce,scrollAdjustedTranslate:Ne}=te.current;if(!de||G.current==null||!Le||!Ne)return;const{onDragOver:Me}=X.current,Ve=Ce.get(_e),ct=Ve&&Ve.rect.current?{id:Ve.id,rect:Ve.rect.current,data:Ve.data,disabled:Ve.disabled}:null,ve={active:de,activatorEvent:Le,collisions:$e,delta:{x:Ne.x,y:Ne.y},over:ct};gt.unstable_batchedUpdates(()=>{Oe(ct),Me==null||Me(ve),k({type:"onDragOver",event:ve})})},[_e]),Qe(()=>{te.current={activatorEvent:U,active:_,activeNode:se,collisionRect:ie,collisions:fe,droppableRects:Y,draggableNodes:E,draggingNode:Pe,draggingNodeRect:De,droppableContainers:R,over:Se,scrollableAncestors:Be,scrollAdjustedTranslate:Z},L.current={initial:De,translated:ie}},[_,se,fe,ie,E,Pe,De,Y,R,Se,Be,Z]),Hu({...J,delta:D,draggingRect:ie,pointerCoordinates:Xe,scrollableAncestors:Be,scrollableAncestorRects:He});const pe=g.useMemo(()=>({active:_,activeNode:se,activeNodeRect:W,activatorEvent:U,collisions:fe,containerNodeRect:ne,dragOverlay:be,draggableNodes:E,droppableContainers:R,droppableRects:Y,over:Se,measureDroppableContainers:K,scrollableAncestors:Be,scrollableAncestorRects:He,measuringConfiguration:$,measuringScheduled:ge,windowRect:qe}),[_,se,W,U,fe,ne,be,E,R,Y,Se,K,Be,He,$,ge,qe]),ye=g.useMemo(()=>({activatorEvent:U,activators:ce,active:_,activeNodeRect:W,ariaDescribedById:{draggable:re},dispatch:y,draggableNodes:E,over:Se,measureDroppableContainers:K}),[U,ce,_,W,y,re,E,Se,K]);return g.createElement(fs.Provider,{value:x},g.createElement(Nr.Provider,{value:ye},g.createElement(Ws.Provider,{value:pe},g.createElement(vn.Provider,{value:A},d)),g.createElement(ff,{disabled:(a==null?void 0:a.restoreFocus)===!1})),g.createElement(gu,{...a,hiddenTextDescribedById:re}));function je(){const de=(B==null?void 0:B.autoScrollEnabled)===!1,Le=typeof l=="object"?l.enabled===!1:l===!1,$e=j&&!de&&!Le;return typeof l=="object"?{...l,enabled:$e}:{enabled:$e}}}),gf=g.createContext(null),Bs="button",bf="Draggable";function vf(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const i=yr(bf),{activators:s,activatorEvent:a,active:l,activeNodeRect:d,ariaDescribedById:u,draggableNodes:f,over:h}=g.useContext(Nr),{role:p=Bs,roleDescription:w="draggable",tabIndex:m=0}=o??{},v=(l==null?void 0:l.id)===t,y=g.useContext(v?vn:gf),[k,x]=cn(),[S,C]=cn(),j=nf(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=g.useMemo(()=>({role:p,tabIndex:m,"aria-disabled":n,"aria-pressed":v&&p===Bs?!0:void 0,"aria-roledescription":w,"aria-describedby":u.draggable}),[n,p,m,v,w,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:d,attributes:E,isDragging:v,listeners:n?void 0:j,node:k,over:h,setNodeRef:x,setActivatorNodeRef:C,transform:y}}function Hs(){return g.useContext(Ws)}const xf="Droppable",wf={timeout:25};function yf(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const i=yr(xf),{active:s,dispatch:a,over:l,measureDroppableContainers:d}=g.useContext(Nr),u=g.useRef({disabled:r}),f=g.useRef(!1),h=g.useRef(null),p=g.useRef(null),{disabled:w,updateMeasurementsFor:m,timeout:v}={...wf,...o},y=xr(m??n),k=g.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{d(Array.isArray(y.current)?y.current:[y.current]),p.current=null},v)},[v]),x=gn({callback:k,disabled:w||!s}),S=g.useCallback((E,D)=>{x&&(D&&(x.unobserve(D),f.current=!1),E&&x.observe(E))},[x]),[C,j]=cn(S),N=xr(t);return g.useEffect(()=>{!x||!C.current||(x.disconnect(),f.current=!1,x.observe(C.current))},[C,x]),g.useEffect(()=>(a({type:ze.RegisterDroppable,element:{id:n,key:i,disabled:r,node:C,rect:h,data:N}}),()=>a({type:ze.UnregisterDroppable,key:i,id:n})),[n]),g.useEffect(()=>{r!==u.current.disabled&&(a({type:ze.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 kf(e){let{animation:t,children:r}=e;const[n,o]=g.useState(null),[i,s]=g.useState(null),a=dn(r);return!r&&!n&&a&&o(a),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]),g.createElement(g.Fragment,null,r,n?g.cloneElement(n,{ref:s}):null)}const Sf={x:0,y:0,scaleX:1,scaleY:1};function Cf(e){let{children:t}=e;return g.createElement(Nr.Provider,{value:Fs},g.createElement(vn.Provider,{value:Sf},t))}const Ef={position:"fixed",touchAction:"none"},jf=e=>un(e)?"transform 250ms ease":void 0,Nf=g.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:o,children:i,className:s,rect:a,style:l,transform:d,transition:u=jf}=e;if(!a)return null;const f=o?d:{...d,scaleX:1,scaleY:1},h={...Ef,width:a.width,height:a.height,top:a.top,left:a.left,transform:vt.Transform.toString(f),transformOrigin:o&&n?vu(n,a):void 0,transition:typeof u=="function"?u(n):u,...l};return g.createElement(r,{className:s,style:h,ref:t},i)}),Tf={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:vt.Transform.toString(t)},{transform:vt.Transform.toString(r)}]},sideEffects:(e=>t=>{let{active:r,dragOverlay:n}=t;const o={},{styles:i,className:s}=e;if(i!=null&&i.active)for(const[a,l]of Object.entries(i.active))l!==void 0&&(o[a]=r.node.style.getPropertyValue(a),r.node.style.setProperty(a,l));if(i!=null&&i.dragOverlay)for(const[a,l]of Object.entries(i.dragOverlay))l!==void 0&&n.node.style.setProperty(a,l);return s!=null&&s.active&&r.node.classList.add(s.active),s!=null&&s.dragOverlay&&n.node.classList.add(s.dragOverlay),function(){for(const[l,d]of Object.entries(o))r.node.style.setProperty(l,d);s!=null&&s.active&&r.node.classList.remove(s.active)}})({styles:{active:{opacity:"0"}}})};function Af(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:o}=e;return ln((i,s)=>{if(t===null)return;const a=r.get(i);if(!a)return;const l=a.node.current;if(!l)return;const d=$s(s);if(!d)return;const{transform:u}=Fe(s).getComputedStyle(s),f=xs(u);if(!f)return;const h=typeof t=="function"?t:zf(t);return Ns(l,o.draggable.measure),h({active:{id:i,data:a.data,node:l,rect:o.draggable.measure(l)},draggableNodes:r,dragOverlay:{node:s,rect:o.dragOverlay.measure(d)},droppableContainers:n,measuringConfiguration:o,transform:f})})}function zf(e){const{duration:t,easing:r,sideEffects:n,keyframes:o}={...Tf,...e};return i=>{let{active:s,dragOverlay:a,transform:l,...d}=i;if(!t)return;const u={x:a.rect.left-s.rect.left,y:a.rect.top-s.rect.top},f={scaleX:l.scaleX!==1?s.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?s.rect.height*l.scaleY/a.rect.height:1},h={x:l.x-u.x,y:l.y-u.y,...f},p=o({...d,active:s,dragOverlay:a,transform:{initial:l,final:h}}),[w]=p,m=p[p.length-1];if(JSON.stringify(w)===JSON.stringify(m))return;const v=n==null?void 0:n({active:s,dragOverlay:a,...d}),y=a.node.animate(p,{duration:t,easing:r,fill:"forwards"});return new Promise(k=>{y.onfinish=()=>{v==null||v(),k()}})}}let Vs=0;function Pf(e){return g.useMemo(()=>{if(e!=null)return Vs++,Vs},[e])}const Of=g.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:o,transition:i,modifiers:s,wrapperElement:a="div",className:l,zIndex:d=999}=e;const{activatorEvent:u,active:f,activeNodeRect:h,containerNodeRect:p,draggableNodes:w,droppableContainers:m,dragOverlay:v,over:y,measuringConfiguration:k,scrollableAncestors:x,scrollableAncestorRects:S,windowRect:C}=Hs(),j=g.useContext(vn),N=Pf(f==null?void 0:f.id),E=Us(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=Ao(h),R=Af({config:n,draggableNodes:w,droppableContainers:m,measuringConfiguration:k}),I=D?v.setRef:void 0;return g.createElement(Cf,null,g.createElement(kf,{animation:R},f&&N?g.createElement(Nf,{key:N,id:f.id,ref:I,as:a,activatorEvent:u,adjustScale:t,className:l,transition:i,rect:D,style:{zIndex:d,...o},transform:E},r):null))}),If=e=>{let{transform:t}=e;return{...t,x:0}};function Ks(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function Df(e,t){return e.reduce((r,n,o)=>{const i=t.get(n);return i&&(r[o]=i),r},Array(e.length))}function xn(e){return e!==null&&e>=0}function _f(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function Mf(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Gs=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const i=Ks(t,n,r),s=t[o],a=i[o];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},wn={scaleX:1,scaleY:1},Rf=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:o,rects:i,overIndex:s}=e;const a=(t=i[r])!=null?t:n;if(!a)return null;if(o===r){const d=i[s];return d?{x:0,y:r<s?d.top+d.height-(a.top+a.height):d.top-a.top,...wn}:null}const l=Lf(i,o,r);return o>r&&o<=s?{x:0,y:-a.height-l,...wn}:o<r&&o>=s?{x:0,y:a.height+l,...wn}:{x:0,y:0,...wn}};function Lf(e,t,r){const n=e[t],o=e[t-1],i=e[t+1];return n?r<t?o?n.top-(o.top+o.height):i?i.top-(n.top+n.height):0:i?i.top-(n.top+n.height):o?n.top-(o.top+o.height):0:0}const Ys="Sortable",qs=g.createContext({activeIndex:-1,containerId:Ys,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Gs,disabled:{draggable:!1,droppable:!1}});function $f(e){let{children:t,id:r,items:n,strategy:o=Gs,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:d,measureDroppableContainers:u}=Hs(),f=yr(Ys,r),h=a.rect!==null,p=g.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=g.useRef(p),k=!_f(p,y.current),x=v!==-1&&m===-1||k,S=Mf(i);Qe(()=>{k&&w&&u(p)},[k,p,w,u]),g.useEffect(()=>{y.current=p},[p]);const C=g.useMemo(()=>({activeIndex:m,containerId:f,disabled:S,disableTransforms:x,items:p,overIndex:v,useDragOverlay:h,sortedRects:Df(p,l),strategy:o}),[m,f,S.draggable,S.droppable,x,p,v,l,h,o]);return g.createElement(qs.Provider,{value:C},t)}const Ff=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return Ks(r,n,o).indexOf(t)},Wf=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:l,transition:d}=e;return!d||!n||a!==i&&o===s?!1:r?!0:s!==o&&t===l},Uf={duration:200,easing:"ease"},Xs="transform",Bf=vt.Transition.toString({property:Xs,duration:0,easing:"linear"}),Hf={roleDescription:"sortable"};function Vf(e){let{disabled:t,index:r,node:n,rect:o}=e;const[i,s]=g.useState(null),a=g.useRef(r);return 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]),g.useEffect(()=>{i&&s(null)},[i]),i}function Kf(e){let{animateLayoutChanges:t=Wf,attributes:r,disabled:n,data:o,getNewIndex:i=Ff,id:s,strategy:a,resizeObserverConfig:l,transition:d=Uf}=e;const{items:u,containerId:f,activeIndex:h,disabled:p,disableTransforms:w,sortedRects:m,overIndex:v,useDragOverlay:y,strategy:k}=g.useContext(qs),x=Gf(n,p),S=u.indexOf(s),C=g.useMemo(()=>({sortable:{containerId:f,index:S,items:u},...o}),[f,o,S,u]),j=g.useMemo(()=>u.slice(u.indexOf(s)),[u,s]),{rect:N,node:E,isOver:D,setNodeRef:R}=yf({id:s,data:C,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...l}}),{active:I,activatorEvent:L,activeNodeRect:_,attributes:G,setNodeRef:B,listeners:F,isDragging:U,over:z,setActivatorNodeRef:X,transform:re}=vf({id:s,data:C,attributes:{...Hf,...r},disabled:x.draggable}),T=nu(R,B),$=!!I,Y=$&&!w&&xn(h)&&xn(v),K=!y&&U,ge=K&&Y?re:null,P=Y?ge??(a??k)({rects:m,activeNodeRect:_,activeIndex:h,overIndex:v,index:S}):null,J=xn(h)&&xn(v)?i({id:s,items:u,activeIndex:h,overIndex:v}):S,ee=I==null?void 0:I.id,W=g.useRef({activeId:ee,items:u,newIndex:J,containerId:f}),ne=u!==W.current.items,te=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=Vf({disabled:!te,index:S,node:E,rect:N});return g.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]),g.useEffect(()=>{if(ee===W.current.activeId)return;if(ee!=null&&W.current.activeId==null){W.current.activeId=ee;return}const Pe=setTimeout(()=>{W.current.activeId=ee},50);return()=>clearTimeout(Pe)},[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:z,setNodeRef:T,setActivatorNodeRef:X,setDroppableNodeRef:R,setDraggableNodeRef:B,transform:we??P,transition:be()};function be(){if(we||ne&&W.current.newIndex===S)return Bf;if(!(K&&!un(L)||!d)&&($||te))return vt.Transition.toString({...d,property:Xs})}}function Gf(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function yn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Yf=[ue.Down,ue.Right,ue.Up,ue.Left],qf=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:i,over:s,scrollableAncestors:a}}=t;if(Yf.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];i.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const h=o.get(f.id);if(h)switch(e.code){case 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=yu({collisionRect:n,droppableRects:o,droppableContainers:l});let u=gs(d,"id");if(u===(s==null?void 0:s.id)&&d.length>1&&(u=d[1].id),u!=null){const f=i.get(r.id),h=i.get(u),p=h?o.get(h.id):null,w=h==null?void 0:h.node.current;if(w&&p&&f&&h){const v=hn(w).some((j,N)=>a[N]!==j),y=Js(f,h),k=Xf(f,h),x=v||!y?{x:0,y:0}:{x:k?n.width-p.width:0,y:k?n.height-p.height:0},S={x:p.left,y:p.top};return x.x&&x.y?S:kr(S,x)}}}};function Js(e,t){return!yn(e)||!yn(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Xf(e,t){return!yn(e)||!yn(t)||!Js(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function zo({className:e,type:t,...r}){return c.jsx("input",{type:t,className: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 Jf({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 Zf({className:e,checked:t,onCheckedChange:r,...n}){return c.jsx("input",{type:"checkbox",checked:t,onChange:o=>r==null?void 0:r(o.target.checked),className:oe("size-4 rounded border border-zinc-700 bg-zinc-900 text-blue-600 focus:ring-2 focus:ring-blue-600",e),...n})}function It({className:e,...t}){return c.jsx("label",{className:oe("text-sm font-medium leading-none select-none",e),...t})}function Zs(e,[t,r]){return Math.min(r,Math.max(t,e))}function he(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=b.createContext(s),l=r.length;r=[...r,s];const d=f=>{var y;const{scope:h,children:p,...w}=f,m=((y=h==null?void 0:h[e])==null?void 0:y[l])||a,v=b.useMemo(()=>w,Object.values(w));return c.jsx(m.Provider,{value:v,children:p})};d.displayName=i+"Provider";function u(f,h){var m;const p=((m=h==null?void 0:h[e])==null?void 0:m[l])||a,w=b.useContext(p);if(w)return w;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[d,u]}const o=()=>{const i=r.map(s=>b.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return b.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[n,Qf(o,...t)]}function Qf(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((a,{useScope:l,scopeName:d})=>{const f=l(i)[`__scope${d}`];return{...a,...f}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}function Qs(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ea(...e){return t=>{let r=!1;const n=e.map(o=>{const i=Qs(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():Qs(e[o],null)}}}}function Ee(...e){return b.useCallback(ea(...e),e)}function Yt(e){const t=tp(e),r=b.forwardRef((n,o)=>{const{children:i,...s}=n,a=b.Children.toArray(i),l=a.find(np);if(l){const d=l.props.children,u=a.map(f=>f===l?b.Children.count(d)>1?b.Children.only(null):b.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...s,ref:o,children:b.isValidElement(d)?b.cloneElement(d,void 0,u):null})}return c.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var ep=Yt("Slot");function tp(e){const t=b.forwardRef((r,n)=>{const{children:o,...i}=r;if(b.isValidElement(o)){const s=ip(o),a=op(i,o.props);return o.type!==b.Fragment&&(a.ref=n?ea(n,s):s),b.cloneElement(o,a)}return b.Children.count(o)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ta=Symbol("radix.slottable");function rp(e){const t=({children:r})=>c.jsx(c.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=ta,t}function np(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ta}function op(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function ip(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function sp(e){const t=e+"CollectionProvider",[r,n]=Tr(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:v,children:y}=m,k=g.useRef(null),x=g.useRef(new Map).current;return c.jsx(o,{scope:v,itemMap:x,collectionRef:k,children:y})};s.displayName=t;const a=e+"CollectionSlot",l=Yt(a),d=g.forwardRef((m,v)=>{const{scope:y,children:k}=m,x=i(a,y),S=Ee(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=g.forwardRef((m,v)=>{const{scope:y,children:k,...x}=m,S=g.useRef(null),C=Ee(v,S),j=i(u,y);return g.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 g.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 ap=b.createContext(void 0);function lp(e){const t=b.useContext(ap);return e||t||"ltr"}var cp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ke=cp.reduce((e,t)=>{const r=Yt(`Primitive.${t}`),n=b.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function dp(e,t){e&&Kr.flushSync(()=>e.dispatchEvent(t))}function Dt(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function up(e,t=globalThis==null?void 0:globalThis.document){const r=Dt(e);b.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var fp="DismissableLayer",Po="dismissableLayer.update",pp="dismissableLayer.pointerDownOutside",hp="dismissableLayer.focusOutside",ra,na=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),kn=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,d=b.useContext(na),[u,f]=b.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=b.useState({}),w=Ee(t,N=>f(N)),m=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(v),k=u?m.indexOf(u):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,S=k>=y,C=bp(N=>{const 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=vp(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 up(N=>{k===d.layers.size-1&&(n==null||n(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},h),b.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ra=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),oa(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=ra)}},[u,h,r,d]),b.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),oa())},[u,d]),b.useEffect(()=>{const N=()=>p({});return document.addEventListener(Po,N),()=>document.removeEventListener(Po,N)},[]),c.jsx(ke.div,{...l,ref:w,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:he(e.onFocusCapture,j.onFocusCapture),onBlurCapture:he(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:he(e.onPointerDownCapture,C.onPointerDownCapture)})});kn.displayName=fp;var mp="DismissableLayerBranch",gp=b.forwardRef((e,t)=>{const r=b.useContext(na),n=b.useRef(null),o=Ee(t,n);return b.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),c.jsx(ke.div,{...e,ref:o})});gp.displayName=mp;function bp(e,t=globalThis==null?void 0:globalThis.document){const r=Dt(e),n=b.useRef(!1),o=b.useRef(()=>{});return b.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let l=function(){ia(pp,r,d,{discrete:!0})};const d={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function vp(e,t=globalThis==null?void 0:globalThis.document){const r=Dt(e),n=b.useRef(!1);return b.useEffect(()=>{const o=i=>{i.target&&!n.current&&ia(hp,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function oa(){const e=new CustomEvent(Po);document.dispatchEvent(e)}function ia(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?dp(o,i):o.dispatchEvent(i)}var Oo=0;function sa(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??aa()),document.body.insertAdjacentElement("beforeend",e[1]??aa()),Oo++,()=>{Oo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Oo--}},[])}function aa(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Io="focusScope.autoFocusOnMount",Do="focusScope.autoFocusOnUnmount",la={bubbles:!1,cancelable:!0},xp="FocusScope",_o=b.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=b.useState(null),d=Dt(o),u=Dt(i),f=b.useRef(null),h=Ee(t,m=>l(m)),p=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(n){let m=function(x){if(p.paused||!a)return;const S=x.target;a.contains(S)?f.current=S:wt(f.current,{select:!0})},v=function(x){if(p.paused||!a)return;const S=x.relatedTarget;S!==null&&(a.contains(S)||wt(f.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const C of x)C.removedNodes.length>0&&wt(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const k=new MutationObserver(y);return a&&k.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),k.disconnect()}}},[n,a,p.paused]),b.useEffect(()=>{if(a){ua.add(p);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(Io,la);a.addEventListener(Io,d),a.dispatchEvent(y),y.defaultPrevented||(wp(Ep(ca(a)),{select:!0}),document.activeElement===m&&wt(a))}return()=>{a.removeEventListener(Io,d),setTimeout(()=>{const y=new CustomEvent(Do,la);a.addEventListener(Do,u),a.dispatchEvent(y),y.defaultPrevented||wt(m??document.body,{select:!0}),a.removeEventListener(Do,u),ua.remove(p)},0)}}},[a,d,u,p]);const w=b.useCallback(m=>{if(!r&&!n||p.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(v&&y){const k=m.currentTarget,[x,S]=yp(k);x&&S?!m.shiftKey&&y===S?(m.preventDefault(),r&&wt(x,{select:!0})):m.shiftKey&&y===x&&(m.preventDefault(),r&&wt(S,{select:!0})):y===k&&m.preventDefault()}},[r,n,p.paused]);return c.jsx(ke.div,{tabIndex:-1,...s,ref:h,onKeyDown:w})});_o.displayName=xp;function wp(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(wt(n,{select:t}),document.activeElement!==r)return}function yp(e){const t=ca(e),r=da(t,e),n=da(t.reverse(),e);return[r,n]}function ca(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function da(e,t){for(const r of e)if(!kp(r,{upTo:t}))return r}function kp(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Sp(e){return e instanceof HTMLInputElement&&"select"in e}function wt(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Sp(e)&&t&&e.select()}}var ua=Cp();function Cp(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=fa(e,t),e.unshift(t)},remove(t){var r;e=fa(e,t),(r=e[0])==null||r.resume()}}}function fa(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Ep(e){return e.filter(t=>t.tagName!=="A")}var Re=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},jp=b[" useId ".trim().toString()]||(()=>{}),Np=0;function Ar(e){const[t,r]=b.useState(jp());return Re(()=>{r(n=>n??String(Np++))},[e]),t?`radix-${t}`:""}const Tp=["top","right","bottom","left"],yt=Math.min,Ke=Math.max,Sn=Math.round,Cn=Math.floor,ot=e=>({x:e,y:e}),Ap={left:"right",right:"left",bottom:"top",top:"bottom"},zp={start:"end",end:"start"};function Mo(e,t,r){return Ke(e,yt(t,r))}function ft(e,t){return typeof e=="function"?e(t):e}function pt(e){return e.split("-")[0]}function qt(e){return e.split("-")[1]}function Ro(e){return e==="x"?"y":"x"}function Lo(e){return e==="y"?"height":"width"}const Pp=new Set(["top","bottom"]);function it(e){return Pp.has(pt(e))?"y":"x"}function $o(e){return Ro(it(e))}function Op(e,t,r){r===void 0&&(r=!1);const n=qt(e),o=$o(e),i=Lo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=En(s)),[s,En(s)]}function Ip(e){const t=En(e);return[Fo(e),t,Fo(t)]}function Fo(e){return e.replace(/start|end/g,t=>zp[t])}const pa=["left","right"],ha=["right","left"],Dp=["top","bottom"],_p=["bottom","top"];function Mp(e,t,r){switch(e){case"top":case"bottom":return r?t?ha:pa:t?pa:ha;case"left":case"right":return t?Dp:_p;default:return[]}}function Rp(e,t,r,n){const o=qt(e);let i=Mp(pt(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Fo)))),i}function En(e){return e.replace(/left|right|bottom|top/g,t=>Ap[t])}function Lp(e){return{top:0,right:0,bottom:0,left:0,...e}}function ma(e){return typeof e!="number"?Lp(e):{top:e,right:e,bottom:e,left:e}}function jn(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function ga(e,t,r){let{reference:n,floating:o}=e;const i=it(t),s=$o(t),a=Lo(s),l=pt(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 $p(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=ft(t,e),w=ma(p),v=a[h?f==="floating"?"reference":"floating":f],y=jn(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(v)))==null||r?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:d,rootBoundary:u,strategy:l})),k=f==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=jn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:k,offsetParent:x,strategy:l}):k);return{top:(y.top-C.top+w.top)/S.y,bottom:(C.bottom-y.bottom+w.bottom)/S.y,left:(y.left-C.left+w.left)/S.x,right:(C.right-y.right+w.right)/S.x}}const Fp=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=ga(d,n,l),h=n,p={},w=0;for(let v=0;v<a.length;v++){var m;const{name:y,fn:k}=a[v],{x,y:S,data:C,reset: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:$p},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}=ga(d,h,l)),v=-1)}return{x:u,y:f,placement:h,strategy:o,middlewareData:p}},Wp=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:d,padding:u=0}=ft(e,t)||{};if(d==null)return{};const f=ma(u),h={x:r,y:n},p=$o(o),w=Lo(p),m=await s.getDimensions(d),v=p==="y",y=v?"top":"left",k=v?"bottom":"right",x=v?"clientHeight":"clientWidth",S=i.reference[w]+i.reference[p]-h[p]-i.floating[w],C=h[p]-i.reference[p],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=yt(f[y],D),I=yt(f[k],D),L=R,_=N-m[w]-I,G=N/2-m[w]/2+E,B=Mo(L,G,_),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-_:0;return{[p]:h[p]+U,data:{[p]:B,centerOffset:G-B-U,...F&&{alignmentOffset:U}},reset:F}}}),Up=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:d}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:m=!0,...v}=ft(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const y=pt(o),k=it(a),x=pt(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(d.floating)),C=h||(x||!m?[En(a)]:Ip(a)),j=w!=="none";!h&&j&&C.push(...Rp(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=Op(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!==it(B):!1)||R.every(z=>it(z.placement)===k?z.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,z)=>U.overflows[1]-z.overflows[1])[0])==null?void 0:L.placement;if(!F)switch(p){case"bestFit":{var _;const U=(_=R.filter(z=>{if(j){const X=it(z.placement);return X===k||X==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(X=>X>0).reduce((X,re)=>X+re,0)]).sort((z,X)=>z[1]-X[1])[0])==null?void 0:_[0];U&&(F=U);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function ba(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function va(e){return Tp.some(t=>e[t]>=0)}const Bp=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:o="referenceHidden",...i}=ft(e,t);switch(o){case"referenceHidden":{const s=await n.detectOverflow(t,{...i,elementContext:"reference"}),a=ba(s,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:va(a)}}}case"escaped":{const s=await n.detectOverflow(t,{...i,altBoundary:!0}),a=ba(s,r.floating);return{data:{escapedOffsets:a,escaped:va(a)}}}default:return{}}}}},xa=new Set(["left","top"]);async function Hp(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=pt(r),a=qt(r),l=it(r)==="y",d=xa.has(s)?-1:1,u=i&&l?-1:1,f=ft(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:w}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof w=="number"&&(p=a==="end"?w*-1:w),l?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const Vp=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await Hp(t,e);return s===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Kp=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:k,y:x}=y;return{x:k,y:x}}},...d}=ft(e,t),u={x:r,y:n},f=await i.detectOverflow(t,d),h=it(pt(o)),p=Ro(h);let w=u[p],m=u[h];if(s){const y=p==="y"?"top":"left",k=p==="y"?"bottom":"right",x=w+f[y],S=w-f[k];w=Mo(x,w,S)}if(a){const y=h==="y"?"top":"left",k=h==="y"?"bottom":"right",x=m+f[y],S=m-f[k];m=Mo(x,m,S)}const v=l.fn({...t,[p]:w,[h]:m});return{...v,data:{x:v.x-r,y:v.y-n,enabled:{[p]:s,[h]:a}}}}}},Gp=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:d=!0}=ft(e,t),u={x:r,y:n},f=it(o),h=Ro(f);let p=u[h],w=u[f];const m=ft(a,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const x=h==="y"?"height":"width",S=i.reference[h]-i.floating[x]+v.mainAxis,C=i.reference[h]+i.reference[x]-v.mainAxis;p<S?p=S:p>C&&(p=C)}if(d){var y,k;const x=h==="y"?"width":"height",S=xa.has(pt(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}}}},Yp=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...d}=ft(e,t),u=await s.detectOverflow(t,d),f=pt(o),h=qt(o),p=it(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=yt(m-u[v],k),C=yt(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=Ke(u.left,0),I=Ke(u.right,0),L=Ke(u.top,0),_=Ke(u.bottom,0);p?E=w-2*(R!==0||I!==0?R+I:Ke(u.left,u.right)):N=m-2*(L!==0||_!==0?L+_:Ke(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 Nn(){return typeof window<"u"}function Xt(e){return wa(e)?(e.nodeName||"").toLowerCase():"#document"}function Ge(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function st(e){var t;return(t=(wa(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function wa(e){return Nn()?e instanceof Node||e instanceof Ge(e).Node:!1}function tt(e){return Nn()?e instanceof Element||e instanceof Ge(e).Element:!1}function at(e){return Nn()?e instanceof HTMLElement||e instanceof Ge(e).HTMLElement:!1}function ya(e){return!Nn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ge(e).ShadowRoot}const qp=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)&&!qp.has(o)}const Xp=new Set(["table","td","th"]);function Jp(e){return Xp.has(Xt(e))}const Zp=[":popover-open",":modal"];function Tn(e){return Zp.some(t=>{try{return e.matches(t)}catch{return!1}})}const Qp=["transform","translate","scale","rotate","perspective"],eh=["transform","translate","scale","rotate","perspective","filter"],th=["paint","layout","strict","content"];function Wo(e){const t=Uo(),r=tt(e)?rt(e):e;return Qp.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||eh.some(n=>(r.willChange||"").includes(n))||th.some(n=>(r.contain||"").includes(n))}function rh(e){let t=kt(e);for(;at(t)&&!Jt(t);){if(Wo(t))return t;if(Tn(t))return null;t=kt(t)}return null}function Uo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const nh=new Set(["html","body","#document"]);function Jt(e){return nh.has(Xt(e))}function rt(e){return Ge(e).getComputedStyle(e)}function An(e){return tt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kt(e){if(Xt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ya(e)&&e.host||st(e);return ya(t)?t.host:t}function ka(e){const t=kt(e);return Jt(t)?e.ownerDocument?e.ownerDocument.body:e.body:at(t)&&zr(t)?t:ka(t)}function Pr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=ka(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=Ge(o);if(i){const a=Bo(s);return t.concat(s,s.visualViewport||[],zr(o)?o:[],a&&r?Pr(a):[])}return t.concat(o,Pr(o,[],r))}function Bo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Sa(e){const t=rt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=at(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,a=Sn(r)!==i||Sn(n)!==s;return a&&(r=i,n=s),{width:r,height:n,$:a}}function Ho(e){return tt(e)?e:e.contextElement}function Zt(e){const t=Ho(e);if(!at(t))return ot(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=Sa(t);let s=(i?Sn(r.width):r.width)/n,a=(i?Sn(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const oh=ot(0);function Ca(e){const t=Ge(e);return!Uo()||!t.visualViewport?oh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ih(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Ge(e)?!1:t}function _t(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=Ho(e);let s=ot(1);t&&(n?tt(n)&&(s=Zt(n)):s=Zt(e));const a=ih(i,r,n)?Ca(i):ot(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=Ge(i),p=n&&tt(n)?Ge(n):n;let w=h,m=Bo(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=Ge(m),m=Bo(w)}}return jn({width:u,height:f,x:l,y:d})}function zn(e,t){const r=An(e).scrollLeft;return t?t.left+r:_t(st(e)).left+r}function Ea(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-zn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function sh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=st(n),a=t?Tn(t.floating):!1;if(n===s||a&&i)return r;let l={scrollLeft:0,scrollTop:0},d=ot(1);const u=ot(0),f=at(n);if((f||!f&&!i)&&((Xt(n)!=="body"||zr(s))&&(l=An(n)),at(n))){const p=_t(n);d=Zt(n),u.x=p.x+n.clientLeft,u.y=p.y+n.clientTop}const h=s&&!f&&!i?Ea(s,l):ot(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-l.scrollLeft*d.x+u.x+h.x,y:r.y*d.y-l.scrollTop*d.y+u.y+h.y}}function ah(e){return Array.from(e.getClientRects())}function lh(e){const t=st(e),r=An(e),n=e.ownerDocument.body,o=Ke(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Ke(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+zn(e);const a=-r.scrollTop;return rt(n).direction==="rtl"&&(s+=Ke(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:a}}const ja=25;function ch(e,t){const r=Ge(e),n=st(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=Uo();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const d=zn(n);if(d<=0){const u=n.ownerDocument,f=u.body,h=getComputedStyle(f),p=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,w=Math.abs(n.clientWidth-f.clientWidth-p);w<=ja&&(i-=w)}else d<=ja&&(i+=d);return{width:i,height:s,x:a,y:l}}const dh=new Set(["absolute","fixed"]);function uh(e,t){const r=_t(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=at(e)?Zt(e):ot(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,d=n*i.y;return{width:s,height:a,x:l,y:d}}function Na(e,t,r){let n;if(t==="viewport")n=ch(e,r);else if(t==="document")n=lh(st(e));else if(tt(t))n=uh(t,r);else{const o=Ca(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return jn(n)}function Ta(e,t){const r=kt(e);return r===t||!tt(r)||Jt(r)?!1:rt(r).position==="fixed"||Ta(r,t)}function fh(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?kt(e):e;for(;tt(s)&&!Jt(s);){const a=rt(s),l=Wo(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&dh.has(o.position)||zr(s)&&!l&&Ta(e,s))?n=n.filter(u=>u!==s):o=a,s=kt(s)}return t.set(e,n),n}function ph(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?Tn(t)?[]:fh(t,this._c):[].concat(r),n],a=s[0],l=s.reduce((d,u)=>{const f=Na(t,u,o);return d.top=Ke(f.top,d.top),d.right=yt(f.right,d.right),d.bottom=yt(f.bottom,d.bottom),d.left=Ke(f.left,d.left),d},Na(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function hh(e){const{width:t,height:r}=Sa(e);return{width:t,height:r}}function mh(e,t,r){const n=at(t),o=st(t),i=r==="fixed",s=_t(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=ot(0);function d(){l.x=zn(o)}if(n||!n&&!i)if((Xt(t)!=="body"||zr(o))&&(a=An(t)),n){const p=_t(t,!0,i,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&d();i&&!n&&o&&d();const u=o&&!n&&!i?Ea(o,a):ot(0),f=s.left+a.scrollLeft-l.x-u.x,h=s.top+a.scrollTop-l.y-u.y;return{x:f,y:h,width:s.width,height:s.height}}function Vo(e){return rt(e).position==="static"}function Aa(e,t){if(!at(e)||rt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return st(e)===r&&(r=r.ownerDocument.body),r}function za(e,t){const r=Ge(e);if(Tn(e))return r;if(!at(e)){let o=kt(e);for(;o&&!Jt(o);){if(tt(o)&&!Vo(o))return o;o=kt(o)}return r}let n=Aa(e,t);for(;n&&Jp(n)&&Vo(n);)n=Aa(n,t);return n&&Jt(n)&&Vo(n)&&!Wo(n)?r:n||rh(e)||r}const gh=async function(e){const t=this.getOffsetParent||za,r=this.getDimensions,n=await r(e.floating);return{reference:mh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function bh(e){return rt(e).direction==="rtl"}const vh={convertOffsetParentRelativeRectToViewportRelativeRect:sh,getDocumentElement:st,getClippingRect:ph,getOffsetParent:za,getElementRects:gh,getClientRects:ah,getDimensions:hh,getScale:Zt,isElement:tt,isRTL:bh};function Pa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xh(e,t){let r=null,n;const o=st(e);function i(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const d=e.getBoundingClientRect(),{left:u,top:f,width:h,height:p}=d;if(a||t(),!h||!p)return;const w=Cn(f),m=Cn(o.clientWidth-(u+h)),v=Cn(o.clientHeight-(f+p)),y=Cn(u),x={rootMargin:-w+"px "+-m+"px "+-v+"px "+-y+"px",threshold:Ke(0,yt(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&&!Pa(d,e.getBoundingClientRect())&&s(),S=!1}try{r=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,x)}r.observe(e)}return s(!0),i}function wh(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,d=Ho(e),u=o||i?[...d?Pr(d):[],...Pr(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",r,{passive:!0}),i&&y.addEventListener("resize",r)});const f=d&&a?xh(d,r):null;let h=-1,p=null;s&&(p=new ResizeObserver(y=>{let[k]=y;k&&k.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),r()}),d&&!l&&p.observe(d),p.observe(t));let w,m=l?_t(e):null;l&&v();function v(){const y=_t(e);m&&!Pa(m,y)&&r(),m=y,w=requestAnimationFrame(v)}return r(),()=>{var y;u.forEach(k=>{o&&k.removeEventListener("scroll",r),i&&k.removeEventListener("resize",r)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,l&&cancelAnimationFrame(w)}}const yh=Vp,kh=Kp,Sh=Up,Ch=Yp,Eh=Bp,Oa=Wp,jh=Gp,Nh=(e,t,r)=>{const n=new Map,o={platform:vh,...r},i={...o.platform,_c:n};return Fp(e,t,{...o,platform:i})};var Th=typeof document<"u",Ah=function(){},Pn=Th?g.useLayoutEffect:Ah;function On(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!On(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!On(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Ia(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Da(e,t){const r=Ia(e);return Math.round(t*r)/r}function Ko(e){const t=b.useRef(e);return Pn(()=>{t.current=e}),t}function zh(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:d}=e,[u,f]=b.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=b.useState(n);On(h,n)||p(n);const[w,m]=b.useState(null),[v,y]=b.useState(null),k=b.useCallback(z=>{z!==j.current&&(j.current=z,m(z))},[]),x=b.useCallback(z=>{z!==N.current&&(N.current=z,y(z))},[]),S=i||w,C=s||v,j=b.useRef(null),N=b.useRef(null),E=b.useRef(u),D=l!=null,R=Ko(l),I=Ko(o),L=Ko(d),_=b.useCallback(()=>{if(!j.current||!N.current)return;const z={placement:t,strategy:r,middleware:h};I.current&&(z.platform=I.current),Nh(j.current,N.current,z).then(X=>{const re={...X,isPositioned:L.current!==!1};G.current&&!On(E.current,re)&&(E.current=re,Kr.flushSync(()=>{f(re)}))})},[h,t,r,I,L]);Pn(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(z=>({...z,isPositioned:!1})))},[d]);const G=b.useRef(!1);Pn(()=>(G.current=!0,()=>{G.current=!1}),[]),Pn(()=>{if(S&&(j.current=S),C&&(N.current=C),S&&C){if(R.current)return R.current(S,C,_);_()}},[S,C,_,R,D]);const B=b.useMemo(()=>({reference:j,floating:N,setReference:k,setFloating:x}),[k,x]),F=b.useMemo(()=>({reference:S,floating:C}),[S,C]),U=b.useMemo(()=>{const z={position:r,left:0,top:0};if(!F.floating)return z;const X=Da(F.floating,u.x),re=Da(F.floating,u.y);return a?{...z,transform:"translate("+X+"px, "+re+"px)",...Ia(F.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:X,top:re}},[r,a,F.floating,u.x,u.y]);return b.useMemo(()=>({...u,update:_,refs:B,elements:F,floatingStyles:U}),[u,_,B,F,U])}const Ph=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Oa({element:n.current,padding:o}).fn(r):{}:n?Oa({element:n,padding:o}).fn(r):{}}}},Oh=(e,t)=>({...yh(e),options:[e,t]}),Ih=(e,t)=>({...kh(e),options:[e,t]}),Dh=(e,t)=>({...jh(e),options:[e,t]}),_h=(e,t)=>({...Sh(e),options:[e,t]}),Mh=(e,t)=>({...Ch(e),options:[e,t]}),Rh=(e,t)=>({...Eh(e),options:[e,t]}),Lh=(e,t)=>({...Ph(e),options:[e,t]});var $h="Arrow",_a=b.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return c.jsx(ke.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});_a.displayName=$h;var Fh=_a;function Wh(e){const[t,r]=b.useState(void 0);return 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 Go="Popper",[Ma,Qt]=Tr(Go),[Uh,Ra]=Ma(Go),La=e=>{const{__scopePopper:t,children:r}=e,[n,o]=b.useState(null);return c.jsx(Uh,{scope:t,anchor:n,onAnchorChange:o,children:r})};La.displayName=Go;var $a="PopperAnchor",Fa=b.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Ra($a,r),s=b.useRef(null),a=Ee(t,s),l=b.useRef(null);return b.useEffect(()=>{const d=l.current;l.current=(n==null?void 0:n.current)||s.current,d!==l.current&&i.onAnchorChange(l.current)}),n?null:c.jsx(ke.div,{...o,ref:a})});Fa.displayName=$a;var Yo="PopperContent",[Bh,Hh]=Ma(Yo),Wa=b.forwardRef((e,t)=>{var P,J,ee,W,ne,te;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:w,...m}=e,v=Ra(Yo,r),[y,k]=b.useState(null),x=Ee(t,we=>k(we)),[S,C]=b.useState(null),j=Wh(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,_={padding:R,boundary:I.filter(Kh),altBoundary:L},{refs:G,floatingStyles:B,placement:F,isPositioned:U,middlewareData:z}=zh({strategy:"fixed",placement:D,whileElementsMounted:(...we)=>wh(...we,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[Oh({mainAxis:o+E,alignmentAxis:s}),l&&Ih({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Dh():void 0,..._}),l&&_h({..._}),Mh({..._,apply:({elements:we,rects:be,availableWidth:Pe,availableHeight:De})=>{const{width:Ue,height:jt}=be.reference,qe=we.floating.style;qe.setProperty("--radix-popper-available-width",`${Pe}px`),qe.setProperty("--radix-popper-available-height",`${De}px`),qe.setProperty("--radix-popper-anchor-width",`${Ue}px`),qe.setProperty("--radix-popper-anchor-height",`${jt}px`)}}),S&&Lh({element:S,padding:a}),Gh({arrowWidth:N,arrowHeight:E}),h&&Rh({strategy:"referenceHidden",..._})]}),[X,re]=Ha(F),T=Dt(w);Re(()=>{U&&(T==null||T())},[U,T]);const $=(P=z.arrow)==null?void 0:P.x,Y=(J=z.arrow)==null?void 0:J.y,K=((ee=z.arrow)==null?void 0:ee.centerOffset)!==0,[ge,se]=b.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=z.transformOrigin)==null?void 0:W.x,(ne=z.transformOrigin)==null?void 0:ne.y].join(" "),...((te=z.hide)==null?void 0:te.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Bh,{scope:r,placedSide:X,onArrowChange:C,arrowX:$,arrowY:Y,shouldHideArrow:K,children:c.jsx(ke.div,{"data-side":X,"data-align":re,...m,ref:x,style:{...m.style,animation:U?void 0:"none"}})})})});Wa.displayName=Yo;var Ua="PopperArrow",Vh={top:"bottom",right:"left",bottom:"top",left:"right"},Ba=b.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Hh(Ua,n),s=Vh[i.placedSide];return c.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:c.jsx(Fh,{...o,ref:r,style:{...o.style,display:"block"}})})});Ba.displayName=Ua;function Kh(e){return e!==null}var Gh=e=>({name:"transformOrigin",options:e,fn(t){var v,y,k;const{placement:r,rects:n,middlewareData:o}=t,s=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[d,u]=Ha(r),f={start:"0%",center:"50%",end:"100%"}[u],h=(((y=o.arrow)==null?void 0:y.x)??0)+a/2,p=(((k=o.arrow)==null?void 0:k.y)??0)+l/2;let w="",m="";return d==="bottom"?(w=s?f:`${h}px`,m=`${-l}px`):d==="top"?(w=s?f:`${h}px`,m=`${n.floating.height+l}px`):d==="right"?(w=`${-l}px`,m=s?f:`${p}px`):d==="left"&&(w=`${n.floating.width+l}px`,m=s?f:`${p}px`),{data:{x:w,y:m}}}});function Ha(e){const[t,r="center"]=e.split("-");return[t,r]}var qo=La,In=Fa,Xo=Wa,Jo=Ba,Yh="Portal",Dn=b.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[o,i]=b.useState(!1);Re(()=>i(!0),[]);const s=r||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?gt.createPortal(c.jsx(ke.div,{...n,ref:t}),s):null});Dn.displayName=Yh;var qh=b[" useInsertionEffect ".trim().toString()]||Re;function _n({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Xh({defaultProp:t,onChange:r}),a=e!==void 0,l=a?e:o;{const u=b.useRef(e!==void 0);b.useEffect(()=>{const f=u.current;f!==a&&console.warn(`${n} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,n])}const d=b.useCallback(u=>{var f;if(a){const h=Jh(u)?u(e):u;h!==e&&((f=s.current)==null||f.call(s,h))}else i(u)},[a,e,i,s]);return[l,d]}function Xh({defaultProp:e,onChange:t}){const[r,n]=b.useState(e),o=b.useRef(r),i=b.useRef(t);return qh(()=>{i.current=t},[t]),b.useEffect(()=>{var s;o.current!==r&&((s=i.current)==null||s.call(i,r),o.current=r)},[r,o]),[r,n,i]}function Jh(e){return typeof e=="function"}function Zh(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Va=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Qh="VisuallyHidden",Ka=b.forwardRef((e,t)=>c.jsx(ke.span,{...e,ref:t,style:{...Va,...e.style}}));Ka.displayName=Qh;var em=Ka,tm=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},er=new WeakMap,Mn=new WeakMap,Rn={},Zo=0,Ga=function(e){return e&&(e.host||Ga(e.parentNode))},rm=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Ga(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},nm=function(e,t,r,n){var o=rm(t,Array.isArray(e)?e:[e]);Rn[r]||(Rn[r]=new WeakMap);var i=Rn[r],s=[],a=new Set,l=new Set(o),d=function(f){!f||a.has(f)||(a.add(f),d(f.parentNode))};o.forEach(d);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))u(h);else try{var p=h.getAttribute(n),w=p!==null&&p!=="false",m=(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&&Mn.set(h,!0),v===1&&h.setAttribute(r,"true"),w||h.setAttribute(n,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return u(t),a.clear(),Zo++,function(){s.forEach(function(f){var h=er.get(f)-1,p=i.get(f)-1;er.set(f,h),i.set(f,p),h||(Mn.has(f)||f.removeAttribute(n),Mn.delete(f)),p||f.removeAttribute(r)}),Zo--,Zo||(er=new WeakMap,er=new WeakMap,Mn=new WeakMap,Rn={})}},Ya=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=tm(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),nm(n,o,r,"aria-hidden")):function(){return null}},lt=function(){return lt=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},lt.apply(this,arguments)};function qa(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function om(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Ln="right-scroll-bar-position",$n="width-before-scroll-bar",im="with-scroll-bars-hidden",sm="--removed-body-scroll-bar-size";function Qo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function am(e,t){var r=g.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var lm=typeof window<"u"?b.useLayoutEffect:b.useEffect,Xa=new WeakMap;function cm(e,t){var r=am(null,function(n){return e.forEach(function(o){return Qo(o,n)})});return lm(function(){var n=Xa.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(a){i.has(a)||Qo(a,null)}),i.forEach(function(a){o.has(a)||Qo(a,s)})}Xa.set(r,e)},[e]),r}function dm(e){return e}function um(e,t){t===void 0&&(t=dm);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(a){return i(a)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var a=r;r=[],a.forEach(i),s=r}var l=function(){var u=s;s=[],u.forEach(i)},d=function(){return Promise.resolve().then(l)};d(),r={push:function(u){s.push(u),d()},filter:function(u){return s=s.filter(u),r}}}};return o}function fm(e){e===void 0&&(e={});var t=um(null);return t.options=lt({async:!0,ssr:!1},e),t}var Ja=function(e){var t=e.sideCar,r=qa(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return b.createElement(n,lt({},r))};Ja.isSideCarExport=!0;function pm(e,t){return e.useMedium(t),Ja}var Za=fm(),ei=function(){},Fn=b.forwardRef(function(e,t){var r=b.useRef(null),n=b.useState({onScrollCapture:ei,onWheelCapture:ei,onTouchMoveCapture:ei}),o=n[0],i=n[1],s=e.forwardProps,a=e.children,l=e.className,d=e.removeScrollBar,u=e.enabled,f=e.shards,h=e.sideCar,p=e.noRelative,w=e.noIsolation,m=e.inert,v=e.allowPinchZoom,y=e.as,k=y===void 0?"div":y,x=e.gapMode,S=qa(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,j=cm([r,t]),N=lt(lt({},S),o);return b.createElement(b.Fragment,null,u&&b.createElement(C,{sideCar:Za,removeScrollBar:d,shards:f,noRelative:p,noIsolation:w,inert:m,setCallbacks:i,allowPinchZoom:!!v,lockRef:r,gapMode:x}),s?b.cloneElement(b.Children.only(a),lt(lt({},N),{ref:j})):b.createElement(k,lt({},N,{className:l,ref:j}),a))});Fn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Fn.classNames={fullWidth:$n,zeroRight:Ln};var hm=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function mm(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=hm();return t&&e.setAttribute("nonce",t),e}function gm(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function bm(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var vm=function(){var e=0,t=null;return{add:function(r){e==0&&(t=mm())&&(gm(t,r),bm(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},xm=function(){var e=vm();return function(t,r){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Qa=function(){var e=xm(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},wm={left:0,top:0,right:0,gap:0},ti=function(e){return parseInt(e||"",10)||0},ym=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ti(r),ti(n),ti(o)]},km=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return wm;var t=ym(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Sm=Qa(),tr="data-scroll-locked",Cm=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,a=e.gap;return r===void 0&&(r="margin"),`
|
|
187
|
+
.`.concat(im,` {
|
|
188
188
|
overflow: hidden `).concat(n,`;
|
|
189
189
|
padding-right: `).concat(a,"px ").concat(n,`;
|
|
190
190
|
}
|
|
@@ -201,26 +201,26 @@ React keys must be passed directly to JSX without using spread:
|
|
|
201
201
|
`),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),`
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
.`).concat(
|
|
204
|
+
.`).concat(Ln,` {
|
|
205
205
|
right: `).concat(a,"px ").concat(n,`;
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
.`).concat(
|
|
208
|
+
.`).concat($n,` {
|
|
209
209
|
margin-right: `).concat(a,"px ").concat(n,`;
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
.`).concat(
|
|
212
|
+
.`).concat(Ln," .").concat(Ln,` {
|
|
213
213
|
right: 0 `).concat(n,`;
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
-
.`).concat(
|
|
216
|
+
.`).concat($n," .").concat($n,` {
|
|
217
217
|
margin-right: 0 `).concat(n,`;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
body[`).concat(tr,`] {
|
|
221
|
-
`).concat(
|
|
221
|
+
`).concat(sm,": ").concat(a,`px;
|
|
222
222
|
}
|
|
223
|
-
`)},
|
|
223
|
+
`)},el=function(){var e=parseInt(document.body.getAttribute(tr)||"0",10);return isFinite(e)?e:0},Em=function(){b.useEffect(function(){return document.body.setAttribute(tr,(el()+1).toString()),function(){var e=el()-1;e<=0?document.body.removeAttribute(tr):document.body.setAttribute(tr,e.toString())}},[])},jm=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;Em();var i=b.useMemo(function(){return km(o)},[o]);return b.createElement(Sm,{styles:Cm(i,!t,o,r?"":"!important")})},ri=!1;if(typeof window<"u")try{var Wn=Object.defineProperty({},"passive",{get:function(){return ri=!0,!0}});window.addEventListener("test",Wn,Wn),window.removeEventListener("test",Wn,Wn)}catch{ri=!1}var rr=ri?{passive:!1}:!1,Nm=function(e){return e.tagName==="TEXTAREA"},tl=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Nm(e)&&r[t]==="visible")},Tm=function(e){return tl(e,"overflowY")},Am=function(e){return tl(e,"overflowX")},rl=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=nl(e,n);if(o){var i=ol(e,n),s=i[1],a=i[2];if(s>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},zm=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Pm=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},nl=function(e,t){return e==="v"?Tm(t):Am(t)},ol=function(e,t){return e==="v"?zm(t):Pm(t)},Om=function(e,t){return e==="h"&&t==="rtl"?-1:1},Im=function(e,t,r,n,o){var i=Om(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=ol(e,a),w=p[0],m=p[1],v=p[2],y=m-v-i*w;(w||y)&&nl(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},Un=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},il=function(e){return[e.deltaX,e.deltaY]},sl=function(e){return e&&"current"in e?e.current:e},Dm=function(e,t){return e[0]===t[0]&&e[1]===t[1]},_m=function(e){return`
|
|
224
224
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
225
225
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
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"})}));
|
|
226
|
+
`)},Mm=0,nr=[];function Rm(e){var t=b.useRef([]),r=b.useRef([0,0]),n=b.useRef(),o=b.useState(Mm++)[0],i=b.useState(Qa)[0],s=b.useRef(e);b.useEffect(function(){s.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=om([e.lockRef.current],(e.shards||[]).map(sl),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=b.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var y=Un(m),k=r.current,x="deltaX"in m?m.deltaX:k[0]-y[0],S="deltaY"in m?m.deltaY:k[1]-y[1],C,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=rl(N,j);if(!I)return!0;if(I?C=N:(C=N==="v"?"h":"v",I=rl(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 Im(L,v,m,L==="h"?x:S)},[]),l=b.useCallback(function(m){var v=m;if(!(!nr.length||nr[nr.length-1]!==i)){var y="deltaY"in v?il(v):Un(v),k=t.current.filter(function(C){return C.name===v.type&&(C.target===v.target||v.target===C.shadowParent)&&Dm(C.delta,y)})[0];if(k&&k.should){v.cancelable&&v.preventDefault();return}if(!k){var x=(s.current.shards||[]).map(sl).filter(Boolean).filter(function(C){return C.contains(v.target)}),S=x.length>0?a(v,x[0]):!s.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),d=b.useCallback(function(m,v,y,k){var x={name:m,delta:v,target:y,should:k,shadowParent:Lm(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),u=b.useCallback(function(m){r.current=Un(m),n.current=void 0},[]),f=b.useCallback(function(m){d(m.type,il(m),m.target,a(m,e.lockRef.current))},[]),h=b.useCallback(function(m){d(m.type,Un(m),m.target,a(m,e.lockRef.current))},[]);b.useEffect(function(){return 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 b.createElement(b.Fragment,null,w?b.createElement(i,{styles:_m(o)}):null,p?b.createElement(jm,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Lm(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const $m=pm(Za,Rm);var ni=b.forwardRef(function(e,t){return b.createElement(Fn,lt({},e,{ref:t,sideCar:$m}))});ni.classNames=Fn.classNames;var Fm=[" ","Enter","ArrowUp","ArrowDown"],Wm=[" ","Enter"],Mt="Select",[Bn,Hn,Um]=sp(Mt),[or]=Tr(Mt,[Um,Qt]),Vn=Qt(),[Bm,St]=or(Mt),[Hm,Vm]=or(Mt),al=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:d,name:u,autoComplete:f,disabled:h,required:p,form:w}=e,m=Vn(t),[v,y]=b.useState(null),[k,x]=b.useState(null),[S,C]=b.useState(!1),j=lp(d),[N,E]=_n({prop:n,defaultProp:o??!1,onChange:i,caller:Mt}),[D,R]=_n({prop:s,defaultProp:a,onChange:l,caller:Mt}),I=b.useRef(null),L=v?w||!!v.closest("form"):!0,[_,G]=b.useState(new Set),B=Array.from(_).map(F=>F.props.value).join(";");return c.jsx(qo,{...m,children:c.jsxs(Bm,{required:p,scope:t,trigger:v,onTriggerChange:y,valueNode:k,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Ar(),value:D,onValueChange:R,open:N,onOpenChange:E,dir:j,triggerPointerDownPosRef:I,disabled:h,children:[c.jsx(Bn.Provider,{scope:t,children:c.jsx(Hm,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(F=>{G(U=>new Set(U).add(F))},[]),onNativeOptionRemove:b.useCallback(F=>{G(U=>{const z=new Set(U);return z.delete(F),z})},[]),children:r})}),L?c.jsxs(Nl,{"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(_)]},B):null]})})};al.displayName=Mt;var ll="SelectTrigger",cl=b.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=Vn(r),s=St(ll,r),a=s.disabled||n,l=Ee(t,s.onTriggerChange),d=Hn(r),u=b.useRef("touch"),[f,h,p]=Al(m=>{const v=d().filter(x=>!x.disabled),y=v.find(x=>x.value===s.value),k=zl(v,m,y);k!==void 0&&s.onValueChange(k.value)}),w=m=>{a||(s.onOpenChange(!0),p()),m&&(s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return c.jsx(In,{asChild:!0,...i,children:c.jsx(ke.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Tl(s.value)?"":void 0,...o,ref:l,onClick:he(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&w(m)}),onPointerDown:he(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:he(o.onKeyDown,m=>{const v=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&h(m.key),!(v&&m.key===" ")&&Fm.includes(m.key)&&(w(),m.preventDefault())})})})});cl.displayName=ll;var dl="SelectValue",ul=b.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...a}=e,l=St(dl,r),{onValueNodeHasChildrenChange:d}=l,u=i!==void 0,f=Ee(t,l.onValueNodeChange);return Re(()=>{d(u)},[d,u]),c.jsx(ke.span,{...a,ref:f,style:{pointerEvents:"none"},children:Tl(l.value)?c.jsx(c.Fragment,{children:s}):i})});ul.displayName=dl;var Km="SelectIcon",fl=b.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return c.jsx(ke.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});fl.displayName=Km;var Gm="SelectPortal",pl=e=>c.jsx(Dn,{asChild:!0,...e});pl.displayName=Gm;var Rt="SelectContent",hl=b.forwardRef((e,t)=>{const r=St(Rt,e.__scopeSelect),[n,o]=b.useState();if(Re(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?Kr.createPortal(c.jsx(ml,{scope:e.__scopeSelect,children:c.jsx(Bn.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),i):null}return c.jsx(gl,{...e,ref:t})});hl.displayName=Rt;var nt=10,[ml,Ct]=or(Rt),Ym="SelectContentImpl",qm=Yt("SelectContent.RemoveScroll"),gl=b.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:w,hideWhenDetached:m,avoidCollisions:v,...y}=e,k=St(Rt,r),[x,S]=b.useState(null),[C,j]=b.useState(null),N=Ee(t,P=>S(P)),[E,D]=b.useState(null),[R,I]=b.useState(null),L=Hn(r),[_,G]=b.useState(!1),B=b.useRef(!1);b.useEffect(()=>{if(x)return Ya(x)},[x]),sa();const F=b.useCallback(P=>{const[J,...ee]=L().map(te=>te.ref.current),[W]=ee.slice(-1),ne=document.activeElement;for(const te of P)if(te===ne||(te==null||te.scrollIntoView({block:"nearest"}),te===J&&C&&(C.scrollTop=0),te===W&&C&&(C.scrollTop=C.scrollHeight),te==null||te.focus(),document.activeElement!==ne))return},[L,C]),U=b.useCallback(()=>F([E,x]),[F,E,x]);b.useEffect(()=>{_&&U()},[_,U]);const{onOpenChange:z,triggerPointerDownPosRef:X}=k;b.useEffect(()=>{if(x){let P={x:0,y:0};const J=W=>{var ne,te;P={x:Math.abs(Math.round(W.pageX)-(((ne=X.current)==null?void 0:ne.x)??0)),y:Math.abs(Math.round(W.pageY)-(((te=X.current)==null?void 0:te.y)??0))}},ee=W=>{P.x<=10&&P.y<=10?W.preventDefault():x.contains(W.target)||z(!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,z,X]),b.useEffect(()=>{const P=()=>z(!1);return window.addEventListener("blur",P),window.addEventListener("resize",P),()=>{window.removeEventListener("blur",P),window.removeEventListener("resize",P)}},[z]);const[re,T]=Al(P=>{const J=L().filter(ne=>!ne.disabled),ee=J.find(ne=>ne.ref.current===document.activeElement),W=zl(J,P,ee);W&&setTimeout(()=>W.ref.current.focus())}),$=b.useCallback((P,J,ee)=>{const W=!B.current&&!ee;(k.value!==void 0&&k.value===J||W)&&(D(P),W&&(B.current=!0))},[k.value]),Y=b.useCallback(()=>x==null?void 0:x.focus(),[x]),K=b.useCallback((P,J,ee)=>{const W=!B.current&&!ee;(k.value!==void 0&&k.value===J||W)&&I(P)},[k.value]),ge=n==="popper"?oi:bl,se=ge===oi?{side:a,sideOffset:l,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:w,hideWhenDetached:m,avoidCollisions:v}:{};return c.jsx(ml,{scope:r,content:x,viewport:C,onViewportChange:j,itemRefCallback:$,selectedItem:E,onItemLeave:Y,itemTextRefCallback:K,focusSelectedItem:U,selectedItemText:R,position:n,isPositioned:_,searchRef:re,children:c.jsx(ni,{as:qm,allowPinchZoom:!0,children:c.jsx(_o,{asChild:!0,trapped:k.open,onMountAutoFocus:P=>{P.preventDefault()},onUnmountAutoFocus:he(o,P=>{var J;(J=k.trigger)==null||J.focus({preventScroll:!0}),P.preventDefault()}),children:c.jsx(kn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:P=>P.preventDefault(),onDismiss:()=>k.onOpenChange(!1),children:c.jsx(ge,{role:"listbox",id:k.contentId,"data-state":k.open?"open":"closed",dir:k.dir,onContextMenu:P=>P.preventDefault(),...y,...se,onPlaced:()=>G(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:he(y.onKeyDown,P=>{const J=P.ctrlKey||P.altKey||P.metaKey;if(P.key==="Tab"&&P.preventDefault(),!J&&P.key.length===1&&T(P.key),["ArrowUp","ArrowDown","Home","End"].includes(P.key)){let W=L().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(P.key)&&(W=W.slice().reverse()),["ArrowUp","ArrowDown"].includes(P.key)){const ne=P.target,te=W.indexOf(ne);W=W.slice(te+1)}setTimeout(()=>F(W)),P.preventDefault()}})})})})})})});gl.displayName=Ym;var Xm="SelectItemAlignedPosition",bl=b.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=St(Rt,r),s=Ct(Rt,r),[a,l]=b.useState(null),[d,u]=b.useState(null),f=Ee(t,N=>u(N)),h=Hn(r),p=b.useRef(!1),w=b.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:y,focusSelectedItem:k}=s,x=b.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&d&&m&&v&&y){const N=i.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),R=y.getBoundingClientRect();if(i.dir!=="rtl"){const ne=R.left-E.left,te=D.left-ne,we=N.left-te,be=N.width+we,Pe=Math.max(be,E.width),De=window.innerWidth-nt,Ue=Zs(te,[nt,Math.max(nt,De-Pe)]);a.style.minWidth=be+"px",a.style.left=Ue+"px"}else{const ne=E.right-R.right,te=window.innerWidth-D.right-ne,we=window.innerWidth-N.right-te,be=N.width+we,Pe=Math.max(be,E.width),De=window.innerWidth-nt,Ue=Zs(te,[nt,Math.max(nt,De-Pe)]);a.style.minWidth=be+"px",a.style.right=Ue+"px"}const I=h(),L=window.innerHeight-nt*2,_=m.scrollHeight,G=window.getComputedStyle(d),B=parseInt(G.borderTopWidth,10),F=parseInt(G.paddingTop,10),U=parseInt(G.borderBottomWidth,10),z=parseInt(G.paddingBottom,10),X=B+F+_+z+U,re=Math.min(v.offsetHeight*5,X),T=window.getComputedStyle(m),$=parseInt(T.paddingTop,10),Y=parseInt(T.paddingBottom,10),K=N.top+N.height/2-nt,ge=L-K,se=v.offsetHeight/2,P=v.offsetTop+se,J=B+F+P,ee=X-J;if(J<=K){const ne=I.length>0&&v===I[I.length-1].ref.current;a.style.bottom="0px";const te=d.clientHeight-m.offsetTop-m.offsetHeight,we=Math.max(ge,se+(ne?Y:0)+te+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=`${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]);Re(()=>x(),[x]);const[S,C]=b.useState();Re(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);const j=b.useCallback(N=>{N&&w.current===!0&&(x(),k==null||k(),w.current=!1)},[x,k]);return c.jsx(Zm,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:j,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:c.jsx(ke.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});bl.displayName=Xm;var Jm="SelectPopperPosition",oi=b.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=nt,...i}=e,s=Vn(r);return c.jsx(Xo,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});oi.displayName=Jm;var[Zm,ii]=or(Rt,{}),si="SelectViewport",vl=b.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=Ct(si,r),s=ii(si,r),a=Ee(t,i.onViewportChange),l=b.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),c.jsx(Bn.Slot,{scope:r,children:c.jsx(ke.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:he(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})})})]})});vl.displayName=si;var xl="SelectGroup",[Qm,eg]=or(xl),tg=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ar();return c.jsx(Qm,{scope:r,id:o,children:c.jsx(ke.div,{role:"group","aria-labelledby":o,...n,ref:t})})});tg.displayName=xl;var wl="SelectLabel",rg=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=eg(wl,r);return c.jsx(ke.div,{id:o.id,...n,ref:t})});rg.displayName=wl;var Kn="SelectItem",[ng,yl]=or(Kn),kl=b.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,a=St(Kn,r),l=Ct(Kn,r),d=a.value===n,[u,f]=b.useState(i??""),[h,p]=b.useState(!1),w=Ee(t,k=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,k,n,o)}),m=Ar(),v=b.useRef("touch"),y=()=>{o||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(ng,{scope:r,value:n,disabled:o,textId:m,isSelected:d,onItemTextChange:b.useCallback(k=>{f(x=>x||((k==null?void 0:k.textContent)??"").trim())},[]),children:c.jsx(Bn.ItemSlot,{scope:r,value:n,disabled:o,textValue:u,children:c.jsx(ke.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:he(s.onFocus,()=>p(!0)),onBlur:he(s.onBlur,()=>p(!1)),onClick:he(s.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:he(s.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:he(s.onPointerDown,k=>{v.current=k.pointerType}),onPointerMove:he(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:he(s.onPointerLeave,k=>{var x;k.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:he(s.onKeyDown,k=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&k.key===" "||(Wm.includes(k.key)&&y(),k.key===" "&&k.preventDefault())})})})})});kl.displayName=Kn;var Or="SelectItemText",Sl=b.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=St(Or,r),a=Ct(Or,r),l=yl(Or,r),d=Vm(Or,r),[u,f]=b.useState(null),h=Ee(t,y=>f(y),l.onItemTextChange,y=>{var k;return(k=a.itemTextRefCallback)==null?void 0:k.call(a,y,l.value,l.disabled)}),p=u==null?void 0:u.textContent,w=b.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=d;return Re(()=>(m(w),()=>v(w)),[m,v,w]),c.jsxs(c.Fragment,{children:[c.jsx(ke.span,{id:l.textId,...i,ref:h}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Kr.createPortal(i.children,s.valueNode):null]})});Sl.displayName=Or;var Cl="SelectItemIndicator",El=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return yl(Cl,r).isSelected?c.jsx(ke.span,{"aria-hidden":!0,...n,ref:t}):null});El.displayName=Cl;var ai="SelectScrollUpButton",og=b.forwardRef((e,t)=>{const r=Ct(ai,e.__scopeSelect),n=ii(ai,e.__scopeSelect),[o,i]=b.useState(!1),s=Ee(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(jl,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});og.displayName=ai;var li="SelectScrollDownButton",ig=b.forwardRef((e,t)=>{const r=Ct(li,e.__scopeSelect),n=ii(li,e.__scopeSelect),[o,i]=b.useState(!1),s=Ee(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(jl,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});ig.displayName=li;var jl=b.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=Ct("SelectScrollButton",r),s=b.useRef(null),a=Hn(r),l=b.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return b.useEffect(()=>()=>l(),[l]),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(ke.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:he(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:he(o.onPointerMove,()=>{var d;(d=i.onItemLeave)==null||d.call(i),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:he(o.onPointerLeave,()=>{l()})})}),sg="SelectSeparator",ag=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return c.jsx(ke.div,{"aria-hidden":!0,...n,ref:t})});ag.displayName=sg;var ci="SelectArrow",lg=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Vn(r),i=St(ci,r),s=Ct(ci,r);return i.open&&s.position==="popper"?c.jsx(Jo,{...o,...n,ref:t}):null});lg.displayName=ci;var cg="SelectBubbleInput",Nl=b.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=b.useRef(null),i=Ee(n,o),s=Zh(t);return b.useEffect(()=>{const a=o.current;if(!a)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&u){const f=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(f)}},[s,t]),c.jsx(ke.select,{...r,style:{...Va,...r.style},ref:i,defaultValue:t})});Nl.displayName=cg;function Tl(e){return e===""||e===void 0}function Al(e){const t=Dt(e),r=b.useRef(""),n=b.useRef(0),o=b.useCallback(s=>{const a=r.current+s;t(a),(function l(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>l(""),1e3))})(a)},[t]),i=b.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function zl(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=dg(e,Math.max(i,0));o.length===1&&(s=s.filter(d=>d!==r));const l=s.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==r?l:void 0}function dg(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var ug=al,Pl=cl,fg=ul,pg=fl,hg=pl,Ol=hl,mg=vl,Il=kl,gg=Sl,bg=El;const vg=ug,xg=fg,Dl=b.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(Pl,{ref:n,className: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(pg,{asChild:!0,children:c.jsx(Zr,{className:"h-3 w-3 shrink-0 text-zinc-400",strokeWidth:2})})]}));Dl.displayName=Pl.displayName;const _l=b.forwardRef(({className:e,children:t,position:r="popper",...n},o)=>c.jsx(hg,{children:c.jsx(Ol,{ref:o,className: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(mg,{className:oe("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));_l.displayName=Ol.displayName;const Ml=b.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(Il,{ref:n,className: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(bg,{children:c.jsx(lo,{className:"h-3 w-3",strokeWidth:2})})}),c.jsx(gg,{children:t})]}));Ml.displayName=Il.displayName;const Rl=b.createContext(null);function Ll(){const e=b.useContext(Rl);if(!e)throw new Error("Dialog components must be used within Dialog");return e}function $l({open:e,onOpenChange:t,children:r}){const[n,o]=b.useState(!1),i=e!==void 0,s=i?e:n,a=b.useCallback(d=>{i||o(d),t==null||t(d)},[i,t]),l=b.useMemo(()=>({open:s,onOpenChange:a}),[s,a]);return c.jsx(Rl.Provider,{value:l,children:r})}function wg({asChild:e,children:t}){const{onOpenChange:r}=Ll(),n=b.Children.only(t);return e&&b.isValidElement(n)?b.cloneElement(n,{onClick:o=>{var i,s;(s=(i=n.props).onClick)==null||s.call(i,o),r(!0)}}):c.jsx("button",{type:"button",onClick:()=>r(!0),children:t})}function Fl({className:e,children:t,preventCloseOnBackdropClick:r,...n}){const{open:o,onOpenChange:i}=Ll();if(b.useEffect(()=>{const a=l=>{l.key==="Escape"&&i(!1)};return o&&(document.addEventListener("keydown",a),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",a),document.body.style.overflow=""}},[o,i]),!o)return null;const s=a=>{a.preventDefault(),a.stopPropagation()};return gt.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 Wl({className:e,...t}){return c.jsx("div",{className:oe("flex flex-col gap-1.5 pb-4",e),...t})}function yg({className:e,...t}){return c.jsx("div",{className:oe("flex justify-end gap-2 pt-4",e),...t})}function Ul({className:e,...t}){return c.jsx("h2",{className:oe("text-sm font-semibold text-white",e),...t})}function Bl({className:e,...t}){return c.jsx("p",{className:oe("text-xs text-zinc-400",e),...t})}const Ye=b.forwardRef(({className:e,variant:t="default",size:r="default",asChild:n=!1,...o},i)=>{const s="inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:shrink-0 cursor-pointer",a={default:"bg-primary text-primary-foreground shadow-lg shadow-primary/20 hover:bg-primary/90",outline:"border border-zinc-700 bg-zinc-900 text-zinc-200 hover:bg-zinc-800 hover:border-zinc-600",ghost:"text-zinc-500 hover:text-zinc-200 hover:bg-zinc-800",destructive:"bg-destructive/15 text-destructive hover:bg-destructive/25"},l={sm:"h-7 px-2.5 text-[11px]",default:"h-8 px-3 py-1.5 text-xs",lg:"h-9 px-5 text-sm",icon:"h-8 w-8","icon-sm":"h-7 w-7","icon-xs":"h-6 w-6"},d=n?ep:"button";return c.jsx(d,{ref:i,type:"button",className:oe(s,a[t],l[r],e),...o})});Ye.displayName="Button";const kg=["library","upload","url"];function Sg({library:e,selectedId:t,onSelect:r}){const[n,o]=g.useState(""),[i,s]=g.useState("all"),a=["all",...new Set(e.flatMap(d=>d.tags??[]))],l=e.filter(d=>{const u=i==="all"||(d.tags??[]).includes(i),f=!n||(d.alt??"").toLowerCase().includes(n.toLowerCase());return u&&f});return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"relative",children:[c.jsx(Fd,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-zinc-600 pointer-events-none"}),c.jsx(zo,{value:n,onChange:d=>o(d.target.value),placeholder:"Cerca immagini...",className:"pl-9 h-8 text-xs bg-zinc-900/50 border-zinc-800"})]}),c.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.map(d=>c.jsx("button",{type:"button",onClick:()=>s(d),className: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(lo,{size:14,className:"text-white"})})]},d.id)})}):c.jsx("div",{className:"text-center py-12 text-zinc-600 text-xs",children:"Nessuna immagine in libreria. Configura assets.assetsManifest nel tenant (es. da public/assets)."})]})}function Cg({preview:e,onPreviewChange:t,onAssetUpload:r}){const[n,o]=g.useState(!1),i=g.useRef(null),s=g.useCallback(async u=>{if(fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:handleFile",message:"handleFile called",data:{fileName:u.name,hasOnAssetUpload:!!r},timestamp:Date.now(),hypothesisId:"H5"})}).catch(()=>{}),!u.type.startsWith("image/"))return;if(r){try{const h=await r(u);fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:handleFile",message:"onAssetUpload resolved",data:{url:h==null?void 0:h.slice(0,50)},timestamp:Date.now(),hypothesisId:"H2,H5"})}).catch(()=>{}),t({name:u.name,size:u.size,dataUrl:h})}catch{const h=new FileReader;h.onload=p=>{var w;t({name:u.name,size:u.size,dataUrl:(w=p.target)==null?void 0:w.result})},h.readAsDataURL(u)}return}const f=new FileReader;f.onload=h=>{var p;t({name:u.name,size:u.size,dataUrl:(p=h.target)==null?void 0:p.result})},f.readAsDataURL(u)},[t,r]),a=g.useCallback(u=>{var h,p;u.preventDefault(),u.stopPropagation(),o(!1);const f=(p=(h=u.dataTransfer)==null?void 0:h.files)==null?void 0:p[0];f&&s(f)},[s]),l=g.useCallback(u=>{u.preventDefault(),u.stopPropagation(),o(!0)},[]),d=g.useCallback(u=>{var h;const f=(h=u.target.files)==null?void 0:h[0];f&&s(f)},[s]);return c.jsxs("div",{onDragOver:l,onDragEnter:l,onDragLeave:u=>{u.preventDefault(),u.stopPropagation(),o(!1)},onDrop:a,onClick:()=>{var u;return!e&&((u=i.current)==null?void 0:u.click())},className: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(Ye,{type:"button",variant:"ghost",className:"text-zinc-400 hover:text-red-400 hover:bg-red-500/10 h-8 w-8 p-0",onClick:u=>{u.stopPropagation(),t(null)},children:c.jsx(en,{size:14})})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/10 flex items-center justify-center text-blue-500 mb-3",children:c.jsx(as,{size:22})}),c.jsx("p",{className:"text-sm font-medium text-white mb-1",children:"Trascina un'immagine qui"}),c.jsx("p",{className:"text-[11px] text-zinc-500 mb-3",children:"oppure clicca per selezionare un file"}),c.jsx("span",{className:"text-[10px] text-zinc-600 bg-white/[0.03] px-3 py-1 rounded",children:"PNG, JPG, WebP — max 5MB"})]}),c.jsx("input",{ref:i,type:"file",accept:"image/*",className:"hidden",onChange:d})]})}function Eg({urlPreview:e,onUrlPreviewChange:t}){const[r,n]=g.useState(""),[o,i]=g.useState(!1),s=()=>{if(r.trim())try{new URL(r),t(r),i(!1)}catch{i(!0),t(null)}};return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(It,{className:"block text-[10px] font-bold uppercase tracking-[0.08em] text-zinc-500 mb-1.5",children:"URL immagine"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(zo,{value:r,onChange:a=>{n(a.target.value),i(!1)},onKeyDown:a=>a.key==="Enter"&&s(),placeholder:"https://images.unsplash.com/photo-...",className:oe("h-8 text-xs bg-zinc-900/50 border-zinc-800",o&&"border-red-500/50")}),c.jsx(Ye,{type:"button",variant:"outline",onClick:s,className:"shrink-0 h-8",children:"Anteprima"})]}),o&&c.jsx("p",{className:"text-[11px] text-red-400 mt-1.5",children:"URL non valido. Inserisci un URL completo (https://…)"})]}),e?c.jsxs("div",{className:"rounded-lg overflow-hidden ring-1 ring-zinc-800",children:[c.jsx("img",{src:e,alt:"URL preview",className:"w-full max-h-[320px] object-contain bg-black/30",onError:()=>{i(!0),t(null)}}),c.jsxs("div",{className:"px-3.5 py-2.5 bg-white/[0.02] border-t border-zinc-800 flex items-center gap-2",children:[c.jsx(lo,{size:14,className:"text-emerald-400"}),c.jsx("span",{className:"text-[11px] text-zinc-500",children:"Immagine caricata correttamente"})]})]}):o?null:c.jsxs("div",{className:"flex flex-col items-center py-12 text-zinc-600",children:[c.jsx(is,{size:32,className:"mb-3 opacity-40"}),c.jsx("p",{className:"text-xs",children:"Incolla un URL e premi Anteprima per verificare"})]})]})}const jg=({open:e,onOpenChange:t,onSelect:r})=>{const{assets:n}=pr(),o=(n==null?void 0:n.assetsManifest)??[],[i,s]=g.useState("library"),[a,l]=g.useState(null),[d,u]=g.useState(null),[f,h]=g.useState(null);g.useEffect(()=>{e&&(s("library"),l(null),u(null),h(null))},[e]),g.useEffect(()=>{if(!e||i!=="upload")return;const y=()=>{fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:beforeunload",message:"beforeunload fired",data:{},timestamp:Date.now(),hypothesisId:"H1"})}).catch(()=>{})};return window.addEventListener("beforeunload",y),()=>window.removeEventListener("beforeunload",y)},[e,i]),g.useEffect(()=>{if(!e||i!=="upload")return;const y=x=>{x.preventDefault()},k={capture:!0};return document.addEventListener("dragover",y,k),document.addEventListener("drop",y,k),window.addEventListener("dragover",y,k),window.addEventListener("drop",y,k),()=>{document.removeEventListener("dragover",y,k),document.removeEventListener("drop",y,k),window.removeEventListener("dragover",y,k),window.removeEventListener("drop",y,k)}},[e,i]);const p=i==="library"&&a!=null||i==="upload"&&d!=null||i==="url"&&f!=null,w=()=>{if(i==="library"&&a){const y=o.find(k=>k.id===a);y&&r({url:y.url,alt:y.alt})}else i==="upload"&&d?r({url:d.dataUrl,alt:d.name}):i==="url"&&f&&r({url:f,alt:""});setTimeout(()=>t(!1),0)},m=i==="library"&&a?"1 immagine selezionata":i==="upload"&&d?d.name:i==="url"&&f?"URL pronto":"Nessuna selezione",v=y=>{y.preventDefault(),y.stopPropagation()};return c.jsx($l,{open:e,onOpenChange:t,children:c.jsxs(Fl,{className:"max-w-2xl p-0 gap-0 max-h-[90vh] flex flex-col",preventCloseOnBackdropClick:i==="upload",onDragOver:v,onDrop:v,children:[c.jsxs(Wl,{className:"px-5 py-4 flex flex-row items-start justify-between gap-4 border-b border-zinc-800",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/15 text-blue-500",children:c.jsx(Qr,{size:18})}),c.jsxs("div",{children:[c.jsx(Ul,{children:"Image Picker"}),c.jsx(Bl,{children:"Scegli dalla libreria, carica dal disco o inserisci un link"})]})]}),c.jsx("button",{type:"button",onClick:()=>t(!1),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Chiudi",children:c.jsx(Ut,{size:18})})]}),c.jsx("div",{className:"flex border-b border-zinc-800",children:kg.map(y=>c.jsxs("button",{type:"button",onClick:()=>s(y),className: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(Qr,{size:14}),y==="upload"&&c.jsx(as,{size:14}),y==="url"&&c.jsx(is,{size:14}),y==="library"?"Libreria":y==="upload"?"Upload":"URL"]},y))}),c.jsxs("div",{className:"flex-1 overflow-y-auto p-5 min-h-0",children:[i==="library"&&c.jsx(Sg,{library:o,selectedId:a,onSelect:l}),i==="upload"&&c.jsx(Cg,{preview:d,onPreviewChange:u,onAssetUpload:n==null?void 0:n.onAssetUpload}),i==="url"&&c.jsx(Eg,{urlPreview:f,onUrlPreviewChange:h})]}),c.jsxs(yg,{className:"px-5 py-4 border-t border-zinc-800 flex-row justify-between",children:[c.jsx("span",{className:"text-[10px] uppercase tracking-[0.05em] text-zinc-600",children:m}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Ye,{type:"button",variant:"outline",size:"sm",onClick:()=>t(!1),children:"Annulla"}),c.jsx(Ye,{type:"button",size:"sm",disabled:!p,onClick:w,className:oe(!p&&"opacity-40"),children:"Inserisci immagine"})]})]})]})})},Hl=(e,t="default")=>{if(e.startsWith("http")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/assets/"))return e;if(e.startsWith("assets/"))return`/${e}`;if(e.startsWith("/uploaded-assets/"))return e;if(!/\.(jpg|jpeg|png|gif|svg|pdf|webp|mp4|webm|ogg)$/i.test(e))return e.startsWith("/")?e:`/${e}`;const n=e.replace(/^\//,"");return`/assets/${t}/${n}`},Ng=({value:e,onChange:t,label:r="IMAGE",className:n})=>{const{tenantId:o="default"}=pr(),[i,s]=g.useState(!1),[a,l]=g.useState(!1),d=!!(e!=null&&e.url),u=e!=null&&e.url?Hl(e.url,o):"",f=p=>{t(p),s(!1)},h=p=>{p.stopPropagation(),t({url:"",alt:""})};return c.jsxs("div",{className:oe("space-y-1.5",n),children:[c.jsx(It,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:r}),d?c.jsxs("div",{role:"button",tabIndex:0,onClick:()=>s(!0),onKeyDown:p=>p.key==="Enter"&&s(!0),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className: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($d,{size:13}),c.jsx("span",{children:"Cambia"})]}),c.jsx(Ye,{type:"button",variant:"ghost",className:"h-8 w-8 p-0 bg-red-500/15 backdrop-blur-md text-red-300 hover:text-red-200 hover:bg-red-500/25",onClick:h,children:c.jsx(en,{size:13})})]})}),c.jsx("div",{className:"px-2.5 py-1.5 bg-black/50 text-[10px] text-zinc-500 truncate",children:((e==null?void 0:e.url)??"").length>50?"…"+((e==null?void 0:e.url)??"").slice(-47):(e==null?void 0:e.url)??""})]}):c.jsxs("button",{type:"button",onClick:()=>s(!0),className: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(Qr,{size:18})}),c.jsx("span",{className:"text-xs text-zinc-400 font-medium",children:"Clicca per aggiungere un'immagine"}),c.jsx("span",{className:"text-[10px] text-zinc-600",children:"Libreria · Upload · URL"})]}),c.jsx(jg,{open:i,onOpenChange:s,onSelect:f})]})},Vl=[{name:"layers",Icon:uo},{name:"github",Icon:Rd},{name:"arrow-right",Icon:Pd},{name:"box",Icon:Id},{name:"terminal",Icon:Bd},{name:"chevron-right",Icon:Dd},{name:"menu",Icon:Ld},{name:"x",Icon:Ut},{name:"sparkles",Icon:Ud},{name:"zap",Icon:Vd}],Gn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),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(It,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Gn(e)}),c.jsx(zo,{type:"text",className:"h-9 text-[13px] bg-zinc-900/50 border-zinc-700 focus-visible:ring-blue-600",value:t||"",onChange:n=>r(n.target.value)})]}),"ui:textarea":({label:e,value:t,onChange:r})=>c.jsxs("div",{className:"grid w-full gap-2 mb-4",children:[c.jsx(It,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Gn(e)}),c.jsx(Jf,{className:"min-h-[96px] text-[13px] bg-zinc-900/50 border-zinc-700 focus-visible:ring-blue-600 resize-none",value:t||"",onChange:n=>r(n.target.value)})]}),"ui:select":({label:e,value:t,onChange:r,options:n=[]})=>c.jsxs("div",{className:"grid w-full gap-2 mb-4",children:[c.jsx(It,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Gn(e)}),c.jsxs(vg,{value:t||"",onValueChange:r,children:[c.jsx(Dl,{className:"w-full h-9 text-[13px] bg-zinc-900/50 border-zinc-700 focus:ring-blue-600",children:c.jsx(xg,{placeholder:"Select..."})}),c.jsx(_l,{className:"dark",children:n.map(o=>c.jsx(Ml,{value:o,className:"text-[13px]",children:o},o))})]})]}),"ui:checkbox":({label:e,value:t,onChange:r})=>c.jsxs("div",{className:"flex items-center space-x-2 mb-4 p-2.5 rounded border border-zinc-700/60 bg-zinc-900/20",children:[c.jsx(Zf,{id:e,checked:!!t,onCheckedChange:n=>r(n===!0)}),c.jsx(It,{htmlFor:e,className:"text-[13px] font-medium cursor-pointer select-none text-zinc-200",children:Gn(e)})]}),"ui:image-picker":({label:e,value:t,onChange:r})=>{const n=t!=null&&typeof t=="object"&&"url"in t?{url:String(t.url??""),alt:String(t.alt??"")}:{url:typeof t=="string"?t:"",alt:""},o=i=>{r(i)};return c.jsx("div",{className:"mb-4",children:c.jsx(Ng,{label:e,value:n,onChange:o})})},"ui:icon-picker":({label:e,value:t,onChange:r})=>{const[n,o]=g.useState(!1),i=Vl.find(s=>s.name===(t||""));return c.jsxs("div",{className:"grid w-full gap-1.5 mb-4",children:[c.jsx(It,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),c.jsxs($l,{open:n,onOpenChange:o,children:[c.jsx(wg,{asChild:!0,children:c.jsx(Ye,{variant:"outline",className:"w-full h-9 rounded-md border border-zinc-800 bg-zinc-900/50 hover:bg-zinc-800/50 flex items-center gap-2 text-left",children:i?c.jsxs(c.Fragment,{children:[c.jsx(i.Icon,{size:16,className:"text-zinc-400 shrink-0"}),c.jsx("span",{className:"text-[11px] text-zinc-300 capitalize truncate",children:i.name})]}):c.jsxs(c.Fragment,{children:[c.jsx(Qr,{size:16,className:"text-zinc-500 shrink-0"}),c.jsx("span",{className:"text-[11px] text-zinc-500",children:"Choose icon..."})]})})}),c.jsxs(Fl,{className:"sm:max-w-[280px] p-4",children:[c.jsxs(Wl,{children:[c.jsx(Ul,{className:"text-sm",children:"Choose icon"}),c.jsx(Bl,{className:"text-xs",children:"Click an icon to select it."})]}),c.jsx("div",{className:"grid grid-cols-5 gap-2 py-2",children:Vl.map(({name:s,Icon:a})=>c.jsx("button",{type:"button",onClick:()=>{r(s),o(!1)},className: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))})]})]})]})}},di=e=>{if(e instanceof Te.z.ZodOptional||e instanceof Te.z.ZodDefault)return di(e._def.innerType);if(e instanceof Te.z.ZodObject){const t={id:crypto.randomUUID()};for(const r in e.shape)r!=="id"&&(t[r]=di(e.shape[r]));return t}return e instanceof Te.z.ZodArray?[]:e instanceof Te.z.ZodString?"":e instanceof Te.z.ZodNumber?0:e instanceof Te.z.ZodBoolean?!1:e instanceof Te.z.ZodEnum?e._def.values[0]:null},Yn=e=>e instanceof Te.z.ZodOptional||e instanceof Te.z.ZodDefault||e instanceof Te.z.ZodNullable?Yn(e._def.innerType):e,Kl=e=>{var n;const t=e;if(typeof e.description=="string"&&e.description.length>0)return e.description;if(typeof((n=t._def)==null?void 0:n.description)=="string"&&t._def.description.length>0)return t._def.description;const r=Yn(e);return r!==e?Kl(r):null},qn=(e,t)=>e&&!t?"opacity-10":"opacity-100",sr=(e,t)=>e!=null&&t.toLowerCase()===e.toLowerCase(),ui=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),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=Yn(h),w=Kl(h)||"ui:text",m=t[f];if(w==="ui:editorial-markdown")return null;if(w==="ui:image-picker"&&p instanceof Te.z.ZodObject){const S=sr(d,f),C=ir["ui:image-picker"]||ir["ui:text"];return c.jsx("div",{className:`transition-opacity duration-200 ${qn(u,S)}`,...S?{"data-jp-focused-field":f}:{},children:c.jsx(C,{label:f,value:m,onChange:j=>r({...t,[f]:j})})},f)}if(p instanceof Te.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 ${qn(u,C)}`,...C?{"data-jp-focused-field":f}:{},children:[c.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[c.jsx("div",{className:"w-1 h-3 bg-blue-500 rounded-full"}),c.jsx("h4",{className:"text-[11px] font-semibold text-zinc-300 tracking-[0.02em]",children:ui(f)})]}),c.jsx(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 Te.z.ZodArray){const S=Array.isArray(m)?m:[],C=Yn(p.element),j=(R,I)=>{if(I<0||I>=S.length)return;const L=[...S],[_]=L.splice(R,1);L.splice(I,0,_),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 ${qn(u,N)}`,...N?{"data-jp-focused-field":f}:{},children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsxs("label",{className:"text-[12px] font-semibold text-zinc-300 tracking-[0.01em]",children:[ui(f)," (",S.length,")"]}),c.jsxs("button",{type:"button",onClick:()=>{const R=di(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(fo,{size:12})," Add Item"]})]}),c.jsx("div",{className:"space-y-2",children:S.map((R,I)=>{const L=R,_=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)||`${ui(f)} #${I+1}`,B=D,F=String(L.id??_),U=B!=null&&String(B)===F,z=U&&o&&o.length>1?o.slice(1):void 0,X=u&&N&&B!=null&&!U;return c.jsx(Tg,{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 Te.z.ZodObject?c.jsx(Ir,{schema:C,data:L||{},expandedItemPath:z,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."})},_)})})]},f)}const v=w in ir?w:"ui:text",y=ir[v]||ir["ui:text"],k=p instanceof Te.z.ZodEnum?p._def.values:void 0,x=sr(d,f);return c.jsx("div",{className:`transition-opacity duration-200 ${qn(u,x)}`,...x?{"data-jp-focused-field":f}:{},children:c.jsx(y,{label:f,value:m,options:k,onChange:S=>r({...t,[f]:S})})},f)})})},Tg=({itemId:e,openItemId:t,isFaded:r=!1,label:n,onExpandedChange:o,onRemove:i,onMoveUp:s,onMoveDown:a,isFirst:l,isLast:d,children:u})=>{const f=t!=null&&String(t)===String(e),[h,p]=g.useState(f);g.useEffect(()=>{t!=null&&(f&&!h&&p(!0),!f&&h&&p(!1))},[t,f,h]);const w=()=>{const v=!h;p(v),o==null||o(v)},m=f&&h;return c.jsxs("div",{className:`border border-zinc-800 rounded-md bg-zinc-900/40 overflow-hidden transition-opacity duration-200 ${r?"opacity-10":"opacity-100"}`,...m?{"data-jp-expanded-item":e}:{},children:[c.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-zinc-900/60",children:[c.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:c.jsxs("button",{type:"button",onClick:w,className:"flex items-center gap-2 text-[12px] font-semibold text-zinc-200 tracking-[0.01em] truncate",children:[h?c.jsx(co,{size:12,className:"shrink-0"}):c.jsx(Zr,{size:12,className:"shrink-0"}),c.jsx("span",{className:"truncate",children:n})]})}),c.jsxs("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[c.jsx("button",{type:"button",disabled:l,onClick:s,className:"text-zinc-500 hover:text-blue-400 disabled:opacity-20 p-1 transition-colors",children:c.jsx(Od,{size:12})}),c.jsx("button",{type:"button",disabled:d,onClick:a,className:"text-zinc-500 hover:text-blue-400 disabled:opacity-20 p-1 transition-colors",children:c.jsx(zd,{size:12})}),c.jsx("div",{className:"w-px h-3 bg-zinc-800 mx-1"}),c.jsx("button",{type:"button",onClick:i,className:"text-zinc-600 hover:text-red-500 transition-colors p-1",children:c.jsx(en,{size:12})})]})]}),h&&c.jsx("div",{className:"p-4 border-t border-zinc-800 bg-black/20",children:u})]})};function Ag(e,t){return b.useReducer((r,n)=>t[r][n]??r,e)}var Dr=e=>{const{present:t,children:r}=e,n=zg(t),o=typeof r=="function"?r({present:n.isPresent}):b.Children.only(r),i=Ee(n.ref,Pg(o));return typeof r=="function"||n.isPresent?b.cloneElement(o,{ref:i}):null};Dr.displayName="Presence";function zg(e){const[t,r]=b.useState(),n=b.useRef(null),o=b.useRef(e),i=b.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Ag(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const d=Xn(n.current);i.current=a==="mounted"?d:"none"},[a]),Re(()=>{const d=n.current,u=o.current;if(u!==e){const h=i.current,p=Xn(d);e?l("MOUNT"):p==="none"||(d==null?void 0:d.display)==="none"?l("UNMOUNT"):l(u&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Re(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,f=p=>{const m=Xn(n.current).includes(CSS.escape(p.animationName));if(p.target===t&&m&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=p=>{p.target===t&&(i.current=Xn(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:b.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function Xn(e){return(e==null?void 0:e.animationName)||"none"}function Pg(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var[Jn]=Tr("Tooltip",[Qt]),Zn=Qt(),Gl="TooltipProvider",Og=700,fi="tooltip.open",[Ig,pi]=Jn(Gl),Yl=e=>{const{__scopeTooltip:t,delayDuration:r=Og,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:i}=e,s=b.useRef(!0),a=b.useRef(!1),l=b.useRef(0);return b.useEffect(()=>{const d=l.current;return()=>window.clearTimeout(d)},[]),c.jsx(Ig,{scope:t,isOpenDelayedRef:s,delayDuration:r,onOpen:b.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:b.useCallback(d=>{a.current=d},[]),disableHoverableContent:o,children:i})};Yl.displayName=Gl;var _r="Tooltip",[Dg,Mr]=Jn(_r),ql=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=pi(_r,e.__scopeTooltip),d=Zn(t),[u,f]=b.useState(null),h=Ar(),p=b.useRef(0),w=s??l.disableHoverableContent,m=a??l.delayDuration,v=b.useRef(!1),[y,k]=_n({prop:n,defaultProp:o??!1,onChange:N=>{N?(l.onOpen(),document.dispatchEvent(new CustomEvent(fi))):l.onClose(),i==null||i(N)},caller:_r}),x=b.useMemo(()=>y?v.current?"delayed-open":"instant-open":"closed",[y]),S=b.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v.current=!1,k(!0)},[k]),C=b.useCallback(()=>{window.clearTimeout(p.current),p.current=0,k(!1)},[k]),j=b.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{v.current=!0,k(!0),p.current=0},m)},[m,k]);return b.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),c.jsx(qo,{...d,children:c.jsx(Dg,{scope:t,contentId:h,open:y,stateAttribute:x,trigger:u,onTriggerChange:f,onTriggerEnter:b.useCallback(()=>{l.isOpenDelayedRef.current?j():S()},[l.isOpenDelayedRef,j,S]),onTriggerLeave:b.useCallback(()=>{w?C():(window.clearTimeout(p.current),p.current=0)},[C,w]),onOpen:S,onClose:C,disableHoverableContent:w,children:r})})};ql.displayName=_r;var hi="TooltipTrigger",Xl=b.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Mr(hi,r),i=pi(hi,r),s=Zn(r),a=b.useRef(null),l=Ee(t,a,o.onTriggerChange),d=b.useRef(!1),u=b.useRef(!1),f=b.useCallback(()=>d.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),c.jsx(In,{asChild:!0,...s,children:c.jsx(ke.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:l,onPointerMove:he(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:he(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:he(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:he(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:he(e.onBlur,o.onClose),onClick:he(e.onClick,o.onClose)})})});Xl.displayName=hi;var mi="TooltipPortal",[_g,Mg]=Jn(mi,{forceMount:void 0}),Jl=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,i=Mr(mi,t);return c.jsx(_g,{scope:t,forceMount:r,children:c.jsx(Dr,{present:r||i.open,children:c.jsx(Dn,{asChild:!0,container:o,children:n})})})};Jl.displayName=mi;var ar="TooltipContent",Zl=b.forwardRef((e,t)=>{const r=Mg(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(Ql,{side:o,...i,ref:t}):c.jsx(Rg,{side:o,...i,ref:t})})}),Rg=b.forwardRef((e,t)=>{const r=Mr(ar,e.__scopeTooltip),n=pi(ar,e.__scopeTooltip),o=b.useRef(null),i=Ee(t,o),[s,a]=b.useState(null),{trigger:l,onClose:d}=r,u=o.current,{onPointerInTransitChange:f}=n,h=b.useCallback(()=>{a(null),f(!1)},[f]),p=b.useCallback((w,m)=>{const v=w.currentTarget,y={x:w.clientX,y:w.clientY},k=Ug(y,v.getBoundingClientRect()),x=Bg(y,k),S=Hg(m.getBoundingClientRect()),C=Kg([...x,...S]);a(C),f(!0)},[f]);return b.useEffect(()=>()=>h(),[h]),b.useEffect(()=>{if(l&&u){const w=v=>p(v,u),m=v=>p(v,l);return l.addEventListener("pointerleave",w),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",w),u.removeEventListener("pointerleave",m)}}},[l,u,p,h]),b.useEffect(()=>{if(s){const w=m=>{const v=m.target,y={x:m.clientX,y:m.clientY},k=(l==null?void 0:l.contains(v))||(u==null?void 0:u.contains(v)),x=!Vg(y,s);k?h():x&&(h(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[l,u,s,d,h]),c.jsx(Ql,{...e,ref:i})}),[Lg,$g]=Jn(_r,{isInside:!1}),Fg=rp("TooltipContent"),Ql=b.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=Mr(ar,r),d=Zn(r),{onClose:u}=l;return b.useEffect(()=>(document.addEventListener(fi,u),()=>document.removeEventListener(fi,u)),[u]),b.useEffect(()=>{if(l.trigger){const f=h=>{const p=h.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),c.jsx(kn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:c.jsxs(Xo,{"data-state":l.stateAttribute,...d,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(Fg,{children:n}),c.jsx(Lg,{scope:r,isInside:!0,children:c.jsx(em,{id:l.contentId,role:"tooltip",children:o||n})})]})})});Zl.displayName=ar;var ec="TooltipArrow",Wg=b.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Zn(r);return $g(ec,r).isInside?null:c.jsx(Jo,{...o,...n,ref:t})});Wg.displayName=ec;function Ug(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,o,i)){case i:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Bg(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Hg(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function Vg(e,t){const{x:r,y:n}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i],l=t[s],d=a.x,u=a.y,f=l.x,h=l.y;u>n!=h>n&&r<(f-d)*(n-u)/(h-u)+d&&(o=!o)}return o}function Kg(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),Gg(t)}function Gg(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const i=r[r.length-1],s=r[r.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Yg=Yl,qg=ql,Xg=Xl,Jg=Jl,tc=Zl;const Zg=Yg,Rr=qg,Lr=Xg,lr=b.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(Jg,{children:c.jsx(tc,{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=tc.displayName;var Qn="Popover",[rc]=Tr(Qn,[Qt]),$r=Qt(),[Qg,Et]=rc(Qn),nc=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=$r(t),l=b.useRef(null),[d,u]=b.useState(!1),[f,h]=_n({prop:n,defaultProp:o??!1,onChange:i,caller:Qn});return c.jsx(qo,{...a,children:c.jsx(Qg,{scope:t,contentId:Ar(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:b.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:d,onCustomAnchorAdd:b.useCallback(()=>u(!0),[]),onCustomAnchorRemove:b.useCallback(()=>u(!1),[]),modal:s,children:r})})};nc.displayName=Qn;var oc="PopoverAnchor",e0=b.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Et(oc,r),i=$r(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return b.useEffect(()=>(s(),()=>a()),[s,a]),c.jsx(In,{...i,...n,ref:t})});e0.displayName=oc;var ic="PopoverTrigger",sc=b.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Et(ic,r),i=$r(r),s=Ee(t,o.triggerRef),a=c.jsx(ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":uc(o.open),...n,ref:s,onClick:he(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:c.jsx(In,{asChild:!0,...i,children:a})});sc.displayName=ic;var gi="PopoverPortal",[t0,r0]=rc(gi,{forceMount:void 0}),ac=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Et(gi,t);return c.jsx(t0,{scope:t,forceMount:r,children:c.jsx(Dr,{present:r||i.open,children:c.jsx(Dn,{asChild:!0,container:o,children:n})})})};ac.displayName=gi;var cr="PopoverContent",lc=b.forwardRef((e,t)=>{const r=r0(cr,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Et(cr,e.__scopePopover);return c.jsx(Dr,{present:n||i.open,children:i.modal?c.jsx(o0,{...o,ref:t}):c.jsx(i0,{...o,ref:t})})});lc.displayName=cr;var n0=Yt("PopoverContent.RemoveScroll"),o0=b.forwardRef((e,t)=>{const r=Et(cr,e.__scopePopover),n=b.useRef(null),o=Ee(t,n),i=b.useRef(!1);return b.useEffect(()=>{const s=n.current;if(s)return Ya(s)},[]),c.jsx(ni,{as:n0,allowPinchZoom:!0,children:c.jsx(cc,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:he(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:he(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:he(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),i0=b.forwardRef((e,t)=>{const r=Et(cr,e.__scopePopover),n=b.useRef(!1),o=b.useRef(!1);return c.jsx(cc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{var l,d;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),cc=b.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:u,...f}=e,h=Et(cr,r),p=$r(r);return sa(),c.jsx(_o,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:c.jsx(kn,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),children:c.jsx(Xo,{"data-state":uc(h.open),role:"dialog",id:h.contentId,...p,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),dc="PopoverClose",s0=b.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Et(dc,r);return c.jsx(ke.button,{type:"button",...n,ref:t,onClick:he(e.onClick,()=>o.onOpenChange(!1))})});s0.displayName=dc;var a0="PopoverArrow",l0=b.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=$r(r);return c.jsx(Jo,{...o,...n,ref:t})});l0.displayName=a0;function uc(e){return e?"open":"closed"}var c0=nc,d0=sc,u0=ac,fc=lc;const f0=c0,p0=d0,pc=b.forwardRef(({className:e,align:t="start",sideOffset:r=6,...n},o)=>c.jsx(u0,{children:c.jsx(fc,{ref:o,align:t,sideOffset:r,className: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})}));pc.displayName=fc.displayName;const hc=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"Select page",h0=({pageSlugs:e,currentSlug:t,onPageChange:r,sectionCount:n,onNewPage:o,className:i,currentPageLabel:s})=>{const[a,l]=g.useState(!1),d=s??hc(t),u=f=>{r(f),l(!1)};return c.jsx("div",{className:oe("mx-3 mt-2 mb-2",i),children:c.jsxs(f0,{open:a,onOpenChange:l,children:[c.jsx(p0,{asChild:!0,children:c.jsxs("button",{type:"button","aria-haspopup":"listbox","aria-label":`Select page, current: ${d}`,className: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(Md,{size:14,className:"shrink-0 text-zinc-500","aria-hidden":!0}),c.jsx("span",{className:"text-xs font-medium flex-1 truncate",children:d}),c.jsx(Zr,{size:13,className:"shrink-0 text-zinc-500","aria-hidden":!0})]})}),c.jsxs(pc,{align:"start",sideOffset:4,className:"min-w-[var(--radix-popover-trigger-width)] bg-zinc-950 border-zinc-800 p-1",role:"listbox","aria-label":"Page list",children:[e.map(f=>{const h=f===t,p=hc(f);return c.jsxs("button",{type:"button",role:"option","aria-selected":h,onClick:()=>u(f),className: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(fo,{size:12,"aria-hidden":!0}),c.jsx("span",{children:"New page"})]})})]})]})})},bi=new Set(["anchorId","paddingTop","paddingBottom","theme","container"]),mc=new Set(["ui:editorial-markdown"]),gc=e=>e instanceof Te.z.ZodOptional||e instanceof Te.z.ZodDefault||e instanceof Te.z.ZodNullable?gc(e._def.innerType):e,vi=e=>{var i;if(!e)return"";const t=e,r=typeof e.description=="string"?e.description:null;if(r)return r;const n=typeof((i=t._def)==null?void 0:i.description)=="string"?t._def.description:null;if(n)return n;const o=gc(e);return o!==e?vi(o):""},xi=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),m0={activationConstraint:{distance:8}},g0={activationConstraint:{delay:200,tolerance:5}};function wi({layer:e,opts:t,dragHandleProps:r}){const{isSelected:n,isActive:o,isDragging:i,canDelete:s,onSelect:a,onOpenSettings:l,onDelete:d}=t,u=!!r;return c.jsxs("div",{className: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(os,{size:12,className:"text-zinc-600"})}):c.jsx("span",{className:"shrink-0 w-5 flex items-center justify-center opacity-0 group-hover:opacity-100 pointer-events-none",children:c.jsx(os,{size:12,className:"text-zinc-600/50"})}),c.jsxs("button",{type:"button",onClick:a,className:"flex-1 min-w-0 text-left",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className: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(Ye,{variant:"ghost",size:"icon-xs",className:"text-zinc-600 hover:text-zinc-300",onClick:f=>{f.stopPropagation(),l(f)},children:c.jsx(Wd,{size:12})})}),c.jsx(lr,{children:"Settings"})]}),s&&c.jsxs(Rr,{children:[c.jsx(Lr,{asChild:!0,children:c.jsx(Ye,{variant:"ghost",size:"icon-xs",className:"text-zinc-600 hover:text-destructive",onClick:f=>{f.stopPropagation(),d()},children:c.jsx(en,{size:12})})}),c.jsx(lr,{children:"Delete section"})]})]})]})}function b0({layer:e,opts:t}){const{attributes:r,listeners:n,setNodeRef:o,transform:i,transition:s,isDragging:a}=Kf({id:e.id,disabled:!t.canReorder}),l={transform:vt.Transform.toString(i),transition:s};return c.jsx("div",{ref:o,style:l,className:oe(a&&"z-10"),children:c.jsx(wi,{layer:e,opts:{...t,isDragging:a},dragHandleProps:t.canReorder?{...r,...n,"aria-roledescription":"elemento trascinabile"}:void 0})})}const bc=({selectedSection:e,pageData:t,allSectionsData:r=[],onUpdate:n,onUpdateSection:o,onClose:i,expandedItemPath:s=null,onReorderSection:a,allLayers:l=[],activeSectionId:d,onRequestScrollToSection:u,onDeleteSection:f,onAddSection:h,hasChanges:p=!1,onSaveToFile:w,onHotSave:m,saveSuccessFeedback:v=!1,hotSaveSuccessFeedback:y=!1,hotSaveInProgress:k=!1,showLegacySave:x=!0,showHotSave:S=!1,onResetToFile:C,showResetToFile:j=!1,pageSlugs:N=[],currentSlug:E="home",onPageChange:D})=>{const{schemas:R}=pr(),[I,L]=g.useState(!0),[_,G]=g.useState(null),[B,F]=g.useState(null),[U,z]=g.useState(null),[X,re]=g.useState(null),T=g.useRef(null),$=g.useRef(null),Y=bu(vo(Eo,m0),vo(Os,g0),vo(So,{coordinateGetter:qf})),K=g.useDeferredValue(e),ge=e!=null&&(K==null?void 0:K.id)!==e.id,se=s&&s.length>0?s:U?[U]:null,P=se!=null&&se.length?{fieldKey:se[se.length-1].fieldKey,itemId:se[se.length-1].itemId}:null,J=g.useRef(s);g.useEffect(()=>{J.current!=null&&s==null&&z(null),J.current=s},[s]),g.useEffect(()=>{(e==null?void 0:e.id)!=null&&L(!1)},[e==null?void 0:e.id]);const ee=()=>{const M=requestAnimationFrame(()=>{requestAnimationFrame(()=>{const Z=T.current;Z&&Z.scrollTo({top:0,behavior:"smooth"})})});return()=>cancelAnimationFrame(M)},W=g.useRef(I);g.useEffect(()=>{if(I&&!W.current){const M=ee();return W.current=I,M}W.current=I},[I]),g.useEffect(()=>{if(!P)return;const M=T.current;if(!M)return;const Z=requestAnimationFrame(()=>{const ie=M.querySelector("[data-jp-expanded-item]")??M.querySelector("[data-jp-focused-field]");ie&&ie.scrollIntoView({behavior:"smooth",block:"start"})});return()=>cancelAnimationFrame(Z)},[P]);const ne=M=>{L(!1),u==null||u(M)},te=()=>{L(M=>{const Z=!M;return Z&&ee(),Z})},we=(M,Z)=>{Z.stopPropagation(),r.length>0&&o?re(M):(L(!1),u==null||u(M))};g.useEffect(()=>{if(X==null)return;const M=Z=>{Z.key==="Escape"&&re(null)};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[X]);const be=M=>{_===M?(f==null||f(M),G(null)):(G(M),setTimeout(()=>G(null),3e3))},Pe=g.useMemo(()=>l.filter(M=>M.scope==="local").map(M=>M.id),[l]),De=!!a&&Pe.length>0,Ue=M=>{F(M.active.id)},jt=M=>{F(null);const{active:Z,over:ie}=M;if(!ie||Z.id===ie.id||!a)return;const fe=l.findIndex(Oe=>Oe.id===Z.id),_e=l.findIndex(Oe=>Oe.id===ie.id);if(fe===-1||_e===-1)return;const Se=fe<_e?_e:_e-1;a(Z.id,Se)},qe=e?t.sections.find(M=>M.id===e.id):void 0,Be=K?t.sections.find(M=>M.id===K.id):void 0,He=K?R[K.type]:void 0,ht=g.useMemo(()=>{if(!He)return!1;const M=He.shape,Z=Object.keys(M).filter(ie=>!bi.has(ie));return Z.length===0?!1:Z.every(ie=>mc.has(vi(M[ie])))},[He]);g.useEffect(()=>{(e==null?void 0:e.id)!=null&&ht&&L(!0)},[e==null?void 0:e.id,ht]);const Xe=l.length>0&&(I||!e),Nt=E?E.charAt(0).toUpperCase()+E.slice(1):"Select page",Ur=g.useMemo(()=>{const M=[];let Z=null;for(const ie of l){const fe=ie.type.toUpperCase(),_e=Z!==null&&(Z==="HEADER"&&fe!=="HEADER"||Z!=="HEADER"&&Z!=="FOOTER"&&fe==="FOOTER");M.push({layer:ie,showSeparatorAbove:_e}),Z=fe}return M},[l]);return c.jsx(Zg,{children:c.jsxs("aside",{className:"relative w-full h-full bg-zinc-950 border-l border-zinc-800 flex flex-col shadow-2xl shrink-0 min-w-0 animate-in slide-in-from-right duration-300",children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800 shrink-0",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("h2",{className:"text-sm font-bold text-white",children:"Inspector"}),c.jsx("p",{className:"text-[10px] tracking-[0.06em] text-zinc-600 mt-0.5",children:e?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-primary font-bold",children:e.type}),c.jsx("span",{className:"text-zinc-700 mx-1.5",children:"|"}),c.jsx("span",{className:"uppercase",children:e.scope})]}):c.jsxs("span",{className:"text-zinc-600",children:[Nt," · ",l.length," sections"]})})]}),c.jsx(Ye,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":"Close Inspector",children:c.jsx(Ut,{size:14})})]}),N.length>0&&D&&c.jsx(h0,{pageSlugs:N,currentSlug:E,onPageChange:D,sectionCount:l.length,currentPageLabel:Nt}),l.length>0&&c.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-t border-zinc-800/50",children:[c.jsxs("button",{type:"button",onClick:te,className:"flex items-center gap-2 flex-1 cursor-pointer min-w-0 text-left","aria-expanded":Xe,"aria-label":Xe?"Collapse Page Layers":"Expand Page Layers",children:[c.jsx(uo,{size:14,className:"text-zinc-500 shrink-0"}),c.jsx("span",{className:"text-[11px] font-semibold tracking-[0.04em] text-zinc-400",children:"Page Layers"}),c.jsxs("span",{className:"text-[10px] text-zinc-600",children:["(",l.length,")"]}),c.jsx(co,{size:13,className: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(Ye,{variant:"ghost",size:"icon-sm",className:"text-zinc-500 hover:text-primary",onClick:h,children:c.jsx(fo,{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:Xe&&c.jsxs("div",{className:"py-1",children:[c.jsxs(mf,{sensors:Y,collisionDetection:wu,modifiers:[If],onDragStart:Ue,onDragEnd:jt,accessibility:{announcements:{onDragStart:()=>"Sezione presa in carico. Usa i tasti freccia per spostare, Spazio per rilasciare.",onDragOver:({over:M})=>M?`Posizione ${Pe.indexOf(String(M.id))+1} di ${Pe.length}.`:void 0,onDragEnd:({over:M})=>M?"Sezione rilasciata in nuova posizione.":"Riposizionamento annullato.",onDragCancel:()=>"Riposizionamento annullato."}},children:[c.jsx($f,{items:Pe,strategy:Rf,children:c.jsx("div",{className:"px-2 space-y-0.5",children:Ur.map(({layer:M,showSeparatorAbove:Z})=>c.jsxs(g.Fragment,{children:[Z&&c.jsx("div",{className:"mx-3 border-t border-zinc-800/60 my-1"}),M.scope==="local"&&De?c.jsx(b0,{layer:M,opts:{isSelected:(e==null?void 0:e.id)===M.id,isActive:d===M.id,isDragging:!1,canReorder:!0,canDelete:!!f,deleteConfirm:_===M.id,onSelect:()=>ne(M.id),onDelete:()=>be(M.id),onOpenSettings:ie=>we(M.id,ie)}}):c.jsx("div",{children:c.jsx(wi,{layer:M,opts:{isSelected:(e==null?void 0:e.id)===M.id,isActive:d===M.id,isDragging:!1,canDelete:M.scope==="local"&&!!f,deleteConfirm:_===M.id,onSelect:()=>ne(M.id),onDelete:()=>be(M.id),onOpenSettings:ie=>we(M.id,ie)}})})]},M.id))})}),c.jsx(Of,{dropAnimation:{duration:200,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:B?(()=>{const M=l.find(Z=>Z.id===B);return M?c.jsx("div",{className:"px-2 w-full max-w-[var(--inspector-width,280px)]",children:c.jsx(wi,{layer:M,opts:{isSelected:!1,isActive:!1,isDragging:!0,canDelete:!1,deleteConfirm:!1,onSelect:()=>{},onDelete:()=>{},onOpenSettings:()=>{}},dragHandleProps:{"aria-hidden":!0}})}):null})():null})]}),_&&c.jsxs("div",{className:"flex items-center gap-2 py-2 px-3 mt-1 mx-2 rounded-md bg-amber-500/10 border border-amber-500/30",children:[c.jsx(_d,{size:12,className:"text-amber-500 shrink-0"}),c.jsx("p",{className:"text-[10px] text-amber-500 font-medium",children:"Click delete again to confirm"})]})]})}),P&&qe&&(()=>{const M=qe.data||{};let Z;if(se&&se.length>0){let ie=M;for(const Se of se){const Oe=ie==null?void 0:ie[Se.fieldKey];Se.itemId!=null&&Array.isArray(Oe)?ie=Oe.find(A=>String(A==null?void 0:A.id)===String(Se.itemId))??null:ie=Oe}const fe=ie||{},_e=P.fieldKey;Z=(typeof fe.name=="string"?fe.name:null)??(typeof fe.title=="string"?fe.title:null)??(typeof fe.label=="string"?fe.label:null)??xi(_e)}else{const ie=P.fieldKey;if(P.itemId!=null){const Se=(Array.isArray(M[ie])?M[ie]:[]).find(Oe=>String(Oe==null?void 0:Oe.id)===String(P.itemId))||{};Z=(typeof Se.name=="string"?Se.name:null)??(typeof Se.title=="string"?Se.title:null)??(typeof Se.label=="string"?Se.label:null)??xi(ie)}else Z=xi(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:Z})]})})(),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"})]}):He?(()=>{const Z=Object.keys(He.shape).filter(fe=>!bi.has(fe)&&!mc.has(vi(He.shape[fe]))),ie=(Be==null?void 0:Be.data)||{};return Z.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:He,data:ie,onChange:fe=>n(fe),keys:Z,expandedItemPath:se,onSidebarExpandedItemChange:z})})():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(Ye,{size:"default",disabled:!p,className:"h-9 min-w-[156px] px-5 text-sm gap-2 ml-auto",onClick:M=>{M.preventDefault(),M.stopPropagation(),w()},children:[c.jsx(ss,{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(Ye,{size:"default",disabled:!p||k,className:"h-9 min-w-[156px] px-5 text-sm gap-2 ml-auto",onClick:M=>{M.preventDefault(),M.stopPropagation(),m()},children:[c.jsx(ss,{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 M=r.find(A=>A.id===X),Z=l.find(A=>A.id===X);if(!M)return null;const ie=(Z==null?void 0:Z.scope)==="global"?"global":"local",fe=M.type,_e=R[fe],Oe=(_e?Object.keys(_e.shape):[]).filter(A=>bi.has(A)),Lt=M.data??{};return Oe.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:A=>A.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:A=>A.target===A.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:A=>A.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:_e,data:Lt,onChange:A=>{const O={...M.data,...A};o(X,ie,fe,O)},keys:Oe})})]})})})()]})})},vc=({draft:e,globalDraft:t,menuConfig:r,themeConfig:n,slug:o,selectedId:i,scrollToSectionId:s,onScrollRequested:a})=>{const l=g.useRef(null),d=g.useCallback(()=>{var u;(u=l.current)!=null&&u.contentWindow&&l.current.contentWindow.postMessage({type:xe.UPDATE_DRAFTS,draft:e,globalDraft:t,menuConfig:r,themeConfig:n},"*")},[e,t,r,n]);return g.useEffect(()=>{d()},[d]),g.useEffect(()=>{const u=f=>{f.data.type===xe.STAGE_READY&&d()};return window.addEventListener("message",u),()=>window.removeEventListener("message",u)},[d]),g.useEffect(()=>{var u;(u=l.current)!=null&&u.contentWindow&&l.current.contentWindow.postMessage({type:xe.SYNC_SELECTION,selectedId:i},"*")},[i]),g.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"})})},yi=new Set;function v0(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function xc(e,t=[],r={}){return Object.entries(e).forEach(([n,o])=>{const i=[...t,v0(n)];if(typeof o=="string"||typeof o=="number"){r[`--theme-${i.join("-")}`]=String(o);return}o&&typeof o=="object"&&!Array.isArray(o)&&xc(o,i,r)}),r}function We(e,t,r,n){n&&(e[t]=`var(${r})`)}function x0(e){const t=xc(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 eo={setTheme:e=>{const t=document.documentElement,r=x0(e);yi.forEach(n=>{t.style.removeProperty(n)}),yi.clear(),Object.entries(r).forEach(([n,o])=>{t.style.setProperty(n,o),yi.add(n)})}};function w0(e,t){if(!t)return e;const r=e[e.length-1];return r&&r.itemId==null&&r.fieldKey===t?e:[...e,{fieldKey:t}]}function wc(e,t){var i,s,a;const r=[];let n=null,o=e;for(;o&&o!==t;){const l=(i=o.getAttribute)==null?void 0:i.call(o,"data-jp-item-id"),d=(s=o.getAttribute)==null?void 0:s.call(o,"data-jp-item-field");if(l&&d&&r.push({fieldKey:d,itemId:l}),n==null){const u=(a=o.getAttribute)==null?void 0:a.call(o,"data-jp-field");u&&(n=u)}o=o.parentElement}return r.reverse(),w0(r,n)}const y0='[data-jp-ignore-select="true"],[data-jp-interactive="true"],.ProseMirror,[contenteditable="true"],button,input,textarea,select,[role="button"],[role="menuitem"]',k0="[data-jp-field],[data-jp-item-id],[data-jp-item-field]",yc=()=>{var h;const[e,t]=g.useState(null),[r,n]=g.useState(null),[o,i]=g.useState({main:[]}),[s,a]=g.useState(null),[l,d]=g.useState(null);if(g.useEffect(()=>{const p=w=>{var m;if(!(w.origin!==window.location.origin||w.source!==window.parent)&&(w.data.type===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&&eo.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)},[]),g.useEffect(()=>{const p=v=>!!v.closest(k0),w=v=>!!(v.closest('[data-jp-ignore-select="true"]')||v.closest(y0)&&!p(v)||v.closest("a[href]")&&!p(v)),m=v=>{var _,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=(_=C.getAttribute)==null?void 0:_.call(C,"data-section-id"),U=(G=C.getAttribute)==null?void 0:G.call(C,"data-section-type"),z=(B=C.getAttribute)==null?void 0:B.call(C,"data-section-scope");if(F&&U&&z){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=wc(R,S);if(I.length===0&&R){let F=null;const U=z=>{var re,T;const X=z.getBoundingClientRect();if(X.left<=k&&k<=X.right&&X.top<=x&&x<=X.bottom){for(let $=0;$<z.children.length;$++)U(z.children[$]);((re=z.getAttribute)!=null&&re.call(z,"data-jp-item-id")||(T=z.getAttribute)!=null&&T.call(z,"data-jp-field"))&&(F=z)}};U(R),F&&(I=wc(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)},[]),g.useEffect(()=>{if(!l)return;const p=setTimeout(()=>d(null),600);return()=>clearTimeout(p)},[l]),!e||!r)return c.jsx("div",{className:"flex items-center justify-center h-screen w-full bg-zinc-950 text-zinc-500 font-mono text-xs uppercase tracking-widest animate-pulse",children:"Waiting for Studio Signal..."});const u={main:nn((h=r.header)==null?void 0:h.data,o.main)},f=p=>{window.parent.postMessage({type:xe.ACTIVE_SECTION_CHANGED,activeSectionId:p},"*")};return c.jsx(Jr,{mode:"studio",children:c.jsx("div",{className:"jp-ice-active",children:c.jsx(ho,{pageConfig:e,siteConfig:r,menuConfig:u,selectedId:s,scrollToSectionId:l,onActiveSectionChange:f})})})};function S0(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const kc=({open:e,onClose:t,sectionTypes:r,sectionTypeLabels:n,onSelect:o})=>{if(g.useEffect(()=>{if(!e)return;const s=a=>{a.key==="Escape"&&t()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,t]),!e)return null;const i=s=>(n==null?void 0:n[s])??S0(s);return c.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",role:"dialog","aria-modal":"true","aria-labelledby":"jp-add-section-title",children:[c.jsx("div",{className:"absolute inset-0 bg-zinc-950/80 backdrop-blur-sm",onClick:t,"aria-hidden":"true"}),c.jsxs("div",{className:"relative w-full max-w-md max-h-[85vh] flex flex-col rounded-xl border border-zinc-700 bg-zinc-900 shadow-2xl overflow-hidden",children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-zinc-800 shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/20 text-blue-400",children:c.jsx(uo,{size:18})}),c.jsx("h2",{id:"jp-add-section-title",className:"text-sm font-bold text-white",children:"Add section"})]}),c.jsx("button",{type:"button",onClick:t,className:"p-1.5 rounded-md text-zinc-400 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close",children:c.jsx(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"})})]})]})},Sc=()=>c.jsxs("div",{style:{"--local-bg":"var(--color-background)","--local-text":"var(--color-text)","--local-text-muted":"var(--color-text-muted)","--local-primary":"var(--color-primary)","--local-radius-md":"var(--radius-md)"},className:"min-h-screen flex flex-col items-center justify-center bg-[var(--local-bg)] px-6",children:[c.jsx("h1",{className:"text-6xl font-bold text-[var(--local-text)] mb-4",children:"404"}),c.jsx("p",{className:"text-xl text-[var(--local-text-muted)] mb-8",children:"Page not found"}),c.jsx("a",{href:"/",className:"inline-flex items-center gap-2 px-6 py-3 rounded-[var(--local-radius-md)] bg-[var(--local-primary)] text-[var(--local-bg)] font-semibold text-sm hover:opacity-90 transition-opacity",children:"Back to Home"})]});function ki(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Cc(e){return e==null?e:JSON.parse(JSON.stringify(e))}function Ec(){if(typeof window>"u")return null;const e=window;return e.__olonWebMcpTools__||(e.__olonWebMcpTools__=new Map),e.__olonWebMcpTools__}const Fr="update-section-draft",to="save-project-state";function jc(){return{type:"object",additionalProperties:!1,properties:{slug:{type:"string"},sectionId:{type:"string",description:"The unique ID of the section to update (found via data-jp-section-id or MCP read)."},sectionType:{type:"string",description:'The type of the section being updated (e.g. "olon-hero"). Used to pick the correct validation schema.'},scope:{type:"string",enum:["local","global"],default:"local"},data:{type:"object",description:"Full replacement payload validated against the section's schema."},itemPath:{type:"array",description:"Optional root-to-leaf path for targeted field updates.",items:{type:"object",additionalProperties:!1,properties:{fieldKey:{type:"string"},itemId:{type:"string"}},required:["fieldKey"]}},fieldKey:{type:"string",description:"Shorthand for a top-level scalar field update when itemPath is omitted."},value:{description:"Value written to the targeted field or array item."}},required:["sectionId"],oneOf:[{required:["data"]},{required:["itemPath","value"]},{required:["fieldKey","value"]}]}}function Nc(){return{type:"object",additionalProperties:!1,properties:{message:{type:"string",description:"Optional save reason or commit message equivalent."}}}}function Si(e,t,r){if(t.length===0)throw new Error("Selection path is empty.");const n=Cc(e);let o=n;for(let i=0;i<t.length;i+=1){const s=t[i],a=i===t.length-1;if(!ki(o))throw new Error(`Cannot navigate path segment "${s.fieldKey}" on a non-object value.`);if(s.itemId!=null){const l=o[s.fieldKey];if(!Array.isArray(l))throw new Error(`Field "${s.fieldKey}" is not an array.`);const d=l.findIndex(u=>ki(u)&&String(u.id??"")===String(s.itemId));if(d===-1)throw new Error(`Array item "${s.itemId}" not found under "${s.fieldKey}".`);if(a)return l[d]=r,n;o=l[d];continue}if(a)return o[s.fieldKey]=r,n;o=o[s.fieldKey]}return n}function Ci(e,t){if(t.data&&ki(t.data))return Cc(t.data);if(Array.isArray(t.itemPath)&&t.itemPath.length>0)return Si(e,t.itemPath,t.value);if(typeof t.fieldKey=="string"&&t.fieldKey.trim().length>0)return Si(e,[{fieldKey:t.fieldKey}],t.value);throw new Error('WebMCP mutation requires either "data", "itemPath", or "fieldKey".')}async function Tc(e){if(e.startsWith("olon://pages/")){const t=e.replace("olon://pages/",""),r=window.location.pathname.replace(/\/admin(\/.*)?$/,"").replace(/\/$/,""),n=await fetch(`${r}/pages/${t}.json`);if(!n.ok)throw new Error(`Resource not found: ${e} (at ${r}/pages/${t}.json)`);return await n.json()}throw new Error(`Unsupported URI scheme: ${e}`)}function ro(){if(typeof window>"u"||typeof navigator>"u")return;const e=Ec();if(!e)return;const t=navigator;t.modelContext||(t.modelContext={}),t.modelContext.registerTool=function(r){e.set(r.name,r)},t.modelContext.unregisterTool=function(r){e.delete(r)},t.modelContext.readResource=Tc,t.modelContextProtocol||(t.modelContextProtocol={}),t.modelContextProtocol.listTools=function(){return Array.from(e.values()).map(({execute:r,...n})=>n)},t.modelContextProtocol.executeTool=async function(r,n){const o=e.get(r);if(!o)throw new Error(`Unknown WebMCP tool: ${r}`);const i=n?JSON.parse(n):{},s=await o.execute(i);return JSON.stringify(s)},t.modelContextProtocol.readResource=async function(r){const n=await Tc(r);return JSON.stringify(n)}}function Ei(e){var n,o;if(typeof navigator>"u")return()=>{};ro();const t=navigator,r=Ec();return!t.modelContext||!r?()=>{}:((o=(n=t.modelContext).registerTool)==null||o.call(n,e),r.set(e.name,e),()=>{var i,s;r.delete(e.name),(s=(i=t.modelContext)==null?void 0:i.unregisterTool)==null||s.call(i,e.name)})}const C0='/*! 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 E0 extends g.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error("[JsonPages Engine]",t,r)}render(){return this.state.hasError&&this.state.error?c.jsxs("div",{style:{minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:24,backgroundColor:"#0f172a",color:"#e2e8f0",fontFamily:"ui-sans-serif, system-ui, sans-serif"},children:[c.jsx("h1",{style:{fontSize:"1.25rem",fontWeight:700,marginBottom:8},children:"JsonPages Engine Error"}),c.jsx("pre",{style:{maxWidth:"100%",overflow:"auto",padding:16,backgroundColor:"rgba(0,0,0,0.3)",borderRadius:8,fontSize:12,marginTop:8},children:this.state.error.message})]}):this.props.children}}function Wr(e){return e.split("/").map(t=>t.trim()).filter(Boolean).join("/")}function Ac(e,t=""){const r=Wr(t);let o=e.replace(/\/+/g,"/");if(r){const s=`/${r}`;o===s?o="/":o.startsWith(`${s}/`)&&(o=o.slice(s.length))}return Wr(o)||"home"}function ji(e,t){const r=Wr(t)||"home";return e[r]}function Ni(e,t){return nn(e,t)}function Ti(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function no(e,t){if(typeof document>"u")return;const r=`link[rel="${e}"]`;let n=document.head.querySelector(r);n||(n=document.createElement("link"),n.rel=e,document.head.appendChild(n)),n.href=t}function zc(e,t,r){if(typeof document>"u")return;const n="olonjs-webmcp-jsonld";let o=document.getElementById(n);o||(o=document.createElement("script"),o.type="application/ld+json",o.id=n,document.head.appendChild(o)),o.textContent=JSON.stringify({"@context":"https://schema.org","@type":"WebPage",name:e,description:t,url:r})}function Pc(e){return`/mcp-manifests/${e}.json`}function Oc(e){return`/schemas/${e}.schema.json`}const Ic=({pageRegistry:e,siteConfig:t,menuConfig:r,themeConfig:n,refDocuments:o,tenantCss:i,adminCss:s,NotFoundComponent:a})=>{const l=Je.useLocation(),d=Ac(l.pathname),u=g.useMemo(()=>Ot({pages:e,siteConfig:t,themeConfig:n,menuConfig:r,refDocuments:o}),[e,t,n,r,o]),f=ji(u.pages,d);return g.useEffect(()=>{var h;try{(h=u.themeConfig)!=null&&h.tokens&&eo.setTheme(u.themeConfig)}catch(p){console.warn("[JsonPages] visitor theme resolution failed",p)}},[u.themeConfig]),g.useEffect(()=>{var w,m;if(!f)return;const h=typeof((w=f.meta)==null?void 0:w.title)=="string"?f.meta.title:d,p=typeof((m=f.meta)==null?void 0:m.description)=="string"?f.meta.description:"";no("mcp-manifest",Pc(d)),no("olon-contract",Oc(d)),zc(h,p,d==="home"?"/":`/${d}`)},[f,d]),f?c.jsx(sn,{mode:"tenant",tenantCss:i,adminCss:s,children:c.jsx(Jr,{mode:"visitor",children:c.jsx(ho,{pageConfig:f,siteConfig:u.siteConfig,menuConfig:u.menuConfig})})}):c.jsx(a,{})},Dc=({pageRegistry:e,schemas:t,siteConfig:r,menuConfig:n,themeConfig:o,refDocuments:i,tenantCss:s,adminCss:a,addSectionConfig:l,addableSectionTypes:d,webMcp:u,saveToFile:f,hotSave:h,showLegacySave:p=!0,showHotSave:w=!1})=>{var Lt;const m=Je.useLocation(),v=Ac(m.pathname,"admin"),y=Je.useNavigate(),k=Object.keys(e).sort((A,O)=>A==="home"?-1:O==="home"?1:A.localeCompare(O)),[x,S]=g.useState(null),[C,j]=g.useState(!1),[N,E]=g.useState(!1),[D,R]=g.useState(!1),[I,L]=g.useState(!1),[_,G]=g.useState(()=>{try{const A=JSON.parse(JSON.stringify(r??{}));return A.identity||(A.identity={title:"Site"}),A.pages||(A.pages=[]),A}catch{return{identity:{title:"Site"},pages:[]}}}),[B,F]=g.useState(null),[U,z]=g.useState(null),[X,re]=g.useState(null),[T,$]=g.useState(null),[Y,K]=g.useState(!1),[ge,se]=g.useState(400),P=g.useMemo(()=>Ot({pages:x?{[v]:x}:{},siteConfig:_,themeConfig:o,menuConfig:n,refDocuments:i}),[x,_,o,n,i,v]),J=x?P.pages[v]??x:null,ee=g.useRef(x),W=g.useRef(_),ne=360,te=920;g.useEffect(()=>{ee.current=x},[x]),g.useEffect(()=>{W.current=_},[_]);const we=g.useCallback(A=>{A.preventDefault();const O=A.currentTarget;O.setPointerCapture(A.pointerId);const q=A.clientX,Q=ge,ce=ye=>{const je=q-ye.clientX,de=Math.min(te,Math.max(ne,Q+je));se(de)},pe=()=>{O.releasePointerCapture(A.pointerId),O.removeEventListener("pointermove",ce),O.removeEventListener("pointerup",pe),O.removeEventListener("pointercancel",pe),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",pe),O.addEventListener("pointercancel",pe)},[ge]),be=x?[..._.header?[{id:_.header.id,type:_.header.type,scope:"global",title:"Header"}]:[],...x.sections.map(A=>{var O,q;return{id:A.id,type:A.type,scope:"local",title:((O=A.data)==null?void 0:O.title)??((q=A.data)==null?void 0:q.titleHighlight)}}),..._.footer?[{id:_.footer.id,type:_.footer.type,scope:"global",title:"Footer"}]:[]]:[];g.useEffect(()=>{const A=ji(e,v);A&&S(JSON.parse(JSON.stringify(A))),F(null),z(null),j(!1)},[v,e]);const Pe=g.useCallback(()=>{const A=ji(e,v);A&&S(JSON.parse(JSON.stringify(A))),F(null),z(null),j(!1)},[v,e]),De=g.useCallback((A,O,q)=>{const Q=[...q.sections],ce=Q.findIndex(je=>je.id===A);if(ce===-1||O<0||O>=Q.length)return;const[pe]=Q.splice(ce,1),ye=O>ce?O-1:O;Q.splice(Math.min(ye,Q.length),0,pe),S({...q,sections:Q}),j(!0)},[]),Ue=g.useCallback(A=>{if(A.origin===window.location.origin){if(A.data.type===xe.SECTION_SELECT){F(A.data.section);const O=A.data.itemPath;Array.isArray(O)&&O.length>0?z(O.map(q=>({fieldKey:q.fieldKey,...q.itemId!=null?{itemId:String(q.itemId)}:{}}))):z(null)}if(A.data.type===xe.INLINE_FIELD_UPDATE){const O=typeof A.data.sectionId=="string"?A.data.sectionId:null,q=typeof A.data.fieldKey=="string"?A.data.fieldKey:null;O&&q&&(S(Q=>{if(!Q)return Q;const ce={...Q,sections:Q.sections.map(pe=>pe.id===O?{...pe,data:{...pe.data,[q]:A.data.value}}:pe)};return ee.current=ce,ce}),j(!0))}if(A.data.type===xe.ACTIVE_SECTION_CHANGED&&re(A.data.activeSectionId??null),A.data.type==="jsonpages:section-reorder"&&ee.current){const{sectionId:O,newIndex:q}=A.data;typeof O=="string"&&typeof q=="number"&&q>=0&&De(O,q,ee.current)}if(A.data.type===xe.WEBMCP_TOOL_CALL){const O=typeof A.data.requestId=="string"?A.data.requestId:crypto.randomUUID(),q=typeof A.data.toolName=="string"?A.data.toolName:"";Z(q,A.data.args).then(Q=>{window.postMessage({type:xe.WEBMCP_TOOL_RESULT,requestId:O,toolName:q,result:Q,ok:!0},window.location.origin)}).catch(Q=>{const ce=Q instanceof Error?Q.message:String(Q);window.postMessage({type:xe.WEBMCP_TOOL_RESULT,requestId:O,toolName:q,ok:!1,error:ce},window.location.origin)})}}},[De,Z]);g.useEffect(()=>(window.addEventListener("message",Ue),()=>window.removeEventListener("message",Ue)),[Ue]),g.useEffect(()=>{if(!(u!=null&&u.enabled)||(ro(),!ee.current))return;const O=Ei({name:Fr,description:`Update any section in OlonJS Studio's in-memory draft state. Does NOT persist to disk. Use "sectionType" in input args to ensure correct schema validation.`,inputSchema:jc(),execute:Q=>Z(Fr,Q)}),q=Ei({name:to,description:`Persist the current in-memory draft state to disk. Call this after making one or more updates via ${Fr}.`,inputSchema:Nc(),execute:Q=>Z(to,Q)});return()=>{O(),q()}},[u==null?void 0:u.enabled,v,x,_,Z]);const jt=g.useCallback(A=>{const O=be.find(q=>q.id===A);O&&F({id:O.id,type:O.type,scope:O.scope}),z(null),$(A)},[be]),qe=g.useCallback(()=>{$(null)},[]),Be=g.useCallback(A=>{S(O=>O&&{...O,sections:O.sections.filter(q=>q.id!==A)}),j(!0),F(O=>(O==null?void 0:O.id)===A?null:O)},[]),He=A=>{if(!(!B||!x))if(j(!0),B.scope==="global")B.type==="header"&&_.header!=null?G({..._,header:{..._.header,data:A}}):B.type==="footer"&&_.footer!=null&&G({..._,footer:{..._.footer,data:A}});else{const O=x.sections.map(q=>q.id===B.id?{...q,data:A}:q);S({...x,sections:O})}},ht=g.useCallback((A,O,q,Q)=>{var ce,pe;if(j(!0),O==="global")((ce=_.header)==null?void 0:ce.id)===A?G({..._,header:{..._.header,data:Q}}):((pe=_.footer)==null?void 0:pe.id)===A&&G({..._,footer:{..._.footer,data:Q}});else if(x){const ye=x.sections.map(je=>je.id===A?{...je,data:Q}:je);S({...x,sections:ye})}},[x,_]),Xe=g.useCallback(async()=>{const A=document.querySelector("iframe");if(!(A!=null&&A.contentWindow))return;const O=crypto.randomUUID();await new Promise(q=>{var pe;let Q=!1;const ce=ye=>{var je,de;ye.origin===window.location.origin&&((je=ye.data)==null?void 0:je.type)===xe.INLINE_FLUSHED&&((de=ye.data)==null?void 0:de.requestId)===O&&(Q=!0,window.removeEventListener("message",ce),q())};window.addEventListener("message",ce),(pe=A.contentWindow)==null||pe.postMessage({type:xe.REQUEST_INLINE_FLUSH,requestId:O},"*"),window.setTimeout(()=>{Q||(window.removeEventListener("message",ce),q())},400)})},[]),Nt=g.useCallback(async(A,O)=>{var pe;if(!f)throw new Error("saveToFile is not configured for this tenant.");const q=Ot({pages:{[v]:A},siteConfig:O,themeConfig:o,menuConfig:n,refDocuments:i}),Q=(pe=q.siteConfig.header)==null?void 0:pe.data,ce={page:A,site:O,menu:{main:Ni(Q,n.main)},theme:q.themeConfig};await f(ce,v),j(!1),E(!0),typeof window<"u"&&window.setTimeout(()=>E(!1),2500)},[f,v,o,n,i]),Ur=g.useCallback(async A=>{var Le,$e;if(!f)throw new Error("WebMCP requires saveToFile persistence in Studio mode.");if(!Ti(A)||typeof A.sectionId!="string")throw new Error("WebMCP mutation requires a sectionId.");const O=A,q=typeof O.slug=="string"?Wr(O.slug):v;if(q!==v)throw new Error(`WebMCP slug mismatch. Active Studio slug is "${v}", received "${q}".`);await Xe();const Q=ee.current,ce=W.current;if(!Q)throw new Error("Studio draft is not ready yet.");const pe=O.scope==="global"?"global":"local";let ye=Q,je=ce,de=O.sectionType;if(pe==="global"){const Ce=((Le=ce.header)==null?void 0:Le.id)===O.sectionId?ce.header:(($e=ce.footer)==null?void 0:$e.id)===O.sectionId?ce.footer:null;if(!Ce)throw new Error(`Global section "${O.sectionId}" was not found.`);if(!de)de=Ce.type;else if(Ce.type!==de)throw new Error(`Section "${O.sectionId}" is type "${Ce.type}", not "${de}".`);const Ne=t[de];if(!Ne||typeof Ne.parse!="function")throw new Error(`Missing schema for section type "${de}".`);const Me=Ti(Ce.data)?Ce.data:{},Ve=Ci(Me,O),ct=Ne.parse(Ve),ve={...Ce,data:ct};je={...ce,...Ce.type==="header"?{header:ve}:{footer:ve}},W.current=je,G(je)}else{const Ce=Q.sections.find(ve=>ve.id===O.sectionId);if(!Ce)throw new Error(`Local section "${O.sectionId}" was not found in page "${v}".`);if(!de)de=Ce.type;else if(Ce.type!==de)throw new Error(`Section "${O.sectionId}" is type "${Ce.type}", not "${de}".`);const Ne=t[de];if(!Ne||typeof Ne.parse!="function")throw new Error(`Missing schema for section type "${de}".`);const Me=Ti(Ce.data)?Ce.data:{},Ve=Ci(Me,O),ct=Ne.parse(Ve);ye={...Q,sections:Q.sections.map(ve=>ve.id===O.sectionId?{...ve,data:ct}:ve)},ee.current=ye,S(ye)}return F({id:O.sectionId,type:de,scope:pe}),z(Array.isArray(O.itemPath)?O.itemPath:null),j(!0),{content:[{type:"text",text:JSON.stringify({ok:!0,slug:v,sectionId:O.sectionId,sectionType:de,scope:pe,action:"draft_updated"})}],isError:!1}},[f,v,Xe,t]),M=g.useCallback(async A=>{if(!f)throw new Error("WebMCP requires saveToFile persistence in Studio mode.");await Xe();const O=ee.current,q=W.current;if(!O)throw new Error("Studio draft is not ready yet.");return await Nt(O,q),{content:[{type:"text",text:JSON.stringify({ok:!0,slug:v,action:"saved_to_disk"})}],isError:!1}},[f,v,Xe,Nt]);async function Z(A,O){if(A===Fr)return Ur(O);if(A===to)return M(O);throw new Error(`Unknown WebMCP tool "${A}".`)}const ie=async()=>{var pe;if(!f)return;await Xe();const A=ee.current,O=W.current;if(!A)return;const q=Ot({pages:{[v]:A},siteConfig:O,themeConfig:o,menuConfig:n,refDocuments:i}),Q=(pe=q.siteConfig.header)==null?void 0:pe.data,ce={page:A,site:O,menu:{main:Ni(Q,n.main)},theme:q.themeConfig};f(ce,v).then(()=>{j(!1),E(!0),typeof window<"u"&&window.setTimeout(()=>E(!1),2500)}).catch(ye=>{console.error("[JsonPages] saveToFile failed",ye);const je=ye instanceof Error?ye.message:String(ye);alert(`Save to file failed: ${je}`)})},fe=async()=>{var pe;if(!h)return;await Xe();const A=ee.current,O=W.current;if(!A)return;const q=Ot({pages:{[v]:A},siteConfig:O,themeConfig:o,menuConfig:n,refDocuments:i}),Q=(pe=q.siteConfig.header)==null?void 0:pe.data,ce={page:A,site:O,menu:{main:Ni(Q,n.main)},theme:q.themeConfig};L(!0),h(ce,v).then(()=>{j(!1),R(!0),typeof window<"u"&&window.setTimeout(()=>R(!1),2500)}).catch(ye=>{console.error("[JsonPages] hotSave failed",ye);const je=ye instanceof Error?ye.message:String(ye);alert(`Hot save failed: ${je}`)}).finally(()=>{L(!1)})},_e=A=>{var Q;if(!x)return;const O=((Q=l==null?void 0:l.getDefaultSectionData)==null?void 0:Q.call(l,A))??{},q={id:crypto.randomUUID(),type:A,data:O,settings:void 0};S({...x,sections:[...x.sections,q]}),j(!0),F({id:q.id,type:A,scope:"local"})};if(g.useEffect(()=>{var Q,ce;const A=J??x,O=typeof((Q=A==null?void 0:A.meta)==null?void 0:Q.title)=="string"?A.meta.title:v,q=typeof((ce=A==null?void 0:A.meta)==null?void 0:ce.description)=="string"?A.meta.description:"";no("mcp-manifest",Pc(v)),no("olon-contract",Oc(v)),zc(O,q,`/admin${v==="home"?"":`/${v}`}`)},[x,J,v]),!x)return c.jsx("div",{children:"Loading Studio..."});const Se=(B==null?void 0:B.scope)==="global"?{sections:[P.siteConfig.header,P.siteConfig.footer].filter(A=>A!=null)}:J??x,Oe=[...P.siteConfig.header?[P.siteConfig.header]:[],...((Lt=J??x)==null?void 0:Lt.sections)??[],...P.siteConfig.footer?[P.siteConfig.footer]:[]];return c.jsx(sn,{mode:"admin",tenantCss:s,adminCss:a,children:c.jsx(Jr,{mode:"studio",children:c.jsxs("div",{className:"flex flex-col h-screen w-screen bg-background text-foreground overflow-hidden",children:[c.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[c.jsx("main",{className:"flex-1 min-w-0 relative bg-zinc-900/50 overflow-hidden",children:c.jsx(vc,{draft:J??x,globalDraft:P.siteConfig,menuConfig:P.menuConfig,themeConfig:P.themeConfig,slug:v,selectedId:B==null?void 0:B.id,scrollToSectionId:T,onScrollRequested:qe})}),c.jsxs("div",{className:"flex shrink-0 relative h-full z-10",style:{width:ge,minWidth:ne,maxWidth:te},children:[c.jsx("div",{role:"separator","aria-label":"Resize inspector",className:"absolute left-0 top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-primary/40 active:bg-primary/60 transition-colors shrink-0",style:{zIndex:9999},onPointerDown:we}),c.jsx(bc,{selectedSection:B,pageData:Se,allSectionsData:Oe,onUpdate:He,onUpdateSection:ht,onClose:()=>{F(null),z(null)},expandedItemPath:U,onReorderSection:x?(A,O)=>De(A,O,x):void 0,allLayers:be,activeSectionId:X,onRequestScrollToSection:jt,onDeleteSection:x?Be:void 0,onAddSection:d.length>0?()=>K(!0):void 0,hasChanges:C,onSaveToFile:f!=null?ie:void 0,saveSuccessFeedback:N,onHotSave:h!=null?fe:void 0,hotSaveSuccessFeedback:D,hotSaveInProgress:I,showLegacySave:p,showHotSave:w,onResetToFile:Pe,pageSlugs:k,currentSlug:v,onPageChange:k.length>1?A=>{const O=Wr(A);y(O==="home"?"/admin":`/admin/${O}`)}:void 0})]})]}),c.jsx(kc,{open:Y,onClose:()=>K(!1),sectionTypes:d,sectionTypeLabels:l==null?void 0:l.sectionTypeLabels,onSelect:_e})]})})})},_c=({tenantCss:e,adminCss:t})=>c.jsx(sn,{mode:"tenant",tenantCss:e,adminCss:t,children:c.jsx(yc,{})});function j0({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=Sc}=e,f=(d==null?void 0:d.addableSectionTypes)??Object.keys(r).filter(N=>N!=="header"&&N!=="footer"),h={saveToFile:(k=e.persistence)==null?void 0:k.saveToFile,hotSave:(x=e.persistence)==null?void 0:x.hotSave,showLegacySave:((S=e.persistence)==null?void 0:S.showLegacySave)??!0,showHotSave:((C=e.persistence)==null?void 0:C.showHotSave)??!1},p=typeof(l==null?void 0:l.tenant)=="string"?l.tenant:"",w=typeof(l==null?void 0:l.admin)=="string"?l.admin:C0,m=g.useMemo(()=>Ot({pages:n,siteConfig:o,themeConfig:i,menuConfig:s,refDocuments:a}),[n,o,i,s,a]),[v,y]=g.useState(!1);return g.useEffect(()=>{var N,E;try{(N=m.themeConfig)!=null&&N.tokens&&eo.setTheme(m.themeConfig)}catch(D){console.warn("[JsonPages] setTheme failed",D)}(E=e.webmcp)!=null&&E.enabled&&ro(),y(!0)},[m.themeConfig,(j=e.webmcp)==null?void 0:j.enabled]),v?c.jsx(E0,{children:c.jsx(es,{config:{registry:t,schemas:r,tenantId:e.tenantId??"default",assets:e.assets,overlayDisabledSectionTypes:e.overlayDisabledSectionTypes},children:c.jsx(Je.BrowserRouter,{children:c.jsxs(Je.Routes,{children:[c.jsx(Je.Route,{path:"/",element:c.jsx(Ic,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:m.themeConfig,refDocuments:a,tenantCss:p,adminCss:w,NotFoundComponent:u})}),c.jsx(Je.Route,{path:"/*",element:c.jsx(Ic,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:m.themeConfig,refDocuments:a,tenantCss:p,adminCss:w,NotFoundComponent:u})}),c.jsx(Je.Route,{path:"/admin",element:c.jsx(Dc,{pageRegistry:n,schemas:r,siteConfig:o,menuConfig:s,themeConfig:m.themeConfig,refDocuments:a,tenantCss:p,adminCss:w,addSectionConfig:d,addableSectionTypes:f,webMcp:e.webmcp,saveToFile:h.saveToFile,hotSave:h.hotSave,showLegacySave:h.showLegacySave,showHotSave:h.showHotSave})}),c.jsx(Je.Route,{path:"/admin/*",element:c.jsx(Dc,{pageRegistry:n,schemas:r,siteConfig:o,menuConfig:s,themeConfig:m.themeConfig,refDocuments:a,tenantCss:p,adminCss:w,addSectionConfig:d,addableSectionTypes:f,webMcp:e.webmcp,saveToFile:h.saveToFile,hotSave:h.hotSave,showLegacySave:h.showLegacySave,showHotSave:h.showHotSave})}),c.jsx(Je.Route,{path:"/admin/preview",element:c.jsx(_c,{tenantCss:p,adminCss:w})}),c.jsx(Je.Route,{path:"/admin/preview/*",element:c.jsx(_c,{tenantCss:p,adminCss:w})}),c.jsx(Je.Route,{path:"*",element:c.jsx(u,{})})]})})})}):c.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#0f172a",color:"#94a3b8",fontFamily:"ui-sans-serif, system-ui, sans-serif",fontSize:14},children:"Loading..."})}ae.AddSectionLibrary=kc,ae.AdminSidebar=bc,ae.ConfigProvider=es,ae.DefaultNotFound=Sc,ae.FormFactory=Ir,ae.InputWidgets=ir,ae.JsonPagesEngine=j0,ae.PageRenderer=ho,ae.PreviewEntry=yc,ae.STUDIO_EVENTS=xe,ae.SectionRenderer=hr,ae.StudioProvider=Jr,ae.StudioStage=vc,ae.ThemeLoader=sn,ae.WEBMCP_TOOL_SAVE=to,ae.WEBMCP_TOOL_UPDATE=Fr,ae.applyValueAtSelectionPath=Si,ae.cn=oe,ae.createWebMcpSaveToolInputSchema=Nc,ae.createWebMcpUpdateToolInputSchema=jc,ae.ensureWebMcpRuntime=ro,ae.registerWebMcpTool=Ei,ae.resolveAssetUrl=Hl,ae.resolveHeaderMenuItems=nn,ae.resolveRuntimeConfig=Ot,ae.resolveSectionMenuItems=on,ae.resolveWebMcpMutationData=Ci,ae.shouldRenderSiteGlobalHeader=Pi,ae.themeManager=eo,ae.useConfig=pr,ae.useStudio=rs,Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"})}));
|