@nicorp/nui 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +8 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.es.js +3317 -3221
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),E=require("react"),to=require("@radix-ui/react-slot"),Li=require("@radix-ui/react-label"),Di=require("@radix-ui/react-separator"),Ei=require("@radix-ui/react-avatar"),Ai=require("@radix-ui/react-checkbox"),I=require("lucide-react"),Fi=require("@radix-ui/react-switch"),Vi=require("@radix-ui/react-select"),zi=require("@radix-ui/react-radio-group"),$i=require("@radix-ui/react-slider"),Bi=require("@radix-ui/react-toggle"),Oi=require("@radix-ui/react-toggle-group"),Se=require("date-fns"),Hi=require("@radix-ui/react-popover"),Gi=require("@radix-ui/react-aspect-ratio"),qi=require("@radix-ui/react-collapsible"),Wi=require("@radix-ui/react-scroll-area"),Ui=require("@radix-ui/react-tabs"),Ki=require("@radix-ui/react-accordion"),Xi=require("@radix-ui/react-dialog"),Yi=require("@radix-ui/react-dropdown-menu"),Zi=require("@radix-ui/react-tooltip"),Ee=require("cmdk"),Ji=require("@radix-ui/react-alert-dialog"),Qi=require("@radix-ui/react-progress"),Hr=require("react-dom"),el=require("@radix-ui/react-navigation-menu"),tl=require("@radix-ui/react-context-menu"),rl=require("@radix-ui/react-hover-card"),Gr=require("recharts");function ge(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const p=ge(E),ro=ge(Li),no=ge(Di),bt=ge(Ei),Ir=ge(Ai),Tr=ge(Fi),he=ge(Vi),Dt=ge(zi),_t=ge($i),oo=ge(Bi),ar=ge(Oi),Et=ge(Hi),nl=ge(Gi),qr=ge(qi),ct=ge(Wi),mt=ge(Ui),dt=ge(Ki),ue=ge(Xi),me=ge(Yi),$t=ge(Zi),Te=ge(Ji),Lr=ge(Qi),Ae=ge(el),fe=ge(tl),ir=ge(rl);function so(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=so(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ao(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=so(e))&&(n&&(n+=" "),n+=t);return n}const ol=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},sl=(e,t)=>({classGroupId:e,validator:t}),io=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),rr="-",Tn=[],al="arbitrary..",il=e=>{const t=cl(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return ll(i);const l=i.split(rr),c=l[0]===""&&l.length>1?1:0;return lo(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=n[i],d=r[i];return c?d?ol(d,c):c:d||Tn}return r[i]||Tn}}},lo=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],a=r.nextPart.get(s);if(a){const d=lo(e,t+1,a);if(d)return d}const i=r.validators;if(i===null)return;const l=t===0?e.join(rr):e.slice(t).join(rr),c=i.length;for(let d=0;d<c;d++){const g=i[d];if(g.validator(l))return g.classGroupId}},ll=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?al+n:void 0})(),cl=e=>{const{theme:t,classGroups:r}=e;return dl(r,t)},dl=(e,t)=>{const r=io();for(const n in e){const s=e[n];Wr(s,r,n,t)}return r},Wr=(e,t,r,n)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];ul(i,t,r,n)}},ul=(e,t,r,n)=>{if(typeof e=="string"){ml(e,t,r);return}if(typeof e=="function"){fl(e,t,r,n);return}gl(e,t,r,n)},ml=(e,t,r)=>{const n=e===""?t:co(t,e);n.classGroupId=r},fl=(e,t,r,n)=>{if(pl(e)){Wr(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(sl(r,e))},gl=(e,t,r,n)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[l,c]=s[i];Wr(c,co(t,l),r,n)}},co=(e,t)=>{let r=e;const n=t.split(rr),s=n.length;for(let a=0;a<s;a++){const i=n[a];let l=r.nextPart.get(i);l||(l=io(),r.nextPart.set(i,l)),r=l}return r},pl=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,hl=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const s=(a,i)=>{r[a]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(a){let i=r[a];if(i!==void 0)return i;if((i=n[a])!==void 0)return s(a,i),i},set(a,i){a in r?r[a]=i:s(a,i)}}},Dr="!",Ln=":",xl=[],Dn=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),bl=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=s=>{const a=[];let i=0,l=0,c=0,d;const g=s.length;for(let x=0;x<g;x++){const y=s[x];if(i===0&&l===0){if(y===Ln){a.push(s.slice(c,x)),c=x+1;continue}if(y==="/"){d=x;continue}}y==="["?i++:y==="]"?i--:y==="("?l++:y===")"&&l--}const u=a.length===0?s:s.slice(c);let f=u,m=!1;u.endsWith(Dr)?(f=u.slice(0,-1),m=!0):u.startsWith(Dr)&&(f=u.slice(1),m=!0);const h=d&&d>c?d-c:void 0;return Dn(a,m,f,h)};if(t){const s=t+Ln,a=n;n=i=>i.startsWith(s)?a(i.slice(s.length)):Dn(xl,!1,i,void 0,!0)}if(r){const s=n;n=a=>r({className:a,parseClassName:s})}return n},vl=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let s=[];for(let a=0;a<r.length;a++){const i=r[a],l=i[0]==="[",c=t.has(i);l||c?(s.length>0&&(s.sort(),n.push(...s),s=[]),n.push(i)):s.push(i)}return s.length>0&&(s.sort(),n.push(...s)),n}},wl=e=>({cache:hl(e.cacheSize),parseClassName:bl(e),sortModifiers:vl(e),...il(e)}),yl=/\s+/,jl=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],l=e.trim().split(yl);let c="";for(let d=l.length-1;d>=0;d-=1){const g=l[d],{isExternal:u,modifiers:f,hasImportantModifier:m,baseClassName:h,maybePostfixModifierPosition:x}=r(g);if(u){c=g+(c.length>0?" "+c:c);continue}let y=!!x,w=n(y?h.substring(0,x):h);if(!w){if(!y){c=g+(c.length>0?" "+c:c);continue}if(w=n(h),!w){c=g+(c.length>0?" "+c:c);continue}y=!1}const v=f.length===0?"":f.length===1?f[0]:a(f).join(":"),j=m?v+Dr:v,R=j+w;if(i.indexOf(R)>-1)continue;i.push(R);const M=s(w,y);for(let C=0;C<M.length;++C){const k=M[C];i.push(j+k)}c=g+(c.length>0?" "+c:c)}return c},Nl=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=uo(r))&&(s&&(s+=" "),s+=n);return s},uo=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=uo(e[n]))&&(r&&(r+=" "),r+=t);return r},Cl=(e,...t)=>{let r,n,s,a;const i=c=>{const d=t.reduce((g,u)=>u(g),e());return r=wl(d),n=r.cache.get,s=r.cache.set,a=l,l(c)},l=c=>{const d=n(c);if(d)return d;const g=jl(c,r);return s(c,g),g};return a=i,(...c)=>a(Nl(...c))},kl=[],ke=e=>{const t=r=>r[e]||kl;return t.isThemeGetter=!0,t},mo=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fo=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Sl=/^\d+\/\d+$/,Rl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_l=/\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$/,Ml=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Pl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Il=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xt=e=>Sl.test(e),se=e=>!!e&&!Number.isNaN(Number(e)),rt=e=>!!e&&Number.isInteger(Number(e)),wr=e=>e.endsWith("%")&&se(e.slice(0,-1)),et=e=>Rl.test(e),Tl=()=>!0,Ll=e=>_l.test(e)&&!Ml.test(e),go=()=>!1,Dl=e=>Pl.test(e),El=e=>Il.test(e),Al=e=>!W(e)&&!U(e),Fl=e=>vt(e,xo,go),W=e=>mo.test(e),it=e=>vt(e,bo,Ll),yr=e=>vt(e,Ol,se),En=e=>vt(e,po,go),Vl=e=>vt(e,ho,El),Kt=e=>vt(e,vo,Dl),U=e=>fo.test(e),St=e=>wt(e,bo),zl=e=>wt(e,Hl),An=e=>wt(e,po),$l=e=>wt(e,xo),Bl=e=>wt(e,ho),Xt=e=>wt(e,vo,!0),vt=(e,t,r)=>{const n=mo.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},wt=(e,t,r=!1)=>{const n=fo.exec(e);return n?n[1]?t(n[1]):r:!1},po=e=>e==="position"||e==="percentage",ho=e=>e==="image"||e==="url",xo=e=>e==="length"||e==="size"||e==="bg-size",bo=e=>e==="length",Ol=e=>e==="number",Hl=e=>e==="family-name",vo=e=>e==="shadow",Gl=()=>{const e=ke("color"),t=ke("font"),r=ke("text"),n=ke("font-weight"),s=ke("tracking"),a=ke("leading"),i=ke("breakpoint"),l=ke("container"),c=ke("spacing"),d=ke("radius"),g=ke("shadow"),u=ke("inset-shadow"),f=ke("text-shadow"),m=ke("drop-shadow"),h=ke("blur"),x=ke("perspective"),y=ke("aspect"),w=ke("ease"),v=ke("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...R(),U,W],C=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],N=()=>[U,W,c],S=()=>[xt,"full","auto",...N()],_=()=>[rt,"none","subgrid",U,W],D=()=>["auto",{span:["full",rt,U,W]},rt,U,W],F=()=>[rt,"auto",U,W],B=()=>["auto","min","max","fr",U,W],P=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...N()],A=()=>[xt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],T=()=>[e,U,W],oe=()=>[...R(),An,En,{position:[U,W]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Y=()=>["auto","cover","contain",$l,Fl,{size:[U,W]}],ee=()=>[wr,St,it],z=()=>["","none","full",d,U,W],L=()=>["",se,St,it],H=()=>["solid","dashed","dotted","double"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>[se,wr,An,En],X=()=>["","none",h,U,W],ce=()=>["none",se,U,W],ae=()=>["none",se,U,W],ie=()=>[se,U,W],G=()=>[xt,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[et],breakpoint:[et],color:[Tl],container:[et],"drop-shadow":[et],ease:["in","out","in-out"],font:[Al],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[et],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[et],shadow:[et],spacing:["px",se],text:[et],"text-shadow":[et],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xt,W,U,y]}],container:["container"],columns:[{columns:[se,W,U,l]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"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:M()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:S()}],"inset-x":[{"inset-x":S()}],"inset-y":[{"inset-y":S()}],start:[{start:S()}],end:[{end:S()}],top:[{top:S()}],right:[{right:S()}],bottom:[{bottom:S()}],left:[{left:S()}],visibility:["visible","invisible","collapse"],z:[{z:[rt,"auto",U,W]}],basis:[{basis:[xt,"full","auto",l,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[se,xt,"auto","initial","none",W]}],grow:[{grow:["",se,U,W]}],shrink:[{shrink:["",se,U,W]}],order:[{order:[rt,"first","last","none",U,W]}],"grid-cols":[{"grid-cols":_()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":_()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...P(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...P()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":P()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:A()}],w:[{w:[l,"screen",...A()]}],"min-w":[{"min-w":[l,"screen","none",...A()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...A()]}],h:[{h:["screen","lh",...A()]}],"min-h":[{"min-h":["screen","lh","none",...A()]}],"max-h":[{"max-h":["screen","lh",...A()]}],"font-size":[{text:["base",r,St,it]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,U,yr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",wr,W]}],"font-family":[{font:[zl,W,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,U,W]}],"line-clamp":[{"line-clamp":[se,"none",U,yr]}],leading:[{leading:[a,...N()]}],"list-image":[{"list-image":["none",U,W]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",U,W]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:[se,"from-font","auto",U,it]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[se,"auto",U,W]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",U,W]}],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",U,W]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:oe()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:Y()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},rt,U,W],radial:["",U,W],conic:[rt,U,W]},Bl,Vl]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:L()}],"border-w-x":[{"border-x":L()}],"border-w-y":[{"border-y":L()}],"border-w-s":[{"border-s":L()}],"border-w-e":[{"border-e":L()}],"border-w-t":[{"border-t":L()}],"border-w-r":[{"border-r":L()}],"border-w-b":[{"border-b":L()}],"border-w-l":[{"border-l":L()}],"divide-x":[{"divide-x":L()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":L()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...H(),"hidden","none"]}],"divide-style":[{divide:[...H(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...H(),"none","hidden"]}],"outline-offset":[{"outline-offset":[se,U,W]}],"outline-w":[{outline:["",se,St,it]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",g,Xt,Kt]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",u,Xt,Kt]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[se,it]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":L()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",f,Xt,Kt]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[se,U,W]}],"mix-blend":[{"mix-blend":[...Z(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Z()}],"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":[se]}],"mask-image-linear-from-pos":[{"mask-linear-from":O()}],"mask-image-linear-to-pos":[{"mask-linear-to":O()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":O()}],"mask-image-t-to-pos":[{"mask-t-to":O()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":O()}],"mask-image-r-to-pos":[{"mask-r-to":O()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":O()}],"mask-image-b-to-pos":[{"mask-b-to":O()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":O()}],"mask-image-l-to-pos":[{"mask-l-to":O()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":O()}],"mask-image-x-to-pos":[{"mask-x-to":O()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":O()}],"mask-image-y-to-pos":[{"mask-y-to":O()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[U,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":O()}],"mask-image-radial-to-pos":[{"mask-radial-to":O()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[se]}],"mask-image-conic-from-pos":[{"mask-conic-from":O()}],"mask-image-conic-to-pos":[{"mask-conic-to":O()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:oe()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:Y()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",U,W]}],filter:[{filter:["","none",U,W]}],blur:[{blur:X()}],brightness:[{brightness:[se,U,W]}],contrast:[{contrast:[se,U,W]}],"drop-shadow":[{"drop-shadow":["","none",m,Xt,Kt]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",se,U,W]}],"hue-rotate":[{"hue-rotate":[se,U,W]}],invert:[{invert:["",se,U,W]}],saturate:[{saturate:[se,U,W]}],sepia:[{sepia:["",se,U,W]}],"backdrop-filter":[{"backdrop-filter":["","none",U,W]}],"backdrop-blur":[{"backdrop-blur":X()}],"backdrop-brightness":[{"backdrop-brightness":[se,U,W]}],"backdrop-contrast":[{"backdrop-contrast":[se,U,W]}],"backdrop-grayscale":[{"backdrop-grayscale":["",se,U,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[se,U,W]}],"backdrop-invert":[{"backdrop-invert":["",se,U,W]}],"backdrop-opacity":[{"backdrop-opacity":[se,U,W]}],"backdrop-saturate":[{"backdrop-saturate":[se,U,W]}],"backdrop-sepia":[{"backdrop-sepia":["",se,U,W]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":N()}],"border-spacing-x":[{"border-spacing-x":N()}],"border-spacing-y":[{"border-spacing-y":N()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",U,W]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[se,"initial",U,W]}],ease:[{ease:["linear","initial",w,U,W]}],delay:[{delay:[se,U,W]}],animate:[{animate:["none",v,U,W]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,U,W]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:ie()}],"skew-x":[{"skew-x":ie()}],"skew-y":[{"skew-y":ie()}],transform:[{transform:[U,W,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:G()}],"translate-x":[{"translate-x":G()}],"translate-y":[{"translate-y":G()}],"translate-z":[{"translate-z":G()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",U,W]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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",U,W]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[se,St,it,yr]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ql=Cl(Gl);function b(...e){return ql(ao(e))}function We(e){const t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=Math.floor(e%60);return t>0?`${t}:${r.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`:`${r}:${n.toString().padStart(2,"0")}`}const Fn=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Vn=ao,ze=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Vn(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:a}=t,i=Object.keys(s).map(d=>{const g=r==null?void 0:r[d],u=a==null?void 0:a[d];if(g===null)return null;const f=Fn(g)||Fn(u);return s[d][f]}),l=r&&Object.entries(r).reduce((d,g)=>{let[u,f]=g;return f===void 0||(d[u]=f),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,g)=>{let{class:u,className:f,...m}=g;return Object.entries(m).every(h=>{let[x,y]=h;return Array.isArray(y)?y.includes({...a,...l}[x]):{...a,...l}[x]===y})?[...d,u,f]:d},[]);return Vn(e,i,c,r==null?void 0:r.class,r==null?void 0:r.className)},Bt=ze("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",brand:"bg-gradient-to-r from-violet-600 to-indigo-600 text-white hover:from-violet-500 hover:to-indigo-500 shadow-lg shadow-violet-500/25 hover:shadow-violet-500/40 hover:scale-[1.02] active:scale-[0.98]",glow:"bg-primary text-primary-foreground shadow-[0_0_20px_rgba(139,92,246,0.5)] hover:shadow-[0_0_30px_rgba(139,92,246,0.7)] hover:scale-[1.02] active:scale-[0.98]"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",xl:"h-12 rounded-lg px-10 text-base",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ve=p.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},a)=>{const i=n?to.Slot:"button";return o.jsx(i,{className:b(Bt({variant:t,size:r,className:e})),ref:a,...s})});ve.displayName="Button";const wo=ze("flex w-full rounded-lg text-sm transition-all duration-200 file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"h-10 border border-input bg-background px-3 py-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",filled:"h-10 border-0 bg-muted/50 px-3 py-2 focus-visible:outline-none focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-ring",glow:"h-10 border border-input bg-background px-3 py-2 ring-offset-background focus-visible:outline-none focus-visible:border-violet-500/50 focus-visible:ring-2 focus-visible:ring-violet-500/30 focus-visible:shadow-[0_0_15px_rgba(139,92,246,0.3)]",ghost:"h-10 border-0 bg-transparent px-3 py-2 focus-visible:outline-none focus-visible:bg-muted/30"},inputSize:{default:"h-10",sm:"h-9 text-xs",lg:"h-12 text-base"}},defaultVariants:{variant:"default",inputSize:"default"}}),st=p.forwardRef(({className:e,type:t,variant:r,inputSize:n,...s},a)=>o.jsx("input",{type:t,className:b(wo({variant:r,inputSize:n}),e),ref:a,...s}));st.displayName="Input";const yo=p.forwardRef(({className:e,...t},r)=>o.jsx("textarea",{className:b("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));yo.displayName="Textarea";const Wl=ze("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),lr=p.forwardRef(({className:e,...t},r)=>o.jsx(ro.Root,{ref:r,className:b(Wl(),e),...t}));lr.displayName=ro.Root.displayName;const jo=ze("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ur({className:e,variant:t,...r}){return o.jsx("div",{className:b(jo({variant:t}),e),...r})}const No=p.forwardRef(({className:e,orientation:t="horizontal",...r},n)=>o.jsx(no.Root,{ref:n,decorative:!0,orientation:t,className:b("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));No.displayName=no.Root.displayName;const Co=p.forwardRef(({className:e,...t},r)=>o.jsx(bt.Root,{ref:r,className:b("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Co.displayName=bt.Root.displayName;const ko=p.forwardRef(({className:e,...t},r)=>o.jsx(bt.Image,{ref:r,className:b("aspect-square h-full w-full",e),...t}));ko.displayName=bt.Image.displayName;const So=p.forwardRef(({className:e,...t},r)=>o.jsx(bt.Fallback,{ref:r,className:b("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));So.displayName=bt.Fallback.displayName;const Ro=p.forwardRef(({className:e,...t},r)=>o.jsx(Ir.Root,{ref:r,className:b("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:o.jsx(Ir.Indicator,{className:b("flex items-center justify-center text-current"),children:o.jsx(I.Check,{className:"h-4 w-4"})})}));Ro.displayName=Ir.Root.displayName;const _o=p.forwardRef(({className:e,...t},r)=>o.jsx(Tr.Root,{className:b("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r,children:o.jsx(Tr.Thumb,{className:b("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));_o.displayName=Tr.Root.displayName;const Ul=he.Root,Kl=he.Group,Xl=he.Value,Mo=p.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(he.Trigger,{ref:n,className:b("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,o.jsx(he.Icon,{asChild:!0,children:o.jsx(I.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Mo.displayName=he.Trigger.displayName;const Kr=p.forwardRef(({className:e,...t},r)=>o.jsx(he.ScrollUpButton,{ref:r,className:b("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(I.ChevronUp,{className:"h-4 w-4"})}));Kr.displayName=he.ScrollUpButton.displayName;const Xr=p.forwardRef(({className:e,...t},r)=>o.jsx(he.ScrollDownButton,{ref:r,className:b("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(I.ChevronDown,{className:"h-4 w-4"})}));Xr.displayName=he.ScrollDownButton.displayName;const Po=p.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>o.jsx(he.Portal,{children:o.jsxs(he.Content,{ref:s,className:b("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[o.jsx(Kr,{}),o.jsx(he.Viewport,{className:b("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),o.jsx(Xr,{})]})}));Po.displayName=he.Content.displayName;const Io=p.forwardRef(({className:e,...t},r)=>o.jsx(he.Label,{ref:r,className:b("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Io.displayName=he.Label.displayName;const To=p.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(he.Item,{ref:n,className:b("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(he.ItemIndicator,{children:o.jsx(I.Check,{className:"h-4 w-4"})})}),o.jsx(he.ItemText,{children:t})]}));To.displayName=he.Item.displayName;const Lo=p.forwardRef(({className:e,...t},r)=>o.jsx(he.Separator,{ref:r,className:b("-mx-1 my-1 h-px bg-muted",e),...t}));Lo.displayName=he.Separator.displayName;const Do=p.forwardRef(({className:e,...t},r)=>o.jsx(Dt.Root,{className:b("grid gap-2",e),...t,ref:r}));Do.displayName=Dt.Root.displayName;const Eo=p.forwardRef(({className:e,...t},r)=>o.jsx(Dt.Item,{ref:r,className:b("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:o.jsx(Dt.Indicator,{className:"flex items-center justify-center",children:o.jsx(I.Circle,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Eo.displayName=Dt.Item.displayName;const Ao=p.forwardRef(({className:e,...t},r)=>o.jsxs(_t.Root,{ref:r,className:b("relative flex w-full touch-none select-none items-center",e),...t,children:[o.jsx(_t.Track,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:o.jsx(_t.Range,{className:"absolute h-full bg-primary"})}),o.jsx(_t.Thumb,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Ao.displayName=_t.Root.displayName;const Yr=ze("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),Fo=p.forwardRef(({className:e,variant:t,size:r,...n},s)=>o.jsx(oo.Root,{ref:s,className:b(Yr({variant:t,size:r,className:e})),...n}));Fo.displayName=oo.Root.displayName;const Vo=p.forwardRef(({className:e,variant:t,size:r,children:n,...s},a)=>o.jsx(ar.Root,{ref:a,className:b("flex items-center justify-center gap-1",e),...s,children:o.jsx(zo.Provider,{value:{variant:t,size:r},children:n})}));Vo.displayName=ar.Root.displayName;const zo=p.createContext({size:"default",variant:"default"}),$o=p.forwardRef(({className:e,children:t,variant:r,size:n,...s},a)=>{const i=p.useContext(zo);return o.jsx(ar.Item,{ref:a,className:b(Yr({variant:i.variant||r,size:i.size||n}),e),...s,children:t})});$o.displayName=ar.Item.displayName;function Zr({selected:e,onSelect:t,className:r,disabled:n}){const[s,a]=p.useState(()=>e?Se.startOfMonth(e):Se.startOfMonth(new Date)),i=Se.startOfMonth(s),l=Se.endOfMonth(s),c=Se.startOfWeek(i,{weekStartsOn:1}),d=Se.endOfWeek(l,{weekStartsOn:1}),g=Se.eachDayOfInterval({start:c,end:d}),u=["Mo","Tu","We","Th","Fr","Sa","Su"],f=()=>{a(Se.subMonths(s,1))},m=()=>{a(Se.addMonths(s,1))},h=x=>{n!=null&&n(x)||t==null||t(Se.isSameDay(x,e||new Date(0))?void 0:x)};return o.jsxs("div",{className:b("p-4 bg-card rounded-xl border shadow-sm w-[320px]",r),children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsx(ve,{variant:"ghost",size:"icon",onClick:f,className:"h-8 w-8 rounded-full hover:bg-accent",children:o.jsx(I.ChevronLeft,{className:"h-4 w-4"})}),o.jsx("h2",{className:"text-base font-semibold",children:Se.format(s,"MMMM yyyy")}),o.jsx(ve,{variant:"ghost",size:"icon",onClick:m,className:"h-8 w-8 rounded-full hover:bg-accent",children:o.jsx(I.ChevronRight,{className:"h-4 w-4"})})]}),o.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:u.map(x=>o.jsx("div",{className:"h-8 flex items-center justify-center text-xs font-medium text-muted-foreground",children:x},x))}),o.jsx("div",{className:"grid grid-cols-7 gap-1",children:g.map((x,y)=>{const w=Se.isSameMonth(x,s),v=e&&Se.isSameDay(x,e),j=Se.isToday(x),R=n==null?void 0:n(x);return o.jsx("button",{onClick:()=>h(x),disabled:R,className:b("h-10 w-10 rounded-lg text-sm font-medium transition-all duration-150","flex items-center justify-center","hover:bg-accent focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1",!w&&"text-muted-foreground/40",w&&!v&&"text-foreground hover:text-foreground",v&&"bg-primary text-primary-foreground hover:bg-primary/90 shadow-md",j&&!v&&"bg-accent text-accent-foreground font-bold",R&&"opacity-30 cursor-not-allowed hover:bg-transparent"),children:Se.format(x,"d")},y)})}),o.jsxs("div",{className:"mt-4 pt-3 border-t flex justify-between items-center",children:[o.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>{const x=new Date;a(Se.startOfMonth(x)),t==null||t(x)},className:"text-xs",children:"Today"}),e&&o.jsx("span",{className:"text-xs text-muted-foreground",children:Se.format(e,"MMM d, yyyy")})]})]})}Zr.displayName="Calendar";const yt=Et.Root,jt=Et.Trigger,ft=p.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>o.jsx(Et.Portal,{children:o.jsx(Et.Content,{ref:s,align:t,sideOffset:r,className:b("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));ft.displayName=Et.Content.displayName;const At={chatInput_placeholder:"Type a message...",chatInput_attachFile:"Attach file",chatInput_stopGenerating:"Stop generating",chatInput_sendMessage:"Send message",conversationList_newChat:"New Chat",conversationList_searchPlaceholder:"Search conversations...",conversationList_noResults:"No conversations found",conversationList_empty:"No conversations yet",conversationList_today:"Today",conversationList_yesterday:"Yesterday",conversationList_previous7Days:"Previous 7 days",conversationList_older:"Older",conversationList_rename:"Rename",conversationList_delete:"Delete",chatHeader_online:"Online",chatHeader_offline:"Offline",chatHeader_typing:"Typing...",chatHeader_back:"Back",chatHeader_clearConversation:"Clear conversation",chatHeader_settings:"Settings",reasoning_title:"Reasoning",reasoning_thinking:"Thinking",reasoning_thoughtFor:"Thought for {duration}",toolCall_calling:"Calling {name}...",toolCall_failed:"{name} — failed",toolCall_arguments:"Arguments",toolCall_result:"Result",toolCall_error:"Error",messageActions_copy:"Copy",messageActions_retry:"Retry",messageActions_edit:"Edit",messageActions_like:"Like",messageActions_dislike:"Dislike",messageActions_share:"Share",messageActions_copied:"Copied!",followUp_freeTextPlaceholder:"Or type your answer...",followUp_send:"Send",sourceCitation_sources:"Sources",aiLoading_thinking:"Thinking",filePreview_remove:"Remove {name}",modelSelector_placeholder:"Select model",modelSelector_searchPlaceholder:"Search models...",modelSelector_noResults:"No models found",common_close:"Close",common_search:"Search",common_noResults:"No results found.",common_previous:"Previous",common_next:"Next",common_more:"More",common_copyCode:"Copy code",combobox_placeholder:"Select option...",combobox_searchPlaceholder:"Search...",combobox_empty:"No results found.",multiselect_placeholder:"Select options...",multiselect_searchPlaceholder:"Search...",multiselect_empty:"No results found.",multiselect_selected:"{count} selected",datePicker_placeholder:"Pick a date",dataTable_searchPlaceholder:"Search...",dataTable_noResults:"No results.",dataTable_pageOf:"Page {page} of {total}",dataTable_previous:"Previous",dataTable_next:"Next",fileUpload_dragDrop:"Drag & drop files here, or click to select",fileUpload_maxSize:"Max file size: {size}",tagInput_placeholder:"Add tag...",pagination_previous:"Previous",pagination_next:"Next",pagination_morePages:"More pages",pagination_goToPrevious:"Go to previous page",pagination_goToNext:"Go to next page",modeToggle_toggleTheme:"Toggle theme",modeToggle_light:"Light",modeToggle_dark:"Dark",modeToggle_system:"System",modeToggle_colorTheme:"Color theme",carousel_previousSlide:"Previous slide",carousel_nextSlide:"Next slide",breadcrumb_more:"More",audioPlayer_play:"Play",audioPlayer_pause:"Pause",audioPlayer_mute:"Mute",audioPlayer_unmute:"Unmute",audioPlayer_seek:"Seek",audioPlayer_volume:"Volume",audioRecorder_startRecording:"Start recording",audioRecorder_stopRecording:"Stop recording",audioRecorder_pauseRecording:"Pause recording",audioRecorder_resumeRecording:"Resume recording",audioRecorder_reRecord:"Re-record",audioRecorder_microphoneAccess:"Microphone access required",audioWaveform_label:"Audio waveform",audioPlaylist_shuffle:"Shuffle",audioPlaylist_repeatOff:"Repeat off",audioPlaylist_repeatAll:"Repeat all",audioPlaylist_repeatOne:"Repeat one",audioPlaylist_previousTrack:"Previous track",audioPlaylist_nextTrack:"Next track",audioPlaylist_trackOf:"Track {current} of {total}",videoPlayer_play:"Play",videoPlayer_pause:"Pause",videoPlayer_mute:"Mute",videoPlayer_unmute:"Unmute",videoPlayer_seek:"Seek",videoPlayer_volume:"Volume",videoPlayer_fullscreen:"Fullscreen",videoPlayer_exitFullscreen:"Exit fullscreen",videoPlayer_pictureInPicture:"Picture in picture",videoPlayer_playbackSpeed:"Playback speed",videoPlayer_subtitles:"Subtitles",videoPlayer_label:"Video player",videoRecorder_startCamera:"Start camera",videoRecorder_shareScreen:"Share screen",videoRecorder_startRecording:"Start recording",videoRecorder_stopRecording:"Stop recording",videoRecorder_pauseRecording:"Pause recording",videoRecorder_resumeRecording:"Resume recording",videoRecorder_reRecord:"Re-record",videoRecorder_cameraPreview:"Camera preview",videoRecorder_screenPreview:"Screen preview",videoThumbnail_play:"Play video: {title}",videoGallery_label:"Video gallery",image_loading:"Loading image",image_zoomIn:"Zoom in",image_failedToLoad:"Image failed to load",lightbox_label:"Image viewer",lightbox_zoomIn:"Zoom in",lightbox_zoomOut:"Zoom out",lightbox_imageOf:"{current} of {total}",imageCropper_label:"Image crop area",imageCropper_crop:"Crop",imageCropper_reset:"Reset",imageCompare_slider:"Image comparison slider",imageCompare_before:"Before",imageCompare_after:"After"},Bo={chatInput_placeholder:"Введите сообщение...",chatInput_attachFile:"Прикрепить файл",chatInput_stopGenerating:"Остановить генерацию",chatInput_sendMessage:"Отправить сообщение",conversationList_newChat:"Новый чат",conversationList_searchPlaceholder:"Поиск диалогов...",conversationList_noResults:"Диалоги не найдены",conversationList_empty:"Нет диалогов",conversationList_today:"Сегодня",conversationList_yesterday:"Вчера",conversationList_previous7Days:"Последние 7 дней",conversationList_older:"Ранее",conversationList_rename:"Переименовать",conversationList_delete:"Удалить",chatHeader_online:"Онлайн",chatHeader_offline:"Не в сети",chatHeader_typing:"Печатает...",chatHeader_back:"Назад",chatHeader_clearConversation:"Очистить диалог",chatHeader_settings:"Настройки",reasoning_title:"Рассуждение",reasoning_thinking:"Думаю",reasoning_thoughtFor:"Думал {duration}",toolCall_calling:"Вызываю {name}...",toolCall_failed:"{name} — ошибка",toolCall_arguments:"Аргументы",toolCall_result:"Результат",toolCall_error:"Ошибка",messageActions_copy:"Копировать",messageActions_retry:"Повторить",messageActions_edit:"Редактировать",messageActions_like:"Нравится",messageActions_dislike:"Не нравится",messageActions_share:"Поделиться",messageActions_copied:"Скопировано!",followUp_freeTextPlaceholder:"Или введите свой ответ...",followUp_send:"Отправить",sourceCitation_sources:"Источники",aiLoading_thinking:"Думаю",filePreview_remove:"Удалить {name}",modelSelector_placeholder:"Выберите модель",modelSelector_searchPlaceholder:"Поиск моделей...",modelSelector_noResults:"Модели не найдены",common_close:"Закрыть",common_search:"Поиск",common_noResults:"Ничего не найдено.",common_previous:"Назад",common_next:"Далее",common_more:"Ещё",common_copyCode:"Копировать код",combobox_placeholder:"Выберите...",combobox_searchPlaceholder:"Поиск...",combobox_empty:"Ничего не найдено.",multiselect_placeholder:"Выберите...",multiselect_searchPlaceholder:"Поиск...",multiselect_empty:"Ничего не найдено.",multiselect_selected:"{count} выбрано",datePicker_placeholder:"Выберите дату",dataTable_searchPlaceholder:"Поиск...",dataTable_noResults:"Нет результатов.",dataTable_pageOf:"Страница {page} из {total}",dataTable_previous:"Назад",dataTable_next:"Далее",fileUpload_dragDrop:"Перетащите файлы сюда или нажмите для выбора",fileUpload_maxSize:"Макс. размер файла: {size}",tagInput_placeholder:"Добавить тег...",pagination_previous:"Назад",pagination_next:"Далее",pagination_morePages:"Ещё страницы",pagination_goToPrevious:"Предыдущая страница",pagination_goToNext:"Следующая страница",modeToggle_toggleTheme:"Сменить тему",modeToggle_light:"Светлая",modeToggle_dark:"Тёмная",modeToggle_system:"Системная",modeToggle_colorTheme:"Цветовая тема",carousel_previousSlide:"Предыдущий слайд",carousel_nextSlide:"Следующий слайд",breadcrumb_more:"Ещё",audioPlayer_play:"Воспроизвести",audioPlayer_pause:"Пауза",audioPlayer_mute:"Выключить звук",audioPlayer_unmute:"Включить звук",audioPlayer_seek:"Перемотка",audioPlayer_volume:"Громкость",audioRecorder_startRecording:"Начать запись",audioRecorder_stopRecording:"Остановить запись",audioRecorder_pauseRecording:"Приостановить запись",audioRecorder_resumeRecording:"Продолжить запись",audioRecorder_reRecord:"Перезаписать",audioRecorder_microphoneAccess:"Требуется доступ к микрофону",audioWaveform_label:"Звуковая волна",audioPlaylist_shuffle:"Перемешать",audioPlaylist_repeatOff:"Повтор выключен",audioPlaylist_repeatAll:"Повторять все",audioPlaylist_repeatOne:"Повторять одну",audioPlaylist_previousTrack:"Предыдущий трек",audioPlaylist_nextTrack:"Следующий трек",audioPlaylist_trackOf:"Трек {current} из {total}",videoPlayer_play:"Воспроизвести",videoPlayer_pause:"Пауза",videoPlayer_mute:"Выключить звук",videoPlayer_unmute:"Включить звук",videoPlayer_seek:"Перемотка",videoPlayer_volume:"Громкость",videoPlayer_fullscreen:"Полный экран",videoPlayer_exitFullscreen:"Выйти из полного экрана",videoPlayer_pictureInPicture:"Картинка в картинке",videoPlayer_playbackSpeed:"Скорость воспроизведения",videoPlayer_subtitles:"Субтитры",videoPlayer_label:"Видеоплеер",videoRecorder_startCamera:"Включить камеру",videoRecorder_shareScreen:"Поделиться экраном",videoRecorder_startRecording:"Начать запись",videoRecorder_stopRecording:"Остановить запись",videoRecorder_pauseRecording:"Приостановить запись",videoRecorder_resumeRecording:"Продолжить запись",videoRecorder_reRecord:"Перезаписать",videoRecorder_cameraPreview:"Предпросмотр камеры",videoRecorder_screenPreview:"Предпросмотр экрана",videoThumbnail_play:"Воспроизвести видео: {title}",videoGallery_label:"Галерея видео",image_loading:"Загрузка изображения",image_zoomIn:"Увеличить",image_failedToLoad:"Не удалось загрузить изображение",lightbox_label:"Просмотр изображений",lightbox_zoomIn:"Увеличить",lightbox_zoomOut:"Уменьшить",lightbox_imageOf:"{current} из {total}",imageCropper_label:"Область обрезки",imageCropper_crop:"Обрезать",imageCropper_reset:"Сбросить",imageCompare_slider:"Сравнение изображений",imageCompare_before:"До",imageCompare_after:"После"};function zn(e,t){if(!e)return;const r=t.split(".");let n=e;for(const s of r){if(n===void 0||typeof n=="string")return;n=n[s]}return typeof n=="string"?n:void 0}function tr(e,t){if(!t)return e;let r=e;for(const[n,s]of Object.entries(t))r=r.replaceAll(`{${n}}`,String(s));return r}const Yl={en:At,ru:Bo},Oo=p.createContext(At),Ho=p.createContext({lang:"en",messages:{}});function Go({locale:e="en",messages:t,children:r}){const n=typeof e=="string"?e:"en",s=p.useMemo(()=>typeof e=="string"?Yl[e]??At:{...At,...e},[e]),a=p.useMemo(()=>({lang:n,messages:t??{}}),[n,t]);return o.jsx(Ho.Provider,{value:a,children:o.jsx(Oo.Provider,{value:s,children:r})})}function te(){return p.useContext(Oo)}function Zl(){const{lang:e,messages:t}=p.useContext(Ho);return{t:p.useCallback((n,s)=>{const a=zn(t[e],n);if(a!==void 0)return tr(a,s);if(e!=="en"){const i=zn(t.en,n);if(i!==void 0)return tr(i,s)}return tr(n,s)},[e,t]),lang:e}}function De(e,t){return tr(e,t)}function Jl({value:e,onChange:t,placeholder:r,disabled:n,className:s}){const a=te(),i=r??a.datePicker_placeholder,[l,c]=p.useState(!1);return o.jsxs(yt,{open:l,onOpenChange:c,children:[o.jsx(jt,{asChild:!0,children:o.jsxs(ve,{variant:"outline",disabled:n,className:b("w-full justify-start text-left font-normal",!e&&"text-muted-foreground",s),children:[o.jsx(I.CalendarIcon,{className:"mr-2 h-4 w-4"}),e?Se.format(e,"PPP"):o.jsx("span",{children:i})]})}),o.jsx(ft,{className:"w-auto p-0",align:"start",children:o.jsx(Zr,{selected:e,onSelect:d=>{t==null||t(d),c(!1)}})})]})}function Ql({value:e={hours:12,minutes:0},onChange:t,is24Hour:r=!1,disabled:n,className:s}){const[a,i]=p.useState(!1),[l,c]=p.useState(e.hours>=12?"PM":"AM"),d=r?e.hours:e.hours===0?12:e.hours>12?e.hours-12:e.hours,g=()=>{const y=d.toString().padStart(2,"0"),w=e.minutes.toString().padStart(2,"0");return r?`${y}:${w}`:`${y}:${w} ${l}`},u=y=>{let w=y;r||(l==="PM"&&y!==12&&(w+=12),l==="AM"&&y===12&&(w=0)),t==null||t({...e,hours:w})},f=y=>{t==null||t({...e,minutes:y})},m=y=>{c(y);let w=e.hours;y==="PM"&&e.hours<12&&(w+=12),y==="AM"&&e.hours>=12&&(w-=12),t==null||t({...e,hours:w})},h=r?Array.from({length:24},(y,w)=>w):Array.from({length:12},(y,w)=>w+1),x=Array.from({length:12},(y,w)=>w*5);return o.jsxs(yt,{open:a,onOpenChange:i,children:[o.jsx(jt,{asChild:!0,children:o.jsxs(ve,{variant:"outline",disabled:n,className:b("w-full justify-start font-normal",s),children:[o.jsx(I.Clock,{className:"mr-2 h-4 w-4"}),g()]})}),o.jsx(ft,{className:"w-auto p-2",align:"start",children:o.jsxs("div",{className:"flex gap-1",children:[o.jsx("div",{className:"h-32 w-12 overflow-y-auto rounded border bg-muted/30",children:h.map(y=>o.jsx("button",{onClick:()=>u(y),className:b("w-full py-1 text-sm font-medium transition-colors","hover:bg-accent",d===y&&"bg-primary text-primary-foreground hover:bg-primary/90"),children:y.toString().padStart(2,"0")},y))}),o.jsx("div",{className:"flex items-center text-muted-foreground font-bold",children:":"}),o.jsx("div",{className:"h-32 w-12 overflow-y-auto rounded border bg-muted/30",children:x.map(y=>o.jsx("button",{onClick:()=>f(y),className:b("w-full py-1 text-sm font-medium transition-colors","hover:bg-accent",e.minutes===y&&"bg-primary text-primary-foreground hover:bg-primary/90"),children:y.toString().padStart(2,"0")},y))}),!r&&o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("button",{onClick:()=>m("AM"),className:b("px-2 py-1 text-xs font-medium rounded border transition-colors flex-1","hover:bg-accent",l==="AM"&&"bg-primary text-primary-foreground border-primary"),children:"AM"}),o.jsx("button",{onClick:()=>m("PM"),className:b("px-2 py-1 text-xs font-medium rounded border transition-colors flex-1","hover:bg-accent",l==="PM"&&"bg-primary text-primary-foreground border-primary"),children:"PM"})]})]})})]})}function ec({value:e=0,onChange:t,min:r=-1/0,max:n=1/0,step:s=1,disabled:a,className:i}){const l=()=>{const g=Math.min(e+s,n);t==null||t(g)},c=()=>{const g=Math.max(e-s,r);t==null||t(g)},d=g=>{const u=parseFloat(g.target.value);if(!isNaN(u)){const f=Math.min(Math.max(u,r),n);t==null||t(f)}};return o.jsxs("div",{className:b("flex items-center gap-2",i),children:[o.jsx(ve,{type:"button",variant:"outline",size:"icon",onClick:c,disabled:a||e<=r,className:"h-9 w-9",children:o.jsx(I.Minus,{className:"h-4 w-4"})}),o.jsx(st,{type:"number",value:e,onChange:d,disabled:a,className:"w-20 text-center [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",min:r,max:n,step:s}),o.jsx(ve,{type:"button",variant:"outline",size:"icon",onClick:l,disabled:a||e>=n,className:"h-9 w-9",children:o.jsx(I.Plus,{className:"h-4 w-4"})})]})}function tc({values:e=[],onChange:t,placeholder:r,disabled:n,className:s,maxTags:a}){const i=te(),l=r??i.tagInput_placeholder,[c,d]=p.useState(""),g=p.useRef(null),u=m=>{if(m.key==="Enter"&&c.trim()){if(m.preventDefault(),a&&e.length>=a)return;e.includes(c.trim())||t==null||t([...e,c.trim()]),d("")}else m.key==="Backspace"&&!c&&e.length>0&&(t==null||t(e.slice(0,-1)))},f=m=>{t==null||t(e.filter(h=>h!==m))};return o.jsxs("div",{className:b("flex flex-wrap gap-2 rounded-md border border-input bg-background px-3 py-2 focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",n&&"opacity-50 cursor-not-allowed",s),onClick:()=>{var m;return(m=g.current)==null?void 0:m.focus()},children:[e.map(m=>o.jsxs(Ur,{variant:"secondary",className:"gap-1",children:[m,!n&&o.jsx("button",{type:"button",onClick:h=>{h.stopPropagation(),f(m)},className:"ml-1 rounded-full outline-none hover:bg-muted",children:o.jsx(I.X,{className:"h-3 w-3"})})]},m)),o.jsx("input",{ref:g,type:"text",value:c,onChange:m=>d(m.target.value),onKeyDown:u,placeholder:e.length===0?l:"",disabled:n||(a?e.length>=a:!1),className:"flex-1 min-w-[120px] bg-transparent outline-none placeholder:text-muted-foreground text-sm"})]})}function rc({options:e,value:t,onChange:r,placeholder:n,searchPlaceholder:s,emptyText:a,disabled:i,className:l}){const c=te(),d=n??c.combobox_placeholder,g=s??c.combobox_searchPlaceholder,u=a??c.combobox_empty,[f,m]=p.useState(!1),[h,x]=p.useState(""),y=e.filter(v=>v.label.toLowerCase().includes(h.toLowerCase())),w=e.find(v=>v.value===t);return o.jsxs(yt,{open:f,onOpenChange:m,children:[o.jsx(jt,{asChild:!0,children:o.jsxs(ve,{variant:"outline",role:"combobox","aria-expanded":f,disabled:i,className:b("w-full justify-between font-normal",!t&&"text-muted-foreground",l),children:[w?w.label:d,o.jsx(I.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsxs(ft,{className:"w-full p-0",align:"start",children:[o.jsx("div",{className:"p-2 border-b",children:o.jsx(st,{placeholder:g,value:h,onChange:v=>x(v.target.value),className:"h-8"})}),o.jsx("div",{className:"max-h-60 overflow-auto p-1",children:y.length===0?o.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:u}):y.map(v=>o.jsxs("button",{onClick:()=>{r==null||r(v.value===t?"":v.value),m(!1),x("")},className:b("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground",t===v.value&&"bg-accent"),children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t===v.value&&o.jsx(I.Check,{className:"h-4 w-4"})}),v.label]},v.value))})]})]})}function nc({options:e,value:t=[],onChange:r,placeholder:n,searchPlaceholder:s,emptyText:a,disabled:i,className:l,maxDisplay:c=3}){const d=te(),g=n??d.multiselect_placeholder,u=s??d.multiselect_searchPlaceholder,f=a??d.multiselect_empty,[m,h]=p.useState(!1),[x,y]=p.useState(""),w=e.filter(C=>C.label.toLowerCase().includes(x.toLowerCase())),v=e.filter(C=>t.includes(C.value)),j=C=>{const k=t.includes(C)?t.filter(N=>N!==C):[...t,C];r==null||r(k)},R=(C,k)=>{k.stopPropagation(),r==null||r(t.filter(N=>N!==C))},M=()=>t.length===0?g:t.length<=c?v.map(C=>C.label).join(", "):De(d.multiselect_selected,{count:t.length});return o.jsxs(yt,{open:m,onOpenChange:h,children:[o.jsx(jt,{asChild:!0,children:o.jsxs(ve,{variant:"outline",role:"combobox","aria-expanded":m,disabled:i,className:b("w-full justify-between font-normal",t.length===0&&"text-muted-foreground",l),children:[o.jsx("span",{className:"truncate",children:M()}),o.jsx(I.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsxs(ft,{className:"w-full p-0",align:"start",children:[o.jsx("div",{className:"p-2 border-b",children:o.jsx(st,{placeholder:u,value:x,onChange:C=>y(C.target.value),className:"h-8"})}),t.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1 p-2 border-b",children:v.map(C=>o.jsxs(Ur,{variant:"secondary",className:"pr-1",children:[C.label,o.jsx("button",{onClick:k=>R(C.value,k),className:"ml-1 rounded-full hover:bg-muted",children:o.jsx(I.X,{className:"h-3 w-3"})})]},C.value))}),o.jsx("div",{className:"max-h-60 overflow-auto p-1",children:w.length===0?o.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:f}):w.map(C=>{const k=t.includes(C.value);return o.jsxs("button",{onClick:()=>j(C.value),className:b("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground",k&&"bg-accent"),children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:k&&o.jsx(I.Check,{className:"h-4 w-4"})}),C.label]},C.value)})})]})]})}function oc({length:e=6,value:t="",onChange:r,onComplete:n,disabled:s,className:a}){const i=p.useRef([]),l=(g,u)=>{var h;if(!/^\d*$/.test(u))return;const f=t.split("");f[g]=u;const m=f.join("").slice(0,e);r==null||r(m),u&&g<e-1&&((h=i.current[g+1])==null||h.focus()),m.length===e&&(n==null||n(m))},c=(g,u)=>{var f;u.key==="Backspace"&&!t[g]&&g>0&&((f=i.current[g-1])==null||f.focus())},d=g=>{var f;g.preventDefault();const u=g.clipboardData.getData("text").replace(/\D/g,"").slice(0,e);r==null||r(u),u.length===e&&(n==null||n(u)),(f=i.current[Math.min(u.length,e-1)])==null||f.focus()};return o.jsx("div",{className:b("flex gap-2",a),children:Array.from({length:e}).map((g,u)=>o.jsx("input",{ref:f=>{i.current[u]=f},type:"text",inputMode:"numeric",maxLength:1,value:t[u]||"",onChange:f=>l(u,f.target.value),onKeyDown:f=>c(u,f),onPaste:d,disabled:s,className:b("h-12 w-12 rounded-lg border border-input bg-background text-center text-lg font-semibold","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:opacity-50 disabled:cursor-not-allowed")},u))})}function sc({accept:e,maxSize:t,multiple:r=!1,onUpload:n,disabled:s,className:a}){const[i,l]=p.useState([]),[c,d]=p.useState(!1),g=p.useRef(null),u=te(),f=v=>{if(!v)return;const j=Array.from(v).filter(M=>!(t&&M.size>t)),R=r?[...i,...j]:j.slice(0,1);l(R),n==null||n(R)},m=v=>{v.preventDefault(),d(!1),s||f(v.dataTransfer.files)},h=v=>{v.preventDefault(),s||d(!0)},x=()=>{d(!1)},y=v=>{const j=i.filter((R,M)=>M!==v);l(j),n==null||n(j)},w=v=>v<1024?v+" B":v<1024*1024?(v/1024).toFixed(1)+" KB":(v/(1024*1024)).toFixed(1)+" MB";return o.jsxs("div",{className:b("space-y-4",a),children:[o.jsxs("div",{onClick:()=>{var v;return!s&&((v=g.current)==null?void 0:v.click())},onDrop:m,onDragOver:h,onDragLeave:x,className:b("border-2 border-dashed rounded-lg p-8 text-center transition-colors cursor-pointer",c?"border-primary bg-primary/5":"border-muted-foreground/25",s&&"opacity-50 cursor-not-allowed","hover:border-primary/50"),children:[o.jsx(I.Upload,{className:"h-10 w-10 mx-auto mb-4 text-muted-foreground"}),o.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:u.fileUpload_dragDrop}),t&&o.jsx("p",{className:"text-xs text-muted-foreground",children:De(u.fileUpload_maxSize,{size:w(t)})}),o.jsx("input",{ref:g,type:"file",accept:e,multiple:r,onChange:v=>f(v.target.files),disabled:s,className:"hidden"})]}),i.length>0&&o.jsx("div",{className:"space-y-2",children:i.map((v,j)=>o.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border bg-muted/50",children:[o.jsx(I.FileIcon,{className:"h-8 w-8 text-muted-foreground"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium truncate",children:v.name}),o.jsx("p",{className:"text-xs text-muted-foreground",children:w(v.size)})]}),o.jsx(ve,{type:"button",variant:"ghost",size:"icon",onClick:()=>y(j),className:"h-8 w-8",children:o.jsx(I.X,{className:"h-4 w-4"})})]},j))})]})}const ac=["#ef4444","#f97316","#eab308","#22c55e","#14b8a6","#3b82f6","#8b5cf6","#ec4899","#000000","#ffffff"];function Yt(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!t)return{h:0,s:100,l:50};let r=parseInt(t[1],16)/255,n=parseInt(t[2],16)/255,s=parseInt(t[3],16)/255;const a=Math.max(r,n,s),i=Math.min(r,n,s);let l=0,c=0;const d=(a+i)/2;if(a!==i){const g=a-i;switch(c=d>.5?g/(2-a-i):g/(a+i),a){case r:l=((n-s)/g+(n<s?6:0))/6;break;case n:l=((s-r)/g+2)/6;break;case s:l=((r-n)/g+4)/6;break}}return{h:Math.round(l*360),s:Math.round(c*100),l:Math.round(d*100)}}function ic(e,t,r){t/=100,r/=100;const n=t*Math.min(r,1-r),s=a=>{const i=(a+e/30)%12,l=r-n*Math.max(Math.min(i-3,9-i,1),-1);return Math.round(255*l).toString(16).padStart(2,"0")};return`#${s(0)}${s(8)}${s(4)}`}function lc({value:e="#3b82f6",onChange:t,disabled:r,className:n}){const[s,a]=p.useState(!1),[i,l]=p.useState(()=>Yt(e)),[c,d]=p.useState(e),g=p.useRef(null);p.useEffect(()=>{l(Yt(e)),d(e)},[e]);const u=h=>{l(h);const x=ic(h.h,h.s,h.l);d(x),t==null||t(x)},f=h=>{if(!g.current)return;const x=g.current.getBoundingClientRect(),y=Math.max(0,Math.min(1,(h.clientX-x.left)/x.width)),w=Math.max(0,Math.min(1,(h.clientY-x.top)/x.height));u({...i,s:Math.round(y*100),l:Math.round((1-w)*100)})},m=h=>{if(d(h),/^#[0-9A-Fa-f]{6}$/.test(h)){const x=Yt(h);l(x),t==null||t(h)}};return o.jsxs(yt,{open:s,onOpenChange:a,children:[o.jsx(jt,{asChild:!0,children:o.jsxs(ve,{variant:"outline",disabled:r,className:b("w-full justify-start gap-2",n),children:[o.jsx("div",{className:"h-5 w-5 rounded border shadow-sm",style:{backgroundColor:e}}),o.jsx("span",{className:"font-mono text-sm",children:e})]})}),o.jsx(ft,{className:"w-72 p-3",align:"start",children:o.jsxs("div",{className:"space-y-3",children:[o.jsx("div",{ref:g,onClick:f,className:"relative h-40 rounded-lg cursor-crosshair overflow-hidden border",style:{background:`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),V=require("react"),to=require("@radix-ui/react-slot"),Li=require("@radix-ui/react-label"),Di=require("@radix-ui/react-separator"),Ei=require("@radix-ui/react-avatar"),Ai=require("@radix-ui/react-checkbox"),T=require("lucide-react"),Fi=require("@radix-ui/react-switch"),Vi=require("@radix-ui/react-select"),zi=require("@radix-ui/react-radio-group"),$i=require("@radix-ui/react-slider"),Bi=require("@radix-ui/react-toggle"),Oi=require("@radix-ui/react-toggle-group"),Se=require("date-fns"),Hi=require("@radix-ui/react-popover"),Gi=require("@radix-ui/react-aspect-ratio"),qi=require("@radix-ui/react-collapsible"),Wi=require("@radix-ui/react-scroll-area"),Ui=require("@radix-ui/react-tabs"),Ki=require("@radix-ui/react-accordion"),Xi=require("@radix-ui/react-dialog"),Yi=require("@radix-ui/react-dropdown-menu"),Zi=require("@radix-ui/react-tooltip"),Ee=require("cmdk"),Ji=require("@radix-ui/react-alert-dialog"),Qi=require("@radix-ui/react-progress"),Hr=require("react-dom"),el=require("@radix-ui/react-navigation-menu"),tl=require("@radix-ui/react-context-menu"),rl=require("@radix-ui/react-hover-card"),Gr=require("recharts");function ge(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const g=ge(V),ro=ge(Li),no=ge(Di),bt=ge(Ei),Ir=ge(Ai),Tr=ge(Fi),he=ge(Vi),Dt=ge(zi),_t=ge($i),oo=ge(Bi),ar=ge(Oi),Et=ge(Hi),nl=ge(Gi),qr=ge(qi),ct=ge(Wi),mt=ge(Ui),dt=ge(Ki),ue=ge(Xi),me=ge(Yi),$t=ge(Zi),Te=ge(Ji),Lr=ge(Qi),Ae=ge(el),fe=ge(tl),ir=ge(rl);function so(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=so(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ao(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=so(e))&&(n&&(n+=" "),n+=t);return n}const ol=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},sl=(e,t)=>({classGroupId:e,validator:t}),io=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),rr="-",Tn=[],al="arbitrary..",il=e=>{const t=cl(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return ll(i);const l=i.split(rr),c=l[0]===""&&l.length>1?1:0;return lo(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=n[i],d=r[i];return c?d?ol(d,c):c:d||Tn}return r[i]||Tn}}},lo=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],a=r.nextPart.get(s);if(a){const d=lo(e,t+1,a);if(d)return d}const i=r.validators;if(i===null)return;const l=t===0?e.join(rr):e.slice(t).join(rr),c=i.length;for(let d=0;d<c;d++){const p=i[d];if(p.validator(l))return p.classGroupId}},ll=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?al+n:void 0})(),cl=e=>{const{theme:t,classGroups:r}=e;return dl(r,t)},dl=(e,t)=>{const r=io();for(const n in e){const s=e[n];Wr(s,r,n,t)}return r},Wr=(e,t,r,n)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];ul(i,t,r,n)}},ul=(e,t,r,n)=>{if(typeof e=="string"){ml(e,t,r);return}if(typeof e=="function"){fl(e,t,r,n);return}gl(e,t,r,n)},ml=(e,t,r)=>{const n=e===""?t:co(t,e);n.classGroupId=r},fl=(e,t,r,n)=>{if(pl(e)){Wr(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(sl(r,e))},gl=(e,t,r,n)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[l,c]=s[i];Wr(c,co(t,l),r,n)}},co=(e,t)=>{let r=e;const n=t.split(rr),s=n.length;for(let a=0;a<s;a++){const i=n[a];let l=r.nextPart.get(i);l||(l=io(),r.nextPart.set(i,l)),r=l}return r},pl=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,hl=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const s=(a,i)=>{r[a]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(a){let i=r[a];if(i!==void 0)return i;if((i=n[a])!==void 0)return s(a,i),i},set(a,i){a in r?r[a]=i:s(a,i)}}},Dr="!",Ln=":",xl=[],Dn=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),bl=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=s=>{const a=[];let i=0,l=0,c=0,d;const p=s.length;for(let x=0;x<p;x++){const w=s[x];if(i===0&&l===0){if(w===Ln){a.push(s.slice(c,x)),c=x+1;continue}if(w==="/"){d=x;continue}}w==="["?i++:w==="]"?i--:w==="("?l++:w===")"&&l--}const u=a.length===0?s:s.slice(c);let m=u,f=!1;u.endsWith(Dr)?(m=u.slice(0,-1),f=!0):u.startsWith(Dr)&&(m=u.slice(1),f=!0);const h=d&&d>c?d-c:void 0;return Dn(a,f,m,h)};if(t){const s=t+Ln,a=n;n=i=>i.startsWith(s)?a(i.slice(s.length)):Dn(xl,!1,i,void 0,!0)}if(r){const s=n;n=a=>r({className:a,parseClassName:s})}return n},vl=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let s=[];for(let a=0;a<r.length;a++){const i=r[a],l=i[0]==="[",c=t.has(i);l||c?(s.length>0&&(s.sort(),n.push(...s),s=[]),n.push(i)):s.push(i)}return s.length>0&&(s.sort(),n.push(...s)),n}},wl=e=>({cache:hl(e.cacheSize),parseClassName:bl(e),sortModifiers:vl(e),...il(e)}),yl=/\s+/,jl=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:a}=t,i=[],l=e.trim().split(yl);let c="";for(let d=l.length-1;d>=0;d-=1){const p=l[d],{isExternal:u,modifiers:m,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:x}=r(p);if(u){c=p+(c.length>0?" "+c:c);continue}let w=!!x,v=n(w?h.substring(0,x):h);if(!v){if(!w){c=p+(c.length>0?" "+c:c);continue}if(v=n(h),!v){c=p+(c.length>0?" "+c:c);continue}w=!1}const y=m.length===0?"":m.length===1?m[0]:a(m).join(":"),j=f?y+Dr:y,k=j+v;if(i.indexOf(k)>-1)continue;i.push(k);const S=s(v,w);for(let R=0;R<S.length;++R){const _=S[R];i.push(j+_)}c=p+(c.length>0?" "+c:c)}return c},Nl=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=uo(r))&&(s&&(s+=" "),s+=n);return s},uo=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=uo(e[n]))&&(r&&(r+=" "),r+=t);return r},Cl=(e,...t)=>{let r,n,s,a;const i=c=>{const d=t.reduce((p,u)=>u(p),e());return r=wl(d),n=r.cache.get,s=r.cache.set,a=l,l(c)},l=c=>{const d=n(c);if(d)return d;const p=jl(c,r);return s(c,p),p};return a=i,(...c)=>a(Nl(...c))},kl=[],ke=e=>{const t=r=>r[e]||kl;return t.isThemeGetter=!0,t},mo=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fo=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Sl=/^\d+\/\d+$/,Rl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_l=/\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$/,Ml=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Pl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Il=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xt=e=>Sl.test(e),le=e=>!!e&&!Number.isNaN(Number(e)),rt=e=>!!e&&Number.isInteger(Number(e)),wr=e=>e.endsWith("%")&&le(e.slice(0,-1)),et=e=>Rl.test(e),Tl=()=>!0,Ll=e=>_l.test(e)&&!Ml.test(e),go=()=>!1,Dl=e=>Pl.test(e),El=e=>Il.test(e),Al=e=>!W(e)&&!U(e),Fl=e=>vt(e,xo,go),W=e=>mo.test(e),it=e=>vt(e,bo,Ll),yr=e=>vt(e,Ol,le),En=e=>vt(e,po,go),Vl=e=>vt(e,ho,El),Kt=e=>vt(e,vo,Dl),U=e=>fo.test(e),St=e=>wt(e,bo),zl=e=>wt(e,Hl),An=e=>wt(e,po),$l=e=>wt(e,xo),Bl=e=>wt(e,ho),Xt=e=>wt(e,vo,!0),vt=(e,t,r)=>{const n=mo.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},wt=(e,t,r=!1)=>{const n=fo.exec(e);return n?n[1]?t(n[1]):r:!1},po=e=>e==="position"||e==="percentage",ho=e=>e==="image"||e==="url",xo=e=>e==="length"||e==="size"||e==="bg-size",bo=e=>e==="length",Ol=e=>e==="number",Hl=e=>e==="family-name",vo=e=>e==="shadow",Gl=()=>{const e=ke("color"),t=ke("font"),r=ke("text"),n=ke("font-weight"),s=ke("tracking"),a=ke("leading"),i=ke("breakpoint"),l=ke("container"),c=ke("spacing"),d=ke("radius"),p=ke("shadow"),u=ke("inset-shadow"),m=ke("text-shadow"),f=ke("drop-shadow"),h=ke("blur"),x=ke("perspective"),w=ke("aspect"),v=ke("ease"),y=ke("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...k(),U,W],R=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],C=()=>[U,W,c],A=()=>[xt,"full","auto",...C()],L=()=>[rt,"none","subgrid",U,W],N=()=>["auto",{span:["full",rt,U,W]},rt,U,W],$=()=>[rt,"auto",U,W],I=()=>["auto","min","max","fr",U,W],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...C()],P=()=>[xt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],E=()=>[e,U,W],oe=()=>[...k(),An,En,{position:[U,W]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ae=()=>["auto","cover","contain",$l,Fl,{size:[U,W]}],X=()=>[wr,St,it],z=()=>["","none","full",d,U,W],G=()=>["",le,St,it],Y=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>[le,wr,An,En],B=()=>["","none",h,U,W],K=()=>["none",le,U,W],te=()=>["none",le,U,W],ie=()=>[le,U,W],q=()=>[xt,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[et],breakpoint:[et],color:[Tl],container:[et],"drop-shadow":[et],ease:["in","out","in-out"],font:[Al],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[et],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[et],shadow:[et],spacing:["px",le],text:[et],"text-shadow":[et],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xt,W,U,w]}],container:["container"],columns:[{columns:[le,W,U,l]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"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:S()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{start:A()}],end:[{end:A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[rt,"auto",U,W]}],basis:[{basis:[xt,"full","auto",l,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[le,xt,"auto","initial","none",W]}],grow:[{grow:["",le,U,W]}],shrink:[{shrink:["",le,U,W]}],order:[{order:[rt,"first","last","none",U,W]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":I()}],"auto-rows":[{"auto-rows":I()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:P()}],w:[{w:[l,"screen",...P()]}],"min-w":[{"min-w":[l,"screen","none",...P()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...P()]}],h:[{h:["screen","lh",...P()]}],"min-h":[{"min-h":["screen","lh","none",...P()]}],"max-h":[{"max-h":["screen","lh",...P()]}],"font-size":[{text:["base",r,St,it]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,U,yr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",wr,W]}],"font-family":[{font:[zl,W,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,U,W]}],"line-clamp":[{"line-clamp":[le,"none",U,yr]}],leading:[{leading:[a,...C()]}],"list-image":[{"list-image":["none",U,W]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",U,W]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:[le,"from-font","auto",U,it]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[le,"auto",U,W]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",U,W]}],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",U,W]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:oe()}],"bg-repeat":[{bg:Z()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},rt,U,W],radial:["",U,W],conic:[rt,U,W]},Bl,Vl]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:G()}],"border-w-x":[{"border-x":G()}],"border-w-y":[{"border-y":G()}],"border-w-s":[{"border-s":G()}],"border-w-e":[{"border-e":G()}],"border-w-t":[{"border-t":G()}],"border-w-r":[{"border-r":G()}],"border-w-b":[{"border-b":G()}],"border-w-l":[{"border-l":G()}],"divide-x":[{"divide-x":G()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":G()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Y(),"hidden","none"]}],"divide-style":[{divide:[...Y(),"hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...Y(),"none","hidden"]}],"outline-offset":[{"outline-offset":[le,U,W]}],"outline-w":[{outline:["",le,St,it]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",p,Xt,Kt]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",u,Xt,Kt]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[le,it]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":G()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",m,Xt,Kt]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[le,U,W]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[le]}],"mask-image-linear-from-pos":[{"mask-linear-from":F()}],"mask-image-linear-to-pos":[{"mask-linear-to":F()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":F()}],"mask-image-t-to-pos":[{"mask-t-to":F()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":F()}],"mask-image-r-to-pos":[{"mask-r-to":F()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":F()}],"mask-image-b-to-pos":[{"mask-b-to":F()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":F()}],"mask-image-l-to-pos":[{"mask-l-to":F()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":F()}],"mask-image-x-to-pos":[{"mask-x-to":F()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":F()}],"mask-image-y-to-pos":[{"mask-y-to":F()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[U,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":F()}],"mask-image-radial-to-pos":[{"mask-radial-to":F()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"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":k()}],"mask-image-conic-pos":[{"mask-conic":[le]}],"mask-image-conic-from-pos":[{"mask-conic-from":F()}],"mask-image-conic-to-pos":[{"mask-conic-to":F()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:oe()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",U,W]}],filter:[{filter:["","none",U,W]}],blur:[{blur:B()}],brightness:[{brightness:[le,U,W]}],contrast:[{contrast:[le,U,W]}],"drop-shadow":[{"drop-shadow":["","none",f,Xt,Kt]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",le,U,W]}],"hue-rotate":[{"hue-rotate":[le,U,W]}],invert:[{invert:["",le,U,W]}],saturate:[{saturate:[le,U,W]}],sepia:[{sepia:["",le,U,W]}],"backdrop-filter":[{"backdrop-filter":["","none",U,W]}],"backdrop-blur":[{"backdrop-blur":B()}],"backdrop-brightness":[{"backdrop-brightness":[le,U,W]}],"backdrop-contrast":[{"backdrop-contrast":[le,U,W]}],"backdrop-grayscale":[{"backdrop-grayscale":["",le,U,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[le,U,W]}],"backdrop-invert":[{"backdrop-invert":["",le,U,W]}],"backdrop-opacity":[{"backdrop-opacity":[le,U,W]}],"backdrop-saturate":[{"backdrop-saturate":[le,U,W]}],"backdrop-sepia":[{"backdrop-sepia":["",le,U,W]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",U,W]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[le,"initial",U,W]}],ease:[{ease:["linear","initial",v,U,W]}],delay:[{delay:[le,U,W]}],animate:[{animate:["none",y,U,W]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,U,W]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:K()}],"rotate-x":[{"rotate-x":K()}],"rotate-y":[{"rotate-y":K()}],"rotate-z":[{"rotate-z":K()}],scale:[{scale:te()}],"scale-x":[{"scale-x":te()}],"scale-y":[{"scale-y":te()}],"scale-z":[{"scale-z":te()}],"scale-3d":["scale-3d"],skew:[{skew:ie()}],"skew-x":[{"skew-x":ie()}],"skew-y":[{"skew-y":ie()}],transform:[{transform:[U,W,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:q()}],"translate-x":[{"translate-x":q()}],"translate-y":[{"translate-y":q()}],"translate-z":[{"translate-z":q()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"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",U,W]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"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",U,W]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[le,St,it,yr]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ql=Cl(Gl);function b(...e){return ql(ao(e))}function We(e){const t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=Math.floor(e%60);return t>0?`${t}:${r.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`:`${r}:${n.toString().padStart(2,"0")}`}const Fn=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Vn=ao,ze=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Vn(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:a}=t,i=Object.keys(s).map(d=>{const p=r==null?void 0:r[d],u=a==null?void 0:a[d];if(p===null)return null;const m=Fn(p)||Fn(u);return s[d][m]}),l=r&&Object.entries(r).reduce((d,p)=>{let[u,m]=p;return m===void 0||(d[u]=m),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,p)=>{let{class:u,className:m,...f}=p;return Object.entries(f).every(h=>{let[x,w]=h;return Array.isArray(w)?w.includes({...a,...l}[x]):{...a,...l}[x]===w})?[...d,u,m]:d},[]);return Vn(e,i,c,r==null?void 0:r.class,r==null?void 0:r.className)},Bt=ze("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",brand:"bg-gradient-to-r from-violet-600 to-indigo-600 text-white hover:from-violet-500 hover:to-indigo-500 shadow-lg shadow-violet-500/25 hover:shadow-violet-500/40 hover:scale-[1.02] active:scale-[0.98]",glow:"bg-primary text-primary-foreground shadow-[0_0_20px_rgba(139,92,246,0.5)] hover:shadow-[0_0_30px_rgba(139,92,246,0.7)] hover:scale-[1.02] active:scale-[0.98]"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",xl:"h-12 rounded-lg px-10 text-base",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ve=g.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},a)=>{const i=n?to.Slot:"button";return o.jsx(i,{className:b(Bt({variant:t,size:r,className:e})),ref:a,...s})});ve.displayName="Button";const wo=ze("flex w-full rounded-lg text-sm transition-all duration-200 file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"h-10 border border-input bg-background px-3 py-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",filled:"h-10 border-0 bg-muted/50 px-3 py-2 focus-visible:outline-none focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-ring",glow:"h-10 border border-input bg-background px-3 py-2 ring-offset-background focus-visible:outline-none focus-visible:border-violet-500/50 focus-visible:ring-2 focus-visible:ring-violet-500/30 focus-visible:shadow-[0_0_15px_rgba(139,92,246,0.3)]",ghost:"h-10 border-0 bg-transparent px-3 py-2 focus-visible:outline-none focus-visible:bg-muted/30"},inputSize:{default:"h-10",sm:"h-9 text-xs",lg:"h-12 text-base"}},defaultVariants:{variant:"default",inputSize:"default"}}),st=g.forwardRef(({className:e,type:t,variant:r,inputSize:n,...s},a)=>o.jsx("input",{type:t,className:b(wo({variant:r,inputSize:n}),e),ref:a,...s}));st.displayName="Input";const yo=g.forwardRef(({className:e,...t},r)=>o.jsx("textarea",{className:b("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));yo.displayName="Textarea";const Wl=ze("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),lr=g.forwardRef(({className:e,...t},r)=>o.jsx(ro.Root,{ref:r,className:b(Wl(),e),...t}));lr.displayName=ro.Root.displayName;const jo=ze("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ur({className:e,variant:t,...r}){return o.jsx("div",{className:b(jo({variant:t}),e),...r})}const No=g.forwardRef(({className:e,orientation:t="horizontal",...r},n)=>o.jsx(no.Root,{ref:n,decorative:!0,orientation:t,className:b("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));No.displayName=no.Root.displayName;const Co=g.forwardRef(({className:e,...t},r)=>o.jsx(bt.Root,{ref:r,className:b("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Co.displayName=bt.Root.displayName;const ko=g.forwardRef(({className:e,...t},r)=>o.jsx(bt.Image,{ref:r,className:b("aspect-square h-full w-full",e),...t}));ko.displayName=bt.Image.displayName;const So=g.forwardRef(({className:e,...t},r)=>o.jsx(bt.Fallback,{ref:r,className:b("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));So.displayName=bt.Fallback.displayName;const Ro=g.forwardRef(({className:e,...t},r)=>o.jsx(Ir.Root,{ref:r,className:b("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:o.jsx(Ir.Indicator,{className:b("flex items-center justify-center text-current"),children:o.jsx(T.Check,{className:"h-4 w-4"})})}));Ro.displayName=Ir.Root.displayName;const _o=g.forwardRef(({className:e,...t},r)=>o.jsx(Tr.Root,{className:b("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r,children:o.jsx(Tr.Thumb,{className:b("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));_o.displayName=Tr.Root.displayName;const Ul=he.Root,Kl=he.Group,Xl=he.Value,Mo=g.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(he.Trigger,{ref:n,className:b("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,o.jsx(he.Icon,{asChild:!0,children:o.jsx(T.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Mo.displayName=he.Trigger.displayName;const Kr=g.forwardRef(({className:e,...t},r)=>o.jsx(he.ScrollUpButton,{ref:r,className:b("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(T.ChevronUp,{className:"h-4 w-4"})}));Kr.displayName=he.ScrollUpButton.displayName;const Xr=g.forwardRef(({className:e,...t},r)=>o.jsx(he.ScrollDownButton,{ref:r,className:b("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(T.ChevronDown,{className:"h-4 w-4"})}));Xr.displayName=he.ScrollDownButton.displayName;const Po=g.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>o.jsx(he.Portal,{children:o.jsxs(he.Content,{ref:s,className:b("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[o.jsx(Kr,{}),o.jsx(he.Viewport,{className:b("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),o.jsx(Xr,{})]})}));Po.displayName=he.Content.displayName;const Io=g.forwardRef(({className:e,...t},r)=>o.jsx(he.Label,{ref:r,className:b("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Io.displayName=he.Label.displayName;const To=g.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(he.Item,{ref:n,className:b("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(he.ItemIndicator,{children:o.jsx(T.Check,{className:"h-4 w-4"})})}),o.jsx(he.ItemText,{children:t})]}));To.displayName=he.Item.displayName;const Lo=g.forwardRef(({className:e,...t},r)=>o.jsx(he.Separator,{ref:r,className:b("-mx-1 my-1 h-px bg-muted",e),...t}));Lo.displayName=he.Separator.displayName;const Do=g.forwardRef(({className:e,...t},r)=>o.jsx(Dt.Root,{className:b("grid gap-2",e),...t,ref:r}));Do.displayName=Dt.Root.displayName;const Eo=g.forwardRef(({className:e,...t},r)=>o.jsx(Dt.Item,{ref:r,className:b("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:o.jsx(Dt.Indicator,{className:"flex items-center justify-center",children:o.jsx(T.Circle,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Eo.displayName=Dt.Item.displayName;const Ao=g.forwardRef(({className:e,...t},r)=>o.jsxs(_t.Root,{ref:r,className:b("relative flex w-full touch-none select-none items-center",e),...t,children:[o.jsx(_t.Track,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:o.jsx(_t.Range,{className:"absolute h-full bg-primary"})}),o.jsx(_t.Thumb,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Ao.displayName=_t.Root.displayName;const Yr=ze("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),Fo=g.forwardRef(({className:e,variant:t,size:r,...n},s)=>o.jsx(oo.Root,{ref:s,className:b(Yr({variant:t,size:r,className:e})),...n}));Fo.displayName=oo.Root.displayName;const Vo=g.forwardRef(({className:e,variant:t,size:r,children:n,...s},a)=>o.jsx(ar.Root,{ref:a,className:b("flex items-center justify-center gap-1",e),...s,children:o.jsx(zo.Provider,{value:{variant:t,size:r},children:n})}));Vo.displayName=ar.Root.displayName;const zo=g.createContext({size:"default",variant:"default"}),$o=g.forwardRef(({className:e,children:t,variant:r,size:n,...s},a)=>{const i=g.useContext(zo);return o.jsx(ar.Item,{ref:a,className:b(Yr({variant:i.variant||r,size:i.size||n}),e),...s,children:t})});$o.displayName=ar.Item.displayName;function Zr({selected:e,onSelect:t,className:r,disabled:n}){const[s,a]=g.useState(()=>e?Se.startOfMonth(e):Se.startOfMonth(new Date)),i=Se.startOfMonth(s),l=Se.endOfMonth(s),c=Se.startOfWeek(i,{weekStartsOn:1}),d=Se.endOfWeek(l,{weekStartsOn:1}),p=Se.eachDayOfInterval({start:c,end:d}),u=["Mo","Tu","We","Th","Fr","Sa","Su"],m=()=>{a(Se.subMonths(s,1))},f=()=>{a(Se.addMonths(s,1))},h=x=>{n!=null&&n(x)||t==null||t(Se.isSameDay(x,e||new Date(0))?void 0:x)};return o.jsxs("div",{className:b("p-4 bg-card rounded-xl border shadow-sm w-[320px]",r),children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsx(ve,{variant:"ghost",size:"icon",onClick:m,className:"h-8 w-8 rounded-full hover:bg-accent",children:o.jsx(T.ChevronLeft,{className:"h-4 w-4"})}),o.jsx("h2",{className:"text-base font-semibold",children:Se.format(s,"MMMM yyyy")}),o.jsx(ve,{variant:"ghost",size:"icon",onClick:f,className:"h-8 w-8 rounded-full hover:bg-accent",children:o.jsx(T.ChevronRight,{className:"h-4 w-4"})})]}),o.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:u.map(x=>o.jsx("div",{className:"h-8 flex items-center justify-center text-xs font-medium text-muted-foreground",children:x},x))}),o.jsx("div",{className:"grid grid-cols-7 gap-1",children:p.map((x,w)=>{const v=Se.isSameMonth(x,s),y=e&&Se.isSameDay(x,e),j=Se.isToday(x),k=n==null?void 0:n(x);return o.jsx("button",{onClick:()=>h(x),disabled:k,className:b("h-10 w-10 rounded-lg text-sm font-medium transition-all duration-150","flex items-center justify-center","hover:bg-accent focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1",!v&&"text-muted-foreground/40",v&&!y&&"text-foreground hover:text-foreground",y&&"bg-primary text-primary-foreground hover:bg-primary/90 shadow-md",j&&!y&&"bg-accent text-accent-foreground font-bold",k&&"opacity-30 cursor-not-allowed hover:bg-transparent"),children:Se.format(x,"d")},w)})}),o.jsxs("div",{className:"mt-4 pt-3 border-t flex justify-between items-center",children:[o.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>{const x=new Date;a(Se.startOfMonth(x)),t==null||t(x)},className:"text-xs",children:"Today"}),e&&o.jsx("span",{className:"text-xs text-muted-foreground",children:Se.format(e,"MMM d, yyyy")})]})]})}Zr.displayName="Calendar";const yt=Et.Root,jt=Et.Trigger,ft=g.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>o.jsx(Et.Portal,{children:o.jsx(Et.Content,{ref:s,align:t,sideOffset:r,className:b("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));ft.displayName=Et.Content.displayName;const At={chatInput_placeholder:"Type a message...",chatInput_attachFile:"Attach file",chatInput_stopGenerating:"Stop generating",chatInput_sendMessage:"Send message",conversationList_newChat:"New Chat",conversationList_searchPlaceholder:"Search conversations...",conversationList_noResults:"No conversations found",conversationList_empty:"No conversations yet",conversationList_today:"Today",conversationList_yesterday:"Yesterday",conversationList_previous7Days:"Previous 7 days",conversationList_older:"Older",conversationList_rename:"Rename",conversationList_delete:"Delete",chatHeader_online:"Online",chatHeader_offline:"Offline",chatHeader_typing:"Typing...",chatHeader_back:"Back",chatHeader_clearConversation:"Clear conversation",chatHeader_settings:"Settings",reasoning_title:"Reasoning",reasoning_thinking:"Thinking",reasoning_thoughtFor:"Thought for {duration}",toolCall_calling:"Calling {name}...",toolCall_failed:"{name} — failed",toolCall_arguments:"Arguments",toolCall_result:"Result",toolCall_error:"Error",messageActions_copy:"Copy",messageActions_retry:"Retry",messageActions_edit:"Edit",messageActions_like:"Like",messageActions_dislike:"Dislike",messageActions_share:"Share",messageActions_copied:"Copied!",followUp_freeTextPlaceholder:"Or type your answer...",followUp_send:"Send",sourceCitation_sources:"Sources",aiLoading_thinking:"Thinking",filePreview_remove:"Remove {name}",modelSelector_placeholder:"Select model",modelSelector_searchPlaceholder:"Search models...",modelSelector_noResults:"No models found",common_close:"Close",common_search:"Search",common_noResults:"No results found.",common_previous:"Previous",common_next:"Next",common_more:"More",common_copyCode:"Copy code",combobox_placeholder:"Select option...",combobox_searchPlaceholder:"Search...",combobox_empty:"No results found.",multiselect_placeholder:"Select options...",multiselect_searchPlaceholder:"Search...",multiselect_empty:"No results found.",multiselect_selected:"{count} selected",datePicker_placeholder:"Pick a date",dataTable_searchPlaceholder:"Search...",dataTable_noResults:"No results.",dataTable_pageOf:"Page {page} of {total}",dataTable_previous:"Previous",dataTable_next:"Next",fileUpload_dragDrop:"Drag & drop files here, or click to select",fileUpload_maxSize:"Max file size: {size}",tagInput_placeholder:"Add tag...",pagination_previous:"Previous",pagination_next:"Next",pagination_morePages:"More pages",pagination_goToPrevious:"Go to previous page",pagination_goToNext:"Go to next page",modeToggle_toggleTheme:"Toggle theme",modeToggle_light:"Light",modeToggle_dark:"Dark",modeToggle_system:"System",modeToggle_colorTheme:"Color theme",carousel_previousSlide:"Previous slide",carousel_nextSlide:"Next slide",breadcrumb_more:"More",audioPlayer_play:"Play",audioPlayer_pause:"Pause",audioPlayer_mute:"Mute",audioPlayer_unmute:"Unmute",audioPlayer_seek:"Seek",audioPlayer_volume:"Volume",audioPlayer_error:"Audio failed to load",audioRecorder_startRecording:"Start recording",audioRecorder_stopRecording:"Stop recording",audioRecorder_pauseRecording:"Pause recording",audioRecorder_resumeRecording:"Resume recording",audioRecorder_reRecord:"Re-record",audioRecorder_microphoneAccess:"Microphone access required",audioWaveform_label:"Audio waveform",audioWaveform_error:"Failed to load audio waveform",audioPlaylist_shuffle:"Shuffle",audioPlaylist_repeatOff:"Repeat off",audioPlaylist_repeatAll:"Repeat all",audioPlaylist_repeatOne:"Repeat one",audioPlaylist_previousTrack:"Previous track",audioPlaylist_nextTrack:"Next track",audioPlaylist_trackOf:"Track {current} of {total}",audioPlaylist_empty:"No tracks in playlist",videoPlayer_play:"Play",videoPlayer_pause:"Pause",videoPlayer_mute:"Mute",videoPlayer_unmute:"Unmute",videoPlayer_seek:"Seek",videoPlayer_volume:"Volume",videoPlayer_fullscreen:"Fullscreen",videoPlayer_exitFullscreen:"Exit fullscreen",videoPlayer_pictureInPicture:"Picture in picture",videoPlayer_playbackSpeed:"Playback speed",videoPlayer_subtitles:"Subtitles",videoPlayer_label:"Video player",videoRecorder_startCamera:"Start camera",videoRecorder_shareScreen:"Share screen",videoRecorder_startRecording:"Start recording",videoRecorder_stopRecording:"Stop recording",videoRecorder_pauseRecording:"Pause recording",videoRecorder_resumeRecording:"Resume recording",videoRecorder_reRecord:"Re-record",videoRecorder_cameraPreview:"Camera preview",videoRecorder_screenPreview:"Screen preview",videoThumbnail_play:"Play video: {title}",videoGallery_label:"Video gallery",image_loading:"Loading image",image_zoomIn:"Zoom in",image_failedToLoad:"Image failed to load",lightbox_label:"Image viewer",lightbox_zoomIn:"Zoom in",lightbox_zoomOut:"Zoom out",lightbox_imageOf:"{current} of {total}",imageCropper_label:"Image crop area",imageCropper_crop:"Crop",imageCropper_reset:"Reset",imageCropper_cropFailed:"Failed to create cropped image",imageCompare_slider:"Image comparison slider",imageCompare_before:"Before",imageCompare_after:"After"},Bo={chatInput_placeholder:"Введите сообщение...",chatInput_attachFile:"Прикрепить файл",chatInput_stopGenerating:"Остановить генерацию",chatInput_sendMessage:"Отправить сообщение",conversationList_newChat:"Новый чат",conversationList_searchPlaceholder:"Поиск диалогов...",conversationList_noResults:"Диалоги не найдены",conversationList_empty:"Нет диалогов",conversationList_today:"Сегодня",conversationList_yesterday:"Вчера",conversationList_previous7Days:"Последние 7 дней",conversationList_older:"Ранее",conversationList_rename:"Переименовать",conversationList_delete:"Удалить",chatHeader_online:"Онлайн",chatHeader_offline:"Не в сети",chatHeader_typing:"Печатает...",chatHeader_back:"Назад",chatHeader_clearConversation:"Очистить диалог",chatHeader_settings:"Настройки",reasoning_title:"Рассуждение",reasoning_thinking:"Думаю",reasoning_thoughtFor:"Думал {duration}",toolCall_calling:"Вызываю {name}...",toolCall_failed:"{name} — ошибка",toolCall_arguments:"Аргументы",toolCall_result:"Результат",toolCall_error:"Ошибка",messageActions_copy:"Копировать",messageActions_retry:"Повторить",messageActions_edit:"Редактировать",messageActions_like:"Нравится",messageActions_dislike:"Не нравится",messageActions_share:"Поделиться",messageActions_copied:"Скопировано!",followUp_freeTextPlaceholder:"Или введите свой ответ...",followUp_send:"Отправить",sourceCitation_sources:"Источники",aiLoading_thinking:"Думаю",filePreview_remove:"Удалить {name}",modelSelector_placeholder:"Выберите модель",modelSelector_searchPlaceholder:"Поиск моделей...",modelSelector_noResults:"Модели не найдены",common_close:"Закрыть",common_search:"Поиск",common_noResults:"Ничего не найдено.",common_previous:"Назад",common_next:"Далее",common_more:"Ещё",common_copyCode:"Копировать код",combobox_placeholder:"Выберите...",combobox_searchPlaceholder:"Поиск...",combobox_empty:"Ничего не найдено.",multiselect_placeholder:"Выберите...",multiselect_searchPlaceholder:"Поиск...",multiselect_empty:"Ничего не найдено.",multiselect_selected:"{count} выбрано",datePicker_placeholder:"Выберите дату",dataTable_searchPlaceholder:"Поиск...",dataTable_noResults:"Нет результатов.",dataTable_pageOf:"Страница {page} из {total}",dataTable_previous:"Назад",dataTable_next:"Далее",fileUpload_dragDrop:"Перетащите файлы сюда или нажмите для выбора",fileUpload_maxSize:"Макс. размер файла: {size}",tagInput_placeholder:"Добавить тег...",pagination_previous:"Назад",pagination_next:"Далее",pagination_morePages:"Ещё страницы",pagination_goToPrevious:"Предыдущая страница",pagination_goToNext:"Следующая страница",modeToggle_toggleTheme:"Сменить тему",modeToggle_light:"Светлая",modeToggle_dark:"Тёмная",modeToggle_system:"Системная",modeToggle_colorTheme:"Цветовая тема",carousel_previousSlide:"Предыдущий слайд",carousel_nextSlide:"Следующий слайд",breadcrumb_more:"Ещё",audioPlayer_play:"Воспроизвести",audioPlayer_pause:"Пауза",audioPlayer_mute:"Выключить звук",audioPlayer_unmute:"Включить звук",audioPlayer_seek:"Перемотка",audioPlayer_volume:"Громкость",audioPlayer_error:"Не удалось загрузить аудио",audioRecorder_startRecording:"Начать запись",audioRecorder_stopRecording:"Остановить запись",audioRecorder_pauseRecording:"Приостановить запись",audioRecorder_resumeRecording:"Продолжить запись",audioRecorder_reRecord:"Перезаписать",audioRecorder_microphoneAccess:"Требуется доступ к микрофону",audioWaveform_label:"Звуковая волна",audioWaveform_error:"Не удалось загрузить звуковую волну",audioPlaylist_shuffle:"Перемешать",audioPlaylist_repeatOff:"Повтор выключен",audioPlaylist_repeatAll:"Повторять все",audioPlaylist_repeatOne:"Повторять одну",audioPlaylist_previousTrack:"Предыдущий трек",audioPlaylist_nextTrack:"Следующий трек",audioPlaylist_trackOf:"Трек {current} из {total}",audioPlaylist_empty:"Нет треков в плейлисте",videoPlayer_play:"Воспроизвести",videoPlayer_pause:"Пауза",videoPlayer_mute:"Выключить звук",videoPlayer_unmute:"Включить звук",videoPlayer_seek:"Перемотка",videoPlayer_volume:"Громкость",videoPlayer_fullscreen:"Полный экран",videoPlayer_exitFullscreen:"Выйти из полного экрана",videoPlayer_pictureInPicture:"Картинка в картинке",videoPlayer_playbackSpeed:"Скорость воспроизведения",videoPlayer_subtitles:"Субтитры",videoPlayer_label:"Видеоплеер",videoRecorder_startCamera:"Включить камеру",videoRecorder_shareScreen:"Поделиться экраном",videoRecorder_startRecording:"Начать запись",videoRecorder_stopRecording:"Остановить запись",videoRecorder_pauseRecording:"Приостановить запись",videoRecorder_resumeRecording:"Продолжить запись",videoRecorder_reRecord:"Перезаписать",videoRecorder_cameraPreview:"Предпросмотр камеры",videoRecorder_screenPreview:"Предпросмотр экрана",videoThumbnail_play:"Воспроизвести видео: {title}",videoGallery_label:"Галерея видео",image_loading:"Загрузка изображения",image_zoomIn:"Увеличить",image_failedToLoad:"Не удалось загрузить изображение",lightbox_label:"Просмотр изображений",lightbox_zoomIn:"Увеличить",lightbox_zoomOut:"Уменьшить",lightbox_imageOf:"{current} из {total}",imageCropper_label:"Область обрезки",imageCropper_crop:"Обрезать",imageCropper_reset:"Сбросить",imageCropper_cropFailed:"Не удалось создать обрезанное изображение",imageCompare_slider:"Сравнение изображений",imageCompare_before:"До",imageCompare_after:"После"};function zn(e,t){if(!e)return;const r=t.split(".");let n=e;for(const s of r){if(n===void 0||typeof n=="string")return;n=n[s]}return typeof n=="string"?n:void 0}function tr(e,t){if(!t)return e;let r=e;for(const[n,s]of Object.entries(t))r=r.replaceAll(`{${n}}`,String(s));return r}const Yl={en:At,ru:Bo},Oo=g.createContext(At),Ho=g.createContext({lang:"en",messages:{}});function Go({locale:e="en",messages:t,children:r}){const n=typeof e=="string"?e:"en",s=g.useMemo(()=>typeof e=="string"?Yl[e]??At:{...At,...e},[e]),a=g.useMemo(()=>({lang:n,messages:t??{}}),[n,t]);return o.jsx(Ho.Provider,{value:a,children:o.jsx(Oo.Provider,{value:s,children:r})})}function re(){return g.useContext(Oo)}function Zl(){const{lang:e,messages:t}=g.useContext(Ho);return{t:g.useCallback((n,s)=>{const a=zn(t[e],n);if(a!==void 0)return tr(a,s);if(e!=="en"){const i=zn(t.en,n);if(i!==void 0)return tr(i,s)}return tr(n,s)},[e,t]),lang:e}}function De(e,t){return tr(e,t)}function Jl({value:e,onChange:t,placeholder:r,disabled:n,className:s}){const a=re(),i=r??a.datePicker_placeholder,[l,c]=g.useState(!1);return o.jsxs(yt,{open:l,onOpenChange:c,children:[o.jsx(jt,{asChild:!0,children:o.jsxs(ve,{variant:"outline",disabled:n,className:b("w-full justify-start text-left font-normal",!e&&"text-muted-foreground",s),children:[o.jsx(T.CalendarIcon,{className:"mr-2 h-4 w-4"}),e?Se.format(e,"PPP"):o.jsx("span",{children:i})]})}),o.jsx(ft,{className:"w-auto p-0",align:"start",children:o.jsx(Zr,{selected:e,onSelect:d=>{t==null||t(d),c(!1)}})})]})}function Ql({value:e={hours:12,minutes:0},onChange:t,is24Hour:r=!1,disabled:n,className:s}){const[a,i]=g.useState(!1),[l,c]=g.useState(e.hours>=12?"PM":"AM"),d=r?e.hours:e.hours===0?12:e.hours>12?e.hours-12:e.hours,p=()=>{const w=d.toString().padStart(2,"0"),v=e.minutes.toString().padStart(2,"0");return r?`${w}:${v}`:`${w}:${v} ${l}`},u=w=>{let v=w;r||(l==="PM"&&w!==12&&(v+=12),l==="AM"&&w===12&&(v=0)),t==null||t({...e,hours:v})},m=w=>{t==null||t({...e,minutes:w})},f=w=>{c(w);let v=e.hours;w==="PM"&&e.hours<12&&(v+=12),w==="AM"&&e.hours>=12&&(v-=12),t==null||t({...e,hours:v})},h=r?Array.from({length:24},(w,v)=>v):Array.from({length:12},(w,v)=>v+1),x=Array.from({length:12},(w,v)=>v*5);return o.jsxs(yt,{open:a,onOpenChange:i,children:[o.jsx(jt,{asChild:!0,children:o.jsxs(ve,{variant:"outline",disabled:n,className:b("w-full justify-start font-normal",s),children:[o.jsx(T.Clock,{className:"mr-2 h-4 w-4"}),p()]})}),o.jsx(ft,{className:"w-auto p-2",align:"start",children:o.jsxs("div",{className:"flex gap-1",children:[o.jsx("div",{className:"h-32 w-12 overflow-y-auto rounded border bg-muted/30",children:h.map(w=>o.jsx("button",{onClick:()=>u(w),className:b("w-full py-1 text-sm font-medium transition-colors","hover:bg-accent",d===w&&"bg-primary text-primary-foreground hover:bg-primary/90"),children:w.toString().padStart(2,"0")},w))}),o.jsx("div",{className:"flex items-center text-muted-foreground font-bold",children:":"}),o.jsx("div",{className:"h-32 w-12 overflow-y-auto rounded border bg-muted/30",children:x.map(w=>o.jsx("button",{onClick:()=>m(w),className:b("w-full py-1 text-sm font-medium transition-colors","hover:bg-accent",e.minutes===w&&"bg-primary text-primary-foreground hover:bg-primary/90"),children:w.toString().padStart(2,"0")},w))}),!r&&o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("button",{onClick:()=>f("AM"),className:b("px-2 py-1 text-xs font-medium rounded border transition-colors flex-1","hover:bg-accent",l==="AM"&&"bg-primary text-primary-foreground border-primary"),children:"AM"}),o.jsx("button",{onClick:()=>f("PM"),className:b("px-2 py-1 text-xs font-medium rounded border transition-colors flex-1","hover:bg-accent",l==="PM"&&"bg-primary text-primary-foreground border-primary"),children:"PM"})]})]})})]})}function ec({value:e=0,onChange:t,min:r=-1/0,max:n=1/0,step:s=1,disabled:a,className:i}){const l=()=>{const p=Math.min(e+s,n);t==null||t(p)},c=()=>{const p=Math.max(e-s,r);t==null||t(p)},d=p=>{const u=parseFloat(p.target.value);if(!isNaN(u)){const m=Math.min(Math.max(u,r),n);t==null||t(m)}};return o.jsxs("div",{className:b("flex items-center gap-2",i),children:[o.jsx(ve,{type:"button",variant:"outline",size:"icon",onClick:c,disabled:a||e<=r,className:"h-9 w-9",children:o.jsx(T.Minus,{className:"h-4 w-4"})}),o.jsx(st,{type:"number",value:e,onChange:d,disabled:a,className:"w-20 text-center [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",min:r,max:n,step:s}),o.jsx(ve,{type:"button",variant:"outline",size:"icon",onClick:l,disabled:a||e>=n,className:"h-9 w-9",children:o.jsx(T.Plus,{className:"h-4 w-4"})})]})}function tc({values:e=[],onChange:t,placeholder:r,disabled:n,className:s,maxTags:a}){const i=re(),l=r??i.tagInput_placeholder,[c,d]=g.useState(""),p=g.useRef(null),u=f=>{if(f.key==="Enter"&&c.trim()){if(f.preventDefault(),a&&e.length>=a)return;e.includes(c.trim())||t==null||t([...e,c.trim()]),d("")}else f.key==="Backspace"&&!c&&e.length>0&&(t==null||t(e.slice(0,-1)))},m=f=>{t==null||t(e.filter(h=>h!==f))};return o.jsxs("div",{className:b("flex flex-wrap gap-2 rounded-md border border-input bg-background px-3 py-2 focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",n&&"opacity-50 cursor-not-allowed",s),onClick:()=>{var f;return(f=p.current)==null?void 0:f.focus()},children:[e.map(f=>o.jsxs(Ur,{variant:"secondary",className:"gap-1",children:[f,!n&&o.jsx("button",{type:"button",onClick:h=>{h.stopPropagation(),m(f)},className:"ml-1 rounded-full outline-none hover:bg-muted",children:o.jsx(T.X,{className:"h-3 w-3"})})]},f)),o.jsx("input",{ref:p,type:"text",value:c,onChange:f=>d(f.target.value),onKeyDown:u,placeholder:e.length===0?l:"",disabled:n||(a?e.length>=a:!1),className:"flex-1 min-w-[120px] bg-transparent outline-none placeholder:text-muted-foreground text-sm"})]})}function rc({options:e,value:t,onChange:r,placeholder:n,searchPlaceholder:s,emptyText:a,disabled:i,className:l}){const c=re(),d=n??c.combobox_placeholder,p=s??c.combobox_searchPlaceholder,u=a??c.combobox_empty,[m,f]=g.useState(!1),[h,x]=g.useState(""),w=e.filter(y=>y.label.toLowerCase().includes(h.toLowerCase())),v=e.find(y=>y.value===t);return o.jsxs(yt,{open:m,onOpenChange:f,children:[o.jsx(jt,{asChild:!0,children:o.jsxs(ve,{variant:"outline",role:"combobox","aria-expanded":m,disabled:i,className:b("w-full justify-between font-normal",!t&&"text-muted-foreground",l),children:[v?v.label:d,o.jsx(T.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsxs(ft,{className:"w-full p-0",align:"start",children:[o.jsx("div",{className:"p-2 border-b",children:o.jsx(st,{placeholder:p,value:h,onChange:y=>x(y.target.value),className:"h-8"})}),o.jsx("div",{className:"max-h-60 overflow-auto p-1",children:w.length===0?o.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:u}):w.map(y=>o.jsxs("button",{onClick:()=>{r==null||r(y.value===t?"":y.value),f(!1),x("")},className:b("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground",t===y.value&&"bg-accent"),children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t===y.value&&o.jsx(T.Check,{className:"h-4 w-4"})}),y.label]},y.value))})]})]})}function nc({options:e,value:t=[],onChange:r,placeholder:n,searchPlaceholder:s,emptyText:a,disabled:i,className:l,maxDisplay:c=3}){const d=re(),p=n??d.multiselect_placeholder,u=s??d.multiselect_searchPlaceholder,m=a??d.multiselect_empty,[f,h]=g.useState(!1),[x,w]=g.useState(""),v=e.filter(R=>R.label.toLowerCase().includes(x.toLowerCase())),y=e.filter(R=>t.includes(R.value)),j=R=>{const _=t.includes(R)?t.filter(C=>C!==R):[...t,R];r==null||r(_)},k=(R,_)=>{_.stopPropagation(),r==null||r(t.filter(C=>C!==R))},S=()=>t.length===0?p:t.length<=c?y.map(R=>R.label).join(", "):De(d.multiselect_selected,{count:t.length});return o.jsxs(yt,{open:f,onOpenChange:h,children:[o.jsx(jt,{asChild:!0,children:o.jsxs(ve,{variant:"outline",role:"combobox","aria-expanded":f,disabled:i,className:b("w-full justify-between font-normal",t.length===0&&"text-muted-foreground",l),children:[o.jsx("span",{className:"truncate",children:S()}),o.jsx(T.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsxs(ft,{className:"w-full p-0",align:"start",children:[o.jsx("div",{className:"p-2 border-b",children:o.jsx(st,{placeholder:u,value:x,onChange:R=>w(R.target.value),className:"h-8"})}),t.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1 p-2 border-b",children:y.map(R=>o.jsxs(Ur,{variant:"secondary",className:"pr-1",children:[R.label,o.jsx("button",{onClick:_=>k(R.value,_),className:"ml-1 rounded-full hover:bg-muted",children:o.jsx(T.X,{className:"h-3 w-3"})})]},R.value))}),o.jsx("div",{className:"max-h-60 overflow-auto p-1",children:v.length===0?o.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:m}):v.map(R=>{const _=t.includes(R.value);return o.jsxs("button",{onClick:()=>j(R.value),className:b("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground",_&&"bg-accent"),children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_&&o.jsx(T.Check,{className:"h-4 w-4"})}),R.label]},R.value)})})]})]})}function oc({length:e=6,value:t="",onChange:r,onComplete:n,disabled:s,className:a}){const i=g.useRef([]),l=(p,u)=>{var h;if(!/^\d*$/.test(u))return;const m=t.split("");m[p]=u;const f=m.join("").slice(0,e);r==null||r(f),u&&p<e-1&&((h=i.current[p+1])==null||h.focus()),f.length===e&&(n==null||n(f))},c=(p,u)=>{var m;u.key==="Backspace"&&!t[p]&&p>0&&((m=i.current[p-1])==null||m.focus())},d=p=>{var m;p.preventDefault();const u=p.clipboardData.getData("text").replace(/\D/g,"").slice(0,e);r==null||r(u),u.length===e&&(n==null||n(u)),(m=i.current[Math.min(u.length,e-1)])==null||m.focus()};return o.jsx("div",{className:b("flex gap-2",a),children:Array.from({length:e}).map((p,u)=>o.jsx("input",{ref:m=>{i.current[u]=m},type:"text",inputMode:"numeric",maxLength:1,value:t[u]||"",onChange:m=>l(u,m.target.value),onKeyDown:m=>c(u,m),onPaste:d,disabled:s,className:b("h-12 w-12 rounded-lg border border-input bg-background text-center text-lg font-semibold","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:opacity-50 disabled:cursor-not-allowed")},u))})}function sc({accept:e,maxSize:t,multiple:r=!1,onUpload:n,disabled:s,className:a}){const[i,l]=g.useState([]),[c,d]=g.useState(!1),p=g.useRef(null),u=re(),m=y=>{if(!y)return;const j=Array.from(y).filter(S=>!(t&&S.size>t)),k=r?[...i,...j]:j.slice(0,1);l(k),n==null||n(k)},f=y=>{y.preventDefault(),d(!1),s||m(y.dataTransfer.files)},h=y=>{y.preventDefault(),s||d(!0)},x=()=>{d(!1)},w=y=>{const j=i.filter((k,S)=>S!==y);l(j),n==null||n(j)},v=y=>y<1024?y+" B":y<1024*1024?(y/1024).toFixed(1)+" KB":(y/(1024*1024)).toFixed(1)+" MB";return o.jsxs("div",{className:b("space-y-4",a),children:[o.jsxs("div",{onClick:()=>{var y;return!s&&((y=p.current)==null?void 0:y.click())},onDrop:f,onDragOver:h,onDragLeave:x,className:b("border-2 border-dashed rounded-lg p-8 text-center transition-colors cursor-pointer",c?"border-primary bg-primary/5":"border-muted-foreground/25",s&&"opacity-50 cursor-not-allowed","hover:border-primary/50"),children:[o.jsx(T.Upload,{className:"h-10 w-10 mx-auto mb-4 text-muted-foreground"}),o.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:u.fileUpload_dragDrop}),t&&o.jsx("p",{className:"text-xs text-muted-foreground",children:De(u.fileUpload_maxSize,{size:v(t)})}),o.jsx("input",{ref:p,type:"file",accept:e,multiple:r,onChange:y=>m(y.target.files),disabled:s,className:"hidden"})]}),i.length>0&&o.jsx("div",{className:"space-y-2",children:i.map((y,j)=>o.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border bg-muted/50",children:[o.jsx(T.FileIcon,{className:"h-8 w-8 text-muted-foreground"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium truncate",children:y.name}),o.jsx("p",{className:"text-xs text-muted-foreground",children:v(y.size)})]}),o.jsx(ve,{type:"button",variant:"ghost",size:"icon",onClick:()=>w(j),className:"h-8 w-8",children:o.jsx(T.X,{className:"h-4 w-4"})})]},j))})]})}const ac=["#ef4444","#f97316","#eab308","#22c55e","#14b8a6","#3b82f6","#8b5cf6","#ec4899","#000000","#ffffff"];function Yt(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!t)return{h:0,s:100,l:50};let r=parseInt(t[1],16)/255,n=parseInt(t[2],16)/255,s=parseInt(t[3],16)/255;const a=Math.max(r,n,s),i=Math.min(r,n,s);let l=0,c=0;const d=(a+i)/2;if(a!==i){const p=a-i;switch(c=d>.5?p/(2-a-i):p/(a+i),a){case r:l=((n-s)/p+(n<s?6:0))/6;break;case n:l=((s-r)/p+2)/6;break;case s:l=((r-n)/p+4)/6;break}}return{h:Math.round(l*360),s:Math.round(c*100),l:Math.round(d*100)}}function ic(e,t,r){t/=100,r/=100;const n=t*Math.min(r,1-r),s=a=>{const i=(a+e/30)%12,l=r-n*Math.max(Math.min(i-3,9-i,1),-1);return Math.round(255*l).toString(16).padStart(2,"0")};return`#${s(0)}${s(8)}${s(4)}`}function lc({value:e="#3b82f6",onChange:t,disabled:r,className:n}){const[s,a]=g.useState(!1),[i,l]=g.useState(()=>Yt(e)),[c,d]=g.useState(e),p=g.useRef(null);g.useEffect(()=>{l(Yt(e)),d(e)},[e]);const u=h=>{l(h);const x=ic(h.h,h.s,h.l);d(x),t==null||t(x)},m=h=>{if(!p.current)return;const x=p.current.getBoundingClientRect(),w=Math.max(0,Math.min(1,(h.clientX-x.left)/x.width)),v=Math.max(0,Math.min(1,(h.clientY-x.top)/x.height));u({...i,s:Math.round(w*100),l:Math.round((1-v)*100)})},f=h=>{if(d(h),/^#[0-9A-Fa-f]{6}$/.test(h)){const x=Yt(h);l(x),t==null||t(h)}};return o.jsxs(yt,{open:s,onOpenChange:a,children:[o.jsx(jt,{asChild:!0,children:o.jsxs(ve,{variant:"outline",disabled:r,className:b("w-full justify-start gap-2",n),children:[o.jsx("div",{className:"h-5 w-5 rounded border shadow-sm",style:{backgroundColor:e}}),o.jsx("span",{className:"font-mono text-sm",children:e})]})}),o.jsx(ft,{className:"w-72 p-3",align:"start",children:o.jsxs("div",{className:"space-y-3",children:[o.jsx("div",{ref:p,onClick:m,className:"relative h-40 rounded-lg cursor-crosshair overflow-hidden border",style:{background:`
|
|
2
2
|
linear-gradient(to top, #000 0%, transparent 100%),
|
|
3
3
|
linear-gradient(to right, #fff 0%, hsl(${i.h}, 100%, 50%) 100%)
|
|
4
4
|
`},children:o.jsx("div",{className:"absolute w-4 h-4 rounded-full border-2 border-white shadow-md transform -translate-x-1/2 -translate-y-1/2 pointer-events-none",style:{left:`${i.s}%`,top:`${100-i.l}%`,backgroundColor:e}})}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(lr,{className:"text-xs",children:"Hue"}),o.jsx("input",{type:"range",min:0,max:360,value:i.h,onChange:h=>u({...i,h:parseInt(h.target.value)}),className:"w-full h-3 rounded-lg appearance-none cursor-pointer",style:{background:`linear-gradient(to right,
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
hsl(240, 100%, 50%),
|
|
10
10
|
hsl(300, 100%, 50%),
|
|
11
11
|
hsl(360, 100%, 50%)
|
|
12
|
-
)`}})]}),o.jsxs("div",{className:"flex gap-2 items-center",children:[o.jsx("div",{className:"h-9 w-9 rounded-md border flex-shrink-0 shadow-inner",style:{backgroundColor:e}}),o.jsx(st,{value:c,onChange:h=>m(h.target.value),placeholder:"#000000",className:"font-mono text-sm"})]}),o.jsx("div",{className:"grid grid-cols-5 gap-1.5",children:ac.map(h=>o.jsx("button",{onClick:()=>{t==null||t(h),l(Yt(h)),d(h)},className:b("h-7 w-7 rounded-md border-2 transition-transform hover:scale-110",e===h?"border-primary ring-2 ring-ring":"border-transparent"),style:{backgroundColor:h}},h))})]})})]})}const qo=p.forwardRef(({className:e,as:t="div",...r},n)=>o.jsx(t,{ref:n,className:b(e),...r}));qo.displayName="Box";const Wo=p.forwardRef(({className:e,direction:t,wrap:r,justify:n,align:s,gap:a,style:i,...l},c)=>o.jsx("div",{ref:c,className:b("flex",t&&`flex-${t}`,r&&`flex-${r}`,n&&`justify-${n}`,s&&`items-${s}`,typeof a=="number"&&`gap-${a}`,e),style:{...typeof a=="string"?{gap:a}:{},...i},...l}));Wo.displayName="Flex";const Uo=p.forwardRef(({className:e,spacing:t=4,align:r,style:n,...s},a)=>o.jsx("div",{ref:a,className:b("flex flex-col",typeof t=="number"&&`gap-${t}`,r&&`items-${r}`,e),style:{...typeof t=="string"?{gap:t}:{},...n},...s}));Uo.displayName="VStack";const Ko=p.forwardRef(({className:e,spacing:t=4,align:r="center",style:n,...s},a)=>o.jsx("div",{ref:a,className:b("flex flex-row",typeof t=="number"&&`gap-${t}`,r&&`items-${r}`,e),style:{...typeof t=="string"?{gap:t}:{},...n},...s}));Ko.displayName="HStack";const Xo=p.forwardRef(({className:e,cols:t=1,gap:r=4,style:n,...s},a)=>{const i=typeof t=="number"?`grid-cols-${t}`:[t.sm&&`sm:grid-cols-${t.sm}`,t.md&&`md:grid-cols-${t.md}`,t.lg&&`lg:grid-cols-${t.lg}`,t.xl&&`xl:grid-cols-${t.xl}`].filter(Boolean).join(" ");return o.jsx("div",{ref:a,className:b("grid",i,typeof r=="number"&&`gap-${r}`,e),style:{...typeof r=="string"?{gap:r}:{},...n},...s})});Xo.displayName="Grid";const cc={sm:"max-w-screen-sm",md:"max-w-screen-md",lg:"max-w-screen-lg",xl:"max-w-screen-xl","2xl":"max-w-screen-2xl",full:"max-w-full"},Yo=p.forwardRef(({className:e,maxWidth:t="lg",centered:r=!0,...n},s)=>o.jsx("div",{ref:s,className:b("w-full px-4",cc[t],r&&"mx-auto",e),...n}));Yo.displayName="Container";const dc=nl.Root,uc=qr.Root,mc=qr.CollapsibleTrigger,Zo=p.forwardRef(({className:e,children:t,...r},n)=>o.jsx(qr.CollapsibleContent,{ref:n,className:b("overflow-hidden transition-all duration-300 ease-in-out","data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",e),...r,children:o.jsx("div",{className:"pb-2",children:t})}));Zo.displayName="CollapsibleContent";const Jo=ze("rounded-xl text-card-foreground transition-all duration-300",{variants:{variant:{default:"border bg-card shadow-sm",elevated:"border border-white/10 bg-gradient-to-br from-card/80 to-card/40 backdrop-blur-xl shadow-2xl shadow-black/20",glass:"border border-white/10 bg-white/5 backdrop-blur-xl shadow-xl",ghost:"bg-transparent"}},defaultVariants:{variant:"default"}}),Jr=p.forwardRef(({className:e,variant:t,...r},n)=>o.jsx("div",{ref:n,className:b(Jo({variant:t}),e),...r}));Jr.displayName="Card";const Qr=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("flex flex-col space-y-1.5 p-6",e),...t}));Qr.displayName="CardHeader";const en=p.forwardRef(({className:e,...t},r)=>o.jsx("h3",{ref:r,className:b("text-2xl font-semibold leading-none tracking-tight",e),...t}));en.displayName="CardTitle";const Qo=p.forwardRef(({className:e,...t},r)=>o.jsx("p",{ref:r,className:b("text-sm text-muted-foreground",e),...t}));Qo.displayName="CardDescription";const tn=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("p-6 pt-0",e),...t}));tn.displayName="CardContent";const es=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("flex items-center p-6 pt-0",e),...t}));es.displayName="CardFooter";const rn=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{className:"relative w-full overflow-auto",children:o.jsx("table",{ref:r,className:b("w-full caption-bottom text-sm",e),...t})}));rn.displayName="Table";const nn=p.forwardRef(({className:e,...t},r)=>o.jsx("thead",{ref:r,className:b("[&_tr]:border-b",e),...t}));nn.displayName="TableHeader";const on=p.forwardRef(({className:e,...t},r)=>o.jsx("tbody",{ref:r,className:b("[&_tr:last-child]:border-0",e),...t}));on.displayName="TableBody";const ts=p.forwardRef(({className:e,...t},r)=>o.jsx("tfoot",{ref:r,className:b("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));ts.displayName="TableFooter";const Pt=p.forwardRef(({className:e,...t},r)=>o.jsx("tr",{ref:r,className:b("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Pt.displayName="TableRow";const sn=p.forwardRef(({className:e,...t},r)=>o.jsx("th",{ref:r,className:b("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));sn.displayName="TableHead";const nr=p.forwardRef(({className:e,...t},r)=>o.jsx("td",{ref:r,className:b("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));nr.displayName="TableCell";const rs=p.forwardRef(({className:e,...t},r)=>o.jsx("caption",{ref:r,className:b("mt-4 text-sm text-muted-foreground",e),...t}));rs.displayName="TableCaption";const cr=p.forwardRef(({className:e,children:t,orientation:r="vertical",...n},s)=>o.jsxs(ct.Root,{ref:s,className:b("relative overflow-hidden",e),...n,children:[o.jsx(ct.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(r==="vertical"||r==="both")&&o.jsx(or,{orientation:"vertical"}),(r==="horizontal"||r==="both")&&o.jsx(or,{orientation:"horizontal"}),o.jsx(ct.Corner,{})]}));cr.displayName=ct.Root.displayName;const or=p.forwardRef(({className:e,orientation:t="vertical",...r},n)=>o.jsx(ct.ScrollAreaScrollbar,{ref:n,orientation:t,className:b("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:o.jsx(ct.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));or.displayName=ct.ScrollAreaScrollbar.displayName;const fc=mt.Root,ns=p.forwardRef(({className:e,...t},r)=>o.jsx(mt.List,{ref:r,className:b("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));ns.displayName=mt.List.displayName;const os=p.forwardRef(({className:e,...t},r)=>o.jsx(mt.Trigger,{ref:r,className:b("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));os.displayName=mt.Trigger.displayName;const ss=p.forwardRef(({className:e,...t},r)=>o.jsx(mt.Content,{ref:r,className:b("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ss.displayName=mt.Content.displayName;const gc=dt.Root,as=p.forwardRef(({className:e,...t},r)=>o.jsx(dt.Item,{ref:r,className:b("border-b",e),...t}));as.displayName="AccordionItem";const is=p.forwardRef(({className:e,children:t,...r},n)=>o.jsx(dt.Header,{className:"flex",children:o.jsxs(dt.Trigger,{ref:n,className:b("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,o.jsx(I.ChevronDown,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));is.displayName=dt.Trigger.displayName;const ls=p.forwardRef(({className:e,children:t,...r},n)=>o.jsx(dt.Content,{ref:n,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:o.jsx("div",{className:b("pb-4 pt-0",e),children:t})}));ls.displayName=dt.Content.displayName;const cs=ue.Root,pc=ue.Trigger,ds=ue.Portal,hc=ue.Close,an=p.forwardRef(({className:e,...t},r)=>o.jsx(ue.Overlay,{ref:r,className:b("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));an.displayName=ue.Overlay.displayName;const ln=p.forwardRef(({className:e,children:t,...r},n)=>{const s=te();return o.jsxs(ds,{children:[o.jsx(an,{}),o.jsxs(ue.Content,{ref:n,className:b("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,o.jsxs(ue.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[o.jsx(I.X,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:s.common_close})]})]})]})});ln.displayName=ue.Content.displayName;const us=({className:e,...t})=>o.jsx("div",{className:b("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});us.displayName="DialogHeader";const ms=({className:e,...t})=>o.jsx("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ms.displayName="DialogFooter";const fs=p.forwardRef(({className:e,...t},r)=>o.jsx(ue.Title,{ref:r,className:b("text-lg font-semibold leading-none tracking-tight",e),...t}));fs.displayName=ue.Title.displayName;const gs=p.forwardRef(({className:e,...t},r)=>o.jsx(ue.Description,{ref:r,className:b("text-sm text-muted-foreground",e),...t}));gs.displayName=ue.Description.displayName;const ps=ue.Root,hs=ue.Trigger,xs=ue.Close,bs=ue.Portal,cn=p.forwardRef(({className:e,...t},r)=>o.jsx(ue.Overlay,{className:b("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));cn.displayName=ue.Overlay.displayName;const xc=ze("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),dn=p.forwardRef(({side:e="right",className:t,children:r,...n},s)=>{const a=te();return o.jsxs(bs,{children:[o.jsx(cn,{}),o.jsxs(ue.Content,{ref:s,className:b(xc({side:e}),t),...n,children:[r,o.jsxs(ue.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[o.jsx(I.X,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:a.common_close})]})]})]})});dn.displayName=ue.Content.displayName;const un=({className:e,...t})=>o.jsx("div",{className:b("flex flex-col space-y-2 text-center sm:text-left",e),...t});un.displayName="SheetHeader";const mn=({className:e,...t})=>o.jsx("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});mn.displayName="SheetFooter";const fn=p.forwardRef(({className:e,...t},r)=>o.jsx(ue.Title,{ref:r,className:b("text-lg font-semibold text-foreground",e),...t}));fn.displayName=ue.Title.displayName;const gn=p.forwardRef(({className:e,...t},r)=>o.jsx(ue.Description,{ref:r,className:b("text-sm text-muted-foreground",e),...t}));gn.displayName=ue.Description.displayName;const vs=me.Root,ws=me.Trigger,bc=me.Group,vc=me.Portal,wc=me.Sub,yc=me.RadioGroup,ys=p.forwardRef(({className:e,inset:t,children:r,...n},s)=>o.jsxs(me.SubTrigger,{ref:s,className:b("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...n,children:[r,o.jsx(I.ChevronRight,{className:"ml-auto h-4 w-4"})]}));ys.displayName=me.SubTrigger.displayName;const js=p.forwardRef(({className:e,...t},r)=>o.jsx(me.SubContent,{ref:r,className:b("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));js.displayName=me.SubContent.displayName;const pn=p.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx(me.Portal,{children:o.jsx(me.Content,{ref:n,sideOffset:t,className:b("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));pn.displayName=me.Content.displayName;const It=p.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(me.Item,{ref:n,className:b("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));It.displayName=me.Item.displayName;const Ns=p.forwardRef(({className:e,children:t,checked:r,...n},s)=>o.jsxs(me.CheckboxItem,{ref:s,className:b("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(me.ItemIndicator,{children:o.jsx(I.Check,{className:"h-4 w-4"})})}),t]}));Ns.displayName=me.CheckboxItem.displayName;const Cs=p.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(me.RadioItem,{ref:n,className:b("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(me.ItemIndicator,{children:o.jsx(I.Circle,{className:"h-2 w-2 fill-current"})})}),t]}));Cs.displayName=me.RadioItem.displayName;const ks=p.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(me.Label,{ref:n,className:b("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));ks.displayName=me.Label.displayName;const Ss=p.forwardRef(({className:e,...t},r)=>o.jsx(me.Separator,{ref:r,className:b("-mx-1 my-1 h-px bg-muted",e),...t}));Ss.displayName=me.Separator.displayName;const Rs=({className:e,...t})=>o.jsx("span",{className:b("ml-auto text-xs tracking-widest opacity-60",e),...t});Rs.displayName="DropdownMenuShortcut";const jc=$t.Provider,Nc=$t.Root,Cc=$t.Trigger,_s=p.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx($t.Content,{ref:n,sideOffset:t,className:b("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...r}));_s.displayName=$t.Content.displayName;const hn=p.forwardRef(({className:e,...t},r)=>o.jsx(Ee.Command,{ref:r,className:b("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));hn.displayName=Ee.Command.displayName;const kc=({children:e,...t})=>o.jsx(cs,{...t,children:o.jsx(ln,{className:"overflow-hidden p-0 shadow-lg",children:o.jsx(hn,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),Ms=p.forwardRef(({className:e,...t},r)=>o.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[o.jsx(I.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),o.jsx(Ee.Command.Input,{ref:r,className:b("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Ms.displayName=Ee.Command.Input.displayName;const Ps=p.forwardRef(({className:e,...t},r)=>o.jsx(Ee.Command.List,{ref:r,className:b("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Ps.displayName=Ee.Command.List.displayName;const Is=p.forwardRef((e,t)=>o.jsx(Ee.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Is.displayName=Ee.Command.Empty.displayName;const Ts=p.forwardRef(({className:e,...t},r)=>o.jsx(Ee.Command.Group,{ref:r,className:b("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Ts.displayName=Ee.Command.Group.displayName;const Ls=p.forwardRef(({className:e,...t},r)=>o.jsx(Ee.Command.Separator,{ref:r,className:b("-mx-1 h-px bg-border",e),...t}));Ls.displayName=Ee.Command.Separator.displayName;const Ds=p.forwardRef(({className:e,...t},r)=>o.jsx(Ee.Command.Item,{ref:r,className:b("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected='true']:text-accent-foreground data-[disabled=true]:opacity-50",e),...t}));Ds.displayName=Ee.Command.Item.displayName;const Es=({className:e,...t})=>o.jsx("span",{className:b("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Es.displayName="CommandShortcut";const Sc=ze("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),As=p.forwardRef(({className:e,variant:t,...r},n)=>o.jsx("div",{ref:n,role:"alert",className:b(Sc({variant:t}),e),...r}));As.displayName="Alert";const Fs=p.forwardRef(({className:e,...t},r)=>o.jsx("h5",{ref:r,className:b("mb-1 font-medium leading-none tracking-tight",e),...t}));Fs.displayName="AlertTitle";const Vs=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("text-sm [&_p]:leading-relaxed",e),...t}));Vs.displayName="AlertDescription";const Rc=Te.Root,_c=Te.Trigger,zs=Te.Portal,xn=p.forwardRef(({className:e,...t},r)=>o.jsx(Te.Overlay,{className:b("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));xn.displayName=Te.Overlay.displayName;const $s=p.forwardRef(({className:e,...t},r)=>o.jsxs(zs,{children:[o.jsx(xn,{}),o.jsx(Te.Content,{ref:r,className:b("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));$s.displayName=Te.Content.displayName;const Bs=({className:e,...t})=>o.jsx("div",{className:b("flex flex-col space-y-2 text-center sm:text-left",e),...t});Bs.displayName="AlertDialogHeader";const Os=({className:e,...t})=>o.jsx("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Os.displayName="AlertDialogFooter";const Hs=p.forwardRef(({className:e,...t},r)=>o.jsx(Te.Title,{ref:r,className:b("text-lg font-semibold",e),...t}));Hs.displayName=Te.Title.displayName;const Gs=p.forwardRef(({className:e,...t},r)=>o.jsx(Te.Description,{ref:r,className:b("text-sm text-muted-foreground",e),...t}));Gs.displayName=Te.Description.displayName;const qs=p.forwardRef(({className:e,...t},r)=>o.jsx(Te.Action,{ref:r,className:b(Bt(),e),...t}));qs.displayName=Te.Action.displayName;const Ws=p.forwardRef(({className:e,...t},r)=>o.jsx(Te.Cancel,{ref:r,className:b(Bt({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Ws.displayName=Te.Cancel.displayName;const Us=p.forwardRef(({className:e,value:t,...r},n)=>o.jsx(Lr.Root,{ref:n,className:b("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:o.jsx(Lr.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Us.displayName=Lr.Root.displayName;function Mc({className:e,...t}){return o.jsx("div",{className:b("animate-pulse rounded-md bg-muted",e),...t})}function Pc(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const Ic=e=>{switch(e){case"success":return Dc;case"info":return Ac;case"warning":return Ec;case"error":return Fc;default:return null}},Tc=Array(12).fill(0),Lc=({visible:e,className:t})=>E.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},E.createElement("div",{className:"sonner-spinner"},Tc.map((r,n)=>E.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Dc=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.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"})),Ec=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},E.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"})),Ac=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.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"})),Fc=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.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"})),Vc=E.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"},E.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),E.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),zc=()=>{const[e,t]=E.useState(document.hidden);return E.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let Er=1;class $c{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...s}=t,a=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:Er++,i=this.toasts.find(c=>c.id===a),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...t,id:a,title:n}),{...c,...t,id:a,dismissible:l,title:n}):c):this.addToast({title:n,...s,dismissible:l,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let a=n!==void 0,i;const l=s.then(async d=>{if(i=["resolve",d],E.isValidElement(d))a=!1,this.create({id:n,type:"default",message:d});else if(Oc(d)&&!d.ok){a=!1;const u=typeof r.error=="function"?await r.error(`HTTP error! status: ${d.status}`):r.error,f=typeof r.description=="function"?await r.description(`HTTP error! status: ${d.status}`):r.description,h=typeof u=="object"&&!E.isValidElement(u)?u:{message:u};this.create({id:n,type:"error",description:f,...h})}else if(d instanceof Error){a=!1;const u=typeof r.error=="function"?await r.error(d):r.error,f=typeof r.description=="function"?await r.description(d):r.description,h=typeof u=="object"&&!E.isValidElement(u)?u:{message:u};this.create({id:n,type:"error",description:f,...h})}else if(r.success!==void 0){a=!1;const u=typeof r.success=="function"?await r.success(d):r.success,f=typeof r.description=="function"?await r.description(d):r.description,h=typeof u=="object"&&!E.isValidElement(u)?u:{message:u};this.create({id:n,type:"success",description:f,...h})}}).catch(async d=>{if(i=["reject",d],r.error!==void 0){a=!1;const g=typeof r.error=="function"?await r.error(d):r.error,u=typeof r.description=="function"?await r.description(d):r.description,m=typeof g=="object"&&!E.isValidElement(g)?g:{message:g};this.create({id:n,type:"error",description:u,...m})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),c=()=>new Promise((d,g)=>l.then(()=>i[0]==="reject"?g(i[1]):d(i[1])).catch(g));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(t,r)=>{const n=(r==null?void 0:r.id)||Er++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Le=new $c,Bc=(e,t)=>{const r=(t==null?void 0:t.id)||Er++;return Le.addToast({title:e,...t,id:r}),r},Oc=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Hc=Bc,Gc=()=>Le.toasts,qc=()=>Le.getActiveToasts(),Wc=Object.assign(Hc,{success:Le.success,info:Le.info,warning:Le.warning,error:Le.error,custom:Le.custom,message:Le.message,promise:Le.promise,dismiss:Le.dismiss,loading:Le.loading},{getHistory:Gc,getToasts:qc});Pc("[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 Zt(e){return e.label!==void 0}const Uc=3,Kc="24px",Xc="16px",$n=4e3,Yc=356,Zc=14,Jc=45,Qc=200;function Je(...e){return e.filter(Boolean).join(" ")}function ed(e){const[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}const td=e=>{var t,r,n,s,a,i,l,c,d;const{invert:g,toast:u,unstyled:f,interacting:m,setHeights:h,visibleToasts:x,heights:y,index:w,toasts:v,expanded:j,removeToast:R,defaultRichColors:M,closeButton:C,style:k,cancelButtonStyle:N,actionButtonStyle:S,className:_="",descriptionClassName:D="",duration:F,position:B,gap:P,expandByDefault:q,classNames:V,icons:A,closeButtonAriaLabel:T="Close toast"}=e,[oe,K]=E.useState(null),[Y,ee]=E.useState(null),[z,L]=E.useState(!1),[H,Z]=E.useState(!1),[O,X]=E.useState(!1),[ce,ae]=E.useState(!1),[ie,G]=E.useState(!1),[le,de]=E.useState(0),[we,Pe]=E.useState(0),ye=E.useRef(u.duration||F||$n),$e=E.useRef(null),xe=E.useRef(null),Oe=w===0,Qe=w+1<=x,je=u.type,Fe=u.dismissible!==!1,gt=u.className||"",$=u.descriptionClassName||"",re=E.useMemo(()=>y.findIndex(ne=>ne.toastId===u.id)||0,[y,u.id]),Ne=E.useMemo(()=>{var ne;return(ne=u.closeButton)!=null?ne:C},[u.closeButton,C]),Xe=E.useMemo(()=>u.duration||F||$n,[u.duration,F]),Ye=E.useRef(0),_e=E.useRef(0),pt=E.useRef(0),Ze=E.useRef(null),[ht,xr]=B.split("-"),Ht=E.useMemo(()=>y.reduce((ne,be,Ce)=>Ce>=re?ne:ne+be.height,0),[y,re]),Gt=zc(),br=u.invert||g,Nt=je==="loading";_e.current=E.useMemo(()=>re*P+Ht,[re,Ht]),E.useEffect(()=>{ye.current=Xe},[Xe]),E.useEffect(()=>{L(!0)},[]),E.useEffect(()=>{const ne=xe.current;if(ne){const be=ne.getBoundingClientRect().height;return Pe(be),h(Ce=>[{toastId:u.id,height:be,position:u.position},...Ce]),()=>h(Ce=>Ce.filter(Ie=>Ie.toastId!==u.id))}},[h,u.id]),E.useLayoutEffect(()=>{if(!z)return;const ne=xe.current,be=ne.style.height;ne.style.height="auto";const Ce=ne.getBoundingClientRect().height;ne.style.height=be,Pe(Ce),h(Ie=>Ie.find(Re=>Re.toastId===u.id)?Ie.map(Re=>Re.toastId===u.id?{...Re,height:Ce}:Re):[{toastId:u.id,height:Ce,position:u.position},...Ie])},[z,u.title,u.description,h,u.id,u.jsx,u.action,u.cancel]);const He=E.useCallback(()=>{Z(!0),de(_e.current),h(ne=>ne.filter(be=>be.toastId!==u.id)),setTimeout(()=>{R(u)},Qc)},[u,R,h,_e]);E.useEffect(()=>{if(u.promise&&je==="loading"||u.duration===1/0||u.type==="loading")return;let ne;return j||m||Gt?(()=>{if(pt.current<Ye.current){const Ie=new Date().getTime()-Ye.current;ye.current=ye.current-Ie}pt.current=new Date().getTime()})():(()=>{ye.current!==1/0&&(Ye.current=new Date().getTime(),ne=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),He()},ye.current))})(),()=>clearTimeout(ne)},[j,m,u,je,Gt,He]),E.useEffect(()=>{u.delete&&(He(),u.onDismiss==null||u.onDismiss.call(u,u))},[He,u.delete]);function vr(){var ne;if(A!=null&&A.loading){var be;return E.createElement("div",{className:Je(V==null?void 0:V.loader,u==null||(be=u.classNames)==null?void 0:be.loader,"sonner-loader"),"data-visible":je==="loading"},A.loading)}return E.createElement(Lc,{className:Je(V==null?void 0:V.loader,u==null||(ne=u.classNames)==null?void 0:ne.loader),visible:je==="loading"})}const qt=u.icon||(A==null?void 0:A[je])||Ic(je);var Ct,kt;return E.createElement("li",{tabIndex:0,ref:xe,className:Je(_,gt,V==null?void 0:V.toast,u==null||(t=u.classNames)==null?void 0:t.toast,V==null?void 0:V.default,V==null?void 0:V[je],u==null||(r=u.classNames)==null?void 0:r[je]),"data-sonner-toast":"","data-rich-colors":(Ct=u.richColors)!=null?Ct:M,"data-styled":!(u.jsx||u.unstyled||f),"data-mounted":z,"data-promise":!!u.promise,"data-swiped":ie,"data-removed":H,"data-visible":Qe,"data-y-position":ht,"data-x-position":xr,"data-index":w,"data-front":Oe,"data-swiping":O,"data-dismissible":Fe,"data-type":je,"data-invert":br,"data-swipe-out":ce,"data-swipe-direction":Y,"data-expanded":!!(j||q&&z),"data-testid":u.testId,style:{"--index":w,"--toasts-before":w,"--z-index":v.length-w,"--offset":`${H?le:_e.current}px`,"--initial-height":q?"auto":`${we}px`,...k,...u.style},onDragEnd:()=>{X(!1),K(null),Ze.current=null},onPointerDown:ne=>{ne.button!==2&&(Nt||!Fe||($e.current=new Date,de(_e.current),ne.target.setPointerCapture(ne.pointerId),ne.target.tagName!=="BUTTON"&&(X(!0),Ze.current={x:ne.clientX,y:ne.clientY})))},onPointerUp:()=>{var ne,be,Ce;if(ce||!Fe)return;Ze.current=null;const Ie=Number(((ne=xe.current)==null?void 0:ne.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Wt=Number(((be=xe.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Re=new Date().getTime()-((Ce=$e.current)==null?void 0:Ce.getTime()),Be=oe==="x"?Ie:Wt,Ut=Math.abs(Be)/Re;if(Math.abs(Be)>=Jc||Ut>.11){de(_e.current),u.onDismiss==null||u.onDismiss.call(u,u),ee(oe==="x"?Ie>0?"right":"left":Wt>0?"down":"up"),He(),ae(!0);return}else{var Ge,qe;(Ge=xe.current)==null||Ge.style.setProperty("--swipe-amount-x","0px"),(qe=xe.current)==null||qe.style.setProperty("--swipe-amount-y","0px")}G(!1),X(!1),K(null)},onPointerMove:ne=>{var be,Ce,Ie;if(!Ze.current||!Fe||((be=window.getSelection())==null?void 0:be.toString().length)>0)return;const Re=ne.clientY-Ze.current.y,Be=ne.clientX-Ze.current.x;var Ut;const Ge=(Ut=e.swipeDirections)!=null?Ut:ed(B);!oe&&(Math.abs(Be)>1||Math.abs(Re)>1)&&K(Math.abs(Be)>Math.abs(Re)?"x":"y");let qe={x:0,y:0};const In=at=>1/(1.5+Math.abs(at)/20);if(oe==="y"){if(Ge.includes("top")||Ge.includes("bottom"))if(Ge.includes("top")&&Re<0||Ge.includes("bottom")&&Re>0)qe.y=Re;else{const at=Re*In(Re);qe.y=Math.abs(at)<Math.abs(Re)?at:Re}}else if(oe==="x"&&(Ge.includes("left")||Ge.includes("right")))if(Ge.includes("left")&&Be<0||Ge.includes("right")&&Be>0)qe.x=Be;else{const at=Be*In(Be);qe.x=Math.abs(at)<Math.abs(Be)?at:Be}(Math.abs(qe.x)>0||Math.abs(qe.y)>0)&&G(!0),(Ce=xe.current)==null||Ce.style.setProperty("--swipe-amount-x",`${qe.x}px`),(Ie=xe.current)==null||Ie.style.setProperty("--swipe-amount-y",`${qe.y}px`)}},Ne&&!u.jsx&&je!=="loading"?E.createElement("button",{"aria-label":T,"data-disabled":Nt,"data-close-button":!0,onClick:Nt||!Fe?()=>{}:()=>{He(),u.onDismiss==null||u.onDismiss.call(u,u)},className:Je(V==null?void 0:V.closeButton,u==null||(n=u.classNames)==null?void 0:n.closeButton)},(kt=A==null?void 0:A.close)!=null?kt:Vc):null,(je||u.icon||u.promise)&&u.icon!==null&&((A==null?void 0:A[je])!==null||u.icon)?E.createElement("div",{"data-icon":"",className:Je(V==null?void 0:V.icon,u==null||(s=u.classNames)==null?void 0:s.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||vr():null,u.type!=="loading"?qt:null):null,E.createElement("div",{"data-content":"",className:Je(V==null?void 0:V.content,u==null||(a=u.classNames)==null?void 0:a.content)},E.createElement("div",{"data-title":"",className:Je(V==null?void 0:V.title,u==null||(i=u.classNames)==null?void 0:i.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?E.createElement("div",{"data-description":"",className:Je(D,$,V==null?void 0:V.description,u==null||(l=u.classNames)==null?void 0:l.description)},typeof u.description=="function"?u.description():u.description):null),E.isValidElement(u.cancel)?u.cancel:u.cancel&&Zt(u.cancel)?E.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||N,onClick:ne=>{Zt(u.cancel)&&Fe&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,ne),He())},className:Je(V==null?void 0:V.cancelButton,u==null||(c=u.classNames)==null?void 0:c.cancelButton)},u.cancel.label):null,E.isValidElement(u.action)?u.action:u.action&&Zt(u.action)?E.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||S,onClick:ne=>{Zt(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,ne),!ne.defaultPrevented&&He())},className:Je(V==null?void 0:V.actionButton,u==null||(d=u.classNames)==null?void 0:d.actionButton)},u.action.label):null)};function Bn(){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 rd(e,t){const r={};return[e,t].forEach((n,s)=>{const a=s===1,i=a?"--mobile-offset":"--offset",l=a?Xc:Kc;function c(d){["top","right","bottom","left"].forEach(g=>{r[`${i}-${g}`]=typeof d=="number"?`${d}px`:d})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(d=>{n[d]===void 0?r[`${i}-${d}`]=l:r[`${i}-${d}`]=typeof n[d]=="number"?`${n[d]}px`:n[d]}):c(l)}),r}const nd=E.forwardRef(function(t,r){const{id:n,invert:s,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:l,closeButton:c,className:d,offset:g,mobileOffset:u,theme:f="light",richColors:m,duration:h,style:x,visibleToasts:y=Uc,toastOptions:w,dir:v=Bn(),gap:j=Zc,icons:R,containerAriaLabel:M="Notifications"}=t,[C,k]=E.useState([]),N=E.useMemo(()=>n?C.filter(z=>z.toasterId===n):C.filter(z=>!z.toasterId),[C,n]),S=E.useMemo(()=>Array.from(new Set([a].concat(N.filter(z=>z.position).map(z=>z.position)))),[N,a]),[_,D]=E.useState([]),[F,B]=E.useState(!1),[P,q]=E.useState(!1),[V,A]=E.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),T=E.useRef(null),oe=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=E.useRef(null),Y=E.useRef(!1),ee=E.useCallback(z=>{k(L=>{var H;return(H=L.find(Z=>Z.id===z.id))!=null&&H.delete||Le.dismiss(z.id),L.filter(({id:Z})=>Z!==z.id)})},[]);return E.useEffect(()=>Le.subscribe(z=>{if(z.dismiss){requestAnimationFrame(()=>{k(L=>L.map(H=>H.id===z.id?{...H,delete:!0}:H))});return}setTimeout(()=>{Hr.flushSync(()=>{k(L=>{const H=L.findIndex(Z=>Z.id===z.id);return H!==-1?[...L.slice(0,H),{...L[H],...z},...L.slice(H+1)]:[z,...L]})})})}),[C]),E.useEffect(()=>{if(f!=="system"){A(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?A("dark"):A("light")),typeof window>"u")return;const z=window.matchMedia("(prefers-color-scheme: dark)");try{z.addEventListener("change",({matches:L})=>{A(L?"dark":"light")})}catch{z.addListener(({matches:H})=>{try{A(H?"dark":"light")}catch(Z){console.error(Z)}})}},[f]),E.useEffect(()=>{C.length<=1&&B(!1)},[C]),E.useEffect(()=>{const z=L=>{var H;if(i.every(X=>L[X]||L.code===X)){var O;B(!0),(O=T.current)==null||O.focus()}L.code==="Escape"&&(document.activeElement===T.current||(H=T.current)!=null&&H.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[i]),E.useEffect(()=>{if(T.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,Y.current=!1)}},[T.current]),E.createElement("section",{ref:r,"aria-label":`${M} ${oe}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},S.map((z,L)=>{var H;const[Z,O]=z.split("-");return N.length?E.createElement("ol",{key:z,dir:v==="auto"?Bn():v,tabIndex:-1,ref:T,className:d,"data-sonner-toaster":!0,"data-sonner-theme":V,"data-y-position":Z,"data-x-position":O,style:{"--front-toast-height":`${((H=_[0])==null?void 0:H.height)||0}px`,"--width":`${Yc}px`,"--gap":`${j}px`,...x,...rd(g,u)},onBlur:X=>{Y.current&&!X.currentTarget.contains(X.relatedTarget)&&(Y.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:X=>{X.target instanceof HTMLElement&&X.target.dataset.dismissible==="false"||Y.current||(Y.current=!0,K.current=X.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{P||B(!1)},onDragEnd:()=>B(!1),onPointerDown:X=>{X.target instanceof HTMLElement&&X.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},N.filter(X=>!X.position&&L===0||X.position===z).map((X,ce)=>{var ae,ie;return E.createElement(td,{key:X.id,icons:R,index:ce,toast:X,defaultRichColors:m,duration:(ae=w==null?void 0:w.duration)!=null?ae:h,className:w==null?void 0:w.className,descriptionClassName:w==null?void 0:w.descriptionClassName,invert:s,visibleToasts:y,closeButton:(ie=w==null?void 0:w.closeButton)!=null?ie:c,interacting:P,position:z,style:w==null?void 0:w.style,unstyled:w==null?void 0:w.unstyled,classNames:w==null?void 0:w.classNames,cancelButtonStyle:w==null?void 0:w.cancelButtonStyle,actionButtonStyle:w==null?void 0:w.actionButtonStyle,closeButtonAriaLabel:w==null?void 0:w.closeButtonAriaLabel,removeToast:ee,toasts:N.filter(G=>G.position==X.position),heights:_.filter(G=>G.position==X.position),setHeights:D,expandByDefault:l,gap:j,expanded:F,swipeDirections:t.swipeDirections})})):null}))}),jr=["light","dark","system"];function od(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function On(e){return e==="system"?od():e}function sd(e){if(typeof document>"u")return()=>{};const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*, *::before, *::after { transition: none !important; animation: none !important; }")),document.head.appendChild(t),window.getComputedStyle(document.body),()=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{document.head.removeChild(t)})})}}function ad(e,t){const r=document.documentElement;t==="class"?(r.classList.remove("light","dark"),r.classList.add(e)):r.setAttribute("data-theme",e)}const Ks=E.createContext(void 0);function id({children:e,defaultTheme:t="system",storageKey:r="nui-theme",attribute:n="class",enableSystem:s=!0,disableTransitionOnChange:a=!1,forcedTheme:i,nonce:l}){const[c,d]=E.useState(()=>{if(typeof window>"u")return t;const w=localStorage.getItem(r);return w&&jr.includes(w)?w:t}),[g,u]=E.useState(()=>On(i??c)),f=E.useRef(c);f.current=c;const m=E.useCallback(()=>{const w=i??f.current,v=On(w);u(v);let j;a&&(j=sd(l)),ad(v,n),j==null||j()},[i,n,a,l]);E.useEffect(()=>{m()},[c,i,m]),E.useEffect(()=>{if(!s)return;const w=window.matchMedia("(prefers-color-scheme: dark)"),v=()=>{(i??f.current)==="system"&&m()};return w.addEventListener("change",v),()=>w.removeEventListener("change",v)},[s,i,m]),E.useEffect(()=>{const w=v=>{if(v.key===r&&v.newValue){const j=v.newValue;jr.includes(j)&&d(j)}};return window.addEventListener("storage",w),()=>window.removeEventListener("storage",w)},[r]);const h=E.useCallback(w=>{!s&&w==="system"||(localStorage.setItem(r,w),d(w))},[r,s]),x=E.useMemo(()=>s?jr:["light","dark"],[s]),y=E.useMemo(()=>({theme:i??c,resolvedTheme:g,setTheme:h,themes:x}),[i,c,g,h,x]);return o.jsx(Ks.Provider,{value:y,children:e})}function dr(){const e=E.useContext(Ks);if(e===void 0)throw new Error("useTheme must be used within a <ThemeProvider>");return e}const ld=({theme:e,...t})=>{let r=e;try{const{resolvedTheme:n}=dr();e||(r=n)}catch{r||(r="system")}return o.jsx(nd,{theme:r,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};function cd({icon:e,title:t,description:r,action:n,className:s}){return o.jsxs("div",{className:b("flex flex-col items-center justify-center py-12 px-4 text-center",s),children:[e&&o.jsx("div",{className:"mb-4 text-muted-foreground",children:e}),o.jsx("h3",{className:"text-lg font-semibold",children:t}),r&&o.jsx("p",{className:"mt-1 text-sm text-muted-foreground max-w-sm",children:r}),n&&o.jsx("div",{className:"mt-4",children:n})]})}const Xs=p.forwardRef(({...e},t)=>o.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));Xs.displayName="Breadcrumb";const Ys=p.forwardRef(({className:e,...t},r)=>o.jsx("ol",{ref:r,className:b("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));Ys.displayName="BreadcrumbList";const Zs=p.forwardRef(({className:e,...t},r)=>o.jsx("li",{ref:r,className:b("inline-flex items-center gap-1.5",e),...t}));Zs.displayName="BreadcrumbItem";const Js=p.forwardRef(({asChild:e,className:t,...r},n)=>{const s=e?to.Slot:"a";return o.jsx(s,{ref:n,className:b("transition-colors hover:text-foreground",t),...r})});Js.displayName="BreadcrumbLink";const Qs=p.forwardRef(({className:e,...t},r)=>o.jsx("span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:b("font-normal text-foreground",e),...t}));Qs.displayName="BreadcrumbPage";const ea=({children:e,className:t,...r})=>o.jsx("li",{role:"presentation","aria-hidden":"true",className:b("[&>svg]:w-3.5 [&>svg]:h-3.5",t),...r,children:e??o.jsx(I.ChevronRight,{})});ea.displayName="BreadcrumbSeparator";const ta=({className:e,...t})=>{const r=te();return o.jsxs("span",{role:"presentation","aria-hidden":"true",className:b("flex h-9 w-9 items-center justify-center",e),...t,children:[o.jsx("span",{className:"h-4 w-4",children:"..."}),o.jsx("span",{className:"sr-only",children:r.breadcrumb_more})]})};ta.displayName="BreadcrumbEllipsis";const ra=({className:e,...t})=>o.jsx("nav",{role:"navigation","aria-label":"pagination",className:b("mx-auto flex w-full justify-center",e),...t});ra.displayName="Pagination";const na=p.forwardRef(({className:e,...t},r)=>o.jsx("ul",{ref:r,className:b("flex flex-row items-center gap-1",e),...t}));na.displayName="PaginationContent";const oa=p.forwardRef(({className:e,...t},r)=>o.jsx("li",{ref:r,className:b("",e),...t}));oa.displayName="PaginationItem";const ur=({className:e,isActive:t,size:r="icon",...n})=>o.jsx("a",{"aria-current":t?"page":void 0,className:b(Bt({variant:t?"outline":"ghost",size:r}),e),...n});ur.displayName="PaginationLink";const sa=({className:e,...t})=>{const r=te();return o.jsxs(ur,{"aria-label":r.pagination_goToPrevious,size:"default",className:b("gap-1 pl-2.5",e),...t,children:[o.jsx(I.ChevronLeft,{className:"h-4 w-4"}),o.jsx("span",{children:r.pagination_previous})]})};sa.displayName="PaginationPrevious";const aa=({className:e,...t})=>{const r=te();return o.jsxs(ur,{"aria-label":r.pagination_goToNext,size:"default",className:b("gap-1 pr-2.5",e),...t,children:[o.jsx("span",{children:r.pagination_next}),o.jsx(I.ChevronRight,{className:"h-4 w-4"})]})};aa.displayName="PaginationNext";const ia=({className:e,...t})=>{const r=te();return o.jsxs("span",{"aria-hidden":!0,className:b("flex h-9 w-9 items-center justify-center",e),...t,children:[o.jsx(I.MoreHorizontal,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:r.pagination_morePages})]})};ia.displayName="PaginationEllipsis";function dd({steps:e,activeStep:t,orientation:r="horizontal",className:n}){return o.jsx("div",{className:b("flex",r==="vertical"?"flex-col":"flex-row items-center",n),children:e.map((s,a)=>{const i=a<t,l=a===t,c=a===e.length-1;return o.jsxs(p.Fragment,{children:[o.jsxs("div",{className:b("flex items-center",r==="vertical"&&"flex-row"),children:[o.jsx("div",{className:b("flex h-10 w-10 items-center justify-center rounded-full border-2 font-semibold transition-colors",i&&"border-primary bg-primary text-primary-foreground",l&&"border-primary text-primary",!i&&!l&&"border-muted-foreground/30 text-muted-foreground"),children:i?o.jsx(I.Check,{className:"h-5 w-5"}):a+1}),o.jsxs("div",{className:b("ml-3",r==="horizontal"&&"hidden sm:block"),children:[o.jsx("p",{className:b("text-sm font-medium",l&&"text-foreground",!l&&"text-muted-foreground"),children:s.title}),s.description&&o.jsx("p",{className:"text-xs text-muted-foreground",children:s.description})]})]}),!c&&o.jsx("div",{className:b("flex-1",r==="horizontal"?"mx-4 h-0.5 min-w-[3rem]":"ml-5 my-2 w-0.5 min-h-[2rem]",i?"bg-primary":"bg-muted-foreground/30")})]},a)})})}const la=p.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(Ae.Root,{ref:n,className:b("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...r,children:[t,o.jsx(bn,{})]}));la.displayName=Ae.Root.displayName;const ca=p.forwardRef(({className:e,...t},r)=>o.jsx(Ae.List,{ref:r,className:b("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));ca.displayName=Ae.List.displayName;const ud=Ae.Item,da=ze("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),ua=p.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(Ae.Trigger,{ref:n,className:b(da(),"group",e),...r,children:[t," ",o.jsx(I.ChevronDown,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));ua.displayName=Ae.Trigger.displayName;const ma=p.forwardRef(({className:e,...t},r)=>o.jsx(Ae.Content,{ref:r,className:b("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto",e),...t}));ma.displayName=Ae.Content.displayName;const md=Ae.Link,bn=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{className:b("absolute left-0 top-full flex justify-center"),children:o.jsx(Ae.Viewport,{className:b("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:r,...t})}));bn.displayName=Ae.Viewport.displayName;const fa=p.forwardRef(({className:e,...t},r)=>o.jsx(Ae.Indicator,{ref:r,className:b("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:o.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));fa.displayName=Ae.Indicator.displayName;const fd=fe.Root,gd=fe.Trigger,pd=fe.Group,hd=fe.Portal,xd=fe.Sub,bd=fe.RadioGroup,ga=p.forwardRef(({className:e,inset:t,children:r,...n},s)=>o.jsxs(fe.SubTrigger,{ref:s,className:b("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...n,children:[r,o.jsx(I.ChevronRight,{className:"ml-auto h-4 w-4"})]}));ga.displayName=fe.SubTrigger.displayName;const pa=p.forwardRef(({className:e,...t},r)=>o.jsx(fe.SubContent,{ref:r,className:b("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));pa.displayName=fe.SubContent.displayName;const ha=p.forwardRef(({className:e,...t},r)=>o.jsx(fe.Portal,{children:o.jsx(fe.Content,{ref:r,className:b("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));ha.displayName=fe.Content.displayName;const xa=p.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(fe.Item,{ref:n,className:b("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));xa.displayName=fe.Item.displayName;const ba=p.forwardRef(({className:e,children:t,checked:r,...n},s)=>o.jsxs(fe.CheckboxItem,{ref:s,className:b("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(fe.ItemIndicator,{children:o.jsx(I.Check,{className:"h-4 w-4"})})}),t]}));ba.displayName=fe.CheckboxItem.displayName;const va=p.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(fe.RadioItem,{ref:n,className:b("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(fe.ItemIndicator,{children:o.jsx(I.Circle,{className:"h-2 w-2 fill-current"})})}),t]}));va.displayName=fe.RadioItem.displayName;const wa=p.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(fe.Label,{ref:n,className:b("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...r}));wa.displayName=fe.Label.displayName;const ya=p.forwardRef(({className:e,...t},r)=>o.jsx(fe.Separator,{ref:r,className:b("-mx-1 my-1 h-px bg-border",e),...t}));ya.displayName=fe.Separator.displayName;const ja=({className:e,...t})=>o.jsx("span",{className:b("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});ja.displayName="ContextMenuShortcut";const vd=ir.Root,wd=ir.Trigger,Na=p.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>o.jsx(ir.Content,{ref:s,align:t,sideOffset:r,className:b("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Na.displayName=ir.Content.displayName;function yd(e){return Object.prototype.toString.call(e)==="[object Object]"}function Hn(e){return yd(e)||Array.isArray(e)}function jd(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function vn(e,t){const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;const s=JSON.stringify(Object.keys(e.breakpoints||{})),a=JSON.stringify(Object.keys(t.breakpoints||{}));return s!==a?!1:r.every(i=>{const l=e[i],c=t[i];return typeof l=="function"?`${l}`==`${c}`:!Hn(l)||!Hn(c)?l===c:vn(l,c)})}function Gn(e){return e.concat().sort((t,r)=>t.name>r.name?1:-1).map(t=>t.options)}function Nd(e,t){if(e.length!==t.length)return!1;const r=Gn(e),n=Gn(t);return r.every((s,a)=>{const i=n[a];return vn(s,i)})}function wn(e){return typeof e=="number"}function Ar(e){return typeof e=="string"}function mr(e){return typeof e=="boolean"}function qn(e){return Object.prototype.toString.call(e)==="[object Object]"}function pe(e){return Math.abs(e)}function yn(e){return Math.sign(e)}function Tt(e,t){return pe(e-t)}function Cd(e,t){if(e===0||t===0||pe(e)<=pe(t))return 0;const r=Tt(pe(e),pe(t));return pe(r/e)}function kd(e){return Math.round(e*100)/100}function Ft(e){return Vt(e).map(Number)}function Ue(e){return e[Ot(e)]}function Ot(e){return Math.max(0,e.length-1)}function jn(e,t){return t===Ot(e)}function Wn(e,t=0){return Array.from(Array(e),(r,n)=>t+n)}function Vt(e){return Object.keys(e)}function Ca(e,t){return[e,t].reduce((r,n)=>(Vt(n).forEach(s=>{const a=r[s],i=n[s],l=qn(a)&&qn(i);r[s]=l?Ca(a,i):i}),r),{})}function Fr(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function Sd(e,t){const r={start:n,center:s,end:a};function n(){return 0}function s(c){return a(c)/2}function a(c){return t-c}function i(c,d){return Ar(e)?r[e](c):e(t,c,d)}return{measure:i}}function zt(){let e=[];function t(s,a,i,l={passive:!0}){let c;if("addEventListener"in s)s.addEventListener(a,i,l),c=()=>s.removeEventListener(a,i,l);else{const d=s;d.addListener(i),c=()=>d.removeListener(i)}return e.push(c),n}function r(){e=e.filter(s=>s())}const n={add:t,clear:r};return n}function Rd(e,t,r,n){const s=zt(),a=1e3/60;let i=null,l=0,c=0;function d(){s.add(e,"visibilitychange",()=>{e.hidden&&h()})}function g(){m(),s.clear()}function u(y){if(!c)return;i||(i=y,r(),r());const w=y-i;for(i=y,l+=w;l>=a;)r(),l-=a;const v=l/a;n(v),c&&(c=t.requestAnimationFrame(u))}function f(){c||(c=t.requestAnimationFrame(u))}function m(){t.cancelAnimationFrame(c),i=null,l=0,c=0}function h(){i=null,l=0}return{init:d,destroy:g,start:f,stop:m,update:r,render:n}}function _d(e,t){const r=t==="rtl",n=e==="y",s=n?"y":"x",a=n?"x":"y",i=!n&&r?-1:1,l=g(),c=u();function d(h){const{height:x,width:y}=h;return n?x:y}function g(){return n?"top":r?"right":"left"}function u(){return n?"bottom":r?"left":"right"}function f(h){return h*i}return{scroll:s,cross:a,startEdge:l,endEdge:c,measureSize:d,direction:f}}function ut(e=0,t=0){const r=pe(e-t);function n(d){return d<e}function s(d){return d>t}function a(d){return n(d)||s(d)}function i(d){return a(d)?n(d)?e:t:d}function l(d){return r?d-r*Math.ceil((d-t)/r):d}return{length:r,max:t,min:e,constrain:i,reachedAny:a,reachedMax:s,reachedMin:n,removeOffset:l}}function ka(e,t,r){const{constrain:n}=ut(0,e),s=e+1;let a=i(t);function i(f){return r?pe((s+f)%s):n(f)}function l(){return a}function c(f){return a=i(f),u}function d(f){return g().set(l()+f)}function g(){return ka(e,l(),r)}const u={get:l,set:c,add:d,clone:g};return u}function Md(e,t,r,n,s,a,i,l,c,d,g,u,f,m,h,x,y,w,v){const{cross:j,direction:R}=e,M=["INPUT","SELECT","TEXTAREA"],C={passive:!1},k=zt(),N=zt(),S=ut(50,225).constrain(m.measure(20)),_={mouse:300,touch:400},D={mouse:500,touch:600},F=h?43:25;let B=!1,P=0,q=0,V=!1,A=!1,T=!1,oe=!1;function K(G){if(!v)return;function le(we){(mr(v)||v(G,we))&&Z(we)}const de=t;k.add(de,"dragstart",we=>we.preventDefault(),C).add(de,"touchmove",()=>{},C).add(de,"touchend",()=>{}).add(de,"touchstart",le).add(de,"mousedown",le).add(de,"touchcancel",X).add(de,"contextmenu",X).add(de,"click",ce,!0)}function Y(){k.clear(),N.clear()}function ee(){const G=oe?r:t;N.add(G,"touchmove",O,C).add(G,"touchend",X).add(G,"mousemove",O,C).add(G,"mouseup",X)}function z(G){const le=G.nodeName||"";return M.includes(le)}function L(){return(h?D:_)[oe?"mouse":"touch"]}function H(G,le){const de=u.add(yn(G)*-1),we=g.byDistance(G,!h).distance;return h||pe(G)<S?we:y&&le?we*.5:g.byIndex(de.get(),0).distance}function Z(G){const le=Fr(G,n);oe=le,T=h&&le&&!G.buttons&&B,B=Tt(s.get(),i.get())>=2,!(le&&G.button!==0)&&(z(G.target)||(V=!0,a.pointerDown(G),d.useFriction(0).useDuration(0),s.set(i),ee(),P=a.readPoint(G),q=a.readPoint(G,j),f.emit("pointerDown")))}function O(G){if(!Fr(G,n)&&G.touches.length>=2)return X(G);const de=a.readPoint(G),we=a.readPoint(G,j),Pe=Tt(de,P),ye=Tt(we,q);if(!A&&!oe&&(!G.cancelable||(A=Pe>ye,!A)))return X(G);const $e=a.pointerMove(G);Pe>x&&(T=!0),d.useFriction(.3).useDuration(.75),l.start(),s.add(R($e)),G.preventDefault()}function X(G){const de=g.byDistance(0,!1).index!==u.get(),we=a.pointerUp(G)*L(),Pe=H(R(we),de),ye=Cd(we,Pe),$e=F-10*ye,xe=w+ye/50;A=!1,V=!1,N.clear(),d.useDuration($e).useFriction(xe),c.distance(Pe,!h),oe=!1,f.emit("pointerUp")}function ce(G){T&&(G.stopPropagation(),G.preventDefault(),T=!1)}function ae(){return V}return{init:K,destroy:Y,pointerDown:ae}}function Pd(e,t){let n,s;function a(u){return u.timeStamp}function i(u,f){const h=`client${(f||e.scroll)==="x"?"X":"Y"}`;return(Fr(u,t)?u:u.touches[0])[h]}function l(u){return n=u,s=u,i(u)}function c(u){const f=i(u)-i(s),m=a(u)-a(n)>170;return s=u,m&&(n=u),f}function d(u){if(!n||!s)return 0;const f=i(s)-i(n),m=a(u)-a(n),h=a(u)-a(s)>170,x=f/m;return m&&!h&&pe(x)>.1?x:0}return{pointerDown:l,pointerMove:c,pointerUp:d,readPoint:i}}function Id(){function e(r){const{offsetTop:n,offsetLeft:s,offsetWidth:a,offsetHeight:i}=r;return{top:n,right:s+a,bottom:n+i,left:s,width:a,height:i}}return{measure:e}}function Td(e){function t(n){return e*(n/100)}return{measure:t}}function Ld(e,t,r,n,s,a,i){const l=[e].concat(n);let c,d,g=[],u=!1;function f(y){return s.measureSize(i.measure(y))}function m(y){if(!a)return;d=f(e),g=n.map(f);function w(v){for(const j of v){if(u)return;const R=j.target===e,M=n.indexOf(j.target),C=R?d:g[M],k=f(R?e:n[M]);if(pe(k-C)>=.5){y.reInit(),t.emit("resize");break}}}c=new ResizeObserver(v=>{(mr(a)||a(y,v))&&w(v)}),r.requestAnimationFrame(()=>{l.forEach(v=>c.observe(v))})}function h(){u=!0,c&&c.disconnect()}return{init:m,destroy:h}}function Dd(e,t,r,n,s,a){let i=0,l=0,c=s,d=a,g=e.get(),u=0;function f(){const C=n.get()-e.get(),k=!c;let N=0;return k?(i=0,r.set(n),e.set(n),N=C):(r.set(e),i+=C/c,i*=d,g+=i,e.add(i),N=g-u),l=yn(N),u=g,M}function m(){const C=n.get()-t.get();return pe(C)<.001}function h(){return c}function x(){return l}function y(){return i}function w(){return j(s)}function v(){return R(a)}function j(C){return c=C,M}function R(C){return d=C,M}const M={direction:x,duration:h,velocity:y,seek:f,settled:m,useBaseFriction:v,useBaseDuration:w,useFriction:R,useDuration:j};return M}function Ed(e,t,r,n,s){const a=s.measure(10),i=s.measure(50),l=ut(.1,.99);let c=!1;function d(){return!(c||!e.reachedAny(r.get())||!e.reachedAny(t.get()))}function g(m){if(!d())return;const h=e.reachedMin(t.get())?"min":"max",x=pe(e[h]-t.get()),y=r.get()-t.get(),w=l.constrain(x/i);r.subtract(y*w),!m&&pe(y)<a&&(r.set(e.constrain(r.get())),n.useDuration(25).useBaseFriction())}function u(m){c=!m}return{shouldConstrain:d,constrain:g,toggleActive:u}}function Ad(e,t,r,n,s){const a=ut(-t+e,0),i=u(),l=g(),c=f();function d(h,x){return Tt(h,x)<=1}function g(){const h=i[0],x=Ue(i),y=i.lastIndexOf(h),w=i.indexOf(x)+1;return ut(y,w)}function u(){return r.map((h,x)=>{const{min:y,max:w}=a,v=a.constrain(h),j=!x,R=jn(r,x);return j?w:R||d(y,v)?y:d(w,v)?w:v}).map(h=>parseFloat(h.toFixed(3)))}function f(){if(t<=e+s)return[a.max];if(n==="keepSnaps")return i;const{min:h,max:x}=l;return i.slice(h,x)}return{snapsContained:c,scrollContainLimit:l}}function Fd(e,t,r){const n=t[0],s=r?n-e:Ue(t);return{limit:ut(s,n)}}function Vd(e,t,r,n){const a=t.min+.1,i=t.max+.1,{reachedMin:l,reachedMax:c}=ut(a,i);function d(f){return f===1?c(r.get()):f===-1?l(r.get()):!1}function g(f){if(!d(f))return;const m=e*(f*-1);n.forEach(h=>h.add(m))}return{loop:g}}function zd(e){const{max:t,length:r}=e;function n(a){const i=a-t;return r?i/-r:0}return{get:n}}function $d(e,t,r,n,s){const{startEdge:a,endEdge:i}=e,{groupSlides:l}=s,c=u().map(t.measure),d=f(),g=m();function u(){return l(n).map(x=>Ue(x)[i]-x[0][a]).map(pe)}function f(){return n.map(x=>r[a]-x[a]).map(x=>-pe(x))}function m(){return l(d).map(x=>x[0]).map((x,y)=>x+c[y])}return{snaps:d,snapsAligned:g}}function Bd(e,t,r,n,s,a){const{groupSlides:i}=s,{min:l,max:c}=n,d=g();function g(){const f=i(a),m=!e||t==="keepSnaps";return r.length===1?[a]:m?f:f.slice(l,c).map((h,x,y)=>{const w=!x,v=jn(y,x);if(w){const j=Ue(y[0])+1;return Wn(j)}if(v){const j=Ot(a)-Ue(y)[0]+1;return Wn(j,Ue(y)[0])}return h})}return{slideRegistry:d}}function Od(e,t,r,n,s){const{reachedAny:a,removeOffset:i,constrain:l}=n;function c(h){return h.concat().sort((x,y)=>pe(x)-pe(y))[0]}function d(h){const x=e?i(h):l(h),y=t.map((v,j)=>({diff:g(v-x,0),index:j})).sort((v,j)=>pe(v.diff)-pe(j.diff)),{index:w}=y[0];return{index:w,distance:x}}function g(h,x){const y=[h,h+r,h-r];if(!e)return h;if(!x)return c(y);const w=y.filter(v=>yn(v)===x);return w.length?c(w):Ue(y)-r}function u(h,x){const y=t[h]-s.get(),w=g(y,x);return{index:h,distance:w}}function f(h,x){const y=s.get()+h,{index:w,distance:v}=d(y),j=!e&&a(y);if(!x||j)return{index:w,distance:h};const R=t[w]-v,M=h+g(R,0);return{index:w,distance:M}}return{byDistance:f,byIndex:u,shortcut:g}}function Hd(e,t,r,n,s,a,i){function l(u){const f=u.distance,m=u.index!==t.get();a.add(f),f&&(n.duration()?e.start():(e.update(),e.render(1),e.update())),m&&(r.set(t.get()),t.set(u.index),i.emit("select"))}function c(u,f){const m=s.byDistance(u,f);l(m)}function d(u,f){const m=t.clone().set(u),h=s.byIndex(m.get(),f);l(h)}return{distance:c,index:d}}function Gd(e,t,r,n,s,a,i,l){const c={passive:!0,capture:!0};let d=0;function g(m){if(!l)return;function h(x){if(new Date().getTime()-d>10)return;i.emit("slideFocusStart"),e.scrollLeft=0;const v=r.findIndex(j=>j.includes(x));wn(v)&&(s.useDuration(0),n.index(v,0),i.emit("slideFocus"))}a.add(document,"keydown",u,!1),t.forEach((x,y)=>{a.add(x,"focus",w=>{(mr(l)||l(m,w))&&h(y)},c)})}function u(m){m.code==="Tab"&&(d=new Date().getTime())}return{init:g}}function Mt(e){let t=e;function r(){return t}function n(c){t=i(c)}function s(c){t+=i(c)}function a(c){t-=i(c)}function i(c){return wn(c)?c:c.get()}return{get:r,set:n,add:s,subtract:a}}function Sa(e,t){const r=e.scroll==="x"?i:l,n=t.style;let s=null,a=!1;function i(f){return`translate3d(${f}px,0px,0px)`}function l(f){return`translate3d(0px,${f}px,0px)`}function c(f){if(a)return;const m=kd(e.direction(f));m!==s&&(n.transform=r(m),s=m)}function d(f){a=!f}function g(){a||(n.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:g,to:c,toggleActive:d}}function qd(e,t,r,n,s,a,i,l,c){const g=Ft(s),u=Ft(s).reverse(),f=w().concat(v());function m(k,N){return k.reduce((S,_)=>S-s[_],N)}function h(k,N){return k.reduce((S,_)=>m(S,N)>0?S.concat([_]):S,[])}function x(k){return a.map((N,S)=>({start:N-n[S]+.5+k,end:N+t-.5+k}))}function y(k,N,S){const _=x(N);return k.map(D=>{const F=S?0:-r,B=S?r:0,P=S?"end":"start",q=_[D][P];return{index:D,loopPoint:q,slideLocation:Mt(-1),translate:Sa(e,c[D]),target:()=>l.get()>q?F:B}})}function w(){const k=i[0],N=h(u,k);return y(N,r,!1)}function v(){const k=t-i[0]-1,N=h(g,k);return y(N,-r,!0)}function j(){return f.every(({index:k})=>{const N=g.filter(S=>S!==k);return m(N,t)<=.1})}function R(){f.forEach(k=>{const{target:N,translate:S,slideLocation:_}=k,D=N();D!==_.get()&&(S.to(D),_.set(D))})}function M(){f.forEach(k=>k.translate.clear())}return{canLoop:j,clear:M,loop:R,loopPoints:f}}function Wd(e,t,r){let n,s=!1;function a(c){if(!r)return;function d(g){for(const u of g)if(u.type==="childList"){c.reInit(),t.emit("slidesChanged");break}}n=new MutationObserver(g=>{s||(mr(r)||r(c,g))&&d(g)}),n.observe(e,{childList:!0})}function i(){n&&n.disconnect(),s=!0}return{init:a,destroy:i}}function Ud(e,t,r,n){const s={};let a=null,i=null,l,c=!1;function d(){l=new IntersectionObserver(h=>{c||(h.forEach(x=>{const y=t.indexOf(x.target);s[y]=x}),a=null,i=null,r.emit("slidesInView"))},{root:e.parentElement,threshold:n}),t.forEach(h=>l.observe(h))}function g(){l&&l.disconnect(),c=!0}function u(h){return Vt(s).reduce((x,y)=>{const w=parseInt(y),{isIntersecting:v}=s[w];return(h&&v||!h&&!v)&&x.push(w),x},[])}function f(h=!0){if(h&&a)return a;if(!h&&i)return i;const x=u(h);return h&&(a=x),h||(i=x),x}return{init:d,destroy:g,get:f}}function Kd(e,t,r,n,s,a){const{measureSize:i,startEdge:l,endEdge:c}=e,d=r[0]&&s,g=h(),u=x(),f=r.map(i),m=y();function h(){if(!d)return 0;const v=r[0];return pe(t[l]-v[l])}function x(){if(!d)return 0;const v=a.getComputedStyle(Ue(n));return parseFloat(v.getPropertyValue(`margin-${c}`))}function y(){return r.map((v,j,R)=>{const M=!j,C=jn(R,j);return M?f[j]+g:C?f[j]+u:R[j+1][l]-v[l]}).map(pe)}return{slideSizes:f,slideSizesWithGaps:m,startGap:g,endGap:u}}function Xd(e,t,r,n,s,a,i,l,c){const{startEdge:d,endEdge:g,direction:u}=e,f=wn(r);function m(w,v){return Ft(w).filter(j=>j%v===0).map(j=>w.slice(j,j+v))}function h(w){return w.length?Ft(w).reduce((v,j,R)=>{const M=Ue(v)||0,C=M===0,k=j===Ot(w),N=s[d]-a[M][d],S=s[d]-a[j][g],_=!n&&C?u(i):0,D=!n&&k?u(l):0,F=pe(S-D-(N+_));return R&&F>t+c&&v.push(j),k&&v.push(w.length),v},[]).map((v,j,R)=>{const M=Math.max(R[j-1]||0);return w.slice(M,v)}):[]}function x(w){return f?m(w,r):h(w)}return{groupSlides:x}}function Yd(e,t,r,n,s,a,i){const{align:l,axis:c,direction:d,startIndex:g,loop:u,duration:f,dragFree:m,dragThreshold:h,inViewThreshold:x,slidesToScroll:y,skipSnaps:w,containScroll:v,watchResize:j,watchSlides:R,watchDrag:M,watchFocus:C}=a,k=2,N=Id(),S=N.measure(t),_=r.map(N.measure),D=_d(c,d),F=D.measureSize(S),B=Td(F),P=Sd(l,F),q=!u&&!!v,V=u||!!v,{slideSizes:A,slideSizesWithGaps:T,startGap:oe,endGap:K}=Kd(D,S,_,r,V,s),Y=Xd(D,F,y,u,S,_,oe,K,k),{snaps:ee,snapsAligned:z}=$d(D,P,S,_,Y),L=-Ue(ee)+Ue(T),{snapsContained:H,scrollContainLimit:Z}=Ad(F,L,z,v,k),O=q?H:z,{limit:X}=Fd(L,O,u),ce=ka(Ot(O),g,u),ae=ce.clone(),ie=Ft(r),G=({dragHandler:_e,scrollBody:pt,scrollBounds:Ze,options:{loop:ht}})=>{ht||Ze.constrain(_e.pointerDown()),pt.seek()},le=({scrollBody:_e,translate:pt,location:Ze,offsetLocation:ht,previousLocation:xr,scrollLooper:Ht,slideLooper:Gt,dragHandler:br,animation:Nt,eventHandler:He,scrollBounds:vr,options:{loop:qt}},Ct)=>{const kt=_e.settled(),ne=!vr.shouldConstrain(),be=qt?kt:kt&&ne,Ce=be&&!br.pointerDown();Ce&&Nt.stop();const Ie=Ze.get()*Ct+xr.get()*(1-Ct);ht.set(Ie),qt&&(Ht.loop(_e.direction()),Gt.loop()),pt.to(ht.get()),Ce&&He.emit("settle"),be||He.emit("scroll")},de=Rd(n,s,()=>G(Ye),_e=>le(Ye,_e)),we=.68,Pe=O[ce.get()],ye=Mt(Pe),$e=Mt(Pe),xe=Mt(Pe),Oe=Mt(Pe),Qe=Dd(ye,xe,$e,Oe,f,we),je=Od(u,O,L,X,Oe),Fe=Hd(de,ce,ae,Qe,je,Oe,i),gt=zd(X),$=zt(),re=Ud(t,r,i,x),{slideRegistry:Ne}=Bd(q,v,O,Z,Y,ie),Xe=Gd(e,r,Ne,Fe,Qe,$,i,C),Ye={ownerDocument:n,ownerWindow:s,eventHandler:i,containerRect:S,slideRects:_,animation:de,axis:D,dragHandler:Md(D,e,n,s,Oe,Pd(D,s),ye,de,Fe,Qe,je,ce,i,B,m,h,w,we,M),eventStore:$,percentOfView:B,index:ce,indexPrevious:ae,limit:X,location:ye,offsetLocation:xe,previousLocation:$e,options:a,resizeHandler:Ld(t,i,s,r,D,j,N),scrollBody:Qe,scrollBounds:Ed(X,xe,Oe,Qe,B),scrollLooper:Vd(L,X,xe,[ye,xe,$e,Oe]),scrollProgress:gt,scrollSnapList:O.map(gt.get),scrollSnaps:O,scrollTarget:je,scrollTo:Fe,slideLooper:qd(D,F,L,A,T,ee,O,xe,r),slideFocus:Xe,slidesHandler:Wd(t,i,R),slidesInView:re,slideIndexes:ie,slideRegistry:Ne,slidesToScroll:Y,target:Oe,translate:Sa(D,t)};return Ye}function Zd(){let e={},t;function r(d){t=d}function n(d){return e[d]||[]}function s(d){return n(d).forEach(g=>g(t,d)),c}function a(d,g){return e[d]=n(d).concat([g]),c}function i(d,g){return e[d]=n(d).filter(u=>u!==g),c}function l(){e={}}const c={init:r,emit:s,off:i,on:a,clear:l};return c}const Jd={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function Qd(e){function t(a,i){return Ca(a,i||{})}function r(a){const i=a.breakpoints||{},l=Vt(i).filter(c=>e.matchMedia(c).matches).map(c=>i[c]).reduce((c,d)=>t(c,d),{});return t(a,l)}function n(a){return a.map(i=>Vt(i.breakpoints||{})).reduce((i,l)=>i.concat(l),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:r,optionsMediaQueries:n}}function eu(e){let t=[];function r(a,i){return t=i.filter(({options:l})=>e.optionsAtMedia(l).active!==!1),t.forEach(l=>l.init(a,e)),i.reduce((l,c)=>Object.assign(l,{[c.name]:c}),{})}function n(){t=t.filter(a=>a.destroy())}return{init:r,destroy:n}}function sr(e,t,r){const n=e.ownerDocument,s=n.defaultView,a=Qd(s),i=eu(a),l=zt(),c=Zd(),{mergeOptions:d,optionsAtMedia:g,optionsMediaQueries:u}=a,{on:f,off:m,emit:h}=c,x=D;let y=!1,w,v=d(Jd,sr.globalOptions),j=d(v),R=[],M,C,k;function N(){const{container:ie,slides:G}=j;C=(Ar(ie)?e.querySelector(ie):ie)||e.children[0];const de=Ar(G)?C.querySelectorAll(G):G;k=[].slice.call(de||C.children)}function S(ie){const G=Yd(e,C,k,n,s,ie,c);if(ie.loop&&!G.slideLooper.canLoop()){const le=Object.assign({},ie,{loop:!1});return S(le)}return G}function _(ie,G){y||(v=d(v,ie),j=g(v),R=G||R,N(),w=S(j),u([v,...R.map(({options:le})=>le)]).forEach(le=>l.add(le,"change",D)),j.active&&(w.translate.to(w.location.get()),w.animation.init(),w.slidesInView.init(),w.slideFocus.init(ae),w.eventHandler.init(ae),w.resizeHandler.init(ae),w.slidesHandler.init(ae),w.options.loop&&w.slideLooper.loop(),C.offsetParent&&k.length&&w.dragHandler.init(ae),M=i.init(ae,R)))}function D(ie,G){const le=Y();F(),_(d({startIndex:le},ie),G),c.emit("reInit")}function F(){w.dragHandler.destroy(),w.eventStore.clear(),w.translate.clear(),w.slideLooper.clear(),w.resizeHandler.destroy(),w.slidesHandler.destroy(),w.slidesInView.destroy(),w.animation.destroy(),i.destroy(),l.clear()}function B(){y||(y=!0,l.clear(),F(),c.emit("destroy"),c.clear())}function P(ie,G,le){!j.active||y||(w.scrollBody.useBaseFriction().useDuration(G===!0?0:j.duration),w.scrollTo.index(ie,le||0))}function q(ie){const G=w.index.add(1).get();P(G,ie,-1)}function V(ie){const G=w.index.add(-1).get();P(G,ie,1)}function A(){return w.index.add(1).get()!==Y()}function T(){return w.index.add(-1).get()!==Y()}function oe(){return w.scrollSnapList}function K(){return w.scrollProgress.get(w.offsetLocation.get())}function Y(){return w.index.get()}function ee(){return w.indexPrevious.get()}function z(){return w.slidesInView.get()}function L(){return w.slidesInView.get(!1)}function H(){return M}function Z(){return w}function O(){return e}function X(){return C}function ce(){return k}const ae={canScrollNext:A,canScrollPrev:T,containerNode:X,internalEngine:Z,destroy:B,off:m,on:f,emit:h,plugins:H,previousScrollSnap:ee,reInit:x,rootNode:O,scrollNext:q,scrollPrev:V,scrollProgress:K,scrollSnapList:oe,scrollTo:P,selectedScrollSnap:Y,slideNodes:ce,slidesInView:z,slidesNotInView:L};return _(t,r),setTimeout(()=>c.emit("init"),0),ae}sr.globalOptions=void 0;function Nn(e={},t=[]){const r=E.useRef(e),n=E.useRef(t),[s,a]=E.useState(),[i,l]=E.useState(),c=E.useCallback(()=>{s&&s.reInit(r.current,n.current)},[s]);return E.useEffect(()=>{vn(r.current,e)||(r.current=e,c())},[e,c]),E.useEffect(()=>{Nd(n.current,t)||(n.current=t,c())},[t,c]),E.useEffect(()=>{if(jd()&&i){sr.globalOptions=Nn.globalOptions;const d=sr(i,r.current,n.current);return a(d),()=>d.destroy()}else a(void 0)},[i,a]),[l,s]}Nn.globalOptions=void 0;const Ra=p.createContext(null);function fr(){const e=p.useContext(Ra);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}const _a=p.forwardRef(({orientation:e="horizontal",opts:t,setApi:r,plugins:n,className:s,children:a,...i},l)=>{const[c,d]=Nn({...t,axis:e==="horizontal"?"x":"y"},n),[g,u]=p.useState(!1),[f,m]=p.useState(!1),h=p.useCallback(v=>{v&&(u(v.canScrollPrev()),m(v.canScrollNext()))},[]),x=p.useCallback(()=>{d==null||d.scrollPrev()},[d]),y=p.useCallback(()=>{d==null||d.scrollNext()},[d]),w=p.useCallback(v=>{v.key==="ArrowLeft"?(v.preventDefault(),x()):v.key==="ArrowRight"&&(v.preventDefault(),y())},[x,y]);return p.useEffect(()=>{!d||!r||r(d)},[d,r]),p.useEffect(()=>{if(d)return h(d),d.on("reInit",h),d.on("select",h),()=>{d==null||d.off("select",h)}},[d,h]),o.jsx(Ra.Provider,{value:{carouselRef:c,api:d,opts:t,orientation:e,scrollPrev:x,scrollNext:y,canScrollPrev:g,canScrollNext:f},children:o.jsx("div",{ref:l,onKeyDownCapture:w,className:b("relative",s),role:"region","aria-roledescription":"carousel",...i,children:a})})});_a.displayName="Carousel";const Ma=p.forwardRef(({className:e,...t},r)=>{const{carouselRef:n,orientation:s}=fr();return o.jsx("div",{ref:n,className:"overflow-hidden",children:o.jsx("div",{ref:r,className:b("flex",s==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});Ma.displayName="CarouselContent";const Pa=p.forwardRef(({className:e,...t},r)=>{const{orientation:n}=fr();return o.jsx("div",{ref:r,role:"group","aria-roledescription":"slide",className:b("min-w-0 shrink-0 grow-0 basis-full",n==="horizontal"?"pl-4":"pt-4",e),...t})});Pa.displayName="CarouselItem";const Ia=p.forwardRef(({className:e,variant:t="outline",size:r="icon",...n},s)=>{const{orientation:a,scrollPrev:i,canScrollPrev:l}=fr(),c=te();return o.jsxs(ve,{ref:s,variant:t,size:r,className:b("absolute h-8 w-8 rounded-full",a==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:i,...n,children:[o.jsx(I.ChevronLeft,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:c.carousel_previousSlide})]})});Ia.displayName="CarouselPrevious";const Ta=p.forwardRef(({className:e,variant:t="outline",size:r="icon",...n},s)=>{const{orientation:a,scrollNext:i,canScrollNext:l}=fr(),c=te();return o.jsxs(ve,{ref:s,variant:t,size:r,className:b("absolute h-8 w-8 rounded-full",a==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:i,...n,children:[o.jsx(I.ChevronRight,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:c.carousel_nextSlide})]})});Ta.displayName="CarouselNext";/**
|
|
12
|
+
)`}})]}),o.jsxs("div",{className:"flex gap-2 items-center",children:[o.jsx("div",{className:"h-9 w-9 rounded-md border flex-shrink-0 shadow-inner",style:{backgroundColor:e}}),o.jsx(st,{value:c,onChange:h=>f(h.target.value),placeholder:"#000000",className:"font-mono text-sm"})]}),o.jsx("div",{className:"grid grid-cols-5 gap-1.5",children:ac.map(h=>o.jsx("button",{onClick:()=>{t==null||t(h),l(Yt(h)),d(h)},className:b("h-7 w-7 rounded-md border-2 transition-transform hover:scale-110",e===h?"border-primary ring-2 ring-ring":"border-transparent"),style:{backgroundColor:h}},h))})]})})]})}const qo=g.forwardRef(({className:e,as:t="div",...r},n)=>o.jsx(t,{ref:n,className:b(e),...r}));qo.displayName="Box";const Wo=g.forwardRef(({className:e,direction:t,wrap:r,justify:n,align:s,gap:a,style:i,...l},c)=>o.jsx("div",{ref:c,className:b("flex",t&&`flex-${t}`,r&&`flex-${r}`,n&&`justify-${n}`,s&&`items-${s}`,typeof a=="number"&&`gap-${a}`,e),style:{...typeof a=="string"?{gap:a}:{},...i},...l}));Wo.displayName="Flex";const Uo=g.forwardRef(({className:e,spacing:t=4,align:r,style:n,...s},a)=>o.jsx("div",{ref:a,className:b("flex flex-col",typeof t=="number"&&`gap-${t}`,r&&`items-${r}`,e),style:{...typeof t=="string"?{gap:t}:{},...n},...s}));Uo.displayName="VStack";const Ko=g.forwardRef(({className:e,spacing:t=4,align:r="center",style:n,...s},a)=>o.jsx("div",{ref:a,className:b("flex flex-row",typeof t=="number"&&`gap-${t}`,r&&`items-${r}`,e),style:{...typeof t=="string"?{gap:t}:{},...n},...s}));Ko.displayName="HStack";const Xo=g.forwardRef(({className:e,cols:t=1,gap:r=4,style:n,...s},a)=>{const i=typeof t=="number"?`grid-cols-${t}`:[t.sm&&`sm:grid-cols-${t.sm}`,t.md&&`md:grid-cols-${t.md}`,t.lg&&`lg:grid-cols-${t.lg}`,t.xl&&`xl:grid-cols-${t.xl}`].filter(Boolean).join(" ");return o.jsx("div",{ref:a,className:b("grid",i,typeof r=="number"&&`gap-${r}`,e),style:{...typeof r=="string"?{gap:r}:{},...n},...s})});Xo.displayName="Grid";const cc={sm:"max-w-screen-sm",md:"max-w-screen-md",lg:"max-w-screen-lg",xl:"max-w-screen-xl","2xl":"max-w-screen-2xl",full:"max-w-full"},Yo=g.forwardRef(({className:e,maxWidth:t="lg",centered:r=!0,...n},s)=>o.jsx("div",{ref:s,className:b("w-full px-4",cc[t],r&&"mx-auto",e),...n}));Yo.displayName="Container";const dc=nl.Root,uc=qr.Root,mc=qr.CollapsibleTrigger,Zo=g.forwardRef(({className:e,children:t,...r},n)=>o.jsx(qr.CollapsibleContent,{ref:n,className:b("overflow-hidden transition-all duration-300 ease-in-out","data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",e),...r,children:o.jsx("div",{className:"pb-2",children:t})}));Zo.displayName="CollapsibleContent";const Jo=ze("rounded-xl text-card-foreground transition-all duration-300",{variants:{variant:{default:"border bg-card shadow-sm",elevated:"border border-white/10 bg-gradient-to-br from-card/80 to-card/40 backdrop-blur-xl shadow-2xl shadow-black/20",glass:"border border-white/10 bg-white/5 backdrop-blur-xl shadow-xl",ghost:"bg-transparent"}},defaultVariants:{variant:"default"}}),Jr=g.forwardRef(({className:e,variant:t,...r},n)=>o.jsx("div",{ref:n,className:b(Jo({variant:t}),e),...r}));Jr.displayName="Card";const Qr=g.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("flex flex-col space-y-1.5 p-6",e),...t}));Qr.displayName="CardHeader";const en=g.forwardRef(({className:e,...t},r)=>o.jsx("h3",{ref:r,className:b("text-2xl font-semibold leading-none tracking-tight",e),...t}));en.displayName="CardTitle";const Qo=g.forwardRef(({className:e,...t},r)=>o.jsx("p",{ref:r,className:b("text-sm text-muted-foreground",e),...t}));Qo.displayName="CardDescription";const tn=g.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("p-6 pt-0",e),...t}));tn.displayName="CardContent";const es=g.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("flex items-center p-6 pt-0",e),...t}));es.displayName="CardFooter";const rn=g.forwardRef(({className:e,...t},r)=>o.jsx("div",{className:"relative w-full overflow-auto",children:o.jsx("table",{ref:r,className:b("w-full caption-bottom text-sm",e),...t})}));rn.displayName="Table";const nn=g.forwardRef(({className:e,...t},r)=>o.jsx("thead",{ref:r,className:b("[&_tr]:border-b",e),...t}));nn.displayName="TableHeader";const on=g.forwardRef(({className:e,...t},r)=>o.jsx("tbody",{ref:r,className:b("[&_tr:last-child]:border-0",e),...t}));on.displayName="TableBody";const ts=g.forwardRef(({className:e,...t},r)=>o.jsx("tfoot",{ref:r,className:b("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));ts.displayName="TableFooter";const Pt=g.forwardRef(({className:e,...t},r)=>o.jsx("tr",{ref:r,className:b("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Pt.displayName="TableRow";const sn=g.forwardRef(({className:e,...t},r)=>o.jsx("th",{ref:r,className:b("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));sn.displayName="TableHead";const nr=g.forwardRef(({className:e,...t},r)=>o.jsx("td",{ref:r,className:b("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));nr.displayName="TableCell";const rs=g.forwardRef(({className:e,...t},r)=>o.jsx("caption",{ref:r,className:b("mt-4 text-sm text-muted-foreground",e),...t}));rs.displayName="TableCaption";const cr=g.forwardRef(({className:e,children:t,orientation:r="vertical",...n},s)=>o.jsxs(ct.Root,{ref:s,className:b("relative overflow-hidden",e),...n,children:[o.jsx(ct.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(r==="vertical"||r==="both")&&o.jsx(or,{orientation:"vertical"}),(r==="horizontal"||r==="both")&&o.jsx(or,{orientation:"horizontal"}),o.jsx(ct.Corner,{})]}));cr.displayName=ct.Root.displayName;const or=g.forwardRef(({className:e,orientation:t="vertical",...r},n)=>o.jsx(ct.ScrollAreaScrollbar,{ref:n,orientation:t,className:b("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:o.jsx(ct.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));or.displayName=ct.ScrollAreaScrollbar.displayName;const fc=mt.Root,ns=g.forwardRef(({className:e,...t},r)=>o.jsx(mt.List,{ref:r,className:b("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));ns.displayName=mt.List.displayName;const os=g.forwardRef(({className:e,...t},r)=>o.jsx(mt.Trigger,{ref:r,className:b("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));os.displayName=mt.Trigger.displayName;const ss=g.forwardRef(({className:e,...t},r)=>o.jsx(mt.Content,{ref:r,className:b("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ss.displayName=mt.Content.displayName;const gc=dt.Root,as=g.forwardRef(({className:e,...t},r)=>o.jsx(dt.Item,{ref:r,className:b("border-b",e),...t}));as.displayName="AccordionItem";const is=g.forwardRef(({className:e,children:t,...r},n)=>o.jsx(dt.Header,{className:"flex",children:o.jsxs(dt.Trigger,{ref:n,className:b("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,o.jsx(T.ChevronDown,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));is.displayName=dt.Trigger.displayName;const ls=g.forwardRef(({className:e,children:t,...r},n)=>o.jsx(dt.Content,{ref:n,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:o.jsx("div",{className:b("pb-4 pt-0",e),children:t})}));ls.displayName=dt.Content.displayName;const cs=ue.Root,pc=ue.Trigger,ds=ue.Portal,hc=ue.Close,an=g.forwardRef(({className:e,...t},r)=>o.jsx(ue.Overlay,{ref:r,className:b("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));an.displayName=ue.Overlay.displayName;const ln=g.forwardRef(({className:e,children:t,...r},n)=>{const s=re();return o.jsxs(ds,{children:[o.jsx(an,{}),o.jsxs(ue.Content,{ref:n,className:b("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,o.jsxs(ue.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[o.jsx(T.X,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:s.common_close})]})]})]})});ln.displayName=ue.Content.displayName;const us=({className:e,...t})=>o.jsx("div",{className:b("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});us.displayName="DialogHeader";const ms=({className:e,...t})=>o.jsx("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ms.displayName="DialogFooter";const fs=g.forwardRef(({className:e,...t},r)=>o.jsx(ue.Title,{ref:r,className:b("text-lg font-semibold leading-none tracking-tight",e),...t}));fs.displayName=ue.Title.displayName;const gs=g.forwardRef(({className:e,...t},r)=>o.jsx(ue.Description,{ref:r,className:b("text-sm text-muted-foreground",e),...t}));gs.displayName=ue.Description.displayName;const ps=ue.Root,hs=ue.Trigger,xs=ue.Close,bs=ue.Portal,cn=g.forwardRef(({className:e,...t},r)=>o.jsx(ue.Overlay,{className:b("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));cn.displayName=ue.Overlay.displayName;const xc=ze("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),dn=g.forwardRef(({side:e="right",className:t,children:r,...n},s)=>{const a=re();return o.jsxs(bs,{children:[o.jsx(cn,{}),o.jsxs(ue.Content,{ref:s,className:b(xc({side:e}),t),...n,children:[r,o.jsxs(ue.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[o.jsx(T.X,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:a.common_close})]})]})]})});dn.displayName=ue.Content.displayName;const un=({className:e,...t})=>o.jsx("div",{className:b("flex flex-col space-y-2 text-center sm:text-left",e),...t});un.displayName="SheetHeader";const mn=({className:e,...t})=>o.jsx("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});mn.displayName="SheetFooter";const fn=g.forwardRef(({className:e,...t},r)=>o.jsx(ue.Title,{ref:r,className:b("text-lg font-semibold text-foreground",e),...t}));fn.displayName=ue.Title.displayName;const gn=g.forwardRef(({className:e,...t},r)=>o.jsx(ue.Description,{ref:r,className:b("text-sm text-muted-foreground",e),...t}));gn.displayName=ue.Description.displayName;const vs=me.Root,ws=me.Trigger,bc=me.Group,vc=me.Portal,wc=me.Sub,yc=me.RadioGroup,ys=g.forwardRef(({className:e,inset:t,children:r,...n},s)=>o.jsxs(me.SubTrigger,{ref:s,className:b("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...n,children:[r,o.jsx(T.ChevronRight,{className:"ml-auto h-4 w-4"})]}));ys.displayName=me.SubTrigger.displayName;const js=g.forwardRef(({className:e,...t},r)=>o.jsx(me.SubContent,{ref:r,className:b("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));js.displayName=me.SubContent.displayName;const pn=g.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx(me.Portal,{children:o.jsx(me.Content,{ref:n,sideOffset:t,className:b("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));pn.displayName=me.Content.displayName;const It=g.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(me.Item,{ref:n,className:b("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));It.displayName=me.Item.displayName;const Ns=g.forwardRef(({className:e,children:t,checked:r,...n},s)=>o.jsxs(me.CheckboxItem,{ref:s,className:b("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(me.ItemIndicator,{children:o.jsx(T.Check,{className:"h-4 w-4"})})}),t]}));Ns.displayName=me.CheckboxItem.displayName;const Cs=g.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(me.RadioItem,{ref:n,className:b("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(me.ItemIndicator,{children:o.jsx(T.Circle,{className:"h-2 w-2 fill-current"})})}),t]}));Cs.displayName=me.RadioItem.displayName;const ks=g.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(me.Label,{ref:n,className:b("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));ks.displayName=me.Label.displayName;const Ss=g.forwardRef(({className:e,...t},r)=>o.jsx(me.Separator,{ref:r,className:b("-mx-1 my-1 h-px bg-muted",e),...t}));Ss.displayName=me.Separator.displayName;const Rs=({className:e,...t})=>o.jsx("span",{className:b("ml-auto text-xs tracking-widest opacity-60",e),...t});Rs.displayName="DropdownMenuShortcut";const jc=$t.Provider,Nc=$t.Root,Cc=$t.Trigger,_s=g.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx($t.Content,{ref:n,sideOffset:t,className:b("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...r}));_s.displayName=$t.Content.displayName;const hn=g.forwardRef(({className:e,...t},r)=>o.jsx(Ee.Command,{ref:r,className:b("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));hn.displayName=Ee.Command.displayName;const kc=({children:e,...t})=>o.jsx(cs,{...t,children:o.jsx(ln,{className:"overflow-hidden p-0 shadow-lg",children:o.jsx(hn,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),Ms=g.forwardRef(({className:e,...t},r)=>o.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[o.jsx(T.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),o.jsx(Ee.Command.Input,{ref:r,className:b("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Ms.displayName=Ee.Command.Input.displayName;const Ps=g.forwardRef(({className:e,...t},r)=>o.jsx(Ee.Command.List,{ref:r,className:b("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Ps.displayName=Ee.Command.List.displayName;const Is=g.forwardRef((e,t)=>o.jsx(Ee.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Is.displayName=Ee.Command.Empty.displayName;const Ts=g.forwardRef(({className:e,...t},r)=>o.jsx(Ee.Command.Group,{ref:r,className:b("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Ts.displayName=Ee.Command.Group.displayName;const Ls=g.forwardRef(({className:e,...t},r)=>o.jsx(Ee.Command.Separator,{ref:r,className:b("-mx-1 h-px bg-border",e),...t}));Ls.displayName=Ee.Command.Separator.displayName;const Ds=g.forwardRef(({className:e,...t},r)=>o.jsx(Ee.Command.Item,{ref:r,className:b("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected='true']:text-accent-foreground data-[disabled=true]:opacity-50",e),...t}));Ds.displayName=Ee.Command.Item.displayName;const Es=({className:e,...t})=>o.jsx("span",{className:b("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Es.displayName="CommandShortcut";const Sc=ze("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),As=g.forwardRef(({className:e,variant:t,...r},n)=>o.jsx("div",{ref:n,role:"alert",className:b(Sc({variant:t}),e),...r}));As.displayName="Alert";const Fs=g.forwardRef(({className:e,...t},r)=>o.jsx("h5",{ref:r,className:b("mb-1 font-medium leading-none tracking-tight",e),...t}));Fs.displayName="AlertTitle";const Vs=g.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("text-sm [&_p]:leading-relaxed",e),...t}));Vs.displayName="AlertDescription";const Rc=Te.Root,_c=Te.Trigger,zs=Te.Portal,xn=g.forwardRef(({className:e,...t},r)=>o.jsx(Te.Overlay,{className:b("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));xn.displayName=Te.Overlay.displayName;const $s=g.forwardRef(({className:e,...t},r)=>o.jsxs(zs,{children:[o.jsx(xn,{}),o.jsx(Te.Content,{ref:r,className:b("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));$s.displayName=Te.Content.displayName;const Bs=({className:e,...t})=>o.jsx("div",{className:b("flex flex-col space-y-2 text-center sm:text-left",e),...t});Bs.displayName="AlertDialogHeader";const Os=({className:e,...t})=>o.jsx("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Os.displayName="AlertDialogFooter";const Hs=g.forwardRef(({className:e,...t},r)=>o.jsx(Te.Title,{ref:r,className:b("text-lg font-semibold",e),...t}));Hs.displayName=Te.Title.displayName;const Gs=g.forwardRef(({className:e,...t},r)=>o.jsx(Te.Description,{ref:r,className:b("text-sm text-muted-foreground",e),...t}));Gs.displayName=Te.Description.displayName;const qs=g.forwardRef(({className:e,...t},r)=>o.jsx(Te.Action,{ref:r,className:b(Bt(),e),...t}));qs.displayName=Te.Action.displayName;const Ws=g.forwardRef(({className:e,...t},r)=>o.jsx(Te.Cancel,{ref:r,className:b(Bt({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Ws.displayName=Te.Cancel.displayName;const Us=g.forwardRef(({className:e,value:t,...r},n)=>o.jsx(Lr.Root,{ref:n,className:b("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:o.jsx(Lr.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Us.displayName=Lr.Root.displayName;function Mc({className:e,...t}){return o.jsx("div",{className:b("animate-pulse rounded-md bg-muted",e),...t})}function Pc(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const Ic=e=>{switch(e){case"success":return Dc;case"info":return Ac;case"warning":return Ec;case"error":return Fc;default:return null}},Tc=Array(12).fill(0),Lc=({visible:e,className:t})=>V.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},V.createElement("div",{className:"sonner-spinner"},Tc.map((r,n)=>V.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Dc=V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},V.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"})),Ec=V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},V.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"})),Ac=V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},V.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"})),Fc=V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},V.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"})),Vc=V.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"},V.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),V.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),zc=()=>{const[e,t]=V.useState(document.hidden);return V.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let Er=1;class $c{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...s}=t,a=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:Er++,i=this.toasts.find(c=>c.id===a),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...t,id:a,title:n}),{...c,...t,id:a,dismissible:l,title:n}):c):this.addToast({title:n,...s,dismissible:l,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let a=n!==void 0,i;const l=s.then(async d=>{if(i=["resolve",d],V.isValidElement(d))a=!1,this.create({id:n,type:"default",message:d});else if(Oc(d)&&!d.ok){a=!1;const u=typeof r.error=="function"?await r.error(`HTTP error! status: ${d.status}`):r.error,m=typeof r.description=="function"?await r.description(`HTTP error! status: ${d.status}`):r.description,h=typeof u=="object"&&!V.isValidElement(u)?u:{message:u};this.create({id:n,type:"error",description:m,...h})}else if(d instanceof Error){a=!1;const u=typeof r.error=="function"?await r.error(d):r.error,m=typeof r.description=="function"?await r.description(d):r.description,h=typeof u=="object"&&!V.isValidElement(u)?u:{message:u};this.create({id:n,type:"error",description:m,...h})}else if(r.success!==void 0){a=!1;const u=typeof r.success=="function"?await r.success(d):r.success,m=typeof r.description=="function"?await r.description(d):r.description,h=typeof u=="object"&&!V.isValidElement(u)?u:{message:u};this.create({id:n,type:"success",description:m,...h})}}).catch(async d=>{if(i=["reject",d],r.error!==void 0){a=!1;const p=typeof r.error=="function"?await r.error(d):r.error,u=typeof r.description=="function"?await r.description(d):r.description,f=typeof p=="object"&&!V.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:u,...f})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),c=()=>new Promise((d,p)=>l.then(()=>i[0]==="reject"?p(i[1]):d(i[1])).catch(p));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(t,r)=>{const n=(r==null?void 0:r.id)||Er++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Le=new $c,Bc=(e,t)=>{const r=(t==null?void 0:t.id)||Er++;return Le.addToast({title:e,...t,id:r}),r},Oc=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Hc=Bc,Gc=()=>Le.toasts,qc=()=>Le.getActiveToasts(),Wc=Object.assign(Hc,{success:Le.success,info:Le.info,warning:Le.warning,error:Le.error,custom:Le.custom,message:Le.message,promise:Le.promise,dismiss:Le.dismiss,loading:Le.loading},{getHistory:Gc,getToasts:qc});Pc("[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 Zt(e){return e.label!==void 0}const Uc=3,Kc="24px",Xc="16px",$n=4e3,Yc=356,Zc=14,Jc=45,Qc=200;function Je(...e){return e.filter(Boolean).join(" ")}function ed(e){const[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}const td=e=>{var t,r,n,s,a,i,l,c,d;const{invert:p,toast:u,unstyled:m,interacting:f,setHeights:h,visibleToasts:x,heights:w,index:v,toasts:y,expanded:j,removeToast:k,defaultRichColors:S,closeButton:R,style:_,cancelButtonStyle:C,actionButtonStyle:A,className:L="",descriptionClassName:N="",duration:$,position:I,gap:M,expandByDefault:H,classNames:D,icons:P,closeButtonAriaLabel:E="Close toast"}=e,[oe,Z]=V.useState(null),[ae,X]=V.useState(null),[z,G]=V.useState(!1),[Y,ee]=V.useState(!1),[F,B]=V.useState(!1),[K,te]=V.useState(!1),[ie,q]=V.useState(!1),[ce,de]=V.useState(0),[we,Pe]=V.useState(0),ye=V.useRef(u.duration||$||$n),$e=V.useRef(null),xe=V.useRef(null),Oe=v===0,Qe=v+1<=x,je=u.type,Fe=u.dismissible!==!1,gt=u.className||"",O=u.descriptionClassName||"",ne=V.useMemo(()=>w.findIndex(se=>se.toastId===u.id)||0,[w,u.id]),Ne=V.useMemo(()=>{var se;return(se=u.closeButton)!=null?se:R},[u.closeButton,R]),Xe=V.useMemo(()=>u.duration||$||$n,[u.duration,$]),Ye=V.useRef(0),_e=V.useRef(0),pt=V.useRef(0),Ze=V.useRef(null),[ht,xr]=I.split("-"),Ht=V.useMemo(()=>w.reduce((se,be,Ce)=>Ce>=ne?se:se+be.height,0),[w,ne]),Gt=zc(),br=u.invert||p,Nt=je==="loading";_e.current=V.useMemo(()=>ne*M+Ht,[ne,Ht]),V.useEffect(()=>{ye.current=Xe},[Xe]),V.useEffect(()=>{G(!0)},[]),V.useEffect(()=>{const se=xe.current;if(se){const be=se.getBoundingClientRect().height;return Pe(be),h(Ce=>[{toastId:u.id,height:be,position:u.position},...Ce]),()=>h(Ce=>Ce.filter(Ie=>Ie.toastId!==u.id))}},[h,u.id]),V.useLayoutEffect(()=>{if(!z)return;const se=xe.current,be=se.style.height;se.style.height="auto";const Ce=se.getBoundingClientRect().height;se.style.height=be,Pe(Ce),h(Ie=>Ie.find(Re=>Re.toastId===u.id)?Ie.map(Re=>Re.toastId===u.id?{...Re,height:Ce}:Re):[{toastId:u.id,height:Ce,position:u.position},...Ie])},[z,u.title,u.description,h,u.id,u.jsx,u.action,u.cancel]);const He=V.useCallback(()=>{ee(!0),de(_e.current),h(se=>se.filter(be=>be.toastId!==u.id)),setTimeout(()=>{k(u)},Qc)},[u,k,h,_e]);V.useEffect(()=>{if(u.promise&&je==="loading"||u.duration===1/0||u.type==="loading")return;let se;return j||f||Gt?(()=>{if(pt.current<Ye.current){const Ie=new Date().getTime()-Ye.current;ye.current=ye.current-Ie}pt.current=new Date().getTime()})():(()=>{ye.current!==1/0&&(Ye.current=new Date().getTime(),se=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),He()},ye.current))})(),()=>clearTimeout(se)},[j,f,u,je,Gt,He]),V.useEffect(()=>{u.delete&&(He(),u.onDismiss==null||u.onDismiss.call(u,u))},[He,u.delete]);function vr(){var se;if(P!=null&&P.loading){var be;return V.createElement("div",{className:Je(D==null?void 0:D.loader,u==null||(be=u.classNames)==null?void 0:be.loader,"sonner-loader"),"data-visible":je==="loading"},P.loading)}return V.createElement(Lc,{className:Je(D==null?void 0:D.loader,u==null||(se=u.classNames)==null?void 0:se.loader),visible:je==="loading"})}const qt=u.icon||(P==null?void 0:P[je])||Ic(je);var Ct,kt;return V.createElement("li",{tabIndex:0,ref:xe,className:Je(L,gt,D==null?void 0:D.toast,u==null||(t=u.classNames)==null?void 0:t.toast,D==null?void 0:D.default,D==null?void 0:D[je],u==null||(r=u.classNames)==null?void 0:r[je]),"data-sonner-toast":"","data-rich-colors":(Ct=u.richColors)!=null?Ct:S,"data-styled":!(u.jsx||u.unstyled||m),"data-mounted":z,"data-promise":!!u.promise,"data-swiped":ie,"data-removed":Y,"data-visible":Qe,"data-y-position":ht,"data-x-position":xr,"data-index":v,"data-front":Oe,"data-swiping":F,"data-dismissible":Fe,"data-type":je,"data-invert":br,"data-swipe-out":K,"data-swipe-direction":ae,"data-expanded":!!(j||H&&z),"data-testid":u.testId,style:{"--index":v,"--toasts-before":v,"--z-index":y.length-v,"--offset":`${Y?ce:_e.current}px`,"--initial-height":H?"auto":`${we}px`,..._,...u.style},onDragEnd:()=>{B(!1),Z(null),Ze.current=null},onPointerDown:se=>{se.button!==2&&(Nt||!Fe||($e.current=new Date,de(_e.current),se.target.setPointerCapture(se.pointerId),se.target.tagName!=="BUTTON"&&(B(!0),Ze.current={x:se.clientX,y:se.clientY})))},onPointerUp:()=>{var se,be,Ce;if(K||!Fe)return;Ze.current=null;const Ie=Number(((se=xe.current)==null?void 0:se.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Wt=Number(((be=xe.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Re=new Date().getTime()-((Ce=$e.current)==null?void 0:Ce.getTime()),Be=oe==="x"?Ie:Wt,Ut=Math.abs(Be)/Re;if(Math.abs(Be)>=Jc||Ut>.11){de(_e.current),u.onDismiss==null||u.onDismiss.call(u,u),X(oe==="x"?Ie>0?"right":"left":Wt>0?"down":"up"),He(),te(!0);return}else{var Ge,qe;(Ge=xe.current)==null||Ge.style.setProperty("--swipe-amount-x","0px"),(qe=xe.current)==null||qe.style.setProperty("--swipe-amount-y","0px")}q(!1),B(!1),Z(null)},onPointerMove:se=>{var be,Ce,Ie;if(!Ze.current||!Fe||((be=window.getSelection())==null?void 0:be.toString().length)>0)return;const Re=se.clientY-Ze.current.y,Be=se.clientX-Ze.current.x;var Ut;const Ge=(Ut=e.swipeDirections)!=null?Ut:ed(I);!oe&&(Math.abs(Be)>1||Math.abs(Re)>1)&&Z(Math.abs(Be)>Math.abs(Re)?"x":"y");let qe={x:0,y:0};const In=at=>1/(1.5+Math.abs(at)/20);if(oe==="y"){if(Ge.includes("top")||Ge.includes("bottom"))if(Ge.includes("top")&&Re<0||Ge.includes("bottom")&&Re>0)qe.y=Re;else{const at=Re*In(Re);qe.y=Math.abs(at)<Math.abs(Re)?at:Re}}else if(oe==="x"&&(Ge.includes("left")||Ge.includes("right")))if(Ge.includes("left")&&Be<0||Ge.includes("right")&&Be>0)qe.x=Be;else{const at=Be*In(Be);qe.x=Math.abs(at)<Math.abs(Be)?at:Be}(Math.abs(qe.x)>0||Math.abs(qe.y)>0)&&q(!0),(Ce=xe.current)==null||Ce.style.setProperty("--swipe-amount-x",`${qe.x}px`),(Ie=xe.current)==null||Ie.style.setProperty("--swipe-amount-y",`${qe.y}px`)}},Ne&&!u.jsx&&je!=="loading"?V.createElement("button",{"aria-label":E,"data-disabled":Nt,"data-close-button":!0,onClick:Nt||!Fe?()=>{}:()=>{He(),u.onDismiss==null||u.onDismiss.call(u,u)},className:Je(D==null?void 0:D.closeButton,u==null||(n=u.classNames)==null?void 0:n.closeButton)},(kt=P==null?void 0:P.close)!=null?kt:Vc):null,(je||u.icon||u.promise)&&u.icon!==null&&((P==null?void 0:P[je])!==null||u.icon)?V.createElement("div",{"data-icon":"",className:Je(D==null?void 0:D.icon,u==null||(s=u.classNames)==null?void 0:s.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||vr():null,u.type!=="loading"?qt:null):null,V.createElement("div",{"data-content":"",className:Je(D==null?void 0:D.content,u==null||(a=u.classNames)==null?void 0:a.content)},V.createElement("div",{"data-title":"",className:Je(D==null?void 0:D.title,u==null||(i=u.classNames)==null?void 0:i.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?V.createElement("div",{"data-description":"",className:Je(N,O,D==null?void 0:D.description,u==null||(l=u.classNames)==null?void 0:l.description)},typeof u.description=="function"?u.description():u.description):null),V.isValidElement(u.cancel)?u.cancel:u.cancel&&Zt(u.cancel)?V.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||C,onClick:se=>{Zt(u.cancel)&&Fe&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,se),He())},className:Je(D==null?void 0:D.cancelButton,u==null||(c=u.classNames)==null?void 0:c.cancelButton)},u.cancel.label):null,V.isValidElement(u.action)?u.action:u.action&&Zt(u.action)?V.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||A,onClick:se=>{Zt(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,se),!se.defaultPrevented&&He())},className:Je(D==null?void 0:D.actionButton,u==null||(d=u.classNames)==null?void 0:d.actionButton)},u.action.label):null)};function Bn(){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 rd(e,t){const r={};return[e,t].forEach((n,s)=>{const a=s===1,i=a?"--mobile-offset":"--offset",l=a?Xc:Kc;function c(d){["top","right","bottom","left"].forEach(p=>{r[`${i}-${p}`]=typeof d=="number"?`${d}px`:d})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(d=>{n[d]===void 0?r[`${i}-${d}`]=l:r[`${i}-${d}`]=typeof n[d]=="number"?`${n[d]}px`:n[d]}):c(l)}),r}const nd=V.forwardRef(function(t,r){const{id:n,invert:s,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:l,closeButton:c,className:d,offset:p,mobileOffset:u,theme:m="light",richColors:f,duration:h,style:x,visibleToasts:w=Uc,toastOptions:v,dir:y=Bn(),gap:j=Zc,icons:k,containerAriaLabel:S="Notifications"}=t,[R,_]=V.useState([]),C=V.useMemo(()=>n?R.filter(z=>z.toasterId===n):R.filter(z=>!z.toasterId),[R,n]),A=V.useMemo(()=>Array.from(new Set([a].concat(C.filter(z=>z.position).map(z=>z.position)))),[C,a]),[L,N]=V.useState([]),[$,I]=V.useState(!1),[M,H]=V.useState(!1),[D,P]=V.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),E=V.useRef(null),oe=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),Z=V.useRef(null),ae=V.useRef(!1),X=V.useCallback(z=>{_(G=>{var Y;return(Y=G.find(ee=>ee.id===z.id))!=null&&Y.delete||Le.dismiss(z.id),G.filter(({id:ee})=>ee!==z.id)})},[]);return V.useEffect(()=>Le.subscribe(z=>{if(z.dismiss){requestAnimationFrame(()=>{_(G=>G.map(Y=>Y.id===z.id?{...Y,delete:!0}:Y))});return}setTimeout(()=>{Hr.flushSync(()=>{_(G=>{const Y=G.findIndex(ee=>ee.id===z.id);return Y!==-1?[...G.slice(0,Y),{...G[Y],...z},...G.slice(Y+1)]:[z,...G]})})})}),[R]),V.useEffect(()=>{if(m!=="system"){P(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?P("dark"):P("light")),typeof window>"u")return;const z=window.matchMedia("(prefers-color-scheme: dark)");try{z.addEventListener("change",({matches:G})=>{P(G?"dark":"light")})}catch{z.addListener(({matches:Y})=>{try{P(Y?"dark":"light")}catch(ee){console.error(ee)}})}},[m]),V.useEffect(()=>{R.length<=1&&I(!1)},[R]),V.useEffect(()=>{const z=G=>{var Y;if(i.every(B=>G[B]||G.code===B)){var F;I(!0),(F=E.current)==null||F.focus()}G.code==="Escape"&&(document.activeElement===E.current||(Y=E.current)!=null&&Y.contains(document.activeElement))&&I(!1)};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[i]),V.useEffect(()=>{if(E.current)return()=>{Z.current&&(Z.current.focus({preventScroll:!0}),Z.current=null,ae.current=!1)}},[E.current]),V.createElement("section",{ref:r,"aria-label":`${S} ${oe}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((z,G)=>{var Y;const[ee,F]=z.split("-");return C.length?V.createElement("ol",{key:z,dir:y==="auto"?Bn():y,tabIndex:-1,ref:E,className:d,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":ee,"data-x-position":F,style:{"--front-toast-height":`${((Y=L[0])==null?void 0:Y.height)||0}px`,"--width":`${Yc}px`,"--gap":`${j}px`,...x,...rd(p,u)},onBlur:B=>{ae.current&&!B.currentTarget.contains(B.relatedTarget)&&(ae.current=!1,Z.current&&(Z.current.focus({preventScroll:!0}),Z.current=null))},onFocus:B=>{B.target instanceof HTMLElement&&B.target.dataset.dismissible==="false"||ae.current||(ae.current=!0,Z.current=B.relatedTarget)},onMouseEnter:()=>I(!0),onMouseMove:()=>I(!0),onMouseLeave:()=>{M||I(!1)},onDragEnd:()=>I(!1),onPointerDown:B=>{B.target instanceof HTMLElement&&B.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},C.filter(B=>!B.position&&G===0||B.position===z).map((B,K)=>{var te,ie;return V.createElement(td,{key:B.id,icons:k,index:K,toast:B,defaultRichColors:f,duration:(te=v==null?void 0:v.duration)!=null?te:h,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:s,visibleToasts:w,closeButton:(ie=v==null?void 0:v.closeButton)!=null?ie:c,interacting:M,position:z,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,closeButtonAriaLabel:v==null?void 0:v.closeButtonAriaLabel,removeToast:X,toasts:C.filter(q=>q.position==B.position),heights:L.filter(q=>q.position==B.position),setHeights:N,expandByDefault:l,gap:j,expanded:$,swipeDirections:t.swipeDirections})})):null}))}),jr=["light","dark","system"];function od(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function On(e){return e==="system"?od():e}function sd(e){if(typeof document>"u")return()=>{};const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*, *::before, *::after { transition: none !important; animation: none !important; }")),document.head.appendChild(t),window.getComputedStyle(document.body),()=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{document.head.removeChild(t)})})}}function ad(e,t){const r=document.documentElement;t==="class"?(r.classList.remove("light","dark"),r.classList.add(e)):r.setAttribute("data-theme",e)}const Ks=V.createContext(void 0);function id({children:e,defaultTheme:t="system",storageKey:r="nui-theme",attribute:n="class",enableSystem:s=!0,disableTransitionOnChange:a=!1,forcedTheme:i,nonce:l}){const[c,d]=V.useState(()=>{if(typeof window>"u")return t;const v=localStorage.getItem(r);return v&&jr.includes(v)?v:t}),[p,u]=V.useState(()=>On(i??c)),m=V.useRef(c);m.current=c;const f=V.useCallback(()=>{const v=i??m.current,y=On(v);u(y);let j;a&&(j=sd(l)),ad(y,n),j==null||j()},[i,n,a,l]);V.useEffect(()=>{f()},[c,i,f]),V.useEffect(()=>{if(!s)return;const v=window.matchMedia("(prefers-color-scheme: dark)"),y=()=>{(i??m.current)==="system"&&f()};return v.addEventListener("change",y),()=>v.removeEventListener("change",y)},[s,i,f]),V.useEffect(()=>{const v=y=>{if(y.key===r&&y.newValue){const j=y.newValue;jr.includes(j)&&d(j)}};return window.addEventListener("storage",v),()=>window.removeEventListener("storage",v)},[r]);const h=V.useCallback(v=>{!s&&v==="system"||(localStorage.setItem(r,v),d(v))},[r,s]),x=V.useMemo(()=>s?jr:["light","dark"],[s]),w=V.useMemo(()=>({theme:i??c,resolvedTheme:p,setTheme:h,themes:x}),[i,c,p,h,x]);return o.jsx(Ks.Provider,{value:w,children:e})}function dr(){const e=V.useContext(Ks);if(e===void 0)throw new Error("useTheme must be used within a <ThemeProvider>");return e}const ld=({theme:e,...t})=>{let r=e;try{const{resolvedTheme:n}=dr();e||(r=n)}catch{r||(r="system")}return o.jsx(nd,{theme:r,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};function cd({icon:e,title:t,description:r,action:n,className:s}){return o.jsxs("div",{className:b("flex flex-col items-center justify-center py-12 px-4 text-center",s),children:[e&&o.jsx("div",{className:"mb-4 text-muted-foreground",children:e}),o.jsx("h3",{className:"text-lg font-semibold",children:t}),r&&o.jsx("p",{className:"mt-1 text-sm text-muted-foreground max-w-sm",children:r}),n&&o.jsx("div",{className:"mt-4",children:n})]})}const Xs=g.forwardRef(({...e},t)=>o.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));Xs.displayName="Breadcrumb";const Ys=g.forwardRef(({className:e,...t},r)=>o.jsx("ol",{ref:r,className:b("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));Ys.displayName="BreadcrumbList";const Zs=g.forwardRef(({className:e,...t},r)=>o.jsx("li",{ref:r,className:b("inline-flex items-center gap-1.5",e),...t}));Zs.displayName="BreadcrumbItem";const Js=g.forwardRef(({asChild:e,className:t,...r},n)=>{const s=e?to.Slot:"a";return o.jsx(s,{ref:n,className:b("transition-colors hover:text-foreground",t),...r})});Js.displayName="BreadcrumbLink";const Qs=g.forwardRef(({className:e,...t},r)=>o.jsx("span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:b("font-normal text-foreground",e),...t}));Qs.displayName="BreadcrumbPage";const ea=({children:e,className:t,...r})=>o.jsx("li",{role:"presentation","aria-hidden":"true",className:b("[&>svg]:w-3.5 [&>svg]:h-3.5",t),...r,children:e??o.jsx(T.ChevronRight,{})});ea.displayName="BreadcrumbSeparator";const ta=({className:e,...t})=>{const r=re();return o.jsxs("span",{role:"presentation","aria-hidden":"true",className:b("flex h-9 w-9 items-center justify-center",e),...t,children:[o.jsx("span",{className:"h-4 w-4",children:"..."}),o.jsx("span",{className:"sr-only",children:r.breadcrumb_more})]})};ta.displayName="BreadcrumbEllipsis";const ra=({className:e,...t})=>o.jsx("nav",{role:"navigation","aria-label":"pagination",className:b("mx-auto flex w-full justify-center",e),...t});ra.displayName="Pagination";const na=g.forwardRef(({className:e,...t},r)=>o.jsx("ul",{ref:r,className:b("flex flex-row items-center gap-1",e),...t}));na.displayName="PaginationContent";const oa=g.forwardRef(({className:e,...t},r)=>o.jsx("li",{ref:r,className:b("",e),...t}));oa.displayName="PaginationItem";const ur=({className:e,isActive:t,size:r="icon",...n})=>o.jsx("a",{"aria-current":t?"page":void 0,className:b(Bt({variant:t?"outline":"ghost",size:r}),e),...n});ur.displayName="PaginationLink";const sa=({className:e,...t})=>{const r=re();return o.jsxs(ur,{"aria-label":r.pagination_goToPrevious,size:"default",className:b("gap-1 pl-2.5",e),...t,children:[o.jsx(T.ChevronLeft,{className:"h-4 w-4"}),o.jsx("span",{children:r.pagination_previous})]})};sa.displayName="PaginationPrevious";const aa=({className:e,...t})=>{const r=re();return o.jsxs(ur,{"aria-label":r.pagination_goToNext,size:"default",className:b("gap-1 pr-2.5",e),...t,children:[o.jsx("span",{children:r.pagination_next}),o.jsx(T.ChevronRight,{className:"h-4 w-4"})]})};aa.displayName="PaginationNext";const ia=({className:e,...t})=>{const r=re();return o.jsxs("span",{"aria-hidden":!0,className:b("flex h-9 w-9 items-center justify-center",e),...t,children:[o.jsx(T.MoreHorizontal,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:r.pagination_morePages})]})};ia.displayName="PaginationEllipsis";function dd({steps:e,activeStep:t,orientation:r="horizontal",className:n}){return o.jsx("div",{className:b("flex",r==="vertical"?"flex-col":"flex-row items-center",n),children:e.map((s,a)=>{const i=a<t,l=a===t,c=a===e.length-1;return o.jsxs(g.Fragment,{children:[o.jsxs("div",{className:b("flex items-center",r==="vertical"&&"flex-row"),children:[o.jsx("div",{className:b("flex h-10 w-10 items-center justify-center rounded-full border-2 font-semibold transition-colors",i&&"border-primary bg-primary text-primary-foreground",l&&"border-primary text-primary",!i&&!l&&"border-muted-foreground/30 text-muted-foreground"),children:i?o.jsx(T.Check,{className:"h-5 w-5"}):a+1}),o.jsxs("div",{className:b("ml-3",r==="horizontal"&&"hidden sm:block"),children:[o.jsx("p",{className:b("text-sm font-medium",l&&"text-foreground",!l&&"text-muted-foreground"),children:s.title}),s.description&&o.jsx("p",{className:"text-xs text-muted-foreground",children:s.description})]})]}),!c&&o.jsx("div",{className:b("flex-1",r==="horizontal"?"mx-4 h-0.5 min-w-[3rem]":"ml-5 my-2 w-0.5 min-h-[2rem]",i?"bg-primary":"bg-muted-foreground/30")})]},a)})})}const la=g.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(Ae.Root,{ref:n,className:b("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...r,children:[t,o.jsx(bn,{})]}));la.displayName=Ae.Root.displayName;const ca=g.forwardRef(({className:e,...t},r)=>o.jsx(Ae.List,{ref:r,className:b("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));ca.displayName=Ae.List.displayName;const ud=Ae.Item,da=ze("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),ua=g.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(Ae.Trigger,{ref:n,className:b(da(),"group",e),...r,children:[t," ",o.jsx(T.ChevronDown,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));ua.displayName=Ae.Trigger.displayName;const ma=g.forwardRef(({className:e,...t},r)=>o.jsx(Ae.Content,{ref:r,className:b("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto",e),...t}));ma.displayName=Ae.Content.displayName;const md=Ae.Link,bn=g.forwardRef(({className:e,...t},r)=>o.jsx("div",{className:b("absolute left-0 top-full flex justify-center"),children:o.jsx(Ae.Viewport,{className:b("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:r,...t})}));bn.displayName=Ae.Viewport.displayName;const fa=g.forwardRef(({className:e,...t},r)=>o.jsx(Ae.Indicator,{ref:r,className:b("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:o.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));fa.displayName=Ae.Indicator.displayName;const fd=fe.Root,gd=fe.Trigger,pd=fe.Group,hd=fe.Portal,xd=fe.Sub,bd=fe.RadioGroup,ga=g.forwardRef(({className:e,inset:t,children:r,...n},s)=>o.jsxs(fe.SubTrigger,{ref:s,className:b("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...n,children:[r,o.jsx(T.ChevronRight,{className:"ml-auto h-4 w-4"})]}));ga.displayName=fe.SubTrigger.displayName;const pa=g.forwardRef(({className:e,...t},r)=>o.jsx(fe.SubContent,{ref:r,className:b("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));pa.displayName=fe.SubContent.displayName;const ha=g.forwardRef(({className:e,...t},r)=>o.jsx(fe.Portal,{children:o.jsx(fe.Content,{ref:r,className:b("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));ha.displayName=fe.Content.displayName;const xa=g.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(fe.Item,{ref:n,className:b("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));xa.displayName=fe.Item.displayName;const ba=g.forwardRef(({className:e,children:t,checked:r,...n},s)=>o.jsxs(fe.CheckboxItem,{ref:s,className:b("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(fe.ItemIndicator,{children:o.jsx(T.Check,{className:"h-4 w-4"})})}),t]}));ba.displayName=fe.CheckboxItem.displayName;const va=g.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(fe.RadioItem,{ref:n,className:b("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(fe.ItemIndicator,{children:o.jsx(T.Circle,{className:"h-2 w-2 fill-current"})})}),t]}));va.displayName=fe.RadioItem.displayName;const wa=g.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(fe.Label,{ref:n,className:b("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...r}));wa.displayName=fe.Label.displayName;const ya=g.forwardRef(({className:e,...t},r)=>o.jsx(fe.Separator,{ref:r,className:b("-mx-1 my-1 h-px bg-border",e),...t}));ya.displayName=fe.Separator.displayName;const ja=({className:e,...t})=>o.jsx("span",{className:b("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});ja.displayName="ContextMenuShortcut";const vd=ir.Root,wd=ir.Trigger,Na=g.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>o.jsx(ir.Content,{ref:s,align:t,sideOffset:r,className:b("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Na.displayName=ir.Content.displayName;function yd(e){return Object.prototype.toString.call(e)==="[object Object]"}function Hn(e){return yd(e)||Array.isArray(e)}function jd(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function vn(e,t){const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;const s=JSON.stringify(Object.keys(e.breakpoints||{})),a=JSON.stringify(Object.keys(t.breakpoints||{}));return s!==a?!1:r.every(i=>{const l=e[i],c=t[i];return typeof l=="function"?`${l}`==`${c}`:!Hn(l)||!Hn(c)?l===c:vn(l,c)})}function Gn(e){return e.concat().sort((t,r)=>t.name>r.name?1:-1).map(t=>t.options)}function Nd(e,t){if(e.length!==t.length)return!1;const r=Gn(e),n=Gn(t);return r.every((s,a)=>{const i=n[a];return vn(s,i)})}function wn(e){return typeof e=="number"}function Ar(e){return typeof e=="string"}function mr(e){return typeof e=="boolean"}function qn(e){return Object.prototype.toString.call(e)==="[object Object]"}function pe(e){return Math.abs(e)}function yn(e){return Math.sign(e)}function Tt(e,t){return pe(e-t)}function Cd(e,t){if(e===0||t===0||pe(e)<=pe(t))return 0;const r=Tt(pe(e),pe(t));return pe(r/e)}function kd(e){return Math.round(e*100)/100}function Ft(e){return Vt(e).map(Number)}function Ue(e){return e[Ot(e)]}function Ot(e){return Math.max(0,e.length-1)}function jn(e,t){return t===Ot(e)}function Wn(e,t=0){return Array.from(Array(e),(r,n)=>t+n)}function Vt(e){return Object.keys(e)}function Ca(e,t){return[e,t].reduce((r,n)=>(Vt(n).forEach(s=>{const a=r[s],i=n[s],l=qn(a)&&qn(i);r[s]=l?Ca(a,i):i}),r),{})}function Fr(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function Sd(e,t){const r={start:n,center:s,end:a};function n(){return 0}function s(c){return a(c)/2}function a(c){return t-c}function i(c,d){return Ar(e)?r[e](c):e(t,c,d)}return{measure:i}}function zt(){let e=[];function t(s,a,i,l={passive:!0}){let c;if("addEventListener"in s)s.addEventListener(a,i,l),c=()=>s.removeEventListener(a,i,l);else{const d=s;d.addListener(i),c=()=>d.removeListener(i)}return e.push(c),n}function r(){e=e.filter(s=>s())}const n={add:t,clear:r};return n}function Rd(e,t,r,n){const s=zt(),a=1e3/60;let i=null,l=0,c=0;function d(){s.add(e,"visibilitychange",()=>{e.hidden&&h()})}function p(){f(),s.clear()}function u(w){if(!c)return;i||(i=w,r(),r());const v=w-i;for(i=w,l+=v;l>=a;)r(),l-=a;const y=l/a;n(y),c&&(c=t.requestAnimationFrame(u))}function m(){c||(c=t.requestAnimationFrame(u))}function f(){t.cancelAnimationFrame(c),i=null,l=0,c=0}function h(){i=null,l=0}return{init:d,destroy:p,start:m,stop:f,update:r,render:n}}function _d(e,t){const r=t==="rtl",n=e==="y",s=n?"y":"x",a=n?"x":"y",i=!n&&r?-1:1,l=p(),c=u();function d(h){const{height:x,width:w}=h;return n?x:w}function p(){return n?"top":r?"right":"left"}function u(){return n?"bottom":r?"left":"right"}function m(h){return h*i}return{scroll:s,cross:a,startEdge:l,endEdge:c,measureSize:d,direction:m}}function ut(e=0,t=0){const r=pe(e-t);function n(d){return d<e}function s(d){return d>t}function a(d){return n(d)||s(d)}function i(d){return a(d)?n(d)?e:t:d}function l(d){return r?d-r*Math.ceil((d-t)/r):d}return{length:r,max:t,min:e,constrain:i,reachedAny:a,reachedMax:s,reachedMin:n,removeOffset:l}}function ka(e,t,r){const{constrain:n}=ut(0,e),s=e+1;let a=i(t);function i(m){return r?pe((s+m)%s):n(m)}function l(){return a}function c(m){return a=i(m),u}function d(m){return p().set(l()+m)}function p(){return ka(e,l(),r)}const u={get:l,set:c,add:d,clone:p};return u}function Md(e,t,r,n,s,a,i,l,c,d,p,u,m,f,h,x,w,v,y){const{cross:j,direction:k}=e,S=["INPUT","SELECT","TEXTAREA"],R={passive:!1},_=zt(),C=zt(),A=ut(50,225).constrain(f.measure(20)),L={mouse:300,touch:400},N={mouse:500,touch:600},$=h?43:25;let I=!1,M=0,H=0,D=!1,P=!1,E=!1,oe=!1;function Z(q){if(!y)return;function ce(we){(mr(y)||y(q,we))&&ee(we)}const de=t;_.add(de,"dragstart",we=>we.preventDefault(),R).add(de,"touchmove",()=>{},R).add(de,"touchend",()=>{}).add(de,"touchstart",ce).add(de,"mousedown",ce).add(de,"touchcancel",B).add(de,"contextmenu",B).add(de,"click",K,!0)}function ae(){_.clear(),C.clear()}function X(){const q=oe?r:t;C.add(q,"touchmove",F,R).add(q,"touchend",B).add(q,"mousemove",F,R).add(q,"mouseup",B)}function z(q){const ce=q.nodeName||"";return S.includes(ce)}function G(){return(h?N:L)[oe?"mouse":"touch"]}function Y(q,ce){const de=u.add(yn(q)*-1),we=p.byDistance(q,!h).distance;return h||pe(q)<A?we:w&&ce?we*.5:p.byIndex(de.get(),0).distance}function ee(q){const ce=Fr(q,n);oe=ce,E=h&&ce&&!q.buttons&&I,I=Tt(s.get(),i.get())>=2,!(ce&&q.button!==0)&&(z(q.target)||(D=!0,a.pointerDown(q),d.useFriction(0).useDuration(0),s.set(i),X(),M=a.readPoint(q),H=a.readPoint(q,j),m.emit("pointerDown")))}function F(q){if(!Fr(q,n)&&q.touches.length>=2)return B(q);const de=a.readPoint(q),we=a.readPoint(q,j),Pe=Tt(de,M),ye=Tt(we,H);if(!P&&!oe&&(!q.cancelable||(P=Pe>ye,!P)))return B(q);const $e=a.pointerMove(q);Pe>x&&(E=!0),d.useFriction(.3).useDuration(.75),l.start(),s.add(k($e)),q.preventDefault()}function B(q){const de=p.byDistance(0,!1).index!==u.get(),we=a.pointerUp(q)*G(),Pe=Y(k(we),de),ye=Cd(we,Pe),$e=$-10*ye,xe=v+ye/50;P=!1,D=!1,C.clear(),d.useDuration($e).useFriction(xe),c.distance(Pe,!h),oe=!1,m.emit("pointerUp")}function K(q){E&&(q.stopPropagation(),q.preventDefault(),E=!1)}function te(){return D}return{init:Z,destroy:ae,pointerDown:te}}function Pd(e,t){let n,s;function a(u){return u.timeStamp}function i(u,m){const h=`client${(m||e.scroll)==="x"?"X":"Y"}`;return(Fr(u,t)?u:u.touches[0])[h]}function l(u){return n=u,s=u,i(u)}function c(u){const m=i(u)-i(s),f=a(u)-a(n)>170;return s=u,f&&(n=u),m}function d(u){if(!n||!s)return 0;const m=i(s)-i(n),f=a(u)-a(n),h=a(u)-a(s)>170,x=m/f;return f&&!h&&pe(x)>.1?x:0}return{pointerDown:l,pointerMove:c,pointerUp:d,readPoint:i}}function Id(){function e(r){const{offsetTop:n,offsetLeft:s,offsetWidth:a,offsetHeight:i}=r;return{top:n,right:s+a,bottom:n+i,left:s,width:a,height:i}}return{measure:e}}function Td(e){function t(n){return e*(n/100)}return{measure:t}}function Ld(e,t,r,n,s,a,i){const l=[e].concat(n);let c,d,p=[],u=!1;function m(w){return s.measureSize(i.measure(w))}function f(w){if(!a)return;d=m(e),p=n.map(m);function v(y){for(const j of y){if(u)return;const k=j.target===e,S=n.indexOf(j.target),R=k?d:p[S],_=m(k?e:n[S]);if(pe(_-R)>=.5){w.reInit(),t.emit("resize");break}}}c=new ResizeObserver(y=>{(mr(a)||a(w,y))&&v(y)}),r.requestAnimationFrame(()=>{l.forEach(y=>c.observe(y))})}function h(){u=!0,c&&c.disconnect()}return{init:f,destroy:h}}function Dd(e,t,r,n,s,a){let i=0,l=0,c=s,d=a,p=e.get(),u=0;function m(){const R=n.get()-e.get(),_=!c;let C=0;return _?(i=0,r.set(n),e.set(n),C=R):(r.set(e),i+=R/c,i*=d,p+=i,e.add(i),C=p-u),l=yn(C),u=p,S}function f(){const R=n.get()-t.get();return pe(R)<.001}function h(){return c}function x(){return l}function w(){return i}function v(){return j(s)}function y(){return k(a)}function j(R){return c=R,S}function k(R){return d=R,S}const S={direction:x,duration:h,velocity:w,seek:m,settled:f,useBaseFriction:y,useBaseDuration:v,useFriction:k,useDuration:j};return S}function Ed(e,t,r,n,s){const a=s.measure(10),i=s.measure(50),l=ut(.1,.99);let c=!1;function d(){return!(c||!e.reachedAny(r.get())||!e.reachedAny(t.get()))}function p(f){if(!d())return;const h=e.reachedMin(t.get())?"min":"max",x=pe(e[h]-t.get()),w=r.get()-t.get(),v=l.constrain(x/i);r.subtract(w*v),!f&&pe(w)<a&&(r.set(e.constrain(r.get())),n.useDuration(25).useBaseFriction())}function u(f){c=!f}return{shouldConstrain:d,constrain:p,toggleActive:u}}function Ad(e,t,r,n,s){const a=ut(-t+e,0),i=u(),l=p(),c=m();function d(h,x){return Tt(h,x)<=1}function p(){const h=i[0],x=Ue(i),w=i.lastIndexOf(h),v=i.indexOf(x)+1;return ut(w,v)}function u(){return r.map((h,x)=>{const{min:w,max:v}=a,y=a.constrain(h),j=!x,k=jn(r,x);return j?v:k||d(w,y)?w:d(v,y)?v:y}).map(h=>parseFloat(h.toFixed(3)))}function m(){if(t<=e+s)return[a.max];if(n==="keepSnaps")return i;const{min:h,max:x}=l;return i.slice(h,x)}return{snapsContained:c,scrollContainLimit:l}}function Fd(e,t,r){const n=t[0],s=r?n-e:Ue(t);return{limit:ut(s,n)}}function Vd(e,t,r,n){const a=t.min+.1,i=t.max+.1,{reachedMin:l,reachedMax:c}=ut(a,i);function d(m){return m===1?c(r.get()):m===-1?l(r.get()):!1}function p(m){if(!d(m))return;const f=e*(m*-1);n.forEach(h=>h.add(f))}return{loop:p}}function zd(e){const{max:t,length:r}=e;function n(a){const i=a-t;return r?i/-r:0}return{get:n}}function $d(e,t,r,n,s){const{startEdge:a,endEdge:i}=e,{groupSlides:l}=s,c=u().map(t.measure),d=m(),p=f();function u(){return l(n).map(x=>Ue(x)[i]-x[0][a]).map(pe)}function m(){return n.map(x=>r[a]-x[a]).map(x=>-pe(x))}function f(){return l(d).map(x=>x[0]).map((x,w)=>x+c[w])}return{snaps:d,snapsAligned:p}}function Bd(e,t,r,n,s,a){const{groupSlides:i}=s,{min:l,max:c}=n,d=p();function p(){const m=i(a),f=!e||t==="keepSnaps";return r.length===1?[a]:f?m:m.slice(l,c).map((h,x,w)=>{const v=!x,y=jn(w,x);if(v){const j=Ue(w[0])+1;return Wn(j)}if(y){const j=Ot(a)-Ue(w)[0]+1;return Wn(j,Ue(w)[0])}return h})}return{slideRegistry:d}}function Od(e,t,r,n,s){const{reachedAny:a,removeOffset:i,constrain:l}=n;function c(h){return h.concat().sort((x,w)=>pe(x)-pe(w))[0]}function d(h){const x=e?i(h):l(h),w=t.map((y,j)=>({diff:p(y-x,0),index:j})).sort((y,j)=>pe(y.diff)-pe(j.diff)),{index:v}=w[0];return{index:v,distance:x}}function p(h,x){const w=[h,h+r,h-r];if(!e)return h;if(!x)return c(w);const v=w.filter(y=>yn(y)===x);return v.length?c(v):Ue(w)-r}function u(h,x){const w=t[h]-s.get(),v=p(w,x);return{index:h,distance:v}}function m(h,x){const w=s.get()+h,{index:v,distance:y}=d(w),j=!e&&a(w);if(!x||j)return{index:v,distance:h};const k=t[v]-y,S=h+p(k,0);return{index:v,distance:S}}return{byDistance:m,byIndex:u,shortcut:p}}function Hd(e,t,r,n,s,a,i){function l(u){const m=u.distance,f=u.index!==t.get();a.add(m),m&&(n.duration()?e.start():(e.update(),e.render(1),e.update())),f&&(r.set(t.get()),t.set(u.index),i.emit("select"))}function c(u,m){const f=s.byDistance(u,m);l(f)}function d(u,m){const f=t.clone().set(u),h=s.byIndex(f.get(),m);l(h)}return{distance:c,index:d}}function Gd(e,t,r,n,s,a,i,l){const c={passive:!0,capture:!0};let d=0;function p(f){if(!l)return;function h(x){if(new Date().getTime()-d>10)return;i.emit("slideFocusStart"),e.scrollLeft=0;const y=r.findIndex(j=>j.includes(x));wn(y)&&(s.useDuration(0),n.index(y,0),i.emit("slideFocus"))}a.add(document,"keydown",u,!1),t.forEach((x,w)=>{a.add(x,"focus",v=>{(mr(l)||l(f,v))&&h(w)},c)})}function u(f){f.code==="Tab"&&(d=new Date().getTime())}return{init:p}}function Mt(e){let t=e;function r(){return t}function n(c){t=i(c)}function s(c){t+=i(c)}function a(c){t-=i(c)}function i(c){return wn(c)?c:c.get()}return{get:r,set:n,add:s,subtract:a}}function Sa(e,t){const r=e.scroll==="x"?i:l,n=t.style;let s=null,a=!1;function i(m){return`translate3d(${m}px,0px,0px)`}function l(m){return`translate3d(0px,${m}px,0px)`}function c(m){if(a)return;const f=kd(e.direction(m));f!==s&&(n.transform=r(f),s=f)}function d(m){a=!m}function p(){a||(n.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:p,to:c,toggleActive:d}}function qd(e,t,r,n,s,a,i,l,c){const p=Ft(s),u=Ft(s).reverse(),m=v().concat(y());function f(_,C){return _.reduce((A,L)=>A-s[L],C)}function h(_,C){return _.reduce((A,L)=>f(A,C)>0?A.concat([L]):A,[])}function x(_){return a.map((C,A)=>({start:C-n[A]+.5+_,end:C+t-.5+_}))}function w(_,C,A){const L=x(C);return _.map(N=>{const $=A?0:-r,I=A?r:0,M=A?"end":"start",H=L[N][M];return{index:N,loopPoint:H,slideLocation:Mt(-1),translate:Sa(e,c[N]),target:()=>l.get()>H?$:I}})}function v(){const _=i[0],C=h(u,_);return w(C,r,!1)}function y(){const _=t-i[0]-1,C=h(p,_);return w(C,-r,!0)}function j(){return m.every(({index:_})=>{const C=p.filter(A=>A!==_);return f(C,t)<=.1})}function k(){m.forEach(_=>{const{target:C,translate:A,slideLocation:L}=_,N=C();N!==L.get()&&(A.to(N),L.set(N))})}function S(){m.forEach(_=>_.translate.clear())}return{canLoop:j,clear:S,loop:k,loopPoints:m}}function Wd(e,t,r){let n,s=!1;function a(c){if(!r)return;function d(p){for(const u of p)if(u.type==="childList"){c.reInit(),t.emit("slidesChanged");break}}n=new MutationObserver(p=>{s||(mr(r)||r(c,p))&&d(p)}),n.observe(e,{childList:!0})}function i(){n&&n.disconnect(),s=!0}return{init:a,destroy:i}}function Ud(e,t,r,n){const s={};let a=null,i=null,l,c=!1;function d(){l=new IntersectionObserver(h=>{c||(h.forEach(x=>{const w=t.indexOf(x.target);s[w]=x}),a=null,i=null,r.emit("slidesInView"))},{root:e.parentElement,threshold:n}),t.forEach(h=>l.observe(h))}function p(){l&&l.disconnect(),c=!0}function u(h){return Vt(s).reduce((x,w)=>{const v=parseInt(w),{isIntersecting:y}=s[v];return(h&&y||!h&&!y)&&x.push(v),x},[])}function m(h=!0){if(h&&a)return a;if(!h&&i)return i;const x=u(h);return h&&(a=x),h||(i=x),x}return{init:d,destroy:p,get:m}}function Kd(e,t,r,n,s,a){const{measureSize:i,startEdge:l,endEdge:c}=e,d=r[0]&&s,p=h(),u=x(),m=r.map(i),f=w();function h(){if(!d)return 0;const y=r[0];return pe(t[l]-y[l])}function x(){if(!d)return 0;const y=a.getComputedStyle(Ue(n));return parseFloat(y.getPropertyValue(`margin-${c}`))}function w(){return r.map((y,j,k)=>{const S=!j,R=jn(k,j);return S?m[j]+p:R?m[j]+u:k[j+1][l]-y[l]}).map(pe)}return{slideSizes:m,slideSizesWithGaps:f,startGap:p,endGap:u}}function Xd(e,t,r,n,s,a,i,l,c){const{startEdge:d,endEdge:p,direction:u}=e,m=wn(r);function f(v,y){return Ft(v).filter(j=>j%y===0).map(j=>v.slice(j,j+y))}function h(v){return v.length?Ft(v).reduce((y,j,k)=>{const S=Ue(y)||0,R=S===0,_=j===Ot(v),C=s[d]-a[S][d],A=s[d]-a[j][p],L=!n&&R?u(i):0,N=!n&&_?u(l):0,$=pe(A-N-(C+L));return k&&$>t+c&&y.push(j),_&&y.push(v.length),y},[]).map((y,j,k)=>{const S=Math.max(k[j-1]||0);return v.slice(S,y)}):[]}function x(v){return m?f(v,r):h(v)}return{groupSlides:x}}function Yd(e,t,r,n,s,a,i){const{align:l,axis:c,direction:d,startIndex:p,loop:u,duration:m,dragFree:f,dragThreshold:h,inViewThreshold:x,slidesToScroll:w,skipSnaps:v,containScroll:y,watchResize:j,watchSlides:k,watchDrag:S,watchFocus:R}=a,_=2,C=Id(),A=C.measure(t),L=r.map(C.measure),N=_d(c,d),$=N.measureSize(A),I=Td($),M=Sd(l,$),H=!u&&!!y,D=u||!!y,{slideSizes:P,slideSizesWithGaps:E,startGap:oe,endGap:Z}=Kd(N,A,L,r,D,s),ae=Xd(N,$,w,u,A,L,oe,Z,_),{snaps:X,snapsAligned:z}=$d(N,M,A,L,ae),G=-Ue(X)+Ue(E),{snapsContained:Y,scrollContainLimit:ee}=Ad($,G,z,y,_),F=H?Y:z,{limit:B}=Fd(G,F,u),K=ka(Ot(F),p,u),te=K.clone(),ie=Ft(r),q=({dragHandler:_e,scrollBody:pt,scrollBounds:Ze,options:{loop:ht}})=>{ht||Ze.constrain(_e.pointerDown()),pt.seek()},ce=({scrollBody:_e,translate:pt,location:Ze,offsetLocation:ht,previousLocation:xr,scrollLooper:Ht,slideLooper:Gt,dragHandler:br,animation:Nt,eventHandler:He,scrollBounds:vr,options:{loop:qt}},Ct)=>{const kt=_e.settled(),se=!vr.shouldConstrain(),be=qt?kt:kt&&se,Ce=be&&!br.pointerDown();Ce&&Nt.stop();const Ie=Ze.get()*Ct+xr.get()*(1-Ct);ht.set(Ie),qt&&(Ht.loop(_e.direction()),Gt.loop()),pt.to(ht.get()),Ce&&He.emit("settle"),be||He.emit("scroll")},de=Rd(n,s,()=>q(Ye),_e=>ce(Ye,_e)),we=.68,Pe=F[K.get()],ye=Mt(Pe),$e=Mt(Pe),xe=Mt(Pe),Oe=Mt(Pe),Qe=Dd(ye,xe,$e,Oe,m,we),je=Od(u,F,G,B,Oe),Fe=Hd(de,K,te,Qe,je,Oe,i),gt=zd(B),O=zt(),ne=Ud(t,r,i,x),{slideRegistry:Ne}=Bd(H,y,F,ee,ae,ie),Xe=Gd(e,r,Ne,Fe,Qe,O,i,R),Ye={ownerDocument:n,ownerWindow:s,eventHandler:i,containerRect:A,slideRects:L,animation:de,axis:N,dragHandler:Md(N,e,n,s,Oe,Pd(N,s),ye,de,Fe,Qe,je,K,i,I,f,h,v,we,S),eventStore:O,percentOfView:I,index:K,indexPrevious:te,limit:B,location:ye,offsetLocation:xe,previousLocation:$e,options:a,resizeHandler:Ld(t,i,s,r,N,j,C),scrollBody:Qe,scrollBounds:Ed(B,xe,Oe,Qe,I),scrollLooper:Vd(G,B,xe,[ye,xe,$e,Oe]),scrollProgress:gt,scrollSnapList:F.map(gt.get),scrollSnaps:F,scrollTarget:je,scrollTo:Fe,slideLooper:qd(N,$,G,P,E,X,F,xe,r),slideFocus:Xe,slidesHandler:Wd(t,i,k),slidesInView:ne,slideIndexes:ie,slideRegistry:Ne,slidesToScroll:ae,target:Oe,translate:Sa(N,t)};return Ye}function Zd(){let e={},t;function r(d){t=d}function n(d){return e[d]||[]}function s(d){return n(d).forEach(p=>p(t,d)),c}function a(d,p){return e[d]=n(d).concat([p]),c}function i(d,p){return e[d]=n(d).filter(u=>u!==p),c}function l(){e={}}const c={init:r,emit:s,off:i,on:a,clear:l};return c}const Jd={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function Qd(e){function t(a,i){return Ca(a,i||{})}function r(a){const i=a.breakpoints||{},l=Vt(i).filter(c=>e.matchMedia(c).matches).map(c=>i[c]).reduce((c,d)=>t(c,d),{});return t(a,l)}function n(a){return a.map(i=>Vt(i.breakpoints||{})).reduce((i,l)=>i.concat(l),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:r,optionsMediaQueries:n}}function eu(e){let t=[];function r(a,i){return t=i.filter(({options:l})=>e.optionsAtMedia(l).active!==!1),t.forEach(l=>l.init(a,e)),i.reduce((l,c)=>Object.assign(l,{[c.name]:c}),{})}function n(){t=t.filter(a=>a.destroy())}return{init:r,destroy:n}}function sr(e,t,r){const n=e.ownerDocument,s=n.defaultView,a=Qd(s),i=eu(a),l=zt(),c=Zd(),{mergeOptions:d,optionsAtMedia:p,optionsMediaQueries:u}=a,{on:m,off:f,emit:h}=c,x=N;let w=!1,v,y=d(Jd,sr.globalOptions),j=d(y),k=[],S,R,_;function C(){const{container:ie,slides:q}=j;R=(Ar(ie)?e.querySelector(ie):ie)||e.children[0];const de=Ar(q)?R.querySelectorAll(q):q;_=[].slice.call(de||R.children)}function A(ie){const q=Yd(e,R,_,n,s,ie,c);if(ie.loop&&!q.slideLooper.canLoop()){const ce=Object.assign({},ie,{loop:!1});return A(ce)}return q}function L(ie,q){w||(y=d(y,ie),j=p(y),k=q||k,C(),v=A(j),u([y,...k.map(({options:ce})=>ce)]).forEach(ce=>l.add(ce,"change",N)),j.active&&(v.translate.to(v.location.get()),v.animation.init(),v.slidesInView.init(),v.slideFocus.init(te),v.eventHandler.init(te),v.resizeHandler.init(te),v.slidesHandler.init(te),v.options.loop&&v.slideLooper.loop(),R.offsetParent&&_.length&&v.dragHandler.init(te),S=i.init(te,k)))}function N(ie,q){const ce=ae();$(),L(d({startIndex:ce},ie),q),c.emit("reInit")}function $(){v.dragHandler.destroy(),v.eventStore.clear(),v.translate.clear(),v.slideLooper.clear(),v.resizeHandler.destroy(),v.slidesHandler.destroy(),v.slidesInView.destroy(),v.animation.destroy(),i.destroy(),l.clear()}function I(){w||(w=!0,l.clear(),$(),c.emit("destroy"),c.clear())}function M(ie,q,ce){!j.active||w||(v.scrollBody.useBaseFriction().useDuration(q===!0?0:j.duration),v.scrollTo.index(ie,ce||0))}function H(ie){const q=v.index.add(1).get();M(q,ie,-1)}function D(ie){const q=v.index.add(-1).get();M(q,ie,1)}function P(){return v.index.add(1).get()!==ae()}function E(){return v.index.add(-1).get()!==ae()}function oe(){return v.scrollSnapList}function Z(){return v.scrollProgress.get(v.offsetLocation.get())}function ae(){return v.index.get()}function X(){return v.indexPrevious.get()}function z(){return v.slidesInView.get()}function G(){return v.slidesInView.get(!1)}function Y(){return S}function ee(){return v}function F(){return e}function B(){return R}function K(){return _}const te={canScrollNext:P,canScrollPrev:E,containerNode:B,internalEngine:ee,destroy:I,off:f,on:m,emit:h,plugins:Y,previousScrollSnap:X,reInit:x,rootNode:F,scrollNext:H,scrollPrev:D,scrollProgress:Z,scrollSnapList:oe,scrollTo:M,selectedScrollSnap:ae,slideNodes:K,slidesInView:z,slidesNotInView:G};return L(t,r),setTimeout(()=>c.emit("init"),0),te}sr.globalOptions=void 0;function Nn(e={},t=[]){const r=V.useRef(e),n=V.useRef(t),[s,a]=V.useState(),[i,l]=V.useState(),c=V.useCallback(()=>{s&&s.reInit(r.current,n.current)},[s]);return V.useEffect(()=>{vn(r.current,e)||(r.current=e,c())},[e,c]),V.useEffect(()=>{Nd(n.current,t)||(n.current=t,c())},[t,c]),V.useEffect(()=>{if(jd()&&i){sr.globalOptions=Nn.globalOptions;const d=sr(i,r.current,n.current);return a(d),()=>d.destroy()}else a(void 0)},[i,a]),[l,s]}Nn.globalOptions=void 0;const Ra=g.createContext(null);function fr(){const e=g.useContext(Ra);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}const _a=g.forwardRef(({orientation:e="horizontal",opts:t,setApi:r,plugins:n,className:s,children:a,...i},l)=>{const[c,d]=Nn({...t,axis:e==="horizontal"?"x":"y"},n),[p,u]=g.useState(!1),[m,f]=g.useState(!1),h=g.useCallback(y=>{y&&(u(y.canScrollPrev()),f(y.canScrollNext()))},[]),x=g.useCallback(()=>{d==null||d.scrollPrev()},[d]),w=g.useCallback(()=>{d==null||d.scrollNext()},[d]),v=g.useCallback(y=>{y.key==="ArrowLeft"?(y.preventDefault(),x()):y.key==="ArrowRight"&&(y.preventDefault(),w())},[x,w]);return g.useEffect(()=>{!d||!r||r(d)},[d,r]),g.useEffect(()=>{if(d)return h(d),d.on("reInit",h),d.on("select",h),()=>{d==null||d.off("select",h)}},[d,h]),o.jsx(Ra.Provider,{value:{carouselRef:c,api:d,opts:t,orientation:e,scrollPrev:x,scrollNext:w,canScrollPrev:p,canScrollNext:m},children:o.jsx("div",{ref:l,onKeyDownCapture:v,className:b("relative",s),role:"region","aria-roledescription":"carousel",...i,children:a})})});_a.displayName="Carousel";const Ma=g.forwardRef(({className:e,...t},r)=>{const{carouselRef:n,orientation:s}=fr();return o.jsx("div",{ref:n,className:"overflow-hidden",children:o.jsx("div",{ref:r,className:b("flex",s==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});Ma.displayName="CarouselContent";const Pa=g.forwardRef(({className:e,...t},r)=>{const{orientation:n}=fr();return o.jsx("div",{ref:r,role:"group","aria-roledescription":"slide",className:b("min-w-0 shrink-0 grow-0 basis-full",n==="horizontal"?"pl-4":"pt-4",e),...t})});Pa.displayName="CarouselItem";const Ia=g.forwardRef(({className:e,variant:t="outline",size:r="icon",...n},s)=>{const{orientation:a,scrollPrev:i,canScrollPrev:l}=fr(),c=re();return o.jsxs(ve,{ref:s,variant:t,size:r,className:b("absolute h-8 w-8 rounded-full",a==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:i,...n,children:[o.jsx(T.ChevronLeft,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:c.carousel_previousSlide})]})});Ia.displayName="CarouselPrevious";const Ta=g.forwardRef(({className:e,variant:t="outline",size:r="icon",...n},s)=>{const{orientation:a,scrollNext:i,canScrollNext:l}=fr(),c=re();return o.jsxs(ve,{ref:s,variant:t,size:r,className:b("absolute h-8 w-8 rounded-full",a==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:i,...n,children:[o.jsx(T.ChevronRight,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:c.carousel_nextSlide})]})});Ta.displayName="CarouselNext";/**
|
|
13
13
|
* table-core
|
|
14
14
|
*
|
|
15
15
|
* Copyright (c) TanStack
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
* LICENSE.md file in the root directory of this source tree.
|
|
19
19
|
*
|
|
20
20
|
* @license MIT
|
|
21
|
-
*/function nt(e,t){return typeof e=="function"?e(t):e}function Ve(e,t){return r=>{t.setState(n=>({...n,[e]:nt(r,n[e])}))}}function gr(e){return e instanceof Function}function tu(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function ru(e,t){const r=[],n=s=>{s.forEach(a=>{r.push(a);const i=t(a);i!=null&&i.length&&n(i)})};return n(e),r}function J(e,t,r){let n=[],s;return a=>{let i;r.key&&r.debug&&(i=Date.now());const l=e(a);if(!(l.length!==n.length||l.some((
|
|
21
|
+
*/function nt(e,t){return typeof e=="function"?e(t):e}function Ve(e,t){return r=>{t.setState(n=>({...n,[e]:nt(r,n[e])}))}}function gr(e){return e instanceof Function}function tu(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function ru(e,t){const r=[],n=s=>{s.forEach(a=>{r.push(a);const i=t(a);i!=null&&i.length&&n(i)})};return n(e),r}function J(e,t,r){let n=[],s;return a=>{let i;r.key&&r.debug&&(i=Date.now());const l=e(a);if(!(l.length!==n.length||l.some((p,u)=>n[u]!==p)))return s;n=l;let d;if(r.key&&r.debug&&(d=Date.now()),s=t(...l),r==null||r.onChange==null||r.onChange(s),r.key&&r.debug&&r!=null&&r.debug()){const p=Math.round((Date.now()-i)*100)/100,u=Math.round((Date.now()-d)*100)/100,m=u/16,f=(h,x)=>{for(h=String(h);h.length<x;)h=" "+h;return h};console.info(`%c⏱ ${f(u,5)} /${f(p,5)} ms`,`
|
|
22
22
|
font-size: .6rem;
|
|
23
23
|
font-weight: bold;
|
|
24
|
-
color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,r==null?void 0:r.key)}return s}}function Q(e,t,r,n){return{debug:()=>{var s;return(s=e==null?void 0:e.debugAll)!=null?s:e[t]},key:process.env.NODE_ENV==="development"&&r,onChange:n}}function nu(e,t,r,n){const s=()=>{var i;return(i=a.getValue())!=null?i:e.options.renderFallbackValue},a={id:`${t.id}_${r.id}`,row:t,column:r,getValue:()=>t.getValue(n),renderValue:s,getContext:J(()=>[e,r,t,a],(i,l,c,d)=>({table:i,column:l,row:c,cell:d,getValue:d.getValue,renderValue:d.renderValue}),Q(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(a,r,t,e)},{}),a}function ou(e,t,r,n){var s,a;const l={...e._getDefaultColumnDef(),...t},c=l.accessorKey;let d=(s=(a=l.id)!=null?a:c?typeof String.prototype.replaceAll=="function"?c.replaceAll(".","_"):c.replace(/\./g,"_"):void 0)!=null?s:typeof l.header=="string"?l.header:void 0,g;if(l.accessorFn?g=l.accessorFn:c&&(c.includes(".")?g=f=>{let m=f;for(const x of c.split(".")){var h;m=(h=m)==null?void 0:h[x],process.env.NODE_ENV!=="production"&&m===void 0&&console.warn(`"${x}" in deeply nested key "${c}" returned undefined.`)}return m}:g=f=>f[l.accessorKey]),!d)throw process.env.NODE_ENV!=="production"?new Error(l.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let u={id:`${String(d)}`,accessorFn:g,parent:n,depth:r,columnDef:l,columns:[],getFlatColumns:J(()=>[!0],()=>{var f;return[u,...(f=u.columns)==null?void 0:f.flatMap(m=>m.getFlatColumns())]},Q(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:J(()=>[e._getOrderColumnsFn()],f=>{var m;if((m=u.columns)!=null&&m.length){let h=u.columns.flatMap(x=>x.getLeafColumns());return f(h)}return[u]},Q(e.options,"debugColumns","column.getLeafColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(u,e);return u}const Me="debugHeaders";function Un(e,t,r){var n;let a={id:(n=r.id)!=null?n:t.id,column:t,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],l=c=>{c.subHeaders&&c.subHeaders.length&&c.subHeaders.map(l),i.push(c)};return l(a),i},getContext:()=>({table:e,header:a,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(a,e)}),a}const su={createTable:e=>{e.getHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,n,s)=>{var a,i;const l=(a=n==null?void 0:n.map(u=>r.find(f=>f.id===u)).filter(Boolean))!=null?a:[],c=(i=s==null?void 0:s.map(u=>r.find(f=>f.id===u)).filter(Boolean))!=null?i:[],d=r.filter(u=>!(n!=null&&n.includes(u.id))&&!(s!=null&&s.includes(u.id)));return Jt(t,[...l,...d,...c],e)},Q(e.options,Me,"getHeaderGroups")),e.getCenterHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,n,s)=>(r=r.filter(a=>!(n!=null&&n.includes(a.id))&&!(s!=null&&s.includes(a.id))),Jt(t,r,e,"center")),Q(e.options,Me,"getCenterHeaderGroups")),e.getLeftHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,r,n)=>{var s;const a=(s=n==null?void 0:n.map(i=>r.find(l=>l.id===i)).filter(Boolean))!=null?s:[];return Jt(t,a,e,"left")},Q(e.options,Me,"getLeftHeaderGroups")),e.getRightHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,r,n)=>{var s;const a=(s=n==null?void 0:n.map(i=>r.find(l=>l.id===i)).filter(Boolean))!=null?s:[];return Jt(t,a,e,"right")},Q(e.options,Me,"getRightHeaderGroups")),e.getFooterGroups=J(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Q(e.options,Me,"getFooterGroups")),e.getLeftFooterGroups=J(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Q(e.options,Me,"getLeftFooterGroups")),e.getCenterFooterGroups=J(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Q(e.options,Me,"getCenterFooterGroups")),e.getRightFooterGroups=J(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Q(e.options,Me,"getRightFooterGroups")),e.getFlatHeaders=J(()=>[e.getHeaderGroups()],t=>t.map(r=>r.headers).flat(),Q(e.options,Me,"getFlatHeaders")),e.getLeftFlatHeaders=J(()=>[e.getLeftHeaderGroups()],t=>t.map(r=>r.headers).flat(),Q(e.options,Me,"getLeftFlatHeaders")),e.getCenterFlatHeaders=J(()=>[e.getCenterHeaderGroups()],t=>t.map(r=>r.headers).flat(),Q(e.options,Me,"getCenterFlatHeaders")),e.getRightFlatHeaders=J(()=>[e.getRightHeaderGroups()],t=>t.map(r=>r.headers).flat(),Q(e.options,Me,"getRightFlatHeaders")),e.getCenterLeafHeaders=J(()=>[e.getCenterFlatHeaders()],t=>t.filter(r=>{var n;return!((n=r.subHeaders)!=null&&n.length)}),Q(e.options,Me,"getCenterLeafHeaders")),e.getLeftLeafHeaders=J(()=>[e.getLeftFlatHeaders()],t=>t.filter(r=>{var n;return!((n=r.subHeaders)!=null&&n.length)}),Q(e.options,Me,"getLeftLeafHeaders")),e.getRightLeafHeaders=J(()=>[e.getRightFlatHeaders()],t=>t.filter(r=>{var n;return!((n=r.subHeaders)!=null&&n.length)}),Q(e.options,Me,"getRightLeafHeaders")),e.getLeafHeaders=J(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,r,n)=>{var s,a,i,l,c,d;return[...(s=(a=t[0])==null?void 0:a.headers)!=null?s:[],...(i=(l=r[0])==null?void 0:l.headers)!=null?i:[],...(c=(d=n[0])==null?void 0:d.headers)!=null?c:[]].map(g=>g.getLeafHeaders()).flat()},Q(e.options,Me,"getLeafHeaders"))}};function Jt(e,t,r,n){var s,a;let i=0;const l=function(f,m){m===void 0&&(m=1),i=Math.max(i,m),f.filter(h=>h.getIsVisible()).forEach(h=>{var x;(x=h.columns)!=null&&x.length&&l(h.columns,m+1)},0)};l(e);let c=[];const d=(f,m)=>{const h={depth:m,id:[n,`${m}`].filter(Boolean).join("_"),headers:[]},x=[];f.forEach(y=>{const w=[...x].reverse()[0],v=y.column.depth===h.depth;let j,R=!1;if(v&&y.column.parent?j=y.column.parent:(j=y.column,R=!0),w&&(w==null?void 0:w.column)===j)w.subHeaders.push(y);else{const M=Un(r,j,{id:[n,m,j.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:R,placeholderId:R?`${x.filter(C=>C.column===j).length}`:void 0,depth:m,index:x.length});M.subHeaders.push(y),x.push(M)}h.headers.push(y),y.headerGroup=h}),c.push(h),m>0&&d(x,m-1)},g=t.map((f,m)=>Un(r,f,{depth:i,index:m}));d(g,i-1),c.reverse();const u=f=>f.filter(h=>h.column.getIsVisible()).map(h=>{let x=0,y=0,w=[0];h.subHeaders&&h.subHeaders.length?(w=[],u(h.subHeaders).forEach(j=>{let{colSpan:R,rowSpan:M}=j;x+=R,w.push(M)})):x=1;const v=Math.min(...w);return y=y+v,h.colSpan=x,h.rowSpan=y,{colSpan:x,rowSpan:y}});return u((s=(a=c[0])==null?void 0:a.headers)!=null?s:[]),c}const Cn=(e,t,r,n,s,a,i)=>{let l={id:t,index:n,original:r,depth:s,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(l._valuesCache.hasOwnProperty(c))return l._valuesCache[c];const d=e.getColumn(c);if(d!=null&&d.accessorFn)return l._valuesCache[c]=d.accessorFn(l.original,n),l._valuesCache[c]},getUniqueValues:c=>{if(l._uniqueValuesCache.hasOwnProperty(c))return l._uniqueValuesCache[c];const d=e.getColumn(c);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(l._uniqueValuesCache[c]=d.columnDef.getUniqueValues(l.original,n),l._uniqueValuesCache[c]):(l._uniqueValuesCache[c]=[l.getValue(c)],l._uniqueValuesCache[c])},renderValue:c=>{var d;return(d=l.getValue(c))!=null?d:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>ru(l.subRows,c=>c.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let c=[],d=l;for(;;){const g=d.getParentRow();if(!g)break;c.push(g),d=g}return c.reverse()},getAllCells:J(()=>[e.getAllLeafColumns()],c=>c.map(d=>nu(e,l,d,d.id)),Q(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:J(()=>[l.getAllCells()],c=>c.reduce((d,g)=>(d[g.column.id]=g,d),{}),Q(e.options,"debugRows","getAllCellsByColumnId"))};for(let c=0;c<e._features.length;c++){const d=e._features[c];d==null||d.createRow==null||d.createRow(l,e)}return l},au={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},La=(e,t,r)=>{var n,s;const a=r==null||(n=r.toString())==null?void 0:n.toLowerCase();return!!(!((s=e.getValue(t))==null||(s=s.toString())==null||(s=s.toLowerCase())==null)&&s.includes(a))};La.autoRemove=e=>Ke(e);const Da=(e,t,r)=>{var n;return!!(!((n=e.getValue(t))==null||(n=n.toString())==null)&&n.includes(r))};Da.autoRemove=e=>Ke(e);const Ea=(e,t,r)=>{var n;return((n=e.getValue(t))==null||(n=n.toString())==null?void 0:n.toLowerCase())===(r==null?void 0:r.toLowerCase())};Ea.autoRemove=e=>Ke(e);const Aa=(e,t,r)=>{var n;return(n=e.getValue(t))==null?void 0:n.includes(r)};Aa.autoRemove=e=>Ke(e);const Fa=(e,t,r)=>!r.some(n=>{var s;return!((s=e.getValue(t))!=null&&s.includes(n))});Fa.autoRemove=e=>Ke(e)||!(e!=null&&e.length);const Va=(e,t,r)=>r.some(n=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(n)});Va.autoRemove=e=>Ke(e)||!(e!=null&&e.length);const za=(e,t,r)=>e.getValue(t)===r;za.autoRemove=e=>Ke(e);const $a=(e,t,r)=>e.getValue(t)==r;$a.autoRemove=e=>Ke(e);const kn=(e,t,r)=>{let[n,s]=r;const a=e.getValue(t);return a>=n&&a<=s};kn.resolveFilterValue=e=>{let[t,r]=e,n=typeof t!="number"?parseFloat(t):t,s=typeof r!="number"?parseFloat(r):r,a=t===null||Number.isNaN(n)?-1/0:n,i=r===null||Number.isNaN(s)?1/0:s;if(a>i){const l=a;a=i,i=l}return[a,i]};kn.autoRemove=e=>Ke(e)||Ke(e[0])&&Ke(e[1]);const tt={includesString:La,includesStringSensitive:Da,equalsString:Ea,arrIncludes:Aa,arrIncludesAll:Fa,arrIncludesSome:Va,equals:za,weakEquals:$a,inNumberRange:kn};function Ke(e){return e==null||e===""}const iu={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ve("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const r=t.getCoreRowModel().flatRows[0],n=r==null?void 0:r.getValue(e.id);return typeof n=="string"?tt.includesString:typeof n=="number"?tt.inNumberRange:typeof n=="boolean"||n!==null&&typeof n=="object"?tt.equals:Array.isArray(n)?tt.arrIncludes:tt.weakEquals},e.getFilterFn=()=>{var r,n;return gr(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(r=(n=t.options.filterFns)==null?void 0:n[e.columnDef.filterFn])!=null?r:tt[e.columnDef.filterFn]},e.getCanFilter=()=>{var r,n,s;return((r=e.columnDef.enableColumnFilter)!=null?r:!0)&&((n=t.options.enableColumnFilters)!=null?n:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var r;return(r=t.getState().columnFilters)==null||(r=r.find(n=>n.id===e.id))==null?void 0:r.value},e.getFilterIndex=()=>{var r,n;return(r=(n=t.getState().columnFilters)==null?void 0:n.findIndex(s=>s.id===e.id))!=null?r:-1},e.setFilterValue=r=>{t.setColumnFilters(n=>{const s=e.getFilterFn(),a=n==null?void 0:n.find(g=>g.id===e.id),i=nt(r,a?a.value:void 0);if(Kn(s,i,e)){var l;return(l=n==null?void 0:n.filter(g=>g.id!==e.id))!=null?l:[]}const c={id:e.id,value:i};if(a){var d;return(d=n==null?void 0:n.map(g=>g.id===e.id?c:g))!=null?d:[]}return n!=null&&n.length?[...n,c]:[c]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const r=e.getAllLeafColumns(),n=s=>{var a;return(a=nt(t,s))==null?void 0:a.filter(i=>{const l=r.find(c=>c.id===i.id);if(l){const c=l.getFilterFn();if(Kn(c,i.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(n)},e.resetColumnFilters=t=>{var r,n;e.setColumnFilters(t?[]:(r=(n=e.initialState)==null?void 0:n.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 Kn(e,t,r){return(e&&e.autoRemove?e.autoRemove(t,r):!1)||typeof t>"u"||typeof t=="string"&&!t}const lu=(e,t,r)=>r.reduce((n,s)=>{const a=s.getValue(e);return n+(typeof a=="number"?a:0)},0),cu=(e,t,r)=>{let n;return r.forEach(s=>{const a=s.getValue(e);a!=null&&(n>a||n===void 0&&a>=a)&&(n=a)}),n},du=(e,t,r)=>{let n;return r.forEach(s=>{const a=s.getValue(e);a!=null&&(n<a||n===void 0&&a>=a)&&(n=a)}),n},uu=(e,t,r)=>{let n,s;return r.forEach(a=>{const i=a.getValue(e);i!=null&&(n===void 0?i>=i&&(n=s=i):(n>i&&(n=i),s<i&&(s=i)))}),[n,s]},mu=(e,t)=>{let r=0,n=0;if(t.forEach(s=>{let a=s.getValue(e);a!=null&&(a=+a)>=a&&(++r,n+=a)}),r)return n/r},fu=(e,t)=>{if(!t.length)return;const r=t.map(a=>a.getValue(e));if(!tu(r))return;if(r.length===1)return r[0];const n=Math.floor(r.length/2),s=r.sort((a,i)=>a-i);return r.length%2!==0?s[n]:(s[n-1]+s[n])/2},gu=(e,t)=>Array.from(new Set(t.map(r=>r.getValue(e))).values()),pu=(e,t)=>new Set(t.map(r=>r.getValue(e))).size,hu=(e,t)=>t.length,Nr={sum:lu,min:cu,max:du,extent:uu,mean:mu,median:fu,unique:gu,uniqueCount:pu,count:hu},xu={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,r;return(t=(r=e.getValue())==null||r.toString==null?void 0:r.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Ve("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(r=>r!=null&&r.includes(e.id)?r.filter(n=>n!==e.id):[...r??[],e.id])},e.getCanGroup=()=>{var r,n;return((r=e.columnDef.enableGrouping)!=null?r:!0)&&((n=t.options.enableGrouping)!=null?n:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var r;return(r=t.getState().grouping)==null?void 0:r.includes(e.id)},e.getGroupedIndex=()=>{var r;return(r=t.getState().grouping)==null?void 0:r.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const r=e.getCanGroup();return()=>{r&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const r=t.getCoreRowModel().flatRows[0],n=r==null?void 0:r.getValue(e.id);if(typeof n=="number")return Nr.sum;if(Object.prototype.toString.call(n)==="[object Date]")return Nr.extent},e.getAggregationFn=()=>{var r,n;if(!e)throw new Error;return gr(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(r=(n=t.options.aggregationFns)==null?void 0:n[e.columnDef.aggregationFn])!=null?r:Nr[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var r,n;e.setGrouping(t?[]:(r=(n=e.initialState)==null?void 0:n.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,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=r=>{if(e._groupingValuesCache.hasOwnProperty(r))return e._groupingValuesCache[r];const n=t.getColumn(r);return n!=null&&n.columnDef.getGroupingValue?(e._groupingValuesCache[r]=n.columnDef.getGroupingValue(e.original),e._groupingValuesCache[r]):e.getValue(r)},e._groupingValuesCache={}},createCell:(e,t,r,n)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===r.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=r.subRows)!=null&&s.length)}}};function bu(e,t,r){if(!(t!=null&&t.length)||!r)return e;const n=e.filter(a=>!t.includes(a.id));return r==="remove"?n:[...t.map(a=>e.find(i=>i.id===a)).filter(Boolean),...n]}const vu={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ve("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=J(r=>[Lt(t,r)],r=>r.findIndex(n=>n.id===e.id),Q(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=r=>{var n;return((n=Lt(t,r)[0])==null?void 0:n.id)===e.id},e.getIsLastColumn=r=>{var n;const s=Lt(t,r);return((n=s[s.length-1])==null?void 0:n.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var r;e.setColumnOrder(t?[]:(r=e.initialState.columnOrder)!=null?r:[])},e._getOrderColumnsFn=J(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,r,n)=>s=>{let a=[];if(!(t!=null&&t.length))a=s;else{const i=[...t],l=[...s];for(;l.length&&i.length;){const c=i.shift(),d=l.findIndex(g=>g.id===c);d>-1&&a.push(l.splice(d,1)[0])}a=[...a,...l]}return bu(a,r,n)},Q(e.options,"debugTable","_getOrderColumnsFn"))}},Cr=()=>({left:[],right:[]}),wu={getInitialState:e=>({columnPinning:Cr(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ve("columnPinning",e)}),createColumn:(e,t)=>{e.pin=r=>{const n=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var a,i;if(r==="right"){var l,c;return{left:((l=s==null?void 0:s.left)!=null?l:[]).filter(u=>!(n!=null&&n.includes(u))),right:[...((c=s==null?void 0:s.right)!=null?c:[]).filter(u=>!(n!=null&&n.includes(u))),...n]}}if(r==="left"){var d,g;return{left:[...((d=s==null?void 0:s.left)!=null?d:[]).filter(u=>!(n!=null&&n.includes(u))),...n],right:((g=s==null?void 0:s.right)!=null?g:[]).filter(u=>!(n!=null&&n.includes(u)))}}return{left:((a=s==null?void 0:s.left)!=null?a:[]).filter(u=>!(n!=null&&n.includes(u))),right:((i=s==null?void 0:s.right)!=null?i:[]).filter(u=>!(n!=null&&n.includes(u)))}})},e.getCanPin=()=>e.getLeafColumns().some(n=>{var s,a,i;return((s=n.columnDef.enablePinning)!=null?s:!0)&&((a=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?a:!0)}),e.getIsPinned=()=>{const r=e.getLeafColumns().map(l=>l.id),{left:n,right:s}=t.getState().columnPinning,a=r.some(l=>n==null?void 0:n.includes(l)),i=r.some(l=>s==null?void 0:s.includes(l));return a?"left":i?"right":!1},e.getPinnedIndex=()=>{var r,n;const s=e.getIsPinned();return s?(r=(n=t.getState().columnPinning)==null||(n=n[s])==null?void 0:n.indexOf(e.id))!=null?r:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=J(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(r,n,s)=>{const a=[...n??[],...s??[]];return r.filter(i=>!a.includes(i.column.id))},Q(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=J(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(r,n)=>(n??[]).map(a=>r.find(i=>i.column.id===a)).filter(Boolean).map(a=>({...a,position:"left"})),Q(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=J(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(r,n)=>(n??[]).map(a=>r.find(i=>i.column.id===a)).filter(Boolean).map(a=>({...a,position:"right"})),Q(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var r,n;return e.setColumnPinning(t?Cr():(r=(n=e.initialState)==null?void 0:n.columnPinning)!=null?r:Cr())},e.getIsSomeColumnsPinned=t=>{var r;const n=e.getState().columnPinning;if(!t){var s,a;return!!((s=n.left)!=null&&s.length||(a=n.right)!=null&&a.length)}return!!((r=n[t])!=null&&r.length)},e.getLeftLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,r)=>(r??[]).map(n=>t.find(s=>s.id===n)).filter(Boolean),Q(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,r)=>(r??[]).map(n=>t.find(s=>s.id===n)).filter(Boolean),Q(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,n)=>{const s=[...r??[],...n??[]];return t.filter(a=>!s.includes(a.id))},Q(e.options,"debugColumns","getCenterLeafColumns"))}};function yu(e){return e||(typeof document<"u"?document:null)}const Qt={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},kr=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),ju={getDefaultColumnDef:()=>Qt,getInitialState:e=>({columnSizing:{},columnSizingInfo:kr(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ve("columnSizing",e),onColumnSizingInfoChange:Ve("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var r,n,s;const a=t.getState().columnSizing[e.id];return Math.min(Math.max((r=e.columnDef.minSize)!=null?r:Qt.minSize,(n=a??e.columnDef.size)!=null?n:Qt.size),(s=e.columnDef.maxSize)!=null?s:Qt.maxSize)},e.getStart=J(r=>[r,Lt(t,r),t.getState().columnSizing],(r,n)=>n.slice(0,e.getIndex(r)).reduce((s,a)=>s+a.getSize(),0),Q(t.options,"debugColumns","getStart")),e.getAfter=J(r=>[r,Lt(t,r),t.getState().columnSizing],(r,n)=>n.slice(e.getIndex(r)+1).reduce((s,a)=>s+a.getSize(),0),Q(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(r=>{let{[e.id]:n,...s}=r;return s})},e.getCanResize=()=>{var r,n;return((r=e.columnDef.enableResizing)!=null?r:!0)&&((n=t.options.enableColumnResizing)!=null?n:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let r=0;const n=s=>{if(s.subHeaders.length)s.subHeaders.forEach(n);else{var a;r+=(a=s.column.getSize())!=null?a:0}};return n(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 n=t.getColumn(e.column.id),s=n==null?void 0:n.getCanResize();return a=>{if(!n||!s||(a.persist==null||a.persist(),Sr(a)&&a.touches&&a.touches.length>1))return;const i=e.getSize(),l=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[n.id,n.getSize()]],c=Sr(a)?Math.round(a.touches[0].clientX):a.clientX,d={},g=(w,v)=>{typeof v=="number"&&(t.setColumnSizingInfo(j=>{var R,M;const C=t.options.columnResizeDirection==="rtl"?-1:1,k=(v-((R=j==null?void 0:j.startOffset)!=null?R:0))*C,N=Math.max(k/((M=j==null?void 0:j.startSize)!=null?M:0),-.999999);return j.columnSizingStart.forEach(S=>{let[_,D]=S;d[_]=Math.round(Math.max(D+D*N,0)*100)/100}),{...j,deltaOffset:k,deltaPercentage:N}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(j=>({...j,...d})))},u=w=>g("move",w),f=w=>{g("end",w),t.setColumnSizingInfo(v=>({...v,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},m=yu(r),h={moveHandler:w=>u(w.clientX),upHandler:w=>{m==null||m.removeEventListener("mousemove",h.moveHandler),m==null||m.removeEventListener("mouseup",h.upHandler),f(w.clientX)}},x={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),u(w.touches[0].clientX),!1),upHandler:w=>{var v;m==null||m.removeEventListener("touchmove",x.moveHandler),m==null||m.removeEventListener("touchend",x.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),f((v=w.touches[0])==null?void 0:v.clientX)}},y=Nu()?{passive:!1}:!1;Sr(a)?(m==null||m.addEventListener("touchmove",x.moveHandler,y),m==null||m.addEventListener("touchend",x.upHandler,y)):(m==null||m.addEventListener("mousemove",h.moveHandler,y),m==null||m.addEventListener("mouseup",h.upHandler,y)),t.setColumnSizingInfo(w=>({...w,startOffset:c,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:n.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var r;e.setColumnSizing(t?{}:(r=e.initialState.columnSizing)!=null?r:{})},e.resetHeaderSizeInfo=t=>{var r;e.setColumnSizingInfo(t?kr():(r=e.initialState.columnSizingInfo)!=null?r:kr())},e.getTotalSize=()=>{var t,r;return(t=(r=e.getHeaderGroups()[0])==null?void 0:r.headers.reduce((n,s)=>n+s.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,r;return(t=(r=e.getLeftHeaderGroups()[0])==null?void 0:r.headers.reduce((n,s)=>n+s.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,r;return(t=(r=e.getCenterHeaderGroups()[0])==null?void 0:r.headers.reduce((n,s)=>n+s.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,r;return(t=(r=e.getRightHeaderGroups()[0])==null?void 0:r.headers.reduce((n,s)=>n+s.getSize(),0))!=null?t:0}}};let er=null;function Nu(){if(typeof er=="boolean")return er;let e=!1;try{const t={get passive(){return e=!0,!1}},r=()=>{};window.addEventListener("test",r,t),window.removeEventListener("test",r)}catch{e=!1}return er=e,er}function Sr(e){return e.type==="touchstart"}const Cu={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ve("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=r=>{e.getCanHide()&&t.setColumnVisibility(n=>({...n,[e.id]:r??!e.getIsVisible()}))},e.getIsVisible=()=>{var r,n;const s=e.columns;return(r=s.length?s.some(a=>a.getIsVisible()):(n=t.getState().columnVisibility)==null?void 0:n[e.id])!=null?r:!0},e.getCanHide=()=>{var r,n;return((r=e.columnDef.enableHiding)!=null?r:!0)&&((n=t.options.enableHiding)!=null?n:!0)},e.getToggleVisibilityHandler=()=>r=>{e.toggleVisibility==null||e.toggleVisibility(r.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=J(()=>[e.getAllCells(),t.getState().columnVisibility],r=>r.filter(n=>n.column.getIsVisible()),Q(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=J(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(r,n,s)=>[...r,...n,...s],Q(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(r,n)=>J(()=>[n(),n().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(a=>a.getIsVisible==null?void 0:a.getIsVisible()),Q(e.options,"debugColumns",r));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=r=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(r),e.resetColumnVisibility=r=>{var n;e.setColumnVisibility(r?{}:(n=e.initialState.columnVisibility)!=null?n:{})},e.toggleAllColumnsVisible=r=>{var n;r=(n=r)!=null?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,a)=>({...s,[a.id]:r||!(a.getCanHide!=null&&a.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 n;e.toggleAllColumnsVisible((n=r.target)==null?void 0:n.checked)}}};function Lt(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const ku={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()}}},Su={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Ve("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var r;const n=(r=e.getCoreRowModel().flatRows[0])==null||(r=r._getAllCellsByColumnId()[t.id])==null?void 0:r.getValue();return typeof n=="string"||typeof n=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var r,n,s,a;return((r=e.columnDef.enableGlobalFilter)!=null?r:!0)&&((n=t.options.enableGlobalFilter)!=null?n:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((a=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?a:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>tt.includesString,e.getGlobalFilterFn=()=>{var t,r;const{globalFilterFn:n}=e.options;return gr(n)?n:n==="auto"?e.getGlobalAutoFilterFn():(t=(r=e.options.filterFns)==null?void 0:r[n])!=null?t:tt[n]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Ru={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ve("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,r=!1;e._autoResetExpanded=()=>{var n,s;if(!t){e._queue(()=>{t=!0});return}if((n=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?n:!e.options.manualExpanding){if(r)return;r=!0,e._queue(()=>{e.resetExpanded(),r=!1})}},e.setExpanded=n=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(n),e.toggleAllRowsExpanded=n=>{n??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=n=>{var s,a;e.setExpanded(n?{}:(s=(a=e.initialState)==null?void 0:a.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(n=>n.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>n=>{n.persist==null||n.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const n=e.getState().expanded;return n===!0||Object.values(n).some(Boolean)},e.getIsAllRowsExpanded=()=>{const n=e.getState().expanded;return typeof n=="boolean"?n===!0:!(!Object.keys(n).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let n=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(a=>{const i=a.split(".");n=Math.max(n,i.length)}),n},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,t)=>{e.toggleExpanded=r=>{t.setExpanded(n=>{var s;const a=n===!0?!0:!!(n!=null&&n[e.id]);let i={};if(n===!0?Object.keys(t.getRowModel().rowsById).forEach(l=>{i[l]=!0}):i=n,r=(s=r)!=null?s:!a,!a&&r)return{...i,[e.id]:!0};if(a&&!r){const{[e.id]:l,...c}=i;return c}return n})},e.getIsExpanded=()=>{var r;const n=t.getState().expanded;return!!((r=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?r:n===!0||n!=null&&n[e.id])},e.getCanExpand=()=>{var r,n,s;return(r=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?r:((n=t.options.enableExpanding)!=null?n:!0)&&!!((s=e.subRows)!=null&&s.length)},e.getIsAllParentsExpanded=()=>{let r=!0,n=e;for(;r&&n.parentId;)n=t.getRow(n.parentId,!0),r=n.getIsExpanded();return r},e.getToggleExpandedHandler=()=>{const r=e.getCanExpand();return()=>{r&&e.toggleExpanded()}}}},Vr=0,zr=10,Rr=()=>({pageIndex:Vr,pageSize:zr}),_u={getInitialState:e=>({...e,pagination:{...Rr(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ve("pagination",e)}),createTable:e=>{let t=!1,r=!1;e._autoResetPageIndex=()=>{var n,s;if(!t){e._queue(()=>{t=!0});return}if((n=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?n:!e.options.manualPagination){if(r)return;r=!0,e._queue(()=>{e.resetPageIndex(),r=!1})}},e.setPagination=n=>{const s=a=>nt(n,a);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=n=>{var s;e.setPagination(n?Rr():(s=e.initialState.pagination)!=null?s:Rr())},e.setPageIndex=n=>{e.setPagination(s=>{let a=nt(n,s.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return a=Math.max(0,Math.min(a,i)),{...s,pageIndex:a}})},e.resetPageIndex=n=>{var s,a;e.setPageIndex(n?Vr:(s=(a=e.initialState)==null||(a=a.pagination)==null?void 0:a.pageIndex)!=null?s:Vr)},e.resetPageSize=n=>{var s,a;e.setPageSize(n?zr:(s=(a=e.initialState)==null||(a=a.pagination)==null?void 0:a.pageSize)!=null?s:zr)},e.setPageSize=n=>{e.setPagination(s=>{const a=Math.max(1,nt(n,s.pageSize)),i=s.pageSize*s.pageIndex,l=Math.floor(i/a);return{...s,pageIndex:l,pageSize:a}})},e.setPageCount=n=>e.setPagination(s=>{var a;let i=nt(n,(a=e.options.pageCount)!=null?a:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...s,pageCount:i}}),e.getPageOptions=J(()=>[e.getPageCount()],n=>{let s=[];return n&&n>0&&(s=[...new Array(n)].fill(null).map((a,i)=>i)),s},Q(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:n}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:n<s-1},e.previousPage=()=>e.setPageIndex(n=>n-1),e.nextPage=()=>e.setPageIndex(n=>n+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 n;return(n=e.options.pageCount)!=null?n:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var n;return(n=e.options.rowCount)!=null?n:e.getPrePaginationRowModel().rows.length}}},_r=()=>({top:[],bottom:[]}),Mu={getInitialState:e=>({rowPinning:_r(),...e}),getDefaultOptions:e=>({onRowPinningChange:Ve("rowPinning",e)}),createRow:(e,t)=>{e.pin=(r,n,s)=>{const a=n?e.getLeafRows().map(c=>{let{id:d}=c;return d}):[],i=s?e.getParentRows().map(c=>{let{id:d}=c;return d}):[],l=new Set([...i,e.id,...a]);t.setRowPinning(c=>{var d,g;if(r==="bottom"){var u,f;return{top:((u=c==null?void 0:c.top)!=null?u:[]).filter(x=>!(l!=null&&l.has(x))),bottom:[...((f=c==null?void 0:c.bottom)!=null?f:[]).filter(x=>!(l!=null&&l.has(x))),...Array.from(l)]}}if(r==="top"){var m,h;return{top:[...((m=c==null?void 0:c.top)!=null?m:[]).filter(x=>!(l!=null&&l.has(x))),...Array.from(l)],bottom:((h=c==null?void 0:c.bottom)!=null?h:[]).filter(x=>!(l!=null&&l.has(x)))}}return{top:((d=c==null?void 0:c.top)!=null?d:[]).filter(x=>!(l!=null&&l.has(x))),bottom:((g=c==null?void 0:c.bottom)!=null?g:[]).filter(x=>!(l!=null&&l.has(x)))}})},e.getCanPin=()=>{var r;const{enableRowPinning:n,enablePinning:s}=t.options;return typeof n=="function"?n(e):(r=n??s)!=null?r:!0},e.getIsPinned=()=>{const r=[e.id],{top:n,bottom:s}=t.getState().rowPinning,a=r.some(l=>n==null?void 0:n.includes(l)),i=r.some(l=>s==null?void 0:s.includes(l));return a?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var r,n;const s=e.getIsPinned();if(!s)return-1;const a=(r=s==="top"?t.getTopRows():t.getBottomRows())==null?void 0:r.map(i=>{let{id:l}=i;return l});return(n=a==null?void 0:a.indexOf(e.id))!=null?n:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var r,n;return e.setRowPinning(t?_r():(r=(n=e.initialState)==null?void 0:n.rowPinning)!=null?r:_r())},e.getIsSomeRowsPinned=t=>{var r;const n=e.getState().rowPinning;if(!t){var s,a;return!!((s=n.top)!=null&&s.length||(a=n.bottom)!=null&&a.length)}return!!((r=n[t])!=null&&r.length)},e._getPinnedRows=(t,r,n)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(r??[]).map(i=>{const l=e.getRow(i,!0);return l.getIsAllParentsExpanded()?l:null}):(r??[]).map(i=>t.find(l=>l.id===i))).filter(Boolean).map(i=>({...i,position:n}))},e.getTopRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,r)=>e._getPinnedRows(t,r,"top"),Q(e.options,"debugRows","getTopRows")),e.getBottomRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,r)=>e._getPinnedRows(t,r,"bottom"),Q(e.options,"debugRows","getBottomRows")),e.getCenterRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,r,n)=>{const s=new Set([...r??[],...n??[]]);return t.filter(a=>!s.has(a.id))},Q(e.options,"debugRows","getCenterRows"))}},Pu={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ve("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var r;return e.setRowSelection(t?{}:(r=e.initialState.rowSelection)!=null?r:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(r=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const n={...r},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(a=>{a.getCanSelect()&&(n[a.id]=!0)}):s.forEach(a=>{delete n[a.id]}),n})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(r=>{const n=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...r};return e.getRowModel().rows.forEach(a=>{$r(s,a.id,n,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=J(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,r)=>Object.keys(t).length?Mr(e,r):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=J(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,r)=>Object.keys(t).length?Mr(e,r):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=J(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,r)=>Object.keys(t).length?Mr(e,r):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:r}=e.getState();let n=!!(t.length&&Object.keys(r).length);return n&&t.some(s=>s.getCanSelect()&&!r[s.id])&&(n=!1),n},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:r}=e.getState();let n=!!t.length;return n&&t.some(s=>!r[s.id])&&(n=!1),n},e.getIsSomeRowsSelected=()=>{var t;const r=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return r>0&&r<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(r=>r.getCanSelect()).some(r=>r.getIsSelected()||r.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(r,n)=>{const s=e.getIsSelected();t.setRowSelection(a=>{var i;if(r=typeof r<"u"?r:!s,e.getCanSelect()&&s===r)return a;const l={...a};return $r(l,e.id,r,(i=n==null?void 0:n.selectChildren)!=null?i:!0,t),l})},e.getIsSelected=()=>{const{rowSelection:r}=t.getState();return Sn(e,r)},e.getIsSomeSelected=()=>{const{rowSelection:r}=t.getState();return Br(e,r)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=t.getState();return Br(e,r)==="all"},e.getCanSelect=()=>{var r;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(r=t.options.enableRowSelection)!=null?r:!0},e.getCanSelectSubRows=()=>{var r;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(r=t.options.enableSubRowSelection)!=null?r:!0},e.getCanMultiSelect=()=>{var r;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(r=t.options.enableMultiRowSelection)!=null?r:!0},e.getToggleSelectedHandler=()=>{const r=e.getCanSelect();return n=>{var s;r&&e.toggleSelected((s=n.target)==null?void 0:s.checked)}}}},$r=(e,t,r,n,s)=>{var a;const i=s.getRow(t,!0);r?(i.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),i.getCanSelect()&&(e[t]=!0)):delete e[t],n&&(a=i.subRows)!=null&&a.length&&i.getCanSelectSubRows()&&i.subRows.forEach(l=>$r(e,l.id,r,n,s))};function Mr(e,t){const r=e.getState().rowSelection,n=[],s={},a=function(i,l){return i.map(c=>{var d;const g=Sn(c,r);if(g&&(n.push(c),s[c.id]=c),(d=c.subRows)!=null&&d.length&&(c={...c,subRows:a(c.subRows)}),g)return c}).filter(Boolean)};return{rows:a(t.rows),flatRows:n,rowsById:s}}function Sn(e,t){var r;return(r=t[e.id])!=null?r:!1}function Br(e,t,r){var n;if(!((n=e.subRows)!=null&&n.length))return!1;let s=!0,a=!1;return e.subRows.forEach(i=>{if(!(a&&!s)&&(i.getCanSelect()&&(Sn(i,t)?a=!0:s=!1),i.subRows&&i.subRows.length)){const l=Br(i,t);l==="all"?a=!0:(l==="some"&&(a=!0),s=!1)}}),s?"all":a?"some":!1}const Or=/([0-9]+)/gm,Iu=(e,t,r)=>Ba(ot(e.getValue(r)).toLowerCase(),ot(t.getValue(r)).toLowerCase()),Tu=(e,t,r)=>Ba(ot(e.getValue(r)),ot(t.getValue(r))),Lu=(e,t,r)=>Rn(ot(e.getValue(r)).toLowerCase(),ot(t.getValue(r)).toLowerCase()),Du=(e,t,r)=>Rn(ot(e.getValue(r)),ot(t.getValue(r))),Eu=(e,t,r)=>{const n=e.getValue(r),s=t.getValue(r);return n>s?1:n<s?-1:0},Au=(e,t,r)=>Rn(e.getValue(r),t.getValue(r));function Rn(e,t){return e===t?0:e>t?1:-1}function ot(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Ba(e,t){const r=e.split(Or).filter(Boolean),n=t.split(Or).filter(Boolean);for(;r.length&&n.length;){const s=r.shift(),a=n.shift(),i=parseInt(s,10),l=parseInt(a,10),c=[i,l].sort();if(isNaN(c[0])){if(s>a)return 1;if(a>s)return-1;continue}if(isNaN(c[1]))return isNaN(i)?-1:1;if(i>l)return 1;if(l>i)return-1}return r.length-n.length}const Rt={alphanumeric:Iu,alphanumericCaseSensitive:Tu,text:Lu,textCaseSensitive:Du,datetime:Eu,basic:Au},Fu={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Ve("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const r=t.getFilteredRowModel().flatRows.slice(10);let n=!1;for(const s of r){const a=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(a)==="[object Date]")return Rt.datetime;if(typeof a=="string"&&(n=!0,a.split(Or).length>1))return Rt.alphanumeric}return n?Rt.text:Rt.basic},e.getAutoSortDir=()=>{const r=t.getFilteredRowModel().flatRows[0];return typeof(r==null?void 0:r.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var r,n;if(!e)throw new Error;return gr(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(r=(n=t.options.sortingFns)==null?void 0:n[e.columnDef.sortingFn])!=null?r:Rt[e.columnDef.sortingFn]},e.toggleSorting=(r,n)=>{const s=e.getNextSortingOrder(),a=typeof r<"u"&&r!==null;t.setSorting(i=>{const l=i==null?void 0:i.find(m=>m.id===e.id),c=i==null?void 0:i.findIndex(m=>m.id===e.id);let d=[],g,u=a?r:s==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&n?l?g="toggle":g="add":i!=null&&i.length&&c!==i.length-1?g="replace":l?g="toggle":g="replace",g==="toggle"&&(a||s||(g="remove")),g==="add"){var f;d=[...i,{id:e.id,desc:u}],d.splice(0,d.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else g==="toggle"?d=i.map(m=>m.id===e.id?{...m,desc:u}:m):g==="remove"?d=i.filter(m=>m.id!==e.id):d=[{id:e.id,desc:u}];return d})},e.getFirstSortDir=()=>{var r,n;return((r=(n=e.columnDef.sortDescFirst)!=null?n:t.options.sortDescFirst)!=null?r:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=r=>{var n,s;const a=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==a&&((n=t.options.enableSortingRemoval)==null||n)&&(!(r&&(s=t.options.enableMultiRemove)!=null)||s)?!1:i==="desc"?"asc":"desc":a},e.getCanSort=()=>{var r,n;return((r=e.columnDef.enableSorting)!=null?r:!0)&&((n=t.options.enableSorting)!=null?n:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var r,n;return(r=(n=e.columnDef.enableMultiSort)!=null?n:t.options.enableMultiSort)!=null?r:!!e.accessorFn},e.getIsSorted=()=>{var r;const n=(r=t.getState().sorting)==null?void 0:r.find(s=>s.id===e.id);return n?n.desc?"desc":"asc":!1},e.getSortIndex=()=>{var r,n;return(r=(n=t.getState().sorting)==null?void 0:n.findIndex(s=>s.id===e.id))!=null?r:-1},e.clearSorting=()=>{t.setSorting(r=>r!=null&&r.length?r.filter(n=>n.id!==e.id):[])},e.getToggleSortingHandler=()=>{const r=e.getCanSort();return n=>{r&&(n.persist==null||n.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(n):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var r,n;e.setSorting(t?[]:(r=(n=e.initialState)==null?void 0:n.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())}},Vu=[su,Cu,vu,wu,au,iu,ku,Su,Fu,xu,Ru,_u,Mu,Pu,ju];function zu(e){var t,r;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const n=[...Vu,...(t=e._features)!=null?t:[]];let s={_features:n};const a=s._features.reduce((f,m)=>Object.assign(f,m.getDefaultOptions==null?void 0:m.getDefaultOptions(s)),{}),i=f=>s.options.mergeOptions?s.options.mergeOptions(a,f):{...a,...f};let c={...{},...(r=e.initialState)!=null?r:{}};s._features.forEach(f=>{var m;c=(m=f.getInitialState==null?void 0:f.getInitialState(c))!=null?m:c});const d=[];let g=!1;const u={_features:n,options:{...a,...e},initialState:c,_queue:f=>{d.push(f),g||(g=!0,Promise.resolve().then(()=>{for(;d.length;)d.shift()();g=!1}).catch(m=>setTimeout(()=>{throw m})))},reset:()=>{s.setState(s.initialState)},setOptions:f=>{const m=nt(f,s.options);s.options=i(m)},getState:()=>s.options.state,setState:f=>{s.options.onStateChange==null||s.options.onStateChange(f)},_getRowId:(f,m,h)=>{var x;return(x=s.options.getRowId==null?void 0:s.options.getRowId(f,m,h))!=null?x:`${h?[h.id,m].join("."):m}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(f,m)=>{let h=(m?s.getPrePaginationRowModel():s.getRowModel()).rowsById[f];if(!h&&(h=s.getCoreRowModel().rowsById[f],!h))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${f}`):new Error;return h},_getDefaultColumnDef:J(()=>[s.options.defaultColumn],f=>{var m;return f=(m=f)!=null?m:{},{header:h=>{const x=h.header.column.columnDef;return x.accessorKey?x.accessorKey:x.accessorFn?x.id:null},cell:h=>{var x,y;return(x=(y=h.renderValue())==null||y.toString==null?void 0:y.toString())!=null?x:null},...s._features.reduce((h,x)=>Object.assign(h,x.getDefaultColumnDef==null?void 0:x.getDefaultColumnDef()),{}),...f}},Q(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>s.options.columns,getAllColumns:J(()=>[s._getColumnDefs()],f=>{const m=function(h,x,y){return y===void 0&&(y=0),h.map(w=>{const v=ou(s,w,y,x),j=w;return v.columns=j.columns?m(j.columns,v,y+1):[],v})};return m(f)},Q(e,"debugColumns","getAllColumns")),getAllFlatColumns:J(()=>[s.getAllColumns()],f=>f.flatMap(m=>m.getFlatColumns()),Q(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:J(()=>[s.getAllFlatColumns()],f=>f.reduce((m,h)=>(m[h.id]=h,m),{}),Q(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:J(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(f,m)=>{let h=f.flatMap(x=>x.getLeafColumns());return m(h)},Q(e,"debugColumns","getAllLeafColumns")),getColumn:f=>{const m=s._getAllFlatColumnsById()[f];return process.env.NODE_ENV!=="production"&&!m&&console.error(`[Table] Column with id '${f}' does not exist.`),m}};Object.assign(s,u);for(let f=0;f<s._features.length;f++){const m=s._features[f];m==null||m.createTable==null||m.createTable(s)}return s}function $u(){return e=>J(()=>[e.options.data],t=>{const r={rows:[],flatRows:[],rowsById:{}},n=function(s,a,i){a===void 0&&(a=0);const l=[];for(let d=0;d<s.length;d++){const g=Cn(e,e._getRowId(s[d],d,i),s[d],d,a,void 0,i==null?void 0:i.id);if(r.flatRows.push(g),r.rowsById[g.id]=g,l.push(g),e.options.getSubRows){var c;g.originalSubRows=e.options.getSubRows(s[d],d),(c=g.originalSubRows)!=null&&c.length&&(g.subRows=n(g.originalSubRows,a+1,g))}}return l};return r.rows=n(t),r},Q(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Bu(e){const t=[],r=n=>{var s;t.push(n),(s=n.subRows)!=null&&s.length&&n.getIsExpanded()&&n.subRows.forEach(r)};return e.rows.forEach(r),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Ou(e,t,r){return r.options.filterFromLeafRows?Hu(e,t,r):Gu(e,t,r)}function Hu(e,t,r){var n;const s=[],a={},i=(n=r.options.maxLeafRowFilterDepth)!=null?n:100,l=function(c,d){d===void 0&&(d=0);const g=[];for(let f=0;f<c.length;f++){var u;let m=c[f];const h=Cn(r,m.id,m.original,m.index,m.depth,void 0,m.parentId);if(h.columnFilters=m.columnFilters,(u=m.subRows)!=null&&u.length&&d<i){if(h.subRows=l(m.subRows,d+1),m=h,t(m)&&!h.subRows.length){g.push(m),a[m.id]=m,s.push(m);continue}if(t(m)||h.subRows.length){g.push(m),a[m.id]=m,s.push(m);continue}}else m=h,t(m)&&(g.push(m),a[m.id]=m,s.push(m))}return g};return{rows:l(e),flatRows:s,rowsById:a}}function Gu(e,t,r){var n;const s=[],a={},i=(n=r.options.maxLeafRowFilterDepth)!=null?n:100,l=function(c,d){d===void 0&&(d=0);const g=[];for(let f=0;f<c.length;f++){let m=c[f];if(t(m)){var u;if((u=m.subRows)!=null&&u.length&&d<i){const x=Cn(r,m.id,m.original,m.index,m.depth,void 0,m.parentId);x.subRows=l(m.subRows,d+1),m=x}g.push(m),s.push(m),a[m.id]=m}}return g};return{rows:l(e),flatRows:s,rowsById:a}}function qu(){return e=>J(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,r,n)=>{if(!t.rows.length||!(r!=null&&r.length)&&!n){for(let f=0;f<t.flatRows.length;f++)t.flatRows[f].columnFilters={},t.flatRows[f].columnFiltersMeta={};return t}const s=[],a=[];(r??[]).forEach(f=>{var m;const h=e.getColumn(f.id);if(!h)return;const x=h.getFilterFn();if(!x){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${h.id}.`);return}s.push({id:f.id,filterFn:x,resolvedValue:(m=x.resolveFilterValue==null?void 0:x.resolveFilterValue(f.value))!=null?m:f.value})});const i=(r??[]).map(f=>f.id),l=e.getGlobalFilterFn(),c=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());n&&l&&c.length&&(i.push("__global__"),c.forEach(f=>{var m;a.push({id:f.id,filterFn:l,resolvedValue:(m=l.resolveFilterValue==null?void 0:l.resolveFilterValue(n))!=null?m:n})}));let d,g;for(let f=0;f<t.flatRows.length;f++){const m=t.flatRows[f];if(m.columnFilters={},s.length)for(let h=0;h<s.length;h++){d=s[h];const x=d.id;m.columnFilters[x]=d.filterFn(m,x,d.resolvedValue,y=>{m.columnFiltersMeta[x]=y})}if(a.length){for(let h=0;h<a.length;h++){g=a[h];const x=g.id;if(g.filterFn(m,x,g.resolvedValue,y=>{m.columnFiltersMeta[x]=y})){m.columnFilters.__global__=!0;break}}m.columnFilters.__global__!==!0&&(m.columnFilters.__global__=!1)}}const u=f=>{for(let m=0;m<i.length;m++)if(f.columnFilters[i[m]]===!1)return!1;return!0};return Ou(t.rows,u,e)},Q(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Wu(e){return t=>J(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(r,n)=>{if(!n.rows.length)return n;const{pageSize:s,pageIndex:a}=r;let{rows:i,flatRows:l,rowsById:c}=n;const d=s*a,g=d+s;i=i.slice(d,g);let u;t.options.paginateExpandedRows?u={rows:i,flatRows:l,rowsById:c}:u=Bu({rows:i,flatRows:l,rowsById:c}),u.flatRows=[];const f=m=>{u.flatRows.push(m),m.subRows.length&&m.subRows.forEach(f)};return u.rows.forEach(f),u},Q(t.options,"debugTable","getPaginationRowModel"))}function Uu(){return e=>J(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,r)=>{if(!r.rows.length||!(t!=null&&t.length))return r;const n=e.getState().sorting,s=[],a=n.filter(c=>{var d;return(d=e.getColumn(c.id))==null?void 0:d.getCanSort()}),i={};a.forEach(c=>{const d=e.getColumn(c.id);d&&(i[c.id]={sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortingFn:d.getSortingFn()})});const l=c=>{const d=c.map(g=>({...g}));return d.sort((g,u)=>{for(let m=0;m<a.length;m+=1){var f;const h=a[m],x=i[h.id],y=x.sortUndefined,w=(f=h==null?void 0:h.desc)!=null?f:!1;let v=0;if(y){const j=g.getValue(h.id),R=u.getValue(h.id),M=j===void 0,C=R===void 0;if(M||C){if(y==="first")return M?-1:1;if(y==="last")return M?1:-1;v=M&&C?0:M?y:-y}}if(v===0&&(v=x.sortingFn(g,u,h.id)),v!==0)return w&&(v*=-1),x.invertSorting&&(v*=-1),v}return g.index-u.index}),d.forEach(g=>{var u;s.push(g),(u=g.subRows)!=null&&u.length&&(g.subRows=l(g.subRows))}),d};return{rows:l(r.rows),flatRows:s,rowsById:r.rowsById}},Q(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
24
|
+
color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,r==null?void 0:r.key)}return s}}function Q(e,t,r,n){return{debug:()=>{var s;return(s=e==null?void 0:e.debugAll)!=null?s:e[t]},key:process.env.NODE_ENV==="development"&&r,onChange:n}}function nu(e,t,r,n){const s=()=>{var i;return(i=a.getValue())!=null?i:e.options.renderFallbackValue},a={id:`${t.id}_${r.id}`,row:t,column:r,getValue:()=>t.getValue(n),renderValue:s,getContext:J(()=>[e,r,t,a],(i,l,c,d)=>({table:i,column:l,row:c,cell:d,getValue:d.getValue,renderValue:d.renderValue}),Q(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(a,r,t,e)},{}),a}function ou(e,t,r,n){var s,a;const l={...e._getDefaultColumnDef(),...t},c=l.accessorKey;let d=(s=(a=l.id)!=null?a:c?typeof String.prototype.replaceAll=="function"?c.replaceAll(".","_"):c.replace(/\./g,"_"):void 0)!=null?s:typeof l.header=="string"?l.header:void 0,p;if(l.accessorFn?p=l.accessorFn:c&&(c.includes(".")?p=m=>{let f=m;for(const x of c.split(".")){var h;f=(h=f)==null?void 0:h[x],process.env.NODE_ENV!=="production"&&f===void 0&&console.warn(`"${x}" in deeply nested key "${c}" returned undefined.`)}return f}:p=m=>m[l.accessorKey]),!d)throw process.env.NODE_ENV!=="production"?new Error(l.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let u={id:`${String(d)}`,accessorFn:p,parent:n,depth:r,columnDef:l,columns:[],getFlatColumns:J(()=>[!0],()=>{var m;return[u,...(m=u.columns)==null?void 0:m.flatMap(f=>f.getFlatColumns())]},Q(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:J(()=>[e._getOrderColumnsFn()],m=>{var f;if((f=u.columns)!=null&&f.length){let h=u.columns.flatMap(x=>x.getLeafColumns());return m(h)}return[u]},Q(e.options,"debugColumns","column.getLeafColumns"))};for(const m of e._features)m.createColumn==null||m.createColumn(u,e);return u}const Me="debugHeaders";function Un(e,t,r){var n;let a={id:(n=r.id)!=null?n:t.id,column:t,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],l=c=>{c.subHeaders&&c.subHeaders.length&&c.subHeaders.map(l),i.push(c)};return l(a),i},getContext:()=>({table:e,header:a,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(a,e)}),a}const su={createTable:e=>{e.getHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,n,s)=>{var a,i;const l=(a=n==null?void 0:n.map(u=>r.find(m=>m.id===u)).filter(Boolean))!=null?a:[],c=(i=s==null?void 0:s.map(u=>r.find(m=>m.id===u)).filter(Boolean))!=null?i:[],d=r.filter(u=>!(n!=null&&n.includes(u.id))&&!(s!=null&&s.includes(u.id)));return Jt(t,[...l,...d,...c],e)},Q(e.options,Me,"getHeaderGroups")),e.getCenterHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,n,s)=>(r=r.filter(a=>!(n!=null&&n.includes(a.id))&&!(s!=null&&s.includes(a.id))),Jt(t,r,e,"center")),Q(e.options,Me,"getCenterHeaderGroups")),e.getLeftHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,r,n)=>{var s;const a=(s=n==null?void 0:n.map(i=>r.find(l=>l.id===i)).filter(Boolean))!=null?s:[];return Jt(t,a,e,"left")},Q(e.options,Me,"getLeftHeaderGroups")),e.getRightHeaderGroups=J(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,r,n)=>{var s;const a=(s=n==null?void 0:n.map(i=>r.find(l=>l.id===i)).filter(Boolean))!=null?s:[];return Jt(t,a,e,"right")},Q(e.options,Me,"getRightHeaderGroups")),e.getFooterGroups=J(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Q(e.options,Me,"getFooterGroups")),e.getLeftFooterGroups=J(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Q(e.options,Me,"getLeftFooterGroups")),e.getCenterFooterGroups=J(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Q(e.options,Me,"getCenterFooterGroups")),e.getRightFooterGroups=J(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Q(e.options,Me,"getRightFooterGroups")),e.getFlatHeaders=J(()=>[e.getHeaderGroups()],t=>t.map(r=>r.headers).flat(),Q(e.options,Me,"getFlatHeaders")),e.getLeftFlatHeaders=J(()=>[e.getLeftHeaderGroups()],t=>t.map(r=>r.headers).flat(),Q(e.options,Me,"getLeftFlatHeaders")),e.getCenterFlatHeaders=J(()=>[e.getCenterHeaderGroups()],t=>t.map(r=>r.headers).flat(),Q(e.options,Me,"getCenterFlatHeaders")),e.getRightFlatHeaders=J(()=>[e.getRightHeaderGroups()],t=>t.map(r=>r.headers).flat(),Q(e.options,Me,"getRightFlatHeaders")),e.getCenterLeafHeaders=J(()=>[e.getCenterFlatHeaders()],t=>t.filter(r=>{var n;return!((n=r.subHeaders)!=null&&n.length)}),Q(e.options,Me,"getCenterLeafHeaders")),e.getLeftLeafHeaders=J(()=>[e.getLeftFlatHeaders()],t=>t.filter(r=>{var n;return!((n=r.subHeaders)!=null&&n.length)}),Q(e.options,Me,"getLeftLeafHeaders")),e.getRightLeafHeaders=J(()=>[e.getRightFlatHeaders()],t=>t.filter(r=>{var n;return!((n=r.subHeaders)!=null&&n.length)}),Q(e.options,Me,"getRightLeafHeaders")),e.getLeafHeaders=J(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,r,n)=>{var s,a,i,l,c,d;return[...(s=(a=t[0])==null?void 0:a.headers)!=null?s:[],...(i=(l=r[0])==null?void 0:l.headers)!=null?i:[],...(c=(d=n[0])==null?void 0:d.headers)!=null?c:[]].map(p=>p.getLeafHeaders()).flat()},Q(e.options,Me,"getLeafHeaders"))}};function Jt(e,t,r,n){var s,a;let i=0;const l=function(m,f){f===void 0&&(f=1),i=Math.max(i,f),m.filter(h=>h.getIsVisible()).forEach(h=>{var x;(x=h.columns)!=null&&x.length&&l(h.columns,f+1)},0)};l(e);let c=[];const d=(m,f)=>{const h={depth:f,id:[n,`${f}`].filter(Boolean).join("_"),headers:[]},x=[];m.forEach(w=>{const v=[...x].reverse()[0],y=w.column.depth===h.depth;let j,k=!1;if(y&&w.column.parent?j=w.column.parent:(j=w.column,k=!0),v&&(v==null?void 0:v.column)===j)v.subHeaders.push(w);else{const S=Un(r,j,{id:[n,f,j.id,w==null?void 0:w.id].filter(Boolean).join("_"),isPlaceholder:k,placeholderId:k?`${x.filter(R=>R.column===j).length}`:void 0,depth:f,index:x.length});S.subHeaders.push(w),x.push(S)}h.headers.push(w),w.headerGroup=h}),c.push(h),f>0&&d(x,f-1)},p=t.map((m,f)=>Un(r,m,{depth:i,index:f}));d(p,i-1),c.reverse();const u=m=>m.filter(h=>h.column.getIsVisible()).map(h=>{let x=0,w=0,v=[0];h.subHeaders&&h.subHeaders.length?(v=[],u(h.subHeaders).forEach(j=>{let{colSpan:k,rowSpan:S}=j;x+=k,v.push(S)})):x=1;const y=Math.min(...v);return w=w+y,h.colSpan=x,h.rowSpan=w,{colSpan:x,rowSpan:w}});return u((s=(a=c[0])==null?void 0:a.headers)!=null?s:[]),c}const Cn=(e,t,r,n,s,a,i)=>{let l={id:t,index:n,original:r,depth:s,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(l._valuesCache.hasOwnProperty(c))return l._valuesCache[c];const d=e.getColumn(c);if(d!=null&&d.accessorFn)return l._valuesCache[c]=d.accessorFn(l.original,n),l._valuesCache[c]},getUniqueValues:c=>{if(l._uniqueValuesCache.hasOwnProperty(c))return l._uniqueValuesCache[c];const d=e.getColumn(c);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(l._uniqueValuesCache[c]=d.columnDef.getUniqueValues(l.original,n),l._uniqueValuesCache[c]):(l._uniqueValuesCache[c]=[l.getValue(c)],l._uniqueValuesCache[c])},renderValue:c=>{var d;return(d=l.getValue(c))!=null?d:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>ru(l.subRows,c=>c.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let c=[],d=l;for(;;){const p=d.getParentRow();if(!p)break;c.push(p),d=p}return c.reverse()},getAllCells:J(()=>[e.getAllLeafColumns()],c=>c.map(d=>nu(e,l,d,d.id)),Q(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:J(()=>[l.getAllCells()],c=>c.reduce((d,p)=>(d[p.column.id]=p,d),{}),Q(e.options,"debugRows","getAllCellsByColumnId"))};for(let c=0;c<e._features.length;c++){const d=e._features[c];d==null||d.createRow==null||d.createRow(l,e)}return l},au={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},La=(e,t,r)=>{var n,s;const a=r==null||(n=r.toString())==null?void 0:n.toLowerCase();return!!(!((s=e.getValue(t))==null||(s=s.toString())==null||(s=s.toLowerCase())==null)&&s.includes(a))};La.autoRemove=e=>Ke(e);const Da=(e,t,r)=>{var n;return!!(!((n=e.getValue(t))==null||(n=n.toString())==null)&&n.includes(r))};Da.autoRemove=e=>Ke(e);const Ea=(e,t,r)=>{var n;return((n=e.getValue(t))==null||(n=n.toString())==null?void 0:n.toLowerCase())===(r==null?void 0:r.toLowerCase())};Ea.autoRemove=e=>Ke(e);const Aa=(e,t,r)=>{var n;return(n=e.getValue(t))==null?void 0:n.includes(r)};Aa.autoRemove=e=>Ke(e);const Fa=(e,t,r)=>!r.some(n=>{var s;return!((s=e.getValue(t))!=null&&s.includes(n))});Fa.autoRemove=e=>Ke(e)||!(e!=null&&e.length);const Va=(e,t,r)=>r.some(n=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(n)});Va.autoRemove=e=>Ke(e)||!(e!=null&&e.length);const za=(e,t,r)=>e.getValue(t)===r;za.autoRemove=e=>Ke(e);const $a=(e,t,r)=>e.getValue(t)==r;$a.autoRemove=e=>Ke(e);const kn=(e,t,r)=>{let[n,s]=r;const a=e.getValue(t);return a>=n&&a<=s};kn.resolveFilterValue=e=>{let[t,r]=e,n=typeof t!="number"?parseFloat(t):t,s=typeof r!="number"?parseFloat(r):r,a=t===null||Number.isNaN(n)?-1/0:n,i=r===null||Number.isNaN(s)?1/0:s;if(a>i){const l=a;a=i,i=l}return[a,i]};kn.autoRemove=e=>Ke(e)||Ke(e[0])&&Ke(e[1]);const tt={includesString:La,includesStringSensitive:Da,equalsString:Ea,arrIncludes:Aa,arrIncludesAll:Fa,arrIncludesSome:Va,equals:za,weakEquals:$a,inNumberRange:kn};function Ke(e){return e==null||e===""}const iu={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ve("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const r=t.getCoreRowModel().flatRows[0],n=r==null?void 0:r.getValue(e.id);return typeof n=="string"?tt.includesString:typeof n=="number"?tt.inNumberRange:typeof n=="boolean"||n!==null&&typeof n=="object"?tt.equals:Array.isArray(n)?tt.arrIncludes:tt.weakEquals},e.getFilterFn=()=>{var r,n;return gr(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(r=(n=t.options.filterFns)==null?void 0:n[e.columnDef.filterFn])!=null?r:tt[e.columnDef.filterFn]},e.getCanFilter=()=>{var r,n,s;return((r=e.columnDef.enableColumnFilter)!=null?r:!0)&&((n=t.options.enableColumnFilters)!=null?n:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var r;return(r=t.getState().columnFilters)==null||(r=r.find(n=>n.id===e.id))==null?void 0:r.value},e.getFilterIndex=()=>{var r,n;return(r=(n=t.getState().columnFilters)==null?void 0:n.findIndex(s=>s.id===e.id))!=null?r:-1},e.setFilterValue=r=>{t.setColumnFilters(n=>{const s=e.getFilterFn(),a=n==null?void 0:n.find(p=>p.id===e.id),i=nt(r,a?a.value:void 0);if(Kn(s,i,e)){var l;return(l=n==null?void 0:n.filter(p=>p.id!==e.id))!=null?l:[]}const c={id:e.id,value:i};if(a){var d;return(d=n==null?void 0:n.map(p=>p.id===e.id?c:p))!=null?d:[]}return n!=null&&n.length?[...n,c]:[c]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const r=e.getAllLeafColumns(),n=s=>{var a;return(a=nt(t,s))==null?void 0:a.filter(i=>{const l=r.find(c=>c.id===i.id);if(l){const c=l.getFilterFn();if(Kn(c,i.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(n)},e.resetColumnFilters=t=>{var r,n;e.setColumnFilters(t?[]:(r=(n=e.initialState)==null?void 0:n.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 Kn(e,t,r){return(e&&e.autoRemove?e.autoRemove(t,r):!1)||typeof t>"u"||typeof t=="string"&&!t}const lu=(e,t,r)=>r.reduce((n,s)=>{const a=s.getValue(e);return n+(typeof a=="number"?a:0)},0),cu=(e,t,r)=>{let n;return r.forEach(s=>{const a=s.getValue(e);a!=null&&(n>a||n===void 0&&a>=a)&&(n=a)}),n},du=(e,t,r)=>{let n;return r.forEach(s=>{const a=s.getValue(e);a!=null&&(n<a||n===void 0&&a>=a)&&(n=a)}),n},uu=(e,t,r)=>{let n,s;return r.forEach(a=>{const i=a.getValue(e);i!=null&&(n===void 0?i>=i&&(n=s=i):(n>i&&(n=i),s<i&&(s=i)))}),[n,s]},mu=(e,t)=>{let r=0,n=0;if(t.forEach(s=>{let a=s.getValue(e);a!=null&&(a=+a)>=a&&(++r,n+=a)}),r)return n/r},fu=(e,t)=>{if(!t.length)return;const r=t.map(a=>a.getValue(e));if(!tu(r))return;if(r.length===1)return r[0];const n=Math.floor(r.length/2),s=r.sort((a,i)=>a-i);return r.length%2!==0?s[n]:(s[n-1]+s[n])/2},gu=(e,t)=>Array.from(new Set(t.map(r=>r.getValue(e))).values()),pu=(e,t)=>new Set(t.map(r=>r.getValue(e))).size,hu=(e,t)=>t.length,Nr={sum:lu,min:cu,max:du,extent:uu,mean:mu,median:fu,unique:gu,uniqueCount:pu,count:hu},xu={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,r;return(t=(r=e.getValue())==null||r.toString==null?void 0:r.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Ve("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(r=>r!=null&&r.includes(e.id)?r.filter(n=>n!==e.id):[...r??[],e.id])},e.getCanGroup=()=>{var r,n;return((r=e.columnDef.enableGrouping)!=null?r:!0)&&((n=t.options.enableGrouping)!=null?n:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var r;return(r=t.getState().grouping)==null?void 0:r.includes(e.id)},e.getGroupedIndex=()=>{var r;return(r=t.getState().grouping)==null?void 0:r.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const r=e.getCanGroup();return()=>{r&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const r=t.getCoreRowModel().flatRows[0],n=r==null?void 0:r.getValue(e.id);if(typeof n=="number")return Nr.sum;if(Object.prototype.toString.call(n)==="[object Date]")return Nr.extent},e.getAggregationFn=()=>{var r,n;if(!e)throw new Error;return gr(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(r=(n=t.options.aggregationFns)==null?void 0:n[e.columnDef.aggregationFn])!=null?r:Nr[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var r,n;e.setGrouping(t?[]:(r=(n=e.initialState)==null?void 0:n.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,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=r=>{if(e._groupingValuesCache.hasOwnProperty(r))return e._groupingValuesCache[r];const n=t.getColumn(r);return n!=null&&n.columnDef.getGroupingValue?(e._groupingValuesCache[r]=n.columnDef.getGroupingValue(e.original),e._groupingValuesCache[r]):e.getValue(r)},e._groupingValuesCache={}},createCell:(e,t,r,n)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===r.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=r.subRows)!=null&&s.length)}}};function bu(e,t,r){if(!(t!=null&&t.length)||!r)return e;const n=e.filter(a=>!t.includes(a.id));return r==="remove"?n:[...t.map(a=>e.find(i=>i.id===a)).filter(Boolean),...n]}const vu={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ve("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=J(r=>[Lt(t,r)],r=>r.findIndex(n=>n.id===e.id),Q(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=r=>{var n;return((n=Lt(t,r)[0])==null?void 0:n.id)===e.id},e.getIsLastColumn=r=>{var n;const s=Lt(t,r);return((n=s[s.length-1])==null?void 0:n.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var r;e.setColumnOrder(t?[]:(r=e.initialState.columnOrder)!=null?r:[])},e._getOrderColumnsFn=J(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,r,n)=>s=>{let a=[];if(!(t!=null&&t.length))a=s;else{const i=[...t],l=[...s];for(;l.length&&i.length;){const c=i.shift(),d=l.findIndex(p=>p.id===c);d>-1&&a.push(l.splice(d,1)[0])}a=[...a,...l]}return bu(a,r,n)},Q(e.options,"debugTable","_getOrderColumnsFn"))}},Cr=()=>({left:[],right:[]}),wu={getInitialState:e=>({columnPinning:Cr(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ve("columnPinning",e)}),createColumn:(e,t)=>{e.pin=r=>{const n=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var a,i;if(r==="right"){var l,c;return{left:((l=s==null?void 0:s.left)!=null?l:[]).filter(u=>!(n!=null&&n.includes(u))),right:[...((c=s==null?void 0:s.right)!=null?c:[]).filter(u=>!(n!=null&&n.includes(u))),...n]}}if(r==="left"){var d,p;return{left:[...((d=s==null?void 0:s.left)!=null?d:[]).filter(u=>!(n!=null&&n.includes(u))),...n],right:((p=s==null?void 0:s.right)!=null?p:[]).filter(u=>!(n!=null&&n.includes(u)))}}return{left:((a=s==null?void 0:s.left)!=null?a:[]).filter(u=>!(n!=null&&n.includes(u))),right:((i=s==null?void 0:s.right)!=null?i:[]).filter(u=>!(n!=null&&n.includes(u)))}})},e.getCanPin=()=>e.getLeafColumns().some(n=>{var s,a,i;return((s=n.columnDef.enablePinning)!=null?s:!0)&&((a=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?a:!0)}),e.getIsPinned=()=>{const r=e.getLeafColumns().map(l=>l.id),{left:n,right:s}=t.getState().columnPinning,a=r.some(l=>n==null?void 0:n.includes(l)),i=r.some(l=>s==null?void 0:s.includes(l));return a?"left":i?"right":!1},e.getPinnedIndex=()=>{var r,n;const s=e.getIsPinned();return s?(r=(n=t.getState().columnPinning)==null||(n=n[s])==null?void 0:n.indexOf(e.id))!=null?r:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=J(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(r,n,s)=>{const a=[...n??[],...s??[]];return r.filter(i=>!a.includes(i.column.id))},Q(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=J(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(r,n)=>(n??[]).map(a=>r.find(i=>i.column.id===a)).filter(Boolean).map(a=>({...a,position:"left"})),Q(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=J(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(r,n)=>(n??[]).map(a=>r.find(i=>i.column.id===a)).filter(Boolean).map(a=>({...a,position:"right"})),Q(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var r,n;return e.setColumnPinning(t?Cr():(r=(n=e.initialState)==null?void 0:n.columnPinning)!=null?r:Cr())},e.getIsSomeColumnsPinned=t=>{var r;const n=e.getState().columnPinning;if(!t){var s,a;return!!((s=n.left)!=null&&s.length||(a=n.right)!=null&&a.length)}return!!((r=n[t])!=null&&r.length)},e.getLeftLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,r)=>(r??[]).map(n=>t.find(s=>s.id===n)).filter(Boolean),Q(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,r)=>(r??[]).map(n=>t.find(s=>s.id===n)).filter(Boolean),Q(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,r,n)=>{const s=[...r??[],...n??[]];return t.filter(a=>!s.includes(a.id))},Q(e.options,"debugColumns","getCenterLeafColumns"))}};function yu(e){return e||(typeof document<"u"?document:null)}const Qt={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},kr=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),ju={getDefaultColumnDef:()=>Qt,getInitialState:e=>({columnSizing:{},columnSizingInfo:kr(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ve("columnSizing",e),onColumnSizingInfoChange:Ve("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var r,n,s;const a=t.getState().columnSizing[e.id];return Math.min(Math.max((r=e.columnDef.minSize)!=null?r:Qt.minSize,(n=a??e.columnDef.size)!=null?n:Qt.size),(s=e.columnDef.maxSize)!=null?s:Qt.maxSize)},e.getStart=J(r=>[r,Lt(t,r),t.getState().columnSizing],(r,n)=>n.slice(0,e.getIndex(r)).reduce((s,a)=>s+a.getSize(),0),Q(t.options,"debugColumns","getStart")),e.getAfter=J(r=>[r,Lt(t,r),t.getState().columnSizing],(r,n)=>n.slice(e.getIndex(r)+1).reduce((s,a)=>s+a.getSize(),0),Q(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(r=>{let{[e.id]:n,...s}=r;return s})},e.getCanResize=()=>{var r,n;return((r=e.columnDef.enableResizing)!=null?r:!0)&&((n=t.options.enableColumnResizing)!=null?n:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let r=0;const n=s=>{if(s.subHeaders.length)s.subHeaders.forEach(n);else{var a;r+=(a=s.column.getSize())!=null?a:0}};return n(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 n=t.getColumn(e.column.id),s=n==null?void 0:n.getCanResize();return a=>{if(!n||!s||(a.persist==null||a.persist(),Sr(a)&&a.touches&&a.touches.length>1))return;const i=e.getSize(),l=e?e.getLeafHeaders().map(v=>[v.column.id,v.column.getSize()]):[[n.id,n.getSize()]],c=Sr(a)?Math.round(a.touches[0].clientX):a.clientX,d={},p=(v,y)=>{typeof y=="number"&&(t.setColumnSizingInfo(j=>{var k,S;const R=t.options.columnResizeDirection==="rtl"?-1:1,_=(y-((k=j==null?void 0:j.startOffset)!=null?k:0))*R,C=Math.max(_/((S=j==null?void 0:j.startSize)!=null?S:0),-.999999);return j.columnSizingStart.forEach(A=>{let[L,N]=A;d[L]=Math.round(Math.max(N+N*C,0)*100)/100}),{...j,deltaOffset:_,deltaPercentage:C}}),(t.options.columnResizeMode==="onChange"||v==="end")&&t.setColumnSizing(j=>({...j,...d})))},u=v=>p("move",v),m=v=>{p("end",v),t.setColumnSizingInfo(y=>({...y,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},f=yu(r),h={moveHandler:v=>u(v.clientX),upHandler:v=>{f==null||f.removeEventListener("mousemove",h.moveHandler),f==null||f.removeEventListener("mouseup",h.upHandler),m(v.clientX)}},x={moveHandler:v=>(v.cancelable&&(v.preventDefault(),v.stopPropagation()),u(v.touches[0].clientX),!1),upHandler:v=>{var y;f==null||f.removeEventListener("touchmove",x.moveHandler),f==null||f.removeEventListener("touchend",x.upHandler),v.cancelable&&(v.preventDefault(),v.stopPropagation()),m((y=v.touches[0])==null?void 0:y.clientX)}},w=Nu()?{passive:!1}:!1;Sr(a)?(f==null||f.addEventListener("touchmove",x.moveHandler,w),f==null||f.addEventListener("touchend",x.upHandler,w)):(f==null||f.addEventListener("mousemove",h.moveHandler,w),f==null||f.addEventListener("mouseup",h.upHandler,w)),t.setColumnSizingInfo(v=>({...v,startOffset:c,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:n.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var r;e.setColumnSizing(t?{}:(r=e.initialState.columnSizing)!=null?r:{})},e.resetHeaderSizeInfo=t=>{var r;e.setColumnSizingInfo(t?kr():(r=e.initialState.columnSizingInfo)!=null?r:kr())},e.getTotalSize=()=>{var t,r;return(t=(r=e.getHeaderGroups()[0])==null?void 0:r.headers.reduce((n,s)=>n+s.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,r;return(t=(r=e.getLeftHeaderGroups()[0])==null?void 0:r.headers.reduce((n,s)=>n+s.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,r;return(t=(r=e.getCenterHeaderGroups()[0])==null?void 0:r.headers.reduce((n,s)=>n+s.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,r;return(t=(r=e.getRightHeaderGroups()[0])==null?void 0:r.headers.reduce((n,s)=>n+s.getSize(),0))!=null?t:0}}};let er=null;function Nu(){if(typeof er=="boolean")return er;let e=!1;try{const t={get passive(){return e=!0,!1}},r=()=>{};window.addEventListener("test",r,t),window.removeEventListener("test",r)}catch{e=!1}return er=e,er}function Sr(e){return e.type==="touchstart"}const Cu={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ve("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=r=>{e.getCanHide()&&t.setColumnVisibility(n=>({...n,[e.id]:r??!e.getIsVisible()}))},e.getIsVisible=()=>{var r,n;const s=e.columns;return(r=s.length?s.some(a=>a.getIsVisible()):(n=t.getState().columnVisibility)==null?void 0:n[e.id])!=null?r:!0},e.getCanHide=()=>{var r,n;return((r=e.columnDef.enableHiding)!=null?r:!0)&&((n=t.options.enableHiding)!=null?n:!0)},e.getToggleVisibilityHandler=()=>r=>{e.toggleVisibility==null||e.toggleVisibility(r.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=J(()=>[e.getAllCells(),t.getState().columnVisibility],r=>r.filter(n=>n.column.getIsVisible()),Q(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=J(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(r,n,s)=>[...r,...n,...s],Q(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(r,n)=>J(()=>[n(),n().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(a=>a.getIsVisible==null?void 0:a.getIsVisible()),Q(e.options,"debugColumns",r));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=r=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(r),e.resetColumnVisibility=r=>{var n;e.setColumnVisibility(r?{}:(n=e.initialState.columnVisibility)!=null?n:{})},e.toggleAllColumnsVisible=r=>{var n;r=(n=r)!=null?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,a)=>({...s,[a.id]:r||!(a.getCanHide!=null&&a.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 n;e.toggleAllColumnsVisible((n=r.target)==null?void 0:n.checked)}}};function Lt(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const ku={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()}}},Su={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Ve("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var r;const n=(r=e.getCoreRowModel().flatRows[0])==null||(r=r._getAllCellsByColumnId()[t.id])==null?void 0:r.getValue();return typeof n=="string"||typeof n=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var r,n,s,a;return((r=e.columnDef.enableGlobalFilter)!=null?r:!0)&&((n=t.options.enableGlobalFilter)!=null?n:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((a=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?a:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>tt.includesString,e.getGlobalFilterFn=()=>{var t,r;const{globalFilterFn:n}=e.options;return gr(n)?n:n==="auto"?e.getGlobalAutoFilterFn():(t=(r=e.options.filterFns)==null?void 0:r[n])!=null?t:tt[n]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Ru={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ve("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,r=!1;e._autoResetExpanded=()=>{var n,s;if(!t){e._queue(()=>{t=!0});return}if((n=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?n:!e.options.manualExpanding){if(r)return;r=!0,e._queue(()=>{e.resetExpanded(),r=!1})}},e.setExpanded=n=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(n),e.toggleAllRowsExpanded=n=>{n??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=n=>{var s,a;e.setExpanded(n?{}:(s=(a=e.initialState)==null?void 0:a.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(n=>n.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>n=>{n.persist==null||n.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const n=e.getState().expanded;return n===!0||Object.values(n).some(Boolean)},e.getIsAllRowsExpanded=()=>{const n=e.getState().expanded;return typeof n=="boolean"?n===!0:!(!Object.keys(n).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let n=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(a=>{const i=a.split(".");n=Math.max(n,i.length)}),n},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,t)=>{e.toggleExpanded=r=>{t.setExpanded(n=>{var s;const a=n===!0?!0:!!(n!=null&&n[e.id]);let i={};if(n===!0?Object.keys(t.getRowModel().rowsById).forEach(l=>{i[l]=!0}):i=n,r=(s=r)!=null?s:!a,!a&&r)return{...i,[e.id]:!0};if(a&&!r){const{[e.id]:l,...c}=i;return c}return n})},e.getIsExpanded=()=>{var r;const n=t.getState().expanded;return!!((r=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?r:n===!0||n!=null&&n[e.id])},e.getCanExpand=()=>{var r,n,s;return(r=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?r:((n=t.options.enableExpanding)!=null?n:!0)&&!!((s=e.subRows)!=null&&s.length)},e.getIsAllParentsExpanded=()=>{let r=!0,n=e;for(;r&&n.parentId;)n=t.getRow(n.parentId,!0),r=n.getIsExpanded();return r},e.getToggleExpandedHandler=()=>{const r=e.getCanExpand();return()=>{r&&e.toggleExpanded()}}}},Vr=0,zr=10,Rr=()=>({pageIndex:Vr,pageSize:zr}),_u={getInitialState:e=>({...e,pagination:{...Rr(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ve("pagination",e)}),createTable:e=>{let t=!1,r=!1;e._autoResetPageIndex=()=>{var n,s;if(!t){e._queue(()=>{t=!0});return}if((n=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?n:!e.options.manualPagination){if(r)return;r=!0,e._queue(()=>{e.resetPageIndex(),r=!1})}},e.setPagination=n=>{const s=a=>nt(n,a);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=n=>{var s;e.setPagination(n?Rr():(s=e.initialState.pagination)!=null?s:Rr())},e.setPageIndex=n=>{e.setPagination(s=>{let a=nt(n,s.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return a=Math.max(0,Math.min(a,i)),{...s,pageIndex:a}})},e.resetPageIndex=n=>{var s,a;e.setPageIndex(n?Vr:(s=(a=e.initialState)==null||(a=a.pagination)==null?void 0:a.pageIndex)!=null?s:Vr)},e.resetPageSize=n=>{var s,a;e.setPageSize(n?zr:(s=(a=e.initialState)==null||(a=a.pagination)==null?void 0:a.pageSize)!=null?s:zr)},e.setPageSize=n=>{e.setPagination(s=>{const a=Math.max(1,nt(n,s.pageSize)),i=s.pageSize*s.pageIndex,l=Math.floor(i/a);return{...s,pageIndex:l,pageSize:a}})},e.setPageCount=n=>e.setPagination(s=>{var a;let i=nt(n,(a=e.options.pageCount)!=null?a:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...s,pageCount:i}}),e.getPageOptions=J(()=>[e.getPageCount()],n=>{let s=[];return n&&n>0&&(s=[...new Array(n)].fill(null).map((a,i)=>i)),s},Q(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:n}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:n<s-1},e.previousPage=()=>e.setPageIndex(n=>n-1),e.nextPage=()=>e.setPageIndex(n=>n+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 n;return(n=e.options.pageCount)!=null?n:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var n;return(n=e.options.rowCount)!=null?n:e.getPrePaginationRowModel().rows.length}}},_r=()=>({top:[],bottom:[]}),Mu={getInitialState:e=>({rowPinning:_r(),...e}),getDefaultOptions:e=>({onRowPinningChange:Ve("rowPinning",e)}),createRow:(e,t)=>{e.pin=(r,n,s)=>{const a=n?e.getLeafRows().map(c=>{let{id:d}=c;return d}):[],i=s?e.getParentRows().map(c=>{let{id:d}=c;return d}):[],l=new Set([...i,e.id,...a]);t.setRowPinning(c=>{var d,p;if(r==="bottom"){var u,m;return{top:((u=c==null?void 0:c.top)!=null?u:[]).filter(x=>!(l!=null&&l.has(x))),bottom:[...((m=c==null?void 0:c.bottom)!=null?m:[]).filter(x=>!(l!=null&&l.has(x))),...Array.from(l)]}}if(r==="top"){var f,h;return{top:[...((f=c==null?void 0:c.top)!=null?f:[]).filter(x=>!(l!=null&&l.has(x))),...Array.from(l)],bottom:((h=c==null?void 0:c.bottom)!=null?h:[]).filter(x=>!(l!=null&&l.has(x)))}}return{top:((d=c==null?void 0:c.top)!=null?d:[]).filter(x=>!(l!=null&&l.has(x))),bottom:((p=c==null?void 0:c.bottom)!=null?p:[]).filter(x=>!(l!=null&&l.has(x)))}})},e.getCanPin=()=>{var r;const{enableRowPinning:n,enablePinning:s}=t.options;return typeof n=="function"?n(e):(r=n??s)!=null?r:!0},e.getIsPinned=()=>{const r=[e.id],{top:n,bottom:s}=t.getState().rowPinning,a=r.some(l=>n==null?void 0:n.includes(l)),i=r.some(l=>s==null?void 0:s.includes(l));return a?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var r,n;const s=e.getIsPinned();if(!s)return-1;const a=(r=s==="top"?t.getTopRows():t.getBottomRows())==null?void 0:r.map(i=>{let{id:l}=i;return l});return(n=a==null?void 0:a.indexOf(e.id))!=null?n:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var r,n;return e.setRowPinning(t?_r():(r=(n=e.initialState)==null?void 0:n.rowPinning)!=null?r:_r())},e.getIsSomeRowsPinned=t=>{var r;const n=e.getState().rowPinning;if(!t){var s,a;return!!((s=n.top)!=null&&s.length||(a=n.bottom)!=null&&a.length)}return!!((r=n[t])!=null&&r.length)},e._getPinnedRows=(t,r,n)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(r??[]).map(i=>{const l=e.getRow(i,!0);return l.getIsAllParentsExpanded()?l:null}):(r??[]).map(i=>t.find(l=>l.id===i))).filter(Boolean).map(i=>({...i,position:n}))},e.getTopRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,r)=>e._getPinnedRows(t,r,"top"),Q(e.options,"debugRows","getTopRows")),e.getBottomRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,r)=>e._getPinnedRows(t,r,"bottom"),Q(e.options,"debugRows","getBottomRows")),e.getCenterRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,r,n)=>{const s=new Set([...r??[],...n??[]]);return t.filter(a=>!s.has(a.id))},Q(e.options,"debugRows","getCenterRows"))}},Pu={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ve("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var r;return e.setRowSelection(t?{}:(r=e.initialState.rowSelection)!=null?r:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(r=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const n={...r},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(a=>{a.getCanSelect()&&(n[a.id]=!0)}):s.forEach(a=>{delete n[a.id]}),n})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(r=>{const n=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...r};return e.getRowModel().rows.forEach(a=>{$r(s,a.id,n,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=J(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,r)=>Object.keys(t).length?Mr(e,r):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=J(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,r)=>Object.keys(t).length?Mr(e,r):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=J(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,r)=>Object.keys(t).length?Mr(e,r):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:r}=e.getState();let n=!!(t.length&&Object.keys(r).length);return n&&t.some(s=>s.getCanSelect()&&!r[s.id])&&(n=!1),n},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:r}=e.getState();let n=!!t.length;return n&&t.some(s=>!r[s.id])&&(n=!1),n},e.getIsSomeRowsSelected=()=>{var t;const r=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return r>0&&r<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(r=>r.getCanSelect()).some(r=>r.getIsSelected()||r.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(r,n)=>{const s=e.getIsSelected();t.setRowSelection(a=>{var i;if(r=typeof r<"u"?r:!s,e.getCanSelect()&&s===r)return a;const l={...a};return $r(l,e.id,r,(i=n==null?void 0:n.selectChildren)!=null?i:!0,t),l})},e.getIsSelected=()=>{const{rowSelection:r}=t.getState();return Sn(e,r)},e.getIsSomeSelected=()=>{const{rowSelection:r}=t.getState();return Br(e,r)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=t.getState();return Br(e,r)==="all"},e.getCanSelect=()=>{var r;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(r=t.options.enableRowSelection)!=null?r:!0},e.getCanSelectSubRows=()=>{var r;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(r=t.options.enableSubRowSelection)!=null?r:!0},e.getCanMultiSelect=()=>{var r;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(r=t.options.enableMultiRowSelection)!=null?r:!0},e.getToggleSelectedHandler=()=>{const r=e.getCanSelect();return n=>{var s;r&&e.toggleSelected((s=n.target)==null?void 0:s.checked)}}}},$r=(e,t,r,n,s)=>{var a;const i=s.getRow(t,!0);r?(i.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),i.getCanSelect()&&(e[t]=!0)):delete e[t],n&&(a=i.subRows)!=null&&a.length&&i.getCanSelectSubRows()&&i.subRows.forEach(l=>$r(e,l.id,r,n,s))};function Mr(e,t){const r=e.getState().rowSelection,n=[],s={},a=function(i,l){return i.map(c=>{var d;const p=Sn(c,r);if(p&&(n.push(c),s[c.id]=c),(d=c.subRows)!=null&&d.length&&(c={...c,subRows:a(c.subRows)}),p)return c}).filter(Boolean)};return{rows:a(t.rows),flatRows:n,rowsById:s}}function Sn(e,t){var r;return(r=t[e.id])!=null?r:!1}function Br(e,t,r){var n;if(!((n=e.subRows)!=null&&n.length))return!1;let s=!0,a=!1;return e.subRows.forEach(i=>{if(!(a&&!s)&&(i.getCanSelect()&&(Sn(i,t)?a=!0:s=!1),i.subRows&&i.subRows.length)){const l=Br(i,t);l==="all"?a=!0:(l==="some"&&(a=!0),s=!1)}}),s?"all":a?"some":!1}const Or=/([0-9]+)/gm,Iu=(e,t,r)=>Ba(ot(e.getValue(r)).toLowerCase(),ot(t.getValue(r)).toLowerCase()),Tu=(e,t,r)=>Ba(ot(e.getValue(r)),ot(t.getValue(r))),Lu=(e,t,r)=>Rn(ot(e.getValue(r)).toLowerCase(),ot(t.getValue(r)).toLowerCase()),Du=(e,t,r)=>Rn(ot(e.getValue(r)),ot(t.getValue(r))),Eu=(e,t,r)=>{const n=e.getValue(r),s=t.getValue(r);return n>s?1:n<s?-1:0},Au=(e,t,r)=>Rn(e.getValue(r),t.getValue(r));function Rn(e,t){return e===t?0:e>t?1:-1}function ot(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Ba(e,t){const r=e.split(Or).filter(Boolean),n=t.split(Or).filter(Boolean);for(;r.length&&n.length;){const s=r.shift(),a=n.shift(),i=parseInt(s,10),l=parseInt(a,10),c=[i,l].sort();if(isNaN(c[0])){if(s>a)return 1;if(a>s)return-1;continue}if(isNaN(c[1]))return isNaN(i)?-1:1;if(i>l)return 1;if(l>i)return-1}return r.length-n.length}const Rt={alphanumeric:Iu,alphanumericCaseSensitive:Tu,text:Lu,textCaseSensitive:Du,datetime:Eu,basic:Au},Fu={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Ve("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const r=t.getFilteredRowModel().flatRows.slice(10);let n=!1;for(const s of r){const a=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(a)==="[object Date]")return Rt.datetime;if(typeof a=="string"&&(n=!0,a.split(Or).length>1))return Rt.alphanumeric}return n?Rt.text:Rt.basic},e.getAutoSortDir=()=>{const r=t.getFilteredRowModel().flatRows[0];return typeof(r==null?void 0:r.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var r,n;if(!e)throw new Error;return gr(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(r=(n=t.options.sortingFns)==null?void 0:n[e.columnDef.sortingFn])!=null?r:Rt[e.columnDef.sortingFn]},e.toggleSorting=(r,n)=>{const s=e.getNextSortingOrder(),a=typeof r<"u"&&r!==null;t.setSorting(i=>{const l=i==null?void 0:i.find(f=>f.id===e.id),c=i==null?void 0:i.findIndex(f=>f.id===e.id);let d=[],p,u=a?r:s==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&n?l?p="toggle":p="add":i!=null&&i.length&&c!==i.length-1?p="replace":l?p="toggle":p="replace",p==="toggle"&&(a||s||(p="remove")),p==="add"){var m;d=[...i,{id:e.id,desc:u}],d.splice(0,d.length-((m=t.options.maxMultiSortColCount)!=null?m:Number.MAX_SAFE_INTEGER))}else p==="toggle"?d=i.map(f=>f.id===e.id?{...f,desc:u}:f):p==="remove"?d=i.filter(f=>f.id!==e.id):d=[{id:e.id,desc:u}];return d})},e.getFirstSortDir=()=>{var r,n;return((r=(n=e.columnDef.sortDescFirst)!=null?n:t.options.sortDescFirst)!=null?r:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=r=>{var n,s;const a=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==a&&((n=t.options.enableSortingRemoval)==null||n)&&(!(r&&(s=t.options.enableMultiRemove)!=null)||s)?!1:i==="desc"?"asc":"desc":a},e.getCanSort=()=>{var r,n;return((r=e.columnDef.enableSorting)!=null?r:!0)&&((n=t.options.enableSorting)!=null?n:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var r,n;return(r=(n=e.columnDef.enableMultiSort)!=null?n:t.options.enableMultiSort)!=null?r:!!e.accessorFn},e.getIsSorted=()=>{var r;const n=(r=t.getState().sorting)==null?void 0:r.find(s=>s.id===e.id);return n?n.desc?"desc":"asc":!1},e.getSortIndex=()=>{var r,n;return(r=(n=t.getState().sorting)==null?void 0:n.findIndex(s=>s.id===e.id))!=null?r:-1},e.clearSorting=()=>{t.setSorting(r=>r!=null&&r.length?r.filter(n=>n.id!==e.id):[])},e.getToggleSortingHandler=()=>{const r=e.getCanSort();return n=>{r&&(n.persist==null||n.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(n):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var r,n;e.setSorting(t?[]:(r=(n=e.initialState)==null?void 0:n.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())}},Vu=[su,Cu,vu,wu,au,iu,ku,Su,Fu,xu,Ru,_u,Mu,Pu,ju];function zu(e){var t,r;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const n=[...Vu,...(t=e._features)!=null?t:[]];let s={_features:n};const a=s._features.reduce((m,f)=>Object.assign(m,f.getDefaultOptions==null?void 0:f.getDefaultOptions(s)),{}),i=m=>s.options.mergeOptions?s.options.mergeOptions(a,m):{...a,...m};let c={...{},...(r=e.initialState)!=null?r:{}};s._features.forEach(m=>{var f;c=(f=m.getInitialState==null?void 0:m.getInitialState(c))!=null?f:c});const d=[];let p=!1;const u={_features:n,options:{...a,...e},initialState:c,_queue:m=>{d.push(m),p||(p=!0,Promise.resolve().then(()=>{for(;d.length;)d.shift()();p=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{s.setState(s.initialState)},setOptions:m=>{const f=nt(m,s.options);s.options=i(f)},getState:()=>s.options.state,setState:m=>{s.options.onStateChange==null||s.options.onStateChange(m)},_getRowId:(m,f,h)=>{var x;return(x=s.options.getRowId==null?void 0:s.options.getRowId(m,f,h))!=null?x:`${h?[h.id,f].join("."):f}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(m,f)=>{let h=(f?s.getPrePaginationRowModel():s.getRowModel()).rowsById[m];if(!h&&(h=s.getCoreRowModel().rowsById[m],!h))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${m}`):new Error;return h},_getDefaultColumnDef:J(()=>[s.options.defaultColumn],m=>{var f;return m=(f=m)!=null?f:{},{header:h=>{const x=h.header.column.columnDef;return x.accessorKey?x.accessorKey:x.accessorFn?x.id:null},cell:h=>{var x,w;return(x=(w=h.renderValue())==null||w.toString==null?void 0:w.toString())!=null?x:null},...s._features.reduce((h,x)=>Object.assign(h,x.getDefaultColumnDef==null?void 0:x.getDefaultColumnDef()),{}),...m}},Q(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>s.options.columns,getAllColumns:J(()=>[s._getColumnDefs()],m=>{const f=function(h,x,w){return w===void 0&&(w=0),h.map(v=>{const y=ou(s,v,w,x),j=v;return y.columns=j.columns?f(j.columns,y,w+1):[],y})};return f(m)},Q(e,"debugColumns","getAllColumns")),getAllFlatColumns:J(()=>[s.getAllColumns()],m=>m.flatMap(f=>f.getFlatColumns()),Q(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:J(()=>[s.getAllFlatColumns()],m=>m.reduce((f,h)=>(f[h.id]=h,f),{}),Q(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:J(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(m,f)=>{let h=m.flatMap(x=>x.getLeafColumns());return f(h)},Q(e,"debugColumns","getAllLeafColumns")),getColumn:m=>{const f=s._getAllFlatColumnsById()[m];return process.env.NODE_ENV!=="production"&&!f&&console.error(`[Table] Column with id '${m}' does not exist.`),f}};Object.assign(s,u);for(let m=0;m<s._features.length;m++){const f=s._features[m];f==null||f.createTable==null||f.createTable(s)}return s}function $u(){return e=>J(()=>[e.options.data],t=>{const r={rows:[],flatRows:[],rowsById:{}},n=function(s,a,i){a===void 0&&(a=0);const l=[];for(let d=0;d<s.length;d++){const p=Cn(e,e._getRowId(s[d],d,i),s[d],d,a,void 0,i==null?void 0:i.id);if(r.flatRows.push(p),r.rowsById[p.id]=p,l.push(p),e.options.getSubRows){var c;p.originalSubRows=e.options.getSubRows(s[d],d),(c=p.originalSubRows)!=null&&c.length&&(p.subRows=n(p.originalSubRows,a+1,p))}}return l};return r.rows=n(t),r},Q(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Bu(e){const t=[],r=n=>{var s;t.push(n),(s=n.subRows)!=null&&s.length&&n.getIsExpanded()&&n.subRows.forEach(r)};return e.rows.forEach(r),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Ou(e,t,r){return r.options.filterFromLeafRows?Hu(e,t,r):Gu(e,t,r)}function Hu(e,t,r){var n;const s=[],a={},i=(n=r.options.maxLeafRowFilterDepth)!=null?n:100,l=function(c,d){d===void 0&&(d=0);const p=[];for(let m=0;m<c.length;m++){var u;let f=c[m];const h=Cn(r,f.id,f.original,f.index,f.depth,void 0,f.parentId);if(h.columnFilters=f.columnFilters,(u=f.subRows)!=null&&u.length&&d<i){if(h.subRows=l(f.subRows,d+1),f=h,t(f)&&!h.subRows.length){p.push(f),a[f.id]=f,s.push(f);continue}if(t(f)||h.subRows.length){p.push(f),a[f.id]=f,s.push(f);continue}}else f=h,t(f)&&(p.push(f),a[f.id]=f,s.push(f))}return p};return{rows:l(e),flatRows:s,rowsById:a}}function Gu(e,t,r){var n;const s=[],a={},i=(n=r.options.maxLeafRowFilterDepth)!=null?n:100,l=function(c,d){d===void 0&&(d=0);const p=[];for(let m=0;m<c.length;m++){let f=c[m];if(t(f)){var u;if((u=f.subRows)!=null&&u.length&&d<i){const x=Cn(r,f.id,f.original,f.index,f.depth,void 0,f.parentId);x.subRows=l(f.subRows,d+1),f=x}p.push(f),s.push(f),a[f.id]=f}}return p};return{rows:l(e),flatRows:s,rowsById:a}}function qu(){return e=>J(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,r,n)=>{if(!t.rows.length||!(r!=null&&r.length)&&!n){for(let m=0;m<t.flatRows.length;m++)t.flatRows[m].columnFilters={},t.flatRows[m].columnFiltersMeta={};return t}const s=[],a=[];(r??[]).forEach(m=>{var f;const h=e.getColumn(m.id);if(!h)return;const x=h.getFilterFn();if(!x){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${h.id}.`);return}s.push({id:m.id,filterFn:x,resolvedValue:(f=x.resolveFilterValue==null?void 0:x.resolveFilterValue(m.value))!=null?f:m.value})});const i=(r??[]).map(m=>m.id),l=e.getGlobalFilterFn(),c=e.getAllLeafColumns().filter(m=>m.getCanGlobalFilter());n&&l&&c.length&&(i.push("__global__"),c.forEach(m=>{var f;a.push({id:m.id,filterFn:l,resolvedValue:(f=l.resolveFilterValue==null?void 0:l.resolveFilterValue(n))!=null?f:n})}));let d,p;for(let m=0;m<t.flatRows.length;m++){const f=t.flatRows[m];if(f.columnFilters={},s.length)for(let h=0;h<s.length;h++){d=s[h];const x=d.id;f.columnFilters[x]=d.filterFn(f,x,d.resolvedValue,w=>{f.columnFiltersMeta[x]=w})}if(a.length){for(let h=0;h<a.length;h++){p=a[h];const x=p.id;if(p.filterFn(f,x,p.resolvedValue,w=>{f.columnFiltersMeta[x]=w})){f.columnFilters.__global__=!0;break}}f.columnFilters.__global__!==!0&&(f.columnFilters.__global__=!1)}}const u=m=>{for(let f=0;f<i.length;f++)if(m.columnFilters[i[f]]===!1)return!1;return!0};return Ou(t.rows,u,e)},Q(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Wu(e){return t=>J(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(r,n)=>{if(!n.rows.length)return n;const{pageSize:s,pageIndex:a}=r;let{rows:i,flatRows:l,rowsById:c}=n;const d=s*a,p=d+s;i=i.slice(d,p);let u;t.options.paginateExpandedRows?u={rows:i,flatRows:l,rowsById:c}:u=Bu({rows:i,flatRows:l,rowsById:c}),u.flatRows=[];const m=f=>{u.flatRows.push(f),f.subRows.length&&f.subRows.forEach(m)};return u.rows.forEach(m),u},Q(t.options,"debugTable","getPaginationRowModel"))}function Uu(){return e=>J(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,r)=>{if(!r.rows.length||!(t!=null&&t.length))return r;const n=e.getState().sorting,s=[],a=n.filter(c=>{var d;return(d=e.getColumn(c.id))==null?void 0:d.getCanSort()}),i={};a.forEach(c=>{const d=e.getColumn(c.id);d&&(i[c.id]={sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortingFn:d.getSortingFn()})});const l=c=>{const d=c.map(p=>({...p}));return d.sort((p,u)=>{for(let f=0;f<a.length;f+=1){var m;const h=a[f],x=i[h.id],w=x.sortUndefined,v=(m=h==null?void 0:h.desc)!=null?m:!1;let y=0;if(w){const j=p.getValue(h.id),k=u.getValue(h.id),S=j===void 0,R=k===void 0;if(S||R){if(w==="first")return S?-1:1;if(w==="last")return S?1:-1;y=S&&R?0:S?w:-w}}if(y===0&&(y=x.sortingFn(p,u,h.id)),y!==0)return v&&(y*=-1),x.invertSorting&&(y*=-1),y}return p.index-u.index}),d.forEach(p=>{var u;s.push(p),(u=p.subRows)!=null&&u.length&&(p.subRows=l(p.subRows))}),d};return{rows:l(r.rows),flatRows:s,rowsById:r.rowsById}},Q(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
25
25
|
* react-table
|
|
26
26
|
*
|
|
27
27
|
* Copyright (c) TanStack
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
* LICENSE.md file in the root directory of this source tree.
|
|
31
31
|
*
|
|
32
32
|
* @license MIT
|
|
33
|
-
*/function Xn(e,t){return e?Ku(e)?
|
|
34
|
-
`),n=t==="css"||t==="scss"||t==="less",s=t==="html"||t==="xml"||t==="svg",a=t==="json",i=t==="bash"||t==="sh"||t==="shell"||t==="zsh";return r.map(l=>{const c=[];let d=0;const
|
|
35
|
-
`).map(u=>[{type:"plain",value:u}])}},[c,t]),g=async()=>{try{await navigator.clipboard.writeText(c),l(!0),setTimeout(()=>l(!1),2e3)}catch{}};return o.jsxs("div",{className:b("relative group",s),children:[n&&o.jsx("button",{type:"button",onClick:g,className:"absolute top-3 right-3 z-10 p-1.5 rounded-md bg-white/10 backdrop-blur text-white/60 hover:text-white opacity-0 group-hover:opacity-100 transition-opacity text-xs","aria-label":a.common_copyCode,children:i?o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("polyline",{points:"20 6 9 17 4 12"})}):o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2"}),o.jsx("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})}),o.jsx("pre",{className:"overflow-x-auto rounded-lg p-4 text-[13px] leading-relaxed font-mono",style:{background:"var(--cb-bg, #1e1e2e)",color:"var(--cb-plain, #d4d4d4)"},children:d.map((u,f)=>o.jsxs("div",{children:[r&&o.jsx("span",{className:"inline-block w-8 select-none text-right mr-4 opacity-40",style:{color:"var(--cb-plain, #d4d4d4)"},children:f+1}),u.map((m,h)=>o.jsx("span",{style:{color:nm[m.type]},children:m.value},h))]},f))})]})}const Oa=ze("font-bold tracking-tight",{variants:{level:{1:"text-2xl lg:text-3xl",2:"text-xl lg:text-2xl",3:"text-lg lg:text-xl",4:"text-base lg:text-lg",5:"text-sm lg:text-base",6:"text-xs lg:text-sm"}},defaultVariants:{level:2}});function sm({className:e,level:t=2,as:r,children:n,...s}){const a=r||`h${t}`;return o.jsx(a,{className:b(Oa({level:t}),e),...s,children:n})}const Ha=ze("",{variants:{size:{xs:"text-xs",sm:"text-sm",base:"text-base",lg:"text-lg",xl:"text-xl"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},variant:{default:"text-foreground",muted:"text-muted-foreground",primary:"text-primary",destructive:"text-destructive",success:"text-green-600 dark:text-green-400"},leading:{tight:"leading-tight",normal:"leading-normal",relaxed:"leading-relaxed"}},defaultVariants:{size:"base",weight:"normal",variant:"default",leading:"normal"}});function am({className:e,size:t,weight:r,variant:n,leading:s,as:a="p",children:i,...l}){return o.jsx(a,{className:b(Ha({size:t,weight:r,variant:n,leading:s}),e),...l,children:i})}function im({className:e,...t}){return o.jsx("code",{className:b("relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm",e),...t})}function lm({className:e,...t}){return o.jsx("blockquote",{className:b("border-l-4 border-primary pl-4 italic text-muted-foreground",e),...t})}function cm({className:e,...t}){return o.jsx("p",{className:b("text-xl text-muted-foreground",e),...t})}function dm({className:e,...t}){return o.jsx("p",{className:b("text-sm text-muted-foreground",e),...t})}const Ga=p.forwardRef(({className:e,children:t,...r},n)=>o.jsx("div",{ref:n,className:b("w-full h-full min-h-[300px]",e),...r,children:o.jsx(Gr.ResponsiveContainer,{width:"100%",height:"100%",children:t})}));Ga.displayName="ChartContainer";const um=Gr.Tooltip,mm=Gr.Legend,qa=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("flex flex-col space-y-4",e),...t}));qa.displayName="Timeline";const Wa=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("relative flex gap-4 pb-4 last:pb-0",e),...t}));Wa.displayName="TimelineItem";const Ua=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border bg-background text-primary shadow-sm",e),...t}));Ua.displayName="TimelineIcon";const Ka=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("absolute left-4 top-8 -bottom-4 w-px bg-border",e),...t}));Ka.displayName="TimelineConnector";const Xa=p.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("flex-1 space-y-1 pt-1",e),...t}));Xa.displayName="TimelineContent";const Ya=p.forwardRef(({className:e,children:t,...r},n)=>o.jsx("div",{ref:n,className:b("grid min-h-screen w-full lg:grid-cols-[280px_1fr]",e),...r,children:t}));Ya.displayName="AppShell";const Za=p.forwardRef(({className:e,children:t,...r},n)=>o.jsx("div",{ref:n,className:b("hidden border-r bg-muted/40 lg:block dark:bg-muted/10",e),...r,children:o.jsx("div",{className:"flex h-full max-h-screen flex-col gap-2",children:t})}));Za.displayName="Sidebar";const Ja=p.forwardRef(({className:e,children:t,...r},n)=>o.jsx("header",{ref:n,className:b("flex h-14 items-center gap-4 border-b bg-background px-6 lg:h-[60px]",e),...r,children:t}));Ja.displayName="Header";const Qa=p.forwardRef(({className:e,children:t,...r},n)=>o.jsx("main",{ref:n,className:b("flex flex-1 flex-col gap-4 p-4 lg:gap-6 lg:p-6",e),...r,children:t}));Qa.displayName="Main";function fm({title:e,value:t,description:r,trend:n,trendLabel:s,icon:a,className:i,...l}){return o.jsxs(Jr,{className:b("overflow-hidden",i),...l,children:[o.jsxs(Qr,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(en,{className:"text-sm font-medium text-muted-foreground",children:e}),a&&o.jsx("div",{className:"text-muted-foreground",children:a})]}),o.jsxs(tn,{children:[o.jsx("div",{className:"text-2xl font-bold",children:t}),(r||n!==void 0)&&o.jsxs("div",{className:"text-xs flex items-center gap-1 mt-1 text-muted-foreground",children:[n!==void 0&&o.jsxs("span",{className:b("flex items-center font-medium",n>0?"text-green-500":n<0?"text-red-500":"text-muted-foreground"),children:[n>0?o.jsx(I.TrendingUp,{className:"mr-1 h-3 w-3"}):n<0?o.jsx(I.TrendingDown,{className:"mr-1 h-3 w-3"}):o.jsx(I.Minus,{className:"mr-1 h-3 w-3"}),n>0?"+":"",n,"%"]}),s&&o.jsx("span",{children:s}),r&&!n&&o.jsx("span",{children:r})]})]})]})}const ei=p.forwardRef(({className:e,label:t,value:r,...n},s)=>{const[a,i]=p.useState(!1),l=()=>{navigator.clipboard.writeText(r),i(!0),setTimeout(()=>i(!1),2e3)};return o.jsxs("div",{className:"space-y-2",children:[t&&o.jsx(lr,{children:t}),o.jsxs("div",{className:"flex gap-2 relative",children:[o.jsx(st,{ref:s,value:r,readOnly:!0,className:b("pr-10 font-mono text-sm",e),...n}),o.jsx(ve,{size:"icon",variant:"outline",className:"shrink-0",onClick:l,children:a?o.jsx(I.Check,{className:"h-4 w-4 text-green-500"}):o.jsx(I.Copy,{className:"h-4 w-4"})})]})]})});ei.displayName="CopyInput";const ti=p.forwardRef(({className:e,data:t,...r},n)=>o.jsx("pre",{ref:n,className:b("rounded-lg border bg-muted p-4 overflow-auto text-xs font-mono text-muted-foreground",e),...r,children:JSON.stringify(t,null,2)}));ti.displayName="JsonViewer";const gm=ze("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{status:{neutral:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",success:"border-transparent bg-green-500/15 text-green-700 dark:text-green-400 hover:bg-green-500/25",warning:"border-transparent bg-yellow-500/15 text-yellow-700 dark:text-yellow-400 hover:bg-yellow-500/25",error:"border-transparent bg-red-500/15 text-red-700 dark:text-red-400 hover:bg-red-500/25",info:"border-transparent bg-blue-500/15 text-blue-700 dark:text-blue-400 hover:bg-blue-500/25"}},defaultVariants:{status:"neutral"}});function pm({className:e,status:t,dot:r=!0,children:n,...s}){return o.jsxs("div",{className:b(gm({status:t}),e),...s,children:[r&&o.jsx("span",{className:b("mr-1.5 h-2 w-2 rounded-full",{"bg-current":!0})}),n]})}const pr=p.forwardRef(({src:e,data:t,stream:r,color:n,progressColor:s,progress:a=0,height:i=80,barCount:l=100,barWidth:c=3,barGap:d=1,barRadius:g=2,mirrored:u=!1,onSeek:f,className:m,...h},x)=>{const y=p.useRef(null),[w,v]=p.useState([]),j=p.useRef(0),R=te();p.useEffect(()=>{if(!e)return;const C=new AudioContext;let k=!1;return fetch(e).then(N=>N.arrayBuffer()).then(N=>C.decodeAudioData(N)).then(N=>{if(k)return;const S=N.getChannelData(0),_=Math.floor(S.length/l),D=[];for(let B=0;B<l;B++){let P=0;for(let q=0;q<_;q++)P+=Math.abs(S[B*_+q]);D.push(P/_)}const F=Math.max(...D,.01);v(D.map(B=>B/F))}).catch(()=>{}),()=>{k=!0,C.close()}},[e,l]),p.useEffect(()=>{if(t){const C=Math.max(...t,.01);v(t.map(k=>k/C))}},[t]),p.useEffect(()=>{if(!r)return;const C=new AudioContext,k=C.createMediaStreamSource(r),N=C.createAnalyser();N.fftSize=256,k.connect(N);const S=new Uint8Array(N.frequencyBinCount),_=()=>{N.getByteFrequencyData(S);const D=Math.floor(S.length/l),F=[];for(let B=0;B<l;B++)F.push(S[B*D]/255);v(F),j.current=requestAnimationFrame(_)};return j.current=requestAnimationFrame(_),()=>{cancelAnimationFrame(j.current),k.disconnect(),C.close()}},[r,l]),p.useEffect(()=>{const C=y.current;if(!C||w.length===0)return;const k=C.getContext("2d");if(!k)return;const N=window.devicePixelRatio||1,S=C.getBoundingClientRect();C.width=S.width*N,C.height=S.height*N,k.scale(N,N),k.clearRect(0,0,S.width,S.height);const _=getComputedStyle(C),D=n||_.getPropertyValue("--muted-foreground").trim()||"#888",F=s||_.getPropertyValue("--primary").trim()||"#7c3aed",B=c+d,P=Math.max(0,(S.width-w.length*B)/2);for(let q=0;q<w.length;q++){const V=Math.max(2,w[q]*(u?S.height/2:S.height*.9)),A=P+q*B,T=q/w.length<=a;if(k.fillStyle=T?F:D,u){const oe=S.height/2-V;Pr(k,A,oe,c,V,g),k.fill(),Pr(k,A,S.height/2,c,V,g),k.fill()}else{const oe=S.height-V;Pr(k,A,oe,c,V,g),k.fill()}}},[w,a,n,s,c,d,g,u,i]);const M=C=>{if(!f||!y.current)return;const k=y.current.getBoundingClientRect(),N=(C.clientX-k.left)/k.width;f(Math.max(0,Math.min(1,N)))};return o.jsx("div",{ref:x,className:b("relative w-full",m),role:"img","aria-label":R.audioWaveform_label,...h,children:o.jsx("canvas",{ref:y,style:{width:"100%",height:i},className:b(f&&"cursor-pointer"),onClick:M})})});pr.displayName="AudioWaveform";function Pr(e,t,r,n,s,a){e.beginPath(),e.moveTo(t+a,r),e.lineTo(t+n-a,r),e.quadraticCurveTo(t+n,r,t+n,r+a),e.lineTo(t+n,r+s-a),e.quadraticCurveTo(t+n,r+s,t+n-a,r+s),e.lineTo(t+a,r+s),e.quadraticCurveTo(t,r+s,t,r+s-a),e.lineTo(t,r+a),e.quadraticCurveTo(t,r,t+a,r),e.closePath()}const ri=ze("flex items-center gap-3 rounded-lg border bg-card p-3 text-card-foreground shadow-sm",{variants:{size:{sm:"p-2 gap-2",default:"p-3 gap-3",lg:"p-4 gap-4"}},defaultVariants:{size:"default"}}),hm={sm:"h-3.5 w-3.5",default:"h-4 w-4",lg:"h-5 w-5"};function _n({src:e,title:t,artist:r,albumArt:n,showWaveform:s=!1,showVolume:a=!0,defaultVolume:i=1,autoPlay:l=!1,loop:c=!1,preload:d="metadata",size:g="default",onPlay:u,onPause:f,onEnded:m,onTimeUpdate:h,className:x}){const y=p.useRef(null),w=p.useRef(null),[v,j]=p.useState(!1),[R,M]=p.useState(0),[C,k]=p.useState(0),[N,S]=p.useState(i),[_,D]=p.useState(!1),[F,B]=p.useState(!1),P=te(),q=hm[g??"default"];p.useEffect(()=>{const L=y.current;if(!L)return;const H=()=>k(L.duration),Z=()=>{F||(M(L.currentTime),h==null||h(L.currentTime))},O=()=>{j(!0),u==null||u()},X=()=>{j(!1),f==null||f()},ce=()=>{j(!1),m==null||m()};return L.addEventListener("loadedmetadata",H),L.addEventListener("timeupdate",Z),L.addEventListener("play",O),L.addEventListener("pause",X),L.addEventListener("ended",ce),()=>{L.removeEventListener("loadedmetadata",H),L.removeEventListener("timeupdate",Z),L.removeEventListener("play",O),L.removeEventListener("pause",X),L.removeEventListener("ended",ce)}},[F,u,f,m,h]),p.useEffect(()=>{const L=y.current;L&&(L.volume=_?0:N)},[N,_]);const V=()=>{const L=y.current;L&&(v?L.pause():L.play())},A=L=>{const H=y.current;!H||!C||(H.currentTime=L*C,M(H.currentTime))},T=L=>{if(!w.current)return;const H=w.current.getBoundingClientRect();A((L.clientX-H.left)/H.width)},oe=L=>{var H,Z;B(!0),(Z=(H=L.target).setPointerCapture)==null||Z.call(H,L.pointerId)};p.useEffect(()=>{if(!F)return;const L=Z=>{if(!w.current)return;const O=w.current.getBoundingClientRect(),X=Math.max(0,Math.min(1,(Z.clientX-O.left)/O.width));A(X)},H=()=>B(!1);return document.addEventListener("pointermove",L),document.addEventListener("pointerup",H),()=>{document.removeEventListener("pointermove",L),document.removeEventListener("pointerup",H)}},[F,C]);const K=L=>{if(!y.current||!C)return;const H=L.shiftKey?10:5;L.key==="ArrowLeft"?(L.preventDefault(),y.current.currentTime=Math.max(0,R-H)):L.key==="ArrowRight"&&(L.preventDefault(),y.current.currentTime=Math.min(C,R+H))},Y=()=>D(L=>!L),ee=_||N===0?I.VolumeX:N<.5?I.Volume1:I.Volume2,z=C?R/C:0;return o.jsxs("div",{className:b(ri({size:g}),x),children:[o.jsx("audio",{ref:y,src:e,autoPlay:l,loop:c,preload:d}),n&&o.jsx("img",{src:n,alt:"",className:b("rounded object-cover shrink-0",g==="sm"?"h-8 w-8":g==="lg"?"h-14 w-14":"h-10 w-10")}),o.jsx("button",{type:"button",onClick:V,className:"shrink-0 flex items-center justify-center rounded-full bg-primary text-primary-foreground hover:bg-primary/90 transition-colors h-8 w-8","aria-label":v?P.audioPlayer_pause:P.audioPlayer_play,children:v?o.jsx(I.Pause,{className:q}):o.jsx(I.Play,{className:b(q,"ml-0.5")})}),o.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[(t||r)&&o.jsxs("div",{className:"flex items-center gap-2 text-xs leading-tight",children:[t&&o.jsx("span",{className:"font-medium truncate",children:t}),r&&o.jsx("span",{className:"text-muted-foreground truncate",children:r})]}),s?o.jsx(pr,{src:e,progress:z,height:g==="sm"?24:g==="lg"?40:32,barCount:60,onSeek:A}):o.jsxs("div",{ref:w,className:"relative h-1.5 bg-muted rounded-full cursor-pointer group",onClick:T,onPointerDown:oe,onKeyDown:K,role:"slider","aria-label":P.audioPlayer_seek,"aria-valuemin":0,"aria-valuemax":Math.round(C),"aria-valuenow":Math.round(R),"aria-valuetext":We(R),tabIndex:0,children:[o.jsx("div",{className:"absolute inset-y-0 left-0 bg-primary rounded-full transition-[width] duration-75",style:{width:`${z*100}%`}}),o.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 h-3 w-3 rounded-full bg-primary shadow opacity-0 group-hover:opacity-100 transition-opacity",style:{left:`${z*100}%`,transform:"translate(-50%, -50%)"}})]}),o.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground tabular-nums",children:[o.jsx("span",{children:We(R)}),o.jsx("span",{children:We(C)})]})]}),a&&o.jsxs("div",{className:"shrink-0 flex items-center gap-1.5 group/volume",children:[o.jsx("button",{type:"button",onClick:Y,className:"p-1 rounded hover:bg-accent transition-colors","aria-label":_?P.audioPlayer_unmute:P.audioPlayer_mute,children:o.jsx(ee,{className:q})}),o.jsx("input",{type:"range",min:0,max:1,step:.01,value:_?0:N,onChange:L=>{S(Number(L.target.value)),D(!1)},className:"w-16 h-1 accent-primary cursor-pointer opacity-0 group-hover/volume:opacity-100 transition-opacity","aria-label":P.audioPlayer_volume})]})]})}function xm({mimeType:e="audio/webm",maxDuration:t,showWaveform:r=!0,onRecordingComplete:n,onRecordingStart:s,onError:a,className:i}){const[l,c]=p.useState("idle"),[d,g]=p.useState(0),[u,f]=p.useState(null),[m,h]=p.useState(null),x=p.useRef(null),y=p.useRef([]),w=p.useRef(null),v=te(),j=p.useCallback(()=>{w.current&&(clearInterval(w.current),w.current=null),m&&(m.getTracks().forEach(D=>D.stop()),h(null)),u&&URL.revokeObjectURL(u)},[m,u]);p.useEffect(()=>j,[]);const R=()=>{w.current=setInterval(()=>{g(D=>{const F=D+1;return t&&F>=t&&k(),F})},1e3)},M=()=>{w.current&&(clearInterval(w.current),w.current=null)},C=async()=>{try{const D=await navigator.mediaDevices.getUserMedia({audio:!0});h(D),y.current=[],g(0),u&&(URL.revokeObjectURL(u),f(null));const F=MediaRecorder.isTypeSupported(e)?e:"",B=new MediaRecorder(D,F?{mimeType:F}:void 0);B.ondataavailable=P=>{P.data.size>0&&y.current.push(P.data)},B.onstop=()=>{const P=new Blob(y.current,{type:F||"audio/webm"}),q=URL.createObjectURL(P);f(q),n==null||n(P),D.getTracks().forEach(V=>V.stop()),h(null)},x.current=B,B.start(100),c("recording"),R(),s==null||s()}catch(D){a==null||a(D instanceof Error?D:new Error(String(D)))}},k=()=>{x.current&&x.current.state!=="inactive"&&x.current.stop(),M(),c("stopped")},N=()=>{x.current&&x.current.state==="recording"&&(x.current.pause(),M(),c("paused"))},S=()=>{x.current&&x.current.state==="paused"&&(x.current.resume(),R(),c("recording"))},_=()=>{j(),g(0),f(null),c("idle")};return o.jsx("div",{className:b("space-y-3 rounded-lg border bg-card p-4 text-card-foreground shadow-sm",i),children:l==="stopped"&&u?o.jsxs("div",{className:"space-y-3",children:[o.jsx(_n,{src:u,size:"sm"}),o.jsxs("button",{type:"button",onClick:_,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx(I.RotateCcw,{className:"h-4 w-4"}),v.audioRecorder_reRecord]})]}):o.jsxs(o.Fragment,{children:[r&&m&&l==="recording"&&o.jsx(pr,{stream:m,height:48,barCount:50,className:"rounded"}),o.jsxs("div",{className:"flex items-center justify-center gap-4",children:[l==="idle"&&o.jsxs("button",{type:"button",onClick:C,className:"flex items-center gap-2 px-4 py-2 rounded-full bg-destructive text-destructive-foreground hover:bg-destructive/90 transition-colors","aria-label":v.audioRecorder_startRecording,children:[o.jsx(I.Mic,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm",children:v.audioRecorder_startRecording})]}),(l==="recording"||l==="paused")&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"text-sm font-mono tabular-nums text-muted-foreground min-w-[60px] text-center","aria-live":"off",children:[l==="recording"&&o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-destructive animate-pulse mr-2"}),We(d)]}),l==="recording"?o.jsx("button",{type:"button",onClick:N,className:"p-2 rounded-full hover:bg-accent transition-colors","aria-label":v.audioRecorder_pauseRecording,children:o.jsx(I.Pause,{className:"h-5 w-5"})}):o.jsx("button",{type:"button",onClick:S,className:"p-2 rounded-full hover:bg-accent transition-colors","aria-label":v.audioRecorder_resumeRecording,children:o.jsx(I.Play,{className:"h-5 w-5"})}),o.jsx("button",{type:"button",onClick:k,className:"p-2 rounded-full bg-destructive text-destructive-foreground hover:bg-destructive/90 transition-colors","aria-label":v.audioRecorder_stopRecording,children:o.jsx(I.Square,{className:"h-5 w-5"})})]})]}),t&&(l==="recording"||l==="paused")&&o.jsx("div",{className:"w-full bg-muted rounded-full h-1",children:o.jsx("div",{className:"bg-destructive rounded-full h-1 transition-[width] duration-1000",style:{width:`${Math.min(100,d/t*100)}%`}})})]})})}function bm({tracks:e,showWaveform:t=!1,defaultRepeatMode:r="none",defaultShuffle:n=!1,autoPlay:s=!1,onTrackChange:a,onPlayStateChange:i,className:l}){const[c,d]=p.useState(0),[g,u]=p.useState(r),[f,m]=p.useState(n),[h,x]=p.useState([]),y=te();p.useEffect(()=>{if(f){const S=Array.from({length:e.length},(_,D)=>D);for(let _=S.length-1;_>0;_--){const D=Math.floor(Math.random()*(_+1));[S[_],S[D]]=[S[D],S[_]]}x(S)}},[f,e.length]);const w=p.useCallback((S,_=1)=>{if(f){const B=h.indexOf(S)+_;return B>=0&&B<h.length?h[B]:g==="all"?_===1?h[0]:h[h.length-1]:null}const D=S+_;return D>=0&&D<e.length?D:g==="all"?_===1?0:e.length-1:null},[f,h,e.length,g]),v=S=>{d(S),a==null||a(e[S],S)},j=()=>{if(g==="one")return;const S=w(c,1);S!==null&&v(S)},R=()=>{const S=w(c,-1);S!==null&&v(S)},M=()=>{const S=w(c,1);S!==null&&v(S)},C=()=>{u(S=>S==="none"?"all":S==="all"?"one":"none")},k=g==="none"?y.audioPlaylist_repeatOff:g==="all"?y.audioPlaylist_repeatAll:y.audioPlaylist_repeatOne,N=e[c];return N?o.jsxs("div",{className:b("rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden",l),children:[o.jsxs("div",{className:"p-3 border-b space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-center gap-3",children:[o.jsx("button",{type:"button",onClick:()=>m(S=>!S),className:b("p-1.5 rounded hover:bg-accent transition-colors",f&&"text-primary"),"aria-label":y.audioPlaylist_shuffle,"aria-pressed":f,children:o.jsx(I.Shuffle,{className:"h-4 w-4"})}),o.jsx("button",{type:"button",onClick:R,className:"p-1.5 rounded hover:bg-accent transition-colors","aria-label":y.audioPlaylist_previousTrack,children:o.jsx(I.SkipBack,{className:"h-4 w-4"})}),o.jsx("button",{type:"button",onClick:M,className:"p-1.5 rounded hover:bg-accent transition-colors","aria-label":y.audioPlaylist_nextTrack,children:o.jsx(I.SkipForward,{className:"h-4 w-4"})}),o.jsx("button",{type:"button",onClick:C,className:b("p-1.5 rounded hover:bg-accent transition-colors",g!=="none"&&"text-primary"),"aria-label":k,children:g==="one"?o.jsx(I.Repeat1,{className:"h-4 w-4"}):o.jsx(I.Repeat,{className:"h-4 w-4"})})]}),o.jsx(_n,{src:N.src,title:N.title,artist:N.artist,albumArt:N.albumArt,showWaveform:t,autoPlay:s||c>0,loop:g==="one",onEnded:j,onPlay:()=>i==null?void 0:i(!0),onPause:()=>i==null?void 0:i(!1),size:"sm",className:"border-0 shadow-none p-0"},N.id)]}),o.jsx(cr,{className:"max-h-64",children:o.jsx("div",{role:"list",className:"divide-y",children:e.map((S,_)=>o.jsxs("button",{type:"button",role:"listitem",onClick:()=>v(_),"aria-current":_===c?"true":void 0,className:b("w-full flex items-center gap-3 px-3 py-2 text-left hover:bg-accent/50 transition-colors",_===c&&"bg-accent"),children:[S.albumArt?o.jsx("img",{src:S.albumArt,alt:"",className:"h-8 w-8 rounded object-cover shrink-0"}):o.jsx("div",{className:"h-8 w-8 rounded bg-muted flex items-center justify-center shrink-0",children:o.jsx(I.Music,{className:"h-4 w-4 text-muted-foreground"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium truncate",children:S.title}),S.artist&&o.jsx("p",{className:"text-xs text-muted-foreground truncate",children:S.artist})]}),S.duration!==void 0&&o.jsx("span",{className:"text-xs text-muted-foreground tabular-nums shrink-0",children:We(S.duration)})]},S.id))})}),e.length>1&&o.jsx("div",{className:"px-3 py-1.5 border-t text-xs text-muted-foreground text-center",children:De(y.audioPlaylist_trackOf,{current:String(c+1),total:String(e.length)})})]}):null}function hr({src:e,poster:t,showControls:r=!0,controlsTimeout:n=3e3,enablePiP:s=!0,enableFullscreen:a=!0,enablePlaybackRate:i=!0,playbackRates:l=[.5,.75,1,1.25,1.5,2],tracks:c,aspectRatio:d="16/9",autoPlay:g=!1,loop:u=!1,muted:f=!1,preload:m="metadata",onPlay:h,onPause:x,onEnded:y,onTimeUpdate:w,onFullscreenChange:v,className:j}){const R=p.useRef(null),M=p.useRef(null),C=p.useRef(null),k=p.useRef(null),[N,S]=p.useState(!1),[_,D]=p.useState(0),[F,B]=p.useState(0),[P,q]=p.useState(0),[V,A]=p.useState(1),[T,oe]=p.useState(f),[K,Y]=p.useState(!1),[ee,z]=p.useState(!0),[L,H]=p.useState(!1),[Z,O]=p.useState(1),[X,ce]=p.useState(!1),ae=te(),ie=typeof document<"u"&&"pictureInPictureEnabled"in document;p.useEffect(()=>{const $=M.current;if(!$)return;const re=()=>B($.duration),Ne=()=>{X||(D($.currentTime),w==null||w($.currentTime)),$.buffered.length>0&&q($.buffered.end($.buffered.length-1))},Xe=()=>{S(!0),h==null||h()},Ye=()=>{S(!1),x==null||x()},_e=()=>{S(!1),y==null||y()};return $.addEventListener("loadedmetadata",re),$.addEventListener("timeupdate",Ne),$.addEventListener("play",Xe),$.addEventListener("pause",Ye),$.addEventListener("ended",_e),()=>{$.removeEventListener("loadedmetadata",re),$.removeEventListener("timeupdate",Ne),$.removeEventListener("play",Xe),$.removeEventListener("pause",Ye),$.removeEventListener("ended",_e)}},[X,h,x,y,w]),p.useEffect(()=>{const $=M.current;$&&($.volume=T?0:V)},[V,T]),p.useEffect(()=>{const $=()=>{const re=!!document.fullscreenElement;Y(re),v==null||v(re)};return document.addEventListener("fullscreenchange",$),()=>document.removeEventListener("fullscreenchange",$)},[v]);const G=p.useCallback(()=>{z(!0),k.current&&clearTimeout(k.current),N&&(k.current=setTimeout(()=>z(!1),n))},[N,n]),le=()=>{const $=M.current;$&&(N?$.pause():$.play())},de=$=>{const re=M.current;!re||!F||(re.currentTime=$*F,D(re.currentTime))},we=$=>{if(!C.current)return;const re=C.current.getBoundingClientRect();de(($.clientX-re.left)/re.width)},Pe=$=>{var re,Ne;ce(!0),(Ne=(re=$.target).setPointerCapture)==null||Ne.call(re,$.pointerId)};p.useEffect(()=>{if(!X)return;const $=Ne=>{if(!C.current)return;const Xe=C.current.getBoundingClientRect();de(Math.max(0,Math.min(1,(Ne.clientX-Xe.left)/Xe.width)))},re=()=>ce(!1);return document.addEventListener("pointermove",$),document.addEventListener("pointerup",re),()=>{document.removeEventListener("pointermove",$),document.removeEventListener("pointerup",re)}},[X,F]);const ye=()=>{var $,re;R.current&&(document.fullscreenElement?document.exitFullscreen():(re=($=R.current).requestFullscreen)==null||re.call($))},$e=async()=>{const $=M.current;if($)try{document.pictureInPictureElement?await document.exitPictureInPicture():await $.requestPictureInPicture()}catch{}},xe=()=>oe($=>!$),Oe=$=>{const re=M.current;re&&(re.playbackRate=$),O($),H(!1)},Qe=$=>{const re=M.current;if(re){switch($.key){case" ":case"k":$.preventDefault(),le();break;case"f":$.preventDefault(),ye();break;case"m":$.preventDefault(),xe();break;case"ArrowLeft":$.preventDefault(),re.currentTime=Math.max(0,re.currentTime-5);break;case"ArrowRight":$.preventDefault(),re.currentTime=Math.min(F,re.currentTime+5);break;case"ArrowUp":$.preventDefault(),A(Ne=>Math.min(1,Ne+.1)),oe(!1);break;case"ArrowDown":$.preventDefault(),A(Ne=>Math.max(0,Ne-.1));break;case"c":if($.preventDefault(),re.textTracks.length>0){const Ne=re.textTracks[0];Ne.mode=Ne.mode==="showing"?"hidden":"showing"}break}G()}},je=T||V===0?I.VolumeX:V<.5?I.Volume1:I.Volume2,Fe=F?_/F:0,gt=F?P/F:0;return o.jsxs("div",{ref:R,className:b("relative group bg-black rounded-lg overflow-hidden",j),style:{aspectRatio:d},onMouseMove:G,onMouseLeave:()=>N&&z(!1),onKeyDown:Qe,tabIndex:0,role:"application","aria-label":ae.videoPlayer_label,children:[o.jsx("video",{ref:M,src:e,poster:t,autoPlay:g,loop:u,muted:f,preload:m,className:"w-full h-full object-contain",onClick:le,onDoubleClick:ye,children:c==null?void 0:c.map(($,re)=>o.jsx("track",{src:$.src,kind:$.kind,srcLang:$.srcLang,label:$.label,default:$.default},re))}),!N&&r&&o.jsx("button",{type:"button",onClick:le,className:"absolute inset-0 flex items-center justify-center z-10","aria-label":ae.videoPlayer_play,children:o.jsx("div",{className:"h-16 w-16 rounded-full bg-black/50 flex items-center justify-center backdrop-blur-sm hover:bg-black/70 transition-colors",children:o.jsx(I.Play,{className:"h-8 w-8 text-white ml-1"})})}),r&&o.jsxs("div",{className:b("absolute bottom-0 left-0 right-0 z-20 bg-gradient-to-t from-black/80 to-transparent pt-8 pb-2 px-3 transition-opacity duration-200",ee||!N?"opacity-100":"opacity-0 pointer-events-none"),children:[o.jsxs("div",{ref:C,className:"relative h-1 bg-white/20 rounded-full cursor-pointer mb-2 group/seek",onClick:we,onPointerDown:Pe,role:"slider","aria-label":ae.videoPlayer_seek,"aria-valuemin":0,"aria-valuemax":Math.round(F),"aria-valuenow":Math.round(_),"aria-valuetext":We(_),tabIndex:0,children:[o.jsx("div",{className:"absolute inset-y-0 left-0 bg-white/30 rounded-full",style:{width:`${gt*100}%`}}),o.jsx("div",{className:"absolute inset-y-0 left-0 bg-primary rounded-full",style:{width:`${Fe*100}%`}}),o.jsx("div",{className:"absolute top-1/2 h-3 w-3 rounded-full bg-primary shadow opacity-0 group-hover/seek:opacity-100 transition-opacity",style:{left:`${Fe*100}%`,transform:"translate(-50%, -50%)"}})]}),o.jsxs("div",{className:"flex items-center gap-2 text-white",children:[o.jsx("button",{type:"button",onClick:le,className:"p-1 hover:bg-white/10 rounded transition-colors","aria-label":N?ae.videoPlayer_pause:ae.videoPlayer_play,children:N?o.jsx(I.Pause,{className:"h-5 w-5"}):o.jsx(I.Play,{className:"h-5 w-5"})}),o.jsxs("span",{className:"text-xs tabular-nums",children:[We(_)," / ",We(F)]}),o.jsx("div",{className:"flex-1"}),o.jsxs("div",{className:"flex items-center gap-1 group/vol",children:[o.jsx("button",{type:"button",onClick:xe,className:"p-1 hover:bg-white/10 rounded transition-colors","aria-label":T?ae.videoPlayer_unmute:ae.videoPlayer_mute,children:o.jsx(je,{className:"h-5 w-5"})}),o.jsx("input",{type:"range",min:0,max:1,step:.01,value:T?0:V,onChange:$=>{A(Number($.target.value)),oe(!1)},className:"w-16 h-1 accent-white cursor-pointer opacity-0 group-hover/vol:opacity-100 transition-opacity","aria-label":ae.videoPlayer_volume})]}),i&&o.jsxs("div",{className:"relative",children:[o.jsxs("button",{type:"button",onClick:()=>H($=>!$),className:"px-1.5 py-0.5 text-xs hover:bg-white/10 rounded transition-colors","aria-label":ae.videoPlayer_playbackSpeed,children:[Z,"x"]}),L&&o.jsx("div",{className:"absolute bottom-full right-0 mb-1 bg-black/90 rounded-md border border-white/10 py-1 min-w-[60px]",children:l.map($=>o.jsxs("button",{type:"button",onClick:()=>Oe($),className:b("block w-full px-3 py-1 text-xs text-left hover:bg-white/10 transition-colors",$===Z&&"text-primary"),children:[$,"x"]},$))})]}),c&&c.length>0&&o.jsx("button",{type:"button",onClick:()=>{const $=M.current;if($&&$.textTracks.length>0){const re=$.textTracks[0];re.mode=re.mode==="showing"?"hidden":"showing"}},className:"p-1 hover:bg-white/10 rounded transition-colors","aria-label":ae.videoPlayer_subtitles,children:o.jsx(I.Subtitles,{className:"h-5 w-5"})}),s&&ie&&o.jsx("button",{type:"button",onClick:$e,className:"p-1 hover:bg-white/10 rounded transition-colors","aria-label":ae.videoPlayer_pictureInPicture,children:o.jsx(I.PictureInPicture2,{className:"h-5 w-5"})}),a&&o.jsx("button",{type:"button",onClick:ye,className:"p-1 hover:bg-white/10 rounded transition-colors","aria-label":K?ae.videoPlayer_exitFullscreen:ae.videoPlayer_fullscreen,children:K?o.jsx(I.Minimize,{className:"h-5 w-5"}):o.jsx(I.Maximize,{className:"h-5 w-5"})})]})]})]})}function vm({source:e="camera",videoConstraints:t,audioConstraints:r=!0,mimeType:n="video/webm",maxDuration:s,showTimer:a=!0,mirrored:i,onRecordingComplete:l,onRecordingStart:c,onError:d,className:g}){const[u,f]=p.useState("idle"),[m,h]=p.useState(0),[x,y]=p.useState(null),[w,v]=p.useState(null),j=p.useRef(null),R=p.useRef(null),M=p.useRef([]),C=p.useRef(null),k=te(),N=i!==void 0?i:e==="camera",S=p.useCallback(()=>{C.current&&(clearInterval(C.current),C.current=null),w&&(w.getTracks().forEach(T=>T.stop()),v(null)),x&&URL.revokeObjectURL(x)},[w,x]);p.useEffect(()=>S,[]);const _=()=>{C.current=setInterval(()=>{h(T=>{const oe=T+1;return s&&oe>=s&&P(),oe})},1e3)},D=()=>{C.current&&(clearInterval(C.current),C.current=null)},F=async()=>{try{let T;e==="screen"?T=await navigator.mediaDevices.getDisplayMedia({video:!0,audio:r}):T=await navigator.mediaDevices.getUserMedia({video:t||!0,audio:r}),T.getVideoTracks().forEach(oe=>{oe.addEventListener("ended",()=>{S(),f("idle")})}),v(T),f("preview"),j.current&&(j.current.srcObject=T)}catch(T){d==null||d(T instanceof Error?T:new Error(String(T)))}};p.useEffect(()=>{j.current&&w&&(u==="preview"||u==="recording"||u==="paused")&&(j.current.srcObject=w)},[w,u]);const B=()=>{if(!w)return;M.current=[],h(0),x&&(URL.revokeObjectURL(x),y(null));const T=MediaRecorder.isTypeSupported(n)?n:"",oe=new MediaRecorder(w,T?{mimeType:T}:void 0);oe.ondataavailable=K=>{K.data.size>0&&M.current.push(K.data)},oe.onstop=()=>{const K=new Blob(M.current,{type:T||"video/webm"}),Y=URL.createObjectURL(K);y(Y),l==null||l(K),w.getTracks().forEach(ee=>ee.stop()),v(null)},R.current=oe,oe.start(100),f("recording"),_(),c==null||c()},P=()=>{R.current&&R.current.state!=="inactive"&&R.current.stop(),D(),f("stopped")},q=()=>{R.current&&R.current.state==="recording"&&(R.current.pause(),D(),f("paused"))},V=()=>{R.current&&R.current.state==="paused"&&(R.current.resume(),_(),f("recording"))},A=()=>{S(),h(0),y(null),f("idle")};return o.jsx("div",{className:b("space-y-3 rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden",g),children:u==="stopped"&&x?o.jsxs("div",{className:"space-y-3",children:[o.jsx(hr,{src:x,aspectRatio:"16/9"}),o.jsx("div",{className:"px-4 pb-3",children:o.jsxs("button",{type:"button",onClick:A,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx(I.RotateCcw,{className:"h-4 w-4"}),k.videoRecorder_reRecord]})})]}):u==="idle"?o.jsx("div",{className:"flex items-center justify-center gap-3 p-8",children:o.jsx("button",{type:"button",onClick:F,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",children:e==="screen"?o.jsxs(o.Fragment,{children:[o.jsx(I.Monitor,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm",children:k.videoRecorder_shareScreen})]}):o.jsxs(o.Fragment,{children:[o.jsx(I.Camera,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm",children:k.videoRecorder_startCamera})]})})}):o.jsxs("div",{className:"relative",children:[o.jsx("video",{ref:j,autoPlay:!0,muted:!0,playsInline:!0,className:b("w-full",N&&"scale-x-[-1]"),style:{aspectRatio:"16/9"},"aria-label":e==="camera"?k.videoRecorder_cameraPreview:k.videoRecorder_screenPreview}),a&&(u==="recording"||u==="paused")&&o.jsxs("div",{className:"absolute top-3 left-3 flex items-center gap-2 px-2 py-1 rounded bg-black/60 text-white text-sm tabular-nums",children:[u==="recording"&&o.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500 animate-pulse"}),We(m)]}),o.jsxs("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 flex items-center gap-3",children:[u==="preview"&&o.jsx("button",{type:"button",onClick:B,className:"h-12 w-12 rounded-full bg-red-500 hover:bg-red-600 flex items-center justify-center transition-colors border-4 border-white/80","aria-label":k.videoRecorder_startRecording,children:o.jsx(I.Circle,{className:"h-5 w-5 text-white fill-white"})}),u==="recording"&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:q,className:"p-2 rounded-full bg-black/50 hover:bg-black/70 text-white transition-colors","aria-label":k.videoRecorder_pauseRecording,children:o.jsx(I.Pause,{className:"h-5 w-5"})}),o.jsx("button",{type:"button",onClick:P,className:"h-12 w-12 rounded-full bg-red-500 hover:bg-red-600 flex items-center justify-center transition-colors border-4 border-white/80","aria-label":k.videoRecorder_stopRecording,children:o.jsx(I.Square,{className:"h-5 w-5 text-white fill-white"})})]}),u==="paused"&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:V,className:"p-2 rounded-full bg-black/50 hover:bg-black/70 text-white transition-colors","aria-label":k.videoRecorder_resumeRecording,children:o.jsx(I.Play,{className:"h-5 w-5"})}),o.jsx("button",{type:"button",onClick:P,className:"h-12 w-12 rounded-full bg-red-500 hover:bg-red-600 flex items-center justify-center transition-colors border-4 border-white/80","aria-label":k.videoRecorder_stopRecording,children:o.jsx(I.Square,{className:"h-5 w-5 text-white fill-white"})})]})]}),s&&(u==="recording"||u==="paused")&&o.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-1 bg-white/20",children:o.jsx("div",{className:"h-full bg-red-500 transition-[width] duration-1000",style:{width:`${Math.min(100,m/s*100)}%`}})})]})})}const Mn=p.forwardRef(({src:e,poster:t,title:r,duration:n,clickAction:s="inline",aspectRatio:a="16/9",showDuration:i=!0,showPlayButton:l=!0,onPlay:c,className:d,...g},u)=>{const[f,m]=p.useState(!1),[h,x]=p.useState(null),y=te();p.useEffect(()=>{if(t||!e)return;const M=document.createElement("video");M.crossOrigin="anonymous",M.preload="metadata",M.muted=!0;const C=()=>{try{const k=document.createElement("canvas");k.width=M.videoWidth,k.height=M.videoHeight;const N=k.getContext("2d");N&&(N.drawImage(M,0,0),x(k.toDataURL("image/jpeg",.7)))}catch{}M.remove()};return M.addEventListener("seeked",C,{once:!0}),M.addEventListener("loadedmetadata",()=>{M.currentTime=Math.min(1,M.duration*.1)},{once:!0}),M.src=e,()=>{M.removeEventListener("seeked",C),M.remove()}},[e,t]);const w=()=>{s==="inline"?(m(!0),c==null||c()):s==="none"&&(c==null||c())},v=M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),w())},j=t||h,R=r?De(y.videoThumbnail_play,{title:r}):y.videoPlayer_play;return f&&s==="inline"?o.jsx("div",{ref:u,className:b("rounded-lg overflow-hidden bg-black",d),style:{aspectRatio:a},...g,children:o.jsx(hr,{src:e,autoPlay:!0,aspectRatio:a})}):o.jsxs("div",{ref:u,className:b("relative rounded-lg overflow-hidden bg-muted cursor-pointer group",d),style:{aspectRatio:a},onClick:w,onKeyDown:v,role:"button",tabIndex:0,"aria-label":R,...g,children:[j?o.jsx("img",{src:j,alt:r||"",className:"w-full h-full object-cover",draggable:!1}):o.jsx("div",{className:"w-full h-full bg-muted flex items-center justify-center",children:o.jsx(I.Play,{className:"h-8 w-8 text-muted-foreground"})}),l&&o.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:o.jsx("div",{className:"h-12 w-12 rounded-full bg-black/50 flex items-center justify-center backdrop-blur-sm group-hover:bg-black/70 group-hover:scale-110 transition-all",children:o.jsx(I.Play,{className:"h-6 w-6 text-white ml-0.5"})})}),i&&n!==void 0&&o.jsx("span",{className:"absolute bottom-2 right-2 px-1.5 py-0.5 rounded bg-black/70 text-white text-xs tabular-nums",children:We(n)}),r&&o.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/60 to-transparent p-2 pt-6",children:o.jsx("p",{className:"text-white text-sm font-medium truncate",children:r})})]})});Mn.displayName="VideoThumbnail";const ni=p.forwardRef(({videos:e,columns:t=3,gap:r=4,aspectRatio:n="16/9",clickAction:s="lightbox",onVideoSelect:a,className:i,...l},c)=>{const[d,g]=p.useState(null),u=te(),f=typeof t=="number"?t:t.md||t.sm||3,m=(v,j)=>{a==null||a(v,j),s==="lightbox"&&g(j)},h=()=>g(null),x=()=>{d!==null&&g(d>0?d-1:e.length-1)},y=()=>{d!==null&&g(d<e.length-1?d+1:0)};p.useEffect(()=>{if(d===null)return;const v=j=>{switch(j.key){case"Escape":h();break;case"ArrowLeft":x();break;case"ArrowRight":y();break}};return document.addEventListener("keydown",v),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",v),document.body.style.overflow=""}},[d]);const w=typeof t=="number"?{gridTemplateColumns:`repeat(${t}, minmax(0, 1fr))`}:{gridTemplateColumns:`repeat(${f}, minmax(0, 1fr))`};return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:c,className:b("grid",i),style:{...w,gap:`${r*4}px`},role:"list","aria-label":u.videoGallery_label,...l,children:e.map((v,j)=>o.jsx(Mn,{src:v.src,poster:v.poster,title:v.title,duration:v.duration,aspectRatio:n,clickAction:"none",onPlay:()=>m(v,j),role:"listitem"},v.id))}),s==="lightbox"&&d!==null&&e[d]&&Hr.createPortal(o.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/90",onClick:v=>{v.target===v.currentTarget&&h()},role:"dialog","aria-modal":"true","aria-label":u.videoGallery_label,children:[o.jsx("button",{type:"button",onClick:h,className:"absolute top-4 right-4 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors","aria-label":u.common_close,children:o.jsx(I.X,{className:"h-5 w-5"})}),e.length>1&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:x,className:"absolute left-4 top-1/2 -translate-y-1/2 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors","aria-label":u.common_previous,children:o.jsx(I.ChevronLeft,{className:"h-6 w-6"})}),o.jsx("button",{type:"button",onClick:y,className:"absolute right-4 top-1/2 -translate-y-1/2 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors","aria-label":u.common_next,children:o.jsx(I.ChevronRight,{className:"h-6 w-6"})})]}),o.jsxs("div",{className:"w-full max-w-4xl px-4",children:[o.jsx(hr,{src:e[d].src,poster:e[d].poster,autoPlay:!0,aspectRatio:n},e[d].id),e[d].title&&o.jsx("p",{className:"text-white text-sm mt-3 text-center",children:e[d].title})]}),o.jsxs("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 text-white/70 text-sm tabular-nums",children:[d+1," / ",e.length]})]}),document.body)]})});ni.displayName="VideoGallery";const wm={contain:"object-contain",cover:"object-cover",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"},oi=p.forwardRef(({src:e,alt:t,fallbackSrc:r,placeholder:n,showSkeleton:s=!0,lazy:a=!0,rootMargin:i="200px",aspectRatio:l,zoomOnHover:c=!1,zoomScale:d=1.5,zoomOnClick:g=!1,fit:u="cover",className:f,style:m,onLoad:h,onError:x,...y},w)=>{const[v,j]=p.useState("loading"),[R,M]=p.useState(!a),[C,k]=p.useState(e),[N,S]=p.useState(!1),_=p.useRef(null),D=te();p.useEffect(()=>{k(e),j("loading")},[e]),p.useEffect(()=>{if(!a||!_.current)return;const A=new IntersectionObserver(([T])=>{T.isIntersecting&&(M(!0),A.disconnect())},{rootMargin:i});return A.observe(_.current),()=>A.disconnect()},[a,i]);const F=A=>{j("loaded"),h==null||h(A)},B=A=>{r&&C!==r?k(r):j("error"),x==null||x(A)},P=()=>{g&&S(A=>!A)},q=A=>{g&&(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),S(T=>!T))},V=l!==void 0?{aspectRatio:typeof l=="number"?`${l}`:l}:{};return o.jsxs("div",{ref:_,className:b("relative overflow-hidden inline-block",g&&"cursor-zoom-in",f),style:{...V,...m},onClick:P,onKeyDown:q,tabIndex:g?0:void 0,role:g?"button":void 0,"aria-label":g?D.image_zoomIn:void 0,children:[R&&C?o.jsx("img",{ref:w,src:C,alt:t,className:b("w-full h-full transition-transform duration-300",wm[u],c&&"hover:scale-[var(--zoom-scale)]",N&&"scale-[var(--zoom-scale)]",v==="loading"&&"opacity-0"),style:{"--zoom-scale":d},onLoad:F,onError:B,...y}):null,v==="loading"&&R&&o.jsx("div",{className:"absolute inset-0",children:n||s&&o.jsx("div",{className:"w-full h-full animate-pulse bg-muted rounded-md"})}),v==="error"&&o.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/50 text-muted-foreground text-sm",children:D.image_failedToLoad}),g&&v==="loaded"&&!N&&o.jsx("div",{className:"absolute bottom-2 right-2 p-1.5 rounded-full bg-black/50 text-white opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none",children:o.jsx(I.ZoomIn,{className:"h-4 w-4"})})]})});oi.displayName="NUIImage";function ym({images:e,open:t,defaultIndex:r=0,onClose:n,onIndexChange:s,enableZoom:a=!0,enableKeyboard:i=!0,showCounter:l=!0,showThumbnails:c=!1,className:d,children:g}){const[u,f]=p.useState(!1),[m,h]=p.useState(r),[x,y]=p.useState(!1),[w,v]=p.useState(null),j=p.useRef(null),R=p.useRef(null),M=te(),C=t!==void 0?t:u,k=A=>{j.current=document.activeElement,A!==void 0&&h(A),f(!0)},N=()=>{var A;f(!1),y(!1),n==null||n(),(A=j.current)==null||A.focus()},S=p.useCallback(A=>{h(A),y(!1),s==null||s(A)},[s]),_=p.useCallback(()=>{S(m>0?m-1:e.length-1)},[m,e.length,S]),D=p.useCallback(()=>{S(m<e.length-1?m+1:0)},[m,e.length,S]);p.useEffect(()=>{if(!C||!i)return;const A=T=>{switch(T.key){case"Escape":N();break;case"ArrowLeft":_();break;case"ArrowRight":D();break}};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[C,i,_,D]),p.useEffect(()=>{var A;return C?(document.body.style.overflow="hidden",(A=R.current)==null||A.focus()):document.body.style.overflow="",()=>{document.body.style.overflow=""}},[C]);const F=A=>{A.target===R.current&&N()},B=A=>{v(A.touches[0].clientX)},P=A=>{if(w===null)return;const T=w-A.changedTouches[0].clientX;Math.abs(T)>50&&(T>0?D():_()),v(null)},q=()=>{a&&y(A=>!A)};if(!C)return g?o.jsx("div",{onClick:()=>k(r),className:"cursor-pointer",children:g}):null;const V=e[m];return V?Hr.createPortal(o.jsxs("div",{ref:R,className:b("fixed inset-0 z-50 flex flex-col items-center justify-center bg-black/90",d),onClick:F,onTouchStart:B,onTouchEnd:P,role:"dialog","aria-modal":"true","aria-label":M.lightbox_label,tabIndex:-1,children:[o.jsx("button",{type:"button",onClick:N,className:"absolute top-4 right-4 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors","aria-label":M.common_close,children:o.jsx(I.X,{className:"h-5 w-5"})}),l&&e.length>1&&o.jsx("div",{className:"absolute top-4 left-1/2 -translate-x-1/2 text-white/80 text-sm tabular-nums","aria-live":"polite",children:De(M.lightbox_imageOf,{current:String(m+1),total:String(e.length)})}),a&&o.jsx("button",{type:"button",onClick:()=>y(A=>!A),className:"absolute top-4 right-14 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors","aria-label":x?M.lightbox_zoomOut:M.lightbox_zoomIn,children:x?o.jsx(I.ZoomOut,{className:"h-5 w-5"}):o.jsx(I.ZoomIn,{className:"h-5 w-5"})}),e.length>1&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:_,className:"absolute left-4 top-1/2 -translate-y-1/2 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors","aria-label":M.common_previous,children:o.jsx(I.ChevronLeft,{className:"h-6 w-6"})}),o.jsx("button",{type:"button",onClick:D,className:"absolute right-4 top-1/2 -translate-y-1/2 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors","aria-label":M.common_next,children:o.jsx(I.ChevronRight,{className:"h-6 w-6"})})]}),o.jsx("div",{className:b("flex-1 flex items-center justify-center w-full",x?"overflow-auto cursor-zoom-out":"cursor-zoom-in"),onDoubleClick:q,children:o.jsx("img",{src:V.src,alt:V.alt||"",className:b("transition-transform duration-200 select-none",x?"max-w-none max-h-none":"max-h-[85vh] max-w-[90vw] object-contain"),style:x?{transform:"scale(2)"}:void 0,draggable:!1})}),(V.title||V.description)&&o.jsxs("div",{className:"absolute bottom-16 left-1/2 -translate-x-1/2 text-center text-white max-w-lg px-4",children:[V.title&&o.jsx("p",{className:"text-sm font-medium",children:V.title}),V.description&&o.jsx("p",{className:"text-xs text-white/70 mt-1",children:V.description})]}),c&&e.length>1&&o.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-2 max-w-[90vw] overflow-x-auto px-4 py-2",children:e.map((A,T)=>o.jsx("button",{type:"button",onClick:()=>S(T),className:b("shrink-0 w-12 h-12 rounded overflow-hidden border-2 transition-colors",T===m?"border-white":"border-transparent opacity-60 hover:opacity-100"),children:o.jsx("img",{src:A.src,alt:"",className:"w-full h-full object-cover"})},T))})]}),document.body):null}function jm({src:e,aspectRatio:t,minSize:r=50,maxSize:n,initialCrop:s,outputFormat:a="image/png",outputQuality:i=.92,onCropComplete:l,onCropChange:c,showGrid:d=!0,circular:g=!1,className:u}){const f=p.useRef(null),m=p.useRef(null),[h,x]=p.useState(!1),[y,w]=p.useState({width:0,height:0}),[v,j]=p.useState(s||{x:.15,y:.15,width:.7,height:.7}),[R,M]=p.useState(null),[C,k]=p.useState(null),[N,S]=p.useState({x:0,y:0}),[_,D]=p.useState({x:0,y:0,width:0,height:0}),F=te();p.useEffect(()=>{s&&j(s)},[s]);const B=()=>{m.current&&(w({width:m.current.naturalWidth,height:m.current.naturalHeight}),x(!0))},P=p.useCallback(K=>{let{x:Y,y:ee,width:z,height:L}=K;const H=r/(y.width||1),Z=r/(y.height||1);if(z=Math.max(H,z),L=Math.max(Z,L),n&&(z=Math.min(n/(y.width||1),z),L=Math.min(n/(y.height||1),L)),z=Math.min(1,z),L=Math.min(1,L),t){const O=(y.width||1)/(y.height||1),X=t/O;z/L>X?z=L*X:L=z/X}return Y=Math.max(0,Math.min(1-z,Y)),ee=Math.max(0,Math.min(1-L,ee)),{x:Y,y:ee,width:z,height:L}},[y,r,n,t]);p.useEffect(()=>{if(!R)return;const K=ee=>{ee.preventDefault();const z=f.current;if(!z)return;const L=z.getBoundingClientRect(),H=(ee.clientX-N.x)/L.width,Z=(ee.clientY-N.y)/L.height;let O;if(R==="move")O=P({..._,x:_.x+H,y:_.y+Z});else{switch(O={..._},C){case"se":O.width=_.width+H,O.height=_.height+Z;break;case"sw":O.x=_.x+H,O.width=_.width-H,O.height=_.height+Z;break;case"ne":O.y=_.y+Z,O.width=_.width+H,O.height=_.height-Z;break;case"nw":O.x=_.x+H,O.y=_.y+Z,O.width=_.width-H,O.height=_.height-Z;break;case"n":O.y=_.y+Z,O.height=_.height-Z;break;case"s":O.height=_.height+Z;break;case"w":O.x=_.x+H,O.width=_.width-H;break;case"e":O.width=_.width+H;break}O=P(O)}j(O),c==null||c(O)},Y=()=>{M(null),k(null)};return document.addEventListener("pointermove",K),document.addEventListener("pointerup",Y),()=>{document.removeEventListener("pointermove",K),document.removeEventListener("pointerup",Y)}},[R,N,_,C,P,c]);const q=(K,Y,ee)=>{K.preventDefault(),K.stopPropagation(),M(Y),k(ee||null),S({x:K.clientX,y:K.clientY}),D({...v})},V=K=>{const Y=K.shiftKey?.05:.01;let ee={...v};if(K.shiftKey&&!K.altKey)switch(K.key){case"ArrowLeft":ee.width-=Y;break;case"ArrowRight":ee.width+=Y;break;case"ArrowUp":ee.height-=Y;break;case"ArrowDown":ee.height+=Y;break;default:return}else switch(K.key){case"ArrowLeft":ee.x-=Y;break;case"ArrowRight":ee.x+=Y;break;case"ArrowUp":ee.y-=Y;break;case"ArrowDown":ee.y+=Y;break;case"Enter":A();return;default:return}K.preventDefault(),ee=P(ee),j(ee),c==null||c(ee)},A=()=>{const K=m.current;if(!K||!l)return;const Y=document.createElement("canvas"),ee=v.x*K.naturalWidth,z=v.y*K.naturalHeight,L=v.width*K.naturalWidth,H=v.height*K.naturalHeight;Y.width=L,Y.height=H;const Z=Y.getContext("2d");if(!Z)return;g&&(Z.beginPath(),Z.arc(L/2,H/2,Math.min(L,H)/2,0,Math.PI*2),Z.closePath(),Z.clip()),Z.drawImage(K,ee,z,L,H,0,0,L,H);const O=Y.toDataURL(a,i);Y.toBlob(X=>{X&&l(X,O)},a,i)},T=()=>{const K=s||{x:.15,y:.15,width:.7,height:.7};j(P(K)),c==null||c(K)},oe=[{handle:"nw",pos:"top-0 left-0 -translate-x-1/2 -translate-y-1/2",cursor:"cursor-nw-resize"},{handle:"ne",pos:"top-0 right-0 translate-x-1/2 -translate-y-1/2",cursor:"cursor-ne-resize"},{handle:"sw",pos:"bottom-0 left-0 -translate-x-1/2 translate-y-1/2",cursor:"cursor-sw-resize"},{handle:"se",pos:"bottom-0 right-0 translate-x-1/2 translate-y-1/2",cursor:"cursor-se-resize"},{handle:"n",pos:"top-0 left-1/2 -translate-x-1/2 -translate-y-1/2",cursor:"cursor-n-resize"},{handle:"s",pos:"bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2",cursor:"cursor-s-resize"},{handle:"w",pos:"top-1/2 left-0 -translate-x-1/2 -translate-y-1/2",cursor:"cursor-w-resize"},{handle:"e",pos:"top-1/2 right-0 translate-x-1/2 -translate-y-1/2",cursor:"cursor-e-resize"}];return o.jsxs("div",{className:b("space-y-3",u),children:[o.jsxs("div",{ref:f,className:"relative overflow-hidden rounded-lg select-none",role:"application","aria-label":F.imageCropper_label,tabIndex:0,onKeyDown:V,children:[o.jsx("img",{ref:m,src:e,alt:"",className:"block w-full",onLoad:B,crossOrigin:"anonymous",draggable:!1}),h&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"absolute inset-0 bg-black/50 pointer-events-none"}),o.jsxs("div",{className:b("absolute border-2 border-white shadow-lg cursor-move",g&&"rounded-full"),style:{left:`${v.x*100}%`,top:`${v.y*100}%`,width:`${v.width*100}%`,height:`${v.height*100}%`},onPointerDown:K=>q(K,"move"),children:[o.jsx("div",{className:b("absolute inset-0 overflow-hidden",g&&"rounded-full"),children:o.jsx("img",{src:e,alt:"",className:"block",style:{position:"absolute",left:`-${v.x/v.width*100}%`,top:`-${v.y/v.height*100}%`,width:`${1/v.width*100}%`,height:`${1/v.height*100}%`},draggable:!1})}),d&&!g&&o.jsxs("div",{className:"absolute inset-0 pointer-events-none",children:[o.jsx("div",{className:"absolute left-1/3 top-0 bottom-0 w-px bg-white/40"}),o.jsx("div",{className:"absolute left-2/3 top-0 bottom-0 w-px bg-white/40"}),o.jsx("div",{className:"absolute top-1/3 left-0 right-0 h-px bg-white/40"}),o.jsx("div",{className:"absolute top-2/3 left-0 right-0 h-px bg-white/40"})]}),!g&&oe.map(({handle:K,pos:Y,cursor:ee})=>o.jsx("div",{className:b("absolute w-3 h-3 bg-white rounded-full border border-border shadow z-10",Y,ee),onPointerDown:z=>q(z,"resize",K)},K))]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("button",{type:"button",onClick:A,className:"flex items-center gap-2 px-3 py-1.5 rounded-md bg-primary text-primary-foreground text-sm hover:bg-primary/90 transition-colors",children:[o.jsx(I.Crop,{className:"h-4 w-4"}),F.imageCropper_crop]}),o.jsxs("button",{type:"button",onClick:T,className:"flex items-center gap-2 px-3 py-1.5 rounded-md border text-sm hover:bg-accent transition-colors",children:[o.jsx(I.RotateCcw,{className:"h-4 w-4"}),F.imageCropper_reset]})]})]})}const si=p.forwardRef(({beforeSrc:e,afterSrc:t,beforeAlt:r="",afterAlt:n="",initialPosition:s=50,orientation:a="horizontal",showLabels:i=!0,beforeLabel:l,afterLabel:c,handleSize:d=4,onPositionChange:g,className:u,...f},m)=>{var _,D;const[h,x]=p.useState(s),[y,w]=p.useState(!1),v=p.useRef(null),j=te(),R=a==="horizontal",M=l??j.imageCompare_before,C=c??j.imageCompare_after,k=p.useCallback((F,B)=>{const P=v.current;if(!P)return;const q=P.getBoundingClientRect();let V;R?V=(F-q.left)/q.width*100:V=(B-q.top)/q.height*100,V=Math.max(0,Math.min(100,V)),x(V),g==null||g(V)},[R,g]);p.useEffect(()=>{if(!y)return;const F=P=>{P.preventDefault(),k(P.clientX,P.clientY)},B=()=>w(!1);return document.addEventListener("pointermove",F),document.addEventListener("pointerup",B),()=>{document.removeEventListener("pointermove",F),document.removeEventListener("pointerup",B)}},[y,k]);const N=F=>{var B,P;F.preventDefault(),(P=(B=F.target).setPointerCapture)==null||P.call(B,F.pointerId),w(!0)},S=F=>{const B=F.shiftKey?10:1;let P=h;if(R&&F.key==="ArrowLeft"||!R&&F.key==="ArrowUp")P=Math.max(0,h-B);else if(R&&F.key==="ArrowRight"||!R&&F.key==="ArrowDown")P=Math.min(100,h+B);else return;F.preventDefault(),x(P),g==null||g(P)};return o.jsxs("div",{ref:F=>{v.current=F,typeof m=="function"?m(F):m&&(m.current=F)},className:b("relative select-none overflow-hidden rounded-lg",u),...f,children:[o.jsx("img",{src:t,alt:n,className:"block w-full h-full object-cover",draggable:!1}),o.jsx("div",{className:"absolute inset-0 overflow-hidden",style:R?{width:`${h}%`}:{height:`${h}%`},children:o.jsx("img",{src:e,alt:r,className:b("block object-cover",R?"h-full":"w-full"),style:R?{width:`${((_=v.current)==null?void 0:_.offsetWidth)??0}px`,maxWidth:"none",height:"100%"}:{height:`${((D=v.current)==null?void 0:D.offsetHeight)??0}px`,maxHeight:"none",width:"100%"},draggable:!1})}),o.jsxs("div",{className:b("absolute z-10",R?"top-0 bottom-0 cursor-ew-resize":"left-0 right-0 cursor-ns-resize"),style:R?{left:`${h}%`,width:d,transform:"translateX(-50%)"}:{top:`${h}%`,height:d,transform:"translateY(-50%)"},onPointerDown:N,onKeyDown:S,role:"slider","aria-label":j.imageCompare_slider,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(h),"aria-orientation":R?"horizontal":"vertical",tabIndex:0,children:[o.jsx("div",{className:b("bg-white shadow-lg",R?"w-1 h-full":"h-1 w-full")}),o.jsx("div",{className:b("absolute flex items-center justify-center rounded-full bg-white shadow-lg border border-border","left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-8 h-8"),children:o.jsx(I.GripVertical,{className:b("h-4 w-4 text-muted-foreground",!R&&"rotate-90")})})]}),i&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"absolute top-3 left-3 px-2 py-1 rounded bg-black/60 text-white text-xs font-medium pointer-events-none",children:M}),o.jsx("span",{className:"absolute top-3 right-3 px-2 py-1 rounded bg-black/60 text-white text-xs font-medium pointer-events-none",children:C})]})]})});si.displayName="ImageCompare";function Nm({className:e}){const{setTheme:t}=dr(),r=te();return o.jsxs(vs,{children:[o.jsx(ws,{asChild:!0,children:o.jsxs(ve,{variant:"outline",size:"icon",className:e,children:[o.jsx(I.Sun,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),o.jsx(I.Moon,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),o.jsx("span",{className:"sr-only",children:r.modeToggle_toggleTheme})]})}),o.jsxs(pn,{align:"end",children:[o.jsxs(It,{onClick:()=>t("light"),children:[o.jsx(I.Sun,{className:"mr-2 h-4 w-4"}),r.modeToggle_light]}),o.jsxs(It,{onClick:()=>t("dark"),children:[o.jsx(I.Moon,{className:"mr-2 h-4 w-4"}),r.modeToggle_dark]}),o.jsxs(It,{onClick:()=>t("system"),children:[o.jsx(I.Monitor,{className:"mr-2 h-4 w-4"}),r.modeToggle_system]})]})]})}const Cm=[{value:"light",icon:I.Sun,key:"modeToggle_light"},{value:"dark",icon:I.Moon,key:"modeToggle_dark"},{value:"system",icon:I.Monitor,key:"modeToggle_system"}];function km({className:e}){const{theme:t,setTheme:r,themes:n}=dr(),s=te();return o.jsx("div",{className:b("inline-flex items-center rounded-lg border border-border bg-muted/50 p-0.5 gap-0.5",e),role:"radiogroup","aria-label":s.modeToggle_colorTheme,children:Cm.filter(a=>n.includes(a.value)).map(({value:a,icon:i,key:l})=>{const c=s[l];return o.jsxs("button",{role:"radio","aria-checked":t===a,"aria-label":c,onClick:()=>r(a),className:b("inline-flex items-center justify-center rounded-md px-2.5 py-1.5 text-sm font-medium transition-all","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t===a?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground hover:bg-background/50"),children:[o.jsx(i,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:c})]},a)})})}const ai=p.forwardRef(({className:e,variant:t="received",children:r,...n},s)=>o.jsx("div",{ref:s,className:b("group flex gap-2 max-w-[85%]",t==="sent"?"ml-auto flex-row-reverse":"mr-auto",e),"data-variant":t,...n,children:r}));ai.displayName="ChatBubble";const ii=p.forwardRef(({className:e,src:t,fallback:r,...n},s)=>o.jsx("div",{ref:s,className:b("flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground overflow-hidden",e),...n,children:t?o.jsx("img",{src:t,alt:r??"avatar",className:"h-full w-full object-cover"}):o.jsx("span",{children:r??"?"})}));ii.displayName="ChatBubbleAvatar";const Sm={sending:o.jsxs("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"10"}),o.jsx("path",{d:"M12 6v6l4 2"})]}),sent:o.jsx("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}),delivered:o.jsxs("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 7 17l-5-5"}),o.jsx("path",{d:"m22 10-9.5 9.5-2-2"})]}),read:o.jsxs("svg",{className:"h-3 w-3 text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 7 17l-5-5"}),o.jsx("path",{d:"m22 10-9.5 9.5-2-2"})]}),error:o.jsxs("svg",{className:"h-3 w-3 text-destructive",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"10"}),o.jsx("path",{d:"m15 9-6 6"}),o.jsx("path",{d:"m9 9 6 6"})]})},li=p.forwardRef(({className:e,variant:t="received",isLoading:r,status:n,children:s,...a},i)=>o.jsx("div",{ref:i,className:b("rounded-2xl px-4 py-2.5 text-sm leading-relaxed",t==="sent"?"bg-primary text-primary-foreground rounded-br-md":"bg-muted text-foreground rounded-bl-md",e),...a,children:r?o.jsxs("div",{className:"flex items-center gap-1 py-1",children:[o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:0ms]"}),o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:150ms]"}),o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:300ms]"})]}):o.jsxs(o.Fragment,{children:[s,n&&o.jsx("div",{className:"flex justify-end mt-1",children:Sm[n]})]})}));li.displayName="ChatBubbleMessage";const ci=p.forwardRef(({className:e,...t},r)=>o.jsx("span",{ref:r,className:b("text-[10px] text-muted-foreground mt-1 px-1",e),...t}));ci.displayName="ChatBubbleTimestamp";const di=p.forwardRef(({visibility:e="hover",className:t,children:r,...n},s)=>o.jsx("div",{ref:s,className:b("flex items-center gap-0.5 mt-0.5",e==="hover"&&"opacity-0 group-hover:opacity-100 transition-opacity",t),...n,children:r}));di.displayName="ChatBubbleActions";const ui=p.forwardRef(({onSend:e,placeholder:t,disabled:r,isLoading:n,showAttach:s,onAttach:a,acceptFiles:i="*",onStop:l,value:c,onChange:d,headerSlot:g,footerSlot:u,maxLength:f,className:m},h)=>{const x=te(),y=p.useRef(null),w=p.useRef(null),[v,j]=p.useState(""),R=c!==void 0,M=R?c:v,C=P=>{R?d==null||d(P):j(P)},k=()=>{const P=y.current;P&&(P.style.height="auto",P.style.height=Math.min(P.scrollHeight,160)+"px")},N=()=>{const P=M.trim();!P||r||n||(e==null||e(P),C(""),y.current&&(y.current.style.height="auto"))},S=P=>{P.key==="Enter"&&!P.shiftKey&&(P.preventDefault(),N())},_=()=>{var P;(P=w.current)==null||P.click()},D=P=>{P.target.files&&P.target.files.length>0&&(a==null||a(P.target.files)),P.target.value=""},F=M.length,B=f?F>f:!1;return o.jsxs("div",{ref:h,className:b("rounded-xl border border-border bg-background",m),children:[g&&o.jsx("div",{className:"px-3 pt-2 pb-1 border-b border-border/40",children:g}),o.jsxs("div",{className:"flex items-end gap-2 p-2",children:[s&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:_,className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors","aria-label":x.chatInput_attachFile,disabled:r,children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}),o.jsx("input",{ref:w,type:"file",multiple:!0,accept:i,onChange:D,className:"hidden","aria-hidden":"true"})]}),o.jsx("textarea",{ref:y,value:M,onChange:P=>{C(P.target.value),k()},onKeyDown:S,placeholder:t??x.chatInput_placeholder,disabled:r||n,rows:1,className:"flex-1 resize-none bg-transparent text-sm outline-none placeholder:text-muted-foreground min-h-[36px] py-2 px-2 max-h-40"}),n&&l?o.jsx("button",{type:"button",onClick:l,className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-destructive/10 text-destructive hover:bg-destructive/20 transition-colors","aria-label":x.chatInput_stopGenerating,children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}):o.jsx("button",{type:"button",onClick:N,disabled:r||n||!M.trim()||B,className:b("flex h-9 w-9 shrink-0 items-center justify-center rounded-lg transition-colors",M.trim()&&!r&&!n&&!B?"bg-primary text-primary-foreground hover:bg-primary/90":"bg-muted text-muted-foreground cursor-not-allowed"),"aria-label":x.chatInput_sendMessage,children:n?o.jsx("svg",{className:"animate-spin",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}):o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"m5 12 7-7 7 7"}),o.jsx("path",{d:"M12 19V5"})]})})]}),(u||f)&&o.jsxs("div",{className:"px-3 pb-2 pt-0.5 flex items-center gap-2",children:[o.jsx("div",{className:"flex-1",children:u}),f&&o.jsxs("span",{className:b("text-[10px] tabular-nums shrink-0",B?"text-destructive font-medium":"text-muted-foreground"),children:[F,"/",f]})]})]})});ui.displayName="ChatInput";const mi=p.forwardRef(({className:e,children:t,...r},n)=>o.jsx("div",{ref:n,className:b("flex flex-col h-full",e),...r,children:t}));mi.displayName="ChatContainer";const fi=p.forwardRef(({className:e,children:t,autoScroll:r=!0,...n},s)=>{const a=p.useRef(null),i=p.Children.count(t);return p.useEffect(()=>{r&&a.current&&a.current.scrollIntoView({behavior:"smooth"})},[i,r]),o.jsx(cr,{className:"flex-1",orientation:"vertical",children:o.jsxs("div",{ref:s,className:b("flex flex-col gap-4 p-4",e),...n,children:[t,o.jsx("div",{ref:a})]})})});fi.displayName="ChatList";const gi=p.forwardRef(({className:e,variant:t="dots",text:r,...n},s)=>{const a=te(),i=r??a.aiLoading_thinking;return t==="text"?o.jsxs("div",{ref:s,className:b("flex items-center gap-1.5 text-sm text-muted-foreground",e),...n,children:[o.jsx("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),o.jsxs("span",{className:"animate-pulse",children:[i,"…"]})]}):o.jsxs("div",{ref:s,className:b("flex items-center gap-1",e),...n,children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-muted-foreground/60 animate-bounce [animation-delay:0ms]"}),o.jsx("span",{className:"h-2 w-2 rounded-full bg-muted-foreground/60 animate-bounce [animation-delay:150ms]"}),o.jsx("span",{className:"h-2 w-2 rounded-full bg-muted-foreground/60 animate-bounce [animation-delay:300ms]"})]})});gi.displayName="AILoading";function lt(e){const t=[],r=/(`[^`]+`)|(\~\~[^~]+\~\~)|(\*\*[^*]+\*\*)|(\*[^*]+\*)|(!\[[^\]]*\]\([^)]+\))|(\[[^\]]+\]\([^)]+\))/g;let n=0,s;for(;(s=r.exec(e))!==null;){s.index>n&&t.push(e.slice(n,s.index));const a=s[0];if(a.startsWith("`"))t.push(o.jsx("code",{className:"px-1 py-0.5 rounded bg-muted text-sm font-mono",children:a.slice(1,-1)},s.index));else if(a.startsWith("~~"))t.push(o.jsx("del",{className:"text-muted-foreground",children:a.slice(2,-2)},s.index));else if(a.startsWith("**"))t.push(o.jsx("strong",{children:a.slice(2,-2)},s.index));else if(a.startsWith("*"))t.push(o.jsx("em",{children:a.slice(1,-1)},s.index));else if(a.startsWith("![")){const i=a.indexOf("]"),l=a.slice(2,i),c=a.slice(i+2,-1);t.push(o.jsx("img",{src:c,alt:l,className:"max-w-full rounded-lg my-2 inline-block",loading:"lazy"},s.index))}else if(a.startsWith("[")){const i=a.indexOf("]"),l=a.slice(1,i),c=a.slice(i+2,-1);t.push(o.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 hover:text-primary/80",children:l},s.index))}n=s.index+a.length}return n<e.length&&t.push(e.slice(n)),t}function Rm(e){const t=e.split(`
|
|
33
|
+
*/function Xn(e,t){return e?Ku(e)?g.createElement(e,t):e:null}function Ku(e){return Xu(e)||typeof e=="function"||Yu(e)}function Xu(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Yu(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Zu(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[r]=g.useState(()=>({current:zu(t)})),[n,s]=g.useState(()=>r.current.initialState);return r.current.setOptions(a=>({...a,...e,state:{...n,...e.state},onStateChange:i=>{s(i),e.onStateChange==null||e.onStateChange(i)}})),r.current}function Ju({columns:e,data:t,searchKey:r,searchPlaceholder:n,pageSize:s=10}){var w,v;const a=re(),i=n??a.dataTable_searchPlaceholder,[l,c]=g.useState([]),[d,p]=g.useState([]),[u,m]=g.useState({}),[f,h]=g.useState({}),x=Zu({data:t,columns:e,onSortingChange:c,onColumnFiltersChange:p,getCoreRowModel:$u(),getPaginationRowModel:Wu(),getSortedRowModel:Uu(),getFilteredRowModel:qu(),onColumnVisibilityChange:m,onRowSelectionChange:h,state:{sorting:l,columnFilters:d,columnVisibility:u,rowSelection:f},initialState:{pagination:{pageSize:s}}});return o.jsxs("div",{className:"space-y-4",children:[r&&o.jsx("div",{className:"flex items-center gap-2",children:o.jsx(st,{placeholder:i,value:((w=x.getColumn(r))==null?void 0:w.getFilterValue())??"",onChange:y=>{var j;return(j=x.getColumn(r))==null?void 0:j.setFilterValue(y.target.value)},className:"max-w-sm"})}),o.jsx("div",{className:"rounded-md border",children:o.jsxs(rn,{children:[o.jsx(nn,{children:x.getHeaderGroups().map(y=>o.jsx(Pt,{children:y.headers.map(j=>o.jsx(sn,{children:j.isPlaceholder?null:Xn(j.column.columnDef.header,j.getContext())},j.id))},y.id))}),o.jsx(on,{children:(v=x.getRowModel().rows)!=null&&v.length?x.getRowModel().rows.map(y=>o.jsx(Pt,{"data-state":y.getIsSelected()&&"selected",children:y.getVisibleCells().map(j=>o.jsx(nr,{children:Xn(j.column.columnDef.cell,j.getContext())},j.id))},y.id)):o.jsx(Pt,{children:o.jsx(nr,{colSpan:e.length,className:"h-24 text-center",children:a.dataTable_noResults})})})]})}),o.jsxs("div",{className:"flex items-center justify-between px-2",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:De(a.dataTable_pageOf,{page:x.getState().pagination.pageIndex+1,total:x.getPageCount()})}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>x.previousPage(),disabled:!x.getCanPreviousPage(),children:[o.jsx(T.ChevronLeft,{className:"h-4 w-4"}),a.dataTable_previous]}),o.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>x.nextPage(),disabled:!x.getCanNextPage(),children:[a.dataTable_next,o.jsx(T.ChevronRight,{className:"h-4 w-4"})]})]})]})]})}function Qu({column:e,title:t,className:r}){return e.getCanSort()?o.jsxs(ve,{variant:"ghost",size:"sm",className:b("-ml-3 h-8",r),onClick:()=>e.toggleSorting(e.getIsSorted()==="asc"),children:[t,o.jsx(T.ArrowUpDown,{className:"ml-2 h-4 w-4"})]}):o.jsx("div",{className:b(r),children:t})}const em=new Set(["abstract","as","async","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","from","function","get","if","implements","import","in","instanceof","interface","let","new","null","of","package","private","protected","public","return","set","static","super","switch","this","throw","true","try","type","typeof","undefined","var","void","while","with","yield"]),tm=new Set(["display","flex","grid","none","block","inline","relative","absolute","fixed","sticky","hidden","visible","auto","inherit","initial","unset","important","solid","dashed","dotted","transparent","center","left","right","top","bottom","normal","bold","italic","nowrap","wrap"]);function rm(e,t){const r=e.split(`
|
|
34
|
+
`),n=t==="css"||t==="scss"||t==="less",s=t==="html"||t==="xml"||t==="svg",a=t==="json",i=t==="bash"||t==="sh"||t==="shell"||t==="zsh";return r.map(l=>{const c=[];let d=0;const p=l.length*4;let u=0;for(;d<l.length&&u++<p;){if(!n&&!a&&l[d]==="/"&&l[d+1]==="/"){c.push({type:"comment",value:l.slice(d)}),d=l.length;continue}if(i&&l[d]==="#"){c.push({type:"comment",value:l.slice(d)}),d=l.length;continue}if(l[d]==="/"&&l[d+1]==="*"){const m=l.indexOf("*/",d+2);m!==-1?(c.push({type:"comment",value:l.slice(d,m+2)}),d=m+2):(c.push({type:"comment",value:l.slice(d)}),d=l.length);continue}if(l[d]==="`"){let m=d+1;for(;m<l.length&&l[m]!=="`";)l[m]==="\\"&&m++,m++;c.push({type:"string",value:l.slice(d,m+1)}),d=m+1;continue}if(l[d]==='"'||l[d]==="'"){const m=l[d];let f=d+1;for(;f<l.length&&l[f]!==m;)l[f]==="\\"&&f++,f++;c.push({type:"string",value:l.slice(d,f+1)}),d=f+1;continue}if(/[0-9]/.test(l[d])&&(d===0||/[\s,\(\[:=+\-*/<>!&|^~?{]/.test(l[d-1]))){let m=d;for(;m<l.length&&/[0-9a-fA-FxXoObB._eE+\-n]/.test(l[m]);)m++;c.push({type:"number",value:l.slice(d,m)}),d=m;continue}if(l[d]==="<"&&/[a-zA-Z\/!]/.test(l[d+1]||"")||l[d]==="/"&&l[d+1]===">"){if(l[d]==="/"&&l[d+1]===">"){c.push({type:"punctuation",value:"/>"}),d+=2;continue}const m=l[d+1]==="/";let f=m?d+2:d+1;for(;f<l.length&&/[a-zA-Z0-9.\-_]/.test(l[f]);)f++;c.push({type:"punctuation",value:l[d]+(m?"/":"")});const h=l.slice(m?d+2:d+1,f);h&&c.push({type:"tag",value:h}),d=f;continue}if(l[d]===">"){c.push({type:"punctuation",value:">"}),d++;continue}if(/[a-zA-Z_$@]/.test(l[d])){let m=d;for(;m<l.length&&/[a-zA-Z0-9_$@\-]/.test(l[m]);)m++;m===d&&m++;const f=l.slice(d,m);if(n&&tm.has(f))c.push({type:"keyword",value:f});else if(s||n){const h=l.slice(m).trimStart();h[0]==="="||h[0]===":"?c.push({type:"attr",value:f}):c.push({type:"plain",value:f})}else em.has(f)?c.push({type:"keyword",value:f}):!a&&l[m]==="("?c.push({type:"function",value:f}):!a&&/^[A-Z]/.test(f)?c.push({type:"tag",value:f}):c.push({type:"plain",value:f});d=m;continue}if(/[=+\-*/%<>!&|^~?:]/.test(l[d])){let m=d;for(;m<l.length&&/[=+\-*/%<>!&|^~?:]/.test(l[m]);)m++;c.push({type:"operator",value:l.slice(d,m)}),d=m;continue}if(/[{}()\[\],;.]/.test(l[d])){c.push({type:"punctuation",value:l[d]}),d++;continue}if(/\s/.test(l[d])){let m=d;for(;m<l.length&&/\s/.test(l[m]);)m++;c.push({type:"plain",value:l.slice(d,m)}),d=m;continue}c.push({type:"plain",value:l[d]}),d++}return c})}const nm={comment:"var(--cb-comment, #6a9955)",string:"var(--cb-string, #ce9178)",keyword:"var(--cb-keyword, #569cd6)",number:"var(--cb-number, #b5cea8)",function:"var(--cb-function, #dcdcaa)",tag:"var(--cb-tag, #4ec9b0)",attr:"var(--cb-attr, #9cdcfe)",punctuation:"var(--cb-punctuation, #d4d4d4)",operator:"var(--cb-operator, #d4d4d4)",plain:"var(--cb-plain, #d4d4d4)"};function om({code:e,language:t="tsx",showLineNumbers:r=!1,showCopy:n=!0,className:s}){const a=re(),[i,l]=g.useState(!1),c=e.trim(),d=g.useMemo(()=>{try{return rm(c,t)}catch{return c.split(`
|
|
35
|
+
`).map(u=>[{type:"plain",value:u}])}},[c,t]),p=async()=>{try{await navigator.clipboard.writeText(c),l(!0),setTimeout(()=>l(!1),2e3)}catch{}};return o.jsxs("div",{className:b("relative group",s),children:[n&&o.jsx("button",{type:"button",onClick:p,className:"absolute top-3 right-3 z-10 p-1.5 rounded-md bg-white/10 backdrop-blur text-white/60 hover:text-white opacity-0 group-hover:opacity-100 transition-opacity text-xs","aria-label":a.common_copyCode,children:i?o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("polyline",{points:"20 6 9 17 4 12"})}):o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2"}),o.jsx("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})}),o.jsx("pre",{className:"overflow-x-auto rounded-lg p-4 text-[13px] leading-relaxed font-mono",style:{background:"var(--cb-bg, #1e1e2e)",color:"var(--cb-plain, #d4d4d4)"},children:d.map((u,m)=>o.jsxs("div",{children:[r&&o.jsx("span",{className:"inline-block w-8 select-none text-right mr-4 opacity-40",style:{color:"var(--cb-plain, #d4d4d4)"},children:m+1}),u.map((f,h)=>o.jsx("span",{style:{color:nm[f.type]},children:f.value},h))]},m))})]})}const Oa=ze("font-bold tracking-tight",{variants:{level:{1:"text-2xl lg:text-3xl",2:"text-xl lg:text-2xl",3:"text-lg lg:text-xl",4:"text-base lg:text-lg",5:"text-sm lg:text-base",6:"text-xs lg:text-sm"}},defaultVariants:{level:2}});function sm({className:e,level:t=2,as:r,children:n,...s}){const a=r||`h${t}`;return o.jsx(a,{className:b(Oa({level:t}),e),...s,children:n})}const Ha=ze("",{variants:{size:{xs:"text-xs",sm:"text-sm",base:"text-base",lg:"text-lg",xl:"text-xl"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},variant:{default:"text-foreground",muted:"text-muted-foreground",primary:"text-primary",destructive:"text-destructive",success:"text-green-600 dark:text-green-400"},leading:{tight:"leading-tight",normal:"leading-normal",relaxed:"leading-relaxed"}},defaultVariants:{size:"base",weight:"normal",variant:"default",leading:"normal"}});function am({className:e,size:t,weight:r,variant:n,leading:s,as:a="p",children:i,...l}){return o.jsx(a,{className:b(Ha({size:t,weight:r,variant:n,leading:s}),e),...l,children:i})}function im({className:e,...t}){return o.jsx("code",{className:b("relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm",e),...t})}function lm({className:e,...t}){return o.jsx("blockquote",{className:b("border-l-4 border-primary pl-4 italic text-muted-foreground",e),...t})}function cm({className:e,...t}){return o.jsx("p",{className:b("text-xl text-muted-foreground",e),...t})}function dm({className:e,...t}){return o.jsx("p",{className:b("text-sm text-muted-foreground",e),...t})}const Ga=g.forwardRef(({className:e,children:t,...r},n)=>o.jsx("div",{ref:n,className:b("w-full h-full min-h-[300px]",e),...r,children:o.jsx(Gr.ResponsiveContainer,{width:"100%",height:"100%",children:t})}));Ga.displayName="ChartContainer";const um=Gr.Tooltip,mm=Gr.Legend,qa=g.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("flex flex-col space-y-4",e),...t}));qa.displayName="Timeline";const Wa=g.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("relative flex gap-4 pb-4 last:pb-0",e),...t}));Wa.displayName="TimelineItem";const Ua=g.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border bg-background text-primary shadow-sm",e),...t}));Ua.displayName="TimelineIcon";const Ka=g.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("absolute left-4 top-8 -bottom-4 w-px bg-border",e),...t}));Ka.displayName="TimelineConnector";const Xa=g.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:b("flex-1 space-y-1 pt-1",e),...t}));Xa.displayName="TimelineContent";const Ya=g.forwardRef(({className:e,children:t,...r},n)=>o.jsx("div",{ref:n,className:b("grid min-h-screen w-full lg:grid-cols-[280px_1fr]",e),...r,children:t}));Ya.displayName="AppShell";const Za=g.forwardRef(({className:e,children:t,...r},n)=>o.jsx("div",{ref:n,className:b("hidden border-r bg-muted/40 lg:block dark:bg-muted/10",e),...r,children:o.jsx("div",{className:"flex h-full max-h-screen flex-col gap-2",children:t})}));Za.displayName="Sidebar";const Ja=g.forwardRef(({className:e,children:t,...r},n)=>o.jsx("header",{ref:n,className:b("flex h-14 items-center gap-4 border-b bg-background px-6 lg:h-[60px]",e),...r,children:t}));Ja.displayName="Header";const Qa=g.forwardRef(({className:e,children:t,...r},n)=>o.jsx("main",{ref:n,className:b("flex flex-1 flex-col gap-4 p-4 lg:gap-6 lg:p-6",e),...r,children:t}));Qa.displayName="Main";function fm({title:e,value:t,description:r,trend:n,trendLabel:s,icon:a,className:i,...l}){return o.jsxs(Jr,{className:b("overflow-hidden",i),...l,children:[o.jsxs(Qr,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[o.jsx(en,{className:"text-sm font-medium text-muted-foreground",children:e}),a&&o.jsx("div",{className:"text-muted-foreground",children:a})]}),o.jsxs(tn,{children:[o.jsx("div",{className:"text-2xl font-bold",children:t}),(r||n!==void 0)&&o.jsxs("div",{className:"text-xs flex items-center gap-1 mt-1 text-muted-foreground",children:[n!==void 0&&o.jsxs("span",{className:b("flex items-center font-medium",n>0?"text-green-500":n<0?"text-red-500":"text-muted-foreground"),children:[n>0?o.jsx(T.TrendingUp,{className:"mr-1 h-3 w-3"}):n<0?o.jsx(T.TrendingDown,{className:"mr-1 h-3 w-3"}):o.jsx(T.Minus,{className:"mr-1 h-3 w-3"}),n>0?"+":"",n,"%"]}),s&&o.jsx("span",{children:s}),r&&!n&&o.jsx("span",{children:r})]})]})]})}const ei=g.forwardRef(({className:e,label:t,value:r,...n},s)=>{const[a,i]=g.useState(!1),l=()=>{navigator.clipboard.writeText(r),i(!0),setTimeout(()=>i(!1),2e3)};return o.jsxs("div",{className:"space-y-2",children:[t&&o.jsx(lr,{children:t}),o.jsxs("div",{className:"flex gap-2 relative",children:[o.jsx(st,{ref:s,value:r,readOnly:!0,className:b("pr-10 font-mono text-sm",e),...n}),o.jsx(ve,{size:"icon",variant:"outline",className:"shrink-0",onClick:l,children:a?o.jsx(T.Check,{className:"h-4 w-4 text-green-500"}):o.jsx(T.Copy,{className:"h-4 w-4"})})]})]})});ei.displayName="CopyInput";const ti=g.forwardRef(({className:e,data:t,...r},n)=>o.jsx("pre",{ref:n,className:b("rounded-lg border bg-muted p-4 overflow-auto text-xs font-mono text-muted-foreground",e),...r,children:JSON.stringify(t,null,2)}));ti.displayName="JsonViewer";const gm=ze("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{status:{neutral:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",success:"border-transparent bg-green-500/15 text-green-700 dark:text-green-400 hover:bg-green-500/25",warning:"border-transparent bg-yellow-500/15 text-yellow-700 dark:text-yellow-400 hover:bg-yellow-500/25",error:"border-transparent bg-red-500/15 text-red-700 dark:text-red-400 hover:bg-red-500/25",info:"border-transparent bg-blue-500/15 text-blue-700 dark:text-blue-400 hover:bg-blue-500/25"}},defaultVariants:{status:"neutral"}});function pm({className:e,status:t,dot:r=!0,children:n,...s}){return o.jsxs("div",{className:b(gm({status:t}),e),...s,children:[r&&o.jsx("span",{className:b("mr-1.5 h-2 w-2 rounded-full",{"bg-current":!0})}),n]})}const pr=g.forwardRef(({src:e,data:t,stream:r,color:n,progressColor:s,progress:a=0,height:i=80,barCount:l=100,barWidth:c=3,barGap:d=1,barRadius:p=2,mirrored:u=!1,onSeek:m,className:f,...h},x)=>{const w=g.useRef(null),[v,y]=g.useState([]),j=g.useRef(0),k=re(),[S,R]=g.useState({width:0,height:0}),[_,C]=g.useState(null);g.useEffect(()=>{var $;const L=($=w.current)==null?void 0:$.parentElement;if(!L)return;const N=new ResizeObserver(I=>{for(const M of I){const{width:H,height:D}=M.contentRect;R({width:H,height:D})}});return N.observe(L),()=>N.disconnect()},[]),g.useEffect(()=>{if(!e||r)return;const L=new AudioContext;let N=!1;return fetch(e).then($=>$.arrayBuffer()).then($=>L.decodeAudioData($)).then($=>{if(N)return;const I=$.getChannelData(0),M=Math.floor(I.length/l),H=[];for(let P=0;P<l;P++){let E=0;for(let oe=0;oe<M;oe++)E+=Math.abs(I[P*M+oe]);H.push(E/M)}const D=Math.max(...H,.01);y(H.map(P=>P/D))}).catch(()=>{N||C(k.audioWaveform_error)}),()=>{N=!0,L.close()}},[e,l]),g.useEffect(()=>{if(t){const L=Math.max(...t,.01);y(t.map(N=>N/L))}},[t]),g.useEffect(()=>{if(!r)return;const L=new AudioContext,N=L.createMediaStreamSource(r),$=L.createAnalyser();$.fftSize=256,N.connect($);const I=new Uint8Array($.frequencyBinCount),M=()=>{$.getByteFrequencyData(I);const H=Math.floor(I.length/l),D=[];for(let P=0;P<l;P++)D.push(I[P*H]/255);y(D),j.current=requestAnimationFrame(M)};return j.current=requestAnimationFrame(M),()=>{cancelAnimationFrame(j.current),N.disconnect(),L.close()}},[r,l]),g.useEffect(()=>{const L=w.current;if(!L||v.length===0)return;const N=L.getContext("2d");if(!N)return;const $=window.devicePixelRatio||1,I=L.getBoundingClientRect();L.width=I.width*$,L.height=I.height*$,N.scale($,$),N.clearRect(0,0,I.width,I.height);const M=getComputedStyle(L),H=n||M.getPropertyValue("--muted-foreground").trim()||"#888",D=s||M.getPropertyValue("--primary").trim()||"#7c3aed",P=c+d,E=Math.max(0,(I.width-v.length*P)/2);for(let oe=0;oe<v.length;oe++){const Z=Math.max(2,v[oe]*(u?I.height/2:I.height*.9)),ae=E+oe*P,X=oe/v.length<=a;if(N.fillStyle=X?D:H,u){const z=I.height/2-Z;Pr(N,ae,z,c,Z,p),N.fill(),Pr(N,ae,I.height/2,c,Z,p),N.fill()}else{const z=I.height-Z;Pr(N,ae,z,c,Z,p),N.fill()}}},[v,a,n,s,c,d,p,u,i,S]);const A=L=>{if(!m||!w.current)return;const N=w.current.getBoundingClientRect(),$=(L.clientX-N.left)/N.width;m(Math.max(0,Math.min(1,$)))};return o.jsxs("div",{ref:x,className:b("relative w-full",f),role:"img","aria-label":k.audioWaveform_label,...h,children:[o.jsx("canvas",{ref:w,style:{width:"100%",height:i},className:b(m&&"cursor-pointer"),onClick:A}),_&&o.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-sm text-muted-foreground",children:_})]})});pr.displayName="AudioWaveform";function Pr(e,t,r,n,s,a){e.beginPath(),e.moveTo(t+a,r),e.lineTo(t+n-a,r),e.quadraticCurveTo(t+n,r,t+n,r+a),e.lineTo(t+n,r+s-a),e.quadraticCurveTo(t+n,r+s,t+n-a,r+s),e.lineTo(t+a,r+s),e.quadraticCurveTo(t,r+s,t,r+s-a),e.lineTo(t,r+a),e.quadraticCurveTo(t,r,t+a,r),e.closePath()}const ri=ze("flex items-center gap-3 rounded-lg border bg-card p-3 text-card-foreground shadow-sm",{variants:{size:{sm:"p-2 gap-2",default:"p-3 gap-3",lg:"p-4 gap-4"}},defaultVariants:{size:"default"}}),hm={sm:"h-3.5 w-3.5",default:"h-4 w-4",lg:"h-5 w-5"};function _n({src:e,title:t,artist:r,albumArt:n,showWaveform:s=!1,showVolume:a=!0,defaultVolume:i=1,autoPlay:l=!1,loop:c=!1,preload:d="metadata",size:p="default",onPlay:u,onPause:m,onEnded:f,onTimeUpdate:h,className:x}){const w=g.useRef(null),v=g.useRef(null),[y,j]=g.useState(!1),[k,S]=g.useState(0),[R,_]=g.useState(0),[C,A]=g.useState(i),[L,N]=g.useState(!1),[$,I]=g.useState(!1),M=g.useRef(!1),[H,D]=g.useState(null),P=re(),E=hm[p??"default"];g.useEffect(()=>{const F=w.current;if(!F)return;const B=()=>_(F.duration),K=()=>{M.current||(S(F.currentTime),h==null||h(F.currentTime))},te=()=>{j(!0),u==null||u()},ie=()=>{j(!1),m==null||m()},q=()=>{j(!1),f==null||f()};F.addEventListener("loadedmetadata",B),F.addEventListener("timeupdate",K),F.addEventListener("play",te),F.addEventListener("pause",ie),F.addEventListener("ended",q);const ce=()=>{j(!1),D(P.audioPlayer_error)};return F.addEventListener("error",ce),()=>{F.removeEventListener("loadedmetadata",B),F.removeEventListener("timeupdate",K),F.removeEventListener("play",te),F.removeEventListener("pause",ie),F.removeEventListener("ended",q),F.removeEventListener("error",ce)}},[u,m,f,h]),g.useEffect(()=>{const F=w.current;F&&(F.volume=L?0:C)},[C,L]),g.useEffect(()=>{D(null),S(0),_(0)},[e]);const oe=()=>{const F=w.current;F&&(y?F.pause():F.play())},Z=F=>{const B=w.current;!B||!R||(B.currentTime=F*R,S(B.currentTime))},ae=F=>{if(!v.current)return;const B=v.current.getBoundingClientRect();Z((F.clientX-B.left)/B.width)},X=F=>{var B,K;I(!0),M.current=!0,(K=(B=F.target).setPointerCapture)==null||K.call(B,F.pointerId)};g.useEffect(()=>{if(!$)return;const F=K=>{if(!v.current)return;const te=v.current.getBoundingClientRect(),ie=Math.max(0,Math.min(1,(K.clientX-te.left)/te.width));Z(ie)},B=()=>{I(!1),M.current=!1};return document.addEventListener("pointermove",F),document.addEventListener("pointerup",B),()=>{document.removeEventListener("pointermove",F),document.removeEventListener("pointerup",B)}},[$,R]);const z=F=>{if(!w.current||!R)return;const B=F.shiftKey?10:5;F.key==="ArrowLeft"?(F.preventDefault(),w.current.currentTime=Math.max(0,k-B)):F.key==="ArrowRight"&&(F.preventDefault(),w.current.currentTime=Math.min(R,k+B))},G=()=>N(F=>!F),Y=L||C===0?T.VolumeX:C<.5?T.Volume1:T.Volume2,ee=R?k/R:0;return o.jsxs("div",{className:b(ri({size:p}),x),children:[o.jsx("audio",{ref:w,src:e,autoPlay:l,loop:c,preload:d}),H&&o.jsx("div",{className:"flex-1 text-sm text-destructive",children:H}),!H&&o.jsxs(o.Fragment,{children:[n&&o.jsx("img",{src:n,alt:"",className:b("rounded object-cover shrink-0",p==="sm"?"h-8 w-8":p==="lg"?"h-14 w-14":"h-10 w-10")}),o.jsx("button",{type:"button",onClick:oe,className:"shrink-0 flex items-center justify-center rounded-full bg-primary text-primary-foreground hover:bg-primary/90 transition-colors h-8 w-8","aria-label":y?P.audioPlayer_pause:P.audioPlayer_play,children:y?o.jsx(T.Pause,{className:E}):o.jsx(T.Play,{className:b(E,"ml-0.5")})}),o.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[(t||r)&&o.jsxs("div",{className:"flex items-center gap-2 text-xs leading-tight",children:[t&&o.jsx("span",{className:"font-medium truncate",children:t}),r&&o.jsx("span",{className:"text-muted-foreground truncate",children:r})]}),s?o.jsx(pr,{src:e,progress:ee,height:p==="sm"?24:p==="lg"?40:32,barCount:60,onSeek:Z}):o.jsxs("div",{ref:v,className:"relative h-1.5 bg-muted rounded-full cursor-pointer group",onClick:ae,onPointerDown:X,onKeyDown:z,role:"slider","aria-label":P.audioPlayer_seek,"aria-valuemin":0,"aria-valuemax":Math.round(R),"aria-valuenow":Math.round(k),"aria-valuetext":We(k),tabIndex:0,children:[o.jsx("div",{className:"absolute inset-y-0 left-0 bg-primary rounded-full transition-[width] duration-75",style:{width:`${ee*100}%`}}),o.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 h-3 w-3 rounded-full bg-primary shadow opacity-0 group-hover:opacity-100 transition-opacity",style:{left:`${ee*100}%`,transform:"translate(-50%, -50%)"}})]}),o.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground tabular-nums",children:[o.jsx("span",{children:We(k)}),o.jsx("span",{children:We(R)})]})]}),a&&o.jsxs("div",{className:"shrink-0 flex items-center gap-1.5 group/volume [&:focus-within>input]:opacity-100",children:[o.jsx("button",{type:"button",onClick:G,className:"p-1 rounded hover:bg-accent transition-colors","aria-label":L?P.audioPlayer_unmute:P.audioPlayer_mute,children:o.jsx(Y,{className:E})}),o.jsx("input",{type:"range",min:0,max:1,step:.01,value:L?0:C,onChange:F=>{A(Number(F.target.value)),N(!1)},className:"w-16 h-1 accent-primary cursor-pointer opacity-0 group-hover/volume:opacity-100 focus:opacity-100 transition-opacity","aria-label":P.audioPlayer_volume})]})]})]})}function xm({mimeType:e="audio/webm",maxDuration:t,showWaveform:r=!0,onRecordingComplete:n,onRecordingStart:s,onError:a,className:i}){const[l,c]=g.useState("idle"),[d,p]=g.useState(0),[u,m]=g.useState(null),[f,h]=g.useState(null),x=g.useRef(null),w=g.useRef([]),v=g.useRef(null),y=g.useRef(null),j=g.useRef(null),k=re(),S=g.useCallback(()=>{v.current&&(clearInterval(v.current),v.current=null),y.current&&(y.current.getTracks().forEach(I=>I.stop()),y.current=null,h(null)),j.current&&(URL.revokeObjectURL(j.current),j.current=null)},[]);g.useEffect(()=>S,[S]);const R=()=>{v.current=setInterval(()=>{p(I=>{const M=I+1;return t&&M>=t&&A(),M})},1e3)},_=()=>{v.current&&(clearInterval(v.current),v.current=null)},C=async()=>{try{const I=await navigator.mediaDevices.getUserMedia({audio:!0});h(I),y.current=I,p(0),u&&(URL.revokeObjectURL(u),m(null),j.current=null);const M=MediaRecorder.isTypeSupported(e)?e:"",H=new MediaRecorder(I,M?{mimeType:M}:void 0);H.ondataavailable=D=>{D.data.size>0&&w.current.push(D.data)},H.onstop=()=>{const D=new Blob(w.current,{type:M||"audio/webm"}),P=URL.createObjectURL(D);m(P),j.current=P,n==null||n(D),I.getTracks().forEach(E=>E.stop()),h(null),y.current=null},x.current=H,H.start(100),c("recording"),R(),s==null||s()}catch(I){a==null||a(I instanceof Error?I:new Error(String(I)))}},A=()=>{x.current&&x.current.state!=="inactive"&&x.current.stop(),_(),c("stopped")},L=()=>{x.current&&x.current.state==="recording"&&(x.current.pause(),_(),c("paused"))},N=()=>{x.current&&x.current.state==="paused"&&(x.current.resume(),R(),c("recording"))},$=()=>{S(),p(0),m(null),j.current=null,c("idle")};return o.jsx("div",{className:b("space-y-3 rounded-lg border bg-card p-4 text-card-foreground shadow-sm",i),children:l==="stopped"&&u?o.jsxs("div",{className:"space-y-3",children:[o.jsx(_n,{src:u,size:"sm"}),o.jsxs("button",{type:"button",onClick:$,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx(T.RotateCcw,{className:"h-4 w-4"}),k.audioRecorder_reRecord]})]}):o.jsxs(o.Fragment,{children:[r&&f&&l==="recording"&&o.jsx(pr,{stream:f,height:48,barCount:50,className:"rounded"}),o.jsxs("div",{className:"flex items-center justify-center gap-4",children:[l==="idle"&&o.jsxs("button",{type:"button",onClick:C,className:"flex items-center gap-2 px-4 py-2 rounded-full bg-destructive text-destructive-foreground hover:bg-destructive/90 transition-colors","aria-label":k.audioRecorder_startRecording,children:[o.jsx(T.Mic,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm",children:k.audioRecorder_startRecording})]}),(l==="recording"||l==="paused")&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"text-sm font-mono tabular-nums text-muted-foreground min-w-[60px] text-center","aria-live":"off",children:[l==="recording"&&o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-destructive animate-pulse mr-2"}),We(d)]}),l==="recording"?o.jsx("button",{type:"button",onClick:L,className:"p-2 rounded-full hover:bg-accent transition-colors","aria-label":k.audioRecorder_pauseRecording,children:o.jsx(T.Pause,{className:"h-5 w-5"})}):o.jsx("button",{type:"button",onClick:N,className:"p-2 rounded-full hover:bg-accent transition-colors","aria-label":k.audioRecorder_resumeRecording,children:o.jsx(T.Play,{className:"h-5 w-5"})}),o.jsx("button",{type:"button",onClick:A,className:"p-2 rounded-full bg-destructive text-destructive-foreground hover:bg-destructive/90 transition-colors","aria-label":k.audioRecorder_stopRecording,children:o.jsx(T.Square,{className:"h-5 w-5"})})]})]}),t&&(l==="recording"||l==="paused")&&o.jsx("div",{className:"w-full bg-muted rounded-full h-1",children:o.jsx("div",{className:"bg-destructive rounded-full h-1 transition-[width] duration-1000",style:{width:`${Math.min(100,d/t*100)}%`}})})]})})}function bm({tracks:e,showWaveform:t=!1,defaultRepeatMode:r="none",defaultShuffle:n=!1,autoPlay:s=!1,onTrackChange:a,onPlayStateChange:i,className:l}){const[c,d]=g.useState(0),[p,u]=g.useState(r),[m,f]=g.useState(n),[h,x]=g.useState([]),[w,v]=g.useState(new Map),y=re();g.useEffect(()=>{if(m){const N=Array.from({length:e.length},(I,M)=>M);for(let I=N.length-1;I>0;I--){const M=Math.floor(Math.random()*(I+1));[N[I],N[M]]=[N[M],N[I]]}x(N);const $=new Map;N.forEach((I,M)=>$.set(I,M)),v($)}},[m,e.length]);const j=g.useCallback((N,$=1)=>{if(m){const H=(w.get(N)??-1)+$;return H>=0&&H<h.length?h[H]:p==="all"?$===1?h[0]:h[h.length-1]:null}const I=N+$;return I>=0&&I<e.length?I:p==="all"?$===1?0:e.length-1:null},[m,h,w,e.length,p]),k=N=>{d(N),a==null||a(e[N],N)},S=()=>{if(p==="one")return;const N=j(c,1);N!==null&&k(N)},R=()=>{const N=j(c,-1);N!==null&&k(N)},_=()=>{const N=j(c,1);N!==null&&k(N)},C=()=>{u(N=>N==="none"?"all":N==="all"?"one":"none")},A=p==="none"?y.audioPlaylist_repeatOff:p==="all"?y.audioPlaylist_repeatAll:y.audioPlaylist_repeatOne,L=e[c];return L?o.jsxs("div",{className:b("rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden",l),children:[o.jsxs("div",{className:"p-3 border-b space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-center gap-3",children:[o.jsx("button",{type:"button",onClick:()=>f(N=>!N),className:b("p-1.5 rounded hover:bg-accent transition-colors",m&&"text-primary"),"aria-label":y.audioPlaylist_shuffle,"aria-pressed":m,children:o.jsx(T.Shuffle,{className:"h-4 w-4"})}),o.jsx("button",{type:"button",onClick:R,className:"p-1.5 rounded hover:bg-accent transition-colors","aria-label":y.audioPlaylist_previousTrack,children:o.jsx(T.SkipBack,{className:"h-4 w-4"})}),o.jsx("button",{type:"button",onClick:_,className:"p-1.5 rounded hover:bg-accent transition-colors","aria-label":y.audioPlaylist_nextTrack,children:o.jsx(T.SkipForward,{className:"h-4 w-4"})}),o.jsx("button",{type:"button",onClick:C,className:b("p-1.5 rounded hover:bg-accent transition-colors",p!=="none"&&"text-primary"),"aria-label":A,children:p==="one"?o.jsx(T.Repeat1,{className:"h-4 w-4"}):o.jsx(T.Repeat,{className:"h-4 w-4"})})]}),o.jsx(_n,{src:L.src,title:L.title,artist:L.artist,albumArt:L.albumArt,showWaveform:t,autoPlay:s||c>0,loop:p==="one",onEnded:S,onPlay:()=>i==null?void 0:i(!0),onPause:()=>i==null?void 0:i(!1),size:"sm",className:"border-0 shadow-none p-0"},L.id)]}),o.jsx(cr,{className:"max-h-64",children:o.jsx("div",{role:"list",className:"divide-y",children:e.map((N,$)=>o.jsxs("button",{type:"button",role:"listitem",onClick:()=>k($),"aria-current":$===c?"true":void 0,className:b("w-full flex items-center gap-3 px-3 py-2 text-left hover:bg-accent/50 transition-colors",$===c&&"bg-accent"),children:[N.albumArt?o.jsx("img",{src:N.albumArt,alt:"",className:"h-8 w-8 rounded object-cover shrink-0"}):o.jsx("div",{className:"h-8 w-8 rounded bg-muted flex items-center justify-center shrink-0",children:o.jsx(T.Music,{className:"h-4 w-4 text-muted-foreground"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium truncate",children:N.title}),N.artist&&o.jsx("p",{className:"text-xs text-muted-foreground truncate",children:N.artist})]}),N.duration!==void 0&&o.jsx("span",{className:"text-xs text-muted-foreground tabular-nums shrink-0",children:We(N.duration)})]},N.id))})}),e.length>1&&o.jsx("div",{className:"px-3 py-1.5 border-t text-xs text-muted-foreground text-center",children:De(y.audioPlaylist_trackOf,{current:String(c+1),total:String(e.length)})})]}):o.jsx("div",{className:b("rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden p-8",l),children:o.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 text-muted-foreground",children:[o.jsx(T.Music,{className:"h-8 w-8"}),o.jsx("p",{className:"text-sm",children:y.audioPlaylist_empty})]})})}function hr({src:e,poster:t,showControls:r=!0,controlsTimeout:n=3e3,enablePiP:s=!0,enableFullscreen:a=!0,enablePlaybackRate:i=!0,playbackRates:l=[.5,.75,1,1.25,1.5,2],tracks:c,aspectRatio:d="16/9",autoPlay:p=!1,loop:u=!1,muted:m=!1,preload:f="metadata",onPlay:h,onPause:x,onEnded:w,onTimeUpdate:v,onFullscreenChange:y,className:j}){const k=g.useRef(null),S=g.useRef(null),R=g.useRef(null),_=g.useRef(null),[C,A]=g.useState(!1),[L,N]=g.useState(0),[$,I]=g.useState(0),[M,H]=g.useState(0),[D,P]=g.useState(1),[E,oe]=g.useState(m),[Z,ae]=g.useState(!1),[X,z]=g.useState(!0),[G,Y]=g.useState(!1),[ee,F]=g.useState(1),[B,K]=g.useState(!1),te=re(),ie=typeof document<"u"&&"pictureInPictureEnabled"in document;g.useEffect(()=>{const O=S.current;if(!O)return;const ne=()=>I(O.duration),Ne=()=>{B||(N(O.currentTime),v==null||v(O.currentTime)),O.buffered.length>0&&H(O.buffered.end(O.buffered.length-1))},Xe=()=>{A(!0),h==null||h()},Ye=()=>{A(!1),x==null||x()},_e=()=>{A(!1),w==null||w()};return O.addEventListener("loadedmetadata",ne),O.addEventListener("timeupdate",Ne),O.addEventListener("play",Xe),O.addEventListener("pause",Ye),O.addEventListener("ended",_e),()=>{O.removeEventListener("loadedmetadata",ne),O.removeEventListener("timeupdate",Ne),O.removeEventListener("play",Xe),O.removeEventListener("pause",Ye),O.removeEventListener("ended",_e)}},[B,h,x,w,v]),g.useEffect(()=>{const O=S.current;O&&(O.volume=E?0:D)},[D,E]),g.useEffect(()=>{const O=()=>{const ne=!!document.fullscreenElement;ae(ne),y==null||y(ne)};return document.addEventListener("fullscreenchange",O),()=>document.removeEventListener("fullscreenchange",O)},[y]);const q=g.useCallback(()=>{z(!0),_.current&&clearTimeout(_.current),C&&(_.current=setTimeout(()=>z(!1),n))},[C,n]),ce=()=>{const O=S.current;O&&(C?O.pause():O.play())},de=O=>{const ne=S.current;!ne||!$||(ne.currentTime=O*$,N(ne.currentTime))},we=O=>{if(!R.current)return;const ne=R.current.getBoundingClientRect();de((O.clientX-ne.left)/ne.width)},Pe=O=>{var ne,Ne;K(!0),(Ne=(ne=O.target).setPointerCapture)==null||Ne.call(ne,O.pointerId)};g.useEffect(()=>{if(!B)return;const O=Ne=>{if(!R.current)return;const Xe=R.current.getBoundingClientRect();de(Math.max(0,Math.min(1,(Ne.clientX-Xe.left)/Xe.width)))},ne=()=>K(!1);return document.addEventListener("pointermove",O),document.addEventListener("pointerup",ne),()=>{document.removeEventListener("pointermove",O),document.removeEventListener("pointerup",ne)}},[B,$]);const ye=()=>{var O,ne;k.current&&(document.fullscreenElement?document.exitFullscreen():(ne=(O=k.current).requestFullscreen)==null||ne.call(O))},$e=async()=>{const O=S.current;if(O)try{document.pictureInPictureElement?await document.exitPictureInPicture():await O.requestPictureInPicture()}catch{}},xe=()=>oe(O=>!O),Oe=O=>{const ne=S.current;ne&&(ne.playbackRate=O),F(O),Y(!1)},Qe=O=>{const ne=S.current;if(ne){switch(O.key){case" ":case"k":O.preventDefault(),ce();break;case"f":O.preventDefault(),ye();break;case"m":O.preventDefault(),xe();break;case"ArrowLeft":O.preventDefault(),ne.currentTime=Math.max(0,ne.currentTime-5);break;case"ArrowRight":O.preventDefault(),ne.currentTime=Math.min($,ne.currentTime+5);break;case"ArrowUp":O.preventDefault(),P(Ne=>Math.min(1,Ne+.1)),oe(!1);break;case"ArrowDown":O.preventDefault(),P(Ne=>Math.max(0,Ne-.1));break;case"c":if(O.preventDefault(),ne.textTracks.length>0){const Ne=ne.textTracks[0];Ne.mode=Ne.mode==="showing"?"hidden":"showing"}break}q()}},je=E||D===0?T.VolumeX:D<.5?T.Volume1:T.Volume2,Fe=$?L/$:0,gt=$?M/$:0;return o.jsxs("div",{ref:k,className:b("relative group bg-black rounded-lg overflow-hidden",j),style:{aspectRatio:d},onMouseMove:q,onMouseLeave:()=>C&&z(!1),onKeyDown:Qe,tabIndex:0,role:"application","aria-label":te.videoPlayer_label,children:[o.jsx("video",{ref:S,src:e,poster:t,autoPlay:p,loop:u,muted:m,preload:f,className:"w-full h-full object-contain",onClick:ce,onDoubleClick:ye,children:c==null?void 0:c.map((O,ne)=>o.jsx("track",{src:O.src,kind:O.kind,srcLang:O.srcLang,label:O.label,default:O.default},ne))}),!C&&r&&o.jsx("button",{type:"button",onClick:ce,className:"absolute inset-0 flex items-center justify-center z-10","aria-label":te.videoPlayer_play,children:o.jsx("div",{className:"h-16 w-16 rounded-full bg-black/50 flex items-center justify-center backdrop-blur-sm hover:bg-black/70 transition-colors",children:o.jsx(T.Play,{className:"h-8 w-8 text-white ml-1"})})}),r&&o.jsxs("div",{className:b("absolute bottom-0 left-0 right-0 z-20 bg-gradient-to-t from-black/80 to-transparent pt-8 pb-2 px-3 transition-opacity duration-200",X||!C?"opacity-100":"opacity-0 pointer-events-none"),children:[o.jsxs("div",{ref:R,className:"relative h-1 bg-white/20 rounded-full cursor-pointer mb-2 group/seek",onClick:we,onPointerDown:Pe,role:"slider","aria-label":te.videoPlayer_seek,"aria-valuemin":0,"aria-valuemax":Math.round($),"aria-valuenow":Math.round(L),"aria-valuetext":We(L),tabIndex:0,children:[o.jsx("div",{className:"absolute inset-y-0 left-0 bg-white/30 rounded-full",style:{width:`${gt*100}%`}}),o.jsx("div",{className:"absolute inset-y-0 left-0 bg-primary rounded-full",style:{width:`${Fe*100}%`}}),o.jsx("div",{className:"absolute top-1/2 h-3 w-3 rounded-full bg-primary shadow opacity-0 group-hover/seek:opacity-100 transition-opacity",style:{left:`${Fe*100}%`,transform:"translate(-50%, -50%)"}})]}),o.jsxs("div",{className:"flex items-center gap-2 text-white",children:[o.jsx("button",{type:"button",onClick:ce,className:"p-1 hover:bg-white/10 rounded transition-colors","aria-label":C?te.videoPlayer_pause:te.videoPlayer_play,children:C?o.jsx(T.Pause,{className:"h-5 w-5"}):o.jsx(T.Play,{className:"h-5 w-5"})}),o.jsxs("span",{className:"text-xs tabular-nums",children:[We(L)," / ",We($)]}),o.jsx("div",{className:"flex-1"}),o.jsxs("div",{className:"flex items-center gap-1 group/vol",children:[o.jsx("button",{type:"button",onClick:xe,className:"p-1 hover:bg-white/10 rounded transition-colors","aria-label":E?te.videoPlayer_unmute:te.videoPlayer_mute,children:o.jsx(je,{className:"h-5 w-5"})}),o.jsx("input",{type:"range",min:0,max:1,step:.01,value:E?0:D,onChange:O=>{P(Number(O.target.value)),oe(!1)},className:"w-16 h-1 accent-white cursor-pointer opacity-0 group-hover/vol:opacity-100 transition-opacity","aria-label":te.videoPlayer_volume})]}),i&&o.jsxs("div",{className:"relative",children:[o.jsxs("button",{type:"button",onClick:()=>Y(O=>!O),className:"px-1.5 py-0.5 text-xs hover:bg-white/10 rounded transition-colors","aria-label":te.videoPlayer_playbackSpeed,children:[ee,"x"]}),G&&o.jsx("div",{className:"absolute bottom-full right-0 mb-1 bg-black/90 rounded-md border border-white/10 py-1 min-w-[60px]",children:l.map(O=>o.jsxs("button",{type:"button",onClick:()=>Oe(O),className:b("block w-full px-3 py-1 text-xs text-left hover:bg-white/10 transition-colors",O===ee&&"text-primary"),children:[O,"x"]},O))})]}),c&&c.length>0&&o.jsx("button",{type:"button",onClick:()=>{const O=S.current;if(O&&O.textTracks.length>0){const ne=O.textTracks[0];ne.mode=ne.mode==="showing"?"hidden":"showing"}},className:"p-1 hover:bg-white/10 rounded transition-colors","aria-label":te.videoPlayer_subtitles,children:o.jsx(T.Subtitles,{className:"h-5 w-5"})}),s&&ie&&o.jsx("button",{type:"button",onClick:$e,className:"p-1 hover:bg-white/10 rounded transition-colors","aria-label":te.videoPlayer_pictureInPicture,children:o.jsx(T.PictureInPicture2,{className:"h-5 w-5"})}),a&&o.jsx("button",{type:"button",onClick:ye,className:"p-1 hover:bg-white/10 rounded transition-colors","aria-label":Z?te.videoPlayer_exitFullscreen:te.videoPlayer_fullscreen,children:Z?o.jsx(T.Minimize,{className:"h-5 w-5"}):o.jsx(T.Maximize,{className:"h-5 w-5"})})]})]})]})}function vm({source:e="camera",videoConstraints:t,audioConstraints:r=!0,mimeType:n="video/webm",maxDuration:s,showTimer:a=!0,mirrored:i,onRecordingComplete:l,onRecordingStart:c,onError:d,className:p}){const[u,m]=g.useState("idle"),[f,h]=g.useState(0),[x,w]=g.useState(null),[v,y]=g.useState(null),j=g.useRef(null),k=g.useRef(null),S=g.useRef([]),R=g.useRef(null),_=g.useRef(null),C=g.useRef(null),A=re(),L=i!==void 0?i:e==="camera",N=g.useCallback(()=>{R.current&&(clearInterval(R.current),R.current=null),_.current&&(_.current.getTracks().forEach(Z=>Z.stop()),_.current=null,y(null)),C.current&&(URL.revokeObjectURL(C.current),C.current=null)},[]);g.useEffect(()=>N,[N]);const $=()=>{R.current=setInterval(()=>{h(Z=>{const ae=Z+1;return s&&ae>=s&&D(),ae})},1e3)},I=()=>{R.current&&(clearInterval(R.current),R.current=null)},M=async()=>{try{let Z;e==="screen"?Z=await navigator.mediaDevices.getDisplayMedia({video:!0,audio:!!r}):Z=await navigator.mediaDevices.getUserMedia({video:t||!0,audio:r}),Z.getVideoTracks().forEach(ae=>{ae.addEventListener("ended",()=>{N(),m("idle")})}),y(Z),_.current=Z,m("preview"),j.current&&(j.current.srcObject=Z)}catch(Z){d==null||d(Z instanceof Error?Z:new Error(String(Z)))}};g.useEffect(()=>{j.current&&v&&(u==="preview"||u==="recording"||u==="paused")&&(j.current.srcObject=v)},[v,u]);const H=()=>{if(!v)return;S.current=[],h(0),x&&(URL.revokeObjectURL(x),w(null),C.current=null);const Z=MediaRecorder.isTypeSupported(n)?n:"",ae=new MediaRecorder(v,Z?{mimeType:Z}:void 0);ae.ondataavailable=X=>{X.data.size>0&&S.current.push(X.data)},ae.onstop=()=>{const X=new Blob(S.current,{type:Z||"video/webm"}),z=URL.createObjectURL(X);w(z),C.current=z,l==null||l(X),v.getTracks().forEach(G=>G.stop()),y(null),_.current=null},k.current=ae,ae.start(100),m("recording"),$(),c==null||c()},D=()=>{k.current&&k.current.state!=="inactive"&&k.current.stop(),I(),m("stopped")},P=()=>{k.current&&k.current.state==="recording"&&(k.current.pause(),I(),m("paused"))},E=()=>{k.current&&k.current.state==="paused"&&(k.current.resume(),$(),m("recording"))},oe=()=>{N(),h(0),w(null),C.current=null,m("idle")};return o.jsx("div",{className:b("space-y-3 rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden",p),children:u==="stopped"&&x?o.jsxs("div",{className:"space-y-3",children:[o.jsx(hr,{src:x,aspectRatio:"16/9"}),o.jsx("div",{className:"px-4 pb-3",children:o.jsxs("button",{type:"button",onClick:oe,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx(T.RotateCcw,{className:"h-4 w-4"}),A.videoRecorder_reRecord]})})]}):u==="idle"?o.jsx("div",{className:"flex items-center justify-center gap-3 p-8",children:o.jsx("button",{type:"button",onClick:M,className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",children:e==="screen"?o.jsxs(o.Fragment,{children:[o.jsx(T.Monitor,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm",children:A.videoRecorder_shareScreen})]}):o.jsxs(o.Fragment,{children:[o.jsx(T.Camera,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm",children:A.videoRecorder_startCamera})]})})}):o.jsxs("div",{className:"relative",children:[o.jsx("video",{ref:j,autoPlay:!0,muted:!0,playsInline:!0,className:b("w-full",L&&"scale-x-[-1]"),style:{aspectRatio:"16/9"},"aria-label":e==="camera"?A.videoRecorder_cameraPreview:A.videoRecorder_screenPreview}),a&&(u==="recording"||u==="paused")&&o.jsxs("div",{className:"absolute top-3 left-3 flex items-center gap-2 px-2 py-1 rounded bg-black/60 text-white text-sm tabular-nums",children:[u==="recording"&&o.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500 animate-pulse"}),We(f)]}),o.jsxs("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 flex items-center gap-3",children:[u==="preview"&&o.jsx("button",{type:"button",onClick:H,className:"h-12 w-12 rounded-full bg-red-500 hover:bg-red-600 flex items-center justify-center transition-colors border-4 border-white/80","aria-label":A.videoRecorder_startRecording,children:o.jsx(T.Circle,{className:"h-5 w-5 text-white fill-white"})}),u==="recording"&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:P,className:"p-2 rounded-full bg-black/50 hover:bg-black/70 text-white transition-colors","aria-label":A.videoRecorder_pauseRecording,children:o.jsx(T.Pause,{className:"h-5 w-5"})}),o.jsx("button",{type:"button",onClick:D,className:"h-12 w-12 rounded-full bg-red-500 hover:bg-red-600 flex items-center justify-center transition-colors border-4 border-white/80","aria-label":A.videoRecorder_stopRecording,children:o.jsx(T.Square,{className:"h-5 w-5 text-white fill-white"})})]}),u==="paused"&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:E,className:"p-2 rounded-full bg-black/50 hover:bg-black/70 text-white transition-colors","aria-label":A.videoRecorder_resumeRecording,children:o.jsx(T.Play,{className:"h-5 w-5"})}),o.jsx("button",{type:"button",onClick:D,className:"h-12 w-12 rounded-full bg-red-500 hover:bg-red-600 flex items-center justify-center transition-colors border-4 border-white/80","aria-label":A.videoRecorder_stopRecording,children:o.jsx(T.Square,{className:"h-5 w-5 text-white fill-white"})})]})]}),s&&(u==="recording"||u==="paused")&&o.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-1 bg-white/20",children:o.jsx("div",{className:"h-full bg-red-500 transition-[width] duration-1000",style:{width:`${Math.min(100,f/s*100)}%`}})})]})})}const Mn=g.forwardRef(({src:e,poster:t,title:r,duration:n,clickAction:s="inline",aspectRatio:a="16/9",showDuration:i=!0,showPlayButton:l=!0,onPlay:c,className:d,...p},u)=>{const[m,f]=g.useState(!1),[h,x]=g.useState(null),w=re();g.useEffect(()=>{if(t||!e)return;const S=document.createElement("video");S.crossOrigin="anonymous",S.preload="metadata",S.muted=!0;const R=()=>{try{const C=document.createElement("canvas");C.width=S.videoWidth,C.height=S.videoHeight;const A=C.getContext("2d");A&&(A.drawImage(S,0,0),x(C.toDataURL("image/jpeg",.7)))}catch{}S.remove()};S.addEventListener("seeked",R,{once:!0});const _=()=>{S.currentTime=Math.min(1,S.duration*.1)};return S.addEventListener("loadedmetadata",_,{once:!0}),S.src=e,()=>{S.removeEventListener("seeked",R),S.removeEventListener("loadedmetadata",_),S.src="",S.remove()}},[e,t]);const v=()=>{s==="inline"?(f(!0),c==null||c()):s==="none"&&(c==null||c())},y=S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),v())},j=t||h,k=r?De(w.videoThumbnail_play,{title:r}):w.videoPlayer_play;return m&&s==="inline"?o.jsx("div",{ref:u,className:b("rounded-lg overflow-hidden bg-black",d),style:{aspectRatio:a},...p,children:o.jsx(hr,{src:e,autoPlay:!0,aspectRatio:a})}):o.jsxs("div",{ref:u,className:b("relative rounded-lg overflow-hidden bg-muted cursor-pointer group",d),style:{aspectRatio:a},onClick:v,onKeyDown:y,role:"button",tabIndex:0,"aria-label":k,...p,children:[j?o.jsx("img",{src:j,alt:r||"",className:"w-full h-full object-cover",draggable:!1}):o.jsx("div",{className:"w-full h-full bg-muted flex items-center justify-center",children:o.jsx(T.Play,{className:"h-8 w-8 text-muted-foreground"})}),l&&o.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:o.jsx("div",{className:"h-12 w-12 rounded-full bg-black/50 flex items-center justify-center backdrop-blur-sm group-hover:bg-black/70 group-hover:scale-110 transition-all",children:o.jsx(T.Play,{className:"h-6 w-6 text-white ml-0.5"})})}),i&&n!==void 0&&o.jsx("span",{className:"absolute bottom-2 right-2 px-1.5 py-0.5 rounded bg-black/70 text-white text-xs tabular-nums",children:We(n)}),r&&o.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/60 to-transparent p-2 pt-6",children:o.jsx("p",{className:"text-white text-sm font-medium truncate",children:r})})]})});Mn.displayName="VideoThumbnail";const ni=g.forwardRef(({videos:e,columns:t=3,gap:r=4,aspectRatio:n="16/9",clickAction:s="lightbox",onVideoSelect:a,className:i,...l},c)=>{const[d,p]=g.useState(null),u=re(),m=g.useCallback(()=>{if(typeof t=="number")return t;if(typeof window>"u")return t.sm??3;const k=window.innerWidth;return t.xl&&k>=1280?t.xl:t.lg&&k>=1024?t.lg:t.md&&k>=768?t.md:t.sm??3},[t]),[f,h]=g.useState(typeof t=="number"?t:3);g.useEffect(()=>{const k=()=>h(m());return k(),window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[m]);const x=(k,S)=>{a==null||a(k,S),s==="lightbox"&&p(S)},w=()=>p(null),v=()=>{d!==null&&p(d>0?d-1:e.length-1)},y=()=>{d!==null&&p(d<e.length-1?d+1:0)};g.useEffect(()=>{if(d===null)return;const k=document.body.style.overflow,S=R=>{switch(R.key){case"Escape":w();break;case"ArrowLeft":v();break;case"ArrowRight":y();break}};return document.addEventListener("keydown",S),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",S),document.body.style.overflow=k}},[d]);const j={gridTemplateColumns:`repeat(${f}, minmax(0, 1fr))`};return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:c,className:b("grid",i),style:{...j,gap:`${r*4}px`},role:"list","aria-label":u.videoGallery_label,...l,children:e.map((k,S)=>o.jsx(Mn,{src:k.src,poster:k.poster,title:k.title,duration:k.duration,aspectRatio:n,clickAction:"none",onPlay:()=>x(k,S),role:"listitem"},k.id))}),s==="lightbox"&&d!==null&&e[d]&&Hr.createPortal(o.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/90",onClick:k=>{k.target===k.currentTarget&&w()},role:"dialog","aria-modal":"true","aria-label":u.videoGallery_label,children:[o.jsx("button",{type:"button",onClick:w,className:"absolute top-4 right-4 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors","aria-label":u.common_close,children:o.jsx(T.X,{className:"h-5 w-5"})}),e.length>1&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:v,className:"absolute left-4 top-1/2 -translate-y-1/2 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors","aria-label":u.common_previous,children:o.jsx(T.ChevronLeft,{className:"h-6 w-6"})}),o.jsx("button",{type:"button",onClick:y,className:"absolute right-4 top-1/2 -translate-y-1/2 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors","aria-label":u.common_next,children:o.jsx(T.ChevronRight,{className:"h-6 w-6"})})]}),o.jsxs("div",{className:"w-full max-w-4xl px-4",children:[o.jsx(hr,{src:e[d].src,poster:e[d].poster,autoPlay:!0,aspectRatio:n},e[d].id),e[d].title&&o.jsx("p",{className:"text-white text-sm mt-3 text-center",children:e[d].title})]}),o.jsxs("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 text-white/70 text-sm tabular-nums",children:[d+1," / ",e.length]})]}),document.body)]})});ni.displayName="VideoGallery";const wm={contain:"object-contain",cover:"object-cover",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"},oi=g.forwardRef(({src:e,alt:t,fallbackSrc:r,placeholder:n,showSkeleton:s=!0,lazy:a=!0,rootMargin:i="200px",aspectRatio:l,zoomOnHover:c=!1,zoomScale:d=1.5,zoomOnClick:p=!1,fit:u="cover",className:m,style:f,onLoad:h,onError:x,...w},v)=>{const[y,j]=g.useState("loading"),[k,S]=g.useState(!a),[R,_]=g.useState(e),[C,A]=g.useState(!1),L=g.useRef(null),N=re();g.useEffect(()=>{_(e),j("loading")},[e]),g.useEffect(()=>{if(!a||!L.current)return;const P=new IntersectionObserver(([E])=>{E.isIntersecting&&(S(!0),P.disconnect())},{rootMargin:i});return P.observe(L.current),()=>P.disconnect()},[a,i]);const $=P=>{j("loaded"),h==null||h(P)},I=P=>{r&&R!==r?_(r):j("error"),x==null||x(P)},M=()=>{p&&A(P=>!P)},H=P=>{p&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),A(E=>!E))},D=l!==void 0?{aspectRatio:typeof l=="number"?`${l}`:l}:{};return o.jsxs("div",{ref:L,className:b("group relative overflow-hidden inline-block",p&&"cursor-zoom-in focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",m),style:{...D,...f},onClick:M,onKeyDown:H,tabIndex:p?0:void 0,role:p?"button":void 0,"aria-label":p?N.image_zoomIn:void 0,children:[k&&R?o.jsx("img",{ref:v,src:R,alt:t??"",className:b("w-full h-full transition-transform duration-300",wm[u],c&&"hover:scale-[var(--zoom-scale)]",C&&"scale-[var(--zoom-scale)]",y==="loading"&&"opacity-0"),style:{"--zoom-scale":d},onLoad:$,onError:I,...w}):null,y==="loading"&&k&&o.jsx("div",{className:"absolute inset-0",children:n||s&&o.jsx("div",{className:"w-full h-full animate-pulse bg-muted rounded-md"})}),y==="error"&&o.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/50 text-muted-foreground text-sm",children:N.image_failedToLoad}),p&&y==="loaded"&&!C&&o.jsx("div",{className:"absolute bottom-2 right-2 p-1.5 rounded-full bg-black/50 text-white opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none",children:o.jsx(T.ZoomIn,{className:"h-4 w-4"})})]})});oi.displayName="NUIImage";function ym({images:e,open:t,defaultIndex:r=0,onClose:n,onIndexChange:s,enableZoom:a=!0,enableKeyboard:i=!0,showCounter:l=!0,showThumbnails:c=!1,className:d,children:p}){const[u,m]=g.useState(!1),[f,h]=g.useState(r),[x,w]=g.useState(!1),[v,y]=g.useState(null),j=g.useRef(null),k=g.useRef(null),S=re(),R=t!==void 0?t:u,_=P=>{j.current=document.activeElement instanceof HTMLElement?document.activeElement:null,P!==void 0&&h(P),m(!0)},C=()=>{var P;m(!1),w(!1),n==null||n(),(P=j.current)==null||P.focus()},A=g.useCallback(P=>{h(P),w(!1),s==null||s(P)},[s]),L=g.useCallback(()=>{A(f>0?f-1:e.length-1)},[f,e.length,A]),N=g.useCallback(()=>{A(f<e.length-1?f+1:0)},[f,e.length,A]);g.useEffect(()=>{if(!R||!i)return;const P=E=>{switch(E.key){case"Escape":E.preventDefault(),C();break;case"ArrowLeft":E.preventDefault(),L();break;case"ArrowRight":E.preventDefault(),N();break}};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[R,i,L,N]),g.useEffect(()=>{var E;if(!R)return;const P=document.body.style.overflow;return document.body.style.overflow="hidden",(E=k.current)==null||E.focus(),()=>{document.body.style.overflow=P}},[R]);const $=P=>{P.target===k.current&&C()},I=P=>{y(P.touches[0].clientX)},M=P=>{var Z;if(v===null)return;const E=v-P.changedTouches[0].clientX,oe=Math.max(30,Math.min(80,(((Z=k.current)==null?void 0:Z.offsetWidth)??300)*.1));Math.abs(E)>oe&&(E>0?N():L()),y(null)},H=()=>{a&&w(P=>!P)};if(!R)return p?o.jsx("div",{onClick:()=>_(r),className:"cursor-pointer",children:p}):null;const D=e[f];return D?Hr.createPortal(o.jsxs("div",{ref:k,className:b("fixed inset-0 z-50 flex flex-col items-center justify-center bg-black/90",d),onClick:$,onTouchStart:I,onTouchEnd:M,role:"dialog","aria-modal":"true","aria-label":S.lightbox_label,tabIndex:-1,children:[o.jsx("button",{type:"button",onClick:C,className:"absolute top-4 right-4 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors","aria-label":S.common_close,children:o.jsx(T.X,{className:"h-5 w-5"})}),l&&e.length>1&&o.jsx("div",{className:"absolute top-4 left-1/2 -translate-x-1/2 text-white/80 text-sm tabular-nums","aria-live":"polite",children:De(S.lightbox_imageOf,{current:String(f+1),total:String(e.length)})}),a&&o.jsx("button",{type:"button",onClick:()=>w(P=>!P),className:"absolute top-4 right-14 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors","aria-label":x?S.lightbox_zoomOut:S.lightbox_zoomIn,children:x?o.jsx(T.ZoomOut,{className:"h-5 w-5"}):o.jsx(T.ZoomIn,{className:"h-5 w-5"})}),e.length>1&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:L,className:"absolute left-4 top-1/2 -translate-y-1/2 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors","aria-label":S.common_previous,children:o.jsx(T.ChevronLeft,{className:"h-6 w-6"})}),o.jsx("button",{type:"button",onClick:N,className:"absolute right-4 top-1/2 -translate-y-1/2 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors","aria-label":S.common_next,children:o.jsx(T.ChevronRight,{className:"h-6 w-6"})})]}),o.jsx("div",{className:b("flex-1 flex items-center justify-center w-full",x?"overflow-auto cursor-zoom-out":"cursor-zoom-in"),onDoubleClick:H,children:o.jsx("img",{src:D.src,alt:D.alt||"",className:b("transition-transform duration-200 select-none",x?"max-w-none max-h-none":"max-h-[85vh] max-w-[90vw] object-contain"),style:x?{transform:"scale(2)"}:void 0,draggable:!1})}),(D.title||D.description)&&o.jsxs("div",{className:"absolute bottom-16 left-1/2 -translate-x-1/2 text-center text-white max-w-lg px-4",children:[D.title&&o.jsx("p",{className:"text-sm font-medium",children:D.title}),D.description&&o.jsx("p",{className:"text-xs text-white/70 mt-1",children:D.description})]}),c&&e.length>1&&o.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-2 max-w-[90vw] overflow-x-auto px-4 py-2",children:e.map((P,E)=>o.jsx("button",{type:"button",onClick:()=>A(E),className:b("shrink-0 w-12 h-12 rounded overflow-hidden border-2 transition-colors",E===f?"border-white":"border-transparent opacity-60 hover:opacity-100"),children:o.jsx("img",{src:P.src,alt:"",className:"w-full h-full object-cover"})},E))})]}),document.body):null}function jm({src:e,aspectRatio:t,minSize:r=50,maxSize:n,initialCrop:s,outputFormat:a="image/png",outputQuality:i=.92,onCropComplete:l,onCropChange:c,onError:d,showGrid:p=!0,circular:u=!1,className:m}){const f=g.useRef(null),h=g.useRef(null),[x,w]=g.useState(!1),[v,y]=g.useState({width:0,height:0}),[j,k]=g.useState(s||{x:.15,y:.15,width:.7,height:.7}),[S,R]=g.useState(null),[_,C]=g.useState(null),[A,L]=g.useState({x:0,y:0}),[N,$]=g.useState({x:0,y:0,width:0,height:0}),I=g.useRef(null),M=re();g.useEffect(()=>{s&&k(s)},[s]);const H=()=>{h.current&&(y({width:h.current.naturalWidth,height:h.current.naturalHeight}),w(!0))},D=g.useCallback(X=>{let{x:z,y:G,width:Y,height:ee}=X;const F=r/(v.width||1),B=r/(v.height||1);if(Y=Math.max(F,Y),ee=Math.max(B,ee),n&&(Y=Math.min(n/(v.width||1),Y),ee=Math.min(n/(v.height||1),ee)),Y=Math.min(1,Y),ee=Math.min(1,ee),t){const K=(v.width||1)/(v.height||1),te=t/K;Y/ee>te?Y=ee*te:ee=Y/te}return z=Math.max(0,Math.min(1-Y,z)),G=Math.max(0,Math.min(1-ee,G)),{x:z,y:G,width:Y,height:ee}},[v,r,n,t]);g.useEffect(()=>{if(!S)return;const X=G=>{G.preventDefault();const Y=f.current;if(!Y)return;const ee=Y.getBoundingClientRect(),F=(G.clientX-A.x)/ee.width,B=(G.clientY-A.y)/ee.height;let K;if(S==="move")K=D({...N,x:N.x+F,y:N.y+B});else{switch(K={...N},_){case"se":K.width=N.width+F,K.height=N.height+B;break;case"sw":K.x=N.x+F,K.width=N.width-F,K.height=N.height+B;break;case"ne":K.y=N.y+B,K.width=N.width+F,K.height=N.height-B;break;case"nw":K.x=N.x+F,K.y=N.y+B,K.width=N.width-F,K.height=N.height-B;break;case"n":K.y=N.y+B,K.height=N.height-B;break;case"s":K.height=N.height+B;break;case"w":K.x=N.x+F,K.width=N.width-F;break;case"e":K.width=N.width+F;break}K=D(K)}k(K),c==null||c(K)},z=()=>{if(R(null),C(null),I.current){try{I.current.target.releasePointerCapture(I.current.pointerId)}catch{}I.current=null}};return document.addEventListener("pointermove",X),document.addEventListener("pointerup",z),()=>{document.removeEventListener("pointermove",X),document.removeEventListener("pointerup",z)}},[S,A,N,_,D,c]);const P=(X,z,G)=>{X.preventDefault(),X.stopPropagation();const Y=X.currentTarget;try{Y.setPointerCapture(X.pointerId),I.current={target:Y,pointerId:X.pointerId}}catch{}R(z),C(G||null),L({x:X.clientX,y:X.clientY}),$({...j})},E=X=>{const z=X.shiftKey?.05:.01;let G={...j};if(X.shiftKey&&!X.altKey)switch(X.key){case"ArrowLeft":G.width-=z;break;case"ArrowRight":G.width+=z;break;case"ArrowUp":G.height-=z;break;case"ArrowDown":G.height+=z;break;default:return}else switch(X.key){case"ArrowLeft":G.x-=z;break;case"ArrowRight":G.x+=z;break;case"ArrowUp":G.y-=z;break;case"ArrowDown":G.y+=z;break;case"Enter":oe();return;default:return}X.preventDefault(),G=D(G),k(G),c==null||c(G)},oe=()=>{const X=h.current;if(!X||!l)return;const z=document.createElement("canvas"),G=j.x*X.naturalWidth,Y=j.y*X.naturalHeight,ee=j.width*X.naturalWidth,F=j.height*X.naturalHeight;z.width=ee,z.height=F;const B=z.getContext("2d");if(!B)return;u&&(B.beginPath(),B.arc(ee/2,F/2,Math.min(ee,F)/2,0,Math.PI*2),B.closePath(),B.clip()),B.drawImage(X,G,Y,ee,F,0,0,ee,F);const K=z.toDataURL(a,i);z.toBlob(te=>{te?l(te,K):d==null||d(new Error(M.imageCropper_cropFailed))},a,i)},Z=()=>{const z=D(s||{x:.15,y:.15,width:.7,height:.7});k(z),c==null||c(z)},ae=[{handle:"nw",pos:"top-0 left-0 -translate-x-1/2 -translate-y-1/2",cursor:"cursor-[nw-resize]"},{handle:"ne",pos:"top-0 right-0 translate-x-1/2 -translate-y-1/2",cursor:"cursor-[ne-resize]"},{handle:"sw",pos:"bottom-0 left-0 -translate-x-1/2 translate-y-1/2",cursor:"cursor-[sw-resize]"},{handle:"se",pos:"bottom-0 right-0 translate-x-1/2 translate-y-1/2",cursor:"cursor-[se-resize]"},{handle:"n",pos:"top-0 left-1/2 -translate-x-1/2 -translate-y-1/2",cursor:"cursor-[n-resize]"},{handle:"s",pos:"bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2",cursor:"cursor-[s-resize]"},{handle:"w",pos:"top-1/2 left-0 -translate-x-1/2 -translate-y-1/2",cursor:"cursor-[w-resize]"},{handle:"e",pos:"top-1/2 right-0 translate-x-1/2 -translate-y-1/2",cursor:"cursor-[e-resize]"}];return o.jsxs("div",{className:b("space-y-3",m),children:[o.jsxs("div",{ref:f,className:"relative overflow-hidden rounded-lg select-none",role:"application","aria-label":M.imageCropper_label,tabIndex:0,onKeyDown:E,children:[o.jsx("img",{ref:h,src:e,alt:"",className:"block w-full",onLoad:H,crossOrigin:"anonymous",draggable:!1}),x&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"absolute inset-0 bg-black/50 pointer-events-none"}),o.jsxs("div",{className:b("absolute border-2 border-white shadow-lg cursor-move",u&&"rounded-full"),style:{left:`${j.x*100}%`,top:`${j.y*100}%`,width:`${j.width*100}%`,height:`${j.height*100}%`},onPointerDown:X=>P(X,"move"),children:[o.jsx("div",{className:b("absolute inset-0 overflow-hidden",u&&"rounded-full"),children:o.jsx("img",{src:e,alt:"",className:"block",style:{position:"absolute",left:`-${j.x/j.width*100}%`,top:`-${j.y/j.height*100}%`,width:`${1/j.width*100}%`,height:`${1/j.height*100}%`},draggable:!1})}),p&&!u&&o.jsxs("div",{className:"absolute inset-0 pointer-events-none",children:[o.jsx("div",{className:"absolute left-1/3 top-0 bottom-0 w-px bg-white/40"}),o.jsx("div",{className:"absolute left-2/3 top-0 bottom-0 w-px bg-white/40"}),o.jsx("div",{className:"absolute top-1/3 left-0 right-0 h-px bg-white/40"}),o.jsx("div",{className:"absolute top-2/3 left-0 right-0 h-px bg-white/40"})]}),!u&&ae.map(({handle:X,pos:z,cursor:G})=>o.jsx("div",{className:b("absolute w-3 h-3 bg-white rounded-full border border-border shadow z-10",z,G),onPointerDown:Y=>P(Y,"resize",X)},X))]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("button",{type:"button",onClick:oe,className:"flex items-center gap-2 px-3 py-1.5 rounded-md bg-primary text-primary-foreground text-sm hover:bg-primary/90 transition-colors",children:[o.jsx(T.Crop,{className:"h-4 w-4"}),M.imageCropper_crop]}),o.jsxs("button",{type:"button",onClick:Z,className:"flex items-center gap-2 px-3 py-1.5 rounded-md border text-sm hover:bg-accent transition-colors",children:[o.jsx(T.RotateCcw,{className:"h-4 w-4"}),M.imageCropper_reset]})]})]})}const si=g.forwardRef(({beforeSrc:e,afterSrc:t,beforeAlt:r="",afterAlt:n="",initialPosition:s=50,orientation:a="horizontal",showLabels:i=!0,beforeLabel:l,afterLabel:c,handleSize:d=4,onPositionChange:p,className:u,...m},f)=>{const[h,x]=g.useState(Math.max(0,Math.min(100,s))),[w,v]=g.useState(!1),y=g.useRef(null),[j,k]=g.useState({width:0,height:0}),S=g.useRef(null),R=re(),_=a==="horizontal",C=l??R.imageCompare_before,A=c??R.imageCompare_after;g.useEffect(()=>{const I=y.current;if(!I)return;const M=new ResizeObserver(H=>{for(const D of H){const{width:P,height:E}=D.contentRect;k({width:P,height:E})}});return M.observe(I),k({width:I.offsetWidth,height:I.offsetHeight}),()=>M.disconnect()},[]);const L=g.useCallback((I,M)=>{const H=y.current;if(!H)return;const D=H.getBoundingClientRect();let P;_?P=(I-D.left)/D.width*100:P=(M-D.top)/D.height*100,P=Math.max(0,Math.min(100,P)),x(P),p==null||p(P)},[_,p]);g.useEffect(()=>{if(!w)return;const I=D=>{D.preventDefault(),L(D.clientX,D.clientY)},M=()=>{if(S.current){const{element:D,pointerId:P}=S.current;D.releasePointerCapture(P),S.current=null}v(!1)},H=()=>{if(S.current){const{element:D,pointerId:P}=S.current;D.releasePointerCapture(P),S.current=null}v(!1)};return document.addEventListener("pointermove",I),document.addEventListener("pointerup",M),window.addEventListener("blur",H),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",M),window.removeEventListener("blur",H)}},[w,L]);const N=I=>{I.preventDefault();const M=I.currentTarget;M.setPointerCapture(I.pointerId),S.current={element:M,pointerId:I.pointerId},v(!0)},$=I=>{const M=I.shiftKey?10:1;let H=h;if(_&&I.key==="ArrowLeft"||!_&&I.key==="ArrowUp")H=Math.max(0,h-M);else if(_&&I.key==="ArrowRight"||!_&&I.key==="ArrowDown")H=Math.min(100,h+M);else return;I.preventDefault(),x(H),p==null||p(H)};return o.jsxs("div",{ref:I=>{y.current=I,typeof f=="function"?f(I):f&&(f.current=I)},className:b("relative select-none overflow-hidden rounded-lg",u),...m,children:[o.jsx("img",{src:t,alt:n,className:"block w-full h-full object-cover",draggable:!1}),o.jsx("div",{className:"absolute inset-0 overflow-hidden",style:_?{width:`${h}%`}:{height:`${h}%`},children:o.jsx("img",{src:e,alt:r,className:b("block object-cover",_?"h-full":"w-full"),style:_?{width:`${j.width}px`,maxWidth:"none",height:"100%"}:{height:`${j.height}px`,maxHeight:"none",width:"100%"},draggable:!1})}),o.jsxs("div",{className:b("absolute z-10",_?"top-0 bottom-0 cursor-[ew-resize]":"left-0 right-0 cursor-[ns-resize]"),style:_?{left:`${h}%`,width:d,transform:"translateX(-50%)"}:{top:`${h}%`,height:d,transform:"translateY(-50%)"},onPointerDown:N,onKeyDown:$,role:"slider","aria-label":R.imageCompare_slider,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(h),"aria-orientation":_?"horizontal":"vertical",tabIndex:0,children:[o.jsx("div",{className:b("bg-white shadow-lg",_?"w-1 h-full":"h-1 w-full")}),o.jsx("div",{className:b("absolute flex items-center justify-center rounded-full bg-white shadow-lg border border-border","left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-8 h-8"),children:o.jsx(T.GripVertical,{className:b("h-4 w-4 text-muted-foreground",!_&&"rotate-90")})})]}),i&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"absolute top-3 left-3 px-2 py-1 rounded bg-black/60 text-white text-xs font-medium pointer-events-none",children:C}),o.jsx("span",{className:"absolute top-3 right-3 px-2 py-1 rounded bg-black/60 text-white text-xs font-medium pointer-events-none",children:A})]})]})});si.displayName="ImageCompare";function Nm({className:e}){const{setTheme:t}=dr(),r=re();return o.jsxs(vs,{children:[o.jsx(ws,{asChild:!0,children:o.jsxs(ve,{variant:"outline",size:"icon",className:e,children:[o.jsx(T.Sun,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),o.jsx(T.Moon,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),o.jsx("span",{className:"sr-only",children:r.modeToggle_toggleTheme})]})}),o.jsxs(pn,{align:"end",children:[o.jsxs(It,{onClick:()=>t("light"),children:[o.jsx(T.Sun,{className:"mr-2 h-4 w-4"}),r.modeToggle_light]}),o.jsxs(It,{onClick:()=>t("dark"),children:[o.jsx(T.Moon,{className:"mr-2 h-4 w-4"}),r.modeToggle_dark]}),o.jsxs(It,{onClick:()=>t("system"),children:[o.jsx(T.Monitor,{className:"mr-2 h-4 w-4"}),r.modeToggle_system]})]})]})}const Cm=[{value:"light",icon:T.Sun,key:"modeToggle_light"},{value:"dark",icon:T.Moon,key:"modeToggle_dark"},{value:"system",icon:T.Monitor,key:"modeToggle_system"}];function km({className:e}){const{theme:t,setTheme:r,themes:n}=dr(),s=re();return o.jsx("div",{className:b("inline-flex items-center rounded-lg border border-border bg-muted/50 p-0.5 gap-0.5",e),role:"radiogroup","aria-label":s.modeToggle_colorTheme,children:Cm.filter(a=>n.includes(a.value)).map(({value:a,icon:i,key:l})=>{const c=s[l];return o.jsxs("button",{role:"radio","aria-checked":t===a,"aria-label":c,onClick:()=>r(a),className:b("inline-flex items-center justify-center rounded-md px-2.5 py-1.5 text-sm font-medium transition-all","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t===a?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground hover:bg-background/50"),children:[o.jsx(i,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:c})]},a)})})}const ai=g.forwardRef(({className:e,variant:t="received",children:r,...n},s)=>o.jsx("div",{ref:s,className:b("group flex gap-2 max-w-[85%]",t==="sent"?"ml-auto flex-row-reverse":"mr-auto",e),"data-variant":t,...n,children:r}));ai.displayName="ChatBubble";const ii=g.forwardRef(({className:e,src:t,fallback:r,...n},s)=>o.jsx("div",{ref:s,className:b("flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground overflow-hidden",e),...n,children:t?o.jsx("img",{src:t,alt:r??"avatar",className:"h-full w-full object-cover"}):o.jsx("span",{children:r??"?"})}));ii.displayName="ChatBubbleAvatar";const Sm={sending:o.jsxs("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"10"}),o.jsx("path",{d:"M12 6v6l4 2"})]}),sent:o.jsx("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}),delivered:o.jsxs("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 7 17l-5-5"}),o.jsx("path",{d:"m22 10-9.5 9.5-2-2"})]}),read:o.jsxs("svg",{className:"h-3 w-3 text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 7 17l-5-5"}),o.jsx("path",{d:"m22 10-9.5 9.5-2-2"})]}),error:o.jsxs("svg",{className:"h-3 w-3 text-destructive",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"10"}),o.jsx("path",{d:"m15 9-6 6"}),o.jsx("path",{d:"m9 9 6 6"})]})},li=g.forwardRef(({className:e,variant:t="received",isLoading:r,status:n,children:s,...a},i)=>o.jsx("div",{ref:i,className:b("rounded-2xl px-4 py-2.5 text-sm leading-relaxed",t==="sent"?"bg-primary text-primary-foreground rounded-br-md":"bg-muted text-foreground rounded-bl-md",e),...a,children:r?o.jsxs("div",{className:"flex items-center gap-1 py-1",children:[o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:0ms]"}),o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:150ms]"}),o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:300ms]"})]}):o.jsxs(o.Fragment,{children:[s,n&&o.jsx("div",{className:"flex justify-end mt-1",children:Sm[n]})]})}));li.displayName="ChatBubbleMessage";const ci=g.forwardRef(({className:e,...t},r)=>o.jsx("span",{ref:r,className:b("text-[10px] text-muted-foreground mt-1 px-1",e),...t}));ci.displayName="ChatBubbleTimestamp";const di=g.forwardRef(({visibility:e="hover",className:t,children:r,...n},s)=>o.jsx("div",{ref:s,className:b("flex items-center gap-0.5 mt-0.5",e==="hover"&&"opacity-0 group-hover:opacity-100 transition-opacity",t),...n,children:r}));di.displayName="ChatBubbleActions";const ui=g.forwardRef(({onSend:e,placeholder:t,disabled:r,isLoading:n,showAttach:s,onAttach:a,acceptFiles:i="*",onStop:l,value:c,onChange:d,headerSlot:p,footerSlot:u,maxLength:m,className:f},h)=>{const x=re(),w=g.useRef(null),v=g.useRef(null),[y,j]=g.useState(""),k=c!==void 0,S=k?c:y,R=M=>{k?d==null||d(M):j(M)},_=()=>{const M=w.current;M&&(M.style.height="auto",M.style.height=Math.min(M.scrollHeight,160)+"px")},C=()=>{const M=S.trim();!M||r||n||(e==null||e(M),R(""),w.current&&(w.current.style.height="auto"))},A=M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),C())},L=()=>{var M;(M=v.current)==null||M.click()},N=M=>{M.target.files&&M.target.files.length>0&&(a==null||a(M.target.files)),M.target.value=""},$=S.length,I=m?$>m:!1;return o.jsxs("div",{ref:h,className:b("rounded-xl border border-border bg-background",f),children:[p&&o.jsx("div",{className:"px-3 pt-2 pb-1 border-b border-border/40",children:p}),o.jsxs("div",{className:"flex items-end gap-2 p-2",children:[s&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:L,className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors","aria-label":x.chatInput_attachFile,disabled:r,children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}),o.jsx("input",{ref:v,type:"file",multiple:!0,accept:i,onChange:N,className:"hidden","aria-hidden":"true"})]}),o.jsx("textarea",{ref:w,value:S,onChange:M=>{R(M.target.value),_()},onKeyDown:A,placeholder:t??x.chatInput_placeholder,disabled:r||n,rows:1,className:"flex-1 resize-none bg-transparent text-sm outline-none placeholder:text-muted-foreground min-h-[36px] py-2 px-2 max-h-40"}),n&&l?o.jsx("button",{type:"button",onClick:l,className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-destructive/10 text-destructive hover:bg-destructive/20 transition-colors","aria-label":x.chatInput_stopGenerating,children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}):o.jsx("button",{type:"button",onClick:C,disabled:r||n||!S.trim()||I,className:b("flex h-9 w-9 shrink-0 items-center justify-center rounded-lg transition-colors",S.trim()&&!r&&!n&&!I?"bg-primary text-primary-foreground hover:bg-primary/90":"bg-muted text-muted-foreground cursor-not-allowed"),"aria-label":x.chatInput_sendMessage,children:n?o.jsx("svg",{className:"animate-spin",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}):o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"m5 12 7-7 7 7"}),o.jsx("path",{d:"M12 19V5"})]})})]}),(u||m)&&o.jsxs("div",{className:"px-3 pb-2 pt-0.5 flex items-center gap-2",children:[o.jsx("div",{className:"flex-1",children:u}),m&&o.jsxs("span",{className:b("text-[10px] tabular-nums shrink-0",I?"text-destructive font-medium":"text-muted-foreground"),children:[$,"/",m]})]})]})});ui.displayName="ChatInput";const mi=g.forwardRef(({className:e,children:t,...r},n)=>o.jsx("div",{ref:n,className:b("flex flex-col h-full",e),...r,children:t}));mi.displayName="ChatContainer";const fi=g.forwardRef(({className:e,children:t,autoScroll:r=!0,...n},s)=>{const a=g.useRef(null),i=g.Children.count(t);return g.useEffect(()=>{r&&a.current&&a.current.scrollIntoView({behavior:"smooth"})},[i,r]),o.jsx(cr,{className:"flex-1",orientation:"vertical",children:o.jsxs("div",{ref:s,className:b("flex flex-col gap-4 p-4",e),...n,children:[t,o.jsx("div",{ref:a})]})})});fi.displayName="ChatList";const gi=g.forwardRef(({className:e,variant:t="dots",text:r,...n},s)=>{const a=re(),i=r??a.aiLoading_thinking;return t==="text"?o.jsxs("div",{ref:s,className:b("flex items-center gap-1.5 text-sm text-muted-foreground",e),...n,children:[o.jsx("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),o.jsxs("span",{className:"animate-pulse",children:[i,"…"]})]}):o.jsxs("div",{ref:s,className:b("flex items-center gap-1",e),...n,children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-muted-foreground/60 animate-bounce [animation-delay:0ms]"}),o.jsx("span",{className:"h-2 w-2 rounded-full bg-muted-foreground/60 animate-bounce [animation-delay:150ms]"}),o.jsx("span",{className:"h-2 w-2 rounded-full bg-muted-foreground/60 animate-bounce [animation-delay:300ms]"})]})});gi.displayName="AILoading";function lt(e){const t=[],r=/(`[^`]+`)|(\~\~[^~]+\~\~)|(\*\*[^*]+\*\*)|(\*[^*]+\*)|(!\[[^\]]*\]\([^)]+\))|(\[[^\]]+\]\([^)]+\))/g;let n=0,s;for(;(s=r.exec(e))!==null;){s.index>n&&t.push(e.slice(n,s.index));const a=s[0];if(a.startsWith("`"))t.push(o.jsx("code",{className:"px-1 py-0.5 rounded bg-muted text-sm font-mono",children:a.slice(1,-1)},s.index));else if(a.startsWith("~~"))t.push(o.jsx("del",{className:"text-muted-foreground",children:a.slice(2,-2)},s.index));else if(a.startsWith("**"))t.push(o.jsx("strong",{children:a.slice(2,-2)},s.index));else if(a.startsWith("*"))t.push(o.jsx("em",{children:a.slice(1,-1)},s.index));else if(a.startsWith("![")){const i=a.indexOf("]"),l=a.slice(2,i),c=a.slice(i+2,-1);t.push(o.jsx("img",{src:c,alt:l,className:"max-w-full rounded-lg my-2 inline-block",loading:"lazy"},s.index))}else if(a.startsWith("[")){const i=a.indexOf("]"),l=a.slice(1,i),c=a.slice(i+2,-1);t.push(o.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 hover:text-primary/80",children:l},s.index))}n=s.index+a.length}return n<e.length&&t.push(e.slice(n)),t}function Rm(e){const t=e.split(`
|
|
36
36
|
`),r=[];let n=0,s=0;for(;n<t.length;){const a=t[n];if(a.trimStart().startsWith("```")){const l=a.trimStart().slice(3).trim(),c=[];for(n++;n<t.length&&!t[n].trimStart().startsWith("```");)c.push(t[n]),n++;n++,r.push(o.jsx("pre",{className:"overflow-x-auto rounded-lg p-4 text-[13px] leading-relaxed font-mono my-3",style:{background:"var(--cb-bg, #1e1e2e)",color:"var(--cb-plain, #d4d4d4)"},children:o.jsx("code",{"data-language":l||void 0,children:c.join(`
|
|
37
|
-
`)})},s++));continue}const i=a.match(/^(#{1,6})\s+(.*)/);if(i){const l=i[1].length,c=i[2],d=`h${l}`,g={1:"text-2xl font-bold mt-6 mb-3",2:"text-xl font-semibold mt-5 mb-2",3:"text-lg font-semibold mt-4 mb-2",4:"text-base font-semibold mt-3 mb-1",5:"text-sm font-semibold mt-2 mb-1",6:"text-sm font-medium mt-2 mb-1"};r.push(o.jsx(d,{className:g[l],children:lt(c)},s++)),n++;continue}if(/^[\s]*[-*]\s/.test(a)){const l=[];for(;n<t.length&&/^[\s]*[-*]\s/.test(t[n]);)l.push(o.jsx("li",{children:lt(t[n].replace(/^[\s]*[-*]\s/,""))},s++)),n++;r.push(o.jsx("ul",{className:"list-disc pl-5 space-y-1 my-2 text-sm",children:l},s++));continue}if(/^\s*\d+\.\s/.test(a)){const l=[];for(;n<t.length&&/^\s*\d+\.\s/.test(t[n]);)l.push(o.jsx("li",{children:lt(t[n].replace(/^\s*\d+\.\s/,""))},s++)),n++;r.push(o.jsx("ol",{className:"list-decimal pl-5 space-y-1 my-2 text-sm",children:l},s++));continue}if(a.startsWith(">")){const l=[];for(;n<t.length&&t[n].startsWith(">");)l.push(t[n].replace(/^>\s?/,"")),n++;r.push(o.jsx("blockquote",{className:"border-l-4 border-primary/40 pl-4 italic text-muted-foreground my-3 text-sm",children:lt(l.join(" "))},s++));continue}if(a.includes("|")&&n+1<t.length&&/^\s*\|?[\s\-:|]+\|/.test(t[n+1])){const l=[];for(;n<t.length&&t[n].includes("|");)l.push(t[n]),n++;if(l.length>=2){const c=u=>u.split("|").map(f=>f.trim()).filter((f,m,h)=>m>0&&m<h.length),d=c(l[0]),g=l.slice(2).map(c);r.push(o.jsx("div",{className:"overflow-x-auto my-3",children:o.jsxs("table",{className:"w-full text-sm border-collapse",children:[o.jsx("thead",{children:o.jsx("tr",{className:"border-b border-border",children:d.map((u,f)=>o.jsx("th",{className:"px-3 py-2 text-left font-semibold text-foreground",children:lt(u)},f))})}),o.jsx("tbody",{children:g.map((u,f)=>o.jsx("tr",{className:"border-b border-border/50",children:u.map((m,h)=>o.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:lt(m)},h))},f))})]})},s++));continue}}if(/^[-*_]{3,}\s*$/.test(a)){r.push(o.jsx("hr",{className:"my-4 border-border"},s++)),n++;continue}if(a.trim()===""){n++;continue}r.push(o.jsx("p",{className:"text-sm leading-relaxed my-2",children:lt(a)},s++)),n++}return r}const pi=p.forwardRef(({content:e,streaming:t,className:r,...n},s)=>{const a=t?e:e.trim(),i=p.useMemo(()=>{try{return Rm(a)}catch{return[p.createElement("p",{className:"text-sm"},a)]}},[a]);return o.jsx("div",{ref:s,className:b("markdown-renderer",r),...n,children:i})});pi.displayName="MarkdownRenderer";const hi=p.forwardRef(({suggestions:e,onSelect:t,columns:r=2,className:n,...s},a)=>{const i={1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"};return o.jsx("div",{ref:a,className:b("grid gap-3",i[r],n),...s,children:e.map((l,c)=>o.jsxs("button",{type:"button",onClick:()=>t==null?void 0:t(l.prompt),className:b("flex flex-col items-start gap-1 rounded-xl border border-border p-4","bg-card text-left transition-colors hover:bg-muted/60 hover:border-primary/30","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:l.title}),l.description&&o.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:l.description})]},c))})});hi.displayName="PromptSuggestions";const xi=p.forwardRef(({models:e,value:t,onChange:r,placeholder:n,compact:s,className:a,...i},l)=>{const c=te(),[d,g]=p.useState(!1),[u,f]=p.useState(""),m=p.useRef(null),h=p.useRef(null),x=e.find(v=>v.id===t),y=p.useMemo(()=>{if(!u)return e;const v=u.toLowerCase();return e.filter(j=>{var R;return j.name.toLowerCase().includes(v)||((R=j.provider)==null?void 0:R.toLowerCase().includes(v))||j.id.toLowerCase().includes(v)})},[e,u]);p.useEffect(()=>{d&&(f(""),setTimeout(()=>{var v;return(v=h.current)==null?void 0:v.focus()},0))},[d]),p.useEffect(()=>{if(!d)return;const v=j=>{m.current&&!m.current.contains(j.target)&&g(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[d]);const w=v=>{v.key==="Escape"&&g(!1)};return o.jsxs("div",{ref:m,className:b("relative",a),...i,children:[o.jsxs("button",{ref:l,type:"button",onClick:()=>g(v=>!v),className:b("flex items-center gap-2 rounded-lg border border-border bg-background px-3 py-1.5 text-sm transition-colors hover:bg-muted","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",!x&&"text-muted-foreground"),children:[x?o.jsxs(o.Fragment,{children:[x.icon&&o.jsx("span",{className:"text-base shrink-0",children:x.icon}),o.jsx("span",{className:"font-medium truncate",children:x.name}),!s&&x.provider&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",x.provider,")"]})]}):o.jsx("span",{children:n??c.modelSelector_placeholder}),o.jsx("svg",{className:b("h-3.5 w-3.5 ml-auto shrink-0 text-muted-foreground transition-transform",d&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"m6 9 6 6 6-6"})})]}),d&&o.jsxs("div",{className:"absolute z-50 mt-1 w-full min-w-[260px] rounded-xl border border-border bg-popover shadow-lg animate-in fade-in-0 zoom-in-95",onKeyDown:w,children:[o.jsx("div",{className:"p-2 border-b border-border",children:o.jsx("input",{ref:h,value:u,onChange:v=>f(v.target.value),placeholder:c.modelSelector_searchPlaceholder,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground px-2 py-1"})}),o.jsxs("div",{className:"max-h-[280px] overflow-auto p-1",children:[y.length===0&&o.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:c.modelSelector_noResults}),y.map(v=>o.jsxs("button",{type:"button",disabled:v.disabled,onClick:()=>{r==null||r(v.id),g(!1)},className:b("flex w-full items-start gap-3 rounded-lg px-3 py-2.5 text-left text-sm transition-colors","hover:bg-muted focus-visible:outline-none focus-visible:bg-muted",v.id===t&&"bg-primary/10",v.disabled&&"opacity-50 cursor-not-allowed"),children:[v.icon&&o.jsx("span",{className:"text-lg shrink-0 mt-0.5",children:v.icon}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-medium truncate",children:v.name}),v.id===t&&o.jsx("svg",{className:"h-4 w-4 text-primary shrink-0",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})})]}),v.provider&&o.jsx("span",{className:"text-xs text-muted-foreground",children:v.provider}),v.description&&o.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:v.description}),v.badges&&v.badges.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1 mt-1.5",children:v.badges.map(j=>o.jsx("span",{className:"inline-flex items-center rounded-full border border-border px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:j},j))})]})]},v.id))]})]})]})});xi.displayName="ModelSelector";const bi=p.forwardRef(({modes:e,value:t,onChange:r,size:n="default",className:s,...a},i)=>o.jsx("div",{ref:i,className:b("inline-flex items-center gap-1 rounded-lg bg-muted/50 p-1",s),role:"radiogroup",...a,children:e.map(l=>{const c=l.id===t;return o.jsxs("button",{type:"button",role:"radio","aria-checked":c,onClick:()=>r==null?void 0:r(l.id),title:l.description,className:b("rounded-md transition-all text-sm font-medium whitespace-nowrap","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",n==="sm"?"px-2.5 py-1 text-xs":"px-3 py-1.5",c?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[l.icon&&o.jsx("span",{className:"mr-1",children:l.icon}),l.label]},l.id)})}));bi.displayName="ChatModeSelector";const vi=p.forwardRef(({question:e,options:t,onSelect:r,selected:n,allowFreeText:s,onFreeTextSubmit:a,columns:i=1,className:l,...c},d)=>{const g=te(),[u,f]=p.useState(""),m=!!n,h=()=>{const x=u.trim();x&&(a==null||a(x),f(""))};return o.jsxs("div",{ref:d,className:b("rounded-2xl bg-muted text-foreground rounded-bl-md px-4 py-3 max-w-[85%]",l),...c,children:[o.jsx("p",{className:"text-sm leading-relaxed mb-3",children:e}),o.jsx("div",{className:b("grid gap-2",i===2?"grid-cols-1 sm:grid-cols-2":"grid-cols-1"),children:t.map(x=>{const y=x.id===n;return o.jsxs("button",{type:"button",disabled:m,onClick:()=>r==null?void 0:r(x.id,x.label),className:b("flex items-center gap-2 rounded-xl border px-3 py-2 text-left text-sm transition-all","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",y?"border-primary bg-primary/10 text-primary font-medium":m?"border-border/50 text-muted-foreground opacity-50 cursor-default":"border-border bg-background hover:border-primary/40 hover:bg-primary/5 cursor-pointer"),children:[y&&o.jsx("svg",{className:"h-4 w-4 shrink-0 text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}),!y&&o.jsx("span",{className:b("h-4 w-4 shrink-0 rounded-full border-2",m?"border-border/50":"border-border")}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("span",{className:"block truncate",children:x.label}),x.description&&o.jsx("span",{className:"block text-xs text-muted-foreground mt-0.5 line-clamp-1",children:x.description})]})]},x.id)})}),s&&!m&&o.jsxs("div",{className:"flex gap-2 mt-2",children:[o.jsx("input",{type:"text",value:u,onChange:x=>f(x.target.value),onKeyDown:x=>{x.key==="Enter"&&h()},placeholder:g.followUp_freeTextPlaceholder,className:"flex-1 bg-background rounded-lg border border-border px-3 py-1.5 text-sm outline-none placeholder:text-muted-foreground focus:border-primary/40"}),o.jsx("button",{type:"button",onClick:h,disabled:!u.trim(),className:b("rounded-lg px-3 py-1.5 text-sm font-medium transition-colors",u.trim()?"bg-primary text-primary-foreground hover:bg-primary/90":"bg-muted text-muted-foreground cursor-not-allowed"),children:g.followUp_send})]})]})});vi.displayName="ChatFollowUp";const wi=p.forwardRef(({id:e,question:t,options:r,onSelect:n,selectedId:s,disabled:a=!1,allowFreeText:i=!1,onFreeTextSubmit:l,columns:c=1,freeTextValue:d,className:g,...u},f)=>{const[m,h]=p.useState(""),[x,y]=p.useState(null),[w,v]=p.useState(null),j=Array.isArray(r)?r:[],R=t??"",M=s??x,C=d??w,k=a||M!=null&&M!==""||C!=null&&C!=="",N=p.useCallback((_,D)=>{k||(y(_),n==null||n(_,D))},[k,n]),S=p.useCallback(()=>{const _=(m??"").trim();!_||k||(v(_),l==null||l(_),h(""))},[m,k,l]);return o.jsxs("div",{ref:f,"data-question-id":e,className:b("rounded-xl border border-border/60 overflow-hidden","bg-card shadow-sm","animate-in fade-in-0 slide-in-from-bottom-2 duration-300",g),...u,children:[o.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border/40 bg-muted/30",children:[o.jsx("div",{className:"flex-shrink-0 flex items-center justify-center w-7 h-7 rounded-lg bg-primary/15 text-primary",children:o.jsx(I.HelpCircle,{className:"w-4 h-4"})}),o.jsx("p",{className:"text-sm font-medium text-foreground leading-snug",children:R})]}),o.jsxs("div",{className:"p-3 space-y-3",children:[j.length>0&&o.jsx("div",{className:b("grid gap-2",c===2?"grid-cols-1 sm:grid-cols-2":"grid-cols-1"),children:j.map((_,D)=>{if(!_)return null;const F=_.id||`opt-${D}`,B=_.label||F,P=M===_.id;return o.jsxs("button",{type:"button",disabled:k,onClick:()=>N(_.id,B),className:b("group relative flex items-center gap-3 w-full p-3 rounded-lg border text-left","transition-all duration-200 ease-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",P?"border-primary bg-primary/8 ring-1 ring-primary/20":k?"border-border/40 text-muted-foreground/60 cursor-not-allowed":"border-border/60 bg-background hover:border-primary/40 hover:bg-accent/50 cursor-pointer active:scale-[0.98]"),children:[o.jsx("div",{className:b("flex-shrink-0 flex items-center justify-center w-5 h-5 rounded-full border-2 transition-all duration-200",P?"border-primary bg-primary scale-110":k?"border-muted-foreground/30":"border-muted-foreground/40 group-hover:border-primary/60"),children:P&&o.jsx(I.Check,{className:"w-3 h-3 text-primary-foreground animate-in zoom-in-50 duration-200"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("span",{className:b("block text-sm font-medium leading-tight",P?"text-primary":"text-foreground"),children:B}),_.description&&o.jsx("span",{className:"block text-xs text-muted-foreground mt-0.5 line-clamp-2",children:_.description})]})]},F)})}),C&&o.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-primary/8 border border-primary/20",children:[o.jsx(I.Check,{className:"w-4 h-4 text-primary flex-shrink-0"}),o.jsx("span",{className:"text-sm font-medium text-primary truncate",children:C})]}),i&&!k&&o.jsxs("div",{className:"flex gap-2 pt-2 border-t border-border/30",children:[o.jsx("input",{type:"text",value:m,onChange:_=>h(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),S())},placeholder:"Или напишите свой ответ...",className:b("flex-1 rounded-lg border border-border/60 bg-background px-3 py-2 text-sm","placeholder:text-muted-foreground/60","outline-none focus:border-primary/50 focus:ring-1 focus:ring-primary/20","transition-colors")}),o.jsx("button",{type:"button",onClick:S,disabled:!(m??"").trim(),className:b("flex-shrink-0 flex items-center justify-center w-9 h-9 rounded-lg transition-all duration-150",(m??"").trim()?"bg-primary text-primary-foreground hover:bg-primary/90 cursor-pointer active:scale-95":"bg-muted text-muted-foreground/50 cursor-not-allowed"),children:o.jsx(I.Send,{className:"w-4 h-4"})})]})]})]})});wi.displayName="ChatQuestion";const Yn={success:{Icon:I.CheckCircle2,border:"border-emerald-500/30",bg:"bg-emerald-500/5",iconBox:"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",title:"text-emerald-900 dark:text-emerald-100",btn:"bg-emerald-600 hover:bg-emerald-700 text-white"},info:{Icon:I.Info,border:"border-blue-500/30",bg:"bg-blue-500/5",iconBox:"bg-blue-500/15 text-blue-600 dark:text-blue-400",title:"text-blue-900 dark:text-blue-100",btn:"bg-blue-600 hover:bg-blue-700 text-white"},warning:{Icon:I.AlertTriangle,border:"border-amber-500/30",bg:"bg-amber-500/5",iconBox:"bg-amber-500/15 text-amber-600 dark:text-amber-400",title:"text-amber-900 dark:text-amber-100",btn:"bg-amber-600 hover:bg-amber-700 text-white"},result:{Icon:I.Sparkles,border:"border-violet-500/30",bg:"bg-gradient-to-br from-violet-500/8 to-emerald-500/5",iconBox:"bg-violet-500/15 text-violet-600 dark:text-violet-400",title:"text-violet-900 dark:text-violet-100",btn:"bg-violet-600 hover:bg-violet-700 text-white"}},yi=p.forwardRef(({type:e="info",title:t,description:r,icon:n,action:s,dismissible:a=!1,onDismiss:i,className:l,...c},d)=>{const[g,u]=p.useState(!1),[f,m]=p.useState(!1),h=Yn[e]??Yn.info,x=n??h.Icon,y=p.useCallback(()=>{u(!0),i==null||i()},[i]),w=p.useCallback(()=>{f||!(s!=null&&s.onClick)||(m(!0),s.onClick(),setTimeout(()=>m(!1),1e3))},[s,f]);return g?null:o.jsx("div",{ref:d,className:b("rounded-xl border overflow-hidden shadow-sm","animate-in fade-in-0 slide-in-from-bottom-2 duration-300",h.border,h.bg,l),...c,children:o.jsxs("div",{className:"flex items-start gap-3 p-4",children:[o.jsx("div",{className:b("flex-shrink-0 flex items-center justify-center w-9 h-9 rounded-lg",h.iconBox),children:o.jsx(x,{className:"w-5 h-5"})}),o.jsxs("div",{className:"flex-1 min-w-0 pt-0.5",children:[t&&o.jsx("h4",{className:b("text-sm font-semibold leading-tight",h.title),children:t}),r&&o.jsx("p",{className:"text-sm text-muted-foreground mt-1 leading-relaxed",children:r})]}),s&&s.label&&o.jsxs("button",{type:"button",disabled:f,onClick:w,className:b("flex-shrink-0 inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-lg","text-sm font-medium whitespace-nowrap","transition-all duration-150","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","active:scale-95",f?"opacity-60 cursor-wait":"cursor-pointer",h.btn),children:[s.label,o.jsx(I.ArrowRight,{className:"w-3.5 h-3.5"})]}),a&&o.jsx("button",{type:"button",onClick:y,className:"flex-shrink-0 p-1 rounded-md hover:bg-foreground/10 text-muted-foreground hover:text-foreground transition-colors","aria-label":"Dismiss",children:o.jsx(I.X,{className:"w-4 h-4"})})]})})});yi.displayName="ChatActionCard";const Zn={task:{Icon:I.CheckSquare,color:"text-blue-600 dark:text-blue-400 bg-blue-500/12"},project:{Icon:I.FolderKanban,color:"text-purple-600 dark:text-purple-400 bg-purple-500/12"},file:{Icon:I.FileText,color:"text-orange-600 dark:text-orange-400 bg-orange-500/12"},custom:{Icon:I.FileText,color:"text-primary bg-primary/12"}},ji=p.forwardRef(({type:e="task",title:t,id:r,status:n,properties:s,icon:a,onNavigate:i,className:l,...c},d)=>{const g=Zn[e]??Zn.custom,u=a??g.Icon,f=typeof i=="function",m=s&&typeof s=="object"?s:null,h=p.useCallback(()=>{i==null||i()},[i]),x=p.useCallback(y=>{f&&(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),i==null||i())},[f,i]);return o.jsxs("div",{ref:d,role:f?"button":void 0,tabIndex:f?0:void 0,onClick:f?h:void 0,onKeyDown:f?x:void 0,className:b("rounded-xl border border-border/60 bg-card overflow-hidden shadow-sm","animate-in fade-in-0 slide-in-from-bottom-2 duration-300",f&&"cursor-pointer hover:border-primary/40 hover:shadow-md transition-all active:scale-[0.99]",l),...c,children:[o.jsxs("div",{className:"flex items-start gap-3 p-4",children:[o.jsx("div",{className:b("flex-shrink-0 flex items-center justify-center w-9 h-9 rounded-lg",g.color),children:o.jsx(u,{className:"w-5 h-5"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o.jsx("h4",{className:"text-sm font-semibold text-foreground truncate",children:t??"Untitled"}),r&&o.jsx("span",{className:"inline-flex px-1.5 py-0.5 rounded bg-muted text-[11px] font-mono text-muted-foreground leading-none",children:r})]}),n&&o.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:n})]}),f&&o.jsx(I.ExternalLink,{className:"flex-shrink-0 w-4 h-4 text-muted-foreground/50 mt-0.5"})]}),m&&Object.keys(m).length>0&&o.jsx("div",{className:"px-4 pb-4",children:o.jsx("div",{className:"rounded-lg bg-muted/40 divide-y divide-border/30",children:Object.entries(m).map(([y,w])=>o.jsxs("div",{className:"flex items-baseline justify-between gap-4 px-3 py-2 text-xs",children:[o.jsx("span",{className:"text-muted-foreground font-medium whitespace-nowrap",children:y}),o.jsx("span",{className:"text-foreground text-right break-words",children:String(w??"")})]},y))})})]})});ji.displayName="ChatEntityPreview";const Ni=p.forwardRef(({title:e,description:t,icon:r,linkLabel:n,onNavigate:s,metadata:a,variant:i="success",className:l,...c},d)=>{const g=r??(i==="highlight"?I.Sparkles:I.CheckCircle2),u=a&&typeof a=="object"?a:null,f=typeof s=="function",m=i==="success";return o.jsx("div",{ref:d,className:b("rounded-xl border overflow-hidden shadow-sm","animate-in fade-in-0 slide-in-from-bottom-3 duration-300",m?"border-emerald-500/30 bg-gradient-to-br from-emerald-500/8 via-emerald-500/4 to-transparent":"border-violet-500/30 bg-gradient-to-br from-violet-500/8 via-violet-500/4 to-transparent",l),...c,children:o.jsxs("div",{className:"p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:b("flex-shrink-0 flex items-center justify-center w-10 h-10 rounded-xl",m?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":"bg-violet-500/15 text-violet-600 dark:text-violet-400"),children:o.jsx(g,{className:"w-5 h-5"})}),o.jsxs("div",{className:"flex-1 min-w-0 pt-0.5",children:[e&&o.jsx("h4",{className:b("text-sm font-semibold leading-tight",m?"text-emerald-900 dark:text-emerald-100":"text-violet-900 dark:text-violet-100"),children:e}),t&&o.jsx("p",{className:"text-sm text-muted-foreground mt-1 leading-relaxed",children:t})]}),f&&o.jsxs("button",{type:"button",onClick:s,className:b("flex-shrink-0 inline-flex items-center gap-1.5 px-4 py-2 rounded-lg","text-sm font-medium whitespace-nowrap","transition-all duration-150","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","active:scale-95 cursor-pointer",m?"bg-emerald-600 hover:bg-emerald-700 text-white":"bg-violet-600 hover:bg-violet-700 text-white"),children:[n??"Перейти",o.jsx(I.ArrowRight,{className:"w-4 h-4"})]})]}),u&&Object.keys(u).length>0&&o.jsx("div",{className:"rounded-lg bg-background/60 border border-border/30 divide-y divide-border/20",children:Object.entries(u).map(([h,x])=>o.jsxs("div",{className:"flex items-baseline justify-between gap-4 px-3 py-2 text-xs",children:[o.jsx("span",{className:"text-muted-foreground font-medium whitespace-nowrap",children:h}),o.jsx("span",{className:"text-foreground text-right break-words",children:String(x??"")})]},h))})]})})});Ni.displayName="ChatResultCard";const _m={copy:{path:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2 M9 2h6a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z"},retry:{path:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8 M3 3v5h5"},edit:{path:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"},like:{path:"M7 10v12 M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2h0a3.13 3.13 0 0 1 3 3.88Z"},dislike:{path:"M17 14V2 M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22h0a3.13 3.13 0 0 1-3-3.88Z"},share:{path:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8 M16 6l-4-4-4 4 M12 2v13"}},Ci=p.forwardRef(({actions:e=["copy"],content:t,likeState:r,onCopy:n,onRetry:s,onEdit:a,onLike:i,onDislike:l,onShare:c,visibility:d="hover",className:g,...u},f)=>{const m=te(),[h,x]=p.useState(!1),y={copy:m.messageActions_copy,retry:m.messageActions_retry,edit:m.messageActions_edit,like:m.messageActions_like,dislike:m.messageActions_dislike,share:m.messageActions_share},v={copy:async()=>{if(t)try{await navigator.clipboard.writeText(t),x(!0),setTimeout(()=>x(!1),2e3)}catch{}n==null||n()},retry:s,edit:a,like:i,dislike:l,share:c};return o.jsx("div",{ref:f,className:b("flex items-center gap-0.5",d==="hover"&&"opacity-0 group-hover:opacity-100 transition-opacity",g),...u,children:e.map(j=>{const R=j==="copy"&&h,k=j==="like"&&r==="liked"||j==="dislike"&&r==="disliked";return o.jsx("button",{type:"button",onClick:v[j],"aria-label":y[j],title:R?m.messageActions_copied:y[j],className:b("inline-flex items-center justify-center h-7 w-7 rounded-md transition-colors","text-muted-foreground hover:text-foreground hover:bg-muted","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",k&&"text-primary",R&&"text-green-500"),children:R?o.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}):o.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:k?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:_m[j].path})})},j)})})});Ci.displayName="MessageActions";const ki=p.forwardRef(({text:e,speed:t=2,onComplete:r,cursor:n=!0,immediate:s=!1,className:a,...i},l)=>{const[c,d]=p.useState(s?e:""),[g,u]=p.useState(s),f=p.useRef(e),m=p.useRef(),h=p.useRef(s?e.length:0);return p.useEffect(()=>{if(e!==f.current){if(f.current=e,s){d(e),u(!0),h.current=e.length;return}e.startsWith(c)||(h.current=0,d("")),u(!1)}},[e,s,c]),p.useEffect(()=>{if(s||g)return;const x=()=>{const y=Math.min(h.current+t,e.length);h.current=y,d(e.slice(0,y)),y>=e.length?(u(!0),r==null||r()):m.current=requestAnimationFrame(x)};return m.current=requestAnimationFrame(x),()=>{m.current&&cancelAnimationFrame(m.current)}},[e,t,s,g,r]),o.jsxs("span",{ref:l,className:b("whitespace-pre-wrap",a),...i,children:[c,n&&!g&&o.jsx("span",{className:"inline-block w-[2px] h-[1em] bg-foreground ml-px align-text-bottom animate-pulse"})]})});ki.displayName="StreamingText";const Si=p.forwardRef(({content:e,isThinking:t,duration:r,defaultOpen:n=!1,title:s,className:a,...i},l)=>{const c=te(),[d,g]=p.useState(n||t===!0),[u,f]=p.useState(r??0),m=p.useRef(Date.now());p.useEffect(()=>{t&&g(!0)},[t]),p.useEffect(()=>{if(!t)return;m.current=Date.now();const y=setInterval(()=>{f(Math.floor((Date.now()-m.current)/1e3))},1e3);return()=>clearInterval(y)},[t]);const h=t?u:r??u,x=y=>y<60?`${y}s`:`${Math.floor(y/60)}m ${y%60}s`;return o.jsxs("div",{ref:l,className:b("rounded-xl border border-border/60 overflow-hidden my-2",t&&"border-primary/30",a),...i,children:[o.jsxs("button",{type:"button",onClick:()=>g(y=>!y),className:b("flex items-center gap-2 w-full px-3 py-2 text-sm transition-colors","hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",t&&"bg-primary/5"),children:[o.jsxs("svg",{className:b("h-4 w-4 shrink-0 text-muted-foreground",t&&"text-primary animate-pulse"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"}),o.jsx("path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"}),o.jsx("path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"}),o.jsx("path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375"}),o.jsx("path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5"}),o.jsx("path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396"}),o.jsx("path",{d:"M19.938 10.5a4 4 0 0 1 .585.396"}),o.jsx("path",{d:"M6 18a4 4 0 0 1-1.967-.516"}),o.jsx("path",{d:"M19.967 17.484A4 4 0 0 1 18 18"})]}),o.jsx("span",{className:b("font-medium",t&&"text-primary animate-pulse"),children:t?c.reasoning_thinking:s??c.reasoning_title}),h>0&&o.jsx("span",{className:"text-xs text-muted-foreground",children:t?`${x(h)}...`:De(c.reasoning_thoughtFor,{duration:x(h)})}),o.jsx("svg",{className:b("h-3.5 w-3.5 ml-auto shrink-0 text-muted-foreground transition-transform duration-200",d&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"m6 9 6 6 6-6"})})]}),d&&o.jsx("div",{className:"border-t border-border/40 px-4 py-3 bg-muted/20",children:o.jsx("div",{className:"border-l-2 border-primary/20 pl-3",children:o.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed whitespace-pre-wrap",children:[e,t&&o.jsx("span",{className:"inline-block w-[2px] h-[1em] bg-muted-foreground ml-px align-text-bottom animate-pulse"})]})})})]})});Si.displayName="ReasoningBlock";const Ri=p.forwardRef(({name:e,args:t,result:r,status:n,error:s,defaultOpen:a=!1,className:i,...l},c)=>{const d=te(),[g,u]=p.useState(a),f={running:o.jsx("svg",{className:"h-3.5 w-3.5 animate-spin text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),success:o.jsx("svg",{className:"h-3.5 w-3.5 text-green-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}),error:o.jsxs("svg",{className:"h-3.5 w-3.5 text-destructive",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 6 18"}),o.jsx("path",{d:"m6 6 12 12"})]})},m={running:De(d.toolCall_calling,{name:e}),success:e,error:De(d.toolCall_failed,{name:e})};return o.jsxs("div",{ref:c,className:b("rounded-xl border overflow-hidden my-1",n==="error"?"border-destructive/30":"border-border/60",i),...l,children:[o.jsxs("button",{type:"button",onClick:()=>u(h=>!h),className:b("flex items-center gap-2 w-full px-3 py-2 text-sm transition-colors","hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[o.jsx("svg",{className:"h-4 w-4 shrink-0 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),f[n],o.jsx("span",{className:b("font-medium font-mono text-xs",n==="running"&&"text-primary",n==="error"&&"text-destructive"),children:m[n]}),o.jsx("svg",{className:b("h-3.5 w-3.5 ml-auto shrink-0 text-muted-foreground transition-transform duration-200",g&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"m6 9 6 6 6-6"})})]}),g&&o.jsxs("div",{className:"border-t border-border/40 text-xs",children:[t&&Object.keys(t).length>0&&o.jsxs("div",{className:"px-3 py-2 bg-muted/20",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1 font-semibold",children:d.toolCall_arguments}),o.jsx("pre",{className:"overflow-x-auto font-mono text-foreground/80 whitespace-pre-wrap",children:JSON.stringify(t,null,2)})]}),r&&o.jsxs("div",{className:b("px-3 py-2",t&&"border-t border-border/30"),children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1 font-semibold",children:d.toolCall_result}),o.jsx("pre",{className:"overflow-x-auto font-mono text-foreground/80 whitespace-pre-wrap",children:r})]}),s&&o.jsxs("div",{className:b("px-3 py-2 bg-destructive/5",t&&"border-t border-border/30"),children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-destructive mb-1 font-semibold",children:d.toolCall_error}),o.jsx("pre",{className:"overflow-x-auto font-mono text-destructive whitespace-pre-wrap",children:s})]})]})]})});Ri.displayName="ChatToolCall";function Mm(e,t){const r=new Date,n=new Date(r.getFullYear(),r.getMonth(),r.getDate()),s=new Date(n.getTime()-864e5),a=new Date(n.getTime()-7*864e5),i=[{label:t[0],items:[]},{label:t[1],items:[]},{label:t[2],items:[]},{label:t[3],items:[]}],l=[...e].sort((c,d)=>d.updatedAt.getTime()-c.updatedAt.getTime());for(const c of l){const d=c.updatedAt;d>=n?i[0].items.push(c):d>=s?i[1].items.push(c):d>=a?i[2].items.push(c):i[3].items.push(c)}return i.filter(c=>c.items.length>0)}const _i=p.forwardRef(({conversations:e,activeId:t,onSelect:r,onNew:n,onDelete:s,onRename:a,showSearch:i=!0,className:l,...c},d)=>{const g=te(),[u,f]=p.useState(""),[m,h]=p.useState(null),[x,y]=p.useState(""),w=p.useRef(null),v=p.useMemo(()=>{if(!u)return e;const k=u.toLowerCase();return e.filter(N=>{var S;return N.title.toLowerCase().includes(k)||((S=N.lastMessage)==null?void 0:S.toLowerCase().includes(k))})},[e,u]),j=[g.conversationList_today,g.conversationList_yesterday,g.conversationList_previous7Days,g.conversationList_older],R=p.useMemo(()=>Mm(v,j),[v,j]),M=k=>{h(k.id),y(k.title),setTimeout(()=>{var N;return(N=w.current)==null?void 0:N.focus()},0)},C=()=>{m&&x.trim()&&(a==null||a(m,x.trim())),h(null)};return o.jsxs("div",{ref:d,className:b("flex flex-col h-full",l),...c,children:[n&&o.jsx("div",{className:"p-3 border-b border-border shrink-0",children:o.jsxs("button",{type:"button",onClick:n,className:b("flex items-center justify-center gap-2 w-full rounded-lg border border-border px-3 py-2 text-sm font-medium","transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[o.jsxs("svg",{className:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M5 12h14"}),o.jsx("path",{d:"M12 5v14"})]}),g.conversationList_newChat]})}),i&&o.jsx("div",{className:"px-3 pt-3 pb-2 shrink-0",children:o.jsxs("div",{className:"relative",children:[o.jsxs("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"11",cy:"11",r:"8"}),o.jsx("path",{d:"m21 21-4.3-4.3"})]}),o.jsx("input",{value:u,onChange:k=>f(k.target.value),placeholder:g.conversationList_searchPlaceholder,className:"w-full bg-muted/50 rounded-lg pl-8 pr-3 py-1.5 text-sm outline-none placeholder:text-muted-foreground focus:bg-muted"})]})}),o.jsxs("div",{className:"flex-1 overflow-auto px-2 py-1",children:[R.length===0&&o.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:u?g.conversationList_noResults:g.conversationList_empty}),R.map(k=>o.jsxs("div",{className:"mb-3",children:[o.jsx("div",{className:"px-2 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:k.label}),k.items.map(N=>{const S=N.id===t,_=N.id===m;return o.jsxs("div",{className:b("group flex items-center gap-2 rounded-lg px-2 py-2 cursor-pointer transition-colors",S?"bg-primary/10":"hover:bg-muted"),onClick:()=>!_&&(r==null?void 0:r(N.id)),children:[o.jsx("svg",{className:"h-4 w-4 shrink-0 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z"})}),o.jsx("div",{className:"flex-1 min-w-0",children:_?o.jsx("input",{ref:w,value:x,onChange:D=>y(D.target.value),onBlur:C,onKeyDown:D=>{D.key==="Enter"&&C(),D.key==="Escape"&&h(null)},className:"w-full bg-background border border-border rounded px-1 py-0.5 text-sm outline-none",onClick:D=>D.stopPropagation()}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"text-sm truncate font-medium",children:N.title}),N.lastMessage&&o.jsx("div",{className:"text-xs text-muted-foreground truncate",children:N.lastMessage})]})}),!_&&o.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[a&&o.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),M(N)},className:"h-6 w-6 flex items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":g.conversationList_rename,children:o.jsx("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"})})}),s&&o.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),s(N.id)},className:"h-6 w-6 flex items-center justify-center rounded text-muted-foreground hover:text-destructive hover:bg-destructive/10","aria-label":g.conversationList_delete,children:o.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M3 6h18"}),o.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),o.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]})})]})]},N.id)})]},k.label))]})]})});_i.displayName="ConversationList";const Pm={online:"bg-green-500",offline:"bg-muted-foreground/40",typing:"bg-primary animate-pulse"},Mi=p.forwardRef(({title:e,model:t,modelIcon:r,status:n,onClear:s,onSettings:a,onBack:i,children:l,className:c,...d},g)=>{const u=te(),f={online:u.chatHeader_online,offline:u.chatHeader_offline,typing:u.chatHeader_typing};return o.jsxs("div",{ref:g,className:b("flex items-center gap-3 px-4 h-14 border-b border-border shrink-0 bg-background",c),...d,children:[i&&o.jsx("button",{type:"button",onClick:i,className:"h-8 w-8 flex items-center justify-center rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors -ml-1 shrink-0","aria-label":u.chatHeader_back,children:o.jsx("svg",{className:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"m15 18-6-6 6-6"})})}),r&&o.jsx("span",{className:"text-xl shrink-0",children:r}),o.jsxs("div",{className:"flex-1 min-w-0",children:[e&&o.jsx("div",{className:"text-sm font-semibold truncate",children:e}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[t&&o.jsx("span",{className:"text-xs text-muted-foreground truncate",children:t}),n&&o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("span",{className:b("h-1.5 w-1.5 rounded-full shrink-0",Pm[n])}),o.jsx("span",{className:"text-[10px] text-muted-foreground",children:f[n]})]})]})]}),l,o.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s&&o.jsx("button",{type:"button",onClick:s,className:"h-8 w-8 flex items-center justify-center rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors","aria-label":u.chatHeader_clearConversation,title:u.chatHeader_clearConversation,children:o.jsxs("svg",{className:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M3 6h18"}),o.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),o.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]})}),a&&o.jsx("button",{type:"button",onClick:a,className:"h-8 w-8 flex items-center justify-center rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors","aria-label":u.chatHeader_settings,title:u.chatHeader_settings,children:o.jsxs("svg",{className:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),o.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]})]})});Mi.displayName="ChatHeader";const Pn=p.forwardRef(({citation:e,className:t,...r},n)=>{const[s,a]=p.useState(!1);return o.jsxs("span",{className:"relative inline-block",children:[o.jsx("button",{ref:n,type:"button",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>a(!0),onBlur:()=>a(!1),onClick:()=>window.open(e.url,"_blank","noopener"),className:b("inline-flex items-center justify-center h-4 min-w-[16px] px-1 rounded text-[10px] font-medium","bg-primary/15 text-primary hover:bg-primary/25 transition-colors cursor-pointer","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","align-super",t),"aria-label":`Source ${e.index}: ${e.title}`,...r,children:e.index}),s&&o.jsxs("div",{className:"absolute z-50 bottom-full left-1/2 -translate-x-1/2 mb-2 w-64 rounded-lg border border-border bg-popover shadow-lg p-3 text-left animate-in fade-in-0 zoom-in-95",children:[o.jsxs("div",{className:"flex items-start gap-2",children:[e.favicon&&o.jsx("img",{src:e.favicon,alt:"",className:"h-4 w-4 mt-0.5 shrink-0 rounded"}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:e.title}),o.jsx("div",{className:"text-[10px] text-muted-foreground truncate",children:e.url}),e.snippet&&o.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.snippet})]})]}),o.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-border"})]})]})});Pn.displayName="CitationBadge";const Pi=p.forwardRef(({citations:e,variant:t="footer",className:r,...n},s)=>{const a=te();return t==="inline"?o.jsx("span",{ref:s,className:b("inline",r),...n,children:e.map(i=>o.jsx(Pn,{citation:i},i.index))}):o.jsxs("div",{ref:s,className:b("border-t border-border/50 pt-3 mt-3 space-y-2",r),...n,children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold mb-2",children:a.sourceCitation_sources}),e.map(i=>o.jsxs("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",className:b("flex items-start gap-2.5 rounded-lg border border-border/60 p-2.5 transition-colors","hover:bg-muted/50 hover:border-primary/30"),children:[o.jsx("span",{className:"flex items-center justify-center h-5 w-5 rounded bg-primary/15 text-primary text-[10px] font-semibold shrink-0 mt-0.5",children:i.index}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[i.favicon&&o.jsx("img",{src:i.favicon,alt:"",className:"h-3.5 w-3.5 rounded shrink-0"}),o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title})]}),o.jsx("span",{className:"text-[10px] text-muted-foreground truncate block",children:i.url}),i.snippet&&o.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:i.snippet})]})]},i.index))]})});Pi.displayName="SourceCitation";function Jn(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Qn(e){return e.startsWith("image/")}function eo(e){return e.startsWith("image/")?"🖼️":e.startsWith("video/")?"🎬":e.startsWith("audio/")?"🎵":e.includes("pdf")?"📄":e.includes("zip")||e.includes("rar")||e.includes("tar")?"📦":e.includes("json")||e.includes("xml")||e.includes("csv")?"📊":e.includes("text")||e.includes("javascript")||e.includes("typescript")?"📝":"📎"}const Ii=p.forwardRef(({files:e,onRemove:t,variant:r="compact",className:n,...s},a)=>{const i=te();return e.length===0?null:r==="grid"?o.jsx("div",{ref:a,className:b("grid grid-cols-2 gap-2",n),...s,children:e.map((l,c)=>o.jsxs("div",{className:"group relative rounded-xl border border-border overflow-hidden bg-muted/30",children:[Qn(l.type)&&(l.thumbnail||l.url)?o.jsx("div",{className:"aspect-square",children:o.jsx("img",{src:l.thumbnail||l.url,alt:l.name,className:"h-full w-full object-cover"})}):o.jsx("div",{className:"aspect-square flex items-center justify-center text-3xl bg-muted/50",children:eo(l.type)}),o.jsxs("div",{className:"px-2 py-1.5 border-t border-border/40",children:[o.jsx("div",{className:"text-xs font-medium truncate",children:l.name}),o.jsx("div",{className:"text-[10px] text-muted-foreground",children:Jn(l.size)})]}),t&&o.jsx("button",{type:"button",onClick:()=>t(c),className:"absolute top-1.5 right-1.5 h-5 w-5 rounded-full bg-background/80 backdrop-blur flex items-center justify-center text-muted-foreground hover:text-destructive transition-colors opacity-0 group-hover:opacity-100","aria-label":De(i.filePreview_remove,{name:l.name}),children:o.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 6 18"}),o.jsx("path",{d:"m6 6 12 12"})]})})]},l.id??c))}):o.jsx("div",{ref:a,className:b("flex gap-2 overflow-x-auto pb-1",n),...s,children:e.map((l,c)=>o.jsxs("div",{className:"group relative flex items-center gap-2 rounded-lg border border-border bg-muted/30 px-2.5 py-1.5 shrink-0 max-w-[200px]",children:[Qn(l.type)&&(l.thumbnail||l.url)?o.jsx("img",{src:l.thumbnail||l.url,alt:l.name,className:"h-8 w-8 rounded object-cover shrink-0"}):o.jsx("span",{className:"text-lg shrink-0",children:eo(l.type)}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"text-xs font-medium truncate",children:l.name}),o.jsx("div",{className:"text-[10px] text-muted-foreground",children:Jn(l.size)})]}),t&&o.jsx("button",{type:"button",onClick:()=>t(c),className:"h-5 w-5 rounded-full flex items-center justify-center text-muted-foreground hover:text-destructive transition-colors shrink-0 opacity-0 group-hover:opacity-100","aria-label":De(i.filePreview_remove,{name:l.name}),children:o.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 6 18"}),o.jsx("path",{d:"m6 6 12 12"})]})})]},l.id??c))})});Ii.displayName="FilePreview";const Im={sending:o.jsxs("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"10"}),o.jsx("path",{d:"M12 6v6l4 2"})]}),sent:o.jsx("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}),delivered:o.jsxs("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 7 17l-5-5"}),o.jsx("path",{d:"m22 10-9.5 9.5-2-2"})]}),read:o.jsxs("svg",{className:"h-3 w-3 text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 7 17l-5-5"}),o.jsx("path",{d:"m22 10-9.5 9.5-2-2"})]}),error:o.jsxs("svg",{className:"h-3 w-3 text-destructive",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"10"}),o.jsx("path",{d:"m15 9-6 6"}),o.jsx("path",{d:"m9 9 6 6"})]})},Ti=p.forwardRef(({variant:e="received",avatar:t,avatarFallback:r,content:n,timestamp:s,isLoading:a,status:i,actions:l,textContent:c,likeState:d,onCopy:g,onRetry:u,onEdit:f,onLike:m,onDislike:h,onShare:x,followUp:y,onFollowUpSelect:w,onFollowUpFreeText:v,reasoning:j,toolCalls:R,citations:M,className:C,...k},N)=>{const S=te(),_=e==="sent",[D,F]=p.useState(!1),B=async()=>{if(c)try{await navigator.clipboard.writeText(c),F(!0),setTimeout(()=>F(!1),2e3)}catch{}g==null||g()};return o.jsxs("div",{ref:N,className:b("group flex gap-2 max-w-[85%]",_?"ml-auto flex-row-reverse":"mr-auto",C),...k,children:[(t||r)&&o.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground overflow-hidden",children:t?o.jsx("img",{src:t,alt:r??"avatar",className:"h-full w-full object-cover"}):o.jsx("span",{children:r??"?"})}),o.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[j&&o.jsx("div",{className:b("rounded-xl border border-border/60 overflow-hidden",j.isThinking&&"border-primary/30"),children:o.jsx(Tm,{...j})}),R==null?void 0:R.map((P,q)=>o.jsx(Lm,{...P},q)),o.jsxs("div",{className:b("rounded-2xl px-4 py-2.5 text-sm leading-relaxed",_?"bg-primary text-primary-foreground rounded-br-md":"bg-muted text-foreground rounded-bl-md"),children:[a?o.jsxs("div",{className:"flex items-center gap-1 py-1",children:[o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:0ms]"}),o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:150ms]"}),o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:300ms]"})]}):n,M&&M.length>0&&o.jsxs("div",{className:"border-t border-border/30 pt-2 mt-2 space-y-1.5",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold",children:S.sourceCitation_sources}),M.map(P=>o.jsxs("a",{href:P.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx("span",{className:"h-4 min-w-[16px] px-0.5 rounded bg-primary/15 text-primary text-[10px] font-semibold flex items-center justify-center",children:P.index}),o.jsx("span",{className:"truncate",children:P.title})]},P.index))]})]}),y&&o.jsxs("div",{className:"rounded-2xl bg-muted text-foreground rounded-bl-md px-4 py-3",children:[o.jsx("p",{className:"text-sm leading-relaxed mb-2.5",children:y.question}),o.jsx("div",{className:"grid gap-1.5",children:y.options.map(P=>{const q=P.id===y.selected,V=!!y.selected;return o.jsxs("button",{type:"button",disabled:V,onClick:()=>w==null?void 0:w(P.id,P.label),className:b("flex items-center gap-2 rounded-xl border px-3 py-2 text-left text-sm transition-all",q?"border-primary bg-primary/10 text-primary font-medium":V?"border-border/50 text-muted-foreground opacity-50 cursor-default":"border-border bg-background hover:border-primary/40 hover:bg-primary/5 cursor-pointer"),children:[q?o.jsx("svg",{className:"h-4 w-4 shrink-0 text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}):o.jsx("span",{className:b("h-4 w-4 shrink-0 rounded-full border-2",V?"border-border/50":"border-border")}),o.jsx("span",{className:"truncate",children:P.label})]},P.id)})})]}),(s||i)&&o.jsxs("div",{className:b("flex items-center gap-1 px-1",_&&"flex-row-reverse"),children:[s&&o.jsx("span",{className:"text-[10px] text-muted-foreground",children:s}),i&&Im[i]]}),l&&l.length>0&&!a&&o.jsx("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:l.map(P=>{const q=P==="copy"&&D,V={copy:B,retry:u,edit:f,like:m,dislike:h,share:x},A=P==="like"&&d==="liked"||P==="dislike"&&d==="disliked",T={copy:S.messageActions_copy,retry:S.messageActions_retry,edit:S.messageActions_edit,like:S.messageActions_like,dislike:S.messageActions_dislike,share:S.messageActions_share};return o.jsx("button",{type:"button",onClick:V[P],title:q?S.messageActions_copied:T[P],className:b("h-7 w-7 rounded-md flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",A&&"text-primary",q&&"text-green-500"),children:q?o.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}):P==="copy"?o.jsxs("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),o.jsx("path",{d:"M9 2h6a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z"})]}):P==="retry"?o.jsxs("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),o.jsx("path",{d:"M3 3v5h5"})]}):P==="like"?o.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:A?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M7 10v12 M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2h0a3.13 3.13 0 0 1 3 3.88Z"})}):P==="dislike"?o.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:A?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M17 14V2 M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22h0a3.13 3.13 0 0 1-3-3.88Z"})}):P==="edit"?o.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"})}):o.jsxs("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),o.jsx("path",{d:"M16 6l-4-4-4 4"}),o.jsx("path",{d:"M12 2v13"})]})},P)})})]})]})});Ti.displayName="ChatMessage";function Tm({content:e,isThinking:t,duration:r}){const n=te(),[s,a]=p.useState(t===!0),[i,l]=p.useState(r??0);p.useEffect(()=>{t&&a(!0)},[t]),p.useEffect(()=>{if(!t)return;const d=Date.now(),g=setInterval(()=>l(Math.floor((Date.now()-d)/1e3)),1e3);return()=>clearInterval(g)},[t]);const c=t?i:r??i;return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",onClick:()=>a(d=>!d),className:"flex items-center gap-2 w-full px-3 py-2 text-sm hover:bg-muted/50",children:[o.jsxs("svg",{className:b("h-4 w-4 shrink-0 text-muted-foreground",t&&"text-primary animate-pulse"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"}),o.jsx("path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"})]}),o.jsx("span",{className:b("font-medium",t&&"text-primary animate-pulse"),children:t?n.reasoning_thinking:n.reasoning_title}),c>0&&o.jsx("span",{className:"text-xs text-muted-foreground",children:t?`${c}s...`:De(n.reasoning_thoughtFor,{duration:`${c}s`})}),o.jsx("svg",{className:b("h-3.5 w-3.5 ml-auto text-muted-foreground transition-transform",s&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"m6 9 6 6 6-6"})})]}),s&&o.jsx("div",{className:"border-t border-border/40 px-4 py-3 bg-muted/20",children:o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed whitespace-pre-wrap border-l-2 border-primary/20 pl-3",children:e})})]})}function Lm({name:e,args:t,result:r,status:n,error:s}){const a=te(),[i,l]=p.useState(!1);return o.jsxs("div",{className:b("rounded-xl border overflow-hidden",n==="error"?"border-destructive/30":"border-border/60"),children:[o.jsxs("button",{type:"button",onClick:()=>l(c=>!c),className:"flex items-center gap-2 w-full px-3 py-2 text-sm hover:bg-muted/50",children:[o.jsx("svg",{className:"h-4 w-4 shrink-0 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),n==="running"?o.jsx("svg",{className:"h-3.5 w-3.5 animate-spin text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}):n==="success"?o.jsx("svg",{className:"h-3.5 w-3.5 text-green-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}):o.jsxs("svg",{className:"h-3.5 w-3.5 text-destructive",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 6 18"}),o.jsx("path",{d:"m6 6 12 12"})]}),o.jsx("span",{className:"font-medium font-mono text-xs",children:n==="running"?De(a.toolCall_calling,{name:e}):e}),o.jsx("svg",{className:b("h-3.5 w-3.5 ml-auto text-muted-foreground transition-transform",i&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"m6 9 6 6 6-6"})})]}),i&&o.jsxs("div",{className:"border-t border-border/40 text-xs",children:[t&&Object.keys(t).length>0&&o.jsxs("div",{className:"px-3 py-2 bg-muted/20",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1 font-semibold",children:a.toolCall_arguments}),o.jsx("pre",{className:"overflow-x-auto font-mono whitespace-pre-wrap",children:JSON.stringify(t,null,2)})]}),r&&o.jsxs("div",{className:"px-3 py-2 border-t border-border/30",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1 font-semibold",children:a.toolCall_result}),o.jsx("pre",{className:"overflow-x-auto font-mono whitespace-pre-wrap",children:r})]}),s&&o.jsxs("div",{className:"px-3 py-2 bg-destructive/5 border-t border-border/30",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-destructive mb-1 font-semibold",children:a.toolCall_error}),o.jsx("pre",{className:"overflow-x-auto font-mono text-destructive whitespace-pre-wrap",children:s})]})]})]})}exports.AILoading=gi;exports.Accordion=gc;exports.AccordionContent=ls;exports.AccordionItem=as;exports.AccordionTrigger=is;exports.Alert=As;exports.AlertDescription=Vs;exports.AlertDialog=Rc;exports.AlertDialogAction=qs;exports.AlertDialogCancel=Ws;exports.AlertDialogContent=$s;exports.AlertDialogDescription=Gs;exports.AlertDialogFooter=Os;exports.AlertDialogHeader=Bs;exports.AlertDialogOverlay=xn;exports.AlertDialogPortal=zs;exports.AlertDialogTitle=Hs;exports.AlertDialogTrigger=_c;exports.AlertTitle=Fs;exports.AppShell=Ya;exports.AspectRatio=dc;exports.AudioPlayer=_n;exports.AudioPlaylist=bm;exports.AudioRecorder=xm;exports.AudioWaveform=pr;exports.Avatar=Co;exports.AvatarFallback=So;exports.AvatarImage=ko;exports.Badge=Ur;exports.Blockquote=lm;exports.Box=qo;exports.Breadcrumb=Xs;exports.BreadcrumbEllipsis=ta;exports.BreadcrumbItem=Zs;exports.BreadcrumbLink=Js;exports.BreadcrumbList=Ys;exports.BreadcrumbPage=Qs;exports.BreadcrumbSeparator=ea;exports.Button=ve;exports.Calendar=Zr;exports.Card=Jr;exports.CardContent=tn;exports.CardDescription=Qo;exports.CardFooter=es;exports.CardHeader=Qr;exports.CardTitle=en;exports.Carousel=_a;exports.CarouselContent=Ma;exports.CarouselItem=Pa;exports.CarouselNext=Ta;exports.CarouselPrevious=Ia;exports.ChartContainer=Ga;exports.ChartLegend=mm;exports.ChartTooltip=um;exports.ChatActionCard=yi;exports.ChatBubble=ai;exports.ChatBubbleActions=di;exports.ChatBubbleAvatar=ii;exports.ChatBubbleMessage=li;exports.ChatBubbleTimestamp=ci;exports.ChatContainer=mi;exports.ChatEntityPreview=ji;exports.ChatFollowUp=vi;exports.ChatHeader=Mi;exports.ChatInput=ui;exports.ChatList=fi;exports.ChatMessage=Ti;exports.ChatModeSelector=bi;exports.ChatQuestion=wi;exports.ChatResultCard=Ni;exports.ChatToolCall=Ri;exports.Checkbox=Ro;exports.CitationBadge=Pn;exports.Code=im;exports.CodeBlock=om;exports.Collapsible=uc;exports.CollapsibleContent=Zo;exports.CollapsibleTrigger=mc;exports.ColorPicker=lc;exports.Combobox=rc;exports.Command=hn;exports.CommandDialog=kc;exports.CommandEmpty=Is;exports.CommandGroup=Ts;exports.CommandInput=Ms;exports.CommandItem=Ds;exports.CommandList=Ps;exports.CommandSeparator=Ls;exports.CommandShortcut=Es;exports.Container=Yo;exports.ContextMenu=fd;exports.ContextMenuCheckboxItem=ba;exports.ContextMenuContent=ha;exports.ContextMenuGroup=pd;exports.ContextMenuItem=xa;exports.ContextMenuLabel=wa;exports.ContextMenuPortal=hd;exports.ContextMenuRadioGroup=bd;exports.ContextMenuRadioItem=va;exports.ContextMenuSeparator=ya;exports.ContextMenuShortcut=ja;exports.ContextMenuSub=xd;exports.ContextMenuSubContent=pa;exports.ContextMenuSubTrigger=ga;exports.ContextMenuTrigger=gd;exports.ConversationList=_i;exports.CopyInput=ei;exports.DataTable=Ju;exports.DataTableColumnHeader=Qu;exports.DatePicker=Jl;exports.Dialog=cs;exports.DialogClose=hc;exports.DialogContent=ln;exports.DialogDescription=gs;exports.DialogFooter=ms;exports.DialogHeader=us;exports.DialogOverlay=an;exports.DialogPortal=ds;exports.DialogTitle=fs;exports.DialogTrigger=pc;exports.Drawer=ps;exports.DrawerClose=xs;exports.DrawerContent=dn;exports.DrawerDescription=gn;exports.DrawerFooter=mn;exports.DrawerHeader=un;exports.DrawerTitle=fn;exports.DrawerTrigger=hs;exports.DropdownMenu=vs;exports.DropdownMenuCheckboxItem=Ns;exports.DropdownMenuContent=pn;exports.DropdownMenuGroup=bc;exports.DropdownMenuItem=It;exports.DropdownMenuLabel=ks;exports.DropdownMenuPortal=vc;exports.DropdownMenuRadioGroup=yc;exports.DropdownMenuRadioItem=Cs;exports.DropdownMenuSeparator=Ss;exports.DropdownMenuShortcut=Rs;exports.DropdownMenuSub=wc;exports.DropdownMenuSubContent=js;exports.DropdownMenuSubTrigger=ys;exports.DropdownMenuTrigger=ws;exports.EmptyState=cd;exports.FilePreview=Ii;exports.FileUpload=sc;exports.Flex=Wo;exports.Grid=Xo;exports.HStack=Ko;exports.Header=Ja;exports.Heading=sm;exports.HoverCard=vd;exports.HoverCardContent=Na;exports.HoverCardTrigger=wd;exports.Image=oi;exports.ImageCompare=si;exports.ImageCropper=jm;exports.Input=st;exports.JsonViewer=ti;exports.Label=lr;exports.Lead=cm;exports.Lightbox=ym;exports.Main=Qa;exports.MarkdownRenderer=pi;exports.MessageActions=Ci;exports.MetricCard=fm;exports.ModeToggle=Nm;exports.ModeToggleGroup=km;exports.ModelSelector=xi;exports.MultiSelect=nc;exports.Muted=dm;exports.NUIProvider=Go;exports.NavigationMenu=la;exports.NavigationMenuContent=ma;exports.NavigationMenuIndicator=fa;exports.NavigationMenuItem=ud;exports.NavigationMenuLink=md;exports.NavigationMenuList=ca;exports.NavigationMenuTrigger=ua;exports.NavigationMenuViewport=bn;exports.NumberInput=ec;exports.OTPInput=oc;exports.Pagination=ra;exports.PaginationContent=na;exports.PaginationEllipsis=ia;exports.PaginationItem=oa;exports.PaginationLink=ur;exports.PaginationNext=aa;exports.PaginationPrevious=sa;exports.Popover=yt;exports.PopoverContent=ft;exports.PopoverTrigger=jt;exports.Progress=Us;exports.PromptSuggestions=hi;exports.RadioGroup=Do;exports.RadioGroupItem=Eo;exports.ReasoningBlock=Si;exports.ScrollArea=cr;exports.ScrollBar=or;exports.Select=Ul;exports.SelectContent=Po;exports.SelectGroup=Kl;exports.SelectItem=To;exports.SelectLabel=Io;exports.SelectScrollDownButton=Xr;exports.SelectScrollUpButton=Kr;exports.SelectSeparator=Lo;exports.SelectTrigger=Mo;exports.SelectValue=Xl;exports.Separator=No;exports.Sheet=ps;exports.SheetClose=xs;exports.SheetContent=dn;exports.SheetDescription=gn;exports.SheetFooter=mn;exports.SheetHeader=un;exports.SheetOverlay=cn;exports.SheetPortal=bs;exports.SheetTitle=fn;exports.SheetTrigger=hs;exports.Sidebar=Za;exports.Skeleton=Mc;exports.Slider=Ao;exports.SourceCitation=Pi;exports.StatusBadge=pm;exports.Stepper=dd;exports.StreamingText=ki;exports.Switch=_o;exports.Table=rn;exports.TableBody=on;exports.TableCaption=rs;exports.TableCell=nr;exports.TableFooter=ts;exports.TableHead=sn;exports.TableHeader=nn;exports.TableRow=Pt;exports.Tabs=fc;exports.TabsContent=ss;exports.TabsList=ns;exports.TabsTrigger=os;exports.TagInput=tc;exports.Text=am;exports.Textarea=yo;exports.ThemeProvider=id;exports.TimePicker=Ql;exports.Timeline=qa;exports.TimelineConnector=Ka;exports.TimelineContent=Xa;exports.TimelineIcon=Ua;exports.TimelineItem=Wa;exports.Toaster=ld;exports.Toggle=Fo;exports.ToggleGroup=Vo;exports.ToggleGroupItem=$o;exports.Tooltip=Nc;exports.TooltipContent=_s;exports.TooltipProvider=jc;exports.TooltipTrigger=Cc;exports.TranslateProvider=Go;exports.VStack=Uo;exports.VideoGallery=ni;exports.VideoPlayer=hr;exports.VideoRecorder=vm;exports.VideoThumbnail=Mn;exports.audioPlayerVariants=ri;exports.badgeVariants=jo;exports.buttonVariants=Bt;exports.cardVariants=Jo;exports.cn=b;exports.en=At;exports.formatTime=We;exports.headingVariants=Oa;exports.inputVariants=wo;exports.navigationMenuTriggerStyle=da;exports.ru=Bo;exports.textVariants=Ha;exports.toast=Wc;exports.toggleVariants=Yr;exports.tpl=De;exports.useLocale=Zl;exports.useNUILocale=te;exports.useTheme=dr;exports.useTranslate=te;
|
|
37
|
+
`)})},s++));continue}const i=a.match(/^(#{1,6})\s+(.*)/);if(i){const l=i[1].length,c=i[2],d=`h${l}`,p={1:"text-2xl font-bold mt-6 mb-3",2:"text-xl font-semibold mt-5 mb-2",3:"text-lg font-semibold mt-4 mb-2",4:"text-base font-semibold mt-3 mb-1",5:"text-sm font-semibold mt-2 mb-1",6:"text-sm font-medium mt-2 mb-1"};r.push(o.jsx(d,{className:p[l],children:lt(c)},s++)),n++;continue}if(/^[\s]*[-*]\s/.test(a)){const l=[];for(;n<t.length&&/^[\s]*[-*]\s/.test(t[n]);)l.push(o.jsx("li",{children:lt(t[n].replace(/^[\s]*[-*]\s/,""))},s++)),n++;r.push(o.jsx("ul",{className:"list-disc pl-5 space-y-1 my-2 text-sm",children:l},s++));continue}if(/^\s*\d+\.\s/.test(a)){const l=[];for(;n<t.length&&/^\s*\d+\.\s/.test(t[n]);)l.push(o.jsx("li",{children:lt(t[n].replace(/^\s*\d+\.\s/,""))},s++)),n++;r.push(o.jsx("ol",{className:"list-decimal pl-5 space-y-1 my-2 text-sm",children:l},s++));continue}if(a.startsWith(">")){const l=[];for(;n<t.length&&t[n].startsWith(">");)l.push(t[n].replace(/^>\s?/,"")),n++;r.push(o.jsx("blockquote",{className:"border-l-4 border-primary/40 pl-4 italic text-muted-foreground my-3 text-sm",children:lt(l.join(" "))},s++));continue}if(a.includes("|")&&n+1<t.length&&/^\s*\|?[\s\-:|]+\|/.test(t[n+1])){const l=[];for(;n<t.length&&t[n].includes("|");)l.push(t[n]),n++;if(l.length>=2){const c=u=>u.split("|").map(m=>m.trim()).filter((m,f,h)=>f>0&&f<h.length),d=c(l[0]),p=l.slice(2).map(c);r.push(o.jsx("div",{className:"overflow-x-auto my-3",children:o.jsxs("table",{className:"w-full text-sm border-collapse",children:[o.jsx("thead",{children:o.jsx("tr",{className:"border-b border-border",children:d.map((u,m)=>o.jsx("th",{className:"px-3 py-2 text-left font-semibold text-foreground",children:lt(u)},m))})}),o.jsx("tbody",{children:p.map((u,m)=>o.jsx("tr",{className:"border-b border-border/50",children:u.map((f,h)=>o.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:lt(f)},h))},m))})]})},s++));continue}}if(/^[-*_]{3,}\s*$/.test(a)){r.push(o.jsx("hr",{className:"my-4 border-border"},s++)),n++;continue}if(a.trim()===""){n++;continue}r.push(o.jsx("p",{className:"text-sm leading-relaxed my-2",children:lt(a)},s++)),n++}return r}const pi=g.forwardRef(({content:e,streaming:t,className:r,...n},s)=>{const a=t?e:e.trim(),i=g.useMemo(()=>{try{return Rm(a)}catch{return[g.createElement("p",{className:"text-sm"},a)]}},[a]);return o.jsx("div",{ref:s,className:b("markdown-renderer",r),...n,children:i})});pi.displayName="MarkdownRenderer";const hi=g.forwardRef(({suggestions:e,onSelect:t,columns:r=2,className:n,...s},a)=>{const i={1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"};return o.jsx("div",{ref:a,className:b("grid gap-3",i[r],n),...s,children:e.map((l,c)=>o.jsxs("button",{type:"button",onClick:()=>t==null?void 0:t(l.prompt),className:b("flex flex-col items-start gap-1 rounded-xl border border-border p-4","bg-card text-left transition-colors hover:bg-muted/60 hover:border-primary/30","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:l.title}),l.description&&o.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:l.description})]},c))})});hi.displayName="PromptSuggestions";const xi=g.forwardRef(({models:e,value:t,onChange:r,placeholder:n,compact:s,className:a,...i},l)=>{const c=re(),[d,p]=g.useState(!1),[u,m]=g.useState(""),f=g.useRef(null),h=g.useRef(null),x=e.find(y=>y.id===t),w=g.useMemo(()=>{if(!u)return e;const y=u.toLowerCase();return e.filter(j=>{var k;return j.name.toLowerCase().includes(y)||((k=j.provider)==null?void 0:k.toLowerCase().includes(y))||j.id.toLowerCase().includes(y)})},[e,u]);g.useEffect(()=>{d&&(m(""),setTimeout(()=>{var y;return(y=h.current)==null?void 0:y.focus()},0))},[d]),g.useEffect(()=>{if(!d)return;const y=j=>{f.current&&!f.current.contains(j.target)&&p(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[d]);const v=y=>{y.key==="Escape"&&p(!1)};return o.jsxs("div",{ref:f,className:b("relative",a),...i,children:[o.jsxs("button",{ref:l,type:"button",onClick:()=>p(y=>!y),className:b("flex items-center gap-2 rounded-lg border border-border bg-background px-3 py-1.5 text-sm transition-colors hover:bg-muted","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",!x&&"text-muted-foreground"),children:[x?o.jsxs(o.Fragment,{children:[x.icon&&o.jsx("span",{className:"text-base shrink-0",children:x.icon}),o.jsx("span",{className:"font-medium truncate",children:x.name}),!s&&x.provider&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",x.provider,")"]})]}):o.jsx("span",{children:n??c.modelSelector_placeholder}),o.jsx("svg",{className:b("h-3.5 w-3.5 ml-auto shrink-0 text-muted-foreground transition-transform",d&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"m6 9 6 6 6-6"})})]}),d&&o.jsxs("div",{className:"absolute z-50 mt-1 w-full min-w-[260px] rounded-xl border border-border bg-popover shadow-lg animate-in fade-in-0 zoom-in-95",onKeyDown:v,children:[o.jsx("div",{className:"p-2 border-b border-border",children:o.jsx("input",{ref:h,value:u,onChange:y=>m(y.target.value),placeholder:c.modelSelector_searchPlaceholder,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground px-2 py-1"})}),o.jsxs("div",{className:"max-h-[280px] overflow-auto p-1",children:[w.length===0&&o.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:c.modelSelector_noResults}),w.map(y=>o.jsxs("button",{type:"button",disabled:y.disabled,onClick:()=>{r==null||r(y.id),p(!1)},className:b("flex w-full items-start gap-3 rounded-lg px-3 py-2.5 text-left text-sm transition-colors","hover:bg-muted focus-visible:outline-none focus-visible:bg-muted",y.id===t&&"bg-primary/10",y.disabled&&"opacity-50 cursor-not-allowed"),children:[y.icon&&o.jsx("span",{className:"text-lg shrink-0 mt-0.5",children:y.icon}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-medium truncate",children:y.name}),y.id===t&&o.jsx("svg",{className:"h-4 w-4 text-primary shrink-0",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})})]}),y.provider&&o.jsx("span",{className:"text-xs text-muted-foreground",children:y.provider}),y.description&&o.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:y.description}),y.badges&&y.badges.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1 mt-1.5",children:y.badges.map(j=>o.jsx("span",{className:"inline-flex items-center rounded-full border border-border px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:j},j))})]})]},y.id))]})]})]})});xi.displayName="ModelSelector";const bi=g.forwardRef(({modes:e,value:t,onChange:r,size:n="default",className:s,...a},i)=>o.jsx("div",{ref:i,className:b("inline-flex items-center gap-1 rounded-lg bg-muted/50 p-1",s),role:"radiogroup",...a,children:e.map(l=>{const c=l.id===t;return o.jsxs("button",{type:"button",role:"radio","aria-checked":c,onClick:()=>r==null?void 0:r(l.id),title:l.description,className:b("rounded-md transition-all text-sm font-medium whitespace-nowrap","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",n==="sm"?"px-2.5 py-1 text-xs":"px-3 py-1.5",c?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[l.icon&&o.jsx("span",{className:"mr-1",children:l.icon}),l.label]},l.id)})}));bi.displayName="ChatModeSelector";const vi=g.forwardRef(({question:e,options:t,onSelect:r,selected:n,allowFreeText:s,onFreeTextSubmit:a,columns:i=1,className:l,...c},d)=>{const p=re(),[u,m]=g.useState(""),f=!!n,h=()=>{const x=u.trim();x&&(a==null||a(x),m(""))};return o.jsxs("div",{ref:d,className:b("rounded-2xl bg-muted text-foreground rounded-bl-md px-4 py-3 max-w-[85%]",l),...c,children:[o.jsx("p",{className:"text-sm leading-relaxed mb-3",children:e}),o.jsx("div",{className:b("grid gap-2",i===2?"grid-cols-1 sm:grid-cols-2":"grid-cols-1"),children:t.map(x=>{const w=x.id===n;return o.jsxs("button",{type:"button",disabled:f,onClick:()=>r==null?void 0:r(x.id,x.label),className:b("flex items-center gap-2 rounded-xl border px-3 py-2 text-left text-sm transition-all","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",w?"border-primary bg-primary/10 text-primary font-medium":f?"border-border/50 text-muted-foreground opacity-50 cursor-default":"border-border bg-background hover:border-primary/40 hover:bg-primary/5 cursor-pointer"),children:[w&&o.jsx("svg",{className:"h-4 w-4 shrink-0 text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}),!w&&o.jsx("span",{className:b("h-4 w-4 shrink-0 rounded-full border-2",f?"border-border/50":"border-border")}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("span",{className:"block truncate",children:x.label}),x.description&&o.jsx("span",{className:"block text-xs text-muted-foreground mt-0.5 line-clamp-1",children:x.description})]})]},x.id)})}),s&&!f&&o.jsxs("div",{className:"flex gap-2 mt-2",children:[o.jsx("input",{type:"text",value:u,onChange:x=>m(x.target.value),onKeyDown:x=>{x.key==="Enter"&&h()},placeholder:p.followUp_freeTextPlaceholder,className:"flex-1 bg-background rounded-lg border border-border px-3 py-1.5 text-sm outline-none placeholder:text-muted-foreground focus:border-primary/40"}),o.jsx("button",{type:"button",onClick:h,disabled:!u.trim(),className:b("rounded-lg px-3 py-1.5 text-sm font-medium transition-colors",u.trim()?"bg-primary text-primary-foreground hover:bg-primary/90":"bg-muted text-muted-foreground cursor-not-allowed"),children:p.followUp_send})]})]})});vi.displayName="ChatFollowUp";const wi=g.forwardRef(({id:e,question:t,options:r,onSelect:n,selectedId:s,disabled:a=!1,allowFreeText:i=!1,onFreeTextSubmit:l,columns:c=1,freeTextValue:d,className:p,...u},m)=>{const[f,h]=g.useState(""),[x,w]=g.useState(null),[v,y]=g.useState(null),j=Array.isArray(r)?r:[],k=t??"",S=s??x,R=d??v,_=a||S!=null&&S!==""||R!=null&&R!=="",C=g.useCallback((L,N)=>{_||(w(L),n==null||n(L,N))},[_,n]),A=g.useCallback(()=>{const L=(f??"").trim();!L||_||(y(L),l==null||l(L),h(""))},[f,_,l]);return o.jsxs("div",{ref:m,"data-question-id":e,className:b("rounded-xl border border-border/60 overflow-hidden","bg-card shadow-sm","animate-in fade-in-0 slide-in-from-bottom-2 duration-300",p),...u,children:[o.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border/40 bg-muted/30",children:[o.jsx("div",{className:"flex-shrink-0 flex items-center justify-center w-7 h-7 rounded-lg bg-primary/15 text-primary",children:o.jsx(T.HelpCircle,{className:"w-4 h-4"})}),o.jsx("p",{className:"text-sm font-medium text-foreground leading-snug",children:k})]}),o.jsxs("div",{className:"p-3 space-y-3",children:[j.length>0&&o.jsx("div",{className:b("grid gap-2",c===2?"grid-cols-1 sm:grid-cols-2":"grid-cols-1"),children:j.map((L,N)=>{if(!L)return null;const $=L.id||`opt-${N}`,I=L.label||$,M=S===L.id;return o.jsxs("button",{type:"button",disabled:_,onClick:()=>C(L.id,I),className:b("group relative flex items-center gap-3 w-full p-3 rounded-lg border text-left","transition-all duration-200 ease-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",M?"border-primary bg-primary/8 ring-1 ring-primary/20":_?"border-border/40 text-muted-foreground/60 cursor-not-allowed":"border-border/60 bg-background hover:border-primary/40 hover:bg-accent/50 cursor-pointer active:scale-[0.98]"),children:[o.jsx("div",{className:b("flex-shrink-0 flex items-center justify-center w-5 h-5 rounded-full border-2 transition-all duration-200",M?"border-primary bg-primary scale-110":_?"border-muted-foreground/30":"border-muted-foreground/40 group-hover:border-primary/60"),children:M&&o.jsx(T.Check,{className:"w-3 h-3 text-primary-foreground animate-in zoom-in-50 duration-200"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("span",{className:b("block text-sm font-medium leading-tight",M?"text-primary":"text-foreground"),children:I}),L.description&&o.jsx("span",{className:"block text-xs text-muted-foreground mt-0.5 line-clamp-2",children:L.description})]})]},$)})}),R&&o.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-primary/8 border border-primary/20",children:[o.jsx(T.Check,{className:"w-4 h-4 text-primary flex-shrink-0"}),o.jsx("span",{className:"text-sm font-medium text-primary truncate",children:R})]}),i&&!_&&o.jsxs("div",{className:"flex gap-2 pt-2 border-t border-border/30",children:[o.jsx("input",{type:"text",value:f,onChange:L=>h(L.target.value),onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),A())},placeholder:"Или напишите свой ответ...",className:b("flex-1 rounded-lg border border-border/60 bg-background px-3 py-2 text-sm","placeholder:text-muted-foreground/60","outline-none focus:border-primary/50 focus:ring-1 focus:ring-primary/20","transition-colors")}),o.jsx("button",{type:"button",onClick:A,disabled:!(f??"").trim(),className:b("flex-shrink-0 flex items-center justify-center w-9 h-9 rounded-lg transition-all duration-150",(f??"").trim()?"bg-primary text-primary-foreground hover:bg-primary/90 cursor-pointer active:scale-95":"bg-muted text-muted-foreground/50 cursor-not-allowed"),children:o.jsx(T.Send,{className:"w-4 h-4"})})]})]})]})});wi.displayName="ChatQuestion";const Yn={success:{Icon:T.CheckCircle2,border:"border-emerald-500/30",bg:"bg-emerald-500/5",iconBox:"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",title:"text-emerald-900 dark:text-emerald-100",btn:"bg-emerald-600 hover:bg-emerald-700 text-white"},info:{Icon:T.Info,border:"border-blue-500/30",bg:"bg-blue-500/5",iconBox:"bg-blue-500/15 text-blue-600 dark:text-blue-400",title:"text-blue-900 dark:text-blue-100",btn:"bg-blue-600 hover:bg-blue-700 text-white"},warning:{Icon:T.AlertTriangle,border:"border-amber-500/30",bg:"bg-amber-500/5",iconBox:"bg-amber-500/15 text-amber-600 dark:text-amber-400",title:"text-amber-900 dark:text-amber-100",btn:"bg-amber-600 hover:bg-amber-700 text-white"},result:{Icon:T.Sparkles,border:"border-violet-500/30",bg:"bg-gradient-to-br from-violet-500/8 to-emerald-500/5",iconBox:"bg-violet-500/15 text-violet-600 dark:text-violet-400",title:"text-violet-900 dark:text-violet-100",btn:"bg-violet-600 hover:bg-violet-700 text-white"}},yi=g.forwardRef(({type:e="info",title:t,description:r,icon:n,action:s,dismissible:a=!1,onDismiss:i,className:l,...c},d)=>{const[p,u]=g.useState(!1),[m,f]=g.useState(!1),h=Yn[e]??Yn.info,x=n??h.Icon,w=g.useCallback(()=>{u(!0),i==null||i()},[i]),v=g.useCallback(()=>{m||!(s!=null&&s.onClick)||(f(!0),s.onClick(),setTimeout(()=>f(!1),1e3))},[s,m]);return p?null:o.jsx("div",{ref:d,className:b("rounded-xl border overflow-hidden shadow-sm","animate-in fade-in-0 slide-in-from-bottom-2 duration-300",h.border,h.bg,l),...c,children:o.jsxs("div",{className:"flex items-start gap-3 p-4",children:[o.jsx("div",{className:b("flex-shrink-0 flex items-center justify-center w-9 h-9 rounded-lg",h.iconBox),children:o.jsx(x,{className:"w-5 h-5"})}),o.jsxs("div",{className:"flex-1 min-w-0 pt-0.5",children:[t&&o.jsx("h4",{className:b("text-sm font-semibold leading-tight",h.title),children:t}),r&&o.jsx("p",{className:"text-sm text-muted-foreground mt-1 leading-relaxed",children:r})]}),s&&s.label&&o.jsxs("button",{type:"button",disabled:m,onClick:v,className:b("flex-shrink-0 inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-lg","text-sm font-medium whitespace-nowrap","transition-all duration-150","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","active:scale-95",m?"opacity-60 cursor-wait":"cursor-pointer",h.btn),children:[s.label,o.jsx(T.ArrowRight,{className:"w-3.5 h-3.5"})]}),a&&o.jsx("button",{type:"button",onClick:w,className:"flex-shrink-0 p-1 rounded-md hover:bg-foreground/10 text-muted-foreground hover:text-foreground transition-colors","aria-label":"Dismiss",children:o.jsx(T.X,{className:"w-4 h-4"})})]})})});yi.displayName="ChatActionCard";const Zn={task:{Icon:T.CheckSquare,color:"text-blue-600 dark:text-blue-400 bg-blue-500/12"},project:{Icon:T.FolderKanban,color:"text-purple-600 dark:text-purple-400 bg-purple-500/12"},file:{Icon:T.FileText,color:"text-orange-600 dark:text-orange-400 bg-orange-500/12"},custom:{Icon:T.FileText,color:"text-primary bg-primary/12"}},ji=g.forwardRef(({type:e="task",title:t,id:r,status:n,properties:s,icon:a,onNavigate:i,className:l,...c},d)=>{const p=Zn[e]??Zn.custom,u=a??p.Icon,m=typeof i=="function",f=s&&typeof s=="object"?s:null,h=g.useCallback(()=>{i==null||i()},[i]),x=g.useCallback(w=>{m&&(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),i==null||i())},[m,i]);return o.jsxs("div",{ref:d,role:m?"button":void 0,tabIndex:m?0:void 0,onClick:m?h:void 0,onKeyDown:m?x:void 0,className:b("rounded-xl border border-border/60 bg-card overflow-hidden shadow-sm","animate-in fade-in-0 slide-in-from-bottom-2 duration-300",m&&"cursor-pointer hover:border-primary/40 hover:shadow-md transition-all active:scale-[0.99]",l),...c,children:[o.jsxs("div",{className:"flex items-start gap-3 p-4",children:[o.jsx("div",{className:b("flex-shrink-0 flex items-center justify-center w-9 h-9 rounded-lg",p.color),children:o.jsx(u,{className:"w-5 h-5"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o.jsx("h4",{className:"text-sm font-semibold text-foreground truncate",children:t??"Untitled"}),r&&o.jsx("span",{className:"inline-flex px-1.5 py-0.5 rounded bg-muted text-[11px] font-mono text-muted-foreground leading-none",children:r})]}),n&&o.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:n})]}),m&&o.jsx(T.ExternalLink,{className:"flex-shrink-0 w-4 h-4 text-muted-foreground/50 mt-0.5"})]}),f&&Object.keys(f).length>0&&o.jsx("div",{className:"px-4 pb-4",children:o.jsx("div",{className:"rounded-lg bg-muted/40 divide-y divide-border/30",children:Object.entries(f).map(([w,v])=>o.jsxs("div",{className:"flex items-baseline justify-between gap-4 px-3 py-2 text-xs",children:[o.jsx("span",{className:"text-muted-foreground font-medium whitespace-nowrap",children:w}),o.jsx("span",{className:"text-foreground text-right break-words",children:String(v??"")})]},w))})})]})});ji.displayName="ChatEntityPreview";const Ni=g.forwardRef(({title:e,description:t,icon:r,linkLabel:n,onNavigate:s,metadata:a,variant:i="success",className:l,...c},d)=>{const p=r??(i==="highlight"?T.Sparkles:T.CheckCircle2),u=a&&typeof a=="object"?a:null,m=typeof s=="function",f=i==="success";return o.jsx("div",{ref:d,className:b("rounded-xl border overflow-hidden shadow-sm","animate-in fade-in-0 slide-in-from-bottom-3 duration-300",f?"border-emerald-500/30 bg-gradient-to-br from-emerald-500/8 via-emerald-500/4 to-transparent":"border-violet-500/30 bg-gradient-to-br from-violet-500/8 via-violet-500/4 to-transparent",l),...c,children:o.jsxs("div",{className:"p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("div",{className:b("flex-shrink-0 flex items-center justify-center w-10 h-10 rounded-xl",f?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":"bg-violet-500/15 text-violet-600 dark:text-violet-400"),children:o.jsx(p,{className:"w-5 h-5"})}),o.jsxs("div",{className:"flex-1 min-w-0 pt-0.5",children:[e&&o.jsx("h4",{className:b("text-sm font-semibold leading-tight",f?"text-emerald-900 dark:text-emerald-100":"text-violet-900 dark:text-violet-100"),children:e}),t&&o.jsx("p",{className:"text-sm text-muted-foreground mt-1 leading-relaxed",children:t})]}),m&&o.jsxs("button",{type:"button",onClick:s,className:b("flex-shrink-0 inline-flex items-center gap-1.5 px-4 py-2 rounded-lg","text-sm font-medium whitespace-nowrap","transition-all duration-150","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","active:scale-95 cursor-pointer",f?"bg-emerald-600 hover:bg-emerald-700 text-white":"bg-violet-600 hover:bg-violet-700 text-white"),children:[n??"Перейти",o.jsx(T.ArrowRight,{className:"w-4 h-4"})]})]}),u&&Object.keys(u).length>0&&o.jsx("div",{className:"rounded-lg bg-background/60 border border-border/30 divide-y divide-border/20",children:Object.entries(u).map(([h,x])=>o.jsxs("div",{className:"flex items-baseline justify-between gap-4 px-3 py-2 text-xs",children:[o.jsx("span",{className:"text-muted-foreground font-medium whitespace-nowrap",children:h}),o.jsx("span",{className:"text-foreground text-right break-words",children:String(x??"")})]},h))})]})})});Ni.displayName="ChatResultCard";const _m={copy:{path:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2 M9 2h6a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z"},retry:{path:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8 M3 3v5h5"},edit:{path:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"},like:{path:"M7 10v12 M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2h0a3.13 3.13 0 0 1 3 3.88Z"},dislike:{path:"M17 14V2 M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22h0a3.13 3.13 0 0 1-3-3.88Z"},share:{path:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8 M16 6l-4-4-4 4 M12 2v13"}},Ci=g.forwardRef(({actions:e=["copy"],content:t,likeState:r,onCopy:n,onRetry:s,onEdit:a,onLike:i,onDislike:l,onShare:c,visibility:d="hover",className:p,...u},m)=>{const f=re(),[h,x]=g.useState(!1),w={copy:f.messageActions_copy,retry:f.messageActions_retry,edit:f.messageActions_edit,like:f.messageActions_like,dislike:f.messageActions_dislike,share:f.messageActions_share},y={copy:async()=>{if(t)try{await navigator.clipboard.writeText(t),x(!0),setTimeout(()=>x(!1),2e3)}catch{}n==null||n()},retry:s,edit:a,like:i,dislike:l,share:c};return o.jsx("div",{ref:m,className:b("flex items-center gap-0.5",d==="hover"&&"opacity-0 group-hover:opacity-100 transition-opacity",p),...u,children:e.map(j=>{const k=j==="copy"&&h,_=j==="like"&&r==="liked"||j==="dislike"&&r==="disliked";return o.jsx("button",{type:"button",onClick:y[j],"aria-label":w[j],title:k?f.messageActions_copied:w[j],className:b("inline-flex items-center justify-center h-7 w-7 rounded-md transition-colors","text-muted-foreground hover:text-foreground hover:bg-muted","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",_&&"text-primary",k&&"text-green-500"),children:k?o.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}):o.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:_?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:_m[j].path})})},j)})})});Ci.displayName="MessageActions";const ki=g.forwardRef(({text:e,speed:t=2,onComplete:r,cursor:n=!0,immediate:s=!1,className:a,...i},l)=>{const[c,d]=g.useState(s?e:""),[p,u]=g.useState(s),m=g.useRef(e),f=g.useRef(),h=g.useRef(s?e.length:0);return g.useEffect(()=>{if(e!==m.current){if(m.current=e,s){d(e),u(!0),h.current=e.length;return}e.startsWith(c)||(h.current=0,d("")),u(!1)}},[e,s,c]),g.useEffect(()=>{if(s||p)return;const x=()=>{const w=Math.min(h.current+t,e.length);h.current=w,d(e.slice(0,w)),w>=e.length?(u(!0),r==null||r()):f.current=requestAnimationFrame(x)};return f.current=requestAnimationFrame(x),()=>{f.current&&cancelAnimationFrame(f.current)}},[e,t,s,p,r]),o.jsxs("span",{ref:l,className:b("whitespace-pre-wrap",a),...i,children:[c,n&&!p&&o.jsx("span",{className:"inline-block w-[2px] h-[1em] bg-foreground ml-px align-text-bottom animate-pulse"})]})});ki.displayName="StreamingText";const Si=g.forwardRef(({content:e,isThinking:t,duration:r,defaultOpen:n=!1,title:s,className:a,...i},l)=>{const c=re(),[d,p]=g.useState(n||t===!0),[u,m]=g.useState(r??0),f=g.useRef(Date.now());g.useEffect(()=>{t&&p(!0)},[t]),g.useEffect(()=>{if(!t)return;f.current=Date.now();const w=setInterval(()=>{m(Math.floor((Date.now()-f.current)/1e3))},1e3);return()=>clearInterval(w)},[t]);const h=t?u:r??u,x=w=>w<60?`${w}s`:`${Math.floor(w/60)}m ${w%60}s`;return o.jsxs("div",{ref:l,className:b("rounded-xl border border-border/60 overflow-hidden my-2",t&&"border-primary/30",a),...i,children:[o.jsxs("button",{type:"button",onClick:()=>p(w=>!w),className:b("flex items-center gap-2 w-full px-3 py-2 text-sm transition-colors","hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",t&&"bg-primary/5"),children:[o.jsxs("svg",{className:b("h-4 w-4 shrink-0 text-muted-foreground",t&&"text-primary animate-pulse"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"}),o.jsx("path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"}),o.jsx("path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"}),o.jsx("path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375"}),o.jsx("path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5"}),o.jsx("path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396"}),o.jsx("path",{d:"M19.938 10.5a4 4 0 0 1 .585.396"}),o.jsx("path",{d:"M6 18a4 4 0 0 1-1.967-.516"}),o.jsx("path",{d:"M19.967 17.484A4 4 0 0 1 18 18"})]}),o.jsx("span",{className:b("font-medium",t&&"text-primary animate-pulse"),children:t?c.reasoning_thinking:s??c.reasoning_title}),h>0&&o.jsx("span",{className:"text-xs text-muted-foreground",children:t?`${x(h)}...`:De(c.reasoning_thoughtFor,{duration:x(h)})}),o.jsx("svg",{className:b("h-3.5 w-3.5 ml-auto shrink-0 text-muted-foreground transition-transform duration-200",d&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"m6 9 6 6 6-6"})})]}),d&&o.jsx("div",{className:"border-t border-border/40 px-4 py-3 bg-muted/20",children:o.jsx("div",{className:"border-l-2 border-primary/20 pl-3",children:o.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed whitespace-pre-wrap",children:[e,t&&o.jsx("span",{className:"inline-block w-[2px] h-[1em] bg-muted-foreground ml-px align-text-bottom animate-pulse"})]})})})]})});Si.displayName="ReasoningBlock";const Ri=g.forwardRef(({name:e,args:t,result:r,status:n,error:s,defaultOpen:a=!1,className:i,...l},c)=>{const d=re(),[p,u]=g.useState(a),m={running:o.jsx("svg",{className:"h-3.5 w-3.5 animate-spin text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),success:o.jsx("svg",{className:"h-3.5 w-3.5 text-green-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}),error:o.jsxs("svg",{className:"h-3.5 w-3.5 text-destructive",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 6 18"}),o.jsx("path",{d:"m6 6 12 12"})]})},f={running:De(d.toolCall_calling,{name:e}),success:e,error:De(d.toolCall_failed,{name:e})};return o.jsxs("div",{ref:c,className:b("rounded-xl border overflow-hidden my-1",n==="error"?"border-destructive/30":"border-border/60",i),...l,children:[o.jsxs("button",{type:"button",onClick:()=>u(h=>!h),className:b("flex items-center gap-2 w-full px-3 py-2 text-sm transition-colors","hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[o.jsx("svg",{className:"h-4 w-4 shrink-0 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),m[n],o.jsx("span",{className:b("font-medium font-mono text-xs",n==="running"&&"text-primary",n==="error"&&"text-destructive"),children:f[n]}),o.jsx("svg",{className:b("h-3.5 w-3.5 ml-auto shrink-0 text-muted-foreground transition-transform duration-200",p&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"m6 9 6 6 6-6"})})]}),p&&o.jsxs("div",{className:"border-t border-border/40 text-xs",children:[t&&Object.keys(t).length>0&&o.jsxs("div",{className:"px-3 py-2 bg-muted/20",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1 font-semibold",children:d.toolCall_arguments}),o.jsx("pre",{className:"overflow-x-auto font-mono text-foreground/80 whitespace-pre-wrap",children:JSON.stringify(t,null,2)})]}),r&&o.jsxs("div",{className:b("px-3 py-2",t&&"border-t border-border/30"),children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1 font-semibold",children:d.toolCall_result}),o.jsx("pre",{className:"overflow-x-auto font-mono text-foreground/80 whitespace-pre-wrap",children:r})]}),s&&o.jsxs("div",{className:b("px-3 py-2 bg-destructive/5",t&&"border-t border-border/30"),children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-destructive mb-1 font-semibold",children:d.toolCall_error}),o.jsx("pre",{className:"overflow-x-auto font-mono text-destructive whitespace-pre-wrap",children:s})]})]})]})});Ri.displayName="ChatToolCall";function Mm(e,t){const r=new Date,n=new Date(r.getFullYear(),r.getMonth(),r.getDate()),s=new Date(n.getTime()-864e5),a=new Date(n.getTime()-7*864e5),i=[{label:t[0],items:[]},{label:t[1],items:[]},{label:t[2],items:[]},{label:t[3],items:[]}],l=[...e].sort((c,d)=>d.updatedAt.getTime()-c.updatedAt.getTime());for(const c of l){const d=c.updatedAt;d>=n?i[0].items.push(c):d>=s?i[1].items.push(c):d>=a?i[2].items.push(c):i[3].items.push(c)}return i.filter(c=>c.items.length>0)}const _i=g.forwardRef(({conversations:e,activeId:t,onSelect:r,onNew:n,onDelete:s,onRename:a,showSearch:i=!0,className:l,...c},d)=>{const p=re(),[u,m]=g.useState(""),[f,h]=g.useState(null),[x,w]=g.useState(""),v=g.useRef(null),y=g.useMemo(()=>{if(!u)return e;const _=u.toLowerCase();return e.filter(C=>{var A;return C.title.toLowerCase().includes(_)||((A=C.lastMessage)==null?void 0:A.toLowerCase().includes(_))})},[e,u]),j=[p.conversationList_today,p.conversationList_yesterday,p.conversationList_previous7Days,p.conversationList_older],k=g.useMemo(()=>Mm(y,j),[y,j]),S=_=>{h(_.id),w(_.title),setTimeout(()=>{var C;return(C=v.current)==null?void 0:C.focus()},0)},R=()=>{f&&x.trim()&&(a==null||a(f,x.trim())),h(null)};return o.jsxs("div",{ref:d,className:b("flex flex-col h-full",l),...c,children:[n&&o.jsx("div",{className:"p-3 border-b border-border shrink-0",children:o.jsxs("button",{type:"button",onClick:n,className:b("flex items-center justify-center gap-2 w-full rounded-lg border border-border px-3 py-2 text-sm font-medium","transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[o.jsxs("svg",{className:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M5 12h14"}),o.jsx("path",{d:"M12 5v14"})]}),p.conversationList_newChat]})}),i&&o.jsx("div",{className:"px-3 pt-3 pb-2 shrink-0",children:o.jsxs("div",{className:"relative",children:[o.jsxs("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"11",cy:"11",r:"8"}),o.jsx("path",{d:"m21 21-4.3-4.3"})]}),o.jsx("input",{value:u,onChange:_=>m(_.target.value),placeholder:p.conversationList_searchPlaceholder,className:"w-full bg-muted/50 rounded-lg pl-8 pr-3 py-1.5 text-sm outline-none placeholder:text-muted-foreground focus:bg-muted"})]})}),o.jsxs("div",{className:"flex-1 overflow-auto px-2 py-1",children:[k.length===0&&o.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:u?p.conversationList_noResults:p.conversationList_empty}),k.map(_=>o.jsxs("div",{className:"mb-3",children:[o.jsx("div",{className:"px-2 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:_.label}),_.items.map(C=>{const A=C.id===t,L=C.id===f;return o.jsxs("div",{className:b("group flex items-center gap-2 rounded-lg px-2 py-2 cursor-pointer transition-colors",A?"bg-primary/10":"hover:bg-muted"),onClick:()=>!L&&(r==null?void 0:r(C.id)),children:[o.jsx("svg",{className:"h-4 w-4 shrink-0 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z"})}),o.jsx("div",{className:"flex-1 min-w-0",children:L?o.jsx("input",{ref:v,value:x,onChange:N=>w(N.target.value),onBlur:R,onKeyDown:N=>{N.key==="Enter"&&R(),N.key==="Escape"&&h(null)},className:"w-full bg-background border border-border rounded px-1 py-0.5 text-sm outline-none",onClick:N=>N.stopPropagation()}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"text-sm truncate font-medium",children:C.title}),C.lastMessage&&o.jsx("div",{className:"text-xs text-muted-foreground truncate",children:C.lastMessage})]})}),!L&&o.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[a&&o.jsx("button",{type:"button",onClick:N=>{N.stopPropagation(),S(C)},className:"h-6 w-6 flex items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":p.conversationList_rename,children:o.jsx("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"})})}),s&&o.jsx("button",{type:"button",onClick:N=>{N.stopPropagation(),s(C.id)},className:"h-6 w-6 flex items-center justify-center rounded text-muted-foreground hover:text-destructive hover:bg-destructive/10","aria-label":p.conversationList_delete,children:o.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M3 6h18"}),o.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),o.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]})})]})]},C.id)})]},_.label))]})]})});_i.displayName="ConversationList";const Pm={online:"bg-green-500",offline:"bg-muted-foreground/40",typing:"bg-primary animate-pulse"},Mi=g.forwardRef(({title:e,model:t,modelIcon:r,status:n,onClear:s,onSettings:a,onBack:i,children:l,className:c,...d},p)=>{const u=re(),m={online:u.chatHeader_online,offline:u.chatHeader_offline,typing:u.chatHeader_typing};return o.jsxs("div",{ref:p,className:b("flex items-center gap-3 px-4 h-14 border-b border-border shrink-0 bg-background",c),...d,children:[i&&o.jsx("button",{type:"button",onClick:i,className:"h-8 w-8 flex items-center justify-center rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors -ml-1 shrink-0","aria-label":u.chatHeader_back,children:o.jsx("svg",{className:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"m15 18-6-6 6-6"})})}),r&&o.jsx("span",{className:"text-xl shrink-0",children:r}),o.jsxs("div",{className:"flex-1 min-w-0",children:[e&&o.jsx("div",{className:"text-sm font-semibold truncate",children:e}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[t&&o.jsx("span",{className:"text-xs text-muted-foreground truncate",children:t}),n&&o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("span",{className:b("h-1.5 w-1.5 rounded-full shrink-0",Pm[n])}),o.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[n]})]})]})]}),l,o.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s&&o.jsx("button",{type:"button",onClick:s,className:"h-8 w-8 flex items-center justify-center rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors","aria-label":u.chatHeader_clearConversation,title:u.chatHeader_clearConversation,children:o.jsxs("svg",{className:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M3 6h18"}),o.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),o.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]})}),a&&o.jsx("button",{type:"button",onClick:a,className:"h-8 w-8 flex items-center justify-center rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors","aria-label":u.chatHeader_settings,title:u.chatHeader_settings,children:o.jsxs("svg",{className:"h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),o.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]})]})});Mi.displayName="ChatHeader";const Pn=g.forwardRef(({citation:e,className:t,...r},n)=>{const[s,a]=g.useState(!1);return o.jsxs("span",{className:"relative inline-block",children:[o.jsx("button",{ref:n,type:"button",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>a(!0),onBlur:()=>a(!1),onClick:()=>window.open(e.url,"_blank","noopener"),className:b("inline-flex items-center justify-center h-4 min-w-[16px] px-1 rounded text-[10px] font-medium","bg-primary/15 text-primary hover:bg-primary/25 transition-colors cursor-pointer","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","align-super",t),"aria-label":`Source ${e.index}: ${e.title}`,...r,children:e.index}),s&&o.jsxs("div",{className:"absolute z-50 bottom-full left-1/2 -translate-x-1/2 mb-2 w-64 rounded-lg border border-border bg-popover shadow-lg p-3 text-left animate-in fade-in-0 zoom-in-95",children:[o.jsxs("div",{className:"flex items-start gap-2",children:[e.favicon&&o.jsx("img",{src:e.favicon,alt:"",className:"h-4 w-4 mt-0.5 shrink-0 rounded"}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:e.title}),o.jsx("div",{className:"text-[10px] text-muted-foreground truncate",children:e.url}),e.snippet&&o.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.snippet})]})]}),o.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-border"})]})]})});Pn.displayName="CitationBadge";const Pi=g.forwardRef(({citations:e,variant:t="footer",className:r,...n},s)=>{const a=re();return t==="inline"?o.jsx("span",{ref:s,className:b("inline",r),...n,children:e.map(i=>o.jsx(Pn,{citation:i},i.index))}):o.jsxs("div",{ref:s,className:b("border-t border-border/50 pt-3 mt-3 space-y-2",r),...n,children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold mb-2",children:a.sourceCitation_sources}),e.map(i=>o.jsxs("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",className:b("flex items-start gap-2.5 rounded-lg border border-border/60 p-2.5 transition-colors","hover:bg-muted/50 hover:border-primary/30"),children:[o.jsx("span",{className:"flex items-center justify-center h-5 w-5 rounded bg-primary/15 text-primary text-[10px] font-semibold shrink-0 mt-0.5",children:i.index}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[i.favicon&&o.jsx("img",{src:i.favicon,alt:"",className:"h-3.5 w-3.5 rounded shrink-0"}),o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title})]}),o.jsx("span",{className:"text-[10px] text-muted-foreground truncate block",children:i.url}),i.snippet&&o.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:i.snippet})]})]},i.index))]})});Pi.displayName="SourceCitation";function Jn(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Qn(e){return e.startsWith("image/")}function eo(e){return e.startsWith("image/")?"🖼️":e.startsWith("video/")?"🎬":e.startsWith("audio/")?"🎵":e.includes("pdf")?"📄":e.includes("zip")||e.includes("rar")||e.includes("tar")?"📦":e.includes("json")||e.includes("xml")||e.includes("csv")?"📊":e.includes("text")||e.includes("javascript")||e.includes("typescript")?"📝":"📎"}const Ii=g.forwardRef(({files:e,onRemove:t,variant:r="compact",className:n,...s},a)=>{const i=re();return e.length===0?null:r==="grid"?o.jsx("div",{ref:a,className:b("grid grid-cols-2 gap-2",n),...s,children:e.map((l,c)=>o.jsxs("div",{className:"group relative rounded-xl border border-border overflow-hidden bg-muted/30",children:[Qn(l.type)&&(l.thumbnail||l.url)?o.jsx("div",{className:"aspect-square",children:o.jsx("img",{src:l.thumbnail||l.url,alt:l.name,className:"h-full w-full object-cover"})}):o.jsx("div",{className:"aspect-square flex items-center justify-center text-3xl bg-muted/50",children:eo(l.type)}),o.jsxs("div",{className:"px-2 py-1.5 border-t border-border/40",children:[o.jsx("div",{className:"text-xs font-medium truncate",children:l.name}),o.jsx("div",{className:"text-[10px] text-muted-foreground",children:Jn(l.size)})]}),t&&o.jsx("button",{type:"button",onClick:()=>t(c),className:"absolute top-1.5 right-1.5 h-5 w-5 rounded-full bg-background/80 backdrop-blur flex items-center justify-center text-muted-foreground hover:text-destructive transition-colors opacity-0 group-hover:opacity-100","aria-label":De(i.filePreview_remove,{name:l.name}),children:o.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 6 18"}),o.jsx("path",{d:"m6 6 12 12"})]})})]},l.id??c))}):o.jsx("div",{ref:a,className:b("flex gap-2 overflow-x-auto pb-1",n),...s,children:e.map((l,c)=>o.jsxs("div",{className:"group relative flex items-center gap-2 rounded-lg border border-border bg-muted/30 px-2.5 py-1.5 shrink-0 max-w-[200px]",children:[Qn(l.type)&&(l.thumbnail||l.url)?o.jsx("img",{src:l.thumbnail||l.url,alt:l.name,className:"h-8 w-8 rounded object-cover shrink-0"}):o.jsx("span",{className:"text-lg shrink-0",children:eo(l.type)}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"text-xs font-medium truncate",children:l.name}),o.jsx("div",{className:"text-[10px] text-muted-foreground",children:Jn(l.size)})]}),t&&o.jsx("button",{type:"button",onClick:()=>t(c),className:"h-5 w-5 rounded-full flex items-center justify-center text-muted-foreground hover:text-destructive transition-colors shrink-0 opacity-0 group-hover:opacity-100","aria-label":De(i.filePreview_remove,{name:l.name}),children:o.jsxs("svg",{className:"h-3 w-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 6 18"}),o.jsx("path",{d:"m6 6 12 12"})]})})]},l.id??c))})});Ii.displayName="FilePreview";const Im={sending:o.jsxs("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"10"}),o.jsx("path",{d:"M12 6v6l4 2"})]}),sent:o.jsx("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}),delivered:o.jsxs("svg",{className:"h-3 w-3 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 7 17l-5-5"}),o.jsx("path",{d:"m22 10-9.5 9.5-2-2"})]}),read:o.jsxs("svg",{className:"h-3 w-3 text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 7 17l-5-5"}),o.jsx("path",{d:"m22 10-9.5 9.5-2-2"})]}),error:o.jsxs("svg",{className:"h-3 w-3 text-destructive",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"10"}),o.jsx("path",{d:"m15 9-6 6"}),o.jsx("path",{d:"m9 9 6 6"})]})},Ti=g.forwardRef(({variant:e="received",avatar:t,avatarFallback:r,content:n,timestamp:s,isLoading:a,status:i,actions:l,textContent:c,likeState:d,onCopy:p,onRetry:u,onEdit:m,onLike:f,onDislike:h,onShare:x,followUp:w,onFollowUpSelect:v,onFollowUpFreeText:y,reasoning:j,toolCalls:k,citations:S,className:R,..._},C)=>{const A=re(),L=e==="sent",[N,$]=g.useState(!1),I=async()=>{if(c)try{await navigator.clipboard.writeText(c),$(!0),setTimeout(()=>$(!1),2e3)}catch{}p==null||p()};return o.jsxs("div",{ref:C,className:b("group flex gap-2 max-w-[85%]",L?"ml-auto flex-row-reverse":"mr-auto",R),..._,children:[(t||r)&&o.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground overflow-hidden",children:t?o.jsx("img",{src:t,alt:r??"avatar",className:"h-full w-full object-cover"}):o.jsx("span",{children:r??"?"})}),o.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[j&&o.jsx("div",{className:b("rounded-xl border border-border/60 overflow-hidden",j.isThinking&&"border-primary/30"),children:o.jsx(Tm,{...j})}),k==null?void 0:k.map((M,H)=>o.jsx(Lm,{...M},H)),o.jsxs("div",{className:b("rounded-2xl px-4 py-2.5 text-sm leading-relaxed",L?"bg-primary text-primary-foreground rounded-br-md":"bg-muted text-foreground rounded-bl-md"),children:[a?o.jsxs("div",{className:"flex items-center gap-1 py-1",children:[o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:0ms]"}),o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:150ms]"}),o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:300ms]"})]}):n,S&&S.length>0&&o.jsxs("div",{className:"border-t border-border/30 pt-2 mt-2 space-y-1.5",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold",children:A.sourceCitation_sources}),S.map(M=>o.jsxs("a",{href:M.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx("span",{className:"h-4 min-w-[16px] px-0.5 rounded bg-primary/15 text-primary text-[10px] font-semibold flex items-center justify-center",children:M.index}),o.jsx("span",{className:"truncate",children:M.title})]},M.index))]})]}),w&&o.jsxs("div",{className:"rounded-2xl bg-muted text-foreground rounded-bl-md px-4 py-3",children:[o.jsx("p",{className:"text-sm leading-relaxed mb-2.5",children:w.question}),o.jsx("div",{className:"grid gap-1.5",children:w.options.map(M=>{const H=M.id===w.selected,D=!!w.selected;return o.jsxs("button",{type:"button",disabled:D,onClick:()=>v==null?void 0:v(M.id,M.label),className:b("flex items-center gap-2 rounded-xl border px-3 py-2 text-left text-sm transition-all",H?"border-primary bg-primary/10 text-primary font-medium":D?"border-border/50 text-muted-foreground opacity-50 cursor-default":"border-border bg-background hover:border-primary/40 hover:bg-primary/5 cursor-pointer"),children:[H?o.jsx("svg",{className:"h-4 w-4 shrink-0 text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}):o.jsx("span",{className:b("h-4 w-4 shrink-0 rounded-full border-2",D?"border-border/50":"border-border")}),o.jsx("span",{className:"truncate",children:M.label})]},M.id)})})]}),(s||i)&&o.jsxs("div",{className:b("flex items-center gap-1 px-1",L&&"flex-row-reverse"),children:[s&&o.jsx("span",{className:"text-[10px] text-muted-foreground",children:s}),i&&Im[i]]}),l&&l.length>0&&!a&&o.jsx("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:l.map(M=>{const H=M==="copy"&&N,D={copy:I,retry:u,edit:m,like:f,dislike:h,share:x},P=M==="like"&&d==="liked"||M==="dislike"&&d==="disliked",E={copy:A.messageActions_copy,retry:A.messageActions_retry,edit:A.messageActions_edit,like:A.messageActions_like,dislike:A.messageActions_dislike,share:A.messageActions_share};return o.jsx("button",{type:"button",onClick:D[M],title:H?A.messageActions_copied:E[M],className:b("h-7 w-7 rounded-md flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",P&&"text-primary",H&&"text-green-500"),children:H?o.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}):M==="copy"?o.jsxs("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),o.jsx("path",{d:"M9 2h6a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z"})]}):M==="retry"?o.jsxs("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),o.jsx("path",{d:"M3 3v5h5"})]}):M==="like"?o.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:P?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M7 10v12 M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2h0a3.13 3.13 0 0 1 3 3.88Z"})}):M==="dislike"?o.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:P?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M17 14V2 M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22h0a3.13 3.13 0 0 1-3-3.88Z"})}):M==="edit"?o.jsx("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"})}):o.jsxs("svg",{className:"h-3.5 w-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),o.jsx("path",{d:"M16 6l-4-4-4 4"}),o.jsx("path",{d:"M12 2v13"})]})},M)})})]})]})});Ti.displayName="ChatMessage";function Tm({content:e,isThinking:t,duration:r}){const n=re(),[s,a]=g.useState(t===!0),[i,l]=g.useState(r??0);g.useEffect(()=>{t&&a(!0)},[t]),g.useEffect(()=>{if(!t)return;const d=Date.now(),p=setInterval(()=>l(Math.floor((Date.now()-d)/1e3)),1e3);return()=>clearInterval(p)},[t]);const c=t?i:r??i;return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",onClick:()=>a(d=>!d),className:"flex items-center gap-2 w-full px-3 py-2 text-sm hover:bg-muted/50",children:[o.jsxs("svg",{className:b("h-4 w-4 shrink-0 text-muted-foreground",t&&"text-primary animate-pulse"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"}),o.jsx("path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"})]}),o.jsx("span",{className:b("font-medium",t&&"text-primary animate-pulse"),children:t?n.reasoning_thinking:n.reasoning_title}),c>0&&o.jsx("span",{className:"text-xs text-muted-foreground",children:t?`${c}s...`:De(n.reasoning_thoughtFor,{duration:`${c}s`})}),o.jsx("svg",{className:b("h-3.5 w-3.5 ml-auto text-muted-foreground transition-transform",s&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"m6 9 6 6 6-6"})})]}),s&&o.jsx("div",{className:"border-t border-border/40 px-4 py-3 bg-muted/20",children:o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed whitespace-pre-wrap border-l-2 border-primary/20 pl-3",children:e})})]})}function Lm({name:e,args:t,result:r,status:n,error:s}){const a=re(),[i,l]=g.useState(!1);return o.jsxs("div",{className:b("rounded-xl border overflow-hidden",n==="error"?"border-destructive/30":"border-border/60"),children:[o.jsxs("button",{type:"button",onClick:()=>l(c=>!c),className:"flex items-center gap-2 w-full px-3 py-2 text-sm hover:bg-muted/50",children:[o.jsx("svg",{className:"h-4 w-4 shrink-0 text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),n==="running"?o.jsx("svg",{className:"h-3.5 w-3.5 animate-spin text-primary",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}):n==="success"?o.jsx("svg",{className:"h-3.5 w-3.5 text-green-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M20 6 9 17l-5-5"})}):o.jsxs("svg",{className:"h-3.5 w-3.5 text-destructive",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M18 6 6 18"}),o.jsx("path",{d:"m6 6 12 12"})]}),o.jsx("span",{className:"font-medium font-mono text-xs",children:n==="running"?De(a.toolCall_calling,{name:e}):e}),o.jsx("svg",{className:b("h-3.5 w-3.5 ml-auto text-muted-foreground transition-transform",i&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"m6 9 6 6 6-6"})})]}),i&&o.jsxs("div",{className:"border-t border-border/40 text-xs",children:[t&&Object.keys(t).length>0&&o.jsxs("div",{className:"px-3 py-2 bg-muted/20",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1 font-semibold",children:a.toolCall_arguments}),o.jsx("pre",{className:"overflow-x-auto font-mono whitespace-pre-wrap",children:JSON.stringify(t,null,2)})]}),r&&o.jsxs("div",{className:"px-3 py-2 border-t border-border/30",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1 font-semibold",children:a.toolCall_result}),o.jsx("pre",{className:"overflow-x-auto font-mono whitespace-pre-wrap",children:r})]}),s&&o.jsxs("div",{className:"px-3 py-2 bg-destructive/5 border-t border-border/30",children:[o.jsx("div",{className:"text-[10px] uppercase tracking-wider text-destructive mb-1 font-semibold",children:a.toolCall_error}),o.jsx("pre",{className:"overflow-x-auto font-mono text-destructive whitespace-pre-wrap",children:s})]})]})]})}exports.AILoading=gi;exports.Accordion=gc;exports.AccordionContent=ls;exports.AccordionItem=as;exports.AccordionTrigger=is;exports.Alert=As;exports.AlertDescription=Vs;exports.AlertDialog=Rc;exports.AlertDialogAction=qs;exports.AlertDialogCancel=Ws;exports.AlertDialogContent=$s;exports.AlertDialogDescription=Gs;exports.AlertDialogFooter=Os;exports.AlertDialogHeader=Bs;exports.AlertDialogOverlay=xn;exports.AlertDialogPortal=zs;exports.AlertDialogTitle=Hs;exports.AlertDialogTrigger=_c;exports.AlertTitle=Fs;exports.AppShell=Ya;exports.AspectRatio=dc;exports.AudioPlayer=_n;exports.AudioPlaylist=bm;exports.AudioRecorder=xm;exports.AudioWaveform=pr;exports.Avatar=Co;exports.AvatarFallback=So;exports.AvatarImage=ko;exports.Badge=Ur;exports.Blockquote=lm;exports.Box=qo;exports.Breadcrumb=Xs;exports.BreadcrumbEllipsis=ta;exports.BreadcrumbItem=Zs;exports.BreadcrumbLink=Js;exports.BreadcrumbList=Ys;exports.BreadcrumbPage=Qs;exports.BreadcrumbSeparator=ea;exports.Button=ve;exports.Calendar=Zr;exports.Card=Jr;exports.CardContent=tn;exports.CardDescription=Qo;exports.CardFooter=es;exports.CardHeader=Qr;exports.CardTitle=en;exports.Carousel=_a;exports.CarouselContent=Ma;exports.CarouselItem=Pa;exports.CarouselNext=Ta;exports.CarouselPrevious=Ia;exports.ChartContainer=Ga;exports.ChartLegend=mm;exports.ChartTooltip=um;exports.ChatActionCard=yi;exports.ChatBubble=ai;exports.ChatBubbleActions=di;exports.ChatBubbleAvatar=ii;exports.ChatBubbleMessage=li;exports.ChatBubbleTimestamp=ci;exports.ChatContainer=mi;exports.ChatEntityPreview=ji;exports.ChatFollowUp=vi;exports.ChatHeader=Mi;exports.ChatInput=ui;exports.ChatList=fi;exports.ChatMessage=Ti;exports.ChatModeSelector=bi;exports.ChatQuestion=wi;exports.ChatResultCard=Ni;exports.ChatToolCall=Ri;exports.Checkbox=Ro;exports.CitationBadge=Pn;exports.Code=im;exports.CodeBlock=om;exports.Collapsible=uc;exports.CollapsibleContent=Zo;exports.CollapsibleTrigger=mc;exports.ColorPicker=lc;exports.Combobox=rc;exports.Command=hn;exports.CommandDialog=kc;exports.CommandEmpty=Is;exports.CommandGroup=Ts;exports.CommandInput=Ms;exports.CommandItem=Ds;exports.CommandList=Ps;exports.CommandSeparator=Ls;exports.CommandShortcut=Es;exports.Container=Yo;exports.ContextMenu=fd;exports.ContextMenuCheckboxItem=ba;exports.ContextMenuContent=ha;exports.ContextMenuGroup=pd;exports.ContextMenuItem=xa;exports.ContextMenuLabel=wa;exports.ContextMenuPortal=hd;exports.ContextMenuRadioGroup=bd;exports.ContextMenuRadioItem=va;exports.ContextMenuSeparator=ya;exports.ContextMenuShortcut=ja;exports.ContextMenuSub=xd;exports.ContextMenuSubContent=pa;exports.ContextMenuSubTrigger=ga;exports.ContextMenuTrigger=gd;exports.ConversationList=_i;exports.CopyInput=ei;exports.DataTable=Ju;exports.DataTableColumnHeader=Qu;exports.DatePicker=Jl;exports.Dialog=cs;exports.DialogClose=hc;exports.DialogContent=ln;exports.DialogDescription=gs;exports.DialogFooter=ms;exports.DialogHeader=us;exports.DialogOverlay=an;exports.DialogPortal=ds;exports.DialogTitle=fs;exports.DialogTrigger=pc;exports.Drawer=ps;exports.DrawerClose=xs;exports.DrawerContent=dn;exports.DrawerDescription=gn;exports.DrawerFooter=mn;exports.DrawerHeader=un;exports.DrawerTitle=fn;exports.DrawerTrigger=hs;exports.DropdownMenu=vs;exports.DropdownMenuCheckboxItem=Ns;exports.DropdownMenuContent=pn;exports.DropdownMenuGroup=bc;exports.DropdownMenuItem=It;exports.DropdownMenuLabel=ks;exports.DropdownMenuPortal=vc;exports.DropdownMenuRadioGroup=yc;exports.DropdownMenuRadioItem=Cs;exports.DropdownMenuSeparator=Ss;exports.DropdownMenuShortcut=Rs;exports.DropdownMenuSub=wc;exports.DropdownMenuSubContent=js;exports.DropdownMenuSubTrigger=ys;exports.DropdownMenuTrigger=ws;exports.EmptyState=cd;exports.FilePreview=Ii;exports.FileUpload=sc;exports.Flex=Wo;exports.Grid=Xo;exports.HStack=Ko;exports.Header=Ja;exports.Heading=sm;exports.HoverCard=vd;exports.HoverCardContent=Na;exports.HoverCardTrigger=wd;exports.Image=oi;exports.ImageCompare=si;exports.ImageCropper=jm;exports.Input=st;exports.JsonViewer=ti;exports.Label=lr;exports.Lead=cm;exports.Lightbox=ym;exports.Main=Qa;exports.MarkdownRenderer=pi;exports.MessageActions=Ci;exports.MetricCard=fm;exports.ModeToggle=Nm;exports.ModeToggleGroup=km;exports.ModelSelector=xi;exports.MultiSelect=nc;exports.Muted=dm;exports.NUIProvider=Go;exports.NavigationMenu=la;exports.NavigationMenuContent=ma;exports.NavigationMenuIndicator=fa;exports.NavigationMenuItem=ud;exports.NavigationMenuLink=md;exports.NavigationMenuList=ca;exports.NavigationMenuTrigger=ua;exports.NavigationMenuViewport=bn;exports.NumberInput=ec;exports.OTPInput=oc;exports.Pagination=ra;exports.PaginationContent=na;exports.PaginationEllipsis=ia;exports.PaginationItem=oa;exports.PaginationLink=ur;exports.PaginationNext=aa;exports.PaginationPrevious=sa;exports.Popover=yt;exports.PopoverContent=ft;exports.PopoverTrigger=jt;exports.Progress=Us;exports.PromptSuggestions=hi;exports.RadioGroup=Do;exports.RadioGroupItem=Eo;exports.ReasoningBlock=Si;exports.ScrollArea=cr;exports.ScrollBar=or;exports.Select=Ul;exports.SelectContent=Po;exports.SelectGroup=Kl;exports.SelectItem=To;exports.SelectLabel=Io;exports.SelectScrollDownButton=Xr;exports.SelectScrollUpButton=Kr;exports.SelectSeparator=Lo;exports.SelectTrigger=Mo;exports.SelectValue=Xl;exports.Separator=No;exports.Sheet=ps;exports.SheetClose=xs;exports.SheetContent=dn;exports.SheetDescription=gn;exports.SheetFooter=mn;exports.SheetHeader=un;exports.SheetOverlay=cn;exports.SheetPortal=bs;exports.SheetTitle=fn;exports.SheetTrigger=hs;exports.Sidebar=Za;exports.Skeleton=Mc;exports.Slider=Ao;exports.SourceCitation=Pi;exports.StatusBadge=pm;exports.Stepper=dd;exports.StreamingText=ki;exports.Switch=_o;exports.Table=rn;exports.TableBody=on;exports.TableCaption=rs;exports.TableCell=nr;exports.TableFooter=ts;exports.TableHead=sn;exports.TableHeader=nn;exports.TableRow=Pt;exports.Tabs=fc;exports.TabsContent=ss;exports.TabsList=ns;exports.TabsTrigger=os;exports.TagInput=tc;exports.Text=am;exports.Textarea=yo;exports.ThemeProvider=id;exports.TimePicker=Ql;exports.Timeline=qa;exports.TimelineConnector=Ka;exports.TimelineContent=Xa;exports.TimelineIcon=Ua;exports.TimelineItem=Wa;exports.Toaster=ld;exports.Toggle=Fo;exports.ToggleGroup=Vo;exports.ToggleGroupItem=$o;exports.Tooltip=Nc;exports.TooltipContent=_s;exports.TooltipProvider=jc;exports.TooltipTrigger=Cc;exports.TranslateProvider=Go;exports.VStack=Uo;exports.VideoGallery=ni;exports.VideoPlayer=hr;exports.VideoRecorder=vm;exports.VideoThumbnail=Mn;exports.audioPlayerVariants=ri;exports.badgeVariants=jo;exports.buttonVariants=Bt;exports.cardVariants=Jo;exports.cn=b;exports.en=At;exports.formatTime=We;exports.headingVariants=Oa;exports.inputVariants=wo;exports.navigationMenuTriggerStyle=da;exports.ru=Bo;exports.textVariants=Ha;exports.toast=Wc;exports.toggleVariants=Yr;exports.tpl=De;exports.useLocale=Zl;exports.useNUILocale=re;exports.useTheme=dr;exports.useTranslate=re;
|
|
38
38
|
//# sourceMappingURL=index.cjs.js.map
|