({classGroupId:e,validator:n}),B1=(e=new Map,n=null,r)=>({nextPart:e,validators:n,classGroupId:r}),gu="-",Jb=[],TN="arbitrary..",ON=e=>{const n=AN(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return jN(u);const d=u.split(gu),p=d[0]===""&&d.length>1?1:0;return q1(d,p,n)},getConflictingClassGroupIds:(u,d)=>{if(d){const p=o[u],h=r[u];return p?h?EN(h,p):p:h||Jb}return r[u]||Jb}}},q1=(e,n,r)=>{if(e.length-n===0)return r.classGroupId;const s=e[n],l=r.nextPart.get(s);if(l){const h=q1(e,n+1,l);if(h)return h}const u=r.validators;if(u===null)return;const d=n===0?e.join(gu):e.slice(n).join(gu),p=u.length;for(let h=0;he.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),r=n.indexOf(":"),o=n.slice(0,r);return o?TN+o:void 0})(),AN=e=>{const{theme:n,classGroups:r}=e;return MN(r,n)},MN=(e,n)=>{const r=B1();for(const o in e){const s=e[o];zp(s,r,o,n)}return r},zp=(e,n,r,o)=>{const s=e.length;for(let l=0;l{if(typeof e=="string"){DN(e,n,r);return}if(typeof e=="function"){zN(e,n,r,o);return}kN(e,n,r,o)},DN=(e,n,r)=>{const o=e===""?n:G1(n,e);o.classGroupId=r},zN=(e,n,r,o)=>{if(LN(e)){zp(e(o),n,r,o);return}n.validators===null&&(n.validators=[]),n.validators.push(RN(r,e))},kN=(e,n,r,o)=>{const s=Object.entries(e),l=s.length;for(let u=0;u{let r=e;const o=n.split(gu),s=o.length;for(let l=0;l"isThemeGetter"in e&&e.isThemeGetter===!0,$N=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,r=Object.create(null),o=Object.create(null);const s=(l,u)=>{r[l]=u,n++,n>e&&(n=0,o=r,r=Object.create(null))};return{get(l){let u=r[l];if(u!==void 0)return u;if((u=o[l])!==void 0)return s(l,u),u},set(l,u){l in r?r[l]=u:s(l,u)}}},Cm="!",Wb=":",IN=[],ex=(e,n,r,o,s)=>({modifiers:e,hasImportantModifier:n,baseClassName:r,maybePostfixModifierPosition:o,isExternal:s}),VN=e=>{const{prefix:n,experimentalParseClassName:r}=e;let o=s=>{const l=[];let u=0,d=0,p=0,h;const y=s.length;for(let _=0;_p?h-p:void 0;return ex(l,x,b,C)};if(n){const s=n+Wb,l=o;o=u=>u.startsWith(s)?l(u.slice(s.length)):ex(IN,!1,u,void 0,!0)}if(r){const s=o;o=l=>r({className:l,parseClassName:s})}return o},FN=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((r,o)=>{n.set(r,1e6+o)}),r=>{const o=[];let s=[];for(let l=0;l0&&(s.sort(),o.push(...s),s=[]),o.push(u)):s.push(u)}return s.length>0&&(s.sort(),o.push(...s)),o}},PN=e=>({cache:$N(e.cacheSize),parseClassName:VN(e),sortModifiers:FN(e),postfixLookupClassGroupIds:UN(e),...ON(e)}),UN=e=>{const n=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let o=0;o{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:s,sortModifiers:l,postfixLookupClassGroupIds:u}=n,d=[],p=e.trim().split(HN);let h="";for(let y=p.length-1;y>=0;y-=1){const v=p[y],{isExternal:b,modifiers:x,hasImportantModifier:C,baseClassName:_,maybePostfixModifierPosition:E}=r(v);if(b){h=v+(h.length>0?" "+h:h);continue}let T=!!E,O;if(T){const H=_.substring(0,E);O=o(H);const I=O&&u[O]?o(_):void 0;I&&I!==O&&(O=I,T=!1)}else O=o(_);if(!O){if(!T){h=v+(h.length>0?" "+h:h);continue}if(O=o(_),!O){h=v+(h.length>0?" "+h:h);continue}T=!1}const A=x.length===0?"":x.length===1?x[0]:l(x).join(":"),z=C?A+Cm:A,L=z+O;if(d.indexOf(L)>-1)continue;d.push(L);const B=s(O,T);for(let H=0;H0?" "+h:h)}return h},qN=(...e)=>{let n=0,r,o,s="";for(;n{if(typeof e=="string")return e;let n,r="";for(let o=0;o{let r,o,s,l;const u=p=>{const h=n.reduce((y,v)=>v(y),e());return r=PN(h),o=r.cache.get,s=r.cache.set,l=d,d(p)},d=p=>{const h=o(p);if(h)return h;const y=BN(p,r);return s(p,y),y};return l=u,(...p)=>l(qN(...p))},ZN=[],qt=e=>{const n=r=>r[e]||ZN;return n.isThemeGetter=!0,n},K1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Y1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,KN=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,YN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QN=/\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$/,XN=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,JN=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,WN=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ai=e=>KN.test(e),qe=e=>!!e&&!Number.isNaN(Number(e)),Cr=e=>!!e&&Number.isInteger(Number(e)),Ih=e=>e.endsWith("%")&&qe(e.slice(0,-1)),Jr=e=>YN.test(e),Q1=()=>!0,eD=e=>QN.test(e)&&!XN.test(e),kp=()=>!1,tD=e=>JN.test(e),nD=e=>WN.test(e),rD=e=>!_e(e)&&!Ce(e),iD=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),oD=e=>Ki(e,W1,kp),_e=e=>K1.test(e),vo=e=>Ki(e,e_,eD),tx=e=>Ki(e,hD,qe),aD=e=>Ki(e,n_,Q1),sD=e=>Ki(e,t_,kp),nx=e=>Ki(e,X1,kp),lD=e=>Ki(e,J1,nD),Hc=e=>Ki(e,r_,tD),Ce=e=>Y1.test(e),Fs=e=>zo(e,e_),cD=e=>zo(e,t_),rx=e=>zo(e,X1),uD=e=>zo(e,W1),dD=e=>zo(e,J1),Bc=e=>zo(e,r_,!0),fD=e=>zo(e,n_,!0),Ki=(e,n,r)=>{const o=K1.exec(e);return o?o[1]?n(o[1]):r(o[2]):!1},zo=(e,n,r=!1)=>{const o=Y1.exec(e);return o?o[1]?n(o[1]):r:!1},X1=e=>e==="position"||e==="percentage",J1=e=>e==="image"||e==="url",W1=e=>e==="length"||e==="size"||e==="bg-size",e_=e=>e==="length",hD=e=>e==="number",t_=e=>e==="family-name",n_=e=>e==="number"||e==="weight",r_=e=>e==="shadow",mD=()=>{const e=qt("color"),n=qt("font"),r=qt("text"),o=qt("font-weight"),s=qt("tracking"),l=qt("leading"),u=qt("breakpoint"),d=qt("container"),p=qt("spacing"),h=qt("radius"),y=qt("shadow"),v=qt("inset-shadow"),b=qt("text-shadow"),x=qt("drop-shadow"),C=qt("blur"),_=qt("perspective"),E=qt("aspect"),T=qt("ease"),O=qt("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...z(),Ce,_e],B=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto","contain","none"],I=()=>[Ce,_e,p],ne=()=>[Ai,"full","auto",...I()],ve=()=>[Cr,"none","subgrid",Ce,_e],fe=()=>["auto",{span:["full",Cr,Ce,_e]},Cr,Ce,_e],ce=()=>[Cr,"auto",Ce,_e],le=()=>["auto","min","max","fr",Ce,_e],me=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],xe=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...I()],Z=()=>[Ai,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],re=()=>[Ai,"screen","full","dvw","lvw","svw","min","max","fit",...I()],W=()=>[Ai,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],ee=()=>[e,Ce,_e],D=()=>[...z(),rx,nx,{position:[Ce,_e]}],M=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",uD,oD,{size:[Ce,_e]}],Q=()=>[Ih,Fs,vo],K=()=>["","none","full",h,Ce,_e],ae=()=>["",qe,Fs,vo],J=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[qe,Ih,rx,nx],Ne=()=>["","none",C,Ce,_e],Fe=()=>["none",qe,Ce,_e],Ue=()=>["none",qe,Ce,_e],ht=()=>[qe,Ce,_e],Je=()=>[Ai,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jr],breakpoint:[Jr],color:[Q1],container:[Jr],"drop-shadow":[Jr],ease:["in","out","in-out"],font:[rD],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Jr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Jr],shadow:[Jr],spacing:["px",qe],text:[Jr],"text-shadow":[Jr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ai,_e,Ce,E]}],container:["container"],"container-type":[{"@container":["","normal","size",Ce,_e]}],"container-named":[iD],columns:[{columns:[qe,_e,Ce,d]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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:L()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ne()}],"inset-x":[{"inset-x":ne()}],"inset-y":[{"inset-y":ne()}],start:[{"inset-s":ne(),start:ne()}],end:[{"inset-e":ne(),end:ne()}],"inset-bs":[{"inset-bs":ne()}],"inset-be":[{"inset-be":ne()}],top:[{top:ne()}],right:[{right:ne()}],bottom:[{bottom:ne()}],left:[{left:ne()}],visibility:["visible","invisible","collapse"],z:[{z:[Cr,"auto",Ce,_e]}],basis:[{basis:[Ai,"full","auto",d,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,Ai,"auto","initial","none",_e]}],grow:[{grow:["",qe,Ce,_e]}],shrink:[{shrink:["",qe,Ce,_e]}],order:[{order:[Cr,"first","last","none",Ce,_e]}],"grid-cols":[{"grid-cols":ve()}],"col-start-end":[{col:fe()}],"col-start":[{"col-start":ce()}],"col-end":[{"col-end":ce()}],"grid-rows":[{"grid-rows":ve()}],"row-start-end":[{row:fe()}],"row-start":[{"row-start":ce()}],"row-end":[{"row-end":ce()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":le()}],"auto-rows":[{"auto-rows":le()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...me(),"normal"]}],"justify-items":[{"justify-items":[...xe(),"normal"]}],"justify-self":[{"justify-self":["auto",...xe()]}],"align-content":[{content:["normal",...me()]}],"align-items":[{items:[...xe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...xe(),{baseline:["","last"]}]}],"place-content":[{"place-content":me()}],"place-items":[{"place-items":[...xe(),"baseline"]}],"place-self":[{"place-self":["auto",...xe()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mbs:[{mbs:N()}],mbe:[{mbe:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...re()]}],"min-inline-size":[{"min-inline":["auto",...re()]}],"max-inline-size":[{"max-inline":["none",...re()]}],"block-size":[{block:["auto",...W()]}],"min-block-size":[{"min-block":["auto",...W()]}],"max-block-size":[{"max-block":["none",...W()]}],w:[{w:[d,"screen",...Z()]}],"min-w":[{"min-w":[d,"screen","none",...Z()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",r,Fs,vo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,fD,aD]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ih,_e]}],"font-family":[{font:[cD,sD,n]}],"font-features":[{"font-features":[_e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Ce,_e]}],"line-clamp":[{"line-clamp":[qe,"none",Ce,tx]}],leading:[{leading:[l,...I()]}],"list-image":[{"list-image":["none",Ce,_e]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ce,_e]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ee()}],"text-color":[{text:ee()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",Ce,vo]}],"text-decoration-color":[{decoration:ee()}],"underline-offset":[{"underline-offset":[qe,"auto",Ce,_e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"tab-size":[{tab:[Cr,Ce,_e]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ce,_e]}],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",Ce,_e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:M()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Cr,Ce,_e],radial:["",Ce,_e],conic:[Cr,Ce,_e]},dD,lD]}],"bg-color":[{bg:ee()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:ee()}],"gradient-via":[{via:ee()}],"gradient-to":[{to:ee()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:ee()}],"border-color-x":[{"border-x":ee()}],"border-color-y":[{"border-y":ee()}],"border-color-s":[{"border-s":ee()}],"border-color-e":[{"border-e":ee()}],"border-color-bs":[{"border-bs":ee()}],"border-color-be":[{"border-be":ee()}],"border-color-t":[{"border-t":ee()}],"border-color-r":[{"border-r":ee()}],"border-color-b":[{"border-b":ee()}],"border-color-l":[{"border-l":ee()}],"divide-color":[{divide:ee()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,Ce,_e]}],"outline-w":[{outline:["",qe,Fs,vo]}],"outline-color":[{outline:ee()}],shadow:[{shadow:["","none",y,Bc,Hc]}],"shadow-color":[{shadow:ee()}],"inset-shadow":[{"inset-shadow":["none",v,Bc,Hc]}],"inset-shadow-color":[{"inset-shadow":ee()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ee()}],"ring-offset-w":[{"ring-offset":[qe,vo]}],"ring-offset-color":[{"ring-offset":ee()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":ee()}],"text-shadow":[{"text-shadow":["none",b,Bc,Hc]}],"text-shadow-color":[{"text-shadow":ee()}],opacity:[{opacity:[qe,Ce,_e]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"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":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":ee()}],"mask-image-linear-to-color":[{"mask-linear-to":ee()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":ee()}],"mask-image-t-to-color":[{"mask-t-to":ee()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":ee()}],"mask-image-r-to-color":[{"mask-r-to":ee()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":ee()}],"mask-image-b-to-color":[{"mask-b-to":ee()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":ee()}],"mask-image-l-to-color":[{"mask-l-to":ee()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":ee()}],"mask-image-x-to-color":[{"mask-x-to":ee()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":ee()}],"mask-image-y-to-color":[{"mask-y-to":ee()}],"mask-image-radial":[{"mask-radial":[Ce,_e]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":ee()}],"mask-image-radial-to-color":[{"mask-radial-to":ee()}],"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":z()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":ee()}],"mask-image-conic-to-color":[{"mask-conic-to":ee()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:M()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ce,_e]}],filter:[{filter:["","none",Ce,_e]}],blur:[{blur:Ne()}],brightness:[{brightness:[qe,Ce,_e]}],contrast:[{contrast:[qe,Ce,_e]}],"drop-shadow":[{"drop-shadow":["","none",x,Bc,Hc]}],"drop-shadow-color":[{"drop-shadow":ee()}],grayscale:[{grayscale:["",qe,Ce,_e]}],"hue-rotate":[{"hue-rotate":[qe,Ce,_e]}],invert:[{invert:["",qe,Ce,_e]}],saturate:[{saturate:[qe,Ce,_e]}],sepia:[{sepia:["",qe,Ce,_e]}],"backdrop-filter":[{"backdrop-filter":["","none",Ce,_e]}],"backdrop-blur":[{"backdrop-blur":Ne()}],"backdrop-brightness":[{"backdrop-brightness":[qe,Ce,_e]}],"backdrop-contrast":[{"backdrop-contrast":[qe,Ce,_e]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,Ce,_e]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,Ce,_e]}],"backdrop-invert":[{"backdrop-invert":["",qe,Ce,_e]}],"backdrop-opacity":[{"backdrop-opacity":[qe,Ce,_e]}],"backdrop-saturate":[{"backdrop-saturate":[qe,Ce,_e]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,Ce,_e]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ce,_e]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",Ce,_e]}],ease:[{ease:["linear","initial",T,Ce,_e]}],delay:[{delay:[qe,Ce,_e]}],animate:[{animate:["none",O,Ce,_e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Ce,_e]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Fe()}],"rotate-x":[{"rotate-x":Fe()}],"rotate-y":[{"rotate-y":Fe()}],"rotate-z":[{"rotate-z":Fe()}],scale:[{scale:Ue()}],"scale-x":[{"scale-x":Ue()}],"scale-y":[{"scale-y":Ue()}],"scale-z":[{"scale-z":Ue()}],"scale-3d":["scale-3d"],skew:[{skew:ht()}],"skew-x":[{"skew-x":ht()}],"skew-y":[{"skew-y":ht()}],transform:[{transform:[Ce,_e,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Je()}],"translate-x":[{"translate-x":Je()}],"translate-y":[{"translate-y":Je()}],"translate-z":[{"translate-z":Je()}],"translate-none":["translate-none"],zoom:[{zoom:[Cr,Ce,_e]}],accent:[{accent:ee()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ee()}],"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",Ce,_e]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":ee()}],"scrollbar-track-color":[{"scrollbar-track":ee()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",Ce,_e]}],fill:[{fill:["none",...ee()]}],"stroke-w":[{stroke:[qe,Fs,vo,tx]}],stroke:[{stroke:["none",...ee()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-bs","border-w-be","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-bs","border-color-be","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-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},pD=GN(mD);function We(...e){return pD(H1(e))}function gD({delayDuration:e=0,...n}){return m.jsx(bN,{"data-slot":"tooltip-provider",delayDuration:e,...n})}function vD({...e}){return m.jsx(xN,{"data-slot":"tooltip",...e})}function yD({...e}){return m.jsx(wN,{"data-slot":"tooltip-trigger",...e})}function bD({className:e,sideOffset:n=0,children:r,...o}){return m.jsx(SN,{children:m.jsxs(_N,{"data-slot":"tooltip-content",sideOffset:n,className:We("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",e),...o,children:[r,m.jsx(CN,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const Em=new Set;function xD(e){return Em.add(e),()=>Em.delete(e)}function wD(){for(const e of Em)e()}const i_=(...e)=>e.filter((n,r,o)=>!!n&&n.trim()!==""&&o.indexOf(n)===r).join(" ").trim();const SD=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const _D=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,r,o)=>o?o.toUpperCase():r.toLowerCase());const ix=e=>{const n=_D(e);return n.charAt(0).toUpperCase()+n.slice(1)};var Vh={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"};const CD=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},ED=w.createContext({}),RD=()=>w.useContext(ED),TD=w.forwardRef(({color:e,size:n,strokeWidth:r,absoluteStrokeWidth:o,className:s="",children:l,iconNode:u,...d},p)=>{const{size:h=24,strokeWidth:y=2,absoluteStrokeWidth:v=!1,color:b="currentColor",className:x=""}=RD()??{},C=o??v?Number(r??y)*24/Number(n??h):r??y;return w.createElement("svg",{ref:p,...Vh,width:n??h??Vh.width,height:n??h??Vh.height,stroke:e??b,strokeWidth:C,className:i_("lucide",x,s),...!l&&!CD(d)&&{"aria-hidden":"true"},...d},[...u.map(([_,E])=>w.createElement(_,E)),...Array.isArray(l)?l:[l]])});const Ae=(e,n)=>{const r=w.forwardRef(({className:o,...s},l)=>w.createElement(TD,{ref:l,iconNode:n,className:i_(`lucide-${SD(ix(e))}`,`lucide-${e}`,o),...s}));return r.displayName=ix(e),r};const OD=[["path",{d:"M4.5 3h15",key:"c7n0jr"}],["path",{d:"M6 3v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V3",key:"m1uhx7"}],["path",{d:"M6 14h12",key:"4cwo0f"}]],jD=Ae("beaker",OD);const AD=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],MD=Ae("book-open",AD);const ND=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],DD=Ae("briefcase",ND);const zD=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],kD=Ae("bug",zD);const LD=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],$D=Ae("calendar",LD);const ID=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],o_=Ae("check",ID);const VD=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Lp=Ae("chevron-down",VD);const FD=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],PD=Ae("chevron-right",FD);const UD=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],HD=Ae("chevron-up",UD);const BD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],qD=Ae("circle-check",BD);const GD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],a_=Ae("clock",GD);const ZD=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],KD=Ae("code",ZD);const YD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]],QD=Ae("compass",YD);const XD=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],JD=Ae("copy",XD);const WD=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],ez=Ae("credit-card",WD);const tz=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],nz=Ae("database",tz);const rz=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],iz=Ae("download",rz);const oz=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],az=Ae("ellipsis",oz);const sz=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],s_=Ae("file-text",sz);const lz=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],cz=Ae("flag",lz);const uz=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],$p=Ae("folder",uz);const dz=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],fz=Ae("gauge",dz);const hz=[["path",{d:"m14 13-8.381 8.38a1 1 0 0 1-3.001-3l8.384-8.381",key:"pgg06f"}],["path",{d:"m16 16 6-6",key:"vzrcl6"}],["path",{d:"m21.5 10.5-8-8",key:"a17d9x"}],["path",{d:"m8 8 6-6",key:"18bi4p"}],["path",{d:"m8.5 7.5 8 8",key:"1oyaui"}]],mz=Ae("gavel",hz);const pz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],l_=Ae("globe",pz);const gz=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],vz=Ae("graduation-cap",gz);const yz=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],bz=Ae("heart",yz);const xz=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],wz=Ae("history",xz);const Sz=[["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"}]],_z=Ae("image",Sz);const Cz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ez=Ae("info",Cz);const Rz=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Tz=Ae("layout-dashboard",Rz);const Oz=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],jz=Ae("lightbulb",Oz);const Az=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Mz=Ae("link",Az);const Nz=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Dz=Ae("loader-circle",Nz);const zz=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],c_=Ae("lock",zz);const kz=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Lz=Ae("log-out",kz);const $z=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],Iz=Ae("megaphone",$z);const Vz=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Fz=Ae("menu",Vz);const Pz=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],Uz=Ae("music",Pz);const Hz=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Bz=Ae("octagon-x",Hz);const qz=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 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.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Gz=Ae("package",qz);const Zz=[["path",{d:"M13 21h8",key:"1jsn5i"}],["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"}]],Kz=Ae("pen-line",Zz);const Yz=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Qz=Ae("plus",Yz);const Xz=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],Jz=Ae("rocket",Xz);const Wz=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],u_=Ae("search",Wz);const ek=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],tk=Ae("settings",ek);const nk=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],rk=Ae("share-2",nk);const ik=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],d_=Ae("shield",ik);const ok=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],f_=Ae("square-terminal",ok);const ak=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],sk=Ae("star",ak);const lk=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ck=Ae("trash-2",lk);const uk=[["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"}]],h_=Ae("triangle-alert",uk);const dk=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],fk=Ae("upload",dk);const hk=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],m_=Ae("users",hk);const mk=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],pk=Ae("wrench",mk);const gk=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],p_=Ae("x",gk);function vk(){const e=!document.body.classList.contains("sb-open");document.body.classList.toggle("sb-open"),Gu(),e?document.getElementById("sidebar")?.querySelector(yk)?.focus():document.getElementById("menu-btn")?.focus()}const yk='a[href], button:not(:disabled), select, input, [tabindex]:not([tabindex="-1"])';function mr(){const e=document.body.classList.contains("sb-open");document.body.classList.remove("sb-open"),Gu(),e&&window.innerWidth<=nu&&document.getElementById("menu-btn")?.focus()}const nu=900;function Gu(){const e=document.getElementById("sidebar");if(!e)return;const n=document.body.classList.contains("sb-open");window.innerWidth<=nu&&!n?e.setAttribute("inert",""):e.removeAttribute("inert");const o=document.getElementById("main");o&&(n&&window.innerWidth<=nu?o.setAttribute("inert",""):o.removeAttribute("inert")),e.setAttribute("aria-modal",String(n&&window.innerWidth<=nu)),document.getElementById("menu-btn")?.setAttribute("aria-expanded",String(n))}typeof window<"u"&&(window.addEventListener("resize",Gu),window.addEventListener("keydown",e=>{e.key==="Escape"&&document.body.classList.contains("sb-open")&&mr()}));const bk={alert:h_,card:ez,check:o_,chev:PD,chevd:Lp,clock:a_,copy:JD,doc:s_,dots:az,download:iz,folder:$p,dashboard:Tz,gear:tk,globe:l_,hist:wz,link:Mz,lock:c_,menu:Fz,plus:Qz,power:Lz,search:u_,share:rk,shield:d_,terminal:f_,trash:ck,upload:fk,users:m_,x:p_};function yt({name:e}){const n=bk[e];return n?m.jsx(n,{className:"ico","aria-hidden":"true"}):null}const g_={folder:$p,"book-open":MD,"file-text":s_,"pen-line":Kz,users:m_,briefcase:DD,megaphone:Iz,rocket:Jz,lightbulb:jz,flag:cz,star:sk,heart:bz,code:KD,"square-terminal":f_,bug:kD,wrench:pk,database:nz,package:Gz,beaker:jD,gauge:fz,shield:d_,lock:c_,gavel:mz,globe:l_,compass:QD,calendar:$D,clock:a_,"graduation-cap":vz,image:_z,music:Uz};function ka({name:e,className:n}){const r=g_[e??""]??$p;return m.jsx(r,{className:n,"aria-hidden":"true"})}function xk({size:e=22}){return m.jsxs("svg",{width:e,height:e,viewBox:"0 0 32 32",fill:"currentColor",role:"img","aria-label":"BearDrive",children:[m.jsx("rect",{x:"4",y:"4",width:"5.6",height:"24"}),m.jsx("rect",{x:"11.2",y:"4",width:"14.4",height:"11.2"}),m.jsx("rect",{x:"11.2",y:"16.8",width:"16.8",height:"11.2"})]})}function vu(e){const n=["page",e.width??"app",e.className].filter(Boolean).join(" ");return m.jsx("div",{className:n,children:e.children})}function wk(e){e&&Gu()}function al(e){return m.jsxs(m.Fragment,{children:[m.jsx("div",{id:"sb-backdrop",onClick:mr}),m.jsxs("aside",{id:"sidebar",ref:wk,children:[e.vault,e.projectsNav,e.tree??m.jsx("nav",{id:"tree","aria-label":"Files"}),e.orgBar]}),m.jsxs("main",{id:"main",children:[e.topbar,m.jsx("article",{id:"content",ref:e.contentRef,onScroll:e.onContentScroll,children:e.children})]})]})}function Zu(e){const{name:n,onHome:r,showSignout:o,search:s}=e;return m.jsxs("header",{id:"vault",children:[m.jsx("span",{id:"vault-badge",children:m.jsx(xk,{size:22})}),m.jsx("span",{id:"vault-name",className:r?"vault-link":void 0,onClick:r,role:r?"button":void 0,tabIndex:r?0:void 0,onKeyDown:l=>{r&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),r())},children:n}),m.jsxs("div",{className:"vault-actions",children:[s&&m.jsxs(vD,{delayDuration:150,children:[m.jsx(yD,{asChild:!0,children:m.jsx("button",{id:"search-btn",className:"icon-btn2","aria-label":"Search",onClick:()=>{wD(),mr()},children:m.jsx(yt,{name:"search"})})}),m.jsxs(bD,{className:"tipcard",sideOffset:6,children:["Search ",m.jsx("kbd",{children:"⌘K"})]})]}),o&&m.jsx("a",{id:"signout",href:"/auth/logout",title:"Sign out","aria-label":"Sign out",children:m.jsx(yt,{name:"power"})})]})]})}function sl(e){return m.jsxs("header",{id:"topbar",children:[m.jsx("button",{id:"menu-btn",className:"icon-btn",title:"Menu","aria-label":"Menu","aria-controls":"sidebar","aria-expanded":"false",onClick:vk,children:m.jsx(yt,{name:"menu"})}),m.jsx("span",{id:"crumb",children:e.crumb}),m.jsx("span",{id:"meta",children:e.meta}),e.actions]})}function Sk(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const _k=e=>{switch(e){case"success":return Rk;case"info":return Ok;case"warning":return Tk;case"error":return jk;default:return null}},Ck=Array(12).fill(0),Ek=({visible:e,className:n})=>he.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},he.createElement("div",{className:"sonner-spinner"},Ck.map((r,o)=>he.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),Rk=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Tk=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Ok=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),jk=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Ak=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},he.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),he.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Mk=()=>{const[e,n]=he.useState(document.hidden);return he.useEffect(()=>{const r=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let Rm=1;class Nk{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{const r=this.subscribers.indexOf(n);this.subscribers.splice(r,1)}),this.publish=n=>{this.subscribers.forEach(r=>r(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var r;const{message:o,...s}=n,l=typeof n?.id=="number"||((r=n.id)==null?void 0:r.length)>0?n.id:Rm++,u=this.toasts.find(p=>p.id===l),d=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),u?this.toasts=this.toasts.map(p=>p.id===l?(this.publish({...p,...n,id:l,title:o}),{...p,...n,id:l,dismissible:d,title:o}):p):this.addToast({title:o,...s,dismissible:d,id:l}),l},this.dismiss=n=>(n?(this.dismissedToasts.add(n),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:n,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(o=>o({id:r.id,dismiss:!0}))}),n),this.message=(n,r)=>this.create({...r,message:n}),this.error=(n,r)=>this.create({...r,message:n,type:"error"}),this.success=(n,r)=>this.create({...r,type:"success",message:n}),this.info=(n,r)=>this.create({...r,type:"info",message:n}),this.warning=(n,r)=>this.create({...r,type:"warning",message:n}),this.loading=(n,r)=>this.create({...r,type:"loading",message:n}),this.promise=(n,r)=>{if(!r)return;let o;r.loading!==void 0&&(o=this.create({...r,promise:n,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(n instanceof Function?n():n);let l=o!==void 0,u;const d=s.then(async h=>{if(u=["resolve",h],he.isValidElement(h))l=!1,this.create({id:o,type:"default",message:h});else if(zk(h)&&!h.ok){l=!1;const v=typeof r.error=="function"?await r.error(`HTTP error! status: ${h.status}`):r.error,b=typeof r.description=="function"?await r.description(`HTTP error! status: ${h.status}`):r.description,C=typeof v=="object"&&!he.isValidElement(v)?v:{message:v};this.create({id:o,type:"error",description:b,...C})}else if(h instanceof Error){l=!1;const v=typeof r.error=="function"?await r.error(h):r.error,b=typeof r.description=="function"?await r.description(h):r.description,C=typeof v=="object"&&!he.isValidElement(v)?v:{message:v};this.create({id:o,type:"error",description:b,...C})}else if(r.success!==void 0){l=!1;const v=typeof r.success=="function"?await r.success(h):r.success,b=typeof r.description=="function"?await r.description(h):r.description,C=typeof v=="object"&&!he.isValidElement(v)?v:{message:v};this.create({id:o,type:"success",description:b,...C})}}).catch(async h=>{if(u=["reject",h],r.error!==void 0){l=!1;const y=typeof r.error=="function"?await r.error(h):r.error,v=typeof r.description=="function"?await r.description(h):r.description,x=typeof y=="object"&&!he.isValidElement(y)?y:{message:y};this.create({id:o,type:"error",description:v,...x})}}).finally(()=>{l&&(this.dismiss(o),o=void 0),r.finally==null||r.finally.call(r)}),p=()=>new Promise((h,y)=>d.then(()=>u[0]==="reject"?y(u[1]):h(u[1])).catch(y));return typeof o!="string"&&typeof o!="number"?{unwrap:p}:Object.assign(o,{unwrap:p})},this.custom=(n,r)=>{const o=r?.id||Rm++;return this.create({jsx:n(o),id:o,...r}),o},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Mn=new Nk,Dk=(e,n)=>{const r=n?.id||Rm++;return Mn.addToast({title:e,...n,id:r}),r},zk=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",kk=Dk,Lk=()=>Mn.toasts,$k=()=>Mn.getActiveToasts(),ox=Object.assign(kk,{success:Mn.success,info:Mn.info,warning:Mn.warning,error:Mn.error,custom:Mn.custom,message:Mn.message,promise:Mn.promise,dismiss:Mn.dismiss,loading:Mn.loading},{getHistory:Lk,getToasts:$k});Sk("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function qc(e){return e.label!==void 0}const Ik=3,Vk="24px",Fk="16px",ax=4e3,Pk=356,Uk=14,Hk=45,Bk=200;function Er(...e){return e.filter(Boolean).join(" ")}function qk(e){const[n,r]=e.split("-"),o=[];return n&&o.push(n),r&&o.push(r),o}const Gk=e=>{var n,r,o,s,l,u,d,p,h;const{invert:y,toast:v,unstyled:b,interacting:x,setHeights:C,visibleToasts:_,heights:E,index:T,toasts:O,expanded:A,removeToast:z,defaultRichColors:L,closeButton:B,style:H,cancelButtonStyle:I,actionButtonStyle:ne,className:ve="",descriptionClassName:fe="",duration:ce,position:le,gap:me,expandByDefault:xe,classNames:N,icons:Z,closeButtonAriaLabel:re="Close toast"}=e,[W,ee]=he.useState(null),[D,M]=he.useState(null),[U,Q]=he.useState(!1),[K,ae]=he.useState(!1),[J,ge]=he.useState(!1),[ye,Ne]=he.useState(!1),[Fe,Ue]=he.useState(!1),[ht,Je]=he.useState(0),[xn,dn]=he.useState(0),Xt=he.useRef(v.duration||ce||ax),or=he.useRef(null),Ht=he.useRef(null),ar=T===0,Bn=T+1<=_,zt=v.type,pn=v.dismissible!==!1,jt=v.className||"",Dr=v.descriptionClassName||"",kt=he.useMemo(()=>E.findIndex(Me=>Me.toastId===v.id)||0,[E,v.id]),oi=he.useMemo(()=>{var Me;return(Me=v.closeButton)!=null?Me:B},[v.closeButton,B]),br=he.useMemo(()=>v.duration||ce||ax,[v.duration,ce]),ze=he.useRef(0),ke=he.useRef(0),j=he.useRef(0),V=he.useRef(null),[F,se]=le.split("-"),de=he.useMemo(()=>E.reduce((Me,mt,bt)=>bt>=kt?Me:Me+mt.height,0),[E,kt]),pe=Mk(),be=v.invert||y,we=zt==="loading";ke.current=he.useMemo(()=>kt*me+de,[kt,de]),he.useEffect(()=>{Xt.current=br},[br]),he.useEffect(()=>{Q(!0)},[]),he.useEffect(()=>{const Me=Ht.current;if(Me){const mt=Me.getBoundingClientRect().height;return dn(mt),C(bt=>[{toastId:v.id,height:mt,position:v.position},...bt]),()=>C(bt=>bt.filter(Zt=>Zt.toastId!==v.id))}},[C,v.id]),he.useLayoutEffect(()=>{if(!U)return;const Me=Ht.current,mt=Me.style.height;Me.style.height="auto";const bt=Me.getBoundingClientRect().height;Me.style.height=mt,dn(bt),C(Zt=>Zt.find(_t=>_t.toastId===v.id)?Zt.map(_t=>_t.toastId===v.id?{..._t,height:bt}:_t):[{toastId:v.id,height:bt,position:v.position},...Zt])},[U,v.title,v.description,C,v.id,v.jsx,v.action,v.cancel]);const Te=he.useCallback(()=>{ae(!0),Je(ke.current),C(Me=>Me.filter(mt=>mt.toastId!==v.id)),setTimeout(()=>{z(v)},Bk)},[v,z,C,ke]);he.useEffect(()=>{if(v.promise&&zt==="loading"||v.duration===1/0||v.type==="loading")return;let Me;return A||x||pe?(()=>{if(j.current{v.onAutoClose==null||v.onAutoClose.call(v,v),Te()},Xt.current)),()=>clearTimeout(Me)},[A,x,v,zt,pe,Te]),he.useEffect(()=>{v.delete&&(Te(),v.onDismiss==null||v.onDismiss.call(v,v))},[Te,v.delete]);function nt(){var Me;if(Z?.loading){var mt;return he.createElement("div",{className:Er(N?.loader,v==null||(mt=v.classNames)==null?void 0:mt.loader,"sonner-loader"),"data-visible":zt==="loading"},Z.loading)}return he.createElement(Ek,{className:Er(N?.loader,v==null||(Me=v.classNames)==null?void 0:Me.loader),visible:zt==="loading"})}const St=v.icon||Z?.[zt]||_k(zt);var Jt,Lt;return he.createElement("li",{tabIndex:0,ref:Ht,className:Er(ve,jt,N?.toast,v==null||(n=v.classNames)==null?void 0:n.toast,N?.default,N?.[zt],v==null||(r=v.classNames)==null?void 0:r[zt]),"data-sonner-toast":"","data-rich-colors":(Jt=v.richColors)!=null?Jt:L,"data-styled":!(v.jsx||v.unstyled||b),"data-mounted":U,"data-promise":!!v.promise,"data-swiped":Fe,"data-removed":K,"data-visible":Bn,"data-y-position":F,"data-x-position":se,"data-index":T,"data-front":ar,"data-swiping":J,"data-dismissible":pn,"data-type":zt,"data-invert":be,"data-swipe-out":ye,"data-swipe-direction":D,"data-expanded":!!(A||xe&&U),"data-testid":v.testId,style:{"--index":T,"--toasts-before":T,"--z-index":O.length-T,"--offset":`${K?ht:ke.current}px`,"--initial-height":xe?"auto":`${xn}px`,...H,...v.style},onDragEnd:()=>{ge(!1),ee(null),V.current=null},onPointerDown:Me=>{Me.button!==2&&(we||!pn||(or.current=new Date,Je(ke.current),Me.target.setPointerCapture(Me.pointerId),Me.target.tagName!=="BUTTON"&&(ge(!0),V.current={x:Me.clientX,y:Me.clientY})))},onPointerUp:()=>{var Me,mt,bt;if(ye||!pn)return;V.current=null;const Zt=Number(((Me=Ht.current)==null?void 0:Me.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),sr=Number(((mt=Ht.current)==null?void 0:mt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),_t=new Date().getTime()-((bt=or.current)==null?void 0:bt.getTime()),wn=W==="x"?Zt:sr,Xi=Math.abs(wn)/_t;if(Math.abs(wn)>=Hk||Xi>.11){Je(ke.current),v.onDismiss==null||v.onDismiss.call(v,v),M(W==="x"?Zt>0?"right":"left":sr>0?"down":"up"),Te(),Ne(!0);return}else{var Sn,_n;(Sn=Ht.current)==null||Sn.style.setProperty("--swipe-amount-x","0px"),(_n=Ht.current)==null||_n.style.setProperty("--swipe-amount-y","0px")}Ue(!1),ge(!1),ee(null)},onPointerMove:Me=>{var mt,bt,Zt;if(!V.current||!pn||((mt=window.getSelection())==null?void 0:mt.toString().length)>0)return;const _t=Me.clientY-V.current.y,wn=Me.clientX-V.current.x;var Xi;const Sn=(Xi=e.swipeDirections)!=null?Xi:qk(le);!W&&(Math.abs(wn)>1||Math.abs(_t)>1)&&ee(Math.abs(wn)>Math.abs(_t)?"x":"y");let _n={x:0,y:0};const Lo=lr=>1/(1.5+Math.abs(lr)/20);if(W==="y"){if(Sn.includes("top")||Sn.includes("bottom"))if(Sn.includes("top")&&_t<0||Sn.includes("bottom")&&_t>0)_n.y=_t;else{const lr=_t*Lo(_t);_n.y=Math.abs(lr)0)_n.x=wn;else{const lr=wn*Lo(wn);_n.x=Math.abs(lr)0||Math.abs(_n.y)>0)&&Ue(!0),(bt=Ht.current)==null||bt.style.setProperty("--swipe-amount-x",`${_n.x}px`),(Zt=Ht.current)==null||Zt.style.setProperty("--swipe-amount-y",`${_n.y}px`)}},oi&&!v.jsx&&zt!=="loading"?he.createElement("button",{"aria-label":re,"data-disabled":we,"data-close-button":!0,onClick:we||!pn?()=>{}:()=>{Te(),v.onDismiss==null||v.onDismiss.call(v,v)},className:Er(N?.closeButton,v==null||(o=v.classNames)==null?void 0:o.closeButton)},(Lt=Z?.close)!=null?Lt:Ak):null,(zt||v.icon||v.promise)&&v.icon!==null&&(Z?.[zt]!==null||v.icon)?he.createElement("div",{"data-icon":"",className:Er(N?.icon,v==null||(s=v.classNames)==null?void 0:s.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||nt():null,v.type!=="loading"?St:null):null,he.createElement("div",{"data-content":"",className:Er(N?.content,v==null||(l=v.classNames)==null?void 0:l.content)},he.createElement("div",{"data-title":"",className:Er(N?.title,v==null||(u=v.classNames)==null?void 0:u.title)},v.jsx?v.jsx:typeof v.title=="function"?v.title():v.title),v.description?he.createElement("div",{"data-description":"",className:Er(fe,Dr,N?.description,v==null||(d=v.classNames)==null?void 0:d.description)},typeof v.description=="function"?v.description():v.description):null),he.isValidElement(v.cancel)?v.cancel:v.cancel&&qc(v.cancel)?he.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||I,onClick:Me=>{qc(v.cancel)&&pn&&(v.cancel.onClick==null||v.cancel.onClick.call(v.cancel,Me),Te())},className:Er(N?.cancelButton,v==null||(p=v.classNames)==null?void 0:p.cancelButton)},v.cancel.label):null,he.isValidElement(v.action)?v.action:v.action&&qc(v.action)?he.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||ne,onClick:Me=>{qc(v.action)&&(v.action.onClick==null||v.action.onClick.call(v.action,Me),!Me.defaultPrevented&&Te())},className:Er(N?.actionButton,v==null||(h=v.classNames)==null?void 0:h.actionButton)},v.action.label):null)};function sx(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Zk(e,n){const r={};return[e,n].forEach((o,s)=>{const l=s===1,u=l?"--mobile-offset":"--offset",d=l?Fk:Vk;function p(h){["top","right","bottom","left"].forEach(y=>{r[`${u}-${y}`]=typeof h=="number"?`${h}px`:h})}typeof o=="number"||typeof o=="string"?p(o):typeof o=="object"?["top","right","bottom","left"].forEach(h=>{o[h]===void 0?r[`${u}-${h}`]=d:r[`${u}-${h}`]=typeof o[h]=="number"?`${o[h]}px`:o[h]}):p(d)}),r}const Kk=he.forwardRef(function(n,r){const{id:o,invert:s,position:l="bottom-right",hotkey:u=["altKey","KeyT"],expand:d,closeButton:p,className:h,offset:y,mobileOffset:v,theme:b="light",richColors:x,duration:C,style:_,visibleToasts:E=Ik,toastOptions:T,dir:O=sx(),gap:A=Uk,icons:z,containerAriaLabel:L="Notifications"}=n,[B,H]=he.useState([]),I=he.useMemo(()=>o?B.filter(U=>U.toasterId===o):B.filter(U=>!U.toasterId),[B,o]),ne=he.useMemo(()=>Array.from(new Set([l].concat(I.filter(U=>U.position).map(U=>U.position)))),[I,l]),[ve,fe]=he.useState([]),[ce,le]=he.useState(!1),[me,xe]=he.useState(!1),[N,Z]=he.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),re=he.useRef(null),W=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),ee=he.useRef(null),D=he.useRef(!1),M=he.useCallback(U=>{H(Q=>{var K;return(K=Q.find(ae=>ae.id===U.id))!=null&&K.delete||Mn.dismiss(U.id),Q.filter(({id:ae})=>ae!==U.id)})},[]);return he.useEffect(()=>Mn.subscribe(U=>{if(U.dismiss){requestAnimationFrame(()=>{H(Q=>Q.map(K=>K.id===U.id?{...K,delete:!0}:K))});return}setTimeout(()=>{X2.flushSync(()=>{H(Q=>{const K=Q.findIndex(ae=>ae.id===U.id);return K!==-1?[...Q.slice(0,K),{...Q[K],...U},...Q.slice(K+1)]:[U,...Q]})})})}),[B]),he.useEffect(()=>{if(b!=="system"){Z(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Z("dark"):Z("light")),typeof window>"u")return;const U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:Q})=>{Z(Q?"dark":"light")})}catch{U.addListener(({matches:K})=>{try{Z(K?"dark":"light")}catch(ae){console.error(ae)}})}},[b]),he.useEffect(()=>{B.length<=1&&le(!1)},[B]),he.useEffect(()=>{const U=Q=>{var K;if(u.every(ge=>Q[ge]||Q.code===ge)){var J;le(!0),(J=re.current)==null||J.focus()}Q.code==="Escape"&&(document.activeElement===re.current||(K=re.current)!=null&&K.contains(document.activeElement))&&le(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[u]),he.useEffect(()=>{if(re.current)return()=>{ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null,D.current=!1)}},[re.current]),he.createElement("section",{ref:r,"aria-label":`${L} ${W}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},ne.map((U,Q)=>{var K;const[ae,J]=U.split("-");return I.length?he.createElement("ol",{key:U,dir:O==="auto"?sx():O,tabIndex:-1,ref:re,className:h,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":ae,"data-x-position":J,style:{"--front-toast-height":`${((K=ve[0])==null?void 0:K.height)||0}px`,"--width":`${Pk}px`,"--gap":`${A}px`,..._,...Zk(y,v)},onBlur:ge=>{D.current&&!ge.currentTarget.contains(ge.relatedTarget)&&(D.current=!1,ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null))},onFocus:ge=>{ge.target instanceof HTMLElement&&ge.target.dataset.dismissible==="false"||D.current||(D.current=!0,ee.current=ge.relatedTarget)},onMouseEnter:()=>le(!0),onMouseMove:()=>le(!0),onMouseLeave:()=>{me||le(!1)},onDragEnd:()=>le(!1),onPointerDown:ge=>{ge.target instanceof HTMLElement&&ge.target.dataset.dismissible==="false"||xe(!0)},onPointerUp:()=>xe(!1)},I.filter(ge=>!ge.position&&Q===0||ge.position===U).map((ge,ye)=>{var Ne,Fe;return he.createElement(Gk,{key:ge.id,icons:z,index:ye,toast:ge,defaultRichColors:x,duration:(Ne=T?.duration)!=null?Ne:C,className:T?.className,descriptionClassName:T?.descriptionClassName,invert:s,visibleToasts:E,closeButton:(Fe=T?.closeButton)!=null?Fe:p,interacting:me,position:U,style:T?.style,unstyled:T?.unstyled,classNames:T?.classNames,cancelButtonStyle:T?.cancelButtonStyle,actionButtonStyle:T?.actionButtonStyle,closeButtonAriaLabel:T?.closeButtonAriaLabel,removeToast:M,toasts:I.filter(Ue=>Ue.position==ge.position),heights:ve.filter(Ue=>Ue.position==ge.position),setHeights:fe,expandByDefault:d,gap:A,expanded:ce,swipeDirections:n.swipeDirections})})):null}))}),Yk=({...e})=>m.jsx(Kk,{theme:"dark",className:"toaster group",icons:{success:m.jsx(qD,{className:"size-4"}),info:m.jsx(Ez,{className:"size-4"}),warning:m.jsx(h_,{className:"size-4"}),error:m.jsx(Bz,{className:"size-4"}),loading:m.jsx(Dz,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius-ctl)"},...e});function Qe(e,n=!1){n?ox.error(e,{duration:1/0,closeButton:!0}):ox(e)}function Qk(){return m.jsx(Yk,{position:"bottom-center"})}const lx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,cx=H1,Xk=(e,n)=>r=>{var o;if(n?.variants==null)return cx(e,r?.class,r?.className);const{variants:s,defaultVariants:l}=n,u=Object.keys(s).map(h=>{const y=r?.[h],v=l?.[h];if(y===null)return null;const b=lx(y)||lx(v);return s[h][b]}),d=r&&Object.entries(r).reduce((h,y)=>{let[v,b]=y;return b===void 0||(h[v]=b),h},{}),p=n==null||(o=n.compoundVariants)===null||o===void 0?void 0:o.reduce((h,y)=>{let{class:v,className:b,...x}=y;return Object.entries(x).every(C=>{let[_,E]=C;return Array.isArray(E)?E.includes({...l,...d}[_]):{...l,...d}[_]===E})?[...h,v,b]:h},[]);return cx(e,u,p,r?.class,r?.className)},Jk=Xk("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[background-color,border-color,color] disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",primary:"pbtn",danger:"danger-btn",subtle:"ai-btn",toolbar:"btn",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Ct({className:e,variant:n="default",size:r="default",asChild:o=!1,...s}){const l=o?J2:"button";return m.jsx(l,{"data-slot":"button","data-variant":n,"data-size":r,className:We(Jk({variant:n,size:r,className:e})),...s})}function Ip({...e}){return m.jsx(op,{"data-slot":"dialog",...e})}function Wk({...e}){return m.jsx(sp,{"data-slot":"dialog-portal",...e})}function e3({className:e,...n}){return m.jsx(lp,{"data-slot":"dialog-overlay",className:We("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...n})}function Vp({className:e,children:n,showCloseButton:r=!0,...o}){return m.jsxs(Wk,{"data-slot":"dialog-portal",children:[m.jsx(e3,{}),m.jsxs(cp,{"data-slot":"dialog-content",className:We("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",e),...o,children:[n,r&&m.jsxs(Yw,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[m.jsx(p_,{}),m.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Ku({className:e,...n}){return m.jsx(Gw,{"data-slot":"dialog-title",className:We("text-lg leading-none font-semibold",e),...n})}let v_=null,ru=[];function bl(e){v_=e,ru.forEach(n=>n())}function Fp(e,n,r="",o="OK",s={}){return new Promise(l=>bl({kind:"prompt",title:e,label:n,value:r,okLabel:o,...s,resolve:l}))}function Yu(e,n,r="Confirm",o=!1){return new Promise(s=>bl({kind:"confirm",title:e,message:n,confirmLabel:r,danger:o,resolve:s}))}function t3(){const e=w.useSyncExternalStore(r=>(ru.push(r),()=>{ru=ru.filter(o=>o!==r)}),()=>v_);if(!e)return null;const n=()=>{bl(null),e.kind==="prompt"?e.resolve(null):e.resolve(!1)};return m.jsx(Ip,{open:!0,onOpenChange:r=>!r&&n(),children:m.jsx(Vp,{className:"modal",showCloseButton:!1,children:e.kind==="prompt"?m.jsx(n3,{m:e}):m.jsx(r3,{m:e})})})}function n3({m:e}){const n=w.useRef(null),r=h=>{bl(null),e.resolve(h)},[o,s]=w.useState(""),[l,u]=w.useState(e.value),d=e.match===void 0||l.trim()===e.match,p=()=>{const h=l;if(d){if(!h.trim()){s("Give it a name."),n.current.focus();return}r(h)}};return m.jsxs(m.Fragment,{children:[m.jsx(Ku,{asChild:!0,children:m.jsx("h3",{children:e.title})}),m.jsx("label",{className:"modal-label",htmlFor:"modal-input",children:e.label}),m.jsx("input",{className:"modal-input",type:"text",autoComplete:"off",value:l,ref:n,id:"modal-input",autoFocus:!0,onFocus:h=>h.currentTarget.select(),"aria-invalid":!!o,"aria-describedby":o?"modal-input-err":void 0,onChange:h=>{u(h.currentTarget.value),o&&s("")},onKeyDown:h=>h.key==="Enter"&&p()}),o&&m.jsx("span",{id:"modal-input-err",role:"alert",className:"field-err",children:o}),m.jsxs("div",{className:"modal-actions",children:[m.jsx(Ct,{variant:"subtle",onClick:()=>r(null),children:"Cancel"}),m.jsx(Ct,{variant:e.danger?"danger":"primary",onClick:p,disabled:!d,children:e.okLabel})]})]})}function r3({m:e}){const n=r=>{bl(null),e.resolve(r)};return m.jsxs(m.Fragment,{children:[m.jsx(Ku,{asChild:!0,children:m.jsx("h3",{children:e.title})}),m.jsx("p",{className:"modal-msg",children:e.message}),m.jsxs("div",{className:"modal-actions",children:[m.jsx(Ct,{variant:"subtle",onClick:()=>n(!1),autoFocus:e.danger,children:"Cancel"}),m.jsx(Ct,{variant:e.danger?"danger":"primary",onClick:()=>n(!0),autoFocus:!e.danger,children:e.confirmLabel})]})]})}function i3(e){return Gt({queryKey:["projects"],queryFn:()=>cn("/api/projects"),enabled:e,refetchInterval:3e4,select:n=>n.projects||[]})}function o3(e){return Gt({queryKey:["orgs"],queryFn:()=>cn("/api/orgs"),enabled:e,select:n=>n.orgs||[]})}function a3(e){return Gt({queryKey:["permissions",e],queryFn:()=>cn(`/api/p/${e}/permissions`),enabled:!!e})}function y_(e,n=!0){return Gt({queryKey:["shares",e],queryFn:()=>cn(`/api/p/${e}/shares`),enabled:!!e&&n,select:r=>r.shares||[]})}function b_(e){return Gt({queryKey:["admin","pending"],queryFn:()=>cn("/api/admin/pending"),enabled:e,select:n=>n.pending||[]})}function Pp(){const e=jo();return()=>Promise.all([e.invalidateQueries({queryKey:["projects"]}),e.invalidateQueries({queryKey:["orgs"]})]).then(()=>{})}function x_(e){return e.split("/").map(encodeURIComponent).join("/")}function s3(e){return e.split("/").map(decodeURIComponent).join("/")}const l3=new Set(["dashboard","history","install","settings"]),Fh={insights:"dashboard"};function w_(e,n){const r=e.indexOf("?"),o=r===-1?"":new URLSearchParams(e.slice(r)).get("v")||"",s=c3(r===-1?e:e.slice(0,r),n);return o&&(s.version=o),s}function ux(e,n){const r=n.replace(/\/+$/,"");return r!==n&&(e.trailingSlash=!0),e.path=r?s3(r):"",e}function c3(e,n){const r=e.replace(/^\/+/,"");if(n!=="hub")return ux({path:""},r);if(r==="orgs"||r.startsWith("orgs/"))return{org:r.slice(5).replace(/\/+$/,""),path:""};if(r==="billing"||r.startsWith("billing/"))return{billing:!0,path:""};const o=r.indexOf("/");if(o===-1)return{project:r,path:""};const s=ux({project:r.slice(0,o),path:""},r.slice(o+1)),l=s.path.indexOf("/"),u=l===-1?s.path:s.path.slice(0,l);return(l3.has(u)||Fh[u])&&(s.view=Fh[u]||u,Fh[u]&&(s.legacyView=!0),s.viewTarget=l===-1?"":s.path.slice(l+1).replace(/\/+$/,""),s.path=""),s}function Qu(e,n,r){const o=x_(e),s=r?"?v="+r:"";return n?"/"+n+(o?"/"+o:"")+s:"/"+o+s}function bo(e,n,r){let o=(n?"/"+n:"")+"/"+e;return r&&(o+="/"+x_(r.replace(/\/+$/,""))),o}let Up="POP";const Tm=new Set;function S_(){for(const e of Tm)e()}window.addEventListener("popstate",()=>{Up="POP",S_()});function yn(e,n){const r=location.pathname+location.search;!n?.replace&&r===e||(history[n?.replace?"replaceState":"pushState"](null,"",e),Up=n?.replace?"REPLACE":"PUSH",S_())}function Hp(){return w.useSyncExternalStore(e=>(Tm.add(e),()=>{Tm.delete(e)}),()=>location.pathname+location.search)}function u3(){return Up}function yu(e){return e.startsWith("/")&&!e.startsWith("//")?{href:e,onClick:r=>{r.defaultPrevented||r.metaKey||r.ctrlKey||r.shiftKey||r.altKey||r.button!==0||(r.preventDefault(),yn(e),document.body.classList.remove("sb-open"))}}:{href:e,target:"_blank",rel:"noopener noreferrer"}}function iu({to:e}){return w.useEffect(()=>{yn(e,{replace:!0})},[e]),null}function __(){return{accessor:(e,n)=>typeof e=="function"?{...n,accessorFn:e}:{...n,accessorKey:e},display:e=>e,group:e=>e}}function Ni(e,n){return typeof e=="function"?e(n):e}function Hn(e,n){return r=>{n.setState(o=>({...o,[e]:Ni(r,o[e])}))}}function Xu(e){return e instanceof Function}function d3(e){return Array.isArray(e)&&e.every(n=>typeof n=="number")}function f3(e,n){const r=[],o=s=>{s.forEach(l=>{r.push(l);const u=n(l);u!=null&&u.length&&o(u)})};return o(e),r}function Le(e,n,r){let o=[],s;return l=>{let u;r.key&&r.debug&&(u=Date.now());const d=e(l);if(!(d.length!==o.length||d.some((y,v)=>o[v]!==y)))return s;o=d;let h;if(r.key&&r.debug&&(h=Date.now()),s=n(...d),r==null||r.onChange==null||r.onChange(s),r.key&&r.debug&&r!=null&&r.debug()){const y=Math.round((Date.now()-u)*100)/100,v=Math.round((Date.now()-h)*100)/100,b=v/16,x=(C,_)=>{for(C=String(C);C.length<_;)C=" "+C;return C};console.info(`%c⏱ ${x(v,5)} /${x(y,5)} ms`,`
+`)},bO=0,_a=[];function xO(e){var n=w.useRef([]),r=w.useRef([0,0]),o=w.useRef(),s=w.useState(bO++)[0],l=w.useState(Lw)[0],u=w.useRef(e);w.useEffect(function(){u.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var _=PT([e.lockRef.current],(e.shards||[]).map(Vb),!0).filter(Boolean);return _.forEach(function(E){return E.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),_.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var d=w.useCallback(function(_,E){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!u.current.allowPinchZoom;var T=Vc(_),O=r.current,A="deltaX"in _?_.deltaX:O[0]-T[0],z="deltaY"in _?_.deltaY:O[1]-T[1],L,B=_.target,H=Math.abs(A)>Math.abs(z)?"h":"v";if("touches"in _&&H==="h"&&B.type==="range")return!1;var I=window.getSelection(),ne=I&&I.anchorNode,ve=ne?ne===B||ne.contains(B):!1;if(ve)return!1;var fe=$b(H,B);if(!fe)return!0;if(fe?L=H:(L=H==="v"?"h":"v",fe=$b(H,B)),!fe)return!1;if(!o.current&&"changedTouches"in _&&(A||z)&&(o.current=L),!L)return!0;var ce=o.current||L;return gO(ce,E,_,ce==="h"?A:z)},[]),p=w.useCallback(function(_){var E=_;if(!(!_a.length||_a[_a.length-1]!==l)){var T="deltaY"in E?Ib(E):Vc(E),O=n.current.filter(function(L){return L.name===E.type&&(L.target===E.target||E.target===L.shadowParent)&&vO(L.delta,T)})[0];if(O&&O.should){E.cancelable&&E.preventDefault();return}if(!O){var A=(u.current.shards||[]).map(Vb).filter(Boolean).filter(function(L){return L.contains(E.target)}),z=A.length>0?d(E,A[0]):!u.current.noIsolation;z&&E.cancelable&&E.preventDefault()}}},[]),m=w.useCallback(function(_,E,T,O){var A={name:_,delta:E,target:T,should:O,shadowParent:wO(T)};n.current.push(A),setTimeout(function(){n.current=n.current.filter(function(z){return z!==A})},1)},[]),y=w.useCallback(function(_){r.current=Vc(_),o.current=void 0},[]),v=w.useCallback(function(_){m(_.type,Ib(_),_.target,d(_,e.lockRef.current))},[]),b=w.useCallback(function(_){m(_.type,Vc(_),_.target,d(_,e.lockRef.current))},[]);w.useEffect(function(){return _a.push(l),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:b}),document.addEventListener("wheel",p,Sa),document.addEventListener("touchmove",p,Sa),document.addEventListener("touchstart",y,Sa),function(){_a=_a.filter(function(_){return _!==l}),document.removeEventListener("wheel",p,Sa),document.removeEventListener("touchmove",p,Sa),document.removeEventListener("touchstart",y,Sa)}},[]);var x=e.removeScrollBar,C=e.inert;return w.createElement(w.Fragment,null,C?w.createElement(l,{styles:yO(s)}):null,x?w.createElement(cO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function wO(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const SO=QT(kw,xO);var Au=w.forwardRef(function(e,n){return w.createElement(ju,Or({},e,{ref:n,sideCar:SO}))});Au.classNames=ju.classNames;var _O=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},Ca=new WeakMap,Fc=new WeakMap,Pc={},Dh=0,Fw=function(e){return e&&(e.host||Fw(e.parentNode))},CO=function(e,n){return n.map(function(r){if(e.contains(r))return r;var o=Fw(r);return o&&e.contains(o)?o:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},EO=function(e,n,r,o){var s=CO(n,Array.isArray(e)?e:[e]);Pc[r]||(Pc[r]=new WeakMap);var l=Pc[r],u=[],d=new Set,p=new Set(s),m=function(v){!v||d.has(v)||(d.add(v),m(v.parentNode))};s.forEach(m);var y=function(v){!v||p.has(v)||Array.prototype.forEach.call(v.children,function(b){if(d.has(b))y(b);else try{var x=b.getAttribute(o),C=x!==null&&x!=="false",_=(Ca.get(b)||0)+1,E=(l.get(b)||0)+1;Ca.set(b,_),l.set(b,E),u.push(b),_===1&&C&&Fc.set(b,!0),E===1&&b.setAttribute(r,"true"),C||b.setAttribute(o,"true")}catch(T){console.error("aria-hidden: cannot operate on ",b,T)}})};return y(n),d.clear(),Dh++,function(){u.forEach(function(v){var b=Ca.get(v)-1,x=l.get(v)-1;Ca.set(v,b),l.set(v,x),b||(Fc.has(v)||v.removeAttribute(o),Fc.delete(v)),x||v.removeAttribute(r)}),Dh--,Dh||(Ca=new WeakMap,Ca=new WeakMap,Fc=new WeakMap,Pc={})}},op=function(e,n,r){r===void 0&&(r="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),s=_O(e);return s?(o.push.apply(o,Array.from(s.querySelectorAll("[aria-live], script"))),EO(o,s,r,"aria-hidden")):function(){return null}},Mu="Dialog",[Pw]=Bi(Mu),[RO,yr]=Pw(Mu),ap=e=>{const{__scopeDialog:n,children:r,open:o,defaultOpen:s,onOpenChange:l,modal:u=!0}=e,d=w.useRef(null),p=w.useRef(null),[m,y]=Fa({prop:o,defaultProp:s??!1,onChange:l,caller:Mu});return h.jsx(RO,{scope:n,triggerRef:d,contentRef:p,contentId:mn(),titleId:mn(),descriptionId:mn(),open:m,onOpenChange:y,onOpenToggle:w.useCallback(()=>y(v=>!v),[y]),modal:u,children:r})};ap.displayName=Mu;var Uw="DialogTrigger",TO=w.forwardRef((e,n)=>{const{__scopeDialog:r,...o}=e,s=yr(Uw,r),l=it(n,s.triggerRef);return h.jsx(Ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":dp(s.open),...o,ref:l,onClick:Re(e.onClick,s.onOpenToggle)})});TO.displayName=Uw;var sp="DialogPortal",[OO,Hw]=Pw(sp,{forceMount:void 0}),lp=e=>{const{__scopeDialog:n,forceMount:r,children:o,container:s}=e,l=yr(sp,n);return h.jsx(OO,{scope:n,forceMount:r,children:w.Children.map(o,u=>h.jsx(vr,{present:r||l.open,children:h.jsx(ml,{asChild:!0,container:s,children:u})}))})};lp.displayName=sp;var lu="DialogOverlay",cp=w.forwardRef((e,n)=>{const r=Hw(lu,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,l=yr(lu,e.__scopeDialog);return l.modal?h.jsx(vr,{present:o||l.open,children:h.jsx(AO,{...s,ref:n})}):null});cp.displayName=lu;var jO=So("DialogOverlay.RemoveScroll"),AO=w.forwardRef((e,n)=>{const{__scopeDialog:r,...o}=e,s=yr(lu,r),l=jT(),u=it(n,l);return h.jsx(Au,{as:jO,allowPinchZoom:!0,shards:[s.contentRef],children:h.jsx(Ve.div,{"data-state":dp(s.open),...o,ref:u,style:{pointerEvents:"auto",...o.style}})})}),Pa="DialogContent",up=w.forwardRef((e,n)=>{const r=Hw(Pa,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,l=yr(Pa,e.__scopeDialog);return h.jsx(vr,{present:o||l.open,children:l.modal?h.jsx(MO,{...s,ref:n}):h.jsx(NO,{...s,ref:n})})});up.displayName=Pa;var MO=w.forwardRef((e,n)=>{const r=yr(Pa,e.__scopeDialog),o=w.useRef(null),s=it(n,r.contentRef,o);return w.useEffect(()=>{const l=o.current;if(l)return op(l)},[]),h.jsx(Bw,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Re(e.onCloseAutoFocus,l=>{l.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0;(u.button===2||d)&&l.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,l=>l.preventDefault())})}),NO=w.forwardRef((e,n)=>{const r=yr(Pa,e.__scopeDialog),o=w.useRef(!1),s=w.useRef(!1);return h.jsx(Bw,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{e.onCloseAutoFocus?.(l),l.defaultPrevented||(o.current||r.triggerRef.current?.focus(),l.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:l=>{e.onInteractOutside?.(l),l.defaultPrevented||(o.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const u=l.target;r.triggerRef.current?.contains(u)&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),Bw=w.forwardRef((e,n)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:l,...u}=e,d=yr(Pa,r);return ip(),h.jsx(h.Fragment,{children:h.jsx(Ou,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:l,children:h.jsx(hl,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":dp(d.open),...u,ref:n,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1)})})})}),qw="DialogTitle",Gw=w.forwardRef((e,n)=>{const{__scopeDialog:r,...o}=e,s=yr(qw,r);return h.jsx(Ve.h2,{id:s.titleId,...o,ref:n})});Gw.displayName=qw;var Zw="DialogDescription",DO=w.forwardRef((e,n)=>{const{__scopeDialog:r,...o}=e,s=yr(Zw,r);return h.jsx(Ve.p,{id:s.descriptionId,...o,ref:n})});DO.displayName=Zw;var Kw="DialogClose",Yw=w.forwardRef((e,n)=>{const{__scopeDialog:r,...o}=e,s=yr(Kw,r);return h.jsx(Ve.button,{type:"button",...o,ref:n,onClick:Re(e.onClick,()=>s.onOpenChange(!1))})});Yw.displayName=Kw;function dp(e){return e?"open":"closed"}function zO(e){const n=w.useRef({value:e,previous:e});return w.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}function kO(e){const[n,r]=w.useState(void 0);return Qt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const l=s[0];let u,d;if("borderBoxSize"in l){const p=l.borderBoxSize,m=Array.isArray(p)?p[0]:p;u=m.inlineSize,d=m.blockSize}else u=e.offsetWidth,d=e.offsetHeight;r({width:u,height:d})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else r(void 0)},[e]),n}const LO=["top","right","bottom","left"],Vi=Math.min,ti=Math.max,cu=Math.round,Uc=Math.floor,ni=e=>({x:e,y:e}),$O={left:"right",right:"left",bottom:"top",top:"bottom"};function Qw(e,n,r){return ti(e,Vi(n,r))}function ri(e,n){return typeof e=="function"?e(n):e}function Fi(e){return e.split("-")[0]}function Ba(e){return e.split("-")[1]}function fp(e){return e==="x"?"y":"x"}function hp(e){return e==="y"?"height":"width"}function jr(e){const n=e[0];return n==="t"||n==="b"?"y":"x"}function mp(e){return fp(jr(e))}function IO(e,n,r){r===void 0&&(r=!1);const o=Ba(e),s=mp(e),l=hp(s);let u=s==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return n.reference[l]>n.floating[l]&&(u=uu(u)),[u,uu(u)]}function VO(e){const n=uu(e);return[pm(e),n,pm(n)]}function pm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Fb=["left","right"],Pb=["right","left"],FO=["top","bottom"],PO=["bottom","top"];function UO(e,n,r){switch(e){case"top":case"bottom":return r?n?Pb:Fb:n?Fb:Pb;case"left":case"right":return n?FO:PO;default:return[]}}function HO(e,n,r,o){const s=Ba(e);let l=UO(Fi(e),r==="start",o);return s&&(l=l.map(u=>u+"-"+s),n&&(l=l.concat(l.map(pm)))),l}function uu(e){const n=Fi(e);return $O[n]+e.slice(n.length)}function BO(e){var n,r,o,s;return{top:(n=e.top)!=null?n:0,right:(r=e.right)!=null?r:0,bottom:(o=e.bottom)!=null?o:0,left:(s=e.left)!=null?s:0}}function Xw(e){return typeof e!="number"?BO(e):{top:e,right:e,bottom:e,left:e}}function du(e){const{x:n,y:r,width:o,height:s}=e;return{width:o,height:s,top:r,left:n,right:n+o,bottom:r+s,x:n,y:r}}function Ub(e,n,r){let{reference:o,floating:s}=e;const l=jr(n),u=mp(n),d=hp(u),p=Fi(n),m=l==="y",y=o.x+o.width/2-s.width/2,v=o.y+o.height/2-s.height/2,b=o[d]/2-s[d]/2;let x;switch(p){case"top":x={x:y,y:o.y-s.height};break;case"bottom":x={x:y,y:o.y+o.height};break;case"right":x={x:o.x+o.width,y:v};break;case"left":x={x:o.x-s.width,y:v};break;default:x={x:o.x,y:o.y}}const C=Ba(n);return C&&(x[u]+=b*(C==="end"?1:-1)*(r&&m?-1:1)),x}async function qO(e,n){var r;n===void 0&&(n={});const{x:o,y:s,platform:l,rects:u,elements:d,strategy:p}=e,{boundary:m="clippingAncestors",rootBoundary:y="viewport",elementContext:v="floating",altBoundary:b=!1,padding:x=0}=ri(n,e),C=Xw(x),E=d[b?v==="floating"?"reference":"floating":v],T=du(await l.getClippingRect({element:(r=await(l.isElement==null?void 0:l.isElement(E)))==null||r?E:E.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:m,rootBoundary:y,strategy:p})),O=v==="floating"?{x:o,y:s,width:u.floating.width,height:u.floating.height}:u.reference,A=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),z=await(l.isElement==null?void 0:l.isElement(A))&&await(l.getScale==null?void 0:l.getScale(A))||{x:1,y:1},L=du(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:O,offsetParent:A,strategy:p}):O);return{top:(T.top-L.top+C.top)/z.y,bottom:(L.bottom-T.bottom+C.bottom)/z.y,left:(T.left-L.left+C.left)/z.x,right:(L.right-T.right+C.right)/z.x}}const GO=50,ZO=async(e,n,r)=>{const{placement:o="bottom",strategy:s="absolute",middleware:l=[],platform:u}=r,d=u.detectOverflow?u:{...u,detectOverflow:qO},p=await(u.isRTL==null?void 0:u.isRTL(n));let m=await u.getElementRects({reference:e,floating:n,strategy:s}),{x:y,y:v}=Ub(m,o,p),b=o,x=0;const C={};for(let _=0;_({name:"arrow",options:e,async fn(n){const{x:r,y:o,placement:s,rects:l,platform:u,elements:d,middlewareData:p}=n,{element:m,padding:y=0}=ri(e,n)||{};if(m==null)return{};const v=Xw(y),b={x:r,y:o},x=mp(s),C=hp(x),_=await u.getDimensions(m),E=x==="y",T=E?"top":"left",O=E?"bottom":"right",A=E?"clientHeight":"clientWidth",z=l.reference[C]+l.reference[x]-b[x]-l.floating[C],L=b[x]-l.reference[x],B=await(u.getOffsetParent==null?void 0:u.getOffsetParent(m));let H=B?B[A]:0;(!H||!await(u.isElement==null?void 0:u.isElement(B)))&&(H=d.floating[A]||l.floating[C]);const I=z/2-L/2,ne=H/2-_[C]/2-1,ve=Vi(v[T],ne),fe=Vi(v[O],ne),ce=H-_[C]-fe,le=H/2-_[C]/2+I,me=Qw(ve,le,ce),xe=!p.arrow&&Ba(s)!=null&&le!==me&&l.reference[C]/2-(leme<=0)){var fe,ce;const me=(((fe=l.flip)==null?void 0:fe.index)||0)+1,xe=H[me];if(xe&&(!(v==="alignment"?O!==jr(xe):!1)||ve.every(re=>jr(re.placement)===O?re.overflows[0]>0:!0)))return{data:{index:me,overflows:ve},reset:{placement:xe}};let N=(ce=ve.filter(Z=>Z.overflows[0]<=0).sort((Z,re)=>Z.overflows[1]-re.overflows[1])[0])==null?void 0:ce.placement;if(!N)switch(x){case"bestFit":{var le;const Z=(le=ve.filter(re=>{if(B){const W=jr(re.placement);return W===O||W==="y"}return!0}).map(re=>[re.placement,re.overflows.filter(W=>W>0).reduce((W,ee)=>W+ee,0)]).sort((re,W)=>re[1]-W[1])[0])==null?void 0:le[0];Z&&(N=Z);break}case"initialPlacement":N=d;break}if(s!==N)return{reset:{placement:N}}}return{}}}};function Hb(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function Bb(e){return LO.some(n=>e[n]>=0)}const QO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:r,platform:o}=n,{strategy:s="referenceHidden",...l}=ri(e,n);switch(s){case"referenceHidden":{const u=await o.detectOverflow(n,{...l,elementContext:"reference"}),d=Hb(u,r.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Bb(d)}}}case"escaped":{const u=await o.detectOverflow(n,{...l,altBoundary:!0}),d=Hb(u,r.floating);return{data:{escapedOffsets:d,escaped:Bb(d)}}}default:return{}}}}},Jw=new Set(["left","top"]);async function XO(e,n){const{placement:r,platform:o,elements:s}=e,l=await(o.isRTL==null?void 0:o.isRTL(s.floating)),u=Fi(r),d=Ba(r),p=jr(r)==="y",m=Jw.has(u)?-1:1,y=l&&p?-1:1,v=ri(n,e);let{mainAxis:b,crossAxis:x,alignmentAxis:C}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return d&&typeof C=="number"&&(x=d==="end"?C*-1:C),p?{x:x*y,y:b*m}:{x:b*m,y:x*y}}const JO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var r,o;const{x:s,y:l,placement:u,middlewareData:d}=n,p=await XO(n,e);return u===((r=d.offset)==null?void 0:r.placement)&&(o=d.arrow)!=null&&o.alignmentOffset?{}:{x:s+p.x,y:l+p.y,data:{...p,placement:u}}}}},WO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:r,y:o,placement:s,platform:l}=n,{mainAxis:u=!0,crossAxis:d=!1,limiter:p={fn:O=>{let{x:A,y:z}=O;return{x:A,y:z}}},...m}=ri(e,n),y={x:r,y:o},v=await l.detectOverflow(n,m),b=jr(s),x=fp(b);let C=y[x],_=y[b];const E=(O,A)=>Qw(A+v[O==="y"?"top":"left"],A,A-v[O==="y"?"bottom":"right"]);u&&(C=E(x,C)),d&&(_=E(b,_));const T=p.fn({...n,[x]:C,[b]:_});return{...T,data:{x:T.x-r,y:T.y-o,enabled:{[x]:u,[b]:d}}}}}},ej=function(e){return e===void 0&&(e={}),{options:e,fn(n){var r,o;const{x:s,y:l,placement:u,rects:d,middlewareData:p}=n,{offset:m=0,mainAxis:y=!0,crossAxis:v=!0}=ri(e,n),b={x:s,y:l},x=jr(u),C=fp(x);let _=b[C],E=b[x];const T=ri(m,n),O=typeof T=="number"?{mainAxis:T,crossAxis:0}:{mainAxis:(r=T.mainAxis)!=null?r:0,crossAxis:(o=T.crossAxis)!=null?o:0};if(y){const L=C==="y"?"height":"width",B=d.reference[C]-d.floating[L]+O.mainAxis,H=d.reference[C]+d.reference[L]-O.mainAxis;_H&&(_=H)}if(v){var A,z;const L=C==="y"?"width":"height",B=Jw.has(Fi(u)),H=d.reference[x]-d.floating[L]+(B&&((A=p.offset)==null?void 0:A[x])||0)+(B?0:O.crossAxis),I=d.reference[x]+d.reference[L]+(B?0:((z=p.offset)==null?void 0:z[x])||0)-(B?O.crossAxis:0);EI&&(E=I)}return{[C]:_,[x]:E}}}},tj=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){const{placement:r,rects:o,platform:s,elements:l}=n,{apply:u=()=>{},...d}=ri(e,n),p=await s.detectOverflow(n,d),m=Fi(r),y=Ba(r),v=jr(r)==="y",{width:b,height:x}=o.floating;let C,_;m==="top"||m==="bottom"?(C=m,_=y===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(_=m,C=y==="end"?"top":"bottom");const E=x-p.top-p.bottom,T=b-p.left-p.right,O=Vi(x-p[C],E),A=Vi(b-p[_],T),z=n.middlewareData.shift,L=!z;let B=O,H=A;z!=null&&z.enabled.x&&(H=T),z!=null&&z.enabled.y&&(B=E),L&&!y&&(v?H=b-2*ti(p.left,p.right):B=x-2*ti(p.top,p.bottom)),await u({...n,availableWidth:H,availableHeight:B});const I=await s.getDimensions(l.floating);return b!==I.width||x!==I.height?{reset:{rects:!0}}:{}}}};function Nu(){return typeof window<"u"}function qa(e){return Ww(e)?(e.nodeName||"").toLowerCase():"#document"}function Dn(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function ii(e){var n;return(n=(Ww(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function Ww(e){return Nu()?e instanceof Node||e instanceof Dn(e).Node:!1}function Ar(e){return Nu()?e instanceof Element||e instanceof Dn(e).Element:!1}function qi(e){return Nu()?e instanceof HTMLElement||e instanceof Dn(e).HTMLElement:!1}function qb(e){return!Nu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Dn(e).ShadowRoot}function Du(e){const{overflow:n,overflowX:r,overflowY:o,display:s}=Mr(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+r)&&s!=="inline"&&s!=="contents"}function nj(e){return/^(table|td|th)$/.test(qa(e))}function zu(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const rj=/transform|translate|scale|rotate|perspective|filter/,ij=/paint|layout|strict|content/,go=e=>!!e&&e!=="none";let zh;function pp(e){const n=Ar(e)?Mr(e):e;return go(n.transform)||go(n.translate)||go(n.scale)||go(n.rotate)||go(n.perspective)||!gp()&&(go(n.backdropFilter)||go(n.filter))||rj.test(n.willChange||"")||ij.test(n.contain||"")}function oj(e){let n=_o(e);for(;qi(n)&&!tl(n);){if(pp(n))return n;if(zu(n))return null;n=_o(n)}return null}function gp(){return zh==null&&(zh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),zh}function tl(e){return/^(html|body|#document)$/.test(qa(e))}function Mr(e){return Dn(e).getComputedStyle(e)}function ku(e){return Ar(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _o(e){if(qa(e)==="html")return e;const n=e.assignedSlot||e.parentNode||qb(e)&&e.host||ii(e);return qb(n)?n.host:n}function eS(e){const n=_o(e);return tl(n)?(e.ownerDocument||e).body:qi(n)&&Du(n)?n:eS(n)}function nl(e,n,r){var o;n===void 0&&(n=[]),r===void 0&&(r=!0);const s=eS(e),l=s===((o=e.ownerDocument)==null?void 0:o.body),u=Dn(s);if(l){const d=gm(u);return n.concat(u,u.visualViewport||[],Du(s)?s:[],d&&r?nl(d):[])}else return n.concat(s,nl(s,[],r))}function gm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function tS(e){const n=Mr(e);let r=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const s=qi(e),l=s?e.offsetWidth:r,u=s?e.offsetHeight:o,d=cu(r)!==l||cu(o)!==u;return d&&(r=l,o=u),{width:r,height:o,$:d}}function vp(e){return Ar(e)?e:e.contextElement}function za(e){const n=vp(e);if(!qi(n))return ni(1);const r=n.getBoundingClientRect(),{width:o,height:s,$:l}=tS(n);let u=(l?cu(r.width):r.width)/o,d=(l?cu(r.height):r.height)/s;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const aj=ni(0);function nS(e){const n=Dn(e);return!gp()||!n.visualViewport?aj:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function sj(e,n,r){return n===void 0&&(n=!1),!!r&&n&&r===Dn(e)}function Co(e,n,r,o){n===void 0&&(n=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),l=vp(e);let u=ni(1);n&&(o?Ar(o)&&(u=za(o)):u=za(e));const d=sj(l,r,o)?nS(l):ni(0);let p=(s.left+d.x)/u.x,m=(s.top+d.y)/u.y,y=s.width/u.x,v=s.height/u.y;if(l&&o){const b=Dn(l),x=Ar(o)?Dn(o):o;let C=b,_=gm(C);for(;_&&x!==C;){const E=za(_),T=_.getBoundingClientRect(),O=Mr(_),A=T.left+(_.clientLeft+parseFloat(O.paddingLeft))*E.x,z=T.top+(_.clientTop+parseFloat(O.paddingTop))*E.y;p*=E.x,m*=E.y,y*=E.x,v*=E.y,p+=A,m+=z,C=Dn(_),_=gm(C)}}return du({width:y,height:v,x:p,y:m})}function Lu(e,n){const r=ku(e).scrollLeft;return n?n.left+r:Co(ii(e)).left+r}function rS(e,n){const r=e.getBoundingClientRect(),o=r.left+n.scrollLeft-Lu(e,r),s=r.top+n.scrollTop;return{x:o,y:s}}function lj(e){let{elements:n,rect:r,offsetParent:o,strategy:s}=e;const l=s==="fixed",u=ii(o),d=n?zu(n.floating):!1;if(o===u||d&&l)return r;let p={scrollLeft:0,scrollTop:0},m=ni(1);const y=ni(0),v=qi(o);if((v||!l)&&((qa(o)!=="body"||Du(u))&&(p=ku(o)),v)){const x=Co(o);m=za(o),y.x=x.x+o.clientLeft,y.y=x.y+o.clientTop}const b=u&&!v&&!l?rS(u,p):ni(0);return{width:r.width*m.x,height:r.height*m.y,x:r.x*m.x-p.scrollLeft*m.x+y.x+b.x,y:r.y*m.y-p.scrollTop*m.y+y.y+b.y}}function cj(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function uj(e){const n=ku(e),r=e.ownerDocument.body,o=ti(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=ti(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Lu(e);const u=-n.scrollTop;return Mr(r).direction==="rtl"&&(l+=ti(e.clientWidth,r.clientWidth)-o),{width:o,height:s,x:l,y:u}}const dj=25;function fj(e,n,r){r===void 0&&(r="viewport");const o=r==="layoutViewport",s=Dn(e),l=ii(e),u=s.visualViewport;let d=l.clientWidth,p=l.clientHeight,m=0,y=0;if(u){const b=!gp()||n==="fixed";o?b||(m=-u.offsetLeft,y=-u.offsetTop):(d=u.width,p=u.height,b&&(m=u.offsetLeft,y=u.offsetTop))}if(Lu(l)<=0){const b=l.ownerDocument,x=b.body,C=getComputedStyle(x),_=b.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,E=Math.abs(l.clientWidth-x.clientWidth-_),T=getComputedStyle(l).scrollbarGutter==="stable both-edges"?E/2:E;T<=dj&&(d-=T)}return{width:d,height:p,x:m,y}}function hj(e,n){const r=Co(e,!0,n==="fixed"),o=r.top+e.clientTop,s=r.left+e.clientLeft,l=za(e),u=e.clientWidth*l.x,d=e.clientHeight*l.y,p=s*l.x,m=o*l.y;return{width:u,height:d,x:p,y:m}}function Gb(e,n,r){let o;if(n==="viewport"||n==="layoutViewport")o=fj(e,r,n);else if(n==="document")o=uj(ii(e));else if(Ar(n))o=hj(n,r);else{const s=nS(e);o={x:n.x-s.x,y:n.y-s.y,width:n.width,height:n.height}}return du(o)}function mj(e,n){const r=n.get(e);if(r)return r;let o=nl(e,[],!1).filter(d=>Ar(d)&&qa(d)!=="body"),s=null;const l=Mr(e).position==="fixed";let u=l?_o(e):e;for(;Ar(u)&&!tl(u);){const d=Mr(u),p=pp(u),m=s?s.position:l?"fixed":"";!p&&(m==="fixed"||m==="absolute"&&d.position==="static")?o=o.filter(v=>v!==u):s=d,u=_o(u)}return n.set(e,o),o}function pj(e){let{element:n,boundary:r,rootBoundary:o,strategy:s}=e;const u=[...r==="clippingAncestors"?zu(n)?[]:mj(n,this._c):[].concat(r),o],d=Gb(n,u[0],s);let p=d.top,m=d.right,y=d.bottom,v=d.left;for(let b=1;b{d(!1,1e-7)},1e3)}H=!1}try{o=new IntersectionObserver(I,{...B,root:l.ownerDocument})}catch{o=new IntersectionObserver(I,B)}o.observe(e)}const p=Dn(e),m=()=>d(r);return p.addEventListener("resize",m),d(!0),()=>{p.removeEventListener("resize",m),u()}}function Sj(e,n,r,o){o===void 0&&(o={});const{ancestorScroll:s=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:p=!1}=o,m=vp(e),y=s||l?[...m?nl(m):[],...n?nl(n):[]]:[];y.forEach(T=>{s&&T.addEventListener("scroll",r),l&&T.addEventListener("resize",r)});const v=m&&d?wj(m,r,l):null;let b=-1,x=null;u&&(x=new ResizeObserver(T=>{let[O]=T;O&&O.target===m&&x&&n&&(x.unobserve(n),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var A;(A=x)==null||A.observe(n)})),r()}),m&&!p&&x.observe(m),n&&x.observe(n));let C,_=p?Co(e):null;p&&E();function E(){const T=Co(e);_&&!oS(_,T)&&r(),_=T,C=requestAnimationFrame(E)}return r(),()=>{var T;y.forEach(O=>{s&&O.removeEventListener("scroll",r),l&&O.removeEventListener("resize",r)}),v?.(),(T=x)==null||T.disconnect(),x=null,p&&cancelAnimationFrame(C)}}const _j=JO,Cj=WO,Ej=YO,Rj=tj,Tj=QO,Kb=KO,Oj=ej,jj=(e,n,r)=>{const o=new Map,s=r??{},l={...xj,...s.platform,_c:o};return ZO(e,n,{...s,platform:l})};var Aj=typeof document<"u",Mj=function(){},tu=Aj?w.useLayoutEffect:Mj;function fu(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let r,o,s;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==n.length)return!1;for(o=r;o--!==0;)if(!fu(e[o],n[o]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!{}.hasOwnProperty.call(n,s[o]))return!1;for(o=r;o--!==0;){const l=s[o];if(!(l==="_owner"&&e.$$typeof)&&!fu(e[l],n[l]))return!1}return!0}return e!==e&&n!==n}function aS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yb(e,n){const r=aS(e);return Math.round(n*r)/r}function Lh(e){const n=w.useRef(e);return tu(()=>{n.current=e}),n}function Nj(e){e===void 0&&(e={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:s,elements:{reference:l,floating:u}={},transform:d=!0,whileElementsMounted:p,open:m}=e,[y,v]=w.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[b,x]=w.useState(o);fu(b,o)||x(o);const[C,_]=w.useState(null),[E,T]=w.useState(null),O=w.useCallback(re=>{re!==B.current&&(B.current=re,_(re))},[]),A=w.useCallback(re=>{re!==H.current&&(H.current=re,T(re))},[]),z=l||C,L=u||E,B=w.useRef(null),H=w.useRef(null),I=w.useRef(y),ne=p!=null,ve=Lh(p),fe=Lh(s),ce=Lh(m),le=w.useCallback(()=>{if(!B.current||!H.current)return;const re={placement:n,strategy:r,middleware:b};fe.current&&(re.platform=fe.current),jj(B.current,H.current,re).then(W=>{const ee={...W,isPositioned:ce.current!==!1};me.current&&!fu(I.current,ee)&&(I.current=ee,Ao.flushSync(()=>{v(ee)}))})},[b,n,r,fe,ce]);tu(()=>{m===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,v(re=>({...re,isPositioned:!1})))},[m]);const me=w.useRef(!1);tu(()=>(me.current=!0,()=>{me.current=!1}),[]),tu(()=>{if(z&&(B.current=z),L&&(H.current=L),z&&L){if(ve.current)return ve.current(z,L,le);le()}},[z,L,le,ve,ne]);const xe=w.useMemo(()=>({reference:B,floating:H,setReference:O,setFloating:A}),[O,A]),N=w.useMemo(()=>({reference:z,floating:L}),[z,L]),Z=w.useMemo(()=>{const re={position:r,left:0,top:0};if(!N.floating)return re;const W=Yb(N.floating,y.x),ee=Yb(N.floating,y.y);return d?{...re,transform:"translate("+W+"px, "+ee+"px)",...aS(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:W,top:ee}},[r,d,N.floating,y.x,y.y]);return w.useMemo(()=>({...y,update:le,refs:xe,elements:N,floatingStyles:Z}),[y,le,xe,N,Z])}const Dj=e=>{function n(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:o,padding:s}=typeof e=="function"?e(r):e;return o&&n(o)?o.current!=null?Kb({element:o.current,padding:s}).fn(r):{}:o?Kb({element:o,padding:s}).fn(r):{}}}},zj=(e,n)=>{const r=_j(e);return{name:r.name,fn:r.fn,options:[e,n]}},kj=(e,n)=>{const r=Cj(e);return{name:r.name,fn:r.fn,options:[e,n]}},Lj=(e,n)=>({fn:Oj(e).fn,options:[e,n]}),$j=(e,n)=>{const r=Ej(e);return{name:r.name,fn:r.fn,options:[e,n]}},Ij=(e,n)=>{const r=Rj(e);return{name:r.name,fn:r.fn,options:[e,n]}},Vj=(e,n)=>{const r=Tj(e);return{name:r.name,fn:r.fn,options:[e,n]}},Fj=(e,n)=>{const r=Dj(e);return{name:r.name,fn:r.fn,options:[e,n]}};var Pj="Arrow",sS=w.forwardRef((e,n)=>{const{children:r,width:o=10,height:s=5,...l}=e;return h.jsx(Ve.svg,{...l,ref:n,width:o,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});sS.displayName=Pj;var Uj=sS,yp="Popper",[lS,Ga]=Bi(yp),[Hj,cS]=lS(yp),uS=e=>{const{__scopePopper:n,children:r}=e,[o,s]=w.useState(null),[l,u]=w.useState(void 0);return h.jsx(Hj,{scope:n,anchor:o,onAnchorChange:s,placementState:l,setPlacementState:u,children:r})};uS.displayName=yp;var dS="PopperAnchor",fS=w.forwardRef((e,n)=>{const{__scopePopper:r,virtualRef:o,...s}=e,l=cS(dS,r),u=w.useRef(null),d=l.onAnchorChange,p=w.useCallback(C=>{u.current=C,C&&d(C)},[d]),m=it(n,p),y=w.useRef(null);w.useEffect(()=>{if(!o)return;const C=y.current;y.current=o.current,C!==y.current&&d(y.current)});const v=l.placementState&&xp(l.placementState),b=v?.[0],x=v?.[1];return o?null:h.jsx(Ve.div,{"data-radix-popper-side":b,"data-radix-popper-align":x,...s,ref:m})});fS.displayName=dS;var bp="PopperContent",[Bj,qj]=lS(bp),hS=w.forwardRef((e,n)=>{const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:l="center",alignOffset:u=0,arrowPadding:d=0,avoidCollisions:p=!0,collisionBoundary:m=[],collisionPadding:y=0,sticky:v="partial",hideWhenDetached:b=!1,updatePositionStrategy:x="optimized",onPlaced:C,..._}=e,E=cS(bp,r),[T,O]=w.useState(null),A=it(n,O),[z,L]=w.useState(null),B=kO(z),H=B?.width??0,I=B?.height??0,ne=o+(l!=="center"?"-"+l:""),ve=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},fe=Array.isArray(m)?m:[m],ce=fe.length>0,le={padding:ve,boundary:fe.filter(Zj),altBoundary:ce},{refs:me,floatingStyles:xe,placement:N,isPositioned:Z,middlewareData:re}=Nj({strategy:"fixed",placement:ne,whileElementsMounted:(...ge)=>Sj(...ge,{animationFrame:x==="always"}),elements:{reference:E.anchor},middleware:[zj({mainAxis:s+I,alignmentAxis:u}),p&&kj({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?Lj():void 0,...le}),p&&$j({...le}),Ij({...le,apply:({elements:ge,rects:ye,availableWidth:Ne,availableHeight:Fe})=>{const{width:Ue,height:ht}=ye.reference,Je=ge.floating.style;Je.setProperty("--radix-popper-available-width",`${Ne}px`),Je.setProperty("--radix-popper-available-height",`${Fe}px`),Je.setProperty("--radix-popper-anchor-width",`${Ue}px`),Je.setProperty("--radix-popper-anchor-height",`${ht}px`)}}),z&&Fj({element:z,padding:d}),Kj({arrowWidth:H,arrowHeight:I}),b&&Vj({strategy:"referenceHidden",...le,boundary:ce?le.boundary:void 0})]}),W=E.setPlacementState;Qt(()=>(W(N),()=>{W(void 0)}),[N,W]);const[ee,D]=xp(N),M=rr(C);Qt(()=>{Z&&M?.()},[Z,M]);const U=re.arrow?.x,Q=re.arrow?.y,K=re.arrow?.centerOffset!==0,[ae,J]=w.useState();return Qt(()=>{T&&J(window.getComputedStyle(T).zIndex)},[T]),h.jsx("div",{ref:me.setFloating,"data-radix-popper-content-wrapper":"",style:{...xe,transform:Z?xe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[re.transformOrigin?.x,re.transformOrigin?.y].join(" "),...re.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(Bj,{scope:r,placedSide:ee,placedAlign:D,onArrowChange:L,arrowX:U,arrowY:Q,shouldHideArrow:K,children:h.jsx(Ve.div,{"data-side":ee,"data-align":D,..._,ref:A,style:{..._.style,animation:Z?void 0:"none"}})})})});hS.displayName=bp;var mS="PopperArrow",Gj={top:"bottom",right:"left",bottom:"top",left:"right"},pS=w.forwardRef(function(n,r){const{__scopePopper:o,...s}=n,l=qj(mS,o),u=Gj[l.placedSide];return h.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:h.jsx(Uj,{...s,ref:r,style:{...s.style,display:"block"}})})});pS.displayName=mS;function Zj(e){return e!==null}var Kj=e=>({name:"transformOrigin",options:e,fn(n){const{placement:r,rects:o,middlewareData:s}=n,u=s.arrow?.centerOffset!==0,d=u?0:e.arrowWidth,p=u?0:e.arrowHeight,[m,y]=xp(r),v={start:"0%",center:"50%",end:"100%"}[y],b=(s.arrow?.x??0)+d/2,x=(s.arrow?.y??0)+p/2;let C="",_="";return m==="bottom"?(C=u?v:`${b}px`,_=`${-p}px`):m==="top"?(C=u?v:`${b}px`,_=`${o.floating.height+p}px`):m==="right"?(C=`${-p}px`,_=u?v:`${x}px`):m==="left"&&(C=`${o.floating.width+p}px`,_=u?v:`${x}px`),{data:{x:C,y:_}}}});function xp(e){const[n,r="center"]=e.split("-");return[n,r]}var wp=uS,Sp=fS,_p=hS,Cp=pS,$h=!1;function Yj(){const[e,n]=w.useState($h);return w.useEffect(()=>{$h||($h=!0,n(!0))},[]),e}var gS=Ru[" useSyncExternalStore ".trim().toString()];function Qj(){return()=>{}}function Xj(){return gS(Qj,()=>!0,()=>!1)}var Jj=typeof gS=="function"?Xj:Yj,Ih="rovingFocusGroup.onEntryFocus",Wj={bubbles:!1,cancelable:!0},pl="RovingFocusGroup",[vm,vS,eA]=tp(pl),[tA,yS]=Bi(pl,[eA]),[nA,rA]=tA(pl),bS=w.forwardRef((e,n)=>h.jsx(vm.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(vm.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(iA,{...e,ref:n})})}));bS.displayName=pl;var iA=w.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:l,currentTabStopId:u,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:p,onEntryFocus:m,preventScrollOnEntryFocus:y=!1,...v}=e,b=w.useRef(null),x=it(n,b),C=np(l),[_,E]=Fa({prop:u,defaultProp:d??null,onChange:p,caller:pl}),[T,O]=w.useState(!1),A=rr(m),z=vS(r),L=w.useRef(!1),[B,H]=w.useState(0);return w.useEffect(()=>{const I=b.current;if(I)return I.addEventListener(Ih,A),()=>I.removeEventListener(Ih,A)},[A]),h.jsx(nA,{scope:r,orientation:o,dir:C,loop:s,currentTabStopId:_,onItemFocus:w.useCallback(I=>E(I),[E]),onItemShiftTab:w.useCallback(()=>O(!0),[]),onFocusableItemAdd:w.useCallback(()=>H(I=>I+1),[]),onFocusableItemRemove:w.useCallback(()=>H(I=>I-1),[]),children:h.jsx(Ve.div,{tabIndex:T||B===0?-1:0,"data-orientation":o,...v,ref:x,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{L.current=!0}),onFocus:Re(e.onFocus,I=>{const ne=!L.current;if(I.target===I.currentTarget&&ne&&!T){const ve=new CustomEvent(Ih,Wj);if(I.currentTarget.dispatchEvent(ve),!ve.defaultPrevented){const fe=z().filter(N=>N.focusable),ce=fe.find(N=>N.active),le=fe.find(N=>N.id===_),xe=[ce,le,...fe].filter(Boolean).map(N=>N.ref.current);SS(xe,y)}}L.current=!1}),onBlur:Re(e.onBlur,()=>O(!1))})})}),xS="RovingFocusGroupItem",wS=w.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:l,children:u,...d}=e,p=mn(),m=l||p,y=rA(xS,r),v=y.currentTabStopId===m,b=vS(r),{onFocusableItemAdd:x,onFocusableItemRemove:C,currentTabStopId:_}=y,E=Jj();return Qt(()=>{if(!(!E||!o))return x(),()=>C()},[E,o,x,C]),w.useEffect(()=>{if(!(E||!o))return x(),()=>C()},[E,o,x,C]),h.jsx(vm.ItemSlot,{scope:r,id:m,focusable:o,active:s,children:h.jsx(Ve.span,{tabIndex:v?0:-1,"data-orientation":y.orientation,...d,ref:n,onMouseDown:Re(e.onMouseDown,T=>{o?y.onItemFocus(m):T.preventDefault()}),onFocus:Re(e.onFocus,()=>y.onItemFocus(m)),onKeyDown:Re(e.onKeyDown,T=>{if(T.key==="Tab"&&T.shiftKey){y.onItemShiftTab();return}if(T.target!==T.currentTarget)return;const O=sA(T,y.orientation,y.dir);if(O!==void 0){if(T.metaKey||T.ctrlKey||T.altKey||T.shiftKey)return;T.preventDefault();let z=b().filter(L=>L.focusable).map(L=>L.ref.current);if(O==="last")z.reverse();else if(O==="prev"||O==="next"){O==="prev"&&z.reverse();const L=z.indexOf(T.currentTarget);z=y.loop?lA(z,L+1):z.slice(L+1)}setTimeout(()=>SS(z))}}),children:typeof u=="function"?u({isCurrentTabStop:v,hasTabStop:_!=null}):u})})});wS.displayName=xS;var oA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function aA(e,n){return n!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function sA(e,n,r){const o=aA(e.key,r);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return oA[o]}function SS(e,n=!1){const r=document.activeElement;for(const o of e)if(o===r||(o.focus({preventScroll:n}),document.activeElement!==r))return}function lA(e,n){return e.map((r,o)=>e[(n+o)%e.length])}var cA=bS,uA=wS,ym=["Enter"," "],dA=["ArrowDown","PageUp","Home"],_S=["ArrowUp","PageDown","End"],fA=[...dA,..._S],hA={ltr:[...ym,"ArrowRight"],rtl:[...ym,"ArrowLeft"]},mA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},gl="Menu",[rl,pA,gA]=tp(gl),[Mo,CS]=Bi(gl,[gA,Ga,yS]),$u=Ga(),ES=yS(),[vA,No]=Mo(gl),[yA,vl]=Mo(gl),RS=e=>{const{__scopeMenu:n,open:r=!1,children:o,dir:s,onOpenChange:l,modal:u=!0}=e,d=$u(n),[p,m]=w.useState(null),y=w.useRef(!1),v=rr(l),b=np(s);return w.useEffect(()=>{const x=()=>{y.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},C=()=>y.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),w.useEffect(()=>{if(!r)return;const x=()=>v(!1);return window.addEventListener("blur",x),()=>window.removeEventListener("blur",x)},[r,v]),h.jsx(wp,{...d,children:h.jsx(vA,{scope:n,open:r,onOpenChange:v,content:p,onContentChange:m,children:h.jsx(yA,{scope:n,onClose:w.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:y,dir:b,modal:u,children:o})})})};RS.displayName=gl;var bA="MenuAnchor",Ep=w.forwardRef((e,n)=>{const{__scopeMenu:r,...o}=e,s=$u(r);return h.jsx(Sp,{...s,...o,ref:n})});Ep.displayName=bA;var Rp="MenuPortal",[xA,TS]=Mo(Rp,{forceMount:void 0}),OS=e=>{const{__scopeMenu:n,forceMount:r,children:o,container:s}=e,l=No(Rp,n);return h.jsx(xA,{scope:n,forceMount:r,children:h.jsx(vr,{present:r||l.open,children:h.jsx(ml,{asChild:!0,container:s,children:o})})})};OS.displayName=Rp;var nr="MenuContent",[wA,Tp]=Mo(nr),jS=w.forwardRef((e,n)=>{const r=TS(nr,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,l=No(nr,e.__scopeMenu),u=vl(nr,e.__scopeMenu);return h.jsx(rl.Provider,{scope:e.__scopeMenu,children:h.jsx(vr,{present:o||l.open,children:h.jsx(rl.Slot,{scope:e.__scopeMenu,children:u.modal?h.jsx(SA,{...s,ref:n}):h.jsx(_A,{...s,ref:n})})})})}),SA=w.forwardRef((e,n)=>{const r=No(nr,e.__scopeMenu),o=w.useRef(null),s=it(n,o);return w.useEffect(()=>{const l=o.current;if(l)return op(l)},[]),h.jsx(Op,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Re(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),_A=w.forwardRef((e,n)=>{const r=No(nr,e.__scopeMenu);return h.jsx(Op,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),CA=So("MenuContent.ScrollLock"),Op=w.forwardRef((e,n)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:u,disableOutsidePointerEvents:d,onEntryFocus:p,onEscapeKeyDown:m,onPointerDownOutside:y,onFocusOutside:v,onInteractOutside:b,onDismiss:x,disableOutsideScroll:C,..._}=e,E=No(nr,r),T=vl(nr,r),O=$u(r),A=ES(r),z=pA(r),[L,B]=w.useState(null),H=w.useRef(null),I=it(n,H,E.onContentChange),ne=w.useRef(0),ve=w.useRef(""),fe=w.useRef(0),ce=w.useRef(null),le=w.useRef("right"),me=w.useRef(0),xe=C?Au:w.Fragment,N=C?{as:CA,allowPinchZoom:!0}:void 0,Z=W=>{const ee=ve.current+W,D=z().filter(J=>!J.disabled),M=document.activeElement,U=D.find(J=>J.ref.current===M)?.textValue,Q=D.map(J=>J.textValue),K=LA(Q,ee,U),ae=D.find(J=>J.textValue===K)?.ref.current;(function J(ge){ve.current=ge,window.clearTimeout(ne.current),ge!==""&&(ne.current=window.setTimeout(()=>J(""),1e3))})(ee),ae&&setTimeout(()=>ae.focus())};w.useEffect(()=>()=>window.clearTimeout(ne.current),[]),ip();const re=w.useCallback(W=>le.current===ce.current?.side&&IA(W,ce.current?.area),[]);return h.jsx(wA,{scope:r,searchRef:ve,onItemEnter:w.useCallback(W=>{re(W)&&W.preventDefault()},[re]),onItemLeave:w.useCallback(W=>{re(W)||(H.current?.focus(),B(null))},[re]),onTriggerLeave:w.useCallback(W=>{re(W)&&W.preventDefault()},[re]),pointerGraceTimerRef:fe,onPointerGraceIntentChange:w.useCallback(W=>{ce.current=W},[]),children:h.jsx(xe,{...N,children:h.jsx(Ou,{asChild:!0,trapped:s,onMountAutoFocus:Re(l,W=>{W.preventDefault(),H.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:h.jsx(hl,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:m,onPointerDownOutside:y,onFocusOutside:v,onInteractOutside:b,onDismiss:x,children:h.jsx(cA,{asChild:!0,...A,dir:T.dir,orientation:"vertical",loop:o,currentTabStopId:L,onCurrentTabStopIdChange:B,onEntryFocus:Re(p,W=>{T.isUsingKeyboardRef.current||W.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(_p,{role:"menu","aria-orientation":"vertical","data-state":qS(E.open),"data-radix-menu-content":"",dir:T.dir,...O,..._,ref:I,style:{outline:"none",..._.style},onKeyDown:Re(_.onKeyDown,W=>{const D=W.target.closest("[data-radix-menu-content]")===W.currentTarget,M=W.ctrlKey||W.altKey||W.metaKey,U=W.key.length===1;D&&(W.key==="Tab"&&W.preventDefault(),!M&&U&&Z(W.key));const Q=H.current;if(W.target!==Q||!fA.includes(W.key))return;W.preventDefault();const ae=z().filter(J=>!J.disabled).map(J=>J.ref.current);_S.includes(W.key)&&ae.reverse(),zA(ae)}),onBlur:Re(e.onBlur,W=>{W.currentTarget.contains(W.target)||(window.clearTimeout(ne.current),ve.current="")}),onPointerMove:Re(e.onPointerMove,il(W=>{const ee=W.target,D=me.current!==W.clientX;if(W.currentTarget.contains(ee)&&D){const M=W.clientX>me.current?"right":"left";le.current=M,me.current=W.clientX}}))})})})})})})});jS.displayName=nr;var EA="MenuGroup",jp=w.forwardRef((e,n)=>{const{__scopeMenu:r,...o}=e;return h.jsx(Ve.div,{role:"group",...o,ref:n})});jp.displayName=EA;var RA="MenuLabel",AS=w.forwardRef((e,n)=>{const{__scopeMenu:r,...o}=e;return h.jsx(Ve.div,{...o,ref:n})});AS.displayName=RA;var hu="MenuItem",Qb="menu.itemSelect",Iu=w.forwardRef((e,n)=>{const{disabled:r=!1,onSelect:o,...s}=e,l=w.useRef(null),u=vl(hu,e.__scopeMenu),d=Tp(hu,e.__scopeMenu),p=it(n,l),m=w.useRef(!1),y=()=>{const v=l.current;if(!r&&v){const b=new CustomEvent(Qb,{bubbles:!0,cancelable:!0});v.addEventListener(Qb,x=>o?.(x),{once:!0}),Ow(v,b),b.defaultPrevented?m.current=!1:u.onClose()}};return h.jsx(MS,{...s,ref:p,disabled:r,onClick:Re(e.onClick,y),onPointerDown:v=>{e.onPointerDown?.(v),m.current=!0},onPointerUp:Re(e.onPointerUp,v=>{m.current||v.currentTarget?.click()}),onKeyDown:Re(e.onKeyDown,v=>{r||v.target!==v.currentTarget||d.searchRef.current!==""&&v.key===" "||ym.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})});Iu.displayName=hu;var MS=w.forwardRef((e,n)=>{const{__scopeMenu:r,disabled:o=!1,textValue:s,...l}=e,u=Tp(hu,r),d=ES(r),p=w.useRef(null),m=it(n,p),[y,v]=w.useState(!1),[b,x]=w.useState("");return w.useEffect(()=>{const C=p.current;C&&x((C.textContent??"").trim())},[l.children]),h.jsx(rl.ItemSlot,{scope:r,disabled:o,textValue:s??b,children:h.jsx(uA,{asChild:!0,...d,focusable:!o,children:h.jsx(Ve.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...l,ref:m,onPointerMove:Re(e.onPointerMove,il(C=>{o?u.onItemLeave(C):(u.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(e.onPointerLeave,il(C=>u.onItemLeave(C))),onFocus:Re(e.onFocus,()=>v(!0)),onBlur:Re(e.onBlur,()=>v(!1))})})})}),TA="MenuCheckboxItem",NS=w.forwardRef((e,n)=>{const{checked:r=!1,onCheckedChange:o,...s}=e;return h.jsx($S,{scope:e.__scopeMenu,checked:r,children:h.jsx(Iu,{role:"menuitemcheckbox","aria-checked":mu(r)?"mixed":r,...s,ref:n,"data-state":Mp(r),onSelect:Re(s.onSelect,()=>o?.(mu(r)?!0:!r),{checkForDefaultPrevented:!1})})})});NS.displayName=TA;var DS="MenuRadioGroup",[OA,jA]=Mo(DS,{value:void 0,onValueChange:()=>{}}),zS=w.forwardRef((e,n)=>{const{value:r,onValueChange:o,...s}=e,l=rr(o);return h.jsx(OA,{scope:e.__scopeMenu,value:r,onValueChange:l,children:h.jsx(jp,{...s,ref:n})})});zS.displayName=DS;var kS="MenuRadioItem",LS=w.forwardRef((e,n)=>{const{value:r,...o}=e,s=jA(kS,e.__scopeMenu),l=r===s.value;return h.jsx($S,{scope:e.__scopeMenu,checked:l,children:h.jsx(Iu,{role:"menuitemradio","aria-checked":l,...o,ref:n,"data-state":Mp(l),onSelect:Re(o.onSelect,()=>s.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});LS.displayName=kS;var Ap="MenuItemIndicator",[$S,AA]=Mo(Ap,{checked:!1}),IS=w.forwardRef((e,n)=>{const{__scopeMenu:r,forceMount:o,...s}=e,l=AA(Ap,r);return h.jsx(vr,{present:o||mu(l.checked)||l.checked===!0,children:h.jsx(Ve.span,{...s,ref:n,"data-state":Mp(l.checked)})})});IS.displayName=Ap;var MA="MenuSeparator",VS=w.forwardRef((e,n)=>{const{__scopeMenu:r,...o}=e;return h.jsx(Ve.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})});VS.displayName=MA;var NA="MenuArrow",FS=w.forwardRef((e,n)=>{const{__scopeMenu:r,...o}=e,s=$u(r);return h.jsx(Cp,{...s,...o,ref:n})});FS.displayName=NA;var DA="MenuSub",[yV,PS]=Mo(DA),qs="MenuSubTrigger",US=w.forwardRef((e,n)=>{const r=No(qs,e.__scopeMenu),o=vl(qs,e.__scopeMenu),s=PS(qs,e.__scopeMenu),l=Tp(qs,e.__scopeMenu),u=w.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:p}=l,m={__scopeMenu:e.__scopeMenu},y=w.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);w.useEffect(()=>y,[y]),w.useEffect(()=>{const b=d.current;return()=>{window.clearTimeout(b),p(null)}},[d,p]);const v=it(n,s.onTriggerChange);return h.jsx(Ep,{asChild:!0,...m,children:h.jsx(MS,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?s.contentId:void 0,"data-state":qS(r.open),...e,ref:v,onClick:b=>{e.onClick?.(b),!(e.disabled||b.defaultPrevented)&&(b.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Re(e.onPointerMove,il(b=>{l.onItemEnter(b),!b.defaultPrevented&&!e.disabled&&!r.open&&!u.current&&(l.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{r.onOpenChange(!0),y()},100))})),onPointerLeave:Re(e.onPointerLeave,il(b=>{y();const x=r.content?.getBoundingClientRect();if(x){const C=r.content?.dataset.side,_=C==="right",E=_?-5:5,T=x[_?"left":"right"],O=x[_?"right":"left"];l.onPointerGraceIntentChange({area:[{x:b.clientX+E,y:b.clientY},{x:T,y:x.top},{x:O,y:x.top},{x:O,y:x.bottom},{x:T,y:x.bottom}],side:C}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(b),b.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:Re(e.onKeyDown,b=>{e.disabled||b.target!==b.currentTarget||l.searchRef.current!==""&&b.key===" "||hA[o.dir].includes(b.key)&&(r.onOpenChange(!0),r.content?.focus(),b.preventDefault())})})})});US.displayName=qs;var HS="MenuSubContent",BS=w.forwardRef((e,n)=>{const r=TS(nr,e.__scopeMenu),{forceMount:o=r.forceMount,align:s="start",...l}=e,u=No(nr,e.__scopeMenu),d=vl(nr,e.__scopeMenu),p=PS(HS,e.__scopeMenu),m=w.useRef(null),y=it(n,m);return h.jsx(rl.Provider,{scope:e.__scopeMenu,children:h.jsx(vr,{present:o||u.open,children:h.jsx(rl.Slot,{scope:e.__scopeMenu,children:h.jsx(Op,{id:p.contentId,"aria-labelledby":p.triggerId,...l,ref:y,align:s,side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{d.isUsingKeyboardRef.current&&m.current?.focus(),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:Re(e.onFocusOutside,v=>{v.target!==p.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:Re(e.onEscapeKeyDown,v=>{d.onClose(),v.preventDefault()}),onKeyDown:Re(e.onKeyDown,v=>{const b=v.currentTarget.contains(v.target),x=mA[d.dir].includes(v.key);b&&x&&(u.onOpenChange(!1),p.trigger?.focus(),v.preventDefault())})})})})})});BS.displayName=HS;function qS(e){return e?"open":"closed"}function mu(e){return e==="indeterminate"}function Mp(e){return mu(e)?"indeterminate":e?"checked":"unchecked"}function zA(e){const n=document.activeElement;for(const r of e)if(r===n||(r.focus(),document.activeElement!==n))return}function kA(e,n){return e.map((r,o)=>e[(n+o)%e.length])}function LA(e,n,r){const s=n.length>1&&Array.from(n).every(m=>m===n[0])?n[0]:n,l=r?e.indexOf(r):-1;let u=kA(e,Math.max(l,0));s.length===1&&(u=u.filter(m=>m!==r));const p=u.find(m=>m.toLowerCase().startsWith(s.toLowerCase()));return p!==r?p:void 0}function $A(e,n){const{x:r,y:o}=e;let s=!1;for(let l=0,u=n.length-1;lo!=b>o&&r<(v-m)*(o-y)/(b-y)+m&&(s=!s)}return s}function IA(e,n){if(!n)return!1;const r={x:e.clientX,y:e.clientY};return $A(r,n)}function il(e){return n=>n.pointerType==="mouse"?e(n):void 0}var VA=RS,FA=Ep,PA=OS,UA=jS,HA=jp,BA=AS,qA=Iu,GA=NS,ZA=zS,KA=LS,YA=IS,QA=VS,XA=FS,JA=US,WA=BS,Vu="DropdownMenu",[eM]=Bi(Vu,[CS]),bn=CS(),[tM,GS]=eM(Vu),ZS=e=>{const{__scopeDropdownMenu:n,children:r,dir:o,open:s,defaultOpen:l,onOpenChange:u,modal:d=!0}=e,p=bn(n),m=w.useRef(null),[y,v]=Fa({prop:s,defaultProp:l??!1,onChange:u,caller:Vu});return h.jsx(tM,{scope:n,triggerId:mn(),triggerRef:m,contentId:mn(),open:y,onOpenChange:v,onOpenToggle:w.useCallback(()=>v(b=>!b),[v]),modal:d,children:h.jsx(VA,{...p,open:y,onOpenChange:v,dir:o,modal:d,children:r})})};ZS.displayName=Vu;var KS="DropdownMenuTrigger",YS=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...s}=e,l=GS(KS,r),u=bn(r),d=it(n,l.triggerRef);return h.jsx(FA,{asChild:!0,...u,children:h.jsx(Ve.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...s,ref:d,onPointerDown:Re(e.onPointerDown,p=>{!o&&p.button===0&&p.ctrlKey===!1&&(l.onOpenToggle(),l.open||p.preventDefault())}),onKeyDown:Re(e.onKeyDown,p=>{o||(["Enter"," "].includes(p.key)&&l.onOpenToggle(),p.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(p.key)&&p.preventDefault())})})})});YS.displayName=KS;var nM="DropdownMenuPortal",QS=e=>{const{__scopeDropdownMenu:n,...r}=e,o=bn(n);return h.jsx(PA,{...o,...r})};QS.displayName=nM;var XS="DropdownMenuContent",JS=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,s=GS(XS,r),l=bn(r),u=w.useRef(!1);return h.jsx(UA,{id:s.contentId,"aria-labelledby":s.triggerId,...l,...o,ref:n,onCloseAutoFocus:Re(e.onCloseAutoFocus,d=>{u.current||s.triggerRef.current?.focus(),u.current=!1,d.preventDefault()}),onInteractOutside:Re(e.onInteractOutside,d=>{const p=d.detail.originalEvent,m=p.button===0&&p.ctrlKey===!0,y=p.button===2||m;(!s.modal||y)&&(u.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});JS.displayName=XS;var rM="DropdownMenuGroup",iM=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,s=bn(r);return h.jsx(HA,{...s,...o,ref:n})});iM.displayName=rM;var oM="DropdownMenuLabel",WS=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,s=bn(r);return h.jsx(BA,{...s,...o,ref:n})});WS.displayName=oM;var aM="DropdownMenuItem",e1=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,s=bn(r);return h.jsx(qA,{...s,...o,ref:n})});e1.displayName=aM;var sM="DropdownMenuCheckboxItem",lM=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,s=bn(r);return h.jsx(GA,{...s,...o,ref:n})});lM.displayName=sM;var cM="DropdownMenuRadioGroup",uM=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,s=bn(r);return h.jsx(ZA,{...s,...o,ref:n})});uM.displayName=cM;var dM="DropdownMenuRadioItem",fM=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,s=bn(r);return h.jsx(KA,{...s,...o,ref:n})});fM.displayName=dM;var hM="DropdownMenuItemIndicator",mM=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,s=bn(r);return h.jsx(YA,{...s,...o,ref:n})});mM.displayName=hM;var pM="DropdownMenuSeparator",gM=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,s=bn(r);return h.jsx(QA,{...s,...o,ref:n})});gM.displayName=pM;var vM="DropdownMenuArrow",yM=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,s=bn(r);return h.jsx(XA,{...s,...o,ref:n})});yM.displayName=vM;var bM="DropdownMenuSubTrigger",xM=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,s=bn(r);return h.jsx(JA,{...s,...o,ref:n})});xM.displayName=bM;var wM="DropdownMenuSubContent",SM=w.forwardRef((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,s=bn(r);return h.jsx(WA,{...s,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});SM.displayName=wM;var _M=ZS,CM=YS,EM=QS,RM=JS,TM=WS,OM=e1,jM="Label",t1=w.forwardRef((e,n)=>h.jsx(Ve.label,{...e,ref:n,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));t1.displayName=jM;var AM=t1;function Xb(e,[n,r]){return Math.min(r,Math.max(n,e))}var MM=[" ","Enter","ArrowUp","ArrowDown"],NM=[" ","Enter"],Eo="Select",[Fu,Pu,DM]=tp(Eo),[Do]=Bi(Eo,[DM,Ga]),Uu=Ga(),[zM,Gi]=Do(Eo),[kM,LM]=Do(Eo),$M="SelectProvider";function n1(e){const{__scopeSelect:n,children:r,open:o,defaultOpen:s,onOpenChange:l,value:u,defaultValue:d,onValueChange:p,dir:m,name:y,autoComplete:v,disabled:b,required:x,form:C,internal_do_not_use_render:_}=e,E=Uu(n),[T,O]=w.useState(null),[A,z]=w.useState(null),[L,B]=w.useState(!1),H=np(m),[I,ne]=Fa({prop:o,defaultProp:s??!1,onChange:l,caller:Eo}),[ve,fe]=Fa({prop:u,defaultProp:d,onChange:p,caller:Eo}),ce=w.useRef(null),le=w.useRef(ve);w.useEffect(()=>{const M=C?T?.ownerDocument.getElementById(C):T?.form;if(M instanceof HTMLFormElement){const U=()=>fe(le.current);return M.addEventListener("reset",U),()=>M.removeEventListener("reset",U)}},[C,T,fe]);const me=T?!!C||!!T.closest("form"):!0,[xe,N]=w.useState(new Set),Z=mn(),re=Array.from(xe).map(M=>M.props.value).join(";"),W=w.useCallback(M=>{N(U=>new Set(U).add(M))},[]),ee=w.useCallback(M=>{N(U=>{const Q=new Set(U);return Q.delete(M),Q})},[]),D={required:x,trigger:T,onTriggerChange:O,valueNode:A,onValueNodeChange:z,valueNodeHasChildren:L,onValueNodeHasChildrenChange:B,contentId:Z,value:ve,onValueChange:fe,open:I,onOpenChange:ne,dir:H,triggerPointerDownPosRef:ce,disabled:b,name:y,autoComplete:v,form:C,nativeOptions:xe,nativeSelectKey:re,isFormControl:me};return h.jsx(wp,{...E,children:h.jsx(zM,{scope:n,...D,children:h.jsx(Fu.Provider,{scope:n,children:h.jsx(kM,{scope:n,onNativeOptionAdd:W,onNativeOptionRemove:ee,children:eN(_)?_(D):r})})})})}n1.displayName=$M;var r1=e=>{const{__scopeSelect:n,children:r,...o}=e;return h.jsx(n1,{__scopeSelect:n,...o,internal_do_not_use_render:({isFormControl:s})=>h.jsxs(h.Fragment,{children:[r,s?h.jsx(j1,{__scopeSelect:n}):null]})})};r1.displayName=Eo;var i1="SelectTrigger",o1=w.forwardRef((e,n)=>{const{__scopeSelect:r,disabled:o=!1,...s}=e,l=Uu(r),u=Gi(i1,r),d=u.disabled||o,p=it(n,u.onTriggerChange),m=Pu(r),y=w.useRef("touch"),[v,b,x]=A1(_=>{const E=m().filter(A=>!A.disabled),T=E.find(A=>A.value===u.value),O=M1(E,_,T);O!==void 0&&u.onValueChange(O.value)}),C=_=>{d||(u.onOpenChange(!0),x()),_&&(u.triggerPointerDownPosRef.current={x:Math.round(_.pageX),y:Math.round(_.pageY)})};return h.jsx(Sp,{asChild:!0,...l,children:h.jsx(Ve.button,{type:"button",role:"combobox","aria-controls":u.open?u.contentId:void 0,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":Hu(u.value)?"":void 0,...s,ref:p,onClick:Re(s.onClick,_=>{_.currentTarget.focus(),y.current!=="mouse"&&C(_)}),onPointerDown:Re(s.onPointerDown,_=>{y.current=_.pointerType;const E=_.target;E.hasPointerCapture(_.pointerId)&&E.releasePointerCapture(_.pointerId),_.button===0&&_.ctrlKey===!1&&_.pointerType==="mouse"&&(C(_),_.preventDefault())}),onKeyDown:Re(s.onKeyDown,_=>{const E=v.current!=="";!(_.ctrlKey||_.altKey||_.metaKey)&&_.key.length===1&&b(_.key),!(E&&_.key===" ")&&MM.includes(_.key)&&(C(),_.preventDefault())})})})});o1.displayName=i1;var a1="SelectValue",s1=w.forwardRef((e,n)=>{const{__scopeSelect:r,className:o,style:s,children:l,placeholder:u="",...d}=e,p=Gi(a1,r),{onValueNodeHasChildrenChange:m}=p,y=l!==void 0,v=it(n,p.onValueNodeChange);Qt(()=>{m(y)},[m,y]);const b=Hu(p.value);return h.jsx(Ve.span,{...d,asChild:b?!1:d.asChild,ref:v,style:{pointerEvents:"none"},children:h.jsx(w.Fragment,{children:b?u:l},b?"placeholder":"value")})});s1.displayName=a1;var IM="SelectIcon",l1=w.forwardRef((e,n)=>{const{__scopeSelect:r,children:o,...s}=e;return h.jsx(Ve.span,{"aria-hidden":!0,...s,ref:n,children:o||"▼"})});l1.displayName=IM;var c1="SelectPortal",[VM,FM]=Do(c1,{forceMount:void 0}),u1=e=>{const{__scopeSelect:n,forceMount:r,...o}=e;return h.jsx(VM,{scope:e.__scopeSelect,forceMount:r,children:h.jsx(ml,{asChild:!0,...o})})};u1.displayName=c1;var Pi="SelectContent",d1=w.forwardRef((e,n)=>{const r=FM(Pi,e.__scopeSelect),{forceMount:o=r.forceMount,...s}=e,l=Gi(Pi,e.__scopeSelect),[u,d]=w.useState();return Qt(()=>{d(new DocumentFragment)},[]),h.jsx(vr,{present:o||l.open,children:({present:p})=>p?h.jsx(m1,{...s,ref:n}):h.jsx(f1,{...s,fragment:u})})});d1.displayName=Pi;var f1=w.forwardRef((e,n)=>{const{__scopeSelect:r,children:o,fragment:s}=e;return s?Ao.createPortal(h.jsx(h1,{scope:r,children:h.jsx(Fu.Slot,{scope:r,children:h.jsx("div",{ref:n,children:o})})}),s):null});f1.displayName="SelectContentFragment";var fr=10,[h1,Zi]=Do(Pi),PM="SelectContentImpl",UM=So("SelectContent.RemoveScroll"),m1=w.forwardRef((e,n)=>{const{__scopeSelect:r}=e,{position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:l,onPointerDownOutside:u,side:d,sideOffset:p,align:m,alignOffset:y,arrowPadding:v,collisionBoundary:b,collisionPadding:x,sticky:C,hideWhenDetached:_,avoidCollisions:E,...T}=e,O=Gi(Pi,r),[A,z]=w.useState(null),[L,B]=w.useState(null),H=it(n,z),[I,ne]=w.useState(null),[ve,fe]=w.useState(null),ce=Pu(r),[le,me]=w.useState(!1),xe=w.useRef(!1);w.useEffect(()=>{if(A)return op(A)},[A]),ip();const N=w.useCallback(J=>{const[ge,...ye]=ce().map(Ue=>Ue.ref.current),[Ne]=ye.slice(-1),Fe=document.activeElement;for(const Ue of J)if(Ue===Fe||(Ue?.scrollIntoView({block:"nearest"}),Ue===ge&&L&&(L.scrollTop=0),Ue===Ne&&L&&(L.scrollTop=L.scrollHeight),Ue?.focus(),document.activeElement!==Fe))return},[ce,L]),Z=w.useCallback(()=>N([I,A]),[N,I,A]);w.useEffect(()=>{le&&Z()},[le,Z]);const{onOpenChange:re,triggerPointerDownPosRef:W}=O;w.useEffect(()=>{if(A){let J={x:0,y:0};const ge=Ne=>{J={x:Math.abs(Math.round(Ne.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(Ne.pageY)-(W.current?.y??0))}},ye=Ne=>{J.x<=10&&J.y<=10?Ne.preventDefault():Ne.composedPath().includes(A)||re(!1),document.removeEventListener("pointermove",ge),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",ge),document.addEventListener("pointerup",ye,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ge),document.removeEventListener("pointerup",ye,{capture:!0})}}},[A,re,W]),w.useEffect(()=>{const J=()=>re(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[re]);const[ee,D]=A1(J=>{const ge=ce().filter(Fe=>!Fe.disabled),ye=ge.find(Fe=>Fe.ref.current===document.activeElement),Ne=M1(ge,J,ye);Ne&&setTimeout(()=>Ne.ref.current?.focus())}),M=w.useCallback((J,ge,ye)=>{const Ne=!xe.current&&!ye;(O.value!==void 0&&O.value===ge||Ne)&&(ne(J),Ne&&(xe.current=!0))},[O.value]),U=w.useCallback(()=>A?.focus(),[A]),Q=w.useCallback((J,ge,ye)=>{const Ne=!xe.current&&!ye;(O.value!==void 0&&O.value===ge||Ne)&&fe(J)},[O.value]),K=o==="popper"?bm:p1,ae=K===bm?{side:d,sideOffset:p,align:m,alignOffset:y,arrowPadding:v,collisionBoundary:b,collisionPadding:x,sticky:C,hideWhenDetached:_,avoidCollisions:E}:{};return h.jsx(h1,{scope:r,content:A,viewport:L,onViewportChange:B,itemRefCallback:M,selectedItem:I,onItemLeave:U,itemTextRefCallback:Q,focusSelectedItem:Z,selectedItemText:ve,position:o,isPositioned:le,searchRef:ee,children:h.jsx(Au,{as:UM,allowPinchZoom:!0,children:h.jsx(Ou,{asChild:!0,trapped:O.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:Re(s,J=>{O.trigger?.focus({preventScroll:!0}),J.preventDefault()}),children:h.jsx(hl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>O.onOpenChange(!1),children:h.jsx(K,{role:"listbox",id:O.contentId,"data-state":O.open?"open":"closed",dir:O.dir,onContextMenu:J=>J.preventDefault(),...T,...ae,onPlaced:()=>me(!0),ref:H,style:{display:"flex",flexDirection:"column",outline:"none",...T.style},onKeyDown:Re(T.onKeyDown,J=>{const ge=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!ge&&J.key.length===1&&D(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let Ne=ce().filter(Fe=>!Fe.disabled).map(Fe=>Fe.ref.current);if(["ArrowUp","End"].includes(J.key)&&(Ne=Ne.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const Fe=J.target,Ue=Ne.indexOf(Fe);Ne=Ne.slice(Ue+1)}setTimeout(()=>N(Ne)),J.preventDefault()}})})})})})})});m1.displayName=PM;var HM="SelectItemAlignedPosition",p1=w.forwardRef((e,n)=>{const{__scopeSelect:r,onPlaced:o,...s}=e,l=Gi(Pi,r),u=Zi(Pi,r),[d,p]=w.useState(null),[m,y]=w.useState(null),v=it(n,y),b=Pu(r),x=w.useRef(!1),C=w.useRef(!0),{viewport:_,selectedItem:E,selectedItemText:T,focusSelectedItem:O}=u,A=w.useCallback(()=>{if(l.trigger&&l.valueNode&&d&&m&&_&&E&&T){const H=l.trigger.getBoundingClientRect(),I=m.getBoundingClientRect(),ne=l.valueNode.getBoundingClientRect(),ve=T.getBoundingClientRect();if(l.dir!=="rtl"){const Fe=ve.left-I.left,Ue=ne.left-Fe,ht=H.left-Ue,Je=H.width+ht,xn=Math.max(Je,I.width),dn=window.innerWidth-fr,Xt=Xb(Ue,[fr,Math.max(fr,dn-xn)]);d.style.minWidth=Je+"px",d.style.left=Xt+"px"}else{const Fe=I.right-ve.right,Ue=window.innerWidth-ne.right-Fe,ht=window.innerWidth-H.right-Ue,Je=H.width+ht,xn=Math.max(Je,I.width),dn=window.innerWidth-fr,Xt=Xb(Ue,[fr,Math.max(fr,dn-xn)]);d.style.minWidth=Je+"px",d.style.right=Xt+"px"}const fe=b(),ce=window.innerHeight-fr*2,le=_.scrollHeight,me=window.getComputedStyle(m),xe=parseInt(me.borderTopWidth,10),N=parseInt(me.paddingTop,10),Z=parseInt(me.borderBottomWidth,10),re=parseInt(me.paddingBottom,10),W=xe+N+le+re+Z,ee=Math.min(E.offsetHeight*5,W),D=window.getComputedStyle(_),M=parseInt(D.paddingTop,10),U=parseInt(D.paddingBottom,10),Q=H.top+H.height/2-fr,K=ce-Q,ae=E.offsetHeight/2,J=E.offsetTop+ae,ge=xe+N+J,ye=W-ge;if(ge<=Q){const Fe=fe.length>0&&E===fe[fe.length-1].ref.current;d.style.bottom="0px";const Ue=m.clientHeight-_.offsetTop-_.offsetHeight,ht=Math.max(K,ae+(Fe?U:0)+Ue+Z),Je=ge+ht;d.style.height=Je+"px"}else{const Fe=fe.length>0&&E===fe[0].ref.current;d.style.top="0px";const ht=Math.max(Q,xe+_.offsetTop+(Fe?M:0)+ae)+ye;d.style.height=ht+"px",_.scrollTop=ge-Q+_.offsetTop}d.style.margin=`${fr}px 0`,d.style.minHeight=ee+"px",d.style.maxHeight=ce+"px",o?.(),requestAnimationFrame(()=>x.current=!0)}},[b,l.trigger,l.valueNode,d,m,_,E,T,l.dir,o]);Qt(()=>A(),[A]);const[z,L]=w.useState();Qt(()=>{m&&L(window.getComputedStyle(m).zIndex)},[m]);const B=w.useCallback(H=>{H&&C.current===!0&&(A(),O?.(),C.current=!1)},[A,O]);return h.jsx(qM,{scope:r,contentWrapper:d,shouldExpandOnScrollRef:x,onScrollButtonChange:B,children:h.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:z},children:h.jsx(Ve.div,{...s,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});p1.displayName=HM;var BM="SelectPopperPosition",bm=w.forwardRef((e,n)=>{const{__scopeSelect:r,align:o="start",collisionPadding:s=fr,...l}=e,u=Uu(r);return h.jsx(_p,{...u,...l,ref:n,align:o,collisionPadding:s,style:{boxSizing:"border-box",...l.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)"}})});bm.displayName=BM;var[qM,Np]=Do(Pi,{}),xm="SelectViewport",g1=w.forwardRef((e,n)=>{const{__scopeSelect:r,nonce:o,...s}=e,l=Zi(xm,r),u=Np(xm,r),d=it(n,l.onViewportChange),p=w.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),h.jsx(Fu.Slot,{scope:r,children:h.jsx(Ve.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Re(s.onScroll,m=>{const y=m.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:b}=u;if(b?.current&&v){const x=Math.abs(p.current-y.scrollTop);if(x>0){const C=window.innerHeight-fr*2,_=parseFloat(v.style.minHeight),E=parseFloat(v.style.height),T=Math.max(_,E);if(T0?z:0,v.style.justifyContent="flex-end")}}}p.current=y.scrollTop})})})]})});g1.displayName=xm;var v1="SelectGroup",[GM,ZM]=Do(v1),KM=w.forwardRef((e,n)=>{const{__scopeSelect:r,...o}=e,s=mn();return h.jsx(GM,{scope:r,id:s,children:h.jsx(Ve.div,{role:"group","aria-labelledby":s,...o,ref:n})})});KM.displayName=v1;var y1="SelectLabel",YM=w.forwardRef((e,n)=>{const{__scopeSelect:r,...o}=e,s=ZM(y1,r);return h.jsx(Ve.div,{id:s.id,...o,ref:n})});YM.displayName=y1;var pu="SelectItem",[QM,b1]=Do(pu),x1=w.forwardRef((e,n)=>{const{__scopeSelect:r,value:o,disabled:s=!1,textValue:l,...u}=e,d=Gi(pu,r),p=Zi(pu,r),m=d.value===o,[y,v]=w.useState(l??""),[b,x]=w.useState(!1),C=rr(A=>p.itemRefCallback?.(A,o,s)),_=it(n,C),E=mn(),T=w.useRef("touch"),O=()=>{s||(d.onValueChange(o),d.onOpenChange(!1))};return h.jsx(QM,{scope:r,value:o,disabled:s,textId:E,isSelected:m,onItemTextChange:w.useCallback(A=>{v(z=>z||(A?.textContent??"").trim())},[]),children:h.jsx(Fu.ItemSlot,{scope:r,value:o,disabled:s,textValue:y,children:h.jsx(Ve.div,{role:"option","aria-labelledby":E,"data-highlighted":b?"":void 0,"aria-selected":m&&b,"data-state":m?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...u,ref:_,onFocus:Re(u.onFocus,()=>x(!0)),onBlur:Re(u.onBlur,()=>x(!1)),onClick:Re(u.onClick,()=>{T.current!=="mouse"&&O()}),onPointerUp:Re(u.onPointerUp,()=>{T.current==="mouse"&&O()}),onPointerDown:Re(u.onPointerDown,A=>{T.current=A.pointerType}),onPointerMove:Re(u.onPointerMove,A=>{T.current=A.pointerType,s?p.onItemLeave?.():T.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Re(u.onPointerLeave,A=>{A.currentTarget===document.activeElement&&p.onItemLeave?.()}),onKeyDown:Re(u.onKeyDown,A=>{s||A.target!==A.currentTarget||p.searchRef?.current!==""&&A.key===" "||(NM.includes(A.key)&&O(),A.key===" "&&A.preventDefault())})})})})});x1.displayName=pu;var Gs="SelectItemText",w1=w.forwardRef((e,n)=>{const{__scopeSelect:r,className:o,style:s,...l}=e,u=Gi(Gs,r),d=Zi(Gs,r),p=b1(Gs,r),m=LM(Gs,r),[y,v]=w.useState(null),b=rr(O=>d.itemTextRefCallback?.(O,p.value,p.disabled)),x=it(n,v,p.onItemTextChange,b),C=y?.textContent,_=w.useMemo(()=>h.jsx("option",{value:p.value,disabled:p.disabled,children:C},p.value),[p.disabled,p.value,C]),{onNativeOptionAdd:E,onNativeOptionRemove:T}=m;return Qt(()=>(E(_),()=>T(_)),[E,T,_]),h.jsxs(h.Fragment,{children:[h.jsx(Ve.span,{id:p.textId,...l,ref:x}),p.isSelected&&u.valueNode&&!u.valueNodeHasChildren&&!Hu(u.value)?Ao.createPortal(l.children,u.valueNode):null]})});w1.displayName=Gs;var S1="SelectItemIndicator",_1=w.forwardRef((e,n)=>{const{__scopeSelect:r,...o}=e;return b1(S1,r).isSelected?h.jsx(Ve.span,{"aria-hidden":!0,...o,ref:n}):null});_1.displayName=S1;var wm="SelectScrollUpButton",C1=w.forwardRef((e,n)=>{const r=Zi(wm,e.__scopeSelect),o=Np(wm,e.__scopeSelect),[s,l]=w.useState(!1),u=it(n,o.onScrollButtonChange);return Qt(()=>{if(r.viewport&&r.isPositioned){let d=function(){const m=p.scrollTop>0;l(m)};const p=r.viewport;return d(),p.addEventListener("scroll",d),()=>p.removeEventListener("scroll",d)}},[r.viewport,r.isPositioned]),s?h.jsx(R1,{...e,ref:u,onAutoScroll:()=>{const{viewport:d,selectedItem:p}=r;d&&p&&(d.scrollTop=d.scrollTop-p.offsetHeight)}}):null});C1.displayName=wm;var Sm="SelectScrollDownButton",E1=w.forwardRef((e,n)=>{const r=Zi(Sm,e.__scopeSelect),o=Np(Sm,e.__scopeSelect),[s,l]=w.useState(!1),u=it(n,o.onScrollButtonChange);return Qt(()=>{if(r.viewport&&r.isPositioned){let d=function(){const m=p.scrollHeight-p.clientHeight,y=Math.ceil(p.scrollTop)p.removeEventListener("scroll",d)}},[r.viewport,r.isPositioned]),s?h.jsx(R1,{...e,ref:u,onAutoScroll:()=>{const{viewport:d,selectedItem:p}=r;d&&p&&(d.scrollTop=d.scrollTop+p.offsetHeight)}}):null});E1.displayName=Sm;var R1=w.forwardRef((e,n)=>{const{__scopeSelect:r,onAutoScroll:o,...s}=e,l=Zi("SelectScrollButton",r),u=w.useRef(null),d=Pu(r),p=w.useCallback(()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},[]);return w.useEffect(()=>()=>p(),[p]),Qt(()=>{d().find(y=>y.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[d]),h.jsx(Ve.div,{"aria-hidden":!0,...s,ref:n,style:{flexShrink:0,...s.style},onPointerDown:Re(s.onPointerDown,()=>{u.current===null&&(u.current=window.setInterval(o,50))}),onPointerMove:Re(s.onPointerMove,()=>{l.onItemLeave?.(),u.current===null&&(u.current=window.setInterval(o,50))}),onPointerLeave:Re(s.onPointerLeave,()=>{p()})})}),XM="SelectSeparator",JM=w.forwardRef((e,n)=>{const{__scopeSelect:r,...o}=e;return h.jsx(Ve.div,{"aria-hidden":!0,...o,ref:n})});JM.displayName=XM;var T1="SelectArrow",WM=w.forwardRef((e,n)=>{const{__scopeSelect:r,...o}=e,s=Uu(r);return Zi(T1,r).position==="popper"?h.jsx(Cp,{...s,...o,ref:n}):null});WM.displayName=T1;var O1="SelectBubbleInput",j1=w.forwardRef(({__scopeSelect:e,...n},r)=>{const o=Gi(O1,e),{value:s,onValueChange:l,required:u,disabled:d,name:p,autoComplete:m,form:y}=o,{nativeOptions:v,nativeSelectKey:b}=o,x=w.useRef(null),C=it(r,x),_=s??"",E=zO(_),T=Array.from(v).some(O=>(O.props.value??"")==="");return w.useEffect(()=>{const O=x.current;if(!O)return;const A=window.HTMLSelectElement.prototype,L=Object.getOwnPropertyDescriptor(A,"value").set;if(E!==_&&L){const B=new Event("change",{bubbles:!0});L.call(O,_),O.dispatchEvent(B)}},[E,_]),h.jsxs(Ve.select,{"aria-hidden":!0,required:u,tabIndex:-1,name:p,autoComplete:m,disabled:d,form:y,onChange:O=>l(O.target.value),...n,style:{...jw,...n.style},ref:C,defaultValue:_,children:[Hu(s)&&!T?h.jsx("option",{value:""}):null,Array.from(v)]},b)});j1.displayName=O1;function eN(e){return typeof e=="function"}function Hu(e){return e===""||e===void 0}function A1(e){const n=rr(e),r=w.useRef(""),o=w.useRef(0),s=w.useCallback(u=>{const d=r.current+u;n(d),(function p(m){r.current=m,window.clearTimeout(o.current),m!==""&&(o.current=window.setTimeout(()=>p(""),1e3))})(d)},[n]),l=w.useCallback(()=>{r.current="",window.clearTimeout(o.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(o.current),[]),[r,s,l]}function M1(e,n,r){const s=n.length>1&&Array.from(n).every(m=>m===n[0])?n[0]:n,l=r?e.indexOf(r):-1;let u=tN(e,Math.max(l,0));s.length===1&&(u=u.filter(m=>m!==r));const p=u.find(m=>m.textValue.toLowerCase().startsWith(s.toLowerCase()));return p!==r?p:void 0}function tN(e,n){return e.map((r,o)=>e[(n+o)%e.length])}var nN="Separator",Jb="horizontal",rN=["horizontal","vertical"],N1=w.forwardRef((e,n)=>{const{decorative:r,orientation:o=Jb,...s}=e,l=iN(o)?o:Jb,d=r?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return h.jsx(Ve.div,{"data-orientation":l,...d,...s,ref:n})});N1.displayName=nN;function iN(e){return rN.includes(e)}var oN=N1,[Bu]=Bi("Tooltip",[Ga]),qu=Ga(),D1="TooltipProvider",aN=700,_m="tooltip.open",[sN,Dp]=Bu(D1),z1=e=>{const{__scopeTooltip:n,delayDuration:r=aN,skipDelayDuration:o=300,disableHoverableContent:s=!1,children:l}=e,u=w.useRef(!0),d=w.useRef(!1),p=w.useRef(0);return w.useEffect(()=>{const m=p.current;return()=>window.clearTimeout(m)},[]),h.jsx(sN,{scope:n,isOpenDelayedRef:u,delayDuration:r,onOpen:w.useCallback(()=>{o<=0||(window.clearTimeout(p.current),u.current=!1)},[o]),onClose:w.useCallback(()=>{o<=0||(window.clearTimeout(p.current),p.current=window.setTimeout(()=>u.current=!0,o))},[o]),isPointerInTransitRef:d,onPointerInTransitChange:w.useCallback(m=>{d.current=m},[]),disableHoverableContent:s,children:l})};z1.displayName=D1;var ol="Tooltip",[lN,yl]=Bu(ol),k1=e=>{const{__scopeTooltip:n,children:r,open:o,defaultOpen:s,onOpenChange:l,disableHoverableContent:u,delayDuration:d}=e,p=Dp(ol,e.__scopeTooltip),m=qu(n),[y,v]=w.useState(null),b=mn(),x=w.useRef(0),C=u??p.disableHoverableContent,_=d??p.delayDuration,E=w.useRef(!1),[T,O]=Fa({prop:o,defaultProp:s??!1,onChange:H=>{H?(p.onOpen(),document.dispatchEvent(new CustomEvent(_m))):p.onClose(),l?.(H)},caller:ol}),A=w.useMemo(()=>T?E.current?"delayed-open":"instant-open":"closed",[T]),z=w.useCallback(()=>{window.clearTimeout(x.current),x.current=0,E.current=!1,O(!0)},[O]),L=w.useCallback(()=>{window.clearTimeout(x.current),x.current=0,O(!1)},[O]),B=w.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{E.current=!0,O(!0),x.current=0},_)},[_,O]);return w.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),h.jsx(wp,{...m,children:h.jsx(lN,{scope:n,contentId:b,open:T,stateAttribute:A,trigger:y,onTriggerChange:v,onTriggerEnter:w.useCallback(()=>{p.isOpenDelayedRef.current?B():z()},[p.isOpenDelayedRef,B,z]),onTriggerLeave:w.useCallback(()=>{C?L():(window.clearTimeout(x.current),x.current=0)},[L,C]),onOpen:z,onClose:L,disableHoverableContent:C,children:r})})};k1.displayName=ol;var Cm="TooltipTrigger",L1=w.forwardRef((e,n)=>{const{__scopeTooltip:r,...o}=e,s=yl(Cm,r),l=Dp(Cm,r),u=qu(r),d=w.useRef(null),p=it(n,d,s.onTriggerChange),m=w.useRef(!1),y=w.useRef(!1),v=w.useCallback(()=>m.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),h.jsx(Sp,{asChild:!0,...u,children:h.jsx(Ve.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:p,onPointerMove:Re(e.onPointerMove,b=>{b.pointerType!=="touch"&&!y.current&&!l.isPointerInTransitRef.current&&(s.onTriggerEnter(),y.current=!0)}),onPointerLeave:Re(e.onPointerLeave,()=>{s.onTriggerLeave(),y.current=!1}),onPointerDown:Re(e.onPointerDown,()=>{s.open&&s.onClose(),m.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:Re(e.onFocus,()=>{m.current||s.onOpen()}),onBlur:Re(e.onBlur,s.onClose),onClick:Re(e.onClick,s.onClose)})})});L1.displayName=Cm;var zp="TooltipPortal",[cN,uN]=Bu(zp,{forceMount:void 0}),$1=e=>{const{__scopeTooltip:n,forceMount:r,children:o,container:s}=e,l=yl(zp,n);return h.jsx(cN,{scope:n,forceMount:r,children:h.jsx(vr,{present:r||l.open,children:h.jsx(ml,{asChild:!0,container:s,children:o})})})};$1.displayName=zp;var Ua="TooltipContent",I1=w.forwardRef((e,n)=>{const r=uN(Ua,e.__scopeTooltip),{forceMount:o=r.forceMount,side:s="top",...l}=e,u=yl(Ua,e.__scopeTooltip);return h.jsx(vr,{present:o||u.open,children:u.disableHoverableContent?h.jsx(V1,{side:s,...l,ref:n}):h.jsx(dN,{side:s,...l,ref:n})})}),dN=w.forwardRef((e,n)=>{const r=yl(Ua,e.__scopeTooltip),o=Dp(Ua,e.__scopeTooltip),s=w.useRef(null),l=it(n,s),[u,d]=w.useState(null),{trigger:p,onClose:m}=r,y=s.current,{onPointerInTransitChange:v}=o,b=w.useCallback(()=>{d(null),v(!1)},[v]),x=w.useCallback((C,_)=>{const E=C.currentTarget,T={x:C.clientX,y:C.clientY},O=pN(T,E.getBoundingClientRect()),A=gN(T,O),z=vN(_.getBoundingClientRect()),L=bN([...A,...z]);d(L),v(!0)},[v]);return w.useEffect(()=>()=>b(),[b]),w.useEffect(()=>{if(p&&y){const C=E=>x(E,y),_=E=>x(E,p);return p.addEventListener("pointerleave",C),y.addEventListener("pointerleave",_),()=>{p.removeEventListener("pointerleave",C),y.removeEventListener("pointerleave",_)}}},[p,y,x,b]),w.useEffect(()=>{if(u){const C=_=>{const E=_.target,T={x:_.clientX,y:_.clientY},O=p?.contains(E)||y?.contains(E),A=!yN(T,u);O?b():A&&(b(),m())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[p,y,u,m,b]),h.jsx(V1,{...e,ref:l})}),[fN,hN]=Bu(ol,{isInside:!1}),mN=tT("TooltipContent"),V1=w.forwardRef((e,n)=>{const{__scopeTooltip:r,children:o,"aria-label":s,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,p=yl(Ua,r),m=qu(r),{onClose:y}=p;return w.useEffect(()=>(document.addEventListener(_m,y),()=>document.removeEventListener(_m,y)),[y]),w.useEffect(()=>{if(p.trigger){const v=b=>{b.target instanceof Node&&b.target.contains(p.trigger)&&y()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[p.trigger,y]),h.jsx(hl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:v=>v.preventDefault(),onDismiss:y,children:h.jsxs(_p,{"data-state":p.stateAttribute,...m,...d,ref:n,style:{...d.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:[h.jsx(mN,{children:o}),h.jsx(fN,{scope:r,isInside:!0,children:h.jsx(fT,{id:p.contentId,role:"tooltip",children:s||o})})]})})});I1.displayName=Ua;var F1="TooltipArrow",P1=w.forwardRef((e,n)=>{const{__scopeTooltip:r,...o}=e,s=qu(r);return hN(F1,r).isInside?null:h.jsx(Cp,{...s,...o,ref:n})});P1.displayName=F1;function pN(e,n){const r=Math.abs(n.top-e.y),o=Math.abs(n.bottom-e.y),s=Math.abs(n.right-e.x),l=Math.abs(n.left-e.x);switch(Math.min(r,o,s,l)){case l:return"left";case s:return"right";case r:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function gN(e,n,r=5){const o=[];switch(n){case"top":o.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":o.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":o.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":o.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return o}function vN(e){const{top:n,right:r,bottom:o,left:s}=e;return[{x:s,y:n},{x:r,y:n},{x:r,y:o},{x:s,y:o}]}function yN(e,n){const{x:r,y:o}=e;let s=!1;for(let l=0,u=n.length-1;lo!=b>o&&r<(v-m)*(o-y)/(b-y)+m&&(s=!s)}return s}function bN(e){const n=e.slice();return n.sort((r,o)=>r.xo.x?1:r.yo.y?1:0),xN(n)}function xN(e){if(e.length<=1)return e.slice();const n=[];for(let o=0;o=2;){const l=n[n.length-1],u=n[n.length-2];if((l.x-u.x)*(s.y-u.y)>=(l.y-u.y)*(s.x-u.x))n.pop();else break}n.push(s)}n.pop();const r=[];for(let o=e.length-1;o>=0;o--){const s=e[o];for(;r.length>=2;){const l=r[r.length-1],u=r[r.length-2];if((l.x-u.x)*(s.y-u.y)>=(l.y-u.y)*(s.x-u.x))r.pop();else break}r.push(s)}return r.pop(),n.length===1&&r.length===1&&n[0].x===r[0].x&&n[0].y===r[0].y?n:n.concat(r)}var wN=z1,SN=k1,_N=L1,CN=$1,EN=I1,RN=P1;function U1(e){var n,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(n=0;n{const r=new Array(e.length+n.length);for(let o=0;o({classGroupId:e,validator:n}),B1=(e=new Map,n=null,r)=>({nextPart:e,validators:n,classGroupId:r}),gu="-",Wb=[],jN="arbitrary..",AN=e=>{const n=NN(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return MN(u);const d=u.split(gu),p=d[0]===""&&d.length>1?1:0;return q1(d,p,n)},getConflictingClassGroupIds:(u,d)=>{if(d){const p=o[u],m=r[u];return p?m?TN(m,p):p:m||Wb}return r[u]||Wb}}},q1=(e,n,r)=>{if(e.length-n===0)return r.classGroupId;const s=e[n],l=r.nextPart.get(s);if(l){const m=q1(e,n+1,l);if(m)return m}const u=r.validators;if(u===null)return;const d=n===0?e.join(gu):e.slice(n).join(gu),p=u.length;for(let m=0;me.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),r=n.indexOf(":"),o=n.slice(0,r);return o?jN+o:void 0})(),NN=e=>{const{theme:n,classGroups:r}=e;return DN(r,n)},DN=(e,n)=>{const r=B1();for(const o in e){const s=e[o];kp(s,r,o,n)}return r},kp=(e,n,r,o)=>{const s=e.length;for(let l=0;l{if(typeof e=="string"){kN(e,n,r);return}if(typeof e=="function"){LN(e,n,r,o);return}$N(e,n,r,o)},kN=(e,n,r)=>{const o=e===""?n:G1(n,e);o.classGroupId=r},LN=(e,n,r,o)=>{if(IN(e)){kp(e(o),n,r,o);return}n.validators===null&&(n.validators=[]),n.validators.push(ON(r,e))},$N=(e,n,r,o)=>{const s=Object.entries(e),l=s.length;for(let u=0;u{let r=e;const o=n.split(gu),s=o.length;for(let l=0;l"isThemeGetter"in e&&e.isThemeGetter===!0,VN=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,r=Object.create(null),o=Object.create(null);const s=(l,u)=>{r[l]=u,n++,n>e&&(n=0,o=r,r=Object.create(null))};return{get(l){let u=r[l];if(u!==void 0)return u;if((u=o[l])!==void 0)return s(l,u),u},set(l,u){l in r?r[l]=u:s(l,u)}}},Em="!",ex=":",FN=[],tx=(e,n,r,o,s)=>({modifiers:e,hasImportantModifier:n,baseClassName:r,maybePostfixModifierPosition:o,isExternal:s}),PN=e=>{const{prefix:n,experimentalParseClassName:r}=e;let o=s=>{const l=[];let u=0,d=0,p=0,m;const y=s.length;for(let _=0;_p?m-p:void 0;return tx(l,x,b,C)};if(n){const s=n+ex,l=o;o=u=>u.startsWith(s)?l(u.slice(s.length)):tx(FN,!1,u,void 0,!0)}if(r){const s=o;o=l=>r({className:l,parseClassName:s})}return o},UN=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((r,o)=>{n.set(r,1e6+o)}),r=>{const o=[];let s=[];for(let l=0;l0&&(s.sort(),o.push(...s),s=[]),o.push(u)):s.push(u)}return s.length>0&&(s.sort(),o.push(...s)),o}},HN=e=>({cache:VN(e.cacheSize),parseClassName:PN(e),sortModifiers:UN(e),postfixLookupClassGroupIds:BN(e),...AN(e)}),BN=e=>{const n=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let o=0;o{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:s,sortModifiers:l,postfixLookupClassGroupIds:u}=n,d=[],p=e.trim().split(qN);let m="";for(let y=p.length-1;y>=0;y-=1){const v=p[y],{isExternal:b,modifiers:x,hasImportantModifier:C,baseClassName:_,maybePostfixModifierPosition:E}=r(v);if(b){m=v+(m.length>0?" "+m:m);continue}let T=!!E,O;if(T){const H=_.substring(0,E);O=o(H);const I=O&&u[O]?o(_):void 0;I&&I!==O&&(O=I,T=!1)}else O=o(_);if(!O){if(!T){m=v+(m.length>0?" "+m:m);continue}if(O=o(_),!O){m=v+(m.length>0?" "+m:m);continue}T=!1}const A=x.length===0?"":x.length===1?x[0]:l(x).join(":"),z=C?A+Em:A,L=z+O;if(d.indexOf(L)>-1)continue;d.push(L);const B=s(O,T);for(let H=0;H0?" "+m:m)}return m},ZN=(...e)=>{let n=0,r,o,s="";for(;n{if(typeof e=="string")return e;let n,r="";for(let o=0;o{let r,o,s,l;const u=p=>{const m=n.reduce((y,v)=>v(y),e());return r=HN(m),o=r.cache.get,s=r.cache.set,l=d,d(p)},d=p=>{const m=o(p);if(m)return m;const y=GN(p,r);return s(p,y),y};return l=u,(...p)=>l(ZN(...p))},YN=[],qt=e=>{const n=r=>r[e]||YN;return n.isThemeGetter=!0,n},K1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Y1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,QN=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,XN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,JN=/\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$/,WN=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,eD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ai=e=>QN.test(e),qe=e=>!!e&&!Number.isNaN(Number(e)),Cr=e=>!!e&&Number.isInteger(Number(e)),Vh=e=>e.endsWith("%")&&qe(e.slice(0,-1)),Jr=e=>XN.test(e),Q1=()=>!0,nD=e=>JN.test(e)&&!WN.test(e),Lp=()=>!1,rD=e=>eD.test(e),iD=e=>tD.test(e),oD=e=>!_e(e)&&!Ce(e),aD=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),sD=e=>Ki(e,W1,Lp),_e=e=>K1.test(e),vo=e=>Ki(e,e_,nD),nx=e=>Ki(e,pD,qe),lD=e=>Ki(e,n_,Q1),cD=e=>Ki(e,t_,Lp),rx=e=>Ki(e,X1,Lp),uD=e=>Ki(e,J1,iD),Hc=e=>Ki(e,r_,rD),Ce=e=>Y1.test(e),Fs=e=>zo(e,e_),dD=e=>zo(e,t_),ix=e=>zo(e,X1),fD=e=>zo(e,W1),hD=e=>zo(e,J1),Bc=e=>zo(e,r_,!0),mD=e=>zo(e,n_,!0),Ki=(e,n,r)=>{const o=K1.exec(e);return o?o[1]?n(o[1]):r(o[2]):!1},zo=(e,n,r=!1)=>{const o=Y1.exec(e);return o?o[1]?n(o[1]):r:!1},X1=e=>e==="position"||e==="percentage",J1=e=>e==="image"||e==="url",W1=e=>e==="length"||e==="size"||e==="bg-size",e_=e=>e==="length",pD=e=>e==="number",t_=e=>e==="family-name",n_=e=>e==="number"||e==="weight",r_=e=>e==="shadow",gD=()=>{const e=qt("color"),n=qt("font"),r=qt("text"),o=qt("font-weight"),s=qt("tracking"),l=qt("leading"),u=qt("breakpoint"),d=qt("container"),p=qt("spacing"),m=qt("radius"),y=qt("shadow"),v=qt("inset-shadow"),b=qt("text-shadow"),x=qt("drop-shadow"),C=qt("blur"),_=qt("perspective"),E=qt("aspect"),T=qt("ease"),O=qt("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...z(),Ce,_e],B=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto","contain","none"],I=()=>[Ce,_e,p],ne=()=>[Ai,"full","auto",...I()],ve=()=>[Cr,"none","subgrid",Ce,_e],fe=()=>["auto",{span:["full",Cr,Ce,_e]},Cr,Ce,_e],ce=()=>[Cr,"auto",Ce,_e],le=()=>["auto","min","max","fr",Ce,_e],me=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],xe=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...I()],Z=()=>[Ai,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],re=()=>[Ai,"screen","full","dvw","lvw","svw","min","max","fit",...I()],W=()=>[Ai,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],ee=()=>[e,Ce,_e],D=()=>[...z(),ix,rx,{position:[Ce,_e]}],M=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",fD,sD,{size:[Ce,_e]}],Q=()=>[Vh,Fs,vo],K=()=>["","none","full",m,Ce,_e],ae=()=>["",qe,Fs,vo],J=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[qe,Vh,ix,rx],Ne=()=>["","none",C,Ce,_e],Fe=()=>["none",qe,Ce,_e],Ue=()=>["none",qe,Ce,_e],ht=()=>[qe,Ce,_e],Je=()=>[Ai,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jr],breakpoint:[Jr],color:[Q1],container:[Jr],"drop-shadow":[Jr],ease:["in","out","in-out"],font:[oD],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Jr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Jr],shadow:[Jr],spacing:["px",qe],text:[Jr],"text-shadow":[Jr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ai,_e,Ce,E]}],container:["container"],"container-type":[{"@container":["","normal","size",Ce,_e]}],"container-named":[aD],columns:[{columns:[qe,_e,Ce,d]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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:L()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ne()}],"inset-x":[{"inset-x":ne()}],"inset-y":[{"inset-y":ne()}],start:[{"inset-s":ne(),start:ne()}],end:[{"inset-e":ne(),end:ne()}],"inset-bs":[{"inset-bs":ne()}],"inset-be":[{"inset-be":ne()}],top:[{top:ne()}],right:[{right:ne()}],bottom:[{bottom:ne()}],left:[{left:ne()}],visibility:["visible","invisible","collapse"],z:[{z:[Cr,"auto",Ce,_e]}],basis:[{basis:[Ai,"full","auto",d,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,Ai,"auto","initial","none",_e]}],grow:[{grow:["",qe,Ce,_e]}],shrink:[{shrink:["",qe,Ce,_e]}],order:[{order:[Cr,"first","last","none",Ce,_e]}],"grid-cols":[{"grid-cols":ve()}],"col-start-end":[{col:fe()}],"col-start":[{"col-start":ce()}],"col-end":[{"col-end":ce()}],"grid-rows":[{"grid-rows":ve()}],"row-start-end":[{row:fe()}],"row-start":[{"row-start":ce()}],"row-end":[{"row-end":ce()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":le()}],"auto-rows":[{"auto-rows":le()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...me(),"normal"]}],"justify-items":[{"justify-items":[...xe(),"normal"]}],"justify-self":[{"justify-self":["auto",...xe()]}],"align-content":[{content:["normal",...me()]}],"align-items":[{items:[...xe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...xe(),{baseline:["","last"]}]}],"place-content":[{"place-content":me()}],"place-items":[{"place-items":[...xe(),"baseline"]}],"place-self":[{"place-self":["auto",...xe()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mbs:[{mbs:N()}],mbe:[{mbe:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...re()]}],"min-inline-size":[{"min-inline":["auto",...re()]}],"max-inline-size":[{"max-inline":["none",...re()]}],"block-size":[{block:["auto",...W()]}],"min-block-size":[{"min-block":["auto",...W()]}],"max-block-size":[{"max-block":["none",...W()]}],w:[{w:[d,"screen",...Z()]}],"min-w":[{"min-w":[d,"screen","none",...Z()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",r,Fs,vo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,mD,lD]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Vh,_e]}],"font-family":[{font:[dD,cD,n]}],"font-features":[{"font-features":[_e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Ce,_e]}],"line-clamp":[{"line-clamp":[qe,"none",Ce,nx]}],leading:[{leading:[l,...I()]}],"list-image":[{"list-image":["none",Ce,_e]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ce,_e]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ee()}],"text-color":[{text:ee()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",Ce,vo]}],"text-decoration-color":[{decoration:ee()}],"underline-offset":[{"underline-offset":[qe,"auto",Ce,_e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"tab-size":[{tab:[Cr,Ce,_e]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ce,_e]}],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",Ce,_e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:M()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Cr,Ce,_e],radial:["",Ce,_e],conic:[Cr,Ce,_e]},hD,uD]}],"bg-color":[{bg:ee()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:ee()}],"gradient-via":[{via:ee()}],"gradient-to":[{to:ee()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:ee()}],"border-color-x":[{"border-x":ee()}],"border-color-y":[{"border-y":ee()}],"border-color-s":[{"border-s":ee()}],"border-color-e":[{"border-e":ee()}],"border-color-bs":[{"border-bs":ee()}],"border-color-be":[{"border-be":ee()}],"border-color-t":[{"border-t":ee()}],"border-color-r":[{"border-r":ee()}],"border-color-b":[{"border-b":ee()}],"border-color-l":[{"border-l":ee()}],"divide-color":[{divide:ee()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,Ce,_e]}],"outline-w":[{outline:["",qe,Fs,vo]}],"outline-color":[{outline:ee()}],shadow:[{shadow:["","none",y,Bc,Hc]}],"shadow-color":[{shadow:ee()}],"inset-shadow":[{"inset-shadow":["none",v,Bc,Hc]}],"inset-shadow-color":[{"inset-shadow":ee()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ee()}],"ring-offset-w":[{"ring-offset":[qe,vo]}],"ring-offset-color":[{"ring-offset":ee()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":ee()}],"text-shadow":[{"text-shadow":["none",b,Bc,Hc]}],"text-shadow-color":[{"text-shadow":ee()}],opacity:[{opacity:[qe,Ce,_e]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"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":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":ee()}],"mask-image-linear-to-color":[{"mask-linear-to":ee()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":ee()}],"mask-image-t-to-color":[{"mask-t-to":ee()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":ee()}],"mask-image-r-to-color":[{"mask-r-to":ee()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":ee()}],"mask-image-b-to-color":[{"mask-b-to":ee()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":ee()}],"mask-image-l-to-color":[{"mask-l-to":ee()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":ee()}],"mask-image-x-to-color":[{"mask-x-to":ee()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":ee()}],"mask-image-y-to-color":[{"mask-y-to":ee()}],"mask-image-radial":[{"mask-radial":[Ce,_e]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":ee()}],"mask-image-radial-to-color":[{"mask-radial-to":ee()}],"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":z()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":ee()}],"mask-image-conic-to-color":[{"mask-conic-to":ee()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:M()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ce,_e]}],filter:[{filter:["","none",Ce,_e]}],blur:[{blur:Ne()}],brightness:[{brightness:[qe,Ce,_e]}],contrast:[{contrast:[qe,Ce,_e]}],"drop-shadow":[{"drop-shadow":["","none",x,Bc,Hc]}],"drop-shadow-color":[{"drop-shadow":ee()}],grayscale:[{grayscale:["",qe,Ce,_e]}],"hue-rotate":[{"hue-rotate":[qe,Ce,_e]}],invert:[{invert:["",qe,Ce,_e]}],saturate:[{saturate:[qe,Ce,_e]}],sepia:[{sepia:["",qe,Ce,_e]}],"backdrop-filter":[{"backdrop-filter":["","none",Ce,_e]}],"backdrop-blur":[{"backdrop-blur":Ne()}],"backdrop-brightness":[{"backdrop-brightness":[qe,Ce,_e]}],"backdrop-contrast":[{"backdrop-contrast":[qe,Ce,_e]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,Ce,_e]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,Ce,_e]}],"backdrop-invert":[{"backdrop-invert":["",qe,Ce,_e]}],"backdrop-opacity":[{"backdrop-opacity":[qe,Ce,_e]}],"backdrop-saturate":[{"backdrop-saturate":[qe,Ce,_e]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,Ce,_e]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ce,_e]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",Ce,_e]}],ease:[{ease:["linear","initial",T,Ce,_e]}],delay:[{delay:[qe,Ce,_e]}],animate:[{animate:["none",O,Ce,_e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Ce,_e]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Fe()}],"rotate-x":[{"rotate-x":Fe()}],"rotate-y":[{"rotate-y":Fe()}],"rotate-z":[{"rotate-z":Fe()}],scale:[{scale:Ue()}],"scale-x":[{"scale-x":Ue()}],"scale-y":[{"scale-y":Ue()}],"scale-z":[{"scale-z":Ue()}],"scale-3d":["scale-3d"],skew:[{skew:ht()}],"skew-x":[{"skew-x":ht()}],"skew-y":[{"skew-y":ht()}],transform:[{transform:[Ce,_e,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Je()}],"translate-x":[{"translate-x":Je()}],"translate-y":[{"translate-y":Je()}],"translate-z":[{"translate-z":Je()}],"translate-none":["translate-none"],zoom:[{zoom:[Cr,Ce,_e]}],accent:[{accent:ee()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ee()}],"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",Ce,_e]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":ee()}],"scrollbar-track-color":[{"scrollbar-track":ee()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",Ce,_e]}],fill:[{fill:["none",...ee()]}],"stroke-w":[{stroke:[qe,Fs,vo,nx]}],stroke:[{stroke:["none",...ee()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-bs","border-w-be","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-bs","border-color-be","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-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},vD=KN(gD);function We(...e){return vD(H1(e))}function yD({delayDuration:e=0,...n}){return h.jsx(wN,{"data-slot":"tooltip-provider",delayDuration:e,...n})}function bD({...e}){return h.jsx(SN,{"data-slot":"tooltip",...e})}function xD({...e}){return h.jsx(_N,{"data-slot":"tooltip-trigger",...e})}function wD({className:e,sideOffset:n=0,children:r,...o}){return h.jsx(CN,{children:h.jsxs(EN,{"data-slot":"tooltip-content",sideOffset:n,className:We("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",e),...o,children:[r,h.jsx(RN,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const Rm=new Set;function SD(e){return Rm.add(e),()=>Rm.delete(e)}function _D(){for(const e of Rm)e()}const i_=(...e)=>e.filter((n,r,o)=>!!n&&n.trim()!==""&&o.indexOf(n)===r).join(" ").trim();const CD=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const ED=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,r,o)=>o?o.toUpperCase():r.toLowerCase());const ox=e=>{const n=ED(e);return n.charAt(0).toUpperCase()+n.slice(1)};var Fh={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"};const RD=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},TD=w.createContext({}),OD=()=>w.useContext(TD),jD=w.forwardRef(({color:e,size:n,strokeWidth:r,absoluteStrokeWidth:o,className:s="",children:l,iconNode:u,...d},p)=>{const{size:m=24,strokeWidth:y=2,absoluteStrokeWidth:v=!1,color:b="currentColor",className:x=""}=OD()??{},C=o??v?Number(r??y)*24/Number(n??m):r??y;return w.createElement("svg",{ref:p,...Fh,width:n??m??Fh.width,height:n??m??Fh.height,stroke:e??b,strokeWidth:C,className:i_("lucide",x,s),...!l&&!RD(d)&&{"aria-hidden":"true"},...d},[...u.map(([_,E])=>w.createElement(_,E)),...Array.isArray(l)?l:[l]])});const Ae=(e,n)=>{const r=w.forwardRef(({className:o,...s},l)=>w.createElement(jD,{ref:l,iconNode:n,className:i_(`lucide-${CD(ox(e))}`,`lucide-${e}`,o),...s}));return r.displayName=ox(e),r};const AD=[["path",{d:"M4.5 3h15",key:"c7n0jr"}],["path",{d:"M6 3v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V3",key:"m1uhx7"}],["path",{d:"M6 14h12",key:"4cwo0f"}]],MD=Ae("beaker",AD);const ND=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],DD=Ae("book-open",ND);const zD=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],kD=Ae("briefcase",zD);const LD=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],$D=Ae("bug",LD);const ID=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],VD=Ae("calendar",ID);const FD=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],o_=Ae("check",FD);const PD=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],$p=Ae("chevron-down",PD);const UD=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],HD=Ae("chevron-right",UD);const BD=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],qD=Ae("chevron-up",BD);const GD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ZD=Ae("circle-check",GD);const KD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],a_=Ae("clock",KD);const YD=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],QD=Ae("code",YD);const XD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]],JD=Ae("compass",XD);const WD=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ez=Ae("copy",WD);const tz=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],nz=Ae("credit-card",tz);const rz=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],iz=Ae("database",rz);const oz=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],az=Ae("download",oz);const sz=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],lz=Ae("ellipsis",sz);const cz=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],s_=Ae("file-text",cz);const uz=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],dz=Ae("flag",uz);const fz=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Ip=Ae("folder",fz);const hz=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],mz=Ae("gauge",hz);const pz=[["path",{d:"m14 13-8.381 8.38a1 1 0 0 1-3.001-3l8.384-8.381",key:"pgg06f"}],["path",{d:"m16 16 6-6",key:"vzrcl6"}],["path",{d:"m21.5 10.5-8-8",key:"a17d9x"}],["path",{d:"m8 8 6-6",key:"18bi4p"}],["path",{d:"m8.5 7.5 8 8",key:"1oyaui"}]],gz=Ae("gavel",pz);const vz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],l_=Ae("globe",vz);const yz=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],bz=Ae("graduation-cap",yz);const xz=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],wz=Ae("heart",xz);const Sz=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],_z=Ae("history",Sz);const Cz=[["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"}]],Ez=Ae("image",Cz);const Rz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Tz=Ae("info",Rz);const Oz=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],jz=Ae("layout-dashboard",Oz);const Az=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],Mz=Ae("lightbulb",Az);const Nz=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Dz=Ae("link",Nz);const zz=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],kz=Ae("loader-circle",zz);const Lz=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],c_=Ae("lock",Lz);const $z=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Iz=Ae("log-out",$z);const Vz=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],Fz=Ae("megaphone",Vz);const Pz=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Uz=Ae("menu",Pz);const Hz=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],Bz=Ae("music",Hz);const qz=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Gz=Ae("octagon-x",qz);const Zz=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 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.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Kz=Ae("package",Zz);const Yz=[["path",{d:"M13 21h8",key:"1jsn5i"}],["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"}]],Qz=Ae("pen-line",Yz);const Xz=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Jz=Ae("plus",Xz);const Wz=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],ek=Ae("rocket",Wz);const tk=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],u_=Ae("search",tk);const nk=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],rk=Ae("settings",nk);const ik=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],ok=Ae("share-2",ik);const ak=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],d_=Ae("shield",ak);const sk=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],f_=Ae("square-terminal",sk);const lk=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],ck=Ae("star",lk);const uk=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],dk=Ae("trash-2",uk);const fk=[["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"}]],h_=Ae("triangle-alert",fk);const hk=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],mk=Ae("upload",hk);const pk=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],m_=Ae("users",pk);const gk=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],vk=Ae("wrench",gk);const yk=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],p_=Ae("x",yk);function bk(){const e=!document.body.classList.contains("sb-open");document.body.classList.toggle("sb-open"),Gu(),e?document.getElementById("sidebar")?.querySelector(xk)?.focus():document.getElementById("menu-btn")?.focus()}const xk='a[href], button:not(:disabled), select, input, [tabindex]:not([tabindex="-1"])';function mr(){const e=document.body.classList.contains("sb-open");document.body.classList.remove("sb-open"),Gu(),e&&window.innerWidth<=nu&&document.getElementById("menu-btn")?.focus()}const nu=900;function Gu(){const e=document.getElementById("sidebar");if(!e)return;const n=document.body.classList.contains("sb-open");window.innerWidth<=nu&&!n?e.setAttribute("inert",""):e.removeAttribute("inert");const o=document.getElementById("main");o&&(n&&window.innerWidth<=nu?o.setAttribute("inert",""):o.removeAttribute("inert")),e.setAttribute("aria-modal",String(n&&window.innerWidth<=nu)),document.getElementById("menu-btn")?.setAttribute("aria-expanded",String(n))}typeof window<"u"&&(window.addEventListener("resize",Gu),window.addEventListener("keydown",e=>{e.key==="Escape"&&document.body.classList.contains("sb-open")&&mr()}));const wk={alert:h_,card:nz,check:o_,chev:HD,chevd:$p,clock:a_,copy:ez,doc:s_,dots:lz,download:az,folder:Ip,dashboard:jz,gear:rk,globe:l_,hist:_z,link:Dz,lock:c_,menu:Uz,plus:Jz,power:Iz,search:u_,share:ok,shield:d_,terminal:f_,trash:dk,upload:mk,users:m_,x:p_};function yt({name:e}){const n=wk[e];return n?h.jsx(n,{className:"ico","aria-hidden":"true"}):null}const g_={folder:Ip,"book-open":DD,"file-text":s_,"pen-line":Qz,users:m_,briefcase:kD,megaphone:Fz,rocket:ek,lightbulb:Mz,flag:dz,star:ck,heart:wz,code:QD,"square-terminal":f_,bug:$D,wrench:vk,database:iz,package:Kz,beaker:MD,gauge:mz,shield:d_,lock:c_,gavel:gz,globe:l_,compass:JD,calendar:VD,clock:a_,"graduation-cap":bz,image:Ez,music:Bz};function ka({name:e,className:n}){const r=g_[e??""]??Ip;return h.jsx(r,{className:n,"aria-hidden":"true"})}function Sk({size:e=22}){return h.jsxs("svg",{width:e,height:e,viewBox:"0 0 32 32",fill:"currentColor",role:"img","aria-label":"BearDrive",children:[h.jsx("rect",{x:"4",y:"4",width:"5.6",height:"24"}),h.jsx("rect",{x:"11.2",y:"4",width:"14.4",height:"11.2"}),h.jsx("rect",{x:"11.2",y:"16.8",width:"16.8",height:"11.2"})]})}function vu(e){const n=["page",e.width??"app",e.className].filter(Boolean).join(" ");return h.jsx("div",{className:n,children:e.children})}function _k(e){e&&Gu()}function al(e){return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:"sb-backdrop",onClick:mr}),h.jsxs("aside",{id:"sidebar",ref:_k,children:[e.vault,e.projectsNav,e.tree??h.jsx("nav",{id:"tree","aria-label":"Files"}),e.orgBar]}),h.jsxs("main",{id:"main",children:[e.topbar,h.jsx("article",{id:"content",ref:e.contentRef,onScroll:e.onContentScroll,children:e.children})]})]})}function Zu(e){const{name:n,onHome:r,showSignout:o,search:s}=e;return h.jsxs("header",{id:"vault",children:[h.jsx("span",{id:"vault-badge",children:h.jsx(Sk,{size:22})}),h.jsx("span",{id:"vault-name",className:r?"vault-link":void 0,onClick:r,role:r?"button":void 0,tabIndex:r?0:void 0,onKeyDown:l=>{r&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),r())},children:n}),h.jsxs("div",{className:"vault-actions",children:[s&&h.jsxs(bD,{delayDuration:150,children:[h.jsx(xD,{asChild:!0,children:h.jsx("button",{id:"search-btn",className:"icon-btn2","aria-label":"Search",onClick:()=>{_D(),mr()},children:h.jsx(yt,{name:"search"})})}),h.jsxs(wD,{className:"tipcard",sideOffset:6,children:["Search ",h.jsx("kbd",{children:"⌘K"})]})]}),o&&h.jsx("a",{id:"signout",href:"/auth/logout",title:"Sign out","aria-label":"Sign out",children:h.jsx(yt,{name:"power"})})]})]})}function sl(e){return h.jsxs("header",{id:"topbar",children:[h.jsx("button",{id:"menu-btn",className:"icon-btn",title:"Menu","aria-label":"Menu","aria-controls":"sidebar","aria-expanded":"false",onClick:bk,children:h.jsx(yt,{name:"menu"})}),h.jsx("span",{id:"crumb",children:e.crumb}),h.jsx("span",{id:"meta",children:e.meta}),e.actions]})}function Ck(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const Ek=e=>{switch(e){case"success":return Ok;case"info":return Ak;case"warning":return jk;case"error":return Mk;default:return null}},Rk=Array(12).fill(0),Tk=({visible:e,className:n})=>he.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},he.createElement("div",{className:"sonner-spinner"},Rk.map((r,o)=>he.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),Ok=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),jk=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Ak=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Mk=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},he.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Nk=he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},he.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),he.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Dk=()=>{const[e,n]=he.useState(document.hidden);return he.useEffect(()=>{const r=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let Tm=1;class zk{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{const r=this.subscribers.indexOf(n);this.subscribers.splice(r,1)}),this.publish=n=>{this.subscribers.forEach(r=>r(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var r;const{message:o,...s}=n,l=typeof n?.id=="number"||((r=n.id)==null?void 0:r.length)>0?n.id:Tm++,u=this.toasts.find(p=>p.id===l),d=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),u?this.toasts=this.toasts.map(p=>p.id===l?(this.publish({...p,...n,id:l,title:o}),{...p,...n,id:l,dismissible:d,title:o}):p):this.addToast({title:o,...s,dismissible:d,id:l}),l},this.dismiss=n=>(n?(this.dismissedToasts.add(n),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:n,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(o=>o({id:r.id,dismiss:!0}))}),n),this.message=(n,r)=>this.create({...r,message:n}),this.error=(n,r)=>this.create({...r,message:n,type:"error"}),this.success=(n,r)=>this.create({...r,type:"success",message:n}),this.info=(n,r)=>this.create({...r,type:"info",message:n}),this.warning=(n,r)=>this.create({...r,type:"warning",message:n}),this.loading=(n,r)=>this.create({...r,type:"loading",message:n}),this.promise=(n,r)=>{if(!r)return;let o;r.loading!==void 0&&(o=this.create({...r,promise:n,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(n instanceof Function?n():n);let l=o!==void 0,u;const d=s.then(async m=>{if(u=["resolve",m],he.isValidElement(m))l=!1,this.create({id:o,type:"default",message:m});else if(Lk(m)&&!m.ok){l=!1;const v=typeof r.error=="function"?await r.error(`HTTP error! status: ${m.status}`):r.error,b=typeof r.description=="function"?await r.description(`HTTP error! status: ${m.status}`):r.description,C=typeof v=="object"&&!he.isValidElement(v)?v:{message:v};this.create({id:o,type:"error",description:b,...C})}else if(m instanceof Error){l=!1;const v=typeof r.error=="function"?await r.error(m):r.error,b=typeof r.description=="function"?await r.description(m):r.description,C=typeof v=="object"&&!he.isValidElement(v)?v:{message:v};this.create({id:o,type:"error",description:b,...C})}else if(r.success!==void 0){l=!1;const v=typeof r.success=="function"?await r.success(m):r.success,b=typeof r.description=="function"?await r.description(m):r.description,C=typeof v=="object"&&!he.isValidElement(v)?v:{message:v};this.create({id:o,type:"success",description:b,...C})}}).catch(async m=>{if(u=["reject",m],r.error!==void 0){l=!1;const y=typeof r.error=="function"?await r.error(m):r.error,v=typeof r.description=="function"?await r.description(m):r.description,x=typeof y=="object"&&!he.isValidElement(y)?y:{message:y};this.create({id:o,type:"error",description:v,...x})}}).finally(()=>{l&&(this.dismiss(o),o=void 0),r.finally==null||r.finally.call(r)}),p=()=>new Promise((m,y)=>d.then(()=>u[0]==="reject"?y(u[1]):m(u[1])).catch(y));return typeof o!="string"&&typeof o!="number"?{unwrap:p}:Object.assign(o,{unwrap:p})},this.custom=(n,r)=>{const o=r?.id||Tm++;return this.create({jsx:n(o),id:o,...r}),o},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Mn=new zk,kk=(e,n)=>{const r=n?.id||Tm++;return Mn.addToast({title:e,...n,id:r}),r},Lk=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",$k=kk,Ik=()=>Mn.toasts,Vk=()=>Mn.getActiveToasts(),ax=Object.assign($k,{success:Mn.success,info:Mn.info,warning:Mn.warning,error:Mn.error,custom:Mn.custom,message:Mn.message,promise:Mn.promise,dismiss:Mn.dismiss,loading:Mn.loading},{getHistory:Ik,getToasts:Vk});Ck("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function qc(e){return e.label!==void 0}const Fk=3,Pk="24px",Uk="16px",sx=4e3,Hk=356,Bk=14,qk=45,Gk=200;function Er(...e){return e.filter(Boolean).join(" ")}function Zk(e){const[n,r]=e.split("-"),o=[];return n&&o.push(n),r&&o.push(r),o}const Kk=e=>{var n,r,o,s,l,u,d,p,m;const{invert:y,toast:v,unstyled:b,interacting:x,setHeights:C,visibleToasts:_,heights:E,index:T,toasts:O,expanded:A,removeToast:z,defaultRichColors:L,closeButton:B,style:H,cancelButtonStyle:I,actionButtonStyle:ne,className:ve="",descriptionClassName:fe="",duration:ce,position:le,gap:me,expandByDefault:xe,classNames:N,icons:Z,closeButtonAriaLabel:re="Close toast"}=e,[W,ee]=he.useState(null),[D,M]=he.useState(null),[U,Q]=he.useState(!1),[K,ae]=he.useState(!1),[J,ge]=he.useState(!1),[ye,Ne]=he.useState(!1),[Fe,Ue]=he.useState(!1),[ht,Je]=he.useState(0),[xn,dn]=he.useState(0),Xt=he.useRef(v.duration||ce||sx),or=he.useRef(null),Ht=he.useRef(null),ar=T===0,Bn=T+1<=_,zt=v.type,pn=v.dismissible!==!1,jt=v.className||"",Dr=v.descriptionClassName||"",kt=he.useMemo(()=>E.findIndex(Me=>Me.toastId===v.id)||0,[E,v.id]),oi=he.useMemo(()=>{var Me;return(Me=v.closeButton)!=null?Me:B},[v.closeButton,B]),br=he.useMemo(()=>v.duration||ce||sx,[v.duration,ce]),ze=he.useRef(0),ke=he.useRef(0),j=he.useRef(0),V=he.useRef(null),[F,se]=le.split("-"),de=he.useMemo(()=>E.reduce((Me,mt,bt)=>bt>=kt?Me:Me+mt.height,0),[E,kt]),pe=Dk(),be=v.invert||y,we=zt==="loading";ke.current=he.useMemo(()=>kt*me+de,[kt,de]),he.useEffect(()=>{Xt.current=br},[br]),he.useEffect(()=>{Q(!0)},[]),he.useEffect(()=>{const Me=Ht.current;if(Me){const mt=Me.getBoundingClientRect().height;return dn(mt),C(bt=>[{toastId:v.id,height:mt,position:v.position},...bt]),()=>C(bt=>bt.filter(Zt=>Zt.toastId!==v.id))}},[C,v.id]),he.useLayoutEffect(()=>{if(!U)return;const Me=Ht.current,mt=Me.style.height;Me.style.height="auto";const bt=Me.getBoundingClientRect().height;Me.style.height=mt,dn(bt),C(Zt=>Zt.find(_t=>_t.toastId===v.id)?Zt.map(_t=>_t.toastId===v.id?{..._t,height:bt}:_t):[{toastId:v.id,height:bt,position:v.position},...Zt])},[U,v.title,v.description,C,v.id,v.jsx,v.action,v.cancel]);const Te=he.useCallback(()=>{ae(!0),Je(ke.current),C(Me=>Me.filter(mt=>mt.toastId!==v.id)),setTimeout(()=>{z(v)},Gk)},[v,z,C,ke]);he.useEffect(()=>{if(v.promise&&zt==="loading"||v.duration===1/0||v.type==="loading")return;let Me;return A||x||pe?(()=>{if(j.current{v.onAutoClose==null||v.onAutoClose.call(v,v),Te()},Xt.current)),()=>clearTimeout(Me)},[A,x,v,zt,pe,Te]),he.useEffect(()=>{v.delete&&(Te(),v.onDismiss==null||v.onDismiss.call(v,v))},[Te,v.delete]);function nt(){var Me;if(Z?.loading){var mt;return he.createElement("div",{className:Er(N?.loader,v==null||(mt=v.classNames)==null?void 0:mt.loader,"sonner-loader"),"data-visible":zt==="loading"},Z.loading)}return he.createElement(Tk,{className:Er(N?.loader,v==null||(Me=v.classNames)==null?void 0:Me.loader),visible:zt==="loading"})}const St=v.icon||Z?.[zt]||Ek(zt);var Jt,Lt;return he.createElement("li",{tabIndex:0,ref:Ht,className:Er(ve,jt,N?.toast,v==null||(n=v.classNames)==null?void 0:n.toast,N?.default,N?.[zt],v==null||(r=v.classNames)==null?void 0:r[zt]),"data-sonner-toast":"","data-rich-colors":(Jt=v.richColors)!=null?Jt:L,"data-styled":!(v.jsx||v.unstyled||b),"data-mounted":U,"data-promise":!!v.promise,"data-swiped":Fe,"data-removed":K,"data-visible":Bn,"data-y-position":F,"data-x-position":se,"data-index":T,"data-front":ar,"data-swiping":J,"data-dismissible":pn,"data-type":zt,"data-invert":be,"data-swipe-out":ye,"data-swipe-direction":D,"data-expanded":!!(A||xe&&U),"data-testid":v.testId,style:{"--index":T,"--toasts-before":T,"--z-index":O.length-T,"--offset":`${K?ht:ke.current}px`,"--initial-height":xe?"auto":`${xn}px`,...H,...v.style},onDragEnd:()=>{ge(!1),ee(null),V.current=null},onPointerDown:Me=>{Me.button!==2&&(we||!pn||(or.current=new Date,Je(ke.current),Me.target.setPointerCapture(Me.pointerId),Me.target.tagName!=="BUTTON"&&(ge(!0),V.current={x:Me.clientX,y:Me.clientY})))},onPointerUp:()=>{var Me,mt,bt;if(ye||!pn)return;V.current=null;const Zt=Number(((Me=Ht.current)==null?void 0:Me.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),sr=Number(((mt=Ht.current)==null?void 0:mt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),_t=new Date().getTime()-((bt=or.current)==null?void 0:bt.getTime()),wn=W==="x"?Zt:sr,Xi=Math.abs(wn)/_t;if(Math.abs(wn)>=qk||Xi>.11){Je(ke.current),v.onDismiss==null||v.onDismiss.call(v,v),M(W==="x"?Zt>0?"right":"left":sr>0?"down":"up"),Te(),Ne(!0);return}else{var Sn,_n;(Sn=Ht.current)==null||Sn.style.setProperty("--swipe-amount-x","0px"),(_n=Ht.current)==null||_n.style.setProperty("--swipe-amount-y","0px")}Ue(!1),ge(!1),ee(null)},onPointerMove:Me=>{var mt,bt,Zt;if(!V.current||!pn||((mt=window.getSelection())==null?void 0:mt.toString().length)>0)return;const _t=Me.clientY-V.current.y,wn=Me.clientX-V.current.x;var Xi;const Sn=(Xi=e.swipeDirections)!=null?Xi:Zk(le);!W&&(Math.abs(wn)>1||Math.abs(_t)>1)&&ee(Math.abs(wn)>Math.abs(_t)?"x":"y");let _n={x:0,y:0};const Lo=lr=>1/(1.5+Math.abs(lr)/20);if(W==="y"){if(Sn.includes("top")||Sn.includes("bottom"))if(Sn.includes("top")&&_t<0||Sn.includes("bottom")&&_t>0)_n.y=_t;else{const lr=_t*Lo(_t);_n.y=Math.abs(lr)0)_n.x=wn;else{const lr=wn*Lo(wn);_n.x=Math.abs(lr)0||Math.abs(_n.y)>0)&&Ue(!0),(bt=Ht.current)==null||bt.style.setProperty("--swipe-amount-x",`${_n.x}px`),(Zt=Ht.current)==null||Zt.style.setProperty("--swipe-amount-y",`${_n.y}px`)}},oi&&!v.jsx&&zt!=="loading"?he.createElement("button",{"aria-label":re,"data-disabled":we,"data-close-button":!0,onClick:we||!pn?()=>{}:()=>{Te(),v.onDismiss==null||v.onDismiss.call(v,v)},className:Er(N?.closeButton,v==null||(o=v.classNames)==null?void 0:o.closeButton)},(Lt=Z?.close)!=null?Lt:Nk):null,(zt||v.icon||v.promise)&&v.icon!==null&&(Z?.[zt]!==null||v.icon)?he.createElement("div",{"data-icon":"",className:Er(N?.icon,v==null||(s=v.classNames)==null?void 0:s.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||nt():null,v.type!=="loading"?St:null):null,he.createElement("div",{"data-content":"",className:Er(N?.content,v==null||(l=v.classNames)==null?void 0:l.content)},he.createElement("div",{"data-title":"",className:Er(N?.title,v==null||(u=v.classNames)==null?void 0:u.title)},v.jsx?v.jsx:typeof v.title=="function"?v.title():v.title),v.description?he.createElement("div",{"data-description":"",className:Er(fe,Dr,N?.description,v==null||(d=v.classNames)==null?void 0:d.description)},typeof v.description=="function"?v.description():v.description):null),he.isValidElement(v.cancel)?v.cancel:v.cancel&&qc(v.cancel)?he.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||I,onClick:Me=>{qc(v.cancel)&&pn&&(v.cancel.onClick==null||v.cancel.onClick.call(v.cancel,Me),Te())},className:Er(N?.cancelButton,v==null||(p=v.classNames)==null?void 0:p.cancelButton)},v.cancel.label):null,he.isValidElement(v.action)?v.action:v.action&&qc(v.action)?he.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||ne,onClick:Me=>{qc(v.action)&&(v.action.onClick==null||v.action.onClick.call(v.action,Me),!Me.defaultPrevented&&Te())},className:Er(N?.actionButton,v==null||(m=v.classNames)==null?void 0:m.actionButton)},v.action.label):null)};function lx(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Yk(e,n){const r={};return[e,n].forEach((o,s)=>{const l=s===1,u=l?"--mobile-offset":"--offset",d=l?Uk:Pk;function p(m){["top","right","bottom","left"].forEach(y=>{r[`${u}-${y}`]=typeof m=="number"?`${m}px`:m})}typeof o=="number"||typeof o=="string"?p(o):typeof o=="object"?["top","right","bottom","left"].forEach(m=>{o[m]===void 0?r[`${u}-${m}`]=d:r[`${u}-${m}`]=typeof o[m]=="number"?`${o[m]}px`:o[m]}):p(d)}),r}const Qk=he.forwardRef(function(n,r){const{id:o,invert:s,position:l="bottom-right",hotkey:u=["altKey","KeyT"],expand:d,closeButton:p,className:m,offset:y,mobileOffset:v,theme:b="light",richColors:x,duration:C,style:_,visibleToasts:E=Fk,toastOptions:T,dir:O=lx(),gap:A=Bk,icons:z,containerAriaLabel:L="Notifications"}=n,[B,H]=he.useState([]),I=he.useMemo(()=>o?B.filter(U=>U.toasterId===o):B.filter(U=>!U.toasterId),[B,o]),ne=he.useMemo(()=>Array.from(new Set([l].concat(I.filter(U=>U.position).map(U=>U.position)))),[I,l]),[ve,fe]=he.useState([]),[ce,le]=he.useState(!1),[me,xe]=he.useState(!1),[N,Z]=he.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),re=he.useRef(null),W=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),ee=he.useRef(null),D=he.useRef(!1),M=he.useCallback(U=>{H(Q=>{var K;return(K=Q.find(ae=>ae.id===U.id))!=null&&K.delete||Mn.dismiss(U.id),Q.filter(({id:ae})=>ae!==U.id)})},[]);return he.useEffect(()=>Mn.subscribe(U=>{if(U.dismiss){requestAnimationFrame(()=>{H(Q=>Q.map(K=>K.id===U.id?{...K,delete:!0}:K))});return}setTimeout(()=>{W2.flushSync(()=>{H(Q=>{const K=Q.findIndex(ae=>ae.id===U.id);return K!==-1?[...Q.slice(0,K),{...Q[K],...U},...Q.slice(K+1)]:[U,...Q]})})})}),[B]),he.useEffect(()=>{if(b!=="system"){Z(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Z("dark"):Z("light")),typeof window>"u")return;const U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:Q})=>{Z(Q?"dark":"light")})}catch{U.addListener(({matches:K})=>{try{Z(K?"dark":"light")}catch(ae){console.error(ae)}})}},[b]),he.useEffect(()=>{B.length<=1&&le(!1)},[B]),he.useEffect(()=>{const U=Q=>{var K;if(u.every(ge=>Q[ge]||Q.code===ge)){var J;le(!0),(J=re.current)==null||J.focus()}Q.code==="Escape"&&(document.activeElement===re.current||(K=re.current)!=null&&K.contains(document.activeElement))&&le(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[u]),he.useEffect(()=>{if(re.current)return()=>{ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null,D.current=!1)}},[re.current]),he.createElement("section",{ref:r,"aria-label":`${L} ${W}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},ne.map((U,Q)=>{var K;const[ae,J]=U.split("-");return I.length?he.createElement("ol",{key:U,dir:O==="auto"?lx():O,tabIndex:-1,ref:re,className:m,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":ae,"data-x-position":J,style:{"--front-toast-height":`${((K=ve[0])==null?void 0:K.height)||0}px`,"--width":`${Hk}px`,"--gap":`${A}px`,..._,...Yk(y,v)},onBlur:ge=>{D.current&&!ge.currentTarget.contains(ge.relatedTarget)&&(D.current=!1,ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null))},onFocus:ge=>{ge.target instanceof HTMLElement&&ge.target.dataset.dismissible==="false"||D.current||(D.current=!0,ee.current=ge.relatedTarget)},onMouseEnter:()=>le(!0),onMouseMove:()=>le(!0),onMouseLeave:()=>{me||le(!1)},onDragEnd:()=>le(!1),onPointerDown:ge=>{ge.target instanceof HTMLElement&&ge.target.dataset.dismissible==="false"||xe(!0)},onPointerUp:()=>xe(!1)},I.filter(ge=>!ge.position&&Q===0||ge.position===U).map((ge,ye)=>{var Ne,Fe;return he.createElement(Kk,{key:ge.id,icons:z,index:ye,toast:ge,defaultRichColors:x,duration:(Ne=T?.duration)!=null?Ne:C,className:T?.className,descriptionClassName:T?.descriptionClassName,invert:s,visibleToasts:E,closeButton:(Fe=T?.closeButton)!=null?Fe:p,interacting:me,position:U,style:T?.style,unstyled:T?.unstyled,classNames:T?.classNames,cancelButtonStyle:T?.cancelButtonStyle,actionButtonStyle:T?.actionButtonStyle,closeButtonAriaLabel:T?.closeButtonAriaLabel,removeToast:M,toasts:I.filter(Ue=>Ue.position==ge.position),heights:ve.filter(Ue=>Ue.position==ge.position),setHeights:fe,expandByDefault:d,gap:A,expanded:ce,swipeDirections:n.swipeDirections})})):null}))}),Xk=({...e})=>h.jsx(Qk,{theme:"dark",className:"toaster group",icons:{success:h.jsx(ZD,{className:"size-4"}),info:h.jsx(Tz,{className:"size-4"}),warning:h.jsx(h_,{className:"size-4"}),error:h.jsx(Gz,{className:"size-4"}),loading:h.jsx(kz,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius-ctl)"},...e});function Qe(e,n=!1){n?ax.error(e,{duration:1/0,closeButton:!0}):ax(e)}function Jk(){return h.jsx(Xk,{position:"bottom-center"})}const cx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ux=H1,Wk=(e,n)=>r=>{var o;if(n?.variants==null)return ux(e,r?.class,r?.className);const{variants:s,defaultVariants:l}=n,u=Object.keys(s).map(m=>{const y=r?.[m],v=l?.[m];if(y===null)return null;const b=cx(y)||cx(v);return s[m][b]}),d=r&&Object.entries(r).reduce((m,y)=>{let[v,b]=y;return b===void 0||(m[v]=b),m},{}),p=n==null||(o=n.compoundVariants)===null||o===void 0?void 0:o.reduce((m,y)=>{let{class:v,className:b,...x}=y;return Object.entries(x).every(C=>{let[_,E]=C;return Array.isArray(E)?E.includes({...l,...d}[_]):{...l,...d}[_]===E})?[...m,v,b]:m},[]);return ux(e,u,p,r?.class,r?.className)},e3=Wk("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[background-color,border-color,color] disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",primary:"pbtn",danger:"danger-btn",subtle:"ai-btn",toolbar:"btn",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Ct({className:e,variant:n="default",size:r="default",asChild:o=!1,...s}){const l=o?eT:"button";return h.jsx(l,{"data-slot":"button","data-variant":n,"data-size":r,className:We(e3({variant:n,size:r,className:e})),...s})}function Vp({...e}){return h.jsx(ap,{"data-slot":"dialog",...e})}function t3({...e}){return h.jsx(lp,{"data-slot":"dialog-portal",...e})}function n3({className:e,...n}){return h.jsx(cp,{"data-slot":"dialog-overlay",className:We("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...n})}function Fp({className:e,children:n,showCloseButton:r=!0,...o}){return h.jsxs(t3,{"data-slot":"dialog-portal",children:[h.jsx(n3,{}),h.jsxs(up,{"data-slot":"dialog-content",className:We("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",e),...o,children:[n,r&&h.jsxs(Yw,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[h.jsx(p_,{}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Ku({className:e,...n}){return h.jsx(Gw,{"data-slot":"dialog-title",className:We("text-lg leading-none font-semibold",e),...n})}let v_=null,ru=[];function bl(e){v_=e,ru.forEach(n=>n())}function Pp(e,n,r="",o="OK",s={}){return new Promise(l=>bl({kind:"prompt",title:e,label:n,value:r,okLabel:o,...s,resolve:l}))}function Yu(e,n,r="Confirm",o=!1){return new Promise(s=>bl({kind:"confirm",title:e,message:n,confirmLabel:r,danger:o,resolve:s}))}function r3(){const e=w.useSyncExternalStore(r=>(ru.push(r),()=>{ru=ru.filter(o=>o!==r)}),()=>v_);if(!e)return null;const n=()=>{bl(null),e.kind==="prompt"?e.resolve(null):e.resolve(!1)};return h.jsx(Vp,{open:!0,onOpenChange:r=>!r&&n(),children:h.jsx(Fp,{className:"modal",showCloseButton:!1,children:e.kind==="prompt"?h.jsx(i3,{m:e}):h.jsx(o3,{m:e})})})}function i3({m:e}){const n=w.useRef(null),r=m=>{bl(null),e.resolve(m)},[o,s]=w.useState(""),[l,u]=w.useState(e.value),d=e.match===void 0||l.trim()===e.match,p=()=>{const m=l;if(d){if(!m.trim()){s("Give it a name."),n.current.focus();return}r(m)}};return h.jsxs(h.Fragment,{children:[h.jsx(Ku,{asChild:!0,children:h.jsx("h3",{children:e.title})}),h.jsx("label",{className:"modal-label",htmlFor:"modal-input",children:e.label}),h.jsx("input",{className:"modal-input",type:"text",autoComplete:"off",value:l,ref:n,id:"modal-input",autoFocus:!0,onFocus:m=>m.currentTarget.select(),"aria-invalid":!!o,"aria-describedby":o?"modal-input-err":void 0,onChange:m=>{u(m.currentTarget.value),o&&s("")},onKeyDown:m=>m.key==="Enter"&&p()}),o&&h.jsx("span",{id:"modal-input-err",role:"alert",className:"field-err",children:o}),h.jsxs("div",{className:"modal-actions",children:[h.jsx(Ct,{variant:"subtle",onClick:()=>r(null),children:"Cancel"}),h.jsx(Ct,{variant:e.danger?"danger":"primary",onClick:p,disabled:!d,children:e.okLabel})]})]})}function o3({m:e}){const n=r=>{bl(null),e.resolve(r)};return h.jsxs(h.Fragment,{children:[h.jsx(Ku,{asChild:!0,children:h.jsx("h3",{children:e.title})}),h.jsx("p",{className:"modal-msg",children:e.message}),h.jsxs("div",{className:"modal-actions",children:[h.jsx(Ct,{variant:"subtle",onClick:()=>n(!1),autoFocus:e.danger,children:"Cancel"}),h.jsx(Ct,{variant:e.danger?"danger":"primary",onClick:()=>n(!0),autoFocus:!e.danger,children:e.confirmLabel})]})]})}function a3(e){return Gt({queryKey:["projects"],queryFn:()=>cn("/api/projects"),enabled:e,refetchInterval:3e4,select:n=>n.projects||[]})}function s3(e){return Gt({queryKey:["orgs"],queryFn:()=>cn("/api/orgs"),enabled:e,select:n=>n.orgs||[]})}function l3(e){return Gt({queryKey:["permissions",e],queryFn:()=>cn(`/api/p/${e}/permissions`),enabled:!!e})}function y_(e,n=!0){return Gt({queryKey:["shares",e],queryFn:()=>cn(`/api/p/${e}/shares`),enabled:!!e&&n,select:r=>r.shares||[]})}function b_(e){return Gt({queryKey:["admin","pending"],queryFn:()=>cn("/api/admin/pending"),enabled:e,select:n=>n.pending||[]})}function Up(){const e=jo();return()=>Promise.all([e.invalidateQueries({queryKey:["projects"]}),e.invalidateQueries({queryKey:["orgs"]})]).then(()=>{})}function x_(e){return e.split("/").map(encodeURIComponent).join("/")}function c3(e){return e.split("/").map(decodeURIComponent).join("/")}const u3=new Set(["dashboard","history","install","settings"]),Ph={insights:"dashboard"};function w_(e,n){const r=e.indexOf("?"),o=r===-1?"":new URLSearchParams(e.slice(r)).get("v")||"",s=d3(r===-1?e:e.slice(0,r),n);return o&&(s.version=o),s}function dx(e,n){const r=n.replace(/\/+$/,"");return r!==n&&(e.trailingSlash=!0),e.path=r?c3(r):"",e}function d3(e,n){const r=e.replace(/^\/+/,"");if(n!=="hub")return dx({path:""},r);if(r==="orgs"||r.startsWith("orgs/"))return{org:r.slice(5).replace(/\/+$/,""),path:""};if(r==="billing"||r.startsWith("billing/"))return{billing:!0,path:""};const o=r.indexOf("/");if(o===-1)return{project:r,path:""};const s=dx({project:r.slice(0,o),path:""},r.slice(o+1)),l=s.path.indexOf("/"),u=l===-1?s.path:s.path.slice(0,l);return(u3.has(u)||Ph[u])&&(s.view=Ph[u]||u,Ph[u]&&(s.legacyView=!0),s.viewTarget=l===-1?"":s.path.slice(l+1).replace(/\/+$/,""),s.path=""),s}function Qu(e,n,r){const o=x_(e),s=r?"?v="+r:"";return n?"/"+n+(o?"/"+o:"")+s:"/"+o+s}function bo(e,n,r){let o=(n?"/"+n:"")+"/"+e;return r&&(o+="/"+x_(r.replace(/\/+$/,""))),o}let Hp="POP";const Om=new Set;function S_(){for(const e of Om)e()}window.addEventListener("popstate",()=>{Hp="POP",S_()});function yn(e,n){const r=location.pathname+location.search;!n?.replace&&r===e||(history[n?.replace?"replaceState":"pushState"](null,"",e),Hp=n?.replace?"REPLACE":"PUSH",S_())}function Bp(){return w.useSyncExternalStore(e=>(Om.add(e),()=>{Om.delete(e)}),()=>location.pathname+location.search)}function f3(){return Hp}function yu(e){return e.startsWith("/")&&!e.startsWith("//")?{href:e,onClick:r=>{r.defaultPrevented||r.metaKey||r.ctrlKey||r.shiftKey||r.altKey||r.button!==0||(r.preventDefault(),yn(e),document.body.classList.remove("sb-open"))}}:{href:e,target:"_blank",rel:"noopener noreferrer"}}function iu({to:e}){return w.useEffect(()=>{yn(e,{replace:!0})},[e]),null}function __(){return{accessor:(e,n)=>typeof e=="function"?{...n,accessorFn:e}:{...n,accessorKey:e},display:e=>e,group:e=>e}}function Ni(e,n){return typeof e=="function"?e(n):e}function Hn(e,n){return r=>{n.setState(o=>({...o,[e]:Ni(r,o[e])}))}}function Xu(e){return e instanceof Function}function h3(e){return Array.isArray(e)&&e.every(n=>typeof n=="number")}function m3(e,n){const r=[],o=s=>{s.forEach(l=>{r.push(l);const u=n(l);u!=null&&u.length&&o(u)})};return o(e),r}function Le(e,n,r){let o=[],s;return l=>{let u;r.key&&r.debug&&(u=Date.now());const d=e(l);if(!(d.length!==o.length||d.some((y,v)=>o[v]!==y)))return s;o=d;let m;if(r.key&&r.debug&&(m=Date.now()),s=n(...d),r==null||r.onChange==null||r.onChange(s),r.key&&r.debug&&r!=null&&r.debug()){const y=Math.round((Date.now()-u)*100)/100,v=Math.round((Date.now()-m)*100)/100,b=v/16,x=(C,_)=>{for(C=String(C);C.length<_;)C=" "+C;return C};console.info(`%c⏱ ${x(v,5)} /${x(y,5)} ms`,`
font-size: .6rem;
font-weight: bold;
- color: hsl(${Math.max(0,Math.min(120-120*b,120))}deg 100% 31%);`,r?.key)}return s}}function $e(e,n,r,o){return{debug:()=>{var s;return(s=e?.debugAll)!=null?s:e[n]},key:!1,onChange:o}}function h3(e,n,r,o){const s=()=>{var u;return(u=l.getValue())!=null?u:e.options.renderFallbackValue},l={id:`${n.id}_${r.id}`,row:n,column:r,getValue:()=>n.getValue(o),renderValue:s,getContext:Le(()=>[e,r,n,l],(u,d,p,h)=>({table:u,column:d,row:p,cell:h,getValue:h.getValue,renderValue:h.renderValue}),$e(e.options,"debugCells"))};return e._features.forEach(u=>{u.createCell==null||u.createCell(l,r,n,e)},{}),l}function m3(e,n,r,o){var s,l;const d={...e._getDefaultColumnDef(),...n},p=d.accessorKey;let h=(s=(l=d.id)!=null?l:p?typeof String.prototype.replaceAll=="function"?p.replaceAll(".","_"):p.replace(/\./g,"_"):void 0)!=null?s:typeof d.header=="string"?d.header:void 0,y;if(d.accessorFn?y=d.accessorFn:p&&(p.includes(".")?y=b=>{let x=b;for(const _ of p.split(".")){var C;x=(C=x)==null?void 0:C[_]}return x}:y=b=>b[d.accessorKey]),!h)throw new Error;let v={id:`${String(h)}`,accessorFn:y,parent:o,depth:r,columnDef:d,columns:[],getFlatColumns:Le(()=>[!0],()=>{var b;return[v,...(b=v.columns)==null?void 0:b.flatMap(x=>x.getFlatColumns())]},$e(e.options,"debugColumns")),getLeafColumns:Le(()=>[e._getOrderColumnsFn()],b=>{var x;if((x=v.columns)!=null&&x.length){let C=v.columns.flatMap(_=>_.getLeafColumns());return b(C)}return[v]},$e(e.options,"debugColumns"))};for(const b of e._features)b.createColumn==null||b.createColumn(v,e);return v}const hn="debugHeaders";function dx(e,n,r){var o;let l={id:(o=r.id)!=null?o:n.id,column:n,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const u=[],d=p=>{p.subHeaders&&p.subHeaders.length&&p.subHeaders.map(d),u.push(p)};return d(l),u},getContext:()=>({table:e,header:l,column:n})};return e._features.forEach(u=>{u.createHeader==null||u.createHeader(l,e)}),l}const p3={createTable:e=>{e.getHeaderGroups=Le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,o,s)=>{var l,u;const d=(l=o?.map(v=>r.find(b=>b.id===v)).filter(Boolean))!=null?l:[],p=(u=s?.map(v=>r.find(b=>b.id===v)).filter(Boolean))!=null?u:[],h=r.filter(v=>!(o!=null&&o.includes(v.id))&&!(s!=null&&s.includes(v.id)));return Gc(n,[...d,...h,...p],e)},$e(e.options,hn)),e.getCenterHeaderGroups=Le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,o,s)=>(r=r.filter(l=>!(o!=null&&o.includes(l.id))&&!(s!=null&&s.includes(l.id))),Gc(n,r,e,"center")),$e(e.options,hn)),e.getLeftHeaderGroups=Le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(n,r,o)=>{var s;const l=(s=o?.map(u=>r.find(d=>d.id===u)).filter(Boolean))!=null?s:[];return Gc(n,l,e,"left")},$e(e.options,hn)),e.getRightHeaderGroups=Le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(n,r,o)=>{var s;const l=(s=o?.map(u=>r.find(d=>d.id===u)).filter(Boolean))!=null?s:[];return Gc(n,l,e,"right")},$e(e.options,hn)),e.getFooterGroups=Le(()=>[e.getHeaderGroups()],n=>[...n].reverse(),$e(e.options,hn)),e.getLeftFooterGroups=Le(()=>[e.getLeftHeaderGroups()],n=>[...n].reverse(),$e(e.options,hn)),e.getCenterFooterGroups=Le(()=>[e.getCenterHeaderGroups()],n=>[...n].reverse(),$e(e.options,hn)),e.getRightFooterGroups=Le(()=>[e.getRightHeaderGroups()],n=>[...n].reverse(),$e(e.options,hn)),e.getFlatHeaders=Le(()=>[e.getHeaderGroups()],n=>n.map(r=>r.headers).flat(),$e(e.options,hn)),e.getLeftFlatHeaders=Le(()=>[e.getLeftHeaderGroups()],n=>n.map(r=>r.headers).flat(),$e(e.options,hn)),e.getCenterFlatHeaders=Le(()=>[e.getCenterHeaderGroups()],n=>n.map(r=>r.headers).flat(),$e(e.options,hn)),e.getRightFlatHeaders=Le(()=>[e.getRightHeaderGroups()],n=>n.map(r=>r.headers).flat(),$e(e.options,hn)),e.getCenterLeafHeaders=Le(()=>[e.getCenterFlatHeaders()],n=>n.filter(r=>{var o;return!((o=r.subHeaders)!=null&&o.length)}),$e(e.options,hn)),e.getLeftLeafHeaders=Le(()=>[e.getLeftFlatHeaders()],n=>n.filter(r=>{var o;return!((o=r.subHeaders)!=null&&o.length)}),$e(e.options,hn)),e.getRightLeafHeaders=Le(()=>[e.getRightFlatHeaders()],n=>n.filter(r=>{var o;return!((o=r.subHeaders)!=null&&o.length)}),$e(e.options,hn)),e.getLeafHeaders=Le(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(n,r,o)=>{var s,l,u,d,p,h;return[...(s=(l=n[0])==null?void 0:l.headers)!=null?s:[],...(u=(d=r[0])==null?void 0:d.headers)!=null?u:[],...(p=(h=o[0])==null?void 0:h.headers)!=null?p:[]].map(y=>y.getLeafHeaders()).flat()},$e(e.options,hn))}};function Gc(e,n,r,o){var s,l;let u=0;const d=function(b,x){x===void 0&&(x=1),u=Math.max(u,x),b.filter(C=>C.getIsVisible()).forEach(C=>{var _;(_=C.columns)!=null&&_.length&&d(C.columns,x+1)},0)};d(e);let p=[];const h=(b,x)=>{const C={depth:x,id:[o,`${x}`].filter(Boolean).join("_"),headers:[]},_=[];b.forEach(E=>{const T=[..._].reverse()[0],O=E.column.depth===C.depth;let A,z=!1;if(O&&E.column.parent?A=E.column.parent:(A=E.column,z=!0),T&&T?.column===A)T.subHeaders.push(E);else{const L=dx(r,A,{id:[o,x,A.id,E?.id].filter(Boolean).join("_"),isPlaceholder:z,placeholderId:z?`${_.filter(B=>B.column===A).length}`:void 0,depth:x,index:_.length});L.subHeaders.push(E),_.push(L)}C.headers.push(E),E.headerGroup=C}),p.push(C),x>0&&h(_,x-1)},y=n.map((b,x)=>dx(r,b,{depth:u,index:x}));h(y,u-1),p.reverse();const v=b=>b.filter(C=>C.column.getIsVisible()).map(C=>{let _=0,E=0,T=[0];C.subHeaders&&C.subHeaders.length?(T=[],v(C.subHeaders).forEach(A=>{let{colSpan:z,rowSpan:L}=A;_+=z,T.push(L)})):_=1;const O=Math.min(...T);return E=E+O,C.colSpan=_,C.rowSpan=E,{colSpan:_,rowSpan:E}});return v((s=(l=p[0])==null?void 0:l.headers)!=null?s:[]),p}const g3=(e,n,r,o,s,l,u)=>{let d={id:n,index:o,original:r,depth:s,parentId:u,_valuesCache:{},_uniqueValuesCache:{},getValue:p=>{if(d._valuesCache.hasOwnProperty(p))return d._valuesCache[p];const h=e.getColumn(p);if(h!=null&&h.accessorFn)return d._valuesCache[p]=h.accessorFn(d.original,o),d._valuesCache[p]},getUniqueValues:p=>{if(d._uniqueValuesCache.hasOwnProperty(p))return d._uniqueValuesCache[p];const h=e.getColumn(p);if(h!=null&&h.accessorFn)return h.columnDef.getUniqueValues?(d._uniqueValuesCache[p]=h.columnDef.getUniqueValues(d.original,o),d._uniqueValuesCache[p]):(d._uniqueValuesCache[p]=[d.getValue(p)],d._uniqueValuesCache[p])},renderValue:p=>{var h;return(h=d.getValue(p))!=null?h:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>f3(d.subRows,p=>p.subRows),getParentRow:()=>d.parentId?e.getRow(d.parentId,!0):void 0,getParentRows:()=>{let p=[],h=d;for(;;){const y=h.getParentRow();if(!y)break;p.push(y),h=y}return p.reverse()},getAllCells:Le(()=>[e.getAllLeafColumns()],p=>p.map(h=>h3(e,d,h,h.id)),$e(e.options,"debugRows")),_getAllCellsByColumnId:Le(()=>[d.getAllCells()],p=>p.reduce((h,y)=>(h[y.column.id]=y,h),{}),$e(e.options,"debugRows"))};for(let p=0;p{e._getFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():n.getPreFilteredRowModel(),e._getFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},C_=(e,n,r)=>{var o,s;const l=r==null||(o=r.toString())==null?void 0:o.toLowerCase();return!!(!((s=e.getValue(n))==null||(s=s.toString())==null||(s=s.toLowerCase())==null)&&s.includes(l))};C_.autoRemove=e=>gr(e);const E_=(e,n,r)=>{var o;return!!(!((o=e.getValue(n))==null||(o=o.toString())==null)&&o.includes(r))};E_.autoRemove=e=>gr(e);const R_=(e,n,r)=>{var o;return((o=e.getValue(n))==null||(o=o.toString())==null?void 0:o.toLowerCase())===r?.toLowerCase()};R_.autoRemove=e=>gr(e);const T_=(e,n,r)=>{var o;return(o=e.getValue(n))==null?void 0:o.includes(r)};T_.autoRemove=e=>gr(e);const O_=(e,n,r)=>!r.some(o=>{var s;return!((s=e.getValue(n))!=null&&s.includes(o))});O_.autoRemove=e=>gr(e)||!(e!=null&&e.length);const j_=(e,n,r)=>r.some(o=>{var s;return(s=e.getValue(n))==null?void 0:s.includes(o)});j_.autoRemove=e=>gr(e)||!(e!=null&&e.length);const A_=(e,n,r)=>e.getValue(n)===r;A_.autoRemove=e=>gr(e);const M_=(e,n,r)=>e.getValue(n)==r;M_.autoRemove=e=>gr(e);const Bp=(e,n,r)=>{let[o,s]=r;const l=e.getValue(n);return l>=o&&l<=s};Bp.resolveFilterValue=e=>{let[n,r]=e,o=typeof n!="number"?parseFloat(n):n,s=typeof r!="number"?parseFloat(r):r,l=n===null||Number.isNaN(o)?-1/0:o,u=r===null||Number.isNaN(s)?1/0:s;if(l>u){const d=l;l=u,u=d}return[l,u]};Bp.autoRemove=e=>gr(e)||gr(e[0])&&gr(e[1]);const Wr={includesString:C_,includesStringSensitive:E_,equalsString:R_,arrIncludes:T_,arrIncludesAll:O_,arrIncludesSome:j_,equals:A_,weakEquals:M_,inNumberRange:Bp};function gr(e){return e==null||e===""}const y3={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Hn("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,n)=>{e.getAutoFilterFn=()=>{const r=n.getCoreRowModel().flatRows[0],o=r?.getValue(e.id);return typeof o=="string"?Wr.includesString:typeof o=="number"?Wr.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Wr.equals:Array.isArray(o)?Wr.arrIncludes:Wr.weakEquals},e.getFilterFn=()=>{var r,o;return Xu(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(r=(o=n.options.filterFns)==null?void 0:o[e.columnDef.filterFn])!=null?r:Wr[e.columnDef.filterFn]},e.getCanFilter=()=>{var r,o,s;return((r=e.columnDef.enableColumnFilter)!=null?r:!0)&&((o=n.options.enableColumnFilters)!=null?o:!0)&&((s=n.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var r;return(r=n.getState().columnFilters)==null||(r=r.find(o=>o.id===e.id))==null?void 0:r.value},e.getFilterIndex=()=>{var r,o;return(r=(o=n.getState().columnFilters)==null?void 0:o.findIndex(s=>s.id===e.id))!=null?r:-1},e.setFilterValue=r=>{n.setColumnFilters(o=>{const s=e.getFilterFn(),l=o?.find(y=>y.id===e.id),u=Ni(r,l?l.value:void 0);if(fx(s,u,e)){var d;return(d=o?.filter(y=>y.id!==e.id))!=null?d:[]}const p={id:e.id,value:u};if(l){var h;return(h=o?.map(y=>y.id===e.id?p:y))!=null?h:[]}return o!=null&&o.length?[...o,p]:[p]})}},createRow:(e,n)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=n=>{const r=e.getAllLeafColumns(),o=s=>{var l;return(l=Ni(n,s))==null?void 0:l.filter(u=>{const d=r.find(p=>p.id===u.id);if(d){const p=d.getFilterFn();if(fx(p,u.value,d))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(o)},e.resetColumnFilters=n=>{var r,o;e.setColumnFilters(n?[]:(r=(o=e.initialState)==null?void 0:o.columnFilters)!=null?r:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function fx(e,n,r){return(e&&e.autoRemove?e.autoRemove(n,r):!1)||typeof n>"u"||typeof n=="string"&&!n}const b3=(e,n,r)=>r.reduce((o,s)=>{const l=s.getValue(e);return o+(typeof l=="number"?l:0)},0),x3=(e,n,r)=>{let o;return r.forEach(s=>{const l=s.getValue(e);l!=null&&(o>l||o===void 0&&l>=l)&&(o=l)}),o},w3=(e,n,r)=>{let o;return r.forEach(s=>{const l=s.getValue(e);l!=null&&(o=l)&&(o=l)}),o},S3=(e,n,r)=>{let o,s;return r.forEach(l=>{const u=l.getValue(e);u!=null&&(o===void 0?u>=u&&(o=s=u):(o>u&&(o=u),s{let r=0,o=0;if(n.forEach(s=>{let l=s.getValue(e);l!=null&&(l=+l)>=l&&(++r,o+=l)}),r)return o/r},C3=(e,n)=>{if(!n.length)return;const r=n.map(l=>l.getValue(e));if(!d3(r))return;if(r.length===1)return r[0];const o=Math.floor(r.length/2),s=r.sort((l,u)=>l-u);return r.length%2!==0?s[o]:(s[o-1]+s[o])/2},E3=(e,n)=>Array.from(new Set(n.map(r=>r.getValue(e))).values()),R3=(e,n)=>new Set(n.map(r=>r.getValue(e))).size,T3=(e,n)=>n.length,Ph={sum:b3,min:x3,max:w3,extent:S3,mean:_3,median:C3,unique:E3,uniqueCount:R3,count:T3},O3={getDefaultColumnDef:()=>({aggregatedCell:e=>{var n,r;return(n=(r=e.getValue())==null||r.toString==null?void 0:r.toString())!=null?n:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Hn("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,n)=>{e.toggleGrouping=()=>{n.setGrouping(r=>r!=null&&r.includes(e.id)?r.filter(o=>o!==e.id):[...r??[],e.id])},e.getCanGroup=()=>{var r,o;return((r=e.columnDef.enableGrouping)!=null?r:!0)&&((o=n.options.enableGrouping)!=null?o:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var r;return(r=n.getState().grouping)==null?void 0:r.includes(e.id)},e.getGroupedIndex=()=>{var r;return(r=n.getState().grouping)==null?void 0:r.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const r=e.getCanGroup();return()=>{r&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const r=n.getCoreRowModel().flatRows[0],o=r?.getValue(e.id);if(typeof o=="number")return Ph.sum;if(Object.prototype.toString.call(o)==="[object Date]")return Ph.extent},e.getAggregationFn=()=>{var r,o;if(!e)throw new Error;return Xu(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(r=(o=n.options.aggregationFns)==null?void 0:o[e.columnDef.aggregationFn])!=null?r:Ph[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=n=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(n),e.resetGrouping=n=>{var r,o;e.setGrouping(n?[]:(r=(o=e.initialState)==null?void 0:o.grouping)!=null?r:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,n)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=r=>{if(e._groupingValuesCache.hasOwnProperty(r))return e._groupingValuesCache[r];const o=n.getColumn(r);return o!=null&&o.columnDef.getGroupingValue?(e._groupingValuesCache[r]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[r]):e.getValue(r)},e._groupingValuesCache={}},createCell:(e,n,r,o)=>{e.getIsGrouped=()=>n.getIsGrouped()&&n.id===r.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&n.getIsGrouped(),e.getIsAggregated=()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=r.subRows)!=null&&s.length)}}};function j3(e,n,r){if(!(n!=null&&n.length)||!r)return e;const o=e.filter(l=>!n.includes(l.id));return r==="remove"?o:[...n.map(l=>e.find(u=>u.id===l)).filter(Boolean),...o]}const A3={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Hn("columnOrder",e)}),createColumn:(e,n)=>{e.getIndex=Le(r=>[Qs(n,r)],r=>r.findIndex(o=>o.id===e.id),$e(n.options,"debugColumns")),e.getIsFirstColumn=r=>{var o;return((o=Qs(n,r)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=r=>{var o;const s=Qs(n,r);return((o=s[s.length-1])==null?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=n=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(n),e.resetColumnOrder=n=>{var r;e.setColumnOrder(n?[]:(r=e.initialState.columnOrder)!=null?r:[])},e._getOrderColumnsFn=Le(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(n,r,o)=>s=>{let l=[];if(!(n!=null&&n.length))l=s;else{const u=[...n],d=[...s];for(;d.length&&u.length;){const p=u.shift(),h=d.findIndex(y=>y.id===p);h>-1&&l.push(d.splice(h,1)[0])}l=[...l,...d]}return j3(l,r,o)},$e(e.options,"debugTable"))}},Uh=()=>({left:[],right:[]}),M3={getInitialState:e=>({columnPinning:Uh(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Hn("columnPinning",e)}),createColumn:(e,n)=>{e.pin=r=>{const o=e.getLeafColumns().map(s=>s.id).filter(Boolean);n.setColumnPinning(s=>{var l,u;if(r==="right"){var d,p;return{left:((d=s?.left)!=null?d:[]).filter(v=>!(o!=null&&o.includes(v))),right:[...((p=s?.right)!=null?p:[]).filter(v=>!(o!=null&&o.includes(v))),...o]}}if(r==="left"){var h,y;return{left:[...((h=s?.left)!=null?h:[]).filter(v=>!(o!=null&&o.includes(v))),...o],right:((y=s?.right)!=null?y:[]).filter(v=>!(o!=null&&o.includes(v)))}}return{left:((l=s?.left)!=null?l:[]).filter(v=>!(o!=null&&o.includes(v))),right:((u=s?.right)!=null?u:[]).filter(v=>!(o!=null&&o.includes(v)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var s,l,u;return((s=o.columnDef.enablePinning)!=null?s:!0)&&((l=(u=n.options.enableColumnPinning)!=null?u:n.options.enablePinning)!=null?l:!0)}),e.getIsPinned=()=>{const r=e.getLeafColumns().map(d=>d.id),{left:o,right:s}=n.getState().columnPinning,l=r.some(d=>o?.includes(d)),u=r.some(d=>s?.includes(d));return l?"left":u?"right":!1},e.getPinnedIndex=()=>{var r,o;const s=e.getIsPinned();return s?(r=(o=n.getState().columnPinning)==null||(o=o[s])==null?void 0:o.indexOf(e.id))!=null?r:-1:0}},createRow:(e,n)=>{e.getCenterVisibleCells=Le(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left,n.getState().columnPinning.right],(r,o,s)=>{const l=[...o??[],...s??[]];return r.filter(u=>!l.includes(u.column.id))},$e(n.options,"debugRows")),e.getLeftVisibleCells=Le(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left],(r,o)=>(o??[]).map(l=>r.find(u=>u.column.id===l)).filter(Boolean).map(l=>({...l,position:"left"})),$e(n.options,"debugRows")),e.getRightVisibleCells=Le(()=>[e._getAllVisibleCells(),n.getState().columnPinning.right],(r,o)=>(o??[]).map(l=>r.find(u=>u.column.id===l)).filter(Boolean).map(l=>({...l,position:"right"})),$e(n.options,"debugRows"))},createTable:e=>{e.setColumnPinning=n=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(n),e.resetColumnPinning=n=>{var r,o;return e.setColumnPinning(n?Uh():(r=(o=e.initialState)==null?void 0:o.columnPinning)!=null?r:Uh())},e.getIsSomeColumnsPinned=n=>{var r;const o=e.getState().columnPinning;if(!n){var s,l;return!!((s=o.left)!=null&&s.length||(l=o.right)!=null&&l.length)}return!!((r=o[n])!=null&&r.length)},e.getLeftLeafColumns=Le(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(s=>s.id===o)).filter(Boolean),$e(e.options,"debugColumns")),e.getRightLeafColumns=Le(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(s=>s.id===o)).filter(Boolean),$e(e.options,"debugColumns")),e.getCenterLeafColumns=Le(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,o)=>{const s=[...r??[],...o??[]];return n.filter(l=>!s.includes(l.id))},$e(e.options,"debugColumns"))}};function N3(e){return e||(typeof document<"u"?document:null)}const Zc={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Hh=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),D3={getDefaultColumnDef:()=>Zc,getInitialState:e=>({columnSizing:{},columnSizingInfo:Hh(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Hn("columnSizing",e),onColumnSizingInfoChange:Hn("columnSizingInfo",e)}),createColumn:(e,n)=>{e.getSize=()=>{var r,o,s;const l=n.getState().columnSizing[e.id];return Math.min(Math.max((r=e.columnDef.minSize)!=null?r:Zc.minSize,(o=l??e.columnDef.size)!=null?o:Zc.size),(s=e.columnDef.maxSize)!=null?s:Zc.maxSize)},e.getStart=Le(r=>[r,Qs(n,r),n.getState().columnSizing],(r,o)=>o.slice(0,e.getIndex(r)).reduce((s,l)=>s+l.getSize(),0),$e(n.options,"debugColumns")),e.getAfter=Le(r=>[r,Qs(n,r),n.getState().columnSizing],(r,o)=>o.slice(e.getIndex(r)+1).reduce((s,l)=>s+l.getSize(),0),$e(n.options,"debugColumns")),e.resetSize=()=>{n.setColumnSizing(r=>{let{[e.id]:o,...s}=r;return s})},e.getCanResize=()=>{var r,o;return((r=e.columnDef.enableResizing)!=null?r:!0)&&((o=n.options.enableColumnResizing)!=null?o:!0)},e.getIsResizing=()=>n.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,n)=>{e.getSize=()=>{let r=0;const o=s=>{if(s.subHeaders.length)s.subHeaders.forEach(o);else{var l;r+=(l=s.column.getSize())!=null?l:0}};return o(e),r},e.getStart=()=>{if(e.index>0){const r=e.headerGroup.headers[e.index-1];return r.getStart()+r.getSize()}return 0},e.getResizeHandler=r=>{const o=n.getColumn(e.column.id),s=o?.getCanResize();return l=>{if(!o||!s||(l.persist==null||l.persist(),Bh(l)&&l.touches&&l.touches.length>1))return;const u=e.getSize(),d=e?e.getLeafHeaders().map(T=>[T.column.id,T.column.getSize()]):[[o.id,o.getSize()]],p=Bh(l)?Math.round(l.touches[0].clientX):l.clientX,h={},y=(T,O)=>{typeof O=="number"&&(n.setColumnSizingInfo(A=>{var z,L;const B=n.options.columnResizeDirection==="rtl"?-1:1,H=(O-((z=A?.startOffset)!=null?z:0))*B,I=Math.max(H/((L=A?.startSize)!=null?L:0),-.999999);return A.columnSizingStart.forEach(ne=>{let[ve,fe]=ne;h[ve]=Math.round(Math.max(fe+fe*I,0)*100)/100}),{...A,deltaOffset:H,deltaPercentage:I}}),(n.options.columnResizeMode==="onChange"||T==="end")&&n.setColumnSizing(A=>({...A,...h})))},v=T=>y("move",T),b=T=>{y("end",T),n.setColumnSizingInfo(O=>({...O,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},x=N3(r),C={moveHandler:T=>v(T.clientX),upHandler:T=>{x?.removeEventListener("mousemove",C.moveHandler),x?.removeEventListener("mouseup",C.upHandler),b(T.clientX)}},_={moveHandler:T=>(T.cancelable&&(T.preventDefault(),T.stopPropagation()),v(T.touches[0].clientX),!1),upHandler:T=>{var O;x?.removeEventListener("touchmove",_.moveHandler),x?.removeEventListener("touchend",_.upHandler),T.cancelable&&(T.preventDefault(),T.stopPropagation()),b((O=T.touches[0])==null?void 0:O.clientX)}},E=z3()?{passive:!1}:!1;Bh(l)?(x?.addEventListener("touchmove",_.moveHandler,E),x?.addEventListener("touchend",_.upHandler,E)):(x?.addEventListener("mousemove",C.moveHandler,E),x?.addEventListener("mouseup",C.upHandler,E)),n.setColumnSizingInfo(T=>({...T,startOffset:p,startSize:u,deltaOffset:0,deltaPercentage:0,columnSizingStart:d,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=n=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(n),e.setColumnSizingInfo=n=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(n),e.resetColumnSizing=n=>{var r;e.setColumnSizing(n?{}:(r=e.initialState.columnSizing)!=null?r:{})},e.resetHeaderSizeInfo=n=>{var r;e.setColumnSizingInfo(n?Hh():(r=e.initialState.columnSizingInfo)!=null?r:Hh())},e.getTotalSize=()=>{var n,r;return(n=(r=e.getHeaderGroups()[0])==null?void 0:r.headers.reduce((o,s)=>o+s.getSize(),0))!=null?n:0},e.getLeftTotalSize=()=>{var n,r;return(n=(r=e.getLeftHeaderGroups()[0])==null?void 0:r.headers.reduce((o,s)=>o+s.getSize(),0))!=null?n:0},e.getCenterTotalSize=()=>{var n,r;return(n=(r=e.getCenterHeaderGroups()[0])==null?void 0:r.headers.reduce((o,s)=>o+s.getSize(),0))!=null?n:0},e.getRightTotalSize=()=>{var n,r;return(n=(r=e.getRightHeaderGroups()[0])==null?void 0:r.headers.reduce((o,s)=>o+s.getSize(),0))!=null?n:0}}};let Kc=null;function z3(){if(typeof Kc=="boolean")return Kc;let e=!1;try{const n={get passive(){return e=!0,!1}},r=()=>{};window.addEventListener("test",r,n),window.removeEventListener("test",r)}catch{e=!1}return Kc=e,Kc}function Bh(e){return e.type==="touchstart"}const k3={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Hn("columnVisibility",e)}),createColumn:(e,n)=>{e.toggleVisibility=r=>{e.getCanHide()&&n.setColumnVisibility(o=>({...o,[e.id]:r??!e.getIsVisible()}))},e.getIsVisible=()=>{var r,o;const s=e.columns;return(r=s.length?s.some(l=>l.getIsVisible()):(o=n.getState().columnVisibility)==null?void 0:o[e.id])!=null?r:!0},e.getCanHide=()=>{var r,o;return((r=e.columnDef.enableHiding)!=null?r:!0)&&((o=n.options.enableHiding)!=null?o:!0)},e.getToggleVisibilityHandler=()=>r=>{e.toggleVisibility==null||e.toggleVisibility(r.target.checked)}},createRow:(e,n)=>{e._getAllVisibleCells=Le(()=>[e.getAllCells(),n.getState().columnVisibility],r=>r.filter(o=>o.column.getIsVisible()),$e(n.options,"debugRows")),e.getVisibleCells=Le(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(r,o,s)=>[...r,...o,...s],$e(n.options,"debugRows"))},createTable:e=>{const n=(r,o)=>Le(()=>[o(),o().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(l=>l.getIsVisible==null?void 0:l.getIsVisible()),$e(e.options,"debugColumns"));e.getVisibleFlatColumns=n("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=n("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=n("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=n("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=n("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=r=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(r),e.resetColumnVisibility=r=>{var o;e.setColumnVisibility(r?{}:(o=e.initialState.columnVisibility)!=null?o:{})},e.toggleAllColumnsVisible=r=>{var o;r=(o=r)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,l)=>({...s,[l.id]:r||!(l.getCanHide!=null&&l.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(r=>!(r.getIsVisible!=null&&r.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(r=>r.getIsVisible==null?void 0:r.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>r=>{var o;e.toggleAllColumnsVisible((o=r.target)==null?void 0:o.checked)}}};function Qs(e,n){return n?n==="center"?e.getCenterVisibleLeafColumns():n==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const L3={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},$3={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Hn("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:n=>{var r;const o=(r=e.getCoreRowModel().flatRows[0])==null||(r=r._getAllCellsByColumnId()[n.id])==null?void 0:r.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,n)=>{e.getCanGlobalFilter=()=>{var r,o,s,l;return((r=e.columnDef.enableGlobalFilter)!=null?r:!0)&&((o=n.options.enableGlobalFilter)!=null?o:!0)&&((s=n.options.enableFilters)!=null?s:!0)&&((l=n.options.getColumnCanGlobalFilter==null?void 0:n.options.getColumnCanGlobalFilter(e))!=null?l:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Wr.includesString,e.getGlobalFilterFn=()=>{var n,r;const{globalFilterFn:o}=e.options;return Xu(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(n=(r=e.options.filterFns)==null?void 0:r[o])!=null?n:Wr[o]},e.setGlobalFilter=n=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(n)},e.resetGlobalFilter=n=>{e.setGlobalFilter(n?void 0:e.initialState.globalFilter)}}},I3={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Hn("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let n=!1,r=!1;e._autoResetExpanded=()=>{var o,s;if(!n){e._queue(()=>{n=!0});return}if((o=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(r)return;r=!0,e._queue(()=>{e.resetExpanded(),r=!1})}},e.setExpanded=o=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(o),e.toggleAllRowsExpanded=o=>{o??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=o=>{var s,l;e.setExpanded(o?{}:(s=(l=e.initialState)==null?void 0:l.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const o=e.getState().expanded;return o===!0||Object.values(o).some(Boolean)},e.getIsAllRowsExpanded=()=>{const o=e.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let o=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(l=>{const u=l.split(".");o=Math.max(o,u.length)}),o},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,n)=>{e.toggleExpanded=r=>{n.setExpanded(o=>{var s;const l=o===!0?!0:!!(o!=null&&o[e.id]);let u={};if(o===!0?Object.keys(n.getRowModel().rowsById).forEach(d=>{u[d]=!0}):u=o,r=(s=r)!=null?s:!l,!l&&r)return{...u,[e.id]:!0};if(l&&!r){const{[e.id]:d,...p}=u;return p}return o})},e.getIsExpanded=()=>{var r;const o=n.getState().expanded;return!!((r=n.options.getIsRowExpanded==null?void 0:n.options.getIsRowExpanded(e))!=null?r:o===!0||o?.[e.id])},e.getCanExpand=()=>{var r,o,s;return(r=n.options.getRowCanExpand==null?void 0:n.options.getRowCanExpand(e))!=null?r:((o=n.options.enableExpanding)!=null?o:!0)&&!!((s=e.subRows)!=null&&s.length)},e.getIsAllParentsExpanded=()=>{let r=!0,o=e;for(;r&&o.parentId;)o=n.getRow(o.parentId,!0),r=o.getIsExpanded();return r},e.getToggleExpandedHandler=()=>{const r=e.getCanExpand();return()=>{r&&e.toggleExpanded()}}}},Om=0,jm=10,qh=()=>({pageIndex:Om,pageSize:jm}),V3={getInitialState:e=>({...e,pagination:{...qh(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Hn("pagination",e)}),createTable:e=>{let n=!1,r=!1;e._autoResetPageIndex=()=>{var o,s;if(!n){e._queue(()=>{n=!0});return}if((o=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(r)return;r=!0,e._queue(()=>{e.resetPageIndex(),r=!1})}},e.setPagination=o=>{const s=l=>Ni(o,l);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=o=>{var s;e.setPagination(o?qh():(s=e.initialState.pagination)!=null?s:qh())},e.setPageIndex=o=>{e.setPagination(s=>{let l=Ni(o,s.pageIndex);const u=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return l=Math.max(0,Math.min(l,u)),{...s,pageIndex:l}})},e.resetPageIndex=o=>{var s,l;e.setPageIndex(o?Om:(s=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageIndex)!=null?s:Om)},e.resetPageSize=o=>{var s,l;e.setPageSize(o?jm:(s=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageSize)!=null?s:jm)},e.setPageSize=o=>{e.setPagination(s=>{const l=Math.max(1,Ni(o,s.pageSize)),u=s.pageSize*s.pageIndex,d=Math.floor(u/l);return{...s,pageIndex:d,pageSize:l}})},e.setPageCount=o=>e.setPagination(s=>{var l;let u=Ni(o,(l=e.options.pageCount)!=null?l:-1);return typeof u=="number"&&(u=Math.max(-1,u)),{...s,pageCount:u}}),e.getPageOptions=Le(()=>[e.getPageCount()],o=>{let s=[];return o&&o>0&&(s=[...new Array(o)].fill(null).map((l,u)=>u)),s},$e(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:o}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:oe.setPageIndex(o=>o-1),e.nextPage=()=>e.setPageIndex(o=>o+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var o;return(o=e.options.pageCount)!=null?o:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var o;return(o=e.options.rowCount)!=null?o:e.getPrePaginationRowModel().rows.length}}},Gh=()=>({top:[],bottom:[]}),F3={getInitialState:e=>({rowPinning:Gh(),...e}),getDefaultOptions:e=>({onRowPinningChange:Hn("rowPinning",e)}),createRow:(e,n)=>{e.pin=(r,o,s)=>{const l=o?e.getLeafRows().map(p=>{let{id:h}=p;return h}):[],u=s?e.getParentRows().map(p=>{let{id:h}=p;return h}):[],d=new Set([...u,e.id,...l]);n.setRowPinning(p=>{var h,y;if(r==="bottom"){var v,b;return{top:((v=p?.top)!=null?v:[]).filter(_=>!(d!=null&&d.has(_))),bottom:[...((b=p?.bottom)!=null?b:[]).filter(_=>!(d!=null&&d.has(_))),...Array.from(d)]}}if(r==="top"){var x,C;return{top:[...((x=p?.top)!=null?x:[]).filter(_=>!(d!=null&&d.has(_))),...Array.from(d)],bottom:((C=p?.bottom)!=null?C:[]).filter(_=>!(d!=null&&d.has(_)))}}return{top:((h=p?.top)!=null?h:[]).filter(_=>!(d!=null&&d.has(_))),bottom:((y=p?.bottom)!=null?y:[]).filter(_=>!(d!=null&&d.has(_)))}})},e.getCanPin=()=>{var r;const{enableRowPinning:o,enablePinning:s}=n.options;return typeof o=="function"?o(e):(r=o??s)!=null?r:!0},e.getIsPinned=()=>{const r=[e.id],{top:o,bottom:s}=n.getState().rowPinning,l=r.some(d=>o?.includes(d)),u=r.some(d=>s?.includes(d));return l?"top":u?"bottom":!1},e.getPinnedIndex=()=>{var r,o;const s=e.getIsPinned();if(!s)return-1;const l=(r=s==="top"?n.getTopRows():n.getBottomRows())==null?void 0:r.map(u=>{let{id:d}=u;return d});return(o=l?.indexOf(e.id))!=null?o:-1}},createTable:e=>{e.setRowPinning=n=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(n),e.resetRowPinning=n=>{var r,o;return e.setRowPinning(n?Gh():(r=(o=e.initialState)==null?void 0:o.rowPinning)!=null?r:Gh())},e.getIsSomeRowsPinned=n=>{var r;const o=e.getState().rowPinning;if(!n){var s,l;return!!((s=o.top)!=null&&s.length||(l=o.bottom)!=null&&l.length)}return!!((r=o[n])!=null&&r.length)},e._getPinnedRows=(n,r,o)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(r??[]).map(u=>{const d=e.getRow(u,!0);return d.getIsAllParentsExpanded()?d:null}):(r??[]).map(u=>n.find(d=>d.id===u))).filter(Boolean).map(u=>({...u,position:o}))},e.getTopRows=Le(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(n,r)=>e._getPinnedRows(n,r,"top"),$e(e.options,"debugRows")),e.getBottomRows=Le(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(n,r)=>e._getPinnedRows(n,r,"bottom"),$e(e.options,"debugRows")),e.getCenterRows=Le(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(n,r,o)=>{const s=new Set([...r??[],...o??[]]);return n.filter(l=>!s.has(l.id))},$e(e.options,"debugRows"))}},P3={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Hn("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=n=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(n),e.resetRowSelection=n=>{var r;return e.setRowSelection(n?{}:(r=e.initialState.rowSelection)!=null?r:{})},e.toggleAllRowsSelected=n=>{e.setRowSelection(r=>{n=typeof n<"u"?n:!e.getIsAllRowsSelected();const o={...r},s=e.getPreGroupedRowModel().flatRows;return n?s.forEach(l=>{l.getCanSelect()&&(o[l.id]=!0)}):s.forEach(l=>{delete o[l.id]}),o})},e.toggleAllPageRowsSelected=n=>e.setRowSelection(r=>{const o=typeof n<"u"?n:!e.getIsAllPageRowsSelected(),s={...r};return e.getRowModel().rows.forEach(l=>{Am(s,l.id,o,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Le(()=>[e.getState().rowSelection,e.getCoreRowModel()],(n,r)=>Object.keys(n).length?Zh(e,r):{rows:[],flatRows:[],rowsById:{}},$e(e.options,"debugTable")),e.getFilteredSelectedRowModel=Le(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(n,r)=>Object.keys(n).length?Zh(e,r):{rows:[],flatRows:[],rowsById:{}},$e(e.options,"debugTable")),e.getGroupedSelectedRowModel=Le(()=>[e.getState().rowSelection,e.getSortedRowModel()],(n,r)=>Object.keys(n).length?Zh(e,r):{rows:[],flatRows:[],rowsById:{}},$e(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const n=e.getFilteredRowModel().flatRows,{rowSelection:r}=e.getState();let o=!!(n.length&&Object.keys(r).length);return o&&n.some(s=>s.getCanSelect()&&!r[s.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:r}=e.getState();let o=!!n.length;return o&&n.some(s=>!r[s.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var n;const r=Object.keys((n=e.getState().rowSelection)!=null?n:{}).length;return r>0&&r{const n=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:n.filter(r=>r.getCanSelect()).some(r=>r.getIsSelected()||r.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>n=>{e.toggleAllRowsSelected(n.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>n=>{e.toggleAllPageRowsSelected(n.target.checked)}},createRow:(e,n)=>{e.toggleSelected=(r,o)=>{const s=e.getIsSelected();n.setRowSelection(l=>{var u;if(r=typeof r<"u"?r:!s,e.getCanSelect()&&s===r)return l;const d={...l};return Am(d,e.id,r,(u=o?.selectChildren)!=null?u:!0,n),d})},e.getIsSelected=()=>{const{rowSelection:r}=n.getState();return qp(e,r)},e.getIsSomeSelected=()=>{const{rowSelection:r}=n.getState();return Mm(e,r)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=n.getState();return Mm(e,r)==="all"},e.getCanSelect=()=>{var r;return typeof n.options.enableRowSelection=="function"?n.options.enableRowSelection(e):(r=n.options.enableRowSelection)!=null?r:!0},e.getCanSelectSubRows=()=>{var r;return typeof n.options.enableSubRowSelection=="function"?n.options.enableSubRowSelection(e):(r=n.options.enableSubRowSelection)!=null?r:!0},e.getCanMultiSelect=()=>{var r;return typeof n.options.enableMultiRowSelection=="function"?n.options.enableMultiRowSelection(e):(r=n.options.enableMultiRowSelection)!=null?r:!0},e.getToggleSelectedHandler=()=>{const r=e.getCanSelect();return o=>{var s;r&&e.toggleSelected((s=o.target)==null?void 0:s.checked)}}}},Am=(e,n,r,o,s)=>{var l;const u=s.getRow(n,!0);r?(u.getCanMultiSelect()||Object.keys(e).forEach(d=>delete e[d]),u.getCanSelect()&&(e[n]=!0)):delete e[n],o&&(l=u.subRows)!=null&&l.length&&u.getCanSelectSubRows()&&u.subRows.forEach(d=>Am(e,d.id,r,o,s))};function Zh(e,n){const r=e.getState().rowSelection,o=[],s={},l=function(u,d){return u.map(p=>{var h;const y=qp(p,r);if(y&&(o.push(p),s[p.id]=p),(h=p.subRows)!=null&&h.length&&(p={...p,subRows:l(p.subRows)}),y)return p}).filter(Boolean)};return{rows:l(n.rows),flatRows:o,rowsById:s}}function qp(e,n){var r;return(r=n[e.id])!=null?r:!1}function Mm(e,n,r){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let s=!0,l=!1;return e.subRows.forEach(u=>{if(!(l&&!s)&&(u.getCanSelect()&&(qp(u,n)?l=!0:s=!1),u.subRows&&u.subRows.length)){const d=Mm(u,n);d==="all"?l=!0:(d==="some"&&(l=!0),s=!1)}}),s?"all":l?"some":!1}const Nm=/([0-9]+)/gm,U3=(e,n,r)=>N_(Ui(e.getValue(r)).toLowerCase(),Ui(n.getValue(r)).toLowerCase()),H3=(e,n,r)=>N_(Ui(e.getValue(r)),Ui(n.getValue(r))),B3=(e,n,r)=>Gp(Ui(e.getValue(r)).toLowerCase(),Ui(n.getValue(r)).toLowerCase()),q3=(e,n,r)=>Gp(Ui(e.getValue(r)),Ui(n.getValue(r))),G3=(e,n,r)=>{const o=e.getValue(r),s=n.getValue(r);return o>s?1:oGp(e.getValue(r),n.getValue(r));function Gp(e,n){return e===n?0:e>n?1:-1}function Ui(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function N_(e,n){const r=e.split(Nm).filter(Boolean),o=n.split(Nm).filter(Boolean);for(;r.length&&o.length;){const s=r.shift(),l=o.shift(),u=parseInt(s,10),d=parseInt(l,10),p=[u,d].sort();if(isNaN(p[0])){if(s>l)return 1;if(l>s)return-1;continue}if(isNaN(p[1]))return isNaN(u)?-1:1;if(u>d)return 1;if(d>u)return-1}return r.length-o.length}const Ps={alphanumeric:U3,alphanumericCaseSensitive:H3,text:B3,textCaseSensitive:q3,datetime:G3,basic:Z3},K3={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Hn("sorting",e),isMultiSortEvent:n=>n.shiftKey}),createColumn:(e,n)=>{e.getAutoSortingFn=()=>{const r=n.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const s of r){const l=s?.getValue(e.id);if(Object.prototype.toString.call(l)==="[object Date]")return Ps.datetime;if(typeof l=="string"&&(o=!0,l.split(Nm).length>1))return Ps.alphanumeric}return o?Ps.text:Ps.basic},e.getAutoSortDir=()=>{const r=n.getFilteredRowModel().flatRows[0];return typeof r?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var r,o;if(!e)throw new Error;return Xu(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(r=(o=n.options.sortingFns)==null?void 0:o[e.columnDef.sortingFn])!=null?r:Ps[e.columnDef.sortingFn]},e.toggleSorting=(r,o)=>{const s=e.getNextSortingOrder(),l=typeof r<"u"&&r!==null;n.setSorting(u=>{const d=u?.find(x=>x.id===e.id),p=u?.findIndex(x=>x.id===e.id);let h=[],y,v=l?r:s==="desc";if(u!=null&&u.length&&e.getCanMultiSort()&&o?d?y="toggle":y="add":u!=null&&u.length&&p!==u.length-1?y="replace":d?y="toggle":y="replace",y==="toggle"&&(l||s||(y="remove")),y==="add"){var b;h=[...u,{id:e.id,desc:v}],h.splice(0,h.length-((b=n.options.maxMultiSortColCount)!=null?b:Number.MAX_SAFE_INTEGER))}else y==="toggle"?h=u.map(x=>x.id===e.id?{...x,desc:v}:x):y==="remove"?h=u.filter(x=>x.id!==e.id):h=[{id:e.id,desc:v}];return h})},e.getFirstSortDir=()=>{var r,o;return((r=(o=e.columnDef.sortDescFirst)!=null?o:n.options.sortDescFirst)!=null?r:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=r=>{var o,s;const l=e.getFirstSortDir(),u=e.getIsSorted();return u?u!==l&&((o=n.options.enableSortingRemoval)==null||o)&&(!(r&&(s=n.options.enableMultiRemove)!=null)||s)?!1:u==="desc"?"asc":"desc":l},e.getCanSort=()=>{var r,o;return((r=e.columnDef.enableSorting)!=null?r:!0)&&((o=n.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var r,o;return(r=(o=e.columnDef.enableMultiSort)!=null?o:n.options.enableMultiSort)!=null?r:!!e.accessorFn},e.getIsSorted=()=>{var r;const o=(r=n.getState().sorting)==null?void 0:r.find(s=>s.id===e.id);return o?o.desc?"desc":"asc":!1},e.getSortIndex=()=>{var r,o;return(r=(o=n.getState().sorting)==null?void 0:o.findIndex(s=>s.id===e.id))!=null?r:-1},e.clearSorting=()=>{n.setSorting(r=>r!=null&&r.length?r.filter(o=>o.id!==e.id):[])},e.getToggleSortingHandler=()=>{const r=e.getCanSort();return o=>{r&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?n.options.isMultiSortEvent==null?void 0:n.options.isMultiSortEvent(o):!1))}}},createTable:e=>{e.setSorting=n=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(n),e.resetSorting=n=>{var r,o;e.setSorting(n?[]:(r=(o=e.initialState)==null?void 0:o.sorting)!=null?r:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Y3=[p3,k3,A3,M3,v3,y3,L3,$3,K3,O3,I3,V3,F3,P3,D3];function Q3(e){var n,r;const o=[...Y3,...(n=e._features)!=null?n:[]];let s={_features:o};const l=s._features.reduce((b,x)=>Object.assign(b,x.getDefaultOptions==null?void 0:x.getDefaultOptions(s)),{}),u=b=>s.options.mergeOptions?s.options.mergeOptions(l,b):{...l,...b};let p={...{},...(r=e.initialState)!=null?r:{}};s._features.forEach(b=>{var x;p=(x=b.getInitialState==null?void 0:b.getInitialState(p))!=null?x:p});const h=[];let y=!1;const v={_features:o,options:{...l,...e},initialState:p,_queue:b=>{h.push(b),y||(y=!0,Promise.resolve().then(()=>{for(;h.length;)h.shift()();y=!1}).catch(x=>setTimeout(()=>{throw x})))},reset:()=>{s.setState(s.initialState)},setOptions:b=>{const x=Ni(b,s.options);s.options=u(x)},getState:()=>s.options.state,setState:b=>{s.options.onStateChange==null||s.options.onStateChange(b)},_getRowId:(b,x,C)=>{var _;return(_=s.options.getRowId==null?void 0:s.options.getRowId(b,x,C))!=null?_:`${C?[C.id,x].join("."):x}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(b,x)=>{let C=(x?s.getPrePaginationRowModel():s.getRowModel()).rowsById[b];if(!C&&(C=s.getCoreRowModel().rowsById[b],!C))throw new Error;return C},_getDefaultColumnDef:Le(()=>[s.options.defaultColumn],b=>{var x;return b=(x=b)!=null?x:{},{header:C=>{const _=C.header.column.columnDef;return _.accessorKey?_.accessorKey:_.accessorFn?_.id:null},cell:C=>{var _,E;return(_=(E=C.renderValue())==null||E.toString==null?void 0:E.toString())!=null?_:null},...s._features.reduce((C,_)=>Object.assign(C,_.getDefaultColumnDef==null?void 0:_.getDefaultColumnDef()),{}),...b}},$e(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:Le(()=>[s._getColumnDefs()],b=>{const x=function(C,_,E){return E===void 0&&(E=0),C.map(T=>{const O=m3(s,T,E,_),A=T;return O.columns=A.columns?x(A.columns,O,E+1):[],O})};return x(b)},$e(e,"debugColumns")),getAllFlatColumns:Le(()=>[s.getAllColumns()],b=>b.flatMap(x=>x.getFlatColumns()),$e(e,"debugColumns")),_getAllFlatColumnsById:Le(()=>[s.getAllFlatColumns()],b=>b.reduce((x,C)=>(x[C.id]=C,x),{}),$e(e,"debugColumns")),getAllLeafColumns:Le(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(b,x)=>{let C=b.flatMap(_=>_.getLeafColumns());return x(C)},$e(e,"debugColumns")),getColumn:b=>s._getAllFlatColumnsById()[b]};Object.assign(s,v);for(let b=0;bLe(()=>[e.options.data],n=>{const r={rows:[],flatRows:[],rowsById:{}},o=function(s,l,u){l===void 0&&(l=0);const d=[];for(let h=0;he._autoResetPageIndex()))}function z_(){return e=>Le(()=>[e.getState().sorting,e.getPreSortedRowModel()],(n,r)=>{if(!r.rows.length||!(n!=null&&n.length))return r;const o=e.getState().sorting,s=[],l=o.filter(p=>{var h;return(h=e.getColumn(p.id))==null?void 0:h.getCanSort()}),u={};l.forEach(p=>{const h=e.getColumn(p.id);h&&(u[p.id]={sortUndefined:h.columnDef.sortUndefined,invertSorting:h.columnDef.invertSorting,sortingFn:h.getSortingFn()})});const d=p=>{const h=p.map(y=>({...y}));return h.sort((y,v)=>{for(let x=0;x{var v;s.push(y),(v=y.subRows)!=null&&v.length&&(y.subRows=d(y.subRows))}),h};return{rows:d(r.rows),flatRows:s,rowsById:r.rowsById}},$e(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function Dm(e,n){return e?X3(e)?w.createElement(e,n):e:null}function X3(e){return J3(e)||typeof e=="function"||W3(e)}function J3(e){return typeof e=="function"&&(()=>{const n=Object.getPrototypeOf(e);return n.prototype&&n.prototype.isReactComponent})()}function W3(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function k_(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[r]=w.useState(()=>({current:Q3(n)})),[o,s]=w.useState(()=>r.current.initialState);return r.current.setOptions(l=>({...l,...e,state:{...o,...e.state},onStateChange:u=>{s(u),e.onStateChange==null||e.onStateChange(u)}})),r.current}var xl=e=>e.type==="checkbox",Di=e=>e instanceof Date,an=e=>e==null;const Zp=e=>typeof e=="object";var Ot=e=>!an(e)&&!Array.isArray(e)&&Zp(e)&&!Di(e),e4=e=>Ot(e)&&e.target?xl(e.target)?e.target.checked:e.target.value:e,t4=(e,n)=>n.split(".").some((r,o,s)=>!isNaN(Number(r))&&e.has(s.slice(0,o).join("."))),L_=e=>{const n=e.constructor&&e.constructor.prototype;return Ot(n)&&n.hasOwnProperty("isPrototypeOf")},Ju=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Nt(e){if(e instanceof Date)return new Date(e);const n=typeof FileList<"u"&&e instanceof FileList;if(Ju&&(e instanceof Blob||n))return e;const r=Array.isArray(e);if(!r&&!(Ot(e)&&L_(e)))return e;const o=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(o[s]=Nt(e[s]));return o}const Ea={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},pr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},hr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},$_="root",Kp=["__proto__","constructor","prototype"],n4=/^\w*$/;var wl=e=>n4.test(e),vt=e=>e===void 0;const r4=/[.[\]'"]/;var Wu=e=>e.split(r4).filter(Boolean),Se=(e,n,r)=>{if(!n||!Ot(e))return r;const o=wl(n)?[n]:Wu(n);if(o.some(l=>Kp.includes(l)))return r;const s=o.reduce((l,u)=>an(l)?void 0:l[u],e);return vt(s)||s===e?vt(e[n])?r:e[n]:s},Rr=e=>typeof e=="boolean",tr=e=>typeof e=="function",ut=(e,n,r)=>{let o=-1;const s=wl(n)?[n]:Wu(n),l=s.length,u=l-1;for(;++o{const s={};for(const l in e)Object.defineProperty(s,l,{get:()=>{const u=l;return n._proxyFormState[u]!==pr.all&&(n._proxyFormState[u]=!o||pr.all),e[u]}});return s};const a4=Ju?he.useLayoutEffect:he.useEffect;var ln=e=>typeof e=="string",s4=(e,n,r,o,s)=>ln(e)?(o&&n.watch.add(e),Se(r,e,s)):Array.isArray(e)?e.map(l=>(o&&n.watch.add(l),Se(r,l))):(o&&(n.watchAll=!0),r),zm=e=>an(e)||!Zp(e);const hx=(e,n)=>n.length===0&&!Array.isArray(e)&&!L_(e);function Tr(e,n,r=new WeakMap){if(e===n)return!0;if(zm(e)||zm(n))return Object.is(e,n);if(Di(e)&&Di(n))return Object.is(e.getTime(),n.getTime());const o=Object.keys(e),s=Object.keys(n);if(o.length!==s.length)return!1;if(hx(e,o)||hx(n,s))return Object.is(e,n);if(!o.length&&Array.isArray(e)!==Array.isArray(n))return!1;const l=r.get(e);if(l&&l.has(n))return!0;if(l)l.add(n);else{const u=new WeakSet;u.add(n),r.set(e,u)}for(const u of o){const d=e[u];if(!(u in n))return!1;if(u!=="ref"){const p=n[u];if(Di(d)&&Di(p)||(Ot(d)||Array.isArray(d))&&(Ot(p)||Array.isArray(p))?!Tr(d,p,r):!Object.is(d,p))return!1}}return!0}var Yc=e=>({isOnSubmit:!e||e===pr.onSubmit,isOnBlur:e===pr.onBlur,isOnChange:e===pr.onChange,isOnAll:e===pr.all,isOnTouch:e===pr.onTouched}),Kh=(e,n,r)=>{if(r)return!1;if(n.watchAll||n.watch.has(e))return!0;for(const o of n.watch)if(e.startsWith(o)&&e.charAt(o.length)===".")return!0;return!1};const Xs=(e,n,r,o)=>{for(const s of r||Object.keys(e)){const l=Se(e,s);if(l){const{_f:u,...d}=l;if(u){if(u.refs&&u.refs[0]&&n(u.refs[0],s)&&!o)return!0;if(u.ref&&n(u.ref,u.name)&&!o)return!0;if(Xs(d,n))break}else if(Ot(d)&&Xs(d,n))break}}};var mx=(e,n,r)=>{const o=Se(e,r),s=Array.isArray(o)?o:[];return ut(s,$_,n[r]),ut(e,r,s),e},on=e=>Ot(e)&&!Object.keys(e).length,Yp=e=>e.type==="file",bu=e=>{if(!Ju)return!1;const n=e?e.ownerDocument:0;return e instanceof(n&&n.defaultView?n.defaultView.HTMLElement:HTMLElement)},Qp=e=>e.type==="radio",xu=e=>e instanceof RegExp,Xp=(e,n,r,o,s)=>n?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[o]:s||!0}}:{};const px={value:!1,isValid:!1},gx={value:!0,isValid:!0};var I_=e=>{if(Array.isArray(e)){if(e.length>1){const n=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:n,isValid:!!n.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!vt(e[0].attributes.value)?vt(e[0].value)||e[0].value===""?gx:{value:e[0].value,isValid:!0}:gx:px}return px};const vx={isValid:!1,value:null};var V_=e=>Array.isArray(e)?e.reduce((n,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:n,vx):vx;function yx(e,n,r="validate"){if(ln(e)||Array.isArray(e)&&e.every(ln)||Rr(e)&&!e)return{type:r,message:ln(e)?e:"",ref:n}}var Ra=e=>Ot(e)&&!xu(e)?e:{value:e,message:""},bx=async(e,n,r,o,s,l)=>{const{ref:u,refs:d,required:p,maxLength:h,minLength:y,min:v,max:b,pattern:x,validate:C,name:_,valueAsNumber:E,mount:T}=e._f,O=Se(r,_);if(!T||n.has(_))return{};const A=d?d[0]:u,z=ce=>{if(s&&A.reportValidity){const le=Rr(ce)?"":ce||"";d?d.forEach(me=>me.setCustomValidity(le)):A.setCustomValidity(le),A.reportValidity()}},L={},B=Qp(u),H=xl(u),I=B||H,ne=(E||Yp(u))&&vt(u.value)&&vt(O)||bu(u)&&u.value===""||O===""||Array.isArray(O)&&!O.length,ve=Xp.bind(null,_,o,L),fe=(ce,le,me,xe=hr.maxLength,N=hr.minLength)=>{const Z=ce?le:me;L[_]={type:ce?xe:N,message:Z,ref:u,...ve(ce?xe:N,Z)}};if(l?!Array.isArray(O)||!O.length:p&&(!I&&(ne||an(O))||Rr(O)&&!O||H&&!I_(d).isValid||B&&!V_(d).isValid)){const{value:ce,message:le}=ln(p)?{value:!!p,message:p}:Ra(p);if(ce&&(L[_]={type:hr.required,message:le,ref:A,...ve(hr.required,le)},!o))return z(le),L}if(!ne&&(!an(v)||!an(b))){let ce,le;const me=Ra(b),xe=Ra(v);if(!an(O)&&!isNaN(O)){const N=u.valueAsNumber||O&&+O;an(me.value)||(ce=N>me.value),an(xe.value)||(le=Nnew Date(new Date().toDateString()+" "+ee),re=u.type=="time",W=u.type=="week";ln(me.value)&&O&&(ce=re?Z(O)>Z(me.value):W?O>me.value:N>new Date(me.value)),ln(xe.value)&&O&&(le=re?Z(O)+ce.value,xe=!an(le.value)&&O.length<+le.value;if((me||xe)&&(fe(me,ce.message,le.message),!o))return z(L[_].message),L}if(x&&!ne&&ln(O)){const{value:ce,message:le}=Ra(x);if(xu(ce)&&!O.match(ce)&&(L[_]={type:hr.pattern,message:le,ref:u,...ve(hr.pattern,le)},!o))return z(le),L}if(C){if(tr(C)){const ce=await C(O,r),le=yx(ce,A);if(le&&(L[_]={...le,...ve(hr.validate,le.message)},!o))return z(le.message),L}else if(Ot(C)){let ce={};for(const le in C){if(!on(ce)&&!o)break;const me=yx(await C[le](O,r),A,le);me&&(ce={...me,...ve(le,me.message)},z(me.message),o&&(L[_]=ce))}if(!on(ce)&&(L[_]={ref:A,...ce},!o))return L}}return z(!0),L},ou=e=>Array.isArray(e)?e:[e],F_=e=>Array.isArray(e)?e.filter(Boolean):[];function l4(e,n){const r=n.slice(0,-1).length;let o=0;for(;oKp.includes(String(u))))return e;const o=r.length===1?e:l4(e,r),s=r.length-1,l=r[s];return o&&delete o[l],s!==0&&(Ot(o)&&on(o)||Array.isArray(o)&&c4(o))&&Dt(e,r.slice(0,-1)),e}const P_=e=>{const n={};for(const r of Object.keys(e))if(Zp(e[r])&&e[r]!==null&&!Di(e[r])){const o=P_(e[r]);for(const s of Object.keys(o))n[`${r}.${s}`]=o[s]}else n[r]=e[r];return n},u4=he.createContext(null);u4.displayName="HookFormContext";var xx=()=>{let e=[];return{get observers(){return e},next:s=>{for(const l of e)l.next&&l.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(l=>l!==s)}}),unsubscribe:()=>{e=[]}}};function U_(e,n){const r={};for(const o in e)if(e.hasOwnProperty(o)){const s=e[o],l=n[o];if(s&&Ot(s)&&l){const u=U_(s,l);Ot(u)&&(r[o]=u)}else e[o]&&(r[o]=l)}return r}var H_=e=>e.type==="select-multiple",d4=e=>Qp(e)||xl(e),Yh=e=>bu(e)&&e.isConnected,f4=e=>{for(const n in e)if(tr(e[n]))return!0;return!1};function B_(e){return Array.isArray(e)||Ot(e)&&!f4(e)}function q_(e){return!!(e&&"_f"in e)}function G_(e){return Array.isArray(e)?!e.some(n=>!vt(n)):!Object.keys(e).length}function km(e,n){Array.isArray(e)?e[n]=void 0:delete e[n]}function Lm(e,n={},r){for(const o in e){const s=e[o],l=r&&r[o];B_(s)&&(!Array.isArray(s)||!q_(l))?(n[o]=Array.isArray(s)?[]:{},Lm(s,n[o],l),G_(n[o])&&km(n,o)):vt(s)||(n[o]=!0)}return n}function yo(e,n,r,o){r||(r=Lm(n,{},o));for(const s in e){const l=e[s],u=o&&o[s];B_(l)&&(!Array.isArray(l)||!q_(u))?(vt(n)||zm(r[s])?r[s]=Lm(l,Array.isArray(l)?[]:{},u):yo(l,an(n)?{}:n[s],r[s],u),G_(r[s])&&km(r,s)):Tr(l,n[s])?km(r,s):r[s]=!0}return r}var Z_=(e,{valueAsNumber:n,valueAsDate:r,setValueAs:o})=>vt(e)?e:n?e===""?NaN:e&&+e:r&&ln(e)?new Date(e):o?o(e):e;function wx(e){const n=e.ref;return Yp(n)?n.files:Qp(n)?V_(e.refs).value:H_(n)?[...n.selectedOptions].map(({value:r})=>r):xl(n)?I_(e.refs).value:Z_(vt(n.value)?e.ref.value:n.value,e)}var h4=(e,n,r,o)=>{const s={};for(const l of e){const u=Se(n,l);u&&ut(s,l,u._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:o}},Us=e=>vt(e)?e:xu(e)?e.source:Ot(e)?xu(e.value)?e.value.source:e.value:e;const Sx="AsyncFunction";var m4=e=>{if(!e||!e.validate)return!1;if(tr(e.validate))return e.validate.constructor.name===Sx;if(Ot(e.validate)){for(const n in e.validate)if(e.validate[n].constructor.name===Sx)return!0}return!1},p4=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function _x(e,n,r){const o=Se(e,r);if(o||wl(r))return{error:o,name:r};const s=r.split(".");for(;s.length;){const l=s.join("."),u=Se(n,l),d=Se(e,l);if(u&&!Array.isArray(u)&&r!==l)return{name:r};if(d&&d.type)return{name:l,error:d};if(d&&d.root&&d.root.type)return{name:`${l}.root`,error:d.root};s.pop()}return{name:r}}var g4=(e,n,r,o)=>{r(e);const{name:s,...l}=e,u=Object.keys(l);return!u.length||o&&u.length>=Object.keys(n).length||u.find(d=>n[d]===(!o||pr.all))},v4=(e,n,r)=>!e||!n||e===n||ou(e).some(o=>o&&(r?o===n||o.startsWith(n+"."):o.startsWith(n)||n.startsWith(o))),y4=(e,n,r,o,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(n||e):(r?o.isOnBlur:s.isOnBlur)?!e:(r?o.isOnChange:s.isOnChange)?e:!0,b4=(e,n)=>!F_(Se(e,n)).length&&Dt(e,n);const x4={mode:pr.onSubmit,reValidateMode:pr.onChange,shouldFocusError:!0},Qh="form",K_={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function w4(e={}){let n={...x4,...e},r={...Nt(K_),isLoading:tr(n.defaultValues),errors:n.errors||{},disabled:n.disabled||!1},o={},s=Ot(n.defaultValues)||Ot(n.values)?Nt(n.defaultValues||n.values)||{}:{},l=n.shouldUnregister?{}:Nt(s),u={action:!1,mount:!1,watch:!1,keepIsValid:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const p={},h={};let y=0,v=Yc(n.mode),b=Yc(n.reValidateMode);const x={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},C={...x};let _={...C};const E={array:xx(),state:xx()};let T=0;const O=n.criteriaMode===pr.all,A=(j,V)=>F=>{clearTimeout(h[j]),h[j]=setTimeout(V,F)},z=async j=>{if(!u.keepIsValid&&!n.disabled&&(C.isValid||_.isValid||j)){const V=++T;let F;n.resolver?(F=on((await me()).errors),V===T&&L()):F=await Z({fields:o,onlyCheckValid:!0,eventType:Ea.VALID}),V===T&&F!==r.isValid&&E.state.next({isValid:F})}},L=(j,V)=>{!n.disabled&&(C.isValidating||C.validatingFields||_.isValidating||_.validatingFields)&&((j||Array.from(d.mount)).forEach(F=>{F&&(V?ut(r.validatingFields,F,V):Dt(r.validatingFields,F))}),E.state.next({validatingFields:r.validatingFields,isValidating:!on(r.validatingFields)}))},B=()=>{r.dirtyFields=yo(s,l,void 0,o)},H=(j,V=[],F,se,de=!0,pe=!0)=>{if(se&&F&&!n.disabled){if(u.action=!0,pe&&Array.isArray(Se(o,j))){const be=F(Se(o,j),se.argA,se.argB);de&&ut(o,j,be)}if(pe&&Array.isArray(Se(r.errors,j))){const be=F(Se(r.errors,j),se.argA,se.argB);de&&ut(r.errors,j,be),b4(r.errors,j)}if((C.touchedFields||_.touchedFields)&&pe&&Array.isArray(Se(r.touchedFields,j))){const be=F(Se(r.touchedFields,j),se.argA,se.argB);de&&ut(r.touchedFields,j,be)}(C.dirtyFields||_.dirtyFields)&&B(),E.state.next({name:j,isDirty:W(j,V),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ut(l,j,V)},I=(j,V)=>{ut(r.errors,j,V),r.errors={...r.errors},E.state.next({errors:r.errors})},ne=j=>{r.errors=j,E.state.next({errors:r.errors,isValid:!1})},ve=j=>{const V=wl(j)?[j]:Wu(j);let F=l,se=s;for(let de=0;de{const de=Se(o,j);if(de){if(ve(j))return;const pe=vt(Se(l,j)),be=Se(l,j,vt(F)?Se(s,j):F);vt(be)||se&&se.defaultChecked||V?ut(l,j,V?be:wx(de._f)):M(j,be),u.mount&&!u.action&&(z(),pe&&r.isDirty&&(C.isDirty||_.isDirty)&&(W()||(r.isDirty=!1,E.state.next({...r}))),e.shouldUnregister&&pe&&!vt(Se(l,j))&&Kh(j,d)&&(u.watch=!0))}},ce=(j,V,F,se,de)=>{let pe=!1,be=!1;const we={name:j};if(!n.disabled||se===!0){if(!F||se){const Te=Tr(Se(s,j),V);(C.isDirty||_.isDirty)&&(be=r.isDirty,r.isDirty=we.isDirty=!Te||W(),pe=be!==we.isDirty),be=!!Se(r.dirtyFields,j),Te!==r.isDirty?r.dirtyFields=yo(s,l,void 0,o):Te?Dt(r.dirtyFields,j):ut(r.dirtyFields,j,!0),we.dirtyFields=r.dirtyFields,pe=pe||(C.dirtyFields||_.dirtyFields)&&be!==!Te}if(F){const Te=Se(r.touchedFields,j);Te||(ut(r.touchedFields,j,F),we.touchedFields=r.touchedFields,pe=pe||(C.touchedFields||_.touchedFields)&&Te!==F)}pe&&de&&E.state.next(we)}return pe?we:{}},le=(j,V,F,se)=>{const de=Se(r.errors,j),pe=(C.isValid||_.isValid)&&Rr(V)&&r.isValid!==V;if(n.delayError&&F?(p[j]=A(j,()=>I(j,F)),p[j](n.delayError)):(clearTimeout(h[j]),delete p[j],F?ut(r.errors,j,F):Dt(r.errors,j),r.errors={...r.errors}),(F?!Tr(de,F):de)||!on(se)||pe){const be={...se,...pe&&Rr(V)?{isValid:V}:{},errors:r.errors,name:j};r={...r,...be},E.state.next(be)}},me=async j=>(L(j,!0),await n.resolver(l,n.context,h4(j||d.mount,o,n.criteriaMode,n.shouldUseNativeValidation))),xe=async j=>{const{errors:V}=await me(j);if(L(j),j){for(const F of j){const se=Se(V,F);se?d.array.has(F)&&Ot(se)&&!Object.keys(se).some(de=>!Number.isNaN(Number(de)))?mx(r.errors,{[F]:se},F):ut(r.errors,F,se):Dt(r.errors,F)}r.errors={...r.errors}}else r.errors=V;return V},N=async({name:j,eventType:V})=>{if(e.validate){const F=await e.validate({formValues:l,formState:r,name:j,eventType:V});if(Ot(F))for(const se in F){const de=F[se];de&&ht(`${Qh}.${se}`,{message:ln(de.message)?de.message:"",type:de.type||hr.validate})}else ln(F)||!F?ht(Qh,{message:F||"",type:hr.validate}):Ue(Qh);return F}return!0},Z=async({fields:j,onlyCheckValid:V,name:F,eventType:se,context:de={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(de.runRootValidation=!0,!await N({name:F,eventType:se})&&(de.valid=!1,V)))return de.valid;for(const pe in j){const be=j[pe];if(be){const{_f:we,...Te}=be;if(we){const nt=d.array.has(we.name),St=be._f&&m4(be._f),Jt=C.validatingFields||C.isValidating||_.validatingFields||_.isValidating;St&&Jt&&L([we.name],!0);const Lt=await bx(be,d.disabled,l,O,n.shouldUseNativeValidation&&!V,nt);if(St&&Jt&&L([we.name]),Lt[we.name]&&(de.valid=!1,V)||(!V&&(Se(Lt,we.name)?nt?mx(r.errors,Lt,we.name):ut(r.errors,we.name,Lt[we.name]):Dt(r.errors,we.name)),e.shouldUseNativeValidation&&Lt[we.name]))break}!on(Te)&&await Z({context:de,onlyCheckValid:V,fields:Te,name:pe,eventType:se})}}return de.valid},re=()=>{for(const j of d.unMount){const V=Se(o,j);V&&(V._f.refs?V._f.refs.every(F=>!Yh(F)):!Yh(V._f.ref))&&Xt(j)}d.unMount=new Set},W=(j,V)=>(j&&V&&ut(l,j,V),!Tr(u.mount?l:s,s)),ee=(j,V,F)=>s4(j,d,{...u.mount?l:vt(V)?s:ln(j)?{[j]:V}:V},F,V),D=j=>F_(Se(u.mount?l:s,j,n.shouldUnregister?Se(s,j,[]):[])),M=(j,V,F={},se=!1,de=!1)=>{const pe=Se(o,j);let be=V;if(pe){const we=pe._f;we&&(!we.disabled&&ut(l,j,Z_(V,we)),be=bu(we.ref)&&an(V)?"":V,H_(we.ref)?[...we.ref.options].forEach(Te=>Te.selected=be.includes(Te.value)):we.refs?xl(we.ref)?we.refs.forEach(Te=>{(!Te.defaultChecked||!Te.disabled)&&(Array.isArray(be)?Te.checked=!!be.find(nt=>nt===Te.value):Te.checked=be===Te.value||!!be)}):we.refs.forEach(Te=>Te.checked=Te.value===be):Yp(we.ref)?we.ref.value="":(we.ref.value=be,!we.ref.type&&!de&&E.state.next({name:j,values:se?l:Nt(l)})))}(F.shouldDirty||F.shouldTouch)&&ce(j,be,F.shouldTouch,F.shouldDirty,!de),F.shouldValidate&&ye(j,{delayError:F.delayError})},U=(j,V,F,se=!1,de=!1)=>{for(const pe in V){if(!V.hasOwnProperty(pe))return;const be=V[pe],we=j+"."+pe,Te=Se(o,we);(d.array.has(j)||Ot(be)||Te&&!Te._f)&&!Di(be)?U(we,be,F,se,de):M(we,be,F,se,de)}},Q=(j,V,F,se,de=!1)=>{const pe=Se(o,j),be=d.array.has(j),we=se?V:Nt(V),Te=Se(l,j),nt=Tr(Te,we);if(nt||ut(l,j,we),be)E.array.next({name:j,values:se?l:Nt(l)}),(C.isDirty||C.dirtyFields||_.isDirty||_.dirtyFields)&&F.shouldDirty&&(B(),de||E.state.next({name:j,dirtyFields:r.dirtyFields,isDirty:W(j,we)}));else{const St=Array.isArray(we)&&!we.length||on(we);!pe||pe._f||an(we)||St?M(j,we,F,se,de):U(j,we,F,se,de)}if(!nt&&!de){const St=Kh(j,d),Jt=se?l:Nt(l);E.state.next({...St&&r,name:u.mount||St?j:void 0,values:Jt})}},K=(j,V,F={})=>Q(j,V,F,!1),ae=(j,V={})=>{const F=tr(j)?j(l):j;if(!Tr(l,F)){l={...l,...F};const se=P_(F);for(const de of d.mount)de in se&&Q(de,se[de],V,!0,!0);E.state.next({...r,name:void 0,type:void 0,...y?{values:l}:{}}),V.shouldValidate&&z()}},J=async j=>{u.mount=!0;const V=j.target;let F=V.name,se=!0;const de=Se(o,F),pe=be=>{se=Number.isNaN(be)||Di(be)&&isNaN(be.getTime())||Tr(be,Se(l,F,be))};if(de){let be,we;const Te=V.type?wx(de._f):e4(j),nt=j.type===Ea.BLUR||j.type===Ea.FOCUS_OUT,St=!p4(de._f)&&!e.validate&&!n.resolver&&!Se(r.errors,F)&&!de._f.deps,Jt=St||y4(nt,Se(r.touchedFields,F),r.isSubmitted,b,v),Lt=Kh(F,d,nt);if(ut(l,F,Te),nt){if(!V||!V.readOnly){de._f.onBlur&&de._f.onBlur(j);const bt=p[F];bt&&bt(0)}}else de._f.onChange&&de._f.onChange(j);const Me=ce(F,Te,nt),mt=!on(Me)||Lt;if(!nt&&E.state.next({name:F,type:j.type,...y?{values:Nt(l)}:{}}),Jt)return(!St||!r.isValid)&&(C.isValid||_.isValid)&&(n.mode==="onBlur"?nt&&z():nt||z()),mt&&E.state.next({name:F,...Lt?{}:Me});if(!n.resolver&&e.validate&&await N({name:F,eventType:j.type}),!nt&&Lt&&E.state.next({...r}),n.resolver){const{errors:bt}=await me([F]);if(L([F]),pe(Te),!se){!on(Me)&&E.state.next(Me);return}const Zt=_x(r.errors,o,F),sr=_x(bt,o,Zt.name||F);be=sr.error,F=sr.name,we=on(bt)}else L([F],!0),be=(await bx(de,d.disabled,l,O,n.shouldUseNativeValidation))[F],L([F]),pe(Te),se&&(be?we=!1:(C.isValid||_.isValid)&&(we=await Z({fields:o,onlyCheckValid:!0,name:F,eventType:j.type})));se&&(de._f.deps&&(!Array.isArray(de._f.deps)||de._f.deps.length>0)&&ye(de._f.deps),le(F,we,be,Me))}},ge=(j,V)=>{if(Se(r.errors,V)&&j.focus)return j.focus(),1},ye=async(j,V={})=>{let F,se;const de=ou(j);if(n.resolver){const pe=await xe(vt(j)?j:de);F=on(pe),se=j?!de.some(be=>Se(pe,be)):F}else j?(se=(await Promise.all(de.map(async pe=>{const be=Se(o,pe);return await Z({fields:be&&be._f?{[pe]:be}:be,eventType:Ea.TRIGGER})}))).every(Boolean),!(!se&&!r.isValid)&&z()):se=F=await Z({fields:o,name:j,eventType:Ea.TRIGGER});if(V.delayError&&n.delayError&&ln(j)){const pe=Se(r.errors,j);pe?(Dt(r.errors,j),p[j]=A(j,()=>I(j,pe)),p[j](n.delayError)):(clearTimeout(h[j]),delete p[j])}return E.state.next({...!ln(j)||(C.isValid||_.isValid)&&F!==r.isValid?{}:{name:j},...n.resolver||!j?{isValid:F}:{},errors:r.errors}),V.shouldFocus&&!se&&Xs(o,ge,j?de:d.mount),se},Ne=(j,V)=>{let F={...u.mount?l:s};return V&&(F=U_(V.dirtyFields?r.dirtyFields:r.touchedFields,F)),vt(j)?F:ln(j)?Se(F,j):j.map(se=>Se(F,se))},Fe=(j,V)=>({invalid:!!Se((V||r).errors,j),isDirty:!!Se((V||r).dirtyFields,j),error:Se((V||r).errors,j),isValidating:!!Se(r.validatingFields,j),isTouched:!!Se((V||r).touchedFields,j)}),Ue=j=>{const V=j?ou(j):void 0;V?.forEach(F=>Dt(r.errors,F)),V?V.forEach(F=>{E.state.next({name:F,errors:r.errors})}):E.state.next({errors:{}})},ht=(j,V,F)=>{const se=(Se(o,j,{_f:{}})._f||{}).ref,de=Se(r.errors,j)||{},{ref:pe,message:be,type:we,...Te}=de;ut(r.errors,j,{...Te,...V,ref:se}),E.state.next({name:j,errors:r.errors,isValid:!1}),F&&F.shouldFocus&&se&&se.focus&&se.focus()},Je=(j,V)=>{if(tr(j)){y++;const{unsubscribe:F}=E.state.subscribe({next:de=>"values"in de&&j(de.values||ee(void 0,V),de)});let se=!1;return{unsubscribe:()=>{se||(se=!0,y--,F())}}}return ee(j,V,!0)},xn=j=>{var V;const F=!!(!((V=j.formState)===null||V===void 0)&&V.values);F&&y++;const{unsubscribe:se}=E.state.subscribe({next:pe=>{if(v4(j.name,pe.name,j.exact)&&g4(pe,j.formState||C,oi,j.reRenderRoot)){const be={...l};j.callback({values:be,...r,...pe,defaultValues:s})}}});if(!F)return se;let de=!1;return()=>{de||(de=!0,y--,se())}},dn=j=>(u.mount=!0,_={..._,...j.formState},xn({...j,formState:{...x,...j.formState}})),Xt=(j,V={})=>{for(const F of j?ou(j):d.mount)d.mount.delete(F),d.array.delete(F),V.keepValue||(Dt(o,F),Dt(l,F)),!V.keepError&&Dt(r.errors,F),!V.keepDirty&&Dt(r.dirtyFields,F),!V.keepTouched&&Dt(r.touchedFields,F),!V.keepIsValidating&&Dt(r.validatingFields,F),!n.shouldUnregister&&!V.keepDefaultValue&&Dt(s,F);E.state.next({values:Nt(l)}),E.state.next({...r,...V.keepDirty?{isDirty:W()}:{}}),!V.keepIsValid&&z()},or=({disabled:j,name:V})=>{if(Rr(j)&&u.mount||j||d.disabled.has(V)){const de=d.disabled.has(V)!==!!j;j?d.disabled.add(V):d.disabled.delete(V),de&&u.mount&&!u.action&&z()}},Ht=(j,V={})=>{let F=Se(o,j);const se=Rr(V.disabled)||Rr(n.disabled),de=!d.registerName.has(j)&&F&&F._f&&!F._f.mount;return ut(o,j,{...F||{},_f:{...F&&F._f?F._f:{ref:{name:j}},name:j,mount:!0,...V}}),d.mount.add(j),F&&!de?or({disabled:Rr(V.disabled)?V.disabled:n.disabled,name:j}):fe(j,!0,V.value),{...se?{disabled:V.disabled||n.disabled}:{},...n.progressive?{required:!!V.required,min:Us(V.min),max:Us(V.max),minLength:Us(V.minLength),maxLength:Us(V.maxLength),pattern:Us(V.pattern)}:{},name:j,onChange:J,onBlur:J,ref:pe=>{if(pe){d.registerName.add(j),Ht(j,V),d.registerName.delete(j),F=Se(o,j);const be=vt(pe.value)&&pe.querySelectorAll&&pe.querySelectorAll("input,select,textarea")[0]||pe,we=d4(be),Te=F._f.refs||[];if(we?Te.find(nt=>nt===be):be===F._f.ref)return;ut(o,j,{_f:{...F._f,...we?{refs:[...Te.filter(Yh),be,...Array.isArray(Se(s,j))?[{}]:[]],ref:{type:be.type,name:j}}:{ref:be}}}),fe(j,!1,void 0,be)}else F=Se(o,j,{}),F._f&&(F._f.mount=!1),(n.shouldUnregister||V.shouldUnregister)&&!(t4(d.array,j)&&u.action)&&d.unMount.add(j)}}},ar=()=>n.shouldFocusError&&!n.shouldUseNativeValidation&&Xs(o,ge,d.mount),Bn=j=>{Rr(j)&&(E.state.next({disabled:j}),Xs(o,(V,F)=>{const se=Se(o,F);se&&(V.disabled=se._f.disabled||j,Array.isArray(se._f.refs)&&se._f.refs.forEach(de=>{de.disabled=se._f.disabled||j}))},0,!1))},zt=(j,V)=>async F=>{let se;F&&(F.preventDefault&&F.preventDefault(),F.persist&&F.persist());let de=Nt(l);if(E.state.next({isSubmitting:!0}),n.resolver){const{errors:pe,values:be}=await me();L(),r.errors=pe,de=Nt(be)}else await Z({fields:o,eventType:Ea.SUBMIT});if(d.disabled.size)for(const pe of d.disabled)Dt(de,pe);if(Dt(r.errors,$_),on(r.errors)){E.state.next({errors:{}});try{await j(de,F)}catch(pe){se=pe}}else V&&await V({...r.errors},F),ar(),setTimeout(ar);if(E.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:on(r.errors)&&!se,submitCount:r.submitCount+1,errors:r.errors}),se)throw se},pn=(j,V={})=>{Se(o,j)&&(vt(V.defaultValue)?K(j,Nt(Se(s,j))):(K(j,V.defaultValue),ut(s,j,Nt(V.defaultValue))),V.keepTouched||Dt(r.touchedFields,j),V.keepDirty||(Dt(r.dirtyFields,j),r.isDirty=V.defaultValue?W(j,Nt(Se(s,j))):W()),V.keepError||(Dt(r.errors,j),C.isValid&&z()),E.state.next({...r}))},jt=(j,V={})=>{const F=j?Nt(j):s,se=Nt(F),de=on(j),pe=se,be=o;if(V.keepDefaultValues||(s=F),!V.keepValues){if(V.keepDirtyValues){const we=new Set([...d.mount,...Object.keys(yo(s,l,void 0,be))]);for(const Te of Array.from(we)){const nt=Se(r.dirtyFields,Te),St=Se(l,Te),Jt=Se(pe,Te);nt&&!vt(St)?ut(pe,Te,St):!nt&&!vt(Jt)&&K(Te,Jt)}}else{if(Ju&&vt(j))for(const we of d.mount){const Te=Se(o,we);if(Te&&Te._f){const nt=Array.isArray(Te._f.refs)?Te._f.refs[0]:Te._f.ref;if(bu(nt)){const St=nt.closest("form");if(St){St.reset();break}}}}if(V.keepFieldsRef)for(const we of d.mount)K(we,Se(pe,we));else o={}}if(n.shouldUnregister){if(l=V.keepDefaultValues?Nt(s):{},V.keepFieldsRef)for(const we of d.mount)ut(l,we,Se(pe,we))}else l=Nt(pe);E.array.next({values:{...pe}}),E.state.next({name:void 0,type:void 0,values:{...pe}})}d={mount:V.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},u.mount=!C.isValid||!!V.keepIsValid||!!V.keepDirtyValues||!n.shouldUnregister&&!on(pe),u.watch=!!n.shouldUnregister,u.keepIsValid=!!V.keepIsValid,u.action=!1,V.keepErrors||(r.errors={}),E.state.next({submitCount:V.keepSubmitCount?r.submitCount:0,isDirty:de?!1:V.keepDirty?r.isDirty:V.keepValues?W():!!(V.keepDefaultValues&&!Tr(j,s)),isSubmitted:V.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:de?{}:V.keepDirtyValues?V.keepDefaultValues&&l?yo(s,l,void 0,be):r.dirtyFields:V.keepDefaultValues&&j?yo(s,j,void 0,be):V.keepDirty?r.dirtyFields:{},touchedFields:V.keepTouched?r.touchedFields:{},errors:V.keepErrors?r.errors:{},isSubmitSuccessful:V.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},Dr=(j,V)=>jt(tr(j)?j(l):j,{...n.resetOptions,...V}),kt=(j,V={})=>{const F=Se(o,j),se=F&&F._f;if(se){const de=se.refs?se.refs[0]:se.ref;de.focus&&setTimeout(()=>{de.focus(),V.shouldSelect&&tr(de.select)&&de.select()})}},oi=j=>{const{name:V,type:F,values:se,...de}=j;r={...r,...de}},ke={control:{register:Ht,unregister:Xt,getFieldState:Fe,handleSubmit:zt,setError:ht,_subscribe:xn,_runSchema:me,_updateIsValidating:L,_focusError:ar,_getWatch:ee,_getDirty:W,_setValid:z,_setFieldArray:H,_setDisabledField:or,_setErrors:ne,_getFieldArray:D,_reset:jt,_resetDefaultValues:()=>tr(n.defaultValues)&&n.defaultValues().then(j=>{Dr(j,n.resetOptions),E.state.next({isLoading:!1})}),_removeUnmounted:re,_disableForm:Bn,_subjects:E,_proxyFormState:C,get _fields(){return o},get _formValues(){return l},get _state(){return u},set _state(j){u=j},get _defaultValues(){return s},get _names(){return d},set _names(j){d=j},get _formState(){return r},get _options(){return n},set _options(j){n={...n,...j},v=Yc(n.mode),b=Yc(n.reValidateMode)}},subscribe:dn,trigger:ye,register:Ht,handleSubmit:zt,watch:Je,setValue:K,setValues:ae,getValues:Ne,reset:Dr,resetField:pn,resetDefaultValues:(j,V={})=>{if(s=Nt(j),!V.keepDirty){const F=yo(s,l,void 0,o);r.dirtyFields=F,r.isDirty=!on(F)}V.keepIsValid||z(),E.state.next({...r,defaultValues:s})},clearErrors:Ue,unregister:Xt,setError:ht,setFocus:kt,getFieldState:Fe};return{...ke,formControl:ke}}function Jp(e={}){const n=he.useRef(void 0),r=he.useRef(void 0),o=he.useRef(e.formControl),[s,l]=he.useState(()=>({...Nt(K_),isLoading:tr(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:tr(e.defaultValues)?void 0:e.defaultValues}));if(!n.current||e.formControl&&o.current!==e.formControl)if(o.current=e.formControl,e.formControl)n.current={...e.formControl,formState:s},e.defaultValues&&!tr(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:d,...p}=w4(e);n.current={...p,formState:s}}const u=n.current.control;return u._options=e,a4(()=>{const d=u._subscribe({formState:u._proxyFormState,callback:()=>l({...u._formState,defaultValues:u._defaultValues}),reRenderRoot:!0});return l(p=>({...p,isReady:!0})),u._formState.isReady=!0,d},[u]),he.useEffect(()=>u._disableForm(e.disabled),[u,e.disabled]),he.useEffect(()=>{e.mode&&(u._options.mode=e.mode),e.reValidateMode&&(u._options.reValidateMode=e.reValidateMode)},[u,e.mode,e.reValidateMode]),he.useEffect(()=>{e.errors&&(u._setErrors(e.errors),u._focusError())},[u,e.errors]),he.useEffect(()=>{e.shouldUnregister&&u._subjects.state.next({values:u._getWatch()})},[u,e.shouldUnregister]),he.useEffect(()=>{if(u._proxyFormState.isDirty){const d=u._getDirty();d!==s.isDirty&&u._subjects.state.next({isDirty:d})}},[u,s.isDirty]),he.useEffect(()=>{var d;e.values&&!Tr(e.values,r.current)?(u._reset(e.values,{keepFieldsRef:!0,...u._options.resetOptions}),!((d=u._options.resetOptions)===null||d===void 0)&&d.keepIsValid||u._setValid(),r.current=e.values,l(p=>({...p}))):u._resetDefaultValues()},[u,e.values]),he.useEffect(()=>{u._state.mount||(u._setValid(),u._state.mount=!0),u._state.watch&&(u._state.watch=!1,u._subjects.state.next({...u._formState})),u._removeUnmounted()}),n.current.formState=he.useMemo(()=>o4(s,u),[u,s]),n.current}const Cx=(e,n,r)=>{if(e&&"reportValidity"in e){const o=Se(r,n);e.setCustomValidity(o&&o.message||""),e.reportValidity()}},$m=(e,n)=>{for(const r in n.fields){const o=n.fields[r];o&&o.ref&&"reportValidity"in o.ref?Cx(o.ref,r,e):o&&o.refs&&o.refs.forEach(s=>Cx(s,r,e))}},Ex=(e,n)=>{n.shouldUseNativeValidation&&$m(e,n);const r={};for(const o in e){const s=Se(n.fields,o),l=Object.assign(e[o]||{},{ref:s&&s.ref});if(S4(n.names||Object.keys(e),o)){const u=Object.assign({},Se(r,o));ut(u,"root",l),ut(r,o,u)}else ut(r,o,l)}return r},S4=(e,n)=>{const r=Rx(n).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(o=>Rx(o).match(`^${r}\\.\\d+`))};function Rx(e){return e.replace(/[\[\]]/g,"")}var Tx;function ue(e,n,r){function o(d,p){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:p,constr:u,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),n(d,p);const h=u.prototype,y=Object.keys(h);for(let v=0;vr?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class La extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Y_ extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}(Tx=globalThis).__zod_globalConfig??(Tx.__zod_globalConfig={});const Wp=globalThis.__zod_globalConfig;function Ro(e){return Wp}function Q_(e){const n=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,s])=>n.indexOf(+o)===-1).map(([o,s])=>s)}function Im(e,n){return typeof n=="bigint"?n.toString():n}function eg(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function tg(e){return e==null}function ng(e){const n=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(n,r)}const Ox=Symbol("evaluating");function dt(e,n,r){let o;Object.defineProperty(e,n,{get(){if(o!==Ox)return o===void 0&&(o=Ox,o=r()),o},set(s){Object.defineProperty(e,n,{value:s})},configurable:!0})}function ko(e,n,r){Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Yi(...e){const n={};for(const r of e){const o=Object.getOwnPropertyDescriptors(r);Object.assign(n,o)}return Object.defineProperties({},n)}function jx(e){return JSON.stringify(e)}function _4(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X_="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function wu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const C4=eg(()=>{if(Wp.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ll(e){if(wu(e)===!1)return!1;const n=e.constructor;if(n===void 0||typeof n!="function")return!0;const r=n.prototype;return!(wu(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function J_(e){return ll(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const E4=new Set(["string","number","symbol"]);function ed(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qi(e,n,r){const o=new e._zod.constr(n??e._zod.def);return(!n||r?.parent)&&(o._zod.parent=e),o}function Ie(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function R4(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}function T4(e,n){const r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const l=Yi(e._zod.def,{get shape(){const u={};for(const d in n){if(!(d in r.shape))throw new Error(`Unrecognized key: "${d}"`);n[d]&&(u[d]=r.shape[d])}return ko(this,"shape",u),u},checks:[]});return Qi(e,l)}function O4(e,n){const r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const l=Yi(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const d in n){if(!(d in r.shape))throw new Error(`Unrecognized key: "${d}"`);n[d]&&delete u[d]}return ko(this,"shape",u),u},checks:[]});return Qi(e,l)}function j4(e,n){if(!ll(n))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const l=e._zod.def.shape;for(const u in n)if(Object.getOwnPropertyDescriptor(l,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Yi(e._zod.def,{get shape(){const l={...e._zod.def.shape,...n};return ko(this,"shape",l),l}});return Qi(e,s)}function A4(e,n){if(!ll(n))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Yi(e._zod.def,{get shape(){const o={...e._zod.def.shape,...n};return ko(this,"shape",o),o}});return Qi(e,r)}function M4(e,n){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r=Yi(e._zod.def,{get shape(){const o={...e._zod.def.shape,...n._zod.def.shape};return ko(this,"shape",o),o},get catchall(){return n._zod.def.catchall},checks:n._zod.def.checks??[]});return Qi(e,r)}function N4(e,n,r){const s=n._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const u=Yi(n._zod.def,{get shape(){const d=n._zod.def.shape,p={...d};if(r)for(const h in r){if(!(h in d))throw new Error(`Unrecognized key: "${h}"`);r[h]&&(p[h]=e?new e({type:"optional",innerType:d[h]}):d[h])}else for(const h in d)p[h]=e?new e({type:"optional",innerType:d[h]}):d[h];return ko(this,"shape",p),p},checks:[]});return Qi(n,u)}function D4(e,n,r){const o=Yi(n._zod.def,{get shape(){const s=n._zod.def.shape,l={...s};if(r)for(const u in r){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=new e({type:"nonoptional",innerType:s[u]}))}else for(const u in s)l[u]=new e({type:"nonoptional",innerType:s[u]});return ko(this,"shape",l),l}});return Qi(n,o)}function Ma(e,n=0){if(e.aborted===!0)return!0;for(let r=n;r{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Qc(e){return typeof e=="string"?e:e?.message}function To(e,n,r){const o=e.message?e.message:Qc(e.inst?._zod.def?.error?.(e))??Qc(n?.error?.(e))??Qc(r.customError?.(e))??Qc(r.localeError?.(e))??"Invalid input",{inst:s,continue:l,input:u,...d}=e;return d.path??(d.path=[]),d.message=o,n?.reportInput&&(d.input=u),d}function rg(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function cl(...e){const[n,r,o]=e;return typeof n=="string"?{message:n,code:"custom",input:r,inst:o}:{...n}}const eC=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,Im,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ig=ue("$ZodError",eC),td=ue("$ZodError",eC,{Parent:Error});function k4(e,n=r=>r.message){const r={},o=[];for(const s of e.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(n(s))):o.push(n(s));return{formErrors:o,fieldErrors:r}}function L4(e,n=r=>r.message){const r={_errors:[]},o=(s,l=[])=>{for(const u of s.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(d=>o({issues:d},[...l,...u.path]));else if(u.code==="invalid_key")o({issues:u.issues},[...l,...u.path]);else if(u.code==="invalid_element")o({issues:u.issues},[...l,...u.path]);else{const d=[...l,...u.path];if(d.length===0)r._errors.push(n(u));else{let p=r,h=0;for(;h(n,r,o,s)=>{const l=o?{...o,async:!1}:{async:!1},u=n._zod.run({value:r,issues:[]},l);if(u instanceof Promise)throw new La;if(u.issues.length){const d=new(s?.Err??e)(u.issues.map(p=>To(p,l,Ro())));throw X_(d,s?.callee),d}return u.value},$4=nd(td),rd=e=>async(n,r,o,s)=>{const l=o?{...o,async:!0}:{async:!0};let u=n._zod.run({value:r,issues:[]},l);if(u instanceof Promise&&(u=await u),u.issues.length){const d=new(s?.Err??e)(u.issues.map(p=>To(p,l,Ro())));throw X_(d,s?.callee),d}return u.value},I4=rd(td),id=e=>(n,r,o)=>{const s=o?{...o,async:!1}:{async:!1},l=n._zod.run({value:r,issues:[]},s);if(l instanceof Promise)throw new La;return l.issues.length?{success:!1,error:new(e??ig)(l.issues.map(u=>To(u,s,Ro())))}:{success:!0,data:l.value}},V4=id(td),od=e=>async(n,r,o)=>{const s=o?{...o,async:!0}:{async:!0};let l=n._zod.run({value:r,issues:[]},s);return l instanceof Promise&&(l=await l),l.issues.length?{success:!1,error:new e(l.issues.map(u=>To(u,s,Ro())))}:{success:!0,data:l.value}},F4=od(td),P4=e=>(n,r,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return nd(e)(n,r,s)},U4=e=>(n,r,o)=>nd(e)(n,r,o),H4=e=>async(n,r,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return rd(e)(n,r,s)},B4=e=>async(n,r,o)=>rd(e)(n,r,o),q4=e=>(n,r,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return id(e)(n,r,s)},G4=e=>(n,r,o)=>id(e)(n,r,o),Z4=e=>async(n,r,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return od(e)(n,r,s)},K4=e=>async(n,r,o)=>od(e)(n,r,o),Y4=/^[cC][0-9a-z]{6,}$/,Q4=/^[0-9a-z]+$/,X4=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,J4=/^[0-9a-vA-V]{20}$/,W4=/^[A-Za-z0-9]{27}$/,e5=/^[a-zA-Z0-9_-]{21}$/,t5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,n5=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ax=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,r5=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,i5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function o5(){return new RegExp(i5,"u")}const a5=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,s5=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,l5=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,c5=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,u5=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tC=/^[A-Za-z0-9_-]*$/,d5=/^https?$/,f5=/^\+[1-9]\d{6,14}$/,nC="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",h5=new RegExp(`^${nC}$`);function rC(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function m5(e){return new RegExp(`^${rC(e)}$`)}function p5(e){const n=rC({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${n}(?:${r.join("|")})`;return new RegExp(`^${nC}T(?:${o})$`)}const g5=e=>{const n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},v5=/^(?:true|false)$/i,y5=/^[^A-Z]*$/,b5=/^[^a-z]*$/,Nr=ue("$ZodCheck",(e,n)=>{var r;e._zod??(e._zod={}),e._zod.def=n,(r=e._zod).onattach??(r.onattach=[])}),x5=ue("$ZodCheckMaxLength",(e,n)=>{var r;Nr.init(e,n),(r=e._zod.def).when??(r.when=o=>{const s=o.value;return!tg(s)&&s.length!==void 0}),e._zod.onattach.push(o=>{const s=o._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum{const s=o.value;if(s.length<=n.maximum)return;const u=rg(s);o.issues.push({origin:u,code:"too_big",maximum:n.maximum,inclusive:!0,input:s,inst:e,continue:!n.abort})}}),w5=ue("$ZodCheckMinLength",(e,n)=>{var r;Nr.init(e,n),(r=e._zod.def).when??(r.when=o=>{const s=o.value;return!tg(s)&&s.length!==void 0}),e._zod.onattach.push(o=>{const s=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>s&&(o._zod.bag.minimum=n.minimum)}),e._zod.check=o=>{const s=o.value;if(s.length>=n.minimum)return;const u=rg(s);o.issues.push({origin:u,code:"too_small",minimum:n.minimum,inclusive:!0,input:s,inst:e,continue:!n.abort})}}),S5=ue("$ZodCheckLengthEquals",(e,n)=>{var r;Nr.init(e,n),(r=e._zod.def).when??(r.when=o=>{const s=o.value;return!tg(s)&&s.length!==void 0}),e._zod.onattach.push(o=>{const s=o._zod.bag;s.minimum=n.length,s.maximum=n.length,s.length=n.length}),e._zod.check=o=>{const s=o.value,l=s.length;if(l===n.length)return;const u=rg(s),d=l>n.length;o.issues.push({origin:u,...d?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!n.abort})}}),ad=ue("$ZodCheckStringFormat",(e,n)=>{var r,o;Nr.init(e,n),e._zod.onattach.push(s=>{const l=s._zod.bag;l.format=n.format,n.pattern&&(l.patterns??(l.patterns=new Set),l.patterns.add(n.pattern))}),n.pattern?(r=e._zod).check??(r.check=s=>{n.pattern.lastIndex=0,!n.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:n.format,input:s.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(o=e._zod).check??(o.check=()=>{})}),_5=ue("$ZodCheckRegex",(e,n)=>{ad.init(e,n),e._zod.check=r=>{n.pattern.lastIndex=0,!n.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),C5=ue("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=y5),ad.init(e,n)}),E5=ue("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=b5),ad.init(e,n)}),R5=ue("$ZodCheckIncludes",(e,n)=>{Nr.init(e,n);const r=ed(n.includes),o=new RegExp(typeof n.position=="number"?`^.{${n.position}}${r}`:r);n.pattern=o,e._zod.onattach.push(s=>{const l=s._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(o)}),e._zod.check=s=>{s.value.includes(n.includes,n.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:s.value,inst:e,continue:!n.abort})}}),T5=ue("$ZodCheckStartsWith",(e,n)=>{Nr.init(e,n);const r=new RegExp(`^${ed(n.prefix)}.*`);n.pattern??(n.pattern=r),e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(n.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:o.value,inst:e,continue:!n.abort})}}),O5=ue("$ZodCheckEndsWith",(e,n)=>{Nr.init(e,n);const r=new RegExp(`.*${ed(n.suffix)}$`);n.pattern??(n.pattern=r),e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(n.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:o.value,inst:e,continue:!n.abort})}}),j5=ue("$ZodCheckOverwrite",(e,n)=>{Nr.init(e,n),e._zod.check=r=>{r.value=n.tx(r.value)}});class A5{constructor(n=[]){this.content=[],this.indent=0,this&&(this.args=n)}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const o=n.split(`
+ color: hsl(${Math.max(0,Math.min(120-120*b,120))}deg 100% 31%);`,r?.key)}return s}}function $e(e,n,r,o){return{debug:()=>{var s;return(s=e?.debugAll)!=null?s:e[n]},key:!1,onChange:o}}function p3(e,n,r,o){const s=()=>{var u;return(u=l.getValue())!=null?u:e.options.renderFallbackValue},l={id:`${n.id}_${r.id}`,row:n,column:r,getValue:()=>n.getValue(o),renderValue:s,getContext:Le(()=>[e,r,n,l],(u,d,p,m)=>({table:u,column:d,row:p,cell:m,getValue:m.getValue,renderValue:m.renderValue}),$e(e.options,"debugCells"))};return e._features.forEach(u=>{u.createCell==null||u.createCell(l,r,n,e)},{}),l}function g3(e,n,r,o){var s,l;const d={...e._getDefaultColumnDef(),...n},p=d.accessorKey;let m=(s=(l=d.id)!=null?l:p?typeof String.prototype.replaceAll=="function"?p.replaceAll(".","_"):p.replace(/\./g,"_"):void 0)!=null?s:typeof d.header=="string"?d.header:void 0,y;if(d.accessorFn?y=d.accessorFn:p&&(p.includes(".")?y=b=>{let x=b;for(const _ of p.split(".")){var C;x=(C=x)==null?void 0:C[_]}return x}:y=b=>b[d.accessorKey]),!m)throw new Error;let v={id:`${String(m)}`,accessorFn:y,parent:o,depth:r,columnDef:d,columns:[],getFlatColumns:Le(()=>[!0],()=>{var b;return[v,...(b=v.columns)==null?void 0:b.flatMap(x=>x.getFlatColumns())]},$e(e.options,"debugColumns")),getLeafColumns:Le(()=>[e._getOrderColumnsFn()],b=>{var x;if((x=v.columns)!=null&&x.length){let C=v.columns.flatMap(_=>_.getLeafColumns());return b(C)}return[v]},$e(e.options,"debugColumns"))};for(const b of e._features)b.createColumn==null||b.createColumn(v,e);return v}const hn="debugHeaders";function fx(e,n,r){var o;let l={id:(o=r.id)!=null?o:n.id,column:n,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const u=[],d=p=>{p.subHeaders&&p.subHeaders.length&&p.subHeaders.map(d),u.push(p)};return d(l),u},getContext:()=>({table:e,header:l,column:n})};return e._features.forEach(u=>{u.createHeader==null||u.createHeader(l,e)}),l}const v3={createTable:e=>{e.getHeaderGroups=Le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,o,s)=>{var l,u;const d=(l=o?.map(v=>r.find(b=>b.id===v)).filter(Boolean))!=null?l:[],p=(u=s?.map(v=>r.find(b=>b.id===v)).filter(Boolean))!=null?u:[],m=r.filter(v=>!(o!=null&&o.includes(v.id))&&!(s!=null&&s.includes(v.id)));return Gc(n,[...d,...m,...p],e)},$e(e.options,hn)),e.getCenterHeaderGroups=Le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,o,s)=>(r=r.filter(l=>!(o!=null&&o.includes(l.id))&&!(s!=null&&s.includes(l.id))),Gc(n,r,e,"center")),$e(e.options,hn)),e.getLeftHeaderGroups=Le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(n,r,o)=>{var s;const l=(s=o?.map(u=>r.find(d=>d.id===u)).filter(Boolean))!=null?s:[];return Gc(n,l,e,"left")},$e(e.options,hn)),e.getRightHeaderGroups=Le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(n,r,o)=>{var s;const l=(s=o?.map(u=>r.find(d=>d.id===u)).filter(Boolean))!=null?s:[];return Gc(n,l,e,"right")},$e(e.options,hn)),e.getFooterGroups=Le(()=>[e.getHeaderGroups()],n=>[...n].reverse(),$e(e.options,hn)),e.getLeftFooterGroups=Le(()=>[e.getLeftHeaderGroups()],n=>[...n].reverse(),$e(e.options,hn)),e.getCenterFooterGroups=Le(()=>[e.getCenterHeaderGroups()],n=>[...n].reverse(),$e(e.options,hn)),e.getRightFooterGroups=Le(()=>[e.getRightHeaderGroups()],n=>[...n].reverse(),$e(e.options,hn)),e.getFlatHeaders=Le(()=>[e.getHeaderGroups()],n=>n.map(r=>r.headers).flat(),$e(e.options,hn)),e.getLeftFlatHeaders=Le(()=>[e.getLeftHeaderGroups()],n=>n.map(r=>r.headers).flat(),$e(e.options,hn)),e.getCenterFlatHeaders=Le(()=>[e.getCenterHeaderGroups()],n=>n.map(r=>r.headers).flat(),$e(e.options,hn)),e.getRightFlatHeaders=Le(()=>[e.getRightHeaderGroups()],n=>n.map(r=>r.headers).flat(),$e(e.options,hn)),e.getCenterLeafHeaders=Le(()=>[e.getCenterFlatHeaders()],n=>n.filter(r=>{var o;return!((o=r.subHeaders)!=null&&o.length)}),$e(e.options,hn)),e.getLeftLeafHeaders=Le(()=>[e.getLeftFlatHeaders()],n=>n.filter(r=>{var o;return!((o=r.subHeaders)!=null&&o.length)}),$e(e.options,hn)),e.getRightLeafHeaders=Le(()=>[e.getRightFlatHeaders()],n=>n.filter(r=>{var o;return!((o=r.subHeaders)!=null&&o.length)}),$e(e.options,hn)),e.getLeafHeaders=Le(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(n,r,o)=>{var s,l,u,d,p,m;return[...(s=(l=n[0])==null?void 0:l.headers)!=null?s:[],...(u=(d=r[0])==null?void 0:d.headers)!=null?u:[],...(p=(m=o[0])==null?void 0:m.headers)!=null?p:[]].map(y=>y.getLeafHeaders()).flat()},$e(e.options,hn))}};function Gc(e,n,r,o){var s,l;let u=0;const d=function(b,x){x===void 0&&(x=1),u=Math.max(u,x),b.filter(C=>C.getIsVisible()).forEach(C=>{var _;(_=C.columns)!=null&&_.length&&d(C.columns,x+1)},0)};d(e);let p=[];const m=(b,x)=>{const C={depth:x,id:[o,`${x}`].filter(Boolean).join("_"),headers:[]},_=[];b.forEach(E=>{const T=[..._].reverse()[0],O=E.column.depth===C.depth;let A,z=!1;if(O&&E.column.parent?A=E.column.parent:(A=E.column,z=!0),T&&T?.column===A)T.subHeaders.push(E);else{const L=fx(r,A,{id:[o,x,A.id,E?.id].filter(Boolean).join("_"),isPlaceholder:z,placeholderId:z?`${_.filter(B=>B.column===A).length}`:void 0,depth:x,index:_.length});L.subHeaders.push(E),_.push(L)}C.headers.push(E),E.headerGroup=C}),p.push(C),x>0&&m(_,x-1)},y=n.map((b,x)=>fx(r,b,{depth:u,index:x}));m(y,u-1),p.reverse();const v=b=>b.filter(C=>C.column.getIsVisible()).map(C=>{let _=0,E=0,T=[0];C.subHeaders&&C.subHeaders.length?(T=[],v(C.subHeaders).forEach(A=>{let{colSpan:z,rowSpan:L}=A;_+=z,T.push(L)})):_=1;const O=Math.min(...T);return E=E+O,C.colSpan=_,C.rowSpan=E,{colSpan:_,rowSpan:E}});return v((s=(l=p[0])==null?void 0:l.headers)!=null?s:[]),p}const y3=(e,n,r,o,s,l,u)=>{let d={id:n,index:o,original:r,depth:s,parentId:u,_valuesCache:{},_uniqueValuesCache:{},getValue:p=>{if(d._valuesCache.hasOwnProperty(p))return d._valuesCache[p];const m=e.getColumn(p);if(m!=null&&m.accessorFn)return d._valuesCache[p]=m.accessorFn(d.original,o),d._valuesCache[p]},getUniqueValues:p=>{if(d._uniqueValuesCache.hasOwnProperty(p))return d._uniqueValuesCache[p];const m=e.getColumn(p);if(m!=null&&m.accessorFn)return m.columnDef.getUniqueValues?(d._uniqueValuesCache[p]=m.columnDef.getUniqueValues(d.original,o),d._uniqueValuesCache[p]):(d._uniqueValuesCache[p]=[d.getValue(p)],d._uniqueValuesCache[p])},renderValue:p=>{var m;return(m=d.getValue(p))!=null?m:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>m3(d.subRows,p=>p.subRows),getParentRow:()=>d.parentId?e.getRow(d.parentId,!0):void 0,getParentRows:()=>{let p=[],m=d;for(;;){const y=m.getParentRow();if(!y)break;p.push(y),m=y}return p.reverse()},getAllCells:Le(()=>[e.getAllLeafColumns()],p=>p.map(m=>p3(e,d,m,m.id)),$e(e.options,"debugRows")),_getAllCellsByColumnId:Le(()=>[d.getAllCells()],p=>p.reduce((m,y)=>(m[y.column.id]=y,m),{}),$e(e.options,"debugRows"))};for(let p=0;p{e._getFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():n.getPreFilteredRowModel(),e._getFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},C_=(e,n,r)=>{var o,s;const l=r==null||(o=r.toString())==null?void 0:o.toLowerCase();return!!(!((s=e.getValue(n))==null||(s=s.toString())==null||(s=s.toLowerCase())==null)&&s.includes(l))};C_.autoRemove=e=>gr(e);const E_=(e,n,r)=>{var o;return!!(!((o=e.getValue(n))==null||(o=o.toString())==null)&&o.includes(r))};E_.autoRemove=e=>gr(e);const R_=(e,n,r)=>{var o;return((o=e.getValue(n))==null||(o=o.toString())==null?void 0:o.toLowerCase())===r?.toLowerCase()};R_.autoRemove=e=>gr(e);const T_=(e,n,r)=>{var o;return(o=e.getValue(n))==null?void 0:o.includes(r)};T_.autoRemove=e=>gr(e);const O_=(e,n,r)=>!r.some(o=>{var s;return!((s=e.getValue(n))!=null&&s.includes(o))});O_.autoRemove=e=>gr(e)||!(e!=null&&e.length);const j_=(e,n,r)=>r.some(o=>{var s;return(s=e.getValue(n))==null?void 0:s.includes(o)});j_.autoRemove=e=>gr(e)||!(e!=null&&e.length);const A_=(e,n,r)=>e.getValue(n)===r;A_.autoRemove=e=>gr(e);const M_=(e,n,r)=>e.getValue(n)==r;M_.autoRemove=e=>gr(e);const qp=(e,n,r)=>{let[o,s]=r;const l=e.getValue(n);return l>=o&&l<=s};qp.resolveFilterValue=e=>{let[n,r]=e,o=typeof n!="number"?parseFloat(n):n,s=typeof r!="number"?parseFloat(r):r,l=n===null||Number.isNaN(o)?-1/0:o,u=r===null||Number.isNaN(s)?1/0:s;if(l>u){const d=l;l=u,u=d}return[l,u]};qp.autoRemove=e=>gr(e)||gr(e[0])&&gr(e[1]);const Wr={includesString:C_,includesStringSensitive:E_,equalsString:R_,arrIncludes:T_,arrIncludesAll:O_,arrIncludesSome:j_,equals:A_,weakEquals:M_,inNumberRange:qp};function gr(e){return e==null||e===""}const x3={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Hn("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,n)=>{e.getAutoFilterFn=()=>{const r=n.getCoreRowModel().flatRows[0],o=r?.getValue(e.id);return typeof o=="string"?Wr.includesString:typeof o=="number"?Wr.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Wr.equals:Array.isArray(o)?Wr.arrIncludes:Wr.weakEquals},e.getFilterFn=()=>{var r,o;return Xu(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(r=(o=n.options.filterFns)==null?void 0:o[e.columnDef.filterFn])!=null?r:Wr[e.columnDef.filterFn]},e.getCanFilter=()=>{var r,o,s;return((r=e.columnDef.enableColumnFilter)!=null?r:!0)&&((o=n.options.enableColumnFilters)!=null?o:!0)&&((s=n.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var r;return(r=n.getState().columnFilters)==null||(r=r.find(o=>o.id===e.id))==null?void 0:r.value},e.getFilterIndex=()=>{var r,o;return(r=(o=n.getState().columnFilters)==null?void 0:o.findIndex(s=>s.id===e.id))!=null?r:-1},e.setFilterValue=r=>{n.setColumnFilters(o=>{const s=e.getFilterFn(),l=o?.find(y=>y.id===e.id),u=Ni(r,l?l.value:void 0);if(hx(s,u,e)){var d;return(d=o?.filter(y=>y.id!==e.id))!=null?d:[]}const p={id:e.id,value:u};if(l){var m;return(m=o?.map(y=>y.id===e.id?p:y))!=null?m:[]}return o!=null&&o.length?[...o,p]:[p]})}},createRow:(e,n)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=n=>{const r=e.getAllLeafColumns(),o=s=>{var l;return(l=Ni(n,s))==null?void 0:l.filter(u=>{const d=r.find(p=>p.id===u.id);if(d){const p=d.getFilterFn();if(hx(p,u.value,d))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(o)},e.resetColumnFilters=n=>{var r,o;e.setColumnFilters(n?[]:(r=(o=e.initialState)==null?void 0:o.columnFilters)!=null?r:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function hx(e,n,r){return(e&&e.autoRemove?e.autoRemove(n,r):!1)||typeof n>"u"||typeof n=="string"&&!n}const w3=(e,n,r)=>r.reduce((o,s)=>{const l=s.getValue(e);return o+(typeof l=="number"?l:0)},0),S3=(e,n,r)=>{let o;return r.forEach(s=>{const l=s.getValue(e);l!=null&&(o>l||o===void 0&&l>=l)&&(o=l)}),o},_3=(e,n,r)=>{let o;return r.forEach(s=>{const l=s.getValue(e);l!=null&&(o=l)&&(o=l)}),o},C3=(e,n,r)=>{let o,s;return r.forEach(l=>{const u=l.getValue(e);u!=null&&(o===void 0?u>=u&&(o=s=u):(o>u&&(o=u),s{let r=0,o=0;if(n.forEach(s=>{let l=s.getValue(e);l!=null&&(l=+l)>=l&&(++r,o+=l)}),r)return o/r},R3=(e,n)=>{if(!n.length)return;const r=n.map(l=>l.getValue(e));if(!h3(r))return;if(r.length===1)return r[0];const o=Math.floor(r.length/2),s=r.sort((l,u)=>l-u);return r.length%2!==0?s[o]:(s[o-1]+s[o])/2},T3=(e,n)=>Array.from(new Set(n.map(r=>r.getValue(e))).values()),O3=(e,n)=>new Set(n.map(r=>r.getValue(e))).size,j3=(e,n)=>n.length,Uh={sum:w3,min:S3,max:_3,extent:C3,mean:E3,median:R3,unique:T3,uniqueCount:O3,count:j3},A3={getDefaultColumnDef:()=>({aggregatedCell:e=>{var n,r;return(n=(r=e.getValue())==null||r.toString==null?void 0:r.toString())!=null?n:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Hn("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,n)=>{e.toggleGrouping=()=>{n.setGrouping(r=>r!=null&&r.includes(e.id)?r.filter(o=>o!==e.id):[...r??[],e.id])},e.getCanGroup=()=>{var r,o;return((r=e.columnDef.enableGrouping)!=null?r:!0)&&((o=n.options.enableGrouping)!=null?o:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var r;return(r=n.getState().grouping)==null?void 0:r.includes(e.id)},e.getGroupedIndex=()=>{var r;return(r=n.getState().grouping)==null?void 0:r.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const r=e.getCanGroup();return()=>{r&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const r=n.getCoreRowModel().flatRows[0],o=r?.getValue(e.id);if(typeof o=="number")return Uh.sum;if(Object.prototype.toString.call(o)==="[object Date]")return Uh.extent},e.getAggregationFn=()=>{var r,o;if(!e)throw new Error;return Xu(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(r=(o=n.options.aggregationFns)==null?void 0:o[e.columnDef.aggregationFn])!=null?r:Uh[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=n=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(n),e.resetGrouping=n=>{var r,o;e.setGrouping(n?[]:(r=(o=e.initialState)==null?void 0:o.grouping)!=null?r:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,n)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=r=>{if(e._groupingValuesCache.hasOwnProperty(r))return e._groupingValuesCache[r];const o=n.getColumn(r);return o!=null&&o.columnDef.getGroupingValue?(e._groupingValuesCache[r]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[r]):e.getValue(r)},e._groupingValuesCache={}},createCell:(e,n,r,o)=>{e.getIsGrouped=()=>n.getIsGrouped()&&n.id===r.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&n.getIsGrouped(),e.getIsAggregated=()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=r.subRows)!=null&&s.length)}}};function M3(e,n,r){if(!(n!=null&&n.length)||!r)return e;const o=e.filter(l=>!n.includes(l.id));return r==="remove"?o:[...n.map(l=>e.find(u=>u.id===l)).filter(Boolean),...o]}const N3={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Hn("columnOrder",e)}),createColumn:(e,n)=>{e.getIndex=Le(r=>[Qs(n,r)],r=>r.findIndex(o=>o.id===e.id),$e(n.options,"debugColumns")),e.getIsFirstColumn=r=>{var o;return((o=Qs(n,r)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=r=>{var o;const s=Qs(n,r);return((o=s[s.length-1])==null?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=n=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(n),e.resetColumnOrder=n=>{var r;e.setColumnOrder(n?[]:(r=e.initialState.columnOrder)!=null?r:[])},e._getOrderColumnsFn=Le(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(n,r,o)=>s=>{let l=[];if(!(n!=null&&n.length))l=s;else{const u=[...n],d=[...s];for(;d.length&&u.length;){const p=u.shift(),m=d.findIndex(y=>y.id===p);m>-1&&l.push(d.splice(m,1)[0])}l=[...l,...d]}return M3(l,r,o)},$e(e.options,"debugTable"))}},Hh=()=>({left:[],right:[]}),D3={getInitialState:e=>({columnPinning:Hh(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Hn("columnPinning",e)}),createColumn:(e,n)=>{e.pin=r=>{const o=e.getLeafColumns().map(s=>s.id).filter(Boolean);n.setColumnPinning(s=>{var l,u;if(r==="right"){var d,p;return{left:((d=s?.left)!=null?d:[]).filter(v=>!(o!=null&&o.includes(v))),right:[...((p=s?.right)!=null?p:[]).filter(v=>!(o!=null&&o.includes(v))),...o]}}if(r==="left"){var m,y;return{left:[...((m=s?.left)!=null?m:[]).filter(v=>!(o!=null&&o.includes(v))),...o],right:((y=s?.right)!=null?y:[]).filter(v=>!(o!=null&&o.includes(v)))}}return{left:((l=s?.left)!=null?l:[]).filter(v=>!(o!=null&&o.includes(v))),right:((u=s?.right)!=null?u:[]).filter(v=>!(o!=null&&o.includes(v)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var s,l,u;return((s=o.columnDef.enablePinning)!=null?s:!0)&&((l=(u=n.options.enableColumnPinning)!=null?u:n.options.enablePinning)!=null?l:!0)}),e.getIsPinned=()=>{const r=e.getLeafColumns().map(d=>d.id),{left:o,right:s}=n.getState().columnPinning,l=r.some(d=>o?.includes(d)),u=r.some(d=>s?.includes(d));return l?"left":u?"right":!1},e.getPinnedIndex=()=>{var r,o;const s=e.getIsPinned();return s?(r=(o=n.getState().columnPinning)==null||(o=o[s])==null?void 0:o.indexOf(e.id))!=null?r:-1:0}},createRow:(e,n)=>{e.getCenterVisibleCells=Le(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left,n.getState().columnPinning.right],(r,o,s)=>{const l=[...o??[],...s??[]];return r.filter(u=>!l.includes(u.column.id))},$e(n.options,"debugRows")),e.getLeftVisibleCells=Le(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left],(r,o)=>(o??[]).map(l=>r.find(u=>u.column.id===l)).filter(Boolean).map(l=>({...l,position:"left"})),$e(n.options,"debugRows")),e.getRightVisibleCells=Le(()=>[e._getAllVisibleCells(),n.getState().columnPinning.right],(r,o)=>(o??[]).map(l=>r.find(u=>u.column.id===l)).filter(Boolean).map(l=>({...l,position:"right"})),$e(n.options,"debugRows"))},createTable:e=>{e.setColumnPinning=n=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(n),e.resetColumnPinning=n=>{var r,o;return e.setColumnPinning(n?Hh():(r=(o=e.initialState)==null?void 0:o.columnPinning)!=null?r:Hh())},e.getIsSomeColumnsPinned=n=>{var r;const o=e.getState().columnPinning;if(!n){var s,l;return!!((s=o.left)!=null&&s.length||(l=o.right)!=null&&l.length)}return!!((r=o[n])!=null&&r.length)},e.getLeftLeafColumns=Le(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(s=>s.id===o)).filter(Boolean),$e(e.options,"debugColumns")),e.getRightLeafColumns=Le(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(s=>s.id===o)).filter(Boolean),$e(e.options,"debugColumns")),e.getCenterLeafColumns=Le(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,o)=>{const s=[...r??[],...o??[]];return n.filter(l=>!s.includes(l.id))},$e(e.options,"debugColumns"))}};function z3(e){return e||(typeof document<"u"?document:null)}const Zc={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Bh=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),k3={getDefaultColumnDef:()=>Zc,getInitialState:e=>({columnSizing:{},columnSizingInfo:Bh(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Hn("columnSizing",e),onColumnSizingInfoChange:Hn("columnSizingInfo",e)}),createColumn:(e,n)=>{e.getSize=()=>{var r,o,s;const l=n.getState().columnSizing[e.id];return Math.min(Math.max((r=e.columnDef.minSize)!=null?r:Zc.minSize,(o=l??e.columnDef.size)!=null?o:Zc.size),(s=e.columnDef.maxSize)!=null?s:Zc.maxSize)},e.getStart=Le(r=>[r,Qs(n,r),n.getState().columnSizing],(r,o)=>o.slice(0,e.getIndex(r)).reduce((s,l)=>s+l.getSize(),0),$e(n.options,"debugColumns")),e.getAfter=Le(r=>[r,Qs(n,r),n.getState().columnSizing],(r,o)=>o.slice(e.getIndex(r)+1).reduce((s,l)=>s+l.getSize(),0),$e(n.options,"debugColumns")),e.resetSize=()=>{n.setColumnSizing(r=>{let{[e.id]:o,...s}=r;return s})},e.getCanResize=()=>{var r,o;return((r=e.columnDef.enableResizing)!=null?r:!0)&&((o=n.options.enableColumnResizing)!=null?o:!0)},e.getIsResizing=()=>n.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,n)=>{e.getSize=()=>{let r=0;const o=s=>{if(s.subHeaders.length)s.subHeaders.forEach(o);else{var l;r+=(l=s.column.getSize())!=null?l:0}};return o(e),r},e.getStart=()=>{if(e.index>0){const r=e.headerGroup.headers[e.index-1];return r.getStart()+r.getSize()}return 0},e.getResizeHandler=r=>{const o=n.getColumn(e.column.id),s=o?.getCanResize();return l=>{if(!o||!s||(l.persist==null||l.persist(),qh(l)&&l.touches&&l.touches.length>1))return;const u=e.getSize(),d=e?e.getLeafHeaders().map(T=>[T.column.id,T.column.getSize()]):[[o.id,o.getSize()]],p=qh(l)?Math.round(l.touches[0].clientX):l.clientX,m={},y=(T,O)=>{typeof O=="number"&&(n.setColumnSizingInfo(A=>{var z,L;const B=n.options.columnResizeDirection==="rtl"?-1:1,H=(O-((z=A?.startOffset)!=null?z:0))*B,I=Math.max(H/((L=A?.startSize)!=null?L:0),-.999999);return A.columnSizingStart.forEach(ne=>{let[ve,fe]=ne;m[ve]=Math.round(Math.max(fe+fe*I,0)*100)/100}),{...A,deltaOffset:H,deltaPercentage:I}}),(n.options.columnResizeMode==="onChange"||T==="end")&&n.setColumnSizing(A=>({...A,...m})))},v=T=>y("move",T),b=T=>{y("end",T),n.setColumnSizingInfo(O=>({...O,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},x=z3(r),C={moveHandler:T=>v(T.clientX),upHandler:T=>{x?.removeEventListener("mousemove",C.moveHandler),x?.removeEventListener("mouseup",C.upHandler),b(T.clientX)}},_={moveHandler:T=>(T.cancelable&&(T.preventDefault(),T.stopPropagation()),v(T.touches[0].clientX),!1),upHandler:T=>{var O;x?.removeEventListener("touchmove",_.moveHandler),x?.removeEventListener("touchend",_.upHandler),T.cancelable&&(T.preventDefault(),T.stopPropagation()),b((O=T.touches[0])==null?void 0:O.clientX)}},E=L3()?{passive:!1}:!1;qh(l)?(x?.addEventListener("touchmove",_.moveHandler,E),x?.addEventListener("touchend",_.upHandler,E)):(x?.addEventListener("mousemove",C.moveHandler,E),x?.addEventListener("mouseup",C.upHandler,E)),n.setColumnSizingInfo(T=>({...T,startOffset:p,startSize:u,deltaOffset:0,deltaPercentage:0,columnSizingStart:d,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=n=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(n),e.setColumnSizingInfo=n=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(n),e.resetColumnSizing=n=>{var r;e.setColumnSizing(n?{}:(r=e.initialState.columnSizing)!=null?r:{})},e.resetHeaderSizeInfo=n=>{var r;e.setColumnSizingInfo(n?Bh():(r=e.initialState.columnSizingInfo)!=null?r:Bh())},e.getTotalSize=()=>{var n,r;return(n=(r=e.getHeaderGroups()[0])==null?void 0:r.headers.reduce((o,s)=>o+s.getSize(),0))!=null?n:0},e.getLeftTotalSize=()=>{var n,r;return(n=(r=e.getLeftHeaderGroups()[0])==null?void 0:r.headers.reduce((o,s)=>o+s.getSize(),0))!=null?n:0},e.getCenterTotalSize=()=>{var n,r;return(n=(r=e.getCenterHeaderGroups()[0])==null?void 0:r.headers.reduce((o,s)=>o+s.getSize(),0))!=null?n:0},e.getRightTotalSize=()=>{var n,r;return(n=(r=e.getRightHeaderGroups()[0])==null?void 0:r.headers.reduce((o,s)=>o+s.getSize(),0))!=null?n:0}}};let Kc=null;function L3(){if(typeof Kc=="boolean")return Kc;let e=!1;try{const n={get passive(){return e=!0,!1}},r=()=>{};window.addEventListener("test",r,n),window.removeEventListener("test",r)}catch{e=!1}return Kc=e,Kc}function qh(e){return e.type==="touchstart"}const $3={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Hn("columnVisibility",e)}),createColumn:(e,n)=>{e.toggleVisibility=r=>{e.getCanHide()&&n.setColumnVisibility(o=>({...o,[e.id]:r??!e.getIsVisible()}))},e.getIsVisible=()=>{var r,o;const s=e.columns;return(r=s.length?s.some(l=>l.getIsVisible()):(o=n.getState().columnVisibility)==null?void 0:o[e.id])!=null?r:!0},e.getCanHide=()=>{var r,o;return((r=e.columnDef.enableHiding)!=null?r:!0)&&((o=n.options.enableHiding)!=null?o:!0)},e.getToggleVisibilityHandler=()=>r=>{e.toggleVisibility==null||e.toggleVisibility(r.target.checked)}},createRow:(e,n)=>{e._getAllVisibleCells=Le(()=>[e.getAllCells(),n.getState().columnVisibility],r=>r.filter(o=>o.column.getIsVisible()),$e(n.options,"debugRows")),e.getVisibleCells=Le(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(r,o,s)=>[...r,...o,...s],$e(n.options,"debugRows"))},createTable:e=>{const n=(r,o)=>Le(()=>[o(),o().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(l=>l.getIsVisible==null?void 0:l.getIsVisible()),$e(e.options,"debugColumns"));e.getVisibleFlatColumns=n("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=n("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=n("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=n("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=n("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=r=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(r),e.resetColumnVisibility=r=>{var o;e.setColumnVisibility(r?{}:(o=e.initialState.columnVisibility)!=null?o:{})},e.toggleAllColumnsVisible=r=>{var o;r=(o=r)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,l)=>({...s,[l.id]:r||!(l.getCanHide!=null&&l.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(r=>!(r.getIsVisible!=null&&r.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(r=>r.getIsVisible==null?void 0:r.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>r=>{var o;e.toggleAllColumnsVisible((o=r.target)==null?void 0:o.checked)}}};function Qs(e,n){return n?n==="center"?e.getCenterVisibleLeafColumns():n==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const I3={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},V3={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Hn("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:n=>{var r;const o=(r=e.getCoreRowModel().flatRows[0])==null||(r=r._getAllCellsByColumnId()[n.id])==null?void 0:r.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,n)=>{e.getCanGlobalFilter=()=>{var r,o,s,l;return((r=e.columnDef.enableGlobalFilter)!=null?r:!0)&&((o=n.options.enableGlobalFilter)!=null?o:!0)&&((s=n.options.enableFilters)!=null?s:!0)&&((l=n.options.getColumnCanGlobalFilter==null?void 0:n.options.getColumnCanGlobalFilter(e))!=null?l:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Wr.includesString,e.getGlobalFilterFn=()=>{var n,r;const{globalFilterFn:o}=e.options;return Xu(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(n=(r=e.options.filterFns)==null?void 0:r[o])!=null?n:Wr[o]},e.setGlobalFilter=n=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(n)},e.resetGlobalFilter=n=>{e.setGlobalFilter(n?void 0:e.initialState.globalFilter)}}},F3={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Hn("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let n=!1,r=!1;e._autoResetExpanded=()=>{var o,s;if(!n){e._queue(()=>{n=!0});return}if((o=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(r)return;r=!0,e._queue(()=>{e.resetExpanded(),r=!1})}},e.setExpanded=o=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(o),e.toggleAllRowsExpanded=o=>{o??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=o=>{var s,l;e.setExpanded(o?{}:(s=(l=e.initialState)==null?void 0:l.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const o=e.getState().expanded;return o===!0||Object.values(o).some(Boolean)},e.getIsAllRowsExpanded=()=>{const o=e.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let o=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(l=>{const u=l.split(".");o=Math.max(o,u.length)}),o},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,n)=>{e.toggleExpanded=r=>{n.setExpanded(o=>{var s;const l=o===!0?!0:!!(o!=null&&o[e.id]);let u={};if(o===!0?Object.keys(n.getRowModel().rowsById).forEach(d=>{u[d]=!0}):u=o,r=(s=r)!=null?s:!l,!l&&r)return{...u,[e.id]:!0};if(l&&!r){const{[e.id]:d,...p}=u;return p}return o})},e.getIsExpanded=()=>{var r;const o=n.getState().expanded;return!!((r=n.options.getIsRowExpanded==null?void 0:n.options.getIsRowExpanded(e))!=null?r:o===!0||o?.[e.id])},e.getCanExpand=()=>{var r,o,s;return(r=n.options.getRowCanExpand==null?void 0:n.options.getRowCanExpand(e))!=null?r:((o=n.options.enableExpanding)!=null?o:!0)&&!!((s=e.subRows)!=null&&s.length)},e.getIsAllParentsExpanded=()=>{let r=!0,o=e;for(;r&&o.parentId;)o=n.getRow(o.parentId,!0),r=o.getIsExpanded();return r},e.getToggleExpandedHandler=()=>{const r=e.getCanExpand();return()=>{r&&e.toggleExpanded()}}}},jm=0,Am=10,Gh=()=>({pageIndex:jm,pageSize:Am}),P3={getInitialState:e=>({...e,pagination:{...Gh(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Hn("pagination",e)}),createTable:e=>{let n=!1,r=!1;e._autoResetPageIndex=()=>{var o,s;if(!n){e._queue(()=>{n=!0});return}if((o=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(r)return;r=!0,e._queue(()=>{e.resetPageIndex(),r=!1})}},e.setPagination=o=>{const s=l=>Ni(o,l);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=o=>{var s;e.setPagination(o?Gh():(s=e.initialState.pagination)!=null?s:Gh())},e.setPageIndex=o=>{e.setPagination(s=>{let l=Ni(o,s.pageIndex);const u=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return l=Math.max(0,Math.min(l,u)),{...s,pageIndex:l}})},e.resetPageIndex=o=>{var s,l;e.setPageIndex(o?jm:(s=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageIndex)!=null?s:jm)},e.resetPageSize=o=>{var s,l;e.setPageSize(o?Am:(s=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageSize)!=null?s:Am)},e.setPageSize=o=>{e.setPagination(s=>{const l=Math.max(1,Ni(o,s.pageSize)),u=s.pageSize*s.pageIndex,d=Math.floor(u/l);return{...s,pageIndex:d,pageSize:l}})},e.setPageCount=o=>e.setPagination(s=>{var l;let u=Ni(o,(l=e.options.pageCount)!=null?l:-1);return typeof u=="number"&&(u=Math.max(-1,u)),{...s,pageCount:u}}),e.getPageOptions=Le(()=>[e.getPageCount()],o=>{let s=[];return o&&o>0&&(s=[...new Array(o)].fill(null).map((l,u)=>u)),s},$e(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:o}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:oe.setPageIndex(o=>o-1),e.nextPage=()=>e.setPageIndex(o=>o+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var o;return(o=e.options.pageCount)!=null?o:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var o;return(o=e.options.rowCount)!=null?o:e.getPrePaginationRowModel().rows.length}}},Zh=()=>({top:[],bottom:[]}),U3={getInitialState:e=>({rowPinning:Zh(),...e}),getDefaultOptions:e=>({onRowPinningChange:Hn("rowPinning",e)}),createRow:(e,n)=>{e.pin=(r,o,s)=>{const l=o?e.getLeafRows().map(p=>{let{id:m}=p;return m}):[],u=s?e.getParentRows().map(p=>{let{id:m}=p;return m}):[],d=new Set([...u,e.id,...l]);n.setRowPinning(p=>{var m,y;if(r==="bottom"){var v,b;return{top:((v=p?.top)!=null?v:[]).filter(_=>!(d!=null&&d.has(_))),bottom:[...((b=p?.bottom)!=null?b:[]).filter(_=>!(d!=null&&d.has(_))),...Array.from(d)]}}if(r==="top"){var x,C;return{top:[...((x=p?.top)!=null?x:[]).filter(_=>!(d!=null&&d.has(_))),...Array.from(d)],bottom:((C=p?.bottom)!=null?C:[]).filter(_=>!(d!=null&&d.has(_)))}}return{top:((m=p?.top)!=null?m:[]).filter(_=>!(d!=null&&d.has(_))),bottom:((y=p?.bottom)!=null?y:[]).filter(_=>!(d!=null&&d.has(_)))}})},e.getCanPin=()=>{var r;const{enableRowPinning:o,enablePinning:s}=n.options;return typeof o=="function"?o(e):(r=o??s)!=null?r:!0},e.getIsPinned=()=>{const r=[e.id],{top:o,bottom:s}=n.getState().rowPinning,l=r.some(d=>o?.includes(d)),u=r.some(d=>s?.includes(d));return l?"top":u?"bottom":!1},e.getPinnedIndex=()=>{var r,o;const s=e.getIsPinned();if(!s)return-1;const l=(r=s==="top"?n.getTopRows():n.getBottomRows())==null?void 0:r.map(u=>{let{id:d}=u;return d});return(o=l?.indexOf(e.id))!=null?o:-1}},createTable:e=>{e.setRowPinning=n=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(n),e.resetRowPinning=n=>{var r,o;return e.setRowPinning(n?Zh():(r=(o=e.initialState)==null?void 0:o.rowPinning)!=null?r:Zh())},e.getIsSomeRowsPinned=n=>{var r;const o=e.getState().rowPinning;if(!n){var s,l;return!!((s=o.top)!=null&&s.length||(l=o.bottom)!=null&&l.length)}return!!((r=o[n])!=null&&r.length)},e._getPinnedRows=(n,r,o)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(r??[]).map(u=>{const d=e.getRow(u,!0);return d.getIsAllParentsExpanded()?d:null}):(r??[]).map(u=>n.find(d=>d.id===u))).filter(Boolean).map(u=>({...u,position:o}))},e.getTopRows=Le(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(n,r)=>e._getPinnedRows(n,r,"top"),$e(e.options,"debugRows")),e.getBottomRows=Le(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(n,r)=>e._getPinnedRows(n,r,"bottom"),$e(e.options,"debugRows")),e.getCenterRows=Le(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(n,r,o)=>{const s=new Set([...r??[],...o??[]]);return n.filter(l=>!s.has(l.id))},$e(e.options,"debugRows"))}},H3={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Hn("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=n=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(n),e.resetRowSelection=n=>{var r;return e.setRowSelection(n?{}:(r=e.initialState.rowSelection)!=null?r:{})},e.toggleAllRowsSelected=n=>{e.setRowSelection(r=>{n=typeof n<"u"?n:!e.getIsAllRowsSelected();const o={...r},s=e.getPreGroupedRowModel().flatRows;return n?s.forEach(l=>{l.getCanSelect()&&(o[l.id]=!0)}):s.forEach(l=>{delete o[l.id]}),o})},e.toggleAllPageRowsSelected=n=>e.setRowSelection(r=>{const o=typeof n<"u"?n:!e.getIsAllPageRowsSelected(),s={...r};return e.getRowModel().rows.forEach(l=>{Mm(s,l.id,o,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Le(()=>[e.getState().rowSelection,e.getCoreRowModel()],(n,r)=>Object.keys(n).length?Kh(e,r):{rows:[],flatRows:[],rowsById:{}},$e(e.options,"debugTable")),e.getFilteredSelectedRowModel=Le(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(n,r)=>Object.keys(n).length?Kh(e,r):{rows:[],flatRows:[],rowsById:{}},$e(e.options,"debugTable")),e.getGroupedSelectedRowModel=Le(()=>[e.getState().rowSelection,e.getSortedRowModel()],(n,r)=>Object.keys(n).length?Kh(e,r):{rows:[],flatRows:[],rowsById:{}},$e(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const n=e.getFilteredRowModel().flatRows,{rowSelection:r}=e.getState();let o=!!(n.length&&Object.keys(r).length);return o&&n.some(s=>s.getCanSelect()&&!r[s.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:r}=e.getState();let o=!!n.length;return o&&n.some(s=>!r[s.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var n;const r=Object.keys((n=e.getState().rowSelection)!=null?n:{}).length;return r>0&&r{const n=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:n.filter(r=>r.getCanSelect()).some(r=>r.getIsSelected()||r.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>n=>{e.toggleAllRowsSelected(n.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>n=>{e.toggleAllPageRowsSelected(n.target.checked)}},createRow:(e,n)=>{e.toggleSelected=(r,o)=>{const s=e.getIsSelected();n.setRowSelection(l=>{var u;if(r=typeof r<"u"?r:!s,e.getCanSelect()&&s===r)return l;const d={...l};return Mm(d,e.id,r,(u=o?.selectChildren)!=null?u:!0,n),d})},e.getIsSelected=()=>{const{rowSelection:r}=n.getState();return Gp(e,r)},e.getIsSomeSelected=()=>{const{rowSelection:r}=n.getState();return Nm(e,r)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=n.getState();return Nm(e,r)==="all"},e.getCanSelect=()=>{var r;return typeof n.options.enableRowSelection=="function"?n.options.enableRowSelection(e):(r=n.options.enableRowSelection)!=null?r:!0},e.getCanSelectSubRows=()=>{var r;return typeof n.options.enableSubRowSelection=="function"?n.options.enableSubRowSelection(e):(r=n.options.enableSubRowSelection)!=null?r:!0},e.getCanMultiSelect=()=>{var r;return typeof n.options.enableMultiRowSelection=="function"?n.options.enableMultiRowSelection(e):(r=n.options.enableMultiRowSelection)!=null?r:!0},e.getToggleSelectedHandler=()=>{const r=e.getCanSelect();return o=>{var s;r&&e.toggleSelected((s=o.target)==null?void 0:s.checked)}}}},Mm=(e,n,r,o,s)=>{var l;const u=s.getRow(n,!0);r?(u.getCanMultiSelect()||Object.keys(e).forEach(d=>delete e[d]),u.getCanSelect()&&(e[n]=!0)):delete e[n],o&&(l=u.subRows)!=null&&l.length&&u.getCanSelectSubRows()&&u.subRows.forEach(d=>Mm(e,d.id,r,o,s))};function Kh(e,n){const r=e.getState().rowSelection,o=[],s={},l=function(u,d){return u.map(p=>{var m;const y=Gp(p,r);if(y&&(o.push(p),s[p.id]=p),(m=p.subRows)!=null&&m.length&&(p={...p,subRows:l(p.subRows)}),y)return p}).filter(Boolean)};return{rows:l(n.rows),flatRows:o,rowsById:s}}function Gp(e,n){var r;return(r=n[e.id])!=null?r:!1}function Nm(e,n,r){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let s=!0,l=!1;return e.subRows.forEach(u=>{if(!(l&&!s)&&(u.getCanSelect()&&(Gp(u,n)?l=!0:s=!1),u.subRows&&u.subRows.length)){const d=Nm(u,n);d==="all"?l=!0:(d==="some"&&(l=!0),s=!1)}}),s?"all":l?"some":!1}const Dm=/([0-9]+)/gm,B3=(e,n,r)=>N_(Ui(e.getValue(r)).toLowerCase(),Ui(n.getValue(r)).toLowerCase()),q3=(e,n,r)=>N_(Ui(e.getValue(r)),Ui(n.getValue(r))),G3=(e,n,r)=>Zp(Ui(e.getValue(r)).toLowerCase(),Ui(n.getValue(r)).toLowerCase()),Z3=(e,n,r)=>Zp(Ui(e.getValue(r)),Ui(n.getValue(r))),K3=(e,n,r)=>{const o=e.getValue(r),s=n.getValue(r);return o>s?1:oZp(e.getValue(r),n.getValue(r));function Zp(e,n){return e===n?0:e>n?1:-1}function Ui(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function N_(e,n){const r=e.split(Dm).filter(Boolean),o=n.split(Dm).filter(Boolean);for(;r.length&&o.length;){const s=r.shift(),l=o.shift(),u=parseInt(s,10),d=parseInt(l,10),p=[u,d].sort();if(isNaN(p[0])){if(s>l)return 1;if(l>s)return-1;continue}if(isNaN(p[1]))return isNaN(u)?-1:1;if(u>d)return 1;if(d>u)return-1}return r.length-o.length}const Ps={alphanumeric:B3,alphanumericCaseSensitive:q3,text:G3,textCaseSensitive:Z3,datetime:K3,basic:Y3},Q3={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Hn("sorting",e),isMultiSortEvent:n=>n.shiftKey}),createColumn:(e,n)=>{e.getAutoSortingFn=()=>{const r=n.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const s of r){const l=s?.getValue(e.id);if(Object.prototype.toString.call(l)==="[object Date]")return Ps.datetime;if(typeof l=="string"&&(o=!0,l.split(Dm).length>1))return Ps.alphanumeric}return o?Ps.text:Ps.basic},e.getAutoSortDir=()=>{const r=n.getFilteredRowModel().flatRows[0];return typeof r?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var r,o;if(!e)throw new Error;return Xu(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(r=(o=n.options.sortingFns)==null?void 0:o[e.columnDef.sortingFn])!=null?r:Ps[e.columnDef.sortingFn]},e.toggleSorting=(r,o)=>{const s=e.getNextSortingOrder(),l=typeof r<"u"&&r!==null;n.setSorting(u=>{const d=u?.find(x=>x.id===e.id),p=u?.findIndex(x=>x.id===e.id);let m=[],y,v=l?r:s==="desc";if(u!=null&&u.length&&e.getCanMultiSort()&&o?d?y="toggle":y="add":u!=null&&u.length&&p!==u.length-1?y="replace":d?y="toggle":y="replace",y==="toggle"&&(l||s||(y="remove")),y==="add"){var b;m=[...u,{id:e.id,desc:v}],m.splice(0,m.length-((b=n.options.maxMultiSortColCount)!=null?b:Number.MAX_SAFE_INTEGER))}else y==="toggle"?m=u.map(x=>x.id===e.id?{...x,desc:v}:x):y==="remove"?m=u.filter(x=>x.id!==e.id):m=[{id:e.id,desc:v}];return m})},e.getFirstSortDir=()=>{var r,o;return((r=(o=e.columnDef.sortDescFirst)!=null?o:n.options.sortDescFirst)!=null?r:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=r=>{var o,s;const l=e.getFirstSortDir(),u=e.getIsSorted();return u?u!==l&&((o=n.options.enableSortingRemoval)==null||o)&&(!(r&&(s=n.options.enableMultiRemove)!=null)||s)?!1:u==="desc"?"asc":"desc":l},e.getCanSort=()=>{var r,o;return((r=e.columnDef.enableSorting)!=null?r:!0)&&((o=n.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var r,o;return(r=(o=e.columnDef.enableMultiSort)!=null?o:n.options.enableMultiSort)!=null?r:!!e.accessorFn},e.getIsSorted=()=>{var r;const o=(r=n.getState().sorting)==null?void 0:r.find(s=>s.id===e.id);return o?o.desc?"desc":"asc":!1},e.getSortIndex=()=>{var r,o;return(r=(o=n.getState().sorting)==null?void 0:o.findIndex(s=>s.id===e.id))!=null?r:-1},e.clearSorting=()=>{n.setSorting(r=>r!=null&&r.length?r.filter(o=>o.id!==e.id):[])},e.getToggleSortingHandler=()=>{const r=e.getCanSort();return o=>{r&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?n.options.isMultiSortEvent==null?void 0:n.options.isMultiSortEvent(o):!1))}}},createTable:e=>{e.setSorting=n=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(n),e.resetSorting=n=>{var r,o;e.setSorting(n?[]:(r=(o=e.initialState)==null?void 0:o.sorting)!=null?r:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},X3=[v3,$3,N3,D3,b3,x3,I3,V3,Q3,A3,F3,P3,U3,H3,k3];function J3(e){var n,r;const o=[...X3,...(n=e._features)!=null?n:[]];let s={_features:o};const l=s._features.reduce((b,x)=>Object.assign(b,x.getDefaultOptions==null?void 0:x.getDefaultOptions(s)),{}),u=b=>s.options.mergeOptions?s.options.mergeOptions(l,b):{...l,...b};let p={...{},...(r=e.initialState)!=null?r:{}};s._features.forEach(b=>{var x;p=(x=b.getInitialState==null?void 0:b.getInitialState(p))!=null?x:p});const m=[];let y=!1;const v={_features:o,options:{...l,...e},initialState:p,_queue:b=>{m.push(b),y||(y=!0,Promise.resolve().then(()=>{for(;m.length;)m.shift()();y=!1}).catch(x=>setTimeout(()=>{throw x})))},reset:()=>{s.setState(s.initialState)},setOptions:b=>{const x=Ni(b,s.options);s.options=u(x)},getState:()=>s.options.state,setState:b=>{s.options.onStateChange==null||s.options.onStateChange(b)},_getRowId:(b,x,C)=>{var _;return(_=s.options.getRowId==null?void 0:s.options.getRowId(b,x,C))!=null?_:`${C?[C.id,x].join("."):x}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(b,x)=>{let C=(x?s.getPrePaginationRowModel():s.getRowModel()).rowsById[b];if(!C&&(C=s.getCoreRowModel().rowsById[b],!C))throw new Error;return C},_getDefaultColumnDef:Le(()=>[s.options.defaultColumn],b=>{var x;return b=(x=b)!=null?x:{},{header:C=>{const _=C.header.column.columnDef;return _.accessorKey?_.accessorKey:_.accessorFn?_.id:null},cell:C=>{var _,E;return(_=(E=C.renderValue())==null||E.toString==null?void 0:E.toString())!=null?_:null},...s._features.reduce((C,_)=>Object.assign(C,_.getDefaultColumnDef==null?void 0:_.getDefaultColumnDef()),{}),...b}},$e(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:Le(()=>[s._getColumnDefs()],b=>{const x=function(C,_,E){return E===void 0&&(E=0),C.map(T=>{const O=g3(s,T,E,_),A=T;return O.columns=A.columns?x(A.columns,O,E+1):[],O})};return x(b)},$e(e,"debugColumns")),getAllFlatColumns:Le(()=>[s.getAllColumns()],b=>b.flatMap(x=>x.getFlatColumns()),$e(e,"debugColumns")),_getAllFlatColumnsById:Le(()=>[s.getAllFlatColumns()],b=>b.reduce((x,C)=>(x[C.id]=C,x),{}),$e(e,"debugColumns")),getAllLeafColumns:Le(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(b,x)=>{let C=b.flatMap(_=>_.getLeafColumns());return x(C)},$e(e,"debugColumns")),getColumn:b=>s._getAllFlatColumnsById()[b]};Object.assign(s,v);for(let b=0;bLe(()=>[e.options.data],n=>{const r={rows:[],flatRows:[],rowsById:{}},o=function(s,l,u){l===void 0&&(l=0);const d=[];for(let m=0;me._autoResetPageIndex()))}function z_(){return e=>Le(()=>[e.getState().sorting,e.getPreSortedRowModel()],(n,r)=>{if(!r.rows.length||!(n!=null&&n.length))return r;const o=e.getState().sorting,s=[],l=o.filter(p=>{var m;return(m=e.getColumn(p.id))==null?void 0:m.getCanSort()}),u={};l.forEach(p=>{const m=e.getColumn(p.id);m&&(u[p.id]={sortUndefined:m.columnDef.sortUndefined,invertSorting:m.columnDef.invertSorting,sortingFn:m.getSortingFn()})});const d=p=>{const m=p.map(y=>({...y}));return m.sort((y,v)=>{for(let x=0;x{var v;s.push(y),(v=y.subRows)!=null&&v.length&&(y.subRows=d(y.subRows))}),m};return{rows:d(r.rows),flatRows:s,rowsById:r.rowsById}},$e(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function zm(e,n){return e?W3(e)?w.createElement(e,n):e:null}function W3(e){return e4(e)||typeof e=="function"||t4(e)}function e4(e){return typeof e=="function"&&(()=>{const n=Object.getPrototypeOf(e);return n.prototype&&n.prototype.isReactComponent})()}function t4(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function k_(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[r]=w.useState(()=>({current:J3(n)})),[o,s]=w.useState(()=>r.current.initialState);return r.current.setOptions(l=>({...l,...e,state:{...o,...e.state},onStateChange:u=>{s(u),e.onStateChange==null||e.onStateChange(u)}})),r.current}var xl=e=>e.type==="checkbox",Di=e=>e instanceof Date,an=e=>e==null;const Kp=e=>typeof e=="object";var Ot=e=>!an(e)&&!Array.isArray(e)&&Kp(e)&&!Di(e),n4=e=>Ot(e)&&e.target?xl(e.target)?e.target.checked:e.target.value:e,r4=(e,n)=>n.split(".").some((r,o,s)=>!isNaN(Number(r))&&e.has(s.slice(0,o).join("."))),L_=e=>{const n=e.constructor&&e.constructor.prototype;return Ot(n)&&n.hasOwnProperty("isPrototypeOf")},Ju=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Nt(e){if(e instanceof Date)return new Date(e);const n=typeof FileList<"u"&&e instanceof FileList;if(Ju&&(e instanceof Blob||n))return e;const r=Array.isArray(e);if(!r&&!(Ot(e)&&L_(e)))return e;const o=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(o[s]=Nt(e[s]));return o}const Ea={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},pr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},hr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},$_="root",Yp=["__proto__","constructor","prototype"],i4=/^\w*$/;var wl=e=>i4.test(e),vt=e=>e===void 0;const o4=/[.[\]'"]/;var Wu=e=>e.split(o4).filter(Boolean),Se=(e,n,r)=>{if(!n||!Ot(e))return r;const o=wl(n)?[n]:Wu(n);if(o.some(l=>Yp.includes(l)))return r;const s=o.reduce((l,u)=>an(l)?void 0:l[u],e);return vt(s)||s===e?vt(e[n])?r:e[n]:s},Rr=e=>typeof e=="boolean",tr=e=>typeof e=="function",ut=(e,n,r)=>{let o=-1;const s=wl(n)?[n]:Wu(n),l=s.length,u=l-1;for(;++o{const s={};for(const l in e)Object.defineProperty(s,l,{get:()=>{const u=l;return n._proxyFormState[u]!==pr.all&&(n._proxyFormState[u]=!o||pr.all),e[u]}});return s};const l4=Ju?he.useLayoutEffect:he.useEffect;var ln=e=>typeof e=="string",c4=(e,n,r,o,s)=>ln(e)?(o&&n.watch.add(e),Se(r,e,s)):Array.isArray(e)?e.map(l=>(o&&n.watch.add(l),Se(r,l))):(o&&(n.watchAll=!0),r),km=e=>an(e)||!Kp(e);const mx=(e,n)=>n.length===0&&!Array.isArray(e)&&!L_(e);function Tr(e,n,r=new WeakMap){if(e===n)return!0;if(km(e)||km(n))return Object.is(e,n);if(Di(e)&&Di(n))return Object.is(e.getTime(),n.getTime());const o=Object.keys(e),s=Object.keys(n);if(o.length!==s.length)return!1;if(mx(e,o)||mx(n,s))return Object.is(e,n);if(!o.length&&Array.isArray(e)!==Array.isArray(n))return!1;const l=r.get(e);if(l&&l.has(n))return!0;if(l)l.add(n);else{const u=new WeakSet;u.add(n),r.set(e,u)}for(const u of o){const d=e[u];if(!(u in n))return!1;if(u!=="ref"){const p=n[u];if(Di(d)&&Di(p)||(Ot(d)||Array.isArray(d))&&(Ot(p)||Array.isArray(p))?!Tr(d,p,r):!Object.is(d,p))return!1}}return!0}var Yc=e=>({isOnSubmit:!e||e===pr.onSubmit,isOnBlur:e===pr.onBlur,isOnChange:e===pr.onChange,isOnAll:e===pr.all,isOnTouch:e===pr.onTouched}),Yh=(e,n,r)=>{if(r)return!1;if(n.watchAll||n.watch.has(e))return!0;for(const o of n.watch)if(e.startsWith(o)&&e.charAt(o.length)===".")return!0;return!1};const Xs=(e,n,r,o)=>{for(const s of r||Object.keys(e)){const l=Se(e,s);if(l){const{_f:u,...d}=l;if(u){if(u.refs&&u.refs[0]&&n(u.refs[0],s)&&!o)return!0;if(u.ref&&n(u.ref,u.name)&&!o)return!0;if(Xs(d,n))break}else if(Ot(d)&&Xs(d,n))break}}};var px=(e,n,r)=>{const o=Se(e,r),s=Array.isArray(o)?o:[];return ut(s,$_,n[r]),ut(e,r,s),e},on=e=>Ot(e)&&!Object.keys(e).length,Qp=e=>e.type==="file",bu=e=>{if(!Ju)return!1;const n=e?e.ownerDocument:0;return e instanceof(n&&n.defaultView?n.defaultView.HTMLElement:HTMLElement)},Xp=e=>e.type==="radio",xu=e=>e instanceof RegExp,Jp=(e,n,r,o,s)=>n?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[o]:s||!0}}:{};const gx={value:!1,isValid:!1},vx={value:!0,isValid:!0};var I_=e=>{if(Array.isArray(e)){if(e.length>1){const n=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:n,isValid:!!n.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!vt(e[0].attributes.value)?vt(e[0].value)||e[0].value===""?vx:{value:e[0].value,isValid:!0}:vx:gx}return gx};const yx={isValid:!1,value:null};var V_=e=>Array.isArray(e)?e.reduce((n,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:n,yx):yx;function bx(e,n,r="validate"){if(ln(e)||Array.isArray(e)&&e.every(ln)||Rr(e)&&!e)return{type:r,message:ln(e)?e:"",ref:n}}var Ra=e=>Ot(e)&&!xu(e)?e:{value:e,message:""},xx=async(e,n,r,o,s,l)=>{const{ref:u,refs:d,required:p,maxLength:m,minLength:y,min:v,max:b,pattern:x,validate:C,name:_,valueAsNumber:E,mount:T}=e._f,O=Se(r,_);if(!T||n.has(_))return{};const A=d?d[0]:u,z=ce=>{if(s&&A.reportValidity){const le=Rr(ce)?"":ce||"";d?d.forEach(me=>me.setCustomValidity(le)):A.setCustomValidity(le),A.reportValidity()}},L={},B=Xp(u),H=xl(u),I=B||H,ne=(E||Qp(u))&&vt(u.value)&&vt(O)||bu(u)&&u.value===""||O===""||Array.isArray(O)&&!O.length,ve=Jp.bind(null,_,o,L),fe=(ce,le,me,xe=hr.maxLength,N=hr.minLength)=>{const Z=ce?le:me;L[_]={type:ce?xe:N,message:Z,ref:u,...ve(ce?xe:N,Z)}};if(l?!Array.isArray(O)||!O.length:p&&(!I&&(ne||an(O))||Rr(O)&&!O||H&&!I_(d).isValid||B&&!V_(d).isValid)){const{value:ce,message:le}=ln(p)?{value:!!p,message:p}:Ra(p);if(ce&&(L[_]={type:hr.required,message:le,ref:A,...ve(hr.required,le)},!o))return z(le),L}if(!ne&&(!an(v)||!an(b))){let ce,le;const me=Ra(b),xe=Ra(v);if(!an(O)&&!isNaN(O)){const N=u.valueAsNumber||O&&+O;an(me.value)||(ce=N>me.value),an(xe.value)||(le=Nnew Date(new Date().toDateString()+" "+ee),re=u.type=="time",W=u.type=="week";ln(me.value)&&O&&(ce=re?Z(O)>Z(me.value):W?O>me.value:N>new Date(me.value)),ln(xe.value)&&O&&(le=re?Z(O)+ce.value,xe=!an(le.value)&&O.length<+le.value;if((me||xe)&&(fe(me,ce.message,le.message),!o))return z(L[_].message),L}if(x&&!ne&&ln(O)){const{value:ce,message:le}=Ra(x);if(xu(ce)&&!O.match(ce)&&(L[_]={type:hr.pattern,message:le,ref:u,...ve(hr.pattern,le)},!o))return z(le),L}if(C){if(tr(C)){const ce=await C(O,r),le=bx(ce,A);if(le&&(L[_]={...le,...ve(hr.validate,le.message)},!o))return z(le.message),L}else if(Ot(C)){let ce={};for(const le in C){if(!on(ce)&&!o)break;const me=bx(await C[le](O,r),A,le);me&&(ce={...me,...ve(le,me.message)},z(me.message),o&&(L[_]=ce))}if(!on(ce)&&(L[_]={ref:A,...ce},!o))return L}}return z(!0),L},ou=e=>Array.isArray(e)?e:[e],F_=e=>Array.isArray(e)?e.filter(Boolean):[];function u4(e,n){const r=n.slice(0,-1).length;let o=0;for(;oYp.includes(String(u))))return e;const o=r.length===1?e:u4(e,r),s=r.length-1,l=r[s];return o&&delete o[l],s!==0&&(Ot(o)&&on(o)||Array.isArray(o)&&d4(o))&&Dt(e,r.slice(0,-1)),e}const P_=e=>{const n={};for(const r of Object.keys(e))if(Kp(e[r])&&e[r]!==null&&!Di(e[r])){const o=P_(e[r]);for(const s of Object.keys(o))n[`${r}.${s}`]=o[s]}else n[r]=e[r];return n},f4=he.createContext(null);f4.displayName="HookFormContext";var wx=()=>{let e=[];return{get observers(){return e},next:s=>{for(const l of e)l.next&&l.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(l=>l!==s)}}),unsubscribe:()=>{e=[]}}};function U_(e,n){const r={};for(const o in e)if(e.hasOwnProperty(o)){const s=e[o],l=n[o];if(s&&Ot(s)&&l){const u=U_(s,l);Ot(u)&&(r[o]=u)}else e[o]&&(r[o]=l)}return r}var H_=e=>e.type==="select-multiple",h4=e=>Xp(e)||xl(e),Qh=e=>bu(e)&&e.isConnected,m4=e=>{for(const n in e)if(tr(e[n]))return!0;return!1};function B_(e){return Array.isArray(e)||Ot(e)&&!m4(e)}function q_(e){return!!(e&&"_f"in e)}function G_(e){return Array.isArray(e)?!e.some(n=>!vt(n)):!Object.keys(e).length}function Lm(e,n){Array.isArray(e)?e[n]=void 0:delete e[n]}function $m(e,n={},r){for(const o in e){const s=e[o],l=r&&r[o];B_(s)&&(!Array.isArray(s)||!q_(l))?(n[o]=Array.isArray(s)?[]:{},$m(s,n[o],l),G_(n[o])&&Lm(n,o)):vt(s)||(n[o]=!0)}return n}function yo(e,n,r,o){r||(r=$m(n,{},o));for(const s in e){const l=e[s],u=o&&o[s];B_(l)&&(!Array.isArray(l)||!q_(u))?(vt(n)||km(r[s])?r[s]=$m(l,Array.isArray(l)?[]:{},u):yo(l,an(n)?{}:n[s],r[s],u),G_(r[s])&&Lm(r,s)):Tr(l,n[s])?Lm(r,s):r[s]=!0}return r}var Z_=(e,{valueAsNumber:n,valueAsDate:r,setValueAs:o})=>vt(e)?e:n?e===""?NaN:e&&+e:r&&ln(e)?new Date(e):o?o(e):e;function Sx(e){const n=e.ref;return Qp(n)?n.files:Xp(n)?V_(e.refs).value:H_(n)?[...n.selectedOptions].map(({value:r})=>r):xl(n)?I_(e.refs).value:Z_(vt(n.value)?e.ref.value:n.value,e)}var p4=(e,n,r,o)=>{const s={};for(const l of e){const u=Se(n,l);u&&ut(s,l,u._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:o}},Us=e=>vt(e)?e:xu(e)?e.source:Ot(e)?xu(e.value)?e.value.source:e.value:e;const _x="AsyncFunction";var g4=e=>{if(!e||!e.validate)return!1;if(tr(e.validate))return e.validate.constructor.name===_x;if(Ot(e.validate)){for(const n in e.validate)if(e.validate[n].constructor.name===_x)return!0}return!1},v4=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Cx(e,n,r){const o=Se(e,r);if(o||wl(r))return{error:o,name:r};const s=r.split(".");for(;s.length;){const l=s.join("."),u=Se(n,l),d=Se(e,l);if(u&&!Array.isArray(u)&&r!==l)return{name:r};if(d&&d.type)return{name:l,error:d};if(d&&d.root&&d.root.type)return{name:`${l}.root`,error:d.root};s.pop()}return{name:r}}var y4=(e,n,r,o)=>{r(e);const{name:s,...l}=e,u=Object.keys(l);return!u.length||o&&u.length>=Object.keys(n).length||u.find(d=>n[d]===(!o||pr.all))},b4=(e,n,r)=>!e||!n||e===n||ou(e).some(o=>o&&(r?o===n||o.startsWith(n+"."):o.startsWith(n)||n.startsWith(o))),x4=(e,n,r,o,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(n||e):(r?o.isOnBlur:s.isOnBlur)?!e:(r?o.isOnChange:s.isOnChange)?e:!0,w4=(e,n)=>!F_(Se(e,n)).length&&Dt(e,n);const S4={mode:pr.onSubmit,reValidateMode:pr.onChange,shouldFocusError:!0},Xh="form",K_={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function _4(e={}){let n={...S4,...e},r={...Nt(K_),isLoading:tr(n.defaultValues),errors:n.errors||{},disabled:n.disabled||!1},o={},s=Ot(n.defaultValues)||Ot(n.values)?Nt(n.defaultValues||n.values)||{}:{},l=n.shouldUnregister?{}:Nt(s),u={action:!1,mount:!1,watch:!1,keepIsValid:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const p={},m={};let y=0,v=Yc(n.mode),b=Yc(n.reValidateMode);const x={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},C={...x};let _={...C};const E={array:wx(),state:wx()};let T=0;const O=n.criteriaMode===pr.all,A=(j,V)=>F=>{clearTimeout(m[j]),m[j]=setTimeout(V,F)},z=async j=>{if(!u.keepIsValid&&!n.disabled&&(C.isValid||_.isValid||j)){const V=++T;let F;n.resolver?(F=on((await me()).errors),V===T&&L()):F=await Z({fields:o,onlyCheckValid:!0,eventType:Ea.VALID}),V===T&&F!==r.isValid&&E.state.next({isValid:F})}},L=(j,V)=>{!n.disabled&&(C.isValidating||C.validatingFields||_.isValidating||_.validatingFields)&&((j||Array.from(d.mount)).forEach(F=>{F&&(V?ut(r.validatingFields,F,V):Dt(r.validatingFields,F))}),E.state.next({validatingFields:r.validatingFields,isValidating:!on(r.validatingFields)}))},B=()=>{r.dirtyFields=yo(s,l,void 0,o)},H=(j,V=[],F,se,de=!0,pe=!0)=>{if(se&&F&&!n.disabled){if(u.action=!0,pe&&Array.isArray(Se(o,j))){const be=F(Se(o,j),se.argA,se.argB);de&&ut(o,j,be)}if(pe&&Array.isArray(Se(r.errors,j))){const be=F(Se(r.errors,j),se.argA,se.argB);de&&ut(r.errors,j,be),w4(r.errors,j)}if((C.touchedFields||_.touchedFields)&&pe&&Array.isArray(Se(r.touchedFields,j))){const be=F(Se(r.touchedFields,j),se.argA,se.argB);de&&ut(r.touchedFields,j,be)}(C.dirtyFields||_.dirtyFields)&&B(),E.state.next({name:j,isDirty:W(j,V),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ut(l,j,V)},I=(j,V)=>{ut(r.errors,j,V),r.errors={...r.errors},E.state.next({errors:r.errors})},ne=j=>{r.errors=j,E.state.next({errors:r.errors,isValid:!1})},ve=j=>{const V=wl(j)?[j]:Wu(j);let F=l,se=s;for(let de=0;de{const de=Se(o,j);if(de){if(ve(j))return;const pe=vt(Se(l,j)),be=Se(l,j,vt(F)?Se(s,j):F);vt(be)||se&&se.defaultChecked||V?ut(l,j,V?be:Sx(de._f)):M(j,be),u.mount&&!u.action&&(z(),pe&&r.isDirty&&(C.isDirty||_.isDirty)&&(W()||(r.isDirty=!1,E.state.next({...r}))),e.shouldUnregister&&pe&&!vt(Se(l,j))&&Yh(j,d)&&(u.watch=!0))}},ce=(j,V,F,se,de)=>{let pe=!1,be=!1;const we={name:j};if(!n.disabled||se===!0){if(!F||se){const Te=Tr(Se(s,j),V);(C.isDirty||_.isDirty)&&(be=r.isDirty,r.isDirty=we.isDirty=!Te||W(),pe=be!==we.isDirty),be=!!Se(r.dirtyFields,j),Te!==r.isDirty?r.dirtyFields=yo(s,l,void 0,o):Te?Dt(r.dirtyFields,j):ut(r.dirtyFields,j,!0),we.dirtyFields=r.dirtyFields,pe=pe||(C.dirtyFields||_.dirtyFields)&&be!==!Te}if(F){const Te=Se(r.touchedFields,j);Te||(ut(r.touchedFields,j,F),we.touchedFields=r.touchedFields,pe=pe||(C.touchedFields||_.touchedFields)&&Te!==F)}pe&&de&&E.state.next(we)}return pe?we:{}},le=(j,V,F,se)=>{const de=Se(r.errors,j),pe=(C.isValid||_.isValid)&&Rr(V)&&r.isValid!==V;if(n.delayError&&F?(p[j]=A(j,()=>I(j,F)),p[j](n.delayError)):(clearTimeout(m[j]),delete p[j],F?ut(r.errors,j,F):Dt(r.errors,j),r.errors={...r.errors}),(F?!Tr(de,F):de)||!on(se)||pe){const be={...se,...pe&&Rr(V)?{isValid:V}:{},errors:r.errors,name:j};r={...r,...be},E.state.next(be)}},me=async j=>(L(j,!0),await n.resolver(l,n.context,p4(j||d.mount,o,n.criteriaMode,n.shouldUseNativeValidation))),xe=async j=>{const{errors:V}=await me(j);if(L(j),j){for(const F of j){const se=Se(V,F);se?d.array.has(F)&&Ot(se)&&!Object.keys(se).some(de=>!Number.isNaN(Number(de)))?px(r.errors,{[F]:se},F):ut(r.errors,F,se):Dt(r.errors,F)}r.errors={...r.errors}}else r.errors=V;return V},N=async({name:j,eventType:V})=>{if(e.validate){const F=await e.validate({formValues:l,formState:r,name:j,eventType:V});if(Ot(F))for(const se in F){const de=F[se];de&&ht(`${Xh}.${se}`,{message:ln(de.message)?de.message:"",type:de.type||hr.validate})}else ln(F)||!F?ht(Xh,{message:F||"",type:hr.validate}):Ue(Xh);return F}return!0},Z=async({fields:j,onlyCheckValid:V,name:F,eventType:se,context:de={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(de.runRootValidation=!0,!await N({name:F,eventType:se})&&(de.valid=!1,V)))return de.valid;for(const pe in j){const be=j[pe];if(be){const{_f:we,...Te}=be;if(we){const nt=d.array.has(we.name),St=be._f&&g4(be._f),Jt=C.validatingFields||C.isValidating||_.validatingFields||_.isValidating;St&&Jt&&L([we.name],!0);const Lt=await xx(be,d.disabled,l,O,n.shouldUseNativeValidation&&!V,nt);if(St&&Jt&&L([we.name]),Lt[we.name]&&(de.valid=!1,V)||(!V&&(Se(Lt,we.name)?nt?px(r.errors,Lt,we.name):ut(r.errors,we.name,Lt[we.name]):Dt(r.errors,we.name)),e.shouldUseNativeValidation&&Lt[we.name]))break}!on(Te)&&await Z({context:de,onlyCheckValid:V,fields:Te,name:pe,eventType:se})}}return de.valid},re=()=>{for(const j of d.unMount){const V=Se(o,j);V&&(V._f.refs?V._f.refs.every(F=>!Qh(F)):!Qh(V._f.ref))&&Xt(j)}d.unMount=new Set},W=(j,V)=>(j&&V&&ut(l,j,V),!Tr(u.mount?l:s,s)),ee=(j,V,F)=>c4(j,d,{...u.mount?l:vt(V)?s:ln(j)?{[j]:V}:V},F,V),D=j=>F_(Se(u.mount?l:s,j,n.shouldUnregister?Se(s,j,[]):[])),M=(j,V,F={},se=!1,de=!1)=>{const pe=Se(o,j);let be=V;if(pe){const we=pe._f;we&&(!we.disabled&&ut(l,j,Z_(V,we)),be=bu(we.ref)&&an(V)?"":V,H_(we.ref)?[...we.ref.options].forEach(Te=>Te.selected=be.includes(Te.value)):we.refs?xl(we.ref)?we.refs.forEach(Te=>{(!Te.defaultChecked||!Te.disabled)&&(Array.isArray(be)?Te.checked=!!be.find(nt=>nt===Te.value):Te.checked=be===Te.value||!!be)}):we.refs.forEach(Te=>Te.checked=Te.value===be):Qp(we.ref)?we.ref.value="":(we.ref.value=be,!we.ref.type&&!de&&E.state.next({name:j,values:se?l:Nt(l)})))}(F.shouldDirty||F.shouldTouch)&&ce(j,be,F.shouldTouch,F.shouldDirty,!de),F.shouldValidate&&ye(j,{delayError:F.delayError})},U=(j,V,F,se=!1,de=!1)=>{for(const pe in V){if(!V.hasOwnProperty(pe))return;const be=V[pe],we=j+"."+pe,Te=Se(o,we);(d.array.has(j)||Ot(be)||Te&&!Te._f)&&!Di(be)?U(we,be,F,se,de):M(we,be,F,se,de)}},Q=(j,V,F,se,de=!1)=>{const pe=Se(o,j),be=d.array.has(j),we=se?V:Nt(V),Te=Se(l,j),nt=Tr(Te,we);if(nt||ut(l,j,we),be)E.array.next({name:j,values:se?l:Nt(l)}),(C.isDirty||C.dirtyFields||_.isDirty||_.dirtyFields)&&F.shouldDirty&&(B(),de||E.state.next({name:j,dirtyFields:r.dirtyFields,isDirty:W(j,we)}));else{const St=Array.isArray(we)&&!we.length||on(we);!pe||pe._f||an(we)||St?M(j,we,F,se,de):U(j,we,F,se,de)}if(!nt&&!de){const St=Yh(j,d),Jt=se?l:Nt(l);E.state.next({...St&&r,name:u.mount||St?j:void 0,values:Jt})}},K=(j,V,F={})=>Q(j,V,F,!1),ae=(j,V={})=>{const F=tr(j)?j(l):j;if(!Tr(l,F)){l={...l,...F};const se=P_(F);for(const de of d.mount)de in se&&Q(de,se[de],V,!0,!0);E.state.next({...r,name:void 0,type:void 0,...y?{values:l}:{}}),V.shouldValidate&&z()}},J=async j=>{u.mount=!0;const V=j.target;let F=V.name,se=!0;const de=Se(o,F),pe=be=>{se=Number.isNaN(be)||Di(be)&&isNaN(be.getTime())||Tr(be,Se(l,F,be))};if(de){let be,we;const Te=V.type?Sx(de._f):n4(j),nt=j.type===Ea.BLUR||j.type===Ea.FOCUS_OUT,St=!v4(de._f)&&!e.validate&&!n.resolver&&!Se(r.errors,F)&&!de._f.deps,Jt=St||x4(nt,Se(r.touchedFields,F),r.isSubmitted,b,v),Lt=Yh(F,d,nt);if(ut(l,F,Te),nt){if(!V||!V.readOnly){de._f.onBlur&&de._f.onBlur(j);const bt=p[F];bt&&bt(0)}}else de._f.onChange&&de._f.onChange(j);const Me=ce(F,Te,nt),mt=!on(Me)||Lt;if(!nt&&E.state.next({name:F,type:j.type,...y?{values:Nt(l)}:{}}),Jt)return(!St||!r.isValid)&&(C.isValid||_.isValid)&&(n.mode==="onBlur"?nt&&z():nt||z()),mt&&E.state.next({name:F,...Lt?{}:Me});if(!n.resolver&&e.validate&&await N({name:F,eventType:j.type}),!nt&&Lt&&E.state.next({...r}),n.resolver){const{errors:bt}=await me([F]);if(L([F]),pe(Te),!se){!on(Me)&&E.state.next(Me);return}const Zt=Cx(r.errors,o,F),sr=Cx(bt,o,Zt.name||F);be=sr.error,F=sr.name,we=on(bt)}else L([F],!0),be=(await xx(de,d.disabled,l,O,n.shouldUseNativeValidation))[F],L([F]),pe(Te),se&&(be?we=!1:(C.isValid||_.isValid)&&(we=await Z({fields:o,onlyCheckValid:!0,name:F,eventType:j.type})));se&&(de._f.deps&&(!Array.isArray(de._f.deps)||de._f.deps.length>0)&&ye(de._f.deps),le(F,we,be,Me))}},ge=(j,V)=>{if(Se(r.errors,V)&&j.focus)return j.focus(),1},ye=async(j,V={})=>{let F,se;const de=ou(j);if(n.resolver){const pe=await xe(vt(j)?j:de);F=on(pe),se=j?!de.some(be=>Se(pe,be)):F}else j?(se=(await Promise.all(de.map(async pe=>{const be=Se(o,pe);return await Z({fields:be&&be._f?{[pe]:be}:be,eventType:Ea.TRIGGER})}))).every(Boolean),!(!se&&!r.isValid)&&z()):se=F=await Z({fields:o,name:j,eventType:Ea.TRIGGER});if(V.delayError&&n.delayError&&ln(j)){const pe=Se(r.errors,j);pe?(Dt(r.errors,j),p[j]=A(j,()=>I(j,pe)),p[j](n.delayError)):(clearTimeout(m[j]),delete p[j])}return E.state.next({...!ln(j)||(C.isValid||_.isValid)&&F!==r.isValid?{}:{name:j},...n.resolver||!j?{isValid:F}:{},errors:r.errors}),V.shouldFocus&&!se&&Xs(o,ge,j?de:d.mount),se},Ne=(j,V)=>{let F={...u.mount?l:s};return V&&(F=U_(V.dirtyFields?r.dirtyFields:r.touchedFields,F)),vt(j)?F:ln(j)?Se(F,j):j.map(se=>Se(F,se))},Fe=(j,V)=>({invalid:!!Se((V||r).errors,j),isDirty:!!Se((V||r).dirtyFields,j),error:Se((V||r).errors,j),isValidating:!!Se(r.validatingFields,j),isTouched:!!Se((V||r).touchedFields,j)}),Ue=j=>{const V=j?ou(j):void 0;V?.forEach(F=>Dt(r.errors,F)),V?V.forEach(F=>{E.state.next({name:F,errors:r.errors})}):E.state.next({errors:{}})},ht=(j,V,F)=>{const se=(Se(o,j,{_f:{}})._f||{}).ref,de=Se(r.errors,j)||{},{ref:pe,message:be,type:we,...Te}=de;ut(r.errors,j,{...Te,...V,ref:se}),E.state.next({name:j,errors:r.errors,isValid:!1}),F&&F.shouldFocus&&se&&se.focus&&se.focus()},Je=(j,V)=>{if(tr(j)){y++;const{unsubscribe:F}=E.state.subscribe({next:de=>"values"in de&&j(de.values||ee(void 0,V),de)});let se=!1;return{unsubscribe:()=>{se||(se=!0,y--,F())}}}return ee(j,V,!0)},xn=j=>{var V;const F=!!(!((V=j.formState)===null||V===void 0)&&V.values);F&&y++;const{unsubscribe:se}=E.state.subscribe({next:pe=>{if(b4(j.name,pe.name,j.exact)&&y4(pe,j.formState||C,oi,j.reRenderRoot)){const be={...l};j.callback({values:be,...r,...pe,defaultValues:s})}}});if(!F)return se;let de=!1;return()=>{de||(de=!0,y--,se())}},dn=j=>(u.mount=!0,_={..._,...j.formState},xn({...j,formState:{...x,...j.formState}})),Xt=(j,V={})=>{for(const F of j?ou(j):d.mount)d.mount.delete(F),d.array.delete(F),V.keepValue||(Dt(o,F),Dt(l,F)),!V.keepError&&Dt(r.errors,F),!V.keepDirty&&Dt(r.dirtyFields,F),!V.keepTouched&&Dt(r.touchedFields,F),!V.keepIsValidating&&Dt(r.validatingFields,F),!n.shouldUnregister&&!V.keepDefaultValue&&Dt(s,F);E.state.next({values:Nt(l)}),E.state.next({...r,...V.keepDirty?{isDirty:W()}:{}}),!V.keepIsValid&&z()},or=({disabled:j,name:V})=>{if(Rr(j)&&u.mount||j||d.disabled.has(V)){const de=d.disabled.has(V)!==!!j;j?d.disabled.add(V):d.disabled.delete(V),de&&u.mount&&!u.action&&z()}},Ht=(j,V={})=>{let F=Se(o,j);const se=Rr(V.disabled)||Rr(n.disabled),de=!d.registerName.has(j)&&F&&F._f&&!F._f.mount;return ut(o,j,{...F||{},_f:{...F&&F._f?F._f:{ref:{name:j}},name:j,mount:!0,...V}}),d.mount.add(j),F&&!de?or({disabled:Rr(V.disabled)?V.disabled:n.disabled,name:j}):fe(j,!0,V.value),{...se?{disabled:V.disabled||n.disabled}:{},...n.progressive?{required:!!V.required,min:Us(V.min),max:Us(V.max),minLength:Us(V.minLength),maxLength:Us(V.maxLength),pattern:Us(V.pattern)}:{},name:j,onChange:J,onBlur:J,ref:pe=>{if(pe){d.registerName.add(j),Ht(j,V),d.registerName.delete(j),F=Se(o,j);const be=vt(pe.value)&&pe.querySelectorAll&&pe.querySelectorAll("input,select,textarea")[0]||pe,we=h4(be),Te=F._f.refs||[];if(we?Te.find(nt=>nt===be):be===F._f.ref)return;ut(o,j,{_f:{...F._f,...we?{refs:[...Te.filter(Qh),be,...Array.isArray(Se(s,j))?[{}]:[]],ref:{type:be.type,name:j}}:{ref:be}}}),fe(j,!1,void 0,be)}else F=Se(o,j,{}),F._f&&(F._f.mount=!1),(n.shouldUnregister||V.shouldUnregister)&&!(r4(d.array,j)&&u.action)&&d.unMount.add(j)}}},ar=()=>n.shouldFocusError&&!n.shouldUseNativeValidation&&Xs(o,ge,d.mount),Bn=j=>{Rr(j)&&(E.state.next({disabled:j}),Xs(o,(V,F)=>{const se=Se(o,F);se&&(V.disabled=se._f.disabled||j,Array.isArray(se._f.refs)&&se._f.refs.forEach(de=>{de.disabled=se._f.disabled||j}))},0,!1))},zt=(j,V)=>async F=>{let se;F&&(F.preventDefault&&F.preventDefault(),F.persist&&F.persist());let de=Nt(l);if(E.state.next({isSubmitting:!0}),n.resolver){const{errors:pe,values:be}=await me();L(),r.errors=pe,de=Nt(be)}else await Z({fields:o,eventType:Ea.SUBMIT});if(d.disabled.size)for(const pe of d.disabled)Dt(de,pe);if(Dt(r.errors,$_),on(r.errors)){E.state.next({errors:{}});try{await j(de,F)}catch(pe){se=pe}}else V&&await V({...r.errors},F),ar(),setTimeout(ar);if(E.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:on(r.errors)&&!se,submitCount:r.submitCount+1,errors:r.errors}),se)throw se},pn=(j,V={})=>{Se(o,j)&&(vt(V.defaultValue)?K(j,Nt(Se(s,j))):(K(j,V.defaultValue),ut(s,j,Nt(V.defaultValue))),V.keepTouched||Dt(r.touchedFields,j),V.keepDirty||(Dt(r.dirtyFields,j),r.isDirty=V.defaultValue?W(j,Nt(Se(s,j))):W()),V.keepError||(Dt(r.errors,j),C.isValid&&z()),E.state.next({...r}))},jt=(j,V={})=>{const F=j?Nt(j):s,se=Nt(F),de=on(j),pe=se,be=o;if(V.keepDefaultValues||(s=F),!V.keepValues){if(V.keepDirtyValues){const we=new Set([...d.mount,...Object.keys(yo(s,l,void 0,be))]);for(const Te of Array.from(we)){const nt=Se(r.dirtyFields,Te),St=Se(l,Te),Jt=Se(pe,Te);nt&&!vt(St)?ut(pe,Te,St):!nt&&!vt(Jt)&&K(Te,Jt)}}else{if(Ju&&vt(j))for(const we of d.mount){const Te=Se(o,we);if(Te&&Te._f){const nt=Array.isArray(Te._f.refs)?Te._f.refs[0]:Te._f.ref;if(bu(nt)){const St=nt.closest("form");if(St){St.reset();break}}}}if(V.keepFieldsRef)for(const we of d.mount)K(we,Se(pe,we));else o={}}if(n.shouldUnregister){if(l=V.keepDefaultValues?Nt(s):{},V.keepFieldsRef)for(const we of d.mount)ut(l,we,Se(pe,we))}else l=Nt(pe);E.array.next({values:{...pe}}),E.state.next({name:void 0,type:void 0,values:{...pe}})}d={mount:V.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},u.mount=!C.isValid||!!V.keepIsValid||!!V.keepDirtyValues||!n.shouldUnregister&&!on(pe),u.watch=!!n.shouldUnregister,u.keepIsValid=!!V.keepIsValid,u.action=!1,V.keepErrors||(r.errors={}),E.state.next({submitCount:V.keepSubmitCount?r.submitCount:0,isDirty:de?!1:V.keepDirty?r.isDirty:V.keepValues?W():!!(V.keepDefaultValues&&!Tr(j,s)),isSubmitted:V.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:de?{}:V.keepDirtyValues?V.keepDefaultValues&&l?yo(s,l,void 0,be):r.dirtyFields:V.keepDefaultValues&&j?yo(s,j,void 0,be):V.keepDirty?r.dirtyFields:{},touchedFields:V.keepTouched?r.touchedFields:{},errors:V.keepErrors?r.errors:{},isSubmitSuccessful:V.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},Dr=(j,V)=>jt(tr(j)?j(l):j,{...n.resetOptions,...V}),kt=(j,V={})=>{const F=Se(o,j),se=F&&F._f;if(se){const de=se.refs?se.refs[0]:se.ref;de.focus&&setTimeout(()=>{de.focus(),V.shouldSelect&&tr(de.select)&&de.select()})}},oi=j=>{const{name:V,type:F,values:se,...de}=j;r={...r,...de}},ke={control:{register:Ht,unregister:Xt,getFieldState:Fe,handleSubmit:zt,setError:ht,_subscribe:xn,_runSchema:me,_updateIsValidating:L,_focusError:ar,_getWatch:ee,_getDirty:W,_setValid:z,_setFieldArray:H,_setDisabledField:or,_setErrors:ne,_getFieldArray:D,_reset:jt,_resetDefaultValues:()=>tr(n.defaultValues)&&n.defaultValues().then(j=>{Dr(j,n.resetOptions),E.state.next({isLoading:!1})}),_removeUnmounted:re,_disableForm:Bn,_subjects:E,_proxyFormState:C,get _fields(){return o},get _formValues(){return l},get _state(){return u},set _state(j){u=j},get _defaultValues(){return s},get _names(){return d},set _names(j){d=j},get _formState(){return r},get _options(){return n},set _options(j){n={...n,...j},v=Yc(n.mode),b=Yc(n.reValidateMode)}},subscribe:dn,trigger:ye,register:Ht,handleSubmit:zt,watch:Je,setValue:K,setValues:ae,getValues:Ne,reset:Dr,resetField:pn,resetDefaultValues:(j,V={})=>{if(s=Nt(j),!V.keepDirty){const F=yo(s,l,void 0,o);r.dirtyFields=F,r.isDirty=!on(F)}V.keepIsValid||z(),E.state.next({...r,defaultValues:s})},clearErrors:Ue,unregister:Xt,setError:ht,setFocus:kt,getFieldState:Fe};return{...ke,formControl:ke}}function Wp(e={}){const n=he.useRef(void 0),r=he.useRef(void 0),o=he.useRef(e.formControl),[s,l]=he.useState(()=>({...Nt(K_),isLoading:tr(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:tr(e.defaultValues)?void 0:e.defaultValues}));if(!n.current||e.formControl&&o.current!==e.formControl)if(o.current=e.formControl,e.formControl)n.current={...e.formControl,formState:s},e.defaultValues&&!tr(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:d,...p}=_4(e);n.current={...p,formState:s}}const u=n.current.control;return u._options=e,l4(()=>{const d=u._subscribe({formState:u._proxyFormState,callback:()=>l({...u._formState,defaultValues:u._defaultValues}),reRenderRoot:!0});return l(p=>({...p,isReady:!0})),u._formState.isReady=!0,d},[u]),he.useEffect(()=>u._disableForm(e.disabled),[u,e.disabled]),he.useEffect(()=>{e.mode&&(u._options.mode=e.mode),e.reValidateMode&&(u._options.reValidateMode=e.reValidateMode)},[u,e.mode,e.reValidateMode]),he.useEffect(()=>{e.errors&&(u._setErrors(e.errors),u._focusError())},[u,e.errors]),he.useEffect(()=>{e.shouldUnregister&&u._subjects.state.next({values:u._getWatch()})},[u,e.shouldUnregister]),he.useEffect(()=>{if(u._proxyFormState.isDirty){const d=u._getDirty();d!==s.isDirty&&u._subjects.state.next({isDirty:d})}},[u,s.isDirty]),he.useEffect(()=>{var d;e.values&&!Tr(e.values,r.current)?(u._reset(e.values,{keepFieldsRef:!0,...u._options.resetOptions}),!((d=u._options.resetOptions)===null||d===void 0)&&d.keepIsValid||u._setValid(),r.current=e.values,l(p=>({...p}))):u._resetDefaultValues()},[u,e.values]),he.useEffect(()=>{u._state.mount||(u._setValid(),u._state.mount=!0),u._state.watch&&(u._state.watch=!1,u._subjects.state.next({...u._formState})),u._removeUnmounted()}),n.current.formState=he.useMemo(()=>s4(s,u),[u,s]),n.current}const Ex=(e,n,r)=>{if(e&&"reportValidity"in e){const o=Se(r,n);e.setCustomValidity(o&&o.message||""),e.reportValidity()}},Im=(e,n)=>{for(const r in n.fields){const o=n.fields[r];o&&o.ref&&"reportValidity"in o.ref?Ex(o.ref,r,e):o&&o.refs&&o.refs.forEach(s=>Ex(s,r,e))}},Rx=(e,n)=>{n.shouldUseNativeValidation&&Im(e,n);const r={};for(const o in e){const s=Se(n.fields,o),l=Object.assign(e[o]||{},{ref:s&&s.ref});if(C4(n.names||Object.keys(e),o)){const u=Object.assign({},Se(r,o));ut(u,"root",l),ut(r,o,u)}else ut(r,o,l)}return r},C4=(e,n)=>{const r=Tx(n).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(o=>Tx(o).match(`^${r}\\.\\d+`))};function Tx(e){return e.replace(/[\[\]]/g,"")}var Ox;function ue(e,n,r){function o(d,p){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:p,constr:u,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),n(d,p);const m=u.prototype,y=Object.keys(m);for(let v=0;vr?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class La extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Y_ extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}(Ox=globalThis).__zod_globalConfig??(Ox.__zod_globalConfig={});const eg=globalThis.__zod_globalConfig;function Ro(e){return eg}function Q_(e){const n=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,s])=>n.indexOf(+o)===-1).map(([o,s])=>s)}function Vm(e,n){return typeof n=="bigint"?n.toString():n}function tg(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function ng(e){return e==null}function rg(e){const n=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(n,r)}const jx=Symbol("evaluating");function dt(e,n,r){let o;Object.defineProperty(e,n,{get(){if(o!==jx)return o===void 0&&(o=jx,o=r()),o},set(s){Object.defineProperty(e,n,{value:s})},configurable:!0})}function ko(e,n,r){Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Yi(...e){const n={};for(const r of e){const o=Object.getOwnPropertyDescriptors(r);Object.assign(n,o)}return Object.defineProperties({},n)}function Ax(e){return JSON.stringify(e)}function E4(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X_="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function wu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const R4=tg(()=>{if(eg.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ll(e){if(wu(e)===!1)return!1;const n=e.constructor;if(n===void 0||typeof n!="function")return!0;const r=n.prototype;return!(wu(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function J_(e){return ll(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const T4=new Set(["string","number","symbol"]);function ed(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qi(e,n,r){const o=new e._zod.constr(n??e._zod.def);return(!n||r?.parent)&&(o._zod.parent=e),o}function Ie(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function O4(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}function j4(e,n){const r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const l=Yi(e._zod.def,{get shape(){const u={};for(const d in n){if(!(d in r.shape))throw new Error(`Unrecognized key: "${d}"`);n[d]&&(u[d]=r.shape[d])}return ko(this,"shape",u),u},checks:[]});return Qi(e,l)}function A4(e,n){const r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const l=Yi(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const d in n){if(!(d in r.shape))throw new Error(`Unrecognized key: "${d}"`);n[d]&&delete u[d]}return ko(this,"shape",u),u},checks:[]});return Qi(e,l)}function M4(e,n){if(!ll(n))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const l=e._zod.def.shape;for(const u in n)if(Object.getOwnPropertyDescriptor(l,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Yi(e._zod.def,{get shape(){const l={...e._zod.def.shape,...n};return ko(this,"shape",l),l}});return Qi(e,s)}function N4(e,n){if(!ll(n))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Yi(e._zod.def,{get shape(){const o={...e._zod.def.shape,...n};return ko(this,"shape",o),o}});return Qi(e,r)}function D4(e,n){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r=Yi(e._zod.def,{get shape(){const o={...e._zod.def.shape,...n._zod.def.shape};return ko(this,"shape",o),o},get catchall(){return n._zod.def.catchall},checks:n._zod.def.checks??[]});return Qi(e,r)}function z4(e,n,r){const s=n._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const u=Yi(n._zod.def,{get shape(){const d=n._zod.def.shape,p={...d};if(r)for(const m in r){if(!(m in d))throw new Error(`Unrecognized key: "${m}"`);r[m]&&(p[m]=e?new e({type:"optional",innerType:d[m]}):d[m])}else for(const m in d)p[m]=e?new e({type:"optional",innerType:d[m]}):d[m];return ko(this,"shape",p),p},checks:[]});return Qi(n,u)}function k4(e,n,r){const o=Yi(n._zod.def,{get shape(){const s=n._zod.def.shape,l={...s};if(r)for(const u in r){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=new e({type:"nonoptional",innerType:s[u]}))}else for(const u in s)l[u]=new e({type:"nonoptional",innerType:s[u]});return ko(this,"shape",l),l}});return Qi(n,o)}function Ma(e,n=0){if(e.aborted===!0)return!0;for(let r=n;r{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Qc(e){return typeof e=="string"?e:e?.message}function To(e,n,r){const o=e.message?e.message:Qc(e.inst?._zod.def?.error?.(e))??Qc(n?.error?.(e))??Qc(r.customError?.(e))??Qc(r.localeError?.(e))??"Invalid input",{inst:s,continue:l,input:u,...d}=e;return d.path??(d.path=[]),d.message=o,n?.reportInput&&(d.input=u),d}function ig(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function cl(...e){const[n,r,o]=e;return typeof n=="string"?{message:n,code:"custom",input:r,inst:o}:{...n}}const eC=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,Vm,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},og=ue("$ZodError",eC),td=ue("$ZodError",eC,{Parent:Error});function $4(e,n=r=>r.message){const r={},o=[];for(const s of e.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(n(s))):o.push(n(s));return{formErrors:o,fieldErrors:r}}function I4(e,n=r=>r.message){const r={_errors:[]},o=(s,l=[])=>{for(const u of s.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(d=>o({issues:d},[...l,...u.path]));else if(u.code==="invalid_key")o({issues:u.issues},[...l,...u.path]);else if(u.code==="invalid_element")o({issues:u.issues},[...l,...u.path]);else{const d=[...l,...u.path];if(d.length===0)r._errors.push(n(u));else{let p=r,m=0;for(;m(n,r,o,s)=>{const l=o?{...o,async:!1}:{async:!1},u=n._zod.run({value:r,issues:[]},l);if(u instanceof Promise)throw new La;if(u.issues.length){const d=new(s?.Err??e)(u.issues.map(p=>To(p,l,Ro())));throw X_(d,s?.callee),d}return u.value},V4=nd(td),rd=e=>async(n,r,o,s)=>{const l=o?{...o,async:!0}:{async:!0};let u=n._zod.run({value:r,issues:[]},l);if(u instanceof Promise&&(u=await u),u.issues.length){const d=new(s?.Err??e)(u.issues.map(p=>To(p,l,Ro())));throw X_(d,s?.callee),d}return u.value},F4=rd(td),id=e=>(n,r,o)=>{const s=o?{...o,async:!1}:{async:!1},l=n._zod.run({value:r,issues:[]},s);if(l instanceof Promise)throw new La;return l.issues.length?{success:!1,error:new(e??og)(l.issues.map(u=>To(u,s,Ro())))}:{success:!0,data:l.value}},P4=id(td),od=e=>async(n,r,o)=>{const s=o?{...o,async:!0}:{async:!0};let l=n._zod.run({value:r,issues:[]},s);return l instanceof Promise&&(l=await l),l.issues.length?{success:!1,error:new e(l.issues.map(u=>To(u,s,Ro())))}:{success:!0,data:l.value}},U4=od(td),H4=e=>(n,r,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return nd(e)(n,r,s)},B4=e=>(n,r,o)=>nd(e)(n,r,o),q4=e=>async(n,r,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return rd(e)(n,r,s)},G4=e=>async(n,r,o)=>rd(e)(n,r,o),Z4=e=>(n,r,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return id(e)(n,r,s)},K4=e=>(n,r,o)=>id(e)(n,r,o),Y4=e=>async(n,r,o)=>{const s=o?{...o,direction:"backward"}:{direction:"backward"};return od(e)(n,r,s)},Q4=e=>async(n,r,o)=>od(e)(n,r,o),X4=/^[cC][0-9a-z]{6,}$/,J4=/^[0-9a-z]+$/,W4=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,e5=/^[0-9a-vA-V]{20}$/,t5=/^[A-Za-z0-9]{27}$/,n5=/^[a-zA-Z0-9_-]{21}$/,r5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,i5=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Mx=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,o5=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,a5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function s5(){return new RegExp(a5,"u")}const l5=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,c5=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,u5=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,d5=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,f5=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tC=/^[A-Za-z0-9_-]*$/,h5=/^https?$/,m5=/^\+[1-9]\d{6,14}$/,nC="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",p5=new RegExp(`^${nC}$`);function rC(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function g5(e){return new RegExp(`^${rC(e)}$`)}function v5(e){const n=rC({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${n}(?:${r.join("|")})`;return new RegExp(`^${nC}T(?:${o})$`)}const y5=e=>{const n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},b5=/^(?:true|false)$/i,x5=/^[^A-Z]*$/,w5=/^[^a-z]*$/,Nr=ue("$ZodCheck",(e,n)=>{var r;e._zod??(e._zod={}),e._zod.def=n,(r=e._zod).onattach??(r.onattach=[])}),S5=ue("$ZodCheckMaxLength",(e,n)=>{var r;Nr.init(e,n),(r=e._zod.def).when??(r.when=o=>{const s=o.value;return!ng(s)&&s.length!==void 0}),e._zod.onattach.push(o=>{const s=o._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum{const s=o.value;if(s.length<=n.maximum)return;const u=ig(s);o.issues.push({origin:u,code:"too_big",maximum:n.maximum,inclusive:!0,input:s,inst:e,continue:!n.abort})}}),_5=ue("$ZodCheckMinLength",(e,n)=>{var r;Nr.init(e,n),(r=e._zod.def).when??(r.when=o=>{const s=o.value;return!ng(s)&&s.length!==void 0}),e._zod.onattach.push(o=>{const s=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>s&&(o._zod.bag.minimum=n.minimum)}),e._zod.check=o=>{const s=o.value;if(s.length>=n.minimum)return;const u=ig(s);o.issues.push({origin:u,code:"too_small",minimum:n.minimum,inclusive:!0,input:s,inst:e,continue:!n.abort})}}),C5=ue("$ZodCheckLengthEquals",(e,n)=>{var r;Nr.init(e,n),(r=e._zod.def).when??(r.when=o=>{const s=o.value;return!ng(s)&&s.length!==void 0}),e._zod.onattach.push(o=>{const s=o._zod.bag;s.minimum=n.length,s.maximum=n.length,s.length=n.length}),e._zod.check=o=>{const s=o.value,l=s.length;if(l===n.length)return;const u=ig(s),d=l>n.length;o.issues.push({origin:u,...d?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!n.abort})}}),ad=ue("$ZodCheckStringFormat",(e,n)=>{var r,o;Nr.init(e,n),e._zod.onattach.push(s=>{const l=s._zod.bag;l.format=n.format,n.pattern&&(l.patterns??(l.patterns=new Set),l.patterns.add(n.pattern))}),n.pattern?(r=e._zod).check??(r.check=s=>{n.pattern.lastIndex=0,!n.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:n.format,input:s.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(o=e._zod).check??(o.check=()=>{})}),E5=ue("$ZodCheckRegex",(e,n)=>{ad.init(e,n),e._zod.check=r=>{n.pattern.lastIndex=0,!n.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),R5=ue("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=x5),ad.init(e,n)}),T5=ue("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=w5),ad.init(e,n)}),O5=ue("$ZodCheckIncludes",(e,n)=>{Nr.init(e,n);const r=ed(n.includes),o=new RegExp(typeof n.position=="number"?`^.{${n.position}}${r}`:r);n.pattern=o,e._zod.onattach.push(s=>{const l=s._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(o)}),e._zod.check=s=>{s.value.includes(n.includes,n.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:s.value,inst:e,continue:!n.abort})}}),j5=ue("$ZodCheckStartsWith",(e,n)=>{Nr.init(e,n);const r=new RegExp(`^${ed(n.prefix)}.*`);n.pattern??(n.pattern=r),e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(n.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:o.value,inst:e,continue:!n.abort})}}),A5=ue("$ZodCheckEndsWith",(e,n)=>{Nr.init(e,n);const r=new RegExp(`.*${ed(n.suffix)}$`);n.pattern??(n.pattern=r),e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(n.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:o.value,inst:e,continue:!n.abort})}}),M5=ue("$ZodCheckOverwrite",(e,n)=>{Nr.init(e,n),e._zod.check=r=>{r.value=n.tx(r.value)}});class N5{constructor(n=[]){this.content=[],this.indent=0,this&&(this.args=n)}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const o=n.split(`
`).filter(u=>u),s=Math.min(...o.map(u=>u.length-u.trimStart().length)),l=o.map(u=>u.slice(s)).map(u=>" ".repeat(this.indent*2)+u);for(const u of l)this.content.push(u)}compile(){const n=Function,r=this?.args,s=[...(this?.content??[""]).map(l=>` ${l}`)];return new n(...r,s.join(`
-`))}}const M5={major:4,minor:4,patch:3},Pt=ue("$ZodType",(e,n)=>{var r;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=M5;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const s of o)for(const l of s._zod.onattach)l(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(u,d,p)=>{let h=Ma(u),y;for(const v of d){if(v._zod.def.when){if(z4(u)||!v._zod.def.when(u))continue}else if(h)continue;const b=u.issues.length,x=v._zod.check(u);if(x instanceof Promise&&p?.async===!1)throw new La;if(y||x instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await x,u.issues.length!==b&&(h||(h=Ma(u,b)))});else{if(u.issues.length===b)continue;h||(h=Ma(u,b))}}return y?y.then(()=>u):u},l=(u,d,p)=>{if(Ma(u))return u.aborted=!0,u;const h=s(d,o,p);if(h instanceof Promise){if(p.async===!1)throw new La;return h.then(y=>e._zod.parse(y,p))}return e._zod.parse(h,p)};e._zod.run=(u,d)=>{if(d.skipChecks)return e._zod.parse(u,d);if(d.direction==="backward"){const h=e._zod.parse({value:u.value,issues:[]},{...d,skipChecks:!0});return h instanceof Promise?h.then(y=>l(y,u,d)):l(h,u,d)}const p=e._zod.parse(u,d);if(p instanceof Promise){if(d.async===!1)throw new La;return p.then(h=>s(h,o,d))}return s(p,o,d)}}dt(e,"~standard",()=>({validate:s=>{try{const l=V4(e,s);return l.success?{value:l.data}:{issues:l.error?.issues}}catch{return F4(e,s).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},vendor:"zod",version:1}))}),og=ue("$ZodString",(e,n)=>{Pt.init(e,n),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??g5(e._zod.bag),e._zod.parse=(r,o)=>{if(n.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),wt=ue("$ZodStringFormat",(e,n)=>{ad.init(e,n),og.init(e,n)}),N5=ue("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=n5),wt.init(e,n)}),D5=ue("$ZodUUID",(e,n)=>{if(n.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(o===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=Ax(o))}else n.pattern??(n.pattern=Ax());wt.init(e,n)}),z5=ue("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=r5),wt.init(e,n)}),k5=ue("$ZodURL",(e,n)=>{wt.init(e,n),e._zod.check=r=>{try{const o=r.value.trim();if(!n.normalize&&n.protocol?.source===d5.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!n.abort});return}const s=new URL(o);n.hostname&&(n.hostname.lastIndex=0,n.hostname.test(s.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:n.hostname.source,input:r.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,n.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:r.value,inst:e,continue:!n.abort})),n.normalize?r.value=s.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!n.abort})}}}),L5=ue("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=o5()),wt.init(e,n)}),$5=ue("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=e5),wt.init(e,n)}),I5=ue("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=Y4),wt.init(e,n)}),V5=ue("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=Q4),wt.init(e,n)}),F5=ue("$ZodULID",(e,n)=>{n.pattern??(n.pattern=X4),wt.init(e,n)}),P5=ue("$ZodXID",(e,n)=>{n.pattern??(n.pattern=J4),wt.init(e,n)}),U5=ue("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=W4),wt.init(e,n)}),H5=ue("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=p5(n)),wt.init(e,n)}),B5=ue("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=h5),wt.init(e,n)}),q5=ue("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=m5(n)),wt.init(e,n)}),G5=ue("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=t5),wt.init(e,n)}),Z5=ue("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=a5),wt.init(e,n),e._zod.bag.format="ipv4"}),K5=ue("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=s5),wt.init(e,n),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!n.abort})}}}),Y5=ue("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=l5),wt.init(e,n)}),Q5=ue("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=c5),wt.init(e,n),e._zod.check=r=>{const o=r.value.split("/");try{if(o.length!==2)throw new Error;const[s,l]=o;if(!l)throw new Error;const u=Number(l);if(`${u}`!==l)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${s}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!n.abort})}}});function iC(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const X5=ue("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=u5),wt.init(e,n),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{iC(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!n.abort})}});function J5(e){if(!tC.test(e))return!1;const n=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=n.padEnd(Math.ceil(n.length/4)*4,"=");return iC(r)}const W5=ue("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=tC),wt.init(e,n),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{J5(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!n.abort})}}),e6=ue("$ZodE164",(e,n)=>{n.pattern??(n.pattern=f5),wt.init(e,n)});function t6(e,n=null){try{const r=e.split(".");if(r.length!==3)return!1;const[o]=r;if(!o)return!1;const s=JSON.parse(atob(o));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||n&&(!("alg"in s)||s.alg!==n))}catch{return!1}}const n6=ue("$ZodJWT",(e,n)=>{wt.init(e,n),e._zod.check=r=>{t6(r.value,n.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!n.abort})}}),r6=ue("$ZodBoolean",(e,n)=>{Pt.init(e,n),e._zod.pattern=v5,e._zod.parse=(r,o)=>{if(n.coerce)try{r.value=!!r.value}catch{}const s=r.value;return typeof s=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),r}}),i6=ue("$ZodUnknown",(e,n)=>{Pt.init(e,n),e._zod.parse=r=>r}),o6=ue("$ZodNever",(e,n)=>{Pt.init(e,n),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Mx(e,n,r){e.issues.length&&n.issues.push(...W_(r,e.issues)),n.value[r]=e.value}const a6=ue("$ZodArray",(e,n)=>{Pt.init(e,n),e._zod.parse=(r,o)=>{const s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=Array(s.length);const l=[];for(let u=0;uMx(h,r,u))):Mx(p,r,u)}return l.length?Promise.all(l).then(()=>r):r}});function Su(e,n,r,o,s,l){const u=r in o;if(e.issues.length){if(s&&l&&!u)return;n.issues.push(...W_(r,e.issues))}if(!u&&!s){e.issues.length||n.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?u&&(n.value[r]=void 0):n.value[r]=e.value}function oC(e){const n=Object.keys(e.shape);for(const o of n)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const r=R4(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(r)}}function aC(e,n,r,o,s,l){const u=[],d=s.keySet,p=s.catchall._zod,h=p.def.type,y=p.optin==="optional",v=p.optout==="optional";for(const b in n){if(b==="__proto__"||d.has(b))continue;if(h==="never"){u.push(b);continue}const x=p.run({value:n[b],issues:[]},o);x instanceof Promise?e.push(x.then(C=>Su(C,r,b,n,y,v))):Su(x,r,b,n,y,v)}return u.length&&r.issues.push({code:"unrecognized_keys",keys:u,input:n,inst:l}),e.length?Promise.all(e).then(()=>r):r}const s6=ue("$ZodObject",(e,n)=>{if(Pt.init(e,n),!Object.getOwnPropertyDescriptor(n,"shape")?.get){const d=n.shape;Object.defineProperty(n,"shape",{get:()=>{const p={...d};return Object.defineProperty(n,"shape",{value:p}),p}})}const o=eg(()=>oC(n));dt(e._zod,"propValues",()=>{const d=n.shape,p={};for(const h in d){const y=d[h]._zod;if(y.values){p[h]??(p[h]=new Set);for(const v of y.values)p[h].add(v)}}return p});const s=wu,l=n.catchall;let u;e._zod.parse=(d,p)=>{u??(u=o.value);const h=d.value;if(!s(h))return d.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),d;d.value={};const y=[],v=u.shape;for(const b of u.keys){const x=v[b],C=x._zod.optin==="optional",_=x._zod.optout==="optional",E=x._zod.run({value:h[b],issues:[]},p);E instanceof Promise?y.push(E.then(T=>Su(T,d,b,h,C,_))):Su(E,d,b,h,C,_)}return l?aC(y,h,d,p,o.value,e):y.length?Promise.all(y).then(()=>d):d}}),l6=ue("$ZodObjectJIT",(e,n)=>{s6.init(e,n);const r=e._zod.parse,o=eg(()=>oC(n)),s=b=>{const x=new A5(["shape","payload","ctx"]),C=o.value,_=A=>{const z=jx(A);return`shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`};x.write("const input = payload.value;");const E=Object.create(null);let T=0;for(const A of C.keys)E[A]=`key_${T++}`;x.write("const newResult = {};");for(const A of C.keys){const z=E[A],L=jx(A),B=b[A],H=B?._zod?.optin==="optional",I=B?._zod?.optout==="optional";x.write(`const ${z} = ${_(A)};`),H&&I?x.write(`
+`))}}const D5={major:4,minor:4,patch:3},Pt=ue("$ZodType",(e,n)=>{var r;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=D5;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const s of o)for(const l of s._zod.onattach)l(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(u,d,p)=>{let m=Ma(u),y;for(const v of d){if(v._zod.def.when){if(L4(u)||!v._zod.def.when(u))continue}else if(m)continue;const b=u.issues.length,x=v._zod.check(u);if(x instanceof Promise&&p?.async===!1)throw new La;if(y||x instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await x,u.issues.length!==b&&(m||(m=Ma(u,b)))});else{if(u.issues.length===b)continue;m||(m=Ma(u,b))}}return y?y.then(()=>u):u},l=(u,d,p)=>{if(Ma(u))return u.aborted=!0,u;const m=s(d,o,p);if(m instanceof Promise){if(p.async===!1)throw new La;return m.then(y=>e._zod.parse(y,p))}return e._zod.parse(m,p)};e._zod.run=(u,d)=>{if(d.skipChecks)return e._zod.parse(u,d);if(d.direction==="backward"){const m=e._zod.parse({value:u.value,issues:[]},{...d,skipChecks:!0});return m instanceof Promise?m.then(y=>l(y,u,d)):l(m,u,d)}const p=e._zod.parse(u,d);if(p instanceof Promise){if(d.async===!1)throw new La;return p.then(m=>s(m,o,d))}return s(p,o,d)}}dt(e,"~standard",()=>({validate:s=>{try{const l=P4(e,s);return l.success?{value:l.data}:{issues:l.error?.issues}}catch{return U4(e,s).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},vendor:"zod",version:1}))}),ag=ue("$ZodString",(e,n)=>{Pt.init(e,n),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??y5(e._zod.bag),e._zod.parse=(r,o)=>{if(n.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),wt=ue("$ZodStringFormat",(e,n)=>{ad.init(e,n),ag.init(e,n)}),z5=ue("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=i5),wt.init(e,n)}),k5=ue("$ZodUUID",(e,n)=>{if(n.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(o===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=Mx(o))}else n.pattern??(n.pattern=Mx());wt.init(e,n)}),L5=ue("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=o5),wt.init(e,n)}),$5=ue("$ZodURL",(e,n)=>{wt.init(e,n),e._zod.check=r=>{try{const o=r.value.trim();if(!n.normalize&&n.protocol?.source===h5.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!n.abort});return}const s=new URL(o);n.hostname&&(n.hostname.lastIndex=0,n.hostname.test(s.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:n.hostname.source,input:r.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,n.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:r.value,inst:e,continue:!n.abort})),n.normalize?r.value=s.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!n.abort})}}}),I5=ue("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=s5()),wt.init(e,n)}),V5=ue("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=n5),wt.init(e,n)}),F5=ue("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=X4),wt.init(e,n)}),P5=ue("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=J4),wt.init(e,n)}),U5=ue("$ZodULID",(e,n)=>{n.pattern??(n.pattern=W4),wt.init(e,n)}),H5=ue("$ZodXID",(e,n)=>{n.pattern??(n.pattern=e5),wt.init(e,n)}),B5=ue("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=t5),wt.init(e,n)}),q5=ue("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=v5(n)),wt.init(e,n)}),G5=ue("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=p5),wt.init(e,n)}),Z5=ue("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=g5(n)),wt.init(e,n)}),K5=ue("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=r5),wt.init(e,n)}),Y5=ue("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=l5),wt.init(e,n),e._zod.bag.format="ipv4"}),Q5=ue("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=c5),wt.init(e,n),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!n.abort})}}}),X5=ue("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=u5),wt.init(e,n)}),J5=ue("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=d5),wt.init(e,n),e._zod.check=r=>{const o=r.value.split("/");try{if(o.length!==2)throw new Error;const[s,l]=o;if(!l)throw new Error;const u=Number(l);if(`${u}`!==l)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${s}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!n.abort})}}});function iC(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const W5=ue("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=f5),wt.init(e,n),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{iC(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!n.abort})}});function e6(e){if(!tC.test(e))return!1;const n=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=n.padEnd(Math.ceil(n.length/4)*4,"=");return iC(r)}const t6=ue("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=tC),wt.init(e,n),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{e6(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!n.abort})}}),n6=ue("$ZodE164",(e,n)=>{n.pattern??(n.pattern=m5),wt.init(e,n)});function r6(e,n=null){try{const r=e.split(".");if(r.length!==3)return!1;const[o]=r;if(!o)return!1;const s=JSON.parse(atob(o));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||n&&(!("alg"in s)||s.alg!==n))}catch{return!1}}const i6=ue("$ZodJWT",(e,n)=>{wt.init(e,n),e._zod.check=r=>{r6(r.value,n.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!n.abort})}}),o6=ue("$ZodBoolean",(e,n)=>{Pt.init(e,n),e._zod.pattern=b5,e._zod.parse=(r,o)=>{if(n.coerce)try{r.value=!!r.value}catch{}const s=r.value;return typeof s=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),r}}),a6=ue("$ZodUnknown",(e,n)=>{Pt.init(e,n),e._zod.parse=r=>r}),s6=ue("$ZodNever",(e,n)=>{Pt.init(e,n),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Nx(e,n,r){e.issues.length&&n.issues.push(...W_(r,e.issues)),n.value[r]=e.value}const l6=ue("$ZodArray",(e,n)=>{Pt.init(e,n),e._zod.parse=(r,o)=>{const s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=Array(s.length);const l=[];for(let u=0;uNx(m,r,u))):Nx(p,r,u)}return l.length?Promise.all(l).then(()=>r):r}});function Su(e,n,r,o,s,l){const u=r in o;if(e.issues.length){if(s&&l&&!u)return;n.issues.push(...W_(r,e.issues))}if(!u&&!s){e.issues.length||n.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?u&&(n.value[r]=void 0):n.value[r]=e.value}function oC(e){const n=Object.keys(e.shape);for(const o of n)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const r=O4(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(r)}}function aC(e,n,r,o,s,l){const u=[],d=s.keySet,p=s.catchall._zod,m=p.def.type,y=p.optin==="optional",v=p.optout==="optional";for(const b in n){if(b==="__proto__"||d.has(b))continue;if(m==="never"){u.push(b);continue}const x=p.run({value:n[b],issues:[]},o);x instanceof Promise?e.push(x.then(C=>Su(C,r,b,n,y,v))):Su(x,r,b,n,y,v)}return u.length&&r.issues.push({code:"unrecognized_keys",keys:u,input:n,inst:l}),e.length?Promise.all(e).then(()=>r):r}const c6=ue("$ZodObject",(e,n)=>{if(Pt.init(e,n),!Object.getOwnPropertyDescriptor(n,"shape")?.get){const d=n.shape;Object.defineProperty(n,"shape",{get:()=>{const p={...d};return Object.defineProperty(n,"shape",{value:p}),p}})}const o=tg(()=>oC(n));dt(e._zod,"propValues",()=>{const d=n.shape,p={};for(const m in d){const y=d[m]._zod;if(y.values){p[m]??(p[m]=new Set);for(const v of y.values)p[m].add(v)}}return p});const s=wu,l=n.catchall;let u;e._zod.parse=(d,p)=>{u??(u=o.value);const m=d.value;if(!s(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d;d.value={};const y=[],v=u.shape;for(const b of u.keys){const x=v[b],C=x._zod.optin==="optional",_=x._zod.optout==="optional",E=x._zod.run({value:m[b],issues:[]},p);E instanceof Promise?y.push(E.then(T=>Su(T,d,b,m,C,_))):Su(E,d,b,m,C,_)}return l?aC(y,m,d,p,o.value,e):y.length?Promise.all(y).then(()=>d):d}}),u6=ue("$ZodObjectJIT",(e,n)=>{c6.init(e,n);const r=e._zod.parse,o=tg(()=>oC(n)),s=b=>{const x=new N5(["shape","payload","ctx"]),C=o.value,_=A=>{const z=Ax(A);return`shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`};x.write("const input = payload.value;");const E=Object.create(null);let T=0;for(const A of C.keys)E[A]=`key_${T++}`;x.write("const newResult = {};");for(const A of C.keys){const z=E[A],L=Ax(A),B=b[A],H=B?._zod?.optin==="optional",I=B?._zod?.optout==="optional";x.write(`const ${z} = ${_(A)};`),H&&I?x.write(`
if (${z}.issues.length) {
if (${L} in input) {
payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
@@ -110,11 +110,11 @@ Error generating stack: `+c.message+`
}
}
- `)}x.write("payload.value = newResult;"),x.write("return payload;");const O=x.compile();return(A,z)=>O(b,A,z)};let l;const u=wu,d=!Wp.jitless,h=d&&C4.value,y=n.catchall;let v;e._zod.parse=(b,x)=>{v??(v=o.value);const C=b.value;return u(C)?d&&h&&x?.async===!1&&x.jitless!==!0?(l||(l=s(n.shape)),b=l(b,x),y?aC([],C,b,x,v,e):b):r(b,x):(b.issues.push({expected:"object",code:"invalid_type",input:C,inst:e}),b)}});function Nx(e,n,r,o){for(const l of e)if(l.issues.length===0)return n.value=l.value,n;const s=e.filter(l=>!Ma(l));return s.length===1?(n.value=s[0].value,s[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:r,errors:e.map(l=>l.issues.map(u=>To(u,o,Ro())))}),n)}const c6=ue("$ZodUnion",(e,n)=>{Pt.init(e,n),dt(e._zod,"optin",()=>n.options.some(o=>o._zod.optin==="optional")?"optional":void 0),dt(e._zod,"optout",()=>n.options.some(o=>o._zod.optout==="optional")?"optional":void 0),dt(e._zod,"values",()=>{if(n.options.every(o=>o._zod.values))return new Set(n.options.flatMap(o=>Array.from(o._zod.values)))}),dt(e._zod,"pattern",()=>{if(n.options.every(o=>o._zod.pattern)){const o=n.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>ng(s.source)).join("|")})$`)}});const r=n.options.length===1?n.options[0]._zod.run:null;e._zod.parse=(o,s)=>{if(r)return r(o,s);let l=!1;const u=[];for(const d of n.options){const p=d._zod.run({value:o.value,issues:[]},s);if(p instanceof Promise)u.push(p),l=!0;else{if(p.issues.length===0)return p;u.push(p)}}return l?Promise.all(u).then(d=>Nx(d,o,e,s)):Nx(u,o,e,s)}}),u6=ue("$ZodIntersection",(e,n)=>{Pt.init(e,n),e._zod.parse=(r,o)=>{const s=r.value,l=n.left._zod.run({value:s,issues:[]},o),u=n.right._zod.run({value:s,issues:[]},o);return l instanceof Promise||u instanceof Promise?Promise.all([l,u]).then(([p,h])=>Dx(r,p,h)):Dx(r,l,u)}});function Vm(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(ll(e)&&ll(n)){const r=Object.keys(n),o=Object.keys(e).filter(l=>r.indexOf(l)!==-1),s={...e,...n};for(const l of o){const u=Vm(e[l],n[l]);if(!u.valid)return{valid:!1,mergeErrorPath:[l,...u.mergeErrorPath]};s[l]=u.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let o=0;od.l&&d.r).map(([d])=>d);if(l.length&&s&&e.issues.push({...s,keys:l}),Ma(e))return e;const u=Vm(n.value,r.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const d6=ue("$ZodEnum",(e,n)=>{Pt.init(e,n);const r=Q_(n.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(s=>E4.has(typeof s)).map(s=>typeof s=="string"?ed(s):s.toString()).join("|")})$`),e._zod.parse=(s,l)=>{const u=s.value;return o.has(u)||s.issues.push({code:"invalid_value",values:r,input:u,inst:e}),s}}),f6=ue("$ZodTransform",(e,n)=>{Pt.init(e,n),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Y_(e.constructor.name);const s=n.transform(r.value,r);if(o.async)return(s instanceof Promise?s:Promise.resolve(s)).then(u=>(r.value=u,r.fallback=!0,r));if(s instanceof Promise)throw new La;return r.value=s,r.fallback=!0,r}});function zx(e,n){return n===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const sC=ue("$ZodOptional",(e,n)=>{Pt.init(e,n),e._zod.optin="optional",e._zod.optout="optional",dt(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),dt(e._zod,"pattern",()=>{const r=n.innerType._zod.pattern;return r?new RegExp(`^(${ng(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(n.innerType._zod.optin==="optional"){const s=r.value,l=n.innerType._zod.run(r,o);return l instanceof Promise?l.then(u=>zx(u,s)):zx(l,s)}return r.value===void 0?r:n.innerType._zod.run(r,o)}}),h6=ue("$ZodExactOptional",(e,n)=>{sC.init(e,n),dt(e._zod,"values",()=>n.innerType._zod.values),dt(e._zod,"pattern",()=>n.innerType._zod.pattern),e._zod.parse=(r,o)=>n.innerType._zod.run(r,o)}),m6=ue("$ZodNullable",(e,n)=>{Pt.init(e,n),dt(e._zod,"optin",()=>n.innerType._zod.optin),dt(e._zod,"optout",()=>n.innerType._zod.optout),dt(e._zod,"pattern",()=>{const r=n.innerType._zod.pattern;return r?new RegExp(`^(${ng(r.source)}|null)$`):void 0}),dt(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:n.innerType._zod.run(r,o)}),p6=ue("$ZodDefault",(e,n)=>{Pt.init(e,n),e._zod.optin="optional",dt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return n.innerType._zod.run(r,o);if(r.value===void 0)return r.value=n.defaultValue,r;const s=n.innerType._zod.run(r,o);return s instanceof Promise?s.then(l=>kx(l,n)):kx(s,n)}});function kx(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const g6=ue("$ZodPrefault",(e,n)=>{Pt.init(e,n),e._zod.optin="optional",dt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=n.defaultValue),n.innerType._zod.run(r,o))}),v6=ue("$ZodNonOptional",(e,n)=>{Pt.init(e,n),dt(e._zod,"values",()=>{const r=n.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{const s=n.innerType._zod.run(r,o);return s instanceof Promise?s.then(l=>Lx(l,e)):Lx(s,e)}});function Lx(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const y6=ue("$ZodCatch",(e,n)=>{Pt.init(e,n),e._zod.optin="optional",dt(e._zod,"optout",()=>n.innerType._zod.optout),dt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return n.innerType._zod.run(r,o);const s=n.innerType._zod.run(r,o);return s instanceof Promise?s.then(l=>(r.value=l.value,l.issues.length&&(r.value=n.catchValue({...r,error:{issues:l.issues.map(u=>To(u,o,Ro()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=s.value,s.issues.length&&(r.value=n.catchValue({...r,error:{issues:s.issues.map(l=>To(l,o,Ro()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),b6=ue("$ZodPipe",(e,n)=>{Pt.init(e,n),dt(e._zod,"values",()=>n.in._zod.values),dt(e._zod,"optin",()=>n.in._zod.optin),dt(e._zod,"optout",()=>n.out._zod.optout),dt(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){const l=n.out._zod.run(r,o);return l instanceof Promise?l.then(u=>Xc(u,n.in,o)):Xc(l,n.in,o)}const s=n.in._zod.run(r,o);return s instanceof Promise?s.then(l=>Xc(l,n.out,o)):Xc(s,n.out,o)}});function Xc(e,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}const x6=ue("$ZodReadonly",(e,n)=>{Pt.init(e,n),dt(e._zod,"propValues",()=>n.innerType._zod.propValues),dt(e._zod,"values",()=>n.innerType._zod.values),dt(e._zod,"optin",()=>n.innerType?._zod?.optin),dt(e._zod,"optout",()=>n.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return n.innerType._zod.run(r,o);const s=n.innerType._zod.run(r,o);return s instanceof Promise?s.then($x):$x(s)}});function $x(e){return e.value=Object.freeze(e.value),e}const w6=ue("$ZodCustom",(e,n)=>{Nr.init(e,n),Pt.init(e,n),e._zod.parse=(r,o)=>r,e._zod.check=r=>{const o=r.value,s=n.fn(o);if(s instanceof Promise)return s.then(l=>Ix(l,r,o,e));Ix(s,r,o,e)}});function Ix(e,n,r,o){if(!e){const s={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(s.params=o._zod.def.params),n.issues.push(cl(s))}}var Vx;class S6{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...r){const o=r[0];return this._map.set(n,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,n),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){const r=this._map.get(n);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(n),this}get(n){const r=n._zod.parent;if(r){const o={...this.get(r)??{}};delete o.id;const s={...o,...this._map.get(n)};return Object.keys(s).length?s:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function _6(){return new S6}(Vx=globalThis).__zod_globalRegistry??(Vx.__zod_globalRegistry=_6());const Zs=globalThis.__zod_globalRegistry;function C6(e,n){return new e({type:"string",...Ie(n)})}function E6(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ie(n)})}function Fx(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ie(n)})}function R6(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ie(n)})}function T6(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ie(n)})}function O6(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ie(n)})}function j6(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ie(n)})}function A6(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ie(n)})}function M6(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ie(n)})}function N6(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ie(n)})}function D6(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ie(n)})}function z6(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ie(n)})}function k6(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ie(n)})}function L6(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ie(n)})}function $6(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ie(n)})}function I6(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ie(n)})}function V6(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ie(n)})}function F6(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ie(n)})}function P6(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ie(n)})}function U6(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ie(n)})}function H6(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ie(n)})}function B6(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ie(n)})}function q6(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ie(n)})}function G6(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ie(n)})}function Z6(e,n){return new e({type:"string",format:"date",check:"string_format",...Ie(n)})}function K6(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ie(n)})}function Y6(e,n){return new e({type:"string",format:"duration",check:"string_format",...Ie(n)})}function Q6(e,n){return new e({type:"boolean",...Ie(n)})}function X6(e){return new e({type:"unknown"})}function J6(e,n){return new e({type:"never",...Ie(n)})}function lC(e,n){return new x5({check:"max_length",...Ie(n),maximum:e})}function _u(e,n){return new w5({check:"min_length",...Ie(n),minimum:e})}function cC(e,n){return new S5({check:"length_equals",...Ie(n),length:e})}function W6(e,n){return new _5({check:"string_format",format:"regex",...Ie(n),pattern:e})}function eL(e){return new C5({check:"string_format",format:"lowercase",...Ie(e)})}function tL(e){return new E5({check:"string_format",format:"uppercase",...Ie(e)})}function nL(e,n){return new R5({check:"string_format",format:"includes",...Ie(n),includes:e})}function rL(e,n){return new T5({check:"string_format",format:"starts_with",...Ie(n),prefix:e})}function iL(e,n){return new O5({check:"string_format",format:"ends_with",...Ie(n),suffix:e})}function Za(e){return new j5({check:"overwrite",tx:e})}function oL(e){return Za(n=>n.normalize(e))}function aL(){return Za(e=>e.trim())}function sL(){return Za(e=>e.toLowerCase())}function lL(){return Za(e=>e.toUpperCase())}function cL(){return Za(e=>_4(e))}function uL(e,n,r){return new e({type:"array",element:n,...Ie(r)})}function dL(e,n,r){return new e({type:"custom",check:"custom",fn:n,...Ie(r)})}function fL(e,n){const r=hL(o=>(o.addIssue=s=>{if(typeof s=="string")o.issues.push(cl(s,o.value,r._zod.def));else{const l=s;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=o.value),l.inst??(l.inst=r),l.continue??(l.continue=!r._zod.def.abort),o.issues.push(cl(l))}},e(o.value,o)),n);return r}function hL(e,n){const r=new Nr({check:"custom",...Ie(n)});return r._zod.check=e,r}function uC(e){let n=e?.target??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Zs,target:n,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function un(e,n,r={path:[],schemaPath:[]}){var o;const s=e._zod.def,l=n.seen.get(e);if(l)return l.count++,r.schemaPath.includes(e)&&(l.cycle=r.path),l.schema;const u={schema:{},count:1,cycle:void 0,path:r.path};n.seen.set(e,u);const d=e._zod.toJSONSchema?.();if(d)u.schema=d;else{const y={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,u.schema,y);else{const b=u.schema,x=n.processors[s.type];if(!x)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);x(e,n,b,y)}const v=e._zod.parent;v&&(u.ref||(u.ref=v),un(v,n,y),n.seen.get(v).isParent=!0)}const p=n.metadataRegistry.get(e);return p&&Object.assign(u.schema,p),n.io==="input"&&vn(e)&&(delete u.schema.examples,delete u.schema.default),n.io==="input"&&"_prefault"in u.schema&&((o=u.schema).default??(o.default=u.schema._prefault)),delete u.schema._prefault,n.seen.get(e).schema}function dC(e,n){const r=e.seen.get(n);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=new Map;for(const u of e.seen.entries()){const d=e.metadataRegistry.get(u[0])?.id;if(d){const p=o.get(d);if(p&&p!==u[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(d,u[0])}}const s=u=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=e.external.registry.get(u[0])?.id,b=e.external.uri??(C=>C);if(v)return{ref:b(v)};const x=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=x,{defId:x,ref:`${b("__shared")}#/${d}/${x}`}}if(u[1]===r)return{ref:"#"};const h=`#/${d}/`,y=u[1].schema.id??`__schema${e.counter++}`;return{defId:y,ref:h+y}},l=u=>{if(u[1].schema.$ref)return;const d=u[1],{ref:p,defId:h}=s(u);d.def={...d.schema},h&&(d.defId=h);const y=d.schema;for(const v in y)delete y[v];y.$ref=p};if(e.cycles==="throw")for(const u of e.seen.entries()){const d=u[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/
+ `)}x.write("payload.value = newResult;"),x.write("return payload;");const O=x.compile();return(A,z)=>O(b,A,z)};let l;const u=wu,d=!eg.jitless,m=d&&R4.value,y=n.catchall;let v;e._zod.parse=(b,x)=>{v??(v=o.value);const C=b.value;return u(C)?d&&m&&x?.async===!1&&x.jitless!==!0?(l||(l=s(n.shape)),b=l(b,x),y?aC([],C,b,x,v,e):b):r(b,x):(b.issues.push({expected:"object",code:"invalid_type",input:C,inst:e}),b)}});function Dx(e,n,r,o){for(const l of e)if(l.issues.length===0)return n.value=l.value,n;const s=e.filter(l=>!Ma(l));return s.length===1?(n.value=s[0].value,s[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:r,errors:e.map(l=>l.issues.map(u=>To(u,o,Ro())))}),n)}const d6=ue("$ZodUnion",(e,n)=>{Pt.init(e,n),dt(e._zod,"optin",()=>n.options.some(o=>o._zod.optin==="optional")?"optional":void 0),dt(e._zod,"optout",()=>n.options.some(o=>o._zod.optout==="optional")?"optional":void 0),dt(e._zod,"values",()=>{if(n.options.every(o=>o._zod.values))return new Set(n.options.flatMap(o=>Array.from(o._zod.values)))}),dt(e._zod,"pattern",()=>{if(n.options.every(o=>o._zod.pattern)){const o=n.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>rg(s.source)).join("|")})$`)}});const r=n.options.length===1?n.options[0]._zod.run:null;e._zod.parse=(o,s)=>{if(r)return r(o,s);let l=!1;const u=[];for(const d of n.options){const p=d._zod.run({value:o.value,issues:[]},s);if(p instanceof Promise)u.push(p),l=!0;else{if(p.issues.length===0)return p;u.push(p)}}return l?Promise.all(u).then(d=>Dx(d,o,e,s)):Dx(u,o,e,s)}}),f6=ue("$ZodIntersection",(e,n)=>{Pt.init(e,n),e._zod.parse=(r,o)=>{const s=r.value,l=n.left._zod.run({value:s,issues:[]},o),u=n.right._zod.run({value:s,issues:[]},o);return l instanceof Promise||u instanceof Promise?Promise.all([l,u]).then(([p,m])=>zx(r,p,m)):zx(r,l,u)}});function Fm(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(ll(e)&&ll(n)){const r=Object.keys(n),o=Object.keys(e).filter(l=>r.indexOf(l)!==-1),s={...e,...n};for(const l of o){const u=Fm(e[l],n[l]);if(!u.valid)return{valid:!1,mergeErrorPath:[l,...u.mergeErrorPath]};s[l]=u.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let o=0;od.l&&d.r).map(([d])=>d);if(l.length&&s&&e.issues.push({...s,keys:l}),Ma(e))return e;const u=Fm(n.value,r.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const h6=ue("$ZodEnum",(e,n)=>{Pt.init(e,n);const r=Q_(n.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(s=>T4.has(typeof s)).map(s=>typeof s=="string"?ed(s):s.toString()).join("|")})$`),e._zod.parse=(s,l)=>{const u=s.value;return o.has(u)||s.issues.push({code:"invalid_value",values:r,input:u,inst:e}),s}}),m6=ue("$ZodTransform",(e,n)=>{Pt.init(e,n),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Y_(e.constructor.name);const s=n.transform(r.value,r);if(o.async)return(s instanceof Promise?s:Promise.resolve(s)).then(u=>(r.value=u,r.fallback=!0,r));if(s instanceof Promise)throw new La;return r.value=s,r.fallback=!0,r}});function kx(e,n){return n===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const sC=ue("$ZodOptional",(e,n)=>{Pt.init(e,n),e._zod.optin="optional",e._zod.optout="optional",dt(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),dt(e._zod,"pattern",()=>{const r=n.innerType._zod.pattern;return r?new RegExp(`^(${rg(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(n.innerType._zod.optin==="optional"){const s=r.value,l=n.innerType._zod.run(r,o);return l instanceof Promise?l.then(u=>kx(u,s)):kx(l,s)}return r.value===void 0?r:n.innerType._zod.run(r,o)}}),p6=ue("$ZodExactOptional",(e,n)=>{sC.init(e,n),dt(e._zod,"values",()=>n.innerType._zod.values),dt(e._zod,"pattern",()=>n.innerType._zod.pattern),e._zod.parse=(r,o)=>n.innerType._zod.run(r,o)}),g6=ue("$ZodNullable",(e,n)=>{Pt.init(e,n),dt(e._zod,"optin",()=>n.innerType._zod.optin),dt(e._zod,"optout",()=>n.innerType._zod.optout),dt(e._zod,"pattern",()=>{const r=n.innerType._zod.pattern;return r?new RegExp(`^(${rg(r.source)}|null)$`):void 0}),dt(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:n.innerType._zod.run(r,o)}),v6=ue("$ZodDefault",(e,n)=>{Pt.init(e,n),e._zod.optin="optional",dt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return n.innerType._zod.run(r,o);if(r.value===void 0)return r.value=n.defaultValue,r;const s=n.innerType._zod.run(r,o);return s instanceof Promise?s.then(l=>Lx(l,n)):Lx(s,n)}});function Lx(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const y6=ue("$ZodPrefault",(e,n)=>{Pt.init(e,n),e._zod.optin="optional",dt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=n.defaultValue),n.innerType._zod.run(r,o))}),b6=ue("$ZodNonOptional",(e,n)=>{Pt.init(e,n),dt(e._zod,"values",()=>{const r=n.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{const s=n.innerType._zod.run(r,o);return s instanceof Promise?s.then(l=>$x(l,e)):$x(s,e)}});function $x(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const x6=ue("$ZodCatch",(e,n)=>{Pt.init(e,n),e._zod.optin="optional",dt(e._zod,"optout",()=>n.innerType._zod.optout),dt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return n.innerType._zod.run(r,o);const s=n.innerType._zod.run(r,o);return s instanceof Promise?s.then(l=>(r.value=l.value,l.issues.length&&(r.value=n.catchValue({...r,error:{issues:l.issues.map(u=>To(u,o,Ro()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=s.value,s.issues.length&&(r.value=n.catchValue({...r,error:{issues:s.issues.map(l=>To(l,o,Ro()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),w6=ue("$ZodPipe",(e,n)=>{Pt.init(e,n),dt(e._zod,"values",()=>n.in._zod.values),dt(e._zod,"optin",()=>n.in._zod.optin),dt(e._zod,"optout",()=>n.out._zod.optout),dt(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){const l=n.out._zod.run(r,o);return l instanceof Promise?l.then(u=>Xc(u,n.in,o)):Xc(l,n.in,o)}const s=n.in._zod.run(r,o);return s instanceof Promise?s.then(l=>Xc(l,n.out,o)):Xc(s,n.out,o)}});function Xc(e,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}const S6=ue("$ZodReadonly",(e,n)=>{Pt.init(e,n),dt(e._zod,"propValues",()=>n.innerType._zod.propValues),dt(e._zod,"values",()=>n.innerType._zod.values),dt(e._zod,"optin",()=>n.innerType?._zod?.optin),dt(e._zod,"optout",()=>n.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return n.innerType._zod.run(r,o);const s=n.innerType._zod.run(r,o);return s instanceof Promise?s.then(Ix):Ix(s)}});function Ix(e){return e.value=Object.freeze(e.value),e}const _6=ue("$ZodCustom",(e,n)=>{Nr.init(e,n),Pt.init(e,n),e._zod.parse=(r,o)=>r,e._zod.check=r=>{const o=r.value,s=n.fn(o);if(s instanceof Promise)return s.then(l=>Vx(l,r,o,e));Vx(s,r,o,e)}});function Vx(e,n,r,o){if(!e){const s={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(s.params=o._zod.def.params),n.issues.push(cl(s))}}var Fx;class C6{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...r){const o=r[0];return this._map.set(n,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,n),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){const r=this._map.get(n);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(n),this}get(n){const r=n._zod.parent;if(r){const o={...this.get(r)??{}};delete o.id;const s={...o,...this._map.get(n)};return Object.keys(s).length?s:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function E6(){return new C6}(Fx=globalThis).__zod_globalRegistry??(Fx.__zod_globalRegistry=E6());const Zs=globalThis.__zod_globalRegistry;function R6(e,n){return new e({type:"string",...Ie(n)})}function T6(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ie(n)})}function Px(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ie(n)})}function O6(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ie(n)})}function j6(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ie(n)})}function A6(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ie(n)})}function M6(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ie(n)})}function N6(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ie(n)})}function D6(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ie(n)})}function z6(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ie(n)})}function k6(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ie(n)})}function L6(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ie(n)})}function $6(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ie(n)})}function I6(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ie(n)})}function V6(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ie(n)})}function F6(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ie(n)})}function P6(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ie(n)})}function U6(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ie(n)})}function H6(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ie(n)})}function B6(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ie(n)})}function q6(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ie(n)})}function G6(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ie(n)})}function Z6(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ie(n)})}function K6(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ie(n)})}function Y6(e,n){return new e({type:"string",format:"date",check:"string_format",...Ie(n)})}function Q6(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ie(n)})}function X6(e,n){return new e({type:"string",format:"duration",check:"string_format",...Ie(n)})}function J6(e,n){return new e({type:"boolean",...Ie(n)})}function W6(e){return new e({type:"unknown"})}function eL(e,n){return new e({type:"never",...Ie(n)})}function lC(e,n){return new S5({check:"max_length",...Ie(n),maximum:e})}function _u(e,n){return new _5({check:"min_length",...Ie(n),minimum:e})}function cC(e,n){return new C5({check:"length_equals",...Ie(n),length:e})}function tL(e,n){return new E5({check:"string_format",format:"regex",...Ie(n),pattern:e})}function nL(e){return new R5({check:"string_format",format:"lowercase",...Ie(e)})}function rL(e){return new T5({check:"string_format",format:"uppercase",...Ie(e)})}function iL(e,n){return new O5({check:"string_format",format:"includes",...Ie(n),includes:e})}function oL(e,n){return new j5({check:"string_format",format:"starts_with",...Ie(n),prefix:e})}function aL(e,n){return new A5({check:"string_format",format:"ends_with",...Ie(n),suffix:e})}function Za(e){return new M5({check:"overwrite",tx:e})}function sL(e){return Za(n=>n.normalize(e))}function lL(){return Za(e=>e.trim())}function cL(){return Za(e=>e.toLowerCase())}function uL(){return Za(e=>e.toUpperCase())}function dL(){return Za(e=>E4(e))}function fL(e,n,r){return new e({type:"array",element:n,...Ie(r)})}function hL(e,n,r){return new e({type:"custom",check:"custom",fn:n,...Ie(r)})}function mL(e,n){const r=pL(o=>(o.addIssue=s=>{if(typeof s=="string")o.issues.push(cl(s,o.value,r._zod.def));else{const l=s;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=o.value),l.inst??(l.inst=r),l.continue??(l.continue=!r._zod.def.abort),o.issues.push(cl(l))}},e(o.value,o)),n);return r}function pL(e,n){const r=new Nr({check:"custom",...Ie(n)});return r._zod.check=e,r}function uC(e){let n=e?.target??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Zs,target:n,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function un(e,n,r={path:[],schemaPath:[]}){var o;const s=e._zod.def,l=n.seen.get(e);if(l)return l.count++,r.schemaPath.includes(e)&&(l.cycle=r.path),l.schema;const u={schema:{},count:1,cycle:void 0,path:r.path};n.seen.set(e,u);const d=e._zod.toJSONSchema?.();if(d)u.schema=d;else{const y={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,u.schema,y);else{const b=u.schema,x=n.processors[s.type];if(!x)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);x(e,n,b,y)}const v=e._zod.parent;v&&(u.ref||(u.ref=v),un(v,n,y),n.seen.get(v).isParent=!0)}const p=n.metadataRegistry.get(e);return p&&Object.assign(u.schema,p),n.io==="input"&&vn(e)&&(delete u.schema.examples,delete u.schema.default),n.io==="input"&&"_prefault"in u.schema&&((o=u.schema).default??(o.default=u.schema._prefault)),delete u.schema._prefault,n.seen.get(e).schema}function dC(e,n){const r=e.seen.get(n);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=new Map;for(const u of e.seen.entries()){const d=e.metadataRegistry.get(u[0])?.id;if(d){const p=o.get(d);if(p&&p!==u[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(d,u[0])}}const s=u=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=e.external.registry.get(u[0])?.id,b=e.external.uri??(C=>C);if(v)return{ref:b(v)};const x=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=x,{defId:x,ref:`${b("__shared")}#/${d}/${x}`}}if(u[1]===r)return{ref:"#"};const m=`#/${d}/`,y=u[1].schema.id??`__schema${e.counter++}`;return{defId:y,ref:m+y}},l=u=>{if(u[1].schema.$ref)return;const d=u[1],{ref:p,defId:m}=s(u);d.def={...d.schema},m&&(d.defId=m);const y=d.schema;for(const v in y)delete y[v];y.$ref=p};if(e.cycles==="throw")for(const u of e.seen.entries()){const d=u[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/
-Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const d=u[1];if(n===u[0]){l(u);continue}if(e.external){const h=e.external.registry.get(u[0])?.id;if(n!==u[0]&&h){l(u);continue}}if(e.metadataRegistry.get(u[0])?.id){l(u);continue}if(d.cycle){l(u);continue}if(d.count>1&&e.reused==="ref"){l(u);continue}}}function fC(e,n){const r=e.seen.get(n);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=d=>{const p=e.seen.get(d);if(p.ref===null)return;const h=p.def??p.schema,y={...h},v=p.ref;if(p.ref=null,v){o(v);const x=e.seen.get(v),C=x.schema;if(C.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(C)):Object.assign(h,C),Object.assign(h,y),d._zod.parent===v)for(const E in h)E==="$ref"||E==="allOf"||E in y||delete h[E];if(C.$ref&&x.def)for(const E in h)E==="$ref"||E==="allOf"||E in x.def&&JSON.stringify(h[E])===JSON.stringify(x.def[E])&&delete h[E]}const b=d._zod.parent;if(b&&b!==v){o(b);const x=e.seen.get(b);if(x?.schema.$ref&&(h.$ref=x.schema.$ref,x.def))for(const C in h)C==="$ref"||C==="allOf"||C in x.def&&JSON.stringify(h[C])===JSON.stringify(x.def[C])&&delete h[C]}e.override({zodSchema:d,jsonSchema:h,path:p.path??[]})};for(const d of[...e.seen.entries()].reverse())o(d[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(n)?.id;if(!d)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(d)}Object.assign(s,r.def??r.schema);const l=e.metadataRegistry.get(n)?.id;l!==void 0&&s.id===l&&delete s.id;const u=e.external?.defs??{};for(const d of e.seen.entries()){const p=d[1];p.def&&p.defId&&(p.def.id===p.defId&&delete p.def.id,u[p.defId]=p.def)}e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?s.$defs=u:s.definitions=u);try{const d=JSON.parse(JSON.stringify(s));return Object.defineProperty(d,"~standard",{value:{...n["~standard"],jsonSchema:{input:Cu(n,"input",e.processors),output:Cu(n,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function vn(e,n){const r=n??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return vn(o.element,r);if(o.type==="set")return vn(o.valueType,r);if(o.type==="lazy")return vn(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return vn(o.innerType,r);if(o.type==="intersection")return vn(o.left,r)||vn(o.right,r);if(o.type==="record"||o.type==="map")return vn(o.keyType,r)||vn(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:vn(o.in,r)||vn(o.out,r);if(o.type==="object"){for(const s in o.shape)if(vn(o.shape[s],r))return!0;return!1}if(o.type==="union"){for(const s of o.options)if(vn(s,r))return!0;return!1}if(o.type==="tuple"){for(const s of o.items)if(vn(s,r))return!0;return!!(o.rest&&vn(o.rest,r))}return!1}const mL=(e,n={})=>r=>{const o=uC({...r,processors:n});return un(e,o),dC(o,e),fC(o,e)},Cu=(e,n,r={})=>o=>{const{libraryOptions:s,target:l}=o??{},u=uC({...s??{},target:l,io:n,processors:r});return un(e,u),dC(u,e),fC(u,e)},pL={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},gL=(e,n,r,o)=>{const s=r;s.type="string";const{minimum:l,maximum:u,format:d,patterns:p,contentEncoding:h}=e._zod.bag;if(typeof l=="number"&&(s.minLength=l),typeof u=="number"&&(s.maxLength=u),d&&(s.format=pL[d]??d,s.format===""&&delete s.format,d==="time"&&delete s.format),h&&(s.contentEncoding=h),p&&p.size>0){const y=[...p];y.length===1?s.pattern=y[0].source:y.length>1&&(s.allOf=[...y.map(v=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},vL=(e,n,r,o)=>{r.type="boolean"},yL=(e,n,r,o)=>{r.not={}},bL=(e,n,r,o)=>{},xL=(e,n,r,o)=>{const s=e._zod.def,l=Q_(s.entries);l.every(u=>typeof u=="number")&&(r.type="number"),l.every(u=>typeof u=="string")&&(r.type="string"),r.enum=l},wL=(e,n,r,o)=>{if(n.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},SL=(e,n,r,o)=>{if(n.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},_L=(e,n,r,o)=>{const s=r,l=e._zod.def,{minimum:u,maximum:d}=e._zod.bag;typeof u=="number"&&(s.minItems=u),typeof d=="number"&&(s.maxItems=d),s.type="array",s.items=un(l.element,n,{...o,path:[...o.path,"items"]})},CL=(e,n,r,o)=>{const s=r,l=e._zod.def;s.type="object",s.properties={};const u=l.shape;for(const h in u)s.properties[h]=un(u[h],n,{...o,path:[...o.path,"properties",h]});const d=new Set(Object.keys(u)),p=new Set([...d].filter(h=>{const y=l.shape[h]._zod;return n.io==="input"?y.optin===void 0:y.optout===void 0}));p.size>0&&(s.required=Array.from(p)),l.catchall?._zod.def.type==="never"?s.additionalProperties=!1:l.catchall?l.catchall&&(s.additionalProperties=un(l.catchall,n,{...o,path:[...o.path,"additionalProperties"]})):n.io==="output"&&(s.additionalProperties=!1)},EL=(e,n,r,o)=>{const s=e._zod.def,l=s.inclusive===!1,u=s.options.map((d,p)=>un(d,n,{...o,path:[...o.path,l?"oneOf":"anyOf",p]}));l?r.oneOf=u:r.anyOf=u},RL=(e,n,r,o)=>{const s=e._zod.def,l=un(s.left,n,{...o,path:[...o.path,"allOf",0]}),u=un(s.right,n,{...o,path:[...o.path,"allOf",1]}),d=h=>"allOf"in h&&Object.keys(h).length===1,p=[...d(l)?l.allOf:[l],...d(u)?u.allOf:[u]];r.allOf=p},TL=(e,n,r,o)=>{const s=e._zod.def,l=un(s.innerType,n,o),u=n.seen.get(e);n.target==="openapi-3.0"?(u.ref=s.innerType,r.nullable=!0):r.anyOf=[l,{type:"null"}]},OL=(e,n,r,o)=>{const s=e._zod.def;un(s.innerType,n,o);const l=n.seen.get(e);l.ref=s.innerType},jL=(e,n,r,o)=>{const s=e._zod.def;un(s.innerType,n,o);const l=n.seen.get(e);l.ref=s.innerType,r.default=JSON.parse(JSON.stringify(s.defaultValue))},AL=(e,n,r,o)=>{const s=e._zod.def;un(s.innerType,n,o);const l=n.seen.get(e);l.ref=s.innerType,n.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},ML=(e,n,r,o)=>{const s=e._zod.def;un(s.innerType,n,o);const l=n.seen.get(e);l.ref=s.innerType;let u;try{u=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=u},NL=(e,n,r,o)=>{const s=e._zod.def,l=s.in._zod.traits.has("$ZodTransform"),u=n.io==="input"?l?s.out:s.in:s.out;un(u,n,o);const d=n.seen.get(e);d.ref=u},DL=(e,n,r,o)=>{const s=e._zod.def;un(s.innerType,n,o);const l=n.seen.get(e);l.ref=s.innerType,r.readOnly=!0},hC=(e,n,r,o)=>{const s=e._zod.def;un(s.innerType,n,o);const l=n.seen.get(e);l.ref=s.innerType};function Fm(){return Fm=Object.assign?Object.assign.bind():function(e){for(var n=1;n0){var p=s.errors[0][0];r[d]={message:p.message,type:p.code}}else r[d]={message:u,type:l};if(s.code==="invalid_union"&&s.errors.forEach(function(v){return v.forEach(function(b){return e.push(Fm({},b,{path:[].concat(s.path,b.path)}))})}),n){var h=r[d].types,y=h&&h[s.code];r[d]=Xp(d,n,r,l,y?[].concat(y,s.message):s.message)}e.shift()};e.length;)o();return r}function ag(e,n,r){if(r===void 0&&(r={}),(function(o){return"_def"in o&&typeof o._def=="object"&&"typeName"in o._def})(e))return function(o,s,l){try{return Promise.resolve(Px(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](o,n)).then(function(u){return l.shouldUseNativeValidation&&$m({},l),{errors:{},values:r.raw?Object.assign({},o):u}})},function(u){if((function(d){return Array.isArray(d?.issues)})(u))return{values:{},errors:Ex(zL(u.errors,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw u}))}catch(u){return Promise.reject(u)}};if((function(o){return"_zod"in o&&typeof o._zod=="object"})(e))return function(o,s,l){try{return Promise.resolve(Px(function(){return Promise.resolve((r.mode==="sync"?$4:I4)(e,o,n)).then(function(u){return l.shouldUseNativeValidation&&$m({},l),{errors:{},values:r.raw?Object.assign({},o):u}})},function(u){if((function(d){return d instanceof ig})(u))return{values:{},errors:Ex(kL(u.issues,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw u}))}catch(u){return Promise.reject(u)}};throw new Error("Invalid input: not a Zod schema")}const LL=ue("ZodISODateTime",(e,n)=>{H5.init(e,n),Et.init(e,n)});function $L(e){return G6(LL,e)}const IL=ue("ZodISODate",(e,n)=>{B5.init(e,n),Et.init(e,n)});function VL(e){return Z6(IL,e)}const FL=ue("ZodISOTime",(e,n)=>{q5.init(e,n),Et.init(e,n)});function PL(e){return K6(FL,e)}const UL=ue("ZodISODuration",(e,n)=>{G5.init(e,n),Et.init(e,n)});function HL(e){return Y6(UL,e)}const BL=(e,n)=>{ig.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>L4(e,r)},flatten:{value:r=>k4(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Im,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Im,2)}},isEmpty:{get(){return e.issues.length===0}}})},ir=ue("ZodError",BL,{Parent:Error}),qL=nd(ir),GL=rd(ir),ZL=id(ir),KL=od(ir),YL=P4(ir),QL=U4(ir),XL=H4(ir),JL=B4(ir),WL=q4(ir),e8=G4(ir),t8=Z4(ir),n8=K4(ir),Ux=new WeakMap;function sd(e,n,r){const o=Object.getPrototypeOf(e);let s=Ux.get(o);if(s||(s=new Set,Ux.set(o,s)),!s.has(n)){s.add(n);for(const l in r){const u=r[l];Object.defineProperty(o,l,{configurable:!0,enumerable:!1,get(){const d=u.bind(this);return Object.defineProperty(this,l,{configurable:!0,writable:!0,enumerable:!0,value:d}),d},set(d){Object.defineProperty(this,l,{configurable:!0,writable:!0,enumerable:!0,value:d})}})}}}const Ut=ue("ZodType",(e,n)=>(Pt.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:Cu(e,"input"),output:Cu(e,"output")}}),e.toJSONSchema=mL(e,{}),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.parse=(r,o)=>qL(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>ZL(e,r,o),e.parseAsync=async(r,o)=>GL(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>KL(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>YL(e,r,o),e.decode=(r,o)=>QL(e,r,o),e.encodeAsync=async(r,o)=>XL(e,r,o),e.decodeAsync=async(r,o)=>JL(e,r,o),e.safeEncode=(r,o)=>WL(e,r,o),e.safeDecode=(r,o)=>e8(e,r,o),e.safeEncodeAsync=async(r,o)=>t8(e,r,o),e.safeDecodeAsync=async(r,o)=>n8(e,r,o),sd(e,"ZodType",{check(...r){const o=this.def;return this.clone(Yi(o,{checks:[...o.checks??[],...r.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return Qi(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(Y8(r,o))},superRefine(r,o){return this.check(Q8(r,o))},overwrite(r){return this.check(Za(r))},optional(){return Gx(this)},exactOptional(){return L8(this)},nullable(){return Zx(this)},nullish(){return Gx(Zx(this))},nonoptional(r){return U8(this,r)},array(){return R8(this)},or(r){return j8([this,r])},and(r){return M8(this,r)},transform(r){return Kx(this,z8(r))},default(r){return V8(this,r)},prefault(r){return P8(this,r)},catch(r){return B8(this,r)},pipe(r){return Kx(this,r)},readonly(){return Z8(this)},describe(r){const o=this.clone();return Zs.add(o,{description:r}),o},meta(...r){if(r.length===0)return Zs.get(this);const o=this.clone();return Zs.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Zs.get(e)?.description},configurable:!0}),e)),mC=ue("_ZodString",(e,n)=>{og.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(o,s,l)=>gL(e,o,s);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,sd(e,"_ZodString",{regex(...o){return this.check(W6(...o))},includes(...o){return this.check(nL(...o))},startsWith(...o){return this.check(rL(...o))},endsWith(...o){return this.check(iL(...o))},min(...o){return this.check(_u(...o))},max(...o){return this.check(lC(...o))},length(...o){return this.check(cC(...o))},nonempty(...o){return this.check(_u(1,...o))},lowercase(o){return this.check(eL(o))},uppercase(o){return this.check(tL(o))},trim(){return this.check(aL())},normalize(...o){return this.check(oL(...o))},toLowerCase(){return this.check(sL())},toUpperCase(){return this.check(lL())},slugify(){return this.check(cL())}})}),r8=ue("ZodString",(e,n)=>{og.init(e,n),mC.init(e,n),e.email=r=>e.check(E6(i8,r)),e.url=r=>e.check(A6(o8,r)),e.jwt=r=>e.check(q6(x8,r)),e.emoji=r=>e.check(M6(a8,r)),e.guid=r=>e.check(Fx(Hx,r)),e.uuid=r=>e.check(R6(Jc,r)),e.uuidv4=r=>e.check(T6(Jc,r)),e.uuidv6=r=>e.check(O6(Jc,r)),e.uuidv7=r=>e.check(j6(Jc,r)),e.nanoid=r=>e.check(N6(s8,r)),e.guid=r=>e.check(Fx(Hx,r)),e.cuid=r=>e.check(D6(l8,r)),e.cuid2=r=>e.check(z6(c8,r)),e.ulid=r=>e.check(k6(u8,r)),e.base64=r=>e.check(U6(v8,r)),e.base64url=r=>e.check(H6(y8,r)),e.xid=r=>e.check(L6(d8,r)),e.ksuid=r=>e.check($6(f8,r)),e.ipv4=r=>e.check(I6(h8,r)),e.ipv6=r=>e.check(V6(m8,r)),e.cidrv4=r=>e.check(F6(p8,r)),e.cidrv6=r=>e.check(P6(g8,r)),e.e164=r=>e.check(B6(b8,r)),e.datetime=r=>e.check($L(r)),e.date=r=>e.check(VL(r)),e.time=r=>e.check(PL(r)),e.duration=r=>e.check(HL(r))});function au(e){return C6(r8,e)}const Et=ue("ZodStringFormat",(e,n)=>{wt.init(e,n),mC.init(e,n)}),i8=ue("ZodEmail",(e,n)=>{z5.init(e,n),Et.init(e,n)}),Hx=ue("ZodGUID",(e,n)=>{N5.init(e,n),Et.init(e,n)}),Jc=ue("ZodUUID",(e,n)=>{D5.init(e,n),Et.init(e,n)}),o8=ue("ZodURL",(e,n)=>{k5.init(e,n),Et.init(e,n)}),a8=ue("ZodEmoji",(e,n)=>{L5.init(e,n),Et.init(e,n)}),s8=ue("ZodNanoID",(e,n)=>{$5.init(e,n),Et.init(e,n)}),l8=ue("ZodCUID",(e,n)=>{I5.init(e,n),Et.init(e,n)}),c8=ue("ZodCUID2",(e,n)=>{V5.init(e,n),Et.init(e,n)}),u8=ue("ZodULID",(e,n)=>{F5.init(e,n),Et.init(e,n)}),d8=ue("ZodXID",(e,n)=>{P5.init(e,n),Et.init(e,n)}),f8=ue("ZodKSUID",(e,n)=>{U5.init(e,n),Et.init(e,n)}),h8=ue("ZodIPv4",(e,n)=>{Z5.init(e,n),Et.init(e,n)}),m8=ue("ZodIPv6",(e,n)=>{K5.init(e,n),Et.init(e,n)}),p8=ue("ZodCIDRv4",(e,n)=>{Y5.init(e,n),Et.init(e,n)}),g8=ue("ZodCIDRv6",(e,n)=>{Q5.init(e,n),Et.init(e,n)}),v8=ue("ZodBase64",(e,n)=>{X5.init(e,n),Et.init(e,n)}),y8=ue("ZodBase64URL",(e,n)=>{W5.init(e,n),Et.init(e,n)}),b8=ue("ZodE164",(e,n)=>{e6.init(e,n),Et.init(e,n)}),x8=ue("ZodJWT",(e,n)=>{n6.init(e,n),Et.init(e,n)}),w8=ue("ZodBoolean",(e,n)=>{r6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>vL(e,r,o)});function Bx(e){return Q6(w8,e)}const S8=ue("ZodUnknown",(e,n)=>{i6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>bL()});function qx(){return X6(S8)}const _8=ue("ZodNever",(e,n)=>{o6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>yL(e,r,o)});function C8(e){return J6(_8,e)}const E8=ue("ZodArray",(e,n)=>{a6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>_L(e,r,o,s),e.element=n.element,sd(e,"ZodArray",{min(r,o){return this.check(_u(r,o))},nonempty(r){return this.check(_u(1,r))},max(r,o){return this.check(lC(r,o))},length(r,o){return this.check(cC(r,o))},unwrap(){return this.element}})});function R8(e,n){return uL(E8,e,n)}const T8=ue("ZodObject",(e,n)=>{l6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>CL(e,r,o,s),dt(e,"shape",()=>n.shape),sd(e,"ZodObject",{keyof(){return N8(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:qx()})},loose(){return this.clone({...this._zod.def,catchall:qx()})},strict(){return this.clone({...this._zod.def,catchall:C8()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return j4(this,r)},safeExtend(r){return A4(this,r)},merge(r){return M4(this,r)},pick(r){return T4(this,r)},omit(r){return O4(this,r)},partial(...r){return N4(pC,this,r[0])},required(...r){return D4(gC,this,r[0])}})});function sg(e,n){const r={type:"object",shape:e??{},...Ie(n)};return new T8(r)}const O8=ue("ZodUnion",(e,n)=>{c6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>EL(e,r,o,s),e.options=n.options});function j8(e,n){return new O8({type:"union",options:e,...Ie(n)})}const A8=ue("ZodIntersection",(e,n)=>{u6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>RL(e,r,o,s)});function M8(e,n){return new A8({type:"intersection",left:e,right:n})}const Pm=ue("ZodEnum",(e,n)=>{d6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(o,s,l)=>xL(e,o,s),e.enum=n.entries,e.options=Object.values(n.entries);const r=new Set(Object.keys(n.entries));e.extract=(o,s)=>{const l={};for(const u of o)if(r.has(u))l[u]=n.entries[u];else throw new Error(`Key ${u} not found in enum`);return new Pm({...n,checks:[],...Ie(s),entries:l})},e.exclude=(o,s)=>{const l={...n.entries};for(const u of o)if(r.has(u))delete l[u];else throw new Error(`Key ${u} not found in enum`);return new Pm({...n,checks:[],...Ie(s),entries:l})}});function N8(e,n){const r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Pm({type:"enum",entries:r,...Ie(n)})}const D8=ue("ZodTransform",(e,n)=>{f6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>SL(e,r),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Y_(e.constructor.name);r.addIssue=l=>{if(typeof l=="string")r.issues.push(cl(l,r.value,n));else{const u=l;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=r.value),u.inst??(u.inst=e),r.issues.push(cl(u))}};const s=n.transform(r.value,r);return s instanceof Promise?s.then(l=>(r.value=l,r.fallback=!0,r)):(r.value=s,r.fallback=!0,r)}});function z8(e){return new D8({type:"transform",transform:e})}const pC=ue("ZodOptional",(e,n)=>{sC.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>hC(e,r,o,s),e.unwrap=()=>e._zod.def.innerType});function Gx(e){return new pC({type:"optional",innerType:e})}const k8=ue("ZodExactOptional",(e,n)=>{h6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>hC(e,r,o,s),e.unwrap=()=>e._zod.def.innerType});function L8(e){return new k8({type:"optional",innerType:e})}const $8=ue("ZodNullable",(e,n)=>{m6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>TL(e,r,o,s),e.unwrap=()=>e._zod.def.innerType});function Zx(e){return new $8({type:"nullable",innerType:e})}const I8=ue("ZodDefault",(e,n)=>{p6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>jL(e,r,o,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function V8(e,n){return new I8({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():J_(n)}})}const F8=ue("ZodPrefault",(e,n)=>{g6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>AL(e,r,o,s),e.unwrap=()=>e._zod.def.innerType});function P8(e,n){return new F8({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():J_(n)}})}const gC=ue("ZodNonOptional",(e,n)=>{v6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>OL(e,r,o,s),e.unwrap=()=>e._zod.def.innerType});function U8(e,n){return new gC({type:"nonoptional",innerType:e,...Ie(n)})}const H8=ue("ZodCatch",(e,n)=>{y6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>ML(e,r,o,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function B8(e,n){return new H8({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const q8=ue("ZodPipe",(e,n)=>{b6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>NL(e,r,o,s),e.in=n.in,e.out=n.out});function Kx(e,n){return new q8({type:"pipe",in:e,out:n})}const G8=ue("ZodReadonly",(e,n)=>{x6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>DL(e,r,o,s),e.unwrap=()=>e._zod.def.innerType});function Z8(e){return new G8({type:"readonly",innerType:e})}const K8=ue("ZodCustom",(e,n)=>{w6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>wL(e,r)});function Y8(e,n={}){return dL(K8,e,n)}function Q8(e,n){return fL(e,n)}const X8=/\.(md|markdown)$/i,J8=/\.(png|jpe?g|gif|svg|webp|ico|bmp|avif)$/i,vC=/\.html?$/i,W8=/\.(txt|log|json|ya?ml|toml|csv|go|py|js|ts|jsx|tsx|sh|bash|zsh|rb|rs|c|h|cpp|java|kt|swift|sql|css|xml|ini|conf|env|mod|sum|jsonl)$/i;function yC(e){if(e<1024)return e+" B";const n=["KB","MB","GB","TB"];let r=-1;do e/=1024,r++;while(e>=1024&&r`:e.user||e.author||"unknown"}function e$({className:e,...n}){return m.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:m.jsx("table",{"data-slot":"table",className:We("w-full caption-bottom text-sm",e),...n})})}function t$({className:e,...n}){return m.jsx("thead",{"data-slot":"table-header",className:We("[&_tr]:border-b",e),...n})}function n$({className:e,...n}){return m.jsx("tbody",{"data-slot":"table-body",className:We("[&_tr:last-child]:border-0",e),...n})}function Yx({className:e,...n}){return m.jsx("tr",{"data-slot":"table-row",className:We("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",e),...n})}function Qx({className:e,...n}){return m.jsx("th",{"data-slot":"table-head",className:We("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...n})}function r$({className:e,...n}){return m.jsx("td",{"data-slot":"table-cell",className:We("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...n})}function i$({header:e}){const n=e.column.getIsSorted();return e.column.getCanSort()?m.jsx(Qx,{"data-sort":n||void 0,"aria-sort":n==="asc"?"ascending":n==="desc"?"descending":"none",children:m.jsxs("button",{type:"button",className:"th-sort",onClick:e.column.getToggleSortingHandler(),children:[Dm(e.column.columnDef.header,e.getContext()),n==="asc"?" ↑":n==="desc"?" ↓":""]})}):m.jsx(Qx,{children:Dm(e.column.columnDef.header,e.getContext())})}function xC({table:e,className:n}){return m.jsx("div",{className:"admin-list admin-card-table"+(n?" "+n:""),children:m.jsxs(e$,{className:"admin-table",children:[m.jsx(t$,{children:e.getHeaderGroups().map(r=>m.jsx(Yx,{children:r.headers.map(o=>m.jsx(i$,{header:o},o.id))},r.id))}),m.jsx(n$,{children:e.getRowModel().rows.map(r=>m.jsx(Yx,{className:"admin-item",children:r.getVisibleCells().map(o=>m.jsx(r$,{children:Dm(o.column.columnDef.cell,o.getContext())},o.id))},r.id))})]})})}function wC(e){return e?"expires "+new Date(e).toLocaleDateString():"no expiry"}function SC(e,n){const r=[];return n&&e.project_name&&r.push(e.project_name),e.creator&&r.push("by "+e.creator),e.created&&r.push(new Date(e.created).toLocaleDateString()),r.push(wC(e.expires)),r.join(" · ")}function _C({shares:e,onChanged:n,showProject:r=!1,canRevoke:o=!0,empty:s="No public shares."}){const[l,u]=w.useState([]),d=w.useMemo(()=>__(),[]),p=w.useMemo(()=>[d.accessor("path",{header:"Path",cell:y=>m.jsx("a",{className:"ai-main mono",title:y.getValue(),...yu(Qu(y.getValue(),y.row.original.project)),children:y.getValue()})}),d.accessor(y=>SC(y,r),{id:"detail",header:r?"Project":"Shared",cell:y=>m.jsx("span",{className:"ai-tag",children:y.getValue()})}),d.display({id:"actions",header:"",cell:y=>o?m.jsx("button",{className:"ai-del","aria-label":`Revoke the share of ${y.row.original.path}`,onClick:()=>CC(y.row.original,n),children:"Revoke"}):null})],[d,n,r,o]),h=k_({data:e,columns:p,state:{sorting:l},onSortingChange:u,getCoreRowModel:D_(),getSortedRowModel:z_()});return e.length===0?m.jsx("div",{className:"admin-list",children:m.jsx("div",{className:"admin-empty",children:s})}):m.jsx(xC,{table:h,className:"shares-table"})}async function CC(e,n){if(await Yu("Revoke share link",`Revoke the public link to “${e.path}”? Anyone with the URL will lose access.`,"Revoke",!0))try{await Un("DELETE","/api/shares/"+e.token),Qe("Share revoked."),n()}catch(r){Qe(r.message,!0)}}const o$=sg({name:au().trim().min(1,"Give the organization a name.").max(60,"Keep it under 60 characters.")});function a$({org:e,projects:n,myEmail:r}){const o=jo(),s=e.role==="owner",l=()=>o.invalidateQueries({queryKey:["orgs"]}),u=()=>o.invalidateQueries({queryKey:["invites",e.id]}),d=()=>o.invalidateQueries({queryKey:["orgShares",e.id]}),p=Jp({resolver:ag(o$),values:{name:e.name}}),{data:h}=Gt({queryKey:["invites",e.id],queryFn:()=>cn(`/api/orgs/${e.id}/invites`),enabled:s,select:b=>b.invites||[]}),{data:y}=Gt({queryKey:["orgShares",e.id],queryFn:()=>cn(`/api/orgs/${e.id}/shares`),enabled:s,select:b=>b.shares||[]}),v=n.filter(b=>b.org===e.id);return m.jsxs("div",{className:"admin",children:[m.jsx("h1",{id:"org-title",children:e.name}),!s&&m.jsx("p",{className:"role-chip-row",children:m.jsx("span",{className:"ai-tag role-chip",children:"Member"})}),!s&&m.jsx("p",{className:"admin-sub",children:"Only owners can rename this organization, manage members, or issue invite links."}),s&&m.jsxs("form",{className:"admin-row",onSubmit:p.handleSubmit(async({name:b})=>{try{await Un("PATCH","/api/orgs/"+e.id,{name:b}),Qe("Renamed."),l()}catch(x){Qe(x.message,!0)}}),children:[m.jsx("label",{className:"admin-lbl",htmlFor:"org-rename",children:"Organization name"}),m.jsx("input",{id:"org-rename",type:"text","aria-invalid":!!p.formState.errors.name,"aria-describedby":p.formState.errors.name?"org-rename-err":void 0,...p.register("name")}),m.jsx(Ct,{variant:"subtle",id:"org-rename-btn",type:"submit",disabled:!p.formState.isDirty,children:"Rename org"}),p.formState.errors.name&&m.jsx("span",{id:"org-rename-err",role:"alert",className:"field-err",children:p.formState.errors.name.message})]}),m.jsx("h3",{children:"Members"}),m.jsx(s$,{org:e,owner:s,myEmail:r,onChanged:l}),m.jsx("h3",{children:"Projects"}),m.jsxs("div",{className:"admin-list",children:[v.length===0&&m.jsx("div",{className:"admin-empty",children:"No projects yet."}),v.map(b=>m.jsx("div",{className:"admin-item",children:m.jsx("span",{className:"ai-main",title:b.name,children:b.name})},b.id))]}),s&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"admin-h",children:[m.jsx("h3",{children:"Invite links"}),m.jsx(Ct,{variant:"primary",onClick:async()=>{try{const b=await Ia(`/api/orgs/${e.id}/invites`),x=await Ha(b.url);Qe(x?"Invite link copied to clipboard.":"Invite created — copy it from the list below."),u()}catch(b){Qe(b.message,!0)}},children:"New invite"})]}),m.jsxs("div",{className:"admin-list",children:[h&&h.length===0&&m.jsx("div",{className:"admin-empty",children:"No active invite links."}),(h||[]).map(b=>m.jsxs("div",{className:"admin-item",children:[m.jsx("button",{type:"button",className:"ai-main mono ai-copy","aria-label":`Copy invite link ${b.url}`,title:b.url,onClick:()=>Ha(b.url).then(x=>Qe(x?"Copied.":"Select and copy the link.")),children:b.url}),m.jsx("span",{className:"ai-tag",children:(b.creator?"by "+b.creator+" · ":"")+(b.uses?b.uses+" joined · ":"unused · ")+"expires "+new Date(b.expires).toLocaleDateString()}),m.jsx("button",{className:"ai-del","aria-label":`Revoke invite ${b.token.slice(0,8)}`,onClick:async()=>{if(await Yu("Revoke invite",`Revoke the link starting ${b.token.slice(0,8)}…? Anyone still holding it won't be able to join.`,"Revoke",!0))try{await Un("DELETE",`/api/orgs/${e.id}/invites/${b.token}`),Qe("Revoked."),u()}catch(x){Qe(x.message,!0)}},children:"Revoke"})]},b.token))]}),m.jsx("h3",{children:"Public share links"}),m.jsx("p",{className:"admin-sub",children:"Every live link across this organization's projects. A project's own links are on its Settings page, and on the file itself."}),m.jsx(_C,{shares:y||[],onChanged:d,showProject:!0})]})]})}function s$({org:e,owner:n,myEmail:r,onChanged:o}){const[s,l]=w.useState([{id:"email",desc:!1}]),u=w.useMemo(()=>__(),[]),d=w.useMemo(()=>[u.accessor("email",{id:"email",header:"Member",cell:h=>{const y=!!r&&h.getValue().toLowerCase()===r.toLowerCase();return m.jsx("span",{className:"ai-main",title:h.getValue(),children:h.getValue()+(y?" (you)":"")})}}),u.accessor("role",{id:"role",header:"Role",cell:h=>{const y=h.row.original,v=!!r&&y.email.toLowerCase()===r.toLowerCase();return!n||v?m.jsx("span",{className:"ai-tag role-static",children:y.role}):m.jsxs("span",{className:"role-cell",children:[m.jsxs("select",{"aria-label":`Role for ${y.email}`,value:y.role,onChange:async b=>{try{await Un("PATCH",`/api/orgs/${e.id}/members/${encodeURIComponent(y.email)}`,{role:b.target.value}),Qe("Role updated.")}catch(x){Qe(x.message,!0)}o()},children:[m.jsx("option",{value:"owner",children:"owner"}),m.jsx("option",{value:"member",children:"member"})]}),m.jsx("button",{className:"ai-del","aria-label":`Remove ${y.email}`,onClick:async()=>{if(await Yu("Remove member",`Remove ${y.email} from ${e.name}?`,"Remove",!0))try{await Un("DELETE",`/api/orgs/${e.id}/members/${encodeURIComponent(y.email)}`),Qe("Removed."),o()}catch(b){Qe(b.message,!0)}},children:"Remove"})]})}})],[u,e.id,e.name,n,r]),p=k_({data:e.members,columns:d,state:{sorting:s},onSortingChange:l,getCoreRowModel:D_(),getSortedRowModel:z_()});return m.jsx(xC,{table:p})}const l$=sg({require_verification:Bx(),require_approval:Bx()});function c$(){const e=jo(),{data:n,error:r}=Gt({queryKey:["admin","policy"],queryFn:()=>cn("/api/admin/policy")}),{data:o}=b_(!0),s=Jp({resolver:ag(l$),values:n?{require_verification:n.require_verification&&n.mailer,require_approval:n.require_approval}:{require_verification:!1,require_approval:!1}});if(w.useEffect(()=>{r&&Qe(r.message,!0)},[r]),!n)return null;const l=async(u,d,p)=>{try{await Ia(`/api/admin/pending/${u}/${d}`),Qe((d==="approve"?"Approved ":"Denied ")+p),e.invalidateQueries({queryKey:["admin","pending"]})}catch(h){Qe(h.message,!0)}};return m.jsxs("div",{className:"admin",children:[m.jsx("h1",{children:"Signup & access"}),m.jsx("p",{className:"admin-sub",children:"Who can create an account on this hub, and how new accounts are vetted."}),m.jsx("h3",{children:"New-account vetting"}),m.jsxs("form",{onSubmit:s.handleSubmit(async u=>{try{await Ia("/api/admin/policy",u),Qe("Signup policy saved."),e.invalidateQueries({queryKey:["admin","policy"]})}catch(d){Qe(d.message,!0)}}),children:[m.jsxs("div",{className:"admin-list",children:[m.jsx(Xx,{label:"Require email verification",desc:n.mailer?"New accounts must click an emailed link before they can sign in — proves they control the address.":"Configure SMTP on the server (auth.smtp) to enable email verification.",disabled:!n.mailer,inputProps:s.register("require_verification")}),m.jsx(Xx,{label:"Require admin approval",desc:"New accounts wait for a hub admin to approve them before they gain access.",inputProps:s.register("require_approval")})]}),m.jsx(Ct,{variant:"primary",type:"submit",style:{marginTop:14},disabled:!s.formState.isDirty,children:"Save policy"})]}),m.jsx("h3",{children:"Who can sign up"}),m.jsxs("div",{className:"admin-list",children:[m.jsxs("div",{className:"admin-item",children:[m.jsx("span",{className:"ai-main",children:"Allowed email domains"}),m.jsx("span",{className:"ai-tag",children:n.allowed_domains&&n.allowed_domains.length?n.allowed_domains.map(u=>"@"+u).join(", "):"any"})]}),m.jsxs("div",{className:"admin-item",children:[m.jsx("span",{className:"ai-main",children:"Self-signup"}),m.jsx("span",{className:"ai-tag",children:n.allow_signup?"open":"invite-only"})]}),m.jsxs("div",{className:"admin-item",children:[m.jsx("span",{className:"ai-main",children:"Hub admins"}),m.jsx("span",{className:"ai-tag",children:n.admins&&n.admins.length?n.admins.join(", "):"none"})]})]}),m.jsx("p",{className:"admin-sub",children:"Domains and admins are set in the server config file (they can't be widened from the browser)."}),m.jsx("h3",{children:"Pending signups"}),m.jsxs("div",{className:"admin-list",children:[(!o||o.length===0)&&m.jsx("div",{className:"admin-empty",children:"No one is waiting for approval."}),(o||[]).map(u=>m.jsxs("div",{className:"admin-item",children:[m.jsx("span",{className:"ai-main",children:(u.name?u.name+" · ":"")+u.email}),m.jsx(Ct,{variant:"primary",onClick:()=>l(u.id,"approve",u.email),children:"Approve"}),m.jsx("button",{className:"ai-del",onClick:()=>l(u.id,"deny",u.email),children:"Deny"})]},u.id))]})]})}function Xx({label:e,desc:n,disabled:r,inputProps:o}){return m.jsxs("label",{className:"admin-item toggle",style:r?{opacity:.55}:void 0,children:[m.jsxs("span",{className:"ai-main",children:[m.jsx("div",{className:"tg-label",children:e}),m.jsx("div",{className:"tg-desc",children:n})]}),m.jsx("input",{type:"checkbox",disabled:r,...o})]})}function u$({...e}){return m.jsx(r1,{"data-slot":"select",...e})}function d$({...e}){return m.jsx(s1,{"data-slot":"select-value",...e})}function f$({className:e,size:n="default",children:r,...o}){return m.jsxs(o1,{"data-slot":"select-trigger","data-size":n,className:We("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...o,children:[r,m.jsx(l1,{asChild:!0,children:m.jsx(Lp,{className:"size-4 opacity-50"})})]})}function h$({className:e,children:n,position:r="item-aligned",align:o="center",...s}){return m.jsx(u1,{children:m.jsxs(d1,{"data-slot":"select-content",className:We("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",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,align:o,...s,children:[m.jsx(p$,{}),m.jsx(g1,{className:We("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:n}),m.jsx(g$,{})]})})}function m$({className:e,children:n,...r}){return m.jsxs(x1,{"data-slot":"select-item",className:We("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[m.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:m.jsx(_1,{children:m.jsx(o_,{className:"size-4"})})}),m.jsx(w1,{children:n})]})}function p$({className:e,...n}){return m.jsx(C1,{"data-slot":"select-scroll-up-button",className:We("flex cursor-default items-center justify-center py-1",e),...n,children:m.jsx(HD,{className:"size-4"})})}function g$({className:e,...n}){return m.jsx(E1,{"data-slot":"select-scroll-down-button",className:We("flex cursor-default items-center justify-center py-1",e),...n,children:m.jsx(Lp,{className:"size-4"})})}const Jx=["#5b8def","#f5a623","#4cc38a","#e0679b","#8b7bf0","#3ec8c8","#e6934a"];function ul(e){let n=0;for(const r of e)n=n*31+r.charCodeAt(0)>>>0;return Jx[n%Jx.length]}function Wx({projects:e,currentId:n,menu:r}){const o=Pp(),s=e.find(u=>u.id===n),l=async()=>{const u=await Fp("New project","Project name","","Create");if(u!==null)try{const d=await Ia("/api/projects",{name:u});await o(),yn("/"+d.project.id),Qe(`Created “${d.project.name}”.`)}catch(d){Qe("Could not create the project: "+d.message,!0)}};return m.jsxs("nav",{id:"projects","aria-label":"Projects",children:[m.jsxs("div",{className:"nav-head",children:[m.jsx("span",{children:"Projects"}),m.jsx("button",{className:"nav-add",title:"New project","aria-label":"New project",onClick:l,children:"+"})]}),m.jsx("div",{className:"proj-row",children:m.jsxs(u$,{value:n||"",onValueChange:u=>{u&&u!==n&&(yn("/"+u),mr())},children:[m.jsxs(f$,{id:"project-select","aria-label":`Switch project — current: ${s?.name??"none"}`,title:s?.name,className:"proj-trigger",children:[s&&m.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:ul(s.name)},children:m.jsx(ka,{name:s.icon})}),s?m.jsx("span",{"data-slot":"select-value",children:s.name}):m.jsx(d$,{placeholder:"Select a project"})]}),m.jsx(h$,{className:"proj-menu",position:"popper",sideOffset:4,children:e.map(u=>m.jsxs(m$,{value:u.id,children:[m.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:ul(u.name)},children:m.jsx(ka,{name:u.icon})}),u.name]},u.id))})]})}),r&&m.jsx("ul",{className:"nav-menu","aria-label":"Project pages",children:[["dashboard","Dashboard","dashboard",r.onDashboard],["install","Installation","terminal",r.onInstall],["history","History","hist",r.onHistory],["settings","Settings","gear",r.onSettings]].map(([u,d,p,h])=>m.jsx("li",{children:m.jsxs("div",{id:"nav-"+u,className:"row"+(r.active===u?" active":""),role:"button",tabIndex:0,onClick:h,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),h())},children:[m.jsx(yt,{name:p}),m.jsx("span",{className:"label",children:d})]})},u))})]})}function EC({...e}){return m.jsx(wM,{"data-slot":"dropdown-menu",...e})}function RC({...e}){return m.jsx(SM,{"data-slot":"dropdown-menu-trigger",...e})}function TC({className:e,sideOffset:n=4,...r}){return m.jsx(_M,{children:m.jsx(CM,{"data-slot":"dropdown-menu-content",sideOffset:n,className:We("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...r})})}function Na({className:e,inset:n,variant:r="default",...o}){return m.jsx(RM,{"data-slot":"dropdown-menu-item","data-inset":n,"data-variant":r,className:We("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",e),...o})}function Xh({className:e,inset:n,...r}){return m.jsx(EM,{"data-slot":"dropdown-menu-label","data-inset":n,className:We("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...r})}function v$({me:e,org:n,admin:r,orgActive:o,billing:s}){const l=e.name||e.email,[u,d]=w.useState(!1),p=n?yu(n.manage_url):null,h=s?yu(s.url):null;return m.jsx("footer",{id:"accountbar",children:m.jsxs(EC,{modal:!1,open:u,onOpenChange:d,children:[m.jsx(RC,{asChild:!0,children:m.jsxs("button",{id:"account-btn",className:o?"active":void 0,"aria-label":"Account menu",children:[m.jsx("span",{className:"avatar",style:{background:ul(e.email)},"aria-hidden":"true",children:(l.trim()[0]||"?").toUpperCase()}),m.jsxs("span",{className:"acct",children:[m.jsx("b",{children:l}),e.name&&m.jsx("small",{children:e.email})]}),m.jsx(yt,{name:"chev"})]})}),m.jsxs(TC,{id:"account-menu",side:"top",align:"start",sideOffset:6,className:"acct-menu",children:[n&&m.jsxs(m.Fragment,{children:[m.jsx(Xh,{className:"menu-sec",children:"Organization"}),m.jsx(Na,{asChild:!0,children:m.jsxs("a",{id:"menu-org-settings","aria-current":o?"page":void 0,...p,onClick:y=>{p?.onClick?.(y),d(!1)},children:[m.jsx(yt,{name:"gear"}),m.jsxs("span",{children:[m.jsx("b",{children:n.name})," Settings"]}),!n.manage_url.startsWith("/")&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"ext","aria-hidden":"true",children:"↗"}),m.jsx("span",{className:"sr-only",children:" (opens in a new tab)"})]})]})}),s&&m.jsx(Na,{asChild:!0,children:m.jsxs("a",{id:"menu-billing",...h,onClick:y=>{h?.onClick?.(y),d(!1)},children:[m.jsx(yt,{name:"card"}),m.jsx("span",{children:"Billing"}),m.jsx("span",{className:"ps-chip plan-chip",children:s.plan})]})})]}),r&&m.jsxs(m.Fragment,{children:[m.jsx(Xh,{className:"menu-sec",children:"Hub"}),m.jsxs(Na,{id:"menu-hub-admin",onSelect:r.onClick,children:[m.jsx(yt,{name:"shield"}),m.jsxs("span",{children:["Signup & access",r.pending?` · ${r.pending}`:""]})]})]}),m.jsx(Xh,{className:"menu-sec",children:"Account"}),m.jsx(Na,{asChild:!0,children:m.jsxs("a",{id:"signout",href:"/auth/logout",children:[m.jsx(yt,{name:"power"}),m.jsx("span",{children:"Log out"})]})})]})]})})}function ki({className:e,...n}){return m.jsx("div",{"data-slot":"card",className:We("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...n})}function Li({className:e,...n}){return m.jsx("div",{"data-slot":"card-header",className:We("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...n})}function $i({className:e,...n}){return m.jsx("div",{"data-slot":"card-title",className:We("leading-none font-semibold",e),...n})}function $a({className:e,...n}){return m.jsx("div",{"data-slot":"card-description",className:We("text-muted-foreground text-sm",e),...n})}function Ii({className:e,...n}){return m.jsx("div",{"data-slot":"card-content",className:We("px-6",e),...n})}function ei({className:e,orientation:n="horizontal",decorative:r=!0,...o}){return m.jsx(rN,{"data-slot":"separator",decorative:r,orientation:n,className:We("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...o})}function y$({url:e}){const n=Gt({queryKey:["billing"],queryFn:()=>cn(e)});if(n.isLoading)return m.jsx("div",{className:"empty",children:"Loading…"});if(n.error||!n.data)return m.jsxs("div",{className:"empty",children:[m.jsx("h3",{children:"Billing is unavailable"}),m.jsx("p",{children:n.error?.message||"Try again shortly."})]});const r=n.data;return m.jsxs("div",{className:"project-settings",id:"billing-view",children:[m.jsxs("h2",{children:["Billing",m.jsx("span",{className:"ps-chip plan-chip",children:r.plan.name})]}),m.jsxs(ki,{children:[m.jsxs(Li,{children:[m.jsxs($i,{children:[r.plan.name," plan",r.plan.status?` (${r.plan.status})`:""]}),m.jsxs($a,{children:["Organization ",r.org," · ",r.usage.used," of ",r.usage.cap," used · ",r.seats.used," of ",r.seats.cap," ",r.seats.cap===1?"seat":"seats"]})]}),m.jsx(ei,{}),m.jsx(Ii,{children:m.jsx("div",{className:"usage-bar",children:m.jsx("div",{style:{width:`${r.usage.pct}%`}})})})]}),r.owner?m.jsx("div",{className:"plan-grid",children:r.plans.map(o=>m.jsxs(ki,{children:[m.jsxs(Li,{children:[m.jsx($i,{children:o.name}),m.jsx($a,{children:o.blurb})]}),m.jsx(ei,{}),m.jsxs(Ii,{children:[m.jsxs("p",{className:"plan-price",children:[o.price,m.jsx("small",{children:" / user / month"})]}),m.jsxs("form",{method:"post",action:r.checkout_url,children:[m.jsx("input",{type:"hidden",name:"plan",value:o.id}),m.jsx(Ct,{type:"submit",disabled:o.current,variant:o.current?"subtle":"default",children:o.current?"Current plan":`Upgrade to ${o.name}`})]})]})]},o.id))}):m.jsx("p",{className:"muted-note",children:"Only an organization owner can change the plan."}),r.owner&&r.has_customer&&m.jsxs(ki,{children:[m.jsxs(Li,{children:[m.jsx($i,{children:"Manage subscription"}),m.jsx($a,{children:"Change seats, update the card, download invoices, or cancel."})]}),m.jsx(ei,{}),m.jsx(Ii,{children:m.jsx("form",{method:"post",action:r.portal_url,children:m.jsx(Ct,{type:"submit",variant:"subtle",children:"Open the billing portal"})})})]})]})}function b$({className:e,type:n,...r}){return m.jsx("input",{type:n,"data-slot":"input",className:We("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e),...r})}function Jh({className:e,...n}){return m.jsx(OM,{"data-slot":"label",className:We("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}function x$({className:e,...n}){return m.jsx("textarea",{"data-slot":"textarea",className:We("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...n})}const ew={read:1,write:2,admin:3};function wo(e,n){return(ew[e||""]||0)>=(ew[n]||0)}const Um=280,w$=sg({name:au().trim().min(1,"Give the project a name.").max(120,"Keep the name under 120 characters."),description:au().max(Um,`Keep the description under ${Um} characters.`),icon:au()});function S$({project:e,org:n,onDeleted:r}){const o=Pp(),s=wo(e.perm,"admin"),l=Jp({resolver:ag(w$),defaultValues:{name:e.name,description:e.description??"",icon:e.icon??""}});w.useEffect(()=>{l.reset({name:e.name,description:e.description??"",icon:e.icon??""})},[e.id,e.name,e.description,e.icon]);const u=l.watch("icon"),d=l.watch("description"),p=l.handleSubmit(async h=>{const y=l.formState.dirtyFields,v={};if(y.name&&(v.name=h.name.trim()),y.description&&(v.description=h.description),y.icon&&(v.icon=h.icon),Object.keys(v).length!==0)try{await Un("PATCH","/api/projects/"+e.id,v),Qe("Saved."),l.reset({...h,name:h.name.trim()}),await o()}catch(b){Qe(b.message,!0)}});return m.jsxs("div",{className:"project-settings",children:[m.jsxs("h2",{children:[e.name,!wo(e.perm,"write")&&m.jsx("span",{className:"ps-chip",children:"Read-only"})]}),m.jsxs(ki,{children:[m.jsxs(Li,{children:[m.jsx($i,{children:"General"}),m.jsx($a,{children:"Name, description and icon for this project."})]}),m.jsx(ei,{}),m.jsx(Ii,{children:m.jsxs("form",{className:"ps-form",onSubmit:p,children:[m.jsxs("div",{className:"ps-field",children:[m.jsx(Jh,{htmlFor:"ps-icon-btn",children:"Icon"}),m.jsxs("div",{className:"ps-icon-row",children:[m.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:ul(e.name)},children:m.jsx(ka,{name:u})}),m.jsxs(EC,{children:[m.jsx(RC,{asChild:!0,children:m.jsx(Ct,{id:"ps-icon-btn",type:"button",variant:"subtle",disabled:!s,children:"Change"})}),m.jsxs(TC,{align:"start",className:"ps-icon-grid",children:[m.jsx(Na,{className:"ps-icon-cell"+(u===""?" active":""),title:"Default","aria-label":"Default icon",onSelect:()=>l.setValue("icon","",{shouldDirty:!0}),children:m.jsx(ka,{})}),Object.keys(g_).map(h=>m.jsx(Na,{className:"ps-icon-cell"+(u===h?" active":""),title:h,"aria-label":h,onSelect:()=>l.setValue("icon",h,{shouldDirty:!0}),children:m.jsx(ka,{name:h})},h))]})]})]})]}),m.jsxs("div",{className:"ps-field",children:[m.jsx(Jh,{htmlFor:"ps-name",children:"Name"}),m.jsx(b$,{id:"ps-name",disabled:!s,"aria-invalid":!!l.formState.errors.name,"aria-describedby":l.formState.errors.name?"ps-name-err":void 0,...l.register("name")}),l.formState.errors.name&&m.jsx("span",{id:"ps-name-err",role:"alert",className:"field-err",children:l.formState.errors.name.message})]}),m.jsxs("div",{className:"ps-field",children:[m.jsxs(Jh,{htmlFor:"ps-desc",children:["Description ",m.jsx("span",{className:"ps-opt",children:"(optional)"})]}),m.jsx(x$,{id:"ps-desc",rows:2,disabled:!s,placeholder:"What this project is for.","aria-invalid":!!l.formState.errors.description,"aria-describedby":l.formState.errors.description?"ps-desc-err":void 0,...l.register("description")}),m.jsxs("div",{className:"ps-meta",children:[l.formState.errors.description?m.jsx("span",{id:"ps-desc-err",role:"alert",className:"field-err",children:l.formState.errors.description.message}):m.jsx("span",{}),m.jsxs("span",{className:"ps-count",children:[d.length," / ",Um]})]})]}),s&&m.jsxs(m.Fragment,{children:[m.jsx(ei,{}),m.jsx("div",{className:"ps-actions",children:m.jsx(Ct,{id:"ps-save",type:"submit",variant:"primary",disabled:!l.formState.isDirty||l.formState.isSubmitting,children:"Save changes"})})]})]})})]}),m.jsxs(ki,{children:[m.jsx(Li,{children:m.jsx($i,{children:"About"})}),m.jsx(ei,{}),m.jsx(Ii,{children:m.jsxs("dl",{className:"ps-facts",children:[m.jsx("dt",{children:"Project id"}),m.jsx("dd",{children:m.jsx("code",{children:e.id})}),n&&m.jsxs(m.Fragment,{children:[m.jsx("dt",{children:"Workspace"}),m.jsx("dd",{children:n.name})]}),e.created&&m.jsxs(m.Fragment,{children:[m.jsx("dt",{children:"Created"}),m.jsx("dd",{children:new Date(e.created).toLocaleDateString()})]})]})})]}),m.jsx(E$,{project:e,org:n}),m.jsx(_$,{project:e}),s&&m.jsxs(ki,{className:"ps-danger",children:[m.jsx(Li,{children:m.jsx($i,{children:"Danger zone"})}),m.jsx(ei,{}),m.jsxs(Ii,{children:[m.jsx("p",{children:"Deleting removes the project from this hub. Its files stay in storage. This can't be undone."}),m.jsx(Ct,{variant:"danger",onClick:async()=>{if(await Fp(`Delete “${e.name}”?`,"This can't be undone. Type the project name to confirm:","","Delete project",{match:e.name,danger:!0})!==null)try{await Un("DELETE","/api/projects/"+e.id),Qe(`Deleted “${e.name}”.`),await r()}catch(y){Qe(y.message,!0)}},children:"Delete project"})]})]})]})}function _$({project:e}){const n=jo(),{data:r,error:o}=y_(e.id);return o?null:m.jsxs(ki,{children:[m.jsxs(Li,{children:[m.jsx($i,{children:"Public links"}),m.jsx($a,{children:"Files in this project that anyone with the URL can read — no account needed."})]}),m.jsx(ei,{}),m.jsx(Ii,{children:m.jsx(_C,{shares:r||[],canRevoke:wo(e.perm,"write"),onChanged:()=>n.invalidateQueries({queryKey:["shares",e.id]}),empty:"No public links."})})]})}const Hm=[{value:"admin",label:"Admin"},{value:"write",label:"Write"},{value:"read",label:"Read"},{value:"none",label:"No access"}],C$=Object.fromEntries(Hm.map(e=>[e.value,e.label]));function E$({project:e,org:n}){const r=jo(),{data:o,error:s}=a3(e.id),l=wo(e.perm,"admin"),u=()=>{r.invalidateQueries({queryKey:["permissions",e.id]}),r.invalidateQueries({queryKey:["projects"]})},d=async(x,C)=>{try{await x(),Qe(C)}catch(_){Qe(_.message,!0)}u()};if(s||!o)return null;const p=o,h=`/api/p/${e.id}/permissions`,y=new Set((n?.members||[]).filter(x=>x.role==="owner").map(x=>x.email.toLowerCase())),v=[...p.grants.filter(x=>!y.has(x.email.toLowerCase())),...[...y].sort().map(x=>({email:x,level:"admin",owner:!0}))],b=async()=>{const x=await Fp("Add an exception","Email of a workspace member. They get Read access; change it in the table.","","Add");x===null||!x.trim()||await d(()=>Un("PUT",`${h}/${encodeURIComponent(x.trim())}`,{level:"read"}),"Added.")};return m.jsxs(ki,{className:"ps-people",children:[m.jsxs(Li,{children:[m.jsx($i,{children:"People"}),m.jsx($a,{children:"Who can see and change this project."})]}),m.jsx(ei,{}),m.jsxs(Ii,{children:[m.jsxs("p",{className:"ps-row",children:[m.jsxs("span",{children:["Everyone in ",n?.name||"this workspace"," can"]}),m.jsx("select",{"aria-label":"Default access for workspace members",disabled:!l,value:p.default,onChange:async x=>{const C=x.target.value;if(C==="none"&&!await Yu("Make this project invite-only?","Only people listed below (and workspace owners) will see this project.","Make invite-only")){u();return}await d(()=>Un("PUT",h,{default:C}),"Default access updated.")},children:Hm.filter(x=>x.value!=="admin").map(x=>m.jsx("option",{value:x.value,children:x.label},x.value))})]}),p.default==="none"&&m.jsx("p",{className:"ps-note",children:"This project is invite-only: only the people below and workspace owners can see it."}),m.jsxs("div",{className:"ps-people-head",children:[m.jsx("h4",{children:"Exceptions"}),l&&m.jsx(Ct,{type:"button",variant:"subtle",onClick:b,children:"+ Add"})]}),v.length===0?m.jsx("p",{className:"ps-note",children:"No exceptions — everyone gets the access above."}):m.jsx("div",{className:"admin-list",children:v.map(x=>{const C="owner"in x;return m.jsxs("div",{className:"admin-item",children:[m.jsxs("span",{className:"ai-main",title:x.email,children:[x.email,p.creator&&x.email.toLowerCase()===p.creator.toLowerCase()&&m.jsx("span",{className:"ai-tag",children:" (creator)"})]}),C?m.jsx("span",{className:"ai-tag",children:"Workspace owner — always admin"}):m.jsxs("span",{className:"role-cell",children:[m.jsx("select",{"aria-label":`Access for ${x.email}`,disabled:!l,value:x.level,onChange:_=>d(()=>Un("PUT",`${h}/${encodeURIComponent(x.email)}`,{level:_.target.value}),`${x.email} is now ${C$[_.target.value]||_.target.value}.`),children:Hm.map(_=>m.jsx("option",{value:_.value,children:_.label},_.value))}),l&&m.jsx("button",{className:"ai-del","aria-label":`Remove exception for ${x.email}`,onClick:()=>d(()=>Un("DELETE",`${h}/${encodeURIComponent(x.email)}`),"Reverted to the default access."),children:"Remove"})]})]},x.email)})})]})]})}const OC="https://raw.githubusercontent.com/runbear-io/beardrive/main/INSTALL_FOR_AGENTS.md";function jC({project:e}){const n=window.location.origin,r="Follow "+OC+`
+Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const d=u[1];if(n===u[0]){l(u);continue}if(e.external){const m=e.external.registry.get(u[0])?.id;if(n!==u[0]&&m){l(u);continue}}if(e.metadataRegistry.get(u[0])?.id){l(u);continue}if(d.cycle){l(u);continue}if(d.count>1&&e.reused==="ref"){l(u);continue}}}function fC(e,n){const r=e.seen.get(n);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=d=>{const p=e.seen.get(d);if(p.ref===null)return;const m=p.def??p.schema,y={...m},v=p.ref;if(p.ref=null,v){o(v);const x=e.seen.get(v),C=x.schema;if(C.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(m.allOf=m.allOf??[],m.allOf.push(C)):Object.assign(m,C),Object.assign(m,y),d._zod.parent===v)for(const E in m)E==="$ref"||E==="allOf"||E in y||delete m[E];if(C.$ref&&x.def)for(const E in m)E==="$ref"||E==="allOf"||E in x.def&&JSON.stringify(m[E])===JSON.stringify(x.def[E])&&delete m[E]}const b=d._zod.parent;if(b&&b!==v){o(b);const x=e.seen.get(b);if(x?.schema.$ref&&(m.$ref=x.schema.$ref,x.def))for(const C in m)C==="$ref"||C==="allOf"||C in x.def&&JSON.stringify(m[C])===JSON.stringify(x.def[C])&&delete m[C]}e.override({zodSchema:d,jsonSchema:m,path:p.path??[]})};for(const d of[...e.seen.entries()].reverse())o(d[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(n)?.id;if(!d)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(d)}Object.assign(s,r.def??r.schema);const l=e.metadataRegistry.get(n)?.id;l!==void 0&&s.id===l&&delete s.id;const u=e.external?.defs??{};for(const d of e.seen.entries()){const p=d[1];p.def&&p.defId&&(p.def.id===p.defId&&delete p.def.id,u[p.defId]=p.def)}e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?s.$defs=u:s.definitions=u);try{const d=JSON.parse(JSON.stringify(s));return Object.defineProperty(d,"~standard",{value:{...n["~standard"],jsonSchema:{input:Cu(n,"input",e.processors),output:Cu(n,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function vn(e,n){const r=n??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return vn(o.element,r);if(o.type==="set")return vn(o.valueType,r);if(o.type==="lazy")return vn(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return vn(o.innerType,r);if(o.type==="intersection")return vn(o.left,r)||vn(o.right,r);if(o.type==="record"||o.type==="map")return vn(o.keyType,r)||vn(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:vn(o.in,r)||vn(o.out,r);if(o.type==="object"){for(const s in o.shape)if(vn(o.shape[s],r))return!0;return!1}if(o.type==="union"){for(const s of o.options)if(vn(s,r))return!0;return!1}if(o.type==="tuple"){for(const s of o.items)if(vn(s,r))return!0;return!!(o.rest&&vn(o.rest,r))}return!1}const gL=(e,n={})=>r=>{const o=uC({...r,processors:n});return un(e,o),dC(o,e),fC(o,e)},Cu=(e,n,r={})=>o=>{const{libraryOptions:s,target:l}=o??{},u=uC({...s??{},target:l,io:n,processors:r});return un(e,u),dC(u,e),fC(u,e)},vL={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},yL=(e,n,r,o)=>{const s=r;s.type="string";const{minimum:l,maximum:u,format:d,patterns:p,contentEncoding:m}=e._zod.bag;if(typeof l=="number"&&(s.minLength=l),typeof u=="number"&&(s.maxLength=u),d&&(s.format=vL[d]??d,s.format===""&&delete s.format,d==="time"&&delete s.format),m&&(s.contentEncoding=m),p&&p.size>0){const y=[...p];y.length===1?s.pattern=y[0].source:y.length>1&&(s.allOf=[...y.map(v=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},bL=(e,n,r,o)=>{r.type="boolean"},xL=(e,n,r,o)=>{r.not={}},wL=(e,n,r,o)=>{},SL=(e,n,r,o)=>{const s=e._zod.def,l=Q_(s.entries);l.every(u=>typeof u=="number")&&(r.type="number"),l.every(u=>typeof u=="string")&&(r.type="string"),r.enum=l},_L=(e,n,r,o)=>{if(n.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},CL=(e,n,r,o)=>{if(n.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},EL=(e,n,r,o)=>{const s=r,l=e._zod.def,{minimum:u,maximum:d}=e._zod.bag;typeof u=="number"&&(s.minItems=u),typeof d=="number"&&(s.maxItems=d),s.type="array",s.items=un(l.element,n,{...o,path:[...o.path,"items"]})},RL=(e,n,r,o)=>{const s=r,l=e._zod.def;s.type="object",s.properties={};const u=l.shape;for(const m in u)s.properties[m]=un(u[m],n,{...o,path:[...o.path,"properties",m]});const d=new Set(Object.keys(u)),p=new Set([...d].filter(m=>{const y=l.shape[m]._zod;return n.io==="input"?y.optin===void 0:y.optout===void 0}));p.size>0&&(s.required=Array.from(p)),l.catchall?._zod.def.type==="never"?s.additionalProperties=!1:l.catchall?l.catchall&&(s.additionalProperties=un(l.catchall,n,{...o,path:[...o.path,"additionalProperties"]})):n.io==="output"&&(s.additionalProperties=!1)},TL=(e,n,r,o)=>{const s=e._zod.def,l=s.inclusive===!1,u=s.options.map((d,p)=>un(d,n,{...o,path:[...o.path,l?"oneOf":"anyOf",p]}));l?r.oneOf=u:r.anyOf=u},OL=(e,n,r,o)=>{const s=e._zod.def,l=un(s.left,n,{...o,path:[...o.path,"allOf",0]}),u=un(s.right,n,{...o,path:[...o.path,"allOf",1]}),d=m=>"allOf"in m&&Object.keys(m).length===1,p=[...d(l)?l.allOf:[l],...d(u)?u.allOf:[u]];r.allOf=p},jL=(e,n,r,o)=>{const s=e._zod.def,l=un(s.innerType,n,o),u=n.seen.get(e);n.target==="openapi-3.0"?(u.ref=s.innerType,r.nullable=!0):r.anyOf=[l,{type:"null"}]},AL=(e,n,r,o)=>{const s=e._zod.def;un(s.innerType,n,o);const l=n.seen.get(e);l.ref=s.innerType},ML=(e,n,r,o)=>{const s=e._zod.def;un(s.innerType,n,o);const l=n.seen.get(e);l.ref=s.innerType,r.default=JSON.parse(JSON.stringify(s.defaultValue))},NL=(e,n,r,o)=>{const s=e._zod.def;un(s.innerType,n,o);const l=n.seen.get(e);l.ref=s.innerType,n.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},DL=(e,n,r,o)=>{const s=e._zod.def;un(s.innerType,n,o);const l=n.seen.get(e);l.ref=s.innerType;let u;try{u=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=u},zL=(e,n,r,o)=>{const s=e._zod.def,l=s.in._zod.traits.has("$ZodTransform"),u=n.io==="input"?l?s.out:s.in:s.out;un(u,n,o);const d=n.seen.get(e);d.ref=u},kL=(e,n,r,o)=>{const s=e._zod.def;un(s.innerType,n,o);const l=n.seen.get(e);l.ref=s.innerType,r.readOnly=!0},hC=(e,n,r,o)=>{const s=e._zod.def;un(s.innerType,n,o);const l=n.seen.get(e);l.ref=s.innerType};function Pm(){return Pm=Object.assign?Object.assign.bind():function(e){for(var n=1;n0){var p=s.errors[0][0];r[d]={message:p.message,type:p.code}}else r[d]={message:u,type:l};if(s.code==="invalid_union"&&s.errors.forEach(function(v){return v.forEach(function(b){return e.push(Pm({},b,{path:[].concat(s.path,b.path)}))})}),n){var m=r[d].types,y=m&&m[s.code];r[d]=Jp(d,n,r,l,y?[].concat(y,s.message):s.message)}e.shift()};e.length;)o();return r}function sg(e,n,r){if(r===void 0&&(r={}),(function(o){return"_def"in o&&typeof o._def=="object"&&"typeName"in o._def})(e))return function(o,s,l){try{return Promise.resolve(Ux(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](o,n)).then(function(u){return l.shouldUseNativeValidation&&Im({},l),{errors:{},values:r.raw?Object.assign({},o):u}})},function(u){if((function(d){return Array.isArray(d?.issues)})(u))return{values:{},errors:Rx(LL(u.errors,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw u}))}catch(u){return Promise.reject(u)}};if((function(o){return"_zod"in o&&typeof o._zod=="object"})(e))return function(o,s,l){try{return Promise.resolve(Ux(function(){return Promise.resolve((r.mode==="sync"?V4:F4)(e,o,n)).then(function(u){return l.shouldUseNativeValidation&&Im({},l),{errors:{},values:r.raw?Object.assign({},o):u}})},function(u){if((function(d){return d instanceof og})(u))return{values:{},errors:Rx($L(u.issues,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw u}))}catch(u){return Promise.reject(u)}};throw new Error("Invalid input: not a Zod schema")}const IL=ue("ZodISODateTime",(e,n)=>{q5.init(e,n),Et.init(e,n)});function VL(e){return K6(IL,e)}const FL=ue("ZodISODate",(e,n)=>{G5.init(e,n),Et.init(e,n)});function PL(e){return Y6(FL,e)}const UL=ue("ZodISOTime",(e,n)=>{Z5.init(e,n),Et.init(e,n)});function HL(e){return Q6(UL,e)}const BL=ue("ZodISODuration",(e,n)=>{K5.init(e,n),Et.init(e,n)});function qL(e){return X6(BL,e)}const GL=(e,n)=>{og.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>I4(e,r)},flatten:{value:r=>$4(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Vm,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Vm,2)}},isEmpty:{get(){return e.issues.length===0}}})},ir=ue("ZodError",GL,{Parent:Error}),ZL=nd(ir),KL=rd(ir),YL=id(ir),QL=od(ir),XL=H4(ir),JL=B4(ir),WL=q4(ir),e8=G4(ir),t8=Z4(ir),n8=K4(ir),r8=Y4(ir),i8=Q4(ir),Hx=new WeakMap;function sd(e,n,r){const o=Object.getPrototypeOf(e);let s=Hx.get(o);if(s||(s=new Set,Hx.set(o,s)),!s.has(n)){s.add(n);for(const l in r){const u=r[l];Object.defineProperty(o,l,{configurable:!0,enumerable:!1,get(){const d=u.bind(this);return Object.defineProperty(this,l,{configurable:!0,writable:!0,enumerable:!0,value:d}),d},set(d){Object.defineProperty(this,l,{configurable:!0,writable:!0,enumerable:!0,value:d})}})}}}const Ut=ue("ZodType",(e,n)=>(Pt.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:Cu(e,"input"),output:Cu(e,"output")}}),e.toJSONSchema=gL(e,{}),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.parse=(r,o)=>ZL(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>YL(e,r,o),e.parseAsync=async(r,o)=>KL(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>QL(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>XL(e,r,o),e.decode=(r,o)=>JL(e,r,o),e.encodeAsync=async(r,o)=>WL(e,r,o),e.decodeAsync=async(r,o)=>e8(e,r,o),e.safeEncode=(r,o)=>t8(e,r,o),e.safeDecode=(r,o)=>n8(e,r,o),e.safeEncodeAsync=async(r,o)=>r8(e,r,o),e.safeDecodeAsync=async(r,o)=>i8(e,r,o),sd(e,"ZodType",{check(...r){const o=this.def;return this.clone(Yi(o,{checks:[...o.checks??[],...r.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return Qi(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(X8(r,o))},superRefine(r,o){return this.check(J8(r,o))},overwrite(r){return this.check(Za(r))},optional(){return Zx(this)},exactOptional(){return I8(this)},nullable(){return Kx(this)},nullish(){return Zx(Kx(this))},nonoptional(r){return B8(this,r)},array(){return O8(this)},or(r){return M8([this,r])},and(r){return D8(this,r)},transform(r){return Yx(this,L8(r))},default(r){return P8(this,r)},prefault(r){return H8(this,r)},catch(r){return G8(this,r)},pipe(r){return Yx(this,r)},readonly(){return Y8(this)},describe(r){const o=this.clone();return Zs.add(o,{description:r}),o},meta(...r){if(r.length===0)return Zs.get(this);const o=this.clone();return Zs.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Zs.get(e)?.description},configurable:!0}),e)),mC=ue("_ZodString",(e,n)=>{ag.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(o,s,l)=>yL(e,o,s);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,sd(e,"_ZodString",{regex(...o){return this.check(tL(...o))},includes(...o){return this.check(iL(...o))},startsWith(...o){return this.check(oL(...o))},endsWith(...o){return this.check(aL(...o))},min(...o){return this.check(_u(...o))},max(...o){return this.check(lC(...o))},length(...o){return this.check(cC(...o))},nonempty(...o){return this.check(_u(1,...o))},lowercase(o){return this.check(nL(o))},uppercase(o){return this.check(rL(o))},trim(){return this.check(lL())},normalize(...o){return this.check(sL(...o))},toLowerCase(){return this.check(cL())},toUpperCase(){return this.check(uL())},slugify(){return this.check(dL())}})}),o8=ue("ZodString",(e,n)=>{ag.init(e,n),mC.init(e,n),e.email=r=>e.check(T6(a8,r)),e.url=r=>e.check(N6(s8,r)),e.jwt=r=>e.check(Z6(S8,r)),e.emoji=r=>e.check(D6(l8,r)),e.guid=r=>e.check(Px(Bx,r)),e.uuid=r=>e.check(O6(Jc,r)),e.uuidv4=r=>e.check(j6(Jc,r)),e.uuidv6=r=>e.check(A6(Jc,r)),e.uuidv7=r=>e.check(M6(Jc,r)),e.nanoid=r=>e.check(z6(c8,r)),e.guid=r=>e.check(Px(Bx,r)),e.cuid=r=>e.check(k6(u8,r)),e.cuid2=r=>e.check(L6(d8,r)),e.ulid=r=>e.check($6(f8,r)),e.base64=r=>e.check(B6(b8,r)),e.base64url=r=>e.check(q6(x8,r)),e.xid=r=>e.check(I6(h8,r)),e.ksuid=r=>e.check(V6(m8,r)),e.ipv4=r=>e.check(F6(p8,r)),e.ipv6=r=>e.check(P6(g8,r)),e.cidrv4=r=>e.check(U6(v8,r)),e.cidrv6=r=>e.check(H6(y8,r)),e.e164=r=>e.check(G6(w8,r)),e.datetime=r=>e.check(VL(r)),e.date=r=>e.check(PL(r)),e.time=r=>e.check(HL(r)),e.duration=r=>e.check(qL(r))});function au(e){return R6(o8,e)}const Et=ue("ZodStringFormat",(e,n)=>{wt.init(e,n),mC.init(e,n)}),a8=ue("ZodEmail",(e,n)=>{L5.init(e,n),Et.init(e,n)}),Bx=ue("ZodGUID",(e,n)=>{z5.init(e,n),Et.init(e,n)}),Jc=ue("ZodUUID",(e,n)=>{k5.init(e,n),Et.init(e,n)}),s8=ue("ZodURL",(e,n)=>{$5.init(e,n),Et.init(e,n)}),l8=ue("ZodEmoji",(e,n)=>{I5.init(e,n),Et.init(e,n)}),c8=ue("ZodNanoID",(e,n)=>{V5.init(e,n),Et.init(e,n)}),u8=ue("ZodCUID",(e,n)=>{F5.init(e,n),Et.init(e,n)}),d8=ue("ZodCUID2",(e,n)=>{P5.init(e,n),Et.init(e,n)}),f8=ue("ZodULID",(e,n)=>{U5.init(e,n),Et.init(e,n)}),h8=ue("ZodXID",(e,n)=>{H5.init(e,n),Et.init(e,n)}),m8=ue("ZodKSUID",(e,n)=>{B5.init(e,n),Et.init(e,n)}),p8=ue("ZodIPv4",(e,n)=>{Y5.init(e,n),Et.init(e,n)}),g8=ue("ZodIPv6",(e,n)=>{Q5.init(e,n),Et.init(e,n)}),v8=ue("ZodCIDRv4",(e,n)=>{X5.init(e,n),Et.init(e,n)}),y8=ue("ZodCIDRv6",(e,n)=>{J5.init(e,n),Et.init(e,n)}),b8=ue("ZodBase64",(e,n)=>{W5.init(e,n),Et.init(e,n)}),x8=ue("ZodBase64URL",(e,n)=>{t6.init(e,n),Et.init(e,n)}),w8=ue("ZodE164",(e,n)=>{n6.init(e,n),Et.init(e,n)}),S8=ue("ZodJWT",(e,n)=>{i6.init(e,n),Et.init(e,n)}),_8=ue("ZodBoolean",(e,n)=>{o6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>bL(e,r,o)});function qx(e){return J6(_8,e)}const C8=ue("ZodUnknown",(e,n)=>{a6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>wL()});function Gx(){return W6(C8)}const E8=ue("ZodNever",(e,n)=>{s6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>xL(e,r,o)});function R8(e){return eL(E8,e)}const T8=ue("ZodArray",(e,n)=>{l6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>EL(e,r,o,s),e.element=n.element,sd(e,"ZodArray",{min(r,o){return this.check(_u(r,o))},nonempty(r){return this.check(_u(1,r))},max(r,o){return this.check(lC(r,o))},length(r,o){return this.check(cC(r,o))},unwrap(){return this.element}})});function O8(e,n){return fL(T8,e,n)}const j8=ue("ZodObject",(e,n)=>{u6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>RL(e,r,o,s),dt(e,"shape",()=>n.shape),sd(e,"ZodObject",{keyof(){return z8(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Gx()})},loose(){return this.clone({...this._zod.def,catchall:Gx()})},strict(){return this.clone({...this._zod.def,catchall:R8()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return M4(this,r)},safeExtend(r){return N4(this,r)},merge(r){return D4(this,r)},pick(r){return j4(this,r)},omit(r){return A4(this,r)},partial(...r){return z4(pC,this,r[0])},required(...r){return k4(gC,this,r[0])}})});function lg(e,n){const r={type:"object",shape:e??{},...Ie(n)};return new j8(r)}const A8=ue("ZodUnion",(e,n)=>{d6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>TL(e,r,o,s),e.options=n.options});function M8(e,n){return new A8({type:"union",options:e,...Ie(n)})}const N8=ue("ZodIntersection",(e,n)=>{f6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>OL(e,r,o,s)});function D8(e,n){return new N8({type:"intersection",left:e,right:n})}const Um=ue("ZodEnum",(e,n)=>{h6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(o,s,l)=>SL(e,o,s),e.enum=n.entries,e.options=Object.values(n.entries);const r=new Set(Object.keys(n.entries));e.extract=(o,s)=>{const l={};for(const u of o)if(r.has(u))l[u]=n.entries[u];else throw new Error(`Key ${u} not found in enum`);return new Um({...n,checks:[],...Ie(s),entries:l})},e.exclude=(o,s)=>{const l={...n.entries};for(const u of o)if(r.has(u))delete l[u];else throw new Error(`Key ${u} not found in enum`);return new Um({...n,checks:[],...Ie(s),entries:l})}});function z8(e,n){const r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Um({type:"enum",entries:r,...Ie(n)})}const k8=ue("ZodTransform",(e,n)=>{m6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>CL(e,r),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Y_(e.constructor.name);r.addIssue=l=>{if(typeof l=="string")r.issues.push(cl(l,r.value,n));else{const u=l;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=r.value),u.inst??(u.inst=e),r.issues.push(cl(u))}};const s=n.transform(r.value,r);return s instanceof Promise?s.then(l=>(r.value=l,r.fallback=!0,r)):(r.value=s,r.fallback=!0,r)}});function L8(e){return new k8({type:"transform",transform:e})}const pC=ue("ZodOptional",(e,n)=>{sC.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>hC(e,r,o,s),e.unwrap=()=>e._zod.def.innerType});function Zx(e){return new pC({type:"optional",innerType:e})}const $8=ue("ZodExactOptional",(e,n)=>{p6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>hC(e,r,o,s),e.unwrap=()=>e._zod.def.innerType});function I8(e){return new $8({type:"optional",innerType:e})}const V8=ue("ZodNullable",(e,n)=>{g6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>jL(e,r,o,s),e.unwrap=()=>e._zod.def.innerType});function Kx(e){return new V8({type:"nullable",innerType:e})}const F8=ue("ZodDefault",(e,n)=>{v6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>ML(e,r,o,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function P8(e,n){return new F8({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():J_(n)}})}const U8=ue("ZodPrefault",(e,n)=>{y6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>NL(e,r,o,s),e.unwrap=()=>e._zod.def.innerType});function H8(e,n){return new U8({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():J_(n)}})}const gC=ue("ZodNonOptional",(e,n)=>{b6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>AL(e,r,o,s),e.unwrap=()=>e._zod.def.innerType});function B8(e,n){return new gC({type:"nonoptional",innerType:e,...Ie(n)})}const q8=ue("ZodCatch",(e,n)=>{x6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>DL(e,r,o,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function G8(e,n){return new q8({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const Z8=ue("ZodPipe",(e,n)=>{w6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>zL(e,r,o,s),e.in=n.in,e.out=n.out});function Yx(e,n){return new Z8({type:"pipe",in:e,out:n})}const K8=ue("ZodReadonly",(e,n)=>{S6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>kL(e,r,o,s),e.unwrap=()=>e._zod.def.innerType});function Y8(e){return new K8({type:"readonly",innerType:e})}const Q8=ue("ZodCustom",(e,n)=>{_6.init(e,n),Ut.init(e,n),e._zod.processJSONSchema=(r,o,s)=>_L(e,r)});function X8(e,n={}){return hL(Q8,e,n)}function J8(e,n){return mL(e,n)}const W8=/\.(md|markdown)$/i,e$=/\.(png|jpe?g|gif|svg|webp|ico|bmp|avif)$/i,vC=/\.html?$/i,yC=/\.pdf$/i,t$=/\.(txt|log|json|ya?ml|toml|csv|go|py|js|ts|jsx|tsx|sh|bash|zsh|rb|rs|c|h|cpp|java|kt|swift|sql|css|xml|ini|conf|env|mod|sum|jsonl)$/i;function cg(e){if(e<1024)return e+" B";const n=["KB","MB","GB","TB"];let r=-1;do e/=1024,r++;while(e>=1024&&r`:e.user||e.author||"unknown"}function n$({className:e,...n}){return h.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:h.jsx("table",{"data-slot":"table",className:We("w-full caption-bottom text-sm",e),...n})})}function r$({className:e,...n}){return h.jsx("thead",{"data-slot":"table-header",className:We("[&_tr]:border-b",e),...n})}function i$({className:e,...n}){return h.jsx("tbody",{"data-slot":"table-body",className:We("[&_tr:last-child]:border-0",e),...n})}function Qx({className:e,...n}){return h.jsx("tr",{"data-slot":"table-row",className:We("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",e),...n})}function Xx({className:e,...n}){return h.jsx("th",{"data-slot":"table-head",className:We("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...n})}function o$({className:e,...n}){return h.jsx("td",{"data-slot":"table-cell",className:We("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...n})}function a$({header:e}){const n=e.column.getIsSorted();return e.column.getCanSort()?h.jsx(Xx,{"data-sort":n||void 0,"aria-sort":n==="asc"?"ascending":n==="desc"?"descending":"none",children:h.jsxs("button",{type:"button",className:"th-sort",onClick:e.column.getToggleSortingHandler(),children:[zm(e.column.columnDef.header,e.getContext()),n==="asc"?" ↑":n==="desc"?" ↓":""]})}):h.jsx(Xx,{children:zm(e.column.columnDef.header,e.getContext())})}function xC({table:e,className:n}){return h.jsx("div",{className:"admin-list admin-card-table"+(n?" "+n:""),children:h.jsxs(n$,{className:"admin-table",children:[h.jsx(r$,{children:e.getHeaderGroups().map(r=>h.jsx(Qx,{children:r.headers.map(o=>h.jsx(a$,{header:o},o.id))},r.id))}),h.jsx(i$,{children:e.getRowModel().rows.map(r=>h.jsx(Qx,{className:"admin-item",children:r.getVisibleCells().map(o=>h.jsx(o$,{children:zm(o.column.columnDef.cell,o.getContext())},o.id))},r.id))})]})})}function wC(e){return e?"expires "+new Date(e).toLocaleDateString():"no expiry"}function SC(e,n){const r=[];return n&&e.project_name&&r.push(e.project_name),e.creator&&r.push("by "+e.creator),e.created&&r.push(new Date(e.created).toLocaleDateString()),r.push(wC(e.expires)),r.join(" · ")}function _C({shares:e,onChanged:n,showProject:r=!1,canRevoke:o=!0,empty:s="No public shares."}){const[l,u]=w.useState([]),d=w.useMemo(()=>__(),[]),p=w.useMemo(()=>[d.accessor("path",{header:"Path",cell:y=>h.jsx("a",{className:"ai-main mono",title:y.getValue(),...yu(Qu(y.getValue(),y.row.original.project)),children:y.getValue()})}),d.accessor(y=>SC(y,r),{id:"detail",header:r?"Project":"Shared",cell:y=>h.jsx("span",{className:"ai-tag",children:y.getValue()})}),d.display({id:"actions",header:"",cell:y=>o?h.jsx("button",{className:"ai-del","aria-label":`Revoke the share of ${y.row.original.path}`,onClick:()=>CC(y.row.original,n),children:"Revoke"}):null})],[d,n,r,o]),m=k_({data:e,columns:p,state:{sorting:l},onSortingChange:u,getCoreRowModel:D_(),getSortedRowModel:z_()});return e.length===0?h.jsx("div",{className:"admin-list",children:h.jsx("div",{className:"admin-empty",children:s})}):h.jsx(xC,{table:m,className:"shares-table"})}async function CC(e,n){if(await Yu("Revoke share link",`Revoke the public link to “${e.path}”? Anyone with the URL will lose access.`,"Revoke",!0))try{await Un("DELETE","/api/shares/"+e.token),Qe("Share revoked."),n()}catch(r){Qe(r.message,!0)}}const s$=lg({name:au().trim().min(1,"Give the organization a name.").max(60,"Keep it under 60 characters.")});function l$({org:e,projects:n,myEmail:r}){const o=jo(),s=e.role==="owner",l=()=>o.invalidateQueries({queryKey:["orgs"]}),u=()=>o.invalidateQueries({queryKey:["invites",e.id]}),d=()=>o.invalidateQueries({queryKey:["orgShares",e.id]}),p=Wp({resolver:sg(s$),values:{name:e.name}}),{data:m}=Gt({queryKey:["invites",e.id],queryFn:()=>cn(`/api/orgs/${e.id}/invites`),enabled:s,select:b=>b.invites||[]}),{data:y}=Gt({queryKey:["orgShares",e.id],queryFn:()=>cn(`/api/orgs/${e.id}/shares`),enabled:s,select:b=>b.shares||[]}),v=n.filter(b=>b.org===e.id);return h.jsxs("div",{className:"admin",children:[h.jsx("h1",{id:"org-title",children:e.name}),!s&&h.jsx("p",{className:"role-chip-row",children:h.jsx("span",{className:"ai-tag role-chip",children:"Member"})}),!s&&h.jsx("p",{className:"admin-sub",children:"Only owners can rename this organization, manage members, or issue invite links."}),s&&h.jsxs("form",{className:"admin-row",onSubmit:p.handleSubmit(async({name:b})=>{try{await Un("PATCH","/api/orgs/"+e.id,{name:b}),Qe("Renamed."),l()}catch(x){Qe(x.message,!0)}}),children:[h.jsx("label",{className:"admin-lbl",htmlFor:"org-rename",children:"Organization name"}),h.jsx("input",{id:"org-rename",type:"text","aria-invalid":!!p.formState.errors.name,"aria-describedby":p.formState.errors.name?"org-rename-err":void 0,...p.register("name")}),h.jsx(Ct,{variant:"subtle",id:"org-rename-btn",type:"submit",disabled:!p.formState.isDirty,children:"Rename org"}),p.formState.errors.name&&h.jsx("span",{id:"org-rename-err",role:"alert",className:"field-err",children:p.formState.errors.name.message})]}),h.jsx("h3",{children:"Members"}),h.jsx(c$,{org:e,owner:s,myEmail:r,onChanged:l}),h.jsx("h3",{children:"Projects"}),h.jsxs("div",{className:"admin-list",children:[v.length===0&&h.jsx("div",{className:"admin-empty",children:"No projects yet."}),v.map(b=>h.jsx("div",{className:"admin-item",children:h.jsx("span",{className:"ai-main",title:b.name,children:b.name})},b.id))]}),s&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"admin-h",children:[h.jsx("h3",{children:"Invite links"}),h.jsx(Ct,{variant:"primary",onClick:async()=>{try{const b=await Ia(`/api/orgs/${e.id}/invites`),x=await Ha(b.url);Qe(x?"Invite link copied to clipboard.":"Invite created — copy it from the list below."),u()}catch(b){Qe(b.message,!0)}},children:"New invite"})]}),h.jsxs("div",{className:"admin-list",children:[m&&m.length===0&&h.jsx("div",{className:"admin-empty",children:"No active invite links."}),(m||[]).map(b=>h.jsxs("div",{className:"admin-item",children:[h.jsx("button",{type:"button",className:"ai-main mono ai-copy","aria-label":`Copy invite link ${b.url}`,title:b.url,onClick:()=>Ha(b.url).then(x=>Qe(x?"Copied.":"Select and copy the link.")),children:b.url}),h.jsx("span",{className:"ai-tag",children:(b.creator?"by "+b.creator+" · ":"")+(b.uses?b.uses+" joined · ":"unused · ")+"expires "+new Date(b.expires).toLocaleDateString()}),h.jsx("button",{className:"ai-del","aria-label":`Revoke invite ${b.token.slice(0,8)}`,onClick:async()=>{if(await Yu("Revoke invite",`Revoke the link starting ${b.token.slice(0,8)}…? Anyone still holding it won't be able to join.`,"Revoke",!0))try{await Un("DELETE",`/api/orgs/${e.id}/invites/${b.token}`),Qe("Revoked."),u()}catch(x){Qe(x.message,!0)}},children:"Revoke"})]},b.token))]}),h.jsx("h3",{children:"Public share links"}),h.jsx("p",{className:"admin-sub",children:"Every live link across this organization's projects. A project's own links are on its Settings page, and on the file itself."}),h.jsx(_C,{shares:y||[],onChanged:d,showProject:!0})]})]})}function c$({org:e,owner:n,myEmail:r,onChanged:o}){const[s,l]=w.useState([{id:"email",desc:!1}]),u=w.useMemo(()=>__(),[]),d=w.useMemo(()=>[u.accessor("email",{id:"email",header:"Member",cell:m=>{const y=!!r&&m.getValue().toLowerCase()===r.toLowerCase();return h.jsx("span",{className:"ai-main",title:m.getValue(),children:m.getValue()+(y?" (you)":"")})}}),u.accessor("role",{id:"role",header:"Role",cell:m=>{const y=m.row.original,v=!!r&&y.email.toLowerCase()===r.toLowerCase();return!n||v?h.jsx("span",{className:"ai-tag role-static",children:y.role}):h.jsxs("span",{className:"role-cell",children:[h.jsxs("select",{"aria-label":`Role for ${y.email}`,value:y.role,onChange:async b=>{try{await Un("PATCH",`/api/orgs/${e.id}/members/${encodeURIComponent(y.email)}`,{role:b.target.value}),Qe("Role updated.")}catch(x){Qe(x.message,!0)}o()},children:[h.jsx("option",{value:"owner",children:"owner"}),h.jsx("option",{value:"member",children:"member"})]}),h.jsx("button",{className:"ai-del","aria-label":`Remove ${y.email}`,onClick:async()=>{if(await Yu("Remove member",`Remove ${y.email} from ${e.name}?`,"Remove",!0))try{await Un("DELETE",`/api/orgs/${e.id}/members/${encodeURIComponent(y.email)}`),Qe("Removed."),o()}catch(b){Qe(b.message,!0)}},children:"Remove"})]})}})],[u,e.id,e.name,n,r]),p=k_({data:e.members,columns:d,state:{sorting:s},onSortingChange:l,getCoreRowModel:D_(),getSortedRowModel:z_()});return h.jsx(xC,{table:p})}const u$=lg({require_verification:qx(),require_approval:qx()});function d$(){const e=jo(),{data:n,error:r}=Gt({queryKey:["admin","policy"],queryFn:()=>cn("/api/admin/policy")}),{data:o}=b_(!0),s=Wp({resolver:sg(u$),values:n?{require_verification:n.require_verification&&n.mailer,require_approval:n.require_approval}:{require_verification:!1,require_approval:!1}});if(w.useEffect(()=>{r&&Qe(r.message,!0)},[r]),!n)return null;const l=async(u,d,p)=>{try{await Ia(`/api/admin/pending/${u}/${d}`),Qe((d==="approve"?"Approved ":"Denied ")+p),e.invalidateQueries({queryKey:["admin","pending"]})}catch(m){Qe(m.message,!0)}};return h.jsxs("div",{className:"admin",children:[h.jsx("h1",{children:"Signup & access"}),h.jsx("p",{className:"admin-sub",children:"Who can create an account on this hub, and how new accounts are vetted."}),h.jsx("h3",{children:"New-account vetting"}),h.jsxs("form",{onSubmit:s.handleSubmit(async u=>{try{await Ia("/api/admin/policy",u),Qe("Signup policy saved."),e.invalidateQueries({queryKey:["admin","policy"]})}catch(d){Qe(d.message,!0)}}),children:[h.jsxs("div",{className:"admin-list",children:[h.jsx(Jx,{label:"Require email verification",desc:n.mailer?"New accounts must click an emailed link before they can sign in — proves they control the address.":"Configure SMTP on the server (auth.smtp) to enable email verification.",disabled:!n.mailer,inputProps:s.register("require_verification")}),h.jsx(Jx,{label:"Require admin approval",desc:"New accounts wait for a hub admin to approve them before they gain access.",inputProps:s.register("require_approval")})]}),h.jsx(Ct,{variant:"primary",type:"submit",style:{marginTop:14},disabled:!s.formState.isDirty,children:"Save policy"})]}),h.jsx("h3",{children:"Who can sign up"}),h.jsxs("div",{className:"admin-list",children:[h.jsxs("div",{className:"admin-item",children:[h.jsx("span",{className:"ai-main",children:"Allowed email domains"}),h.jsx("span",{className:"ai-tag",children:n.allowed_domains&&n.allowed_domains.length?n.allowed_domains.map(u=>"@"+u).join(", "):"any"})]}),h.jsxs("div",{className:"admin-item",children:[h.jsx("span",{className:"ai-main",children:"Self-signup"}),h.jsx("span",{className:"ai-tag",children:n.allow_signup?"open":"invite-only"})]}),h.jsxs("div",{className:"admin-item",children:[h.jsx("span",{className:"ai-main",children:"Hub admins"}),h.jsx("span",{className:"ai-tag",children:n.admins&&n.admins.length?n.admins.join(", "):"none"})]})]}),h.jsx("p",{className:"admin-sub",children:"Domains and admins are set in the server config file (they can't be widened from the browser)."}),h.jsx("h3",{children:"Pending signups"}),h.jsxs("div",{className:"admin-list",children:[(!o||o.length===0)&&h.jsx("div",{className:"admin-empty",children:"No one is waiting for approval."}),(o||[]).map(u=>h.jsxs("div",{className:"admin-item",children:[h.jsx("span",{className:"ai-main",children:(u.name?u.name+" · ":"")+u.email}),h.jsx(Ct,{variant:"primary",onClick:()=>l(u.id,"approve",u.email),children:"Approve"}),h.jsx("button",{className:"ai-del",onClick:()=>l(u.id,"deny",u.email),children:"Deny"})]},u.id))]})]})}function Jx({label:e,desc:n,disabled:r,inputProps:o}){return h.jsxs("label",{className:"admin-item toggle",style:r?{opacity:.55}:void 0,children:[h.jsxs("span",{className:"ai-main",children:[h.jsx("div",{className:"tg-label",children:e}),h.jsx("div",{className:"tg-desc",children:n})]}),h.jsx("input",{type:"checkbox",disabled:r,...o})]})}function f$({...e}){return h.jsx(r1,{"data-slot":"select",...e})}function h$({...e}){return h.jsx(s1,{"data-slot":"select-value",...e})}function m$({className:e,size:n="default",children:r,...o}){return h.jsxs(o1,{"data-slot":"select-trigger","data-size":n,className:We("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...o,children:[r,h.jsx(l1,{asChild:!0,children:h.jsx($p,{className:"size-4 opacity-50"})})]})}function p$({className:e,children:n,position:r="item-aligned",align:o="center",...s}){return h.jsx(u1,{children:h.jsxs(d1,{"data-slot":"select-content",className:We("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",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,align:o,...s,children:[h.jsx(v$,{}),h.jsx(g1,{className:We("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:n}),h.jsx(y$,{})]})})}function g$({className:e,children:n,...r}){return h.jsxs(x1,{"data-slot":"select-item",className:We("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[h.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:h.jsx(_1,{children:h.jsx(o_,{className:"size-4"})})}),h.jsx(w1,{children:n})]})}function v$({className:e,...n}){return h.jsx(C1,{"data-slot":"select-scroll-up-button",className:We("flex cursor-default items-center justify-center py-1",e),...n,children:h.jsx(qD,{className:"size-4"})})}function y$({className:e,...n}){return h.jsx(E1,{"data-slot":"select-scroll-down-button",className:We("flex cursor-default items-center justify-center py-1",e),...n,children:h.jsx($p,{className:"size-4"})})}const Wx=["#5b8def","#f5a623","#4cc38a","#e0679b","#8b7bf0","#3ec8c8","#e6934a"];function ul(e){let n=0;for(const r of e)n=n*31+r.charCodeAt(0)>>>0;return Wx[n%Wx.length]}function ew({projects:e,currentId:n,menu:r}){const o=Up(),s=e.find(u=>u.id===n),l=async()=>{const u=await Pp("New project","Project name","","Create");if(u!==null)try{const d=await Ia("/api/projects",{name:u});await o(),yn("/"+d.project.id),Qe(`Created “${d.project.name}”.`)}catch(d){Qe("Could not create the project: "+d.message,!0)}};return h.jsxs("nav",{id:"projects","aria-label":"Projects",children:[h.jsxs("div",{className:"nav-head",children:[h.jsx("span",{children:"Projects"}),h.jsx("button",{className:"nav-add",title:"New project","aria-label":"New project",onClick:l,children:"+"})]}),h.jsx("div",{className:"proj-row",children:h.jsxs(f$,{value:n||"",onValueChange:u=>{u&&u!==n&&(yn("/"+u),mr())},children:[h.jsxs(m$,{id:"project-select","aria-label":`Switch project — current: ${s?.name??"none"}`,title:s?.name,className:"proj-trigger",children:[s&&h.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:ul(s.name)},children:h.jsx(ka,{name:s.icon})}),s?h.jsx("span",{"data-slot":"select-value",children:s.name}):h.jsx(h$,{placeholder:"Select a project"})]}),h.jsx(p$,{className:"proj-menu",position:"popper",sideOffset:4,children:e.map(u=>h.jsxs(g$,{value:u.id,children:[h.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:ul(u.name)},children:h.jsx(ka,{name:u.icon})}),u.name]},u.id))})]})}),r&&h.jsx("ul",{className:"nav-menu","aria-label":"Project pages",children:[["dashboard","Dashboard","dashboard",r.onDashboard],["install","Installation","terminal",r.onInstall],["history","History","hist",r.onHistory],["settings","Settings","gear",r.onSettings]].map(([u,d,p,m])=>h.jsx("li",{children:h.jsxs("div",{id:"nav-"+u,className:"row"+(r.active===u?" active":""),role:"button",tabIndex:0,onClick:m,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),m())},children:[h.jsx(yt,{name:p}),h.jsx("span",{className:"label",children:d})]})},u))})]})}function EC({...e}){return h.jsx(_M,{"data-slot":"dropdown-menu",...e})}function RC({...e}){return h.jsx(CM,{"data-slot":"dropdown-menu-trigger",...e})}function TC({className:e,sideOffset:n=4,...r}){return h.jsx(EM,{children:h.jsx(RM,{"data-slot":"dropdown-menu-content",sideOffset:n,className:We("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...r})})}function Na({className:e,inset:n,variant:r="default",...o}){return h.jsx(OM,{"data-slot":"dropdown-menu-item","data-inset":n,"data-variant":r,className:We("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",e),...o})}function Jh({className:e,inset:n,...r}){return h.jsx(TM,{"data-slot":"dropdown-menu-label","data-inset":n,className:We("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...r})}function b$({me:e,org:n,admin:r,orgActive:o,billing:s}){const l=e.name||e.email,[u,d]=w.useState(!1),p=n?yu(n.manage_url):null,m=s?yu(s.url):null;return h.jsx("footer",{id:"accountbar",children:h.jsxs(EC,{modal:!1,open:u,onOpenChange:d,children:[h.jsx(RC,{asChild:!0,children:h.jsxs("button",{id:"account-btn",className:o?"active":void 0,"aria-label":"Account menu",children:[h.jsx("span",{className:"avatar",style:{background:ul(e.email)},"aria-hidden":"true",children:(l.trim()[0]||"?").toUpperCase()}),h.jsxs("span",{className:"acct",children:[h.jsx("b",{children:l}),e.name&&h.jsx("small",{children:e.email})]}),h.jsx(yt,{name:"chev"})]})}),h.jsxs(TC,{id:"account-menu",side:"top",align:"start",sideOffset:6,className:"acct-menu",children:[n&&h.jsxs(h.Fragment,{children:[h.jsx(Jh,{className:"menu-sec",children:"Organization"}),h.jsx(Na,{asChild:!0,children:h.jsxs("a",{id:"menu-org-settings","aria-current":o?"page":void 0,...p,onClick:y=>{p?.onClick?.(y),d(!1)},children:[h.jsx(yt,{name:"gear"}),h.jsxs("span",{children:[h.jsx("b",{children:n.name})," Settings"]}),!n.manage_url.startsWith("/")&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"ext","aria-hidden":"true",children:"↗"}),h.jsx("span",{className:"sr-only",children:" (opens in a new tab)"})]})]})}),s&&h.jsx(Na,{asChild:!0,children:h.jsxs("a",{id:"menu-billing",...m,onClick:y=>{m?.onClick?.(y),d(!1)},children:[h.jsx(yt,{name:"card"}),h.jsx("span",{children:"Billing"}),h.jsx("span",{className:"ps-chip plan-chip",children:s.plan})]})})]}),r&&h.jsxs(h.Fragment,{children:[h.jsx(Jh,{className:"menu-sec",children:"Hub"}),h.jsxs(Na,{id:"menu-hub-admin",onSelect:r.onClick,children:[h.jsx(yt,{name:"shield"}),h.jsxs("span",{children:["Signup & access",r.pending?` · ${r.pending}`:""]})]})]}),h.jsx(Jh,{className:"menu-sec",children:"Account"}),h.jsx(Na,{asChild:!0,children:h.jsxs("a",{id:"signout",href:"/auth/logout",children:[h.jsx(yt,{name:"power"}),h.jsx("span",{children:"Log out"})]})})]})]})})}function ki({className:e,...n}){return h.jsx("div",{"data-slot":"card",className:We("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...n})}function Li({className:e,...n}){return h.jsx("div",{"data-slot":"card-header",className:We("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...n})}function $i({className:e,...n}){return h.jsx("div",{"data-slot":"card-title",className:We("leading-none font-semibold",e),...n})}function $a({className:e,...n}){return h.jsx("div",{"data-slot":"card-description",className:We("text-muted-foreground text-sm",e),...n})}function Ii({className:e,...n}){return h.jsx("div",{"data-slot":"card-content",className:We("px-6",e),...n})}function ei({className:e,orientation:n="horizontal",decorative:r=!0,...o}){return h.jsx(oN,{"data-slot":"separator",decorative:r,orientation:n,className:We("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...o})}function x$({url:e}){const n=Gt({queryKey:["billing"],queryFn:()=>cn(e)});if(n.isLoading)return h.jsx("div",{className:"empty",children:"Loading…"});if(n.error||!n.data)return h.jsxs("div",{className:"empty",children:[h.jsx("h3",{children:"Billing is unavailable"}),h.jsx("p",{children:n.error?.message||"Try again shortly."})]});const r=n.data;return h.jsxs("div",{className:"project-settings",id:"billing-view",children:[h.jsxs("h2",{children:["Billing",h.jsx("span",{className:"ps-chip plan-chip",children:r.plan.name})]}),h.jsxs(ki,{children:[h.jsxs(Li,{children:[h.jsxs($i,{children:[r.plan.name," plan",r.plan.status?` (${r.plan.status})`:""]}),h.jsxs($a,{children:["Organization ",r.org," · ",r.usage.used," of ",r.usage.cap," used · ",r.seats.used," of ",r.seats.cap," ",r.seats.cap===1?"seat":"seats"]})]}),h.jsx(ei,{}),h.jsx(Ii,{children:h.jsx("div",{className:"usage-bar",children:h.jsx("div",{style:{width:`${r.usage.pct}%`}})})})]}),r.owner?h.jsx("div",{className:"plan-grid",children:r.plans.map(o=>h.jsxs(ki,{children:[h.jsxs(Li,{children:[h.jsx($i,{children:o.name}),h.jsx($a,{children:o.blurb})]}),h.jsx(ei,{}),h.jsxs(Ii,{children:[h.jsxs("p",{className:"plan-price",children:[o.price,h.jsx("small",{children:" / user / month"})]}),h.jsxs("form",{method:"post",action:r.checkout_url,children:[h.jsx("input",{type:"hidden",name:"plan",value:o.id}),h.jsx(Ct,{type:"submit",disabled:o.current,variant:o.current?"subtle":"default",children:o.current?"Current plan":`Upgrade to ${o.name}`})]})]})]},o.id))}):h.jsx("p",{className:"muted-note",children:"Only an organization owner can change the plan."}),r.owner&&r.has_customer&&h.jsxs(ki,{children:[h.jsxs(Li,{children:[h.jsx($i,{children:"Manage subscription"}),h.jsx($a,{children:"Change seats, update the card, download invoices, or cancel."})]}),h.jsx(ei,{}),h.jsx(Ii,{children:h.jsx("form",{method:"post",action:r.portal_url,children:h.jsx(Ct,{type:"submit",variant:"subtle",children:"Open the billing portal"})})})]})]})}function w$({className:e,type:n,...r}){return h.jsx("input",{type:n,"data-slot":"input",className:We("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e),...r})}function Wh({className:e,...n}){return h.jsx(AM,{"data-slot":"label",className:We("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}function S$({className:e,...n}){return h.jsx("textarea",{"data-slot":"textarea",className:We("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...n})}const tw={read:1,write:2,admin:3};function wo(e,n){return(tw[e||""]||0)>=(tw[n]||0)}const Hm=280,_$=lg({name:au().trim().min(1,"Give the project a name.").max(120,"Keep the name under 120 characters."),description:au().max(Hm,`Keep the description under ${Hm} characters.`),icon:au()});function C$({project:e,org:n,onDeleted:r}){const o=Up(),s=wo(e.perm,"admin"),l=Wp({resolver:sg(_$),defaultValues:{name:e.name,description:e.description??"",icon:e.icon??""}});w.useEffect(()=>{l.reset({name:e.name,description:e.description??"",icon:e.icon??""})},[e.id,e.name,e.description,e.icon]);const u=l.watch("icon"),d=l.watch("description"),p=l.handleSubmit(async m=>{const y=l.formState.dirtyFields,v={};if(y.name&&(v.name=m.name.trim()),y.description&&(v.description=m.description),y.icon&&(v.icon=m.icon),Object.keys(v).length!==0)try{await Un("PATCH","/api/projects/"+e.id,v),Qe("Saved."),l.reset({...m,name:m.name.trim()}),await o()}catch(b){Qe(b.message,!0)}});return h.jsxs("div",{className:"project-settings",children:[h.jsxs("h2",{children:[e.name,!wo(e.perm,"write")&&h.jsx("span",{className:"ps-chip",children:"Read-only"})]}),h.jsxs(ki,{children:[h.jsxs(Li,{children:[h.jsx($i,{children:"General"}),h.jsx($a,{children:"Name, description and icon for this project."})]}),h.jsx(ei,{}),h.jsx(Ii,{children:h.jsxs("form",{className:"ps-form",onSubmit:p,children:[h.jsxs("div",{className:"ps-field",children:[h.jsx(Wh,{htmlFor:"ps-icon-btn",children:"Icon"}),h.jsxs("div",{className:"ps-icon-row",children:[h.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:ul(e.name)},children:h.jsx(ka,{name:u})}),h.jsxs(EC,{children:[h.jsx(RC,{asChild:!0,children:h.jsx(Ct,{id:"ps-icon-btn",type:"button",variant:"subtle",disabled:!s,children:"Change"})}),h.jsxs(TC,{align:"start",className:"ps-icon-grid",children:[h.jsx(Na,{className:"ps-icon-cell"+(u===""?" active":""),title:"Default","aria-label":"Default icon",onSelect:()=>l.setValue("icon","",{shouldDirty:!0}),children:h.jsx(ka,{})}),Object.keys(g_).map(m=>h.jsx(Na,{className:"ps-icon-cell"+(u===m?" active":""),title:m,"aria-label":m,onSelect:()=>l.setValue("icon",m,{shouldDirty:!0}),children:h.jsx(ka,{name:m})},m))]})]})]})]}),h.jsxs("div",{className:"ps-field",children:[h.jsx(Wh,{htmlFor:"ps-name",children:"Name"}),h.jsx(w$,{id:"ps-name",disabled:!s,"aria-invalid":!!l.formState.errors.name,"aria-describedby":l.formState.errors.name?"ps-name-err":void 0,...l.register("name")}),l.formState.errors.name&&h.jsx("span",{id:"ps-name-err",role:"alert",className:"field-err",children:l.formState.errors.name.message})]}),h.jsxs("div",{className:"ps-field",children:[h.jsxs(Wh,{htmlFor:"ps-desc",children:["Description ",h.jsx("span",{className:"ps-opt",children:"(optional)"})]}),h.jsx(S$,{id:"ps-desc",rows:2,disabled:!s,placeholder:"What this project is for.","aria-invalid":!!l.formState.errors.description,"aria-describedby":l.formState.errors.description?"ps-desc-err":void 0,...l.register("description")}),h.jsxs("div",{className:"ps-meta",children:[l.formState.errors.description?h.jsx("span",{id:"ps-desc-err",role:"alert",className:"field-err",children:l.formState.errors.description.message}):h.jsx("span",{}),h.jsxs("span",{className:"ps-count",children:[d.length," / ",Hm]})]})]}),s&&h.jsxs(h.Fragment,{children:[h.jsx(ei,{}),h.jsx("div",{className:"ps-actions",children:h.jsx(Ct,{id:"ps-save",type:"submit",variant:"primary",disabled:!l.formState.isDirty||l.formState.isSubmitting,children:"Save changes"})})]})]})})]}),h.jsxs(ki,{children:[h.jsx(Li,{children:h.jsx($i,{children:"About"})}),h.jsx(ei,{}),h.jsx(Ii,{children:h.jsxs("dl",{className:"ps-facts",children:[h.jsx("dt",{children:"Project id"}),h.jsx("dd",{children:h.jsx("code",{children:e.id})}),n&&h.jsxs(h.Fragment,{children:[h.jsx("dt",{children:"Workspace"}),h.jsx("dd",{children:n.name})]}),e.created&&h.jsxs(h.Fragment,{children:[h.jsx("dt",{children:"Created"}),h.jsx("dd",{children:new Date(e.created).toLocaleDateString()})]})]})})]}),h.jsx(T$,{project:e,org:n}),h.jsx(E$,{project:e}),s&&h.jsxs(ki,{className:"ps-danger",children:[h.jsx(Li,{children:h.jsx($i,{children:"Danger zone"})}),h.jsx(ei,{}),h.jsxs(Ii,{children:[h.jsx("p",{children:"Deleting removes the project from this hub. Its files stay in storage. This can't be undone."}),h.jsx(Ct,{variant:"danger",onClick:async()=>{if(await Pp(`Delete “${e.name}”?`,"This can't be undone. Type the project name to confirm:","","Delete project",{match:e.name,danger:!0})!==null)try{await Un("DELETE","/api/projects/"+e.id),Qe(`Deleted “${e.name}”.`),await r()}catch(y){Qe(y.message,!0)}},children:"Delete project"})]})]})]})}function E$({project:e}){const n=jo(),{data:r,error:o}=y_(e.id);return o?null:h.jsxs(ki,{children:[h.jsxs(Li,{children:[h.jsx($i,{children:"Public links"}),h.jsx($a,{children:"Files in this project that anyone with the URL can read — no account needed."})]}),h.jsx(ei,{}),h.jsx(Ii,{children:h.jsx(_C,{shares:r||[],canRevoke:wo(e.perm,"write"),onChanged:()=>n.invalidateQueries({queryKey:["shares",e.id]}),empty:"No public links."})})]})}const Bm=[{value:"admin",label:"Admin"},{value:"write",label:"Write"},{value:"read",label:"Read"},{value:"none",label:"No access"}],R$=Object.fromEntries(Bm.map(e=>[e.value,e.label]));function T$({project:e,org:n}){const r=jo(),{data:o,error:s}=l3(e.id),l=wo(e.perm,"admin"),u=()=>{r.invalidateQueries({queryKey:["permissions",e.id]}),r.invalidateQueries({queryKey:["projects"]})},d=async(x,C)=>{try{await x(),Qe(C)}catch(_){Qe(_.message,!0)}u()};if(s||!o)return null;const p=o,m=`/api/p/${e.id}/permissions`,y=new Set((n?.members||[]).filter(x=>x.role==="owner").map(x=>x.email.toLowerCase())),v=[...p.grants.filter(x=>!y.has(x.email.toLowerCase())),...[...y].sort().map(x=>({email:x,level:"admin",owner:!0}))],b=async()=>{const x=await Pp("Add an exception","Email of a workspace member. They get Read access; change it in the table.","","Add");x===null||!x.trim()||await d(()=>Un("PUT",`${m}/${encodeURIComponent(x.trim())}`,{level:"read"}),"Added.")};return h.jsxs(ki,{className:"ps-people",children:[h.jsxs(Li,{children:[h.jsx($i,{children:"People"}),h.jsx($a,{children:"Who can see and change this project."})]}),h.jsx(ei,{}),h.jsxs(Ii,{children:[h.jsxs("p",{className:"ps-row",children:[h.jsxs("span",{children:["Everyone in ",n?.name||"this workspace"," can"]}),h.jsx("select",{"aria-label":"Default access for workspace members",disabled:!l,value:p.default,onChange:async x=>{const C=x.target.value;if(C==="none"&&!await Yu("Make this project invite-only?","Only people listed below (and workspace owners) will see this project.","Make invite-only")){u();return}await d(()=>Un("PUT",m,{default:C}),"Default access updated.")},children:Bm.filter(x=>x.value!=="admin").map(x=>h.jsx("option",{value:x.value,children:x.label},x.value))})]}),p.default==="none"&&h.jsx("p",{className:"ps-note",children:"This project is invite-only: only the people below and workspace owners can see it."}),h.jsxs("div",{className:"ps-people-head",children:[h.jsx("h4",{children:"Exceptions"}),l&&h.jsx(Ct,{type:"button",variant:"subtle",onClick:b,children:"+ Add"})]}),v.length===0?h.jsx("p",{className:"ps-note",children:"No exceptions — everyone gets the access above."}):h.jsx("div",{className:"admin-list",children:v.map(x=>{const C="owner"in x;return h.jsxs("div",{className:"admin-item",children:[h.jsxs("span",{className:"ai-main",title:x.email,children:[x.email,p.creator&&x.email.toLowerCase()===p.creator.toLowerCase()&&h.jsx("span",{className:"ai-tag",children:" (creator)"})]}),C?h.jsx("span",{className:"ai-tag",children:"Workspace owner — always admin"}):h.jsxs("span",{className:"role-cell",children:[h.jsx("select",{"aria-label":`Access for ${x.email}`,disabled:!l,value:x.level,onChange:_=>d(()=>Un("PUT",`${m}/${encodeURIComponent(x.email)}`,{level:_.target.value}),`${x.email} is now ${R$[_.target.value]||_.target.value}.`),children:Bm.map(_=>h.jsx("option",{value:_.value,children:_.label},_.value))}),l&&h.jsx("button",{className:"ai-del","aria-label":`Remove exception for ${x.email}`,onClick:()=>d(()=>Un("DELETE",`${m}/${encodeURIComponent(x.email)}`),"Reverted to the default access."),children:"Remove"})]})]},x.email)})})]})]})}const OC="https://raw.githubusercontent.com/runbear-io/beardrive/main/INSTALL_FOR_AGENTS.md";function jC({project:e}){const n=window.location.origin,r="Follow "+OC+`
to set up BearDrive project `+e.id+" on "+n+'. Ask me which folder to sync (the project is named "'+e.name+'").',o=`brew install runbear-io/tap/beardrive
bdrive login `+n+`
-bdrive init --project `+e.id;return m.jsxs("div",{className:"guide",children:[m.jsxs("h1",{className:"in-title gd-head",children:[m.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:ul(e.name)},children:m.jsx(ka,{name:e.icon})}),e.name]}),e.description&&m.jsx("p",{className:"in-desc",children:e.description}),m.jsxs("div",{className:"gd-body",children:[m.jsx("p",{className:"gd-desc",children:"Paste into your coding agent — Claude Code, Cowork, Codex, Gemini CLI, Hermes — in the folder where you want the files:"}),m.jsx(Bm,{code:r}),m.jsx("p",{className:"gd-desc",children:"The agent installs the CLI, signs this machine in, and registers the sync hooks — asking before anything it changes."}),m.jsxs("details",{className:"gd-manual",children:[m.jsx("summary",{children:"What exactly happens"}),m.jsxs("ul",{className:"gd-desc gd-list",children:[m.jsx("li",{children:"Sign-in uses a device code you approve in this browser — the folder itself never holds credentials."}),m.jsx("li",{children:"Sync hooks pull the latest before every agent turn, push edits seconds after they happen, and stamp each change with the session that made it; agent reads feed Insights. They register once per machine in your agent's own config, so every session is covered and nothing is written into the synced folder."}),m.jsx("li",{children:"Codex hooks are off by default: set [features] codex_hooks = true in ~/.codex/config.toml."})]})]}),m.jsxs("details",{className:"gd-manual",children:[m.jsx("summary",{children:"Or run it yourself"}),m.jsx("p",{className:"gd-desc",children:"Same result, in the folder you want the files. One command: init signs this device in, registers the sync hooks and starts syncing."}),m.jsx(Bm,{code:o}),m.jsx("p",{className:"gd-desc",children:m.jsx("a",{href:"https://docs.beardrive.ai/manual/install/",target:"_blank",rel:"noreferrer",children:"Full manual setup guide →"})})]})]})]})}function Bm({code:e}){const[n,r]=w.useState("Copy");return m.jsxs("pre",{className:"gd-code",children:[m.jsx("code",{children:e}),m.jsx("button",{className:"gd-copy",onClick:async()=>{r(await Ha(e)?"Copied":"Copy failed"),setTimeout(()=>r("Copy"),1400)},children:n})]})}function R$(){return m.jsxs("div",{className:"onboard",children:[m.jsx("h1",{children:"Welcome to BearDrive"}),m.jsx("p",{children:"You're signed in, but you're not part of any project yet."}),m.jsxs("div",{className:"ob-card",children:[m.jsx("h3",{children:"Connect a new drive to your project"}),m.jsx("p",{children:"Paste into your coding agent — Claude Code, Cowork, Codex, Gemini CLI, Hermes — in the folder where you want the files. It creates the project and starts syncing:"}),m.jsx(Bm,{code:"Follow "+OC+`
-to set up a new BearDrive project on `+window.location.origin+". Ask me which folder to sync."}),m.jsx("p",{className:"ob-alt",children:m.jsx("a",{href:"https://docs.beardrive.ai/manual/setup-by-hand/",target:"_blank",rel:"noreferrer",children:"Or start a project manually →"})})]})]})}function T$(e,n=!0){const r=Gt({queryKey:["tree",e],queryFn:()=>cn(e+"tree"),enabled:n,refetchInterval:15e3}),o=w.useMemo(()=>{const s=[],l=new Map,u=d=>{for(const p of d.children||[])p.dir?(l.set(p.path,p),u(p)):s.push(p)};return r.data&&u(r.data),{flatFiles:s,dirIndex:l}},[r.data]);return{tree:r.data,...o,loaded:!!r.data}}function O$(e,n){return Gt({queryKey:["heat",e],queryFn:()=>cn(e+"heat?days=30"),enabled:n,staleTime:6e4,refetchInterval:6e4}).data?.entries??null}function j$(e,n,r){return Gt({queryKey:["history",e,"prefix",n,20],queryFn:()=>cn(e+"history?prefix="+encodeURIComponent(n)+"&n=20"),enabled:r,staleTime:15e3}).data?.entries??null}function tw(e,n,r){if(!e)return null;if(!r)return e[n]||null;const o={human:0,agent:0,share:0};for(const[s,l]of Object.entries(e))s.startsWith(n+"/")&&(o.human+=l.human||0,o.agent+=l.agent||0,o.share+=l.share||0);return o.human||o.agent||o.share?o:null}function dl(e){return(e.human||0)+(e.agent||0)+(e.share||0)}function Ks(e){const n=dl(e);if(!n)return"";const r=n+(n===1?" read":" reads");if(!e.agent&&!e.share)return r;const o=[];return e.human&&o.push(e.human+" human"),e.agent&&o.push(e.agent+" agent"),e.share&&o.push(e.share+" shared"),r+" ("+o.join(", ")+")"}function A$(e){const n=dl(e);return n?n<3?1:n<10?2:n<30?3:4:0}function M$(e,n,r){const o=new Array(e);return new Proxy(o,{get(s,l,u){if(typeof l=="string"){const d=l.charCodeAt(0);if(d>=48&&d<=57){const p=+l;if(Number.isInteger(p)&&p>=0&&po[y]!==h))&&(o=d,s=n(...d),r?.onChange&&!(l&&r.skipInitialOnChange)&&r.onChange(s),l=!1),s}return u.updateDeps=d=>{o=d},u}function nw(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const N$=(e,n)=>Math.abs(e-n)<1.01,D$=(e,n,r)=>{let o;return function(...s){e.clearTimeout(o),o=e.setTimeout(()=>n.apply(this,s),r)}};let Hs;const Wh=()=>{if(Hs!==void 0)return Hs;if(typeof navigator>"u")return Hs=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Hs=!0;const e=navigator.maxTouchPoints;return Hs=navigator.platform==="MacIntel"&&e!==void 0&&e>0},rw=e=>{const{offsetWidth:n,offsetHeight:r}=e;return{width:n,height:r}},z$=e=>e,k$=e=>{const n=Math.max(e.startIndex-e.overscan,0),o=Math.min(e.endIndex+e.overscan,e.count-1)-n+1,s=new Array(o);for(let l=0;l{const r=e.scrollElement;if(!r)return;const o=e.targetWindow;if(!o)return;const s=u=>{const{width:d,height:p}=u;n({width:Math.round(d),height:Math.round(p)})};if(s(rw(r)),!o.ResizeObserver)return()=>{};const l=new o.ResizeObserver(u=>{const d=()=>{const p=u[0];if(p?.borderBoxSize){const h=p.borderBoxSize[0];if(h){s({width:h.inlineSize,height:h.blockSize});return}}s(rw(r))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(d):d()});return l.observe(r,{box:"border-box"}),()=>{l.unobserve(r)}},Eu={passive:!0},$$=typeof window>"u"?!0:"onscrollend"in window,I$=(e,n,r)=>{const o=e.scrollElement;if(!o)return;const s=e.targetWindow;if(!s)return;const l=e.options.useScrollendEvent&&$$;let u=0;const d=l?null:D$(s,()=>n(u,!1),e.options.isScrollingResetDelay),p=v=>()=>{u=r(o),d?.(),n(u,v)},h=p(!0),y=p(!1);return o.addEventListener("scroll",h,Eu),l&&o.addEventListener("scrollend",y,Eu),()=>{o.removeEventListener("scroll",h),l&&o.removeEventListener("scrollend",y)}},V$=(e,n)=>I$(e,n,r=>{const{horizontal:o,isRtl:s}=e.options;return o?r.scrollLeft*(s&&-1||1):r.scrollTop}),F$=(e,n,r)=>{if(r.options.useCachedMeasurements){const o=r.indexFromElement(e),s=r.options.getItemKey(o);return r.itemSizeCache.get(s)??r.options.estimateSize(o)}if(n?.borderBoxSize){const o=n.borderBoxSize[0];if(o)return Math.round(o[r.options.horizontal?"inlineSize":"blockSize"])}if(!n){const o=r.indexFromElement(e),s=r.options.getItemKey(o),l=r.itemSizeCache.get(s);if(l!==void 0)return l}return e[r.options.horizontal?"offsetWidth":"offsetHeight"]},P$=(e,{adjustments:n=0,behavior:r},o)=>{var s,l;(l=(s=o.scrollElement)==null?void 0:s.scrollTo)==null||l.call(s,{[o.options.horizontal?"left":"top"]:e+n,behavior:r})},U$=P$;class H${constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var r,o,s;return((s=(o=(r=this.targetWindow)==null?void 0:r.performance)==null?void 0:o.now)==null?void 0:s.call(o))??Date.now()},this.observer=(()=>{let r=null;const o=()=>r||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:r=new this.targetWindow.ResizeObserver(s=>{s.forEach(l=>{const u=()=>{const d=l.target,p=this.indexFromElement(d);if(!d.isConnected){this.observer.unobserve(d);for(const[h,y]of this.elementsCache)if(y===d){this.elementsCache.delete(h);break}return}this.shouldMeasureDuringScroll(p)&&this.resizeItem(p,this.options.measureElement(d,l,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(u):u()})}));return{disconnect:()=>{var s;(s=o())==null||s.disconnect(),r=null},observe:s=>{var l;return(l=o())==null?void 0:l.observe(s,{box:"border-box"})},unobserve:s=>{var l;return(l=o())==null?void 0:l.unobserve(s)}}})(),this.range=null,this.setOptions=r=>{var o,s;const l={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:z$,rangeExtractor:k$,onChange:()=>{},measureElement:F$,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const b in r){const x=r[b];x!==void 0&&(l[b]=x)}const u=this.options;let d=null,p=null,h=!1;if(u!==void 0&&u.enabled&&l.enabled&&l.anchorTo==="end"&&this.scrollElement!==null){const b=u.count,x=l.count,C=this.getMeasurements(),_=b>0?((o=C[0])==null?void 0:o.key)??u.getItemKey(0):null,E=b>0?((s=C[b-1])==null?void 0:s.key)??u.getItemKey(b-1):null;if(x!==b||b>0&&x>0&&(l.getItemKey(0)!==_||l.getItemKey(x-1)!==E)){h=!0;const A=b>0?this.getVirtualItemForOffset(this.getScrollOffset())??C[0]:null;A&&(d=[A.key,this.getScrollOffset()-A.start]);const z=l.followOnAppend===!0?"auto":l.followOnAppend||null;z&&x>b&&this.isAtEnd(u.scrollEndThreshold)&&(b===0||l.getItemKey(x-1)!==E)&&(p=z)}}this.options=l,h&&(this.pendingMin=0,this.itemSizeCacheVersion++);let y=!1,v=0;if(d&&this.scrollOffset!==null){const[b,x]=d,C=this.getMeasurements(),{count:_,getItemKey:E}=this.options;let T=0;for(;T<_&&E(T)!==b;)T++;if(T<_){const O=C[T];if(O){const A=O.start+x;A!==this.scrollOffset&&(v=A-this.scrollOffset,this.scrollOffset=A,y=!0)}}}(y||p)&&(this.pendingScrollAnchor=[y?d[0]:null,y?d[1]:0,p,v])},this.notify=r=>{var o,s;(s=(o=this.options).onChange)==null||s.call(o,this,r)},this.maybeNotify=Ta(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),r=>{this.notify(r)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(r=>r()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var r;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}if(this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((r=this.scrollElement)==null?void 0:r.window)??null,this.elementsCache.forEach(l=>{this.observer.observe(l)}),this.unsubs.push(this.options.observeElementRect(this,l=>{this.scrollRect=l,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(l,u)=>{if(u&&this._intendedScrollOffset===null&&l===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(l-this._intendedScrollOffset)<1.5&&(l=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const d=this.getScrollOffset();this.scrollDirection=u?d===l?this.scrollDirection:d{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},d=()=>{this._iosTouching=!1,!(!Wh()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};l.addEventListener("touchstart",u,Eu),l.addEventListener("touchend",d,Eu),this.unsubs.push(()=>{l.removeEventListener("touchstart",u),l.removeEventListener("touchend",d),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[l,u,d,p]=s;l!==null&&!d&&(Wh()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?p!==0&&(this._iosDeferredAdjustment+=p):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),d&&this.scrollToEnd({behavior:d})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const r=this.getScrollOffset(),o=this.getMaxScrollOffset();if(r<0||r>o)return;const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(r,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Ta(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(r,o,s,l,u,d,p,h)=>(this.prevLanes!==void 0&&this.prevLanes!==d&&(this.lanesChangedFlag=!0),this.prevLanes=d,this.pendingMin=null,{count:r,paddingStart:o,scrollMargin:s,getItemKey:l,enabled:u,lanes:d,laneAssignmentMode:p,gap:h}),{key:!1}),this.getMeasurements=Ta(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:r,paddingStart:o,scrollMargin:s,getItemKey:l,enabled:u,lanes:d,laneAssignmentMode:p,gap:h},y)=>{const v=this.itemSizeCache;if(!u)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>r)for(const T of this.laneAssignments.keys())T>=r&&this.laneAssignments.delete(T);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(T=>{this.itemSizeCache.set(T.key,T.size)}));const b=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===r&&(this.lanesSettling=!1),d===1){const T=r*2;let O=this._flatMeasurements;if(!O||O.length0&&L.set(O.subarray(0,b*2)),O=L,this._flatMeasurements=O}let A;if(b===0)A=o+s;else{const L=b-1;A=O[L*2]+O[L*2+1]+h}for(let L=b;L1){z=A;const ve=C[z],fe=ve!==void 0?x[ve]:void 0;L=fe?fe.end+h:o+s}else if(E===d){let ve=0,fe=_[0],ce=C[0];for(let le=1;lethis.options.debug}),this.calculateRange=Ta(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(r,o,s,l)=>r.length===0||o===0?(this.range=null,null):(this.range=q$(r,o,s,l,l===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ta(()=>{let r=null,o=null;const s=this.calculateRange();return s&&(r=s.startIndex,o=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,r,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,r,o]},(r,o,s,l,u)=>l===null||u===null?[]:r({startIndex:l,endIndex:u,overscan:o,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=r=>{const o=this.options.indexAttribute,s=r.getAttribute(o);return s?parseInt(s,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=r=>{var o;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((o=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:o.index);if(s!==void 0&&this.range){const l=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),u=Math.max(0,s-l),d=Math.min(this.options.count-1,s+l);return r>=u&&r<=d}return!0},this.measureElement=r=>{if(!r){this.elementsCache.forEach((u,d)=>{u.isConnected||(this.observer.unobserve(u),this.elementsCache.delete(d))});return}const o=this.indexFromElement(r),s=this.options.getItemKey(o),l=this.elementsCache.get(s);l!==r&&(l&&this.observer.unobserve(l),this.observer.observe(r),this.elementsCache.set(s,r)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(o)&&this.resizeItem(o,this.options.measureElement(r,void 0,this))},this.resizeItem=(r,o)=>{var s,l;if(r<0||r>=this.options.count)return;let u,d,p;const h=this._flatMeasurements;if(this.options.lanes===1&&h!==null)p=this.options.getItemKey(r),d=h[r*2],u=h[r*2+1];else{const b=this.measurementsCache[r];if(!b)return;p=b.key,d=b.start,u=b.size}const y=this.itemSizeCache.get(p)??u,v=o-y;if(v!==0){const b=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,x=b?this.getTotalSize():0,C=((l=this.scrollState)==null?void 0:l.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[r]??{index:r,key:p,start:d,size:u,end:d+u,lane:0},v,this):d[this.getVirtualIndexes(),this.getMeasurements()],(r,o)=>{const s=[];for(let l=0,u=r.length;lthis.options.debug}),this.getVirtualItemForOffset=r=>{const o=this.getMeasurements();if(o.length===0)return;const s=this._flatMeasurements,l=this.options.lanes===1&&s!=null,u=AC(0,o.length-1,l?d=>s[d*2]:d=>nw(o[d]).start,r);return nw(o[u])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const r=this.scrollElement.document.documentElement;return this.options.horizontal?r.scrollWidth-this.scrollElement.innerWidth:r.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(r=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=r,this.getOffsetForAlignment=(r,o,s=0)=>{if(!this.scrollElement)return 0;const l=this.getSize(),u=this.getScrollOffset();o==="auto"&&(o=r>=u+l?"end":"start"),o==="center"?r+=(s-l)/2:o==="end"&&(r-=l);const d=this.getMaxScrollOffset();return Math.max(Math.min(d,r),0)},this.getOffsetForIndex=(r,o="auto")=>{r=Math.max(0,Math.min(r,this.options.count-1));const s=this.getSize(),l=this.getScrollOffset(),u=this.measurementsCache[r];if(!u)return;if(o==="auto")if(u.end>=l+s-this.options.scrollPaddingEnd)o="end";else if(u.start<=l+this.options.scrollPaddingStart)o="start";else return[l,o];if(o==="end"&&r===this.options.count-1)return[this.getMaxScrollOffset(),o];const d=o==="end"?u.end+this.options.scrollPaddingEnd:u.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(d,o,u.size),o]},this.scrollToOffset=(r,{align:o="start",behavior:s="auto"}={})=>{const l=this.getOffsetForAlignment(r,o),u=this.now();this.scrollState={index:null,align:o,behavior:s,startedAt:u,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(r,{align:o="auto",behavior:s="auto"}={})=>{r=Math.max(0,Math.min(r,this.options.count-1));const l=this.getOffsetForIndex(r,o);if(!l)return;const[u,d]=l,p=this.now();this.scrollState={index:r,align:d,behavior:s,startedAt:p,lastTargetOffset:u,stableFrames:0},this._scrollToOffset(u,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(r,{behavior:o="auto"}={})=>{const s=this.getScrollOffset()+r,l=this.now();this.scrollState={index:null,align:"start",behavior:o,startedAt:l,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:r="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:r});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:r})},this.getTotalSize=()=>{var r;const o=this.getMeasurements();let s;if(o.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const l=o.length-1,u=this._flatMeasurements;u!=null?s=u[l*2]+u[l*2+1]:s=((r=o[l])==null?void 0:r.end)??0}else{const l=Array(this.options.lanes).fill(null);let u=o.length-1;for(;u>=0&&l.some(d=>d===null);){const d=o[u];l[d.lane]===null&&(l[d.lane]=d.end),u--}s=Math.max(...l.filter(d=>d!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const r=[];if(this.itemSizeCache.size===0)return r;const o=this.getMeasurements();for(const s of o)s&&this.itemSizeCache.has(s.key)&&r.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return r},this._scrollToOffset=(r,{adjustments:o,behavior:s})=>{this._intendedScrollOffset=r+(o??0),this.options.scrollToFn(r,{behavior:s,adjustments:o},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(n)}applyScrollAdjustment(n,r){n!==0&&(Wh()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=n:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:r}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const o=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=o?o[0]:this.scrollState.lastTargetOffset,l=1,u=s!==this.scrollState.lastTargetOffset;if(!u&&N$(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=l){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,u){const d=this.getSize()||600,p=Math.abs(s-this.getScrollOffset()),h=this.scrollState.behavior==="smooth"&&p>d;this.scrollState.lastTargetOffset=s,h||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:h?"smooth":"auto"})}this.scheduleScrollReconcile()}}const AC=(e,n,r,o)=>{for(;e<=n;){const s=(e+n)/2|0,l=r(s);if(lo)n=s-1;else return s}return e>0?e-1:0};function B$(e,n,r){let o=0;for(;o<=n;){const s=(o+n)/2|0,l=e[s*2];if(lr)n=s-1;else return s}return o>0?o-1:0}function q$(e,n,r,o,s){const l=e.length-1;if(e.length<=o)return{startIndex:0,endIndex:l};if(o===1&&s!==null){const h=B$(s,l,r);let y=h;const v=r+n;for(;ye[h].start,r),p=d;if(o===1)for(;p1){const h=Array(o).fill(0);for(;pv=0&&y.some(v=>v>=r);){const v=e[d];y[v.lane]=v.start,d--}d=Math.max(0,d-d%o),p=Math.min(l,p+(o-1-p%o))}return{startIndex:d,endIndex:p}}const em=typeof document<"u"?w.useLayoutEffect:w.useEffect;function G$({useFlushSync:e=!0,directDomUpdates:n=!1,directDomUpdatesMode:r="transform",...o}){const s=w.useReducer(h=>h+1,0)[1],l=w.useRef({enabled:n,mode:r,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});l.current.enabled=n,l.current.mode=r;const u=h=>{const y=l.current;if(!y.enabled||!y.container)return;const v=h.getTotalSize();if(v!==y.lastSize){y.lastSize=v;const T=h.options.horizontal?"width":"height";y.container.style[T]=`${v}px`}const b=!!h.options.horizontal,x=y.mode==="transform",C=b?"left":"top",_=h.options.scrollMargin,E=h.getVirtualItems();for(const T of E){const O=T.start-_,A=h.elementsCache.get(T.key);A&&y.lastPositions.get(A)!==O&&(y.lastPositions.set(A,O),x?A.style.transform=b?`translate3d(${O}px, 0, 0)`:`translate3d(0, ${O}px, 0)`:A.style[C]=`${O}px`)}},d={...o,onChange:(h,y)=>{var v;const b=l.current;let x=!0;if(b.enabled){u(h);const C=h.range,_=b.prevRange;x=!_||_.isScrolling!==h.isScrolling||_.startIndex!==C?.startIndex||_.endIndex!==C?.endIndex,x&&(b.prevRange=C?{startIndex:C.startIndex,endIndex:C.endIndex,isScrolling:h.isScrolling}:null)}x&&(e&&y?Ao.flushSync(s):s()),(v=o.onChange)==null||v.call(o,h,y)}},[p]=w.useState(()=>{const h=new H$(d);return Object.assign(h,{containerRef:y=>{const v=l.current;if(v.container=y,v.lastSize=null,y&&v.enabled){const b=h.getTotalSize();v.lastSize=b;const x=h.options.horizontal?"width":"height";y.style[x]=`${b}px`}}})});return p.setOptions(d),em(()=>p._didMount(),[]),em(()=>p._willUpdate()),em(()=>{u(p)}),p}function Z$(e){return G$({observeElementRect:L$,observeElementOffset:V$,scrollToFn:U$,...e})}function K$(e,n){const r=[],o=(s,l)=>{for(const u of s)r.push({node:u,depth:l}),u.dir&&n.has(u.path)&&o(u.children||[],l+1)};return o(e?.children||[],0),r}function Y$(e){const{root:n,expanded:r,onToggle:o,currentPath:s,listingShowing:l,onOpen:u}=e,d=w.useRef(null),p=w.useMemo(()=>K$(n,r),[n,r]),h=Z$({count:p.length,getScrollElement:()=>d.current,estimateSize:()=>window.matchMedia("(max-width: 768px)").matches?44:28,overscan:12,getItemKey:y=>p[y].node.path});return w.useEffect(()=>{if(!s)return;const y=p.findIndex(v=>v.node.path===s);y>=0&&h.scrollToIndex(y,{align:"auto"})},[s,p]),m.jsx("nav",{id:"tree","aria-label":"Files",ref:d,children:m.jsx("div",{style:{height:h.getTotalSize(),position:"relative"},children:h.getVirtualItems().map(y=>{const{node:v,depth:b}=p[y.index],x=v.dir?r.has(v.path):!1,C=()=>{if(v.dir&&s===v.path&&l){o(v.path);return}u(v.path),v.dir||mr()};return m.jsxs("div",{className:"row "+(v.dir?"dir":"file")+(s===v.path?" active":"")+(v.dir&&!x?" collapsed":""),"data-path":v.path,tabIndex:0,role:"button",title:v.name,"aria-expanded":v.dir?x:void 0,style:{position:"absolute",top:0,left:0,right:0,transform:`translateY(${y.start}px)`,paddingLeft:8+b*13},onClick:C,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),C())},children:[Array.from({length:b},(_,E)=>m.jsx("span",{className:"tguide",style:{left:8+E*13+5},"aria-hidden":"true"},E)),m.jsx("span",{className:"chev",onClick:_=>{v.dir&&(_.stopPropagation(),o(v.path))},children:m.jsx(yt,{name:"chevd"})}),m.jsx("span",{className:"ticon",children:m.jsx(yt,{name:v.dir?"folder":"doc"})}),m.jsx("span",{className:"label",children:v.name})]},y.key)})})})}function Q$(e){const n=e.split("/"),r=[];let o="";for(let s=0;s{o=o?o+"/"+s:s;const u=o,d=l===r.length-1;return m.jsxs("span",{children:[l>0&&m.jsx("span",{className:"crumb-sep",children:"/"}),d?m.jsx("span",{children:s}):m.jsx("span",{className:"crumb-seg",title:u,onClick:()=>n(u),children:s})]},u)})})}function iw(e){if(e==="")return[];const n=e.split(`
-`);return n[n.length-1]===""&&n.pop(),n}const J$=4e6;function W$(e,n){let r=0;for(;rs.push({op:"-",line:l[v],an:r+v+1}),y=v=>s.push({op:"+",line:u[v],bn:r+v+1});if(d*p>J$){for(let v=0;v=0;C--)for(let _=p-1;_>=0;_--)v[C][_]=l[C]===u[_]?v[C+1][_+1]+1:Math.max(v[C+1][_],v[C][_+1]);let b=0,x=0;for(;b=v[b][x+1]?h(b++):y(x++);for(;bo.op==="+").length,del:r.filter(o=>o.op==="-").length}}const ow=1<<20,tI=8192;function qm(e,n,r,o){let s=e+"blob?sha="+encodeURIComponent(n);return r&&(s+="&name="+encodeURIComponent(r)),o&&(s+="&download=1"),s}async function nI(e){const n=await Y2(e);if(Number(n.headers.get("Content-Length"))>ow)return{kind:"too-large"};const o=new Uint8Array(await n.arrayBuffer());if(o.byteLength>ow)return{kind:"too-large"};if(o.subarray(0,tI).includes(0))return{kind:"binary"};try{return{kind:"text",text:new TextDecoder("utf-8",{fatal:!0}).decode(o)}}catch{return{kind:"binary"}}}function aw(e,n,r){return Gt({queryKey:["blob",e,n],queryFn:()=>nI(qm(e,n)),enabled:!!n,staleTime:1/0,gcTime:1/0,retry:!1})}function rI(e){return e.slice(e.lastIndexOf("/")+1)}function iI({apiBase:e,path:n,prev:r,cur:o}){const s=rI(n);return m.jsxs("span",{className:"dv-dl",children:[m.jsx("a",{href:qm(e,r,s,!0),children:"download previous"}),m.jsx("a",{href:qm(e,o,s,!0),children:"download this version"})]})}function oI({apiBase:e,path:n,prev:r,cur:o}){const s=aw(e,r),l=aw(e,o),u=s.data?.kind==="text"&&l.data?.kind==="text",d=w.useMemo(()=>s.data?.kind==="text"&&l.data?.kind==="text"?eI(s.data.text,l.data.text):null,[s.data,l.data]);if(s.error||l.error)return m.jsx("div",{className:"dv dv-msg",children:"Could not load one of the versions."});if(!s.data||!l.data)return m.jsx("div",{className:"dv dv-msg",children:"Loading changes…"});if(!u){const v=s.data.kind==="too-large"||l.data.kind==="too-large";return m.jsxs("div",{className:"dv dv-msg",children:[v?"Too large to diff — download to compare.":"Binary file — no diff available.",m.jsx(iI,{apiBase:e,path:n,prev:r,cur:o})]})}const{lines:p,add:h,del:y}=d;return m.jsxs("div",{className:"dv",children:[m.jsxs("div",{className:"dv-head",children:[m.jsxs("span",{className:"dv-stat",children:[m.jsxs("span",{className:"dv-add",children:["+",h]})," ",m.jsxs("span",{className:"dv-del",children:["−",y]})]}),h===0&&y===0&&m.jsx("span",{className:"dv-same",children:"No line changes"})]}),m.jsx("div",{className:"dv-body",children:p.map((v,b)=>m.jsxs("div",{className:"dv-line dv-"+(v.op==="="?"ctx":v.op==="+"?"ins":"rm"),children:[m.jsx("span",{className:"dv-n",children:v.an??""}),m.jsx("span",{className:"dv-n",children:v.bn??""}),m.jsx("span",{className:"dv-mark",children:v.op==="="?" ":v.op}),m.jsx("span",{className:"dv-text",children:v.line||" "})]},b))})]})}const aI={add:"added",edit:"edited",delete:"deleted"};function MC({text:e}){return m.jsx(m.Fragment,{children:e.split(/(https?:\/\/\S+)/).map((n,r)=>/^https?:\/\//.test(n)?m.jsx("a",{href:n,target:"_blank",rel:"noopener",children:n},r):n)})}function cg({entry:e,apiBase:n,onOpen:r,diff:o,restore:s,restoreSha:l,inRun:u}){const[d,p]=w.useState(!1),[h,y]=w.useState(!1),v=e.kind==="put"?"edit":e.kind,b=lg(e),x=[e.device.name||e.device.id,e.device.os,e.device.ip].filter(Boolean).join(" · "),C=v!=="delete",_=!!o&&v!=="delete"&&!!e.blob,E=!!u&&v==="add",T=!!s&&!!l&&!E,O=!!s?.busy&&s.busy===e.path+l,A=C&&!!e.blob,z=e.path.split("/").pop()||e.path,L=new Date(e.time).toLocaleString(),B=n+"blob?sha="+e.blob+"&name="+encodeURIComponent(z)+"&download=1",H=()=>y(!h),I=ne=>{ne.target.tagName!=="A"&&C&&r(e.path,e.blob)};return m.jsxs("div",{className:"hentry "+v+(C?" clickable":""),tabIndex:C?0:void 0,role:C?"button":void 0,onClick:I,onKeyDown:ne=>{C&&(ne.key==="Enter"||ne.key===" ")&&(ne.preventDefault(),r(e.path,e.blob))},children:[m.jsxs("div",{className:"hline",children:[m.jsx("span",{className:"hkind",children:aI[v]||v}),m.jsx("span",{className:"hpath",children:e.path}),m.jsx("span",{className:"htime",children:L})]}),m.jsxs("div",{className:"hmeta",children:[m.jsx("span",{className:"hwho",children:b}),m.jsx("span",{className:"hdev",children:x}),m.jsx("span",{className:"hsize",children:e.size?yC(e.size):""}),T&&m.jsxs("button",{type:"button",className:"hrestore-btn",disabled:O,title:"Put this version of "+e.path+" back as a new change",onClick:ne=>{ne.stopPropagation(),s.onRestore(e.path,l)},onKeyDown:ne=>ne.stopPropagation(),children:[m.jsx(yt,{name:"hist"}),O?"restoring…":"restore"]}),s&&E&&m.jsx("span",{className:"hrestore-gap",title:"Restore puts old content back; it can't remove a file yet.",children:"created by this run — can't be undone yet"})]}),e.note&&!u&&m.jsx("div",{className:"hnote"+(d?" open":""),tabIndex:0,role:"button",title:d?"Collapse note":"Show full note","aria-expanded":d,onClick:ne=>{ne.stopPropagation(),ne.target.tagName!=="A"&&p(!d)},onKeyDown:ne=>{(ne.key==="Enter"||ne.key===" ")&&(ne.preventDefault(),ne.stopPropagation(),p(!d))},children:m.jsx(MC,{text:e.note})}),(_||A)&&m.jsxs("div",{className:"hactions",children:[_&&(o.prev?m.jsxs("button",{type:"button",className:"hdiff-btn"+(h?" open":""),"aria-expanded":h,onClick:ne=>{ne.stopPropagation(),H()},onKeyDown:ne=>ne.stopPropagation(),children:[m.jsx(yt,{name:h?"chevd":"chev"}),h?"hide changes":"show changes"]}):m.jsx("div",{className:"hdiff-none",children:"First version — nothing to compare against"})),A&&m.jsxs(m.Fragment,{children:[m.jsxs("button",{type:"button",className:"hver-btn","aria-label":`Open ${z} as of ${L}`,onClick:ne=>{ne.stopPropagation(),r(e.path,e.blob)},onKeyDown:ne=>ne.stopPropagation(),children:[m.jsx(yt,{name:"clock"}),"Open this version"]}),m.jsxs("a",{className:"hver-btn",download:!0,href:B,"aria-label":`Download ${z} as of ${L}`,onClick:ne=>ne.stopPropagation(),onKeyDown:ne=>{ne.stopPropagation(),ne.key===" "&&(ne.preventDefault(),ne.currentTarget.click())},children:[m.jsx(yt,{name:"download"}),"Download"]})]})]}),_&&o.prev&&h&&m.jsx("div",{onClick:ne=>ne.stopPropagation(),children:m.jsx(oI,{apiBase:o.apiBase,path:e.path,prev:o.prev,cur:e.blob})})]})}function sI(e){const{node:n,heatMap:r,onOpen:o}=e,s=(n.children||[]).slice().sort((h,y)=>Number(y.dir||!1)-Number(h.dir||!1)||h.name.localeCompare(y.name)),l=s.filter(h=>h.dir).length,u=s.length-l,d=[];l&&d.push(l+(l===1?" folder":" folders")),u&&d.push(u+(u===1?" file":" files"));const p=tw(r,n.path,!0);return p&&d.push(Ks(p)+" in 30 days"),m.jsxs("div",{className:"dirlist",children:[m.jsxs("h1",{className:"dl-title",children:[m.jsx("span",{className:"dl-title-icon",children:m.jsx(yt,{name:"folder"})}),m.jsx("span",{children:n.name})]}),m.jsx("p",{className:"dl-sub",children:d.join(" · ")||"Empty folder"}),s.length===0?m.jsx("div",{className:"dl-empty",children:"Nothing in this folder yet."}):m.jsx("div",{className:"dl-items",children:s.map(h=>{let y="";if(h.dir){const b=(h.children||[]).length;y=b+(b===1?" item":" items")}else y=[h.size?yC(h.size):"",h.time?new Date(h.time).toLocaleDateString():""].filter(Boolean).join(" · ");const v=tw(r,h.path,!!h.dir);return v&&(y=Ks(v)+(y?" · "+y:"")),m.jsxs("div",{className:"dl-row",tabIndex:0,role:"button",title:h.path,onClick:()=>o(h.path),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),o(h.path))},children:[m.jsx("span",{className:"ticon",children:m.jsx(yt,{name:h.dir?"folder":"doc"})}),m.jsx("span",{className:"dl-name",children:h.name}),v&&m.jsx("span",{className:"heatdot lvl"+A$(v),role:"img","aria-label":Ks(v)+" in 30 days",title:Ks(v)+" in 30 days"}),m.jsx("span",{className:"dl-meta",children:y})]},h.path)})}),e.hub&&m.jsx(lI,{apiBase:e.apiBase,prefix:n.path+"/",onOpen:o,onFullHistory:()=>e.onFullHistory(n.path+"/"),onRendered:e.onRendered})]})}function lI(e){const n=j$(e.apiBase,e.prefix,!0),{onRendered:r}=e;return w.useEffect(()=>{n&&n.length&&r&&r()},[n,r]),!n||n.length===0?null:m.jsxs("div",{className:"dl-history",children:[m.jsx("h3",{className:"dl-h3",children:"Recent changes"}),m.jsx("div",{className:"history dl-hlist",children:n.map((o,s)=>m.jsx(cg,{entry:o,apiBase:e.apiBase,onOpen:e.onOpen},s))}),m.jsx("button",{className:"ai-btn dl-more",onClick:e.onFullHistory,children:"Full history"})]})}function cI(e){const{apiBase:n,path:r,version:o,onMeta:s}=e,l=o?n+"blob?sha="+o+"&name="+encodeURIComponent(r):n+"file?path="+encodeURIComponent(r);return w.useEffect(()=>()=>s(""),[r,s]),X8.test(r)?m.jsx(uI,{...e}):vC.test(r)?m.jsx("iframe",{className:"htmlview",sandbox:"allow-scripts",src:l,title:r,onLoad:e.onRendered}):J8.test(r)?m.jsx(hI,{src:l,alt:r,version:o,onRendered:e.onRendered}):W8.test(r)?m.jsx(mI,{...e,fileURL:l}):m.jsxs("div",{className:"filecard",children:[m.jsx("div",{className:"name",children:r.split("/").pop()}),m.jsx("p",{children:"No preview for this file type."}),m.jsx("a",{className:"btn",download:!0,href:o?l+"&download=1":n+"download?path="+encodeURIComponent(r),children:"Download"})]})}function uI(e){const{apiBase:n,path:r,version:o,heatMap:s,flatFiles:l,onOpenFile:u,onMeta:d,onRendered:p}=e,{data:h,error:y}=Gt({queryKey:["render",n,r,o||""],queryFn:()=>cn(n+"render?path="+encodeURIComponent(r)+(o?"&sha="+o:"")),retry:o?!1:void 0}),v=w.useMemo(()=>h?fI(h.html,r,n):"",[h,r,n]);return w.useEffect(()=>{if(!h)return;const b=[];h.author&&b.push(h.author+(h.device?" on "+h.device:"")),h.time&&b.push(new Date(h.time).toLocaleString());const x=o?null:s&&s[h.path];x&&dl(x)&&b.push(Ks(x)+" / 30d"),d(b.join(" · ")),p?.()},[h,o,s,d,p]),y?m.jsx(ug,{version:o,err:y}):h?m.jsx("div",{dangerouslySetInnerHTML:{__html:v},onClick:b=>dI(b,r,l,u)}):null}function dI(e,n,r,o){const s=e.target.closest("a");if(!s||!e.currentTarget.contains(s))return;const l=s.getAttribute("href")||"",u=n.includes("/")?n.slice(0,n.lastIndexOf("/")):"";l.startsWith("wiki:")?(e.preventDefault(),pI(decodeURIComponent(l.slice(5)),r,o)):/^([a-z]+:|\/|#)/i.test(l)||(e.preventDefault(),o(bC(u,decodeURIComponent(l))))}function fI(e,n,r){const o=n.includes("/")?n.slice(0,n.lastIndexOf("/")):"",s=u=>r+"file?path="+encodeURIComponent(u),l=new DOMParser().parseFromString(e,"text/html");for(const u of l.querySelectorAll("img")){const d=u.getAttribute("src")||"";/^([a-z]+:|\/)/i.test(d)||u.setAttribute("src",s(bC(o,d)))}for(const u of l.querySelectorAll("a")){const d=u.getAttribute("href")||"";/^https?:/i.test(d)&&(u.setAttribute("target","_blank"),u.setAttribute("rel","noopener"))}return l.body.innerHTML}function hI(e){const[n,r]=w.useState(!1);return n?m.jsx(ug,{version:e.version,err:new Error("could not be loaded")}):m.jsx("img",{src:e.src,alt:e.alt,onLoad:e.onRendered,onError:()=>r(!0)})}function ug({version:e,err:n}){return m.jsx("div",{className:"empty",children:e?"That version isn't available.":"Could not load file: "+n.message})}function mI(e){const{path:n,version:r,fileURL:o,onRendered:s}=e,{data:l,error:u}=Gt({queryKey:["text",o],queryFn:async()=>{const d=await fetch(o);if(!d.ok)throw new Error(await d.text());return d.text()},retry:r?!1:void 0});return w.useEffect(()=>{l!=null&&s?.()},[l,s]),u?m.jsx(ug,{version:r,err:u}):l==null?null:m.jsx("pre",{className:"plain",children:l},n)}function pI(e,n,r){const o=e.toLowerCase(),s=n.find(l=>l.path.toLowerCase()===o||l.path.toLowerCase()===o+".md")||n.find(l=>{const u=l.name.toLowerCase();return u===o||u===o+".md"});s&&r(s.path)}const gI=[{value:"",label:"Never"},{value:"24h",label:"In 24 hours"},{value:"168h",label:"In 7 days"},{value:"720h",label:"In 30 days"}];function vI({url:e,copied:n,onClose:r}){const o=e.split("/s/")[1],[s,l]=w.useState(""),[u,d]=w.useState(),[p,h]=w.useState(!1),y=w.useRef(null);async function v(b){const x=s;l(b),h(!0);try{const C=await Un("PATCH","/api/shares/"+o,{expires_in:b});d(C.expires)}catch(C){Qe(C.message,!0),l(x)}finally{h(!1)}}return m.jsx(Ip,{open:!0,onOpenChange:b=>!b&&r(),children:m.jsxs(Vp,{className:"modal",showCloseButton:!1,onOpenAutoFocus:b=>{b.preventDefault(),y.current?.focus()},children:[m.jsx(Ku,{asChild:!0,children:m.jsx("h3",{children:"Public link"})}),m.jsxs("p",{children:[m.jsx("b",{children:"Anyone with this link can view this file"})," — no account needed. It always shows the latest version until it expires or you revoke it."]}),m.jsx("div",{className:"modal-url",children:e}),m.jsxs("div",{className:"modal-expiry",children:[m.jsx("label",{htmlFor:"share-expiry",children:"Expires"}),m.jsx("select",{id:"share-expiry",value:s,disabled:p,onChange:b=>v(b.target.value),children:gI.map(b=>m.jsx("option",{value:b.value,children:b.label},b.value))}),m.jsx("span",{className:"modal-expiry-note",children:wC(u)})]}),m.jsxs("div",{className:"modal-actions",children:[m.jsx(Ct,{ref:y,variant:"primary",onClick:()=>Ha(e).then(b=>Qe(b?"Copied.":"Select and copy the link above.")),children:n?"Copied ✓":"Copy link"}),m.jsx(Ct,{variant:"subtle",onClick:()=>window.open(e,"_blank"),children:"Open"}),m.jsx(Ct,{variant:"subtle",className:"ai-del",onClick:async()=>{try{await Un("DELETE","/api/shares/"+o),Qe("Link revoked — it no longer works."),r()}catch(b){Qe(b.message,!0)}},children:"Revoke"}),m.jsx(Ct,{variant:"subtle",onClick:r,children:"Done"})]})]})})}function yI({shares:e,canRevoke:n,onChanged:r}){return e.length===0?null:m.jsxs("div",{className:"share-banner",role:"status",children:[m.jsxs("div",{className:"sb-head",children:[m.jsx(yt,{name:"share"}),m.jsx("b",{children:"Publicly shared"}),m.jsxs("span",{className:"sb-count",children:[e.length," active link",e.length>1?"s":""]})]}),m.jsxs("p",{className:"sb-note",children:[m.jsx("b",{children:"Anyone with this link can view this file"})," — no account needed. It always shows the latest version until you revoke it."]}),e.map(o=>m.jsxs("div",{className:"sb-link",children:[m.jsx("span",{className:"sb-url mono",title:o.url,children:o.url}),m.jsx("span",{className:"sb-meta",children:SC(o,!1)}),m.jsxs("span",{className:"sb-actions",children:[m.jsx(Ct,{variant:"subtle",onClick:()=>Ha(o.url).then(s=>Qe(s?"Copied.":"Select and copy the link.")),children:"Copy link"}),m.jsx(Ct,{variant:"subtle",onClick:()=>window.open(o.url,"_blank"),children:"Open"}),n&&m.jsx("button",{className:"ai-del","aria-label":`Revoke the share of ${o.path}`,onClick:()=>CC(o,r),children:"Revoke"})]})]},o.token))]})}var sw=1,bI=.9,xI=.8,wI=.17,tm=.1,nm=.999,SI=.9999,_I=.99,CI=/[\\\/_+.#"@\[\(\{&]/,EI=/[\\\/_+.#"@\[\(\{&]/g,RI=/[\s-]/,NC=/[\s-]/g;function Gm(e,n,r,o,s,l,u){if(l===n.length)return s===e.length?sw:_I;var d=`${s},${l}`;if(u[d]!==void 0)return u[d];for(var p=o.charAt(l),h=r.indexOf(p,s),y=0,v,b,x,C;h>=0;)v=Gm(e,n,r,o,h+1,l+1,u),v>y&&(h===s?v*=sw:CI.test(e.charAt(h-1))?(v*=xI,x=e.slice(s,h-1).match(EI),x&&s>0&&(v*=Math.pow(nm,x.length))):RI.test(e.charAt(h-1))?(v*=bI,C=e.slice(s,h-1).match(NC),C&&s>0&&(v*=Math.pow(nm,C.length))):(v*=wI,s>0&&(v*=Math.pow(nm,h-s))),e.charAt(h)!==n.charAt(l)&&(v*=SI)),(vv&&(v=b*tm)),v>y&&(y=v),h=r.indexOf(p,h+1);return u[d]=y,y}function lw(e){return e.toLowerCase().replace(NC," ")}function TI(e,n,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Gm(e,n,lw(e),lw(n),0,0,{})}var Bs='[cmdk-group=""]',rm='[cmdk-group-items=""]',OI='[cmdk-group-heading=""]',DC='[cmdk-item=""]',cw=`${DC}:not([aria-disabled="true"])`,Zm="cmdk-item-select",Oa="data-value",jI=(e,n,r)=>TI(e,n,r),zC=w.createContext(void 0),Sl=()=>w.useContext(zC),kC=w.createContext(void 0),dg=()=>w.useContext(kC),LC=w.createContext(void 0),$C=w.forwardRef((e,n)=>{let r=ja(()=>{var M,U;return{search:"",value:(U=(M=e.value)!=null?M:e.defaultValue)!=null?U:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=ja(()=>new Set),s=ja(()=>new Map),l=ja(()=>new Map),u=ja(()=>new Set),d=IC(e),{label:p,children:h,value:y,onValueChange:v,filter:b,shouldFilter:x,loop:C,disablePointerSelection:_=!1,vimBindings:E=!0,...T}=e,O=mn(),A=mn(),z=mn(),L=w.useRef(null),B=FI();Oo(()=>{if(y!==void 0){let M=y.trim();r.current.value=M,H.emit()}},[y]),Oo(()=>{B(6,le)},[]);let H=w.useMemo(()=>({subscribe:M=>(u.current.add(M),()=>u.current.delete(M)),snapshot:()=>r.current,setState:(M,U,Q)=>{var K,ae,J,ge;if(!Object.is(r.current[M],U)){if(r.current[M]=U,M==="search")ce(),ve(),B(1,fe);else if(M==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ye=document.getElementById(z);ye?ye.focus():(K=document.getElementById(O))==null||K.focus()}if(B(7,()=>{var ye;r.current.selectedItemId=(ye=me())==null?void 0:ye.id,H.emit()}),Q||B(5,le),((ae=d.current)==null?void 0:ae.value)!==void 0){let ye=U??"";(ge=(J=d.current).onValueChange)==null||ge.call(J,ye);return}}H.emit()}},emit:()=>{u.current.forEach(M=>M())}}),[]),I=w.useMemo(()=>({value:(M,U,Q)=>{var K;U!==((K=l.current.get(M))==null?void 0:K.value)&&(l.current.set(M,{value:U,keywords:Q}),r.current.filtered.items.set(M,ne(U,Q)),B(2,()=>{ve(),H.emit()}))},item:(M,U)=>(o.current.add(M),U&&(s.current.has(U)?s.current.get(U).add(M):s.current.set(U,new Set([M]))),B(3,()=>{ce(),ve(),r.current.value||fe(),H.emit()}),()=>{l.current.delete(M),o.current.delete(M),r.current.filtered.items.delete(M);let Q=me();B(4,()=>{ce(),Q?.getAttribute("id")===M&&fe(),H.emit()})}),group:M=>(s.current.has(M)||s.current.set(M,new Set),()=>{l.current.delete(M),s.current.delete(M)}),filter:()=>d.current.shouldFilter,label:p||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:O,inputId:z,labelId:A,listInnerRef:L}),[]);function ne(M,U){var Q,K;let ae=(K=(Q=d.current)==null?void 0:Q.filter)!=null?K:jI;return M?ae(M,r.current.search,U):0}function ve(){if(!r.current.search||d.current.shouldFilter===!1)return;let M=r.current.filtered.items,U=[];r.current.filtered.groups.forEach(K=>{let ae=s.current.get(K),J=0;ae.forEach(ge=>{let ye=M.get(ge);J=Math.max(ye,J)}),U.push([K,J])});let Q=L.current;xe().sort((K,ae)=>{var J,ge;let ye=K.getAttribute("id"),Ne=ae.getAttribute("id");return((J=M.get(Ne))!=null?J:0)-((ge=M.get(ye))!=null?ge:0)}).forEach(K=>{let ae=K.closest(rm);ae?ae.appendChild(K.parentElement===ae?K:K.closest(`${rm} > *`)):Q.appendChild(K.parentElement===Q?K:K.closest(`${rm} > *`))}),U.sort((K,ae)=>ae[1]-K[1]).forEach(K=>{var ae;let J=(ae=L.current)==null?void 0:ae.querySelector(`${Bs}[${Oa}="${encodeURIComponent(K[0])}"]`);J?.parentElement.appendChild(J)})}function fe(){let M=xe().find(Q=>Q.getAttribute("aria-disabled")!=="true"),U=M?.getAttribute(Oa);H.setState("value",U||void 0)}function ce(){var M,U,Q,K;if(!r.current.search||d.current.shouldFilter===!1){r.current.filtered.count=o.current.size;return}r.current.filtered.groups=new Set;let ae=0;for(let J of o.current){let ge=(U=(M=l.current.get(J))==null?void 0:M.value)!=null?U:"",ye=(K=(Q=l.current.get(J))==null?void 0:Q.keywords)!=null?K:[],Ne=ne(ge,ye);r.current.filtered.items.set(J,Ne),Ne>0&&ae++}for(let[J,ge]of s.current)for(let ye of ge)if(r.current.filtered.items.get(ye)>0){r.current.filtered.groups.add(J);break}r.current.filtered.count=ae}function le(){var M,U,Q;let K=me();K&&(((M=K.parentElement)==null?void 0:M.firstChild)===K&&((Q=(U=K.closest(Bs))==null?void 0:U.querySelector(OI))==null||Q.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function me(){var M;return(M=L.current)==null?void 0:M.querySelector(`${DC}[aria-selected="true"]`)}function xe(){var M;return Array.from(((M=L.current)==null?void 0:M.querySelectorAll(cw))||[])}function N(M){let U=xe()[M];U&&H.setState("value",U.getAttribute(Oa))}function Z(M){var U;let Q=me(),K=xe(),ae=K.findIndex(ge=>ge===Q),J=K[ae+M];(U=d.current)!=null&&U.loop&&(J=ae+M<0?K[K.length-1]:ae+M===K.length?K[0]:K[ae+M]),J&&H.setState("value",J.getAttribute(Oa))}function re(M){let U=me(),Q=U?.closest(Bs),K;for(;Q&&!K;)Q=M>0?II(Q,Bs):VI(Q,Bs),K=Q?.querySelector(cw);K?H.setState("value",K.getAttribute(Oa)):Z(M)}let W=()=>N(xe().length-1),ee=M=>{M.preventDefault(),M.metaKey?W():M.altKey?re(1):Z(1)},D=M=>{M.preventDefault(),M.metaKey?N(0):M.altKey?re(-1):Z(-1)};return w.createElement(Ve.div,{ref:n,tabIndex:-1,...T,"cmdk-root":"",onKeyDown:M=>{var U;(U=T.onKeyDown)==null||U.call(T,M);let Q=M.nativeEvent.isComposing||M.keyCode===229;if(!(M.defaultPrevented||Q))switch(M.key){case"n":case"j":{E&&M.ctrlKey&&ee(M);break}case"ArrowDown":{ee(M);break}case"p":case"k":{E&&M.ctrlKey&&D(M);break}case"ArrowUp":{D(M);break}case"Home":{M.preventDefault(),N(0);break}case"End":{M.preventDefault(),W();break}case"Enter":{M.preventDefault();let K=me();if(K){let ae=new Event(Zm);K.dispatchEvent(ae)}}}}},w.createElement("label",{"cmdk-label":"",htmlFor:I.inputId,id:I.labelId,style:UI},p),cd(e,M=>w.createElement(kC.Provider,{value:H},w.createElement(zC.Provider,{value:I},M))))}),AI=w.forwardRef((e,n)=>{var r,o;let s=mn(),l=w.useRef(null),u=w.useContext(LC),d=Sl(),p=IC(e),h=(o=(r=p.current)==null?void 0:r.forceMount)!=null?o:u?.forceMount;Oo(()=>{if(!h)return d.item(s,u?.id)},[h]);let y=VC(s,l,[e.value,e.children,l],e.keywords),v=dg(),b=Hi(B=>B.value&&B.value===y.current),x=Hi(B=>h||d.filter()===!1?!0:B.search?B.filtered.items.get(s)>0:!0);w.useEffect(()=>{let B=l.current;if(!(!B||e.disabled))return B.addEventListener(Zm,C),()=>B.removeEventListener(Zm,C)},[x,e.onSelect,e.disabled]);function C(){var B,H;_(),(H=(B=p.current).onSelect)==null||H.call(B,y.current)}function _(){v.setState("value",y.current,!0)}if(!x)return null;let{disabled:E,value:T,onSelect:O,forceMount:A,keywords:z,...L}=e;return w.createElement(Ve.div,{ref:Va(l,n),...L,id:s,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!b,"data-disabled":!!E,"data-selected":!!b,onPointerMove:E||d.getDisablePointerSelection()?void 0:_,onClick:E?void 0:C},e.children)}),MI=w.forwardRef((e,n)=>{let{heading:r,children:o,forceMount:s,...l}=e,u=mn(),d=w.useRef(null),p=w.useRef(null),h=mn(),y=Sl(),v=Hi(x=>s||y.filter()===!1?!0:x.search?x.filtered.groups.has(u):!0);Oo(()=>y.group(u),[]),VC(u,d,[e.value,e.heading,p]);let b=w.useMemo(()=>({id:u,forceMount:s}),[s]);return w.createElement(Ve.div,{ref:Va(d,n),...l,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},r&&w.createElement("div",{ref:p,"cmdk-group-heading":"","aria-hidden":!0,id:h},r),cd(e,x=>w.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?h:void 0},w.createElement(LC.Provider,{value:b},x))))}),NI=w.forwardRef((e,n)=>{let{alwaysRender:r,...o}=e,s=w.useRef(null),l=Hi(u=>!u.search);return!r&&!l?null:w.createElement(Ve.div,{ref:Va(s,n),...o,"cmdk-separator":"",role:"separator"})}),DI=w.forwardRef((e,n)=>{let{onValueChange:r,...o}=e,s=e.value!=null,l=dg(),u=Hi(h=>h.search),d=Hi(h=>h.selectedItemId),p=Sl();return w.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),w.createElement(Ve.input,{ref:n,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":p.listId,"aria-labelledby":p.labelId,"aria-activedescendant":d,id:p.inputId,type:"text",value:s?e.value:u,onChange:h=>{s||l.setState("search",h.target.value),r?.(h.target.value)}})}),zI=w.forwardRef((e,n)=>{let{children:r,label:o="Suggestions",...s}=e,l=w.useRef(null),u=w.useRef(null),d=Hi(h=>h.selectedItemId),p=Sl();return w.useEffect(()=>{if(u.current&&l.current){let h=u.current,y=l.current,v,b=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let x=h.offsetHeight;y.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return b.observe(h),()=>{cancelAnimationFrame(v),b.unobserve(h)}}},[]),w.createElement(Ve.div,{ref:Va(l,n),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":o,id:p.listId},cd(e,h=>w.createElement("div",{ref:Va(u,p.listInnerRef),"cmdk-list-sizer":""},h)))}),kI=w.forwardRef((e,n)=>{let{open:r,onOpenChange:o,overlayClassName:s,contentClassName:l,container:u,...d}=e;return w.createElement(op,{open:r,onOpenChange:o},w.createElement(sp,{container:u},w.createElement(lp,{"cmdk-overlay":"",className:s}),w.createElement(cp,{"aria-label":e.label,"cmdk-dialog":"",className:l},w.createElement($C,{ref:n,...d}))))}),LI=w.forwardRef((e,n)=>Hi(r=>r.filtered.count===0)?w.createElement(Ve.div,{ref:n,...e,"cmdk-empty":"",role:"presentation"}):null),$I=w.forwardRef((e,n)=>{let{progress:r,children:o,label:s="Loading...",...l}=e;return w.createElement(Ve.div,{ref:n,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},cd(e,u=>w.createElement("div",{"aria-hidden":!0},u)))}),ld=Object.assign($C,{List:zI,Item:AI,Input:DI,Group:MI,Separator:NI,Dialog:kI,Empty:LI,Loading:$I});function II(e,n){let r=e.nextElementSibling;for(;r;){if(r.matches(n))return r;r=r.nextElementSibling}}function VI(e,n){let r=e.previousElementSibling;for(;r;){if(r.matches(n))return r;r=r.previousElementSibling}}function IC(e){let n=w.useRef(e);return Oo(()=>{n.current=e}),n}var Oo=typeof window>"u"?w.useEffect:w.useLayoutEffect;function ja(e){let n=w.useRef();return n.current===void 0&&(n.current=e()),n}function Hi(e){let n=dg(),r=()=>e(n.snapshot());return w.useSyncExternalStore(n.subscribe,r,r)}function VC(e,n,r,o=[]){let s=w.useRef(),l=Sl();return Oo(()=>{var u;let d=(()=>{var h;for(let y of r){if(typeof y=="string")return y.trim();if(typeof y=="object"&&"current"in y)return y.current?(h=y.current.textContent)==null?void 0:h.trim():s.current}})(),p=o.map(h=>h.trim());l.value(e,d,p),(u=n.current)==null||u.setAttribute(Oa,d),s.current=d}),s}var FI=()=>{let[e,n]=w.useState(),r=ja(()=>new Map);return Oo(()=>{r.current.forEach(o=>o()),r.current=new Map},[e]),(o,s)=>{r.current.set(o,s),n({})}};function PI(e){let n=e.type;return typeof n=="function"?n(e.props):"render"in n?n.render(e.props):e}function cd({asChild:e,children:n},r){return e&&w.isValidElement(n)?w.cloneElement(PI(n),{ref:n.ref},r(n.props.children)):r(n)}var UI={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function HI({className:e,...n}){return m.jsx(ld,{"data-slot":"command",className:We("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...n})}function BI({className:e,...n}){return m.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[m.jsx(u_,{className:"size-4 shrink-0 opacity-50"}),m.jsx(ld.Input,{"data-slot":"command-input",className:We("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...n})]})}function qI({className:e,...n}){return m.jsx(ld.List,{"data-slot":"command-list",className:We("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...n})}function GI({className:e,...n}){return m.jsx(ld.Item,{"data-slot":"command-item",className:We("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...n})}function uw(e,n){if(!e)return{score:0,hits:[]};const r=e.toLowerCase(),o=n.toLowerCase();let s=0,l=0,u=0;const d=[];for(let p=0;p3&&o.endsWith("ies")?s=o.slice(0,-3)+"y":o.length>3&&o.endsWith("es")?s=o.slice(0,-2):o.length>2&&o.endsWith("s")&&(s=o.slice(0,-1)),s?uw(s,n):null}function KI({text:e,hits:n}){const r=[];let o=0;return n.forEach((s,l)=>{s>o&&r.push(e.slice(o,s)),r.push(m.jsx("b",{children:e[s]},l)),o=s+1}),r.push(e.slice(o)),m.jsx("span",{className:"plabel",children:r})}function YI({open:e,onClose:n,candidates:r}){const[o,s]=w.useState(""),l=w.useMemo(()=>{if(!e)return[];const d=[];for(const p of r()){const h=ZI(o,p.label);h&&d.push({...p,score:h.score,hits:h.hits})}return d.sort((p,h)=>h.score-p.score),d.slice(0,40)},[e,o,r]);w.useEffect(()=>{e&&s("")},[e]);const u=d=>{n(),d.run()};return m.jsx(Ip,{open:e,onOpenChange:d=>!d&&n(),children:m.jsxs(Vp,{id:"palette",className:"palette",showCloseButton:!1,"aria-describedby":void 0,children:[m.jsx(Ku,{className:"sr-only",children:"Search and quick actions"}),m.jsxs(HI,{shouldFilter:!1,loop:!0,children:[m.jsxs("div",{id:"palette-inputwrap",children:[m.jsx(yt,{name:"search"}),m.jsx(BI,{id:"palette-input",placeholder:"Search file names, projects, actions…",autoComplete:"off",spellCheck:!1,value:o,onValueChange:s})]}),m.jsx(qI,{id:"palette-results",children:l.length===0?m.jsx("div",{className:"pempty",children:"No matches — search covers file names, projects, and actions"}):l.map(d=>m.jsxs(GI,{value:d.kind+":"+d.label,onSelect:()=>u(d),children:[m.jsx("span",{className:"picon",children:m.jsx(yt,{name:d.icon})}),m.jsx(KI,{text:d.label,hits:d.hits}),m.jsx("span",{className:"pkind",children:d.kind})]},d.kind+":"+d.label))}),m.jsx("footer",{id:"palette-hint",children:"↑↓ navigate · ⏎ select · esc close"})]})]})})}const Ys=3,Aa=30;function QI(e,n){return Gt({queryKey:["heatDevices",e],queryFn:()=>cn(e+"heat?by=device&days=30"),enabled:n,retry:!1,staleTime:6e4}).data?.devices??null}function dw(e){const[n,r]=w.useState("all"),{flatFiles:o,heatMap:s,devices:l,scope:u}=e,d=b=>!u||b===u||b.startsWith(u+"/"),p=u?o.filter(b=>d(b.path)):o,h=l&&u?l.map(b=>{const x={};for(const[C,_]of Object.entries(b.folders||{}))d(C)&&(x[C]=_);return{...b,folders:x}}).filter(b=>Object.keys(b.folders).length>0):l,y=Date.now(),v=p.map(b=>{const x=s&&s[b.path]||{},C=b.time?Math.max(0,(y-new Date(b.time).getTime())/864e5):0,_=n==="all"?dl(x):x[n]||0;return{path:b.path,reads:_,agent:x.agent||0,total:dl(x),days:C,danger:_>=Ys&&C>=Aa}});return m.jsxs("div",{className:"insights",children:[m.jsxs("h1",{className:"in-title",children:["Knowledge insights",u?m.jsxs("span",{className:"in-scope",children:[" · ",u]}):null]}),m.jsx("p",{className:"dl-sub",children:u?`Reads over the last 30 days × freshness, for ${u} and everything in it.`:"Reads over the last 30 days × how long since each file changed. Hot but stale knowledge — read a lot, maintained by nobody — is the danger zone."}),m.jsx("div",{className:"in-lens",children:["all","human","agent"].map(b=>m.jsx("button",{className:"in-lens-btn"+(b===n?" active":""),onClick:()=>r(b),children:b==="all"?"All reads":b==="human"?"Human reads":"Agent reads"},b))}),m.jsx("h3",{className:"dl-h3",children:"Map — cell size = reads, color = freshness"}),m.jsx(JI,{pts:v,onOpenFile:e.onOpenFile,onOpenFolder:e.onOpenFolder,isFolder:e.isFolder}),m.jsx("h3",{className:"dl-h3",children:"Reads × freshness"}),m.jsx(WI,{pts:v,onOpenFile:e.onOpenFile}),m.jsx("h3",{className:"dl-h3",children:"Hot path — top files by reads"}),m.jsx(eV,{pts:v,lens:n,onOpenFile:e.onOpenFile}),h&&h.length>0&&m.jsxs(m.Fragment,{children:[m.jsx("h3",{className:"dl-h3",children:"Agent coverage — which agents read which areas"}),m.jsx(tV,{devices:h})]})]})}function XI(e){const n=[[76,195,138],[232,196,84],[224,93,93]],r=Math.min(1,Math.max(0,e/300))*(n.length-1),o=Math.min(n.length-2,Math.floor(r)),s=r-o,l=n[o].map((u,d)=>Math.round(u+(n[o+1][d]-u)*s));return`rgb(${l[0]},${l[1]},${l[2]})`}function fw(e,n,r,o,s){const l=e.reduce((h,y)=>h+y.value,0);if(!l||o<=0||s<=0)return[];const u=e.slice().sort((h,y)=>y.value-h.value).map(h=>({it:h,a:h.value/l*o*s})),d=(h,y)=>{const b=h.reduce((C,_)=>C+_.a,0)/y;let x=0;for(const C of h){const _=C.a/b;x=Math.max(x,_/b,b/_)}return x},p=[];for(;u.length;){const h=o>=s,y=h?s:o,v=[u.shift()];for(;u.length&&d(v.concat(u[0]),y)<=d(v,y);)v.push(u.shift());const b=v.reduce((C,_)=>C+_.a,0)/y;let x=0;for(const C of v){const _=C.a/b;h?p.push({item:C.it,x:n,y:r+x,w:b,h:_}):p.push({item:C.it,x:n+x,y:r,w:_,h:b}),x+=_}h?(n+=b,o-=b):(r+=b,s-=b)}return p}const im=15;function JI({pts:e,onOpenFile:n,onOpenFolder:r,isFolder:o}){const u=new Map;for(const p of e){const h=p.path.includes("/")?p.path.split("/")[0]:"/";let y=u.get(h);y||u.set(h,y={name:h,files:[],value:0}),y.files.push(p),y.value+=p.reads+1}const d=[];for(const p of fw([...u.values()],0,0,720,480)){const h=p.item,y=h.name==="/"?"":h.name;if(d.push(m.jsx("rect",{x:p.x+1,y:p.y+1,width:Math.max(0,p.w-2),height:Math.max(0,p.h-2),rx:3,className:"in-tm-group","data-dir":y},"g"+h.name)),p.w>46&&p.h>im+10){let b=h.name==="/"?"(root)":h.name;const x=Math.floor((p.w-8)/6);b.length>x&&(b=b.slice(0,Math.max(1,x-1))+"…"),d.push(m.jsx("text",{x:p.x+5,y:p.y+12,className:"in-tm-glabel","data-dir":y,children:b},"gl"+h.name))}const v=fw(h.files.map(b=>({...b,name:b.path.split("/").pop(),value:b.reads+1})),p.x+2,p.y+im,Math.max(0,p.w-4),Math.max(0,p.h-im-2));for(const b of v)if(d.push(m.jsx("rect",{x:b.x+.6,y:b.y+.6,width:Math.max(.4,b.w-1.2),height:Math.max(.4,b.h-1.2),rx:1.5,fill:XI(b.item.days),className:"in-tm-cell","data-path":b.item.path,children:m.jsx("title",{children:`${b.item.path} — ${b.item.reads} read${b.item.reads===1?"":"s"}/30d · changed ${Math.round(b.item.days)}d ago`})},b.item.path)),b.w>54&&b.h>16){const x=Math.floor((b.w-8)/6);let C=(b.item.danger?"⚠ ":"")+b.item.name;C.length>x&&(C=C.slice(0,Math.max(1,x-1))+"…"),x>=5&&d.push(m.jsx("text",{x:b.x+4.5,y:b.y+12.5,className:"in-tm-label","data-path":b.item.path,children:C},"l"+b.item.path))}}return m.jsx("svg",{viewBox:"0 0 720 480",className:"in-chart in-treemap",onClick:p=>{const h=p.target.closest("[data-path], [data-dir]");if(!h)return;const y=h.getAttribute("data-path");if(y)return n(y);const v=h.getAttribute("data-dir");v&&o(v)&&r(v)},children:d})}function WI({pts:e,onOpenFile:n}){const s={l:44,r:16,t:20,b:34},l=Math.max(Aa*2,...e.map(v=>v.days)),u=Math.max(Ys*2,...e.map(v=>v.reads)),d=v=>Math.log10(v+1)/Math.log10(l+1),p=v=>Math.log10(v+1)/Math.log10(u+1),h=v=>s.l+d(v)*(720-s.l-s.r),y=v=>360-s.b-p(v)*(360-s.t-s.b);return m.jsxs("svg",{viewBox:"0 0 720 360",className:"in-chart",children:[m.jsx("rect",{x:h(Aa),y:s.t,width:720-s.r-h(Aa),height:y(Ys)-s.t,className:"in-danger-zone"}),m.jsx("line",{x1:h(Aa),y1:s.t,x2:h(Aa),y2:360-s.b,className:"in-threshold"}),m.jsx("line",{x1:s.l,y1:y(Ys),x2:720-s.r,y2:y(Ys),className:"in-threshold"}),m.jsx("line",{x1:s.l,y1:360-s.b,x2:720-s.r,y2:360-s.b,className:"in-axis"}),m.jsx("line",{x1:s.l,y1:s.t,x2:s.l,y2:360-s.b,className:"in-axis"}),m.jsx("text",{x:(s.l+720-s.r)/2,y:352,className:"in-label",children:"days since last change →"}),m.jsx("text",{x:12,y:(s.t+360-s.b)/2,className:"in-label",transform:`rotate(-90 12 ${(s.t+360-s.b)/2})`,children:"reads / 30d →"}),m.jsx("text",{x:720-s.r-6,y:s.t+14,className:"in-quad in-quad-danger",textAnchor:"end",children:"hot + stale"}),m.jsx("text",{x:s.l+6,y:s.t+14,className:"in-quad",children:"hot + fresh"}),m.jsx("text",{x:720-s.r-6,y:360-s.b-8,className:"in-quad",textAnchor:"end",children:"cold + stale"}),m.jsx("text",{x:720-s.r-6,y:s.t+28,className:"in-label",textAnchor:"end",children:"dot size = agent share of reads"}),e.map(v=>{const b=v.total?(v.agent||0)/v.total:0;return m.jsx("circle",{cx:Number(h(v.days).toFixed(1)),cy:Number(y(v.reads).toFixed(1)),r:Number((3+4*b).toFixed(1)),className:"in-pt"+(v.danger?" danger":v.reads?"":" cold"),onClick:()=>n(v.path),children:m.jsx("title",{children:`${v.path} — ${v.reads} read${v.reads===1?"":"s"} / 30d · changed ${Math.round(v.days)}d ago`})},v.path)})]})}function eV({pts:e,lens:n,onOpenFile:r}){const o=e.filter(l=>l.reads>0).sort((l,u)=>u.reads-l.reads||u.days-l.days).slice(0,20);if(!o.length)return m.jsx("div",{className:"dl-empty",children:"No reads in the window yet."});const s=o[0].reads;return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"in-hotpath",children:o.map(l=>{const u=n==="agent"?1:n==="human"?0:l.total?l.agent/l.total:0,d=l.reads/s*100;return m.jsxs("div",{className:"in-hp-row",tabIndex:0,role:"button",title:l.danger?`${l.reads} read${l.reads===1?"":"s"}/30d · unchanged ${Math.round(l.days)}d — review this file`:l.path,onClick:()=>r(l.path),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),r(l.path))},children:[m.jsx("span",{className:"in-hp-name"+(l.danger?" danger":""),children:l.path+(l.danger?" ⚠":"")}),m.jsxs("span",{className:"in-hp-bar",children:[m.jsx("span",{className:"in-hp-agent",style:{width:(d*u).toFixed(1)+"%"}}),m.jsx("span",{className:"in-hp-human",style:{width:(d*(1-u)).toFixed(1)+"%"}})]}),m.jsx("span",{className:"in-hp-count",children:l.reads})]},l.path)})}),m.jsxs("p",{className:"in-legend",children:[m.jsx("span",{className:"in-sw agent"})," agent reads ",m.jsx("span",{className:"in-sw human"})," human reads"]})]})}function tV({devices:e}){const n=new Map;for(const b of e)for(const[x,C]of Object.entries(b.folders||{}))n.set(x,(n.get(x)||0)+C);const r=[...n.entries()].sort((b,x)=>x[1]-b[1]).slice(0,12).map(b=>b[0]),o=e.slice(0,12),s=140,l=6,u=Math.min(76,Math.max(34,(720-s-8)/r.length)),d=26,p=720,h=l+o.length*d+58,y=Math.max(1,...o.flatMap(b=>r.map(x=>(b.folders||{})[x]||0))),v=b=>{const x=[23,25,31],C=[245,166,35],_=x.map((E,T)=>Math.round(E+(C[T]-E)*b));return`rgb(${_[0]},${_[1]},${_[2]})`};return m.jsxs("svg",{viewBox:`0 0 ${p} ${h}`,className:"in-chart in-matrix",children:[o.map((b,x)=>{let C=b.name||b.id||"";return C.length>20&&(C=C.slice(0,19)+"…"),m.jsxs("g",{children:[m.jsx("text",{x:s-8,y:l+x*d+17,textAnchor:"end",className:"in-label",children:C}),r.map((_,E)=>{const T=(b.folders||{})[_]||0;return m.jsx("rect",{x:s+E*u,y:l+x*d,width:u-4,height:d-4,rx:3,fill:v(Math.sqrt(T/y)),children:m.jsx("title",{children:`${b.name||b.id} × ${_||"(root)"}: ${T} read${T===1?"":"s"}/30d`})},_)})]},b.id||x)}),r.map((b,x)=>{const C=s+x*u+(u-4)/2,_=l+o.length*d+14;return m.jsx("text",{x:C,y:_,className:"in-label",textAnchor:"end",transform:`rotate(-28 ${C} ${_})`,children:b||"(root)"},b)})]})}function nV(e){const{apiBase:n,target:r,isFolder:o,onMeta:s,onRendered:l,restore:u}=e,d=r?o(r)?{prefix:r+"/"}:{path:r}:{prefix:""},p="path"in d&&d.path!==void 0?"path="+encodeURIComponent(d.path):"prefix="+encodeURIComponent(d.prefix??""),{data:h,error:y}=Gt({queryKey:["history",n,p,200],queryFn:()=>cn(n+"history?"+p+"&n=200"),staleTime:15e3});if(w.useEffect(()=>{y&&s("History unavailable: "+y.message)},[y,s]),w.useEffect(()=>{h&&l?.()},[h,l]),!h)return null;const v=h.entries||[],b=!!r&&!o(r),x=_=>{for(let E=_+1;Ev[_].kind==="delete"?x(_):v[_].blob;return m.jsxs("div",{className:"history",children:[v.length===0&&m.jsx("div",{className:"empty",children:"No history yet."}),rV(v).map((_,E)=>_.run?m.jsx(iV,{run:_.run,onOpen:e.onOpen,apiBase:n,perFile:b,prevBlob:x,restoreSha:C,restore:u},"g"+E):m.jsx(cg,{entry:v[_.i],apiBase:n,onOpen:e.onOpen,diff:b?{apiBase:n,prev:x(_.i)}:void 0,restore:u,restoreSha:C(_.i)},"r"+_.i))]})}function rV(e){const n=new Map,r=[];return e.forEach((o,s)=>{if(!o.note){r.push({i:s});return}const l=o.note+"\0"+(o.device?.id??""),u=n.get(l);if(u){u.entries.push(o),u.idx.push(s);return}const d={note:o.note,entries:[o],idx:[s]};n.set(l,d),r.push({run:d,i:s})}),r.map(o=>o.run&&o.run.entries.length<2?{i:o.i}:o)}function iV({run:e,onOpen:n,apiBase:r,perFile:o,prevBlob:s,restoreSha:l,restore:u}){const[d,p]=w.useState(!0),h=e.entries[0],y=lg(h),v=[h.device.name||h.device.id,h.device.os].filter(Boolean).join(" · "),b=e.entries.map(_=>new Date(_.time).getTime()),x=oV(Math.min(...b),Math.max(...b)),C=e.entries.length;return m.jsxs("div",{className:"hrun"+(d?" open":""),children:[m.jsxs("div",{className:"hrun-head",children:[m.jsx("button",{type:"button",className:"hrun-toggle","aria-expanded":d,title:d?"Collapse this run":"Expand this run",onClick:()=>p(!d),children:m.jsx(yt,{name:d?"chevd":"chev"})}),m.jsx("span",{className:"hrun-note",children:m.jsx(MC,{text:e.note})}),m.jsxs("span",{className:"hrun-meta",children:[C," file",C===1?"":"s"," · ",y,v?" · "+v:""]}),m.jsx("span",{className:"hrun-time",children:x})]}),d&&m.jsx("div",{className:"hrun-body",children:e.entries.map((_,E)=>m.jsx(cg,{entry:_,apiBase:r,onOpen:n,diff:o?{apiBase:r,prev:s(e.idx[E])}:void 0,restore:u,restoreSha:l(e.idx[E]),inRun:!0},E))})]})}function oV(e,n){const r=new Date(e),o=new Date(n),s=u=>u.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});if(r.toDateString()!==o.toDateString())return r.toLocaleString()+" – "+o.toLocaleString();const l=o.toLocaleDateString();return e===n?l+" "+s(o):l+" "+s(r)+" – "+s(o)}function aV(e,n){return e?n(e)?e+"/ (folder)":e:"all changes"}function sV(e){const{apiBase:n,path:r,version:o}=e,s="path="+encodeURIComponent(r),{data:l}=Gt({queryKey:["history",n,s,200],queryFn:()=>cn(n+"history?"+s+"&n=200"),staleTime:15e3}),u=l?.entries?.find(y=>y.blob===o),d=u?lg(u):"",p=u?.time?new Date(u.time).toLocaleString():"",h=n+"blob?sha="+o+"&name="+encodeURIComponent(r.split("/").pop()||r)+"&download=1";return m.jsxs("div",{className:"vbanner",role:"status",children:[m.jsx("span",{className:"vb-icon",children:m.jsx(yt,{name:"clock"})}),m.jsxs("div",{className:"vb-text",children:[m.jsx("b",{children:[p&&"Version from "+p,d&&"by "+d].filter(Boolean).join(" ")||"Earlier version"}),m.jsx("span",{children:"This is not the current file."})]}),m.jsxs("div",{className:"vb-actions",children:[m.jsx("button",{className:"ai-btn",onClick:e.onViewCurrent,children:"View current"}),m.jsx("a",{className:"ai-btn",download:!0,href:h,children:"Download this version"})]})]})}function FC(e){const{config:n,apiBase:r,route:o,hub:s,project:l}=e,u=Hp(),d=jo(),{tree:p,flatFiles:h,dirIndex:y,loaded:v}=T$(r,!s||!!l),b=O$(r,s&&!!l&&!!n.reads?.enabled),x=s&&!!l&&!o.path&&!o.view,C=o.view==="dashboard"||x,_=QI(r,C);w.useEffect(()=>{C&&d.invalidateQueries({queryKey:["heat",r]})},[C,r,d]);const E=o.path,T=o.view?void 0:o.version,O=E||(o.view==="dashboard"||o.view==="history")&&o.viewTarget||"",A=!!E&&y.has(E),z=!!E&&v&&!A&&h.some(ze=>ze.path===E),L=!!E&&v&&!A&&!z,B=A&&!o.view,[H,I]=w.useState(()=>new Set),ne=w.useRef(!0);w.useEffect(()=>{if(!p||!ne.current)return;ne.current=!1;const ze=(p.children||[]).filter(ke=>ke.dir);ze.length===1&&I(ke=>new Set(ke).add(ze[0].path))},[p]),w.useEffect(()=>{!O||!v||I(ze=>{const ke=new Set(ze);for(const j of Q$(O))ke.add(j);return y.has(O)&&ke.add(O),ke})},[O,v,y]);const ve=w.useCallback(ze=>{I(ke=>{const j=new Set(ke);return j.has(ze)?j.delete(ze):j.add(ze),j})},[]),fe=w.useRef(null),ce=w.useRef(new Map),le=w.useRef({key:"",want:0,attempts:0});w.useEffect(()=>{le.current={key:u,want:u3()==="POP"?ce.current.get(u)??0:0,attempts:0}},[u]);const me=w.useCallback(()=>{const ze=fe.current,ke=le.current;!ze||ke.key!==u||ke.attempts>=3||(ke.attempts++,ze.scrollTo({top:ke.want,behavior:"instant"}))},[u]),xe=w.useCallback(()=>{fe.current&&ce.current.set(u,fe.current.scrollTop)},[u]),N=w.useCallback((ze,ke)=>{yn(Qu(ze,l?.id,ke)),mr()},[l?.id]),Z=w.useCallback(ze=>yn(bo("history",l?.id,ze)),[l?.id]),[re,W]=w.useState(""),[ee,D]=w.useState(null),[M,U]=w.useState(!1),[Q,K]=w.useState(!1);w.useEffect(()=>xD(()=>K(!0)),[]);const ae=w.useRef(null),J=e.panel??null,ge=!J&&s&&!!l&&z&&wo(l.perm,"write"),{data:ye}=y_(l?.id,s&&!!l),Ne=w.useCallback(()=>{d.invalidateQueries({queryKey:["shares",l?.id]})},[d,l?.id]),Fe=z?(ye||[]).filter(ze=>ze.path===E):[],Ue=!J&&s&&!!l,ht=!J&&z,Je=!J&&(z||s&&!!l&&A),xn=T?r+"blob?sha="+T+"&name="+encodeURIComponent(E)+"&download=1":r+"download?path="+encodeURIComponent(E),dn=w.useCallback(async()=>{try{const ze=await fetch(r+"shares",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:E})});if(!ze.ok)throw new Error(await ze.text());const ke=await ze.json();Ew("share_created");const j=await Ha(ke.url);D({url:ke.url,copied:j}),Ne()}catch(ze){Qe("Share failed: "+ze.message,!0)}},[r,E,Ne]),[Xt,or]=w.useState(""),Ht=s&&!!l&&wo(l?.perm,"write"),ar=w.useCallback(async(ze,ke)=>{or(ze+ke);try{await Ia(r+"restore",{path:ze,sha:ke}),d.invalidateQueries({queryKey:["history",r]}),d.invalidateQueries({queryKey:["tree",r]}),d.invalidateQueries({queryKey:["render",r,ze]}),d.invalidateQueries({queryKey:["text"]}),Qe("Restored "+ze+" — it syncs to every device like any other change.")}catch(j){Qe("Restore failed: "+j.message,!0)}finally{or("")}},[r,d]),Bn=w.useCallback(()=>{if(!E)return Z("");Z(A?E+"/":E)},[E,A,Z]);w.useEffect(()=>{const ze=ke=>{(ke.metaKey||ke.ctrlKey)&&ke.key.toLowerCase()==="k"&&(ke.preventDefault(),K(j=>!j))};return window.addEventListener("keydown",ze),()=>window.removeEventListener("keydown",ze)},[]);const zt=w.useCallback(()=>{const ze=[],ke=(j,V,F,se)=>ze.push({icon:j,label:V,kind:F,run:se});if(s&&l&&E&&(z&&ke("share","Share: "+E,"action",dn),ke("hist","History: "+E,"action",Bn),z&&ke("download","Download: "+E,"action",()=>ae.current?.click())),s&&l&&ke("hist","History: whole project","action",()=>Z("")),s)for(const j of e.projects||[])(!l||j.id!==l.id)&&ke("folder","Switch to project: "+j.name,"project",()=>yn("/"+j.id));n.auth?.enabled&&ke("power","Sign out","action",()=>window.location.href="/auth/logout");for(const j of y.keys())ke("folder",j,"folder",()=>N(j));for(const j of h)ke("doc",j.path,"file",()=>N(j.path));return ze},[s,l,E,z,n.auth?.enabled,y,h,e.projects,dn,Bn,Z,N]);w.useEffect(()=>{if(!M)return;const ze=()=>U(!1);return document.addEventListener("click",ze),()=>document.removeEventListener("click",ze)},[M]);const pn=w.useCallback(ze=>y.has(ze),[y]);let jt="app",Dr,kt;J?kt=J.body:o.view==="dashboard"?kt=m.jsx(dw,{flatFiles:h,heatMap:b,devices:_,scope:o.viewTarget||"",onOpenFile:N,onOpenFolder:N,isFolder:pn}):o.view==="history"?kt=m.jsx(nV,{apiBase:r,target:o.viewTarget||"",isFolder:pn,onOpen:N,onMeta:W,onRendered:me,restore:Ht?{onRestore:ar,busy:Xt}:void 0}):E?v?L?kt=m.jsxs("div",{className:"notfound",children:[m.jsx("h1",{children:"Couldn't find that"}),m.jsxs("p",{children:[m.jsx("code",{children:E})," isn't in this project right now."]}),m.jsx("p",{className:"nf-sub",children:"If it was just created, it may still be uploading or syncing from a teammate's device — this page checks again automatically every few seconds, so refresh or come back in a moment."}),m.jsx("button",{className:"pbtn",onClick:()=>d.invalidateQueries({queryKey:["tree",r]}),children:"Check again"})]}):A?kt=m.jsx(sI,{node:y.get(E),heatMap:b,hub:s&&!!l,apiBase:r,onOpen:N,onFullHistory:Z,onRendered:me}):(jt=vC.test(E)?"wide":"read",Dr="markdown",kt=m.jsxs(m.Fragment,{children:[T&&m.jsx(sV,{apiBase:r,path:E,version:T,onViewCurrent:()=>N(E)}),m.jsx(cI,{apiBase:r,path:E,version:T,heatMap:b,flatFiles:h,onOpenFile:N,onMeta:W,onRendered:me})]})):kt=m.jsx("div",{className:"empty",children:"Loading…"}):x?kt=m.jsxs(m.Fragment,{children:[m.jsx(jC,{project:l}),m.jsx("div",{className:"home-insights",children:m.jsx(dw,{flatFiles:h,heatMap:b,devices:_,onOpenFile:N,onOpenFolder:N,isFolder:pn})})]}):kt=m.jsx("div",{className:"empty",children:"Select a file to read it."});const oi=J?J.crumb:E?m.jsx(X$,{path:E,onOpenFolder:N}):o.view==="dashboard"?"Dashboard — "+(o.viewTarget||l?.name||""):o.view==="history"?"History — "+aV(o.viewTarget||"",pn):x?l.name:null,br=m.jsx(sl,{crumb:oi,meta:re,actions:m.jsxs(m.Fragment,{children:[ge&&m.jsx(Ct,{id:"share-btn",variant:"toolbar",className:"icon-only",title:"Share","aria-label":"Share",onClick:dn,children:m.jsx(yt,{name:"share"})}),Ue&&!E&&!o.view&&m.jsxs(Ct,{id:"history-btn",variant:"toolbar",onClick:Bn,children:[m.jsx(yt,{name:"hist"})," ",m.jsx("span",{className:"lbl",children:"History"})]}),ht&&m.jsx("a",{id:"download",hidden:!0,download:!0,href:xn,ref:ae,children:"Download"}),Je&&m.jsx(Ct,{id:"more-btn",variant:"toolbar",className:"icon-only",title:"More actions","aria-label":"More actions",onClick:ze=>{ze.stopPropagation(),U(!M)},children:m.jsx(yt,{name:"dots"})}),M&&m.jsxs("div",{id:"more-menu",role:"menu",children:[Ue&&m.jsx("button",{className:"more-item",onClick:Bn,children:"History"}),ht&&m.jsx("button",{className:"more-item",onClick:()=>ae.current?.click(),children:"Download"}),s&&!!l&&m.jsx("button",{className:"more-item",onClick:()=>{e.onClosePanel?.(),yn(bo("dashboard",l?.id,E))},children:"Dashboard"})]})]})});return m.jsxs(m.Fragment,{children:[m.jsx(al,{vault:e.sidebar.vault,projectsNav:e.sidebar.projectsNav,orgBar:e.sidebar.orgBar,tree:m.jsx(Y$,{root:p,expanded:H,onToggle:ve,currentPath:O,listingShowing:B,onOpen:N}),topbar:br,contentRef:fe,onContentScroll:xe,children:m.jsxs(vu,{width:jt,className:Dr,children:[!J&&z&&m.jsx(yI,{shares:Fe,canRevoke:!!l&&wo(l.perm,"write"),onChanged:Ne}),kt]})}),ee&&m.jsx(vI,{url:ee.url,copied:ee.copied,onClose:()=>{D(null),Ne()}}),m.jsx(YI,{open:Q,onClose:()=>K(!1),candidates:zt})]})}function lV({config:e}){const n=Hp(),r=Pp(),[o,s]=w.useState(null),[l,u]=w.useState(null);w.useEffect(()=>u(null),[n]);const d=w.useMemo(()=>{const I=n.split("?")[0].match(/^\/join\/([0-9a-f]+)\/?$/);return I?I[1]:null},[n]),{data:p}=i3(!d),{data:h}=o3(!d),y=!!e.auth.admin,{data:v}=b_(y),b=w.useMemo(()=>w_(n,"hub"),[n]),x=w.useMemo(()=>p&&(p.find(I=>I.id===b.project)||o&&p.find(I=>I.org===o)||p[0])||null,[p,b.project,o]);if(w.useEffect(()=>{document.title=x?x.name+" — BearDrive":e.brand||"BearDrive"},[x,e]),d)return m.jsx(cV,{token:d,onDone:async I=>{s(I),await r(),yn("/",{replace:!0})}});const C=e.brand||"BearDrive",_=x&&h?.find(I=>I.id===x.org)||null,E=m.jsx(Zu,{name:C,onHome:()=>yn("/"),search:!!x}),T=e.me?m.jsx(v$,{me:e.me,org:_,orgActive:!!b.org,billing:e.billing,admin:y?{pending:v?.length||0,onClick:()=>{u({kind:"hub"}),mr()}}:void 0}):void 0;if(!p||!h)return m.jsx(al,{vault:E,topbar:m.jsx(sl,{}),children:m.jsx(vu,{children:m.jsx("div",{className:"empty",children:"Loading…"})})});if(!x)return m.jsx(al,{vault:E,projectsNav:m.jsx(Wx,{projects:p}),orgBar:T,topbar:m.jsx(sl,{}),children:m.jsx(vu,{children:m.jsx(R$,{})})});const O=l?.kind==="hub"?{crumb:"Signup & access",body:m.jsx(c$,{})}:null,A=b.org?h.find(I=>I.id===b.org):null,L=b.org&&!A?{crumb:"Organization",body:m.jsxs("div",{className:"empty",children:[m.jsx("h3",{children:"Organization not found"}),m.jsx("p",{children:"This organization doesn't exist, or you're no longer a member."}),m.jsx("p",{children:m.jsxs("a",{...yu("/"+x.id),children:["Back to ",x.name]})})]})}:A?{crumb:"Organization",body:m.jsx(a$,{org:A,projects:p,myEmail:e.me?.email||""})}:null,B=b.billing?{crumb:"Billing",body:e.billing?m.jsx(y$,{url:e.billing.url}):m.jsxs("div",{className:"empty",children:[m.jsx("h3",{children:"No billing on this hub"}),m.jsx("p",{children:"This BearDrive hub doesn't have a billing surface."})]})}:null,H=b.view==="settings"?{crumb:"Project settings",body:m.jsx(S$,{project:x,org:_,onDeleted:async()=>{await r(),yn("/")}})}:b.view==="install"?{crumb:"Installation",body:m.jsx(jC,{project:x})}:null;return!b.org&&!b.billing&&b.project!==x.id?m.jsx(iu,{to:"/"+x.id}):b.legacyView&&b.view?m.jsx(iu,{to:bo(b.view,x.id,b.viewTarget)}):b.trailingSlash&&b.path?m.jsx(iu,{to:Qu(b.path,x.id,b.version)}):m.jsx(FC,{config:e,apiBase:"/api/p/"+x.id+"/",route:b,hub:!0,project:x,projects:p,sidebar:{vault:E,projectsNav:m.jsx(Wx,{projects:p,currentId:x.id,menu:{active:l?null:b.view==="dashboard"&&!b.viewTarget?"dashboard":b.view==="install"?"install":b.view==="history"&&!b.viewTarget?"history":b.view==="settings"?"settings":null,onDashboard:()=>{u(null),yn(bo("dashboard",x.id)),mr()},onInstall:()=>{u(null),yn(bo("install",x.id)),mr()},onHistory:()=>{u(null),yn(bo("history",x.id)),mr()},onSettings:()=>{u(null),yn(bo("settings",x.id)),mr()}}}),orgBar:T},panel:O||L||B||H,onClosePanel:()=>u(null)},x.id)}function cV({token:e,onDone:n}){return w.useEffect(()=>{let r=!1;return Ia("/api/invites/"+e).then(o=>{r||(Qe(`Welcome — you joined the “${o.org.name}” team. Opening its projects…`),n(o.org.id))}).catch(o=>{r||String(o.message).includes("signing in")||(Qe("Could not accept the invite: "+o.message,!0),n(null))}),()=>{r=!0}},[e]),m.jsx(al,{vault:m.jsx(Zu,{name:"BearDrive"}),topbar:m.jsx(sl,{}),children:m.jsx(vu,{children:m.jsx("div",{className:"empty",children:"Joining…"})})})}function uV({config:e}){const n=Hp(),r=e.volume||"BearDrive";w.useEffect(()=>{document.title=e.brand||r},[e,r]);const o=w.useMemo(()=>w_(n,"volume"),[n]);return o.trailingSlash&&o.path?m.jsx(iu,{to:Qu(o.path)}):m.jsx(FC,{config:e,apiBase:"/api/",route:o,hub:!1,sidebar:{vault:m.jsx(Zu,{name:r,showSignout:e.auth.enabled,search:!0})}})}function dV(){const{data:e}=Q2();return m.jsxs(gD,{delayDuration:150,children:[e?e.mode==="hub"?m.jsx(lV,{config:e}):m.jsx(uV,{config:e}):m.jsx(al,{vault:m.jsx(Zu,{name:"…",showSignout:!1}),topbar:m.jsx(sl,{}),children:m.jsx("div",{className:"empty",children:"Loading…"})}),m.jsx(Qk,{}),m.jsx(t3,{})]})}const fV=new D2({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});s2.createRoot(document.getElementById("root")).render(m.jsx(w.StrictMode,{children:m.jsx(z2,{client:fV,children:m.jsx(dV,{})})}));
+bdrive init --project `+e.id;return h.jsxs("div",{className:"guide",children:[h.jsxs("h1",{className:"in-title gd-head",children:[h.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:ul(e.name)},children:h.jsx(ka,{name:e.icon})}),e.name]}),e.description&&h.jsx("p",{className:"in-desc",children:e.description}),h.jsxs("div",{className:"gd-body",children:[h.jsx("p",{className:"gd-desc",children:"Paste into your coding agent — Claude Code, Cowork, Codex, Gemini CLI, Hermes — in the folder where you want the files:"}),h.jsx(qm,{code:r}),h.jsx("p",{className:"gd-desc",children:"The agent installs the CLI, signs this machine in, and registers the sync hooks — asking before anything it changes."}),h.jsxs("details",{className:"gd-manual",children:[h.jsx("summary",{children:"What exactly happens"}),h.jsxs("ul",{className:"gd-desc gd-list",children:[h.jsx("li",{children:"Sign-in uses a device code you approve in this browser — the folder itself never holds credentials."}),h.jsx("li",{children:"Sync hooks pull the latest before every agent turn, push edits seconds after they happen, and stamp each change with the session that made it; agent reads feed Insights. They register once per machine in your agent's own config, so every session is covered and nothing is written into the synced folder."}),h.jsx("li",{children:"Codex hooks are off by default: set [features] codex_hooks = true in ~/.codex/config.toml."})]})]}),h.jsxs("details",{className:"gd-manual",children:[h.jsx("summary",{children:"Or run it yourself"}),h.jsx("p",{className:"gd-desc",children:"Same result, in the folder you want the files. One command: init signs this device in, registers the sync hooks and starts syncing."}),h.jsx(qm,{code:o}),h.jsx("p",{className:"gd-desc",children:h.jsx("a",{href:"https://docs.beardrive.ai/manual/install/",target:"_blank",rel:"noreferrer",children:"Full manual setup guide →"})})]})]})]})}function qm({code:e}){const[n,r]=w.useState("Copy");return h.jsxs("pre",{className:"gd-code",children:[h.jsx("code",{children:e}),h.jsx("button",{className:"gd-copy",onClick:async()=>{r(await Ha(e)?"Copied":"Copy failed"),setTimeout(()=>r("Copy"),1400)},children:n})]})}function O$(){return h.jsxs("div",{className:"onboard",children:[h.jsx("h1",{children:"Welcome to BearDrive"}),h.jsx("p",{children:"You're signed in, but you're not part of any project yet."}),h.jsxs("div",{className:"ob-card",children:[h.jsx("h3",{children:"Connect a new drive to your project"}),h.jsx("p",{children:"Paste into your coding agent — Claude Code, Cowork, Codex, Gemini CLI, Hermes — in the folder where you want the files. It creates the project and starts syncing:"}),h.jsx(qm,{code:"Follow "+OC+`
+to set up a new BearDrive project on `+window.location.origin+". Ask me which folder to sync."}),h.jsx("p",{className:"ob-alt",children:h.jsx("a",{href:"https://docs.beardrive.ai/manual/setup-by-hand/",target:"_blank",rel:"noreferrer",children:"Or start a project manually →"})})]})]})}function j$(e,n=!0){const r=Gt({queryKey:["tree",e],queryFn:()=>cn(e+"tree"),enabled:n,refetchInterval:15e3}),o=w.useMemo(()=>{const s=[],l=new Map,u=d=>{for(const p of d.children||[])p.dir?(l.set(p.path,p),u(p)):s.push(p)};return r.data&&u(r.data),{flatFiles:s,dirIndex:l}},[r.data]);return{tree:r.data,...o,loaded:!!r.data}}function A$(e,n){return Gt({queryKey:["heat",e],queryFn:()=>cn(e+"heat?days=30"),enabled:n,staleTime:6e4,refetchInterval:6e4}).data?.entries??null}function M$(e,n,r){return Gt({queryKey:["history",e,"prefix",n,20],queryFn:()=>cn(e+"history?prefix="+encodeURIComponent(n)+"&n=20"),enabled:r,staleTime:15e3}).data?.entries??null}function nw(e,n,r){if(!e)return null;if(!r)return e[n]||null;const o={human:0,agent:0,share:0};for(const[s,l]of Object.entries(e))s.startsWith(n+"/")&&(o.human+=l.human||0,o.agent+=l.agent||0,o.share+=l.share||0);return o.human||o.agent||o.share?o:null}function dl(e){return(e.human||0)+(e.agent||0)+(e.share||0)}function Ks(e){const n=dl(e);if(!n)return"";const r=n+(n===1?" read":" reads");if(!e.agent&&!e.share)return r;const o=[];return e.human&&o.push(e.human+" human"),e.agent&&o.push(e.agent+" agent"),e.share&&o.push(e.share+" shared"),r+" ("+o.join(", ")+")"}function N$(e){const n=dl(e);return n?n<3?1:n<10?2:n<30?3:4:0}function D$(e,n,r){const o=new Array(e);return new Proxy(o,{get(s,l,u){if(typeof l=="string"){const d=l.charCodeAt(0);if(d>=48&&d<=57){const p=+l;if(Number.isInteger(p)&&p>=0&&po[y]!==m))&&(o=d,s=n(...d),r?.onChange&&!(l&&r.skipInitialOnChange)&&r.onChange(s),l=!1),s}return u.updateDeps=d=>{o=d},u}function rw(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const z$=(e,n)=>Math.abs(e-n)<1.01,k$=(e,n,r)=>{let o;return function(...s){e.clearTimeout(o),o=e.setTimeout(()=>n.apply(this,s),r)}};let Hs;const em=()=>{if(Hs!==void 0)return Hs;if(typeof navigator>"u")return Hs=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Hs=!0;const e=navigator.maxTouchPoints;return Hs=navigator.platform==="MacIntel"&&e!==void 0&&e>0},iw=e=>{const{offsetWidth:n,offsetHeight:r}=e;return{width:n,height:r}},L$=e=>e,$$=e=>{const n=Math.max(e.startIndex-e.overscan,0),o=Math.min(e.endIndex+e.overscan,e.count-1)-n+1,s=new Array(o);for(let l=0;l{const r=e.scrollElement;if(!r)return;const o=e.targetWindow;if(!o)return;const s=u=>{const{width:d,height:p}=u;n({width:Math.round(d),height:Math.round(p)})};if(s(iw(r)),!o.ResizeObserver)return()=>{};const l=new o.ResizeObserver(u=>{const d=()=>{const p=u[0];if(p?.borderBoxSize){const m=p.borderBoxSize[0];if(m){s({width:m.inlineSize,height:m.blockSize});return}}s(iw(r))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(d):d()});return l.observe(r,{box:"border-box"}),()=>{l.unobserve(r)}},Eu={passive:!0},V$=typeof window>"u"?!0:"onscrollend"in window,F$=(e,n,r)=>{const o=e.scrollElement;if(!o)return;const s=e.targetWindow;if(!s)return;const l=e.options.useScrollendEvent&&V$;let u=0;const d=l?null:k$(s,()=>n(u,!1),e.options.isScrollingResetDelay),p=v=>()=>{u=r(o),d?.(),n(u,v)},m=p(!0),y=p(!1);return o.addEventListener("scroll",m,Eu),l&&o.addEventListener("scrollend",y,Eu),()=>{o.removeEventListener("scroll",m),l&&o.removeEventListener("scrollend",y)}},P$=(e,n)=>F$(e,n,r=>{const{horizontal:o,isRtl:s}=e.options;return o?r.scrollLeft*(s&&-1||1):r.scrollTop}),U$=(e,n,r)=>{if(r.options.useCachedMeasurements){const o=r.indexFromElement(e),s=r.options.getItemKey(o);return r.itemSizeCache.get(s)??r.options.estimateSize(o)}if(n?.borderBoxSize){const o=n.borderBoxSize[0];if(o)return Math.round(o[r.options.horizontal?"inlineSize":"blockSize"])}if(!n){const o=r.indexFromElement(e),s=r.options.getItemKey(o),l=r.itemSizeCache.get(s);if(l!==void 0)return l}return e[r.options.horizontal?"offsetWidth":"offsetHeight"]},H$=(e,{adjustments:n=0,behavior:r},o)=>{var s,l;(l=(s=o.scrollElement)==null?void 0:s.scrollTo)==null||l.call(s,{[o.options.horizontal?"left":"top"]:e+n,behavior:r})},B$=H$;class q${constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var r,o,s;return((s=(o=(r=this.targetWindow)==null?void 0:r.performance)==null?void 0:o.now)==null?void 0:s.call(o))??Date.now()},this.observer=(()=>{let r=null;const o=()=>r||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:r=new this.targetWindow.ResizeObserver(s=>{s.forEach(l=>{const u=()=>{const d=l.target,p=this.indexFromElement(d);if(!d.isConnected){this.observer.unobserve(d);for(const[m,y]of this.elementsCache)if(y===d){this.elementsCache.delete(m);break}return}this.shouldMeasureDuringScroll(p)&&this.resizeItem(p,this.options.measureElement(d,l,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(u):u()})}));return{disconnect:()=>{var s;(s=o())==null||s.disconnect(),r=null},observe:s=>{var l;return(l=o())==null?void 0:l.observe(s,{box:"border-box"})},unobserve:s=>{var l;return(l=o())==null?void 0:l.unobserve(s)}}})(),this.range=null,this.setOptions=r=>{var o,s;const l={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:L$,rangeExtractor:$$,onChange:()=>{},measureElement:U$,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const b in r){const x=r[b];x!==void 0&&(l[b]=x)}const u=this.options;let d=null,p=null,m=!1;if(u!==void 0&&u.enabled&&l.enabled&&l.anchorTo==="end"&&this.scrollElement!==null){const b=u.count,x=l.count,C=this.getMeasurements(),_=b>0?((o=C[0])==null?void 0:o.key)??u.getItemKey(0):null,E=b>0?((s=C[b-1])==null?void 0:s.key)??u.getItemKey(b-1):null;if(x!==b||b>0&&x>0&&(l.getItemKey(0)!==_||l.getItemKey(x-1)!==E)){m=!0;const A=b>0?this.getVirtualItemForOffset(this.getScrollOffset())??C[0]:null;A&&(d=[A.key,this.getScrollOffset()-A.start]);const z=l.followOnAppend===!0?"auto":l.followOnAppend||null;z&&x>b&&this.isAtEnd(u.scrollEndThreshold)&&(b===0||l.getItemKey(x-1)!==E)&&(p=z)}}this.options=l,m&&(this.pendingMin=0,this.itemSizeCacheVersion++);let y=!1,v=0;if(d&&this.scrollOffset!==null){const[b,x]=d,C=this.getMeasurements(),{count:_,getItemKey:E}=this.options;let T=0;for(;T<_&&E(T)!==b;)T++;if(T<_){const O=C[T];if(O){const A=O.start+x;A!==this.scrollOffset&&(v=A-this.scrollOffset,this.scrollOffset=A,y=!0)}}}(y||p)&&(this.pendingScrollAnchor=[y?d[0]:null,y?d[1]:0,p,v])},this.notify=r=>{var o,s;(s=(o=this.options).onChange)==null||s.call(o,this,r)},this.maybeNotify=Ta(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),r=>{this.notify(r)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(r=>r()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var r;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}if(this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((r=this.scrollElement)==null?void 0:r.window)??null,this.elementsCache.forEach(l=>{this.observer.observe(l)}),this.unsubs.push(this.options.observeElementRect(this,l=>{this.scrollRect=l,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(l,u)=>{if(u&&this._intendedScrollOffset===null&&l===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(l-this._intendedScrollOffset)<1.5&&(l=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const d=this.getScrollOffset();this.scrollDirection=u?d===l?this.scrollDirection:d{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},d=()=>{this._iosTouching=!1,!(!em()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};l.addEventListener("touchstart",u,Eu),l.addEventListener("touchend",d,Eu),this.unsubs.push(()=>{l.removeEventListener("touchstart",u),l.removeEventListener("touchend",d),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[l,u,d,p]=s;l!==null&&!d&&(em()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?p!==0&&(this._iosDeferredAdjustment+=p):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),d&&this.scrollToEnd({behavior:d})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const r=this.getScrollOffset(),o=this.getMaxScrollOffset();if(r<0||r>o)return;const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(r,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Ta(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(r,o,s,l,u,d,p,m)=>(this.prevLanes!==void 0&&this.prevLanes!==d&&(this.lanesChangedFlag=!0),this.prevLanes=d,this.pendingMin=null,{count:r,paddingStart:o,scrollMargin:s,getItemKey:l,enabled:u,lanes:d,laneAssignmentMode:p,gap:m}),{key:!1}),this.getMeasurements=Ta(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:r,paddingStart:o,scrollMargin:s,getItemKey:l,enabled:u,lanes:d,laneAssignmentMode:p,gap:m},y)=>{const v=this.itemSizeCache;if(!u)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>r)for(const T of this.laneAssignments.keys())T>=r&&this.laneAssignments.delete(T);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(T=>{this.itemSizeCache.set(T.key,T.size)}));const b=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===r&&(this.lanesSettling=!1),d===1){const T=r*2;let O=this._flatMeasurements;if(!O||O.length0&&L.set(O.subarray(0,b*2)),O=L,this._flatMeasurements=O}let A;if(b===0)A=o+s;else{const L=b-1;A=O[L*2]+O[L*2+1]+m}for(let L=b;L1){z=A;const ve=C[z],fe=ve!==void 0?x[ve]:void 0;L=fe?fe.end+m:o+s}else if(E===d){let ve=0,fe=_[0],ce=C[0];for(let le=1;lethis.options.debug}),this.calculateRange=Ta(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(r,o,s,l)=>r.length===0||o===0?(this.range=null,null):(this.range=Z$(r,o,s,l,l===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ta(()=>{let r=null,o=null;const s=this.calculateRange();return s&&(r=s.startIndex,o=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,r,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,r,o]},(r,o,s,l,u)=>l===null||u===null?[]:r({startIndex:l,endIndex:u,overscan:o,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=r=>{const o=this.options.indexAttribute,s=r.getAttribute(o);return s?parseInt(s,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=r=>{var o;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((o=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:o.index);if(s!==void 0&&this.range){const l=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),u=Math.max(0,s-l),d=Math.min(this.options.count-1,s+l);return r>=u&&r<=d}return!0},this.measureElement=r=>{if(!r){this.elementsCache.forEach((u,d)=>{u.isConnected||(this.observer.unobserve(u),this.elementsCache.delete(d))});return}const o=this.indexFromElement(r),s=this.options.getItemKey(o),l=this.elementsCache.get(s);l!==r&&(l&&this.observer.unobserve(l),this.observer.observe(r),this.elementsCache.set(s,r)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(o)&&this.resizeItem(o,this.options.measureElement(r,void 0,this))},this.resizeItem=(r,o)=>{var s,l;if(r<0||r>=this.options.count)return;let u,d,p;const m=this._flatMeasurements;if(this.options.lanes===1&&m!==null)p=this.options.getItemKey(r),d=m[r*2],u=m[r*2+1];else{const b=this.measurementsCache[r];if(!b)return;p=b.key,d=b.start,u=b.size}const y=this.itemSizeCache.get(p)??u,v=o-y;if(v!==0){const b=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,x=b?this.getTotalSize():0,C=((l=this.scrollState)==null?void 0:l.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[r]??{index:r,key:p,start:d,size:u,end:d+u,lane:0},v,this):d[this.getVirtualIndexes(),this.getMeasurements()],(r,o)=>{const s=[];for(let l=0,u=r.length;lthis.options.debug}),this.getVirtualItemForOffset=r=>{const o=this.getMeasurements();if(o.length===0)return;const s=this._flatMeasurements,l=this.options.lanes===1&&s!=null,u=AC(0,o.length-1,l?d=>s[d*2]:d=>rw(o[d]).start,r);return rw(o[u])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const r=this.scrollElement.document.documentElement;return this.options.horizontal?r.scrollWidth-this.scrollElement.innerWidth:r.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(r=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=r,this.getOffsetForAlignment=(r,o,s=0)=>{if(!this.scrollElement)return 0;const l=this.getSize(),u=this.getScrollOffset();o==="auto"&&(o=r>=u+l?"end":"start"),o==="center"?r+=(s-l)/2:o==="end"&&(r-=l);const d=this.getMaxScrollOffset();return Math.max(Math.min(d,r),0)},this.getOffsetForIndex=(r,o="auto")=>{r=Math.max(0,Math.min(r,this.options.count-1));const s=this.getSize(),l=this.getScrollOffset(),u=this.measurementsCache[r];if(!u)return;if(o==="auto")if(u.end>=l+s-this.options.scrollPaddingEnd)o="end";else if(u.start<=l+this.options.scrollPaddingStart)o="start";else return[l,o];if(o==="end"&&r===this.options.count-1)return[this.getMaxScrollOffset(),o];const d=o==="end"?u.end+this.options.scrollPaddingEnd:u.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(d,o,u.size),o]},this.scrollToOffset=(r,{align:o="start",behavior:s="auto"}={})=>{const l=this.getOffsetForAlignment(r,o),u=this.now();this.scrollState={index:null,align:o,behavior:s,startedAt:u,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(r,{align:o="auto",behavior:s="auto"}={})=>{r=Math.max(0,Math.min(r,this.options.count-1));const l=this.getOffsetForIndex(r,o);if(!l)return;const[u,d]=l,p=this.now();this.scrollState={index:r,align:d,behavior:s,startedAt:p,lastTargetOffset:u,stableFrames:0},this._scrollToOffset(u,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(r,{behavior:o="auto"}={})=>{const s=this.getScrollOffset()+r,l=this.now();this.scrollState={index:null,align:"start",behavior:o,startedAt:l,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:r="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:r});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:r})},this.getTotalSize=()=>{var r;const o=this.getMeasurements();let s;if(o.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const l=o.length-1,u=this._flatMeasurements;u!=null?s=u[l*2]+u[l*2+1]:s=((r=o[l])==null?void 0:r.end)??0}else{const l=Array(this.options.lanes).fill(null);let u=o.length-1;for(;u>=0&&l.some(d=>d===null);){const d=o[u];l[d.lane]===null&&(l[d.lane]=d.end),u--}s=Math.max(...l.filter(d=>d!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const r=[];if(this.itemSizeCache.size===0)return r;const o=this.getMeasurements();for(const s of o)s&&this.itemSizeCache.has(s.key)&&r.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return r},this._scrollToOffset=(r,{adjustments:o,behavior:s})=>{this._intendedScrollOffset=r+(o??0),this.options.scrollToFn(r,{behavior:s,adjustments:o},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(n)}applyScrollAdjustment(n,r){n!==0&&(em()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=n:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:r}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const o=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=o?o[0]:this.scrollState.lastTargetOffset,l=1,u=s!==this.scrollState.lastTargetOffset;if(!u&&z$(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=l){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,u){const d=this.getSize()||600,p=Math.abs(s-this.getScrollOffset()),m=this.scrollState.behavior==="smooth"&&p>d;this.scrollState.lastTargetOffset=s,m||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:m?"smooth":"auto"})}this.scheduleScrollReconcile()}}const AC=(e,n,r,o)=>{for(;e<=n;){const s=(e+n)/2|0,l=r(s);if(lo)n=s-1;else return s}return e>0?e-1:0};function G$(e,n,r){let o=0;for(;o<=n;){const s=(o+n)/2|0,l=e[s*2];if(lr)n=s-1;else return s}return o>0?o-1:0}function Z$(e,n,r,o,s){const l=e.length-1;if(e.length<=o)return{startIndex:0,endIndex:l};if(o===1&&s!==null){const m=G$(s,l,r);let y=m;const v=r+n;for(;ye[m].start,r),p=d;if(o===1)for(;p1){const m=Array(o).fill(0);for(;pv=0&&y.some(v=>v>=r);){const v=e[d];y[v.lane]=v.start,d--}d=Math.max(0,d-d%o),p=Math.min(l,p+(o-1-p%o))}return{startIndex:d,endIndex:p}}const tm=typeof document<"u"?w.useLayoutEffect:w.useEffect;function K$({useFlushSync:e=!0,directDomUpdates:n=!1,directDomUpdatesMode:r="transform",...o}){const s=w.useReducer(m=>m+1,0)[1],l=w.useRef({enabled:n,mode:r,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});l.current.enabled=n,l.current.mode=r;const u=m=>{const y=l.current;if(!y.enabled||!y.container)return;const v=m.getTotalSize();if(v!==y.lastSize){y.lastSize=v;const T=m.options.horizontal?"width":"height";y.container.style[T]=`${v}px`}const b=!!m.options.horizontal,x=y.mode==="transform",C=b?"left":"top",_=m.options.scrollMargin,E=m.getVirtualItems();for(const T of E){const O=T.start-_,A=m.elementsCache.get(T.key);A&&y.lastPositions.get(A)!==O&&(y.lastPositions.set(A,O),x?A.style.transform=b?`translate3d(${O}px, 0, 0)`:`translate3d(0, ${O}px, 0)`:A.style[C]=`${O}px`)}},d={...o,onChange:(m,y)=>{var v;const b=l.current;let x=!0;if(b.enabled){u(m);const C=m.range,_=b.prevRange;x=!_||_.isScrolling!==m.isScrolling||_.startIndex!==C?.startIndex||_.endIndex!==C?.endIndex,x&&(b.prevRange=C?{startIndex:C.startIndex,endIndex:C.endIndex,isScrolling:m.isScrolling}:null)}x&&(e&&y?Ao.flushSync(s):s()),(v=o.onChange)==null||v.call(o,m,y)}},[p]=w.useState(()=>{const m=new q$(d);return Object.assign(m,{containerRef:y=>{const v=l.current;if(v.container=y,v.lastSize=null,y&&v.enabled){const b=m.getTotalSize();v.lastSize=b;const x=m.options.horizontal?"width":"height";y.style[x]=`${b}px`}}})});return p.setOptions(d),tm(()=>p._didMount(),[]),tm(()=>p._willUpdate()),tm(()=>{u(p)}),p}function Y$(e){return K$({observeElementRect:I$,observeElementOffset:P$,scrollToFn:B$,...e})}function Q$(e,n){const r=[],o=(s,l)=>{for(const u of s)r.push({node:u,depth:l}),u.dir&&n.has(u.path)&&o(u.children||[],l+1)};return o(e?.children||[],0),r}function X$(e){const{root:n,expanded:r,onToggle:o,currentPath:s,listingShowing:l,onOpen:u}=e,d=w.useRef(null),p=w.useMemo(()=>Q$(n,r),[n,r]),m=Y$({count:p.length,getScrollElement:()=>d.current,estimateSize:()=>window.matchMedia("(max-width: 768px)").matches?44:28,overscan:12,getItemKey:y=>p[y].node.path});return w.useEffect(()=>{if(!s)return;const y=p.findIndex(v=>v.node.path===s);y>=0&&m.scrollToIndex(y,{align:"auto"})},[s,p]),h.jsx("nav",{id:"tree","aria-label":"Files",ref:d,children:h.jsx("div",{style:{height:m.getTotalSize(),position:"relative"},children:m.getVirtualItems().map(y=>{const{node:v,depth:b}=p[y.index],x=v.dir?r.has(v.path):!1,C=()=>{if(v.dir&&s===v.path&&l){o(v.path);return}u(v.path),v.dir||mr()};return h.jsxs("div",{className:"row "+(v.dir?"dir":"file")+(s===v.path?" active":"")+(v.dir&&!x?" collapsed":""),"data-path":v.path,tabIndex:0,role:"button",title:v.name,"aria-expanded":v.dir?x:void 0,style:{position:"absolute",top:0,left:0,right:0,transform:`translateY(${y.start}px)`,paddingLeft:8+b*13},onClick:C,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),C())},children:[Array.from({length:b},(_,E)=>h.jsx("span",{className:"tguide",style:{left:8+E*13+5},"aria-hidden":"true"},E)),h.jsx("span",{className:"chev",onClick:_=>{v.dir&&(_.stopPropagation(),o(v.path))},children:h.jsx(yt,{name:"chevd"})}),h.jsx("span",{className:"ticon",children:h.jsx(yt,{name:v.dir?"folder":"doc"})}),h.jsx("span",{className:"label",children:v.name})]},y.key)})})})}function J$(e){const n=e.split("/"),r=[];let o="";for(let s=0;s{o=o?o+"/"+s:s;const u=o,d=l===r.length-1;return h.jsxs("span",{children:[l>0&&h.jsx("span",{className:"crumb-sep",children:"/"}),d?h.jsx("span",{children:s}):h.jsx("span",{className:"crumb-seg",title:u,onClick:()=>n(u),children:s})]},u)})})}function ow(e){if(e==="")return[];const n=e.split(`
+`);return n[n.length-1]===""&&n.pop(),n}const eI=4e6;function tI(e,n){let r=0;for(;rs.push({op:"-",line:l[v],an:r+v+1}),y=v=>s.push({op:"+",line:u[v],bn:r+v+1});if(d*p>eI){for(let v=0;v=0;C--)for(let _=p-1;_>=0;_--)v[C][_]=l[C]===u[_]?v[C+1][_+1]+1:Math.max(v[C+1][_],v[C][_+1]);let b=0,x=0;for(;b=v[b][x+1]?m(b++):y(x++);for(;bo.op==="+").length,del:r.filter(o=>o.op==="-").length}}const MC=1<<20,rI=8192;function iI(e){if(e.byteLength>MC)return{kind:"too-large",size:e.byteLength};if(e.subarray(0,rI).includes(0))return{kind:"binary"};try{return{kind:"text",text:new TextDecoder("utf-8",{fatal:!0}).decode(e)}}catch{return{kind:"binary"}}}function Gm(e,n,r,o){let s=e+"blob?sha="+encodeURIComponent(n);return r&&(s+="&name="+encodeURIComponent(r)),o&&(s+="&download=1"),s}async function oI(e){const n=await X2(e),r=Number(n.headers.get("Content-Length"));return r>MC?{kind:"too-large",size:r}:iI(new Uint8Array(await n.arrayBuffer()))}function NC(e,n,r,o){return Gt({queryKey:n,queryFn:()=>oI(e),enabled:r,...o?{staleTime:1/0,gcTime:1/0}:{},retry:!1})}function aw(e,n,r){return NC(n?Gm(e,n):"",["blob",e,n],!!n,!0)}function aI(e){return e.slice(e.lastIndexOf("/")+1)}function sI({apiBase:e,path:n,prev:r,cur:o}){const s=aI(n);return h.jsxs("span",{className:"dv-dl",children:[h.jsx("a",{href:Gm(e,r,s,!0),children:"download previous"}),h.jsx("a",{href:Gm(e,o,s,!0),children:"download this version"})]})}function lI({apiBase:e,path:n,prev:r,cur:o}){const s=aw(e,r),l=aw(e,o),u=s.data?.kind==="text"&&l.data?.kind==="text",d=w.useMemo(()=>s.data?.kind==="text"&&l.data?.kind==="text"?nI(s.data.text,l.data.text):null,[s.data,l.data]);if(s.error||l.error)return h.jsx("div",{className:"dv dv-msg",children:"Could not load one of the versions."});if(!s.data||!l.data)return h.jsx("div",{className:"dv dv-msg",children:"Loading changes…"});if(!u){const v=s.data.kind==="too-large"||l.data.kind==="too-large";return h.jsxs("div",{className:"dv dv-msg",children:[v?"Too large to diff — download to compare.":"Binary file — no diff available.",h.jsx(sI,{apiBase:e,path:n,prev:r,cur:o})]})}const{lines:p,add:m,del:y}=d;return h.jsxs("div",{className:"dv",children:[h.jsxs("div",{className:"dv-head",children:[h.jsxs("span",{className:"dv-stat",children:[h.jsxs("span",{className:"dv-add",children:["+",m]})," ",h.jsxs("span",{className:"dv-del",children:["−",y]})]}),m===0&&y===0&&h.jsx("span",{className:"dv-same",children:"No line changes"})]}),h.jsx("div",{className:"dv-body",children:p.map((v,b)=>h.jsxs("div",{className:"dv-line dv-"+(v.op==="="?"ctx":v.op==="+"?"ins":"rm"),children:[h.jsx("span",{className:"dv-n",children:v.an??""}),h.jsx("span",{className:"dv-n",children:v.bn??""}),h.jsx("span",{className:"dv-mark",children:v.op==="="?" ":v.op}),h.jsx("span",{className:"dv-text",children:v.line||" "})]},b))})]})}const cI={add:"added",edit:"edited",delete:"deleted"};function DC({text:e}){return h.jsx(h.Fragment,{children:e.split(/(https?:\/\/\S+)/).map((n,r)=>/^https?:\/\//.test(n)?h.jsx("a",{href:n,target:"_blank",rel:"noopener",children:n},r):n)})}function dg({entry:e,apiBase:n,onOpen:r,diff:o,restore:s,restoreSha:l,inRun:u}){const[d,p]=w.useState(!1),[m,y]=w.useState(!1),v=e.kind==="put"?"edit":e.kind,b=ug(e),x=[e.device.name||e.device.id,e.device.os,e.device.ip].filter(Boolean).join(" · "),C=v!=="delete",_=!!o&&v!=="delete"&&!!e.blob,E=!!u&&v==="add",T=!!s&&!!l&&!E,O=!!s?.busy&&s.busy===e.path+l,A=C&&!!e.blob,z=e.path.split("/").pop()||e.path,L=new Date(e.time).toLocaleString(),B=n+"blob?sha="+e.blob+"&name="+encodeURIComponent(z)+"&download=1",H=()=>y(!m),I=ne=>{ne.target.tagName!=="A"&&C&&r(e.path,e.blob)};return h.jsxs("div",{className:"hentry "+v+(C?" clickable":""),tabIndex:C?0:void 0,role:C?"button":void 0,onClick:I,onKeyDown:ne=>{C&&(ne.key==="Enter"||ne.key===" ")&&(ne.preventDefault(),r(e.path,e.blob))},children:[h.jsxs("div",{className:"hline",children:[h.jsx("span",{className:"hkind",children:cI[v]||v}),h.jsx("span",{className:"hpath",children:e.path}),h.jsx("span",{className:"htime",children:L})]}),h.jsxs("div",{className:"hmeta",children:[h.jsx("span",{className:"hwho",children:b}),h.jsx("span",{className:"hdev",children:x}),h.jsx("span",{className:"hsize",children:e.size?cg(e.size):""}),T&&h.jsxs("button",{type:"button",className:"hrestore-btn",disabled:O,title:"Put this version of "+e.path+" back as a new change",onClick:ne=>{ne.stopPropagation(),s.onRestore(e.path,l)},onKeyDown:ne=>ne.stopPropagation(),children:[h.jsx(yt,{name:"hist"}),O?"restoring…":"restore"]}),s&&E&&h.jsx("span",{className:"hrestore-gap",title:"Restore puts old content back; it can't remove a file yet.",children:"created by this run — can't be undone yet"})]}),e.note&&!u&&h.jsx("div",{className:"hnote"+(d?" open":""),tabIndex:0,role:"button",title:d?"Collapse note":"Show full note","aria-expanded":d,onClick:ne=>{ne.stopPropagation(),ne.target.tagName!=="A"&&p(!d)},onKeyDown:ne=>{(ne.key==="Enter"||ne.key===" ")&&(ne.preventDefault(),ne.stopPropagation(),p(!d))},children:h.jsx(DC,{text:e.note})}),(_||A)&&h.jsxs("div",{className:"hactions",children:[_&&(o.prev?h.jsxs("button",{type:"button",className:"hdiff-btn"+(m?" open":""),"aria-expanded":m,onClick:ne=>{ne.stopPropagation(),H()},onKeyDown:ne=>ne.stopPropagation(),children:[h.jsx(yt,{name:m?"chevd":"chev"}),m?"hide changes":"show changes"]}):h.jsx("div",{className:"hdiff-none",children:"First version — nothing to compare against"})),A&&h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",className:"hver-btn","aria-label":`Open ${z} as of ${L}`,onClick:ne=>{ne.stopPropagation(),r(e.path,e.blob)},onKeyDown:ne=>ne.stopPropagation(),children:[h.jsx(yt,{name:"clock"}),"Open this version"]}),h.jsxs("a",{className:"hver-btn",download:!0,href:B,"aria-label":`Download ${z} as of ${L}`,onClick:ne=>ne.stopPropagation(),onKeyDown:ne=>{ne.stopPropagation(),ne.key===" "&&(ne.preventDefault(),ne.currentTarget.click())},children:[h.jsx(yt,{name:"download"}),"Download"]})]})]}),_&&o.prev&&m&&h.jsx("div",{onClick:ne=>ne.stopPropagation(),children:h.jsx(lI,{apiBase:o.apiBase,path:e.path,prev:o.prev,cur:e.blob})})]})}function uI(e){const{node:n,heatMap:r,onOpen:o}=e,s=(n.children||[]).slice().sort((m,y)=>Number(y.dir||!1)-Number(m.dir||!1)||m.name.localeCompare(y.name)),l=s.filter(m=>m.dir).length,u=s.length-l,d=[];l&&d.push(l+(l===1?" folder":" folders")),u&&d.push(u+(u===1?" file":" files"));const p=nw(r,n.path,!0);return p&&d.push(Ks(p)+" in 30 days"),h.jsxs("div",{className:"dirlist",children:[h.jsxs("h1",{className:"dl-title",children:[h.jsx("span",{className:"dl-title-icon",children:h.jsx(yt,{name:"folder"})}),h.jsx("span",{children:n.name})]}),h.jsx("p",{className:"dl-sub",children:d.join(" · ")||"Empty folder"}),s.length===0?h.jsx("div",{className:"dl-empty",children:"Nothing in this folder yet."}):h.jsx("div",{className:"dl-items",children:s.map(m=>{let y="";if(m.dir){const b=(m.children||[]).length;y=b+(b===1?" item":" items")}else y=[m.size?cg(m.size):"",m.time?new Date(m.time).toLocaleDateString():""].filter(Boolean).join(" · ");const v=nw(r,m.path,!!m.dir);return v&&(y=Ks(v)+(y?" · "+y:"")),h.jsxs("div",{className:"dl-row",tabIndex:0,role:"button",title:m.path,onClick:()=>o(m.path),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),o(m.path))},children:[h.jsx("span",{className:"ticon",children:h.jsx(yt,{name:m.dir?"folder":"doc"})}),h.jsx("span",{className:"dl-name",children:m.name}),v&&h.jsx("span",{className:"heatdot lvl"+N$(v),role:"img","aria-label":Ks(v)+" in 30 days",title:Ks(v)+" in 30 days"}),h.jsx("span",{className:"dl-meta",children:y})]},m.path)})}),e.hub&&h.jsx(dI,{apiBase:e.apiBase,prefix:n.path+"/",onOpen:o,onFullHistory:()=>e.onFullHistory(n.path+"/"),onRendered:e.onRendered})]})}function dI(e){const n=M$(e.apiBase,e.prefix,!0),{onRendered:r}=e;return w.useEffect(()=>{n&&n.length&&r&&r()},[n,r]),!n||n.length===0?null:h.jsxs("div",{className:"dl-history",children:[h.jsx("h3",{className:"dl-h3",children:"Recent changes"}),h.jsx("div",{className:"history dl-hlist",children:n.map((o,s)=>h.jsx(dg,{entry:o,apiBase:e.apiBase,onOpen:e.onOpen},s))}),h.jsx("button",{className:"ai-btn dl-more",onClick:e.onFullHistory,children:"Full history"})]})}function fI(e){const{apiBase:n,path:r,version:o,onMeta:s}=e,l=o?n+"blob?sha="+o+"&name="+encodeURIComponent(r):n+"file?path="+encodeURIComponent(r);return w.useEffect(()=>()=>s(""),[r,s]),W8.test(r)?h.jsx(pI,{...e}):vC.test(r)?h.jsx("iframe",{className:"htmlview",sandbox:"allow-scripts",src:l,title:r,onLoad:e.onRendered}):yC.test(r)?h.jsx("iframe",{className:"pdfview",src:l,title:r,onLoad:e.onRendered}):e$.test(r)?h.jsx(yI,{src:l,alt:r,version:o,onRendered:e.onRendered}):t$.test(r)?h.jsx(bI,{...e,fileURL:l}):h.jsx(hI,{...e,fileURL:l})}function hI(e){const{apiBase:n,path:r,version:o,fileURL:s,onRendered:l}=e,{data:u,error:d}=NC(s,["text",s],!0,!!o);return w.useEffect(()=>{u&&l?.()},[u,l]),d?h.jsx(ld,{version:o,err:d}):u?u.kind==="text"?h.jsx("pre",{className:"plain",children:u.text},r):h.jsx(mI,{apiBase:n,path:r,version:o,fileURL:s,children:u.kind==="too-large"?`Too large to preview (${cg(u.size)}).`:"No preview for this file type."}):null}function mI(e){const{apiBase:n,path:r,version:o,fileURL:s}=e;return h.jsxs("div",{className:"filecard",children:[h.jsx("div",{className:"name",children:r.split("/").pop()}),h.jsx("p",{children:e.children}),h.jsx("a",{className:"btn",download:!0,href:o?s+"&download=1":n+"download?path="+encodeURIComponent(r),children:"Download"})]})}function pI(e){const{apiBase:n,path:r,version:o,heatMap:s,flatFiles:l,onOpenFile:u,onMeta:d,onRendered:p}=e,{data:m,error:y}=Gt({queryKey:["render",n,r,o||""],queryFn:()=>cn(n+"render?path="+encodeURIComponent(r)+(o?"&sha="+o:"")),retry:o?!1:void 0}),v=w.useMemo(()=>m?vI(m.html,r,n):"",[m,r,n]);return w.useEffect(()=>{if(!m)return;const b=[];m.author&&b.push(m.author+(m.device?" on "+m.device:"")),m.time&&b.push(new Date(m.time).toLocaleString());const x=o?null:s&&s[m.path];x&&dl(x)&&b.push(Ks(x)+" / 30d"),d(b.join(" · ")),p?.()},[m,o,s,d,p]),y?h.jsx(ld,{version:o,err:y}):m?h.jsx("div",{dangerouslySetInnerHTML:{__html:v},onClick:b=>gI(b,r,l,u)}):null}function gI(e,n,r,o){const s=e.target.closest("a");if(!s||!e.currentTarget.contains(s))return;const l=s.getAttribute("href")||"",u=n.includes("/")?n.slice(0,n.lastIndexOf("/")):"";l.startsWith("wiki:")?(e.preventDefault(),xI(decodeURIComponent(l.slice(5)),r,o)):/^([a-z]+:|\/|#)/i.test(l)||(e.preventDefault(),o(bC(u,decodeURIComponent(l))))}function vI(e,n,r){const o=n.includes("/")?n.slice(0,n.lastIndexOf("/")):"",s=u=>r+"file?path="+encodeURIComponent(u),l=new DOMParser().parseFromString(e,"text/html");for(const u of l.querySelectorAll("img")){const d=u.getAttribute("src")||"";/^([a-z]+:|\/)/i.test(d)||u.setAttribute("src",s(bC(o,d)))}for(const u of l.querySelectorAll("a")){const d=u.getAttribute("href")||"";/^https?:/i.test(d)&&(u.setAttribute("target","_blank"),u.setAttribute("rel","noopener"))}return l.body.innerHTML}function yI(e){const[n,r]=w.useState(!1);return n?h.jsx(ld,{version:e.version,err:new Error("could not be loaded")}):h.jsx("img",{src:e.src,alt:e.alt,onLoad:e.onRendered,onError:()=>r(!0)})}function ld({version:e,err:n}){return h.jsx("div",{className:"empty",children:e?"That version isn't available.":"Could not load file: "+n.message})}function bI(e){const{path:n,version:r,fileURL:o,onRendered:s}=e,{data:l,error:u}=Gt({queryKey:["text",o],queryFn:async()=>{const d=await fetch(o);if(!d.ok)throw new Error(await d.text());return d.text()},retry:r?!1:void 0});return w.useEffect(()=>{l!=null&&s?.()},[l,s]),u?h.jsx(ld,{version:r,err:u}):l==null?null:h.jsx("pre",{className:"plain",children:l},n)}function xI(e,n,r){const o=e.toLowerCase(),s=n.find(l=>l.path.toLowerCase()===o||l.path.toLowerCase()===o+".md")||n.find(l=>{const u=l.name.toLowerCase();return u===o||u===o+".md"});s&&r(s.path)}const wI=[{value:"",label:"Never"},{value:"24h",label:"In 24 hours"},{value:"168h",label:"In 7 days"},{value:"720h",label:"In 30 days"}];function SI({url:e,copied:n,onClose:r}){const o=e.split("/s/")[1],[s,l]=w.useState(""),[u,d]=w.useState(),[p,m]=w.useState(!1),y=w.useRef(null);async function v(b){const x=s;l(b),m(!0);try{const C=await Un("PATCH","/api/shares/"+o,{expires_in:b});d(C.expires)}catch(C){Qe(C.message,!0),l(x)}finally{m(!1)}}return h.jsx(Vp,{open:!0,onOpenChange:b=>!b&&r(),children:h.jsxs(Fp,{className:"modal",showCloseButton:!1,onOpenAutoFocus:b=>{b.preventDefault(),y.current?.focus()},children:[h.jsx(Ku,{asChild:!0,children:h.jsx("h3",{children:"Public link"})}),h.jsxs("p",{children:[h.jsx("b",{children:"Anyone with this link can view this file"})," — no account needed. It always shows the latest version until it expires or you revoke it."]}),h.jsx("div",{className:"modal-url",children:e}),h.jsxs("div",{className:"modal-expiry",children:[h.jsx("label",{htmlFor:"share-expiry",children:"Expires"}),h.jsx("select",{id:"share-expiry",value:s,disabled:p,onChange:b=>v(b.target.value),children:wI.map(b=>h.jsx("option",{value:b.value,children:b.label},b.value))}),h.jsx("span",{className:"modal-expiry-note",children:wC(u)})]}),h.jsxs("div",{className:"modal-actions",children:[h.jsx(Ct,{ref:y,variant:"primary",onClick:()=>Ha(e).then(b=>Qe(b?"Copied.":"Select and copy the link above.")),children:n?"Copied ✓":"Copy link"}),h.jsx(Ct,{variant:"subtle",onClick:()=>window.open(e,"_blank"),children:"Open"}),h.jsx(Ct,{variant:"subtle",className:"ai-del",onClick:async()=>{try{await Un("DELETE","/api/shares/"+o),Qe("Link revoked — it no longer works."),r()}catch(b){Qe(b.message,!0)}},children:"Revoke"}),h.jsx(Ct,{variant:"subtle",onClick:r,children:"Done"})]})]})})}function _I({shares:e,canRevoke:n,onChanged:r}){return e.length===0?null:h.jsxs("div",{className:"share-banner",role:"status",children:[h.jsxs("div",{className:"sb-head",children:[h.jsx(yt,{name:"share"}),h.jsx("b",{children:"Publicly shared"}),h.jsxs("span",{className:"sb-count",children:[e.length," active link",e.length>1?"s":""]})]}),h.jsxs("p",{className:"sb-note",children:[h.jsx("b",{children:"Anyone with this link can view this file"})," — no account needed. It always shows the latest version until you revoke it."]}),e.map(o=>h.jsxs("div",{className:"sb-link",children:[h.jsx("span",{className:"sb-url mono",title:o.url,children:o.url}),h.jsx("span",{className:"sb-meta",children:SC(o,!1)}),h.jsxs("span",{className:"sb-actions",children:[h.jsx(Ct,{variant:"subtle",onClick:()=>Ha(o.url).then(s=>Qe(s?"Copied.":"Select and copy the link.")),children:"Copy link"}),h.jsx(Ct,{variant:"subtle",onClick:()=>window.open(o.url,"_blank"),children:"Open"}),n&&h.jsx("button",{className:"ai-del","aria-label":`Revoke the share of ${o.path}`,onClick:()=>CC(o,r),children:"Revoke"})]})]},o.token))]})}var sw=1,CI=.9,EI=.8,RI=.17,nm=.1,rm=.999,TI=.9999,OI=.99,jI=/[\\\/_+.#"@\[\(\{&]/,AI=/[\\\/_+.#"@\[\(\{&]/g,MI=/[\s-]/,zC=/[\s-]/g;function Zm(e,n,r,o,s,l,u){if(l===n.length)return s===e.length?sw:OI;var d=`${s},${l}`;if(u[d]!==void 0)return u[d];for(var p=o.charAt(l),m=r.indexOf(p,s),y=0,v,b,x,C;m>=0;)v=Zm(e,n,r,o,m+1,l+1,u),v>y&&(m===s?v*=sw:jI.test(e.charAt(m-1))?(v*=EI,x=e.slice(s,m-1).match(AI),x&&s>0&&(v*=Math.pow(rm,x.length))):MI.test(e.charAt(m-1))?(v*=CI,C=e.slice(s,m-1).match(zC),C&&s>0&&(v*=Math.pow(rm,C.length))):(v*=RI,s>0&&(v*=Math.pow(rm,m-s))),e.charAt(m)!==n.charAt(l)&&(v*=TI)),(vv&&(v=b*nm)),v>y&&(y=v),m=r.indexOf(p,m+1);return u[d]=y,y}function lw(e){return e.toLowerCase().replace(zC," ")}function NI(e,n,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Zm(e,n,lw(e),lw(n),0,0,{})}var Bs='[cmdk-group=""]',im='[cmdk-group-items=""]',DI='[cmdk-group-heading=""]',kC='[cmdk-item=""]',cw=`${kC}:not([aria-disabled="true"])`,Km="cmdk-item-select",Oa="data-value",zI=(e,n,r)=>NI(e,n,r),LC=w.createContext(void 0),Sl=()=>w.useContext(LC),$C=w.createContext(void 0),fg=()=>w.useContext($C),IC=w.createContext(void 0),VC=w.forwardRef((e,n)=>{let r=ja(()=>{var M,U;return{search:"",value:(U=(M=e.value)!=null?M:e.defaultValue)!=null?U:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=ja(()=>new Set),s=ja(()=>new Map),l=ja(()=>new Map),u=ja(()=>new Set),d=FC(e),{label:p,children:m,value:y,onValueChange:v,filter:b,shouldFilter:x,loop:C,disablePointerSelection:_=!1,vimBindings:E=!0,...T}=e,O=mn(),A=mn(),z=mn(),L=w.useRef(null),B=qI();Oo(()=>{if(y!==void 0){let M=y.trim();r.current.value=M,H.emit()}},[y]),Oo(()=>{B(6,le)},[]);let H=w.useMemo(()=>({subscribe:M=>(u.current.add(M),()=>u.current.delete(M)),snapshot:()=>r.current,setState:(M,U,Q)=>{var K,ae,J,ge;if(!Object.is(r.current[M],U)){if(r.current[M]=U,M==="search")ce(),ve(),B(1,fe);else if(M==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ye=document.getElementById(z);ye?ye.focus():(K=document.getElementById(O))==null||K.focus()}if(B(7,()=>{var ye;r.current.selectedItemId=(ye=me())==null?void 0:ye.id,H.emit()}),Q||B(5,le),((ae=d.current)==null?void 0:ae.value)!==void 0){let ye=U??"";(ge=(J=d.current).onValueChange)==null||ge.call(J,ye);return}}H.emit()}},emit:()=>{u.current.forEach(M=>M())}}),[]),I=w.useMemo(()=>({value:(M,U,Q)=>{var K;U!==((K=l.current.get(M))==null?void 0:K.value)&&(l.current.set(M,{value:U,keywords:Q}),r.current.filtered.items.set(M,ne(U,Q)),B(2,()=>{ve(),H.emit()}))},item:(M,U)=>(o.current.add(M),U&&(s.current.has(U)?s.current.get(U).add(M):s.current.set(U,new Set([M]))),B(3,()=>{ce(),ve(),r.current.value||fe(),H.emit()}),()=>{l.current.delete(M),o.current.delete(M),r.current.filtered.items.delete(M);let Q=me();B(4,()=>{ce(),Q?.getAttribute("id")===M&&fe(),H.emit()})}),group:M=>(s.current.has(M)||s.current.set(M,new Set),()=>{l.current.delete(M),s.current.delete(M)}),filter:()=>d.current.shouldFilter,label:p||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:O,inputId:z,labelId:A,listInnerRef:L}),[]);function ne(M,U){var Q,K;let ae=(K=(Q=d.current)==null?void 0:Q.filter)!=null?K:zI;return M?ae(M,r.current.search,U):0}function ve(){if(!r.current.search||d.current.shouldFilter===!1)return;let M=r.current.filtered.items,U=[];r.current.filtered.groups.forEach(K=>{let ae=s.current.get(K),J=0;ae.forEach(ge=>{let ye=M.get(ge);J=Math.max(ye,J)}),U.push([K,J])});let Q=L.current;xe().sort((K,ae)=>{var J,ge;let ye=K.getAttribute("id"),Ne=ae.getAttribute("id");return((J=M.get(Ne))!=null?J:0)-((ge=M.get(ye))!=null?ge:0)}).forEach(K=>{let ae=K.closest(im);ae?ae.appendChild(K.parentElement===ae?K:K.closest(`${im} > *`)):Q.appendChild(K.parentElement===Q?K:K.closest(`${im} > *`))}),U.sort((K,ae)=>ae[1]-K[1]).forEach(K=>{var ae;let J=(ae=L.current)==null?void 0:ae.querySelector(`${Bs}[${Oa}="${encodeURIComponent(K[0])}"]`);J?.parentElement.appendChild(J)})}function fe(){let M=xe().find(Q=>Q.getAttribute("aria-disabled")!=="true"),U=M?.getAttribute(Oa);H.setState("value",U||void 0)}function ce(){var M,U,Q,K;if(!r.current.search||d.current.shouldFilter===!1){r.current.filtered.count=o.current.size;return}r.current.filtered.groups=new Set;let ae=0;for(let J of o.current){let ge=(U=(M=l.current.get(J))==null?void 0:M.value)!=null?U:"",ye=(K=(Q=l.current.get(J))==null?void 0:Q.keywords)!=null?K:[],Ne=ne(ge,ye);r.current.filtered.items.set(J,Ne),Ne>0&&ae++}for(let[J,ge]of s.current)for(let ye of ge)if(r.current.filtered.items.get(ye)>0){r.current.filtered.groups.add(J);break}r.current.filtered.count=ae}function le(){var M,U,Q;let K=me();K&&(((M=K.parentElement)==null?void 0:M.firstChild)===K&&((Q=(U=K.closest(Bs))==null?void 0:U.querySelector(DI))==null||Q.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function me(){var M;return(M=L.current)==null?void 0:M.querySelector(`${kC}[aria-selected="true"]`)}function xe(){var M;return Array.from(((M=L.current)==null?void 0:M.querySelectorAll(cw))||[])}function N(M){let U=xe()[M];U&&H.setState("value",U.getAttribute(Oa))}function Z(M){var U;let Q=me(),K=xe(),ae=K.findIndex(ge=>ge===Q),J=K[ae+M];(U=d.current)!=null&&U.loop&&(J=ae+M<0?K[K.length-1]:ae+M===K.length?K[0]:K[ae+M]),J&&H.setState("value",J.getAttribute(Oa))}function re(M){let U=me(),Q=U?.closest(Bs),K;for(;Q&&!K;)Q=M>0?HI(Q,Bs):BI(Q,Bs),K=Q?.querySelector(cw);K?H.setState("value",K.getAttribute(Oa)):Z(M)}let W=()=>N(xe().length-1),ee=M=>{M.preventDefault(),M.metaKey?W():M.altKey?re(1):Z(1)},D=M=>{M.preventDefault(),M.metaKey?N(0):M.altKey?re(-1):Z(-1)};return w.createElement(Ve.div,{ref:n,tabIndex:-1,...T,"cmdk-root":"",onKeyDown:M=>{var U;(U=T.onKeyDown)==null||U.call(T,M);let Q=M.nativeEvent.isComposing||M.keyCode===229;if(!(M.defaultPrevented||Q))switch(M.key){case"n":case"j":{E&&M.ctrlKey&&ee(M);break}case"ArrowDown":{ee(M);break}case"p":case"k":{E&&M.ctrlKey&&D(M);break}case"ArrowUp":{D(M);break}case"Home":{M.preventDefault(),N(0);break}case"End":{M.preventDefault(),W();break}case"Enter":{M.preventDefault();let K=me();if(K){let ae=new Event(Km);K.dispatchEvent(ae)}}}}},w.createElement("label",{"cmdk-label":"",htmlFor:I.inputId,id:I.labelId,style:ZI},p),ud(e,M=>w.createElement($C.Provider,{value:H},w.createElement(LC.Provider,{value:I},M))))}),kI=w.forwardRef((e,n)=>{var r,o;let s=mn(),l=w.useRef(null),u=w.useContext(IC),d=Sl(),p=FC(e),m=(o=(r=p.current)==null?void 0:r.forceMount)!=null?o:u?.forceMount;Oo(()=>{if(!m)return d.item(s,u?.id)},[m]);let y=PC(s,l,[e.value,e.children,l],e.keywords),v=fg(),b=Hi(B=>B.value&&B.value===y.current),x=Hi(B=>m||d.filter()===!1?!0:B.search?B.filtered.items.get(s)>0:!0);w.useEffect(()=>{let B=l.current;if(!(!B||e.disabled))return B.addEventListener(Km,C),()=>B.removeEventListener(Km,C)},[x,e.onSelect,e.disabled]);function C(){var B,H;_(),(H=(B=p.current).onSelect)==null||H.call(B,y.current)}function _(){v.setState("value",y.current,!0)}if(!x)return null;let{disabled:E,value:T,onSelect:O,forceMount:A,keywords:z,...L}=e;return w.createElement(Ve.div,{ref:Va(l,n),...L,id:s,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!b,"data-disabled":!!E,"data-selected":!!b,onPointerMove:E||d.getDisablePointerSelection()?void 0:_,onClick:E?void 0:C},e.children)}),LI=w.forwardRef((e,n)=>{let{heading:r,children:o,forceMount:s,...l}=e,u=mn(),d=w.useRef(null),p=w.useRef(null),m=mn(),y=Sl(),v=Hi(x=>s||y.filter()===!1?!0:x.search?x.filtered.groups.has(u):!0);Oo(()=>y.group(u),[]),PC(u,d,[e.value,e.heading,p]);let b=w.useMemo(()=>({id:u,forceMount:s}),[s]);return w.createElement(Ve.div,{ref:Va(d,n),...l,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},r&&w.createElement("div",{ref:p,"cmdk-group-heading":"","aria-hidden":!0,id:m},r),ud(e,x=>w.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?m:void 0},w.createElement(IC.Provider,{value:b},x))))}),$I=w.forwardRef((e,n)=>{let{alwaysRender:r,...o}=e,s=w.useRef(null),l=Hi(u=>!u.search);return!r&&!l?null:w.createElement(Ve.div,{ref:Va(s,n),...o,"cmdk-separator":"",role:"separator"})}),II=w.forwardRef((e,n)=>{let{onValueChange:r,...o}=e,s=e.value!=null,l=fg(),u=Hi(m=>m.search),d=Hi(m=>m.selectedItemId),p=Sl();return w.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),w.createElement(Ve.input,{ref:n,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":p.listId,"aria-labelledby":p.labelId,"aria-activedescendant":d,id:p.inputId,type:"text",value:s?e.value:u,onChange:m=>{s||l.setState("search",m.target.value),r?.(m.target.value)}})}),VI=w.forwardRef((e,n)=>{let{children:r,label:o="Suggestions",...s}=e,l=w.useRef(null),u=w.useRef(null),d=Hi(m=>m.selectedItemId),p=Sl();return w.useEffect(()=>{if(u.current&&l.current){let m=u.current,y=l.current,v,b=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let x=m.offsetHeight;y.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return b.observe(m),()=>{cancelAnimationFrame(v),b.unobserve(m)}}},[]),w.createElement(Ve.div,{ref:Va(l,n),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":o,id:p.listId},ud(e,m=>w.createElement("div",{ref:Va(u,p.listInnerRef),"cmdk-list-sizer":""},m)))}),FI=w.forwardRef((e,n)=>{let{open:r,onOpenChange:o,overlayClassName:s,contentClassName:l,container:u,...d}=e;return w.createElement(ap,{open:r,onOpenChange:o},w.createElement(lp,{container:u},w.createElement(cp,{"cmdk-overlay":"",className:s}),w.createElement(up,{"aria-label":e.label,"cmdk-dialog":"",className:l},w.createElement(VC,{ref:n,...d}))))}),PI=w.forwardRef((e,n)=>Hi(r=>r.filtered.count===0)?w.createElement(Ve.div,{ref:n,...e,"cmdk-empty":"",role:"presentation"}):null),UI=w.forwardRef((e,n)=>{let{progress:r,children:o,label:s="Loading...",...l}=e;return w.createElement(Ve.div,{ref:n,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},ud(e,u=>w.createElement("div",{"aria-hidden":!0},u)))}),cd=Object.assign(VC,{List:VI,Item:kI,Input:II,Group:LI,Separator:$I,Dialog:FI,Empty:PI,Loading:UI});function HI(e,n){let r=e.nextElementSibling;for(;r;){if(r.matches(n))return r;r=r.nextElementSibling}}function BI(e,n){let r=e.previousElementSibling;for(;r;){if(r.matches(n))return r;r=r.previousElementSibling}}function FC(e){let n=w.useRef(e);return Oo(()=>{n.current=e}),n}var Oo=typeof window>"u"?w.useEffect:w.useLayoutEffect;function ja(e){let n=w.useRef();return n.current===void 0&&(n.current=e()),n}function Hi(e){let n=fg(),r=()=>e(n.snapshot());return w.useSyncExternalStore(n.subscribe,r,r)}function PC(e,n,r,o=[]){let s=w.useRef(),l=Sl();return Oo(()=>{var u;let d=(()=>{var m;for(let y of r){if(typeof y=="string")return y.trim();if(typeof y=="object"&&"current"in y)return y.current?(m=y.current.textContent)==null?void 0:m.trim():s.current}})(),p=o.map(m=>m.trim());l.value(e,d,p),(u=n.current)==null||u.setAttribute(Oa,d),s.current=d}),s}var qI=()=>{let[e,n]=w.useState(),r=ja(()=>new Map);return Oo(()=>{r.current.forEach(o=>o()),r.current=new Map},[e]),(o,s)=>{r.current.set(o,s),n({})}};function GI(e){let n=e.type;return typeof n=="function"?n(e.props):"render"in n?n.render(e.props):e}function ud({asChild:e,children:n},r){return e&&w.isValidElement(n)?w.cloneElement(GI(n),{ref:n.ref},r(n.props.children)):r(n)}var ZI={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function KI({className:e,...n}){return h.jsx(cd,{"data-slot":"command",className:We("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...n})}function YI({className:e,...n}){return h.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[h.jsx(u_,{className:"size-4 shrink-0 opacity-50"}),h.jsx(cd.Input,{"data-slot":"command-input",className:We("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...n})]})}function QI({className:e,...n}){return h.jsx(cd.List,{"data-slot":"command-list",className:We("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...n})}function XI({className:e,...n}){return h.jsx(cd.Item,{"data-slot":"command-item",className:We("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...n})}function uw(e,n){if(!e)return{score:0,hits:[]};const r=e.toLowerCase(),o=n.toLowerCase();let s=0,l=0,u=0;const d=[];for(let p=0;p3&&o.endsWith("ies")?s=o.slice(0,-3)+"y":o.length>3&&o.endsWith("es")?s=o.slice(0,-2):o.length>2&&o.endsWith("s")&&(s=o.slice(0,-1)),s?uw(s,n):null}function WI({text:e,hits:n}){const r=[];let o=0;return n.forEach((s,l)=>{s>o&&r.push(e.slice(o,s)),r.push(h.jsx("b",{children:e[s]},l)),o=s+1}),r.push(e.slice(o)),h.jsx("span",{className:"plabel",children:r})}function eV({open:e,onClose:n,candidates:r}){const[o,s]=w.useState(""),l=w.useMemo(()=>{if(!e)return[];const d=[];for(const p of r()){const m=JI(o,p.label);m&&d.push({...p,score:m.score,hits:m.hits})}return d.sort((p,m)=>m.score-p.score),d.slice(0,40)},[e,o,r]);w.useEffect(()=>{e&&s("")},[e]);const u=d=>{n(),d.run()};return h.jsx(Vp,{open:e,onOpenChange:d=>!d&&n(),children:h.jsxs(Fp,{id:"palette",className:"palette",showCloseButton:!1,"aria-describedby":void 0,children:[h.jsx(Ku,{className:"sr-only",children:"Search and quick actions"}),h.jsxs(KI,{shouldFilter:!1,loop:!0,children:[h.jsxs("div",{id:"palette-inputwrap",children:[h.jsx(yt,{name:"search"}),h.jsx(YI,{id:"palette-input",placeholder:"Search file names, projects, actions…",autoComplete:"off",spellCheck:!1,value:o,onValueChange:s})]}),h.jsx(QI,{id:"palette-results",children:l.length===0?h.jsx("div",{className:"pempty",children:"No matches — search covers file names, projects, and actions"}):l.map(d=>h.jsxs(XI,{value:d.kind+":"+d.label,onSelect:()=>u(d),children:[h.jsx("span",{className:"picon",children:h.jsx(yt,{name:d.icon})}),h.jsx(WI,{text:d.label,hits:d.hits}),h.jsx("span",{className:"pkind",children:d.kind})]},d.kind+":"+d.label))}),h.jsx("footer",{id:"palette-hint",children:"↑↓ navigate · ⏎ select · esc close"})]})]})})}const Ys=3,Aa=30;function tV(e,n){return Gt({queryKey:["heatDevices",e],queryFn:()=>cn(e+"heat?by=device&days=30"),enabled:n,retry:!1,staleTime:6e4}).data?.devices??null}function dw(e){const[n,r]=w.useState("all"),{flatFiles:o,heatMap:s,devices:l,scope:u}=e,d=b=>!u||b===u||b.startsWith(u+"/"),p=u?o.filter(b=>d(b.path)):o,m=l&&u?l.map(b=>{const x={};for(const[C,_]of Object.entries(b.folders||{}))d(C)&&(x[C]=_);return{...b,folders:x}}).filter(b=>Object.keys(b.folders).length>0):l,y=Date.now(),v=p.map(b=>{const x=s&&s[b.path]||{},C=b.time?Math.max(0,(y-new Date(b.time).getTime())/864e5):0,_=n==="all"?dl(x):x[n]||0;return{path:b.path,reads:_,agent:x.agent||0,total:dl(x),days:C,danger:_>=Ys&&C>=Aa}});return h.jsxs("div",{className:"insights",children:[h.jsxs("h1",{className:"in-title",children:["Knowledge insights",u?h.jsxs("span",{className:"in-scope",children:[" · ",u]}):null]}),h.jsx("p",{className:"dl-sub",children:u?`Reads over the last 30 days × freshness, for ${u} and everything in it.`:"Reads over the last 30 days × how long since each file changed. Hot but stale knowledge — read a lot, maintained by nobody — is the danger zone."}),h.jsx("div",{className:"in-lens",children:["all","human","agent"].map(b=>h.jsx("button",{className:"in-lens-btn"+(b===n?" active":""),onClick:()=>r(b),children:b==="all"?"All reads":b==="human"?"Human reads":"Agent reads"},b))}),h.jsx("h3",{className:"dl-h3",children:"Map — cell size = reads, color = freshness"}),h.jsx(rV,{pts:v,onOpenFile:e.onOpenFile,onOpenFolder:e.onOpenFolder,isFolder:e.isFolder}),h.jsx("h3",{className:"dl-h3",children:"Reads × freshness"}),h.jsx(iV,{pts:v,onOpenFile:e.onOpenFile}),h.jsx("h3",{className:"dl-h3",children:"Hot path — top files by reads"}),h.jsx(oV,{pts:v,lens:n,onOpenFile:e.onOpenFile}),m&&m.length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h3",{className:"dl-h3",children:"Agent coverage — which agents read which areas"}),h.jsx(aV,{devices:m})]})]})}function nV(e){const n=[[76,195,138],[232,196,84],[224,93,93]],r=Math.min(1,Math.max(0,e/300))*(n.length-1),o=Math.min(n.length-2,Math.floor(r)),s=r-o,l=n[o].map((u,d)=>Math.round(u+(n[o+1][d]-u)*s));return`rgb(${l[0]},${l[1]},${l[2]})`}function fw(e,n,r,o,s){const l=e.reduce((m,y)=>m+y.value,0);if(!l||o<=0||s<=0)return[];const u=e.slice().sort((m,y)=>y.value-m.value).map(m=>({it:m,a:m.value/l*o*s})),d=(m,y)=>{const b=m.reduce((C,_)=>C+_.a,0)/y;let x=0;for(const C of m){const _=C.a/b;x=Math.max(x,_/b,b/_)}return x},p=[];for(;u.length;){const m=o>=s,y=m?s:o,v=[u.shift()];for(;u.length&&d(v.concat(u[0]),y)<=d(v,y);)v.push(u.shift());const b=v.reduce((C,_)=>C+_.a,0)/y;let x=0;for(const C of v){const _=C.a/b;m?p.push({item:C.it,x:n,y:r+x,w:b,h:_}):p.push({item:C.it,x:n+x,y:r,w:_,h:b}),x+=_}m?(n+=b,o-=b):(r+=b,s-=b)}return p}const om=15;function rV({pts:e,onOpenFile:n,onOpenFolder:r,isFolder:o}){const u=new Map;for(const p of e){const m=p.path.includes("/")?p.path.split("/")[0]:"/";let y=u.get(m);y||u.set(m,y={name:m,files:[],value:0}),y.files.push(p),y.value+=p.reads+1}const d=[];for(const p of fw([...u.values()],0,0,720,480)){const m=p.item,y=m.name==="/"?"":m.name;if(d.push(h.jsx("rect",{x:p.x+1,y:p.y+1,width:Math.max(0,p.w-2),height:Math.max(0,p.h-2),rx:3,className:"in-tm-group","data-dir":y},"g"+m.name)),p.w>46&&p.h>om+10){let b=m.name==="/"?"(root)":m.name;const x=Math.floor((p.w-8)/6);b.length>x&&(b=b.slice(0,Math.max(1,x-1))+"…"),d.push(h.jsx("text",{x:p.x+5,y:p.y+12,className:"in-tm-glabel","data-dir":y,children:b},"gl"+m.name))}const v=fw(m.files.map(b=>({...b,name:b.path.split("/").pop(),value:b.reads+1})),p.x+2,p.y+om,Math.max(0,p.w-4),Math.max(0,p.h-om-2));for(const b of v)if(d.push(h.jsx("rect",{x:b.x+.6,y:b.y+.6,width:Math.max(.4,b.w-1.2),height:Math.max(.4,b.h-1.2),rx:1.5,fill:nV(b.item.days),className:"in-tm-cell","data-path":b.item.path,children:h.jsx("title",{children:`${b.item.path} — ${b.item.reads} read${b.item.reads===1?"":"s"}/30d · changed ${Math.round(b.item.days)}d ago`})},b.item.path)),b.w>54&&b.h>16){const x=Math.floor((b.w-8)/6);let C=(b.item.danger?"⚠ ":"")+b.item.name;C.length>x&&(C=C.slice(0,Math.max(1,x-1))+"…"),x>=5&&d.push(h.jsx("text",{x:b.x+4.5,y:b.y+12.5,className:"in-tm-label","data-path":b.item.path,children:C},"l"+b.item.path))}}return h.jsx("svg",{viewBox:"0 0 720 480",className:"in-chart in-treemap",onClick:p=>{const m=p.target.closest("[data-path], [data-dir]");if(!m)return;const y=m.getAttribute("data-path");if(y)return n(y);const v=m.getAttribute("data-dir");v&&o(v)&&r(v)},children:d})}function iV({pts:e,onOpenFile:n}){const s={l:44,r:16,t:20,b:34},l=Math.max(Aa*2,...e.map(v=>v.days)),u=Math.max(Ys*2,...e.map(v=>v.reads)),d=v=>Math.log10(v+1)/Math.log10(l+1),p=v=>Math.log10(v+1)/Math.log10(u+1),m=v=>s.l+d(v)*(720-s.l-s.r),y=v=>360-s.b-p(v)*(360-s.t-s.b);return h.jsxs("svg",{viewBox:"0 0 720 360",className:"in-chart",children:[h.jsx("rect",{x:m(Aa),y:s.t,width:720-s.r-m(Aa),height:y(Ys)-s.t,className:"in-danger-zone"}),h.jsx("line",{x1:m(Aa),y1:s.t,x2:m(Aa),y2:360-s.b,className:"in-threshold"}),h.jsx("line",{x1:s.l,y1:y(Ys),x2:720-s.r,y2:y(Ys),className:"in-threshold"}),h.jsx("line",{x1:s.l,y1:360-s.b,x2:720-s.r,y2:360-s.b,className:"in-axis"}),h.jsx("line",{x1:s.l,y1:s.t,x2:s.l,y2:360-s.b,className:"in-axis"}),h.jsx("text",{x:(s.l+720-s.r)/2,y:352,className:"in-label",children:"days since last change →"}),h.jsx("text",{x:12,y:(s.t+360-s.b)/2,className:"in-label",transform:`rotate(-90 12 ${(s.t+360-s.b)/2})`,children:"reads / 30d →"}),h.jsx("text",{x:720-s.r-6,y:s.t+14,className:"in-quad in-quad-danger",textAnchor:"end",children:"hot + stale"}),h.jsx("text",{x:s.l+6,y:s.t+14,className:"in-quad",children:"hot + fresh"}),h.jsx("text",{x:720-s.r-6,y:360-s.b-8,className:"in-quad",textAnchor:"end",children:"cold + stale"}),h.jsx("text",{x:720-s.r-6,y:s.t+28,className:"in-label",textAnchor:"end",children:"dot size = agent share of reads"}),e.map(v=>{const b=v.total?(v.agent||0)/v.total:0;return h.jsx("circle",{cx:Number(m(v.days).toFixed(1)),cy:Number(y(v.reads).toFixed(1)),r:Number((3+4*b).toFixed(1)),className:"in-pt"+(v.danger?" danger":v.reads?"":" cold"),onClick:()=>n(v.path),children:h.jsx("title",{children:`${v.path} — ${v.reads} read${v.reads===1?"":"s"} / 30d · changed ${Math.round(v.days)}d ago`})},v.path)})]})}function oV({pts:e,lens:n,onOpenFile:r}){const o=e.filter(l=>l.reads>0).sort((l,u)=>u.reads-l.reads||u.days-l.days).slice(0,20);if(!o.length)return h.jsx("div",{className:"dl-empty",children:"No reads in the window yet."});const s=o[0].reads;return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"in-hotpath",children:o.map(l=>{const u=n==="agent"?1:n==="human"?0:l.total?l.agent/l.total:0,d=l.reads/s*100;return h.jsxs("div",{className:"in-hp-row",tabIndex:0,role:"button",title:l.danger?`${l.reads} read${l.reads===1?"":"s"}/30d · unchanged ${Math.round(l.days)}d — review this file`:l.path,onClick:()=>r(l.path),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),r(l.path))},children:[h.jsx("span",{className:"in-hp-name"+(l.danger?" danger":""),children:l.path+(l.danger?" ⚠":"")}),h.jsxs("span",{className:"in-hp-bar",children:[h.jsx("span",{className:"in-hp-agent",style:{width:(d*u).toFixed(1)+"%"}}),h.jsx("span",{className:"in-hp-human",style:{width:(d*(1-u)).toFixed(1)+"%"}})]}),h.jsx("span",{className:"in-hp-count",children:l.reads})]},l.path)})}),h.jsxs("p",{className:"in-legend",children:[h.jsx("span",{className:"in-sw agent"})," agent reads ",h.jsx("span",{className:"in-sw human"})," human reads"]})]})}function aV({devices:e}){const n=new Map;for(const b of e)for(const[x,C]of Object.entries(b.folders||{}))n.set(x,(n.get(x)||0)+C);const r=[...n.entries()].sort((b,x)=>x[1]-b[1]).slice(0,12).map(b=>b[0]),o=e.slice(0,12),s=140,l=6,u=Math.min(76,Math.max(34,(720-s-8)/r.length)),d=26,p=720,m=l+o.length*d+58,y=Math.max(1,...o.flatMap(b=>r.map(x=>(b.folders||{})[x]||0))),v=b=>{const x=[23,25,31],C=[245,166,35],_=x.map((E,T)=>Math.round(E+(C[T]-E)*b));return`rgb(${_[0]},${_[1]},${_[2]})`};return h.jsxs("svg",{viewBox:`0 0 ${p} ${m}`,className:"in-chart in-matrix",children:[o.map((b,x)=>{let C=b.name||b.id||"";return C.length>20&&(C=C.slice(0,19)+"…"),h.jsxs("g",{children:[h.jsx("text",{x:s-8,y:l+x*d+17,textAnchor:"end",className:"in-label",children:C}),r.map((_,E)=>{const T=(b.folders||{})[_]||0;return h.jsx("rect",{x:s+E*u,y:l+x*d,width:u-4,height:d-4,rx:3,fill:v(Math.sqrt(T/y)),children:h.jsx("title",{children:`${b.name||b.id} × ${_||"(root)"}: ${T} read${T===1?"":"s"}/30d`})},_)})]},b.id||x)}),r.map((b,x)=>{const C=s+x*u+(u-4)/2,_=l+o.length*d+14;return h.jsx("text",{x:C,y:_,className:"in-label",textAnchor:"end",transform:`rotate(-28 ${C} ${_})`,children:b||"(root)"},b)})]})}function sV(e){const{apiBase:n,target:r,isFolder:o,onMeta:s,onRendered:l,restore:u}=e,d=r?o(r)?{prefix:r+"/"}:{path:r}:{prefix:""},p="path"in d&&d.path!==void 0?"path="+encodeURIComponent(d.path):"prefix="+encodeURIComponent(d.prefix??""),{data:m,error:y}=Gt({queryKey:["history",n,p,200],queryFn:()=>cn(n+"history?"+p+"&n=200"),staleTime:15e3});if(w.useEffect(()=>{y&&s("History unavailable: "+y.message)},[y,s]),w.useEffect(()=>{m&&l?.()},[m,l]),!m)return null;const v=m.entries||[],b=!!r&&!o(r),x=_=>{for(let E=_+1;Ev[_].kind==="delete"?x(_):v[_].blob;return h.jsxs("div",{className:"history",children:[v.length===0&&h.jsx("div",{className:"empty",children:"No history yet."}),lV(v).map((_,E)=>_.run?h.jsx(cV,{run:_.run,onOpen:e.onOpen,apiBase:n,perFile:b,prevBlob:x,restoreSha:C,restore:u},"g"+E):h.jsx(dg,{entry:v[_.i],apiBase:n,onOpen:e.onOpen,diff:b?{apiBase:n,prev:x(_.i)}:void 0,restore:u,restoreSha:C(_.i)},"r"+_.i))]})}function lV(e){const n=new Map,r=[];return e.forEach((o,s)=>{if(!o.note){r.push({i:s});return}const l=o.note+"\0"+(o.device?.id??""),u=n.get(l);if(u){u.entries.push(o),u.idx.push(s);return}const d={note:o.note,entries:[o],idx:[s]};n.set(l,d),r.push({run:d,i:s})}),r.map(o=>o.run&&o.run.entries.length<2?{i:o.i}:o)}function cV({run:e,onOpen:n,apiBase:r,perFile:o,prevBlob:s,restoreSha:l,restore:u}){const[d,p]=w.useState(!0),m=e.entries[0],y=ug(m),v=[m.device.name||m.device.id,m.device.os].filter(Boolean).join(" · "),b=e.entries.map(_=>new Date(_.time).getTime()),x=uV(Math.min(...b),Math.max(...b)),C=e.entries.length;return h.jsxs("div",{className:"hrun"+(d?" open":""),children:[h.jsxs("div",{className:"hrun-head",children:[h.jsx("button",{type:"button",className:"hrun-toggle","aria-expanded":d,title:d?"Collapse this run":"Expand this run",onClick:()=>p(!d),children:h.jsx(yt,{name:d?"chevd":"chev"})}),h.jsx("span",{className:"hrun-note",children:h.jsx(DC,{text:e.note})}),h.jsxs("span",{className:"hrun-meta",children:[C," file",C===1?"":"s"," · ",y,v?" · "+v:""]}),h.jsx("span",{className:"hrun-time",children:x})]}),d&&h.jsx("div",{className:"hrun-body",children:e.entries.map((_,E)=>h.jsx(dg,{entry:_,apiBase:r,onOpen:n,diff:o?{apiBase:r,prev:s(e.idx[E])}:void 0,restore:u,restoreSha:l(e.idx[E]),inRun:!0},E))})]})}function uV(e,n){const r=new Date(e),o=new Date(n),s=u=>u.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});if(r.toDateString()!==o.toDateString())return r.toLocaleString()+" – "+o.toLocaleString();const l=o.toLocaleDateString();return e===n?l+" "+s(o):l+" "+s(r)+" – "+s(o)}function dV(e,n){return e?n(e)?e+"/ (folder)":e:"all changes"}function fV(e){const{apiBase:n,path:r,version:o}=e,s="path="+encodeURIComponent(r),{data:l}=Gt({queryKey:["history",n,s,200],queryFn:()=>cn(n+"history?"+s+"&n=200"),staleTime:15e3}),u=l?.entries?.find(y=>y.blob===o),d=u?ug(u):"",p=u?.time?new Date(u.time).toLocaleString():"",m=n+"blob?sha="+o+"&name="+encodeURIComponent(r.split("/").pop()||r)+"&download=1";return h.jsxs("div",{className:"vbanner",role:"status",children:[h.jsx("span",{className:"vb-icon",children:h.jsx(yt,{name:"clock"})}),h.jsxs("div",{className:"vb-text",children:[h.jsx("b",{children:[p&&"Version from "+p,d&&"by "+d].filter(Boolean).join(" ")||"Earlier version"}),h.jsx("span",{children:"This is not the current file."})]}),h.jsxs("div",{className:"vb-actions",children:[h.jsx("button",{className:"ai-btn",onClick:e.onViewCurrent,children:"View current"}),h.jsx("a",{className:"ai-btn",download:!0,href:m,children:"Download this version"})]})]})}function UC(e){const{config:n,apiBase:r,route:o,hub:s,project:l}=e,u=Bp(),d=jo(),{tree:p,flatFiles:m,dirIndex:y,loaded:v}=j$(r,!s||!!l),b=A$(r,s&&!!l&&!!n.reads?.enabled),x=s&&!!l&&!o.path&&!o.view,C=o.view==="dashboard"||x,_=tV(r,C);w.useEffect(()=>{C&&d.invalidateQueries({queryKey:["heat",r]})},[C,r,d]);const E=o.path,T=o.view?void 0:o.version,O=E||(o.view==="dashboard"||o.view==="history")&&o.viewTarget||"",A=!!E&&y.has(E),z=!!E&&v&&!A&&m.some(ze=>ze.path===E),L=!!E&&v&&!A&&!z,B=A&&!o.view,[H,I]=w.useState(()=>new Set),ne=w.useRef(!0);w.useEffect(()=>{if(!p||!ne.current)return;ne.current=!1;const ze=(p.children||[]).filter(ke=>ke.dir);ze.length===1&&I(ke=>new Set(ke).add(ze[0].path))},[p]),w.useEffect(()=>{!O||!v||I(ze=>{const ke=new Set(ze);for(const j of J$(O))ke.add(j);return y.has(O)&&ke.add(O),ke})},[O,v,y]);const ve=w.useCallback(ze=>{I(ke=>{const j=new Set(ke);return j.has(ze)?j.delete(ze):j.add(ze),j})},[]),fe=w.useRef(null),ce=w.useRef(new Map),le=w.useRef({key:"",want:0,attempts:0});w.useEffect(()=>{le.current={key:u,want:f3()==="POP"?ce.current.get(u)??0:0,attempts:0}},[u]);const me=w.useCallback(()=>{const ze=fe.current,ke=le.current;!ze||ke.key!==u||ke.attempts>=3||(ke.attempts++,ze.scrollTo({top:ke.want,behavior:"instant"}))},[u]),xe=w.useCallback(()=>{fe.current&&ce.current.set(u,fe.current.scrollTop)},[u]),N=w.useCallback((ze,ke)=>{yn(Qu(ze,l?.id,ke)),mr()},[l?.id]),Z=w.useCallback(ze=>yn(bo("history",l?.id,ze)),[l?.id]),[re,W]=w.useState(""),[ee,D]=w.useState(null),[M,U]=w.useState(!1),[Q,K]=w.useState(!1);w.useEffect(()=>SD(()=>K(!0)),[]);const ae=w.useRef(null),J=e.panel??null,ge=!J&&s&&!!l&&z&&wo(l.perm,"write"),{data:ye}=y_(l?.id,s&&!!l),Ne=w.useCallback(()=>{d.invalidateQueries({queryKey:["shares",l?.id]})},[d,l?.id]),Fe=z?(ye||[]).filter(ze=>ze.path===E):[],Ue=!J&&s&&!!l,ht=!J&&z,Je=!J&&(z||s&&!!l&&A),xn=T?r+"blob?sha="+T+"&name="+encodeURIComponent(E)+"&download=1":r+"download?path="+encodeURIComponent(E),dn=w.useCallback(async()=>{try{const ze=await fetch(r+"shares",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:E})});if(!ze.ok)throw new Error(await ze.text());const ke=await ze.json();Ew("share_created");const j=await Ha(ke.url);D({url:ke.url,copied:j}),Ne()}catch(ze){Qe("Share failed: "+ze.message,!0)}},[r,E,Ne]),[Xt,or]=w.useState(""),Ht=s&&!!l&&wo(l?.perm,"write"),ar=w.useCallback(async(ze,ke)=>{or(ze+ke);try{await Ia(r+"restore",{path:ze,sha:ke}),d.invalidateQueries({queryKey:["history",r]}),d.invalidateQueries({queryKey:["tree",r]}),d.invalidateQueries({queryKey:["render",r,ze]}),d.invalidateQueries({queryKey:["text"]}),Qe("Restored "+ze+" — it syncs to every device like any other change.")}catch(j){Qe("Restore failed: "+j.message,!0)}finally{or("")}},[r,d]),Bn=w.useCallback(()=>{if(!E)return Z("");Z(A?E+"/":E)},[E,A,Z]);w.useEffect(()=>{const ze=ke=>{(ke.metaKey||ke.ctrlKey)&&ke.key.toLowerCase()==="k"&&(ke.preventDefault(),K(j=>!j))};return window.addEventListener("keydown",ze),()=>window.removeEventListener("keydown",ze)},[]);const zt=w.useCallback(()=>{const ze=[],ke=(j,V,F,se)=>ze.push({icon:j,label:V,kind:F,run:se});if(s&&l&&E&&(z&&ke("share","Share: "+E,"action",dn),ke("hist","History: "+E,"action",Bn),z&&ke("download","Download: "+E,"action",()=>ae.current?.click())),s&&l&&ke("hist","History: whole project","action",()=>Z("")),s)for(const j of e.projects||[])(!l||j.id!==l.id)&&ke("folder","Switch to project: "+j.name,"project",()=>yn("/"+j.id));n.auth?.enabled&&ke("power","Sign out","action",()=>window.location.href="/auth/logout");for(const j of y.keys())ke("folder",j,"folder",()=>N(j));for(const j of m)ke("doc",j.path,"file",()=>N(j.path));return ze},[s,l,E,z,n.auth?.enabled,y,m,e.projects,dn,Bn,Z,N]);w.useEffect(()=>{if(!M)return;const ze=()=>U(!1);return document.addEventListener("click",ze),()=>document.removeEventListener("click",ze)},[M]);const pn=w.useCallback(ze=>y.has(ze),[y]);let jt="app",Dr,kt;J?kt=J.body:o.view==="dashboard"?kt=h.jsx(dw,{flatFiles:m,heatMap:b,devices:_,scope:o.viewTarget||"",onOpenFile:N,onOpenFolder:N,isFolder:pn}):o.view==="history"?kt=h.jsx(sV,{apiBase:r,target:o.viewTarget||"",isFolder:pn,onOpen:N,onMeta:W,onRendered:me,restore:Ht?{onRestore:ar,busy:Xt}:void 0}):E?v?L?kt=h.jsxs("div",{className:"notfound",children:[h.jsx("h1",{children:"Couldn't find that"}),h.jsxs("p",{children:[h.jsx("code",{children:E})," isn't in this project right now."]}),h.jsx("p",{className:"nf-sub",children:"If it was just created, it may still be uploading or syncing from a teammate's device — this page checks again automatically every few seconds, so refresh or come back in a moment."}),h.jsx("button",{className:"pbtn",onClick:()=>d.invalidateQueries({queryKey:["tree",r]}),children:"Check again"})]}):A?kt=h.jsx(uI,{node:y.get(E),heatMap:b,hub:s&&!!l,apiBase:r,onOpen:N,onFullHistory:Z,onRendered:me}):(jt=vC.test(E)||yC.test(E)?"wide":"read",Dr="markdown",kt=h.jsxs(h.Fragment,{children:[T&&h.jsx(fV,{apiBase:r,path:E,version:T,onViewCurrent:()=>N(E)}),h.jsx(fI,{apiBase:r,path:E,version:T,heatMap:b,flatFiles:m,onOpenFile:N,onMeta:W,onRendered:me})]})):kt=h.jsx("div",{className:"empty",children:"Loading…"}):x?kt=h.jsxs(h.Fragment,{children:[h.jsx(jC,{project:l}),h.jsx("div",{className:"home-insights",children:h.jsx(dw,{flatFiles:m,heatMap:b,devices:_,onOpenFile:N,onOpenFolder:N,isFolder:pn})})]}):kt=h.jsx("div",{className:"empty",children:"Select a file to read it."});const oi=J?J.crumb:E?h.jsx(W$,{path:E,onOpenFolder:N}):o.view==="dashboard"?"Dashboard — "+(o.viewTarget||l?.name||""):o.view==="history"?"History — "+dV(o.viewTarget||"",pn):x?l.name:null,br=h.jsx(sl,{crumb:oi,meta:re,actions:h.jsxs(h.Fragment,{children:[ge&&h.jsx(Ct,{id:"share-btn",variant:"toolbar",className:"icon-only",title:"Share","aria-label":"Share",onClick:dn,children:h.jsx(yt,{name:"share"})}),Ue&&!E&&!o.view&&h.jsxs(Ct,{id:"history-btn",variant:"toolbar",onClick:Bn,children:[h.jsx(yt,{name:"hist"})," ",h.jsx("span",{className:"lbl",children:"History"})]}),ht&&h.jsx("a",{id:"download",hidden:!0,download:!0,href:xn,ref:ae,children:"Download"}),Je&&h.jsx(Ct,{id:"more-btn",variant:"toolbar",className:"icon-only",title:"More actions","aria-label":"More actions",onClick:ze=>{ze.stopPropagation(),U(!M)},children:h.jsx(yt,{name:"dots"})}),M&&h.jsxs("div",{id:"more-menu",role:"menu",children:[Ue&&h.jsx("button",{className:"more-item",onClick:Bn,children:"History"}),ht&&h.jsx("button",{className:"more-item",onClick:()=>ae.current?.click(),children:"Download"}),s&&!!l&&h.jsx("button",{className:"more-item",onClick:()=>{e.onClosePanel?.(),yn(bo("dashboard",l?.id,E))},children:"Dashboard"})]})]})});return h.jsxs(h.Fragment,{children:[h.jsx(al,{vault:e.sidebar.vault,projectsNav:e.sidebar.projectsNav,orgBar:e.sidebar.orgBar,tree:h.jsx(X$,{root:p,expanded:H,onToggle:ve,currentPath:O,listingShowing:B,onOpen:N}),topbar:br,contentRef:fe,onContentScroll:xe,children:h.jsxs(vu,{width:jt,className:Dr,children:[!J&&z&&h.jsx(_I,{shares:Fe,canRevoke:!!l&&wo(l.perm,"write"),onChanged:Ne}),kt]})}),ee&&h.jsx(SI,{url:ee.url,copied:ee.copied,onClose:()=>{D(null),Ne()}}),h.jsx(eV,{open:Q,onClose:()=>K(!1),candidates:zt})]})}function hV({config:e}){const n=Bp(),r=Up(),[o,s]=w.useState(null),[l,u]=w.useState(null);w.useEffect(()=>u(null),[n]);const d=w.useMemo(()=>{const I=n.split("?")[0].match(/^\/join\/([0-9a-f]+)\/?$/);return I?I[1]:null},[n]),{data:p}=a3(!d),{data:m}=s3(!d),y=!!e.auth.admin,{data:v}=b_(y),b=w.useMemo(()=>w_(n,"hub"),[n]),x=w.useMemo(()=>p&&(p.find(I=>I.id===b.project)||o&&p.find(I=>I.org===o)||p[0])||null,[p,b.project,o]);if(w.useEffect(()=>{document.title=x?x.name+" — BearDrive":e.brand||"BearDrive"},[x,e]),d)return h.jsx(mV,{token:d,onDone:async I=>{s(I),await r(),yn("/",{replace:!0})}});const C=e.brand||"BearDrive",_=x&&m?.find(I=>I.id===x.org)||null,E=h.jsx(Zu,{name:C,onHome:()=>yn("/"),search:!!x}),T=e.me?h.jsx(b$,{me:e.me,org:_,orgActive:!!b.org,billing:e.billing,admin:y?{pending:v?.length||0,onClick:()=>{u({kind:"hub"}),mr()}}:void 0}):void 0;if(!p||!m)return h.jsx(al,{vault:E,topbar:h.jsx(sl,{}),children:h.jsx(vu,{children:h.jsx("div",{className:"empty",children:"Loading…"})})});if(!x)return h.jsx(al,{vault:E,projectsNav:h.jsx(ew,{projects:p}),orgBar:T,topbar:h.jsx(sl,{}),children:h.jsx(vu,{children:h.jsx(O$,{})})});const O=l?.kind==="hub"?{crumb:"Signup & access",body:h.jsx(d$,{})}:null,A=b.org?m.find(I=>I.id===b.org):null,L=b.org&&!A?{crumb:"Organization",body:h.jsxs("div",{className:"empty",children:[h.jsx("h3",{children:"Organization not found"}),h.jsx("p",{children:"This organization doesn't exist, or you're no longer a member."}),h.jsx("p",{children:h.jsxs("a",{...yu("/"+x.id),children:["Back to ",x.name]})})]})}:A?{crumb:"Organization",body:h.jsx(l$,{org:A,projects:p,myEmail:e.me?.email||""})}:null,B=b.billing?{crumb:"Billing",body:e.billing?h.jsx(x$,{url:e.billing.url}):h.jsxs("div",{className:"empty",children:[h.jsx("h3",{children:"No billing on this hub"}),h.jsx("p",{children:"This BearDrive hub doesn't have a billing surface."})]})}:null,H=b.view==="settings"?{crumb:"Project settings",body:h.jsx(C$,{project:x,org:_,onDeleted:async()=>{await r(),yn("/")}})}:b.view==="install"?{crumb:"Installation",body:h.jsx(jC,{project:x})}:null;return!b.org&&!b.billing&&b.project!==x.id?h.jsx(iu,{to:"/"+x.id}):b.legacyView&&b.view?h.jsx(iu,{to:bo(b.view,x.id,b.viewTarget)}):b.trailingSlash&&b.path?h.jsx(iu,{to:Qu(b.path,x.id,b.version)}):h.jsx(UC,{config:e,apiBase:"/api/p/"+x.id+"/",route:b,hub:!0,project:x,projects:p,sidebar:{vault:E,projectsNav:h.jsx(ew,{projects:p,currentId:x.id,menu:{active:l?null:b.view==="dashboard"&&!b.viewTarget?"dashboard":b.view==="install"?"install":b.view==="history"&&!b.viewTarget?"history":b.view==="settings"?"settings":null,onDashboard:()=>{u(null),yn(bo("dashboard",x.id)),mr()},onInstall:()=>{u(null),yn(bo("install",x.id)),mr()},onHistory:()=>{u(null),yn(bo("history",x.id)),mr()},onSettings:()=>{u(null),yn(bo("settings",x.id)),mr()}}}),orgBar:T},panel:O||L||B||H,onClosePanel:()=>u(null)},x.id)}function mV({token:e,onDone:n}){return w.useEffect(()=>{let r=!1;return Ia("/api/invites/"+e).then(o=>{r||(Qe(`Welcome — you joined the “${o.org.name}” team. Opening its projects…`),n(o.org.id))}).catch(o=>{r||String(o.message).includes("signing in")||(Qe("Could not accept the invite: "+o.message,!0),n(null))}),()=>{r=!0}},[e]),h.jsx(al,{vault:h.jsx(Zu,{name:"BearDrive"}),topbar:h.jsx(sl,{}),children:h.jsx(vu,{children:h.jsx("div",{className:"empty",children:"Joining…"})})})}function pV({config:e}){const n=Bp(),r=e.volume||"BearDrive";w.useEffect(()=>{document.title=e.brand||r},[e,r]);const o=w.useMemo(()=>w_(n,"volume"),[n]);return o.trailingSlash&&o.path?h.jsx(iu,{to:Qu(o.path)}):h.jsx(UC,{config:e,apiBase:"/api/",route:o,hub:!1,sidebar:{vault:h.jsx(Zu,{name:r,showSignout:e.auth.enabled,search:!0})}})}function gV(){const{data:e}=J2();return h.jsxs(yD,{delayDuration:150,children:[e?e.mode==="hub"?h.jsx(hV,{config:e}):h.jsx(pV,{config:e}):h.jsx(al,{vault:h.jsx(Zu,{name:"…",showSignout:!1}),topbar:h.jsx(sl,{}),children:h.jsx("div",{className:"empty",children:"Loading…"})}),h.jsx(Jk,{}),h.jsx(r3,{})]})}const vV=new k2({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});c2.createRoot(document.getElementById("root")).render(h.jsx(w.StrictMode,{children:h.jsx(L2,{client:vV,children:h.jsx(gV,{})})}));
diff --git a/internal/webapp/static/assets/index-ozNOEdCg.css b/internal/webapp/static/assets/index-ld3LwbeV.css
similarity index 98%
rename from internal/webapp/static/assets/index-ozNOEdCg.css
rename to internal/webapp/static/assets/index-ld3LwbeV.css
index 7acdcef..42ac11b 100644
--- a/internal/webapp/static/assets/index-ozNOEdCg.css
+++ b/internal/webapp/static/assets/index-ld3LwbeV.css
@@ -1 +1 @@
-@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-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking: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-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-lg:32rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-medium:500;--font-weight-semibold:600;--tracking-widest:.1em;--radius-xs:.125rem;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--color-background:#0a0b0d;--color-foreground:#eef0f3;--color-card:#15171b;--color-card-foreground:#eef0f3;--color-popover:#15171b;--color-popover-foreground:#eef0f3;--color-primary:#f5a623;--color-primary-foreground:#1a1204;--color-secondary:#ffffff08;--color-secondary-foreground:#eef0f3;--color-muted:#ffffff0f;--color-muted-foreground:#9aa0a9;--color-accent:#ffffff0f;--color-accent-foreground:#eef0f3;--color-destructive:#f26d6d;--color-border:#ffffff12;--color-input:#ffffff1c;--color-ring:#f5a623;--radius-ctl:7px}}@layer base,components;@layer utilities{.\@container\/card-header{container:card-header/inline-size}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:0}.top-4{top:calc(var(--spacing) * 4)}.top-20{top:calc(var(--spacing) * 20)}.top-\[50\%\]{top:50%}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.left-2{left:calc(var(--spacing) * 2)}.left-\[50\%\]{left:50%}.z-50{z-index:50}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.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}}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.my-1{margin-block:var(--spacing)}.mt-4{margin-top:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.field-sizing-content{field-sizing:content}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-px{height:1px}.max-h-\(--radix-dropdown-menu-content-available-height\){max-height:var(--radix-dropdown-menu-content-available-height)}.max-h-\(--radix-select-content-available-height\){max-height:var(--radix-select-content-available-height)}.max-h-\[300px\]{max-height:300px}.min-h-16{min-height:calc(var(--spacing) * 16)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.min-w-0{min-width:0}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.origin-\(--radix-dropdown-menu-content-transform-origin\){transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\(--radix-select-content-transform-origin\){transform-origin:var(--radix-select-content-transform-origin)}.origin-\(--radix-tooltip-content-transform-origin\){transform-origin:var(--radix-tooltip-content-transform-origin)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[calc\(-50\%_-_2px\)\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.resize{resize:both}.scroll-my-1{scroll-margin-block:var(--spacing)}.scroll-py-1{scroll-padding-block:var(--spacing)}.auto-rows-min{grid-auto-rows:min-content}.grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded-\[2px\]{border-radius:2px}.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)}.rounded-xs{border-radius:var(--radius-xs)}.border{border-style:var(--tw-border-style);border-width:1px}.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-input{border-color:var(--color-input)}.bg-background{background-color:var(--color-background)}.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-border{background-color:var(--color-border)}.bg-card{background-color:var(--color-card)}.bg-destructive{background-color:var(--color-destructive)}.bg-foreground{background-color:var(--color-foreground)}.bg-muted\/50{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--color-muted) 50%,transparent)}}.bg-popover{background-color:var(--color-popover)}.bg-primary{background-color:var(--color-primary)}.bg-secondary{background-color:var(--color-secondary)}.bg-transparent{background-color:#0000}.fill-current{fill:currentColor}.fill-foreground{fill:var(--color-foreground)}.p-0{padding:0}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-6{padding:calc(var(--spacing) * 6)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-6{padding-block:calc(var(--spacing) * 6)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.align-middle{vertical-align:middle}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-none{--tw-leading:1;line-height:1}.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-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.whitespace-nowrap{white-space:nowrap}.text-background{color:var(--color-background)}.text-card-foreground{color:var(--color-card-foreground)}.text-destructive{color:var(--color-destructive)}.text-foreground{color:var(--color-foreground)}.text-muted-foreground{color:var(--color-muted-foreground)}.text-popover-foreground{color:var(--color-popover-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-secondary-foreground{color:var(--color-secondary-foreground)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.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-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-offset-background{--tw-ring-offset-color:var(--color-background)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background-color\,border-color\,color\]{transition-property:background-color,border-color,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;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))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.running{animation-play-state:running}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.selection\:bg-primary ::selection{background-color:var(--color-primary)}.selection\:bg-primary::selection{background-color:var(--color-primary)}.selection\:text-primary-foreground ::selection{color:var(--color-primary-foreground)}.selection\:text-primary-foreground::selection{color:var(--color-primary-foreground)}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-7::file-selector-button{height:calc(var(--spacing) * 7)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--color-foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--color-muted-foreground)}@media(hover:hover){.hover\:bg-accent:hover{background-color:var(--color-accent)}.hover\:bg-destructive\/90:hover{background-color:#f26d6de6}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--color-destructive) 90%,transparent)}}.hover\:bg-muted\/50:hover{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--color-muted) 50%,transparent)}}.hover\:bg-primary\/90:hover{background-color:#f5a623e6}@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-secondary\/80:hover{background-color:#ffffff06}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--color-secondary) 80%,transparent)}}.hover\:text-accent-foreground:hover{color:var(--color-accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.focus\:bg-accent:focus{background-color:var(--color-accent)}.focus\:text-accent-foreground:focus{color:var(--color-accent-foreground)}.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-ring:focus{--tw-ring-color:var(--color-ring)}.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\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:border-ring:focus-visible{border-color:var(--color-ring)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + 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-destructive\/20:focus-visible{--tw-ring-color:#f26d6d33}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-destructive) 20%, transparent)}}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:#f5a62380}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-ring) 50%, transparent)}}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.has-aria-expanded\:bg-muted\/50:has([aria-expanded=true]){background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.has-aria-expanded\:bg-muted\/50:has([aria-expanded=true]){background-color:color-mix(in oklab,var(--color-muted) 50%,transparent)}}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-\[\>svg\]\:px-1\.5:has(>svg){padding-inline:calc(var(--spacing) * 1.5)}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing) * 2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing) * 4)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--color-destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:#f26d6d33}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--color-destructive) 20%, transparent)}}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\[disabled\=true\]\:opacity-50[data-disabled=true]{opacity:.5}.data-\[error\=true\]\:text-destructive[data-error=true]{color:var(--color-destructive)}.data-\[inset\]\:pl-8[data-inset]{padding-left:calc(var(--spacing) * 8)}.data-\[orientation\=horizontal\]\:h-px[data-orientation=horizontal]{height:1px}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:w-px[data-orientation=vertical]{width:1px}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--color-muted-foreground)}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:var(--color-accent)}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:var(--color-accent-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.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\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.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-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[size\=default\]\:h-9[data-size=default]{height:calc(var(--spacing) * 9)}.data-\[size\=sm\]\:h-8[data-size=sm]{height:calc(var(--spacing) * 8)}:is(.\*\*\:data-\[slot\=command-input-wrapper\]\:h-12 *)[data-slot=command-input-wrapper]{height:calc(var(--spacing) * 12)}:is(.\*\:data-\[slot\=select-value\]\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\*\:data-\[slot\=select-value\]\:flex>*)[data-slot=select-value]{display:flex}:is(.\*\:data-\[slot\=select-value\]\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\*\:data-\[slot\=select-value\]\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing) * 2)}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--color-accent)}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:var(--color-accent-foreground)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--color-muted-foreground)}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--color-muted)}.data-\[variant\=destructive\]\:text-destructive[data-variant=destructive]{color:var(--color-destructive)}.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:#f26d6d1a}@supports (color:color-mix(in lab,red,red)){.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--color-destructive) 10%,transparent)}}.data-\[variant\=destructive\]\:focus\:text-destructive[data-variant=destructive]:focus{color:var(--color-destructive)}@media(min-width:40rem){.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:text-left{text-align:left}}@media(min-width:48rem){.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media(prefers-color-scheme:dark){.dark\:border-input{border-color:var(--color-input)}.dark\:bg-destructive\/60{background-color:#f26d6d99}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/60{background-color:color-mix(in oklab,var(--color-destructive) 60%,transparent)}}.dark\:bg-input\/30{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30{background-color:color-mix(in oklab,var(--color-input) 30%,transparent)}}@media(hover:hover){.dark\:hover\:bg-accent\/50:hover{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-accent\/50:hover{background-color:color-mix(in oklab,var(--color-accent) 50%,transparent)}}.dark\:hover\:bg-input\/50:hover{background-color:#ffffff0e}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:hover{background-color:color-mix(in oklab,var(--color-input) 50%,transparent)}}}.dark\:focus-visible\:ring-destructive\/40:focus-visible{--tw-ring-color:#f26d6d66}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-destructive) 40%, transparent)}}.dark\:aria-invalid\:ring-destructive\/40[aria-invalid=true]{--tw-ring-color:#f26d6d66}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--color-destructive) 40%, transparent)}}.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20[data-variant=destructive]:focus{background-color:#f26d6d33}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--color-destructive) 20%,transparent)}}}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:var(--color-muted-foreground)}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--spacing) * 5)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--spacing) * 5)}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:calc(var(--spacing) * 12)}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-block:calc(var(--spacing) * 3)}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:calc(var(--spacing) * 5)}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:calc(var(--spacing) * 5)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground svg:not([class*=text-]){color:var(--color-muted-foreground)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\.border-b\]\:pb-6.border-b{padding-bottom:calc(var(--spacing) * 6)}.\[\.border-t\]\:pt-6.border-t{padding-top:calc(var(--spacing) * 6)}:is(.\*\:\[span\]\:last\:flex>*):is(span):last-child{display:flex}:is(.\*\:\[span\]\:last\:items-center>*):is(span):last-child{align-items:center}:is(.\*\:\[span\]\:last\:gap-2>*):is(span):last-child{gap:calc(var(--spacing) * 2)}:is(.data-\[variant\=destructive\]\:\*\:\[svg\]\:text-destructive\![data-variant=destructive]>*):is(svg){color:var(--color-destructive)!important}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y:2px;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}@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-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{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:"";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:"";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:"";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-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}:root{--bg: #0a0b0d;--bg-side: #0c0e10;--bg-raise: #15171b;--surface: rgba(255,255,255,.03);--hover: rgba(255,255,255,.06);--border: rgba(255,255,255,.07);--border-2: rgba(255,255,255,.11);--code-bg: #0d0f12;--text: #eef0f3;--text-dim: #9aa0a9;--text-faint: #868b93;--text-ghost: #666b74;--accent: #f5a623;--accent-bright: #ffcf85;--accent-dim: #d3861a;--accent-press: #e0951a;--glow: rgba(245,166,35,.13);--add: #4cc38a;--del: #f26d6d;--mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;--ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;--r-ctl: 7px;--r-card: 10px;--r-over: 14px;--page-read: 768px;--page-app: 768px;--page-wide: 1200px;--hero-top: clamp(32px, 8vh, 88px)}@font-face{font-family:"Jersey 10";font-style:normal;font-weight:400;font-display:swap;src:url(/assets/jersey-10-COnnvJff.woff2) format("woff2")}@font-face{font-family:Logo Fallback;src:local("Helvetica Neue"),local("Arial"),local("Segoe UI"),local("Roboto");size-adjust:73%}*{box-sizing:border-box}[hidden]{display:none!important}html,body{height:100%;margin:0}#root{display:contents}body{display:flex;background:var(--bg);color:var(--text);font:13px/1.5 var(--ui);letter-spacing:-.006em;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}::selection{background:var(--glow);color:var(--accent-bright)}:focus-visible{outline:2px solid var(--accent);outline-offset:1px;border-radius:5px}:focus-visible{outline-color:var(--accent)}.admin input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}input[type=checkbox]{accent-color:var(--accent);width:20px;height:20px;color-scheme:dark}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.sprite{position:absolute}.ico{width:16px;height:16px;flex:none;stroke:currentColor;stroke-width:1.6;fill:none;stroke-linecap:round;stroke-linejoin:round}button,input,a.btn{font-family:inherit}#sidebar{width:264px;min-width:210px;background:var(--bg-side);border-right:1px solid var(--border);display:flex;flex-direction:column;overflow:hidden}#vault{display:flex;align-items:center;gap:9px;height:52px;padding:0 12px 0 14px;border-bottom:1px solid var(--border);position:relative;z-index:45}#vault-badge{flex:none;display:grid;place-items:center;color:var(--accent)}#vault-name{font-family:"Jersey 10","Logo Fallback",var(--ui);font-size:18px;font-weight:400;font-synthesis:none;letter-spacing:.01em;line-height:1;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vault-actions{display:flex;align-items:center;gap:4px}#vault #signout,.icon-btn2{width:28px;height:28px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;color:var(--text-ghost);background:transparent;border:none;cursor:pointer;text-decoration:none}#vault #signout:hover,.icon-btn2:hover{color:var(--text);background:var(--hover)}#vault #signout .ico,.icon-btn2 .ico{width:16px;height:16px}#projects{flex:none;max-height:32%;overflow-y:auto;padding:10px 8px 8px;border-bottom:1px solid var(--border)}.nav-head{display:flex;align-items:center;justify-content:space-between;padding:6px 8px;font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:.07em;color:var(--text-faint)}.nav-add{display:grid;place-items:center;width:18px;height:18px;border:none;background:transparent;color:var(--text-ghost);cursor:pointer;border-radius:5px}.nav-add .ico{width:14px;height:14px}.nav-add:hover{color:var(--text);background:var(--hover)}#projects ul{list-style:none;margin:0;padding:0}#projects .row{display:flex;align-items:center;gap:9px;height:31px;padding:0 8px;border-radius:7px;color:var(--text-dim);cursor:pointer;position:relative;white-space:nowrap;overflow:hidden}.proj-mark{width:17px;height:17px;border-radius:5px;flex:none;display:grid;place-items:center;font-size:10px;font-weight:700;color:#0a0b0d;letter-spacing:-.02em;text-transform:uppercase}.proj-mark svg{width:11px;height:11px}.proj-menu [data-slot=select-item]{display:flex;align-items:center;gap:8px}#projects .row .label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}#projects .row:hover{background:var(--hover);color:var(--text)}#projects .row.active{background:var(--glow);color:var(--accent-bright)}#projects .row.active:before{content:"";position:absolute;left:0;top:6px;bottom:6px;width:2px;border-radius:2px;background:var(--accent)}#tree{flex:1;overflow-y:auto;padding:8px 8px 24px}.tguide{position:absolute;top:0;bottom:0;width:1px;background:var(--border);pointer-events:none}#tree .row{display:flex;align-items:center;gap:6px;height:28px;padding:0 8px;border-radius:7px;color:var(--text-dim);cursor:pointer;position:relative;white-space:nowrap;overflow:hidden}#tree .row:hover{background:var(--hover);color:var(--text)}#tree .row.active{background:var(--glow);color:var(--accent-bright)}#tree .row.active:before{content:"";position:absolute;left:0;top:5px;bottom:5px;width:2px;border-radius:2px;background:var(--accent)}#tree .chev{width:14px;height:14px;flex:none;color:var(--text-ghost);transition:transform .12s;display:flex;align-items:center;justify-content:center}#tree .chev .ico{width:13px;height:13px}#tree .ticon{flex:none;display:flex;color:var(--text-ghost)}#tree .ticon .ico{width:15px;height:15px}#tree .row:hover .ticon,#tree .row:hover .chev{color:var(--text-faint)}#tree .row.active .ticon,#tree .row.active .chev{color:var(--accent)}#tree .label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}#tree .file .label{font-size:12.5px}#tree .file .chev{visibility:hidden}#tree .row.collapsed .chev{transform:rotate(-90deg)}.field-err{color:var(--del);font-size:12px;margin:6px 2px 0}.modal,#palette{translate:none}.admin-card-table{padding:0}.admin-table{width:100%;border-collapse:collapse;table-layout:fixed}.admin-table td .ai-main,.admin-table td a.ai-main,.admin-table td .ai-copy,.admin-table td .ai-tag{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.admin-table th:last-child,.admin-table td:last-child{width:186px;text-align:right}.admin-table tr:last-child td{border-bottom:none}.admin-table th{text-align:left;font-size:11px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--text-faint);padding:0;border-bottom:1px solid var(--border);-webkit-user-select:none;user-select:none}.admin-table td{padding:0;border-bottom:1px solid var(--border);overflow:hidden;text-overflow:ellipsis}.admin-table tr.admin-item{display:table-row}.admin-table tr.admin-item td{padding:8px 10px}.admin-card-table{overflow-x:auto}.shares-table .admin-table th:last-child,.shares-table .admin-table td:last-child{width:110px}.share-banner{margin:0 0 18px;padding:12px 14px;border:1px solid var(--border);border-left:3px solid var(--accent);border-radius:var(--r-ctl);background:var(--surface)}.share-banner .sb-head{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text)}.share-banner .sb-head .ico,.share-banner .sb-head svg{width:15px;height:15px;flex:none;color:var(--accent)}.share-banner .sb-count{color:var(--text-faint);font-size:12px}.share-banner .sb-note{margin:6px 0 10px;font-size:12.5px;line-height:1.55;color:var(--text-faint);max-width:64ch}.share-banner .sb-link{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding-top:8px;border-top:1px solid var(--border)}.share-banner .sb-link+.sb-link{margin-top:8px}.share-banner .sb-url{flex:1 1 260px;min-width:0;font-size:12px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.share-banner .sb-meta{font-size:11.5px;color:var(--text-faint)}.share-banner .sb-actions{display:flex;align-items:center;gap:6px;margin-left:auto}.nav-menu{list-style:none;margin:6px 0 0;padding:0}.nav-menu .row .ico{width:15px;height:15px;flex:none;color:var(--text-ghost)}.nav-menu .row.active .ico{color:var(--accent-bright)}.proj-row{display:flex;align-items:center;gap:4px;padding:0 10px 4px 12px}#project-select{flex:1;min-width:0;height:30px;padding:0 9px;display:inline-flex;align-items:center;gap:8px;border:1px solid var(--border);border-radius:var(--r-ctl);background:var(--surface);color:var(--text);font:inherit;font-size:12.5px;font-weight:500;cursor:pointer;white-space:nowrap;outline:none}#project-select>span:last-of-type{overflow:hidden;text-overflow:ellipsis}#project-select:hover{background:var(--hover);border-color:var(--border-2)}#project-select svg{color:var(--text-ghost)}.proj-menu{z-index:80;min-width:var(--radix-select-trigger-width, 200px);border:1px solid var(--border-2);border-radius:9px;padding:4px;background:var(--bg-raise);box-shadow:0 10px 32px #00000059}.proj-menu [role=option]{font-size:12.5px;color:var(--text-dim);border-radius:6px;outline:none}.proj-menu [role=option][data-highlighted]{background:var(--hover);color:var(--text)}#accountbar{position:relative;border-top:1px solid var(--border);padding:7px 10px}#account-btn{width:100%;display:flex;align-items:center;gap:9px;text-align:left;padding:6px 8px;border:none;border-radius:7px;background:transparent;color:var(--text-dim);cursor:pointer;font:inherit}#account-btn:hover{background:var(--hover);color:var(--text)}#account-btn .avatar{width:26px;height:26px;flex:none;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:#fff;font-size:12px;font-weight:700}#account-btn .acct{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}#account-btn .acct b{font-size:12.5px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#account-btn .acct small{font-size:11px;color:var(--text-faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#account-btn>.ico{width:14px;height:14px;color:var(--text-ghost)}#account-menu{min-width:var(--radix-dropdown-menu-trigger-width, 220px);padding:5px;border:1px solid var(--border-2);border-radius:9px;background:var(--bg-raise);box-shadow:0 10px 32px #00000059;display:flex;flex-direction:column;z-index:80;outline:none}#account-menu [role=menuitem]{outline:none}#account-menu [role=menuitem][data-highlighted]{background:var(--hover);color:var(--text)}#account-menu .menu-sec{padding:7px 9px 3px;font-size:10.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--text-faint)}#account-menu [role=menuitem]{display:flex;align-items:center;gap:8px;padding:7px 9px;border:none;border-radius:6px;background:transparent;text-align:left;color:var(--text-dim);font:inherit;font-size:12.5px;cursor:pointer;text-decoration:none}#account-menu [role=menuitem]:hover{background:var(--hover);color:var(--text)}#account-menu [role=menuitem] b{font-weight:600}#account-menu [role=menuitem] .ico{width:15px;height:15px}#account-menu .plan-chip{margin-left:auto;color:var(--accent);border-color:var(--border-2)}#account-menu #signout{color:var(--del)}#account-menu #signout:hover{color:var(--del);background:var(--hover)}#billing-view .plan-chip{color:var(--accent)}.plan-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}@media(max-width:700px){.plan-grid{grid-template-columns:1fr}}.usage-bar{background:var(--surface);border:1px solid var(--border);border-radius:4px;height:6px;overflow:hidden}.usage-bar>div{background:var(--accent);height:100%}.plan-price{font-size:20px;font-weight:700;margin:0 0 10px}.plan-price small{font-size:12px;color:var(--text-dim);font-weight:500}.muted-note{color:var(--text-dim);font-size:13px}#main{flex:1;display:flex;flex-direction:column;min-width:0}#topbar{position:relative;display:flex;align-items:center;gap:9px;height:52px;padding:0 16px;border-bottom:1px solid var(--border)}.icon-btn{display:none;width:34px;height:34px;border:none;background:transparent;color:var(--text-dim);cursor:pointer;border-radius:7px;align-items:center;justify-content:center}.icon-btn:hover{color:var(--text);background:var(--hover)}#crumb{font-size:12.5px;color:var(--text);font-weight:500;letter-spacing:-.01em;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#crumb .crumb-seg{color:var(--text-dim);cursor:pointer}#crumb .crumb-seg:hover{color:var(--accent-bright)}#crumb .crumb-sep{color:var(--text-ghost);margin:0 5px}#meta{flex:1;min-width:0;font-size:12px;color:var(--text-faint);text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.btn{display:inline-flex;align-items:center;gap:6px;flex:none;height:30px;padding:0 11px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text-dim);font-size:12.5px;font-weight:500;cursor:pointer;text-decoration:none}.btn:hover{background:var(--hover);color:var(--text);border-color:var(--border-2)}.btn .ico{width:15px;height:15px}.btn.ghost{color:var(--text-dim)}.tipcard{display:flex;align-items:center;gap:7px;white-space:nowrap;padding:6px 9px;border-radius:8px;border:1px solid var(--border-2);background:var(--surface-solid, var(--bg-raise));color:var(--text);font-size:12.5px;font-weight:500;box-shadow:0 8px 24px #00000059;z-index:80}.tipcard kbd{font:11px var(--ui);color:var(--text-faint);background:var(--hover);border:1px solid var(--border-2);border-radius:5px;padding:1px 5px}#more-menu{position:absolute;right:12px;top:calc(100% - 4px);z-index:80;background:var(--bg-raise);border:1px solid var(--border-2);border-radius:var(--r-card);box-shadow:0 18px 44px -14px #000000bf;padding:6px;min-width:168px}.more-item{display:block;width:100%;text-align:left;min-height:40px;padding:0 12px;background:transparent;border:none;cursor:pointer;color:var(--text);font:inherit;font-size:13.5px;border-radius:var(--r-ctl)}.more-item:hover{background:var(--hover)}#content{flex:1;overflow-y:auto;padding:44px 40px 110px;scroll-behavior:smooth}.page{width:100%;max-width:var(--page-app);margin-inline:auto;min-width:0}.page.read{max-width:var(--page-read)}.page.wide{max-width:var(--page-wide)}.empty{color:var(--text-faint);text-align:center;margin-top:var(--hero-top)}.empty-hint{display:block;margin-top:6px;font-size:12px;color:var(--text-faint)}.onboard{max-width:560px;margin:var(--hero-top) auto 0}.onboard h1{font-size:25px;font-weight:640;letter-spacing:-.02em;margin:0 0 8px;color:#f4f6f9}.onboard>p{color:var(--text-dim);margin:0 0 28px;font-size:14px}.ob-card{background:var(--bg-side);border:1px solid var(--border);border-radius:var(--r-card);padding:20px 22px;margin-bottom:14px}.ob-card h3{margin:0 0 6px;font-size:14.5px;font-weight:600}.ob-card p{margin:0 0 14px;font-size:13px;color:var(--text-dim)}.ob-alt{margin:12px 0 0}.ob-alt a{color:var(--text-faint);font-size:12.5px;font-weight:600;text-decoration:none}.ob-alt a:hover{color:var(--text)}.pbtn{display:inline-flex;align-items:center;gap:6px;flex:none;height:32px;padding:0 14px;border-radius:var(--r-ctl);border:none;background:var(--accent);color:#241704;font-size:13px;font-weight:600;cursor:pointer;white-space:nowrap}.pbtn:hover{background:var(--accent-bright)}.pbtn .ico{width:15px;height:15px}.danger-btn{display:inline-flex;align-items:center;height:32px;padding:0 14px;border-radius:var(--r-ctl);border:none;background:#b3382e;color:#fff;font-size:13px;font-weight:600;cursor:pointer}.danger-btn:hover{background:#c94336}[data-slot=input],[data-slot=textarea]{font:inherit;color:var(--text)}[data-slot=input][aria-invalid=true]:focus-visible,[data-slot=textarea][aria-invalid=true]:focus-visible{border-color:var(--del)}[data-slot=card],[data-slot=dropdown-menu-content]{border-color:var(--border)}.project-settings{display:flex;flex-direction:column;gap:14px}.project-settings>h2{font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 4px;color:#f4f6f9}.ps-form{display:flex;flex-direction:column;gap:18px}.ps-field{display:flex;flex-direction:column;gap:7px}.ps-field label{font-size:12.5px;color:var(--text-dim)}.ps-opt{color:var(--text-ghost);font-weight:400}.ps-icon-row{display:flex;align-items:center;gap:10px}.ps-icon-row .proj-mark{width:26px;height:26px;border-radius:7px}.ps-icon-row .proj-mark svg{width:15px;height:15px}.ps-meta{display:flex;align-items:baseline;justify-content:space-between;gap:12px}.ps-meta .field-err{flex:0 1 auto;margin:0}.ps-count{font-size:11.5px;color:var(--text-faint);font-variant-numeric:tabular-nums}.ps-actions{display:flex;justify-content:flex-end}.ps-icon-grid{display:grid;grid-template-columns:repeat(6,30px);gap:4px;padding:8px}.ps-icon-cell{display:grid;place-items:center;width:30px;height:30px;border-radius:7px;border:1px solid transparent;background:none;color:var(--text-dim);cursor:pointer}.ps-icon-cell svg{width:16px;height:16px}.ps-icon-cell:hover{background:var(--hover);color:var(--text)}.ps-icon-cell.active{border-color:var(--accent);color:var(--accent-bright)}.ps-danger [data-slot=card-title]{font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;color:#d2695e;font-weight:600}.ps-chip{margin-left:10px;padding:2px 8px;border-radius:999px;border:1px solid var(--border);background:var(--surface);color:var(--text-faint);font-size:11px;font-weight:600;letter-spacing:.02em;vertical-align:middle}.ps-people h4{font-size:12.5px;font-weight:600;color:var(--text-dim);margin:0}.ps-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:13px;color:var(--text-dim);margin:0 0 10px}.ps-people select{height:28px;padding:0 8px;border-radius:6px;border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:12.5px}.ps-people select:disabled{opacity:.6;cursor:default}.ps-note{color:var(--text-faint);font-size:12.5px;margin:0 0 12px;max-width:56ch;line-height:1.55}.ps-people-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:20px 0 8px}.ps-danger p{color:var(--text-dim);font-size:13px;margin:0 0 14px;max-width:52ch;line-height:1.55}.ps-facts{display:grid;grid-template-columns:auto 1fr;gap:8px 20px;margin:0;font-size:13px}.ps-facts dt{color:var(--text-faint)}.ps-facts dd{margin:0;color:var(--text-dim)}.admin h1{font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 6px;color:#f4f6f9}.admin h3{font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;color:var(--text-faint);font-weight:600;margin:30px 0 10px}.admin-lbl{flex:1 1 100%;margin:0 0 6px;font-size:12.5px;font-weight:600;color:var(--text-dim)}.admin-sub{color:var(--text-dim);font-size:13.5px;margin:-2px 0 16px;line-height:1.55}.admin-h{display:flex;align-items:center;justify-content:space-between;margin:30px 0 10px}.admin-h h3{margin:0}.admin-row{display:flex;gap:9px;margin-bottom:8px}.admin-row input{flex:1;height:34px;padding:0 12px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:13px;outline:none}.admin-row input:focus{border-color:var(--accent);background:var(--hover)}.admin-list{border:1px solid var(--border);border-radius:var(--r-card);overflow:hidden;background:var(--bg-side)}.admin-list.admin-card-table{overflow-x:auto;overflow-y:hidden}.admin-item{display:flex;align-items:center;gap:11px;padding:11px 14px;border-bottom:1px solid var(--border);font-size:13.5px}.modal-actions .ai-btn{height:32px}.empty a{color:var(--accent);text-decoration:none;display:inline-block;padding:6px 10px}.empty a:hover{text-decoration:underline}.empty h3{margin:0 0 8px;font-size:16px;color:var(--text)}.ai-copy{text-align:left;background:none;border:0;padding:6px 0;cursor:pointer}.ai-copy:hover{color:var(--text)}a.ai-main{color:var(--text-dim);text-decoration:none;padding:6px 0}a.ai-main:hover{color:var(--accent)}.th-sort{display:block;width:100%;text-align:left;background:none;border:0;padding:6px 10px;font:inherit;color:inherit;letter-spacing:inherit;text-transform:inherit;cursor:pointer}.th-sort:hover{color:var(--text-dim)}.proj-trigger>[data-slot=select-value]{display:block;flex:1 1 auto;min-width:0;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.role-cell{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center;justify-items:start}.admin-table td .role-static{text-align:left}.role-chip-row{margin:-6px 0 12px}.role-chip{margin-left:0;padding:2px 8px;border:1px solid var(--border-2);border-radius:99px;vertical-align:middle}.ext{margin-left:4px;color:var(--text-faint);font-size:11px}.admin-item:last-child{border-bottom:none}.admin-item:hover{background:var(--hover)}.field-err{flex:1 1 100%;margin:6px 0 0}.admin-row{flex-wrap:wrap}.admin-row input[aria-invalid=true]{border-color:var(--del)}.ai-main{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}.admin-item>.ai-main{flex:1 1 55%;min-width:22ch}.admin-item>.ai-tag{flex:0 0 auto;min-width:0;max-width:45%}@media(max-width:1000px){.admin-item{flex-wrap:wrap}.admin-item>.ai-tag{flex:1 1 100%;max-width:100%}}.admin-table td .ai-main{min-width:0}.ai-main.mono{font:12px var(--mono);color:var(--text-dim);cursor:pointer}.ai-tag{font-size:11.5px;color:var(--text-faint);flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.admin-item select{height:28px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:0 8px;font:inherit;font-size:12.5px;cursor:pointer}.admin-item select:hover{border-color:var(--border-2)}.ai-btn,.ai-del{flex:none;height:27px;padding:0 11px;border-radius:6px;border:1px solid var(--border);background:var(--surface);color:var(--text-dim);font:inherit;font-size:12px;font-weight:500;cursor:pointer}.ai-del{color:var(--del);border-color:#f26d6d47}.ai-del:hover{background:#f26d6d1f;border-color:var(--del);color:#ff8b8b}.ai-btn:hover{background:var(--hover);color:var(--text);border-color:var(--border-2)}.admin-empty{padding:14px;color:var(--text-faint);font-size:13px}.admin-item.toggle{cursor:pointer;align-items:flex-start}.admin-item.toggle .ai-main{white-space:normal}.tg-label{font-size:13.5px;font-weight:550;color:var(--text)}.tg-desc{font-size:12px;color:var(--text-faint);margin-top:3px;line-height:1.5}.admin-item.toggle input{margin-top:2px;flex:none}.dl-title{display:flex;align-items:center;gap:10px;font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 4px;color:#f4f6f9}.dl-title-icon{display:flex;color:var(--accent)}.dl-title-icon .ico{width:20px;height:20px}.dl-sub{color:var(--text-faint);font-size:12.5px;margin:0 0 18px}.dl-items{border:1px solid var(--border);border-radius:var(--r-card);overflow:hidden;background:var(--bg-side)}.dl-row{display:flex;align-items:center;gap:11px;padding:10px 14px;border-bottom:1px solid var(--border);cursor:pointer}.dl-row:last-child{border-bottom:none}.dl-row:hover{background:var(--hover)}.dl-row .ticon{flex:none;display:flex;color:var(--text-ghost)}.dl-row .ticon .ico{width:16px;height:16px}.dl-row:hover .ticon{color:var(--text-faint)}.dl-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13.5px;color:var(--text)}.dl-meta{flex:none;font-size:12px;color:var(--text-faint);font-variant-numeric:tabular-nums}.heatdot{flex:none;width:7px;height:7px;border-radius:50%;background:var(--accent)}.heatdot.lvl1{opacity:.3}.heatdot.lvl2{opacity:.55}.heatdot.lvl3{opacity:.8}.heatdot.lvl4{opacity:1;box-shadow:0 0 6px #f5a6238c}.dl-empty{padding:24px 14px;color:var(--text-faint);font-size:13px;border:1px dashed var(--border);border-radius:var(--r-card);text-align:center}.dl-h3{margin:28px 0 8px;font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;color:var(--text-faint);font-weight:600}.dl-hlist{border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);overflow:hidden;max-width:none}.dl-hlist .hentry:last-child{border-bottom:none}.hentry.clickable{cursor:pointer}.hentry.clickable:hover{background:var(--hover)}.dl-more{margin-top:10px}#vault-name.vault-link{cursor:pointer}#vault-name.vault-link:hover{color:var(--accent-bright)}#account-btn.active{background:var(--glow)}#account-btn.active .acct b{color:var(--accent-bright)}.gd-body{margin-top:18px}.gd-desc{margin:2px 0 8px;color:var(--text-faint);font-size:13px;line-height:1.5}.gd-list{margin:4px 0 8px;padding-left:18px;display:grid;gap:6px}.gd-code{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:10px;margin:6px 0 10px;padding:10px 12px;background:var(--bg-raise);border:1px solid var(--border);border-radius:var(--r-card);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12.5px;line-height:1.6;color:var(--text)}.gd-code>code{display:block;min-width:0;overflow-x:auto;white-space:pre}.gd-copy{align-self:start;font:inherit;font-family:inherit;font-size:11px;font-weight:600;padding:3px 9px;border-radius:6px;border:1px solid var(--border-2);background:var(--bg-raise);color:var(--text-faint);cursor:pointer}.gd-copy:hover{color:var(--accent-bright);border-color:var(--accent-dim)}.gd-manual{margin:10px 0 0}.gd-manual>summary{display:inline-block;font-size:12.5px;font-weight:600;color:var(--text-faint);cursor:pointer;padding:4px 0}.gd-manual>summary:before{content:"▸ ";color:var(--text-ghost)}.gd-manual[open]>summary:before{content:"▾ "}.gd-manual>summary:hover{color:var(--text)}.home-insights{margin-top:30px;padding-top:22px;border-top:1px solid var(--border)}.in-title{font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 4px;color:#f4f6f9}.in-title .in-scope{color:var(--text-ghost);font-weight:500;font-size:15px}.gd-head{display:flex;align-items:center;gap:9px}.gd-head .proj-mark{width:22px;height:22px;border-radius:6px}.gd-head .proj-mark svg{width:13px;height:13px}.in-desc{color:var(--text-dim);font-size:13.5px;line-height:1.55;margin:0 0 10px;max-width:62ch}.in-lens{display:flex;gap:6px;margin:0 0 14px}.in-lens-btn{font:inherit;font-size:12px;padding:5px 12px;border-radius:999px;border:1px solid var(--border);background:none;color:var(--text-faint);cursor:pointer}.in-lens-btn:hover{color:var(--text)}.in-lens-btn.active{color:var(--accent);border-color:var(--accent)}.in-chart{width:100%;max-width:760px;height:auto;border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);margin-bottom:6px}.in-axis{stroke:var(--border);stroke-width:1}.in-threshold{stroke:var(--border);stroke-width:1;stroke-dasharray:4 4}.in-danger-zone{fill:#f26d6d0d}.in-label{fill:var(--text-ghost);font-size:11px}.in-quad{fill:var(--text-ghost);font-size:10.5px;text-transform:uppercase;letter-spacing:.06em}.in-quad-danger{fill:#e07070}.in-pt{fill:var(--accent);opacity:.5;cursor:pointer}.in-pt:hover{opacity:1}.in-pt.cold{fill:var(--text-ghost);opacity:.25}.in-pt.danger{fill:#e05d5d;opacity:.6}.in-treemap{background:#0c0d10}.in-tm-group{fill:none;stroke:var(--border);stroke-width:1;cursor:pointer;pointer-events:all}.in-tm-glabel{fill:var(--text-faint);font-size:10px;text-transform:uppercase;letter-spacing:.05em;cursor:pointer}.in-tm-cell{cursor:pointer}.in-tm-cell:hover{stroke:#fff;stroke-width:1}.in-tm-label{fill:#0c0d10;font-size:10.5px;font-weight:620;cursor:pointer;pointer-events:none}.in-hotpath{border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);overflow:hidden}.in-hp-row{display:flex;align-items:center;gap:10px;padding:6px 12px;border-bottom:1px solid var(--border);cursor:pointer}.in-hp-row:last-child{border-bottom:none}.in-hp-row:hover{background:var(--hover)}.in-hp-name{flex:0 0 300px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;color:var(--text)}.in-hp-name.danger{color:var(--accent)}.in-hp-bar{flex:1;display:flex;height:10px;border-radius:3px;overflow:hidden}.in-hp-agent{background:var(--accent)}.in-hp-human{background:#5b8def}.in-hp-count{flex:none;width:40px;text-align:right;font-size:11.5px;color:var(--text-faint);font-variant-numeric:tabular-nums}.in-legend{margin:8px 2px 0;font-size:11.5px;color:var(--text-faint)}.in-sw{display:inline-block;width:10px;height:10px;border-radius:2px;vertical-align:-1px}.in-sw.agent{background:var(--accent)}.in-sw.human{background:#5b8def}.in-matrix rect{transition:opacity .1s}.in-matrix rect:hover{opacity:.85}.hentry{padding:11px 12px;border-bottom:1px solid var(--border);--hindent: 72px}.hentry:hover{background:#ffffff04}.hline{display:flex;gap:10px;align-items:center}.hkind{flex:none;width:62px;white-space:nowrap;text-align:center;font-size:10px;text-transform:uppercase;letter-spacing:.06em;font-weight:600;padding:2px 6px;border-radius:4px;color:var(--add);background:#4cc38a1f}.hentry.edit .hkind{color:var(--accent-bright);background:var(--glow)}.hentry.delete .hkind{color:#ff8b8b;background:#f26d6d1f}.hpath{font-weight:500;cursor:pointer;color:var(--text);font-size:13px}.hpath:hover{color:var(--accent-bright)}.htime{margin-left:auto;color:var(--text-faint);font-size:12px;font-variant-numeric:tabular-nums}.hmeta{display:flex;align-items:center;gap:14px;margin-top:4px;padding-left:var(--hindent);font-size:12px;color:var(--text-dim)}.hdev,.hsize{color:var(--text-faint)}.hsize{font-variant-numeric:tabular-nums;white-space:nowrap;flex:none}.hnote{margin-top:4px;padding-left:var(--hindent);font-size:12px;color:var(--text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.hnote:hover{color:var(--text)}.hnote.open{white-space:normal;overflow-wrap:anywhere}.hnote:before{content:"›";display:inline-block;margin-right:5px;color:var(--text-ghost);transition:transform .12s}.hnote.open:before{transform:rotate(90deg)}.hnote a{color:var(--accent-bright);text-decoration:none}.hnote a:hover{text-decoration:underline}.hrun{border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);margin:10px 0;overflow:hidden}.hrun-head{display:flex;align-items:center;gap:9px;width:100%;padding:9px 12px;color:var(--text);font-size:12.5px}.hrun-toggle{display:flex;flex:none;padding:2px;border:none;border-radius:4px;background:none;color:var(--text-faint);cursor:pointer}.hrun-toggle:hover{color:var(--text);background:var(--hover)}.hrun-toggle .ico{width:13px;height:13px}.hrun-note{font-weight:560;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:46%}.hrun-note a{color:var(--accent-bright);text-decoration:none}.hrun-note a:hover{text-decoration:underline}.hrun-meta{color:var(--text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hrun-time{margin-left:auto;flex:none;color:var(--text-faint);font-variant-numeric:tabular-nums}.hrun-body{border-top:1px solid var(--border)}.hrun-body .hentry:last-child{border-bottom:none}.hrestore-btn{display:inline-flex;align-items:center;gap:4px;margin-left:auto;padding:2px 8px 2px 5px;border:1px solid var(--border);border-radius:5px;background:none;color:var(--text-faint);font:inherit;font-size:12px;cursor:pointer}.hrestore-btn:hover{color:var(--accent-bright);border-color:var(--border-2);background:var(--hover)}.hrestore-btn:disabled{opacity:.5;cursor:default}.hrestore-btn .ico{width:12px;height:12px}.hrestore-gap{margin-left:auto;color:var(--text-ghost);font-size:11.5px}.hactions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:6px 0 0 23px}.hdiff-btn,.hver-btn{display:inline-flex;align-items:center;gap:4px;padding:2px 7px 2px 4px;border:1px solid var(--border);border-radius:5px;background:none;color:var(--text-faint);font:inherit;font-size:12px;cursor:pointer;text-decoration:none}.hdiff-btn:hover,.hver-btn:hover{color:var(--text);border-color:var(--border-2);background:var(--hover)}.hdiff-btn .ico,.hver-btn .ico{width:12px;height:12px}.hdiff-none{flex-basis:100%;font-size:12px;color:var(--text-ghost)}.dv{margin:8px 0 2px 23px;border:1px solid var(--border);border-radius:6px;overflow:hidden}.dv-msg{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:9px 11px;font-size:12px;color:var(--text-faint)}.dv-dl{display:flex;gap:12px}.dv-msg a{color:var(--accent-bright);text-decoration:none}.dv-msg a:hover{text-decoration:underline}.dv-head{display:flex;align-items:center;gap:10px;padding:5px 11px;border-bottom:1px solid var(--border);font-size:11px;font-variant-numeric:tabular-nums}.dv-add{color:var(--add);font-weight:600}.dv-del{color:var(--del);font-weight:600}.dv-same{color:var(--text-ghost)}.dv-body{overflow-x:auto;padding:4px 0}.dv-line{display:flex;font-family:var(--mono);font-size:12px;line-height:1.55;white-space:pre}.dv-n{flex:none;width:34px;padding-right:8px;text-align:right;color:var(--text-ghost);-webkit-user-select:none;user-select:none;font-variant-numeric:tabular-nums}.dv-mark{flex:none;width:16px;text-align:center;-webkit-user-select:none;user-select:none}.dv-text{padding-right:12px}.dv-ins{background:#4cc38a1a;color:var(--add)}.dv-rm{background:#f26d6d1a;color:#ff8b8b}.dv-ctx{color:var(--text-dim)}#palette{position:fixed;top:12vh;left:50%;transform:translate(-50%);z-index:151;display:block;width:min(560px,92vw);background:var(--bg-raise);border:1px solid var(--border-2);border-radius:var(--r-over);box-shadow:0 24px 70px -18px #000c;overflow:hidden;outline:none;padding:0}#palette-inputwrap{display:flex;align-items:center;gap:11px;padding:14px 16px;border-bottom:1px solid var(--border)}#palette-inputwrap [data-slot=command-input-wrapper]{flex:1;display:flex;border-bottom:0;padding:0;height:auto}#palette-inputwrap [data-slot=command-input-wrapper]>svg:not(.ico){display:none}#palette input,#palette input:focus{border:none;background:transparent;box-shadow:none;outline:none;padding:0}#palette-inputwrap .ico{width:17px;height:17px;color:var(--text-faint)}#palette-input{flex:1;width:100%;border:none;background:transparent;color:var(--text);font:inherit;font-size:15px;letter-spacing:-.01em;outline:none;padding:0}#palette-input::placeholder{color:var(--text-ghost)}#palette-results{list-style:none;margin:0;padding:8px;max-height:46vh;overflow-y:auto}#palette-results [cmdk-item]{display:flex;align-items:center;gap:11px;height:38px;padding:0 10px;border-radius:9px;cursor:pointer;color:var(--text-dim);font-size:13.5px}#palette-results [cmdk-item][data-selected=true]{background:var(--glow)}#palette-results [cmdk-item][data-selected=true] .picon{color:var(--accent)}#palette-results [cmdk-item][data-selected=true] .plabel,#palette-results [cmdk-item][data-selected=true] .plabel b{color:var(--accent-bright)}#palette-results li{display:flex;align-items:center;gap:11px;height:38px;padding:0 10px;border-radius:9px;cursor:pointer;color:var(--text-dim);font-size:13.5px}#palette-results li.selected{background:var(--glow)}#palette-results li.selected .picon{color:var(--accent)}#palette-results li.selected .plabel,#palette-results li.selected .plabel b{color:var(--accent-bright)}#palette-results li .picon{width:18px;flex:none;display:flex;justify-content:center;color:var(--text-faint)}#palette-results li .picon .ico{width:15px;height:15px}#palette-results li .plabel{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text)}#palette-results li .plabel b{color:var(--accent-bright);font-weight:600}#palette-results li .pkind{flex:none;font-size:10.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-ghost)}#palette-results .pempty{color:var(--text-faint);cursor:default;justify-content:center;height:auto;padding:14px}#palette-hint{padding:9px 16px;border-top:1px solid var(--border);font-size:11px;color:var(--text-ghost)}[data-slot=dialog-overlay]{position:fixed;inset:0;background:#06070999;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);z-index:150}.modal{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:151;display:block;background:var(--bg-raise);border:1px solid var(--border-2);border-radius:var(--r-over);padding:22px 24px;width:min(460px,calc(100vw - 40px));box-shadow:0 24px 70px -18px #000c;outline:none}.modal h3{margin:0 0 10px;font-size:16px;font-weight:620;letter-spacing:-.01em}.modal p{margin:0 0 16px;font-size:13.5px;color:var(--text-dim);line-height:1.55}.modal p b{color:var(--text)}.modal-url{font:12px var(--mono);background:var(--surface);border:1px solid var(--border);border-radius:var(--r-ctl);padding:9px 11px;color:var(--text-dim);word-break:break-all;margin-bottom:16px}.modal-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.modal-expiry{display:flex;align-items:center;gap:8px;margin-bottom:16px;font-size:12.5px;color:var(--text-dim)}.modal-expiry select{height:28px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:0 8px;font:inherit;font-size:12.5px;cursor:pointer}.modal-expiry select:disabled{opacity:.6;cursor:default}.modal-expiry-note{margin-left:auto;color:var(--text-dim)}.modal-label{display:block;font-size:12.5px;color:var(--text-dim);margin:0 0 6px}.modal-msg{margin:0 0 16px;font-size:13.5px;color:var(--text-dim);line-height:1.55}.modal-input{width:100%;height:36px;padding:0 12px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:14px;margin-bottom:16px;outline:none}.modal-input:focus{border-color:var(--accent);background:var(--hover)}[data-sonner-toast]{background:var(--bg-raise)!important;color:var(--text)!important;border:1px solid var(--border-2)!important;border-radius:10px!important;font-size:13.5px!important;box-shadow:0 18px 44px -12px #000000b3!important}[data-sonner-toast][data-type=error]{border-color:#f26d6d80!important;color:#ffb0aa!important}#sb-backdrop{display:none}@media(max-width:900px){#sidebar{position:fixed;z-index:60;top:0;left:0;height:100%;transform:translate(-100%);transition:transform .2s ease;box-shadow:0 0 40px #0009}body.sb-open #sidebar{transform:translate(0)}body.sb-open #sb-backdrop{display:block;position:fixed;inset:0;background:#0000008c;z-index:50}.icon-btn,#search-btn{display:inline-flex;width:44px;height:44px}#content{padding:24px 18px 70px}#topbar{padding:0 8px;gap:4px}.btn .lbl{display:none}#topbar .btn{min-width:44px;min-height:44px;padding:0;justify-content:center;gap:0}#topbar .btn .ico{width:18px;height:18px}#more-btn:not([hidden]){display:inline-flex}#history-btn,#upload-btn,#download{display:none!important}#meta{display:none}#crumb{flex:1}#vault{padding:0 8px 0 12px}.icon-btn2,#signout,#tree .row,#projects .row{height:44px}#account-btn,#project-select{min-height:44px}.nav-add{min-width:44px;min-height:44px}.markdown table,pre.plain{display:block;overflow-x:auto;max-width:100%}.admin-item{flex-wrap:wrap;row-gap:8px;padding:12px 14px}.admin-item select{height:44px}.ai-btn,.ai-del{height:auto;min-height:44px;padding:0 12px}.admin-table thead{display:none}.admin-table,.admin-table tbody,.admin-table td{display:block;width:auto}.admin-table tr.admin-item{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.admin-table tr.admin-item td{padding:0;border-bottom:none}.admin-table tr.admin-item td:first-child{flex:1 1 100%;width:auto}.admin-table tr.admin-item td:last-child{width:auto;text-align:left}[data-slot=dropdown-menu-item]{min-height:44px}#projects{flex:0 1 auto;max-height:none}.admin-row{flex-wrap:wrap}.admin-row input{flex:1 1 100%;min-height:44px}.admin-row button{flex:0 0 auto;align-self:flex-start;min-height:44px}.admin-item .ai-main{flex:1 1 100%;white-space:normal;overflow-wrap:anywhere}.admin-table td{white-space:normal}.admin-table td .ai-main,.admin-table td a.ai-main,.admin-table td .ai-copy,.admin-table td .ai-tag{white-space:normal;overflow-wrap:anywhere}.admin-item .ai-tag{flex:1 1 100%;max-width:100%;white-space:normal;overflow-wrap:anywhere}.ai-copy{min-height:44px;display:block;padding:12px 0;white-space:normal;overflow-wrap:anywhere;text-overflow:clip}a.ai-main{min-height:44px;display:flex;align-items:center}.gd-code{min-height:62px;padding-top:12px;padding-bottom:12px}.gd-copy{min-height:44px;padding:0 14px}.gd-tab{min-height:44px}.in-lens-btn{min-height:44px;padding:0 14px}.modal-input{height:44px}.modal-actions button{height:auto;min-height:44px}.modal-expiry select{height:44px}.pbtn,#palette-results li{height:auto;min-height:44px}.more-item{min-height:44px}}.modal-actions .ai-del{margin-right:auto}@media(max-width:430px){.dl-row{flex-wrap:wrap;row-gap:2px}.dl-meta{flex:1 1 100%;padding-left:27px}.ai-tag{font-size:11px}.htime{white-space:nowrap;font-size:12px}.hline{flex-wrap:wrap}.hentry{--hindent: 0px}.modal-actions .ai-del{flex:0 0 100%;justify-content:center;text-align:center}}.markdown h1,.markdown h2,.markdown h3,.markdown h4{color:#f4f6f9;line-height:1.25;letter-spacing:-.018em;margin:1.5em 0 .5em;text-wrap:balance}.markdown h1:first-child{margin-top:0}.markdown h1{font-size:1.85em;font-weight:660;letter-spacing:-.024em}.markdown h2{font-size:1.32em;font-weight:620;margin-top:1.7em}.markdown h3{font-size:1.08em;font-weight:620}.markdown p,.markdown li{color:#c6cbd3;font-size:14.5px;line-height:1.72}.markdown p{margin:0 0 1em}.markdown strong{color:var(--text);font-weight:620}.markdown a{color:var(--accent-bright);text-decoration:none;border-bottom:1px solid rgba(245,166,35,.28)}.markdown a:hover{border-bottom-color:var(--accent)}.markdown ul,.markdown ol{margin:0 0 1em;padding-left:1.4em}.markdown li{margin-bottom:.4em}.markdown li::marker{color:var(--text-ghost)}.markdown code{background:var(--hover);border:1px solid var(--border);padding:.1em .4em;border-radius:5px;font:12.5px/1.5 var(--mono);color:#e4d9c4}.markdown pre{background:var(--code-bg);border:1px solid var(--border);border-radius:var(--r-card);padding:14px 16px;overflow-x:auto;margin:1.3em 0}.markdown pre code{background:none;border:none;padding:0;color:#c6cbd3}.markdown blockquote{margin:1.3em 0;padding:.3em 1em;border-left:2px solid var(--accent);background:linear-gradient(90deg,var(--glow),transparent);border-radius:0 8px 8px 0;color:#d8cdb6}.markdown blockquote p{margin:.3em 0;color:#d8cdb6}.markdown table{border-collapse:collapse;margin:1.3em 0;font-size:13.5px}.markdown th,.markdown td{border-bottom:1px solid var(--border);padding:9px 13px;text-align:left}.markdown th{color:var(--text-faint);font-size:11px;text-transform:uppercase;letter-spacing:.05em;font-weight:600;border-bottom-color:var(--border-2)}.markdown tr:hover td{background:#ffffff05}.markdown img{max-width:100%;border-radius:8px;border:1px solid var(--border)}.markdown hr{border:none;border-top:1px solid var(--border);margin:2.2em 0}.markdown table.frontmatter{margin:0 0 1.8em;font-size:12px;background:var(--surface);border:1px solid var(--border);border-radius:8px;border-collapse:separate;border-spacing:0}.markdown table.frontmatter th{text-transform:none;letter-spacing:0;font-size:11.5px;color:var(--text-faint);font-weight:600;text-align:left;white-space:nowrap;vertical-align:top;padding:6px 14px 6px 12px;border-bottom:1px solid var(--border)}.markdown table.frontmatter td{color:var(--text-dim);padding:6px 12px 6px 0;border-bottom:1px solid var(--border)}.markdown table.frontmatter tr:last-child th,.markdown table.frontmatter tr:last-child td{border-bottom:none}.markdown table.frontmatter code{white-space:pre-wrap;font-size:11px}.markdown .admin input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.admin input[aria-invalid=true]:focus-visible{outline-color:var(--del)}[role=dialog] input[aria-invalid=true]{border-color:var(--del)}[role=dialog] input[aria-invalid=true]:focus-visible{outline-color:var(--del)}button:disabled,.btn:disabled{cursor:default}input[type=checkbox]{accent-color:var(--accent)}.htmlview{display:block;width:100%;height:calc(100vh - 150px);border:1px solid var(--border);border-radius:var(--r-card);background:#fff}.notfound{margin-top:var(--hero-top);text-align:center;color:var(--text-dim)}.notfound h1{color:var(--text);font-size:1.4em;margin-bottom:.5em}.notfound code{background:var(--hover);border:1px solid var(--border);padding:.15em .5em;border-radius:6px}.notfound .nf-sub{max-width:440px;margin:12px auto 20px;font-size:13px;color:var(--text-faint);line-height:1.6}.vbanner{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 22px;padding:11px 14px;border:1px solid var(--accent-dim);border-radius:var(--r-card);background:var(--glow)}.vbanner .vb-icon{flex:none;display:flex;color:var(--accent-bright)}.vbanner .vb-text{flex:1 1 220px;min-width:0;display:flex;flex-direction:column;gap:1px;font-size:12.5px;line-height:1.45}.vbanner .vb-text b{color:var(--accent-bright);font-weight:600}.vbanner .vb-text span{color:var(--text-dim)}.vbanner .vb-actions{flex:none;display:flex;gap:8px}.vbanner .vb-actions .ai-btn{display:inline-flex;align-items:center;text-decoration:none}pre.plain{background:var(--code-bg);border:1px solid var(--border);border-radius:var(--r-card);padding:14px 16px;overflow-x:auto;font:12.5px/1.6 var(--mono);color:#c6cbd3;white-space:pre-wrap;overflow-wrap:anywhere}.filecard{margin-top:var(--hero-top);text-align:center;color:var(--text-dim)}.filecard .name{font-size:1.2em;color:var(--text);margin-bottom:.3em}.filecard .btn{margin-top:14px}
+@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-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking: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-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-lg:32rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-medium:500;--font-weight-semibold:600;--tracking-widest:.1em;--radius-xs:.125rem;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--color-background:#0a0b0d;--color-foreground:#eef0f3;--color-card:#15171b;--color-card-foreground:#eef0f3;--color-popover:#15171b;--color-popover-foreground:#eef0f3;--color-primary:#f5a623;--color-primary-foreground:#1a1204;--color-secondary:#ffffff08;--color-secondary-foreground:#eef0f3;--color-muted:#ffffff0f;--color-muted-foreground:#9aa0a9;--color-accent:#ffffff0f;--color-accent-foreground:#eef0f3;--color-destructive:#f26d6d;--color-border:#ffffff12;--color-input:#ffffff1c;--color-ring:#f5a623;--radius-ctl:7px}}@layer base,components;@layer utilities{.\@container\/card-header{container:card-header/inline-size}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:0}.top-4{top:calc(var(--spacing) * 4)}.top-20{top:calc(var(--spacing) * 20)}.top-\[50\%\]{top:50%}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.left-2{left:calc(var(--spacing) * 2)}.left-\[50\%\]{left:50%}.z-50{z-index:50}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.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}}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.my-1{margin-block:var(--spacing)}.mt-4{margin-top:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.field-sizing-content{field-sizing:content}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-px{height:1px}.max-h-\(--radix-dropdown-menu-content-available-height\){max-height:var(--radix-dropdown-menu-content-available-height)}.max-h-\(--radix-select-content-available-height\){max-height:var(--radix-select-content-available-height)}.max-h-\[300px\]{max-height:300px}.min-h-16{min-height:calc(var(--spacing) * 16)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.min-w-0{min-width:0}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.origin-\(--radix-dropdown-menu-content-transform-origin\){transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\(--radix-select-content-transform-origin\){transform-origin:var(--radix-select-content-transform-origin)}.origin-\(--radix-tooltip-content-transform-origin\){transform-origin:var(--radix-tooltip-content-transform-origin)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[calc\(-50\%_-_2px\)\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.resize{resize:both}.scroll-my-1{scroll-margin-block:var(--spacing)}.scroll-py-1{scroll-padding-block:var(--spacing)}.auto-rows-min{grid-auto-rows:min-content}.grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded-\[2px\]{border-radius:2px}.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)}.rounded-xs{border-radius:var(--radius-xs)}.border{border-style:var(--tw-border-style);border-width:1px}.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-input{border-color:var(--color-input)}.bg-background{background-color:var(--color-background)}.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-border{background-color:var(--color-border)}.bg-card{background-color:var(--color-card)}.bg-destructive{background-color:var(--color-destructive)}.bg-foreground{background-color:var(--color-foreground)}.bg-muted\/50{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--color-muted) 50%,transparent)}}.bg-popover{background-color:var(--color-popover)}.bg-primary{background-color:var(--color-primary)}.bg-secondary{background-color:var(--color-secondary)}.bg-transparent{background-color:#0000}.fill-current{fill:currentColor}.fill-foreground{fill:var(--color-foreground)}.p-0{padding:0}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-6{padding:calc(var(--spacing) * 6)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-6{padding-block:calc(var(--spacing) * 6)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.align-middle{vertical-align:middle}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-none{--tw-leading:1;line-height:1}.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-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.whitespace-nowrap{white-space:nowrap}.text-background{color:var(--color-background)}.text-card-foreground{color:var(--color-card-foreground)}.text-destructive{color:var(--color-destructive)}.text-foreground{color:var(--color-foreground)}.text-muted-foreground{color:var(--color-muted-foreground)}.text-popover-foreground{color:var(--color-popover-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-secondary-foreground{color:var(--color-secondary-foreground)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.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-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-offset-background{--tw-ring-offset-color:var(--color-background)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background-color\,border-color\,color\]{transition-property:background-color,border-color,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;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))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.running{animation-play-state:running}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.selection\:bg-primary ::selection{background-color:var(--color-primary)}.selection\:bg-primary::selection{background-color:var(--color-primary)}.selection\:text-primary-foreground ::selection{color:var(--color-primary-foreground)}.selection\:text-primary-foreground::selection{color:var(--color-primary-foreground)}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-7::file-selector-button{height:calc(var(--spacing) * 7)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--color-foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--color-muted-foreground)}@media(hover:hover){.hover\:bg-accent:hover{background-color:var(--color-accent)}.hover\:bg-destructive\/90:hover{background-color:#f26d6de6}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--color-destructive) 90%,transparent)}}.hover\:bg-muted\/50:hover{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--color-muted) 50%,transparent)}}.hover\:bg-primary\/90:hover{background-color:#f5a623e6}@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-secondary\/80:hover{background-color:#ffffff06}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--color-secondary) 80%,transparent)}}.hover\:text-accent-foreground:hover{color:var(--color-accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.focus\:bg-accent:focus{background-color:var(--color-accent)}.focus\:text-accent-foreground:focus{color:var(--color-accent-foreground)}.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-ring:focus{--tw-ring-color:var(--color-ring)}.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\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:border-ring:focus-visible{border-color:var(--color-ring)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + 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-destructive\/20:focus-visible{--tw-ring-color:#f26d6d33}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-destructive) 20%, transparent)}}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:#f5a62380}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-ring) 50%, transparent)}}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.has-aria-expanded\:bg-muted\/50:has([aria-expanded=true]){background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.has-aria-expanded\:bg-muted\/50:has([aria-expanded=true]){background-color:color-mix(in oklab,var(--color-muted) 50%,transparent)}}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-\[\>svg\]\:px-1\.5:has(>svg){padding-inline:calc(var(--spacing) * 1.5)}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing) * 2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing) * 4)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--color-destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:#f26d6d33}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--color-destructive) 20%, transparent)}}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\[disabled\=true\]\:opacity-50[data-disabled=true]{opacity:.5}.data-\[error\=true\]\:text-destructive[data-error=true]{color:var(--color-destructive)}.data-\[inset\]\:pl-8[data-inset]{padding-left:calc(var(--spacing) * 8)}.data-\[orientation\=horizontal\]\:h-px[data-orientation=horizontal]{height:1px}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:w-px[data-orientation=vertical]{width:1px}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--color-muted-foreground)}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:var(--color-accent)}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:var(--color-accent-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.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\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.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-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[size\=default\]\:h-9[data-size=default]{height:calc(var(--spacing) * 9)}.data-\[size\=sm\]\:h-8[data-size=sm]{height:calc(var(--spacing) * 8)}:is(.\*\*\:data-\[slot\=command-input-wrapper\]\:h-12 *)[data-slot=command-input-wrapper]{height:calc(var(--spacing) * 12)}:is(.\*\:data-\[slot\=select-value\]\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\*\:data-\[slot\=select-value\]\:flex>*)[data-slot=select-value]{display:flex}:is(.\*\:data-\[slot\=select-value\]\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\*\:data-\[slot\=select-value\]\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing) * 2)}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--color-accent)}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:var(--color-accent-foreground)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--color-muted-foreground)}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--color-muted)}.data-\[variant\=destructive\]\:text-destructive[data-variant=destructive]{color:var(--color-destructive)}.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:#f26d6d1a}@supports (color:color-mix(in lab,red,red)){.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--color-destructive) 10%,transparent)}}.data-\[variant\=destructive\]\:focus\:text-destructive[data-variant=destructive]:focus{color:var(--color-destructive)}@media(min-width:40rem){.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:text-left{text-align:left}}@media(min-width:48rem){.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media(prefers-color-scheme:dark){.dark\:border-input{border-color:var(--color-input)}.dark\:bg-destructive\/60{background-color:#f26d6d99}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/60{background-color:color-mix(in oklab,var(--color-destructive) 60%,transparent)}}.dark\:bg-input\/30{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30{background-color:color-mix(in oklab,var(--color-input) 30%,transparent)}}@media(hover:hover){.dark\:hover\:bg-accent\/50:hover{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-accent\/50:hover{background-color:color-mix(in oklab,var(--color-accent) 50%,transparent)}}.dark\:hover\:bg-input\/50:hover{background-color:#ffffff0e}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:hover{background-color:color-mix(in oklab,var(--color-input) 50%,transparent)}}}.dark\:focus-visible\:ring-destructive\/40:focus-visible{--tw-ring-color:#f26d6d66}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-destructive) 40%, transparent)}}.dark\:aria-invalid\:ring-destructive\/40[aria-invalid=true]{--tw-ring-color:#f26d6d66}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--color-destructive) 40%, transparent)}}.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20[data-variant=destructive]:focus{background-color:#f26d6d33}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--color-destructive) 20%,transparent)}}}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:var(--color-muted-foreground)}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--spacing) * 5)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--spacing) * 5)}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:calc(var(--spacing) * 12)}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-block:calc(var(--spacing) * 3)}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:calc(var(--spacing) * 5)}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:calc(var(--spacing) * 5)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground svg:not([class*=text-]){color:var(--color-muted-foreground)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\.border-b\]\:pb-6.border-b{padding-bottom:calc(var(--spacing) * 6)}.\[\.border-t\]\:pt-6.border-t{padding-top:calc(var(--spacing) * 6)}:is(.\*\:\[span\]\:last\:flex>*):is(span):last-child{display:flex}:is(.\*\:\[span\]\:last\:items-center>*):is(span):last-child{align-items:center}:is(.\*\:\[span\]\:last\:gap-2>*):is(span):last-child{gap:calc(var(--spacing) * 2)}:is(.data-\[variant\=destructive\]\:\*\:\[svg\]\:text-destructive\![data-variant=destructive]>*):is(svg){color:var(--color-destructive)!important}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y:2px;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}@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-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{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:"";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:"";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:"";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-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}:root{--bg: #0a0b0d;--bg-side: #0c0e10;--bg-raise: #15171b;--surface: rgba(255,255,255,.03);--hover: rgba(255,255,255,.06);--border: rgba(255,255,255,.07);--border-2: rgba(255,255,255,.11);--code-bg: #0d0f12;--text: #eef0f3;--text-dim: #9aa0a9;--text-faint: #868b93;--text-ghost: #666b74;--accent: #f5a623;--accent-bright: #ffcf85;--accent-dim: #d3861a;--accent-press: #e0951a;--glow: rgba(245,166,35,.13);--add: #4cc38a;--del: #f26d6d;--mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;--ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;--r-ctl: 7px;--r-card: 10px;--r-over: 14px;--page-read: 768px;--page-app: 768px;--page-wide: 1200px;--hero-top: clamp(32px, 8vh, 88px)}@font-face{font-family:"Jersey 10";font-style:normal;font-weight:400;font-display:swap;src:url(/assets/jersey-10-COnnvJff.woff2) format("woff2")}@font-face{font-family:Logo Fallback;src:local("Helvetica Neue"),local("Arial"),local("Segoe UI"),local("Roboto");size-adjust:73%}*{box-sizing:border-box}[hidden]{display:none!important}html,body{height:100%;margin:0}#root{display:contents}body{display:flex;background:var(--bg);color:var(--text);font:13px/1.5 var(--ui);letter-spacing:-.006em;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}::selection{background:var(--glow);color:var(--accent-bright)}:focus-visible{outline:2px solid var(--accent);outline-offset:1px;border-radius:5px}:focus-visible{outline-color:var(--accent)}.admin input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}input[type=checkbox]{accent-color:var(--accent);width:20px;height:20px;color-scheme:dark}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.sprite{position:absolute}.ico{width:16px;height:16px;flex:none;stroke:currentColor;stroke-width:1.6;fill:none;stroke-linecap:round;stroke-linejoin:round}button,input,a.btn{font-family:inherit}#sidebar{width:264px;min-width:210px;background:var(--bg-side);border-right:1px solid var(--border);display:flex;flex-direction:column;overflow:hidden}#vault{display:flex;align-items:center;gap:9px;height:52px;padding:0 12px 0 14px;border-bottom:1px solid var(--border);position:relative;z-index:45}#vault-badge{flex:none;display:grid;place-items:center;color:var(--accent)}#vault-name{font-family:"Jersey 10","Logo Fallback",var(--ui);font-size:18px;font-weight:400;font-synthesis:none;letter-spacing:.01em;line-height:1;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vault-actions{display:flex;align-items:center;gap:4px}#vault #signout,.icon-btn2{width:28px;height:28px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;color:var(--text-ghost);background:transparent;border:none;cursor:pointer;text-decoration:none}#vault #signout:hover,.icon-btn2:hover{color:var(--text);background:var(--hover)}#vault #signout .ico,.icon-btn2 .ico{width:16px;height:16px}#projects{flex:none;max-height:32%;overflow-y:auto;padding:10px 8px 8px;border-bottom:1px solid var(--border)}.nav-head{display:flex;align-items:center;justify-content:space-between;padding:6px 8px;font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:.07em;color:var(--text-faint)}.nav-add{display:grid;place-items:center;width:18px;height:18px;border:none;background:transparent;color:var(--text-ghost);cursor:pointer;border-radius:5px}.nav-add .ico{width:14px;height:14px}.nav-add:hover{color:var(--text);background:var(--hover)}#projects ul{list-style:none;margin:0;padding:0}#projects .row{display:flex;align-items:center;gap:9px;height:31px;padding:0 8px;border-radius:7px;color:var(--text-dim);cursor:pointer;position:relative;white-space:nowrap;overflow:hidden}.proj-mark{width:17px;height:17px;border-radius:5px;flex:none;display:grid;place-items:center;font-size:10px;font-weight:700;color:#0a0b0d;letter-spacing:-.02em;text-transform:uppercase}.proj-mark svg{width:11px;height:11px}.proj-menu [data-slot=select-item]{display:flex;align-items:center;gap:8px}#projects .row .label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}#projects .row:hover{background:var(--hover);color:var(--text)}#projects .row.active{background:var(--glow);color:var(--accent-bright)}#projects .row.active:before{content:"";position:absolute;left:0;top:6px;bottom:6px;width:2px;border-radius:2px;background:var(--accent)}#tree{flex:1;overflow-y:auto;padding:8px 8px 24px}.tguide{position:absolute;top:0;bottom:0;width:1px;background:var(--border);pointer-events:none}#tree .row{display:flex;align-items:center;gap:6px;height:28px;padding:0 8px;border-radius:7px;color:var(--text-dim);cursor:pointer;position:relative;white-space:nowrap;overflow:hidden}#tree .row:hover{background:var(--hover);color:var(--text)}#tree .row.active{background:var(--glow);color:var(--accent-bright)}#tree .row.active:before{content:"";position:absolute;left:0;top:5px;bottom:5px;width:2px;border-radius:2px;background:var(--accent)}#tree .chev{width:14px;height:14px;flex:none;color:var(--text-ghost);transition:transform .12s;display:flex;align-items:center;justify-content:center}#tree .chev .ico{width:13px;height:13px}#tree .ticon{flex:none;display:flex;color:var(--text-ghost)}#tree .ticon .ico{width:15px;height:15px}#tree .row:hover .ticon,#tree .row:hover .chev{color:var(--text-faint)}#tree .row.active .ticon,#tree .row.active .chev{color:var(--accent)}#tree .label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}#tree .file .label{font-size:12.5px}#tree .file .chev{visibility:hidden}#tree .row.collapsed .chev{transform:rotate(-90deg)}.field-err{color:var(--del);font-size:12px;margin:6px 2px 0}.modal,#palette{translate:none}.admin-card-table{padding:0}.admin-table{width:100%;border-collapse:collapse;table-layout:fixed}.admin-table td .ai-main,.admin-table td a.ai-main,.admin-table td .ai-copy,.admin-table td .ai-tag{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.admin-table th:last-child,.admin-table td:last-child{width:186px;text-align:right}.admin-table tr:last-child td{border-bottom:none}.admin-table th{text-align:left;font-size:11px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--text-faint);padding:0;border-bottom:1px solid var(--border);-webkit-user-select:none;user-select:none}.admin-table td{padding:0;border-bottom:1px solid var(--border);overflow:hidden;text-overflow:ellipsis}.admin-table tr.admin-item{display:table-row}.admin-table tr.admin-item td{padding:8px 10px}.admin-card-table{overflow-x:auto}.shares-table .admin-table th:last-child,.shares-table .admin-table td:last-child{width:110px}.share-banner{margin:0 0 18px;padding:12px 14px;border:1px solid var(--border);border-left:3px solid var(--accent);border-radius:var(--r-ctl);background:var(--surface)}.share-banner .sb-head{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text)}.share-banner .sb-head .ico,.share-banner .sb-head svg{width:15px;height:15px;flex:none;color:var(--accent)}.share-banner .sb-count{color:var(--text-faint);font-size:12px}.share-banner .sb-note{margin:6px 0 10px;font-size:12.5px;line-height:1.55;color:var(--text-faint);max-width:64ch}.share-banner .sb-link{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding-top:8px;border-top:1px solid var(--border)}.share-banner .sb-link+.sb-link{margin-top:8px}.share-banner .sb-url{flex:1 1 260px;min-width:0;font-size:12px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.share-banner .sb-meta{font-size:11.5px;color:var(--text-faint)}.share-banner .sb-actions{display:flex;align-items:center;gap:6px;margin-left:auto}.nav-menu{list-style:none;margin:6px 0 0;padding:0}.nav-menu .row .ico{width:15px;height:15px;flex:none;color:var(--text-ghost)}.nav-menu .row.active .ico{color:var(--accent-bright)}.proj-row{display:flex;align-items:center;gap:4px;padding:0 10px 4px 12px}#project-select{flex:1;min-width:0;height:30px;padding:0 9px;display:inline-flex;align-items:center;gap:8px;border:1px solid var(--border);border-radius:var(--r-ctl);background:var(--surface);color:var(--text);font:inherit;font-size:12.5px;font-weight:500;cursor:pointer;white-space:nowrap;outline:none}#project-select>span:last-of-type{overflow:hidden;text-overflow:ellipsis}#project-select:hover{background:var(--hover);border-color:var(--border-2)}#project-select svg{color:var(--text-ghost)}.proj-menu{z-index:80;min-width:var(--radix-select-trigger-width, 200px);border:1px solid var(--border-2);border-radius:9px;padding:4px;background:var(--bg-raise);box-shadow:0 10px 32px #00000059}.proj-menu [role=option]{font-size:12.5px;color:var(--text-dim);border-radius:6px;outline:none}.proj-menu [role=option][data-highlighted]{background:var(--hover);color:var(--text)}#accountbar{position:relative;border-top:1px solid var(--border);padding:7px 10px}#account-btn{width:100%;display:flex;align-items:center;gap:9px;text-align:left;padding:6px 8px;border:none;border-radius:7px;background:transparent;color:var(--text-dim);cursor:pointer;font:inherit}#account-btn:hover{background:var(--hover);color:var(--text)}#account-btn .avatar{width:26px;height:26px;flex:none;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:#fff;font-size:12px;font-weight:700}#account-btn .acct{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}#account-btn .acct b{font-size:12.5px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#account-btn .acct small{font-size:11px;color:var(--text-faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#account-btn>.ico{width:14px;height:14px;color:var(--text-ghost)}#account-menu{min-width:var(--radix-dropdown-menu-trigger-width, 220px);padding:5px;border:1px solid var(--border-2);border-radius:9px;background:var(--bg-raise);box-shadow:0 10px 32px #00000059;display:flex;flex-direction:column;z-index:80;outline:none}#account-menu [role=menuitem]{outline:none}#account-menu [role=menuitem][data-highlighted]{background:var(--hover);color:var(--text)}#account-menu .menu-sec{padding:7px 9px 3px;font-size:10.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--text-faint)}#account-menu [role=menuitem]{display:flex;align-items:center;gap:8px;padding:7px 9px;border:none;border-radius:6px;background:transparent;text-align:left;color:var(--text-dim);font:inherit;font-size:12.5px;cursor:pointer;text-decoration:none}#account-menu [role=menuitem]:hover{background:var(--hover);color:var(--text)}#account-menu [role=menuitem] b{font-weight:600}#account-menu [role=menuitem] .ico{width:15px;height:15px}#account-menu .plan-chip{margin-left:auto;color:var(--accent);border-color:var(--border-2)}#account-menu #signout{color:var(--del)}#account-menu #signout:hover{color:var(--del);background:var(--hover)}#billing-view .plan-chip{color:var(--accent)}.plan-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}@media(max-width:700px){.plan-grid{grid-template-columns:1fr}}.usage-bar{background:var(--surface);border:1px solid var(--border);border-radius:4px;height:6px;overflow:hidden}.usage-bar>div{background:var(--accent);height:100%}.plan-price{font-size:20px;font-weight:700;margin:0 0 10px}.plan-price small{font-size:12px;color:var(--text-dim);font-weight:500}.muted-note{color:var(--text-dim);font-size:13px}#main{flex:1;display:flex;flex-direction:column;min-width:0}#topbar{position:relative;display:flex;align-items:center;gap:9px;height:52px;padding:0 16px;border-bottom:1px solid var(--border)}.icon-btn{display:none;width:34px;height:34px;border:none;background:transparent;color:var(--text-dim);cursor:pointer;border-radius:7px;align-items:center;justify-content:center}.icon-btn:hover{color:var(--text);background:var(--hover)}#crumb{font-size:12.5px;color:var(--text);font-weight:500;letter-spacing:-.01em;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#crumb .crumb-seg{color:var(--text-dim);cursor:pointer}#crumb .crumb-seg:hover{color:var(--accent-bright)}#crumb .crumb-sep{color:var(--text-ghost);margin:0 5px}#meta{flex:1;min-width:0;font-size:12px;color:var(--text-faint);text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.btn{display:inline-flex;align-items:center;gap:6px;flex:none;height:30px;padding:0 11px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text-dim);font-size:12.5px;font-weight:500;cursor:pointer;text-decoration:none}.btn:hover{background:var(--hover);color:var(--text);border-color:var(--border-2)}.btn .ico{width:15px;height:15px}.btn.ghost{color:var(--text-dim)}.tipcard{display:flex;align-items:center;gap:7px;white-space:nowrap;padding:6px 9px;border-radius:8px;border:1px solid var(--border-2);background:var(--surface-solid, var(--bg-raise));color:var(--text);font-size:12.5px;font-weight:500;box-shadow:0 8px 24px #00000059;z-index:80}.tipcard kbd{font:11px var(--ui);color:var(--text-faint);background:var(--hover);border:1px solid var(--border-2);border-radius:5px;padding:1px 5px}#more-menu{position:absolute;right:12px;top:calc(100% - 4px);z-index:80;background:var(--bg-raise);border:1px solid var(--border-2);border-radius:var(--r-card);box-shadow:0 18px 44px -14px #000000bf;padding:6px;min-width:168px}.more-item{display:block;width:100%;text-align:left;min-height:40px;padding:0 12px;background:transparent;border:none;cursor:pointer;color:var(--text);font:inherit;font-size:13.5px;border-radius:var(--r-ctl)}.more-item:hover{background:var(--hover)}#content{flex:1;overflow-y:auto;padding:44px 40px 110px;scroll-behavior:smooth}.page{width:100%;max-width:var(--page-app);margin-inline:auto;min-width:0}.page.read{max-width:var(--page-read)}.page.wide{max-width:var(--page-wide)}.empty{color:var(--text-faint);text-align:center;margin-top:var(--hero-top)}.empty-hint{display:block;margin-top:6px;font-size:12px;color:var(--text-faint)}.onboard{max-width:560px;margin:var(--hero-top) auto 0}.onboard h1{font-size:25px;font-weight:640;letter-spacing:-.02em;margin:0 0 8px;color:#f4f6f9}.onboard>p{color:var(--text-dim);margin:0 0 28px;font-size:14px}.ob-card{background:var(--bg-side);border:1px solid var(--border);border-radius:var(--r-card);padding:20px 22px;margin-bottom:14px}.ob-card h3{margin:0 0 6px;font-size:14.5px;font-weight:600}.ob-card p{margin:0 0 14px;font-size:13px;color:var(--text-dim)}.ob-alt{margin:12px 0 0}.ob-alt a{color:var(--text-faint);font-size:12.5px;font-weight:600;text-decoration:none}.ob-alt a:hover{color:var(--text)}.pbtn{display:inline-flex;align-items:center;gap:6px;flex:none;height:32px;padding:0 14px;border-radius:var(--r-ctl);border:none;background:var(--accent);color:#241704;font-size:13px;font-weight:600;cursor:pointer;white-space:nowrap}.pbtn:hover{background:var(--accent-bright)}.pbtn .ico{width:15px;height:15px}.danger-btn{display:inline-flex;align-items:center;height:32px;padding:0 14px;border-radius:var(--r-ctl);border:none;background:#b3382e;color:#fff;font-size:13px;font-weight:600;cursor:pointer}.danger-btn:hover{background:#c94336}[data-slot=input],[data-slot=textarea]{font:inherit;color:var(--text)}[data-slot=input][aria-invalid=true]:focus-visible,[data-slot=textarea][aria-invalid=true]:focus-visible{border-color:var(--del)}[data-slot=card],[data-slot=dropdown-menu-content]{border-color:var(--border)}.project-settings{display:flex;flex-direction:column;gap:14px}.project-settings>h2{font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 4px;color:#f4f6f9}.ps-form{display:flex;flex-direction:column;gap:18px}.ps-field{display:flex;flex-direction:column;gap:7px}.ps-field label{font-size:12.5px;color:var(--text-dim)}.ps-opt{color:var(--text-ghost);font-weight:400}.ps-icon-row{display:flex;align-items:center;gap:10px}.ps-icon-row .proj-mark{width:26px;height:26px;border-radius:7px}.ps-icon-row .proj-mark svg{width:15px;height:15px}.ps-meta{display:flex;align-items:baseline;justify-content:space-between;gap:12px}.ps-meta .field-err{flex:0 1 auto;margin:0}.ps-count{font-size:11.5px;color:var(--text-faint);font-variant-numeric:tabular-nums}.ps-actions{display:flex;justify-content:flex-end}.ps-icon-grid{display:grid;grid-template-columns:repeat(6,30px);gap:4px;padding:8px}.ps-icon-cell{display:grid;place-items:center;width:30px;height:30px;border-radius:7px;border:1px solid transparent;background:none;color:var(--text-dim);cursor:pointer}.ps-icon-cell svg{width:16px;height:16px}.ps-icon-cell:hover{background:var(--hover);color:var(--text)}.ps-icon-cell.active{border-color:var(--accent);color:var(--accent-bright)}.ps-danger [data-slot=card-title]{font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;color:#d2695e;font-weight:600}.ps-chip{margin-left:10px;padding:2px 8px;border-radius:999px;border:1px solid var(--border);background:var(--surface);color:var(--text-faint);font-size:11px;font-weight:600;letter-spacing:.02em;vertical-align:middle}.ps-people h4{font-size:12.5px;font-weight:600;color:var(--text-dim);margin:0}.ps-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:13px;color:var(--text-dim);margin:0 0 10px}.ps-people select{height:28px;padding:0 8px;border-radius:6px;border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:12.5px}.ps-people select:disabled{opacity:.6;cursor:default}.ps-note{color:var(--text-faint);font-size:12.5px;margin:0 0 12px;max-width:56ch;line-height:1.55}.ps-people-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:20px 0 8px}.ps-danger p{color:var(--text-dim);font-size:13px;margin:0 0 14px;max-width:52ch;line-height:1.55}.ps-facts{display:grid;grid-template-columns:auto 1fr;gap:8px 20px;margin:0;font-size:13px}.ps-facts dt{color:var(--text-faint)}.ps-facts dd{margin:0;color:var(--text-dim)}.admin h1{font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 6px;color:#f4f6f9}.admin h3{font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;color:var(--text-faint);font-weight:600;margin:30px 0 10px}.admin-lbl{flex:1 1 100%;margin:0 0 6px;font-size:12.5px;font-weight:600;color:var(--text-dim)}.admin-sub{color:var(--text-dim);font-size:13.5px;margin:-2px 0 16px;line-height:1.55}.admin-h{display:flex;align-items:center;justify-content:space-between;margin:30px 0 10px}.admin-h h3{margin:0}.admin-row{display:flex;gap:9px;margin-bottom:8px}.admin-row input{flex:1;height:34px;padding:0 12px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:13px;outline:none}.admin-row input:focus{border-color:var(--accent);background:var(--hover)}.admin-list{border:1px solid var(--border);border-radius:var(--r-card);overflow:hidden;background:var(--bg-side)}.admin-list.admin-card-table{overflow-x:auto;overflow-y:hidden}.admin-item{display:flex;align-items:center;gap:11px;padding:11px 14px;border-bottom:1px solid var(--border);font-size:13.5px}.modal-actions .ai-btn{height:32px}.empty a{color:var(--accent);text-decoration:none;display:inline-block;padding:6px 10px}.empty a:hover{text-decoration:underline}.empty h3{margin:0 0 8px;font-size:16px;color:var(--text)}.ai-copy{text-align:left;background:none;border:0;padding:6px 0;cursor:pointer}.ai-copy:hover{color:var(--text)}a.ai-main{color:var(--text-dim);text-decoration:none;padding:6px 0}a.ai-main:hover{color:var(--accent)}.th-sort{display:block;width:100%;text-align:left;background:none;border:0;padding:6px 10px;font:inherit;color:inherit;letter-spacing:inherit;text-transform:inherit;cursor:pointer}.th-sort:hover{color:var(--text-dim)}.proj-trigger>[data-slot=select-value]{display:block;flex:1 1 auto;min-width:0;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.role-cell{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center;justify-items:start}.admin-table td .role-static{text-align:left}.role-chip-row{margin:-6px 0 12px}.role-chip{margin-left:0;padding:2px 8px;border:1px solid var(--border-2);border-radius:99px;vertical-align:middle}.ext{margin-left:4px;color:var(--text-faint);font-size:11px}.admin-item:last-child{border-bottom:none}.admin-item:hover{background:var(--hover)}.field-err{flex:1 1 100%;margin:6px 0 0}.admin-row{flex-wrap:wrap}.admin-row input[aria-invalid=true]{border-color:var(--del)}.ai-main{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}.admin-item>.ai-main{flex:1 1 55%;min-width:22ch}.admin-item>.ai-tag{flex:0 0 auto;min-width:0;max-width:45%}@media(max-width:1000px){.admin-item{flex-wrap:wrap}.admin-item>.ai-tag{flex:1 1 100%;max-width:100%}}.admin-table td .ai-main{min-width:0}.ai-main.mono{font:12px var(--mono);color:var(--text-dim);cursor:pointer}.ai-tag{font-size:11.5px;color:var(--text-faint);flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.admin-item select{height:28px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:0 8px;font:inherit;font-size:12.5px;cursor:pointer}.admin-item select:hover{border-color:var(--border-2)}.ai-btn,.ai-del{flex:none;height:27px;padding:0 11px;border-radius:6px;border:1px solid var(--border);background:var(--surface);color:var(--text-dim);font:inherit;font-size:12px;font-weight:500;cursor:pointer}.ai-del{color:var(--del);border-color:#f26d6d47}.ai-del:hover{background:#f26d6d1f;border-color:var(--del);color:#ff8b8b}.ai-btn:hover{background:var(--hover);color:var(--text);border-color:var(--border-2)}.admin-empty{padding:14px;color:var(--text-faint);font-size:13px}.admin-item.toggle{cursor:pointer;align-items:flex-start}.admin-item.toggle .ai-main{white-space:normal}.tg-label{font-size:13.5px;font-weight:550;color:var(--text)}.tg-desc{font-size:12px;color:var(--text-faint);margin-top:3px;line-height:1.5}.admin-item.toggle input{margin-top:2px;flex:none}.dl-title{display:flex;align-items:center;gap:10px;font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 4px;color:#f4f6f9}.dl-title-icon{display:flex;color:var(--accent)}.dl-title-icon .ico{width:20px;height:20px}.dl-sub{color:var(--text-faint);font-size:12.5px;margin:0 0 18px}.dl-items{border:1px solid var(--border);border-radius:var(--r-card);overflow:hidden;background:var(--bg-side)}.dl-row{display:flex;align-items:center;gap:11px;padding:10px 14px;border-bottom:1px solid var(--border);cursor:pointer}.dl-row:last-child{border-bottom:none}.dl-row:hover{background:var(--hover)}.dl-row .ticon{flex:none;display:flex;color:var(--text-ghost)}.dl-row .ticon .ico{width:16px;height:16px}.dl-row:hover .ticon{color:var(--text-faint)}.dl-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13.5px;color:var(--text)}.dl-meta{flex:none;font-size:12px;color:var(--text-faint);font-variant-numeric:tabular-nums}.heatdot{flex:none;width:7px;height:7px;border-radius:50%;background:var(--accent)}.heatdot.lvl1{opacity:.3}.heatdot.lvl2{opacity:.55}.heatdot.lvl3{opacity:.8}.heatdot.lvl4{opacity:1;box-shadow:0 0 6px #f5a6238c}.dl-empty{padding:24px 14px;color:var(--text-faint);font-size:13px;border:1px dashed var(--border);border-radius:var(--r-card);text-align:center}.dl-h3{margin:28px 0 8px;font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;color:var(--text-faint);font-weight:600}.dl-hlist{border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);overflow:hidden;max-width:none}.dl-hlist .hentry:last-child{border-bottom:none}.hentry.clickable{cursor:pointer}.hentry.clickable:hover{background:var(--hover)}.dl-more{margin-top:10px}#vault-name.vault-link{cursor:pointer}#vault-name.vault-link:hover{color:var(--accent-bright)}#account-btn.active{background:var(--glow)}#account-btn.active .acct b{color:var(--accent-bright)}.gd-body{margin-top:18px}.gd-desc{margin:2px 0 8px;color:var(--text-faint);font-size:13px;line-height:1.5}.gd-list{margin:4px 0 8px;padding-left:18px;display:grid;gap:6px}.gd-code{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:10px;margin:6px 0 10px;padding:10px 12px;background:var(--bg-raise);border:1px solid var(--border);border-radius:var(--r-card);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12.5px;line-height:1.6;color:var(--text)}.gd-code>code{display:block;min-width:0;overflow-x:auto;white-space:pre}.gd-copy{align-self:start;font:inherit;font-family:inherit;font-size:11px;font-weight:600;padding:3px 9px;border-radius:6px;border:1px solid var(--border-2);background:var(--bg-raise);color:var(--text-faint);cursor:pointer}.gd-copy:hover{color:var(--accent-bright);border-color:var(--accent-dim)}.gd-manual{margin:10px 0 0}.gd-manual>summary{display:inline-block;font-size:12.5px;font-weight:600;color:var(--text-faint);cursor:pointer;padding:4px 0}.gd-manual>summary:before{content:"▸ ";color:var(--text-ghost)}.gd-manual[open]>summary:before{content:"▾ "}.gd-manual>summary:hover{color:var(--text)}.home-insights{margin-top:30px;padding-top:22px;border-top:1px solid var(--border)}.in-title{font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 4px;color:#f4f6f9}.in-title .in-scope{color:var(--text-ghost);font-weight:500;font-size:15px}.gd-head{display:flex;align-items:center;gap:9px}.gd-head .proj-mark{width:22px;height:22px;border-radius:6px}.gd-head .proj-mark svg{width:13px;height:13px}.in-desc{color:var(--text-dim);font-size:13.5px;line-height:1.55;margin:0 0 10px;max-width:62ch}.in-lens{display:flex;gap:6px;margin:0 0 14px}.in-lens-btn{font:inherit;font-size:12px;padding:5px 12px;border-radius:999px;border:1px solid var(--border);background:none;color:var(--text-faint);cursor:pointer}.in-lens-btn:hover{color:var(--text)}.in-lens-btn.active{color:var(--accent);border-color:var(--accent)}.in-chart{width:100%;max-width:760px;height:auto;border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);margin-bottom:6px}.in-axis{stroke:var(--border);stroke-width:1}.in-threshold{stroke:var(--border);stroke-width:1;stroke-dasharray:4 4}.in-danger-zone{fill:#f26d6d0d}.in-label{fill:var(--text-ghost);font-size:11px}.in-quad{fill:var(--text-ghost);font-size:10.5px;text-transform:uppercase;letter-spacing:.06em}.in-quad-danger{fill:#e07070}.in-pt{fill:var(--accent);opacity:.5;cursor:pointer}.in-pt:hover{opacity:1}.in-pt.cold{fill:var(--text-ghost);opacity:.25}.in-pt.danger{fill:#e05d5d;opacity:.6}.in-treemap{background:#0c0d10}.in-tm-group{fill:none;stroke:var(--border);stroke-width:1;cursor:pointer;pointer-events:all}.in-tm-glabel{fill:var(--text-faint);font-size:10px;text-transform:uppercase;letter-spacing:.05em;cursor:pointer}.in-tm-cell{cursor:pointer}.in-tm-cell:hover{stroke:#fff;stroke-width:1}.in-tm-label{fill:#0c0d10;font-size:10.5px;font-weight:620;cursor:pointer;pointer-events:none}.in-hotpath{border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);overflow:hidden}.in-hp-row{display:flex;align-items:center;gap:10px;padding:6px 12px;border-bottom:1px solid var(--border);cursor:pointer}.in-hp-row:last-child{border-bottom:none}.in-hp-row:hover{background:var(--hover)}.in-hp-name{flex:0 0 300px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;color:var(--text)}.in-hp-name.danger{color:var(--accent)}.in-hp-bar{flex:1;display:flex;height:10px;border-radius:3px;overflow:hidden}.in-hp-agent{background:var(--accent)}.in-hp-human{background:#5b8def}.in-hp-count{flex:none;width:40px;text-align:right;font-size:11.5px;color:var(--text-faint);font-variant-numeric:tabular-nums}.in-legend{margin:8px 2px 0;font-size:11.5px;color:var(--text-faint)}.in-sw{display:inline-block;width:10px;height:10px;border-radius:2px;vertical-align:-1px}.in-sw.agent{background:var(--accent)}.in-sw.human{background:#5b8def}.in-matrix rect{transition:opacity .1s}.in-matrix rect:hover{opacity:.85}.hentry{padding:11px 12px;border-bottom:1px solid var(--border);--hindent: 72px}.hentry:hover{background:#ffffff04}.hline{display:flex;gap:10px;align-items:center}.hkind{flex:none;width:62px;white-space:nowrap;text-align:center;font-size:10px;text-transform:uppercase;letter-spacing:.06em;font-weight:600;padding:2px 6px;border-radius:4px;color:var(--add);background:#4cc38a1f}.hentry.edit .hkind{color:var(--accent-bright);background:var(--glow)}.hentry.delete .hkind{color:#ff8b8b;background:#f26d6d1f}.hpath{font-weight:500;cursor:pointer;color:var(--text);font-size:13px}.hpath:hover{color:var(--accent-bright)}.htime{margin-left:auto;color:var(--text-faint);font-size:12px;font-variant-numeric:tabular-nums}.hmeta{display:flex;align-items:center;gap:14px;margin-top:4px;padding-left:var(--hindent);font-size:12px;color:var(--text-dim)}.hdev,.hsize{color:var(--text-faint)}.hsize{font-variant-numeric:tabular-nums;white-space:nowrap;flex:none}.hnote{margin-top:4px;padding-left:var(--hindent);font-size:12px;color:var(--text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.hnote:hover{color:var(--text)}.hnote.open{white-space:normal;overflow-wrap:anywhere}.hnote:before{content:"›";display:inline-block;margin-right:5px;color:var(--text-ghost);transition:transform .12s}.hnote.open:before{transform:rotate(90deg)}.hnote a{color:var(--accent-bright);text-decoration:none}.hnote a:hover{text-decoration:underline}.hrun{border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);margin:10px 0;overflow:hidden}.hrun-head{display:flex;align-items:center;gap:9px;width:100%;padding:9px 12px;color:var(--text);font-size:12.5px}.hrun-toggle{display:flex;flex:none;padding:2px;border:none;border-radius:4px;background:none;color:var(--text-faint);cursor:pointer}.hrun-toggle:hover{color:var(--text);background:var(--hover)}.hrun-toggle .ico{width:13px;height:13px}.hrun-note{font-weight:560;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:46%}.hrun-note a{color:var(--accent-bright);text-decoration:none}.hrun-note a:hover{text-decoration:underline}.hrun-meta{color:var(--text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hrun-time{margin-left:auto;flex:none;color:var(--text-faint);font-variant-numeric:tabular-nums}.hrun-body{border-top:1px solid var(--border)}.hrun-body .hentry:last-child{border-bottom:none}.hrestore-btn{display:inline-flex;align-items:center;gap:4px;margin-left:auto;padding:2px 8px 2px 5px;border:1px solid var(--border);border-radius:5px;background:none;color:var(--text-faint);font:inherit;font-size:12px;cursor:pointer}.hrestore-btn:hover{color:var(--accent-bright);border-color:var(--border-2);background:var(--hover)}.hrestore-btn:disabled{opacity:.5;cursor:default}.hrestore-btn .ico{width:12px;height:12px}.hrestore-gap{margin-left:auto;color:var(--text-ghost);font-size:11.5px}.hactions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:6px 0 0 23px}.hdiff-btn,.hver-btn{display:inline-flex;align-items:center;gap:4px;padding:2px 7px 2px 4px;border:1px solid var(--border);border-radius:5px;background:none;color:var(--text-faint);font:inherit;font-size:12px;cursor:pointer;text-decoration:none}.hdiff-btn:hover,.hver-btn:hover{color:var(--text);border-color:var(--border-2);background:var(--hover)}.hdiff-btn .ico,.hver-btn .ico{width:12px;height:12px}.hdiff-none{flex-basis:100%;font-size:12px;color:var(--text-ghost)}.dv{margin:8px 0 2px 23px;border:1px solid var(--border);border-radius:6px;overflow:hidden}.dv-msg{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:9px 11px;font-size:12px;color:var(--text-faint)}.dv-dl{display:flex;gap:12px}.dv-msg a{color:var(--accent-bright);text-decoration:none}.dv-msg a:hover{text-decoration:underline}.dv-head{display:flex;align-items:center;gap:10px;padding:5px 11px;border-bottom:1px solid var(--border);font-size:11px;font-variant-numeric:tabular-nums}.dv-add{color:var(--add);font-weight:600}.dv-del{color:var(--del);font-weight:600}.dv-same{color:var(--text-ghost)}.dv-body{overflow-x:auto;padding:4px 0}.dv-line{display:flex;font-family:var(--mono);font-size:12px;line-height:1.55;white-space:pre}.dv-n{flex:none;width:34px;padding-right:8px;text-align:right;color:var(--text-ghost);-webkit-user-select:none;user-select:none;font-variant-numeric:tabular-nums}.dv-mark{flex:none;width:16px;text-align:center;-webkit-user-select:none;user-select:none}.dv-text{padding-right:12px}.dv-ins{background:#4cc38a1a;color:var(--add)}.dv-rm{background:#f26d6d1a;color:#ff8b8b}.dv-ctx{color:var(--text-dim)}#palette{position:fixed;top:12vh;left:50%;transform:translate(-50%);z-index:151;display:block;width:min(560px,92vw);background:var(--bg-raise);border:1px solid var(--border-2);border-radius:var(--r-over);box-shadow:0 24px 70px -18px #000c;overflow:hidden;outline:none;padding:0}#palette-inputwrap{display:flex;align-items:center;gap:11px;padding:14px 16px;border-bottom:1px solid var(--border)}#palette-inputwrap [data-slot=command-input-wrapper]{flex:1;display:flex;border-bottom:0;padding:0;height:auto}#palette-inputwrap [data-slot=command-input-wrapper]>svg:not(.ico){display:none}#palette input,#palette input:focus{border:none;background:transparent;box-shadow:none;outline:none;padding:0}#palette-inputwrap .ico{width:17px;height:17px;color:var(--text-faint)}#palette-input{flex:1;width:100%;border:none;background:transparent;color:var(--text);font:inherit;font-size:15px;letter-spacing:-.01em;outline:none;padding:0}#palette-input::placeholder{color:var(--text-ghost)}#palette-results{list-style:none;margin:0;padding:8px;max-height:46vh;overflow-y:auto}#palette-results [cmdk-item]{display:flex;align-items:center;gap:11px;height:38px;padding:0 10px;border-radius:9px;cursor:pointer;color:var(--text-dim);font-size:13.5px}#palette-results [cmdk-item][data-selected=true]{background:var(--glow)}#palette-results [cmdk-item][data-selected=true] .picon{color:var(--accent)}#palette-results [cmdk-item][data-selected=true] .plabel,#palette-results [cmdk-item][data-selected=true] .plabel b{color:var(--accent-bright)}#palette-results li{display:flex;align-items:center;gap:11px;height:38px;padding:0 10px;border-radius:9px;cursor:pointer;color:var(--text-dim);font-size:13.5px}#palette-results li.selected{background:var(--glow)}#palette-results li.selected .picon{color:var(--accent)}#palette-results li.selected .plabel,#palette-results li.selected .plabel b{color:var(--accent-bright)}#palette-results li .picon{width:18px;flex:none;display:flex;justify-content:center;color:var(--text-faint)}#palette-results li .picon .ico{width:15px;height:15px}#palette-results li .plabel{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text)}#palette-results li .plabel b{color:var(--accent-bright);font-weight:600}#palette-results li .pkind{flex:none;font-size:10.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-ghost)}#palette-results .pempty{color:var(--text-faint);cursor:default;justify-content:center;height:auto;padding:14px}#palette-hint{padding:9px 16px;border-top:1px solid var(--border);font-size:11px;color:var(--text-ghost)}[data-slot=dialog-overlay]{position:fixed;inset:0;background:#06070999;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);z-index:150}.modal{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:151;display:block;background:var(--bg-raise);border:1px solid var(--border-2);border-radius:var(--r-over);padding:22px 24px;width:min(460px,calc(100vw - 40px));box-shadow:0 24px 70px -18px #000c;outline:none}.modal h3{margin:0 0 10px;font-size:16px;font-weight:620;letter-spacing:-.01em}.modal p{margin:0 0 16px;font-size:13.5px;color:var(--text-dim);line-height:1.55}.modal p b{color:var(--text)}.modal-url{font:12px var(--mono);background:var(--surface);border:1px solid var(--border);border-radius:var(--r-ctl);padding:9px 11px;color:var(--text-dim);word-break:break-all;margin-bottom:16px}.modal-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.modal-expiry{display:flex;align-items:center;gap:8px;margin-bottom:16px;font-size:12.5px;color:var(--text-dim)}.modal-expiry select{height:28px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:0 8px;font:inherit;font-size:12.5px;cursor:pointer}.modal-expiry select:disabled{opacity:.6;cursor:default}.modal-expiry-note{margin-left:auto;color:var(--text-dim)}.modal-label{display:block;font-size:12.5px;color:var(--text-dim);margin:0 0 6px}.modal-msg{margin:0 0 16px;font-size:13.5px;color:var(--text-dim);line-height:1.55}.modal-input{width:100%;height:36px;padding:0 12px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:14px;margin-bottom:16px;outline:none}.modal-input:focus{border-color:var(--accent);background:var(--hover)}[data-sonner-toast]{background:var(--bg-raise)!important;color:var(--text)!important;border:1px solid var(--border-2)!important;border-radius:10px!important;font-size:13.5px!important;box-shadow:0 18px 44px -12px #000000b3!important}[data-sonner-toast][data-type=error]{border-color:#f26d6d80!important;color:#ffb0aa!important}#sb-backdrop{display:none}@media(max-width:900px){#sidebar{position:fixed;z-index:60;top:0;left:0;height:100%;transform:translate(-100%);transition:transform .2s ease;box-shadow:0 0 40px #0009}body.sb-open #sidebar{transform:translate(0)}body.sb-open #sb-backdrop{display:block;position:fixed;inset:0;background:#0000008c;z-index:50}.icon-btn,#search-btn{display:inline-flex;width:44px;height:44px}#content{padding:24px 18px 70px}#topbar{padding:0 8px;gap:4px}.btn .lbl{display:none}#topbar .btn{min-width:44px;min-height:44px;padding:0;justify-content:center;gap:0}#topbar .btn .ico{width:18px;height:18px}#more-btn:not([hidden]){display:inline-flex}#history-btn,#upload-btn,#download{display:none!important}#meta{display:none}#crumb{flex:1}#vault{padding:0 8px 0 12px}.icon-btn2,#signout,#tree .row,#projects .row{height:44px}#account-btn,#project-select{min-height:44px}.nav-add{min-width:44px;min-height:44px}.markdown table,pre.plain{display:block;overflow-x:auto;max-width:100%}.admin-item{flex-wrap:wrap;row-gap:8px;padding:12px 14px}.admin-item select{height:44px}.ai-btn,.ai-del{height:auto;min-height:44px;padding:0 12px}.admin-table thead{display:none}.admin-table,.admin-table tbody,.admin-table td{display:block;width:auto}.admin-table tr.admin-item{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.admin-table tr.admin-item td{padding:0;border-bottom:none}.admin-table tr.admin-item td:first-child{flex:1 1 100%;width:auto}.admin-table tr.admin-item td:last-child{width:auto;text-align:left}[data-slot=dropdown-menu-item]{min-height:44px}#projects{flex:0 1 auto;max-height:none}.admin-row{flex-wrap:wrap}.admin-row input{flex:1 1 100%;min-height:44px}.admin-row button{flex:0 0 auto;align-self:flex-start;min-height:44px}.admin-item .ai-main{flex:1 1 100%;white-space:normal;overflow-wrap:anywhere}.admin-table td{white-space:normal}.admin-table td .ai-main,.admin-table td a.ai-main,.admin-table td .ai-copy,.admin-table td .ai-tag{white-space:normal;overflow-wrap:anywhere}.admin-item .ai-tag{flex:1 1 100%;max-width:100%;white-space:normal;overflow-wrap:anywhere}.ai-copy{min-height:44px;display:block;padding:12px 0;white-space:normal;overflow-wrap:anywhere;text-overflow:clip}a.ai-main{min-height:44px;display:flex;align-items:center}.gd-code{min-height:62px;padding-top:12px;padding-bottom:12px}.gd-copy{min-height:44px;padding:0 14px}.gd-tab{min-height:44px}.in-lens-btn{min-height:44px;padding:0 14px}.modal-input{height:44px}.modal-actions button{height:auto;min-height:44px}.modal-expiry select{height:44px}.pbtn,#palette-results li{height:auto;min-height:44px}.more-item{min-height:44px}}.modal-actions .ai-del{margin-right:auto}@media(max-width:430px){.dl-row{flex-wrap:wrap;row-gap:2px}.dl-meta{flex:1 1 100%;padding-left:27px}.ai-tag{font-size:11px}.htime{white-space:nowrap;font-size:12px}.hline{flex-wrap:wrap}.hentry{--hindent: 0px}.modal-actions .ai-del{flex:0 0 100%;justify-content:center;text-align:center}}.markdown h1,.markdown h2,.markdown h3,.markdown h4{color:#f4f6f9;line-height:1.25;letter-spacing:-.018em;margin:1.5em 0 .5em;text-wrap:balance}.markdown h1:first-child{margin-top:0}.markdown h1{font-size:1.85em;font-weight:660;letter-spacing:-.024em}.markdown h2{font-size:1.32em;font-weight:620;margin-top:1.7em}.markdown h3{font-size:1.08em;font-weight:620}.markdown p,.markdown li{color:#c6cbd3;font-size:14.5px;line-height:1.72}.markdown p{margin:0 0 1em}.markdown strong{color:var(--text);font-weight:620}.markdown a{color:var(--accent-bright);text-decoration:none;border-bottom:1px solid rgba(245,166,35,.28)}.markdown a:hover{border-bottom-color:var(--accent)}.markdown ul,.markdown ol{margin:0 0 1em;padding-left:1.4em}.markdown li{margin-bottom:.4em}.markdown li::marker{color:var(--text-ghost)}.markdown code{background:var(--hover);border:1px solid var(--border);padding:.1em .4em;border-radius:5px;font:12.5px/1.5 var(--mono);color:#e4d9c4}.markdown pre{background:var(--code-bg);border:1px solid var(--border);border-radius:var(--r-card);padding:14px 16px;overflow-x:auto;margin:1.3em 0}.markdown pre code{background:none;border:none;padding:0;color:#c6cbd3}.markdown blockquote{margin:1.3em 0;padding:.3em 1em;border-left:2px solid var(--accent);background:linear-gradient(90deg,var(--glow),transparent);border-radius:0 8px 8px 0;color:#d8cdb6}.markdown blockquote p{margin:.3em 0;color:#d8cdb6}.markdown table{border-collapse:collapse;margin:1.3em 0;font-size:13.5px}.markdown th,.markdown td{border-bottom:1px solid var(--border);padding:9px 13px;text-align:left}.markdown th{color:var(--text-faint);font-size:11px;text-transform:uppercase;letter-spacing:.05em;font-weight:600;border-bottom-color:var(--border-2)}.markdown tr:hover td{background:#ffffff05}.markdown img{max-width:100%;border-radius:8px;border:1px solid var(--border)}.markdown hr{border:none;border-top:1px solid var(--border);margin:2.2em 0}.markdown table.frontmatter{margin:0 0 1.8em;font-size:12px;background:var(--surface);border:1px solid var(--border);border-radius:8px;border-collapse:separate;border-spacing:0}.markdown table.frontmatter th{text-transform:none;letter-spacing:0;font-size:11.5px;color:var(--text-faint);font-weight:600;text-align:left;white-space:nowrap;vertical-align:top;padding:6px 14px 6px 12px;border-bottom:1px solid var(--border)}.markdown table.frontmatter td{color:var(--text-dim);padding:6px 12px 6px 0;border-bottom:1px solid var(--border)}.markdown table.frontmatter tr:last-child th,.markdown table.frontmatter tr:last-child td{border-bottom:none}.markdown table.frontmatter code{white-space:pre-wrap;font-size:11px}.markdown .admin input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.admin input[aria-invalid=true]:focus-visible{outline-color:var(--del)}[role=dialog] input[aria-invalid=true]{border-color:var(--del)}[role=dialog] input[aria-invalid=true]:focus-visible{outline-color:var(--del)}button:disabled,.btn:disabled{cursor:default}input[type=checkbox]{accent-color:var(--accent)}.htmlview,.pdfview{display:block;width:100%;height:calc(100vh - 150px);border:1px solid var(--border);border-radius:var(--r-card);background:#fff}.notfound{margin-top:var(--hero-top);text-align:center;color:var(--text-dim)}.notfound h1{color:var(--text);font-size:1.4em;margin-bottom:.5em}.notfound code{background:var(--hover);border:1px solid var(--border);padding:.15em .5em;border-radius:6px}.notfound .nf-sub{max-width:440px;margin:12px auto 20px;font-size:13px;color:var(--text-faint);line-height:1.6}.vbanner{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 22px;padding:11px 14px;border:1px solid var(--accent-dim);border-radius:var(--r-card);background:var(--glow)}.vbanner .vb-icon{flex:none;display:flex;color:var(--accent-bright)}.vbanner .vb-text{flex:1 1 220px;min-width:0;display:flex;flex-direction:column;gap:1px;font-size:12.5px;line-height:1.45}.vbanner .vb-text b{color:var(--accent-bright);font-weight:600}.vbanner .vb-text span{color:var(--text-dim)}.vbanner .vb-actions{flex:none;display:flex;gap:8px}.vbanner .vb-actions .ai-btn{display:inline-flex;align-items:center;text-decoration:none}pre.plain{background:var(--code-bg);border:1px solid var(--border);border-radius:var(--r-card);padding:14px 16px;overflow-x:auto;font:12.5px/1.6 var(--mono);color:#c6cbd3;white-space:pre-wrap;overflow-wrap:anywhere}.filecard{margin-top:var(--hero-top);text-align:center;color:var(--text-dim)}.filecard .name{font-size:1.2em;color:var(--text);margin-bottom:.3em}.filecard .btn{margin-top:14px}
diff --git a/internal/webapp/static/index.html b/internal/webapp/static/index.html
index 62b6793..5cb700b 100644
--- a/internal/webapp/static/index.html
+++ b/internal/webapp/static/index.html
@@ -5,8 +5,8 @@
BearDrive
-
-
+
+