@buildbase/sdk 0.0.44 → 0.0.46

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.
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import*as n from"react";import a,{Component as i,useRef as s,useMemo as o,createContext as c,useReducer as l,useContext as u,useEffect as d,useCallback as p,useState as m,forwardRef as h,createElement as f,useLayoutEffect as g,Suspense as b,lazy as v}from"react";import*as y from"react-dom";import w from"react-dom";function x(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=x(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function S(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=x(e))&&(n&&(n+=" "),n+=t);return n}const k=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),E="-",N=[],C=e=>{const t=P(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return _(e);const r=e.split(E),n=""===r[0]&&r.length>1?1:0;return A(r,n,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=n[e],a=r[e];return t?a?((e,t)=>{const r=new Array(e.length+t.length);for(let t=0;t<e.length;t++)r[t]=e[t];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r})(a,t):t:a||N}return r[e]||N}}},A=(e,t,r)=>{if(0===e.length-t)return r.classGroupId;const n=e[t],a=r.nextPart.get(n);if(a){const r=A(e,t+1,a);if(r)return r}const i=r.validators;if(null===i)return;const s=0===t?e.join(E):e.slice(t).join(E),o=i.length;for(let e=0;e<o;e++){const t=i[e];if(t.validator(s))return t.classGroupId}},_=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?"arbitrary.."+n:void 0})(),P=e=>{const{theme:t,classGroups:r}=e;return T(r,t)},T=(e,t)=>{const r=k();for(const n in e){const a=e[n];R(a,r,n,t)}return r},R=(e,t,r,n)=>{const a=e.length;for(let i=0;i<a;i++){const a=e[i];D(a,t,r,n)}},D=(e,t,r,n)=>{"string"!=typeof e?"function"!=typeof e?M(e,t,r,n):U(e,t,r,n):I(e,t,r)},I=(e,t,r)=>{(""===e?t:L(t,e)).classGroupId=r},U=(e,t,r,n)=>{O(e)?R(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(r,e)))},M=(e,t,r,n)=>{const a=Object.entries(e),i=a.length;for(let e=0;e<i;e++){const[i,s]=a[e];R(s,L(t,i),r,n)}},L=(e,t)=>{let r=e;const n=t.split(E),a=n.length;for(let e=0;e<a;e++){const t=n[e];let a=r.nextPart.get(t);a||(a=k(),r.nextPart.set(t,a)),r=a}return r},O=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,z=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const a=(a,i)=>{r[a]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=n[e])?(a(e,t),t):void 0},set(e,t){e in r?r[e]=t:a(e,t)}}},F=[],B=(e,t,r,n,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:a}),W=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=e=>{const t=[];let r,n=0,a=0,i=0;const s=e.length;for(let o=0;o<s;o++){const s=e[o];if(0===n&&0===a){if(":"===s){t.push(e.slice(i,o)),i=o+1;continue}if("/"===s){r=o;continue}}"["===s?n++:"]"===s?n--:"("===s?a++:")"===s&&a--}const o=0===t.length?e:e.slice(i);let c=o,l=!1;o.endsWith("!")?(c=o.slice(0,-1),l=!0):o.startsWith("!")&&(c=o.slice(1),l=!0);return B(t,l,c,r&&r>i?r-i:void 0)};if(t){const e=t+":",r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):B(F,!1,t,void 0,!0)}if(r){const e=n;n=t=>r({className:t,parseClassName:e})}return n},V=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((e,r)=>{t.set(e,1e6+r)}),e=>{const r=[];let n=[];for(let a=0;a<e.length;a++){const i=e[a],s="["===i[0],o=t.has(i);s||o?(n.length>0&&(n.sort(),r.push(...n),n=[]),r.push(i)):n.push(i)}return n.length>0&&(n.sort(),r.push(...n)),r}},j=/\s+/,H=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=H(e[n]))&&(r&&(r+=" "),r+=t);return r},G=(e,...t)=>{let r,n,a,i;const s=e=>{const t=n(e);if(t)return t;const i=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:i}=t,s=[],o=e.trim().split(j);let c="";for(let e=o.length-1;e>=0;e-=1){const t=o[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:p,maybePostfixModifierPosition:m}=r(t);if(l){c=t+(c.length>0?" "+c:c);continue}let h=!!m,f=n(h?p.substring(0,m):p);if(!f){if(!h){c=t+(c.length>0?" "+c:c);continue}if(f=n(p),!f){c=t+(c.length>0?" "+c:c);continue}h=!1}const g=0===u.length?"":1===u.length?u[0]:i(u).join(":"),b=d?g+"!":g,v=b+f;if(s.indexOf(v)>-1)continue;s.push(v);const y=a(f,h);for(let e=0;e<y.length;++e){const t=y[e];s.push(b+t)}c=t+(c.length>0?" "+c:c)}return c})(e,r);return a(e,i),i};return i=o=>{const c=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:z(e.cacheSize),parseClassName:W(e),sortModifiers:V(e),...C(e)}))(c),n=r.cache.get,a=r.cache.set,i=s,s(o)},(...e)=>i(((...e)=>{let t,r,n=0,a="";for(;n<e.length;)(t=e[n++])&&(r=H(t))&&(a&&(a+=" "),a+=r);return a})(...e))},$=[],K=e=>{const t=t=>t[e]||$;return t.isThemeGetter=!0,t},q=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Z=/^\((?:(\w[\w-]*):)?(.+)\)$/i,J=/^\d+\/\d+$/,Y=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,X=/\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$/,Q=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ee=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,te=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,re=e=>J.test(e),ne=e=>!!e&&!Number.isNaN(Number(e)),ae=e=>!!e&&Number.isInteger(Number(e)),ie=e=>e.endsWith("%")&&ne(e.slice(0,-1)),se=e=>Y.test(e),oe=()=>!0,ce=e=>X.test(e)&&!Q.test(e),le=()=>!1,ue=e=>ee.test(e),de=e=>te.test(e),pe=e=>!he(e)&&!we(e),me=e=>Ae(e,Re,le),he=e=>q.test(e),fe=e=>Ae(e,De,ce),ge=e=>Ae(e,Ie,ne),be=e=>Ae(e,Pe,le),ve=e=>Ae(e,Te,de),ye=e=>Ae(e,Me,ue),we=e=>Z.test(e),xe=e=>_e(e,De),Se=e=>_e(e,Ue),ke=e=>_e(e,Pe),Ee=e=>_e(e,Re),Ne=e=>_e(e,Te),Ce=e=>_e(e,Me,!0),Ae=(e,t,r)=>{const n=q.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},_e=(e,t,r=!1)=>{const n=Z.exec(e);return!!n&&(n[1]?t(n[1]):r)},Pe=e=>"position"===e||"percentage"===e,Te=e=>"image"===e||"url"===e,Re=e=>"length"===e||"size"===e||"bg-size"===e,De=e=>"length"===e,Ie=e=>"number"===e,Ue=e=>"family-name"===e,Me=e=>"shadow"===e,Le=G(()=>{const e=K("color"),t=K("font"),r=K("text"),n=K("font-weight"),a=K("tracking"),i=K("leading"),s=K("breakpoint"),o=K("container"),c=K("spacing"),l=K("radius"),u=K("shadow"),d=K("inset-shadow"),p=K("text-shadow"),m=K("drop-shadow"),h=K("blur"),f=K("perspective"),g=K("aspect"),b=K("ease"),v=K("animate"),y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",we,he],w=()=>[we,he,c],x=()=>[re,"full","auto",...w()],S=()=>[ae,"none","subgrid",we,he],k=()=>["auto",{span:["full",ae,we,he]},ae,we,he],E=()=>[ae,"auto",we,he],N=()=>["auto","min","max","fr",we,he],C=()=>["auto",...w()],A=()=>[re,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],_=()=>[e,we,he],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ke,be,{position:[we,he]}],T=()=>["auto","cover","contain",Ee,me,{size:[we,he]}],R=()=>[ie,xe,fe],D=()=>["","none","full",l,we,he],I=()=>["",ne,xe,fe],U=()=>[ne,ie,ke,be],M=()=>["","none",h,we,he],L=()=>["none",ne,we,he],O=()=>["none",ne,we,he],z=()=>[ne,we,he],F=()=>[re,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[se],breakpoint:[se],color:[oe],container:[se],"drop-shadow":[se],ease:["in","out","in-out"],font:[pe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[se],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[se],shadow:[se],spacing:["px",ne],text:[se],"text-shadow":[se],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",re,he,we,g]}],container:["container"],columns:[{columns:[ne,he,we,o]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"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:y()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{start:x()}],end:[{end:x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:["visible","invisible","collapse"],z:[{z:[ae,"auto",we,he]}],basis:[{basis:[re,"full","auto",o,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ne,re,"auto","initial","none",he]}],grow:[{grow:["",ne,we,he]}],shrink:[{shrink:["",ne,we,he]}],order:[{order:[ae,"first","last","none",we,he]}],"grid-cols":[{"grid-cols":S()}],"col-start-end":[{col:k()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":S()}],"row-start-end":[{row:k()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:A()}],w:[{w:[o,"screen",...A()]}],"min-w":[{"min-w":[o,"screen","none",...A()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[s]},...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,xe,fe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,we,ge]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ie,he]}],"font-family":[{font:[Se,he,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:[a,we,he]}],"line-clamp":[{"line-clamp":[ne,"none",we,ge]}],leading:[{leading:[i,...w()]}],"list-image":[{"list-image":["none",we,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",we,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[ne,"from-font","auto",we,fe]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[ne,"auto",we,he]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we,he]}],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",we,he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ae,we,he],radial:["",we,he],conic:[ae,we,he]},Ne,ve]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:D()}],"rounded-s":[{"rounded-s":D()}],"rounded-e":[{"rounded-e":D()}],"rounded-t":[{"rounded-t":D()}],"rounded-r":[{"rounded-r":D()}],"rounded-b":[{"rounded-b":D()}],"rounded-l":[{"rounded-l":D()}],"rounded-ss":[{"rounded-ss":D()}],"rounded-se":[{"rounded-se":D()}],"rounded-ee":[{"rounded-ee":D()}],"rounded-es":[{"rounded-es":D()}],"rounded-tl":[{"rounded-tl":D()}],"rounded-tr":[{"rounded-tr":D()}],"rounded-br":[{"rounded-br":D()}],"rounded-bl":[{"rounded-bl":D()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":I()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[ne,we,he]}],"outline-w":[{outline:["",ne,xe,fe]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",u,Ce,ye]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",d,Ce,ye]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[ne,fe]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",p,Ce,ye]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[ne,we,he]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"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":[ne]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[we,he]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"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":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[ne]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",we,he]}],filter:[{filter:["","none",we,he]}],blur:[{blur:M()}],brightness:[{brightness:[ne,we,he]}],contrast:[{contrast:[ne,we,he]}],"drop-shadow":[{"drop-shadow":["","none",m,Ce,ye]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",ne,we,he]}],"hue-rotate":[{"hue-rotate":[ne,we,he]}],invert:[{invert:["",ne,we,he]}],saturate:[{saturate:[ne,we,he]}],sepia:[{sepia:["",ne,we,he]}],"backdrop-filter":[{"backdrop-filter":["","none",we,he]}],"backdrop-blur":[{"backdrop-blur":M()}],"backdrop-brightness":[{"backdrop-brightness":[ne,we,he]}],"backdrop-contrast":[{"backdrop-contrast":[ne,we,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ne,we,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ne,we,he]}],"backdrop-invert":[{"backdrop-invert":["",ne,we,he]}],"backdrop-opacity":[{"backdrop-opacity":[ne,we,he]}],"backdrop-saturate":[{"backdrop-saturate":[ne,we,he]}],"backdrop-sepia":[{"backdrop-sepia":["",ne,we,he]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",we,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ne,"initial",we,he]}],ease:[{ease:["linear","initial",b,we,he]}],delay:[{delay:[ne,we,he]}],animate:[{animate:["none",v,we,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[f,we,he]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:L()}],"rotate-x":[{"rotate-x":L()}],"rotate-y":[{"rotate-y":L()}],"rotate-z":[{"rotate-z":L()}],scale:[{scale:O()}],"scale-x":[{"scale-x":O()}],"scale-y":[{"scale-y":O()}],"scale-z":[{"scale-z":O()}],"scale-3d":["scale-3d"],skew:[{skew:z()}],"skew-x":[{"skew-x":z()}],"skew-y":[{"skew-y":z()}],transform:[{transform:[we,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:F()}],"translate-x":[{"translate-x":F()}],"translate-y":[{"translate-y":F()}],"translate-z":[{"translate-z":F()}],"translate-none":["translate-none"],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"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",we,he]}],"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":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"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",we,he]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[ne,xe,fe,ge]}],stroke:[{stroke:["none",..._()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Oe(...e){return Le(S(e))}let ze=!0;function Fe(e,...t){ze&&function(){try{const e="undefined"!=typeof globalThis?globalThis:null;return"development"===e?.process?.env?.NODE_ENV}catch{return!1}}()&&console.error(e,...t)}function Be(e,...t){console.error(e,...t)}function We(e){return e instanceof Error&&("AbortError"===e.name||"ERR_CANCELED"===e.code)}async function Ve(e,t){try{const r=await e.json();return r?.message||r?.error||t}catch{return t}}async function je(e){const t=await e.text();if(!t)throw new Error("Empty response body");try{return JSON.parse(t)}catch(e){throw new Error(`Invalid JSON response: ${t.substring(0,100)}${t.length>100?"...":""}`)}}async function He(e,t="Request failed"){if(!e.ok){let r=t;try{const t=await je(e);r=t.message||t.error||r}catch{r=function(e,t){const r={400:"Bad Request",401:"Unauthorized - Please check your session",403:"Forbidden - You do not have permission",404:"Resource not found",500:"Internal server error",502:"Bad Gateway",503:"Service unavailable"}[e.status]||e.statusText||t;return new Error(`${t} (${e.status}: ${r})`)}(e,t).message}throw new Error(r)}try{return await je(e)}catch(e){if(e instanceof Error&&e.message.includes("Invalid JSON"))throw e;throw new Error("Failed to parse response as JSON")}}class Ge extends Error{constructor(e,t,r,n){super(e),this.code=t,this.context=r,this.originalError=n,this.name="SDKError","undefined"!=typeof Error&&"captureStackTrace"in Error&&Error.captureStackTrace(this,Ge)}}const $e=new class{constructor(){this.config={enableConsoleLogging:!0,showUserNotifications:!1}}configure(e){this.config={...this.config,...e},void 0!==e.enableConsoleLogging&&function(e){void 0!==e.enableLogging&&(ze=e.enableLogging)}({enableLogging:e.enableConsoleLogging})}handleError(e,t={}){if(We(e))return;const r=e instanceof Error?e:new Ge("string"==typeof e?e:"An unknown error occurred","UNKNOWN_ERROR",t),n=r instanceof Ge?r:new Ge(r.message,"SDK_ERROR",t,r);if(this.config.enableConsoleLogging&&Fe(`[SDK Error] ${t.component||"Unknown"}:`,{message:n.message,code:n.code,context:n.context,originalError:n.originalError,stack:n.stack}),this.config.onError)try{this.config.onError(n,t)}catch(e){Be("[SDK Error Handler] Error in custom error callback:",e)}this.config.showUserNotifications&&this.notifyUser(n,t)}notifyUser(e,t){"undefined"!=typeof window&&window.dispatchEvent&&window.dispatchEvent(new CustomEvent("sdk-error",{detail:{error:e,context:t}}))}wrapAsync(e,t){return(...r)=>e(...r).catch(e=>{throw this.handleError(e,t),e})}wrapSync(e,t){return(...r)=>{try{return e(...r)}catch(e){throw this.handleError(e,t),e}}}};function Ke(e,t={}){$e.handleError(e,t)}function qe(e,t={}){return!We(e)&&($e.handleError(e,t),!0)}class Ze extends i{constructor(e){super(e),this.resetError=()=>{this.setState({hasError:!1,error:null})},this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){if(Ke(e,{component:"ErrorBoundary",action:"componentDidCatch",metadata:{componentStack:t.componentStack,errorBoundary:this.constructor.name}}),this.props.onError)try{this.props.onError(e,t)}catch(e){Be("[SDK ErrorBoundary] Error in onError callback:",e)}}componentDidUpdate(e){this.state.hasError&&!1!==this.props.resetOnPropsChange&&e.children!==this.props.children&&this.resetError()}render(){return this.state.hasError&&this.state.error?this.props.fallback?"function"==typeof this.props.fallback?this.props.fallback(this.state.error,this.resetError):this.props.fallback:e("div",{style:{padding:"1rem",border:"1px solid #ef4444",borderRadius:"0.5rem",backgroundColor:"#fef2f2",color:"#991b1b"},children:[t("h3",{style:{margin:"0 0 0.5rem 0",fontSize:"1rem",fontWeight:600},children:"Something went wrong"}),t("p",{style:{margin:"0 0 1rem 0",fontSize:"0.875rem"},children:this.state.error.message||"An unexpected error occurred"}),t("button",{onClick:this.resetError,style:{padding:"0.5rem 1rem",backgroundColor:"#ef4444",color:"white",border:"none",borderRadius:"0.25rem",cursor:"pointer",fontSize:"0.875rem"},children:"Try again"})]}):this.props.children}}const Je=()=>({type:"AUTHENTICATION_STARTED"}),Ye=()=>({type:"AUTHENTICATION_PROCESSING"}),Xe=()=>({type:"AUTHENTICATION_FAILED"}),Qe=e=>({type:"SET_SESSION",payload:e}),et=()=>({type:"REMOVE_SESSION"});function tt(e,t,r){const n=s(t),a=s(r),i=s(void 0),c=s(!1);return n.current=t,a.current=r,o(()=>{const t=n.current(e);if(c.current){if(a.current?a.current(i.current,t):Object.is(i.current,t))return i.current}return i.current=t,c.current=!0,t},[e])}function rt({name:e,initialState:r,reducer:n,initializer:i}){const s=c(null),u=c(null),d=c(null),p=a.memo(({children:e})=>{const[a,c]=l(n,r,i||(e=>e)),p=o(()=>({state:a,dispatch:c}),[a,c]);return t(d.Provider,{value:p,children:t(s.Provider,{value:a,children:t(u.Provider,{value:c,children:e})})})});p.displayName=`${e}Provider`;const m=t=>new Error(`use${e}${t} must be used within a ${e}Provider. Make sure SaaSOSProvider is wrapping your application.`),h=()=>{const e=a.useContext(s);if(null===e)throw m("State");return e};return{Provider:p,useContext:()=>{const e=a.useContext(d);if(!e)throw m("Context");return e},useState:h,useDispatch:()=>{const e=a.useContext(u);if(null===e)throw m("Dispatch");return e},useSelector:(e,t)=>{const r=e||(e=>e);return tt(h(),r,t)}}}var nt;function at(e){return{isAuthenticated:e===nt.authenticated,isLoading:e===nt.loading||e===nt.redirecting||e===nt.authenticating,isRedirecting:e===nt.redirecting}}function it(e,t,r){return{...e,[t]:r}}function st(e,t){return{...e,...t}}!function(e){e.loading="loading",e.redirecting="redirecting",e.authenticated="authenticated",e.unauthenticated="unauthenticated",e.authenticating="authenticating"}(nt||(nt={}));const ot=()=>({session:null,status:nt.loading}),{Provider:ct,useState:lt,useDispatch:ut}=rt({name:"Auth",initialState:ot(),reducer:(e,t)=>{switch(t.type){case"AUTHENTICATION_STARTED":return it(e,"status",nt.redirecting);case"AUTHENTICATION_PROCESSING":return it(e,"status",nt.authenticating);case"AUTHENTICATION_FAILED":case"REMOVE_SESSION":return st(e,{session:null,status:nt.unauthenticated});case"SET_SESSION":return st(e,{session:t.payload,status:nt.authenticated});default:return e}},initializer:ot}),dt=ct,pt=lt,mt=ut,ht=e=>({type:"SET_SAAS_OS_CONFIG",payload:e}),ft=e=>({type:"SET_SETTINGS",payload:e});var gt;function bt(e){return Boolean(e?.serverUrl&&e?.version&&e?.orgId)}!function(e){e.V1="v1"}(gt||(gt={}));const vt=()=>({serverUrl:"",version:gt.V1,orgId:"",settings:null}),{Provider:yt,useState:wt,useDispatch:xt}=rt({name:"OS",initialState:vt(),reducer:(e,t)=>{switch(t.type){case"SET_SAAS_OS_CONFIG":return st(e,t.payload);case"REMOVE_SAAS_OS_CONFIG":return vt();case"SET_SETTINGS":return it(e,"settings",t.payload);default:return e}}}),St=yt,kt=wt,Et=xt,Nt=e=>({type:"SET_WORKSPACES",payload:e}),Ct=e=>({type:"ADD_WORKSPACE",payload:e}),At=e=>({type:"UPDATE_WORKSPACE",payload:e}),_t=e=>({type:"REMOVE_WORKSPACE",payload:e}),Pt=e=>({type:"SET_ALL_FEATURES",payload:e}),Tt=e=>({type:"SET_CURRENT_WORKSPACE",payload:e}),Rt=()=>({type:"RESET_CURRENT_WORKSPACE"}),Dt=e=>({type:"SET_IS_INITIALIZED",payload:e}),It=e=>({type:"SET_LOADING",payload:e}),Ut=e=>({type:"SET_ERROR",payload:e}),Mt=e=>({type:"SET_REFRESHING",payload:e}),Lt=e=>({type:"SET_SWITCHING_TO_ID",payload:e}),{Provider:Ot,useState:zt,useDispatch:Ft}=rt({name:"Workspace",initialState:{workspaces:[],loading:!1,error:null,currentWorkspace:null,refreshing:!1,switchingToId:null,isInitialized:!1,allFeatures:[]},reducer:(e,t)=>{switch(t.type){case"SET_WORKSPACES":return it(e,"workspaces",t.payload);case"ADD_WORKSPACE":return it(e,"workspaces",[...e.workspaces,t.payload]);case"UPDATE_WORKSPACE":return it(e,"workspaces",e.workspaces.map(e=>e._id===t.payload._id?t.payload:e));case"REMOVE_WORKSPACE":return it(e,"workspaces",e.workspaces.filter(e=>e._id!==t.payload));case"SET_ALL_FEATURES":return it(e,"allFeatures",t.payload);case"SET_CURRENT_WORKSPACE":return it(e,"currentWorkspace",t.payload);case"RESET_CURRENT_WORKSPACE":return it(e,"currentWorkspace",null);case"SET_IS_INITIALIZED":return it(e,"isInitialized",t.payload);case"SET_LOADING":return it(e,"loading",t.payload);case"SET_ERROR":return it(e,"error",t.payload);case"SET_REFRESHING":return it(e,"refreshing",t.payload);case"SET_SWITCHING_TO_ID":return it(e,"switchingToId",t.payload);default:return e}}}),Bt=Ot,Wt=zt,Vt=Ft,jt=a.memo(({children:e})=>t(St,{children:t(dt,{children:t(Bt,{children:e})})}));jt.displayName="SDKContextProvider";const Ht=c({});Ht.displayName="CheckoutConfigContext";const Gt=a.memo(({getCheckoutStripeParams:e,children:r})=>{const n=a.useMemo(()=>({getCheckoutStripeParams:e}),[e]);return t(Ht.Provider,{value:n,children:r})});Gt.displayName="CheckoutConfigProvider";const $t=new Set;function Kt(){$t.forEach(e=>e())}const qt=new Set;function Zt(){qt.forEach(e=>e())}function Jt(e,t){const r=t&&t.cache?t.cache:nr,n=t&&t.serializer?t.serializer:tr;return(t&&t.strategy?t.strategy:er)(e,{cache:r,serializer:n})}function Yt(e,t,r,n){const a=null==(i=n)||"number"==typeof i||"boolean"==typeof i?n:r(n);var i;let s=t.get(a);return void 0===s&&(s=e.call(this,n),t.set(a,s)),s}function Xt(e,t,r){const n=Array.prototype.slice.call(arguments,3),a=r(n);let i=t.get(a);return void 0===i&&(i=e.apply(this,n),t.set(a,i)),i}function Qt(e,t,r,n,a){return r.bind(t,e,n,a)}function er(e,t){return Qt(e,this,1===e.length?Yt:Xt,t.cache.create(),t.serializer)}const tr=function(){return JSON.stringify(arguments)};class rr{cache;constructor(){this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}}const nr={create:function(){return new rr}},ar={variadic:function(e,t){return Qt(e,this,Xt,t.cache.create(),t.serializer)}},ir=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function sr(e){const t={};return e.replace(ir,e=>{const r=e.length;switch(e[0]){case"G":t.era=4===r?"long":5===r?"narrow":"short";break;case"y":t.year=2===r?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][r-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][r-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===r?"long":5===r?"narrow":"short";break;case"e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][r-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][r-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][r-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][r-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][r-1];break;case"s":t.second=["numeric","2-digit"][r-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=r<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}const or=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function cr(e){return e.replace(/^(.*?)-/,"")}const lr=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,ur=/^(@+)?(\+|#+)?[rs]?$/g,dr=/(\*)(0+)|(#+)(0+)|(0+)/g,pr=/^(0+)$/;function mr(e){const t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(ur,function(e,r,n){return"string"!=typeof n?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):"+"===n?t.minimumSignificantDigits=r.length:"#"===r[0]?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+("string"==typeof n?n.length:0)),""}),t}function hr(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function fr(e){let t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){const r=e.slice(0,2);if("+!"===r?(t.signDisplay="always",e=e.slice(2)):"+?"===r&&(t.signDisplay="exceptZero",e=e.slice(2)),!pr.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function gr(e){const t=hr(e);return t||{}}function br(e){let t={};for(const r of e){switch(r.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=r.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=cr(r.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t={...t,notation:"scientific",...r.options.reduce((e,t)=>({...e,...gr(t)}),{})};continue;case"engineering":t={...t,notation:"engineering",...r.options.reduce((e,t)=>({...e,...gr(t)}),{})};continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(r.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(r.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");r.options[0].replace(dr,function(e,r,n,a,i,s){if(r)t.minimumIntegerDigits=n.length;else{if(a&&i)throw new Error("We currently do not support maximum integer digits");if(s)throw new Error("We currently do not support exact integer digits")}return""});continue}if(pr.test(r.stem)){t.minimumIntegerDigits=r.stem.length;continue}if(lr.test(r.stem)){if(r.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(lr,function(e,r,n,a,i,s){return"*"===n?t.minimumFractionDigits=r.length:a&&"#"===a[0]?t.maximumFractionDigits=a.length:i&&s?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+s.length):(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length),""});const e=r.options[0];"w"===e?t={...t,trailingZeroDisplay:"stripIfInteger"}:e&&(t={...t,...mr(e)});continue}if(ur.test(r.stem)){t={...t,...mr(r.stem)};continue}const e=hr(r.stem);e&&(t={...t,...e});const n=fr(r.stem);n&&(t={...t,...n})}return t}let vr=function(e){return e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag",e}({}),yr=function(e){return e[e.number=0]="number",e[e.dateTime=1]="dateTime",e}({});function wr(e){return e.type===vr.literal}function xr(e){return e.type===vr.argument}function Sr(e){return e.type===vr.number}function kr(e){return e.type===vr.date}function Er(e){return e.type===vr.time}function Nr(e){return e.type===vr.select}function Cr(e){return e.type===vr.plural}function Ar(e){return e.type===vr.pound}function _r(e){return e.type===vr.tag}function Pr(e){return!(!e||"object"!=typeof e||e.type!==yr.number)}function Tr(e){return!(!e||"object"!=typeof e||e.type!==yr.dateTime)}let Rr=function(e){return e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG",e}({});const Dr=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,Ir={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GS:["H","h","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ku-SY":["H","hB"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function Ur(e){let t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}const r=e.language;let n;"root"!==r&&(n=e.maximize().region);return(Ir[n||""]||Ir[r||""]||Ir[`${r}-001`]||Ir["001"])[0]}const Mr=new RegExp(`^${Dr.source}*`),Lr=new RegExp(`${Dr.source}*$`);function Or(e,t){return{start:e,end:t}}const zr=!!Object.fromEntries,Fr=!!String.prototype.trimStart,Br=!!String.prototype.trimEnd,Wr=zr?Object.fromEntries:function(e){const t={};for(const[r,n]of e)t[r]=n;return t},Vr=Fr?function(e){return e.trimStart()}:function(e){return e.replace(Mr,"")},jr=Br?function(e){return e.trimEnd()}:function(e){return e.replace(Lr,"")},Hr=new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");class Gr{message;position;locale;ignoreTag;requiresOtherClause;shouldParseSkeletons;constructor(e,t={}){this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}parse(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)}parseMessage(e,t,r){let n=[];for(;!this.isEOF();){const a=this.char();if(123===a){const t=this.parseArgument(e,r);if(t.err)return t;n.push(t.val)}else{if(125===a&&e>0)break;if(35!==a||"plural"!==t&&"selectordinal"!==t){if(60===a&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(Rr.UNMATCHED_CLOSING_TAG,Or(this.clonePosition(),this.clonePosition()))}if(60===a&&!this.ignoreTag&&$r(this.peek()||0)){const r=this.parseTag(e,t);if(r.err)return r;n.push(r.val)}else{const r=this.parseLiteral(e,t);if(r.err)return r;n.push(r.val)}}else{const e=this.clonePosition();this.bump(),n.push({type:vr.pound,location:Or(e,this.clonePosition())})}}}return{val:n,err:null}}parseTag(e,t){const r=this.clonePosition();this.bump();const n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:vr.literal,value:`<${n}/>`,location:Or(r,this.clonePosition())},err:null};if(this.bumpIf(">")){const a=this.parseMessage(e+1,t,!0);if(a.err)return a;const i=a.val,s=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!$r(this.char()))return this.error(Rr.INVALID_TAG,Or(s,this.clonePosition()));const e=this.clonePosition();return n!==this.parseTagName()?this.error(Rr.UNMATCHED_CLOSING_TAG,Or(e,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:vr.tag,value:n,children:i,location:Or(r,this.clonePosition())},err:null}:this.error(Rr.INVALID_TAG,Or(s,this.clonePosition())))}return this.error(Rr.UNCLOSED_TAG,Or(r,this.clonePosition()))}return this.error(Rr.INVALID_TAG,Or(r,this.clonePosition()))}parseTagName(){const e=this.offset();for(this.bump();!this.isEOF()&&Kr(this.char());)this.bump();return this.message.slice(e,this.offset())}parseLiteral(e,t){const r=this.clonePosition();let n="";for(;;){const r=this.tryParseQuote(t);if(r){n+=r;continue}const a=this.tryParseUnquoted(e,t);if(a){n+=a;continue}const i=this.tryParseLeftAngleBracket();if(!i)break;n+=i}const a=Or(r,this.clonePosition());return{val:{type:vr.literal,value:n,location:a},err:null}}tryParseLeftAngleBracket(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&($r(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e}tryParseQuote(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();const t=[this.char()];for(this.bump();!this.isEOF();){const e=this.char();if(39===e){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(e);this.bump()}return String.fromCodePoint(...t)}tryParseUnquoted(e,t){if(this.isEOF())return null;const r=this.char();return 60===r||123===r||35===r&&("plural"===t||"selectordinal"===t)||125===r&&e>0?null:(this.bump(),String.fromCodePoint(r))}parseArgument(e,t){const r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(Rr.EXPECT_ARGUMENT_CLOSING_BRACE,Or(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(Rr.EMPTY_ARGUMENT,Or(r,this.clonePosition()));let n=this.parseIdentifierIfPossible().value;if(!n)return this.error(Rr.MALFORMED_ARGUMENT,Or(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(Rr.EXPECT_ARGUMENT_CLOSING_BRACE,Or(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:vr.argument,value:n,location:Or(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(Rr.EXPECT_ARGUMENT_CLOSING_BRACE,Or(r,this.clonePosition())):this.parseArgumentOptions(e,t,n,r);default:return this.error(Rr.MALFORMED_ARGUMENT,Or(r,this.clonePosition()))}}parseIdentifierIfPossible(){const e=this.clonePosition(),t=this.offset(),r=function(e,t){return Hr.lastIndex=t,Hr.exec(e)[1]??""}(this.message,t),n=t+r.length;this.bumpTo(n);return{value:r,location:Or(e,this.clonePosition())}}parseArgumentOptions(e,t,r,n){let a=this.clonePosition(),i=this.parseIdentifierIfPossible().value,s=this.clonePosition();switch(i){case"":return this.error(Rr.EXPECT_ARGUMENT_TYPE,Or(a,s));case"number":case"date":case"time":{this.bumpSpace();let e=null;if(this.bumpIf(",")){this.bumpSpace();const t=this.clonePosition(),r=this.parseSimpleArgStyleIfPossible();if(r.err)return r;const n=jr(r.val);if(0===n.length)return this.error(Rr.EXPECT_ARGUMENT_STYLE,Or(this.clonePosition(),this.clonePosition()));e={style:n,styleLocation:Or(t,this.clonePosition())}}const t=this.tryParseArgumentClose(n);if(t.err)return t;const a=Or(n,this.clonePosition());if(e&&e.style.startsWith("::")){let t=Vr(e.style.slice(2));if("number"===i){const n=this.parseNumberSkeletonFromString(t,e.styleLocation);return n.err?n:{val:{type:vr.number,value:r,location:a,style:n.val},err:null}}{if(0===t.length)return this.error(Rr.EXPECT_DATE_TIME_SKELETON,a);let n=t;this.locale&&(n=function(e,t){let r="";for(let n=0;n<e.length;n++){const a=e.charAt(n);if("j"===a){let i=0;for(;n+1<e.length&&e.charAt(n+1)===a;)i++,n++;let s=1+(1&i),o=i<2?1:3+(i>>1),c="a",l=Ur(t);for("H"!=l&&"k"!=l||(o=0);o-- >0;)r+=c;for(;s-- >0;)r=l+r}else r+="J"===a?"H":a}return r}(t,this.locale));const s={type:yr.dateTime,pattern:n,location:e.styleLocation,parsedOptions:this.shouldParseSkeletons?sr(n):{}};return{val:{type:"date"===i?vr.date:vr.time,value:r,location:a,style:s},err:null}}}return{val:{type:"number"===i?vr.number:"date"===i?vr.date:vr.time,value:r,location:a,style:e?.style??null},err:null}}case"plural":case"selectordinal":case"select":{const a=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(Rr.EXPECT_SELECT_ARGUMENT_OPTIONS,Or(a,{...a}));this.bumpSpace();let s=this.parseIdentifierIfPossible(),o=0;if("select"!==i&&"offset"===s.value){if(!this.bumpIf(":"))return this.error(Rr.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Or(this.clonePosition(),this.clonePosition()));this.bumpSpace();const e=this.tryParseDecimalInteger(Rr.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Rr.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(e.err)return e;this.bumpSpace(),s=this.parseIdentifierIfPossible(),o=e.val}const c=this.tryParsePluralOrSelectOptions(e,i,t,s);if(c.err)return c;const l=this.tryParseArgumentClose(n);if(l.err)return l;const u=Or(n,this.clonePosition());return"select"===i?{val:{type:vr.select,value:r,options:Wr(c.val),location:u},err:null}:{val:{type:vr.plural,value:r,options:Wr(c.val),offset:o,pluralType:"plural"===i?"cardinal":"ordinal",location:u},err:null}}default:return this.error(Rr.INVALID_ARGUMENT_TYPE,Or(a,s))}}tryParseArgumentClose(e){return this.isEOF()||125!==this.char()?this.error(Rr.EXPECT_ARGUMENT_CLOSING_BRACE,Or(e,this.clonePosition())):(this.bump(),{val:!0,err:null})}parseSimpleArgStyleIfPossible(){let e=0;const t=this.clonePosition();for(;!this.isEOF();){switch(this.char()){case 39:{this.bump();let e=this.clonePosition();if(!this.bumpUntil("'"))return this.error(Rr.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Or(e,this.clonePosition()));this.bump();break}case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}}parseNumberSkeletonFromString(e,t){let r=[];try{r=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");const t=e.split(or).filter(e=>e.length>0),r=[];for(const e of t){let t=e.split("/");if(0===t.length)throw new Error("Invalid number skeleton");const[n,...a]=t;for(const e of a)if(0===e.length)throw new Error("Invalid number skeleton");r.push({stem:n,options:a})}return r}(e)}catch{return this.error(Rr.INVALID_NUMBER_SKELETON,t)}return{val:{type:yr.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?br(r):{}},err:null}}tryParsePluralOrSelectOptions(e,t,r,n){let a=!1;const i=[],s=new Set;let{value:o,location:c}=n;for(;;){if(0===o.length){const e=this.clonePosition();if("select"===t||!this.bumpIf("="))break;{const t=this.tryParseDecimalInteger(Rr.EXPECT_PLURAL_ARGUMENT_SELECTOR,Rr.INVALID_PLURAL_ARGUMENT_SELECTOR);if(t.err)return t;c=Or(e,this.clonePosition()),o=this.message.slice(e.offset,this.offset())}}if(s.has(o))return this.error("select"===t?Rr.DUPLICATE_SELECT_ARGUMENT_SELECTOR:Rr.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===o&&(a=!0),this.bumpSpace();const n=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?Rr.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:Rr.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Or(this.clonePosition(),this.clonePosition()));const l=this.parseMessage(e+1,t,r);if(l.err)return l;const u=this.tryParseArgumentClose(n);if(u.err)return u;i.push([o,{value:l.val,location:Or(n,this.clonePosition())}]),s.add(o),this.bumpSpace(),({value:o,location:c}=this.parseIdentifierIfPossible())}return 0===i.length?this.error("select"===t?Rr.EXPECT_SELECT_ARGUMENT_SELECTOR:Rr.EXPECT_PLURAL_ARGUMENT_SELECTOR,Or(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!a?this.error(Rr.MISSING_OTHER_CLAUSE,Or(this.clonePosition(),this.clonePosition())):{val:i,err:null}}tryParseDecimalInteger(e,t){let r=1;const n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);let a=!1,i=0;for(;!this.isEOF();){const e=this.char();if(!(e>=48&&e<=57))break;a=!0,i=10*i+(e-48),this.bump()}const s=Or(n,this.clonePosition());return a?(i*=r,Number.isSafeInteger(i)?{val:i,err:null}:this.error(t,s)):this.error(e,s)}offset(){return this.position.offset}isEOF(){return this.offset()===this.message.length}clonePosition(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}}char(){const e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");const t=this.message.codePointAt(e);if(void 0===t)throw Error(`Offset ${e} is at invalid UTF-16 code unit boundary`);return t}error(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}}bump(){if(this.isEOF())return;const e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}bumpIf(e){if(this.message.startsWith(e,this.offset())){for(let t=0;t<e.length;t++)this.bump();return!0}return!1}bumpUntil(e){const t=this.offset(),r=this.message.indexOf(e,t);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)}bumpTo(e){if(this.offset()>e)throw Error(`targetOffset ${e} must be greater than or equal to the current offset ${this.offset()}`);for(e=Math.min(e,this.message.length);;){const t=this.offset();if(t===e)break;if(t>e)throw Error(`targetOffset ${e} is at invalid UTF-16 code unit boundary`);if(this.bump(),this.isEOF())break}}bumpSpace(){for(;!this.isEOF()&&qr(this.char());)this.bump()}peek(){if(this.isEOF())return null;const e=this.char(),t=this.offset();return this.message.charCodeAt(t+(e>=65536?2:1))??null}}function $r(e){return e>=97&&e<=122||e>=65&&e<=90}function Kr(e){return 45===e||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function qr(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Zr(e){e.forEach(e=>{if(delete e.location,Nr(e)||Cr(e))for(const t in e.options)delete e.options[t].location,Zr(e.options[t].value);else Sr(e)&&Pr(e.style)||(kr(e)||Er(e))&&Tr(e.style)?delete e.style.location:_r(e)&&Zr(e.children)})}function Jr(e,t={}){t={shouldParseSkeletons:!0,requiresOtherClause:!0,...t};const r=new Gr(e,t).parse();if(r.err){const e=SyntaxError(Rr[r.err.kind]);throw e.location=r.err.location,e.originalMessage=r.err.message,e}return t?.captureLocation||Zr(r.val),r.val}let Yr=function(e){return e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API",e}({});class Xr extends Error{code;originalMessage;constructor(e,t,r){super(e),this.code=t,this.originalMessage=r}toString(){return`[formatjs Error: ${this.code}] ${this.message}`}}class Qr extends Xr{constructor(e,t,r,n){super(`Invalid values for "${e}": "${t}". Options are "${Object.keys(r).join('", "')}"`,Yr.INVALID_VALUE,n)}}class en extends Xr{constructor(e,t,r){super(`Value for "${e}" must be of type ${t}`,Yr.INVALID_VALUE,r)}}class tn extends Xr{constructor(e,t){super(`The intl string context variable "${e}" was not provided to the string "${t}"`,Yr.MISSING_VALUE,t)}}let rn=function(e){return e[e.literal=0]="literal",e[e.object=1]="object",e}({});function nn(e){return"function"==typeof e}function an(e,t,r,n,a,i,s){if(1===e.length&&wr(e[0]))return[{type:rn.literal,value:e[0].value}];const o=[];for(const c of e){if(wr(c)){o.push({type:rn.literal,value:c.value});continue}if(Ar(c)){"number"==typeof i&&o.push({type:rn.literal,value:r.getNumberFormat(t).format(i)});continue}const{value:e}=c;if(!a||!(e in a))throw new tn(e,s);let l=a[e];if(xr(c))l&&"string"!=typeof l&&"number"!=typeof l&&"bigint"!=typeof l||(l="string"==typeof l||"number"==typeof l||"bigint"==typeof l?String(l):""),o.push({type:"string"==typeof l?rn.literal:rn.object,value:l});else{if(kr(c)){const e="string"==typeof c.style?n.date[c.style]:Tr(c.style)?c.style.parsedOptions:void 0;o.push({type:rn.literal,value:r.getDateTimeFormat(t,e).format(l)});continue}if(Er(c)){const e="string"==typeof c.style?n.time[c.style]:Tr(c.style)?c.style.parsedOptions:n.time.medium;o.push({type:rn.literal,value:r.getDateTimeFormat(t,e).format(l)});continue}if(Sr(c)){const e="string"==typeof c.style?n.number[c.style]:Pr(c.style)?c.style.parsedOptions:void 0;if(e&&e.scale){const t=e.scale||1;if("bigint"==typeof l){if(!Number.isInteger(t))throw new TypeError(`Cannot apply fractional scale ${t} to bigint value. Scale must be an integer when formatting bigint.`);l*=BigInt(t)}else l*=t}o.push({type:rn.literal,value:r.getNumberFormat(t,e).format(l)});continue}if(_r(c)){const{children:e,value:l}=c,u=a[l];if(!nn(u))throw new en(l,"function",s);let d=u(an(e,t,r,n,a,i).map(e=>e.value));Array.isArray(d)||(d=[d]),o.push(...d.map(e=>({type:"string"==typeof e?rn.literal:rn.object,value:e})))}if(Nr(c)){const e=l,i=(Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0)||c.options.other;if(!i)throw new Qr(c.value,l,Object.keys(c.options),s);o.push(...an(i.value,t,r,n,a));continue}if(Cr(c)){const e=`=${l}`;let i=Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0;if(!i){if(!Intl.PluralRules)throw new Xr('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Yr.MISSING_INTL_API,s);const e="bigint"==typeof l?Number(l):l,n=r.getPluralRules(t,{type:c.pluralType}).select(e-(c.offset||0));i=(Object.prototype.hasOwnProperty.call(c.options,n)?c.options[n]:void 0)||c.options.other}if(!i)throw new Qr(c.value,l,Object.keys(c.options),s);const u="bigint"==typeof l?Number(l):l;o.push(...an(i.value,t,r,n,a,u-(c.offset||0)));continue}}}return(c=o).length<2?c:c.reduce((e,t)=>{const r=e[e.length-1];return r&&r.type===rn.literal&&t.type===rn.literal?r.value+=t.value:e.push(t),e},[]);var c}function sn(e,t){return t?Object.keys(e).reduce((r,n)=>{var a,i;return r[n]=(a=e[n],(i=t[n])?{...a,...i,...Object.keys(a).reduce((e,t)=>(e[t]={...a[t],...i[t]},e),{})}:a),r},{...e}):e}function on(e){return{create:()=>({get:t=>e[t],set(t,r){e[t]=r}})}}class cn{ast;locales;resolvedLocale;formatters;formats;message;formatterCache={number:{},dateTime:{},pluralRules:{}};constructor(e,t=cn.defaultLocale,r,n){if(this.locales=t,this.resolvedLocale=cn.resolveLocale(t),"string"==typeof e){if(this.message=e,!cn.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");const{...t}=n||{};this.ast=cn.__parse(e,{...t,locale:this.resolvedLocale})}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=sn(cn.formats,r),this.formatters=n&&n.formatters||function(e={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:Jt((...e)=>new Intl.NumberFormat(...e),{cache:on(e.number),strategy:ar.variadic}),getDateTimeFormat:Jt((...e)=>new Intl.DateTimeFormat(...e),{cache:on(e.dateTime),strategy:ar.variadic}),getPluralRules:Jt((...e)=>new Intl.PluralRules(...e),{cache:on(e.pluralRules),strategy:ar.variadic})}}(this.formatterCache)}format=e=>{const t=this.formatToParts(e);if(1===t.length)return t[0].value;const r=t.reduce((e,t)=>(e.length&&t.type===rn.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e),[]);return r.length<=1?r[0]||"":r};formatToParts=e=>an(this.ast,this.locales,this.formatters,this.formats,e,void 0,this.message);resolvedOptions=()=>({locale:this.resolvedLocale?.toString()||Intl.NumberFormat.supportedLocalesOf(this.locales)[0]});getAst=()=>this.ast;static memoizedDefaultLocale=null;static get defaultLocale(){return cn.memoizedDefaultLocale||(cn.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),cn.memoizedDefaultLocale}static resolveLocale=e=>{if(void 0===Intl.Locale)return;const t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])};static __parse=Jr;static formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}}}const ln={settings:{titles:{profile:"Account",general:"Workspace Settings",users:"Workspace Members",subscription:"Plan & Billing",usage:"Usage",features:"Workspace Features",notifications:"Notifications",permissions:"Permissions",danger:"Danger Zone"},sidebar:{account:"Account",workspace:"Workspace",profile:"Account",general:"Settings",users:"Members",subscription:"Plan & Billing",usage:"Usage",features:"Features",notifications:"Notifications",permissions:"Permissions",danger:"Danger Zone"},common:{refresh:"Refresh",refreshing:"Refreshing...",retry:"Retry",retrying:"Retrying...",save:"Save",saving:"Saving...",cancel:"Cancel",delete:"Delete",dismiss:"Dismiss",loading:"Loading...",success:"Success!",error:"Error",refreshAction:"{loading, select, true {Refreshing...} other {Refresh}}",retryAction:"{loading, select, true {Retrying...} other {Retry}}"}},subscription:{managePlan:"Manage your plan and billing",changePlan:"Change Plan",viewPricingPlans:"View Pricing Plans",viewPlans:"View Plans",upgradePlan:"Upgrade Now",subscribe:"Subscribe",currentPlan:"Current Plan",noSubscription:"You don't have an active subscription",choosePlan:"Choose Your Plan",choosePlanDescription:"Compare plans and select the one that fits your needs",forWorkspace:"for {name}",planUpdateAvailable:"Plan update available",updateSuccess:"Subscription updated successfully!",updateFailed:"Update failed",cancelTitle:"Cancel Subscription",cancelConfirm:"Are you sure you want to cancel your subscription?",cancelKeep:"Keep Subscription",cancelButton:"Yes, Cancel Subscription",canceling:"Canceling...",cancelSuccess:"Subscription will be canceled at the end of the billing period.",cancelNotCharged:"You won't be charged again after cancellation",cancelResumeAnytime:"You can resume your subscription anytime before it ends",cancelTrialTitle:"Cancel Trial",cancelTrialConfirm:"Are you sure you want to cancel your trial?",cancelTrialAccess:"Your trial will continue until",cancelTrialNoCharge:"You won't be charged — your trial will simply expire",cancelTrialResume:"You can resume your trial anytime before it ends",cancelTrialKeep:"Keep Trial",cancelTrialButton:"Yes, Cancel Trial",resumeTitle:"Resume Subscription",resumeTrial:"Resume Trial",resumeConfirm:"Are you sure you want to resume your subscription?",resumeKeep:"Keep Canceled",resumeButton:"Yes, Resume Subscription",resuming:"Resuming...",resumeSuccess:"Subscription has been resumed.",managePayment:"Manage Payment",openingPortal:"Opening...",viewAllPlans:"View All Plans",scheduledCancellation:"Subscription scheduled for cancellation",scheduledTrialCancellation:"Trial scheduled for cancellation",paymentPastDue:"Payment past due",paymentPastDueDescription:"Please update your payment method to avoid service interruption.",subscriptionPaused:"Subscription paused",subscriptionPausedDescription:"Your subscription is currently paused. Resume to restore full access.",errorLoading:"Error loading subscription data",errorLoadingDescription:"Please check your connection and try again.",errorProcessing:"Failed to process subscription",errorCanceling:"Failed to cancel subscription",errorResuming:"Failed to resume subscription",invalidWorkspace:"Invalid workspace ID",billingInterval:{monthly:"Monthly",quarterly:"Quarterly",yearly:"Yearly",perMonth:"/month",perQuarter:"/quarter",perYear:"/year"},seats:{title:"Seats",members:"Members",included:"Included",billable:"Billable",perExtraSeat:"Per extra seat",limit:"Limit",includedSeats:"Included seats",maxSeats:"Max seats",freeWithBase:"Free with base price",allIncluded:"All included",extra:"extra",unlimited:"Unlimited"},items:{features:"Features",limits:"Limits",quotas:"Usage Quotas"},checkout:{upgrade:"Upgrade",downgrade:"Downgrade",switchTo:"Switch to",select:"Select"},status:{active:"Active",canceling:"Canceling",trial:"Trial",canceled:"Canceled",pastDue:"Past Due",paused:"Paused",deprecated:"Deprecated",unknown:"Unknown"},plan:"Plan",invoicesTab:"Invoices",changePlanButton:"Change Plan",noPlanAssigned:"No plan assigned",free:"Free",perSeatDisplay:"+ {price}/seat{interval}",estTotalDisplay:"Est. total: {total}{interval} ({count, plural, one {# extra seat} other {# extra seats}})",nextBillingDisplay:"Next billing: {date}",membersInWorkspace:"{count, plural, one {# member} other {# members}} in workspace",billingInCurrency:"Billing in {currency}",savingsPercent:"Save {percent, number}%",switchToInterval:"Switch to {interval}",seatPriceDisplay:"+ {price}/seat{interval} ({included} {includedLabel})",trialEnded:"Your trial has ended.",trialEndsIn:"Your trial ends in {days, plural, one {# day} other {# days}}.",onTrial:"You are on a trial.",upgradeToKeepAccess:"Upgrade to keep access.",viewInvoices:"View Invoices",cancelTrial:"Cancel Trial",dunningFinal:"Final warning: Subscription will be suspended",dunningSuspended:"Subscription suspended",dunningRecovery:"Payment recovery in progress",dunningSuspendedDescription:"Your subscription has been suspended due to repeated payment failures. Update your payment method to restore access.",dunningRecoveryDescription:"We were unable to process your payment. Please update your payment method to avoid losing access.",cancelEndDescription:"Your subscription will end on",trialEndDescription:"Your trial will end on",cancelEndFallback:"Your subscription will be canceled at the end of the current billing period. You won't be charged again.",resumeChargeDate:"You will be charged again on",resumeChargeFallback:"the next billing date",resumeContinue:"Your subscription will continue automatically and you'll be billed according to your plan",resumeCancelAnytime:"You can cancel anytime before the next billing date if you change your mind",retainAccess:"You'll retain full access to this plan until",retainAccessFallback:"the end of your current billing period",noPlansAvailable:"No plan groups are available for this workspace. Please contact support if you believe this is an error.",noPlansAvailableHint:"No plan groups are available for this workspace.",startTrialDescription:"Try the full plan with no commitment. You can upgrade or cancel anytime.",noSubscriptionDescription:"Choose a plan to get started with your workspace",startFreeTrial:"Start Free Trial",startTrialDays:"Start {days}-day Free Trial",trialBadge:"{days}-day trial"},users:{title:"Workspace Members",adminOnly:"Only workspace admin can manage users and roles.",inviteByEmail:"Invite member by email",inviteButton:"Invite",inviting:"Inviting...",inviteSuccess:"User invited successfully",emailRequired:"Email is required",invalidEmail:"Invalid email address format",inviteFailed:"Failed to invite member",seatLimitReached:"Seat limit reached",memberLimitReached:"Member limit reached",role:"Role",you:"You",owner:"Owner",noMembers:"No members found in this workspace.",extraSeatCost:"Each additional member adds {price}/{interval, select, yearly {yr} quarterly {qtr} other {mo}} to your subscription",unknownUser:"Unknown User",seats:"Seats",members:"Members",included:"included",perExtraSeat:"/extra seat",maxMembers:"max members",available:"available",noMemberLimit:"No member limit",seatHeading:"{hasSeatPricing, select, true {Seats} other {Members}}",limitReached:"{reason, select, seat_limit_reached {Seat limit reached} other {Member limit reached}}",memberCount:"{count, plural, one {# member} other {# members}}",subscriptionRequired:"A subscription is required to invite members.",seatLimitMessage:"Your plan allows up to {maxUsers, number} members. Upgrade for more seats.",settingsLimitMessage:"This workspace allows up to {maxUsers, number} members.",memberLimitMessage:"Member limit of {maxUsers, number} reached.",selectRole:"Select a role",inviteAs:"Invite as {role}"},invoices:{title:"Billing History",description:"View and download your invoices",pay:"Pay",view:"View",viewDetails:"View Details",download:"PDF",errorLoading:"Error loading invoices",noInvoices:"No invoices yet. Subscribe to a plan to receive invoices.",noInvoicesWithSub:"No invoices with download option found",paidAmount:"Paid: {amount}",na:"N/A",status:{draft:"Draft",open:"Open",paid:"Paid",uncollectible:"Uncollectible",void:"Void"}},usage:{title:"Usage",description:"Monitor your resource consumption and quotas",totalResources:"Total Resources",overallUsage:"Overall Usage",inOverage:"In Overage",estOverageCost:"Est. Overage Cost",overageDetected:"Overage Detected",overageDescription:"Additional usage will be billed as overage on your next invoice.",overageUnits:"Overage units",rate:"Rate",billableBlocks:"Billable blocks",estimatedCharge:"Estimated charge",noData:"No quota usage data available for this workspace.",noDataHint:"Quotas will appear here once your plan includes metered resources.",used:"used",remaining:"remaining",overLimit:"over limit",percentUsed:"{percent, number}% used",availableRemaining:"{count} remaining",overLimitCount:"{count} over limit",overageWarning:"{count, plural, one {# resource has exceeded the included quota.} other {# resources have exceeded the included quota.}} Additional usage will be billed as overage on your next invoice.",fullyUsed:"Fully used",renewingSoon:"renewing soon",almostFull:"Almost full",overage:"Overage",errorLoading:"Failed to load usage data",perUnit:"/ unit",perUnits:"/ units",rateDisplay:"{rate} {unitSize, plural, =1 {/ unit} other {/ {unitSize, number} units}}",resourcesExceeded:"{count, plural, one {# resource has exceeded the included quota.} other {# resources have exceeded the included quota.}}",estOverageCharges:"Estimated overage charges this period: {amount}",overageRateDisplay:"Overage rate: {rate}",resetDateDisplay:"Usage resets on {date}",daysRemainingDisplay:"{count, plural, one {# day remaining} other {# days remaining}}"},profile:{email:"Email",name:"Name",language:"Language",country:"Country",currency:"Currency",timezone:"Timezone",profileImage:"Profile Image",success:"Profile saved successfully",nameMinLength:"Name must be at least 2 characters.",save:"Save",reset:"Reset"},general:{ownerOnly:"Only the workspace owner can change the workspace settings.",name:"Name",namePlaceholder:"My Awesome Workspace",nameMinLength:"Workspace name must be at least 2 characters.",billingCurrency:"Billing currency",icon:"Icon",iconDescription:"Choose an emoji or upload a custom image for your workspace.",imageUrl:"Image URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats.",previewLabel:"Preview:",success:"Workspace settings saved successfully",chooseEmoji:"Choose Emoji",customImageUrl:"Custom Image URL",updateWorkspace:"Update Workspace"},features:{title:"Workspace Features",ownerOnly:"Only the workspace owner can change the features.",noFeatures:"Workspace has no features to manage.",enabled:"enabled",disabled:"disabled",enabling:"Enabling",disabling:"Disabling",featureSuccess:"successfully",updateSuccess:"{feature} {enabled, select, true {enabled} other {disabled}} successfully",actionStatus:"{action, select, enabling {Enabling} disabling {Disabling} other {}}"},danger:{title:"Delete Workspace",adminOnly:"Only workspace admins can delete workspaces.",deleteWorkspace:"Delete Workspace",deleteConfirm:"Are you absolutely sure?",deleteWarning:"This action cannot be undone. This will permanently delete the workspace and all associated data.",deleting:"Deleting...",deleteDescription:"Once you delete a workspace, there is no going back. This will permanently delete the workspace and all of its data, including members, settings, and features.",deleteConfirmDescription:"This action cannot be undone. This will permanently delete the workspace and all of its data.",failedToDelete:"Failed to delete workspace"},notifications:{title:"Notification Preferences",permissionDenied:"Notification permission denied",notSupported:"Push notifications are not supported in this browser.",manageDescription:"Manage how you receive notifications from this workspace.",blocked:"Notifications Blocked",blockedDescription:"You previously blocked notifications for this site. To enable them, update your browser settings:",pushTitle:"Push Notifications",pushEnabledDescription:"You will receive browser notifications for important updates.",pushDisabledDescription:"Get notified about payment issues, trial expiry, and other important updates.",enabling:"Enabling...",disabling:"Disabling...",enable:"Enable",disable:"Disable",toggleAction:"{loading, select, true {{subscribed, select, true {Disabling...} other {Enabling...}}} other {{subscribed, select, true {Disable} other {Enable}}}}",pushDescription:"{subscribed, select, true {You will receive browser notifications for important updates.} other {Get notified about payment issues, trial expiry, and other important updates.}}",deviceNote:"Notifications are sent to this device. Enable on other devices separately.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"Click the lock icon (or shield icon) in the address bar",step2:'Find "Notifications" in the permissions list',step3:'Change from "Blocked" to "Allow"',step4:"Reload this page"},safari:{step1:"Open Safari → Settings → Websites → Notifications",step2:"Find this website in the list",step3:'Change from "Deny" to "Allow"',step4:"Reload this page"},edge:{step1:"Click the lock icon in the address bar",step2:'Click "Permissions for this site"',step3:'Set "Notifications" to "Allow"',step4:"Reload this page"},chrome:{step1:"Click the lock icon (or tune icon) in the address bar",step2:'Click "Site settings"',step3:'Set "Notifications" to "Allow"',step4:"Reload this page"}}},quota:{includedOnly:"{count, number} included",includedWithOverage:"{count, number} included, then {price} / {unit}",includedHardLimit:"{count, number} included (hard limit)",unitFallback:"unit"},pricing:{title:"Choose Your Plan",description:"Compare plans and select the one that fits your needs",currency:"Currency",billingIn:"Billing in",noPlansCurrency:"No plans available for your billing currency.",noPlansCurrencyHint:"Something went wrong. Please contact support.",noPlans:"No plans available",free:"Free",included:"included",save:"Save",current:"Current",processing:"Processing...",unavailable:"Unavailable",selectCurrency:"Select billing currency",billingInterval:"Billing interval"},beta:{nameLabel:"Name",emailLabel:"Email",submitText:"Submit",submittingText:"Submitting...",errorMessage:"An error occurred",tryAgain:"Try Again",privacyConsent:"By submitting this form, you consent to our",privacyPolicy:"Privacy Policy",and:"and",termsOfService:"Terms of Service"},workspace:{switchTitle:"Switch Workspace",switchDescription:"Select a workspace to switch to or create a new one.",notLoggedIn:"Looks like you are not logged in. Please login to continue.",availableWorkspaces:"Available Workspaces ({count, number})",loadingWorkspaces:"Loading workspaces...",searchPlaceholder:"Search workspaces...",noWorkspacesFound:"No workspaces found",noWorkspacesAvailable:"No workspaces available",switchTo:"Switch to",membersCount:"{count, plural, one {# member} other {# members}}",createNew:"Create New Workspace",createTitle:"Create New Workspace",createDescription:"Create a new workspace to get started.",workspaceName:"Workspace Name",workspaceNamePlaceholder:"My Awesome Workspace",workspaceNameMinLength:"Workspace name must be at least 2 characters.",workspaceIcon:"Workspace Icon",iconDescription:"Choose an emoji or upload a custom image for your workspace.",chooseEmoji:"Choose Emoji",customImageUrl:"Custom Image URL",imageUrl:"Image URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats.",invalidUrl:"Please enter a valid URL",creating:"Creating...",createWorkspace:"Create Workspace"},dropdowns:{search:"Search...",chooseOption:"Choose option",chooseCountry:"Choose country",searchCountry:"Choose country...",chooseLanguage:"Choose language",searchLanguage:"Choose language...",chooseCurrency:"Choose currency",searchCurrency:"Choose currency...",chooseTimezone:"Choose timezone",searchTimezone:"Choose timezone..."},push:{failedToSubscribe:"Failed to subscribe to push notifications",failedToUnsubscribe:"Failed to unsubscribe from push notifications"},permissions:{title:"Permissions",description:"Permissions assigned to each role in this workspace.",ownerOnly:"Only the workspace owner can manage permissions.",save:"Save Permissions",saving:"Saving...",saveSuccess:"Permissions saved successfully"},errors:{networkError:"Network error: Please check your internet connection",unauthorized:"Unauthorized - Please check your session",notFound:"Resource not found",generic:"An error occurred",fetchPlans:"Failed to fetch plans",fetchPlanGroup:"Failed to fetch plan group",fetchPlanGroupVersion:"Failed to fetch plan group version",fetchPlanGroupVersions:"Failed to fetch plan group versions",fetchSubscription:"Failed to fetch subscription",createCheckout:"Failed to create checkout session",updateSubscription:"Failed to update subscription",fetchInvoices:"Failed to fetch invoices",fetchInvoice:"Failed to fetch invoice",openBillingPortal:"Failed to open billing portal",cancelSubscription:"Failed to cancel subscription",resumeSubscription:"Failed to resume subscription",recordUsage:"Failed to record usage",fetchQuotaUsage:"Failed to fetch quota usage status",fetchAllQuotaUsage:"Failed to fetch all quota usage",fetchUsageLogs:"Failed to fetch usage logs"}},un={en:async()=>ln,es:async()=>(await Promise.resolve().then(function(){return IN})).es,fr:async()=>(await Promise.resolve().then(function(){return UN})).fr,de:async()=>(await Promise.resolve().then(function(){return MN})).de,ja:async()=>(await Promise.resolve().then(function(){return LN})).ja,zh:async()=>(await Promise.resolve().then(function(){return ON})).zh,hi:async()=>(await Promise.resolve().then(function(){return zN})).hi,ar:async()=>(await Promise.resolve().then(function(){return FN})).ar},dn=["en","es","fr","de","ja","zh","hi","ar"];const pn={hi:"hi-u-nu-deva",ar:"ar-u-nu-arab"};const mn=c({messages:ln,locale:"en",formattingLocale:"en"});function hn({locale:e="en",children:t}){const r=function(e){const t=e.toLowerCase().replace("_","-");if(dn.includes(t))return t;const r=t.split("-")[0];return dn.includes(r)?r:"en"}(e),[n,i]=a.useState(ln);a.useEffect(()=>{if("en"===r)return void i(ln);let e=!1;const t=un[r];return t&&t().then(t=>{e||i(t)}),()=>{e=!0}},[r]);const s=function(e){return pn[e]??e}(r),c=o(()=>({messages:n,locale:r,formattingLocale:s}),[n,r,s]);return a.createElement(mn.Provider,{value:c},t)}const fn=new Map,gn=new Map,bn=new Map;function vn(e,t){return t?`${e}:${JSON.stringify(t)}`:e}const yn={getNumberFormat(e,t){const r=vn(e,t);let n=fn.get(r);return n||(n=new Intl.NumberFormat(e,t),fn.set(r,n)),n},getDateTimeFormat(e,t){const r=vn(e,t);let n=gn.get(r);return n||(n=new Intl.DateTimeFormat(e,t),gn.set(r,n)),n},getPluralRules(e,t){const r=vn(e,t);let n=bn.get(r);return n||(n=new Intl.PluralRules(e,t),bn.set(r,n)),n}},wn=new Map;function xn(){const{messages:e,locale:t,formattingLocale:r}=u(mn),n=o(()=>(t,n)=>{const a=t.split(".");let i=e;for(const e of a){if(!i||"object"!=typeof i||!(e in i))return t;i=i[e]}const s="string"==typeof i?i:t;if(!n)return s;try{const e=function(e,t){const r=`${t}:${e}`;let n=wn.get(r);return n||(n=new cn(e,t,void 0,{formatters:yn}),wn.set(r,n)),n}(s,r),t=e.format(n);return"string"==typeof t?t:String(t)}catch{return s.replace(/\{(\w+)\}/g,(e,t)=>String(n[t]??`{${t}}`))}},[e,r]),a="ar"===t?"rtl":"ltr",i=o(()=>e=>e.toLocaleString(r),[r]),s=o(()=>(e,t)=>{const n=(t??"").trim().toUpperCase();if(!n)return(e/100).toLocaleString(r,{minimumFractionDigits:2});try{return new Intl.NumberFormat(r,{style:"currency",currency:n,minimumFractionDigits:2}).format(e/100)}catch{return(e/100).toLocaleString(r,{minimumFractionDigits:2})}},[r]);return{t:n,locale:t,formattingLocale:r,dir:a,fmtNum:i,fmtCents:s,messages:e}}function Sn(e){if("undefined"==typeof window)return null;try{return localStorage.getItem(e)}catch(t){return Ke(t,{component:"storage",action:"getStorageItem",metadata:{key:e}}),null}}function kn(e,t){if("undefined"!=typeof window)try{localStorage.setItem(e,t)}catch(t){Ke(t,{component:"storage",action:"setStorageItem",metadata:{key:e}})}}function En(e){if("undefined"!=typeof window)try{localStorage.removeItem(e)}catch(t){Ke(t,{component:"storage",action:"removeStorageItem",metadata:{key:e}})}}const Nn="saas-session-id",Cn="code";function An(e){kn(Nn,e)}function _n(){return function(){if("undefined"==typeof window)return null;try{return Sn(Nn)}catch(e){return Ke(e,{component:"auth-utils",action:"getSessionId",metadata:{key:Nn}}),null}}()}function Pn(){if("undefined"==typeof window)return null;try{return new URLSearchParams(window.location.search).get(Cn)}catch(e){return Ke(e,{component:"auth-utils",action:"getTokenFromUrl",metadata:{param:Cn}}),null}}const Tn="SDK is not ready (missing serverUrl, version, or orgId)";class Rn{constructor(e){this.serverUrl=e.serverUrl,this.version=e.version,this.orgId=e.orgId,this.requireOrgId=e.requireOrgId??!1,this.basePath=e.basePath??"public",this._sessionId=e.sessionId,this._timeout=e.timeout??3e4,this._maxRetries=e.maxRetries??0,this._debug=e.debug??!1,this._customHeaders=e.headers??{},this._onError=e.onError,this._fetch=e.fetch??globalThis.fetch}ensureReady(){if(!this.serverUrl?.trim()||!this.version)throw new Error(Tn);if(this.requireOrgId&&!this.orgId?.trim())throw new Error(Tn)}get baseUrl(){return this.ensureReady(),`${this.serverUrl}/api/${this.version}/${this.basePath}`}getAuthHeaders(){return this._sessionId?{"x-session-id":this._sessionId}:function(){const e=_n(),t={};return e&&(t["x-session-id"]=e),t}()}url(e){const t=e.startsWith("/")?e.slice(1):e;return`${this.baseUrl.endsWith("/")?this.baseUrl.slice(0,-1):this.baseUrl}/${t}`}buildHeaders(e){const t={...this._customHeaders,...this.getAuthHeaders()};return e.headers&&Object.assign(t,e.headers),null==e.body||t["Content-Type"]||(t["Content-Type"]="application/json"),t}async executeFetch(e,t){const r=this.url(e),n=(t.method??"GET").toUpperCase(),a=this.buildHeaders(t),i={...t,headers:a};let s;if(this._timeout>0){const e=new AbortController;s=setTimeout(()=>e.abort(),this._timeout),i.signal=t.signal?AbortSignal.any([t.signal,e.signal]):e.signal}const o=async t=>{try{const e=this._fetch.bind(globalThis),a=await e(r,i);if(this._debug&&console.log(`[BuildBase] ${n} ${r} → ${a.status}`),a.status>=500&&t<this._maxRetries){const e=Math.min(1e3*Math.pow(2,t),1e4);return this._debug&&console.log(`[BuildBase] Retrying in ${e}ms (attempt ${t+1}/${this._maxRetries})`),await new Promise(t=>setTimeout(t,e)),o(t+1)}return a}catch(r){if(r instanceof Error&&"AbortError"===r.name){if(void 0!==s){const t=new Error(`Request timeout after ${this._timeout}ms: ${n} ${e}`);throw this._onError?.(t,{method:n,path:e}),t}throw r}if(t<this._maxRetries){const e=Math.min(1e3*Math.pow(2,t),1e4);return this._debug&&console.log(`[BuildBase] Network error, retrying in ${e}ms (attempt ${t+1}/${this._maxRetries})`),await new Promise(t=>setTimeout(t,e)),o(t+1)}throw r instanceof Error&&this._onError?.(r,{method:n,path:e}),r}};try{return await o(0)}finally{void 0!==s&&clearTimeout(s)}}async fetchJson(e,t={},r="Request failed"){this.ensureReady();try{const n=await this.executeFetch(e,t);return await He(n,r)}catch(r){throw r instanceof Error&&this._onError?.(r,{method:(t.method??"GET").toUpperCase(),path:e}),r}}async fetchResponse(e,t={}){return this.ensureReady(),this.executeFetch(e,t)}}class Dn extends Rn{constructor(e){super({...e,requireOrgId:!0})}async getWorkspaces(){return this.fetchJson("workspaces",{},"Failed to fetch workspaces")}async createWorkspace(e){return this.fetchJson("workspaces",{method:"POST",body:JSON.stringify(e)},"Failed to create workspace")}async updateWorkspace(e,t){return this.fetchJson(`workspaces/${e}`,{method:"PUT",body:JSON.stringify(t)},"Failed to update workspace")}async deleteWorkspace(e){return this.fetchJson(`workspaces/${e}`,{method:"DELETE"},"Failed to delete workspace")}async getWorkspaceUsers(e){return this.fetchJson(`workspaces/${e}/users`,{},"Failed to fetch workspace users")}async addUser(e,t){return this.fetchJson(`workspaces/${e}/users/add`,{method:"POST",body:JSON.stringify(t)},"Failed to invite member")}async removeUser(e,t){return this.fetchJson(`workspaces/${e}/users/${t}`,{method:"DELETE"},"Failed to remove user")}async updateUser(e,t,r){return this.fetchJson(`workspaces/${e}/users/${t}`,{method:"PATCH",body:JSON.stringify(r)},"Failed to update user")}async updateSettings(e){return this.fetchJson("workspaces/settings",{method:"PATCH",body:JSON.stringify(e)},"Failed to update workspace settings")}async updateWorkspacePermissions(e,t){return this.fetchJson(`workspaces/${e}/permissions`,{method:"PATCH",body:JSON.stringify({permissions:t})},"Failed to update workspace permissions")}async getFeatures(){return this.fetchJson("workspaces/features",{},"Failed to fetch features")}async updateFeature(e,t,r){return this.fetchJson(`workspaces/${e}/features`,{method:"PATCH",body:JSON.stringify({features:{[t]:r}})},"Failed to update feature")}async getWorkspace(e){return this.fetchJson(`workspaces/${e}`,{},"Failed to fetch workspace")}async getProfile(){return this.fetchJson("profile",{},"Failed to fetch profile")}async updateUserProfile(e){return this.fetchJson("profile",{method:"PATCH",body:JSON.stringify(e)},"Failed to update user profile")}async getCurrentSubscription(e){const t=await this.fetchResponse(`workspaces/${e}/subscription`);if(!t.ok){let e="Failed to fetch subscription";try{e=(await t.json()).message||e}catch{e=404===t.status?"Workspace not found or no subscription available":401===t.status?"Unauthorized - Please check your session":`Failed to fetch subscription (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to fetch subscription");return r.data||r}return r}async getPlanGroup(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/plan-group`);if(!t.ok){let e="Failed to fetch plan group";try{e=(await t.json()).message||e}catch{e=404===t.status?"No plan group found for this workspace":401===t.status?"Unauthorized - Please check your session":`Failed to fetch plan group (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to fetch plan group");return r.data||r}return r}async getPlanGroupByVersion(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/plan-group?groupVersionId=${encodeURIComponent(t)}`);if(!r.ok){let e="Failed to fetch plan group version";try{e=(await r.json()).message||e}catch{e=404===r.status?"Plan group version not found":401===r.status?"Unauthorized - Please check your session":`Failed to fetch plan group version (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to fetch plan group version");return n.data||n}return n}async getPlanGroupVersions(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/plan-group/versions`);if(!t.ok){let e="Failed to fetch plan group versions";try{e=(await t.json()).message||e}catch{e=404===t.status?"No plan group versions found":401===t.status?"Unauthorized - Please check your session":`Failed to fetch plan group versions (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to fetch plan group versions");return r.data||r}return r}async getPublicPlans(e){if(!this.orgId)throw new Error("orgId is required for getPublicPlans");const t=await this.fetchResponse(`${this.orgId}/plans/${encodeURIComponent(e)}`);if(!t.ok){let r="Failed to fetch plans";try{r=(await t.json()).message||r}catch{r=404===t.status?`Plans "${e}" not found`:`Failed to fetch plans (${t.status}: ${t.statusText})`}throw new Error(r)}const r=await t.json();if(void 0!==r.success&&!r.success)throw new Error(r.message||"Failed to fetch plans");return r.data??r}async getPlanGroupVersion(e){const t=await this.fetchResponse(`plan-group-versions/${e}`);if(!t.ok){let e="Failed to fetch plan group version";try{e=(await t.json()).message||e}catch{e=404===t.status?"Plan group version not found":401===t.status?"Unauthorized - Please check your session":`Failed to fetch plan group version (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to fetch plan group version");return r.data||r}return r}async createCheckoutSession(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/checkout`,{method:"POST",body:JSON.stringify(t)});if(!r.ok){let e="Failed to create checkout session";try{e=(await r.json()).message||e}catch{e=`Failed to create checkout session (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to create checkout session");return n.data||n}return n}async selectFreePlan(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/select-free-plan`,{method:"POST",body:JSON.stringify({planVersionId:t})});if(!r.ok){let e="Failed to select free plan";try{e=(await r.json()).message||e}catch{e=`Failed to select free plan (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();return n.data||n}async updateSubscription(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription`,{method:"PATCH",body:JSON.stringify(t)});if(!r.ok){let e="Failed to update subscription";try{e=(await r.json()).message||e}catch{e=`Failed to update subscription (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to update subscription");return n.data?.checkoutUrl||n.checkoutUrl,n.data||n}return n.checkoutUrl,n}async createBillingPortalSession(e,t){return this.fetchJson(`workspaces/${e}/subscription/billing-portal`,{method:"POST",body:JSON.stringify(t?{returnUrl:t}:{})})}async listInvoices(e,t=10,r){const n=new URLSearchParams;n.append("limit",t.toString()),r&&n.append("starting_after",r);const a=await this.fetchResponse(`workspaces/${e}/subscription/invoices?${n.toString()}`,{});if(!a.ok){let e="Failed to fetch invoices";try{e=(await a.json()).message||e}catch{e=404===a.status?"Workspace not found or no invoices available":401===a.status?"Unauthorized - Please check your session":`Failed to fetch invoices (${a.status}: ${a.statusText})`}throw new Error(e)}const i=await a.json();if(void 0!==i.success){if(!i.success)throw new Error(i.message||"Failed to fetch invoices");return i}return i}async getInvoice(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/invoices/${t}`,{});if(!r.ok){let e="Failed to fetch invoice";try{e=(await r.json()).message||e}catch{e=404===r.status?"Invoice not found":401===r.status?"Unauthorized - Please check your session":`Failed to fetch invoice (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to fetch invoice");return n}return n}async cancelSubscriptionAtPeriodEnd(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/cancel-at-period-end`,{method:"POST"});if(!t.ok){let e="Failed to cancel subscription";try{e=(await t.json()).message||e}catch{e=404===t.status?"Subscription not found":401===t.status?"Unauthorized - Please check your session":`Failed to cancel subscription (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to cancel subscription");return r.data||r}return r}async resumeSubscription(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/resume`,{method:"POST"});if(!t.ok){let e="Failed to resume subscription";try{e=(await t.json()).message||e}catch{e=404===t.status?"Subscription not found":401===t.status?"Unauthorized - Please check your session":`Failed to resume subscription (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to resume subscription");return r.data||r}return r}async recordUsage(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/usage`,{method:"POST",body:JSON.stringify(t)});if(!r.ok){let e="Failed to record usage";try{e=(await r.json()).message||e}catch{e=`Failed to record usage (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to record usage");return n.data||n}return n}async recordUsageBatch(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/usage/batch`,{method:"POST",body:JSON.stringify(t)});if(!r.ok){let e="Failed to record batch usage";try{e=(await r.json()).message||e}catch{e=`Failed to record batch usage (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();return n.data||n}async getQuotaUsageStatus(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/usage/status?quotaSlug=${encodeURIComponent(t)}`);if(!r.ok){let e="Failed to fetch quota usage status";try{e=(await r.json()).message||e}catch{e=404===r.status?"Workspace not found or no subscription available":401===r.status?"Unauthorized - Please check your session":`Failed to fetch quota usage status (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to fetch quota usage status");return n.data||n}return n}async getAllQuotaUsage(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/usage/all`);if(!t.ok){let e="Failed to fetch all quota usage";try{e=(await t.json()).message||e}catch{e=404===t.status?"Workspace not found or no subscription available":401===t.status?"Unauthorized - Please check your session":`Failed to fetch all quota usage (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to fetch all quota usage");return r.data||r}return r}async getUsageLogs(e,t){const r=new URLSearchParams;t?.quotaSlug&&r.append("quotaSlug",t.quotaSlug),t?.from&&r.append("from",t.from),t?.to&&r.append("to",t.to),t?.source&&r.append("source",t.source),t?.page&&r.append("page",t.page.toString()),t?.limit&&r.append("limit",t.limit.toString());const n=r.toString(),a=`workspaces/${e}/subscription/usage/logs${n?`?${n}`:""}`,i=await this.fetchResponse(a);if(!i.ok){let e="Failed to fetch usage logs";try{e=(await i.json()).message||e}catch{e=404===i.status?"Workspace not found":401===i.status?"Unauthorized - Please check your session":`Failed to fetch usage logs (${i.status}: ${i.statusText})`}throw new Error(e)}const s=await i.json();if(void 0!==s.success){if(!s.success)throw new Error(s.message||"Failed to fetch usage logs");return s.data||s}return s}async sendNotification(e,t,r,n){const a={event:t};return r&&(a.userId=r),n&&(a.data=n),this.fetchJson(`workspaces/${e}/notifications/send`,{method:"POST",body:JSON.stringify(a)},"Failed to send notification")}async getNotificationEvents(e){return this.fetchJson(`workspaces/${e}/notification-events`,{},"Failed to fetch notification events")}async getNotificationPreferences(e){return(await this.fetchJson(`workspaces/${e}/notification-preferences`,{},"Failed to fetch notification preferences")).notificationPreferences??{}}async updateNotificationPreferences(e,t){return(await this.fetchJson(`workspaces/${e}/notification-preferences`,{method:"PATCH",body:JSON.stringify({notificationPreferences:t})},"Failed to update notification preferences")).notificationPreferences??{}}}function In(){const e=mt(),t=Et(),r=Vt();return o(()=>({auth:e,os:t,workspaces:r}),[e,t,r])}function Un(e,t){const r=kt(),n=pt(),a=Wt(),i=e||(e=>e);return tt(o(()=>({os:r,auth:n,workspaces:a}),[r,n,a]),i,t)}function Mn(e,t,r){d(()=>{const t=new AbortController;return e(t.signal).catch(e=>{We(e)||(r?.onError?r.onError(e):Ke(e,{component:"useAsyncEffect",action:"effect",metadata:{note:"Unhandled rejection - consider passing onError"}}))}),()=>t.abort()},t)}class Ln extends Rn{constructor(e){super({...e,requireOrgId:!0})}async getSettings(e){return this.fetchJson(`${this.orgId}/settings`,{signal:e},"Failed to fetch settings")}}function On(){return Un(e=>e.os)}let zn=null;function Fn(){const e=In(),t=On(),{serverUrl:r,version:n,orgId:a,settings:i}=t,s=o(()=>bt(t)?new Ln({serverUrl:r,version:n,orgId:a}):null,[r,n,a]),c=p(async t=>s?zn||(zn=(async()=>{try{const r=await s.getSettings(t);return e.os(ft(r)),r}catch(e){return qe(e,{component:"useSaaSSettings",action:"getSettings",metadata:{serverUrl:r,version:n,orgId:a}}),null}finally{zn=null}})(),zn):null,[s,e,r,n,a]);return Mn(async e=>{i||bt(t)&&await c(e)},[r,n,a],{onError:e=>qe(e,{component:"useSaaSSettings",action:"fetchSettings",metadata:{serverUrl:r,version:n,orgId:a}})}),o(()=>({settings:i,getSettings:c}),[i,c])}function Bn(){const e=On(),t=function(e){return o(()=>new Dn(e),[e.serverUrl,e.version,e.orgId])}(e);return o(()=>({os:e,api:t}),[e,t])}function Wn(e,t,r){return e instanceof Error?e.message:r(t)}const Vn=e=>{const{t:t}=xn(),{os:r,api:n}=Bn(),a=bt(r),[i,s]=m(null),[o,c]=m(!1),[l,u]=m(null),h=p(async()=>{if(e&&a){c(!0),u(null);try{const t=await n.getPublicPlans(e);s(t)}catch(r){const n=Wn(r,"errors.fetchPlans",t);u(n),Ke(r,{component:"usePublicPlans",action:"fetchPlans",metadata:{slug:e}})}finally{c(!1)}}else s(null)},[n,e,a]);d(()=>{h()},[h]);const f=e&&!a||o;return{items:i?.items??[],plans:i?.plans??[],notes:i?.notes,loading:f,error:l,refetch:h}},jn=e=>{const{t:t}=xn(),{api:r}=Bn(),[n,a]=m(null),[i,s]=m(!1),[o,c]=m(null),l=p(async()=>{if(e){s(!0),c(null);try{const t=await r.getPlanGroupVersion(e);a(t)}catch(r){const n=Wn(r,"errors.fetchPlanGroupVersion",t);c(n),Ke(r,{component:"usePublicPlanGroupVersion",action:"fetchVersion",metadata:{groupVersionId:e}})}finally{s(!1)}}else a(null)},[r,e]);return d(()=>{l()},[l]),{planGroupVersion:n,loading:i,error:o,refetch:l}},Hn=e=>{const{t:t}=xn(),{api:r}=Bn(),[n,a]=m(null),[i,s]=m(!1),[o,c]=m(null),l=p(async()=>{if(e){s(!0),c(null);try{const t=await r.getCurrentSubscription(e);a(t)}catch(r){const n=Wn(r,"errors.fetchSubscription",t);c(n),Ke(r,{component:"useSubscription",action:"fetchSubscription",metadata:{workspaceId:e}})}finally{s(!1)}}else a(null)},[r,e]);return d(()=>{l()},[l]),{subscription:n,loading:i,error:o,refetch:l}},Gn=(e,t)=>{const{t:r}=xn(),{api:n}=Bn(),[a,i]=m(null),[s,o]=m(!1),[c,l]=m(null),u=p(async()=>{if(e){o(!0),l(null);try{const r=t?await n.getPlanGroupByVersion(e,t):await n.getPlanGroup(e);i(r)}catch(n){const a=Wn(n,"errors.fetchPlanGroup",r);l(a),Ke(n,{component:"usePlanGroup",action:"fetchPlanGroup",metadata:{workspaceId:e,groupVersionId:t}})}finally{o(!1)}}else i(null)},[n,e,t]);return d(()=>{u()},[u]),{planGroup:a,loading:s,error:c,refetch:u}},$n=e=>{const{t:t}=xn(),{api:r}=Bn(),[n,a]=m(null),[i,s]=m(!1),[o,c]=m(null),l=p(async()=>{if(e){s(!0),c(null);try{const t=await r.getPlanGroupVersions(e);a(t)}catch(r){const n=Wn(r,"errors.fetchPlanGroupVersions",t);c(n),Ke(r,{component:"usePlanGroupVersions",action:"fetchVersions",metadata:{workspaceId:e}})}finally{s(!1)}}else a(null)},[r,e]);return d(()=>{l()},[l]),{versions:n,loading:i,error:o,refetch:l}},Kn=e=>{const{t:t}=xn(),{api:r}=Bn(),{getCheckoutStripeParams:n}=u(Ht),[a,i]=m(!1),[s,o]=m(null);return{createCheckoutSession:p(async a=>{if(!e)throw new Error("Workspace ID is required");i(!0),o(null);try{let t=a;if(n){const e=await n(a);e&&(t={...a,stripeOptions:{...a.stripeOptions,...e,metadata:{...a.stripeOptions?.metadata,...e.metadata},subscriptionMetadata:{...a.stripeOptions?.subscriptionMetadata,...e.subscriptionMetadata}}})}const i=await r.createCheckoutSession(e,t);return"trial_started"===i.type&&(Zt(),Kt()),i}catch(r){const n=Wn(r,"errors.createCheckout",t);throw o(n),Ke(r,{component:"useCreateCheckoutSession",action:"createCheckoutSession",metadata:{workspaceId:e,request:a}}),r}finally{i(!1)}},[r,e,n]),loading:a,error:s}},qn=e=>{const{t:t}=xn(),{api:r}=Bn(),[n,a]=m(!1),[i,s]=m(null),o=p(async(n,i)=>{if(!e)throw new Error("Workspace ID is required");a(!0),s(null);try{const t={planVersionId:n,...i?.billingInterval&&{billingInterval:i.billingInterval},...i?.successUrl&&{successUrl:i.successUrl},...i?.cancelUrl&&{cancelUrl:i.cancelUrl}},a=await r.updateSubscription(e,t);return Zt(),a}catch(r){const a=Wn(r,"errors.updateSubscription",t);throw s(a),Ke(r,{component:"useUpdateSubscription",action:"updateSubscription",metadata:{workspaceId:e,planVersionId:n,options:i}}),r}finally{a(!1)}},[r,e]);return{updateSubscription:o,loading:n,error:i}},Zn=(e,t)=>{const r=Hn(e),n=Gn(e,t),a=qn(e),i=p(async()=>{await Promise.all([r.refetch(),n.refetch()])},[r.refetch,n.refetch]);return{subscription:r.subscription,planGroup:n.planGroup,loading:r.loading||n.loading||a.loading,error:r.error||n.error||a.error,updateSubscription:a.updateSubscription,refetch:i}},Jn=(e,t=10,r)=>{const{t:n}=xn(),{api:a}=Bn(),[i,s]=m([]),[o,c]=m(!1),[l,u]=m(!1),[h,f]=m(null),g=p(async()=>{if(!e)return s([]),void c(!1);u(!0),f(null);try{const n=await a.listInvoices(e,t,r);s(n.invoices||[]),c(n.has_more||!1)}catch(a){const i=Wn(a,"errors.fetchInvoices",n);f(i),Ke(a,{component:"useInvoices",action:"fetchInvoices",metadata:{workspaceId:e,limit:t,startingAfter:r}})}finally{u(!1)}},[a,e,t,r]);return d(()=>{g()},[g]),{invoices:i,hasMore:o,loading:l,error:h,refetch:g}},Yn=e=>{const{t:t}=xn(),{api:r}=Bn(),[n,a]=m(!1),[i,s]=m(null);return{openBillingPortal:p(async n=>{if(!e)throw new Error("Workspace ID is required");a(!0),s(null);try{const t=n||window.location.href,a=await r.createBillingPortalSession(e,t);return a.url&&window.open(a.url,"_blank","noopener,noreferrer"),a}catch(r){const n=Wn(r,"errors.openBillingPortal",t);throw s(n),Ke(r,{component:"useBillingPortal",action:"openBillingPortal",metadata:{workspaceId:e}}),r}finally{a(!1)}},[e,r]),loading:n,error:i}},Xn=(e,t)=>{const{t:r}=xn(),{api:n}=Bn(),[a,i]=m(null),[s,o]=m(!1),[c,l]=m(null),u=p(async()=>{if(e&&t){o(!0),l(null);try{const r=await n.getInvoice(e,t);i(r.invoice)}catch(n){const a=Wn(n,"errors.fetchInvoice",r);l(a),Ke(n,{component:"useInvoice",action:"fetchInvoice",metadata:{workspaceId:e,invoiceId:t}})}finally{o(!1)}}else i(null)},[n,e,t]);return d(()=>{u()},[u]),{invoice:a,loading:s,error:c,refetch:u}},Qn=e=>{const{t:t}=xn(),{api:r}=Bn(),[n,a]=m(!1),[i,s]=m(null);return{cancelSubscription:p(async()=>{if(!e)throw new Error("Workspace ID is required");a(!0),s(null);try{const t=await r.cancelSubscriptionAtPeriodEnd(e);return Zt(),t}catch(r){const n=Wn(r,"errors.cancelSubscription",t);throw s(n),Ke(r,{component:"useCancelSubscription",action:"cancelSubscription",metadata:{workspaceId:e}}),r}finally{a(!1)}},[r,e]),loading:n,error:i}},ea=e=>{const{t:t}=xn(),{api:r}=Bn(),[n,a]=m(!1),[i,s]=m(null);return{resumeSubscription:p(async()=>{if(!e)throw new Error("Workspace ID is required");a(!0),s(null);try{const t=await r.resumeSubscription(e);return Zt(),t}catch(r){const n=Wn(r,"errors.resumeSubscription",t);throw s(n),Ke(r,{component:"useResumeSubscription",action:"resumeSubscription",metadata:{workspaceId:e}}),r}finally{a(!1)}},[r,e]),loading:n,error:i}},ta=e=>{const{t:t}=xn(),{api:r}=Bn(),[n,a]=m(!1),[i,s]=m(null);return{recordUsage:p(async n=>{if(!e)throw new Error("Workspace ID is required");a(!0),s(null);try{const t=await r.recordUsage(e,n);return Kt(),t}catch(r){const a=Wn(r,"errors.recordUsage",t);throw s(a),Ke(r,{component:"useRecordUsage",action:"recordUsage",metadata:{workspaceId:e,request:n}}),r}finally{a(!1)}},[r,e]),loading:n,error:i}},ra=(e,t)=>{const{t:r}=xn(),{api:n}=Bn(),[a,i]=m(null),[s,o]=m(!1),[c,l]=m(null),u=p(async()=>{if(e&&t){o(!0),l(null);try{const r=await n.getQuotaUsageStatus(e,t);i(r)}catch(n){const a=Wn(n,"errors.fetchQuotaUsage",r);l(a),Ke(n,{component:"useQuotaUsageStatus",action:"fetchStatus",metadata:{workspaceId:e,quotaSlug:t}})}finally{o(!1)}}else i(null)},[n,e,t]);return d(()=>{u()},[u]),{status:a,loading:s,error:c,refetch:u}},na=e=>{const{t:t}=xn(),{api:r}=Bn(),[n,a]=m(null),[i,s]=m(!1),[o,c]=m(null),l=p(async()=>{if(e){s(!0),c(null);try{const t=await r.getAllQuotaUsage(e);a(t.quotas)}catch(r){const n=Wn(r,"errors.fetchAllQuotaUsage",t);c(n),Ke(r,{component:"useAllQuotaUsage",action:"fetchAllUsage",metadata:{workspaceId:e}})}finally{s(!1)}}else a(null)},[r,e]);return d(()=>{l()},[l]),{quotas:n,loading:i,error:o,refetch:l}},aa=(e,t,r)=>{const{t:n}=xn(),{api:a}=Bn(),[i,s]=m([]),[o,c]=m(0),[l,u]=m(0),[h,f]=m(1),[g,b]=m(!1),[v,y]=m(!1),[w,x]=m(!1),[S,k]=m(null),E=r?.from,N=r?.to,C=r?.source,A=r?.page,_=r?.limit,P=p(async()=>{if(!e)return s([]),c(0),u(0),f(1),b(!1),void y(!1);x(!0),k(null);try{const r={...t&&{quotaSlug:t},...E&&{from:E},...N&&{to:N},...C&&{source:C},...A&&{page:A},..._&&{limit:_}},n=await a.getUsageLogs(e,r);s(n.docs||[]),c(n.totalDocs||0),u(n.totalPages||0),f(n.page||1),b(n.hasNextPage||!1),y(n.hasPrevPage||!1)}catch(r){const a=Wn(r,"errors.fetchUsageLogs",n);k(a),Ke(r,{component:"useUsageLogs",action:"fetchLogs",metadata:{workspaceId:e,quotaSlug:t}})}finally{x(!1)}},[a,e,t,E,N,C,A,_]);return d(()=>{P()},[P]),{logs:i,totalDocs:o,totalPages:l,page:h,hasNextPage:g,hasPrevPage:v,loading:w,error:S,refetch:P}},ia=c(null);ia.displayName="SubscriptionContext";const sa=a.memo(function({children:e}){const r=Un(e=>e.workspaces.currentWorkspace),{subscription:n,loading:a,error:i,refetch:s}=Hn(r?._id);d(()=>{return e=s,qt.add(e),()=>{qt.delete(e)};var e},[s]);const c=o(()=>({response:n,loading:a,error:i,refetch:s}),[n,a,i,s]);return t(ia.Provider,{value:c,children:e})});function oa(){const e=u(ia);if(null===e)throw new Error("useSubscriptionContext must be used within SubscriptionContextProvider. Make sure SubscriptionContextProvider is wrapping your application (or the tree that uses subscription gates).");return e}sa.displayName="SubscriptionContextProvider";const ca=c({appPermissions:void 0});function la({appPermissions:e,children:r}){const n=o(()=>({appPermissions:e}),[e]);return t(ca.Provider,{value:n,children:r})}function ua(){return u(ca)}const da={Monthly:"monthly",Yearly:"yearly",Quarterly:"quarterly"},pa="active",ma="trialing",ha="canceled",fa="past_due",ga="paused",ba="draft",va="open",ya="paid",wa="uncollectible",xa="void",Sa="feature",ka="limit",Ea="quota",Na="none",Ca="final",Aa="suspended";function _a(e,t){const r=e.pricingVariants;if(!r?.length)return null;const n=t.toLowerCase();return r.find(e=>e.currency?.toLowerCase()===n)??null}function Pa(e,t,r){const n=_a(e,t);if(!n?.basePricing)return null;const a=n.basePricing[r];return null!=a?a:null}function Ta(e,t,r,n){const a=_a(e,t),i=a?.quotaOverages?.[r];if(i)return i[n]}function Ra(e,t,r,n){const a=e.quotas?.[r];if(null==a)return null;const i=a[n];if(!i)return null;const s=Ta(e,t,r,n);return{included:i.included,...void 0!==i.unitSize&&{unitSize:i.unitSize},...void 0!==s&&{overage:s},allowOverage:!1!==a.allowOverage}}function Da(e,t){if(!e)return null;for(const r of t){const t=r.pricingVariants;if(t?.length)for(const r of t){const t=r.stripePrices;if(t){if(t.monthlyPriceId===e||t.monthly===e)return{interval:"monthly",currency:r.currency};if(t.yearlyPriceId===e||t.yearly===e)return{interval:"yearly",currency:r.currency};if(t.quarterlyPriceId===e)return{interval:"quarterly",currency:r.currency}}}}return null}function Ia(e,t){const r=_a(e,t);return r?.seatPricing?.enabled?r.seatPricing:null}function Ua(e,t,r){const n=Ia(e,t);return n?.perSeat?n.perSeat[r]??null:null}function Ma(e){const{planVersion:t,currency:r="usd",settingsMaxUsers:n}=e;if(t){const e=Ia(t,r);if(e)return{maxUsers:e.maxSeats??0,source:"seat_pricing",includedSeats:e.includedSeats??0,hasSeatPricing:!0}}return null!=n&&n>0?{maxUsers:n,source:"settings",includedSeats:0,hasSeatPricing:!1}:{maxUsers:0,source:"none",includedSeats:0,hasSeatPricing:!1}}function La(e){const{memberCount:t,maxUsersConfig:r,hasSubscription:n=!0,requireSubscription:a=!1}=e;if(a&&!n)return{canInvite:!1,blockReason:"no_subscription",blockMessageKey:"users.subscriptionRequired",blockMessageValues:{}};const{maxUsers:i,source:s}=r;if(i<=0)return{canInvite:!0,blockReason:null,blockMessageKey:null,blockMessageValues:null};if(t>=i){return{canInvite:!1,blockReason:{seat_pricing:"seat_limit_reached",settings:"settings_user_limit_reached"}[s]??"seat_limit_reached",blockMessageKey:{seat_pricing:"users.seatLimitMessage",settings:"users.settingsLimitMessage"}[s]??"users.memberLimitMessage",blockMessageValues:{maxUsers:i}}}return{canInvite:!0,blockReason:null,blockMessageKey:null,blockMessageValues:null}}const Oa="user:created",za="user:updated",Fa="workspace:changed",Ba="workspace:updated",Wa="workspace:user-added",Va="workspace:user-removed",ja="workspace:user-role-changed",Ha="workspace:created",Ga="workspace:deleted";const $a=new class{constructor(){this.callbacks=null}setCallbacks(e){this.callbacks=e}getCallbacks(){return this.callbacks}async emit(e,t){if(this.callbacks?.handleEvent)try{await this.callbacks.handleEvent(e,t)}catch(t){Ke(t,{component:"EventEmitter",action:"emit",metadata:{eventType:e}})}}async emitUserCreated(e){await this.emit(Oa,{user:e})}async emitUserUpdated(e,t){await this.emit(za,{user:e,previousUser:t})}async emitWorkspaceChanged(e,t){await this.emit(Fa,{workspace:e,previousWorkspace:t})}async emitWorkspaceUpdated(e){await this.emit(Ba,{workspace:e})}async emitWorkspaceUserAdded(e,t,r){await this.emit(Wa,{userId:e,workspace:t,role:r})}async emitWorkspaceUserRemoved(e,t,r){await this.emit(Va,{userId:e,workspace:t,role:r})}async emitWorkspaceUserRoleChanged(e,t,r,n){await this.emit(ja,{userId:e,workspace:t,previousRole:r,newRole:n})}async emitWorkspaceCreated(e){await this.emit(Ha,{workspace:e})}async emitWorkspaceDeleted(e){await this.emit(Ga,{workspace:e})}},Ka=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),qa=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},Za=(...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),Ja=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
2
+ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import*as n from"react";import a,{Component as i,useRef as s,useMemo as o,createContext as c,useReducer as l,useContext as d,useEffect as u,useCallback as p,useState as m,forwardRef as h,createElement as f,useLayoutEffect as g,Suspense as b,lazy as v}from"react";import*as y from"react-dom";import w from"react-dom";function x(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=x(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function k(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=x(e))&&(n&&(n+=" "),n+=t);return n}const S=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),C="-",N=[],E=e=>{const t=P(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return _(e);const r=e.split(C),n=""===r[0]&&r.length>1?1:0;return A(r,n,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=n[e],a=r[e];return t?a?((e,t)=>{const r=new Array(e.length+t.length);for(let t=0;t<e.length;t++)r[t]=e[t];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r})(a,t):t:a||N}return r[e]||N}}},A=(e,t,r)=>{if(0===e.length-t)return r.classGroupId;const n=e[t],a=r.nextPart.get(n);if(a){const r=A(e,t+1,a);if(r)return r}const i=r.validators;if(null===i)return;const s=0===t?e.join(C):e.slice(t).join(C),o=i.length;for(let e=0;e<o;e++){const t=i[e];if(t.validator(s))return t.classGroupId}},_=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?"arbitrary.."+n:void 0})(),P=e=>{const{theme:t,classGroups:r}=e;return T(r,t)},T=(e,t)=>{const r=S();for(const n in e){const a=e[n];R(a,r,n,t)}return r},R=(e,t,r,n)=>{const a=e.length;for(let i=0;i<a;i++){const a=e[i];D(a,t,r,n)}},D=(e,t,r,n)=>{"string"!=typeof e?"function"!=typeof e?U(e,t,r,n):M(e,t,r,n):I(e,t,r)},I=(e,t,r)=>{(""===e?t:L(t,e)).classGroupId=r},M=(e,t,r,n)=>{O(e)?R(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(r,e)))},U=(e,t,r,n)=>{const a=Object.entries(e),i=a.length;for(let e=0;e<i;e++){const[i,s]=a[e];R(s,L(t,i),r,n)}},L=(e,t)=>{let r=e;const n=t.split(C),a=n.length;for(let e=0;e<a;e++){const t=n[e];let a=r.nextPart.get(t);a||(a=S(),r.nextPart.set(t,a)),r=a}return r},O=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,z=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const a=(a,i)=>{r[a]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=n[e])?(a(e,t),t):void 0},set(e,t){e in r?r[e]=t:a(e,t)}}},F=[],B=(e,t,r,n,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:a}),W=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=e=>{const t=[];let r,n=0,a=0,i=0;const s=e.length;for(let o=0;o<s;o++){const s=e[o];if(0===n&&0===a){if(":"===s){t.push(e.slice(i,o)),i=o+1;continue}if("/"===s){r=o;continue}}"["===s?n++:"]"===s?n--:"("===s?a++:")"===s&&a--}const o=0===t.length?e:e.slice(i);let c=o,l=!1;o.endsWith("!")?(c=o.slice(0,-1),l=!0):o.startsWith("!")&&(c=o.slice(1),l=!0);return B(t,l,c,r&&r>i?r-i:void 0)};if(t){const e=t+":",r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):B(F,!1,t,void 0,!0)}if(r){const e=n;n=t=>r({className:t,parseClassName:e})}return n},V=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((e,r)=>{t.set(e,1e6+r)}),e=>{const r=[];let n=[];for(let a=0;a<e.length;a++){const i=e[a],s="["===i[0],o=t.has(i);s||o?(n.length>0&&(n.sort(),r.push(...n),n=[]),r.push(i)):n.push(i)}return n.length>0&&(n.sort(),r.push(...n)),r}},G=/\s+/,H=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=H(e[n]))&&(r&&(r+=" "),r+=t);return r},j=(e,...t)=>{let r,n,a,i;const s=e=>{const t=n(e);if(t)return t;const i=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:i}=t,s=[],o=e.trim().split(G);let c="";for(let e=o.length-1;e>=0;e-=1){const t=o[e],{isExternal:l,modifiers:d,hasImportantModifier:u,baseClassName:p,maybePostfixModifierPosition:m}=r(t);if(l){c=t+(c.length>0?" "+c:c);continue}let h=!!m,f=n(h?p.substring(0,m):p);if(!f){if(!h){c=t+(c.length>0?" "+c:c);continue}if(f=n(p),!f){c=t+(c.length>0?" "+c:c);continue}h=!1}const g=0===d.length?"":1===d.length?d[0]:i(d).join(":"),b=u?g+"!":g,v=b+f;if(s.indexOf(v)>-1)continue;s.push(v);const y=a(f,h);for(let e=0;e<y.length;++e){const t=y[e];s.push(b+t)}c=t+(c.length>0?" "+c:c)}return c})(e,r);return a(e,i),i};return i=o=>{const c=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:z(e.cacheSize),parseClassName:W(e),sortModifiers:V(e),...E(e)}))(c),n=r.cache.get,a=r.cache.set,i=s,s(o)},(...e)=>i(((...e)=>{let t,r,n=0,a="";for(;n<e.length;)(t=e[n++])&&(r=H(t))&&(a&&(a+=" "),a+=r);return a})(...e))},$=[],K=e=>{const t=t=>t[e]||$;return t.isThemeGetter=!0,t},q=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Z=/^\((?:(\w[\w-]*):)?(.+)\)$/i,J=/^\d+\/\d+$/,Y=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,X=/\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$/,Q=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ee=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,te=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,re=e=>J.test(e),ne=e=>!!e&&!Number.isNaN(Number(e)),ae=e=>!!e&&Number.isInteger(Number(e)),ie=e=>e.endsWith("%")&&ne(e.slice(0,-1)),se=e=>Y.test(e),oe=()=>!0,ce=e=>X.test(e)&&!Q.test(e),le=()=>!1,de=e=>ee.test(e),ue=e=>te.test(e),pe=e=>!he(e)&&!we(e),me=e=>Ae(e,Re,le),he=e=>q.test(e),fe=e=>Ae(e,De,ce),ge=e=>Ae(e,Ie,ne),be=e=>Ae(e,Pe,le),ve=e=>Ae(e,Te,ue),ye=e=>Ae(e,Ue,de),we=e=>Z.test(e),xe=e=>_e(e,De),ke=e=>_e(e,Me),Se=e=>_e(e,Pe),Ce=e=>_e(e,Re),Ne=e=>_e(e,Te),Ee=e=>_e(e,Ue,!0),Ae=(e,t,r)=>{const n=q.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},_e=(e,t,r=!1)=>{const n=Z.exec(e);return!!n&&(n[1]?t(n[1]):r)},Pe=e=>"position"===e||"percentage"===e,Te=e=>"image"===e||"url"===e,Re=e=>"length"===e||"size"===e||"bg-size"===e,De=e=>"length"===e,Ie=e=>"number"===e,Me=e=>"family-name"===e,Ue=e=>"shadow"===e,Le=j(()=>{const e=K("color"),t=K("font"),r=K("text"),n=K("font-weight"),a=K("tracking"),i=K("leading"),s=K("breakpoint"),o=K("container"),c=K("spacing"),l=K("radius"),d=K("shadow"),u=K("inset-shadow"),p=K("text-shadow"),m=K("drop-shadow"),h=K("blur"),f=K("perspective"),g=K("aspect"),b=K("ease"),v=K("animate"),y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",we,he],w=()=>[we,he,c],x=()=>[re,"full","auto",...w()],k=()=>[ae,"none","subgrid",we,he],S=()=>["auto",{span:["full",ae,we,he]},ae,we,he],C=()=>[ae,"auto",we,he],N=()=>["auto","min","max","fr",we,he],E=()=>["auto",...w()],A=()=>[re,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],_=()=>[e,we,he],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Se,be,{position:[we,he]}],T=()=>["auto","cover","contain",Ce,me,{size:[we,he]}],R=()=>[ie,xe,fe],D=()=>["","none","full",l,we,he],I=()=>["",ne,xe,fe],M=()=>[ne,ie,Se,be],U=()=>["","none",h,we,he],L=()=>["none",ne,we,he],O=()=>["none",ne,we,he],z=()=>[ne,we,he],F=()=>[re,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[se],breakpoint:[se],color:[oe],container:[se],"drop-shadow":[se],ease:["in","out","in-out"],font:[pe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[se],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[se],shadow:[se],spacing:["px",ne],text:[se],"text-shadow":[se],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",re,he,we,g]}],container:["container"],columns:[{columns:[ne,he,we,o]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"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:y()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{start:x()}],end:[{end:x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:["visible","invisible","collapse"],z:[{z:[ae,"auto",we,he]}],basis:[{basis:[re,"full","auto",o,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ne,re,"auto","initial","none",he]}],grow:[{grow:["",ne,we,he]}],shrink:[{shrink:["",ne,we,he]}],order:[{order:[ae,"first","last","none",we,he]}],"grid-cols":[{"grid-cols":k()}],"col-start-end":[{col:S()}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":k()}],"row-start-end":[{row:S()}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:A()}],w:[{w:[o,"screen",...A()]}],"min-w":[{"min-w":[o,"screen","none",...A()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[s]},...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,xe,fe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,we,ge]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ie,he]}],"font-family":[{font:[ke,he,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:[a,we,he]}],"line-clamp":[{"line-clamp":[ne,"none",we,ge]}],leading:[{leading:[i,...w()]}],"list-image":[{"list-image":["none",we,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",we,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[ne,"from-font","auto",we,fe]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[ne,"auto",we,he]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we,he]}],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",we,he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ae,we,he],radial:["",we,he],conic:[ae,we,he]},Ne,ve]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:D()}],"rounded-s":[{"rounded-s":D()}],"rounded-e":[{"rounded-e":D()}],"rounded-t":[{"rounded-t":D()}],"rounded-r":[{"rounded-r":D()}],"rounded-b":[{"rounded-b":D()}],"rounded-l":[{"rounded-l":D()}],"rounded-ss":[{"rounded-ss":D()}],"rounded-se":[{"rounded-se":D()}],"rounded-ee":[{"rounded-ee":D()}],"rounded-es":[{"rounded-es":D()}],"rounded-tl":[{"rounded-tl":D()}],"rounded-tr":[{"rounded-tr":D()}],"rounded-br":[{"rounded-br":D()}],"rounded-bl":[{"rounded-bl":D()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":I()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[ne,we,he]}],"outline-w":[{outline:["",ne,xe,fe]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",d,Ee,ye]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",u,Ee,ye]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[ne,fe]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",p,Ee,ye]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[ne,we,he]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"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":[ne]}],"mask-image-linear-from-pos":[{"mask-linear-from":M()}],"mask-image-linear-to-pos":[{"mask-linear-to":M()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":M()}],"mask-image-t-to-pos":[{"mask-t-to":M()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":M()}],"mask-image-r-to-pos":[{"mask-r-to":M()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":M()}],"mask-image-b-to-pos":[{"mask-b-to":M()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":M()}],"mask-image-l-to-pos":[{"mask-l-to":M()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":M()}],"mask-image-x-to-pos":[{"mask-x-to":M()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":M()}],"mask-image-y-to-pos":[{"mask-y-to":M()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[we,he]}],"mask-image-radial-from-pos":[{"mask-radial-from":M()}],"mask-image-radial-to-pos":[{"mask-radial-to":M()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"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":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[ne]}],"mask-image-conic-from-pos":[{"mask-conic-from":M()}],"mask-image-conic-to-pos":[{"mask-conic-to":M()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",we,he]}],filter:[{filter:["","none",we,he]}],blur:[{blur:U()}],brightness:[{brightness:[ne,we,he]}],contrast:[{contrast:[ne,we,he]}],"drop-shadow":[{"drop-shadow":["","none",m,Ee,ye]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",ne,we,he]}],"hue-rotate":[{"hue-rotate":[ne,we,he]}],invert:[{invert:["",ne,we,he]}],saturate:[{saturate:[ne,we,he]}],sepia:[{sepia:["",ne,we,he]}],"backdrop-filter":[{"backdrop-filter":["","none",we,he]}],"backdrop-blur":[{"backdrop-blur":U()}],"backdrop-brightness":[{"backdrop-brightness":[ne,we,he]}],"backdrop-contrast":[{"backdrop-contrast":[ne,we,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ne,we,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ne,we,he]}],"backdrop-invert":[{"backdrop-invert":["",ne,we,he]}],"backdrop-opacity":[{"backdrop-opacity":[ne,we,he]}],"backdrop-saturate":[{"backdrop-saturate":[ne,we,he]}],"backdrop-sepia":[{"backdrop-sepia":["",ne,we,he]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",we,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ne,"initial",we,he]}],ease:[{ease:["linear","initial",b,we,he]}],delay:[{delay:[ne,we,he]}],animate:[{animate:["none",v,we,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[f,we,he]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:L()}],"rotate-x":[{"rotate-x":L()}],"rotate-y":[{"rotate-y":L()}],"rotate-z":[{"rotate-z":L()}],scale:[{scale:O()}],"scale-x":[{"scale-x":O()}],"scale-y":[{"scale-y":O()}],"scale-z":[{"scale-z":O()}],"scale-3d":["scale-3d"],skew:[{skew:z()}],"skew-x":[{"skew-x":z()}],"skew-y":[{"skew-y":z()}],transform:[{transform:[we,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:F()}],"translate-x":[{"translate-x":F()}],"translate-y":[{"translate-y":F()}],"translate-z":[{"translate-z":F()}],"translate-none":["translate-none"],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"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",we,he]}],"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":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"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",we,he]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[ne,xe,fe,ge]}],stroke:[{stroke:["none",..._()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Oe(...e){return Le(k(e))}let ze=!0;function Fe(e,...t){ze&&function(){try{const e="undefined"!=typeof globalThis?globalThis:null;return"development"===e?.process?.env?.NODE_ENV}catch{return!1}}()&&console.error(e,...t)}function Be(e,...t){console.error(e,...t)}function We(e){return e instanceof Error&&("AbortError"===e.name||"ERR_CANCELED"===e.code)}async function Ve(e){const t=await e.text();if(!t)throw new Error("Empty response body");try{return JSON.parse(t)}catch(e){throw new Error(`Invalid JSON response: ${t.substring(0,100)}${t.length>100?"...":""}`)}}async function Ge(e,t="Request failed"){if(!e.ok){let r=t;try{const t=await Ve(e);r=t.message||t.error||r}catch{r=function(e,t){const r={400:"Bad Request",401:"Unauthorized - Please check your session",403:"Forbidden - You do not have permission",404:"Resource not found",500:"Internal server error",502:"Bad Gateway",503:"Service unavailable"}[e.status]||e.statusText||t;return new Error(`${t} (${e.status}: ${r})`)}(e,t).message}throw new Error(r)}try{return await Ve(e)}catch(e){if(e instanceof Error&&e.message.includes("Invalid JSON"))throw e;throw new Error("Failed to parse response as JSON")}}class He extends Error{constructor(e,t,r,n){super(e),this.code=t,this.context=r,this.originalError=n,this.name="SDKError","undefined"!=typeof Error&&"captureStackTrace"in Error&&Error.captureStackTrace(this,He)}}const je=new class{constructor(){this.config={enableConsoleLogging:!0,showUserNotifications:!1}}configure(e){this.config={...this.config,...e},void 0!==e.enableConsoleLogging&&function(e){void 0!==e.enableLogging&&(ze=e.enableLogging)}({enableLogging:e.enableConsoleLogging})}handleError(e,t={}){if(We(e))return;const r=e instanceof Error?e:new He("string"==typeof e?e:"An unknown error occurred","UNKNOWN_ERROR",t),n=r instanceof He?r:new He(r.message,"SDK_ERROR",t,r);if(this.config.enableConsoleLogging&&Fe(`[SDK Error] ${t.component||"Unknown"}:`,{message:n.message,code:n.code,context:n.context,originalError:n.originalError,stack:n.stack}),this.config.onError)try{this.config.onError(n,t)}catch(e){Be("[SDK Error Handler] Error in custom error callback:",e)}this.config.showUserNotifications&&this.notifyUser(n,t)}notifyUser(e,t){"undefined"!=typeof window&&window.dispatchEvent&&window.dispatchEvent(new CustomEvent("sdk-error",{detail:{error:e,context:t}}))}wrapAsync(e,t){return(...r)=>e(...r).catch(e=>{throw this.handleError(e,t),e})}wrapSync(e,t){return(...r)=>{try{return e(...r)}catch(e){throw this.handleError(e,t),e}}}};function $e(e,t={}){je.handleError(e,t)}function Ke(e,t={}){return!We(e)&&(je.handleError(e,t),!0)}function qe(e,t,r){return e instanceof Error?e.message:r(t)}class Ze extends i{constructor(e){super(e),this.resetError=()=>{this.setState({hasError:!1,error:null})},this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){if($e(e,{component:"ErrorBoundary",action:"componentDidCatch",metadata:{componentStack:t.componentStack,errorBoundary:this.constructor.name}}),this.props.onError)try{this.props.onError(e,t)}catch(e){Be("[SDK ErrorBoundary] Error in onError callback:",e)}}componentDidUpdate(e){this.state.hasError&&!1!==this.props.resetOnPropsChange&&e.children!==this.props.children&&this.resetError()}render(){return this.state.hasError&&this.state.error?this.props.fallback?"function"==typeof this.props.fallback?this.props.fallback(this.state.error,this.resetError):this.props.fallback:e("div",{style:{padding:"1rem",border:"1px solid #ef4444",borderRadius:"0.5rem",backgroundColor:"#fef2f2",color:"#991b1b"},children:[t("h3",{style:{margin:"0 0 0.5rem 0",fontSize:"1rem",fontWeight:600},children:"Something went wrong"}),t("p",{style:{margin:"0 0 1rem 0",fontSize:"0.875rem"},children:this.state.error.message||"An unexpected error occurred"}),t("button",{onClick:this.resetError,style:{padding:"0.5rem 1rem",backgroundColor:"#ef4444",color:"white",border:"none",borderRadius:"0.25rem",cursor:"pointer",fontSize:"0.875rem"},children:"Try again"})]}):this.props.children}}const Je=()=>({type:"AUTHENTICATION_STARTED"}),Ye=()=>({type:"AUTHENTICATION_PROCESSING"}),Xe=()=>({type:"AUTHENTICATION_FAILED"}),Qe=e=>({type:"SET_SESSION",payload:e}),et=()=>({type:"REMOVE_SESSION"});function tt(e,t,r){const n=s(t),a=s(r),i=s(void 0),c=s(!1),l=n.current!==t,d=a.current!==r,u=l||d;n.current=t,a.current=r;const p=s(0);u&&(p.current+=1);const m=p.current;return o(()=>{const n=t(e);if(c.current){if(r?r(i.current,n):Object.is(i.current,n))return i.current}return i.current=n,c.current=!0,n},[e,m])}function rt({name:e,initialState:r,reducer:n,initializer:i}){const s=c(null),d=c(null),u=c(null),p=a.memo(({children:e})=>{const[a,c]=l(n,r,i||(e=>e)),p=o(()=>({state:a,dispatch:c}),[a,c]);return t(u.Provider,{value:p,children:t(s.Provider,{value:a,children:t(d.Provider,{value:c,children:e})})})});p.displayName=`${e}Provider`;const m=t=>new Error(`use${e}${t} must be used within a ${e}Provider. Make sure SaaSOSProvider is wrapping your application.`),h=()=>{const e=a.useContext(s);if(null===e)throw m("State");return e};return{Provider:p,useContext:()=>{const e=a.useContext(u);if(!e)throw m("Context");return e},useState:h,useDispatch:()=>{const e=a.useContext(d);if(null===e)throw m("Dispatch");return e},useSelector:(e,t)=>{const r=e||(e=>e);return tt(h(),r,t)}}}var nt;function at(e){return{isAuthenticated:e===nt.authenticated,isLoading:e===nt.loading||e===nt.redirecting||e===nt.authenticating,isRedirecting:e===nt.redirecting}}function it(e,t,r){return{...e,[t]:r}}function st(e,t){return{...e,...t}}!function(e){e.loading="loading",e.redirecting="redirecting",e.authenticated="authenticated",e.unauthenticated="unauthenticated",e.authenticating="authenticating"}(nt||(nt={}));const ot=()=>({session:null,status:nt.loading}),{Provider:ct,useState:lt,useDispatch:dt}=rt({name:"Auth",initialState:ot(),reducer:(e,t)=>{switch(t.type){case"AUTHENTICATION_STARTED":return it(e,"status",nt.redirecting);case"AUTHENTICATION_PROCESSING":return it(e,"status",nt.authenticating);case"AUTHENTICATION_FAILED":case"REMOVE_SESSION":return st(e,{session:null,status:nt.unauthenticated});case"SET_SESSION":return st(e,{session:t.payload,status:nt.authenticated});default:return e}},initializer:ot}),ut=ct,pt=lt,mt=dt,ht=e=>({type:"SET_SAAS_OS_CONFIG",payload:e}),ft=e=>({type:"SET_SETTINGS",payload:e});var gt;function bt(e){return Boolean(e?.serverUrl&&e?.version&&e?.orgId)}!function(e){e.V1="v1"}(gt||(gt={}));const vt=()=>({serverUrl:"",version:gt.V1,orgId:"",settings:null}),{Provider:yt,useState:wt,useDispatch:xt}=rt({name:"OS",initialState:vt(),reducer:(e,t)=>{switch(t.type){case"SET_SAAS_OS_CONFIG":return st(e,t.payload);case"REMOVE_SAAS_OS_CONFIG":return vt();case"SET_SETTINGS":return it(e,"settings",t.payload);default:return e}}}),kt=yt,St=wt,Ct=xt,Nt=e=>({type:"SET_WORKSPACES",payload:e}),Et=e=>({type:"ADD_WORKSPACE",payload:e}),At=e=>({type:"UPDATE_WORKSPACE",payload:e}),_t=e=>({type:"REMOVE_WORKSPACE",payload:e}),Pt=e=>({type:"SET_ALL_FEATURES",payload:e}),Tt=e=>({type:"SET_CURRENT_WORKSPACE",payload:e}),Rt=()=>({type:"RESET_CURRENT_WORKSPACE"}),Dt=e=>({type:"SET_IS_INITIALIZED",payload:e}),It=e=>({type:"SET_LOADING",payload:e}),Mt=e=>({type:"SET_ERROR",payload:e}),Ut=e=>({type:"SET_REFRESHING",payload:e}),Lt=e=>({type:"SET_SWITCHING_TO_ID",payload:e}),{Provider:Ot,useState:zt,useDispatch:Ft}=rt({name:"Workspace",initialState:{workspaces:[],loading:!1,error:null,currentWorkspace:null,refreshing:!1,switchingToId:null,isInitialized:!1,allFeatures:[]},reducer:(e,t)=>{switch(t.type){case"SET_WORKSPACES":return it(e,"workspaces",t.payload);case"ADD_WORKSPACE":return it(e,"workspaces",[...e.workspaces,t.payload]);case"UPDATE_WORKSPACE":return it(e,"workspaces",e.workspaces.map(e=>e._id===t.payload._id?t.payload:e));case"REMOVE_WORKSPACE":return it(e,"workspaces",e.workspaces.filter(e=>e._id!==t.payload));case"SET_ALL_FEATURES":return it(e,"allFeatures",t.payload);case"SET_CURRENT_WORKSPACE":return it(e,"currentWorkspace",t.payload);case"RESET_CURRENT_WORKSPACE":return it(e,"currentWorkspace",null);case"SET_IS_INITIALIZED":return it(e,"isInitialized",t.payload);case"SET_LOADING":return it(e,"loading",t.payload);case"SET_ERROR":return it(e,"error",t.payload);case"SET_REFRESHING":return it(e,"refreshing",t.payload);case"SET_SWITCHING_TO_ID":return it(e,"switchingToId",t.payload);default:return e}}}),Bt=Ot,Wt=zt,Vt=Ft,Gt=a.memo(({children:e})=>t(kt,{children:t(ut,{children:t(Bt,{children:e})})}));Gt.displayName="SDKContextProvider";const Ht=c({});Ht.displayName="CheckoutConfigContext";const jt=a.memo(({getCheckoutStripeParams:e,children:r})=>{const n=a.useMemo(()=>({getCheckoutStripeParams:e}),[e]);return t(Ht.Provider,{value:n,children:r})});function $t(){const e=new Set;return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),invalidate(){e.forEach(e=>e())},reset(){e.clear()}}}jt.displayName="CheckoutConfigProvider";const Kt=$t(),qt=Kt.subscribe,Zt=Kt.invalidate,Jt=$t(),Yt=Jt.subscribe,Xt=Jt.invalidate;function Qt(e,t){const r=t&&t.cache?t.cache:sr,n=t&&t.serializer?t.serializer:ar;return(t&&t.strategy?t.strategy:nr)(e,{cache:r,serializer:n})}function er(e,t,r,n){const a=null==(i=n)||"number"==typeof i||"boolean"==typeof i?n:r(n);var i;let s=t.get(a);return void 0===s&&(s=e.call(this,n),t.set(a,s)),s}function tr(e,t,r){const n=Array.prototype.slice.call(arguments,3),a=r(n);let i=t.get(a);return void 0===i&&(i=e.apply(this,n),t.set(a,i)),i}function rr(e,t,r,n,a){return r.bind(t,e,n,a)}function nr(e,t){return rr(e,this,1===e.length?er:tr,t.cache.create(),t.serializer)}const ar=function(){return JSON.stringify(arguments)};class ir{cache;constructor(){this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}}const sr={create:function(){return new ir}},or={variadic:function(e,t){return rr(e,this,tr,t.cache.create(),t.serializer)}},cr=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function lr(e){const t={};return e.replace(cr,e=>{const r=e.length;switch(e[0]){case"G":t.era=4===r?"long":5===r?"narrow":"short";break;case"y":t.year=2===r?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][r-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][r-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===r?"long":5===r?"narrow":"short";break;case"e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][r-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][r-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][r-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][r-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][r-1];break;case"s":t.second=["numeric","2-digit"][r-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=r<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}const dr=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function ur(e){return e.replace(/^(.*?)-/,"")}const pr=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,mr=/^(@+)?(\+|#+)?[rs]?$/g,hr=/(\*)(0+)|(#+)(0+)|(0+)/g,fr=/^(0+)$/;function gr(e){const t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(mr,function(e,r,n){return"string"!=typeof n?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):"+"===n?t.minimumSignificantDigits=r.length:"#"===r[0]?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+("string"==typeof n?n.length:0)),""}),t}function br(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function vr(e){let t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){const r=e.slice(0,2);if("+!"===r?(t.signDisplay="always",e=e.slice(2)):"+?"===r&&(t.signDisplay="exceptZero",e=e.slice(2)),!fr.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function yr(e){const t=br(e);return t||{}}function wr(e){let t={};for(const r of e){switch(r.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=r.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=ur(r.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t={...t,notation:"scientific",...r.options.reduce((e,t)=>({...e,...yr(t)}),{})};continue;case"engineering":t={...t,notation:"engineering",...r.options.reduce((e,t)=>({...e,...yr(t)}),{})};continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(r.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(r.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");r.options[0].replace(hr,function(e,r,n,a,i,s){if(r)t.minimumIntegerDigits=n.length;else{if(a&&i)throw new Error("We currently do not support maximum integer digits");if(s)throw new Error("We currently do not support exact integer digits")}return""});continue}if(fr.test(r.stem)){t.minimumIntegerDigits=r.stem.length;continue}if(pr.test(r.stem)){if(r.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(pr,function(e,r,n,a,i,s){return"*"===n?t.minimumFractionDigits=r.length:a&&"#"===a[0]?t.maximumFractionDigits=a.length:i&&s?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+s.length):(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length),""});const e=r.options[0];"w"===e?t={...t,trailingZeroDisplay:"stripIfInteger"}:e&&(t={...t,...gr(e)});continue}if(mr.test(r.stem)){t={...t,...gr(r.stem)};continue}const e=br(r.stem);e&&(t={...t,...e});const n=vr(r.stem);n&&(t={...t,...n})}return t}let xr=function(e){return e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag",e}({}),kr=function(e){return e[e.number=0]="number",e[e.dateTime=1]="dateTime",e}({});function Sr(e){return e.type===xr.literal}function Cr(e){return e.type===xr.argument}function Nr(e){return e.type===xr.number}function Er(e){return e.type===xr.date}function Ar(e){return e.type===xr.time}function _r(e){return e.type===xr.select}function Pr(e){return e.type===xr.plural}function Tr(e){return e.type===xr.pound}function Rr(e){return e.type===xr.tag}function Dr(e){return!(!e||"object"!=typeof e||e.type!==kr.number)}function Ir(e){return!(!e||"object"!=typeof e||e.type!==kr.dateTime)}let Mr=function(e){return e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG",e}({});const Ur=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,Lr={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GS:["H","h","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ku-SY":["H","hB"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function Or(e){let t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}const r=e.language;let n;"root"!==r&&(n=e.maximize().region);return(Lr[n||""]||Lr[r||""]||Lr[`${r}-001`]||Lr["001"])[0]}const zr=new RegExp(`^${Ur.source}*`),Fr=new RegExp(`${Ur.source}*$`);function Br(e,t){return{start:e,end:t}}const Wr=!!Object.fromEntries,Vr=!!String.prototype.trimStart,Gr=!!String.prototype.trimEnd,Hr=Wr?Object.fromEntries:function(e){const t={};for(const[r,n]of e)t[r]=n;return t},jr=Vr?function(e){return e.trimStart()}:function(e){return e.replace(zr,"")},$r=Gr?function(e){return e.trimEnd()}:function(e){return e.replace(Fr,"")},Kr=new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");class qr{message;position;locale;ignoreTag;requiresOtherClause;shouldParseSkeletons;constructor(e,t={}){this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}parse(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)}parseMessage(e,t,r){let n=[];for(;!this.isEOF();){const a=this.char();if(123===a){const t=this.parseArgument(e,r);if(t.err)return t;n.push(t.val)}else{if(125===a&&e>0)break;if(35!==a||"plural"!==t&&"selectordinal"!==t){if(60===a&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(Mr.UNMATCHED_CLOSING_TAG,Br(this.clonePosition(),this.clonePosition()))}if(60===a&&!this.ignoreTag&&Zr(this.peek()||0)){const r=this.parseTag(e,t);if(r.err)return r;n.push(r.val)}else{const r=this.parseLiteral(e,t);if(r.err)return r;n.push(r.val)}}else{const e=this.clonePosition();this.bump(),n.push({type:xr.pound,location:Br(e,this.clonePosition())})}}}return{val:n,err:null}}parseTag(e,t){const r=this.clonePosition();this.bump();const n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:xr.literal,value:`<${n}/>`,location:Br(r,this.clonePosition())},err:null};if(this.bumpIf(">")){const a=this.parseMessage(e+1,t,!0);if(a.err)return a;const i=a.val,s=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!Zr(this.char()))return this.error(Mr.INVALID_TAG,Br(s,this.clonePosition()));const e=this.clonePosition();return n!==this.parseTagName()?this.error(Mr.UNMATCHED_CLOSING_TAG,Br(e,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:xr.tag,value:n,children:i,location:Br(r,this.clonePosition())},err:null}:this.error(Mr.INVALID_TAG,Br(s,this.clonePosition())))}return this.error(Mr.UNCLOSED_TAG,Br(r,this.clonePosition()))}return this.error(Mr.INVALID_TAG,Br(r,this.clonePosition()))}parseTagName(){const e=this.offset();for(this.bump();!this.isEOF()&&Jr(this.char());)this.bump();return this.message.slice(e,this.offset())}parseLiteral(e,t){const r=this.clonePosition();let n="";for(;;){const r=this.tryParseQuote(t);if(r){n+=r;continue}const a=this.tryParseUnquoted(e,t);if(a){n+=a;continue}const i=this.tryParseLeftAngleBracket();if(!i)break;n+=i}const a=Br(r,this.clonePosition());return{val:{type:xr.literal,value:n,location:a},err:null}}tryParseLeftAngleBracket(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(Zr(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e}tryParseQuote(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();const t=[this.char()];for(this.bump();!this.isEOF();){const e=this.char();if(39===e){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(e);this.bump()}return String.fromCodePoint(...t)}tryParseUnquoted(e,t){if(this.isEOF())return null;const r=this.char();return 60===r||123===r||35===r&&("plural"===t||"selectordinal"===t)||125===r&&e>0?null:(this.bump(),String.fromCodePoint(r))}parseArgument(e,t){const r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(Mr.EXPECT_ARGUMENT_CLOSING_BRACE,Br(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(Mr.EMPTY_ARGUMENT,Br(r,this.clonePosition()));let n=this.parseIdentifierIfPossible().value;if(!n)return this.error(Mr.MALFORMED_ARGUMENT,Br(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(Mr.EXPECT_ARGUMENT_CLOSING_BRACE,Br(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:xr.argument,value:n,location:Br(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(Mr.EXPECT_ARGUMENT_CLOSING_BRACE,Br(r,this.clonePosition())):this.parseArgumentOptions(e,t,n,r);default:return this.error(Mr.MALFORMED_ARGUMENT,Br(r,this.clonePosition()))}}parseIdentifierIfPossible(){const e=this.clonePosition(),t=this.offset(),r=function(e,t){return Kr.lastIndex=t,Kr.exec(e)[1]??""}(this.message,t),n=t+r.length;this.bumpTo(n);return{value:r,location:Br(e,this.clonePosition())}}parseArgumentOptions(e,t,r,n){let a=this.clonePosition(),i=this.parseIdentifierIfPossible().value,s=this.clonePosition();switch(i){case"":return this.error(Mr.EXPECT_ARGUMENT_TYPE,Br(a,s));case"number":case"date":case"time":{this.bumpSpace();let e=null;if(this.bumpIf(",")){this.bumpSpace();const t=this.clonePosition(),r=this.parseSimpleArgStyleIfPossible();if(r.err)return r;const n=$r(r.val);if(0===n.length)return this.error(Mr.EXPECT_ARGUMENT_STYLE,Br(this.clonePosition(),this.clonePosition()));e={style:n,styleLocation:Br(t,this.clonePosition())}}const t=this.tryParseArgumentClose(n);if(t.err)return t;const a=Br(n,this.clonePosition());if(e&&e.style.startsWith("::")){let t=jr(e.style.slice(2));if("number"===i){const n=this.parseNumberSkeletonFromString(t,e.styleLocation);return n.err?n:{val:{type:xr.number,value:r,location:a,style:n.val},err:null}}{if(0===t.length)return this.error(Mr.EXPECT_DATE_TIME_SKELETON,a);let n=t;this.locale&&(n=function(e,t){let r="";for(let n=0;n<e.length;n++){const a=e.charAt(n);if("j"===a){let i=0;for(;n+1<e.length&&e.charAt(n+1)===a;)i++,n++;let s=1+(1&i),o=i<2?1:3+(i>>1),c="a",l=Or(t);for("H"!=l&&"k"!=l||(o=0);o-- >0;)r+=c;for(;s-- >0;)r=l+r}else r+="J"===a?"H":a}return r}(t,this.locale));const s={type:kr.dateTime,pattern:n,location:e.styleLocation,parsedOptions:this.shouldParseSkeletons?lr(n):{}};return{val:{type:"date"===i?xr.date:xr.time,value:r,location:a,style:s},err:null}}}return{val:{type:"number"===i?xr.number:"date"===i?xr.date:xr.time,value:r,location:a,style:e?.style??null},err:null}}case"plural":case"selectordinal":case"select":{const a=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(Mr.EXPECT_SELECT_ARGUMENT_OPTIONS,Br(a,{...a}));this.bumpSpace();let s=this.parseIdentifierIfPossible(),o=0;if("select"!==i&&"offset"===s.value){if(!this.bumpIf(":"))return this.error(Mr.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Br(this.clonePosition(),this.clonePosition()));this.bumpSpace();const e=this.tryParseDecimalInteger(Mr.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Mr.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(e.err)return e;this.bumpSpace(),s=this.parseIdentifierIfPossible(),o=e.val}const c=this.tryParsePluralOrSelectOptions(e,i,t,s);if(c.err)return c;const l=this.tryParseArgumentClose(n);if(l.err)return l;const d=Br(n,this.clonePosition());return"select"===i?{val:{type:xr.select,value:r,options:Hr(c.val),location:d},err:null}:{val:{type:xr.plural,value:r,options:Hr(c.val),offset:o,pluralType:"plural"===i?"cardinal":"ordinal",location:d},err:null}}default:return this.error(Mr.INVALID_ARGUMENT_TYPE,Br(a,s))}}tryParseArgumentClose(e){return this.isEOF()||125!==this.char()?this.error(Mr.EXPECT_ARGUMENT_CLOSING_BRACE,Br(e,this.clonePosition())):(this.bump(),{val:!0,err:null})}parseSimpleArgStyleIfPossible(){let e=0;const t=this.clonePosition();for(;!this.isEOF();){switch(this.char()){case 39:{this.bump();let e=this.clonePosition();if(!this.bumpUntil("'"))return this.error(Mr.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Br(e,this.clonePosition()));this.bump();break}case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}}parseNumberSkeletonFromString(e,t){let r=[];try{r=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");const t=e.split(dr).filter(e=>e.length>0),r=[];for(const e of t){let t=e.split("/");if(0===t.length)throw new Error("Invalid number skeleton");const[n,...a]=t;for(const e of a)if(0===e.length)throw new Error("Invalid number skeleton");r.push({stem:n,options:a})}return r}(e)}catch{return this.error(Mr.INVALID_NUMBER_SKELETON,t)}return{val:{type:kr.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?wr(r):{}},err:null}}tryParsePluralOrSelectOptions(e,t,r,n){let a=!1;const i=[],s=new Set;let{value:o,location:c}=n;for(;;){if(0===o.length){const e=this.clonePosition();if("select"===t||!this.bumpIf("="))break;{const t=this.tryParseDecimalInteger(Mr.EXPECT_PLURAL_ARGUMENT_SELECTOR,Mr.INVALID_PLURAL_ARGUMENT_SELECTOR);if(t.err)return t;c=Br(e,this.clonePosition()),o=this.message.slice(e.offset,this.offset())}}if(s.has(o))return this.error("select"===t?Mr.DUPLICATE_SELECT_ARGUMENT_SELECTOR:Mr.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===o&&(a=!0),this.bumpSpace();const n=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?Mr.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:Mr.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Br(this.clonePosition(),this.clonePosition()));const l=this.parseMessage(e+1,t,r);if(l.err)return l;const d=this.tryParseArgumentClose(n);if(d.err)return d;i.push([o,{value:l.val,location:Br(n,this.clonePosition())}]),s.add(o),this.bumpSpace(),({value:o,location:c}=this.parseIdentifierIfPossible())}return 0===i.length?this.error("select"===t?Mr.EXPECT_SELECT_ARGUMENT_SELECTOR:Mr.EXPECT_PLURAL_ARGUMENT_SELECTOR,Br(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!a?this.error(Mr.MISSING_OTHER_CLAUSE,Br(this.clonePosition(),this.clonePosition())):{val:i,err:null}}tryParseDecimalInteger(e,t){let r=1;const n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);let a=!1,i=0;for(;!this.isEOF();){const e=this.char();if(!(e>=48&&e<=57))break;a=!0,i=10*i+(e-48),this.bump()}const s=Br(n,this.clonePosition());return a?(i*=r,Number.isSafeInteger(i)?{val:i,err:null}:this.error(t,s)):this.error(e,s)}offset(){return this.position.offset}isEOF(){return this.offset()===this.message.length}clonePosition(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}}char(){const e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");const t=this.message.codePointAt(e);if(void 0===t)throw Error(`Offset ${e} is at invalid UTF-16 code unit boundary`);return t}error(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}}bump(){if(this.isEOF())return;const e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}bumpIf(e){if(this.message.startsWith(e,this.offset())){for(let t=0;t<e.length;t++)this.bump();return!0}return!1}bumpUntil(e){const t=this.offset(),r=this.message.indexOf(e,t);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)}bumpTo(e){if(this.offset()>e)throw Error(`targetOffset ${e} must be greater than or equal to the current offset ${this.offset()}`);for(e=Math.min(e,this.message.length);;){const t=this.offset();if(t===e)break;if(t>e)throw Error(`targetOffset ${e} is at invalid UTF-16 code unit boundary`);if(this.bump(),this.isEOF())break}}bumpSpace(){for(;!this.isEOF()&&Yr(this.char());)this.bump()}peek(){if(this.isEOF())return null;const e=this.char(),t=this.offset();return this.message.charCodeAt(t+(e>=65536?2:1))??null}}function Zr(e){return e>=97&&e<=122||e>=65&&e<=90}function Jr(e){return 45===e||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Yr(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Xr(e){e.forEach(e=>{if(delete e.location,_r(e)||Pr(e))for(const t in e.options)delete e.options[t].location,Xr(e.options[t].value);else Nr(e)&&Dr(e.style)||(Er(e)||Ar(e))&&Ir(e.style)?delete e.style.location:Rr(e)&&Xr(e.children)})}function Qr(e,t={}){t={shouldParseSkeletons:!0,requiresOtherClause:!0,...t};const r=new qr(e,t).parse();if(r.err){const e=SyntaxError(Mr[r.err.kind]);throw e.location=r.err.location,e.originalMessage=r.err.message,e}return t?.captureLocation||Xr(r.val),r.val}let en=function(e){return e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API",e}({});class tn extends Error{code;originalMessage;constructor(e,t,r){super(e),this.code=t,this.originalMessage=r}toString(){return`[formatjs Error: ${this.code}] ${this.message}`}}class rn extends tn{constructor(e,t,r,n){super(`Invalid values for "${e}": "${t}". Options are "${Object.keys(r).join('", "')}"`,en.INVALID_VALUE,n)}}class nn extends tn{constructor(e,t,r){super(`Value for "${e}" must be of type ${t}`,en.INVALID_VALUE,r)}}class an extends tn{constructor(e,t){super(`The intl string context variable "${e}" was not provided to the string "${t}"`,en.MISSING_VALUE,t)}}let sn=function(e){return e[e.literal=0]="literal",e[e.object=1]="object",e}({});function on(e){return"function"==typeof e}function cn(e,t,r,n,a,i,s){if(1===e.length&&Sr(e[0]))return[{type:sn.literal,value:e[0].value}];const o=[];for(const c of e){if(Sr(c)){o.push({type:sn.literal,value:c.value});continue}if(Tr(c)){"number"==typeof i&&o.push({type:sn.literal,value:r.getNumberFormat(t).format(i)});continue}const{value:e}=c;if(!a||!(e in a))throw new an(e,s);let l=a[e];if(Cr(c))l&&"string"!=typeof l&&"number"!=typeof l&&"bigint"!=typeof l||(l="string"==typeof l||"number"==typeof l||"bigint"==typeof l?String(l):""),o.push({type:"string"==typeof l?sn.literal:sn.object,value:l});else{if(Er(c)){const e="string"==typeof c.style?n.date[c.style]:Ir(c.style)?c.style.parsedOptions:void 0;o.push({type:sn.literal,value:r.getDateTimeFormat(t,e).format(l)});continue}if(Ar(c)){const e="string"==typeof c.style?n.time[c.style]:Ir(c.style)?c.style.parsedOptions:n.time.medium;o.push({type:sn.literal,value:r.getDateTimeFormat(t,e).format(l)});continue}if(Nr(c)){const e="string"==typeof c.style?n.number[c.style]:Dr(c.style)?c.style.parsedOptions:void 0;if(e&&e.scale){const t=e.scale||1;if("bigint"==typeof l){if(!Number.isInteger(t))throw new TypeError(`Cannot apply fractional scale ${t} to bigint value. Scale must be an integer when formatting bigint.`);l*=BigInt(t)}else l*=t}o.push({type:sn.literal,value:r.getNumberFormat(t,e).format(l)});continue}if(Rr(c)){const{children:e,value:l}=c,d=a[l];if(!on(d))throw new nn(l,"function",s);let u=d(cn(e,t,r,n,a,i).map(e=>e.value));Array.isArray(u)||(u=[u]),o.push(...u.map(e=>({type:"string"==typeof e?sn.literal:sn.object,value:e})))}if(_r(c)){const e=l,i=(Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0)||c.options.other;if(!i)throw new rn(c.value,l,Object.keys(c.options),s);o.push(...cn(i.value,t,r,n,a));continue}if(Pr(c)){const e=`=${l}`;let i=Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0;if(!i){if(!Intl.PluralRules)throw new tn('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',en.MISSING_INTL_API,s);const e="bigint"==typeof l?Number(l):l,n=r.getPluralRules(t,{type:c.pluralType}).select(e-(c.offset||0));i=(Object.prototype.hasOwnProperty.call(c.options,n)?c.options[n]:void 0)||c.options.other}if(!i)throw new rn(c.value,l,Object.keys(c.options),s);const d="bigint"==typeof l?Number(l):l;o.push(...cn(i.value,t,r,n,a,d-(c.offset||0)));continue}}}return(c=o).length<2?c:c.reduce((e,t)=>{const r=e[e.length-1];return r&&r.type===sn.literal&&t.type===sn.literal?r.value+=t.value:e.push(t),e},[]);var c}function ln(e,t){return t?Object.keys(e).reduce((r,n)=>{var a,i;return r[n]=(a=e[n],(i=t[n])?{...a,...i,...Object.keys(a).reduce((e,t)=>(e[t]={...a[t],...i[t]},e),{})}:a),r},{...e}):e}function dn(e){return{create:()=>({get:t=>e[t],set(t,r){e[t]=r}})}}class un{ast;locales;resolvedLocale;formatters;formats;message;formatterCache={number:{},dateTime:{},pluralRules:{}};constructor(e,t=un.defaultLocale,r,n){if(this.locales=t,this.resolvedLocale=un.resolveLocale(t),"string"==typeof e){if(this.message=e,!un.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");const{...t}=n||{};this.ast=un.__parse(e,{...t,locale:this.resolvedLocale})}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=ln(un.formats,r),this.formatters=n&&n.formatters||function(e={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:Qt((...e)=>new Intl.NumberFormat(...e),{cache:dn(e.number),strategy:or.variadic}),getDateTimeFormat:Qt((...e)=>new Intl.DateTimeFormat(...e),{cache:dn(e.dateTime),strategy:or.variadic}),getPluralRules:Qt((...e)=>new Intl.PluralRules(...e),{cache:dn(e.pluralRules),strategy:or.variadic})}}(this.formatterCache)}format=e=>{const t=this.formatToParts(e);if(1===t.length)return t[0].value;const r=t.reduce((e,t)=>(e.length&&t.type===sn.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e),[]);return r.length<=1?r[0]||"":r};formatToParts=e=>cn(this.ast,this.locales,this.formatters,this.formats,e,void 0,this.message);resolvedOptions=()=>({locale:this.resolvedLocale?.toString()||Intl.NumberFormat.supportedLocalesOf(this.locales)[0]});getAst=()=>this.ast;static memoizedDefaultLocale=null;static get defaultLocale(){return un.memoizedDefaultLocale||(un.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),un.memoizedDefaultLocale}static resolveLocale=e=>{if(void 0===Intl.Locale)return;const t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])};static __parse=Qr;static formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}}}const pn={settings:{titles:{profile:"Account",general:"Workspace Settings",users:"Workspace Members",subscription:"Plan & Billing",usage:"Usage",credits:"Credits",features:"Workspace Features",notifications:"Notifications",permissions:"Permissions",danger:"Danger Zone"},sidebar:{account:"Account",workspace:"Workspace",profile:"Account",general:"Settings",users:"Members",subscription:"Plan & Billing",usage:"Usage",credits:"Credits",features:"Features",notifications:"Notifications",permissions:"Permissions",danger:"Danger Zone"},common:{refresh:"Refresh",refreshing:"Refreshing...",retry:"Retry",retrying:"Retrying...",save:"Save",saving:"Saving...",cancel:"Cancel",delete:"Delete",dismiss:"Dismiss",loading:"Loading...",success:"Success!",error:"Error",refreshAction:"{loading, select, true {Refreshing...} other {Refresh}}",retryAction:"{loading, select, true {Retrying...} other {Retry}}",noPermissionTitle:"Access Restricted",noPermissionDescription:"You don't have permission to access this section. Contact a workspace admin if you need access.",billingManageOnly:"Only users with billing management permissions can perform this action."}},subscription:{managePlan:"Manage your plan and billing",changePlan:"Change Plan",viewPricingPlans:"View Pricing Plans",viewPlans:"View Plans",upgradePlan:"Upgrade Now",subscribe:"Subscribe",currentPlan:"Current Plan",noSubscription:"You don't have an active subscription",choosePlan:"Choose Your Plan",choosePlanDescription:"Compare plans and select the one that fits your needs",forWorkspace:"for {name}",planUpdateAvailable:"Plan update available",updateSuccess:"Subscription updated successfully!",updateFailed:"Update failed",cancelTitle:"Cancel Subscription",cancelConfirm:"Are you sure you want to cancel your subscription?",cancelKeep:"Keep Subscription",cancelButton:"Yes, Cancel Subscription",canceling:"Canceling...",cancelSuccess:"Subscription will be canceled at the end of the billing period.",cancelNotCharged:"You won't be charged again after cancellation",cancelResumeAnytime:"You can resume your subscription anytime before it ends",cancelTrialTitle:"Cancel Trial",cancelTrialConfirm:"Are you sure you want to cancel your trial?",cancelTrialAccess:"Your trial will continue until",cancelTrialNoCharge:"You won't be charged — your trial will simply expire",cancelTrialResume:"You can resume your trial anytime before it ends",cancelTrialKeep:"Keep Trial",cancelTrialButton:"Yes, Cancel Trial",resumeTitle:"Resume Subscription",resumeTrial:"Resume Trial",resumeConfirm:"Are you sure you want to resume your subscription?",resumeKeep:"Keep Canceled",resumeButton:"Yes, Resume Subscription",resuming:"Resuming...",resumeSuccess:"Subscription has been resumed.",managePayment:"Manage Payment",openingPortal:"Opening...",viewAllPlans:"View All Plans",scheduledCancellation:"Subscription scheduled for cancellation",scheduledTrialCancellation:"Trial scheduled for cancellation",paymentPastDue:"Payment past due",paymentPastDueDescription:"Please update your payment method to avoid service interruption.",subscriptionPaused:"Subscription paused",subscriptionPausedDescription:"Your subscription is currently paused. Resume to restore full access.",errorLoading:"Error loading subscription data",errorLoadingDescription:"Please check your connection and try again.",errorProcessing:"Failed to process subscription",errorCanceling:"Failed to cancel subscription",errorResuming:"Failed to resume subscription",invalidWorkspace:"Invalid workspace ID",billingInterval:{monthly:"Monthly",quarterly:"Quarterly",yearly:"Yearly",perMonth:"/month",perQuarter:"/quarter",perYear:"/year"},seats:{title:"Seats",members:"Members",included:"Included",billable:"Billable",perExtraSeat:"Per extra seat",limit:"Limit",includedSeats:"Included seats",maxSeats:"Max seats",freeWithBase:"Free with base price",allIncluded:"All included",extra:"extra",unlimited:"Unlimited"},items:{features:"Features",limits:"Limits",quotas:"Usage Quotas",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal"},checkout:{upgrade:"Upgrade",downgrade:"Downgrade",switchTo:"Switch to",select:"Select"},status:{active:"Active",canceling:"Canceling",trial:"Trial",canceled:"Canceled",pastDue:"Past Due",paused:"Paused",deprecated:"Deprecated",unknown:"Unknown"},plan:"Plan",invoicesTab:"Invoices",changePlanButton:"Change Plan",noPlanAssigned:"No plan assigned",free:"Free",perSeatDisplay:"+ {price}/seat{interval}",estTotalDisplay:"Est. total: {total}{interval} ({count, plural, one {# extra seat} other {# extra seats}})",nextBillingDisplay:"Next billing: {date}",membersInWorkspace:"{count, plural, one {# member} other {# members}} in workspace",billingInCurrency:"Billing in {currency}",savingsPercent:"Save {percent, number}%",switchToInterval:"Switch to {interval}",seatPriceDisplay:"+ {price}/seat{interval} ({included} {includedLabel})",trialEnded:"Your trial has ended.",trialEndsIn:"Your trial ends in {days, plural, one {# day} other {# days}}.",onTrial:"You are on a trial.",upgradeToKeepAccess:"Upgrade to keep access.",viewInvoices:"View Invoices",cancelTrial:"Cancel Trial",dunningFinal:"Final warning: Subscription will be suspended",dunningSuspended:"Subscription suspended",dunningRecovery:"Payment recovery in progress",dunningSuspendedDescription:"Your subscription has been suspended due to repeated payment failures. Update your payment method to restore access.",dunningRecoveryDescription:"We were unable to process your payment. Please update your payment method to avoid losing access.",cancelEndDescription:"Your subscription will end on",trialEndDescription:"Your trial will end on",cancelEndFallback:"Your subscription will be canceled at the end of the current billing period. You won't be charged again.",resumeChargeDate:"You will be charged again on",resumeChargeFallback:"the next billing date",resumeContinue:"Your subscription will continue automatically and you'll be billed according to your plan",resumeCancelAnytime:"You can cancel anytime before the next billing date if you change your mind",retainAccess:"You'll retain full access to this plan until",retainAccessFallback:"the end of your current billing period",noPlansAvailable:"No plan groups are available for this workspace. Please contact support if you believe this is an error.",noPlansAvailableHint:"No plan groups are available for this workspace.",startTrialDescription:"Try the full plan with no commitment. You can upgrade or cancel anytime.",noSubscriptionDescription:"Choose a plan to get started with your workspace",startFreeTrial:"Start Free Trial",startTrialDays:"Start {days}-day Free Trial",trialBadge:"{days}-day trial"},users:{title:"Workspace Members",adminOnly:"Only workspace admin can manage users and roles.",inviteByEmail:"Invite member by email",inviteButton:"Invite",inviting:"Inviting...",inviteSuccess:"User invited successfully",emailRequired:"Email is required",invalidEmail:"Invalid email address format",inviteFailed:"Failed to invite member",seatLimitReached:"Seat limit reached",memberLimitReached:"Member limit reached",role:"Role",you:"You",owner:"Owner",noMembers:"No members found in this workspace.",extraSeatCost:"Each additional member adds {price}/{interval, select, yearly {yr} quarterly {qtr} other {mo}} to your subscription",unknownUser:"Unknown User",seats:"Seats",members:"Members",included:"included",perExtraSeat:"/extra seat",maxMembers:"max members",available:"available",noMemberLimit:"No member limit",seatHeading:"{hasSeatPricing, select, true {Seats} other {Members}}",limitReached:"{reason, select, seat_limit_reached {Seat limit reached} other {Member limit reached}}",memberCount:"{count, plural, one {# member} other {# members}}",subscriptionRequired:"A subscription is required to invite members.",seatLimitMessage:"Your plan allows up to {maxUsers, number} members. Upgrade for more seats.",settingsLimitMessage:"This workspace allows up to {maxUsers, number} members.",memberLimitMessage:"Member limit of {maxUsers, number} reached.",selectRole:"Select a role",inviteAs:"Invite as {role}"},invoices:{title:"Billing History",description:"View and download your invoices",pay:"Pay",view:"View",viewDetails:"View Details",download:"PDF",errorLoading:"Error loading invoices",noInvoices:"No invoices yet. Subscribe to a plan to receive invoices.",noInvoicesWithSub:"No invoices with download option found",paidAmount:"Paid: {amount}",na:"N/A",status:{draft:"Draft",open:"Open",paid:"Paid",uncollectible:"Uncollectible",void:"Void"}},usage:{title:"Usage",description:"Monitor your resource consumption and quotas",totalResources:"Total Resources",overallUsage:"Overall Usage",inOverage:"In Overage",estOverageCost:"Est. Overage Cost",overageDetected:"Overage Detected",overageDescription:"Additional usage will be billed as overage on your next invoice.",overageUnits:"Overage units",rate:"Rate",billableBlocks:"Billable blocks",estimatedCharge:"Estimated charge",noData:"No quota usage data available for this workspace.",noDataHint:"Quotas will appear here once your plan includes metered resources.",used:"used",remaining:"remaining",overLimit:"over limit",percentUsed:"{percent, number}% used",availableRemaining:"{count} remaining",overLimitCount:"{count} over limit",overageWarning:"{count, plural, one {# resource has exceeded the included quota.} other {# resources have exceeded the included quota.}} Additional usage will be billed as overage on your next invoice.",fullyUsed:"Fully used",renewingSoon:"renewing soon",almostFull:"Almost full",overage:"Overage",errorLoading:"Failed to load usage data",perUnit:"/ unit",perUnits:"/ units",rateDisplay:"{rate} {unitSize, plural, =1 {/ unit} other {/ {unitSize, number} units}}",resourcesExceeded:"{count, plural, one {# resource has exceeded the included quota.} other {# resources have exceeded the included quota.}}",estOverageCharges:"Estimated overage charges this period: {amount}",overageRateDisplay:"Overage rate: {rate}",resetDateDisplay:"Usage resets on {date}",daysRemainingDisplay:"{count, plural, one {# day remaining} other {# days remaining}}"},profile:{email:"Email",name:"Name",language:"Language",country:"Country",currency:"Currency",timezone:"Timezone",profileImage:"Profile Image",success:"Profile saved successfully",nameMinLength:"Name must be at least 2 characters.",save:"Save",reset:"Reset"},general:{ownerOnly:"Only the workspace owner can change the workspace settings.",name:"Name",namePlaceholder:"My Awesome Workspace",nameMinLength:"Workspace name must be at least 2 characters.",billingCurrency:"Billing currency",icon:"Icon",iconDescription:"Choose an emoji or upload a custom image for your workspace.",imageUrl:"Image URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats.",previewLabel:"Preview:",success:"Workspace settings saved successfully",chooseEmoji:"Choose Emoji",customImageUrl:"Custom Image URL",updateWorkspace:"Update Workspace"},features:{title:"Workspace Features",ownerOnly:"Only the workspace owner can change the features.",noFeatures:"Workspace has no features to manage.",enabled:"enabled",disabled:"disabled",enabling:"Enabling",disabling:"Disabling",featureSuccess:"successfully",updateSuccess:"{feature} {enabled, select, true {enabled} other {disabled}} successfully",actionStatus:"{action, select, enabling {Enabling} disabling {Disabling} other {}}"},danger:{title:"Delete Workspace",adminOnly:"Only workspace admins can delete workspaces.",deleteWorkspace:"Delete Workspace",deleteConfirm:"Are you absolutely sure?",deleteWarning:"This action cannot be undone. This will permanently delete the workspace and all associated data.",deleting:"Deleting...",deleteDescription:"Once you delete a workspace, there is no going back. This will permanently delete the workspace and all of its data, including members, settings, and features.",deleteConfirmDescription:"This action cannot be undone. This will permanently delete the workspace and all of its data.",failedToDelete:"Failed to delete workspace"},notifications:{title:"Notification Preferences",permissionDenied:"Notification permission denied",notSupported:"Push notifications are not supported in this browser.",manageDescription:"Manage how you receive notifications from this workspace.",blocked:"Notifications Blocked",blockedDescription:"You previously blocked notifications for this site. To enable them, update your browser settings:",pushTitle:"Push Notifications",pushEnabledDescription:"You will receive browser notifications for important updates.",pushDisabledDescription:"Get notified about payment issues, trial expiry, and other important updates.",enabling:"Enabling...",disabling:"Disabling...",enable:"Enable",disable:"Disable",toggleAction:"{loading, select, true {{subscribed, select, true {Disabling...} other {Enabling...}}} other {{subscribed, select, true {Disable} other {Enable}}}}",pushDescription:"{subscribed, select, true {You will receive browser notifications for important updates.} other {Get notified about payment issues, trial expiry, and other important updates.}}",deviceNote:"Notifications are sent to this device. Enable on other devices separately.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"Click the lock icon (or shield icon) in the address bar",step2:'Find "Notifications" in the permissions list',step3:'Change from "Blocked" to "Allow"',step4:"Reload this page"},safari:{step1:"Open Safari → Settings → Websites → Notifications",step2:"Find this website in the list",step3:'Change from "Deny" to "Allow"',step4:"Reload this page"},edge:{step1:"Click the lock icon in the address bar",step2:'Click "Permissions for this site"',step3:'Set "Notifications" to "Allow"',step4:"Reload this page"},chrome:{step1:"Click the lock icon (or tune icon) in the address bar",step2:'Click "Site settings"',step3:'Set "Notifications" to "Allow"',step4:"Reload this page"}}},quota:{includedOnly:"{count, number}/mo",includedWithOverage:"{count, number}/mo, then {price} / {unit}",includedHardLimit:"{count, number}/mo (hard limit)",unitFallback:"unit"},pricing:{title:"Choose Your Plan",description:"Compare plans and select the one that fits your needs",currency:"Currency",billingIn:"Billing in",noPlansCurrency:"No plans available for your billing currency.",noPlansCurrencyHint:"Something went wrong. Please contact support.",noPlans:"No plans available",free:"Free",included:"included",save:"Save",current:"Current",processing:"Processing...",unavailable:"Unavailable",selectCurrency:"Select billing currency",billingInterval:"Billing interval"},beta:{nameLabel:"Name",emailLabel:"Email",submitText:"Submit",submittingText:"Submitting...",errorMessage:"An error occurred",tryAgain:"Try Again",privacyConsent:"By submitting this form, you consent to our",privacyPolicy:"Privacy Policy",and:"and",termsOfService:"Terms of Service"},workspace:{switchTitle:"Switch Workspace",switchDescription:"Select a workspace to switch to or create a new one.",notLoggedIn:"Looks like you are not logged in. Please login to continue.",availableWorkspaces:"Available Workspaces ({count, number})",loadingWorkspaces:"Loading workspaces...",searchPlaceholder:"Search workspaces...",noWorkspacesFound:"No workspaces found",noWorkspacesAvailable:"No workspaces available",switchTo:"Switch to",membersCount:"{count, plural, one {# member} other {# members}}",createNew:"Create New Workspace",createTitle:"Create New Workspace",createDescription:"Create a new workspace to get started.",workspaceName:"Workspace Name",workspaceNamePlaceholder:"My Awesome Workspace",workspaceNameMinLength:"Workspace name must be at least 2 characters.",workspaceIcon:"Workspace Icon",iconDescription:"Choose an emoji or upload a custom image for your workspace.",chooseEmoji:"Choose Emoji",customImageUrl:"Custom Image URL",imageUrl:"Image URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats.",invalidUrl:"Please enter a valid URL",creating:"Creating...",createWorkspace:"Create Workspace"},dropdowns:{search:"Search...",chooseOption:"Choose option",chooseCountry:"Choose country",searchCountry:"Choose country...",chooseLanguage:"Choose language",searchLanguage:"Choose language...",chooseCurrency:"Choose currency",searchCurrency:"Choose currency...",chooseTimezone:"Choose timezone",searchTimezone:"Choose timezone..."},push:{failedToSubscribe:"Failed to subscribe to push notifications",failedToUnsubscribe:"Failed to unsubscribe from push notifications"},permissions:{title:"Permissions",description:"Permissions assigned to each role in this workspace.",ownerOnly:"Only the workspace owner can manage permissions.",save:"Save Permissions",saving:"Saving...",saveSuccess:"Permissions saved successfully"},credits:{title:"Credits",description:"Credits can be used for premium actions like AI generation.",balance:"Credit Balance",available:"Available",totalGranted:"Total Granted",totalConsumed:"Total Consumed",totalExpired:"Total Expired",noCredits:"No credits yet",noCreditsHint:"Credits will appear here when granted by your plan or purchased.",buyCredits:"Buy Credits",buyAmount:"Buy {count} Credits",purchasing:"Redirecting...",packages:"Credit Packages",noPackages:"No credit packages available.",creditsAmount:"{count} credits",validityDays:"Valid for {count} days",validityUnlimited:"No expiry",transactions:"Recent Transactions",noTransactions:"No transactions yet.",loadMore:"Load More",viewAll:"View All",expiringSoon:"Expiring Soon",expiringInDays:"{count} credits expiring within {days} days",noExpiring:"No credits expiring soon.",type:{plan_grant:"Plan Grant",pack_purchased:"Purchased",consumed:"Consumed",expired:"Expired",admin_grant:"Granted",admin_revoke:"Revoked",refund:"Refund"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"Credits purchased successfully! Your balance has been updated.",purchaseCanceled:"Credit purchase was canceled. No charges were made.",purchaseFailed:"Credit purchase failed. Please try again or contact support.",errorLoading:"Failed to load credit data",insufficientCredits:"Not enough credits"},errors:{networkError:"Network error: Please check your internet connection",unauthorized:"Unauthorized - Please check your session",notFound:"Resource not found",generic:"An error occurred",fetchPlans:"Failed to fetch plans",fetchPlanGroup:"Failed to fetch plan group",fetchPlanGroupVersion:"Failed to fetch plan group version",fetchPlanGroupVersions:"Failed to fetch plan group versions",fetchSubscription:"Failed to fetch subscription",createCheckout:"Failed to create checkout session",updateSubscription:"Failed to update subscription",fetchInvoices:"Failed to fetch invoices",fetchInvoice:"Failed to fetch invoice",openBillingPortal:"Failed to open billing portal",cancelSubscription:"Failed to cancel subscription",resumeSubscription:"Failed to resume subscription",recordUsage:"Failed to record usage",fetchQuotaUsage:"Failed to fetch quota usage status",fetchAllQuotaUsage:"Failed to fetch all quota usage",fetchUsageLogs:"Failed to fetch usage logs",fetchCreditBalance:"Failed to fetch credit balance",consumeCredits:"Failed to consume credits",purchaseCredits:"Failed to purchase credits",fetchCreditPackages:"Failed to fetch credit packages",fetchCreditTransactions:"Failed to fetch credit transactions",fetchExpiringCredits:"Failed to fetch expiring credits"}},mn={en:async()=>pn,es:async()=>(await Promise.resolve().then(function(){return EE})).es,fr:async()=>(await Promise.resolve().then(function(){return AE})).fr,de:async()=>(await Promise.resolve().then(function(){return _E})).de,ja:async()=>(await Promise.resolve().then(function(){return PE})).ja,zh:async()=>(await Promise.resolve().then(function(){return TE})).zh,hi:async()=>(await Promise.resolve().then(function(){return RE})).hi,ar:async()=>(await Promise.resolve().then(function(){return DE})).ar},hn=["en","es","fr","de","ja","zh","hi","ar"];const fn={hi:"hi-u-nu-deva",ar:"ar-u-nu-arab"};const gn=c({messages:pn,locale:"en",formattingLocale:"en"});function bn({locale:e="en",children:t}){const r=function(e){const t=e.toLowerCase().replace("_","-");if(hn.includes(t))return t;const r=t.split("-")[0];return hn.includes(r)?r:"en"}(e),[n,i]=a.useState(pn);a.useEffect(()=>{if("en"===r)return void i(pn);let e=!1;const t=mn[r];return t&&t().then(t=>{e||i(t)}),()=>{e=!0}},[r]);const s=function(e){return fn[e]??e}(r),c=o(()=>({messages:n,locale:r,formattingLocale:s}),[n,r,s]);return a.createElement(gn.Provider,{value:c},t)}const vn=new Map,yn=new Map,wn=new Map;function xn(e,t){return t?`${e}:${JSON.stringify(t)}`:e}const kn={getNumberFormat(e,t){const r=xn(e,t);let n=vn.get(r);return n||(n=new Intl.NumberFormat(e,t),vn.set(r,n)),n},getDateTimeFormat(e,t){const r=xn(e,t);let n=yn.get(r);return n||(n=new Intl.DateTimeFormat(e,t),yn.set(r,n)),n},getPluralRules(e,t){const r=xn(e,t);let n=wn.get(r);return n||(n=new Intl.PluralRules(e,t),wn.set(r,n)),n}},Sn=new Map;function Cn(){const{messages:e,locale:t,formattingLocale:r}=d(gn),n=o(()=>(t,n)=>{const a=t.split(".");let i=e;for(const e of a){if(!i||"object"!=typeof i||!(e in i))return t;i=i[e]}const s="string"==typeof i?i:t;if(!n)return s;try{const e=function(e,t){const r=`${t}:${e}`;let n=Sn.get(r);return n||(n=new un(e,t,void 0,{formatters:kn}),Sn.set(r,n)),n}(s,r),t=e.format(n);return"string"==typeof t?t:String(t)}catch{return s.replace(/\{(\w+)\}/g,(e,t)=>String(n[t]??`{${t}}`))}},[e,r]),a="ar"===t?"rtl":"ltr",i=o(()=>e=>e.toLocaleString(r),[r]),s=o(()=>(e,t)=>{const n=(t??"").trim().toUpperCase();if(!n)return(e/100).toLocaleString(r,{minimumFractionDigits:2});try{return new Intl.NumberFormat(r,{style:"currency",currency:n,minimumFractionDigits:2}).format(e/100)}catch{return(e/100).toLocaleString(r,{minimumFractionDigits:2})}},[r]);return{t:n,locale:t,formattingLocale:r,dir:a,fmtNum:i,fmtCents:s,messages:e}}function Nn(e){if("undefined"==typeof window)return null;try{return localStorage.getItem(e)}catch(t){return $e(t,{component:"storage",action:"getStorageItem",metadata:{key:e}}),null}}function En(e,t){if("undefined"!=typeof window)try{localStorage.setItem(e,t)}catch(t){$e(t,{component:"storage",action:"setStorageItem",metadata:{key:e}})}}function An(e){if("undefined"!=typeof window)try{localStorage.removeItem(e)}catch(t){$e(t,{component:"storage",action:"removeStorageItem",metadata:{key:e}})}}const _n="saas-session-id",Pn="code";function Tn(e){En(_n,e)}function Rn(){return function(){if("undefined"==typeof window)return null;try{return Nn(_n)}catch(e){return $e(e,{component:"auth-utils",action:"getSessionId",metadata:{key:_n}}),null}}()}function Dn(){if("undefined"==typeof window)return null;try{return new URLSearchParams(window.location.search).get(Pn)}catch(e){return $e(e,{component:"auth-utils",action:"getTokenFromUrl",metadata:{param:Pn}}),null}}const In="SDK is not ready (missing serverUrl, version, or orgId)";class Mn{constructor(e){this.serverUrl=e.serverUrl,this.version=e.version,this.orgId=e.orgId,this.requireOrgId=e.requireOrgId??!1,this.basePath=e.basePath??"public",this._sessionId=e.sessionId,this._timeout=e.timeout??3e4,this._maxRetries=e.maxRetries??0,this._debug=e.debug??!1,this._customHeaders=e.headers??{},this._onError=e.onError,this._onUnauthorized=e.onUnauthorized,this._fetch=e.fetch??globalThis.fetch}ensureReady(){if(!this.serverUrl?.trim()||!this.version)throw new Error(In);if(this.requireOrgId&&!this.orgId?.trim())throw new Error(In)}get baseUrl(){return this.ensureReady(),`${this.serverUrl}/api/${this.version}/${this.basePath}`}getAuthHeaders(){return this._sessionId?{"x-session-id":this._sessionId}:function(){const e=Rn(),t={};return e&&(t["x-session-id"]=e),t}()}url(e){const t=e.startsWith("/")?e.slice(1):e;return`${this.baseUrl.endsWith("/")?this.baseUrl.slice(0,-1):this.baseUrl}/${t}`}buildHeaders(e){const t={...this._customHeaders,...this.getAuthHeaders()};return e.headers&&Object.assign(t,e.headers),null==e.body||t["Content-Type"]||(t["Content-Type"]="application/json"),t}async executeFetch(e,t){const r=this.url(e),n=(t.method??"GET").toUpperCase(),a=this.buildHeaders(t),i={...t,headers:a};let s;if(this._timeout>0){const e=new AbortController;s=setTimeout(()=>e.abort(),this._timeout),i.signal=t.signal?AbortSignal.any([t.signal,e.signal]):e.signal}const o=async t=>{try{const e=this._fetch.bind(globalThis),a=await e(r,i);if(this._debug&&console.log(`[BuildBase] ${n} ${r} → ${a.status}`),401===a.status&&this._onUnauthorized&&this._onUnauthorized(),a.status>=500&&t<this._maxRetries){const e=Math.min(1e3*Math.pow(2,t),1e4);return this._debug&&console.log(`[BuildBase] Retrying in ${e}ms (attempt ${t+1}/${this._maxRetries})`),await new Promise(t=>setTimeout(t,e)),o(t+1)}return a}catch(r){if(r instanceof Error&&"AbortError"===r.name){if(void 0!==s){const t=new Error(`Request timeout after ${this._timeout}ms: ${n} ${e}`);throw this._onError?.(t,{method:n,path:e}),t}throw r}if(t<this._maxRetries){const e=Math.min(1e3*Math.pow(2,t),1e4);return this._debug&&console.log(`[BuildBase] Network error, retrying in ${e}ms (attempt ${t+1}/${this._maxRetries})`),await new Promise(t=>setTimeout(t,e)),o(t+1)}throw r instanceof Error&&this._onError?.(r,{method:n,path:e}),r}};try{return await o(0)}finally{void 0!==s&&clearTimeout(s)}}async fetchJson(e,t={},r="Request failed"){this.ensureReady();try{const n=await this.executeFetch(e,t);return await Ge(n,r)}catch(r){throw r instanceof Error&&this._onError?.(r,{method:(t.method??"GET").toUpperCase(),path:e}),r}}async fetchResponse(e,t={}){return this.ensureReady(),this.executeFetch(e,t)}async throwResponseError(e,t){let r=t;try{r=(await e.json()).message||r}catch{r=`${t} (${e.status}: ${e.statusText})`}throw new Error(r)}async unwrapResponse(e,t){const r=await e.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||t);return r.data||r}return r}}class Un extends Mn{constructor(e){super({...e,requireOrgId:!0})}async getWorkspaces(){return this.fetchJson("workspaces",{},"Failed to fetch workspaces")}async createWorkspace(e){return this.fetchJson("workspaces",{method:"POST",body:JSON.stringify(e)},"Failed to create workspace")}async updateWorkspace(e,t){return this.fetchJson(`workspaces/${e}`,{method:"PUT",body:JSON.stringify(t)},"Failed to update workspace")}async deleteWorkspace(e){return this.fetchJson(`workspaces/${e}`,{method:"DELETE"},"Failed to delete workspace")}async getWorkspaceUsers(e){return this.fetchJson(`workspaces/${e}/users`,{},"Failed to fetch workspace users")}async addUser(e,t){return this.fetchJson(`workspaces/${e}/users/add`,{method:"POST",body:JSON.stringify(t)},"Failed to invite member")}async removeUser(e,t){return this.fetchJson(`workspaces/${e}/users/${t}`,{method:"DELETE"},"Failed to remove user")}async updateUser(e,t,r){return this.fetchJson(`workspaces/${e}/users/${t}`,{method:"PATCH",body:JSON.stringify(r)},"Failed to update user")}async updateSettings(e){return this.fetchJson("workspaces/settings",{method:"PATCH",body:JSON.stringify(e)},"Failed to update workspace settings")}async updateWorkspacePermissions(e,t){return this.fetchJson(`workspaces/${e}/permissions`,{method:"PATCH",body:JSON.stringify({permissions:t})},"Failed to update workspace permissions")}async getFeatures(){return this.fetchJson("workspaces/features",{},"Failed to fetch features")}async updateFeature(e,t,r){return this.fetchJson(`workspaces/${e}/features`,{method:"PATCH",body:JSON.stringify({features:{[t]:r}})},"Failed to update feature")}async getWorkspace(e){return this.fetchJson(`workspaces/${e}`,{},"Failed to fetch workspace")}async getProfile(){return this.fetchJson("profile",{},"Failed to fetch profile")}async updateUserProfile(e){return this.fetchJson("profile",{method:"PATCH",body:JSON.stringify(e)},"Failed to update user profile")}async getCurrentSubscription(e){const t=await this.fetchResponse(`workspaces/${e}/subscription`);return t.ok||await this.throwResponseError(t,"Failed to fetch subscription"),this.unwrapResponse(t,"Failed to fetch subscription")}async getPlanGroup(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/plan-group`);return t.ok||await this.throwResponseError(t,"Failed to fetch plan group"),this.unwrapResponse(t,"Failed to fetch plan group")}async getPlanGroupByVersion(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/plan-group?groupVersionId=${encodeURIComponent(t)}`);return r.ok||await this.throwResponseError(r,"Failed to fetch plan group version"),this.unwrapResponse(r,"Failed to fetch plan group version")}async getPlanGroupVersions(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/plan-group/versions`);return t.ok||await this.throwResponseError(t,"Failed to fetch plan group versions"),this.unwrapResponse(t,"Failed to fetch plan group versions")}async getPublicPlans(e){if(!this.orgId)throw new Error("orgId is required for getPublicPlans");const t=await this.fetchResponse(`${this.orgId}/plans/${encodeURIComponent(e)}`);return t.ok||await this.throwResponseError(t,"Failed to fetch plans"),this.unwrapResponse(t,"Failed to fetch plans")}async getPublicCreditPackages(){if(!this.orgId)throw new Error("orgId is required for getPublicCreditPackages");const e=await this.fetchResponse(`${this.orgId}/credit-packages`);return e.ok||await this.throwResponseError(e,"Failed to fetch credit packages"),this.unwrapResponse(e,"Failed to fetch credit packages")}async getPlanGroupVersion(e){const t=await this.fetchResponse(`plan-group-versions/${e}`);return t.ok||await this.throwResponseError(t,"Failed to fetch plan group version"),this.unwrapResponse(t,"Failed to fetch plan group version")}async createCheckoutSession(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/checkout`,{method:"POST",body:JSON.stringify(t)});return r.ok||await this.throwResponseError(r,"Failed to create checkout session"),this.unwrapResponse(r,"Failed to create checkout session")}async selectFreePlan(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/select-free-plan`,{method:"POST",body:JSON.stringify({planVersionId:t})});return r.ok||await this.throwResponseError(r,"Failed to select free plan"),r.json()}async updateSubscription(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription`,{method:"PATCH",body:JSON.stringify(t)});return r.ok||await this.throwResponseError(r,"Failed to update subscription"),this.unwrapResponse(r,"Failed to update subscription")}async createBillingPortalSession(e,t){return this.fetchJson(`workspaces/${e}/subscription/billing-portal`,{method:"POST",body:JSON.stringify(t?{returnUrl:t}:{})})}async listInvoices(e,t=10,r){const n=new URLSearchParams;n.append("limit",t.toString()),r&&n.append("starting_after",r);const a=await this.fetchResponse(`workspaces/${e}/subscription/invoices?${n.toString()}`);return a.ok||await this.throwResponseError(a,"Failed to fetch invoices"),this.unwrapResponse(a,"Failed to fetch invoices")}async getInvoice(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/invoices/${t}`);return r.ok||await this.throwResponseError(r,"Failed to fetch invoice"),this.unwrapResponse(r,"Failed to fetch invoice")}async cancelSubscriptionAtPeriodEnd(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/cancel-at-period-end`,{method:"POST"});return t.ok||await this.throwResponseError(t,"Failed to cancel subscription"),this.unwrapResponse(t,"Failed to cancel subscription")}async resumeSubscription(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/resume`,{method:"POST"});return t.ok||await this.throwResponseError(t,"Failed to resume subscription"),this.unwrapResponse(t,"Failed to resume subscription")}async recordUsage(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/usage`,{method:"POST",body:JSON.stringify(t)});return r.ok||await this.throwResponseError(r,"Failed to record usage"),this.unwrapResponse(r,"Failed to record usage")}async recordUsageBatch(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/usage/batch`,{method:"POST",body:JSON.stringify(t)});return r.ok||await this.throwResponseError(r,"Failed to record batch usage"),this.unwrapResponse(r,"Failed to record batch usage")}async getQuotaUsageStatus(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/usage/status?quotaSlug=${encodeURIComponent(t)}`);return r.ok||await this.throwResponseError(r,"Failed to fetch quota usage status"),this.unwrapResponse(r,"Failed to fetch quota usage status")}async getAllQuotaUsage(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/usage/all`);return t.ok||await this.throwResponseError(t,"Failed to fetch all quota usage"),this.unwrapResponse(t,"Failed to fetch all quota usage")}async getUsageLogs(e,t){const r=new URLSearchParams;t?.quotaSlug&&r.append("quotaSlug",t.quotaSlug),t?.from&&r.append("from",t.from),t?.to&&r.append("to",t.to),t?.source&&r.append("source",t.source),t?.page&&r.append("page",t.page.toString()),t?.limit&&r.append("limit",t.limit.toString());const n=r.toString(),a=`workspaces/${e}/subscription/usage/logs${n?`?${n}`:""}`,i=await this.fetchResponse(a);return i.ok||await this.throwResponseError(i,"Failed to fetch usage logs"),this.unwrapResponse(i,"Failed to fetch usage logs")}async sendNotification(e,t,r,n){const a={event:t};return r&&(a.userId=r),n&&(a.data=n),this.fetchJson(`workspaces/${e}/notifications/send`,{method:"POST",body:JSON.stringify(a)},"Failed to send notification")}async getNotificationEvents(e){return this.fetchJson(`workspaces/${e}/notification-events`,{},"Failed to fetch notification events")}async getNotificationPreferences(e){return(await this.fetchJson(`workspaces/${e}/notification-preferences`,{},"Failed to fetch notification preferences")).notificationPreferences??{}}async updateNotificationPreferences(e,t){return(await this.fetchJson(`workspaces/${e}/notification-preferences`,{method:"PATCH",body:JSON.stringify({notificationPreferences:t})},"Failed to update notification preferences")).notificationPreferences??{}}async getCreditBalance(e){const t=await this.fetchResponse(`workspaces/${e}/credits`);return t.ok||await this.throwResponseError(t,"Failed to fetch credit balance"),this.unwrapResponse(t,"Failed to fetch credit balance")}async consumeCredits(e,t){const r=await this.fetchResponse(`workspaces/${e}/credits/consume`,{method:"POST",body:JSON.stringify(t)});if(!r.ok){if(402===r.status){const e=await r.json().catch(()=>({})),t=new Error(e.message||"Insufficient credits");throw t.available=e.available,t.requested=e.requested,t.code="INSUFFICIENT_CREDITS",t}await this.throwResponseError(r,"Failed to consume credits")}return this.unwrapResponse(r,"Failed to consume credits")}async purchaseCredits(e,t){const r=await this.fetchResponse(`workspaces/${e}/credits/purchase`,{method:"POST",body:JSON.stringify(t)});return r.ok||await this.throwResponseError(r,"Failed to create credit purchase checkout"),this.unwrapResponse(r,"Failed to create credit purchase checkout")}async getCreditPackages(e){const t=await this.fetchResponse(`workspaces/${e}/credits/packages`);t.ok||await this.throwResponseError(t,"Failed to fetch credit packages");const r=await this.unwrapResponse(t,"Failed to fetch credit packages");return r.docs??r}async getCreditTransactions(e,t){const r=new URLSearchParams;t?.type&&r.append("type",t.type),t?.page&&r.append("page",t.page.toString()),t?.limit&&r.append("limit",t.limit.toString());const n=r.toString(),a=`workspaces/${e}/credits/transactions${n?`?${n}`:""}`,i=await this.fetchResponse(a);return i.ok||await this.throwResponseError(i,"Failed to fetch credit transactions"),this.unwrapResponse(i,"Failed to fetch credit transactions")}async getCreditBuckets(e,t){const r=new URLSearchParams;t?.status&&r.append("status",t.status),t?.source&&r.append("source",t.source),t?.page&&r.append("page",t.page.toString()),t?.limit&&r.append("limit",t.limit.toString());const n=r.toString(),a=`workspaces/${e}/credits/buckets${n?`?${n}`:""}`,i=await this.fetchResponse(a);return i.ok||await this.throwResponseError(i,"Failed to fetch credit buckets"),this.unwrapResponse(i,"Failed to fetch credit buckets")}async getExpiringCredits(e,t){const r=t?`?days=${t}`:"",n=await this.fetchResponse(`workspaces/${e}/credits/expiring${r}`);return n.ok||await this.throwResponseError(n,"Failed to fetch expiring credits"),this.unwrapResponse(n,"Failed to fetch expiring credits")}}function Ln(){const e=mt(),t=Ct(),r=Vt();return o(()=>({auth:e,os:t,workspaces:r}),[e,t,r])}function On(e,t){const r=St(),n=pt(),a=Wt(),i=e||(e=>e);return tt(o(()=>({os:r,auth:n,workspaces:a}),[r,n,a]),i,t)}function zn(e,t,r){u(()=>{const t=new AbortController;return e(t.signal).catch(e=>{We(e)||(r?.onError?r.onError(e):$e(e,{component:"useAsyncEffect",action:"effect",metadata:{note:"Unhandled rejection - consider passing onError"}}))}),()=>t.abort()},t)}class Fn extends Mn{constructor(e){super({...e,requireOrgId:!0})}async getSettings(e){return this.fetchJson(`${this.orgId}/settings`,{signal:e},"Failed to fetch settings")}}function Bn(){return On(e=>e.os)}let Wn=null;function Vn(){const e=Ln(),t=Bn(),{serverUrl:r,version:n,orgId:a,settings:i}=t,s=o(()=>bt(t)?new Fn({serverUrl:r,version:n,orgId:a}):null,[r,n,a]),c=p(async t=>s?Wn||(Wn=(async()=>{try{const r=await s.getSettings(t);return e.os(ft(r)),r}catch(e){return Ke(e,{component:"useSaaSSettings",action:"getSettings",metadata:{serverUrl:r,version:n,orgId:a}}),null}finally{Wn=null}})(),Wn):null,[s,e,r,n,a]);return zn(async e=>{i||bt(t)&&await c(e)},[r,n,a],{onError:e=>Ke(e,{component:"useSaaSSettings",action:"fetchSettings",metadata:{serverUrl:r,version:n,orgId:a}})}),o(()=>({settings:i,getSettings:c}),[i,c])}function Gn(){const e=Bn(),t=p(()=>{e.auth?.callbacks?.onSessionExpired?.("expired")},[e.auth?.callbacks?.onSessionExpired]),r=function(e,t){return o(()=>new Un({...e,onUnauthorized:t}),[e.serverUrl,e.version,e.orgId,t])}(e,t);return o(()=>({os:e,api:r}),[e,r])}const Hn=e=>{const{t:t}=Cn(),{os:r,api:n}=Gn(),a=bt(r),[i,s]=m(null),[o,c]=m(!1),[l,d]=m(null),h=p(async()=>{if(e&&a){c(!0),d(null);try{const t=await n.getPublicPlans(e);s(t)}catch(r){const n=qe(r,"errors.fetchPlans",t);d(n),$e(r,{component:"usePublicPlans",action:"fetchPlans",metadata:{slug:e}})}finally{c(!1)}}else s(null)},[n,e,a]);u(()=>{h()},[h]);const f=e&&!a||o;return{items:i?.items??[],plans:i?.plans??[],notes:i?.notes,loading:f,error:l,refetch:h}},jn=e=>{const{t:t}=Cn(),{api:r}=Gn(),[n,a]=m(null),[i,s]=m(!1),[o,c]=m(null),l=p(async()=>{if(e){s(!0),c(null);try{const t=await r.getPlanGroupVersion(e);a(t)}catch(r){const n=qe(r,"errors.fetchPlanGroupVersion",t);c(n),$e(r,{component:"usePublicPlanGroupVersion",action:"fetchVersion",metadata:{groupVersionId:e}})}finally{s(!1)}}else a(null)},[r,e]);return u(()=>{l()},[l]),{planGroupVersion:n,loading:i,error:o,refetch:l}},$n=e=>{const{t:t}=Cn(),{api:r}=Gn(),[n,a]=m(null),[i,s]=m(!1),[o,c]=m(null),l=p(async()=>{if(e){s(!0),c(null);try{const t=await r.getCurrentSubscription(e);a(t)}catch(r){const n=qe(r,"errors.fetchSubscription",t);c(n),$e(r,{component:"useSubscription",action:"fetchSubscription",metadata:{workspaceId:e}})}finally{s(!1)}}else a(null)},[r,e]);return u(()=>{l()},[l]),{subscription:n,loading:i,error:o,refetch:l}},Kn=(e,t)=>{const{t:r}=Cn(),{api:n}=Gn(),[a,i]=m(null),[s,o]=m(!1),[c,l]=m(null),d=p(async()=>{if(e){o(!0),l(null);try{const r=t?await n.getPlanGroupByVersion(e,t):await n.getPlanGroup(e);i(r)}catch(n){const a=qe(n,"errors.fetchPlanGroup",r);l(a),$e(n,{component:"usePlanGroup",action:"fetchPlanGroup",metadata:{workspaceId:e,groupVersionId:t}})}finally{o(!1)}}else i(null)},[n,e,t]);return u(()=>{d()},[d]),{planGroup:a,loading:s,error:c,refetch:d}},qn=e=>{const{t:t}=Cn(),{api:r}=Gn(),[n,a]=m(null),[i,s]=m(!1),[o,c]=m(null),l=p(async()=>{if(e){s(!0),c(null);try{const t=await r.getPlanGroupVersions(e);a(t)}catch(r){const n=qe(r,"errors.fetchPlanGroupVersions",t);c(n),$e(r,{component:"usePlanGroupVersions",action:"fetchVersions",metadata:{workspaceId:e}})}finally{s(!1)}}else a(null)},[r,e]);return u(()=>{l()},[l]),{versions:n,loading:i,error:o,refetch:l}},Zn=e=>{const{t:t}=Cn(),{api:r}=Gn(),{getCheckoutStripeParams:n}=d(Ht),[a,i]=m(!1),[s,o]=m(null);return{createCheckoutSession:p(async a=>{if(!e)throw new Error("Workspace ID is required");i(!0),o(null);try{let t=a;if(n){const e=await n(a);e&&(t={...a,stripeOptions:{...a.stripeOptions,...e,metadata:{...a.stripeOptions?.metadata,...e.metadata},subscriptionMetadata:{...a.stripeOptions?.subscriptionMetadata,...e.subscriptionMetadata}}})}const i=await r.createCheckoutSession(e,t);return"trial_started"===i.type&&(Xt(),Zt()),i}catch(r){const n=qe(r,"errors.createCheckout",t);throw o(n),$e(r,{component:"useCreateCheckoutSession",action:"createCheckoutSession",metadata:{workspaceId:e,request:a}}),r}finally{i(!1)}},[r,e,n]),loading:a,error:s}},Jn=e=>{const{t:t}=Cn(),{api:r}=Gn(),[n,a]=m(!1),[i,s]=m(null),o=p(async(n,i)=>{if(!e)throw new Error("Workspace ID is required");a(!0),s(null);try{const t={planVersionId:n,...i?.billingInterval&&{billingInterval:i.billingInterval},...i?.successUrl&&{successUrl:i.successUrl},...i?.cancelUrl&&{cancelUrl:i.cancelUrl}},a=await r.updateSubscription(e,t);return Xt(),a}catch(r){const a=qe(r,"errors.updateSubscription",t);throw s(a),$e(r,{component:"useUpdateSubscription",action:"updateSubscription",metadata:{workspaceId:e,planVersionId:n,options:i}}),r}finally{a(!1)}},[r,e]);return{updateSubscription:o,loading:n,error:i}},Yn=(e,t)=>{const r=$n(e),n=Kn(e,t),a=Jn(e),i=p(async()=>{await Promise.all([r.refetch(),n.refetch()])},[r.refetch,n.refetch]);return{subscription:r.subscription,planGroup:n.planGroup,loading:r.loading||n.loading||a.loading,error:r.error||n.error||a.error,updateSubscription:a.updateSubscription,refetch:i}},Xn=(e,t=10,r)=>{const{t:n}=Cn(),{api:a}=Gn(),[i,s]=m([]),[o,c]=m(!1),[l,d]=m(!1),[h,f]=m(null),g=p(async()=>{if(!e)return s([]),void c(!1);d(!0),f(null);try{const n=await a.listInvoices(e,t,r);s(n.invoices||[]),c(n.has_more||!1)}catch(a){const i=qe(a,"errors.fetchInvoices",n);f(i),$e(a,{component:"useInvoices",action:"fetchInvoices",metadata:{workspaceId:e,limit:t,startingAfter:r}})}finally{d(!1)}},[a,e,t,r]);return u(()=>{g()},[g]),{invoices:i,hasMore:o,loading:l,error:h,refetch:g}},Qn=e=>{const{t:t}=Cn(),{api:r}=Gn(),[n,a]=m(!1),[i,s]=m(null);return{openBillingPortal:p(async n=>{if(!e)throw new Error("Workspace ID is required");a(!0),s(null);try{const t=n||window.location.href,a=await r.createBillingPortalSession(e,t);return a.url&&window.open(a.url,"_blank","noopener,noreferrer"),a}catch(r){const n=qe(r,"errors.openBillingPortal",t);throw s(n),$e(r,{component:"useBillingPortal",action:"openBillingPortal",metadata:{workspaceId:e}}),r}finally{a(!1)}},[e,r]),loading:n,error:i}},ea=(e,t)=>{const{t:r}=Cn(),{api:n}=Gn(),[a,i]=m(null),[s,o]=m(!1),[c,l]=m(null),d=p(async()=>{if(e&&t){o(!0),l(null);try{const r=await n.getInvoice(e,t);i(r.invoice)}catch(n){const a=qe(n,"errors.fetchInvoice",r);l(a),$e(n,{component:"useInvoice",action:"fetchInvoice",metadata:{workspaceId:e,invoiceId:t}})}finally{o(!1)}}else i(null)},[n,e,t]);return u(()=>{d()},[d]),{invoice:a,loading:s,error:c,refetch:d}},ta=e=>{const{t:t}=Cn(),{api:r}=Gn(),[n,a]=m(!1),[i,s]=m(null);return{cancelSubscription:p(async()=>{if(!e)throw new Error("Workspace ID is required");a(!0),s(null);try{const t=await r.cancelSubscriptionAtPeriodEnd(e);return Xt(),t}catch(r){const n=qe(r,"errors.cancelSubscription",t);throw s(n),$e(r,{component:"useCancelSubscription",action:"cancelSubscription",metadata:{workspaceId:e}}),r}finally{a(!1)}},[r,e]),loading:n,error:i}},ra=e=>{const{t:t}=Cn(),{api:r}=Gn(),[n,a]=m(!1),[i,s]=m(null);return{resumeSubscription:p(async()=>{if(!e)throw new Error("Workspace ID is required");a(!0),s(null);try{const t=await r.resumeSubscription(e);return Xt(),t}catch(r){const n=qe(r,"errors.resumeSubscription",t);throw s(n),$e(r,{component:"useResumeSubscription",action:"resumeSubscription",metadata:{workspaceId:e}}),r}finally{a(!1)}},[r,e]),loading:n,error:i}},na=e=>{const{t:t}=Cn(),{api:r}=Gn(),[n,a]=m(!1),[i,s]=m(null);return{recordUsage:p(async n=>{if(!e)throw new Error("Workspace ID is required");a(!0),s(null);try{const t=await r.recordUsage(e,n);return Zt(),t}catch(r){const a=qe(r,"errors.recordUsage",t);throw s(a),$e(r,{component:"useRecordUsage",action:"recordUsage",metadata:{workspaceId:e,request:n}}),r}finally{a(!1)}},[r,e]),loading:n,error:i}},aa=(e,t)=>{const{t:r}=Cn(),{api:n}=Gn(),[a,i]=m(null),[s,o]=m(!1),[c,l]=m(null),d=p(async()=>{if(e&&t){o(!0),l(null);try{const r=await n.getQuotaUsageStatus(e,t);i(r)}catch(n){const a=qe(n,"errors.fetchQuotaUsage",r);l(a),$e(n,{component:"useQuotaUsageStatus",action:"fetchStatus",metadata:{workspaceId:e,quotaSlug:t}})}finally{o(!1)}}else i(null)},[n,e,t]);return u(()=>{d()},[d]),{status:a,loading:s,error:c,refetch:d}},ia=e=>{const{t:t}=Cn(),{api:r}=Gn(),[n,a]=m(null),[i,s]=m(!1),[o,c]=m(null),l=p(async()=>{if(e){s(!0),c(null);try{const t=await r.getAllQuotaUsage(e);a(t.quotas)}catch(r){const n=qe(r,"errors.fetchAllQuotaUsage",t);c(n),$e(r,{component:"useAllQuotaUsage",action:"fetchAllUsage",metadata:{workspaceId:e}})}finally{s(!1)}}else a(null)},[r,e]);return u(()=>{l()},[l]),{quotas:n,loading:i,error:o,refetch:l}},sa=(e,t,r)=>{const{t:n}=Cn(),{api:a}=Gn(),[i,s]=m([]),[o,c]=m(0),[l,d]=m(0),[h,f]=m(1),[g,b]=m(!1),[v,y]=m(!1),[w,x]=m(!1),[k,S]=m(null),C=r?.from,N=r?.to,E=r?.source,A=r?.page,_=r?.limit,P=p(async()=>{if(!e)return s([]),c(0),d(0),f(1),b(!1),void y(!1);x(!0),S(null);try{const r={...t&&{quotaSlug:t},...C&&{from:C},...N&&{to:N},...E&&{source:E},...A&&{page:A},..._&&{limit:_}},n=await a.getUsageLogs(e,r);s(n.docs||[]),c(n.totalDocs||0),d(n.totalPages||0),f(n.page||1),b(n.hasNextPage||!1),y(n.hasPrevPage||!1)}catch(r){const a=qe(r,"errors.fetchUsageLogs",n);S(a),$e(r,{component:"useUsageLogs",action:"fetchLogs",metadata:{workspaceId:e,quotaSlug:t}})}finally{x(!1)}},[a,e,t,C,N,E,A,_]);return u(()=>{P()},[P]),{logs:i,totalDocs:o,totalPages:l,page:h,hasNextPage:g,hasPrevPage:v,loading:w,error:k,refetch:P}},oa=c(null);oa.displayName="SubscriptionContext";const ca=a.memo(function({children:e}){const r=On(e=>e.workspaces.currentWorkspace),{subscription:n,loading:a,error:i,refetch:s}=$n(r?._id);u(()=>Yt(s),[s]);const c=o(()=>({response:n,loading:a,error:i,refetch:s}),[n,a,i,s]);return t(oa.Provider,{value:c,children:e})});function la(){const e=d(oa);if(null===e)throw new Error("useSubscriptionContext must be used within SubscriptionContextProvider. Make sure SubscriptionContextProvider is wrapping your application (or the tree that uses subscription gates).");return e}ca.displayName="SubscriptionContextProvider";const da=$t(),ua=da.subscribe,pa=da.invalidate,ma=e=>{const{t:t}=Cn(),{api:r}=Gn(),[n,a]=m(null),[i,s]=m(!1),[o,c]=m(null),l=p(async()=>{if(e){s(!0),c(null);try{const t=await r.getCreditBalance(e);a(t)}catch(r){const n=qe(r,"errors.fetchCreditBalance",t);c(n),$e(r,{component:"useCreditBalance",action:"fetchBalance",metadata:{workspaceId:e}})}finally{s(!1)}}else a(null)},[r,e]);return u(()=>{l()},[l]),{balance:n,loading:i,error:o,refetch:l}},ha=e=>{const{t:t}=Cn(),{api:r}=Gn(),[n,a]=m(!1),[i,s]=m(null);return{consumeCredits:p(async n=>{if(!e)throw new Error("Workspace ID is required");a(!0),s(null);try{const t=await r.consumeCredits(e,n);return pa(),t}catch(r){const a="INSUFFICIENT_CREDITS"===r.code?`Insufficient credits. Available: ${r.available}, requested: ${r.requested}`:qe(r,"errors.consumeCredits",t);throw s(a),$e(r,{component:"useConsumeCredits",action:"consumeCredits",metadata:{workspaceId:e,request:n}}),r}finally{a(!1)}},[r,e]),loading:n,error:i}},fa=e=>{const{t:t}=Cn(),{api:r}=Gn(),[n,a]=m(!1),[i,s]=m(null);return{purchaseCredits:p(async n=>{if(!e)throw new Error("Workspace ID is required");a(!0),s(null);try{return await r.purchaseCredits(e,n)}catch(r){const a=qe(r,"errors.purchaseCredits",t);throw s(a),$e(r,{component:"usePurchaseCredits",action:"purchaseCredits",metadata:{workspaceId:e,request:n}}),r}finally{a(!1)}},[r,e]),loading:n,error:i}},ga=e=>{const{t:t}=Cn(),{api:r}=Gn(),[n,a]=m([]),[i,s]=m(!1),[o,c]=m(null),l=p(async()=>{if(e){s(!0),c(null);try{const t=await r.getCreditPackages(e);a(t)}catch(r){const n=qe(r,"errors.fetchCreditPackages",t);c(n),$e(r,{component:"useCreditPackages",action:"fetchPackages",metadata:{workspaceId:e}})}finally{s(!1)}}else a([])},[r,e]);return u(()=>{l()},[l]),{packages:n,loading:i,error:o,refetch:l}},ba=(e,t)=>{const{t:r}=Cn(),{api:n}=Gn(),[a,i]=m([]),[s,o]=m(0),[c,l]=m(0),[d,h]=m(1),[f,g]=m(!1),[b,v]=m(!1),[y,w]=m(!1),[x,k]=m(null),S=t?.type,C=t?.page,N=t?.limit,E=p(async()=>{if(!e)return i([]),o(0),l(0),h(1),g(!1),void v(!1);w(!0),k(null);try{const t=await n.getCreditTransactions(e,{type:S,page:C,limit:N});i(t.docs||[]),o(t.totalDocs||0),l(t.totalPages||0),h(t.page||1),g(t.hasNextPage||!1),v(t.hasPrevPage||!1)}catch(t){const n=qe(t,"errors.fetchCreditTransactions",r);k(n),$e(t,{component:"useCreditTransactions",action:"fetchTransactions",metadata:{workspaceId:e}})}finally{w(!1)}},[n,e,S,C,N]);return u(()=>{E()},[E]),{transactions:a,totalDocs:s,totalPages:c,page:d,hasNextPage:f,hasPrevPage:b,loading:y,error:x,refetch:E}},va=(e,t)=>{const{t:r}=Cn(),{api:n}=Gn(),[a,i]=m(null),[s,o]=m(!1),[c,l]=m(null),d=p(async()=>{if(e){o(!0),l(null);try{const r=await n.getExpiringCredits(e,t);i(r)}catch(n){const a=qe(n,"errors.fetchExpiringCredits",r);l(a),$e(n,{component:"useExpiringCredits",action:"fetchExpiring",metadata:{workspaceId:e,days:t}})}finally{o(!1)}}else i(null)},[n,e,t]);return u(()=>{d()},[d]),{expiringCredits:a?.expiringCredits??0,buckets:a?.buckets??[],days:a?.days??t??7,loading:s,error:c,refetch:d}},ya=()=>{const{t:e}=Cn(),{os:t,api:r}=Gn(),n=bt(t),[a,i]=m([]),[s,o]=m(),[c,l]=m(!1),[d,h]=m(null),f=p(async()=>{if(n){l(!0),h(null);try{const e=await r.getPublicCreditPackages();i(e.packages||[]),o(e.notes)}catch(t){const r=qe(t,"errors.fetchCreditPackages",e);h(r),$e(t,{component:"usePublicCreditPackages",action:"fetchPackages"})}finally{l(!1)}}else i([])},[r,n]);u(()=>{f()},[f]);return{packages:a,notes:s,loading:!n||c,error:d,refetch:f}},wa=c(null);wa.displayName="CreditBalanceContext";const xa=a.memo(function({children:e}){const r=On(e=>e.workspaces.currentWorkspace),{balance:n,loading:a,error:i,refetch:s}=ma(r?._id);u(()=>ua(s),[s]);const c=o(()=>({balance:n,loading:a,error:i,refetch:s}),[n,a,i,s]);return t(wa.Provider,{value:c,children:e})});function ka(){const e=d(wa);if(null===e)throw new Error("useCreditBalanceContext must be used within CreditBalanceContextProvider. Make sure CreditBalanceContextProvider is wrapping your application (included in SaaSOSProvider by default).");return e}xa.displayName="CreditBalanceContextProvider";const Sa=c({appPermissions:void 0});function Ca({appPermissions:e,children:r}){const n=o(()=>({appPermissions:e}),[e]);return t(Sa.Provider,{value:n,children:r})}function Na(){return d(Sa)}const Ea=c(null);Ea.displayName="QuotaUsageContext";const Aa=a.memo(function({children:e}){const r=On(e=>e.workspaces.currentWorkspace),{quotas:n,loading:a,error:i,refetch:s}=ia(r?._id);u(()=>qt(s),[s]);const c=o(()=>({quotas:n,loading:a,error:i,refetch:s}),[n,a,i,s]);return t(Ea.Provider,{value:c,children:e})});function _a(){const e=d(Ea);if(null===e)throw new Error("useQuotaUsageContext must be used within QuotaUsageContextProvider. Make sure QuotaUsageContextProvider is wrapping your application (or the tree that uses quota gates).");return e}function Pa(e){if(!e||"string"!=typeof e)return null;try{const t=new URL(e);return"https:"===t.protocol?e:"http:"!==t.protocol||"localhost"!==t.hostname&&"127.0.0.1"!==t.hostname&&"::1"!==t.hostname?null:e}catch{return null}}function Ta(e,t="/"){const r=Pa(e);window.location.href=r||t}Aa.displayName="QuotaUsageContextProvider";const Ra="saas-auth-intent";function Da(e){return"object"==typeof e&&null!==e&&"string"==typeof e.returnUrl&&"number"==typeof e.createdAt}function Ia(e){Pa(e)&&function(e,t){try{En(e,JSON.stringify(t))}catch(t){$e(t,{component:"storage",action:"setStorageJSON",metadata:{key:e}})}}(Ra,{returnUrl:e,createdAt:Date.now()})}function Ma(){const e=function(e,t){const r=Nn(e);if(!r)return null;try{const n=JSON.parse(r);return t&&!t(n)?($e(new Error("Storage data failed validation"),{component:"storage",action:"getStorageJSON",metadata:{key:e}}),An(e),null):n}catch(t){return $e(t,{component:"storage",action:"getStorageJSON",metadata:{key:e}}),An(e),null}}(Ra,Da);return An(Ra),e?Date.now()-e.createdAt>6e5?null:Pa(e.returnUrl):null}class Ua extends Mn{constructor(e){super(e)}async requestAuth(e){const t=`${this.serverUrl}/api/${this.version}/auth/request`,r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return r.ok||await this.throwResponseError(r,"Failed to initiate authentication"),r.json()}async getProfile(e,t){return this.fetchJson("profile",{headers:{"x-session-id":e},signal:t},"Failed to fetch user profile")}}const La="bb",Oa="checkout",za="billing",Fa="selectPlan",Ba="creditPurchase",Wa="openCreditStore",Va="success",Ga="cancel",Ha="error",ja="subscription",$a="credits";function Ka(e,t){let r;try{const e=t||("undefined"!=typeof window?window.location.href:"https://localhost");r=new URL(e),r.search=""}catch{r=new URL("https://localhost")}return r.searchParams.set(La,function(e){return Object.entries(e).filter(([,e])=>null!=e&&""!==e).map(([e,t])=>`${encodeURIComponent(e)}:${encodeURIComponent(t)}`).join(",")}(e)),r.toString()}function qa(e,t){const r="undefined"!=typeof window?window.location.href:void 0;return{successUrl:Ka({action:Ba,status:Va,ws:e,screen:$a},r),cancelUrl:Ka({action:Ba,status:Ga,ws:e,screen:$a},r)}}function Za(){if("undefined"==typeof window)return null;try{const e=new URLSearchParams(window.location.search).get(La);if(!e)return null;const t=function(e){const t={};if(!e)return t;const r=e.split(",");for(const e of r){const r=e.indexOf(":");if(-1===r)continue;const n=decodeURIComponent(e.slice(0,r)),a=decodeURIComponent(e.slice(r+1));n&&(t[n]=a)}return t}(e);return Object.keys(t).length>0?t:null}catch{return null}}function Ja(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.has(La)&&(e.searchParams.delete(La),window.history.replaceState({},"",e.toString()))}catch{}}const Ya={Monthly:"monthly",Yearly:"yearly",Quarterly:"quarterly"},Xa="active",Qa="trialing",ei="canceled",ti="past_due",ri="paused",ni="draft",ai="open",ii="paid",si="uncollectible",oi="void",ci="feature",li="limit",di="quota",ui="none",pi="final",mi="suspended",hi="plan_grant",fi="pack_purchased",gi="consumed",bi="expired",vi="admin_grant",yi="admin_revoke",wi="refund";function xi(e,t){const r=e.pricingVariants;if(!r?.length)return null;const n=t.toLowerCase();return r.find(e=>e.currency?.toLowerCase()===n)??null}function ki(e,t,r){const n=xi(e,t);if(!n?.basePricing)return null;const a=n.basePricing[r];return null!=a?a:null}function Si(e,t,r,n){const a=xi(e,t),i=a?.quotaOverages?.[r];if(i)return i[n]}function Ci(e,t,r,n){const a=e.quotas?.[r];if(null==a)return null;const i=a[n];if(!i)return null;const s=Si(e,t,r,n);return{included:i.included,...void 0!==i.unitSize&&{unitSize:i.unitSize},...void 0!==s&&{overage:s},allowOverage:!1!==a.allowOverage}}function Ni(e,t){if(!e)return null;for(const r of t){const t=r.pricingVariants;if(t?.length)for(const r of t){const t=r.stripePrices;if(t){if(t.monthlyPriceId===e||t.monthly===e)return{interval:"monthly",currency:r.currency};if(t.yearlyPriceId===e||t.yearly===e)return{interval:"yearly",currency:r.currency};if(t.quarterlyPriceId===e)return{interval:"quarterly",currency:r.currency}}}}return null}function Ei(e,t){const r=xi(e,t);return r?.seatPricing?.enabled?r.seatPricing:null}function Ai(e,t,r){const n=Ei(e,t);return n?.perSeat?n.perSeat[r]??null:null}function _i(e){const{planVersion:t,currency:r="usd",settingsMaxUsers:n}=e;if(t){const e=Ei(t,r);if(e)return{maxUsers:e.maxSeats??0,source:"seat_pricing",includedSeats:e.includedSeats??0,hasSeatPricing:!0}}return null!=n&&n>0?{maxUsers:n,source:"settings",includedSeats:0,hasSeatPricing:!1}:{maxUsers:0,source:"none",includedSeats:0,hasSeatPricing:!1}}function Pi(e){const{memberCount:t,maxUsersConfig:r,hasSubscription:n=!0,requireSubscription:a=!1}=e;if(a&&!n)return{canInvite:!1,blockReason:"no_subscription",blockMessageKey:"users.subscriptionRequired",blockMessageValues:{}};const{maxUsers:i,source:s}=r;if(i<=0)return{canInvite:!0,blockReason:null,blockMessageKey:null,blockMessageValues:null};if(t>=i){return{canInvite:!1,blockReason:{seat_pricing:"seat_limit_reached",settings:"settings_user_limit_reached"}[s]??"seat_limit_reached",blockMessageKey:{seat_pricing:"users.seatLimitMessage",settings:"users.settingsLimitMessage"}[s]??"users.memberLimitMessage",blockMessageValues:{maxUsers:i}}}return{canInvite:!0,blockReason:null,blockMessageKey:null,blockMessageValues:null}}const Ti="user:created",Ri="user:updated",Di="workspace:changed",Ii="workspace:updated",Mi="workspace:user-added",Ui="workspace:user-removed",Li="workspace:user-role-changed",Oi="workspace:created",zi="workspace:deleted";const Fi=new class{constructor(){this.callbacks=null}setCallbacks(e){this.callbacks=e}getCallbacks(){return this.callbacks}async emit(e,t){if(this.callbacks?.handleEvent)try{await this.callbacks.handleEvent(e,t)}catch(t){$e(t,{component:"EventEmitter",action:"emit",metadata:{eventType:e}})}}async emitUserCreated(e){await this.emit(Ti,{user:e})}async emitUserUpdated(e,t){await this.emit(Ri,{user:e,previousUser:t})}async emitWorkspaceChanged(e,t){await this.emit(Di,{workspace:e,previousWorkspace:t})}async emitWorkspaceUpdated(e){await this.emit(Ii,{workspace:e})}async emitWorkspaceUserAdded(e,t,r){await this.emit(Mi,{userId:e,workspace:t,role:r})}async emitWorkspaceUserRemoved(e,t,r){await this.emit(Ui,{userId:e,workspace:t,role:r})}async emitWorkspaceUserRoleChanged(e,t,r,n){await this.emit(Li,{userId:e,workspace:t,previousRole:r,newRole:n})}async emitWorkspaceCreated(e){await this.emit(Oi,{workspace:e})}async emitWorkspaceDeleted(e){await this.emit(zi,{workspace:e})}},Bi=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Wi=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},Vi=(...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),Gi=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
3
3
  /**
4
4
  * @license lucide-react v0.544.0 - ISC
5
5
  *
@@ -12,19 +12,19 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import*as n from
12
12
  * This source code is licensed under the ISC license.
13
13
  * See the LICENSE file in the root directory of this source tree.
14
14
  */
15
- var Ya={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
15
+ var Hi={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
16
16
  /**
17
17
  * @license lucide-react v0.544.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
- */const Xa=h(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:i,iconNode:s,...o},c)=>f("svg",{ref:c,...Ya,width:t,height:t,stroke:e,strokeWidth:n?24*Number(r)/Number(t):r,className:Za("lucide",a),...!i&&!Ja(o)&&{"aria-hidden":"true"},...o},[...s.map(([e,t])=>f(e,t)),...Array.isArray(i)?i:[i]])),Qa=(e,t)=>{const r=h(({className:r,...n},a)=>f(Xa,{ref:a,iconNode:t,className:Za(`lucide-${Ka(qa(e))}`,`lucide-${e}`,r),...n}));return r.displayName=qa(e),r},ei=Qa("bell-off",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]),ti=Qa("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),ri=Qa("building-2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]),ni=Qa("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]),ai=Qa("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]),ii=Qa("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),si=Qa("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),oi=Qa("credit-card",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]),ci=Qa("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),li=Qa("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),ui=Qa("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),di=Qa("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),pi=Qa("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),mi=Qa("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]),hi=Qa("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),fi=Qa("refresh-ccw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]),gi=Qa("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),bi=Qa("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),vi=Qa("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),yi=Qa("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),wi=Qa("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),xi=Qa("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),Si=Qa("smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]),ki=Qa("toggle-right",[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]),Ei=Qa("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),Ni=Qa("trash",[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),Ci=Qa("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Ai=Qa("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),_i=Qa("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);
21
+ */const ji=h(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:i,iconNode:s,...o},c)=>f("svg",{ref:c,...Hi,width:t,height:t,stroke:e,strokeWidth:n?24*Number(r)/Number(t):r,className:Vi("lucide",a),...!i&&!Gi(o)&&{"aria-hidden":"true"},...o},[...s.map(([e,t])=>f(e,t)),...Array.isArray(i)?i:[i]])),$i=(e,t)=>{const r=h(({className:r,...n},a)=>f(ji,{ref:a,iconNode:t,className:Vi(`lucide-${Bi(Wi(e))}`,`lucide-${e}`,r),...n}));return r.displayName=Wi(e),r},Ki=$i("bell-off",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]),qi=$i("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),Zi=$i("building-2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]),Ji=$i("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]),Yi=$i("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]),Xi=$i("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),Qi=$i("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),es=$i("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),ts=$i("coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]),rs=$i("credit-card",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]),ns=$i("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),as=$i("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),is=$i("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),ss=$i("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),os=$i("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),cs=$i("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]),ls=$i("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),ds=$i("refresh-ccw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]),us=$i("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),ps=$i("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),ms=$i("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),hs=$i("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),fs=$i("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),gs=$i("shopping-cart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]),bs=$i("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),vs=$i("smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]),ys=$i("toggle-right",[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]),ws=$i("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),xs=$i("trash",[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),ks=$i("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Ss=$i("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),Cs=$i("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);
22
22
  /**
23
23
  * @license lucide-react v0.544.0 - ISC
24
24
  *
25
25
  * This source code is licensed under the ISC license.
26
26
  * See the LICENSE file in the root directory of this source tree.
27
- */function Pi(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Ti(...e){return t=>{let r=!1;const n=e.map(e=>{const n=Pi(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():Pi(e[t],null)}}}}function Ri(...e){return n.useCallback(Ti(...e),e)}var Di=Symbol.for("react.lazy"),Ii=n[" use ".trim().toString()];function Ui(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===Di&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}function Mi(e){const r=Oi(e),a=n.forwardRef((e,a)=>{let{children:i,...s}=e;Ui(i)&&"function"==typeof Ii&&(i=Ii(i._payload));const o=n.Children.toArray(i),c=o.find(Fi);if(c){const e=c.props.children,i=o.map(t=>t===c?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t);return t(r,{...s,ref:a,children:n.isValidElement(e)?n.cloneElement(e,void 0,i):null})}return t(r,{...s,ref:a,children:i})});return a.displayName=`${e}.Slot`,a}var Li=Mi("Slot");function Oi(e){const t=n.forwardRef((e,t)=>{let{children:r,...a}=e;if(Ui(r)&&"function"==typeof Ii&&(r=Ii(r._payload)),n.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),i=function(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{const t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}(a,r.props);return r.type!==n.Fragment&&(i.ref=t?Ti(t,e):e),n.cloneElement(r,i)}return n.Children.count(r)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zi=Symbol("radix.slottable");function Fi(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===zi}const Bi=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Wi=S,Vi=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return Wi(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:a,defaultVariants:i}=t,s=Object.keys(a).map(e=>{const t=null==r?void 0:r[e],n=null==i?void 0:i[e];if(null===t)return null;const s=Bi(t)||Bi(n);return a[e][s]}),o=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{}),c=null==t||null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:r,className:n,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...i,...o}[t]):{...i,...o}[t]===r})?[...e,r,n]:e},[]);return Wi(e,s,c,null==r?void 0:r.class,null==r?void 0:r.className)},ji=Vi("inline-flex items-center justify-center rounded-full font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background",{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 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:"underline-offset-4 hover:underline text-primary"},withIcon:{true:"flex"},fullWidth:{true:"w-full"},size:{default:"h-9 py-2 px-4 text-sm",sm:"h-8 px-3 text-xs",lg:"h-10 px-6 text-base",icon:"h-9 w-9"}},compoundVariants:[{size:"lg",withIcon:!0,className:"gap-x-1.5"},{size:"default",withIcon:!0,className:"gap-x-1"},{size:"sm",withIcon:!0,className:"gap-x-0.5"}],defaultVariants:{variant:"default",size:"default"}}),Hi=n.forwardRef(({className:r,variant:a,progress:i,size:s,startIcon:o,endIcon:c,asChild:l=!1,...u},d)=>{const p=l?Li:"button",m=function(e){switch(e){case"lg":return 20;case"sm":return 14;default:return 16}}(s);return e(p,{disabled:i||u.disabled,className:Oe(ji({variant:a,size:s,withIcon:null!=i||null!=o||null!=c,className:r})),ref:d,...u,children:[i&&t(pi,{size:m,className:"animate-spin"}),o&&n.cloneElement(o,{size:m}),u.children,c&&n.cloneElement(c,{size:m})]})});function Gi(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function $i(e,r=[]){let a=[];const i=()=>{const t=a.map(e=>n.createContext(e));return function(r){const a=r?.[e]||t;return n.useMemo(()=>({[`__scope${e}`]:{...r,[e]:a}}),[r,a])}};return i.scopeName=e,[function(r,i){const s=n.createContext(i),o=a.length;a=[...a,i];const c=r=>{const{scope:a,children:i,...c}=r,l=a?.[e]?.[o]||s,u=n.useMemo(()=>c,Object.values(c));return t(l.Provider,{value:u,children:i})};return c.displayName=r+"Provider",[c,function(t,a){const c=a?.[e]?.[o]||s,l=n.useContext(c);if(l)return l;if(void 0!==i)return i;throw new Error(`\`${t}\` must be used within \`${r}\``)}]},Ki(i,...r)]}function Ki(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const a=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return n.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}Hi.displayName="Button";var qi=globalThis?.document?n.useLayoutEffect:()=>{},Zi=n[" useId ".trim().toString()]||(()=>{}),Ji=0;function Yi(e){const[t,r]=n.useState(Zi());return qi(()=>{r(e=>e??String(Ji++))},[e]),e||(t?`radix-${t}`:"")}var Xi=n[" useInsertionEffect ".trim().toString()]||qi;function Qi({prop:e,defaultProp:t,onChange:r=()=>{},caller:a}){const[i,s,o]=function({defaultProp:e,onChange:t}){const[r,a]=n.useState(e),i=n.useRef(r),s=n.useRef(t);return Xi(()=>{s.current=t},[t]),n.useEffect(()=>{i.current!==r&&(s.current?.(r),i.current=r)},[r,i]),[r,a,s]}({defaultProp:t,onChange:r}),c=void 0!==e,l=c?e:i;{const t=n.useRef(void 0!==e);n.useEffect(()=>{const e=t.current;if(e!==c){const t=e?"controlled":"uncontrolled",r=c?"controlled":"uncontrolled";console.warn(`${a} is changing from ${t} to ${r}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=c},[c,a])}const u=n.useCallback(t=>{if(c){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&o.current?.(r)}else s(t)},[c,e,s,o]);return[l,u]}function es(e){const t=n.forwardRef((e,t)=>{const{children:r,...a}=e;if(n.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),i=function(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{const t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}(a,r.props);return r.type!==n.Fragment&&(i.ref=t?Ti(t,e):e),n.cloneElement(r,i)}return n.Children.count(r)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ts=Symbol("radix.slottable");function rs(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===ts}var ns=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{const a=function(e){const r=es(e),a=n.forwardRef((e,a)=>{const{children:i,...s}=e,o=n.Children.toArray(i),c=o.find(rs);if(c){const e=c.props.children,i=o.map(t=>t===c?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t);return t(r,{...s,ref:a,children:n.isValidElement(e)?n.cloneElement(e,void 0,i):null})}return t(r,{...s,ref:a,children:i})});return a.displayName=`${e}.Slot`,a}(`Primitive.${r}`),i=n.forwardRef((e,n)=>{const{asChild:i,...s}=e,o=i?a:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t(o,{...s,ref:n})});return i.displayName=`Primitive.${r}`,{...e,[r]:i}},{});function as(e){const t=n.useRef(e);return n.useEffect(()=>{t.current=e}),n.useMemo(()=>(...e)=>t.current?.(...e),[])}var is,ss="dismissableLayer.update",os="dismissableLayer.pointerDownOutside",cs="dismissableLayer.focusOutside",ls=n.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),us=n.forwardRef((e,r)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:c,onDismiss:l,...u}=e,d=n.useContext(ls),[p,m]=n.useState(null),h=p?.ownerDocument??globalThis?.document,[,f]=n.useState({}),g=Ri(r,e=>m(e)),b=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=b.indexOf(v),w=p?b.indexOf(p):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,S=w>=y,k=function(e,t=globalThis?.document){const r=as(e),a=n.useRef(!1),i=n.useRef(()=>{});return n.useEffect(()=>{const e=e=>{if(e.target&&!a.current){let n=function(){ps(os,r,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",i.current),i.current=n,t.addEventListener("click",i.current,{once:!0})):n()}else t.removeEventListener("click",i.current);a.current=!1},n=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(n),t.removeEventListener("pointerdown",e),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>a.current=!0}}(e=>{const t=e.target,r=[...d.branches].some(e=>e.contains(t));S&&!r&&(s?.(e),c?.(e),e.defaultPrevented||l?.())},h),E=function(e,t=globalThis?.document){const r=as(e),a=n.useRef(!1);return n.useEffect(()=>{const e=e=>{if(e.target&&!a.current){ps(cs,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(o?.(e),c?.(e),e.defaultPrevented||l?.())},h);return function(e,t=globalThis?.document){const r=as(e);n.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{w===d.layers.size-1&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},h),n.useEffect(()=>{if(p)return a&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(is=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),ds(),()=>{a&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=is)}},[p,h,a,d]),n.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),ds())},[p,d]),n.useEffect(()=>{const e=()=>f({});return document.addEventListener(ss,e),()=>document.removeEventListener(ss,e)},[]),t(ns.div,{...u,ref:g,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:Gi(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Gi(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Gi(e.onPointerDownCapture,k.onPointerDownCapture)})});us.displayName="DismissableLayer";function ds(){const e=new CustomEvent(ss);document.dispatchEvent(e)}function ps(e,t,r,{discrete:n}){const a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?function(e,t){e&&y.flushSync(()=>e.dispatchEvent(t))}(a,i):a.dispatchEvent(i)}n.forwardRef((e,r)=>{const a=n.useContext(ls),i=n.useRef(null),s=Ri(r,i);return n.useEffect(()=>{const e=i.current;if(e)return a.branches.add(e),()=>{a.branches.delete(e)}},[a.branches]),t(ns.div,{...e,ref:s})}).displayName="DismissableLayerBranch";var ms="focusScope.autoFocusOnMount",hs="focusScope.autoFocusOnUnmount",fs={bubbles:!1,cancelable:!0},gs=n.forwardRef((e,r)=>{const{loop:a=!1,trapped:i=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...c}=e,[l,u]=n.useState(null),d=as(s),p=as(o),m=n.useRef(null),h=Ri(r,e=>u(e)),f=n.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;n.useEffect(()=>{if(i){let e=function(e){if(f.paused||!l)return;const t=e.target;l.contains(t)?m.current=t:ws(m.current,{select:!0})},t=function(e){if(f.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||ws(m.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&ws(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return l&&n.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[i,l,f.paused]),n.useEffect(()=>{if(l){xs.add(f);const t=document.activeElement;if(!l.contains(t)){const r=new CustomEvent(ms,fs);l.addEventListener(ms,d),l.dispatchEvent(r),r.defaultPrevented||(!function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(ws(n,{select:t}),document.activeElement!==r)return}((e=bs(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&ws(l))}return()=>{l.removeEventListener(ms,d),setTimeout(()=>{const e=new CustomEvent(hs,fs);l.addEventListener(hs,p),l.dispatchEvent(e),e.defaultPrevented||ws(t??document.body,{select:!0}),l.removeEventListener(hs,p),xs.remove(f)},0)}}var e},[l,d,p,f]);const g=n.useCallback(e=>{if(!a&&!i)return;if(f.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[n,i]=function(e){const t=bs(e),r=vs(t,e),n=vs(t.reverse(),e);return[r,n]}(t);n&&i?e.shiftKey||r!==i?e.shiftKey&&r===n&&(e.preventDefault(),a&&ws(i,{select:!0})):(e.preventDefault(),a&&ws(n,{select:!0})):r===t&&e.preventDefault()}},[a,i,f.paused]);return t(ns.div,{tabIndex:-1,...c,ref:h,onKeyDown:g})});function bs(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function vs(e,t){for(const r of e)if(!ys(r,{upTo:t}))return r}function ys(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function ws(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}gs.displayName="FocusScope";var xs=function(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=Ss(e,t),e.unshift(t)},remove(t){e=Ss(e,t),e[0]?.resume()}}}();function Ss(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var ks=n.forwardRef((e,r)=>{const{container:a,...i}=e,[s,o]=n.useState(!1);qi(()=>o(!0),[]);const c=a||s&&globalThis?.document?.body;return c?w.createPortal(t(ns.div,{...i,ref:r}),c):null});ks.displayName="Portal";var Es=e=>{const{present:t,children:r}=e,a=function(e){const[t,r]=n.useState(),a=n.useRef(null),i=n.useRef(e),s=n.useRef("none"),o=e?"mounted":"unmounted",[c,l]=function(e,t){return n.useReducer((e,r)=>t[e][r]??e,e)}(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return n.useEffect(()=>{const e=Ns(a.current);s.current="mounted"===c?e:"none"},[c]),qi(()=>{const t=a.current,r=i.current;if(r!==e){const n=s.current,a=Ns(t);if(e)l("MOUNT");else if("none"===a||"none"===t?.display)l("UNMOUNT");else{l(r&&n!==a?"ANIMATION_OUT":"UNMOUNT")}i.current=e}},[e,l]),qi(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,n=n=>{const s=Ns(a.current).includes(CSS.escape(n.animationName));if(n.target===t&&s&&(l("ANIMATION_END"),!i.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},o=e=>{e.target===t&&(s.current=Ns(a.current))};return t.addEventListener("animationstart",o),t.addEventListener("animationcancel",n),t.addEventListener("animationend",n),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",o),t.removeEventListener("animationcancel",n),t.removeEventListener("animationend",n)}}l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:n.useCallback(e=>{a.current=e?getComputedStyle(e):null,r(e)},[])}}(t),i="function"==typeof r?r({present:a.isPresent}):n.Children.only(r),s=Ri(a.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(i));return"function"==typeof r||a.isPresent?n.cloneElement(i,{ref:s}):null};function Ns(e){return e?.animationName||"none"}Es.displayName="Presence";var Cs=0;function As(){n.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??_s()),document.body.insertAdjacentElement("beforeend",e[1]??_s()),Cs++,()=>{1===Cs&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Cs--}},[])}function _s(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ps=function(){return Ps=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Ps.apply(this,arguments)};function Ts(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}"function"==typeof SuppressedError&&SuppressedError;var Rs="right-scroll-bar-position",Ds="width-before-scroll-bar";function Is(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Us="undefined"!=typeof window?n.useLayoutEffect:n.useEffect,Ms=new WeakMap;function Ls(e,t){var r,n,a,i=(r=null,n=function(t){return e.forEach(function(e){return Is(e,t)})},(a=m(function(){return{value:r,callback:n,facade:{get current(){return a.value},set current(e){var t=a.value;t!==e&&(a.value=e,a.callback(e,t))}}}})[0]).callback=n,a.facade);return Us(function(){var t=Ms.get(i);if(t){var r=new Set(t),n=new Set(e),a=i.current;r.forEach(function(e){n.has(e)||Is(e,null)}),n.forEach(function(e){r.has(e)||Is(e,a)})}Ms.set(i,e)},[e]),i}function Os(e){return e}var zs=function(e){var t=e.sideCar,r=Ts(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return n.createElement(a,Ps({},r))};zs.isSideCarExport=!0;var Fs=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Os);var r=[],n=!1;return{read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(e){var a=t(e,n);return r.push(a),function(){r=r.filter(function(e){return e!==a})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var a=r;r=[],a.forEach(e),t=r}var i=function(){var r=t;t=[],r.forEach(e)},s=function(){return Promise.resolve().then(i)};s(),r={push:function(e){t.push(e),s()},filter:function(e){return t=t.filter(e),r}}}}}(null);return t.options=Ps({async:!0,ssr:!1},e),t}(),Bs=function(){},Ws=n.forwardRef(function(e,t){var r=n.useRef(null),a=n.useState({onScrollCapture:Bs,onWheelCapture:Bs,onTouchMoveCapture:Bs}),i=a[0],s=a[1],o=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,m=e.sideCar,h=e.noRelative,f=e.noIsolation,g=e.inert,b=e.allowPinchZoom,v=e.as,y=void 0===v?"div":v,w=e.gapMode,x=Ts(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,k=Ls([r,t]),E=Ps(Ps({},x),i);return n.createElement(n.Fragment,null,d&&n.createElement(S,{sideCar:Fs,removeScrollBar:u,shards:p,noRelative:h,noIsolation:f,inert:g,setCallbacks:s,allowPinchZoom:!!b,lockRef:r,gapMode:w}),o?n.cloneElement(n.Children.only(c),Ps(Ps({},E),{ref:k})):n.createElement(y,Ps({},E,{className:l,ref:k}),c))});Ws.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ws.classNames={fullWidth:Ds,zeroRight:Rs};function Vs(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var js=function(){var e=0,t=null;return{add:function(r){var n,a;0==e&&(t=Vs())&&(a=r,(n=t).styleSheet?n.styleSheet.cssText=a:n.appendChild(document.createTextNode(a)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Hs=function(){var e,t=(e=js(),function(t,r){n.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])});return function(e){var r=e.styles,n=e.dynamic;return t(r,n),null}},Gs={left:0,top:0,right:0,gap:0},$s=function(e){return parseInt(e||"",10)||0},Ks=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Gs;var t=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[$s(r),$s(n),$s(a)]}(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},qs=Hs(),Zs="data-scroll-locked",Js=function(e,t,r,n){var a=e.left,i=e.top,s=e.right,o=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(o,"px ").concat(n,";\n }\n body[").concat(Zs,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(a,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(o,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(o,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Rs," {\n right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(Ds," {\n margin-right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(Rs," .").concat(Rs," {\n right: 0 ").concat(n,";\n }\n \n .").concat(Ds," .").concat(Ds," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(Zs,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(o,"px;\n }\n")},Ys=function(){var e=parseInt(document.body.getAttribute(Zs)||"0",10);return isFinite(e)?e:0},Xs=function(e){var t=e.noRelative,r=e.noImportant,a=e.gapMode,i=void 0===a?"margin":a;n.useEffect(function(){return document.body.setAttribute(Zs,(Ys()+1).toString()),function(){var e=Ys()-1;e<=0?document.body.removeAttribute(Zs):document.body.setAttribute(Zs,e.toString())}},[]);var s=n.useMemo(function(){return Ks(i)},[i]);return n.createElement(qs,{styles:Js(s,!t,i,r?"":"!important")})},Qs=!1;if("undefined"!=typeof window)try{var eo=Object.defineProperty({},"passive",{get:function(){return Qs=!0,!0}});window.addEventListener("test",eo,eo),window.removeEventListener("test",eo,eo)}catch(e){Qs=!1}var to=!!Qs&&{passive:!1},ro=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},no=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),ao(e,n)){var a=io(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},ao=function(e,t){return"v"===e?function(e){return ro(e,"overflowY")}(t):function(e){return ro(e,"overflowX")}(t)},io=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},so=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},oo=function(e){return[e.deltaX,e.deltaY]},co=function(e){return e&&"current"in e?e.current:e},lo=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},uo=0,po=[];function mo(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var ho,fo=(ho=function(e){var t=n.useRef([]),r=n.useRef([0,0]),a=n.useRef(),i=n.useState(uo++)[0],s=n.useState(Hs)[0],o=n.useRef(e);n.useEffect(function(){o.current=e},[e]),n.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var t=function(e,t,r){if(r||2===arguments.length)for(var n,a=0,i=t.length;a<i;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(co),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var c=n.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!o.current.allowPinchZoom;var n,i=so(e),s=r.current,c="deltaX"in e?e.deltaX:s[0]-i[0],l="deltaY"in e?e.deltaY:s[1]-i[1],u=e.target,d=Math.abs(c)>Math.abs(l)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var p=window.getSelection(),m=p&&p.anchorNode;if(m&&(m===u||m.contains(u)))return!1;var h=no(d,u);if(!h)return!0;if(h?n=d:(n="v"===d?"h":"v",h=no(d,u)),!h)return!1;if(!a.current&&"changedTouches"in e&&(c||l)&&(a.current=n),!n)return!0;var f=a.current||n;return function(e,t,r,n){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=a*n,s=r.target,o=t.contains(s),c=!1,l=i>0,u=0,d=0;do{if(!s)break;var p=io(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&ao(e,s)&&(u+=h,d+=m);var f=s.parentNode;s=f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE?f.host:f}while(!o&&s!==document.body||o&&(t.contains(s)||t===s));return(l&&Math.abs(u)<1||!l&&Math.abs(d)<1)&&(c=!0),c}(f,t,e,"h"===f?c:l)},[]),l=n.useCallback(function(e){var r=e;if(po.length&&po[po.length-1]===s){var n="deltaY"in r?oo(r):so(r),a=t.current.filter(function(e){return e.name===r.type&&(e.target===r.target||r.target===e.shadowParent)&&(t=e.delta,a=n,t[0]===a[0]&&t[1]===a[1]);var t,a})[0];if(a&&a.should)r.cancelable&&r.preventDefault();else if(!a){var i=(o.current.shards||[]).map(co).filter(Boolean).filter(function(e){return e.contains(r.target)});(i.length>0?c(r,i[0]):!o.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),u=n.useCallback(function(e,r,n,a){var i={name:e,delta:r,target:n,should:a,shadowParent:mo(n)};t.current.push(i),setTimeout(function(){t.current=t.current.filter(function(e){return e!==i})},1)},[]),d=n.useCallback(function(e){r.current=so(e),a.current=void 0},[]),p=n.useCallback(function(t){u(t.type,oo(t),t.target,c(t,e.lockRef.current))},[]),m=n.useCallback(function(t){u(t.type,so(t),t.target,c(t,e.lockRef.current))},[]);n.useEffect(function(){return po.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",l,to),document.addEventListener("touchmove",l,to),document.addEventListener("touchstart",d,to),function(){po=po.filter(function(e){return e!==s}),document.removeEventListener("wheel",l,to),document.removeEventListener("touchmove",l,to),document.removeEventListener("touchstart",d,to)}},[]);var h=e.removeScrollBar,f=e.inert;return n.createElement(n.Fragment,null,f?n.createElement(s,{styles:lo(i)}):null,h?n.createElement(Xs,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},Fs.useMedium(ho),zs),go=n.forwardRef(function(e,t){return n.createElement(Ws,Ps({},e,{ref:t,sideCar:fo}))});go.classNames=Ws.classNames;var bo=new WeakMap,vo=new WeakMap,yo={},wo=0,xo=function(e){return e&&(e.host||xo(e.parentNode))},So=function(e,t,r,n){var a=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=xo(t);return r&&e.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);yo[r]||(yo[r]=new WeakMap);var i=yo[r],s=[],o=new Set,c=new Set(a),l=function(e){e&&!o.has(e)&&(o.add(e),l(e.parentNode))};a.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(o.has(e))u(e);else try{var t=e.getAttribute(n),a=null!==t&&"false"!==t,c=(bo.get(e)||0)+1,l=(i.get(e)||0)+1;bo.set(e,c),i.set(e,l),s.push(e),1===c&&a&&vo.set(e,!0),1===l&&e.setAttribute(r,"true"),a||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),o.clear(),wo++,function(){s.forEach(function(e){var t=bo.get(e)-1,a=i.get(e)-1;bo.set(e,t),i.set(e,a),t||(vo.has(e)||e.removeAttribute(n),vo.delete(e)),a||e.removeAttribute(r)}),--wo||(bo=new WeakMap,bo=new WeakMap,vo=new WeakMap,yo={})}},ko=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),So(n,a,r,"aria-hidden")):function(){return null}};function Eo(e){const t=n.forwardRef((e,t)=>{const{children:r,...a}=e;if(n.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),i=function(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{const t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}(a,r.props);return r.type!==n.Fragment&&(i.ref=t?Ti(t,e):e),n.cloneElement(r,i)}return n.Children.count(r)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var No=Symbol("radix.slottable");function Co(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===No}var Ao="Dialog",[_o,Po]=$i(Ao),[To,Ro]=_o(Ao),Do=e=>{const{__scopeDialog:r,children:a,open:i,defaultOpen:s,onOpenChange:o,modal:c=!0}=e,l=n.useRef(null),u=n.useRef(null),[d,p]=Qi({prop:i,defaultProp:s??!1,onChange:o,caller:Ao});return t(To,{scope:r,triggerRef:l,contentRef:u,contentId:Yi(),titleId:Yi(),descriptionId:Yi(),open:d,onOpenChange:p,onOpenToggle:n.useCallback(()=>p(e=>!e),[p]),modal:c,children:a})};Do.displayName=Ao;var Io="DialogTrigger",Uo=n.forwardRef((e,r)=>{const{__scopeDialog:n,...a}=e,i=Ro(Io,n),s=Ri(r,i.triggerRef);return t(ns.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":ec(i.open),...a,ref:s,onClick:Gi(e.onClick,i.onOpenToggle)})});Uo.displayName=Io;var Mo="DialogPortal",[Lo,Oo]=_o(Mo,{forceMount:void 0}),zo=e=>{const{__scopeDialog:r,forceMount:a,children:i,container:s}=e,o=Ro(Mo,r);return t(Lo,{scope:r,forceMount:a,children:n.Children.map(i,e=>t(Es,{present:a||o.open,children:t(ks,{asChild:!0,container:s,children:e})}))})};zo.displayName=Mo;var Fo="DialogOverlay",Bo=n.forwardRef((e,r)=>{const n=Oo(Fo,e.__scopeDialog),{forceMount:a=n.forceMount,...i}=e,s=Ro(Fo,e.__scopeDialog);return s.modal?t(Es,{present:a||s.open,children:t(Vo,{...i,ref:r})}):null});Bo.displayName=Fo;var Wo=function(e){const r=Eo(e),a=n.forwardRef((e,a)=>{const{children:i,...s}=e,o=n.Children.toArray(i),c=o.find(Co);if(c){const e=c.props.children,i=o.map(t=>t===c?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t);return t(r,{...s,ref:a,children:n.isValidElement(e)?n.cloneElement(e,void 0,i):null})}return t(r,{...s,ref:a,children:i})});return a.displayName=`${e}.Slot`,a}("DialogOverlay.RemoveScroll"),Vo=n.forwardRef((e,r)=>{const{__scopeDialog:n,...a}=e,i=Ro(Fo,n);return t(go,{as:Wo,allowPinchZoom:!0,shards:[i.contentRef],children:t(ns.div,{"data-state":ec(i.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),jo="DialogContent",Ho=n.forwardRef((e,r)=>{const n=Oo(jo,e.__scopeDialog),{forceMount:a=n.forceMount,...i}=e,s=Ro(jo,e.__scopeDialog);return t(Es,{present:a||s.open,children:s.modal?t(Go,{...i,ref:r}):t($o,{...i,ref:r})})});Ho.displayName=jo;var Go=n.forwardRef((e,r)=>{const a=Ro(jo,e.__scopeDialog),i=n.useRef(null),s=Ri(r,a.contentRef,i);return n.useEffect(()=>{const e=i.current;if(e)return ko(e)},[]),t(Ko,{...e,ref:s,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Gi(e.onCloseAutoFocus,e=>{e.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:Gi(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:Gi(e.onFocusOutside,e=>e.preventDefault())})}),$o=n.forwardRef((e,r)=>{const a=Ro(jo,e.__scopeDialog),i=n.useRef(!1),s=n.useRef(!1);return t(Ko,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||a.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));const r=t.target,n=a.triggerRef.current?.contains(r);n&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})}),Ko=n.forwardRef((a,i)=>{const{__scopeDialog:s,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:l,...u}=a,d=Ro(jo,s),p=n.useRef(null),m=Ri(i,p);return As(),e(r,{children:[t(gs,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:c,onUnmountAutoFocus:l,children:t(us,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":ec(d.open),...u,ref:m,onDismiss:()=>d.onOpenChange(!1)})}),e(r,{children:[t(ac,{titleId:d.titleId}),t(ic,{contentRef:p,descriptionId:d.descriptionId})]})]})}),qo="DialogTitle",Zo=n.forwardRef((e,r)=>{const{__scopeDialog:n,...a}=e,i=Ro(qo,n);return t(ns.h2,{id:i.titleId,...a,ref:r})});Zo.displayName=qo;var Jo="DialogDescription",Yo=n.forwardRef((e,r)=>{const{__scopeDialog:n,...a}=e,i=Ro(Jo,n);return t(ns.p,{id:i.descriptionId,...a,ref:r})});Yo.displayName=Jo;var Xo="DialogClose",Qo=n.forwardRef((e,r)=>{const{__scopeDialog:n,...a}=e,i=Ro(Xo,n);return t(ns.button,{type:"button",...a,ref:r,onClick:Gi(e.onClick,()=>i.onOpenChange(!1))})});function ec(e){return e?"open":"closed"}Qo.displayName=Xo;var tc="DialogTitleWarning",[rc,nc]=function(e,r){const a=n.createContext(r),i=e=>{const{children:r,...i}=e,s=n.useMemo(()=>i,Object.values(i));return t(a.Provider,{value:s,children:r})};return i.displayName=e+"Provider",[i,function(t){const i=n.useContext(a);if(i)return i;if(void 0!==r)return r;throw new Error(`\`${t}\` must be used within \`${e}\``)}]}(tc,{contentName:jo,titleName:qo,docsSlug:"dialog"}),ac=({titleId:e})=>{const t=nc(tc),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return n.useEffect(()=>{if(e){document.getElementById(e)||console.error(r)}},[r,e]),null},ic=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${nc("DialogDescriptionWarning").contentName}}.`;return n.useEffect(()=>{const n=e.current?.getAttribute("aria-describedby");if(t&&n){document.getElementById(t)||console.warn(r)}},[r,e,t]),null},sc=Do,oc=Uo,cc=zo,lc=Bo,uc=Ho,dc=Zo,pc=Yo,mc=Qo;function hc(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}var fc=["color"],gc=h(function(e,t){var r=e.color,n=void 0===r?"currentColor":r,a=hc(e,fc);return f("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),f("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),bc=["color"],vc=h(function(e,t){var r=e.color,n=void 0===r?"currentColor":r,a=hc(e,bc);return f("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),f("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),yc=["color"],wc=h(function(e,t){var r=e.color,n=void 0===r?"currentColor":r,a=hc(e,yc);return f("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),f("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),xc=["color"],Sc=h(function(e,t){var r=e.color,n=void 0===r?"currentColor":r,a=hc(e,xc);return f("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),f("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))});const kc=c({container:null,setContainer:()=>{}}),Ec=a.memo(({children:r})=>{const[n,i]=a.useState(null),s=a.useMemo(()=>({container:n,setContainer:i}),[n]),o=a.useMemo(()=>r,[r]);return e(kc.Provider,{value:s,children:[o,t("div",{ref:i,id:"saas-os-portal",className:"saas-os-ui",style:{width:"100%",height:"100%"}})]})});Ec.displayName="PortalProvider";const Nc=sc,Cc=oc,Ac=cc,_c=n.forwardRef(({className:e,...r},n)=>t(lc,{ref:n,className:Oe("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}));_c.displayName=lc.displayName;const Pc=n.forwardRef(({className:r,children:a,...i},s)=>{const{container:o}=n.useContext(kc);return e(Ac,{container:o,children:[t(_c,{}),e(uc,{ref:s,className:Oe("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 md:w-full",r),...i,children:[a,e(mc,{className:"absolute right-4 rtl:right-auto rtl:left-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:[t(wc,{className:"h-4 w-4"}),t("span",{className:"sr-only",children:"Close"})]})]})]})});Pc.displayName=uc.displayName;const Tc=({className:e,...r})=>t("div",{className:Oe("flex flex-col space-y-1.5 text-center sm:text-start",e),...r});Tc.displayName="DialogHeader";const Rc=n.forwardRef(({className:e,...r},n)=>t(dc,{ref:n,className:Oe("text-lg font-semibold leading-none tracking-tight",e),...r}));Rc.displayName=dc.displayName;const Dc=n.forwardRef(({className:e,...r},n)=>t(pc,{ref:n,className:Oe("text-sm text-muted-foreground",e),...r}));Dc.displayName=pc.displayName;var Ic=Symbol("radix.slottable");var Uc="AlertDialog",[Mc]=$i(Uc,[Po]),Lc=Po(),Oc=e=>{const{__scopeAlertDialog:r,...n}=e,a=Lc(r);return t(sc,{...a,...n,modal:!0})};Oc.displayName=Uc;var zc=n.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...a}=e,i=Lc(n);return t(oc,{...i,...a,ref:r})});zc.displayName="AlertDialogTrigger";var Fc=e=>{const{__scopeAlertDialog:r,...n}=e,a=Lc(r);return t(cc,{...a,...n})};Fc.displayName="AlertDialogPortal";var Bc=n.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...a}=e,i=Lc(n);return t(lc,{...i,...a,ref:r})});Bc.displayName="AlertDialogOverlay";var Wc="AlertDialogContent",[Vc,jc]=Mc(Wc),Hc=function(e){const n=({children:e})=>t(r,{children:e});return n.displayName=`${e}.Slottable`,n.__radixId=Ic,n}("AlertDialogContent"),Gc=n.forwardRef((r,a)=>{const{__scopeAlertDialog:i,children:s,...o}=r,c=Lc(i),l=n.useRef(null),u=Ri(a,l),d=n.useRef(null);return t(rc,{contentName:Wc,titleName:$c,docsSlug:"alert-dialog",children:t(Vc,{scope:i,cancelRef:d,children:e(uc,{role:"alertdialog",...c,...o,ref:u,onOpenAutoFocus:Gi(o.onOpenAutoFocus,e=>{e.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[t(Hc,{children:s}),t(Qc,{contentRef:l})]})})})});Gc.displayName=Wc;var $c="AlertDialogTitle",Kc=n.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...a}=e,i=Lc(n);return t(dc,{...i,...a,ref:r})});Kc.displayName=$c;var qc="AlertDialogDescription",Zc=n.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...a}=e,i=Lc(n);return t(pc,{...i,...a,ref:r})});Zc.displayName=qc;var Jc=n.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...a}=e,i=Lc(n);return t(mc,{...i,...a,ref:r})});Jc.displayName="AlertDialogAction";var Yc="AlertDialogCancel",Xc=n.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...a}=e,{cancelRef:i}=jc(Yc,n),s=Lc(n),o=Ri(r,i);return t(mc,{...s,...a,ref:o})});Xc.displayName=Yc;var Qc=({contentRef:e})=>{const t=`\`${Wc}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${Wc}\` by passing a \`${qc}\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Wc}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return n.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},el=Bc,tl=Gc,rl=Jc,nl=Xc,al=Kc,il=Zc;const sl=Oc,ol=zc,cl=Fc,ll=n.forwardRef(({className:e,...r},n)=>t(el,{className:Oe("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r,ref:n}));ll.displayName=el.displayName;const ul=n.forwardRef(({className:r,...a},i)=>{const{container:s}=n.useContext(kc);return e(cl,{container:s,children:[t(ll,{}),t(tl,{ref:i,className:Oe("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 md:w-full",r),...a})]})});ul.displayName=tl.displayName;const dl=({className:e,...r})=>t("div",{className:Oe("flex flex-col space-y-2 text-center sm:text-start",e),...r});dl.displayName="AlertDialogHeader";const pl=({className:e,...r})=>t("div",{className:Oe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});pl.displayName="AlertDialogFooter";const ml=n.forwardRef(({className:e,...r},n)=>t(al,{ref:n,className:Oe("text-lg font-semibold",e),...r}));ml.displayName=al.displayName;const hl=n.forwardRef(({className:e,...r},n)=>t(il,{ref:n,className:Oe("text-sm text-muted-foreground",e),...r}));hl.displayName=il.displayName;const fl=n.forwardRef(({className:e,...r},n)=>t(rl,{ref:n,className:Oe(ji(),e),...r}));fl.displayName=rl.displayName;const gl=n.forwardRef(({className:e,...r},n)=>t(nl,{ref:n,className:Oe(ji({variant:"outline"}),"mt-2 sm:mt-0",e),...r}));gl.displayName=nl.displayName;const bl="saas-workspace-current",vl=e=>{e?kn(bl,e._id):En(bl)},yl=()=>Sn(bl),wl=()=>{En(bl)},xl=(e,t)=>!!e&&t.some(t=>t._id===e);function Sl(e,t){if(!t)return!1;const r=(n=e.createdBy)?"string"==typeof n?n:"object"==typeof n&&"_id"in n&&"string"==typeof n._id?n._id:null:null;var n;return null!==r&&r===t}function kl(e,t){if(!t||!e.users||!Array.isArray(e.users))return null;const r=e.users.find(e=>"string"==typeof e?e===t:"object"==typeof e&&null!==e&&"_id"in e&&e._id===t);return r&&"object"==typeof r&&"role"in r&&"string"==typeof r.role?r.role:null}const El={WORKSPACE_SETTINGS_VIEW:"workspace:settings:view",WORKSPACE_SETTINGS_EDIT:"workspace:settings:edit",WORKSPACE_DELETE:"workspace:delete",WORKSPACE_MEMBERS_VIEW:"workspace:members:view",WORKSPACE_MEMBERS_INVITE:"workspace:members:invite",WORKSPACE_MEMBERS_REMOVE:"workspace:members:remove",WORKSPACE_MEMBERS_ROLE_CHANGE:"workspace:members:role-change",WORKSPACE_FEATURES_VIEW:"workspace:features:view",WORKSPACE_FEATURES_EDIT:"workspace:features:edit",WORKSPACE_BILLING_VIEW:"workspace:billing:view",WORKSPACE_BILLING_MANAGE:"workspace:billing:manage",WORKSPACE_USAGE_VIEW:"workspace:usage:view"},Nl=Object.values(El),Cl={admin:Nl.filter(e=>e!==El.WORKSPACE_DELETE),member:[El.WORKSPACE_SETTINGS_VIEW,El.WORKSPACE_MEMBERS_VIEW,El.WORKSPACE_FEATURES_VIEW,El.WORKSPACE_BILLING_VIEW,El.WORKSPACE_USAGE_VIEW],viewer:[El.WORKSPACE_SETTINGS_VIEW,El.WORKSPACE_MEMBERS_VIEW]};function Al(e){const t=new Set;for(const r of Object.values(e))for(const e of r)t.add(e);return Array.from(t)}function _l(e){const{userId:t,workspace:r,settings:n,appPermissions:a}=e;if(!r||!t)return new Set;if(Sl(r,t)){const e=new Set(Nl);if(a)for(const t of Al(a))e.add(t);if(r.permissions)for(const t of Al(r.permissions))e.add(t);if(n?.workspace?.permissions)for(const t of Al(n.workspace.permissions))e.add(t);return e}const i=e.workspaceRole??kl(r,t);if(!i)return new Set;const s=r.permissions,o=n?.workspace?.permissions,c=e=>e.filter(e=>e.startsWith("workspace:")),l=e=>e.filter(e=>!e.startsWith("workspace:")),u=s?.[i]?c(s[i]):[],d=o?.[i]?c(o[i]):[],p=Cl[i]??[];let m;if(u.length>0)m=u;else if(d.length>0)m=d;else if(p.length>0)m=p;else{m=Cl[n?.workspace?.defaultRole??"member"]??Cl.member??[]}const h=new Set(m),f=s?.[i]?l(s[i]):[],g=a?.[i]?l(a[i]):[],b=f.length>0?f:g;for(const e of b)h.add(e);return function(e,t,r){if(!r?.workspace)return;const{canInviteMembers:n}=r.workspace;(!1===n||"admin-only"===n&&"admin"!==t)&&e.delete(El.WORKSPACE_MEMBERS_INVITE)}(h,i,n),h}class Pl extends Rn{constructor(e){super(e)}async requestAuth(e){const t=`${this.serverUrl}/api/${this.version}/auth/request`,r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){let e="Failed to initiate authentication";try{e=(await r.json()).message||e}catch{e=`Failed to initiate authentication (${r.status}: ${r.statusText})`}throw new Error(e)}return r.json()}async getProfile(e,t){return this.fetchJson("profile",{headers:{"x-session-id":e},signal:t},"Failed to fetch user profile")}}function Tl(e){if(!e||"string"!=typeof e)return null;try{const t=new URL(e);return"https:"===t.protocol?e:"http:"!==t.protocol||"localhost"!==t.hostname&&"127.0.0.1"!==t.hostname&&"::1"!==t.hostname?null:e}catch{return null}}function Rl(e,t="/"){const r=Tl(e);window.location.href=r||t}const Dl="saas-auth-intent";function Il(e){return"object"==typeof e&&null!==e&&"string"==typeof e.returnUrl&&"number"==typeof e.createdAt}function Ul(e){Tl(e)&&function(e,t){try{kn(e,JSON.stringify(t))}catch(t){Ke(t,{component:"storage",action:"setStorageJSON",metadata:{key:e}})}}(Dl,{returnUrl:e,createdAt:Date.now()})}function Ml(){const e=function(e,t){const r=Sn(e);if(!r)return null;try{const n=JSON.parse(r);return t&&!t(n)?(Ke(new Error("Storage data failed validation"),{component:"storage",action:"getStorageJSON",metadata:{key:e}}),En(e),null):n}catch(t){return Ke(t,{component:"storage",action:"getStorageJSON",metadata:{key:e}}),En(e),null}}(Dl,Il);return En(Dl),e?Date.now()-e.createdAt>6e5?null:Tl(e.returnUrl):null}function Ll(e,t,r){const n=e._id||e.id;if(!n||"string"!=typeof n)throw new Error("User data missing required ID field");if(!e.email||"string"!=typeof e.email)throw new Error("User data missing required email field");return{id:n,name:e.name||"",org:t,email:e.email,emailVerified:!0,clientId:r,role:e.role||"",image:e.image}}function Ol(e,t){return{user:e,sessionId:t,expires:new Date(Date.now()+864e5).toISOString()}}function zl(){return Un(e=>e.auth)}function Fl(){const{t:e}=xn(),t=In(),r=zl(),n=On(),{serverUrl:a,orgId:i,auth:s}=n,{resetCurrentWorkspace:c,currentWorkspace:l}=rE(),u=o(()=>new Pl({serverUrl:a,version:n.version}),[a,n.version]),d=p(async r=>{Ul(r||window.location.href),t.auth(Je());try{const r=await u.requestAuth({orgId:i,clientId:s?.clientId??"",redirect:{success:s?.redirectUrl||window.location.href,error:s?.redirectUrl||window.location.href}});if(!r.success)throw t.auth(Xe()),new Error(r.message||e("errors.generic"));Rl(r.data.redirectUrl)}catch(e){throw t.auth(Xe()),Ke(e,{component:"useSaaSAuth",action:"signIn"}),e}},[u,i,s,t]),m=p(async()=>{try{s?.callbacks?.onSignOut&&"function"==typeof s.callbacks.onSignOut&&await s.callbacks.onSignOut()}catch(e){Ke(e,{component:"useSaaSAuth",action:"signOut"})}finally{En(Nn),t.auth(et()),c()}},[t,c,s?.callbacks?.onSignOut]),h=p(e=>{l?tE.openWorkspaceSettings(e):Ke(new Error("Cannot open settings: No current workspace"),{component:"useSaaSAuth",action:"openWorkspaceSettings"})},[l]),f=o(()=>at(r.status),[r.status]);return o(()=>({user:r.session?.user,session:r.session,status:r.status,...f,signIn:d,signOut:m,openWorkspaceSettings:h}),[r.session,r.status,f,d,m,h])}function Bl(e){const{user:t}=Fl(),{currentWorkspace:r}=rE(),{settings:n}=Fn(),{appPermissions:a}=ua(),i=e??r??null,s=t?.id??null,c=o(()=>i?kl(i,s):null,[i,s]),l=o(()=>!!i&&Sl(i,s),[i,s]),u=o(()=>_l({userId:s,workspaceRole:c,workspace:i,settings:n,appPermissions:a}),[s,c,i,n,a]),d=p(e=>Array.isArray(e)?e.every(e=>u.has(e)):u.has(e),[u]);return{can:d,permissions:u,isOwner:l,role:c}}function Wl({className:e,...r}){return t("div",{className:Oe("animate-pulse rounded-md bg-primary/10",e),...r})}function Vl(){return e("div",{className:"space-y-3.5",children:[t(Wl,{className:"h-10 w-full"}),t(Wl,{className:"h-10 w-full"}),t(Wl,{className:"h-10 w-full"})]})}const jl=({workspace:n})=>{const[a,i]=m(!1),{deleteWorkspace:s}=rE(),{can:o}=Bl(),{settings:c}=Fn(),{t:l}=xn();if(1===(c?.workspace?.maxWorkspacesPerUser??0))return null;if(!n)return t(Vl,{});return o(El.WORKSPACE_DELETE)?e("div",{className:"space-y-4",children:[e("div",{children:[t("h3",{className:"text-lg font-semibold text-destructive",children:l("danger.title")}),t("p",{className:"text-sm text-muted-foreground mt-2",children:l("danger.deleteDescription")})]}),e(sl,{children:[t(ol,{asChild:!0,children:e(Hi,{variant:"destructive",disabled:a,progress:a,children:[t(Ei,{className:"h-4 w-4 me-2"}),l("danger.deleteWorkspace")]})}),e(ul,{children:[e(dl,{children:[t(ml,{children:l("danger.deleteConfirm")}),t(hl,{children:l("danger.deleteConfirmDescription")})]}),e(pl,{children:[t(gl,{disabled:a,children:l("settings.common.cancel")}),t(fl,{onClick:async()=>{i(!0);try{await s(n._id)}catch(e){Ke(e,{component:"WorkspaceSettingsDanger",action:"handleDeleteWorkspace",metadata:{workspaceId:n._id}}),alert(e instanceof Error?e.message:l("danger.failedToDelete"))}finally{i(!1)}},disabled:a,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:a?e(r,{children:[t(pi,{className:"me-2 h-4 w-4 animate-spin"}),l("danger.deleting")]}):l("danger.deleteWorkspace")})]})]})]})]}):t("div",{className:"space-y-4",children:t("div",{className:"text-red-500",children:l("danger.adminOnly")})})};function Hl(e){const t=n.useRef({value:e,previous:e});return n.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Gl(e){const[t,r]=n.useState(void 0);return qi(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const n=t[0];let a,i;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;a=t.inlineSize,i=t.blockSize}else a=e.offsetWidth,i=e.offsetHeight;r({width:a,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}var $l="Switch",[Kl]=$i($l),[ql,Zl]=Kl($l),Jl=n.forwardRef((r,a)=>{const{__scopeSwitch:i,name:s,checked:o,defaultChecked:c,required:l,disabled:u,value:d="on",onCheckedChange:p,form:m,...h}=r,[f,g]=n.useState(null),b=Ri(a,e=>g(e)),v=n.useRef(!1),y=!f||(m||!!f.closest("form")),[w,x]=Qi({prop:o,defaultProp:c??!1,onChange:p,caller:$l});return e(ql,{scope:i,checked:w,disabled:u,children:[t(ns.button,{type:"button",role:"switch","aria-checked":w,"aria-required":l,"data-state":eu(w),"data-disabled":u?"":void 0,disabled:u,value:d,...h,ref:b,onClick:Gi(r.onClick,e=>{x(e=>!e),y&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),y&&t(Ql,{control:f,bubbles:!v.current,name:s,value:d,checked:w,required:l,disabled:u,form:m,style:{transform:"translateX(-100%)"}})]})});Jl.displayName=$l;var Yl="SwitchThumb",Xl=n.forwardRef((e,r)=>{const{__scopeSwitch:n,...a}=e,i=Zl(Yl,n);return t(ns.span,{"data-state":eu(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:r})});Xl.displayName=Yl;var Ql=n.forwardRef(({__scopeSwitch:e,control:r,checked:a,bubbles:i=!0,...s},o)=>{const c=n.useRef(null),l=Ri(c,o),u=Hl(a),d=Gl(r);return n.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==a&&r){const t=new Event("click",{bubbles:i});r.call(e,a),e.dispatchEvent(t)}},[u,a,i]),t("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a,...s,tabIndex:-1,ref:l,style:{...s.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function eu(e){return e?"checked":"unchecked"}Ql.displayName="SwitchBubbleInput";var tu=Jl,ru=Xl;const nu=n.forwardRef(({className:e,...r},n)=>t(tu,{className:Oe("peer inline-flex h-[20px] w-[36px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm 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),...r,ref:n,children:t(ru,{className:Oe("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));nu.displayName=tu.displayName;const au=({workspaceId:r})=>{const{t:n}=xn(),{allFeatures:a,updateFeature:i,getWorkspace:o}=rE(),{can:c}=Bl(),[l,u]=m({}),[p,h]=m(null),[f,g]=m(null),b=s(null);if(d(()=>()=>{b.current&&clearTimeout(b.current)},[]),d(()=>{o(r).then(g)},[r]),!f)return t(Vl,{});const v=c(El.WORKSPACE_FEATURES_EDIT);return e("div",{children:[p&&e("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[t("p",{className:"font-medium",children:n("settings.common.success")}),t("p",{className:"text-sm",children:p})]}),e("div",{className:"flex flex-col gap-y-3.5 pe-4",children:[!v&&t("div",{className:"text-red-500",children:n("features.ownerOnly")}),!a.length&&t("div",{className:"text-muted-foreground",children:n("features.noFeatures")}),a.length>0&&t("div",{className:"flex flex-col gap-y-3.5",children:a.map(r=>{const s=f?.features?.[r.slug],o=null!==l[r.slug]&&void 0!==l[r.slug],c=l[r.slug],d=n("features.actionStatus",{action:!0===c?"enabling":!1===c?"disabling":"none"});return e("div",{className:"flex items-center gap-x-2 justify-between w-full",children:[e("div",{className:"flex gap-x-2 flex-col",children:[t("h3",{className:"font-medium text-ellipsis",children:r.name}),t("p",{className:"text-muted-foreground",children:r.description})]}),o?e("div",{className:"flex items-center gap-x-1",children:[t(pi,{className:"h-4 w-4 animate-spin text-gray-500"}),e("span",{className:"text-sm text-gray-600",children:[d,"..."]})]}):t(nu,{disabled:!v,checked:s??r.defaultValue,onCheckedChange:e=>async function(e,t){if(f){u(r=>({...r,[e]:t})),h(null);try{const r=await i(f._id,e,t);g(r);const s=a.find(t=>t.slug===e);h(n("features.updateSuccess",{feature:s?.name||"Feature",enabled:String(t)})),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{h(null)},5e3)}catch(t){Ke(t,{component:"WorkspaceSettingsFeatures",action:"updateFeature",metadata:{workspaceId:f._id,featureKey:e}})}finally{u(t=>({...t,[e]:null}))}}}(r.slug,e)})]},r._id)})})]})]})};var iu=e=>"checkbox"===e.type,su=e=>e instanceof Date,ou=e=>null==e;const cu=e=>"object"==typeof e;var lu=e=>!ou(e)&&!Array.isArray(e)&&cu(e)&&!su(e),uu=e=>lu(e)&&e.target?iu(e.target)?e.target.checked:e.target.value:e,du=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),pu="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function mu(e){if(e instanceof Date)return new Date(e);const t="undefined"!=typeof FileList&&e instanceof FileList;if(pu&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!(r||lu(e)&&(e=>{const t=e.constructor&&e.constructor.prototype;return lu(t)&&t.hasOwnProperty("isPrototypeOf")})(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=mu(e[t]));return n}var hu=e=>/^\w*$/.test(e),fu=e=>void 0===e,gu=e=>Array.isArray(e)?e.filter(Boolean):[],bu=e=>gu(e.replace(/["|']|\]/g,"").split(/\.|\[/)),vu=(e,t,r)=>{if(!t||!lu(e))return r;const n=(hu(t)?[t]:bu(t)).reduce((e,t)=>ou(e)?e:e[t],e);return fu(n)||n===e?fu(e[t])?r:e[t]:n},yu=e=>"boolean"==typeof e,wu=e=>"function"==typeof e,xu=(e,t,r)=>{let n=-1;const a=hu(t)?[t]:bu(t),i=a.length,s=i-1;for(;++n<i;){const t=a[n];let i=r;if(n!==s){const r=e[t];i=lu(r)||Array.isArray(r)?r:isNaN(+a[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=i,e=e[t]}};const Su="blur",ku="focusout",Eu="change",Nu="onBlur",Cu="onChange",Au="onSubmit",_u="onTouched",Pu="all",Tu="max",Ru="min",Du="maxLength",Iu="minLength",Uu="pattern",Mu="required",Lu="validate",Ou=a.createContext(null);Ou.displayName="HookFormControlContext";const zu=()=>a.useContext(Ou);var Fu=(e,t,r,n=!0)=>{const a={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(a,i,{get:()=>{const a=i;return t._proxyFormState[a]!==Pu&&(t._proxyFormState[a]=!n||Pu),r&&(r[a]=!0),e[a]}});return a};const Bu="undefined"!=typeof window?a.useLayoutEffect:a.useEffect;var Wu=e=>"string"==typeof e,Vu=(e,t,r,n,a)=>Wu(e)?(n&&t.watch.add(e),vu(r,e,a)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),vu(r,e))):(n&&(t.watchAll=!0),r),ju=e=>ou(e)||!cu(e);function Hu(e,t,r=new WeakSet){if(ju(e)||ju(t))return Object.is(e,t);if(su(e)&&su(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const i of n){const n=e[i];if(!a.includes(i))return!1;if("ref"!==i){const e=t[i];if(su(n)&&su(e)||lu(n)&&lu(e)||Array.isArray(n)&&Array.isArray(e)?!Hu(n,e,r):!Object.is(n,e))return!1}}return!0}function Gu(e){const t=zu(),{name:r,disabled:n,control:i=t,shouldUnregister:s,defaultValue:o,exact:c=!0}=e,l=du(i._names.array,r),u=a.useMemo(()=>vu(i._formValues,r,vu(i._defaultValues,r,o)),[i,r,o]),d=function(e){const t=zu(),{control:r=t,name:n,defaultValue:i,disabled:s,exact:o,compute:c}=e||{},l=a.useRef(i),u=a.useRef(c),d=a.useRef(void 0),p=a.useRef(r),m=a.useRef(n);u.current=c;const[h,f]=a.useState(()=>{const e=r._getWatch(n,l.current);return u.current?u.current(e):e}),g=a.useCallback(e=>{const t=Vu(n,r._names,e||r._formValues,!1,l.current);return u.current?u.current(t):t},[r._formValues,r._names,n]),b=a.useCallback(e=>{if(!s){const t=Vu(n,r._names,e||r._formValues,!1,l.current);if(u.current){const e=u.current(t);Hu(e,d.current)||(f(e),d.current=e)}else f(t)}},[r._formValues,r._names,s,n]);Bu(()=>(p.current===r&&Hu(m.current,n)||(p.current=r,m.current=n,b()),r._subscribe({name:n,formState:{values:!0},exact:o,callback:e=>{b(e.values)}})),[r,o,n,b]),a.useEffect(()=>r._removeUnmounted());const v=p.current!==r,y=m.current,w=a.useMemo(()=>{if(s)return null;const e=!v&&!Hu(y,n);return v||e?g():null},[s,v,n,y,g]);return null!==w?w:h}({control:i,name:r,defaultValue:u,exact:c}),p=function(e){const t=zu(),{control:r=t,disabled:n,name:i,exact:s}=e||{},[o,c]=a.useState(r._formState),l=a.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Bu(()=>r._subscribe({name:i,formState:l.current,exact:s,callback:e=>{!n&&c({...r._formState,...e})}}),[i,n,s]),a.useEffect(()=>{l.current.isValid&&r._setValid(!0)},[r]),a.useMemo(()=>Fu(o,r,l.current,!1),[o,r])}({control:i,name:r,exact:c}),m=a.useRef(e),h=a.useRef(void 0),f=a.useRef(i.register(r,{...e.rules,value:d,...yu(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const g=a.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!vu(p.errors,r)},isDirty:{enumerable:!0,get:()=>!!vu(p.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!vu(p.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!vu(p.validatingFields,r)},error:{enumerable:!0,get:()=>vu(p.errors,r)}}),[p,r]),b=a.useCallback(e=>f.current.onChange({target:{value:uu(e),name:r},type:Eu}),[r]),v=a.useCallback(()=>f.current.onBlur({target:{value:vu(i._formValues,r),name:r},type:Su}),[r,i._formValues]),y=a.useCallback(e=>{const t=vu(i._fields,r);t&&t._f&&e&&(t._f.ref={focus:()=>wu(e.focus)&&e.focus(),select:()=>wu(e.select)&&e.select(),setCustomValidity:t=>wu(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>wu(e.reportValidity)&&e.reportValidity()})},[i._fields,r]),w=a.useMemo(()=>({name:r,value:d,...yu(n)||p.disabled?{disabled:p.disabled||n}:{},onChange:b,onBlur:v,ref:y}),[r,n,p.disabled,b,v,y,d]);return a.useEffect(()=>{const e=i._options.shouldUnregister||s,t=h.current;t&&t!==r&&!l&&i.unregister(t),i.register(r,{...m.current.rules,...yu(m.current.disabled)?{disabled:m.current.disabled}:{}});const n=(e,t)=>{const r=vu(i._fields,e);r&&r._f&&(r._f.mount=t)};if(n(r,!0),e){const e=mu(vu(i._options.defaultValues,r,m.current.defaultValue));xu(i._defaultValues,r,e),fu(vu(i._formValues,r))&&xu(i._formValues,r,e)}return!l&&i.register(r),h.current=r,()=>{(l?e&&!i._state.action:e)?i.unregister(r):n(r,!1)}},[r,i,l,s]),a.useEffect(()=>{i._setDisabledField({disabled:n,name:r})},[n,r,i]),a.useMemo(()=>({field:w,formState:p,fieldState:g}),[w,p,g])}const $u=e=>e.render(Gu(e)),Ku=a.createContext(null);Ku.displayName="HookFormContext";const qu=e=>{const{children:t,watch:r,getValues:n,getFieldState:i,setError:s,clearErrors:o,setValue:c,trigger:l,formState:u,resetField:d,reset:p,handleSubmit:m,unregister:h,control:f,register:g,setFocus:b,subscribe:v}=e;return a.createElement(Ku.Provider,{value:a.useMemo(()=>({watch:r,getValues:n,getFieldState:i,setError:s,clearErrors:o,setValue:c,trigger:l,formState:u,resetField:d,reset:p,handleSubmit:m,unregister:h,control:f,register:g,setFocus:b,subscribe:v}),[o,f,u,i,n,m,g,p,d,s,b,c,v,l,h,r])},a.createElement(Ou.Provider,{value:f},t))};var Zu=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},Ju=e=>Array.isArray(e)?e:[e],Yu=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}};function Xu(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const a=e[n],i=t[n];if(a&&lu(a)&&i){const e=Xu(a,i);lu(e)&&(r[n]=e)}else e[n]&&(r[n]=i)}return r}var Qu=e=>lu(e)&&!Object.keys(e).length,ed=e=>"file"===e.type,td=e=>{if(!pu)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},rd=e=>"select-multiple"===e.type,nd=e=>"radio"===e.type,ad=e=>td(e)&&e.isConnected;function id(e,t){const r=Array.isArray(t)?t:hu(t)?[t]:bu(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=fu(e)?n++:e[t[n++]];return e}(e,r),a=r.length-1,i=r[a];return n&&delete n[i],0!==a&&(lu(n)&&Qu(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!fu(e[t]))return!1;return!0}(n))&&id(e,r.slice(0,-1)),e}function sd(e){return Array.isArray(e)||lu(e)&&!(e=>{for(const t in e)if(wu(e[t]))return!0;return!1})(e)}function od(e,t={}){for(const r in e){const n=e[r];sd(n)?(t[r]=Array.isArray(n)?[]:{},od(n,t[r])):fu(n)||(t[r]=!0)}return t}function cd(e,t,r){r||(r=od(t));for(const n in e){const a=e[n];if(sd(a))fu(t)||ju(r[n])?r[n]=od(a,Array.isArray(a)?[]:{}):cd(a,ou(t)?{}:t[n],r[n]);else{const e=t[n];r[n]=!Hu(a,e)}}return r}const ld={value:!1,isValid:!1},ud={value:!0,isValid:!0};var dd=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!fu(e[0].attributes.value)?fu(e[0].value)||""===e[0].value?ud:{value:e[0].value,isValid:!0}:ud:ld}return ld},pd=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>fu(e)?e:t?""===e?NaN:e?+e:e:r&&Wu(e)?new Date(e):n?n(e):e;const md={isValid:!1,value:null};var hd=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,md):md;function fd(e){const t=e.ref;return ed(t)?t.files:nd(t)?hd(e.refs).value:rd(t)?[...t.selectedOptions].map(({value:e})=>e):iu(t)?dd(e.refs).value:pd(fu(t.value)?e.ref.value:t.value,e)}var gd=e=>e instanceof RegExp,bd=e=>fu(e)?e:gd(e)?e.source:lu(e)?gd(e.value)?e.value.source:e.value:e,vd=e=>({isOnSubmit:!e||e===Au,isOnBlur:e===Nu,isOnChange:e===Cu,isOnAll:e===Pu,isOnTouch:e===_u});const yd="AsyncFunction";var wd=e=>!!e&&!!e.validate&&!!(wu(e.validate)&&e.validate.constructor.name===yd||lu(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===yd)),xd=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const Sd=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const r=vu(e,a);if(r){const{_f:e,...i}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],a)&&!n)return!0;if(e.ref&&t(e.ref,e.name)&&!n)return!0;if(Sd(i,t))break}else if(lu(i)&&Sd(i,t))break}}};function kd(e,t,r){const n=vu(e,r);if(n||hu(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const n=a.join("."),i=vu(t,n),s=vu(e,n);if(i&&!Array.isArray(i)&&r!==n)return{name:r};if(s&&s.type)return{name:n,error:s};if(s&&s.root&&s.root.type)return{name:`${n}.root`,error:s.root};a.pop()}return{name:r}}var Ed=(e,t,r)=>{const n=Ju(vu(e,r));return xu(n,"root",t[r]),xu(e,r,n),e};function Nd(e,t,r="validate"){if(Wu(e)||Array.isArray(e)&&e.every(Wu)||yu(e)&&!e)return{type:r,message:Wu(e)?e:"",ref:t}}var Cd=e=>lu(e)&&!gd(e)?e:{value:e,message:""},Ad=async(e,t,r,n,a,i)=>{const{ref:s,refs:o,required:c,maxLength:l,minLength:u,min:d,max:p,pattern:m,validate:h,name:f,valueAsNumber:g,mount:b}=e._f,v=vu(r,f);if(!b||t.has(f))return{};const y=o?o[0]:s,w=e=>{a&&y.reportValidity&&(y.setCustomValidity(yu(e)?"":e||""),y.reportValidity())},x={},S=nd(s),k=iu(s),E=S||k,N=(g||ed(s))&&fu(s.value)&&fu(v)||td(s)&&""===s.value||""===v||Array.isArray(v)&&!v.length,C=Zu.bind(null,f,n,x),A=(e,t,r,n=Du,a=Iu)=>{const i=e?t:r;x[f]={type:e?n:a,message:i,ref:s,...C(e?n:a,i)}};if(i?!Array.isArray(v)||!v.length:c&&(!E&&(N||ou(v))||yu(v)&&!v||k&&!dd(o).isValid||S&&!hd(o).isValid)){const{value:e,message:t}=Wu(c)?{value:!!c,message:c}:Cd(c);if(e&&(x[f]={type:Mu,message:t,ref:y,...C(Mu,t)},!n))return w(t),x}if(!(N||ou(d)&&ou(p))){let e,t;const r=Cd(p),a=Cd(d);if(ou(v)||isNaN(v)){const n=s.valueAsDate||new Date(v),i=e=>new Date((new Date).toDateString()+" "+e),o="time"==s.type,c="week"==s.type;Wu(r.value)&&v&&(e=o?i(v)>i(r.value):c?v>r.value:n>new Date(r.value)),Wu(a.value)&&v&&(t=o?i(v)<i(a.value):c?v<a.value:n<new Date(a.value))}else{const n=s.valueAsNumber||(v?+v:v);ou(r.value)||(e=n>r.value),ou(a.value)||(t=n<a.value)}if((e||t)&&(A(!!e,r.message,a.message,Tu,Ru),!n))return w(x[f].message),x}if((l||u)&&!N&&(Wu(v)||i&&Array.isArray(v))){const e=Cd(l),t=Cd(u),r=!ou(e.value)&&v.length>+e.value,a=!ou(t.value)&&v.length<+t.value;if((r||a)&&(A(r,e.message,t.message),!n))return w(x[f].message),x}if(m&&!N&&Wu(v)){const{value:e,message:t}=Cd(m);if(gd(e)&&!v.match(e)&&(x[f]={type:Uu,message:t,ref:s,...C(Uu,t)},!n))return w(t),x}if(h)if(wu(h)){const e=Nd(await h(v,r),y);if(e&&(x[f]={...e,...C(Lu,e.message)},!n))return w(e.message),x}else if(lu(h)){let e={};for(const t in h){if(!Qu(e)&&!n)break;const a=Nd(await h[t](v,r),y,t);a&&(e={...a,...C(t,a.message)},w(a.message),n&&(x[f]=e))}if(!Qu(e)&&(x[f]={ref:y,...e},!n))return x}return w(!0),x};const _d={mode:Au,reValidateMode:Cu,shouldFocusError:!0};function Pd(e={}){let t,r={..._d,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:wu(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},i=(lu(r.defaultValues)||lu(r.values))&&mu(r.defaultValues||r.values)||{},s=r.shouldUnregister?{}:mu(i),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...u};let p={...d};const m={array:Yu(),state:Yu()},h=r.criteriaMode===Pu,f=async e=>{if(!o.keepIsValid&&!r.disabled&&(d.isValid||p.isValid||e)){let e;r.resolver?(e=Qu((await w()).errors),g()):e=await x(a,!0),e!==n.isValid&&m.state.next({isValid:e})}},g=(e,t)=>{!r.disabled&&(d.isValidating||d.validatingFields||p.isValidating||p.validatingFields)&&((e||Array.from(c.mount)).forEach(e=>{e&&(t?xu(n.validatingFields,e,t):id(n.validatingFields,e))}),m.state.next({validatingFields:n.validatingFields,isValidating:!Qu(n.validatingFields)}))},b=(e,t,r,n)=>{const c=vu(a,e);if(c){const a=vu(s,e,fu(r)?vu(i,e):r);fu(a)||n&&n.defaultChecked||t?xu(s,e,t?a:fd(c._f)):E(e,a),o.mount&&!o.action&&f()}},v=(e,t,a,s,o)=>{let c=!1,l=!1;const u={name:e};if(!r.disabled){if(!a||s){(d.isDirty||p.isDirty)&&(l=n.isDirty,n.isDirty=u.isDirty=S(),c=l!==u.isDirty);const r=Hu(vu(i,e),t);l=!!vu(n.dirtyFields,e),r?id(n.dirtyFields,e):xu(n.dirtyFields,e,!0),u.dirtyFields=n.dirtyFields,c=c||(d.dirtyFields||p.dirtyFields)&&l!==!r}if(a){const t=vu(n.touchedFields,e);t||(xu(n.touchedFields,e,a),u.touchedFields=n.touchedFields,c=c||(d.touchedFields||p.touchedFields)&&t!==a)}c&&o&&m.state.next(u)}return c?u:{}},y=(e,a,i,s)=>{const o=vu(n.errors,e),c=(d.isValid||p.isValid)&&yu(a)&&n.isValid!==a;var u;if(r.delayError&&i?(u=()=>((e,t)=>{xu(n.errors,e,t),m.state.next({errors:n.errors})})(e,i),t=e=>{clearTimeout(l),l=setTimeout(u,e)},t(r.delayError)):(clearTimeout(l),t=null,i?xu(n.errors,e,i):id(n.errors,e)),(i?!Hu(o,i):o)||!Qu(s)||c){const t={...s,...c&&yu(a)?{isValid:a}:{},errors:n.errors,name:e};n={...n,...t},m.state.next(t)}},w=async e=>{g(e,!0);const t=await r.resolver(s,r.context,((e,t,r,n)=>{const a={};for(const r of e){const e=vu(t,r);e&&xu(a,r,e._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}})(e||c.mount,a,r.criteriaMode,r.shouldUseNativeValidation));return t},x=async(t,a,i={valid:!0})=>{for(const o in t){const l=t[o];if(l){const{_f:t,...o}=l;if(t){const o=c.array.has(t.name),u=l._f&&wd(l._f);u&&d.validatingFields&&g([t.name],!0);const p=await Ad(l,c.disabled,s,h,r.shouldUseNativeValidation&&!a,o);if(u&&d.validatingFields&&g([t.name]),p[t.name]&&(i.valid=!1,a||e.shouldUseNativeValidation))break;!a&&(vu(p,t.name)?o?Ed(n.errors,p,t.name):xu(n.errors,t.name,p[t.name]):id(n.errors,t.name))}!Qu(o)&&await x(o,a,i)}}return i.valid},S=(e,t)=>!r.disabled&&(e&&t&&xu(s,e,t),!Hu(T(),i)),k=(e,t,r)=>Vu(e,c,{...o.mount?s:fu(t)?i:Wu(e)?{[e]:t}:t},r,t),E=(e,t,r={})=>{const n=vu(a,e);let i=t;if(n){const r=n._f;r&&(!r.disabled&&xu(s,e,pd(t,r)),i=td(r.ref)&&ou(t)?"":t,rd(r.ref)?[...r.ref.options].forEach(e=>e.selected=i.includes(e.value)):r.refs?iu(r.ref)?r.refs.forEach(e=>{e.defaultChecked&&e.disabled||(Array.isArray(i)?e.checked=!!i.find(t=>t===e.value):e.checked=i===e.value||!!i)}):r.refs.forEach(e=>e.checked=e.value===i):ed(r.ref)?r.ref.value="":(r.ref.value=i,r.ref.type||m.state.next({name:e,values:mu(s)})))}(r.shouldDirty||r.shouldTouch)&&v(e,i,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&P(e)},N=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const i=t[n],s=e+"."+n,o=vu(a,s);(c.array.has(e)||lu(i)||o&&!o._f)&&!su(i)?N(s,i,r):E(s,i,r)}},C=(e,t,r={})=>{const l=vu(a,e),u=c.array.has(e),h=mu(t);xu(s,e,h),u?(m.array.next({name:e,values:mu(s)}),(d.isDirty||d.dirtyFields||p.isDirty||p.dirtyFields)&&r.shouldDirty&&m.state.next({name:e,dirtyFields:cd(i,s),isDirty:S(e,h)})):!l||l._f||ou(h)?E(e,h,r):N(e,h,r),xd(e,c)?m.state.next({...n,name:e,values:mu(s)}):m.state.next({name:o.mount?e:void 0,values:mu(s)})},A=async e=>{o.mount=!0;const i=e.target;let l=i.name,u=!0;const b=vu(a,l),S=e=>{u=Number.isNaN(e)||su(e)&&isNaN(e.getTime())||Hu(e,vu(s,l,e))},k=vd(r.mode),E=vd(r.reValidateMode);if(b){let o,N;const C=i.type?fd(b._f):uu(e),A=e.type===Su||e.type===ku,_=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(b._f)&&!r.resolver&&!vu(n.errors,l)&&!b._f.deps||((e,t,r,n,a)=>!a.isOnAll&&(!r&&a.isOnTouch?!(t||e):(r?n.isOnBlur:a.isOnBlur)?!e:!(r?n.isOnChange:a.isOnChange)||e))(A,vu(n.touchedFields,l),n.isSubmitted,E,k),T=xd(l,c,A);xu(s,l,C),A?i&&i.readOnly||(b._f.onBlur&&b._f.onBlur(e),t&&t(0)):b._f.onChange&&b._f.onChange(e);const R=v(l,C,A),D=!Qu(R)||T;if(!A&&m.state.next({name:l,type:e.type,values:mu(s)}),_)return(d.isValid||p.isValid)&&("onBlur"===r.mode?A&&f():A||f()),D&&m.state.next({name:l,...T?{}:R});if(!A&&T&&m.state.next({...n}),r.resolver){const{errors:e}=await w([l]);if(g([l]),S(C),u){const t=kd(n.errors,a,l),r=kd(e,a,t.name||l);o=r.error,l=r.name,N=Qu(e)}}else g([l],!0),o=(await Ad(b,c.disabled,s,h,r.shouldUseNativeValidation))[l],g([l]),S(C),u&&(o?N=!1:(d.isValid||p.isValid)&&(N=await x(a,!0)));u&&(b._f.deps&&(!Array.isArray(b._f.deps)||b._f.deps.length>0)&&P(b._f.deps),y(l,N,o,R))}},_=(e,t)=>{if(vu(n.errors,t)&&e.focus)return e.focus(),1},P=async(e,t={})=>{let i,s;const o=Ju(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await w(e);if(g(e),e)for(const r of e){const e=vu(t,r);e?xu(n.errors,r,e):id(n.errors,r)}else n.errors=t;return t})(fu(e)?e:o);i=Qu(t),s=e?!o.some(e=>vu(t,e)):i}else e?(s=(await Promise.all(o.map(async e=>{const t=vu(a,e);return await x(t&&t._f?{[e]:t}:t)}))).every(Boolean),(s||n.isValid)&&f()):s=i=await x(a);return m.state.next({...!Wu(e)||(d.isValid||p.isValid)&&i!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:i}:{},errors:n.errors}),t.shouldFocus&&!s&&Sd(a,_,e?o:c.mount),s},T=(e,t)=>{let r={...o.mount?s:i};return t&&(r=Xu(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),fu(e)?r:Wu(e)?vu(r,e):e.map(e=>vu(r,e))},R=(e,t)=>({invalid:!!vu((t||n).errors,e),isDirty:!!vu((t||n).dirtyFields,e),error:vu((t||n).errors,e),isValidating:!!vu(n.validatingFields,e),isTouched:!!vu((t||n).touchedFields,e)}),D=(e,t,r)=>{const i=(vu(a,e,{_f:{}})._f||{}).ref,s=vu(n.errors,e)||{},{ref:o,message:c,type:l,...u}=s;xu(n.errors,e,{...u,...t,ref:i}),m.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&i&&i.focus&&i.focus()},I=e=>m.state.subscribe({next:t=>{var r,a,o;r=e.name,a=t.name,o=e.exact,r&&a&&r!==a&&!Ju(r).some(e=>e&&(o?e===a:e.startsWith(a)||a.startsWith(e)))||!((e,t,r,n)=>{r(e);const{name:a,...i}=e;return Qu(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(e=>t[e]===(!n||Pu))})(t,e.formState||d,W,e.reRenderRoot)||e.callback({values:{...s},...n,...t,defaultValues:i})}}).unsubscribe,U=(e,t={})=>{for(const o of e?Ju(e):c.mount)c.mount.delete(o),c.array.delete(o),t.keepValue||(id(a,o),id(s,o)),!t.keepError&&id(n.errors,o),!t.keepDirty&&id(n.dirtyFields,o),!t.keepTouched&&id(n.touchedFields,o),!t.keepIsValidating&&id(n.validatingFields,o),!r.shouldUnregister&&!t.keepDefaultValue&&id(i,o);m.state.next({values:mu(s)}),m.state.next({...n,...t.keepDirty?{isDirty:S()}:{}}),!t.keepIsValid&&f()},M=({disabled:e,name:t})=>{if(yu(e)&&o.mount||e||c.disabled.has(t)){const r=c.disabled.has(t)!==!!e;e?c.disabled.add(t):c.disabled.delete(t),r&&o.mount&&!o.action&&f()}},L=(e,t={})=>{let n=vu(a,e);const s=yu(t.disabled)||yu(r.disabled);return xu(a,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),c.mount.add(e),n?M({disabled:yu(t.disabled)?t.disabled:r.disabled,name:e}):b(e,!0,t.value),{...s?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:bd(t.min),max:bd(t.max),minLength:bd(t.minLength),maxLength:bd(t.maxLength),pattern:bd(t.pattern)}:{},name:e,onChange:A,onBlur:A,ref:s=>{if(s){L(e,t),n=vu(a,e);const r=fu(s.value)&&s.querySelectorAll&&s.querySelectorAll("input,select,textarea")[0]||s,o=(e=>nd(e)||iu(e))(r),c=n._f.refs||[];if(o?c.find(e=>e===r):r===n._f.ref)return;xu(a,e,{_f:{...n._f,...o?{refs:[...c.filter(ad),r,...Array.isArray(vu(i,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),b(e,!1,void 0,r)}else n=vu(a,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!du(c.array,e)||!o.action)&&c.unMount.add(e)}}},O=()=>r.shouldFocusError&&Sd(a,_,c.mount),z=(e,t)=>async i=>{let o;i&&(i.preventDefault&&i.preventDefault(),i.persist&&i.persist());let l=mu(s);if(m.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await w();g(),n.errors=e,l=mu(t)}else await x(a);if(c.disabled.size)for(const e of c.disabled)id(l,e);if(id(n.errors,"root"),Qu(n.errors)){m.state.next({errors:{}});try{await e(l,i)}catch(e){o=e}}else t&&await t({...n.errors},i),O(),setTimeout(O);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Qu(n.errors)&&!o,submitCount:n.submitCount+1,errors:n.errors}),o)throw o},F=(e,t={})=>{const l=e?mu(e):i,u=mu(l),p=Qu(e),h=p?i:u;if(t.keepDefaultValues||(i=l),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...c.mount,...Object.keys(cd(i,s))]);for(const t of Array.from(e)){const e=vu(n.dirtyFields,t),r=vu(s,t),a=vu(h,t);e&&!fu(r)?xu(h,t,r):e||fu(a)||C(t,a)}}else{if(pu&&fu(e))for(const e of c.mount){const t=vu(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(td(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of c.mount)C(e,vu(h,e));else a={}}s=r.shouldUnregister?t.keepDefaultValues?mu(i):{}:mu(h),m.array.next({values:{...h}}),m.state.next({values:{...h}})}c={mount:t.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!t.keepIsValid||!!t.keepDirtyValues||!r.shouldUnregister&&!Qu(h),o.watch=!!r.shouldUnregister,o.keepIsValid=!!t.keepIsValid,o.action=!1,t.keepErrors||(n.errors={}),m.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!p&&(t.keepDirty?n.isDirty:!(!t.keepDefaultValues||Hu(e,i))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:p?{}:t.keepDirtyValues?t.keepDefaultValues&&s?cd(i,s):n.dirtyFields:t.keepDefaultValues&&e?cd(i,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1,defaultValues:i})},B=(e,t)=>F(wu(e)?e(s):e,{...r.resetOptions,...t}),W=e=>{n={...n,...e}},V={control:{register:L,unregister:U,getFieldState:R,handleSubmit:z,setError:D,_subscribe:I,_runSchema:w,_updateIsValidating:g,_focusError:O,_getWatch:k,_getDirty:S,_setValid:f,_setFieldArray:(e,t=[],c,l,u=!0,h=!0)=>{if(l&&c&&!r.disabled){if(o.action=!0,h&&Array.isArray(vu(a,e))){const t=c(vu(a,e),l.argA,l.argB);u&&xu(a,e,t)}if(h&&Array.isArray(vu(n.errors,e))){const t=c(vu(n.errors,e),l.argA,l.argB);u&&xu(n.errors,e,t),((e,t)=>{!gu(vu(e,t)).length&&id(e,t)})(n.errors,e)}if((d.touchedFields||p.touchedFields)&&h&&Array.isArray(vu(n.touchedFields,e))){const t=c(vu(n.touchedFields,e),l.argA,l.argB);u&&xu(n.touchedFields,e,t)}(d.dirtyFields||p.dirtyFields)&&(n.dirtyFields=cd(i,s)),m.state.next({name:e,isDirty:S(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else xu(s,e,t)},_setDisabledField:M,_setErrors:e=>{n.errors=e,m.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>gu(vu(o.mount?s:i,e,r.shouldUnregister?vu(i,e,[]):[])),_reset:F,_resetDefaultValues:()=>wu(r.defaultValues)&&r.defaultValues().then(e=>{B(e,r.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of c.unMount){const t=vu(a,e);t&&(t._f.refs?t._f.refs.every(e=>!ad(e)):!ad(t._f.ref))&&U(e)}c.unMount=new Set},_disableForm:e=>{yu(e)&&(m.state.next({disabled:e}),Sd(a,(t,r)=>{const n=vu(a,r);n&&(t.disabled=n._f.disabled||e,Array.isArray(n._f.refs)&&n._f.refs.forEach(t=>{t.disabled=n._f.disabled||e}))},0,!1))},_subjects:m,_proxyFormState:d,get _fields(){return a},get _formValues(){return s},get _state(){return o},set _state(e){o=e},get _defaultValues(){return i},get _names(){return c},set _names(e){c=e},get _formState(){return n},get _options(){return r},set _options(e){r={...r,...e}}},subscribe:e=>(o.mount=!0,p={...p,...e.formState},I({...e,formState:{...u,...e.formState}})),trigger:P,register:L,handleSubmit:z,watch:(e,t)=>wu(e)?m.state.subscribe({next:r=>"values"in r&&e(k(void 0,t),r)}):k(e,t,!0),setValue:C,getValues:T,reset:B,resetField:(e,t={})=>{vu(a,e)&&(fu(t.defaultValue)?C(e,mu(vu(i,e))):(C(e,t.defaultValue),xu(i,e,mu(t.defaultValue))),t.keepTouched||id(n.touchedFields,e),t.keepDirty||(id(n.dirtyFields,e),n.isDirty=t.defaultValue?S(e,mu(vu(i,e))):S()),t.keepError||(id(n.errors,e),d.isValid&&f()),m.state.next({...n}))},clearErrors:e=>{e&&Ju(e).forEach(e=>id(n.errors,e)),m.state.next({errors:e?n.errors:{}})},unregister:U,setError:D,setFocus:(e,t={})=>{const r=vu(a,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&wu(e.select)&&e.select()})}},getFieldState:R};return{...V,formControl:V}}function Td(e={}){const t=a.useRef(void 0),r=a.useRef(void 0),[n,i]=a.useState({isDirty:!1,isValidating:!1,isLoading:wu(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:wu(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!wu(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:r,...a}=Pd(e);t.current={...a,formState:n}}const s=t.current.control;return s._options=e,Bu(()=>{const e=s._subscribe({formState:s._proxyFormState,callback:()=>i({...s._formState}),reRenderRoot:!0});return i(e=>({...e,isReady:!0})),s._formState.isReady=!0,e},[s]),a.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),a.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),a.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),a.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),a.useEffect(()=>{if(s._proxyFormState.isDirty){const e=s._getDirty();e!==n.isDirty&&s._subjects.state.next({isDirty:e})}},[s,n.isDirty]),a.useEffect(()=>{var t;e.values&&!Hu(e.values,r.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),(null===(t=s._options.resetOptions)||void 0===t?void 0:t.keepIsValid)||s._setValid(),r.current=e.values,i(e=>({...e}))):s._resetDefaultValues()},[s,e.values]),a.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=a.useMemo(()=>Fu(n,s),[s,n]),t.current}const Rd=(e,t,r)=>{if(e&&"reportValidity"in e){const n=vu(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Dd=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Rd(n.ref,r,e):n&&n.refs&&n.refs.forEach(t=>Rd(t,r,e))}},Id=(e,t)=>{t.shouldUseNativeValidation&&Dd(e,t);const r={};for(const n in e){const a=vu(t.fields,n),i=Object.assign(e[n]||{},{ref:a&&a.ref});if(Ud(t.names||Object.keys(e),n)){const e=Object.assign({},vu(r,n));xu(e,"root",i),xu(r,n,e)}else xu(r,n,i)}return r},Ud=(e,t)=>{const r=Md(t);return e.some(e=>Md(e).match(`^${r}\\.\\d+`))};function Md(e){return e.replace(/\]|\[/g,"")}function Ld(e,t,r){function n(r,n){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:n,constr:s,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,n);const a=s.prototype,i=Object.keys(a);for(let e=0;e<i.length;e++){const t=i[e];t in r||(r[t]=a[t].bind(r))}}const a=r?.Parent??Object;class i extends a{}function s(e){var t;const a=r?.Parent?new i:this;n(a,e),(t=a._zod).deferred??(t.deferred=[]);for(const e of a._zod.deferred)e();return a}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(r?.Parent&&t instanceof r.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class Od extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class zd extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Fd={};function Bd(e){return Fd}function Wd(e){const t=Object.values(e).filter(e=>"number"==typeof e),r=Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t);return r}function Vd(e,t){return"bigint"==typeof t?t.toString():t}function jd(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Hd(e){return null==e}function Gd(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const $d=Symbol("evaluating");function Kd(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==$d)return void 0===n&&(n=$d,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function qd(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Zd(...e){const t={};for(const r of e){const e=Object.getOwnPropertyDescriptors(r);Object.assign(t,e)}return Object.defineProperties({},t)}function Jd(e){return JSON.stringify(e)}const Yd="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xd(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Qd=jd(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function ep(e){if(!1===Xd(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const r=t.prototype;return!1!==Xd(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function tp(e){return ep(e)?{...e}:Array.isArray(e)?[...e]:e}const rp=new Set(["string","number","symbol"]);function np(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ap(e,t,r){const n=new e._zod.constr(t??e._zod.def);return t&&!r?.parent||(n._zod.parent=e),n}function ip(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function sp(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(!0!==e.issues[r]?.continue)return!0;return!1}function op(e,t){return t.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function cp(e){return"string"==typeof e?e:e?.message}function lp(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const a=cp(e.inst?._zod.def?.error?.(e))??cp(t?.error?.(e))??cp(r.customError?.(e))??cp(r.localeError?.(e))??"Invalid input";n.message=a}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function up(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function dp(...e){const[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}const pp=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Vd,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},mp=Ld("$ZodError",pp),hp=Ld("$ZodError",pp,{Parent:Error});const fp=e=>(t,r,n,a)=>{const i=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new Od;if(s.issues.length){const t=new(a?.Err??e)(s.issues.map(e=>lp(e,i,Bd())));throw Yd(t,a?.callee),t}return s.value},gp=fp(hp),bp=e=>async(t,r,n,a)=>{const i=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(a?.Err??e)(s.issues.map(e=>lp(e,i,Bd())));throw Yd(t,a?.callee),t}return s.value},vp=bp(hp),yp=e=>(t,r,n)=>{const a=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},a);if(i instanceof Promise)throw new Od;return i.issues.length?{success:!1,error:new(e??mp)(i.issues.map(e=>lp(e,a,Bd())))}:{success:!0,data:i.value}},wp=yp(hp),xp=e=>async(t,r,n)=>{const a=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},a);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>lp(e,a,Bd())))}:{success:!0,data:i.value}},Sp=xp(hp),kp=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return fp(e)(t,r,a)},Ep=e=>(t,r,n)=>fp(e)(t,r,n),Np=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return bp(e)(t,r,a)},Cp=e=>async(t,r,n)=>bp(e)(t,r,n),Ap=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return yp(e)(t,r,a)},_p=e=>(t,r,n)=>yp(e)(t,r,n),Pp=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return xp(e)(t,r,a)},Tp=e=>async(t,r,n)=>xp(e)(t,r,n),Rp=/^[cC][^\s-]{8,}$/,Dp=/^[0-9a-z]+$/,Ip=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Up=/^[0-9a-vA-V]{20}$/,Mp=/^[A-Za-z0-9]{27}$/,Lp=/^[a-zA-Z0-9_-]{21}$/,Op=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,zp=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Fp=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Bp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const Wp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Vp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,jp=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Hp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Gp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,$p=/^[A-Za-z0-9_-]*$/,Kp=/^\+[1-9]\d{6,14}$/,qp="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Zp=new RegExp(`^${qp}$`);function Jp(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const Yp=/^[^A-Z]*$/,Xp=/^[^a-z]*$/,Qp=Ld("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),em=Ld("$ZodCheckMaxLength",(e,t)=>{var r;Qp.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Hd(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const n=r.value;if(n.length<=t.maximum)return;const a=up(n);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),tm=Ld("$ZodCheckMinLength",(e,t)=>{var r;Qp.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Hd(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const n=r.value;if(n.length>=t.minimum)return;const a=up(n);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),rm=Ld("$ZodCheckLengthEquals",(e,t)=>{var r;Qp.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Hd(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{const n=r.value,a=n.length;if(a===t.length)return;const i=up(n),s=a>t.length;r.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),nm=Ld("$ZodCheckStringFormat",(e,t)=>{var r,n;Qp.init(e,t),e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),am=Ld("$ZodCheckRegex",(e,t)=>{nm.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),im=Ld("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Yp),nm.init(e,t)}),sm=Ld("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Xp),nm.init(e,t)}),om=Ld("$ZodCheckIncludes",(e,t)=>{Qp.init(e,t);const r=np(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),cm=Ld("$ZodCheckStartsWith",(e,t)=>{Qp.init(e,t);const r=new RegExp(`^${np(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),lm=Ld("$ZodCheckEndsWith",(e,t)=>{Qp.init(e,t);const r=new RegExp(`.*${np(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),um=Ld("$ZodCheckOverwrite",(e,t)=>{Qp.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class dm{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length)),n=t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e);for(const e of n)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const pm={major:4,minor:3,patch:6},mm=Ld("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=pm;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const t of n)for(const r of t._zod.onattach)r(e);if(0===n.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,r)=>{let n,a=sp(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(a)continue;const t=e.issues.length,s=i._zod.check(e);if(s instanceof Promise&&!1===r?.async)throw new Od;if(n||s instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await s;e.issues.length!==t&&(a||(a=sp(e,t)))});else{if(e.issues.length===t)continue;a||(a=sp(e,t))}}return n?n.then(()=>e):e},r=(r,a,i)=>{if(sp(r))return r.aborted=!0,r;const s=t(a,n,i);if(s instanceof Promise){if(!1===i.async)throw new Od;return s.then(t=>e._zod.parse(t,i))}return e._zod.parse(s,i)};e._zod.run=(a,i)=>{if(i.skipChecks)return e._zod.parse(a,i);if("backward"===i.direction){const t=e._zod.parse({value:a.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,a,i)):r(t,a,i)}const s=e._zod.parse(a,i);if(s instanceof Promise){if(!1===i.async)throw new Od;return s.then(e=>t(e,n,i))}return t(s,n,i)}}Kd(e,"~standard",()=>({validate:t=>{try{const r=wp(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return Sp(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),hm=Ld("$ZodString",(e,t)=>{var r;mm.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(r=e._zod.bag,new RegExp(`^${r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),fm=Ld("$ZodStringFormat",(e,t)=>{nm.init(e,t),hm.init(e,t)}),gm=Ld("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=zp),fm.init(e,t)}),bm=Ld("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Fp(e))}else t.pattern??(t.pattern=Fp());fm.init(e,t)}),vm=Ld("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Bp),fm.init(e,t)}),ym=Ld("$ZodURL",(e,t)=>{fm.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),a=new URL(n);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),void(t.normalize?r.value=a.href:r.value=n)}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),wm=Ld("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),fm.init(e,t)}),xm=Ld("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Lp),fm.init(e,t)}),Sm=Ld("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Rp),fm.init(e,t)}),km=Ld("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Dp),fm.init(e,t)}),Em=Ld("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ip),fm.init(e,t)}),Nm=Ld("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Up),fm.init(e,t)}),Cm=Ld("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Mp),fm.init(e,t)}),Am=Ld("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Jp({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${qp}T(?:${n})$`)}(t)),fm.init(e,t)}),_m=Ld("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Zp),fm.init(e,t)}),Pm=Ld("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Jp(t)}$`)),fm.init(e,t)}),Tm=Ld("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Op),fm.init(e,t)}),Rm=Ld("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Wp),fm.init(e,t),e._zod.bag.format="ipv4"}),Dm=Ld("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Vp),fm.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Im=Ld("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=jp),fm.init(e,t)}),Um=Ld("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Hp),fm.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(2!==n.length)throw new Error;const[e,t]=n;if(!t)throw new Error;const r=Number(t);if(`${r}`!==t)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Mm(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Lm=Ld("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Gp),fm.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Mm(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});const Om=Ld("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=$p),fm.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{(function(e){if(!$p.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Mm(t.padEnd(4*Math.ceil(t.length/4),"="))})(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),zm=Ld("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Kp),fm.init(e,t)});const Fm=Ld("$ZodJWT",(e,t)=>{fm.init(e,t),e._zod.check=r=>{(function(e,t=null){try{const r=e.split(".");if(3!==r.length)return!1;const[n]=r;if(!n)return!1;const a=JSON.parse(atob(n));return!("typ"in a&&"JWT"!==a?.typ||!a.alg||t&&(!("alg"in a)||a.alg!==t))}catch{return!1}})(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Bm=Ld("$ZodUnknown",(e,t)=>{mm.init(e,t),e._zod.parse=e=>e}),Wm=Ld("$ZodNever",(e,t)=>{mm.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function Vm(e,t,r){e.issues.length&&t.issues.push(...op(r,e.issues)),t.value[r]=e.value}const jm=Ld("$ZodArray",(e,t)=>{mm.init(e,t),e._zod.parse=(r,n)=>{const a=r.value;if(!Array.isArray(a))return r.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),r;r.value=Array(a.length);const i=[];for(let e=0;e<a.length;e++){const s=a[e],o=t.element._zod.run({value:s,issues:[]},n);o instanceof Promise?i.push(o.then(t=>Vm(t,r,e))):Vm(o,r,e)}return i.length?Promise.all(i).then(()=>r):r}});function Hm(e,t,r,n,a){if(e.issues.length){if(a&&!(r in n))return;t.issues.push(...op(r,e.issues))}void 0===e.value?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function Gm(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const r=(n=e.shape,Object.keys(n).filter(e=>"optional"===n[e]._zod.optin&&"optional"===n[e]._zod.optout));var n;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function $m(e,t,r,n,a,i){const s=[],o=a.keySet,c=a.catchall._zod,l=c.def.type,u="optional"===c.optout;for(const a in t){if(o.has(a))continue;if("never"===l){s.push(a);continue}const i=c.run({value:t[a],issues:[]},n);i instanceof Promise?e.push(i.then(e=>Hm(e,r,a,t,u))):Hm(i,r,a,t,u)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}const Km=Ld("$ZodObject",(e,t)=>{mm.init(e,t);const r=Object.getOwnPropertyDescriptor(t,"shape");if(!r?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const r={...e};return Object.defineProperty(t,"shape",{value:r}),r}})}const n=jd(()=>Gm(t));Kd(e._zod,"propValues",()=>{const e=t.shape,r={};for(const t in e){const n=e[t]._zod;if(n.values){r[t]??(r[t]=new Set);for(const e of n.values)r[t].add(e)}}return r});const a=Xd,i=t.catchall;let s;e._zod.parse=(t,r)=>{s??(s=n.value);const o=t.value;if(!a(o))return t.issues.push({expected:"object",code:"invalid_type",input:o,inst:e}),t;t.value={};const c=[],l=s.shape;for(const e of s.keys){const n=l[e],a="optional"===n._zod.optout,i=n._zod.run({value:o[e],issues:[]},r);i instanceof Promise?c.push(i.then(r=>Hm(r,t,e,o,a))):Hm(i,t,e,o,a)}return i?$m(c,o,t,r,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),qm=Ld("$ZodObjectJIT",(e,t)=>{Km.init(e,t);const r=e._zod.parse,n=jd(()=>Gm(t));let a;const i=Xd,s=!Fd.jitless,o=s&&Qd.value,c=t.catchall;let l;e._zod.parse=(u,d)=>{l??(l=n.value);const p=u.value;return i(p)?s&&o&&!1===d?.async&&!0!==d.jitless?(a||(a=(e=>{const t=new dm(["shape","payload","ctx"]),r=n.value,a=e=>{const t=Jd(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let s=0;for(const e of r.keys)i[e]="key_"+s++;t.write("const newResult = {};");for(const n of r.keys){const r=i[n],s=Jd(n),o=e[n],c="optional"===o?._zod?.optout;t.write(`const ${r} = ${a(n)};`),c?t.write(`\n if (${r}.issues.length) {\n if (${s} in input) {\n payload.issues = payload.issues.concat(${r}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${s}, ...iss.path] : [${s}]\n })));\n }\n }\n \n if (${r}.value === undefined) {\n if (${s} in input) {\n newResult[${s}] = undefined;\n }\n } else {\n newResult[${s}] = ${r}.value;\n }\n \n `):t.write(`\n if (${r}.issues.length) {\n payload.issues = payload.issues.concat(${r}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${s}, ...iss.path] : [${s}]\n })));\n }\n \n if (${r}.value === undefined) {\n if (${s} in input) {\n newResult[${s}] = undefined;\n }\n } else {\n newResult[${s}] = ${r}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const o=t.compile();return(t,r)=>o(e,t,r)})(t.shape)),u=a(u,d),c?$m([],p,u,d,l,e):u):r(u,d):(u.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),u)}});function Zm(e,t,r,n){for(const r of e)if(0===r.issues.length)return t.value=r.value,t;const a=e.filter(e=>!sp(e));return 1===a.length?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>lp(e,n,Bd())))}),t)}const Jm=Ld("$ZodUnion",(e,t)=>{mm.init(e,t),Kd(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Kd(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Kd(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Kd(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>Gd(e.source)).join("|")})$`)}});const r=1===t.options.length,n=t.options[0]._zod.run;e._zod.parse=(a,i)=>{if(r)return n(a,i);let s=!1;const o=[];for(const e of t.options){const t=e._zod.run({value:a.value,issues:[]},i);if(t instanceof Promise)o.push(t),s=!0;else{if(0===t.issues.length)return t;o.push(t)}}return s?Promise.all(o).then(t=>Zm(t,a,e,i)):Zm(o,a,e,i)}}),Ym=Ld("$ZodIntersection",(e,t)=>{mm.init(e,t),e._zod.parse=(e,r)=>{const n=e.value,a=t.left._zod.run({value:n,issues:[]},r),i=t.right._zod.run({value:n,issues:[]},r);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([t,r])=>Qm(e,t,r)):Qm(e,a,i)}});function Xm(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(ep(e)&&ep(t)){const r=Object.keys(t),n=Object.keys(e).filter(e=>-1!==r.indexOf(e)),a={...e,...t};for(const r of n){const n=Xm(e[r],t[r]);if(!n.valid)return{valid:!1,mergeErrorPath:[r,...n.mergeErrorPath]};a[r]=n.data}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const a=Xm(e[n],t[n]);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Qm(e,t,r){const n=new Map;let a;for(const r of t.issues)if("unrecognized_keys"===r.code){a??(a=r);for(const e of r.keys)n.has(e)||n.set(e,{}),n.get(e).l=!0}else e.issues.push(r);for(const t of r.issues)if("unrecognized_keys"===t.code)for(const e of t.keys)n.has(e)||n.set(e,{}),n.get(e).r=!0;else e.issues.push(t);const i=[...n].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(i.length&&a&&e.issues.push({...a,keys:i}),sp(e))return e;const s=Xm(t.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const eh=Ld("$ZodEnum",(e,t)=>{mm.init(e,t);const r=Wd(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(e=>rp.has(typeof e)).map(e=>"string"==typeof e?np(e):e.toString()).join("|")})$`),e._zod.parse=(t,a)=>{const i=t.value;return n.has(i)||t.issues.push({code:"invalid_value",values:r,input:i,inst:e}),t}}),th=Ld("$ZodTransform",(e,t)=>{mm.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new zd(e.constructor.name);const a=t.transform(r.value,r);if(n.async){return(a instanceof Promise?a:Promise.resolve(a)).then(e=>(r.value=e,r))}if(a instanceof Promise)throw new Od;return r.value=a,r}});function rh(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const nh=Ld("$ZodOptional",(e,t)=>{mm.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Kd(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Kd(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Gd(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if("optional"===t.innerType._zod.optin){const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(t=>rh(t,e.value)):rh(n,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),ah=Ld("$ZodExactOptional",(e,t)=>{nh.init(e,t),Kd(e._zod,"values",()=>t.innerType._zod.values),Kd(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),ih=Ld("$ZodNullable",(e,t)=>{mm.init(e,t),Kd(e._zod,"optin",()=>t.innerType._zod.optin),Kd(e._zod,"optout",()=>t.innerType._zod.optout),Kd(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Gd(e.source)}|null)$`):void 0}),Kd(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),sh=Ld("$ZodDefault",(e,t)=>{mm.init(e,t),e._zod.optin="optional",Kd(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>oh(e,t)):oh(n,t)}});function oh(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const ch=Ld("$ZodPrefault",(e,t)=>{mm.init(e,t),e._zod.optin="optional",Kd(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),lh=Ld("$ZodNonOptional",(e,t)=>{mm.init(e,t),Kd(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{const a=t.innerType._zod.run(r,n);return a instanceof Promise?a.then(t=>uh(t,e)):uh(a,e)}});function uh(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const dh=Ld("$ZodCatch",(e,t)=>{mm.init(e,t),Kd(e._zod,"optin",()=>t.innerType._zod.optin),Kd(e._zod,"optout",()=>t.innerType._zod.optout),Kd(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(n=>(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>lp(e,r,Bd()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>lp(e,r,Bd()))},input:e.value}),e.issues=[]),e)}}),ph=Ld("$ZodPipe",(e,t)=>{mm.init(e,t),Kd(e._zod,"values",()=>t.in._zod.values),Kd(e._zod,"optin",()=>t.in._zod.optin),Kd(e._zod,"optout",()=>t.out._zod.optout),Kd(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){const n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>mh(e,t.in,r)):mh(n,t.in,r)}const n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>mh(e,t.out,r)):mh(n,t.out,r)}});function mh(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const hh=Ld("$ZodReadonly",(e,t)=>{mm.init(e,t),Kd(e._zod,"propValues",()=>t.innerType._zod.propValues),Kd(e._zod,"values",()=>t.innerType._zod.values),Kd(e._zod,"optin",()=>t.innerType?._zod?.optin),Kd(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(fh):fh(n)}});function fh(e){return e.value=Object.freeze(e.value),e}const gh=Ld("$ZodCustom",(e,t)=>{Qp.init(e,t),mm.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{const n=r.value,a=t.fn(n);if(a instanceof Promise)return a.then(t=>bh(t,r,n,e));bh(a,r,n,e)}});function bh(e,t,r,n){if(!e){const e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(dp(e))}}var vh;class yh{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const r={...this.get(t)??{}};delete r.id;const n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}(vh=globalThis).__zod_globalRegistry??(vh.__zod_globalRegistry=new yh);const wh=globalThis.__zod_globalRegistry;function xh(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ip(t)})}function Sh(e,t){return new em({check:"max_length",...ip(t),maximum:e})}function kh(e,t){return new tm({check:"min_length",...ip(t),minimum:e})}function Eh(e,t){return new rm({check:"length_equals",...ip(t),length:e})}function Nh(e){return new um({check:"overwrite",tx:e})}function Ch(e){const t=function(e,t){const r=new Qp({check:"custom",...ip(t)});return r._zod.check=e,r}(r=>(r.addIssue=e=>{if("string"==typeof e)r.issues.push(dp(e,r.value,t._zod.def));else{const n=e;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(dp(n))}},e(r.value,r)));return t}function Ah(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??wh,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function _h(e,t,r={path:[],schemaPath:[]}){var n;const a=e._zod.def,i=t.seen.get(e);if(i){i.count++;return r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema}const s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);const o=e._zod.toJSONSchema?.();if(o)s.schema=o;else{const n={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,n);else{const r=s.schema,i=t.processors[a.type];if(!i)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);i(e,t,r,n)}const i=e._zod.parent;i&&(s.ref||(s.ref=i),_h(i,t,n),t.seen.get(i).isParent=!0)}const c=t.metadataRegistry.get(e);c&&Object.assign(s.schema,c),"input"===t.io&&Rh(e)&&(delete s.schema.examples,delete s.schema.default),"input"===t.io&&s.schema._prefault&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault;return t.seen.get(e).schema}function Ph(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const t of e.seen.entries()){const r=e.metadataRegistry.get(t[0])?.id;if(r){const e=n.get(r);if(e&&e!==t[0])throw new Error(`Duplicate schema id "${r}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(r,t[0])}}const a=t=>{if(t[1].schema.$ref)return;const n=t[1],{ref:a,defId:i}=(t=>{const n="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const r=e.external.registry.get(t[0])?.id,a=e.external.uri??(e=>e);if(r)return{ref:a(r)};const i=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=i,{defId:i,ref:`${a("__shared")}#/${n}/${i}`}}if(t[1]===r)return{ref:"#"};const a=`#/${n}/`,i=t[1].schema.id??"__schema"+e.counter++;return{defId:i,ref:a+i}})(t);n.def={...n.schema},i&&(n.defId=i);const s=n.schema;for(const e in s)delete s[e];s.$ref=a};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const n=r[1];if(t===r[0]){a(r);continue}if(e.external){const n=e.external.registry.get(r[0])?.id;if(t!==r[0]&&n){a(r);continue}}const i=e.metadataRegistry.get(r[0])?.id;i?a(r):(n.cycle||n.count>1&&"ref"===e.reused)&&a(r)}}function Th(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=t=>{const r=e.seen.get(t);if(null===r.ref)return;const a=r.def??r.schema,i={...a},s=r.ref;if(r.ref=null,s){n(s);const r=e.seen.get(s),o=r.schema;!o.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(a,o):(a.allOf=a.allOf??[],a.allOf.push(o)),Object.assign(a,i);if(t._zod.parent===s)for(const e in a)"$ref"!==e&&"allOf"!==e&&(e in i||delete a[e]);if(o.$ref&&r.def)for(const e in a)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(a[e])===JSON.stringify(r.def[e])&&delete a[e]}const o=t._zod.parent;if(o&&o!==s){n(o);const t=e.seen.get(o);if(t?.schema.$ref&&(a.$ref=t.schema.$ref,t.def))for(const e in a)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(a[e])===JSON.stringify(t.def[e])&&delete a[e]}e.override({zodSchema:t,jsonSchema:a,path:r.path??[]})};for(const t of[...e.seen.entries()].reverse())n(t[0]);const a={};if("draft-2020-12"===e.target?a.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?a.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?a.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const r=e.external.registry.get(t)?.id;if(!r)throw new Error("Schema is missing an `id` property");a.$id=e.external.uri(r)}Object.assign(a,r.def??r.schema);const i=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(i[e.defId]=e.def)}e.external||Object.keys(i).length>0&&("draft-2020-12"===e.target?a.$defs=i:a.definitions=i);try{const r=JSON.parse(JSON.stringify(a));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:Dh(t,"input",e.processors),output:Dh(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw new Error("Error converting schema to JSON.")}}function Rh(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if("transform"===n.type)return!0;if("array"===n.type)return Rh(n.element,r);if("set"===n.type)return Rh(n.valueType,r);if("lazy"===n.type)return Rh(n.getter(),r);if("promise"===n.type||"optional"===n.type||"nonoptional"===n.type||"nullable"===n.type||"readonly"===n.type||"default"===n.type||"prefault"===n.type)return Rh(n.innerType,r);if("intersection"===n.type)return Rh(n.left,r)||Rh(n.right,r);if("record"===n.type||"map"===n.type)return Rh(n.keyType,r)||Rh(n.valueType,r);if("pipe"===n.type)return Rh(n.in,r)||Rh(n.out,r);if("object"===n.type){for(const e in n.shape)if(Rh(n.shape[e],r))return!0;return!1}if("union"===n.type){for(const e of n.options)if(Rh(e,r))return!0;return!1}if("tuple"===n.type){for(const e of n.items)if(Rh(e,r))return!0;return!(!n.rest||!Rh(n.rest,r))}return!1}const Dh=(e,t,r={})=>n=>{const{libraryOptions:a,target:i}=n??{},s=Ah({...a??{},target:i,io:t,processors:r});return _h(e,s),Ph(s,e),Th(s,e)},Ih={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Uh=(e,t,r,n)=>{const a=e._zod.def;_h(a.innerType,t,n);t.seen.get(e).ref=a.innerType};function Mh(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}function Lh(e,t){for(var r={};e.length;){var n=e[0],a=n.code,i=n.message,s=n.path.join(".");if(!r[s])if("unionErrors"in n){var o=n.unionErrors[0].errors[0];r[s]={message:o.message,type:o.code}}else r[s]={message:i,type:a};if("unionErrors"in n&&n.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var c=r[s].types,l=c&&c[n.code];r[s]=Zu(s,t,r,a,l?[].concat(l,n.message):n.message)}e.shift()}return r}function Oh(e,t){for(var r={};e.length;){var n=e[0],a=n.code,i=n.message,s=n.path.join(".");if(!r[s])if("invalid_union"===n.code&&n.errors.length>0){var o=n.errors[0][0];r[s]={message:o.message,type:o.code}}else r[s]={message:i,type:a};if("invalid_union"===n.code&&n.errors.forEach(function(t){return t.forEach(function(t){return e.push(t)})}),t){var c=r[s].types,l=c&&c[n.code];r[s]=Zu(s,t,r,a,l?[].concat(l,n.message):n.message)}e.shift()}return r}function zh(e,t,r){if(void 0===r&&(r={}),function(e){return"_def"in e&&"object"==typeof e._def&&"typeName"in e._def}(e))return function(n,a,i){try{return Promise.resolve(Mh(function(){return Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return i.shouldUseNativeValidation&&Dd({},i),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return Array.isArray(null==e?void 0:e.issues)}(e))return{values:{},errors:Id(Lh(e.errors,!i.shouldUseNativeValidation&&"all"===i.criteriaMode),i)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return"_zod"in e&&"object"==typeof e._zod}(e))return function(n,a,i){try{return Promise.resolve(Mh(function(){return Promise.resolve(("sync"===r.mode?gp:vp)(e,n,t)).then(function(e){return i.shouldUseNativeValidation&&Dd({},i),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return e instanceof mp}(e))return{values:{},errors:Id(Oh(e.issues,!i.shouldUseNativeValidation&&"all"===i.criteriaMode),i)};throw e}))}catch(e){return Promise.reject(e)}};throw new Error("Invalid input: not a Zod schema")}const Fh=Ld("ZodISODateTime",(e,t)=>{Am.init(e,t),df.init(e,t)});function Bh(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ip(t)})}(Fh,e)}const Wh=Ld("ZodISODate",(e,t)=>{_m.init(e,t),df.init(e,t)});function Vh(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...ip(t)})}(Wh,e)}const jh=Ld("ZodISOTime",(e,t)=>{Pm.init(e,t),df.init(e,t)});function Hh(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ip(t)})}(jh,e)}const Gh=Ld("ZodISODuration",(e,t)=>{Tm.init(e,t),df.init(e,t)});function $h(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...ip(t)})}(Gh,e)}const Kh=Ld("ZodError",(e,t)=>{mp.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const r={_errors:[]},n=e=>{for(const a of e.issues)if("invalid_union"===a.code&&a.errors.length)a.errors.map(e=>n({issues:e}));else if("invalid_key"===a.code)n({issues:a.issues});else if("invalid_element"===a.code)n({issues:a.issues});else if(0===a.path.length)r._errors.push(t(a));else{let e=r,n=0;for(;n<a.path.length;){const r=a.path[n];n===a.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(a))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(e),r}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const r={},n=[];for(const a of e.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:r}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Vd,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Vd,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),qh=fp(Kh),Zh=bp(Kh),Jh=yp(Kh),Yh=xp(Kh),Xh=kp(Kh),Qh=Ep(Kh),ef=Np(Kh),tf=Cp(Kh),rf=Ap(Kh),nf=_p(Kh),af=Pp(Kh),sf=Tp(Kh),of=Ld("ZodType",(e,t)=>(mm.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Dh(e,"input"),output:Dh(e,"output")}}),e.toJSONSchema=((e,t={})=>r=>{const n=Ah({...r,processors:t});return _h(e,n),Ph(n,e),Th(n,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(Zd(t,{checks:[...t.checks??[],...r.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,r)=>ap(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>qh(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>Jh(e,t,r),e.parseAsync=async(t,r)=>Zh(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>Yh(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>Xh(e,t,r),e.decode=(t,r)=>Qh(e,t,r),e.encodeAsync=async(t,r)=>ef(e,t,r),e.decodeAsync=async(t,r)=>tf(e,t,r),e.safeEncode=(t,r)=>rf(e,t,r),e.safeDecode=(t,r)=>nf(e,t,r),e.safeEncodeAsync=async(t,r)=>af(e,t,r),e.safeDecodeAsync=async(t,r)=>sf(e,t,r),e.refine=(t,r)=>e.check(function(e,t={}){return function(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ip(r)})}(eg,e,t)}(t,r)),e.superRefine=t=>e.check(Ch(t)),e.overwrite=t=>e.check(Nh(t)),e.optional=()=>jf(e),e.exactOptional=()=>new Hf({type:"optional",innerType:e}),e.nullable=()=>$f(e),e.nullish=()=>jf($f(e)),e.nonoptional=t=>function(e,t){return new Zf({type:"nonoptional",innerType:e,...ip(t)})}(e,t),e.array=()=>{return function(e,t,r){return new e({type:"array",element:t,...ip(r)})}(Mf,e,t);var t},e.or=t=>function(e,t){return new zf({type:"union",options:e,...ip(t)})}([e,t]),e.and=t=>new Ff({type:"intersection",left:e,right:t}),e.transform=t=>Xf(e,new Wf({type:"transform",transform:t})),e.default=t=>{return r=t,new Kf({type:"default",innerType:e,get defaultValue(){return"function"==typeof r?r():tp(r)}});var r},e.prefault=t=>{return r=t,new qf({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof r?r():tp(r)}});var r},e.catch=t=>{return new Jf({type:"catch",innerType:e,catchValue:"function"==typeof(r=t)?r:()=>r});var r},e.pipe=t=>Xf(e,t),e.readonly=()=>new Qf({type:"readonly",innerType:e}),e.describe=t=>{const r=e.clone();return wh.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>wh.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return wh.get(e);const r=e.clone();return wh.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),cf=Ld("_ZodString",(e,t)=>{hm.init(e,t),of.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{const n=r;n.type="string";const{minimum:a,maximum:i,format:s,patterns:o,contentEncoding:c}=e._zod.bag;if("number"==typeof a&&(n.minLength=a),"number"==typeof i&&(n.maxLength=i),s&&(n.format=Ih[s]??s,""===n.format&&delete n.format,"time"===s&&delete n.format),c&&(n.contentEncoding=c),o&&o.size>0){const e=[...o];1===e.length?n.pattern=e[0].source:e.length>1&&(n.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,r);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new am({check:"string_format",format:"regex",...ip(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new om({check:"string_format",format:"includes",...ip(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new cm({check:"string_format",format:"starts_with",...ip(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new lm({check:"string_format",format:"ends_with",...ip(t),suffix:e})}(...t)),e.min=(...t)=>e.check(kh(...t)),e.max=(...t)=>e.check(Sh(...t)),e.length=(...t)=>e.check(Eh(...t)),e.nonempty=(...t)=>e.check(kh(1,...t)),e.lowercase=t=>e.check(function(e){return new im({check:"string_format",format:"lowercase",...ip(e)})}(t)),e.uppercase=t=>e.check(function(e){return new sm({check:"string_format",format:"uppercase",...ip(e)})}(t)),e.trim=()=>e.check(Nh(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return Nh(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(Nh(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(Nh(e=>e.toUpperCase())),e.slugify=()=>e.check(Nh(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}),lf=Ld("ZodString",(e,t)=>{hm.init(e,t),cf.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ip(t)})}(pf,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ip(t)})}(ff,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ip(t)})}(Tf,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ip(t)})}(gf,t)),e.guid=t=>e.check(xh(mf,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ip(t)})}(hf,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ip(t)})}(hf,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ip(t)})}(hf,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ip(t)})}(hf,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ip(t)})}(bf,t)),e.guid=t=>e.check(xh(mf,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ip(t)})}(vf,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ip(t)})}(yf,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ip(t)})}(wf,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ip(t)})}(Af,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ip(t)})}(_f,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ip(t)})}(xf,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ip(t)})}(Sf,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ip(t)})}(kf,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ip(t)})}(Ef,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ip(t)})}(Nf,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ip(t)})}(Cf,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ip(t)})}(Pf,t)),e.datetime=t=>e.check(Bh(t)),e.date=t=>e.check(Vh(t)),e.time=t=>e.check(Hh(t)),e.duration=t=>e.check($h(t))});function uf(e){return function(e,t){return new e({type:"string",...ip(t)})}(lf,e)}const df=Ld("ZodStringFormat",(e,t)=>{fm.init(e,t),cf.init(e,t)}),pf=Ld("ZodEmail",(e,t)=>{vm.init(e,t),df.init(e,t)}),mf=Ld("ZodGUID",(e,t)=>{gm.init(e,t),df.init(e,t)}),hf=Ld("ZodUUID",(e,t)=>{bm.init(e,t),df.init(e,t)}),ff=Ld("ZodURL",(e,t)=>{ym.init(e,t),df.init(e,t)}),gf=Ld("ZodEmoji",(e,t)=>{wm.init(e,t),df.init(e,t)}),bf=Ld("ZodNanoID",(e,t)=>{xm.init(e,t),df.init(e,t)}),vf=Ld("ZodCUID",(e,t)=>{Sm.init(e,t),df.init(e,t)}),yf=Ld("ZodCUID2",(e,t)=>{km.init(e,t),df.init(e,t)}),wf=Ld("ZodULID",(e,t)=>{Em.init(e,t),df.init(e,t)}),xf=Ld("ZodXID",(e,t)=>{Nm.init(e,t),df.init(e,t)}),Sf=Ld("ZodKSUID",(e,t)=>{Cm.init(e,t),df.init(e,t)}),kf=Ld("ZodIPv4",(e,t)=>{Rm.init(e,t),df.init(e,t)}),Ef=Ld("ZodIPv6",(e,t)=>{Dm.init(e,t),df.init(e,t)}),Nf=Ld("ZodCIDRv4",(e,t)=>{Im.init(e,t),df.init(e,t)}),Cf=Ld("ZodCIDRv6",(e,t)=>{Um.init(e,t),df.init(e,t)}),Af=Ld("ZodBase64",(e,t)=>{Lm.init(e,t),df.init(e,t)}),_f=Ld("ZodBase64URL",(e,t)=>{Om.init(e,t),df.init(e,t)}),Pf=Ld("ZodE164",(e,t)=>{zm.init(e,t),df.init(e,t)}),Tf=Ld("ZodJWT",(e,t)=>{Fm.init(e,t),df.init(e,t)}),Rf=Ld("ZodUnknown",(e,t)=>{Bm.init(e,t),of.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{}});function Df(){return new Rf({type:"unknown"})}const If=Ld("ZodNever",(e,t)=>{Wm.init(e,t),of.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r)=>{r.not={}})(0,0,t)});function Uf(e){return function(e,t){return new e({type:"never",...ip(t)})}(If,e)}const Mf=Ld("ZodArray",(e,t)=>{jm.init(e,t),of.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=r,i=e._zod.def,{minimum:s,maximum:o}=e._zod.bag;"number"==typeof s&&(a.minItems=s),"number"==typeof o&&(a.maxItems=o),a.type="array",a.items=_h(i.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element,e.min=(t,r)=>e.check(kh(t,r)),e.nonempty=t=>e.check(kh(1,t)),e.max=(t,r)=>e.check(Sh(t,r)),e.length=(t,r)=>e.check(Eh(t,r)),e.unwrap=()=>e.element});const Lf=Ld("ZodObject",(e,t)=>{qm.init(e,t),of.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=r,i=e._zod.def;a.type="object",a.properties={};const s=i.shape;for(const e in s)a.properties[e]=_h(s[e],t,{...n,path:[...n.path,"properties",e]});const o=new Set(Object.keys(s)),c=new Set([...o].filter(e=>{const r=i.shape[e]._zod;return"input"===t.io?void 0===r.optin:void 0===r.optout}));c.size>0&&(a.required=Array.from(c)),"never"===i.catchall?._zod.def.type?a.additionalProperties=!1:i.catchall?i.catchall&&(a.additionalProperties=_h(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(a.additionalProperties=!1)})(e,t,r,n),Kd(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Bf({type:"enum",entries:r,...ip(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Df()}),e.loose=()=>e.clone({...e._zod.def,catchall:Df()}),e.strict=()=>e.clone({...e._zod.def,catchall:Uf()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!ep(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const r=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const n=Zd(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return qd(this,"shape",r),r}});return ap(e,n)}(e,t),e.safeExtend=t=>function(e,t){if(!ep(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Zd(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return qd(this,"shape",r),r}});return ap(e,r)}(e,t),e.merge=t=>function(e,t){const r=Zd(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return qd(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return ap(e,r)}(e,t),e.pick=t=>function(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return ap(e,Zd(e._zod.def,{get shape(){const e={};for(const n in t){if(!(n in r.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&(e[n]=r.shape[n])}return qd(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=Zd(e._zod.def,{get shape(){const n={...e._zod.def.shape};for(const e in t){if(!(e in r.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return qd(this,"shape",n),n},checks:[]});return ap(e,a)}(e,t),e.partial=(...t)=>function(e,t,r){const n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=Zd(t._zod.def,{get shape(){const n=t._zod.def.shape,a={...n};if(r)for(const t in r){if(!(t in n))throw new Error(`Unrecognized key: "${t}"`);r[t]&&(a[t]=e?new e({type:"optional",innerType:n[t]}):n[t])}else for(const t in n)a[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return qd(this,"shape",a),a},checks:[]});return ap(t,a)}(Vf,e,t[0]),e.required=(...t)=>function(e,t,r){const n=Zd(t._zod.def,{get shape(){const n=t._zod.def.shape,a={...n};if(r)for(const t in r){if(!(t in a))throw new Error(`Unrecognized key: "${t}"`);r[t]&&(a[t]=new e({type:"nonoptional",innerType:n[t]}))}else for(const t in n)a[t]=new e({type:"nonoptional",innerType:n[t]});return qd(this,"shape",a),a}});return ap(t,n)}(Zf,e,t[0])});function Of(e,t){const r={type:"object",shape:e??{},...ip(t)};return new Lf(r)}const zf=Ld("ZodUnion",(e,t)=>{Jm.init(e,t),of.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,i=!1===a.inclusive,s=a.options.map((e,r)=>_h(e,t,{...n,path:[...n.path,i?"oneOf":"anyOf",r]}));i?r.oneOf=s:r.anyOf=s})(e,t,r,n),e.options=t.options});const Ff=Ld("ZodIntersection",(e,t)=>{Ym.init(e,t),of.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,i=_h(a.left,t,{...n,path:[...n.path,"allOf",0]}),s=_h(a.right,t,{...n,path:[...n.path,"allOf",1]}),o=e=>"allOf"in e&&1===Object.keys(e).length,c=[...o(i)?i.allOf:[i],...o(s)?s.allOf:[s]];r.allOf=c})(e,t,r,n)});const Bf=Ld("ZodEnum",(e,t)=>{eh.init(e,t),of.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{const n=Wd(e._zod.def.entries);n.every(e=>"number"==typeof e)&&(r.type="number"),n.every(e=>"string"==typeof e)&&(r.type="string"),r.enum=n})(e,0,r),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{const a={};for(const n of e){if(!r.has(n))throw new Error(`Key ${n} not found in enum`);a[n]=t.entries[n]}return new Bf({...t,checks:[],...ip(n),entries:a})},e.exclude=(e,n)=>{const a={...t.entries};for(const t of e){if(!r.has(t))throw new Error(`Key ${t} not found in enum`);delete a[t]}return new Bf({...t,checks:[],...ip(n),entries:a})}});const Wf=Ld("ZodTransform",(e,t)=>{th.init(e,t),of.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new zd(e.constructor.name);r.addIssue=n=>{if("string"==typeof n)r.issues.push(dp(n,r.value,t));else{const t=n;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=r.value),t.inst??(t.inst=e),r.issues.push(dp(t))}};const a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r)):(r.value=a,r)}});const Vf=Ld("ZodOptional",(e,t)=>{nh.init(e,t),of.init(e,t),e._zod.processJSONSchema=(t,r,n)=>Uh(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});function jf(e){return new Vf({type:"optional",innerType:e})}const Hf=Ld("ZodExactOptional",(e,t)=>{ah.init(e,t),of.init(e,t),e._zod.processJSONSchema=(t,r,n)=>Uh(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const Gf=Ld("ZodNullable",(e,t)=>{ih.init(e,t),of.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,i=_h(a.innerType,t,n),s=t.seen.get(e);"openapi-3.0"===t.target?(s.ref=a.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function $f(e){return new Gf({type:"nullable",innerType:e})}const Kf=Ld("ZodDefault",(e,t)=>{sh.init(e,t),of.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;_h(a.innerType,t,n),t.seen.get(e).ref=a.innerType,r.default=JSON.parse(JSON.stringify(a.defaultValue))})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const qf=Ld("ZodPrefault",(e,t)=>{ch.init(e,t),of.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;_h(a.innerType,t,n),t.seen.get(e).ref=a.innerType,"input"===t.io&&(r._prefault=JSON.parse(JSON.stringify(a.defaultValue)))})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});const Zf=Ld("ZodNonOptional",(e,t)=>{lh.init(e,t),of.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;_h(a.innerType,t,n),t.seen.get(e).ref=a.innerType})(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const Jf=Ld("ZodCatch",(e,t)=>{dh.init(e,t),of.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;let i;_h(a.innerType,t,n),t.seen.get(e).ref=a.innerType;try{i=a.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const Yf=Ld("ZodPipe",(e,t)=>{ph.init(e,t),of.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,i="input"===t.io?"transform"===a.in._zod.def.type?a.out:a.in:a.out;_h(i,t,n),t.seen.get(e).ref=i})(e,t,0,n),e.in=t.in,e.out=t.out});function Xf(e,t){return new Yf({type:"pipe",in:e,out:t})}const Qf=Ld("ZodReadonly",(e,t)=>{hh.init(e,t),of.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;_h(a.innerType,t,n),t.seen.get(e).ref=a.innerType,r.readOnly=!0})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});const eg=Ld("ZodCustom",(e,t)=>{gh.init(e,t),of.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)});const tg={usd:"$",eur:"€",gbp:"£",jpy:"¥",cad:"CA$",aud:"A$",chf:"CHF",cny:"¥",hkd:"HK$",sgd:"S$",inr:"₹",mxn:"MX$",brl:"R$",nzd:"NZ$",sek:"kr",nok:"kr",dkk:"kr",pln:"zł",thb:"฿"},rg={usd:"🇺🇸",eur:"🇪🇺",gbp:"🇬🇧",jpy:"🇯🇵",cad:"🇨🇦",aud:"🇦🇺",chf:"🇨🇭",cny:"🇨🇳",hkd:"🇭🇰",sgd:"🇸🇬",inr:"🇮🇳",mxn:"🇲🇽",brl:"🇧🇷",nzd:"🇳🇿",sek:"🇸🇪",nok:"🇳🇴",dkk:"🇩🇰",pln:"🇵🇱",thb:"🇹🇭"};function ng(e){return e&&e.trim()?rg[e.trim().toLowerCase()]??"":""}function ag(e){if(!e||!e.trim())return"";const t=e.trim().toLowerCase();return tg[t]??t.toUpperCase()}["usd","eur","gbp","jpy","cad","aud","chf","cny","hkd","sgd","inr","mxn","brl","nzd","sek","nok","dkk","pln","thb"].map(e=>({value:e,label:`${e.toUpperCase()} (${ag(e)})`}));var ig=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{const a=Mi(`Primitive.${r}`),i=n.forwardRef((e,n)=>{const{asChild:i,...s}=e,o=i?a:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t(o,{...s,ref:n})});return i.displayName=`Primitive.${r}`,{...e,[r]:i}},{}),sg=n.forwardRef((e,r)=>t(ig.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));sg.displayName="Label";var og=sg;const cg=Vi("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),lg=n.forwardRef(({className:e,...r},n)=>t(og,{ref:n,className:Oe(cg(),e),...r}));lg.displayName=og.displayName;const ug=qu,dg=n.createContext({}),pg=({...e})=>t(dg.Provider,{value:{name:e.name},children:t($u,{...e})}),mg=()=>{const e=n.useContext(dg),t=n.useContext(hg),{getFieldState:r,formState:i}=a.useContext(Ku),s=r(e.name,i);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},hg=n.createContext({}),fg=n.forwardRef(({className:e,...r},a)=>{const i=n.useId();return t(hg.Provider,{value:{id:i},children:t("div",{ref:a,className:Oe("space-y-2",e),...r})})});fg.displayName="FormItem";const gg=n.forwardRef(({className:e,...r},n)=>{const{error:a,formItemId:i}=mg();return t(lg,{ref:n,className:Oe(a&&"text-destructive",e),htmlFor:i,...r})});gg.displayName="FormLabel";const bg=n.forwardRef(({...e},r)=>{const{error:n,formItemId:a,formDescriptionId:i,formMessageId:s}=mg();return t(Li,{ref:r,id:a,"aria-describedby":n?`${i} ${s}`:`${i}`,"aria-invalid":!!n,...e})});bg.displayName="FormControl";const vg=n.forwardRef(({className:e,...r},n)=>{const{formDescriptionId:a}=mg();return t("p",{ref:n,id:a,className:Oe("text-sm text-muted-foreground",e),...r})});vg.displayName="FormDescription";const yg=n.forwardRef(({className:e,children:r,...n},a)=>{const{error:i,formMessageId:s}=mg(),o=i?String(i?.message):r;return o?t("p",{ref:a,id:s,className:Oe("text-sm font-medium text-destructive",e),...n,children:o}):null});yg.displayName="FormMessage";const wg=n.forwardRef(({className:e,type:r,...n},a)=>t("input",{type:r,className:Oe("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...n}));function xg(e){const r=Sg(e),a=n.forwardRef((e,a)=>{const{children:i,...s}=e,o=n.Children.toArray(i),c=o.find(Eg);if(c){const e=c.props.children,i=o.map(t=>t===c?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t);return t(r,{...s,ref:a,children:n.isValidElement(e)?n.cloneElement(e,void 0,i):null})}return t(r,{...s,ref:a,children:i})});return a.displayName=`${e}.Slot`,a}function Sg(e){const t=n.forwardRef((e,t)=>{const{children:r,...a}=e;if(n.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),i=function(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{const t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}(a,r.props);return r.type!==n.Fragment&&(i.ref=t?Ti(t,e):e),n.cloneElement(r,i)}return n.Children.count(r)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}wg.displayName="Input";var kg=Symbol("radix.slottable");function Eg(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===kg}function Ng(e){const r=e+"CollectionProvider",[n,i]=$i(r),[s,o]=n(r,{collectionRef:{current:null},itemMap:new Map}),c=e=>{const{scope:r,children:n}=e,i=a.useRef(null),o=a.useRef(new Map).current;return t(s,{scope:r,itemMap:o,collectionRef:i,children:n})};c.displayName=r;const l=e+"CollectionSlot",u=xg(l),d=a.forwardRef((e,r)=>{const{scope:n,children:a}=e,i=Ri(r,o(l,n).collectionRef);return t(u,{ref:i,children:a})});d.displayName=l;const p=e+"CollectionItemSlot",m="data-radix-collection-item",h=xg(p),f=a.forwardRef((e,r)=>{const{scope:n,children:i,...s}=e,c=a.useRef(null),l=Ri(r,c),u=o(p,n);return a.useEffect(()=>(u.itemMap.set(c,{ref:c,...s}),()=>{u.itemMap.delete(c)})),t(h,{[m]:"",ref:l,children:i})});return f.displayName=p,[{Provider:c,Slot:d,ItemSlot:f},function(t){const r=o(e+"CollectionConsumer",t),n=a.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`)),n=Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current));return n},[r.collectionRef,r.itemMap]);return n},i]}var Cg=n.createContext(void 0);function Ag(e){const t=n.useContext(Cg);return e||t||"ltr"}var _g="rovingFocusGroup.onEntryFocus",Pg={bubbles:!1,cancelable:!0},Tg="RovingFocusGroup",[Rg,Dg,Ig]=Ng(Tg),[Ug,Mg]=$i(Tg,[Ig]),[Lg,Og]=Ug(Tg),zg=n.forwardRef((e,r)=>t(Rg.Provider,{scope:e.__scopeRovingFocusGroup,children:t(Rg.Slot,{scope:e.__scopeRovingFocusGroup,children:t(Fg,{...e,ref:r})})}));zg.displayName=Tg;var Fg=n.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:a,orientation:i,loop:s=!1,dir:o,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...m}=e,h=n.useRef(null),f=Ri(r,h),g=Ag(o),[b,v]=Qi({prop:c,defaultProp:l??null,onChange:u,caller:Tg}),[y,w]=n.useState(!1),x=as(d),S=Dg(a),k=n.useRef(!1),[E,N]=n.useState(0);return n.useEffect(()=>{const e=h.current;if(e)return e.addEventListener(_g,x),()=>e.removeEventListener(_g,x)},[x]),t(Lg,{scope:a,orientation:i,dir:g,loop:s,currentTabStopId:b,onItemFocus:n.useCallback(e=>v(e),[v]),onItemShiftTab:n.useCallback(()=>w(!0),[]),onFocusableItemAdd:n.useCallback(()=>N(e=>e+1),[]),onFocusableItemRemove:n.useCallback(()=>N(e=>e-1),[]),children:t(ns.div,{tabIndex:y||0===E?-1:0,"data-orientation":i,...m,ref:f,style:{outline:"none",...e.style},onMouseDown:Gi(e.onMouseDown,()=>{k.current=!0}),onFocus:Gi(e.onFocus,e=>{const t=!k.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(_g,Pg);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter(e=>e.focusable);jg([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),p)}}k.current=!1}),onBlur:Gi(e.onBlur,()=>w(!1))})})}),Bg="RovingFocusGroupItem",Wg=n.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:a,focusable:i=!0,active:s=!1,tabStopId:o,children:c,...l}=e,u=Yi(),d=o||u,p=Og(Bg,a),m=p.currentTabStopId===d,h=Dg(a),{onFocusableItemAdd:f,onFocusableItemRemove:g,currentTabStopId:b}=p;return n.useEffect(()=>{if(i)return f(),()=>g()},[i,f,g]),t(Rg.ItemSlot,{scope:a,id:d,focusable:i,active:s,children:t(ns.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...l,ref:r,onMouseDown:Gi(e.onMouseDown,e=>{i?p.onItemFocus(d):e.preventDefault()}),onFocus:Gi(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:Gi(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,r){const n=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)?void 0:Vg[n]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=h().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const n=r.indexOf(e.currentTarget);r=p.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>jg(r))}}),children:"function"==typeof c?c({isCurrentTabStop:m,hasTabStop:null!=b}):c})})});Wg.displayName=Bg;var Vg={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function jg(e,t=!1){const r=document.activeElement;for(const n of e){if(n===r)return;if(n.focus({preventScroll:t}),document.activeElement!==r)return}}var Hg=zg,Gg=Wg,$g="Radio",[Kg,qg]=$i($g),[Zg,Jg]=Kg($g),Yg=n.forwardRef((r,a)=>{const{__scopeRadio:i,name:s,checked:o=!1,required:c,disabled:l,value:u="on",onCheck:d,form:p,...m}=r,[h,f]=n.useState(null),g=Ri(a,e=>f(e)),b=n.useRef(!1),v=!h||(p||!!h.closest("form"));return e(Zg,{scope:i,checked:o,disabled:l,children:[t(ns.button,{type:"button",role:"radio","aria-checked":o,"data-state":tb(o),"data-disabled":l?"":void 0,disabled:l,value:u,...m,ref:g,onClick:Gi(r.onClick,e=>{o||d?.(),v&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})}),v&&t(eb,{control:h,bubbles:!b.current,name:s,value:u,checked:o,required:c,disabled:l,form:p,style:{transform:"translateX(-100%)"}})]})});Yg.displayName=$g;var Xg="RadioIndicator",Qg=n.forwardRef((e,r)=>{const{__scopeRadio:n,forceMount:a,...i}=e,s=Jg(Xg,n);return t(Es,{present:a||s.checked,children:t(ns.span,{"data-state":tb(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:r})})});Qg.displayName=Xg;var eb=n.forwardRef(({__scopeRadio:e,control:r,checked:a,bubbles:i=!0,...s},o)=>{const c=n.useRef(null),l=Ri(c,o),u=Hl(a),d=Gl(r);return n.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==a&&r){const t=new Event("click",{bubbles:i});r.call(e,a),e.dispatchEvent(t)}},[u,a,i]),t(ns.input,{type:"radio","aria-hidden":!0,defaultChecked:a,...s,tabIndex:-1,ref:l,style:{...s.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function tb(e){return e?"checked":"unchecked"}eb.displayName="RadioBubbleInput";var rb=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],nb="RadioGroup",[ab]=$i(nb,[Mg,qg]),ib=Mg(),sb=qg(),[ob,cb]=ab(nb),lb=n.forwardRef((e,r)=>{const{__scopeRadioGroup:n,name:a,defaultValue:i,value:s,required:o=!1,disabled:c=!1,orientation:l,dir:u,loop:d=!0,onValueChange:p,...m}=e,h=ib(n),f=Ag(u),[g,b]=Qi({prop:s,defaultProp:i??null,onChange:p,caller:nb});return t(ob,{scope:n,name:a,required:o,disabled:c,value:g,onValueChange:b,children:t(Hg,{asChild:!0,...h,orientation:l,dir:f,loop:d,children:t(ns.div,{role:"radiogroup","aria-required":o,"aria-orientation":l,"data-disabled":c?"":void 0,dir:f,...m,ref:r})})})});lb.displayName=nb;var ub="RadioGroupItem",db=n.forwardRef((e,r)=>{const{__scopeRadioGroup:a,disabled:i,...s}=e,o=cb(ub,a),c=o.disabled||i,l=ib(a),u=sb(a),d=n.useRef(null),p=Ri(r,d),m=o.value===s.value,h=n.useRef(!1);return n.useEffect(()=>{const e=e=>{rb.includes(e.key)&&(h.current=!0)},t=()=>h.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),t(Gg,{asChild:!0,...l,focusable:!c,active:m,children:t(Yg,{disabled:c,required:o.required,checked:m,...u,...s,name:o.name,ref:p,onCheck:()=>o.onValueChange(s.value),onKeyDown:Gi(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:Gi(s.onFocus,()=>{h.current&&d.current?.click()})})})});db.displayName=ub;var pb=n.forwardRef((e,r)=>{const{__scopeRadioGroup:n,...a}=e,i=sb(n);return t(Qg,{...i,...a,ref:r})});pb.displayName="RadioGroupIndicator";var mb=lb,hb=db,fb=pb;const gb=n.forwardRef(({className:e,...r},n)=>t(mb,{className:Oe("grid gap-2",e),...r,ref:n}));gb.displayName=mb.displayName;const bb=n.forwardRef(({className:e,...r},n)=>t(hb,{ref:n,className:Oe("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:t(fb,{className:"flex items-center justify-center",children:t(vc,{className:"h-3.5 w-3.5 fill-primary"})})}));function vb(e,[t,r]){return Math.min(r,Math.max(t,e))}bb.displayName=hb.displayName;var yb="ScrollArea",[wb]=$i(yb),[xb,Sb]=wb(yb),kb=n.forwardRef((e,r)=>{const{__scopeScrollArea:a,type:i="hover",dir:s,scrollHideDelay:o=600,...c}=e,[l,u]=n.useState(null),[d,p]=n.useState(null),[m,h]=n.useState(null),[f,g]=n.useState(null),[b,v]=n.useState(null),[y,w]=n.useState(0),[x,S]=n.useState(0),[k,E]=n.useState(!1),[N,C]=n.useState(!1),A=Ri(r,e=>u(e)),_=Ag(s);return t(xb,{scope:a,type:i,dir:_,scrollHideDelay:o,scrollArea:l,viewport:d,onViewportChange:p,content:m,onContentChange:h,scrollbarX:f,onScrollbarXChange:g,scrollbarXEnabled:k,onScrollbarXEnabledChange:E,scrollbarY:b,onScrollbarYChange:v,scrollbarYEnabled:N,onScrollbarYEnabledChange:C,onCornerWidthChange:w,onCornerHeightChange:S,children:t(ns.div,{dir:_,...c,ref:A,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});kb.displayName=yb;var Eb="ScrollAreaViewport",Nb=n.forwardRef((a,i)=>{const{__scopeScrollArea:s,children:o,nonce:c,...l}=a,u=Sb(Eb,s),d=Ri(i,n.useRef(null),u.onViewportChange);return e(r,{children:[t("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:c}),t(ns.div,{"data-radix-scroll-area-viewport":"",...l,ref:d,style:{overflowX:u.scrollbarXEnabled?"scroll":"hidden",overflowY:u.scrollbarYEnabled?"scroll":"hidden",...a.style},children:t("div",{ref:u.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});Nb.displayName=Eb;var Cb="ScrollAreaScrollbar",Ab=n.forwardRef((e,r)=>{const{forceMount:a,...i}=e,s=Sb(Cb,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:c}=s,l="horizontal"===e.orientation;return n.useEffect(()=>(l?o(!0):c(!0),()=>{l?o(!1):c(!1)}),[l,o,c]),"hover"===s.type?t(_b,{...i,ref:r,forceMount:a}):"scroll"===s.type?t(Pb,{...i,ref:r,forceMount:a}):"auto"===s.type?t(Tb,{...i,ref:r,forceMount:a}):"always"===s.type?t(Rb,{...i,ref:r}):null});Ab.displayName=Cb;var _b=n.forwardRef((e,r)=>{const{forceMount:a,...i}=e,s=Sb(Cb,e.__scopeScrollArea),[o,c]=n.useState(!1);return n.useEffect(()=>{const e=s.scrollArea;let t=0;if(e){const r=()=>{window.clearTimeout(t),c(!0)},n=()=>{t=window.setTimeout(()=>c(!1),s.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[s.scrollArea,s.scrollHideDelay]),t(Es,{present:a||o,children:t(Tb,{"data-state":o?"visible":"hidden",...i,ref:r})})}),Pb=n.forwardRef((e,r)=>{const{forceMount:a,...i}=e,s=Sb(Cb,e.__scopeScrollArea),o="horizontal"===e.orientation,c=Jb(()=>u("SCROLL_END"),100),[l,u]=(d="hidden",p={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},n.useReducer((e,t)=>p[e][t]??e,d));var d,p;return n.useEffect(()=>{if("idle"===l){const e=window.setTimeout(()=>u("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(e)}},[l,s.scrollHideDelay,u]),n.useEffect(()=>{const e=s.viewport,t=o?"scrollLeft":"scrollTop";if(e){let r=e[t];const n=()=>{const n=e[t];r!==n&&(u("SCROLL"),c()),r=n};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}},[s.viewport,o,u,c]),t(Es,{present:a||"hidden"!==l,children:t(Rb,{"data-state":"hidden"===l?"hidden":"visible",...i,ref:r,onPointerEnter:Gi(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Gi(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),Tb=n.forwardRef((e,r)=>{const a=Sb(Cb,e.__scopeScrollArea),{forceMount:i,...s}=e,[o,c]=n.useState(!1),l="horizontal"===e.orientation,u=Jb(()=>{if(a.viewport){const e=a.viewport.offsetWidth<a.viewport.scrollWidth,t=a.viewport.offsetHeight<a.viewport.scrollHeight;c(l?e:t)}},10);return Yb(a.viewport,u),Yb(a.content,u),t(Es,{present:i||o,children:t(Rb,{"data-state":o?"visible":"hidden",...s,ref:r})})}),Rb=n.forwardRef((e,r)=>{const{orientation:a="vertical",...i}=e,s=Sb(Cb,e.__scopeScrollArea),o=n.useRef(null),c=n.useRef(0),[l,u]=n.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=Hb(l.viewport,l.content),p={...i,sizes:l,onSizesChange:u,hasThumb:Boolean(d>0&&d<1),onThumbChange:e=>o.current=e,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:e=>c.current=e};function m(e,t){return function(e,t,r,n="ltr"){const a=Gb(r),i=a/2,s=t||i,o=a-s,c=r.scrollbar.paddingStart+s,l=r.scrollbar.size-r.scrollbar.paddingEnd-o,u=r.content-r.viewport,d="ltr"===n?[0,u]:[-1*u,0];return Kb([c,l],d)(e)}(e,c.current,l,t)}return"horizontal"===a?t(Db,{...p,ref:r,onThumbPositionChange:()=>{if(s.viewport&&o.current){const e=$b(s.viewport.scrollLeft,l,s.dir);o.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{s.viewport&&(s.viewport.scrollLeft=e)},onDragScroll:e=>{s.viewport&&(s.viewport.scrollLeft=m(e,s.dir))}}):"vertical"===a?t(Ib,{...p,ref:r,onThumbPositionChange:()=>{if(s.viewport&&o.current){const e=$b(s.viewport.scrollTop,l);o.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{s.viewport&&(s.viewport.scrollTop=e)},onDragScroll:e=>{s.viewport&&(s.viewport.scrollTop=m(e))}}):null}),Db=n.forwardRef((e,r)=>{const{sizes:a,onSizesChange:i,...s}=e,o=Sb(Cb,e.__scopeScrollArea),[c,l]=n.useState(),u=n.useRef(null),d=Ri(r,u,o.onScrollbarXChange);return n.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),t(Lb,{"data-orientation":"horizontal",...s,ref:d,sizes:a,style:{bottom:0,left:"rtl"===o.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===o.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Gb(a)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,r)=>{if(o.viewport){const n=o.viewport.scrollLeft+t.deltaX;e.onWheelScroll(n),qb(n,r)&&t.preventDefault()}},onResize:()=>{u.current&&o.viewport&&c&&i({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:jb(c.paddingLeft),paddingEnd:jb(c.paddingRight)}})}})}),Ib=n.forwardRef((e,r)=>{const{sizes:a,onSizesChange:i,...s}=e,o=Sb(Cb,e.__scopeScrollArea),[c,l]=n.useState(),u=n.useRef(null),d=Ri(r,u,o.onScrollbarYChange);return n.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),t(Lb,{"data-orientation":"vertical",...s,ref:d,sizes:a,style:{top:0,right:"ltr"===o.dir?0:void 0,left:"rtl"===o.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Gb(a)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,r)=>{if(o.viewport){const n=o.viewport.scrollTop+t.deltaY;e.onWheelScroll(n),qb(n,r)&&t.preventDefault()}},onResize:()=>{u.current&&o.viewport&&c&&i({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:jb(c.paddingTop),paddingEnd:jb(c.paddingBottom)}})}})}),[Ub,Mb]=wb(Cb),Lb=n.forwardRef((e,r)=>{const{__scopeScrollArea:a,sizes:i,hasThumb:s,onThumbChange:o,onThumbPointerUp:c,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:p,onResize:m,...h}=e,f=Sb(Cb,a),[g,b]=n.useState(null),v=Ri(r,e=>b(e)),y=n.useRef(null),w=n.useRef(""),x=f.viewport,S=i.content-i.viewport,k=as(p),E=as(u),N=Jb(m,10);function C(e){if(y.current){const t=e.clientX-y.current.left,r=e.clientY-y.current.top;d({x:t,y:r})}}return n.useEffect(()=>{const e=e=>{const t=e.target,r=g?.contains(t);r&&k(e,S)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[x,g,S,k]),n.useEffect(E,[i,E]),Yb(g,N),Yb(f.content,N),t(Ub,{scope:a,scrollbar:g,hasThumb:s,onThumbChange:as(o),onThumbPointerUp:as(c),onThumbPositionChange:E,onThumbPointerDown:as(l),children:t(ns.div,{...h,ref:v,style:{position:"absolute",...h.style},onPointerDown:Gi(e.onPointerDown,e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),y.current=g.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),C(e)}}),onPointerMove:Gi(e.onPointerMove,C),onPointerUp:Gi(e.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=w.current,f.viewport&&(f.viewport.style.scrollBehavior=""),y.current=null})})})}),Ob="ScrollAreaThumb",zb=n.forwardRef((e,r)=>{const{forceMount:n,...a}=e,i=Mb(Ob,e.__scopeScrollArea);return t(Es,{present:n||i.hasThumb,children:t(Fb,{ref:r,...a})})}),Fb=n.forwardRef((e,r)=>{const{__scopeScrollArea:a,style:i,...s}=e,o=Sb(Ob,a),c=Mb(Ob,a),{onThumbPositionChange:l}=c,u=Ri(r,e=>c.onThumbChange(e)),d=n.useRef(void 0),p=Jb(()=>{d.current&&(d.current(),d.current=void 0)},100);return n.useEffect(()=>{const e=o.viewport;if(e){const t=()=>{if(p(),!d.current){const t=Zb(e,l);d.current=t,l()}};return l(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,p,l]),t(ns.div,{"data-state":c.hasThumb?"visible":"hidden",...s,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:Gi(e.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;c.onThumbPointerDown({x:r,y:n})}),onPointerUp:Gi(e.onPointerUp,c.onThumbPointerUp)})});zb.displayName=Ob;var Bb="ScrollAreaCorner",Wb=n.forwardRef((e,r)=>{const n=Sb(Bb,e.__scopeScrollArea),a=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&a?t(Vb,{...e,ref:r}):null});Wb.displayName=Bb;var Vb=n.forwardRef((e,r)=>{const{__scopeScrollArea:a,...i}=e,s=Sb(Bb,a),[o,c]=n.useState(0),[l,u]=n.useState(0),d=Boolean(o&&l);return Yb(s.scrollbarX,()=>{const e=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(e),u(e)}),Yb(s.scrollbarY,()=>{const e=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(e),c(e)}),d?t(ns.div,{...i,ref:r,style:{width:o,height:l,position:"absolute",right:"ltr"===s.dir?0:void 0,left:"rtl"===s.dir?0:void 0,bottom:0,...e.style}}):null});function jb(e){return e?parseInt(e,10):0}function Hb(e,t){const r=e/t;return isNaN(r)?0:r}function Gb(e){const t=Hb(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function $b(e,t,r="ltr"){const n=Gb(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,s=t.content-t.viewport,o=i-n,c=vb(e,"ltr"===r?[0,s]:[-1*s,0]);return Kb([0,s],[0,o])(c)}function Kb(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function qb(e,t){return e>0&&e<t}var Zb=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function a(){const i={left:e.scrollLeft,top:e.scrollTop},s=r.left!==i.left,o=r.top!==i.top;(s||o)&&t(),r=i,n=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(n)};function Jb(e,t){const r=as(e),a=n.useRef(0);return n.useEffect(()=>()=>window.clearTimeout(a.current),[]),n.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(r,t)},[r,t])}function Yb(e,t){const r=as(t);qi(()=>{let t=0;if(e){const n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.unobserve(e)}}},[e,r])}var Xb=kb,Qb=Nb,ev=Wb;const tv=n.forwardRef(({className:r,children:n,...a},i)=>e(Xb,{ref:i,className:Oe("relative overflow-hidden",r),...a,children:[t(Qb,{className:"h-full w-full rounded-[inherit]",children:n}),t(rv,{}),t(ev,{})]}));tv.displayName=Xb.displayName;const rv=n.forwardRef(({className:e,orientation:r="vertical",...n},a)=>t(Ab,{ref:a,orientation:r,className:Oe("flex touch-none select-none transition-colors","vertical"===r&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===r&&"h-2.5 border-t border-t-transparent p-[1px]",e),...n,children:t(zb,{className:Oe("relative rounded-full bg-border","vertical"===r&&"flex-1")})}));function nv(e){return`data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="50%" y="50%" dominant-baseline="middle" alignment-baseline="middle" text-anchor="middle" font-size="50" font-family="sans-serif">${e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}</text></svg>`}rv.displayName=Ab.displayName;const av=["🏢","🏬","🏣","🏤","🏦","🏛️","🏠","🏡","🏭","🏗️","🏪","🏨","🏫","🏥","💼","📊","📈","📉","📋","📁","📂","🗂️","🗃️","🗄️","📅","🗓️","📝","🖋️","✏️","🖊️","🖌️","🖍️","📇","📌","📍","📎","🖇️","💻","🖥️","🖨️","🖱️","⌨️","📱","📲","📡","🌐","🔗","🔒","🔓","⚙️","🔧","🛠️","🧑‍💻","👨‍💻","👩‍💻","🕹️","💾","📟","🖥️","🖲️","🚀","💡","🎨","🖼️","🧪","🔬","🧬","🎯","⚡","🎲","🎮","🧩","📷","🎥","✉️","📨","📩","📧","📞","☎️","📠","🗣️","💬","🗨️","📢","📣","🔔","🛎️","💰","💸","💳","🏦","📈","📉","⚖️","🧾","🪙","🏛️","⚗️","🧪","🔭","🔬","🩺","🧬","🩻","🏥","🌱","🌍","🌏","🌎","🌡️","👨‍💼","👩‍💼","👨‍🏫","👩‍🏫","👨‍🔬","👩‍🔬","👨‍🎨","👩‍🎨","👨‍🔧","👩‍🔧","👨‍🚀","👩‍🚀","👨‍⚖️","👩‍⚖️","🏅","🎖️","🥇","🥈","🥉","🏆","🎗️","🔑","🗝️","🧭","🛡️","🚩","🏳️‍🌈","🎟️","🎫"],iv=({workspace:r})=>{const{t:n}=xn(),{updateWorkspace:a}=rE(),{can:i}=Bl(),[o,c]=m(!1),[l,u]=m("emoji"),[p,h]=m(),[f,g]=m(null),b=s(null);d(()=>()=>{b.current&&clearTimeout(b.current)},[]);const v=Td({resolver:zh(Of({name:uf().min(2,{message:n("general.nameMinLength")}),image:uf().optional()})),defaultValues:{name:r.name||"",image:r.image||""}});if(!r)return t(Vl,{});const y=i(El.WORKSPACE_SETTINGS_EDIT);return e("div",{children:[f&&e("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[t("p",{className:"font-medium",children:n("settings.common.success")}),t("p",{className:"text-sm",children:f})]}),!y&&t("div",{className:"text-red-500",children:n("general.ownerOnly")}),t(ug,{...v,children:e("form",{onSubmit:v.handleSubmit(async function(e){c(!0),g(null);try{await a(r,e),g(n("general.success")),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{g(null)},5e3)}catch(e){Ke(e,{component:"WorkspaceSettingsGeneral",action:"updateWorkspace",metadata:{workspaceId:r._id}})}finally{c(!1)}}),className:"space-y-6",children:[t(pg,{control:v.control,name:"name",render:({field:r})=>e(fg,{children:[t(gg,{children:n("general.name")}),t(bg,{children:t(wg,{placeholder:n("general.namePlaceholder"),...r,disabled:!y})}),t(yg,{})]})}),r.billingCurrency?.trim()&&e("div",{className:"space-y-1.5",children:[t(lg,{className:"text-sm font-medium text-muted-foreground",children:n("general.billingCurrency")}),e("div",{className:"flex items-center gap-2 text-sm",children:[ng(r.billingCurrency)&&t("span",{className:"text-base",children:ng(r.billingCurrency)}),t("span",{children:r.billingCurrency.trim().toUpperCase()})]})]}),e("div",{className:"space-y-4",children:[e("div",{children:[t(lg,{className:"text-sm font-medium",children:n("general.icon")}),t(vg,{children:n("general.iconDescription")})]}),e(gb,{value:l,disabled:!y,onValueChange:e=>u(e),className:"flex flex-col space-y-3",children:[e("div",{className:"flex items-center space-x-2",children:[t(bb,{value:"emoji",id:"emoji"}),e(lg,{htmlFor:"emoji",className:"flex items-center gap-2",children:[t(Si,{className:"h-4 w-4"}),n("general.chooseEmoji")]})]}),e("div",{className:"flex items-center space-x-2",children:[t(bb,{value:"url",id:"url"}),e(lg,{htmlFor:"url",className:"flex items-center gap-2",children:[t(di,{className:"h-4 w-4"}),n("general.customImageUrl")]})]})]}),"emoji"===l&&e("div",{className:"space-y-3",children:[e("div",{className:"flex items-center gap-3",children:[t("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:[p&&t("span",{className:"text-2xl",children:p}),!p&&v.watch("image")?.trim()&&t("img",{src:v.watch("image")||void 0,alt:"Workspace preview"})]})]}),y&&t(tv,{className:"h-32 w-full rounded-md border",children:t("div",{className:"p-4 grid grid-cols-8 gap-2",children:av.map((e,r)=>t("button",{type:"button",onClick:()=>(e=>{h(e),v.setValue("image",nv(e))})(e),disabled:!y,className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(p===e?"bg-primary text-primary-foreground":""),children:e},r))})})]}),"url"===l&&e("div",{className:"space-y-3",children:[t(pg,{control:v.control,name:"image",render:({field:r})=>e(fg,{children:[t(gg,{children:n("general.imageUrl")}),t(bg,{children:t(wg,{placeholder:n("general.imageUrlPlaceholder"),...r,disabled:!y})}),t(vg,{children:n("general.imageUrlDescription")}),t(yg,{})]})}),v.watch("image")&&v.watch("image")?.trim()&&e("div",{className:"flex items-center gap-3",children:[t("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),t("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:t("img",{src:v.watch("image")||void 0,className:"w-full h-full object-cover",alt:"Workspace preview"})})]})]})]}),t("div",{className:"flex justify-end gap-3 pt-4",children:y&&t(Hi,{type:"submit",disabled:o,progress:o,children:n("general.updateWorkspace")})})]})})]})};class sv extends Rn{constructor(e){super({...e,requireOrgId:!0})}async getVapidPublicKey(){return this.fetchJson("push/vapid-public-key")}async subscribe(e,t){await this.fetchJson("push/subscribe",{method:"POST",body:JSON.stringify({endpoint:e.endpoint,keys:e.keys,userAgent:t})})}async unsubscribe(e){await this.fetchJson("push/unsubscribe",{method:"DELETE",body:JSON.stringify({endpoint:e})})}}const ov=c(null);function cv(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/"),r=atob(t),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n}const lv=a.memo(function({children:e,serviceWorkerPath:r="/push-sw.js",autoSubscribe:n=!1}){const{t:a}=xn(),i=On(),{isAuthenticated:s}=Fl(),c=o(()=>"undefined"!=typeof window&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window,[]),l=o(()=>new sv({serverUrl:i.serverUrl,version:i.version,orgId:i.orgId}),[i.serverUrl,i.version,i.orgId]),[u,h]=m({permission:c?Notification.permission:"default",isSubscribed:!1,isSupported:c,loading:!1,error:null});d(()=>{if(!s||!c)return;let e=!1;return(async()=>{try{const t=await navigator.serviceWorker.getRegistration(r);if(e)return;if(!t)return void h(e=>({...e,isSubscribed:!1}));const n=await t.pushManager.getSubscription();if(e)return;h(e=>({...e,isSubscribed:!!n,permission:Notification.permission}))}catch{e||h(e=>({...e,isSubscribed:!1}))}})(),()=>{e=!0}},[s,c,r]);const f=p(async()=>{if(!c)return!1;const e=await Notification.requestPermission();return h(t=>({...t,permission:e})),"granted"===e},[c]),g=p(async()=>{if(c&&s){h(e=>({...e,loading:!0,error:null}));try{if(!await f())return void h(e=>({...e,loading:!1,error:a("notifications.permissionDenied")}));const{publicKey:e}=await l.getVapidPublicKey(),t=await navigator.serviceWorker.register(r);await navigator.serviceWorker.ready;const n=(await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:cv(e)})).toJSON();await l.subscribe({endpoint:n.endpoint,keys:{p256dh:n.keys.p256dh,auth:n.keys.auth}},navigator.userAgent),h(e=>({...e,isSubscribed:!0,loading:!1}))}catch(e){const t=e instanceof Error?e.message:a("push.failedToSubscribe");h(e=>({...e,loading:!1,error:t})),Ke(e,{component:"PushNotificationProvider",action:"subscribe"})}}},[c,s,l,r,f]),b=p(async()=>{if(c){h(e=>({...e,loading:!0,error:null}));try{const e=await navigator.serviceWorker.getRegistration(r);if(e){const t=await e.pushManager.getSubscription();if(t){const e=t.endpoint;await t.unsubscribe(),await l.unsubscribe(e)}}h(e=>({...e,isSubscribed:!1,loading:!1}))}catch(e){const t=e instanceof Error?e.message:a("push.failedToUnsubscribe");h(e=>({...e,loading:!1,error:t})),Ke(e,{component:"PushNotificationProvider",action:"unsubscribe"})}}},[c,l,r]),v=o(()=>({...u,requestPermission:f,subscribe:g,unsubscribe:b}),[u,f,g,b]);return t(ov.Provider,{value:v,children:e})});function uv(){const e=u(ov);if(!e)throw new Error("usePushNotifications must be used within PushNotificationProvider");return e}const dv={firefox:4,safari:4,edge:4,chrome:4},pv=({workspace:n})=>{const{isSupported:a,permission:i,isSubscribed:c,loading:l,error:u,subscribe:h,unsubscribe:f}=uv(),{t:g}=xn(),{api:b}=Bn(),{can:v}=Bl(),y=v(El.WORKSPACE_SETTINGS_EDIT),w=o(()=>function(){const e="undefined"!=typeof navigator?navigator.userAgent:"";return e.includes("Firefox")?"firefox":e.includes("Safari")&&!e.includes("Chrome")?"safari":e.includes("Edg")?"edge":"chrome"}(),[]),x=dv[w],[S,k]=m([]),[E,N]=m(!0),[C,A]=m({}),[_,P]=m(!0),[T,R]=m(null),[D,I]=m(null),U=s(null);d(()=>()=>{U.current&&clearTimeout(U.current)},[]),d(()=>{if(!n?._id)return;const e=n._id.toString();N(!0),P(!0),Promise.all([b.getNotificationEvents(e).catch(()=>[]),b.getNotificationPreferences(e).catch(()=>({}))]).then(([e,t])=>{k(e),A(t)}).finally(()=>{N(!1),P(!1)})},[n?._id]);const M=p(async(e,t,r)=>{if(!n?._id||!y)return;const a=!r;R(`${e}.${t}`),I(null),A(r=>({...r,[e]:{...r[e],[t]:a}}));try{const r=await b.updateNotificationPreferences(n._id.toString(),{[e]:{[t]:a}});A(r),I(g("notifications.prefsSaved")),U.current&&clearTimeout(U.current),U.current=setTimeout(()=>I(null),3e3)}catch(n){A(n=>({...n,[e]:{...n[e],[t]:r}})),Ke(n,{component:"SettingsNotifications",action:"toggleChannel"})}finally{R(null)}},[n?._id,y,b,g]),L=(e,t)=>!1!==C[e]?.[t],O=o(()=>{const e=new Map;for(const t of S){const r=t.category||"general";e.has(r)||e.set(r,[]),e.get(r).push(t)}return Array.from(e.entries())},[S]),z=E||_,F=S.length>0;return e("div",{className:"space-y-6",children:[t("p",{className:"text-sm text-gray-600",children:g("notifications.manageDescription")}),a&&e(r,{children:[u&&"denied"!==i&&t("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg text-sm",children:u}),"denied"===i&&t("div",{className:"border border-amber-200 bg-amber-50 rounded-lg p-4",children:e("div",{className:"flex items-start gap-3",children:[t(yi,{className:"h-5 w-5 text-amber-600 shrink-0 mt-0.5"}),e("div",{children:[t("h4",{className:"text-sm font-medium text-amber-800",children:g("notifications.blocked")}),t("p",{className:"text-xs text-amber-700 mt-1",children:g("notifications.blockedDescription")}),t("ol",{className:"text-xs text-amber-700 mt-2 space-y-1 list-decimal list-inside",children:Array.from({length:x},(e,r)=>t("li",{children:g(`notifications.unblock.${w}.step${r+1}`)},r))})]})]})}),"denied"!==i&&e("div",{className:"border rounded-lg p-4",children:[e("div",{className:"flex items-start justify-between gap-4",children:[e("div",{className:"flex items-start gap-3",children:[t("div",{className:"mt-0.5 p-2 rounded-lg "+(c?"bg-green-100":"bg-gray-100"),children:c?t(ti,{className:"h-4 w-4 text-green-600"}):t(ei,{className:"h-4 w-4 text-gray-400"})}),e("div",{children:[t("h4",{className:"text-sm font-medium text-gray-900",children:g("notifications.pushTitle")}),t("p",{className:"text-xs text-gray-500 mt-0.5",children:g("notifications.pushDescription",{subscribed:String(c)})})]})]}),t(Hi,{variant:c?"outline":"default",size:"sm",className:"shrink-0",onClick:c?f:h,disabled:l,progress:l,children:g("notifications.toggleAction",{loading:String(l),subscribed:String(c)})})]}),c&&t("div",{className:"mt-3 pt-3 border-t border-gray-100 text-xs text-gray-500",children:g("notifications.deviceNote")})]})]}),z&&t("div",{className:"text-center text-sm text-gray-400 py-4",children:g("notifications.loadingPrefs")}),!z&&F&&y&&e(r,{children:[D&&t("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded-lg text-sm",children:D}),O.map(([r,n])=>e("div",{className:"border rounded-lg overflow-hidden",children:[t("div",{className:"bg-gray-50 px-4 py-2.5 border-b",children:t("h4",{className:"text-sm font-medium text-gray-700 capitalize",children:r})}),e("div",{className:"divide-y",children:[e("div",{className:"flex items-center px-4 py-2 bg-gray-50/50",children:[t("div",{className:"flex-1"}),e("div",{className:"flex items-center gap-6",children:[t("div",{className:"w-12 flex justify-center",children:t(mi,{className:"h-3.5 w-3.5 text-gray-400"})}),t("div",{className:"w-12 flex justify-center",children:t(xi,{className:"h-3.5 w-3.5 text-gray-400"})})]})]}),n.map(r=>{const n=L(r.slug,"email"),a=L(r.slug,"push"),i=T===`${r.slug}.email`,s=T===`${r.slug}.push`;return e("div",{className:"flex items-center px-4 py-3",children:[e("div",{className:"flex-1 min-w-0",children:[t("div",{className:"text-sm font-medium text-gray-900",children:r.name}),r.description&&t("div",{className:"text-xs text-gray-500 mt-0.5",children:r.description})]}),e("div",{className:"flex items-center gap-6 shrink-0",children:[t("div",{className:"w-12 flex justify-center",children:r.channels.email?t(nu,{checked:n,onCheckedChange:()=>M(r.slug,"email",n),disabled:i}):t("span",{className:"text-xs text-gray-300",children:"—"})}),t("div",{className:"w-12 flex justify-center",children:r.channels.push?t(nu,{checked:a,onCheckedChange:()=>M(r.slug,"push",a),disabled:s}):t("span",{className:"text-xs text-gray-300",children:"—"})})]})]},r.slug)})]})]},r))]})]})},mv=({workspace:r})=>{const{t:n}=xn(),{isOwner:a}=Bl(),{settings:i}=Fn(),{appPermissions:c}=ua(),{updateWorkspacePermissions:l}=rE(),[u,p]=m(!1),[h,f]=m(null),g=s(null);d(()=>()=>{g.current&&clearTimeout(g.current)},[]);const b=o(()=>i?.workspace?.roles??r.roles??[],[i?.workspace?.roles,r.roles]),v=o(()=>{if(!c)return[];const e=new Set;for(const t of Object.values(c))for(const r of t)r.startsWith("workspace:")||e.add(r);return Array.from(e).sort()},[c]),[y,w]=m({});if(d(()=>{if(!c)return;const e=r.permissions,t={};for(const r of b)t[r]=e&&r in e?e[r].filter(e=>!e.startsWith("workspace:")):r in c?c[r].filter(e=>!e.startsWith("workspace:")):[];w(t)},[r.permissions,c,b]),!r)return t(Vl,{});if(!c||0===v.length)return null;return e("div",{children:[h&&e("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[t("p",{className:"font-medium",children:n("settings.common.success")}),t("p",{className:"text-sm",children:h})]}),!a&&t("div",{className:"text-red-500 mb-4",children:n("permissions.ownerOnly")}),t("p",{className:"text-sm text-muted-foreground mb-4",children:n("permissions.description")}),t("div",{className:"overflow-x-auto",children:e("table",{className:"w-full text-sm",children:[t("thead",{children:e("tr",{className:"border-b",children:[t("th",{className:"text-start py-2 pe-4 font-medium text-gray-500 min-w-[160px]"}),b.map(e=>t("th",{className:"text-center py-2 px-3 font-medium text-gray-700 capitalize min-w-[80px]",children:e},e))]})}),t("tbody",{children:v.map(r=>e("tr",{className:"border-b border-gray-50 hover:bg-gray-50/50",children:[t("td",{className:"py-2 pe-4 text-gray-700 font-mono text-xs",children:r}),b.map(e=>{const n="admin"===e,i=n||(y[e]??[]).includes(r);return t("td",{className:"text-center py-2 px-3",children:t(nu,{checked:i,disabled:!a||n,onCheckedChange:()=>((e,t)=>{w(r=>{const n=r[e]??[],a=n.includes(t);return{...r,[e]:a?n.filter(e=>e!==t):[...n,t]}})})(e,r),className:"mx-auto"})},e)})]},r))})]})}),a&&t("div",{className:"mt-6",children:t(Hi,{onClick:async()=>{p(!0),f(null);try{const e=r.permissions??{},t={},a=new Set([...Object.keys(e),...Object.keys(y)]);for(const r of a){const n=(e[r]??[]).filter(e=>e.startsWith("workspace:")),a=y[r]??[];t[r]=[...n,...a]}await l(r._id,t),f(n("permissions.saveSuccess")),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>f(null),5e3)}catch(e){Ke(e,{component:"WorkspaceSettingsPermissions",action:"savePermissions",metadata:{workspaceId:r._id}})}finally{p(!1)}},disabled:u,progress:u,children:n(u?"permissions.saving":"permissions.save")})})]})};var hv=.999,fv=/[\\\/_+.#"@\[\(\{&]/,gv=/[\\\/_+.#"@\[\(\{&]/g,bv=/[\s-]/,vv=/[\s-]/g;function yv(e,t,r,n,a,i,s){if(i===t.length)return a===e.length?1:.99;var o=`${a},${i}`;if(void 0!==s[o])return s[o];for(var c,l,u,d,p=n.charAt(i),m=r.indexOf(p,a),h=0;m>=0;)(c=yv(e,t,r,n,m+1,i+1,s))>h&&(m===a?c*=1:fv.test(e.charAt(m-1))?(c*=.8,(u=e.slice(a,m-1).match(gv))&&a>0&&(c*=Math.pow(hv,u.length))):bv.test(e.charAt(m-1))?(c*=.9,(d=e.slice(a,m-1).match(vv))&&a>0&&(c*=Math.pow(hv,d.length))):(c*=.17,a>0&&(c*=Math.pow(hv,m-a))),e.charAt(m)!==t.charAt(i)&&(c*=.9999)),(c<.1&&r.charAt(m-1)===n.charAt(i+1)||n.charAt(i+1)===n.charAt(i)&&r.charAt(m-1)!==n.charAt(i))&&(.1*(l=yv(e,t,r,n,m+1,i+2,s))>c&&(c=.1*l)),c>h&&(h=c),m=r.indexOf(p,m+1);return s[o]=h,h}function wv(e){return e.toLowerCase().replace(vv," ")}function xv(e,t,r){return yv(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,wv(e),wv(t),0,0,{})}var Sv='[cmdk-group=""]',kv='[cmdk-group-items=""]',Ev='[cmdk-item=""]',Nv=`${Ev}:not([aria-disabled="true"])`,Cv="cmdk-item-select",Av="data-value",_v=(e,t,r)=>xv(e,t,r),Pv=n.createContext(void 0),Tv=()=>n.useContext(Pv),Rv=n.createContext(void 0),Dv=()=>n.useContext(Rv),Iv=n.createContext(void 0),Uv=n.forwardRef((e,t)=>{let r=qv(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=qv(()=>new Set),i=qv(()=>new Map),s=qv(()=>new Map),o=qv(()=>new Set),c=$v(e),{label:l,children:u,value:d,onValueChange:p,filter:m,shouldFilter:h,loop:f,disablePointerSelection:g=!1,vimBindings:b=!0,...v}=e,y=Yi(),w=Yi(),x=Yi(),S=n.useRef(null),k=Yv();Kv(()=>{if(void 0!==d){let e=d.trim();r.current.value=e,E.emit()}},[d]),Kv(()=>{k(6,T)},[]);let E=n.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var a,i,s,o;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)P(),A(),k(1,_);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(x);e?e.focus():null==(a=document.getElementById(y))||a.focus()}if(k(7,()=>{var e;r.current.selectedItemId=null==(e=R())?void 0:e.id,E.emit()}),n||k(5,T),void 0!==(null==(i=c.current)?void 0:i.value)){let e=null!=t?t:"";return void(null==(o=(s=c.current).onValueChange)||o.call(s,e))}}E.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),N=n.useMemo(()=>({value:(e,t,n)=>{var a;t!==(null==(a=s.current.get(e))?void 0:a.value)&&(s.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,C(t,n)),k(2,()=>{A(),E.emit()}))},item:(e,t)=>(a.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),k(3,()=>{P(),A(),r.current.value||_(),E.emit()}),()=>{s.current.delete(e),a.current.delete(e),r.current.filtered.items.delete(e);let t=R();k(4,()=>{P(),(null==t?void 0:t.getAttribute("id"))===e&&_(),E.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{s.current.delete(e),i.current.delete(e)}),filter:()=>c.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:y,inputId:x,labelId:w,listInnerRef:S}),[]);function C(e,t){var n,a;let i=null!=(a=null==(n=c.current)?void 0:n.filter)?a:_v;return e?i(e,r.current.search,t):0}function A(){if(!r.current.search||!1===c.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=i.current.get(r),a=0;n.forEach(t=>{let r=e.get(t);a=Math.max(r,a)}),t.push([r,a])});let n=S.current;D().sort((t,r)=>{var n,a;let i=t.getAttribute("id"),s=r.getAttribute("id");return(null!=(n=e.get(s))?n:0)-(null!=(a=e.get(i))?a:0)}).forEach(e=>{let t=e.closest(kv);t?t.appendChild(e.parentElement===t?e:e.closest(`${kv} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${kv} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=S.current)?void 0:t.querySelector(`${Sv}[${Av}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function _(){let e=D().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(Av);E.setState("value",t||void 0)}function P(){var e,t,n,o;if(!r.current.search||!1===c.current.shouldFilter)return void(r.current.filtered.count=a.current.size);r.current.filtered.groups=new Set;let l=0;for(let i of a.current){let a=C(null!=(t=null==(e=s.current.get(i))?void 0:e.value)?t:"",null!=(o=null==(n=s.current.get(i))?void 0:n.keywords)?o:[]);r.current.filtered.items.set(i,a),a>0&&l++}for(let[e,t]of i.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=l}function T(){var e,t,r;let n=R();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(Sv))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function R(){var e;return null==(e=S.current)?void 0:e.querySelector(`${Ev}[aria-selected="true"]`)}function D(){var e;return Array.from((null==(e=S.current)?void 0:e.querySelectorAll(Nv))||[])}function I(e){let t=D()[e];t&&E.setState("value",t.getAttribute(Av))}function U(e){var t;let r=R(),n=D(),a=n.findIndex(e=>e===r),i=n[a+e];null!=(t=c.current)&&t.loop&&(i=a+e<0?n[n.length-1]:a+e===n.length?n[0]:n[a+e]),i&&E.setState("value",i.getAttribute(Av))}function M(e){let t,r=R(),n=null==r?void 0:r.closest(Sv);for(;n&&!t;)n=e>0?Hv(n,Sv):Gv(n,Sv),t=null==n?void 0:n.querySelector(Nv);t?E.setState("value",t.getAttribute(Av)):U(e)}let L=()=>I(D().length-1),O=e=>{e.preventDefault(),e.metaKey?L():e.altKey?M(1):U(1)},z=e=>{e.preventDefault(),e.metaKey?I(0):e.altKey?M(-1):U(-1)};return n.createElement(ns.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=v.onKeyDown)||t.call(v,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!e.defaultPrevented&&!r)switch(e.key){case"n":case"j":b&&e.ctrlKey&&O(e);break;case"ArrowDown":O(e);break;case"p":case"k":b&&e.ctrlKey&&z(e);break;case"ArrowUp":z(e);break;case"Home":e.preventDefault(),I(0);break;case"End":e.preventDefault(),L();break;case"Enter":{e.preventDefault();let t=R();if(t){let e=new Event(Cv);t.dispatchEvent(e)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:Qv},l),Xv(e,e=>n.createElement(Rv.Provider,{value:E},n.createElement(Pv.Provider,{value:N},e))))}),Mv=n.forwardRef((e,t)=>{var r,a;let i=Yi(),s=n.useRef(null),o=n.useContext(Iv),c=Tv(),l=$v(e),u=null!=(a=null==(r=l.current)?void 0:r.forceMount)?a:null==o?void 0:o.forceMount;Kv(()=>{if(!u)return c.item(i,null==o?void 0:o.id)},[u]);let d=Jv(i,s,[e.value,e.children,s],e.keywords),p=Dv(),m=Zv(e=>e.value&&e.value===d.current),h=Zv(e=>!(!u&&!1!==c.filter())||(!e.search||e.filtered.items.get(i)>0));function f(){var e,t;g(),null==(t=(e=l.current).onSelect)||t.call(e,d.current)}function g(){p.setState("value",d.current,!0)}if(n.useEffect(()=>{let t=s.current;if(t&&!e.disabled)return t.addEventListener(Cv,f),()=>t.removeEventListener(Cv,f)},[h,e.onSelect,e.disabled]),!h)return null;let{disabled:b,value:v,onSelect:y,forceMount:w,keywords:x,...S}=e;return n.createElement(ns.div,{ref:Ti(s,t),...S,id:i,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!m,"data-disabled":!!b,"data-selected":!!m,onPointerMove:b||c.getDisablePointerSelection()?void 0:g,onClick:b?void 0:f},e.children)}),Lv=n.forwardRef((e,t)=>{let{heading:r,children:a,forceMount:i,...s}=e,o=Yi(),c=n.useRef(null),l=n.useRef(null),u=Yi(),d=Tv(),p=Zv(e=>!(!i&&!1!==d.filter())||(!e.search||e.filtered.groups.has(o)));Kv(()=>d.group(o),[]),Jv(o,c,[e.value,e.heading,l]);let m=n.useMemo(()=>({id:o,forceMount:i}),[i]);return n.createElement(ns.div,{ref:Ti(c,t),...s,"cmdk-group":"",role:"presentation",hidden:!p||void 0},r&&n.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),Xv(e,e=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},n.createElement(Iv.Provider,{value:m},e))))}),Ov=n.forwardRef((e,t)=>{let{alwaysRender:r,...a}=e,i=n.useRef(null),s=Zv(e=>!e.search);return r||s?n.createElement(ns.div,{ref:Ti(i,t),...a,"cmdk-separator":"",role:"separator"}):null}),zv=n.forwardRef((e,t)=>{let{onValueChange:r,...a}=e,i=null!=e.value,s=Dv(),o=Zv(e=>e.search),c=Zv(e=>e.selectedItemId),l=Tv();return n.useEffect(()=>{null!=e.value&&s.setState("search",e.value)},[e.value]),n.createElement(ns.input,{ref:t,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:"text",value:i?e.value:o,onChange:e=>{i||s.setState("search",e.target.value),null==r||r(e.target.value)}})}),Fv=n.forwardRef((e,t)=>{let{children:r,label:a="Suggestions",...i}=e,s=n.useRef(null),o=n.useRef(null),c=Zv(e=>e.selectedItemId),l=Tv();return n.useEffect(()=>{if(o.current&&s.current){let e,t=o.current,r=s.current,n=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;r.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return n.observe(t),()=>{cancelAnimationFrame(e),n.unobserve(t)}}},[]),n.createElement(ns.div,{ref:Ti(s,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":a,id:l.listId},Xv(e,e=>n.createElement("div",{ref:Ti(o,l.listInnerRef),"cmdk-list-sizer":""},e)))}),Bv=n.forwardRef((e,t)=>{let{open:r,onOpenChange:a,overlayClassName:i,contentClassName:s,container:o,...c}=e;return n.createElement(sc,{open:r,onOpenChange:a},n.createElement(cc,{container:o},n.createElement(lc,{"cmdk-overlay":"",className:i}),n.createElement(uc,{"aria-label":e.label,"cmdk-dialog":"",className:s},n.createElement(Uv,{ref:t,...c}))))}),Wv=n.forwardRef((e,t)=>Zv(e=>0===e.filtered.count)?n.createElement(ns.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Vv=n.forwardRef((e,t)=>{let{progress:r,children:a,label:i="Loading...",...s}=e;return n.createElement(ns.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Xv(e,e=>n.createElement("div",{"aria-hidden":!0},e)))}),jv=Object.assign(Uv,{List:Fv,Item:Mv,Input:zv,Group:Lv,Separator:Ov,Dialog:Bv,Empty:Wv,Loading:Vv});function Hv(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function Gv(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function $v(e){let t=n.useRef(e);return Kv(()=>{t.current=e}),t}var Kv="undefined"==typeof window?n.useEffect:n.useLayoutEffect;function qv(e){let t=n.useRef();return void 0===t.current&&(t.current=e()),t}function Zv(e){let t=Dv(),r=()=>e(t.snapshot());return n.useSyncExternalStore(t.subscribe,r,r)}function Jv(e,t,r,a=[]){let i=n.useRef(),s=Tv();return Kv(()=>{var n;let o=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():i.current}})(),c=a.map(e=>e.trim());s.value(e,o,c),null==(n=t.current)||n.setAttribute(Av,o),i.current=o}),i}var Yv=()=>{let[e,t]=n.useState(),r=qv(()=>new Map);return Kv(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function Xv({asChild:e,children:t},r){return e&&n.isValidElement(t)?n.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},r(t.props.children)):r(t)}var Qv={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const ey=n.forwardRef(({className:e,...r},n)=>t(jv,{ref:n,className:Oe("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...r}));ey.displayName=jv.displayName;const ty=n.forwardRef(({className:r,...n},a)=>e("div",{className:"flex items-center border-b px-3","data-cmdk-input-wrapper":"",children:[t(Sc,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),t(jv.Input,{ref:a,className:Oe("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",r),...n})]}));ty.displayName=jv.Input.displayName;const ry=n.forwardRef(({className:e,...r},n)=>t(jv.List,{ref:n,className:Oe("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...r}));ry.displayName=jv.List.displayName;n.forwardRef((e,r)=>t(jv.Empty,{ref:r,className:"py-6 text-center text-sm",...e})).displayName=jv.Empty.displayName;const ny=n.forwardRef(({className:e,...r},n)=>t(jv.Group,{ref:n,className:Oe("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),...r}));ny.displayName=jv.Group.displayName;n.forwardRef(({className:e,...r},n)=>t(jv.Separator,{ref:n,className:Oe("-mx-1 h-px bg-border",e),...r})).displayName=jv.Separator.displayName;const ay=n.forwardRef(({className:e,...r},n)=>t(jv.Item,{ref:n,className:Oe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r}));ay.displayName=jv.Item.displayName;const iy=["top","right","bottom","left"],sy=Math.min,oy=Math.max,cy=Math.round,ly=Math.floor,uy=e=>({x:e,y:e}),dy={left:"right",right:"left",bottom:"top",top:"bottom"},py={start:"end",end:"start"};function my(e,t,r){return oy(e,sy(t,r))}function hy(e,t){return"function"==typeof e?e(t):e}function fy(e){return e.split("-")[0]}function gy(e){return e.split("-")[1]}function by(e){return"x"===e?"y":"x"}function vy(e){return"y"===e?"height":"width"}const yy=new Set(["top","bottom"]);function wy(e){return yy.has(fy(e))?"y":"x"}function xy(e){return by(wy(e))}function Sy(e){return e.replace(/start|end/g,e=>py[e])}const ky=["left","right"],Ey=["right","left"],Ny=["top","bottom"],Cy=["bottom","top"];function Ay(e,t,r,n){const a=gy(e);let i=function(e,t,r){switch(e){case"top":case"bottom":return r?t?Ey:ky:t?ky:Ey;case"left":case"right":return t?Ny:Cy;default:return[]}}(fy(e),"start"===r,n);return a&&(i=i.map(e=>e+"-"+a),t&&(i=i.concat(i.map(Sy)))),i}function _y(e){return e.replace(/left|right|bottom|top/g,e=>dy[e])}function Py(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Ty(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function Ry(e,t,r){let{reference:n,floating:a}=e;const i=wy(t),s=xy(t),o=vy(s),c=fy(t),l="y"===i,u=n.x+n.width/2-a.width/2,d=n.y+n.height/2-a.height/2,p=n[o]/2-a[o]/2;let m;switch(c){case"top":m={x:u,y:n.y-a.height};break;case"bottom":m={x:u,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:d};break;case"left":m={x:n.x-a.width,y:d};break;default:m={x:n.x,y:n.y}}switch(gy(t)){case"start":m[s]-=p*(r&&l?-1:1);break;case"end":m[s]+=p*(r&&l?-1:1)}return m}async function Dy(e,t){var r;void 0===t&&(t={});const{x:n,y:a,platform:i,rects:s,elements:o,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:m=0}=hy(t,e),h=Py(m),f=o[p?"floating"===d?"reference":"floating":d],g=Ty(await i.getClippingRect({element:null==(r=await(null==i.isElement?void 0:i.isElement(f)))||r?f:f.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(o.floating)),boundary:l,rootBoundary:u,strategy:c})),b="floating"===d?{x:n,y:a,width:s.floating.width,height:s.floating.height}:s.reference,v=await(null==i.getOffsetParent?void 0:i.getOffsetParent(o.floating)),y=await(null==i.isElement?void 0:i.isElement(v))&&await(null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},w=Ty(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:b,offsetParent:v,strategy:c}):b);return{top:(g.top-w.top+h.top)/y.y,bottom:(w.bottom-g.bottom+h.bottom)/y.y,left:(g.left-w.left+h.left)/y.x,right:(w.right-g.right+h.right)/y.x}}function Iy(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Uy(e){return iy.some(t=>e[t]>=0)}const My=new Set(["left","top"]);function Ly(){return"undefined"!=typeof window}function Oy(e){return By(e)?(e.nodeName||"").toLowerCase():"#document"}function zy(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Fy(e){var t;return null==(t=(By(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function By(e){return!!Ly()&&(e instanceof Node||e instanceof zy(e).Node)}function Wy(e){return!!Ly()&&(e instanceof Element||e instanceof zy(e).Element)}function Vy(e){return!!Ly()&&(e instanceof HTMLElement||e instanceof zy(e).HTMLElement)}function jy(e){return!(!Ly()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof zy(e).ShadowRoot)}const Hy=new Set(["inline","contents"]);function Gy(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=nw(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Hy.has(a)}const $y=new Set(["table","td","th"]);function Ky(e){return $y.has(Oy(e))}const qy=[":popover-open",":modal"];function Zy(e){return qy.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Jy=["transform","translate","scale","rotate","perspective"],Yy=["transform","translate","scale","rotate","perspective","filter"],Xy=["paint","layout","strict","content"];function Qy(e){const t=ew(),r=Wy(e)?nw(e):e;return Jy.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||Yy.some(e=>(r.willChange||"").includes(e))||Xy.some(e=>(r.contain||"").includes(e))}function ew(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const tw=new Set(["html","body","#document"]);function rw(e){return tw.has(Oy(e))}function nw(e){return zy(e).getComputedStyle(e)}function aw(e){return Wy(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function iw(e){if("html"===Oy(e))return e;const t=e.assignedSlot||e.parentNode||jy(e)&&e.host||Fy(e);return jy(t)?t.host:t}function sw(e){const t=iw(e);return rw(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vy(t)&&Gy(t)?t:sw(t)}function ow(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const a=sw(e),i=a===(null==(n=e.ownerDocument)?void 0:n.body),s=zy(a);if(i){const e=cw(s);return t.concat(s,s.visualViewport||[],Gy(a)?a:[],e&&r?ow(e):[])}return t.concat(a,ow(a,[],r))}function cw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lw(e){const t=nw(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=Vy(e),i=a?e.offsetWidth:r,s=a?e.offsetHeight:n,o=cy(r)!==i||cy(n)!==s;return o&&(r=i,n=s),{width:r,height:n,$:o}}function uw(e){return Wy(e)?e:e.contextElement}function dw(e){const t=uw(e);if(!Vy(t))return uy(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:i}=lw(t);let s=(i?cy(r.width):r.width)/n,o=(i?cy(r.height):r.height)/a;return s&&Number.isFinite(s)||(s=1),o&&Number.isFinite(o)||(o=1),{x:s,y:o}}const pw=uy(0);function mw(e){const t=zy(e);return ew()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:pw}function hw(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const a=e.getBoundingClientRect(),i=uw(e);let s=uy(1);t&&(n?Wy(n)&&(s=dw(n)):s=dw(e));const o=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==zy(e))&&t}(i,r,n)?mw(i):uy(0);let c=(a.left+o.x)/s.x,l=(a.top+o.y)/s.y,u=a.width/s.x,d=a.height/s.y;if(i){const e=zy(i),t=n&&Wy(n)?zy(n):n;let r=e,a=cw(r);for(;a&&n&&t!==r;){const e=dw(a),t=a.getBoundingClientRect(),n=nw(a),i=t.left+(a.clientLeft+parseFloat(n.paddingLeft))*e.x,s=t.top+(a.clientTop+parseFloat(n.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=i,l+=s,r=zy(a),a=cw(r)}}return Ty({width:u,height:d,x:c,y:l})}function fw(e,t){const r=aw(e).scrollLeft;return t?t.left+r:hw(Fy(e)).left+r}function gw(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-fw(e,r),y:r.top+t.scrollTop}}const bw=new Set(["absolute","fixed"]);function vw(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=zy(e),n=Fy(e),a=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,o=0,c=0;if(a){i=a.width,s=a.height;const e=ew();(!e||e&&"fixed"===t)&&(o=a.offsetLeft,c=a.offsetTop)}const l=fw(n);if(l<=0){const e=n.ownerDocument,t=e.body,r=getComputedStyle(t),a="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,s=Math.abs(n.clientWidth-t.clientWidth-a);s<=25&&(i-=s)}else l<=25&&(i+=l);return{width:i,height:s,x:o,y:c}}(e,r);else if("document"===t)n=function(e){const t=Fy(e),r=aw(e),n=e.ownerDocument.body,a=oy(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=oy(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+fw(e);const o=-r.scrollTop;return"rtl"===nw(n).direction&&(s+=oy(t.clientWidth,n.clientWidth)-a),{width:a,height:i,x:s,y:o}}(Fy(e));else if(Wy(t))n=function(e,t){const r=hw(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,i=Vy(e)?dw(e):uy(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:a*i.x,y:n*i.y}}(t,r);else{const r=mw(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Ty(n)}function yw(e,t){const r=iw(e);return!(r===t||!Wy(r)||rw(r))&&("fixed"===nw(r).position||yw(r,t))}function ww(e,t,r){const n=Vy(t),a=Fy(t),i="fixed"===r,s=hw(e,!0,i,t);let o={scrollLeft:0,scrollTop:0};const c=uy(0);function l(){c.x=fw(a)}if(n||!n&&!i)if(("body"!==Oy(t)||Gy(a))&&(o=aw(t)),n){const e=hw(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else a&&l();i&&!n&&a&&l();const u=!a||n||i?uy(0):gw(a,o);return{x:s.left+o.scrollLeft-c.x-u.x,y:s.top+o.scrollTop-c.y-u.y,width:s.width,height:s.height}}function xw(e){return"static"===nw(e).position}function Sw(e,t){if(!Vy(e)||"fixed"===nw(e).position)return null;if(t)return t(e);let r=e.offsetParent;return Fy(e)===r&&(r=r.ownerDocument.body),r}function kw(e,t){const r=zy(e);if(Zy(e))return r;if(!Vy(e)){let t=iw(e);for(;t&&!rw(t);){if(Wy(t)&&!xw(t))return t;t=iw(t)}return r}let n=Sw(e,t);for(;n&&Ky(n)&&xw(n);)n=Sw(n,t);return n&&rw(n)&&xw(n)&&!Qy(n)?r:n||function(e){let t=iw(e);for(;Vy(t)&&!rw(t);){if(Qy(t))return t;if(Zy(t))return null;t=iw(t)}return null}(e)||r}const Ew={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const i="fixed"===a,s=Fy(n),o=!!t&&Zy(t.floating);if(n===s||o&&i)return r;let c={scrollLeft:0,scrollTop:0},l=uy(1);const u=uy(0),d=Vy(n);if((d||!d&&!i)&&(("body"!==Oy(n)||Gy(s))&&(c=aw(n)),Vy(n))){const e=hw(n);l=dw(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}const p=!s||d||i?uy(0):gw(s,c);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:r.y*l.y-c.scrollTop*l.y+u.y+p.y}},getDocumentElement:Fy,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const i=[..."clippingAncestors"===r?Zy(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=ow(e,[],!1).filter(e=>Wy(e)&&"body"!==Oy(e)),a=null;const i="fixed"===nw(e).position;let s=i?iw(e):e;for(;Wy(s)&&!rw(s);){const t=nw(s),r=Qy(s);r||"fixed"!==t.position||(a=null),(i?!r&&!a:!r&&"static"===t.position&&a&&bw.has(a.position)||Gy(s)&&!r&&yw(e,s))?n=n.filter(e=>e!==s):a=t,s=iw(s)}return t.set(e,n),n}(t,this._c):[].concat(r),n],s=i[0],o=i.reduce((e,r)=>{const n=vw(t,r,a);return e.top=oy(n.top,e.top),e.right=sy(n.right,e.right),e.bottom=sy(n.bottom,e.bottom),e.left=oy(n.left,e.left),e},vw(t,s,a));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:kw,getElementRects:async function(e){const t=this.getOffsetParent||kw,r=this.getDimensions,n=await r(e.floating);return{reference:ww(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=lw(e);return{width:t,height:r}},getScale:dw,isElement:Wy,isRTL:function(e){return"rtl"===nw(e).direction}};function Nw(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Cw(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:o="function"==typeof IntersectionObserver,animationFrame:c=!1}=n,l=uw(e),u=a||i?[...l?ow(l):[],...ow(t)]:[];u.forEach(e=>{a&&e.addEventListener("scroll",r,{passive:!0}),i&&e.addEventListener("resize",r)});const d=l&&o?function(e,t){let r,n=null;const a=Fy(e);function i(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function s(o,c){void 0===o&&(o=!1),void 0===c&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:p,height:m}=l;if(o||t(),!p||!m)return;const h={rootMargin:-ly(d)+"px "+-ly(a.clientWidth-(u+p))+"px "+-ly(a.clientHeight-(d+m))+"px "+-ly(u)+"px",threshold:oy(0,sy(1,c))||1};let f=!0;function g(t){const n=t[0].intersectionRatio;if(n!==c){if(!f)return s();n?s(!1,n):r=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==n||Nw(l,e.getBoundingClientRect())||s(),f=!1}try{n=new IntersectionObserver(g,{...h,root:a.ownerDocument})}catch(e){n=new IntersectionObserver(g,h)}n.observe(e)}(!0),i}(l,r):null;let p,m=-1,h=null;s&&(h=new ResizeObserver(e=>{let[n]=e;n&&n.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),r()}),l&&!c&&h.observe(l),h.observe(t));let f=c?hw(e):null;return c&&function t(){const n=hw(e);f&&!Nw(f,n)&&r();f=n,p=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach(e=>{a&&e.removeEventListener("scroll",r),i&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const Aw=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:i,placement:s,middlewareData:o}=t,c=await async function(e,t){const{placement:r,platform:n,elements:a}=e,i=await(null==n.isRTL?void 0:n.isRTL(a.floating)),s=fy(r),o=gy(r),c="y"===wy(r),l=My.has(s)?-1:1,u=i&&c?-1:1,d=hy(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&"number"==typeof h&&(m="end"===o?-1*h:h),c?{x:m*u,y:p*l}:{x:p*l,y:m*u}}(t,e);return s===(null==(r=o.offset)?void 0:r.placement)&&null!=(n=o.arrow)&&n.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:s}}}}},_w=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a,platform:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:c={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=hy(e,t),u={x:r,y:n},d=await i.detectOverflow(t,l),p=wy(fy(a)),m=by(p);let h=u[m],f=u[p];if(s){const e="y"===m?"bottom":"right";h=my(h+d["y"===m?"top":"left"],h,h-d[e])}if(o){const e="y"===p?"bottom":"right";f=my(f+d["y"===p?"top":"left"],f,f-d[e])}const g=c.fn({...t,[m]:h,[p]:f});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[m]:s,[p]:o}}}}}},Pw=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:i,rects:s,initialPlacement:o,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:f=!0,...g}=hy(e,t);if(null!=(r=i.arrow)&&r.alignmentOffset)return{};const b=fy(a),v=wy(o),y=fy(o)===o,w=await(null==c.isRTL?void 0:c.isRTL(l.floating)),x=p||(y||!f?[_y(o)]:function(e){const t=_y(e);return[Sy(e),t,Sy(t)]}(o)),S="none"!==h;!p&&S&&x.push(...Ay(o,f,h,w));const k=[o,...x],E=await c.detectOverflow(t,g),N=[];let C=(null==(n=i.flip)?void 0:n.overflows)||[];if(u&&N.push(E[b]),d){const e=function(e,t,r){void 0===r&&(r=!1);const n=gy(e),a=xy(e),i=vy(a);let s="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=_y(s)),[s,_y(s)]}(a,s,w);N.push(E[e[0]],E[e[1]])}if(C=[...C,{placement:a,overflows:N}],!N.every(e=>e<=0)){var A,_;const e=((null==(A=i.flip)?void 0:A.index)||0)+1,t=k[e];if(t){if(!("alignment"===d&&v!==wy(t))||C.every(e=>wy(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:C},reset:{placement:t}}}let r=null==(_=C.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:_.placement;if(!r)switch(m){case"bestFit":{var P;const e=null==(P=C.filter(e=>{if(S){const t=wy(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:P[0];e&&(r=e);break}case"initialPlacement":r=o}if(a!==r)return{reset:{placement:r}}}return{}}}},Tw=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:i,platform:s,elements:o}=t,{apply:c=()=>{},...l}=hy(e,t),u=await s.detectOverflow(t,l),d=fy(a),p=gy(a),m="y"===wy(a),{width:h,height:f}=i.floating;let g,b;"top"===d||"bottom"===d?(g=d,b=p===(await(null==s.isRTL?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(b=d,g="end"===p?"top":"bottom");const v=f-u.top-u.bottom,y=h-u.left-u.right,w=sy(f-u[g],v),x=sy(h-u[b],y),S=!t.middlewareData.shift;let k=w,E=x;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(E=y),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(k=v),S&&!p){const e=oy(u.left,0),t=oy(u.right,0),r=oy(u.top,0),n=oy(u.bottom,0);m?E=h-2*(0!==e||0!==t?e+t:oy(u.left,u.right)):k=f-2*(0!==r||0!==n?r+n:oy(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:k});const N=await s.getDimensions(o.floating);return h!==N.width||f!==N.height?{reset:{rects:!0}}:{}}}},Rw=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:a="referenceHidden",...i}=hy(e,t);switch(a){case"referenceHidden":{const e=Iy(await n.detectOverflow(t,{...i,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Uy(e)}}}case"escaped":{const e=Iy(await n.detectOverflow(t,{...i,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:Uy(e)}}}default:return{}}}}},Dw=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:i,platform:s,elements:o,middlewareData:c}=t,{element:l,padding:u=0}=hy(e,t)||{};if(null==l)return{};const d=Py(u),p={x:r,y:n},m=xy(a),h=vy(m),f=await s.getDimensions(l),g="y"===m,b=g?"top":"left",v=g?"bottom":"right",y=g?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[m]-p[m]-i.floating[h],x=p[m]-i.reference[m],S=await(null==s.getOffsetParent?void 0:s.getOffsetParent(l));let k=S?S[y]:0;k&&await(null==s.isElement?void 0:s.isElement(S))||(k=o.floating[y]||i.floating[h]);const E=w/2-x/2,N=k/2-f[h]/2-1,C=sy(d[b],N),A=sy(d[v],N),_=C,P=k-f[h]-A,T=k/2-f[h]/2+E,R=my(_,T,P),D=!c.arrow&&null!=gy(a)&&T!==R&&i.reference[h]/2-(T<_?C:A)-f[h]/2<0,I=D?T<_?T-_:T-P:0;return{[m]:p[m]+I,data:{[m]:R,centerOffset:T-R-I,...D&&{alignmentOffset:I}},reset:D}}}),Iw=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:i,middlewareData:s}=t,{offset:o=0,mainAxis:c=!0,crossAxis:l=!0}=hy(e,t),u={x:r,y:n},d=wy(a),p=by(d);let m=u[p],h=u[d];const f=hy(o,t),g="number"==typeof f?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+g.mainAxis,r=i.reference[p]+i.reference[e]-g.mainAxis;m<t?m=t:m>r&&(m=r)}if(l){var b,v;const e="y"===p?"width":"height",t=My.has(fy(a)),r=i.reference[d]-i.floating[e]+(t&&(null==(b=s.offset)?void 0:b[d])||0)+(t?0:g.crossAxis),n=i.reference[d]+i.reference[e]+(t?0:(null==(v=s.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);h<r?h=r:h>n&&(h=n)}return{[p]:m,[d]:h}}}},Uw=(e,t,r)=>{const n=new Map,a={platform:Ew,...r},i={...a.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:s}=r,o=i.filter(Boolean),c=await(null==s.isRTL?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:d}=Ry(l,n,c),p=n,m={},h=0;for(let r=0;r<o.length;r++){var f;const{name:i,fn:g}=o[r],{x:b,y:v,data:y,reset:w}=await g({x:u,y:d,initialPlacement:n,placement:p,strategy:a,middlewareData:m,rects:l,platform:{...s,detectOverflow:null!=(f=s.detectOverflow)?f:Dy},elements:{reference:e,floating:t}});u=null!=b?b:u,d=null!=v?v:d,m={...m,[i]:{...m[i],...y}},w&&h<=50&&(h++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(l=!0===w.rects?await s.getElementRects({reference:e,floating:t,strategy:a}):w.rects),({x:u,y:d}=Ry(l,p,c))),r=-1)}return{x:u,y:d,placement:p,strategy:a,middlewareData:m}})(e,t,{...a,platform:i})};var Mw="undefined"!=typeof document?g:function(){};function Lw(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,a;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!==n--;)if(!Lw(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;0!==n--;){const r=a[n];if(("_owner"!==r||!e.$$typeof)&&!Lw(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function Ow(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zw(e,t){const r=Ow(e);return Math.round(t*r)/r}function Fw(e){const t=n.useRef(e);return Mw(()=>{t.current=e}),t}const Bw=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&(a=r,{}.hasOwnProperty.call(a,"current"))?null!=r.current?Dw({element:r.current,padding:n}).fn(t):{}:r?Dw({element:r,padding:n}).fn(t):{};var a}}),Ww=(e,t)=>({...Aw(e),options:[e,t]}),Vw=(e,t)=>({..._w(e),options:[e,t]}),jw=(e,t)=>({...Iw(e),options:[e,t]}),Hw=(e,t)=>({...Pw(e),options:[e,t]}),Gw=(e,t)=>({...Tw(e),options:[e,t]}),$w=(e,t)=>({...Rw(e),options:[e,t]}),Kw=(e,t)=>({...Bw(e),options:[e,t]});var qw=n.forwardRef((e,r)=>{const{children:n,width:a=10,height:i=5,...s}=e;return t(ns.svg,{...s,ref:r,width:a,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:t("polygon",{points:"0,0 30,0 15,10"})})});qw.displayName="Arrow";var Zw=qw,Jw="Popper",[Yw,Xw]=$i(Jw),[Qw,ex]=Yw(Jw),tx=e=>{const{__scopePopper:r,children:a}=e,[i,s]=n.useState(null);return t(Qw,{scope:r,anchor:i,onAnchorChange:s,children:a})};tx.displayName=Jw;var rx="PopperAnchor",nx=n.forwardRef((e,r)=>{const{__scopePopper:a,virtualRef:i,...s}=e,o=ex(rx,a),c=n.useRef(null),l=Ri(r,c),u=n.useRef(null);return n.useEffect(()=>{const e=u.current;u.current=i?.current||c.current,e!==u.current&&o.onAnchorChange(u.current)}),i?null:t(ns.div,{...s,ref:l})});nx.displayName=rx;var ax="PopperContent",[ix,sx]=Yw(ax),ox=n.forwardRef((e,r)=>{const{__scopePopper:a,side:i="bottom",sideOffset:s=0,align:o="center",alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:h=!1,updatePositionStrategy:f="optimized",onPlaced:g,...b}=e,v=ex(ax,a),[w,x]=n.useState(null),S=Ri(r,e=>x(e)),[k,E]=n.useState(null),N=Gl(k),C=N?.width??0,A=N?.height??0,_=i+("center"!==o?"-"+o:""),P="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},T=Array.isArray(d)?d:[d],R=T.length>0,D={padding:P,boundary:T.filter(dx),altBoundary:R},{refs:I,floatingStyles:U,placement:M,isPositioned:L,middlewareData:O}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:a=[],platform:i,elements:{reference:s,floating:o}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,p]=n.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=n.useState(a);Lw(m,a)||h(a);const[f,g]=n.useState(null),[b,v]=n.useState(null),w=n.useCallback(e=>{e!==E.current&&(E.current=e,g(e))},[]),x=n.useCallback(e=>{e!==N.current&&(N.current=e,v(e))},[]),S=s||f,k=o||b,E=n.useRef(null),N=n.useRef(null),C=n.useRef(d),A=null!=l,_=Fw(l),P=Fw(i),T=Fw(u),R=n.useCallback(()=>{if(!E.current||!N.current)return;const e={placement:t,strategy:r,middleware:m};P.current&&(e.platform=P.current),Uw(E.current,N.current,e).then(e=>{const t={...e,isPositioned:!1!==T.current};D.current&&!Lw(C.current,t)&&(C.current=t,y.flushSync(()=>{p(t)}))})},[m,t,r,P,T]);Mw(()=>{!1===u&&C.current.isPositioned&&(C.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[u]);const D=n.useRef(!1);Mw(()=>(D.current=!0,()=>{D.current=!1}),[]),Mw(()=>{if(S&&(E.current=S),k&&(N.current=k),S&&k){if(_.current)return _.current(S,k,R);R()}},[S,k,R,_,A]);const I=n.useMemo(()=>({reference:E,floating:N,setReference:w,setFloating:x}),[w,x]),U=n.useMemo(()=>({reference:S,floating:k}),[S,k]),M=n.useMemo(()=>{const e={position:r,left:0,top:0};if(!U.floating)return e;const t=zw(U.floating,d.x),n=zw(U.floating,d.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...Ow(U.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,c,U.floating,d.x,d.y]);return n.useMemo(()=>({...d,update:R,refs:I,elements:U,floatingStyles:M}),[d,R,I,U,M])}({strategy:"fixed",placement:_,whileElementsMounted:(...e)=>Cw(...e,{animationFrame:"always"===f}),elements:{reference:v.anchor},middleware:[Ww({mainAxis:s+A,alignmentAxis:c}),u&&Vw({mainAxis:!0,crossAxis:!1,limiter:"partial"===m?jw():void 0,...D}),u&&Hw({...D}),Gw({...D,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:a,height:i}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${r}px`),s.setProperty("--radix-popper-available-height",`${n}px`),s.setProperty("--radix-popper-anchor-width",`${a}px`),s.setProperty("--radix-popper-anchor-height",`${i}px`)}}),k&&Kw({element:k,padding:l}),px({arrowWidth:C,arrowHeight:A}),h&&$w({strategy:"referenceHidden",...D})]}),[z,F]=mx(M),B=as(g);qi(()=>{L&&B?.()},[L,B]);const W=O.arrow?.x,V=O.arrow?.y,j=0!==O.arrow?.centerOffset,[H,G]=n.useState();return qi(()=>{w&&G(window.getComputedStyle(w).zIndex)},[w]),t("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:L?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[O.transformOrigin?.x,O.transformOrigin?.y].join(" "),...O.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t(ix,{scope:a,placedSide:z,onArrowChange:E,arrowX:W,arrowY:V,shouldHideArrow:j,children:t(ns.div,{"data-side":z,"data-align":F,...b,ref:S,style:{...b.style,animation:L?void 0:"none"}})})})});ox.displayName=ax;var cx="PopperArrow",lx={top:"bottom",right:"left",bottom:"top",left:"right"},ux=n.forwardRef(function(e,r){const{__scopePopper:n,...a}=e,i=sx(cx,n),s=lx[i.placedSide];return t("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:t(Zw,{...a,ref:r,style:{...a.style,display:"block"}})})});function dx(e){return null!==e}ux.displayName=cx;var px=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:a}=t,i=0!==a.arrow?.centerOffset,s=i?0:e.arrowWidth,o=i?0:e.arrowHeight,[c,l]=mx(r),u={start:"0%",center:"50%",end:"100%"}[l],d=(a.arrow?.x??0)+s/2,p=(a.arrow?.y??0)+o/2;let m="",h="";return"bottom"===c?(m=i?u:`${d}px`,h=-o+"px"):"top"===c?(m=i?u:`${d}px`,h=`${n.floating.height+o}px`):"right"===c?(m=-o+"px",h=i?u:`${p}px`):"left"===c&&(m=`${n.floating.width+o}px`,h=i?u:`${p}px`),{data:{x:m,y:h}}}});function mx(e){const[t,r="center"]=e.split("-");return[t,r]}var hx=tx,fx=nx,gx=ox,bx=ux;function vx(e){const t=n.forwardRef((e,t)=>{const{children:r,...a}=e;if(n.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),i=function(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{const t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}(a,r.props);return r.type!==n.Fragment&&(i.ref=t?Ti(t,e):e),n.cloneElement(r,i)}return n.Children.count(r)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yx=Symbol("radix.slottable");function wx(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===yx}var xx="Popover",[Sx]=$i(xx,[Xw]),kx=Xw(),[Ex,Nx]=Sx(xx),Cx=e=>{const{__scopePopover:r,children:a,open:i,defaultOpen:s,onOpenChange:o,modal:c=!1}=e,l=kx(r),u=n.useRef(null),[d,p]=n.useState(!1),[m,h]=Qi({prop:i,defaultProp:s??!1,onChange:o,caller:xx});return t(hx,{...l,children:t(Ex,{scope:r,contentId:Yi(),triggerRef:u,open:m,onOpenChange:h,onOpenToggle:n.useCallback(()=>h(e=>!e),[h]),hasCustomAnchor:d,onCustomAnchorAdd:n.useCallback(()=>p(!0),[]),onCustomAnchorRemove:n.useCallback(()=>p(!1),[]),modal:c,children:a})})};Cx.displayName=xx;var Ax="PopoverAnchor";n.forwardRef((e,r)=>{const{__scopePopover:a,...i}=e,s=Nx(Ax,a),o=kx(a),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=s;return n.useEffect(()=>(c(),()=>l()),[c,l]),t(fx,{...o,...i,ref:r})}).displayName=Ax;var _x="PopoverTrigger",Px=n.forwardRef((e,r)=>{const{__scopePopover:n,...a}=e,i=Nx(_x,n),s=kx(n),o=Ri(r,i.triggerRef),c=t(ns.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Wx(i.open),...a,ref:o,onClick:Gi(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?c:t(fx,{asChild:!0,...s,children:c})});Px.displayName=_x;var Tx="PopoverPortal",[Rx,Dx]=Sx(Tx,{forceMount:void 0}),Ix=e=>{const{__scopePopover:r,forceMount:n,children:a,container:i}=e,s=Nx(Tx,r);return t(Rx,{scope:r,forceMount:n,children:t(Es,{present:n||s.open,children:t(ks,{asChild:!0,container:i,children:a})})})};Ix.displayName=Tx;var Ux="PopoverContent",Mx=n.forwardRef((e,r)=>{const n=Dx(Ux,e.__scopePopover),{forceMount:a=n.forceMount,...i}=e,s=Nx(Ux,e.__scopePopover);return t(Es,{present:a||s.open,children:s.modal?t(Ox,{...i,ref:r}):t(zx,{...i,ref:r})})});Mx.displayName=Ux;var Lx=function(e){const r=vx(e),a=n.forwardRef((e,a)=>{const{children:i,...s}=e,o=n.Children.toArray(i),c=o.find(wx);if(c){const e=c.props.children,i=o.map(t=>t===c?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t);return t(r,{...s,ref:a,children:n.isValidElement(e)?n.cloneElement(e,void 0,i):null})}return t(r,{...s,ref:a,children:i})});return a.displayName=`${e}.Slot`,a}("PopoverContent.RemoveScroll"),Ox=n.forwardRef((e,r)=>{const a=Nx(Ux,e.__scopePopover),i=n.useRef(null),s=Ri(r,i),o=n.useRef(!1);return n.useEffect(()=>{const e=i.current;if(e)return ko(e)},[]),t(go,{as:Lx,allowPinchZoom:!0,children:t(Fx,{...e,ref:s,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Gi(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||a.triggerRef.current?.focus()}),onPointerDownOutside:Gi(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;o.current=n},{checkForDefaultPrevented:!1}),onFocusOutside:Gi(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),zx=n.forwardRef((e,r)=>{const a=Nx(Ux,e.__scopePopover),i=n.useRef(!1),s=n.useRef(!1);return t(Fx,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||a.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));const r=t.target,n=a.triggerRef.current?.contains(r);n&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})}),Fx=n.forwardRef((e,r)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...p}=e,m=Nx(Ux,n),h=kx(n);return As(),t(gs,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:s,children:t(us,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:t(gx,{"data-state":Wx(m.open),role:"dialog",id:m.contentId,...h,...p,ref:r,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Bx="PopoverClose";n.forwardRef((e,r)=>{const{__scopePopover:n,...a}=e,i=Nx(Bx,n);return t(ns.button,{type:"button",...a,ref:r,onClick:Gi(e.onClick,()=>i.onOpenChange(!1))})}).displayName=Bx;function Wx(e){return e?"open":"closed"}n.forwardRef((e,r)=>{const{__scopePopover:n,...a}=e,i=kx(n);return t(bx,{...i,...a,ref:r})}).displayName="PopoverArrow";var Vx=Ix,jx=Mx;const Hx=Cx,Gx=Px,$x=n.forwardRef(({className:e,align:r="center",sideOffset:a=4,...i},s)=>{const{container:o}=n.useContext(kc);return t(Vx,{container:o,children:t(jx,{ref:s,align:r,sideOffset:a,className:Oe("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),...i})})});function Kx({options:r,value:n,onChange:a,placeholder:i="Search...",emptyLabel:s="Choose option"}){const[o,c]=m(n??""),[l,u]=m(!1);d(()=>{void 0!==n&&c(n)},[n]);const p=r.find(e=>e.value===o);return e(Hx,{open:l,onOpenChange:u,children:[t(Gx,{asChild:!0,children:e(Hi,{variant:"outline",role:"combobox","aria-expanded":l,className:"justify-between overflow-hidden text-ellipsis",children:[p?e("div",{children:[String(p.label).trim(),p.icon&&t("span",{className:"ms-2 text-xs text-muted-foreground",children:p.icon})]}):t("span",{className:"text-muted-foreground",children:s}),t(si,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),t($x,{className:"p-0 overflow-hidden text-ellipsis",children:e(ey,{children:[t(ty,{placeholder:i}),t(ry,{children:t(ny,{children:r.map(r=>e(ay,{className:Oe("whitespace-nowrap text-start",{"text-green-500":o===r.value}),value:r.value,defaultValue:r.value,onSelect:()=>{return e=r.value,c(e),a?.(e),void u(!1);var e},children:[o===r.value&&t(ii,{className:Oe("me-2 h-4 w-4 text-green-400",o===r.value?"opacity-100":"opacity-0")}),String(r.label).trim(),r.icon&&t("span",{className:"ms-2 text-xs text-muted-foreground",children:r.icon})]},r.value))})})]})})]})}$x.displayName=jx.displayName;const qx={USD:"$",EUR:"€",JPY:"¥",GBP:"£",AUD:"A$",CAD:"C$",CHF:"CHF",CNY:"¥",SEK:"kr",NZD:"NZ$",INR:"₹",RUB:"₽",KRW:"₩",BRL:"R$",ZAR:"R",HKD:"HK$",SGD:"S$",MXN:"Mex$",NOK:"kr",TRY:"₺",IDR:"Rp",PLN:"zł",THB:"฿",ILS:"₪",PHP:"₱",MYR:"RM",CZK:"Kč",HUF:"Ft",DKK:"kr",PKR:"₨",EGP:"£",NGN:"₦",BDT:"৳",UAH:"₴",KZT:"₸",VND:"₫",ARS:"$",BGN:"лв",COP:"COL$",HRK:"kn",ISK:"kr",KES:"KSh",LKR:"Rs",MAD:"د.م.",MNT:"₮",NPR:"रू",RSD:"дин.",SAR:"ر.س",TWD:"NT$",UYU:"$U",YER:"﷼",FJD:"FJ$",JMD:"J$",HTG:"G",BHD:"ب.د",KWD:"د.ك",OMR:"ر.ع.",BND:"B$",KPW:"₩",GHS:"₵",SYP:"ل.س",SLL:"Le",SSP:"£",AFN:"؋",MGA:"Ar",MDL:"lei",FOK:"kr",GMD:"D",LTL:"Lt",LVL:"Ls",HNL:"L",GEL:"₾",BMD:"$",AWG:"Afl",BTN:"Nu",GTQ:"Q",TZS:"TSh",BBD:"Bds$",NAD:"N$",BZD:"$",JEP:"£",WST:"T",PGK:"K",KGS:"лв",AZN:"₼",QAR:"ر.ق",XOF:"CFA",XPF:"CFP"},Zx={AF:"AFN",AX:"EUR",AL:"ALL",DZ:"DZD",AS:"USD",AD:"EUR",AO:"AOA",AI:"XCD",AQ:"USD",AG:"XCD",AR:"ARS",AM:"AMD",AW:"AWG",AU:"AUD",AT:"EUR",AZ:"AZN",BS:"BSD",BH:"BHD",BD:"BDT",BB:"BBD",BY:"BYN",BE:"EUR",BZ:"BZD",BJ:"XOF",BM:"BMD",BT:"BTN",BO:"BOB",BA:"BAM",BW:"BWP",BV:"NOK",BR:"BRL",IO:"USD",BN:"BND",BG:"BGN",BF:"XOF",BI:"BIF",KH:"KHR",CM:"XAF",CA:"CAD",CV:"CVE",KY:"KYD",CF:"XAF",TD:"XAF",CL:"CLP",CN:"CNY",CX:"AUD",CC:"AUD",CO:"COP",KM:"KMF",CG:"XAF",CD:"CDF",CK:"NZD",CR:"CRC",CI:"XOF",HR:"HRK",CU:"CUP",CY:"EUR",CZ:"CZK",DK:"DKK",DJ:"DJF",DM:"XCD",DO:"DOP",EC:"USD",EG:"EGP",SV:"USD",GQ:"XAF",ER:"ERN",EE:"EUR",ET:"ETB",FK:"FKP",FO:"DKK",FJ:"FJD",FI:"EUR",FR:"EUR",GF:"EUR",PF:"XPF",TF:"EUR",GA:"XAF",GM:"GMD",GE:"GEL",DE:"EUR",GH:"GHS",GI:"GIP",GR:"EUR",GL:"DKK",GD:"XCD",GP:"EUR",GU:"USD",GT:"GTQ",GG:"GBP",GN:"GNF",GW:"XOF",GY:"GYD",HT:"HTG",HM:"AUD",VA:"EUR",HN:"HNL",HK:"HKD",HU:"HUF",IS:"ISK",IN:"INR",ID:"IDR",IR:"IRR",IQ:"IQD",IE:"EUR",IM:"GBP",IL:"ILS",IT:"EUR",JM:"JMD",JP:"JPY",JE:"GBP",JO:"JOD",KZ:"KZT",KE:"KES",KI:"AUD",KP:"KPW",KR:"KRW",KW:"KWD",KG:"KGS",LA:"LAK",LV:"EUR",LB:"LBP",LS:"LSL",LR:"LRD",LY:"LYD",LI:"CHF",LT:"EUR",LU:"EUR",MO:"MOP",MK:"MKD",MG:"MGA",MW:"MWK",MY:"MYR",MV:"MVR",ML:"XOF",MT:"EUR",MH:"USD",MQ:"EUR",MR:"MRU",MU:"MUR",YT:"EUR",MX:"MXN",FM:"USD",MD:"MDL",MC:"EUR",MN:"MNT",ME:"EUR",MS:"XCD",MA:"MAD",MZ:"MZN",MM:"MMK",NA:"NAD",NR:"AUD",NP:"NPR",NL:"EUR",AN:"ANG",NC:"XPF",NZ:"NZD",NI:"NIO",NE:"XOF",NG:"NGN",NU:"NZD",NF:"AUD",MP:"USD",NO:"NOK",OM:"OMR",PK:"PKR",PW:"USD",PS:"ILS",PA:"PAB",PG:"PGK",PY:"PYG",PE:"PEN",PH:"PHP",PN:"NZD",PL:"PLN",PT:"EUR",PR:"USD",QA:"QAR",RE:"EUR",RO:"RON",RU:"RUB",RW:"RWF",SH:"SHP",KN:"XCD",LC:"XCD",PM:"EUR",VC:"XCD",WS:"WST",SM:"EUR",ST:"STN",SA:"SAR",SN:"XOF",RS:"RSD",SC:"SCR",SL:"SLL",SG:"SGD",SK:"EUR",SI:"EUR",SB:"SBD",SO:"SOS",ZA:"ZAR",GS:"GBP",ES:"EUR",LK:"LKR",SD:"SDG",SR:"SRD",SJ:"NOK",SZ:"SZL",SE:"SEK",CH:"CHF",SY:"SYP",TW:"TWD",TJ:"TJS",TZ:"TZS",TH:"THB"},Jx=[{name:"Afghanistan",code:"AF"},{name:"land Islands",code:"AX"},{name:"Albania",code:"AL"},{name:"Algeria",code:"DZ"},{name:"American Samoa",code:"AS"},{name:"AndorrA",code:"AD"},{name:"Angola",code:"AO"},{name:"Anguilla",code:"AI"},{name:"Antarctica",code:"AQ"},{name:"Antigua and Barbuda",code:"AG"},{name:"Argentina",code:"AR"},{name:"Armenia",code:"AM"},{name:"Aruba",code:"AW"},{name:"Australia",code:"AU"},{name:"Austria",code:"AT"},{name:"Azerbaijan",code:"AZ"},{name:"Bahamas",code:"BS"},{name:"Bahrain",code:"BH"},{name:"Bangladesh",code:"BD"},{name:"Barbados",code:"BB"},{name:"Belarus",code:"BY"},{name:"Belgium",code:"BE"},{name:"Belize",code:"BZ"},{name:"Benin",code:"BJ"},{name:"Bermuda",code:"BM"},{name:"Bhutan",code:"BT"},{name:"Bolivia",code:"BO"},{name:"Bosnia and Herzegovina",code:"BA"},{name:"Botswana",code:"BW"},{name:"Bouvet Island",code:"BV"},{name:"Brazil",code:"BR"},{name:"British Indian Ocean Territory",code:"IO"},{name:"Brunei Darussalam",code:"BN"},{name:"Bulgaria",code:"BG"},{name:"Burkina Faso",code:"BF"},{name:"Burundi",code:"BI"},{name:"Cambodia",code:"KH"},{name:"Cameroon",code:"CM"},{name:"Canada",code:"CA"},{name:"Cape Verde",code:"CV"},{name:"Cayman Islands",code:"KY"},{name:"Central African Republic",code:"CF"},{name:"Chad",code:"TD"},{name:"Chile",code:"CL"},{name:"China",code:"CN"},{name:"Christmas Island",code:"CX"},{name:"Cocos (Keeling) Islands",code:"CC"},{name:"Colombia",code:"CO"},{name:"Comoros",code:"KM"},{name:"Congo",code:"CG"},{name:"Congo, The Democratic Republic of the",code:"CD"},{name:"Cook Islands",code:"CK"},{name:"Costa Rica",code:"CR"},{name:"Cote D Ivoire",code:"CI"},{name:"Croatia",code:"HR"},{name:"Cuba",code:"CU"},{name:"Cyprus",code:"CY"},{name:"Czech Republic",code:"CZ"},{name:"Denmark",code:"DK"},{name:"Djibouti",code:"DJ"},{name:"Dominica",code:"DM"},{name:"Dominican Republic",code:"DO"},{name:"Ecuador",code:"EC"},{name:"Egypt",code:"EG"},{name:"El Salvador",code:"SV"},{name:"Equatorial Guinea",code:"GQ"},{name:"Eritrea",code:"ER"},{name:"Estonia",code:"EE"},{name:"Ethiopia",code:"ET"},{name:"Falkland Islands (Malvinas)",code:"FK"},{name:"Faroe Islands",code:"FO"},{name:"Fiji",code:"FJ"},{name:"Finland",code:"FI"},{name:"France",code:"FR"},{name:"French Guiana",code:"GF"},{name:"French Polynesia",code:"PF"},{name:"French Southern Territories",code:"TF"},{name:"Gabon",code:"GA"},{name:"Gambia",code:"GM"},{name:"Georgia",code:"GE"},{name:"Germany",code:"DE"},{name:"Ghana",code:"GH"},{name:"Gibraltar",code:"GI"},{name:"Greece",code:"GR"},{name:"Greenland",code:"GL"},{name:"Grenada",code:"GD"},{name:"Guadeloupe",code:"GP"},{name:"Guam",code:"GU"},{name:"Guatemala",code:"GT"},{name:"Guernsey",code:"GG"},{name:"Guinea",code:"GN"},{name:"Guinea-Bissau",code:"GW"},{name:"Guyana",code:"GY"},{name:"Haiti",code:"HT"},{name:"Heard Island and Mcdonald Islands",code:"HM"},{name:"Holy See (Vatican City State)",code:"VA"},{name:"Honduras",code:"HN"},{name:"Hong Kong",code:"HK"},{name:"Hungary",code:"HU"},{name:"Iceland",code:"IS"},{name:"India",code:"IN"},{name:"Indonesia",code:"ID"},{name:"Iran, Islamic Republic Of",code:"IR"},{name:"Iraq",code:"IQ"},{name:"Ireland",code:"IE"},{name:"Isle of Man",code:"IM"},{name:"Israel",code:"IL"},{name:"Italy",code:"IT"},{name:"Jamaica",code:"JM"},{name:"Japan",code:"JP"},{name:"Jersey",code:"JE"},{name:"Jordan",code:"JO"},{name:"Kazakhstan",code:"KZ"},{name:"Kenya",code:"KE"},{name:"Kiribati",code:"KI"},{name:'Korea, Democratic People"S Republic of',code:"KP"},{name:"Korea, Republic of",code:"KR"},{name:"Kuwait",code:"KW"},{name:"Kyrgyzstan",code:"KG"},{name:'Lao People"S Democratic Republic',code:"LA"},{name:"Latvia",code:"LV"},{name:"Lebanon",code:"LB"},{name:"Lesotho",code:"LS"},{name:"Liberia",code:"LR"},{name:"Libyan Arab Jamahiriya",code:"LY"},{name:"Liechtenstein",code:"LI"},{name:"Lithuania",code:"LT"},{name:"Luxembourg",code:"LU"},{name:"Macao",code:"MO"},{name:"Macedonia, The Former Yugoslav Republic of",code:"MK"},{name:"Madagascar",code:"MG"},{name:"Malawi",code:"MW"},{name:"Malaysia",code:"MY"},{name:"Maldives",code:"MV"},{name:"Mali",code:"ML"},{name:"Malta",code:"MT"},{name:"Marshall Islands",code:"MH"},{name:"Martinique",code:"MQ"},{name:"Mauritania",code:"MR"},{name:"Mauritius",code:"MU"},{name:"Mayotte",code:"YT"},{name:"Mexico",code:"MX"},{name:"Micronesia, Federated States of",code:"FM"},{name:"Moldova, Republic of",code:"MD"},{name:"Monaco",code:"MC"},{name:"Mongolia",code:"MN"},{name:"Montenegro",code:"ME"},{name:"Montserrat",code:"MS"},{name:"Morocco",code:"MA"},{name:"Mozambique",code:"MZ"},{name:"Myanmar",code:"MM"},{name:"Namibia",code:"NA"},{name:"Nauru",code:"NR"},{name:"Nepal",code:"NP"},{name:"Netherlands",code:"NL"},{name:"Netherlands Antilles",code:"AN"},{name:"New Caledonia",code:"NC"},{name:"New Zealand",code:"NZ"},{name:"Nicaragua",code:"NI"},{name:"Niger",code:"NE"},{name:"Nigeria",code:"NG"},{name:"Niue",code:"NU"},{name:"Norfolk Island",code:"NF"},{name:"Northern Mariana Islands",code:"MP"},{name:"Norway",code:"NO"},{name:"Oman",code:"OM"},{name:"Pakistan",code:"PK"},{name:"Palau",code:"PW"},{name:"Palestinian Territory, Occupied",code:"PS"},{name:"Panama",code:"PA"},{name:"Papua New Guinea",code:"PG"},{name:"Paraguay",code:"PY"},{name:"Peru",code:"PE"},{name:"Philippines",code:"PH"},{name:"Pitcairn",code:"PN"},{name:"Poland",code:"PL"},{name:"Portugal",code:"PT"},{name:"Puerto Rico",code:"PR"},{name:"Qatar",code:"QA"},{name:"Reunion",code:"RE"},{name:"Romania",code:"RO"},{name:"Russian Federation",code:"RU"},{name:"RWANDA",code:"RW"},{name:"Saint Helena",code:"SH"},{name:"Saint Kitts and Nevis",code:"KN"},{name:"Saint Lucia",code:"LC"},{name:"Saint Pierre and Miquelon",code:"PM"},{name:"Saint Vincent and the Grenadines",code:"VC"},{name:"Samoa",code:"WS"},{name:"San Marino",code:"SM"},{name:"Sao Tome and Principe",code:"ST"},{name:"Saudi Arabia",code:"SA"},{name:"Senegal",code:"SN"},{name:"Serbia",code:"RS"},{name:"Seychelles",code:"SC"},{name:"Sierra Leone",code:"SL"},{name:"Singapore",code:"SG"},{name:"Slovakia",code:"SK"},{name:"Slovenia",code:"SI"},{name:"Solomon Islands",code:"SB"},{name:"Somalia",code:"SO"},{name:"South Africa",code:"ZA"},{name:"South Georgia and the South Sandwich Islands",code:"GS"},{name:"Spain",code:"ES"},{name:"Sri Lanka",code:"LK"},{name:"Sudan",code:"SD"},{name:"Suriname",code:"SR"},{name:"Svalbard and Jan Mayen",code:"SJ"},{name:"Swaziland",code:"SZ"},{name:"Sweden",code:"SE"},{name:"Switzerland",code:"CH"},{name:"Syrian Arab Republic",code:"SY"},{name:"Taiwan, Province of China",code:"TW"},{name:"Tajikistan",code:"TJ"},{name:"Tanzania, United Republic of",code:"TZ"},{name:"Thailand",code:"TH"},{name:"Timor-Leste",code:"TL"},{name:"Togo",code:"TG"},{name:"Tokelau",code:"TK"},{name:"Tonga",code:"TO"},{name:"Trinidad and Tobago",code:"TT"},{name:"Tunisia",code:"TN"},{name:"Turkey",code:"TR"},{name:"Turkmenistan",code:"TM"},{name:"Turks and Caicos Islands",code:"TC"},{name:"Tuvalu",code:"TV"},{name:"Uganda",code:"UG"},{name:"Ukraine",code:"UA"},{name:"United Arab Emirates",code:"AE"},{name:"United Kingdom",code:"GB"},{name:"United States",code:"US"},{name:"United States Minor Outlying Islands",code:"UM"},{name:"Uruguay",code:"UY"},{name:"Uzbekistan",code:"UZ"},{name:"Vanuatu",code:"VU"},{name:"Venezuela",code:"VE"},{name:"Viet Nam",code:"VN"},{name:"Virgin Islands, British",code:"VG"},{name:"Virgin Islands, U.S.",code:"VI"},{name:"Wallis and Futuna",code:"WF"},{name:"Western Sahara",code:"EH"},{name:"Yemen",code:"YE"},{name:"Zambia",code:"ZM"},{name:"Zimbabwe",code:"ZW"}].map(e=>{const t=Zx[e.code]||"USD",r=qx[t]||"";return{value:e.code,flag:(n=e.code,n.toUpperCase().replace(/./g,e=>String.fromCodePoint(127397+e.charCodeAt(0)))),text:e.name,currencyCode:t,currencyIcon:r};var n});function Yx({value:e,onChange:r}){const{t:n}=xn(),a=Jx.map(e=>({value:e.value,label:e.text,icon:e.flag}));return t(Kx,{options:a,value:e,onChange:r,placeholder:n("dropdowns.searchCountry"),emptyLabel:n("dropdowns.chooseCountry")})}const Xx=Jx.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),Qx=Array.from(new Set(Xx.map(e=>e.value))).map(e=>Xx.find(t=>t.value===e)).filter(e=>void 0!==e);function eS({value:e,onChange:r}){const{t:n}=xn(),a=Qx.map(e=>({value:e.value,label:e.text,icon:e.icon??void 0}));return t(Kx,{options:a,value:e,onChange:r,placeholder:n("dropdowns.searchCurrency"),emptyLabel:n("dropdowns.chooseCurrency")})}let tS=[{code:"en",label:"English",flag:"🇬🇧"},{code:"en-GB",label:"English (United Kingdom)",flag:"🇬🇧"},{code:"en-US",label:"English (United States)",flag:"🇺🇸"},{code:"en-AU",label:"English (Australia)",flag:"🇦🇺"},{code:"en-CA",label:"English (Canada)",flag:"🇨🇦"},{code:"en-NZ",label:"English (New Zealand)",flag:"🇳🇿"},{code:"es",label:"Spanish",flag:"🇪🇸"},{code:"es-ES",label:"Spanish (Spain)",flag:"🇪🇸"},{code:"es-MX",label:"Spanish (Mexico)",flag:"🇲🇽"},{code:"fr",label:"French",flag:"🇫🇷"},{code:"fr-FR",label:"French (France)",flag:"🇫🇷"},{code:"de",label:"German",flag:"🇩🇪"},{code:"de-DE",label:"German (Germany)",flag:"🇩🇪"},{code:"it",label:"Italian",flag:"🇮🇹"},{code:"it-IT",label:"Italian (Italy)",flag:"🇮🇹"},{code:"pt",label:"Portuguese",flag:"🇵🇹"},{code:"pt-PT",label:"Portuguese (Portugal)",flag:"🇵🇹"},{code:"pt-BR",label:"Portuguese (Brazil)",flag:"🇧🇷"},{code:"ru",label:"Russian",flag:"🇷🇺"},{code:"ru-RU",label:"Russian (Russia)",flag:"🇷🇺"},{code:"zh",label:"Chinese",flag:"🇨🇳"},{code:"zh-CN",label:"Chinese (Simplified)",flag:"🇨🇳"},{code:"zh-TW",label:"Chinese (Traditional)",flag:"🇹🇼"},{code:"ja",label:"Japanese",flag:"🇯🇵"},{code:"ja-JP",label:"Japanese (Japan)",flag:"🇯🇵"},{code:"ko",label:"Korean",flag:"🇰🇷"},{code:"ko-KR",label:"Korean (South Korea)",flag:"🇰🇷"},{code:"ar",label:"Arabic",flag:"🇸🇦"},{code:"ar-SA",label:"Arabic (Saudi Arabia)",flag:"🇸🇦"},{code:"hi",label:"Hindi",flag:"🇮🇳"},{code:"hi-IN",label:"Hindi (India)",flag:"🇮🇳"},{code:"bn",label:"Bengali",flag:"🇮🇳"},{code:"bn-IN",label:"Bengali (India)",flag:"🇮🇳"},{code:"gu",label:"Gujarati",flag:"🇮🇳"},{code:"gu-IN",label:"Gujarati (India)",flag:"🇮🇳"},{code:"ta",label:"Tamil",flag:"🇮🇳"},{code:"ta-IN",label:"Tamil (India)",flag:"🇮🇳"},{code:"te",label:"Telugu",flag:"🇮🇳"},{code:"te-IN",label:"Telugu (India)",flag:"🇮🇳"},{code:"ml",label:"Malayalam",flag:"🇮🇳"},{code:"ml-IN",label:"Malayalam (India)",flag:"🇮🇳"},{code:"kn",label:"Kannada",flag:"🇮🇳"},{code:"kn-IN",label:"Kannada (India)",flag:"🇮🇳"},{code:"mr",label:"Marathi",flag:"🇮🇳"},{code:"mr-IN",label:"Marathi (India)",flag:"🇮🇳"},{code:"pa",label:"Punjabi",flag:"🇮🇳"},{code:"pa-IN",label:"Punjabi (India)",flag:"🇮🇳"},{code:"ur",label:"Urdu",flag:"🇮🇳"},{code:"ur-IN",label:"Urdu (India)",flag:"🇮🇳"},{code:"or",label:"Odia",flag:"🇮🇳"},{code:"or-IN",label:"Odia (India)",flag:"🇮🇳"},{code:"as",label:"Assamese",flag:"🇮🇳"},{code:"as-IN",label:"Assamese (India)",flag:"🇮🇳"},{code:"zh-HK",label:"Chinese (Hong Kong)",flag:"🇭🇰"},{code:"nl",label:"Dutch",flag:"🇳🇱"},{code:"nl-NL",label:"Dutch (Netherlands)",flag:"🇳🇱"},{code:"pl",label:"Polish",flag:"🇵🇱"},{code:"pl-PL",label:"Polish (Poland)",flag:"🇵🇱"},{code:"sv",label:"Swedish",flag:"🇸🇪"},{code:"sv-SE",label:"Swedish (Sweden)",flag:"🇸🇪"},{code:"da",label:"Danish",flag:"🇩🇰"},{code:"da-DK",label:"Danish (Denmark)",flag:"🇩🇰"},{code:"no",label:"Norwegian",flag:"🇳🇴"},{code:"no-NO",label:"Norwegian (Norway)",flag:"🇳🇴"},{code:"fi",label:"Finnish",flag:"🇫🇮"},{code:"fi-FI",label:"Finnish (Finland)",flag:"🇫🇮"},{code:"tr",label:"Turkish",flag:"🇹🇷"},{code:"tr-TR",label:"Turkish (Turkey)",flag:"🇹🇷"},{code:"cs",label:"Czech",flag:"🇨🇿"},{code:"cs-CZ",label:"Czech (Czech Republic)",flag:"🇨🇿"},{code:"sk",label:"Slovak",flag:"🇸🇰"},{code:"sk-SK",label:"Slovak (Slovakia)",flag:"🇸🇰"},{code:"hu",label:"Hungarian",flag:"🇭🇺"},{code:"hu-HU",label:"Hungarian (Hungary)",flag:"🇭🇺"},{code:"ro",label:"Romanian",flag:"🇷🇴"},{code:"ro-RO",label:"Romanian (Romania)",flag:"🇷🇴"},{code:"el",label:"Greek",flag:"🇬🇷"},{code:"el-GR",label:"Greek (Greece)",flag:"🇬🇷"},{code:"th",label:"Thai",flag:"🇹🇭"},{code:"th-TH",label:"Thai (Thailand)",flag:"🇹🇭"},{code:"id",label:"Indonesian",flag:"🇮🇩"},{code:"id-ID",label:"Indonesian (Indonesia)",flag:"🇮🇩"},{code:"ms",label:"Malay",flag:"🇲🇾"},{code:"ms-MY",label:"Malay (Malaysia)",flag:"🇲🇾"},{code:"vi",label:"Vietnamese",flag:"🇻🇳"},{code:"vi-VN",label:"Vietnamese (Vietnam)",flag:"🇻🇳"},{code:"he",label:"Hebrew",flag:"🇮🇱"},{code:"he-IL",label:"Hebrew (Israel)",flag:"🇮🇱"}];tS=tS.filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)),tS.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const rS=tS.filter(e=>function(e){try{const t=new Intl.DateTimeFormat(e);return t.resolvedOptions().locale===e||t.resolvedOptions().locale.startsWith(e)}catch{return!1}}(e.code)).filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)).map(e=>({value:e.code,label:e.label,flag:e.flag}));function nS({value:e,onChange:r}){const{t:n}=xn(),a=rS.map(e=>({value:e.value,label:e.label,icon:e.flag}));return t(Kx,{options:a,value:e,onChange:r,placeholder:n("dropdowns.searchLanguage"),emptyLabel:n("dropdowns.chooseLanguage")})}const aS=[{value:"Dateline Standard Time",abbr:"DST",offset:-12,isdst:!1,text:"(UTC-12:00) International Date Line West",utc:["Etc/GMT+12"]},{value:"UTC-11",abbr:"U",offset:-11,isdst:!1,text:"(UTC-11:00) Coordinated Universal Time-11",utc:["Etc/GMT+11","Pacific/Midway","Pacific/Niue","Pacific/Pago_Pago"]},{value:"Hawaiian Standard Time",abbr:"HST",offset:-10,isdst:!1,text:"(UTC-10:00) Hawaii",utc:["Etc/GMT+10","Pacific/Honolulu","Pacific/Johnston","Pacific/Rarotonga","Pacific/Tahiti"]},{value:"Alaskan Standard Time",abbr:"AKDT",offset:-8,isdst:!0,text:"(UTC-09:00) Alaska",utc:["America/Anchorage","America/Juneau","America/Nome","America/Sitka","America/Yakutat"]},{value:"Pacific Standard Time (Mexico)",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-08:00) Baja California",utc:["America/Santa_Isabel"]},{value:"Pacific Daylight Time",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-07:00) Pacific Daylight Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver"]},{value:"Pacific Standard Time",abbr:"PST",offset:-8,isdst:!1,text:"(UTC-08:00) Pacific Standard Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver","PST8PDT"]},{value:"US Mountain Standard Time",abbr:"UMST",offset:-7,isdst:!1,text:"(UTC-07:00) Arizona",utc:["America/Creston","America/Dawson","America/Dawson_Creek","America/Hermosillo","America/Phoenix","America/Whitehorse","Etc/GMT+7"]},{value:"Mountain Standard Time (Mexico)",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Chihuahua, La Paz, Mazatlan",utc:["America/Chihuahua","America/Mazatlan"]},{value:"Mountain Standard Time",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Mountain Time (US & Canada)",utc:["America/Boise","America/Cambridge_Bay","America/Denver","America/Edmonton","America/Inuvik","America/Ojinaga","America/Yellowknife","MST7MDT"]},{value:"Central America Standard Time",abbr:"CAST",offset:-6,isdst:!1,text:"(UTC-06:00) Central America",utc:["America/Belize","America/Costa_Rica","America/El_Salvador","America/Guatemala","America/Managua","America/Tegucigalpa","Etc/GMT+6","Pacific/Galapagos"]},{value:"Central Standard Time",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Central Time (US & Canada)",utc:["America/Chicago","America/Indiana/Knox","America/Indiana/Tell_City","America/Matamoros","America/Menominee","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Rainy_River","America/Rankin_Inlet","America/Resolute","America/Winnipeg","CST6CDT"]},{value:"Central Standard Time (Mexico)",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Guadalajara, Mexico City, Monterrey",utc:["America/Bahia_Banderas","America/Cancun","America/Merida","America/Mexico_City","America/Monterrey"]},{value:"Canada Central Standard Time",abbr:"CCST",offset:-6,isdst:!1,text:"(UTC-06:00) Saskatchewan",utc:["America/Regina","America/Swift_Current"]},{value:"SA Pacific Standard Time",abbr:"SPST",offset:-5,isdst:!1,text:"(UTC-05:00) Bogota, Lima, Quito",utc:["America/Bogota","America/Cayman","America/Coral_Harbour","America/Eirunepe","America/Guayaquil","America/Jamaica","America/Lima","America/Panama","America/Rio_Branco","Etc/GMT+5"]},{value:"Eastern Standard Time",abbr:"EST",offset:-5,isdst:!1,text:"(UTC-05:00) Eastern Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"Eastern Daylight Time",abbr:"EDT",offset:-4,isdst:!0,text:"(UTC-04:00) Eastern Daylight Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"US Eastern Standard Time",abbr:"UEDT",offset:-5,isdst:!1,text:"(UTC-05:00) Indiana (East)",utc:["America/Indiana/Marengo","America/Indiana/Vevay","America/Indianapolis"]},{value:"Venezuela Standard Time",abbr:"VST",offset:-4.5,isdst:!1,text:"(UTC-04:30) Caracas",utc:["America/Caracas"]},{value:"Paraguay Standard Time",abbr:"PYT",offset:-4,isdst:!1,text:"(UTC-04:00) Asuncion",utc:["America/Asuncion"]},{value:"Atlantic Standard Time",abbr:"ADT",offset:-3,isdst:!0,text:"(UTC-04:00) Atlantic Time (Canada)",utc:["America/Glace_Bay","America/Goose_Bay","America/Halifax","America/Moncton","America/Thule","Atlantic/Bermuda"]},{value:"Central Brazilian Standard Time",abbr:"CBST",offset:-4,isdst:!1,text:"(UTC-04:00) Cuiaba",utc:["America/Campo_Grande","America/Cuiaba"]},{value:"SA Western Standard Time",abbr:"SWST",offset:-4,isdst:!1,text:"(UTC-04:00) Georgetown, La Paz, Manaus, San Juan",utc:["America/Anguilla","America/Antigua","America/Aruba","America/Barbados","America/Blanc-Sablon","America/Boa_Vista","America/Curacao","America/Dominica","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guyana","America/Kralendijk","America/La_Paz","America/Lower_Princes","America/Manaus","America/Marigot","America/Martinique","America/Montserrat","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Santo_Domingo","America/St_Barthelemy","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Tortola","Etc/GMT+4"]},{value:"Pacific SA Standard Time",abbr:"PSST",offset:-4,isdst:!1,text:"(UTC-04:00) Santiago",utc:["America/Santiago","Antarctica/Palmer"]},{value:"Newfoundland Standard Time",abbr:"NDT",offset:-2.5,isdst:!0,text:"(UTC-03:30) Newfoundland",utc:["America/St_Johns"]},{value:"E. South America Standard Time",abbr:"ESAST",offset:-3,isdst:!1,text:"(UTC-03:00) Brasilia",utc:["America/Sao_Paulo"]},{value:"Argentina Standard Time",abbr:"AST",offset:-3,isdst:!1,text:"(UTC-03:00) Buenos Aires",utc:["America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Buenos_Aires","America/Catamarca","America/Cordoba","America/Jujuy","America/Mendoza"]},{value:"SA Eastern Standard Time",abbr:"SEST",offset:-3,isdst:!1,text:"(UTC-03:00) Cayenne, Fortaleza",utc:["America/Araguaina","America/Belem","America/Cayenne","America/Fortaleza","America/Maceio","America/Paramaribo","America/Recife","America/Santarem","Antarctica/Rothera","Atlantic/Stanley","Etc/GMT+3"]},{value:"Greenland Standard Time",abbr:"GDT",offset:-3,isdst:!0,text:"(UTC-03:00) Greenland",utc:["America/Godthab"]},{value:"Montevideo Standard Time",abbr:"MST",offset:-3,isdst:!1,text:"(UTC-03:00) Montevideo",utc:["America/Montevideo"]},{value:"Bahia Standard Time",abbr:"BST",offset:-3,isdst:!1,text:"(UTC-03:00) Salvador",utc:["America/Bahia"]},{value:"UTC-02",abbr:"U",offset:-2,isdst:!1,text:"(UTC-02:00) Coordinated Universal Time-02",utc:["America/Noronha","Atlantic/South_Georgia","Etc/GMT+2"]},{value:"Mid-Atlantic Standard Time",abbr:"MDT",offset:-1,isdst:!0,text:"(UTC-02:00) Mid-Atlantic - Old",utc:[]},{value:"Azores Standard Time",abbr:"ADT",offset:0,isdst:!0,text:"(UTC-01:00) Azores",utc:["America/Scoresbysund","Atlantic/Azores"]},{value:"Cape Verde Standard Time",abbr:"CVST",offset:-1,isdst:!1,text:"(UTC-01:00) Cape Verde Is.",utc:["Atlantic/Cape_Verde","Etc/GMT+1"]},{value:"Morocco Standard Time",abbr:"MDT",offset:1,isdst:!0,text:"(UTC) Casablanca",utc:["Africa/Casablanca","Africa/El_Aaiun"]},{value:"UTC",abbr:"UTC",offset:0,isdst:!1,text:"(UTC) Coordinated Universal Time",utc:["America/Danmarkshavn","Etc/GMT"]},{value:"GMT Standard Time",abbr:"GMT",offset:0,isdst:!1,text:"(UTC) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"British Summer Time",abbr:"BST",offset:1,isdst:!0,text:"(UTC+01:00) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"GMT Standard Time",abbr:"GDT",offset:1,isdst:!0,text:"(UTC) Dublin, Lisbon",utc:["Atlantic/Canary","Atlantic/Faeroe","Atlantic/Madeira","Europe/Dublin","Europe/Lisbon"]},{value:"Greenwich Standard Time",abbr:"GST",offset:0,isdst:!1,text:"(UTC) Monrovia, Reykjavik",utc:["Africa/Abidjan","Africa/Accra","Africa/Bamako","Africa/Banjul","Africa/Bissau","Africa/Conakry","Africa/Dakar","Africa/Freetown","Africa/Lome","Africa/Monrovia","Africa/Nouakchott","Africa/Ouagadougou","Africa/Sao_Tome","Atlantic/Reykjavik","Atlantic/St_Helena"]},{value:"W. Europe Standard Time",abbr:"WEDT",offset:2,isdst:!0,text:"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",utc:["Arctic/Longyearbyen","Europe/Amsterdam","Europe/Andorra","Europe/Berlin","Europe/Busingen","Europe/Gibraltar","Europe/Luxembourg","Europe/Malta","Europe/Monaco","Europe/Oslo","Europe/Rome","Europe/San_Marino","Europe/Stockholm","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Zurich"]},{value:"Central Europe Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",utc:["Europe/Belgrade","Europe/Bratislava","Europe/Budapest","Europe/Ljubljana","Europe/Podgorica","Europe/Prague","Europe/Tirane"]},{value:"Romance Standard Time",abbr:"RDT",offset:2,isdst:!0,text:"(UTC+01:00) Brussels, Copenhagen, Madrid, Paris",utc:["Africa/Ceuta","Europe/Brussels","Europe/Copenhagen","Europe/Madrid","Europe/Paris"]},{value:"Central European Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb",utc:["Europe/Sarajevo","Europe/Skopje","Europe/Warsaw","Europe/Zagreb"]},{value:"W. Central Africa Standard Time",abbr:"WCAST",offset:1,isdst:!1,text:"(UTC+01:00) West Central Africa",utc:["Africa/Algiers","Africa/Bangui","Africa/Brazzaville","Africa/Douala","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Luanda","Africa/Malabo","Africa/Ndjamena","Africa/Niamey","Africa/Porto-Novo","Africa/Tunis","Etc/GMT-1"]},{value:"Namibia Standard Time",abbr:"NST",offset:1,isdst:!1,text:"(UTC+01:00) Windhoek",utc:["Africa/Windhoek"]},{value:"GTB Standard Time",abbr:"GDT",offset:3,isdst:!0,text:"(UTC+02:00) Athens, Bucharest",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau"]},{value:"Middle East Standard Time",abbr:"MEDT",offset:3,isdst:!0,text:"(UTC+02:00) Beirut",utc:["Asia/Beirut"]},{value:"Egypt Standard Time",abbr:"EST",offset:2,isdst:!1,text:"(UTC+02:00) Cairo",utc:["Africa/Cairo"]},{value:"Syria Standard Time",abbr:"SDT",offset:3,isdst:!0,text:"(UTC+02:00) Damascus",utc:["Asia/Damascus"]},{value:"E. Europe Standard Time",abbr:"EEDT",offset:3,isdst:!0,text:"(UTC+02:00) E. Europe",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau","Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Nicosia","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"South Africa Standard Time",abbr:"SAST",offset:2,isdst:!1,text:"(UTC+02:00) Harare, Pretoria",utc:["Africa/Blantyre","Africa/Bujumbura","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Kigali","Africa/Lubumbashi","Africa/Lusaka","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Etc/GMT-2"]},{value:"FLE Standard Time",abbr:"FDT",offset:3,isdst:!0,text:"(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",utc:["Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"Turkey Standard Time",abbr:"TDT",offset:3,isdst:!1,text:"(UTC+03:00) Istanbul",utc:["Europe/Istanbul"]},{value:"Israel Standard Time",abbr:"JDT",offset:3,isdst:!0,text:"(UTC+02:00) Jerusalem",utc:["Asia/Jerusalem"]},{value:"Libya Standard Time",abbr:"LST",offset:2,isdst:!1,text:"(UTC+02:00) Tripoli",utc:["Africa/Tripoli"]},{value:"Jordan Standard Time",abbr:"JST",offset:3,isdst:!1,text:"(UTC+03:00) Amman",utc:["Asia/Amman"]},{value:"Arabic Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Baghdad",utc:["Asia/Baghdad"]},{value:"Kaliningrad Standard Time",abbr:"KST",offset:3,isdst:!1,text:"(UTC+02:00) Kaliningrad",utc:["Europe/Kaliningrad"]},{value:"Arab Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Kuwait, Riyadh",utc:["Asia/Aden","Asia/Bahrain","Asia/Kuwait","Asia/Qatar","Asia/Riyadh"]},{value:"E. Africa Standard Time",abbr:"EAST",offset:3,isdst:!1,text:"(UTC+03:00) Nairobi",utc:["Africa/Addis_Ababa","Africa/Asmera","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Mogadishu","Africa/Nairobi","Antarctica/Syowa","Etc/GMT-3","Indian/Antananarivo","Indian/Comoro","Indian/Mayotte"]},{value:"Moscow Standard Time",abbr:"MSK",offset:3,isdst:!1,text:"(UTC+03:00) Moscow, St. Petersburg, Volgograd, Minsk",utc:["Europe/Kirov","Europe/Moscow","Europe/Simferopol","Europe/Volgograd","Europe/Minsk"]},{value:"Samara Time",abbr:"SAMT",offset:4,isdst:!1,text:"(UTC+04:00) Samara, Ulyanovsk, Saratov",utc:["Europe/Astrakhan","Europe/Samara","Europe/Ulyanovsk"]},{value:"Iran Standard Time",abbr:"IDT",offset:4.5,isdst:!0,text:"(UTC+03:30) Tehran",utc:["Asia/Tehran"]},{value:"Arabian Standard Time",abbr:"AST",offset:4,isdst:!1,text:"(UTC+04:00) Abu Dhabi, Muscat",utc:["Asia/Dubai","Asia/Muscat","Etc/GMT-4"]},{value:"Azerbaijan Standard Time",abbr:"ADT",offset:5,isdst:!0,text:"(UTC+04:00) Baku",utc:["Asia/Baku"]},{value:"Mauritius Standard Time",abbr:"MST",offset:4,isdst:!1,text:"(UTC+04:00) Port Louis",utc:["Indian/Mahe","Indian/Mauritius","Indian/Reunion"]},{value:"Georgian Standard Time",abbr:"GET",offset:4,isdst:!1,text:"(UTC+04:00) Tbilisi",utc:["Asia/Tbilisi"]},{value:"Caucasus Standard Time",abbr:"CST",offset:4,isdst:!1,text:"(UTC+04:00) Yerevan",utc:["Asia/Yerevan"]},{value:"Afghanistan Standard Time",abbr:"AST",offset:4.5,isdst:!1,text:"(UTC+04:30) Kabul",utc:["Asia/Kabul"]},{value:"West Asia Standard Time",abbr:"WAST",offset:5,isdst:!1,text:"(UTC+05:00) Ashgabat, Tashkent",utc:["Antarctica/Mawson","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Dushanbe","Asia/Oral","Asia/Samarkand","Asia/Tashkent","Etc/GMT-5","Indian/Kerguelen","Indian/Maldives"]},{value:"Yekaterinburg Time",abbr:"YEKT",offset:5,isdst:!1,text:"(UTC+05:00) Yekaterinburg",utc:["Asia/Yekaterinburg"]},{value:"Pakistan Standard Time",abbr:"PKT",offset:5,isdst:!1,text:"(UTC+05:00) Islamabad, Karachi",utc:["Asia/Karachi"]},{value:"India Standard Time",abbr:"IST",offset:5.5,isdst:!1,text:"(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi",utc:["Asia/Kolkata","Asia/Calcutta"]},{value:"Sri Lanka Standard Time",abbr:"SLST",offset:5.5,isdst:!1,text:"(UTC+05:30) Sri Jayawardenepura",utc:["Asia/Colombo"]},{value:"Nepal Standard Time",abbr:"NST",offset:5.75,isdst:!1,text:"(UTC+05:45) Kathmandu",utc:["Asia/Kathmandu"]},{value:"Central Asia Standard Time",abbr:"CAST",offset:6,isdst:!1,text:"(UTC+06:00) Nur-Sultan (Astana)",utc:["Antarctica/Vostok","Asia/Almaty","Asia/Bishkek","Asia/Qyzylorda","Asia/Urumqi","Etc/GMT-6","Indian/Chagos"]},{value:"Bangladesh Standard Time",abbr:"BST",offset:6,isdst:!1,text:"(UTC+06:00) Dhaka",utc:["Asia/Dhaka","Asia/Thimphu"]},{value:"Myanmar Standard Time",abbr:"MST",offset:6.5,isdst:!1,text:"(UTC+06:30) Yangon (Rangoon)",utc:["Asia/Rangoon","Indian/Cocos"]},{value:"SE Asia Standard Time",abbr:"SAST",offset:7,isdst:!1,text:"(UTC+07:00) Bangkok, Hanoi, Jakarta",utc:["Antarctica/Davis","Asia/Bangkok","Asia/Hovd","Asia/Jakarta","Asia/Phnom_Penh","Asia/Pontianak","Asia/Saigon","Asia/Vientiane","Etc/GMT-7","Indian/Christmas"]},{value:"N. Central Asia Standard Time",abbr:"NCAST",offset:7,isdst:!1,text:"(UTC+07:00) Novosibirsk",utc:["Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk"]},{value:"China Standard Time",abbr:"CST",offset:8,isdst:!1,text:"(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",utc:["Asia/Hong_Kong","Asia/Macau","Asia/Shanghai"]},{value:"North Asia Standard Time",abbr:"NAST",offset:8,isdst:!1,text:"(UTC+08:00) Krasnoyarsk",utc:["Asia/Krasnoyarsk"]},{value:"Singapore Standard Time",abbr:"MPST",offset:8,isdst:!1,text:"(UTC+08:00) Kuala Lumpur, Singapore",utc:["Asia/Brunei","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Makassar","Asia/Manila","Asia/Singapore","Etc/GMT-8"]},{value:"W. Australia Standard Time",abbr:"WAST",offset:8,isdst:!1,text:"(UTC+08:00) Perth",utc:["Antarctica/Casey","Australia/Perth"]},{value:"Taipei Standard Time",abbr:"TST",offset:8,isdst:!1,text:"(UTC+08:00) Taipei",utc:["Asia/Taipei"]},{value:"Ulaanbaatar Standard Time",abbr:"UST",offset:8,isdst:!1,text:"(UTC+08:00) Ulaanbaatar",utc:["Asia/Choibalsan","Asia/Ulaanbaatar"]},{value:"North Asia East Standard Time",abbr:"NAEST",offset:8,isdst:!1,text:"(UTC+08:00) Irkutsk",utc:["Asia/Irkutsk"]},{value:"Japan Standard Time",abbr:"JST",offset:9,isdst:!1,text:"(UTC+09:00) Osaka, Sapporo, Tokyo",utc:["Asia/Dili","Asia/Jayapura","Asia/Tokyo","Etc/GMT-9","Pacific/Palau"]},{value:"Korea Standard Time",abbr:"KST",offset:9,isdst:!1,text:"(UTC+09:00) Seoul",utc:["Asia/Pyongyang","Asia/Seoul"]},{value:"Cen. Australia Standard Time",abbr:"CAST",offset:9.5,isdst:!1,text:"(UTC+09:30) Adelaide",utc:["Australia/Adelaide","Australia/Broken_Hill"]},{value:"AUS Central Standard Time",abbr:"ACST",offset:9.5,isdst:!1,text:"(UTC+09:30) Darwin",utc:["Australia/Darwin"]},{value:"E. Australia Standard Time",abbr:"EAST",offset:10,isdst:!1,text:"(UTC+10:00) Brisbane",utc:["Australia/Brisbane","Australia/Lindeman"]},{value:"AUS Eastern Standard Time",abbr:"AEST",offset:10,isdst:!1,text:"(UTC+10:00) Canberra, Melbourne, Sydney",utc:["Australia/Melbourne","Australia/Sydney"]},{value:"West Pacific Standard Time",abbr:"WPST",offset:10,isdst:!1,text:"(UTC+10:00) Guam, Port Moresby",utc:["Antarctica/DumontDUrville","Etc/GMT-10","Pacific/Guam","Pacific/Port_Moresby","Pacific/Saipan","Pacific/Truk"]},{value:"Tasmania Standard Time",abbr:"TST",offset:10,isdst:!1,text:"(UTC+10:00) Hobart",utc:["Australia/Currie","Australia/Hobart"]},{value:"Yakutsk Standard Time",abbr:"YST",offset:9,isdst:!1,text:"(UTC+09:00) Yakutsk",utc:["Asia/Chita","Asia/Khandyga","Asia/Yakutsk"]},{value:"Central Pacific Standard Time",abbr:"CPST",offset:11,isdst:!1,text:"(UTC+11:00) Solomon Is., New Caledonia",utc:["Antarctica/Macquarie","Etc/GMT-11","Pacific/Efate","Pacific/Guadalcanal","Pacific/Kosrae","Pacific/Noumea","Pacific/Ponape"]},{value:"Vladivostok Standard Time",abbr:"VST",offset:11,isdst:!1,text:"(UTC+11:00) Vladivostok",utc:["Asia/Sakhalin","Asia/Ust-Nera","Asia/Vladivostok"]},{value:"New Zealand Standard Time",abbr:"NZST",offset:12,isdst:!1,text:"(UTC+12:00) Auckland, Wellington",utc:["Antarctica/McMurdo","Pacific/Auckland"]},{value:"UTC+12",abbr:"U",offset:12,isdst:!1,text:"(UTC+12:00) Coordinated Universal Time+12",utc:["Etc/GMT-12","Pacific/Funafuti","Pacific/Kwajalein","Pacific/Majuro","Pacific/Nauru","Pacific/Tarawa","Pacific/Wake","Pacific/Wallis"]},{value:"Fiji Standard Time",abbr:"FST",offset:12,isdst:!1,text:"(UTC+12:00) Fiji",utc:["Pacific/Fiji"]},{value:"Magadan Standard Time",abbr:"MST",offset:12,isdst:!1,text:"(UTC+12:00) Magadan",utc:["Asia/Anadyr","Asia/Kamchatka","Asia/Magadan","Asia/Srednekolymsk"]},{value:"Kamchatka Standard Time",abbr:"KDT",offset:13,isdst:!0,text:"(UTC+12:00) Petropavlovsk-Kamchatsky - Old",utc:["Asia/Kamchatka"]},{value:"Tonga Standard Time",abbr:"TST",offset:13,isdst:!1,text:"(UTC+13:00) Nuku'alofa",utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]},{value:"Samoa Standard Time",abbr:"SST",offset:13,isdst:!1,text:"(UTC+13:00) Samoa",utc:["Pacific/Apia"]}].filter(e=>e.utc.length).reduce((e,t)=>{let r=t.utc;for(let n=0;n<r.length;n++){const a=r[n],i=t.text;let s=i.substring(i.indexOf("(")+1,i.indexOf(")"));-1!==s.indexOf("UTC")&&e.push({value:a,abbr:t.abbr,offset:t.offset,isdst:t.isdst,text:`(${s}) ${a}`,utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]})}return e},[]).filter((e,t,r)=>t===r.findIndex(t=>t.value===e.value));function iS({value:e,onChange:r}){const{t:n}=xn(),a=aS.map(e=>({value:e.value,label:e.text}));return t(Kx,{options:a,value:e,onChange:r,placeholder:n("dropdowns.searchTimezone"),emptyLabel:n("dropdowns.chooseTimezone")})}const sS=({workspace:r})=>{const{t:n}=xn(),{updateUserProfile:a,getProfile:i}=rE(),[o,c]=m(!1),[l,u]=m(),[p,h]=m(0),[f,g]=m(null),b=s(null);d(()=>()=>{b.current&&clearTimeout(b.current)},[]);const v=Td({resolver:zh(Of({name:uf().min(2,{message:n("profile.nameMinLength")}),country:uf().optional(),timezone:uf().optional(),language:uf().optional(),currency:uf().optional()})),defaultValues:{name:l?.name||"",country:l?.country||"",timezone:l?.timezone||"",language:l?.language||"",currency:l?.currency||""}});return d(()=>{i().then(e=>{u(e),v.setValue("name",e.name),v.setValue("country",e.country),v.setValue("timezone",e.timezone),v.setValue("language",e.language),v.setValue("currency",e.currency)})},[p]),l?e("div",{children:[f&&e("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[t("p",{className:"font-medium",children:n("settings.common.success")}),t("p",{className:"text-sm",children:f})]}),t("div",{className:"space-y-4",children:t(ug,{...v,children:e("form",{onSubmit:v.handleSubmit(async function(e){c(!0),g(null);try{await a({name:e.name,country:e.country,timezone:e.timezone,language:e.language,currency:e.currency}),g(n("profile.success")),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{g(null)},5e3)}catch(e){Ke(e,{component:"WorkspaceSettingsProfile",action:"updateUserProfile",metadata:{workspaceId:r._id}})}finally{c(!1)}}),className:"space-y-4",children:[e("div",{children:[t("label",{className:"block text-sm font-medium mb-1",children:n("profile.email")}),t(wg,{disabled:!0,className:"w-full border rounded px-3 py-2 bg-gray-100",value:l?.email})]}),t(pg,{disabled:o,control:v.control,name:"name",render:({field:r})=>e(fg,{children:[t(gg,{children:n("profile.name")}),t(bg,{children:t(wg,{...r})}),t(yg,{})]})}),e("div",{className:"flex gap-y-2 my-4 flex-col",children:[e("div",{className:"flex flex-col gap-0.5",children:[t("div",{className:"text-sm font-medium",children:n("profile.language")}),t(nS,{value:v.watch("language"),onChange:e=>{v.setValue("language",e)}})]}),e("div",{className:"flex flex-col gap-0.5",children:[t("div",{className:"text-sm font-medium",children:n("profile.country")}),t(Yx,{value:v.watch("country"),onChange:e=>{v.setValue("country",e)}})]}),e("div",{className:"flex flex-col gap-0.5",children:[t("div",{className:"text-sm font-medium",children:n("profile.currency")}),t(eS,{value:v.watch("currency"),onChange:e=>{v.setValue("currency",e)}})]}),e("div",{className:"flex flex-col gap-0.5",children:[t("div",{className:"text-sm font-medium",children:n("profile.timezone")}),t(iS,{value:v.watch("timezone"),onChange:e=>{v.setValue("timezone",e)}})]})]}),e("div",{className:"flex justify-end gap-x-2",children:[t(Hi,{type:"submit",progress:o,disabled:o,children:n("profile.save")}),t(Hi,{type:"button",variant:"outline",onClick:()=>{h(e=>e+1)},disabled:o,children:n("profile.reset")})]})]})})}),l?.image&&e("div",{children:[t("label",{className:"block text-sm font-medium mb-1",children:n("profile.profileImage")}),t("div",{className:"w-16 h-16 rounded-full overflow-hidden",children:t("img",{src:l.image,alt:l.name,className:"w-full h-full object-cover"})})]})]}):t(Vl,{})};function oS(e,t){if(null==e)return null;const r=e[t??"monthly"];return r?{included:r.included,...void 0!==r.overage&&{overage:r.overage},...void 0!==r.unitSize&&{unitSize:r.unitSize},allowOverage:!1!==e.allowOverage}:null}function cS(e,t,r={}){if(null==e)return null;const{overageInCents:n=!0,currency:a,locale:i="en"}=r,{included:s,overage:o}=e;if(!(!1!==e.allowOverage))return{included:s,hasOverage:!1,allowOverage:!1,price:"",unit:""};if(null==o)return{included:s,hasOverage:!1,allowOverage:!0,price:"",unit:""};const c=n?o/100:o,l=(a??"").trim().toUpperCase();let u;if(l&&"number"==typeof c&&Number.isFinite(c))try{u=new Intl.NumberFormat(i,{style:"currency",currency:l,minimumFractionDigits:2}).format(c)}catch{u=`${r.currencySymbol??ag(a??"")}${c.toFixed(2)}`}else{u=`${r.currencySymbol??ag(a??"")}${"number"==typeof c?c.toFixed(2):String(o)}`}return{included:s,hasOverage:!0,allowOverage:!0,price:u,unit:t&&"unitSize"in e&&null!=e.unitSize&&e.unitSize>0?`${e.unitSize.toLocaleString(i)} ${t}`:t||""}}const lS="bb";function uS(e,t){let r;try{const e=t||("undefined"!=typeof window?window.location.href:"https://localhost");r=new URL(e),r.search=""}catch{r=new URL("https://localhost")}return r.searchParams.set(lS,function(e){return Object.entries(e).filter(([,e])=>null!=e&&""!==e).map(([e,t])=>`${encodeURIComponent(e)}:${encodeURIComponent(t)}`).join(",")}(e)),r.toString()}function dS(){if("undefined"==typeof window)return null;try{const e=new URLSearchParams(window.location.search).get(lS);if(!e)return null;const t=function(e){const t={};if(!e)return t;const r=e.split(",");for(const e of r){const r=e.indexOf(":");if(-1===r)continue;const n=decodeURIComponent(e.slice(0,r)),a=decodeURIComponent(e.slice(r+1));n&&(t[n]=a)}return t}(e);return Object.keys(t).length>0?t:null}catch{return null}}function pS(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.has(lS)&&(e.searchParams.delete(lS),window.history.replaceState({},"",e.toString()))}catch{}}const mS="personal",hS=(e,t,r="en-US")=>{const n=(t??"").trim();return n?new Intl.NumberFormat(r,{style:"currency",currency:n.toUpperCase(),minimumFractionDigits:2}).format(e/100):(e/100).toFixed(2)},fS=(e,t="en-US")=>e?new Date(1e3*e).toLocaleDateString(t,{year:"numeric",month:"short",day:"numeric"}):"",gS=e=>{switch(e){case ya:return"bg-green-100 text-green-800";case va:return"bg-yellow-100 text-yellow-800";case ba:return"bg-gray-100 text-gray-800";case wa:return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}},bS=({workspaceId:n,hasActiveSubscription:a=!1,onViewPricingPlans:i,limit:s=20})=>{const{t:o,formattingLocale:c}=xn(),{invoices:l,loading:u,error:d,refetch:p}=Jn(n,s),m=l.length>0;return e("div",{className:"space-y-4",children:[e("div",{className:"flex items-center justify-between",children:[e("div",{children:[t("h3",{className:"text-lg font-semibold",children:o("invoices.title")}),t("p",{className:"text-sm text-gray-600",children:o("invoices.description")})]}),t(Hi,{variant:"ghost",size:"sm",progress:u,onClick:p,disabled:u,children:o("settings.common.refreshAction",{loading:String(u)})})]}),d&&e("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e("div",{children:[t("p",{className:"font-medium",children:o("invoices.errorLoading")}),t("p",{className:"text-sm mt-1",children:d})]}),t(Hi,{variant:"outline",size:"sm",onClick:p,disabled:u,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:o("settings.common.retryAction",{loading:String(u)})})]}),u&&!m?t("div",{className:"border rounded-lg p-6",children:t(Vl,{})}):m?t("div",{className:"space-y-2",children:l.map(n=>{const a=(e=>{switch(e.status){case ba:case va:return{textKey:"invoices.pay",color:"bg-blue-600 hover:bg-blue-700"};case ya:return{textKey:"invoices.view",color:"bg-green-600 hover:bg-green-700"};case wa:case xa:return{textKey:"invoices.viewDetails",color:"bg-gray-600 hover:bg-gray-700"};default:return{textKey:"invoices.view",color:"bg-gray-600 hover:bg-gray-700"}}})(n);return e("div",{className:"border rounded-lg bg-white hover:shadow-sm transition-shadow p-3",children:[e("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[t("span",{className:"text-sm font-medium text-gray-900 truncate min-w-0",children:n.description||n.number||n.id.slice(-8)}),t("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium shrink-0 ${gS(n.status)}`,children:o(`invoices.status.${n.status}`)})]}),e("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-0.5 text-sm text-gray-600 mb-2.5",children:[t("span",{className:"font-medium text-gray-900",children:hS(n.amount_due,n.currency,c)}),n.created&&e(r,{children:[t("span",{className:"text-gray-300 hidden sm:inline",children:"·"}),t("span",{children:fS(n.created,c)})]}),n.amount_paid>0&&n.amount_due>0&&t("span",{className:"text-xs text-gray-500",children:o("invoices.paidAmount",{amount:hS(n.amount_paid,n.currency,c)})})]}),e("div",{className:"flex items-center gap-2",children:[e(Hi,{size:"sm",disabled:!n.hosted_invoice_url,onClick:()=>n.hosted_invoice_url&&window.open(n.hosted_invoice_url,"_blank","noopener,noreferrer"),className:a.color,children:[o(a.textKey),t(li,{className:"h-3 w-3 ms-1.5"})]}),n.invoice_pdf&&e(Hi,{size:"sm",variant:"outline",onClick:()=>window.open(n.invoice_pdf,"_blank","noopener,noreferrer"),children:[t(ci,{className:"h-3 w-3 me-1.5"}),o("invoices.download")]})]})]},n.id)})}):e("div",{className:"border rounded-lg p-6 text-center",children:[t(ui,{className:"h-12 w-12 mx-auto text-gray-400 mb-3"}),t("p",{className:"text-sm text-gray-500",children:o(a?"invoices.noInvoicesWithSub":"invoices.noInvoices")}),!a&&i&&t(Hi,{size:"sm",className:"mt-4",onClick:i,children:o("subscription.viewPricingPlans")})]})]})},vS=v(()=>Promise.resolve().then(function(){return VN}).then(e=>({default:e.default}))),yS=(e,t)=>{if(!t)return"";try{const r=new Date(t);return isNaN(r.getTime())?"":new Intl.DateTimeFormat(e,{month:"long",day:"numeric",year:"numeric"}).format(r)}catch{return""}},wS=({workspace:n})=>{const a=n._id?.toString(),{t:i,formattingLocale:c,fmtNum:l,fmtCents:u}=xn(),{api:p}=Bn(),{can:h}=Bl(),{settings:f}=Fn(),g=h(El.WORKSPACE_BILLING_VIEW),v=h(El.WORKSPACE_BILLING_MANAGE),y=f?.workspace?.mode===mS,{subscription:w,loading:x,error:S,updateSubscription:k,refetch:E}=Zn(a),{createCheckoutSession:N}=Kn(a),{cancelSubscription:C,loading:A}=Qn(a),{resumeSubscription:_,loading:P}=ea(a),{openBillingPortal:T,loading:R}=Yn(a),{versions:D,loading:I,error:U,refetch:M}=$n(a),L=x||I,O=S||U,{currentVersion:z,latestVersion:F,isDeprecated:B,plansToShow:W}=o(()=>{const e=D?.currentVersion,t=D?.availableVersions||[],r=null!=w?.subscription;let n=null;t.length>0?n=t.reduce((e,t)=>t.version>e.version?t:e):e&&(n=e);const a=!!(r&&n&&e)&&n.version>e.version;return{currentVersion:e,latestVersion:n,hasNewerVersion:a,isDeprecated:a&&r,plansToShow:n?.plans&&n.plans.length>0?n.plans:[]}},[D,w?.subscription]),[V,j]=m(!1),[H,G]=m(null),[$,K]=m(null),q=s(null),[Z,J]=m(!1),[Y,X]=m(!1),Q=s(void 0),ee=s(!1);d(()=>{if(ee.current)return;if(x||!W||0===W.length)return;const e=tE.getState(),t="selectPlan"===e.params?.action;w?.subscription&&!t||(ee.current=!0,t&&(Q.current=e.params,tE.clearParams()),J(!0))},[x,w?.subscription,W]),d(()=>()=>{q.current&&clearTimeout(q.current)},[]);const[te,re]=m(!1),[ne,ae]=m("subscription"),ie=async()=>{await Promise.all([E(),M()])},se=o(()=>Da(w?.subscription?.stripePriceId,W??[]),[w?.subscription?.stripePriceId,W]),oe=async()=>{if(a){X(!1),j(!0),G(null),K(null);try{await C(),K(i("subscription.cancelSuccess")),await ie()}catch(e){const t=e instanceof Error?e.message:i("subscription.errorCanceling");G(t)}finally{j(!1),q.current&&clearTimeout(q.current),q.current=setTimeout(()=>{G(null),K(null)},5e3)}}};if(L&&!w&&!D)return t(Vl,{});if(!g)return null;const ce=w?.planVersion?._id||null;return a?e("div",{className:"space-y-6",children:[O&&e("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e("div",{children:[t("p",{className:"font-medium",children:i("subscription.errorLoading")}),t("p",{className:"text-sm mt-1",children:O}),t("p",{className:"text-xs mt-2 text-red-600",children:i("subscription.errorLoadingDescription")})]}),t(Hi,{variant:"outline",size:"sm",onClick:ie,disabled:L,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:i("settings.common.retryAction",{loading:String(L)})})]}),H&&e("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e("div",{children:[t("p",{className:"font-medium",children:i("subscription.updateFailed")}),t("p",{className:"text-sm mt-1",children:H})]}),t(Hi,{variant:"outline",size:"sm",onClick:()=>G(null),className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:i("settings.common.dismiss")})]}),$&&e("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e("div",{children:[t("p",{className:"font-medium",children:i("settings.common.success")}),t("p",{className:"text-sm mt-1",children:$})]}),t(Hi,{variant:"outline",size:"sm",onClick:()=>K(null),className:"flex-shrink-0 border-green-200 text-green-700 hover:bg-green-100",children:i("settings.common.dismiss")})]}),t("div",{className:"border-b border-gray-200",children:e("nav",{className:"-mb-px flex gap-6","aria-label":"Subscription tabs",children:[t("button",{type:"button",onClick:()=>ae("subscription"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("subscription"===ne?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:i("subscription.plan")}),t("button",{type:"button",onClick:()=>ae("invoices"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("invoices"===ne?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:i("subscription.invoicesTab")})]})}),"subscription"===ne&&e(r,{children:[L&&e("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-600",children:[t(pi,{className:"h-4 w-4 animate-spin flex-shrink-0"}),t("span",{children:i("settings.common.loading")})]}),B&&w?.subscription&&e("div",{className:"bg-amber-50 border border-amber-200 rounded-lg px-4 py-3 flex flex-col sm:flex-row sm:items-center justify-between gap-2",children:[e("div",{className:"flex items-center gap-2 min-w-0",children:[t(Ci,{className:"h-4 w-4 text-amber-600 shrink-0"}),e("span",{className:"text-sm text-amber-800",children:[t("span",{className:"font-medium",children:i("subscription.planUpdateAvailable")}),e("span",{className:"text-amber-600",children:[" ","— v",z?.version||"?"," → v",F?.version||"?"]})]})]}),t(Hi,{size:"sm",variant:"outline",className:"shrink-0 border-amber-300 text-amber-700 hover:bg-amber-100",onClick:()=>J(!0),children:i("subscription.viewPlans")})]}),e("div",{className:"space-y-4",children:[e("div",{className:"flex items-center justify-between",children:[t("div",{children:t("p",{className:"text-sm text-gray-600",children:i("subscription.managePlan")})}),e("div",{className:"flex items-center gap-2",children:[(()=>{const e=w?.subscription?.subscriptionStatus===ha,r=w?.subscription?.cancelAtPeriodEnd;return r||A?null:e&&W&&W.length>0?t(Hi,{size:"sm",onClick:()=>J(!0),children:i("subscription.viewPricingPlans")}):w?.subscription&&!e&&v?t(Hi,{variant:"outline",size:"sm",onClick:()=>J(!0),children:i("subscription.changePlanButton")}):!w?.subscription&&W&&W.length>0?t(Hi,{size:"sm",onClick:()=>J(!0),children:i("subscription.viewPricingPlans")}):null})(),t(Hi,{variant:"ghost",size:"sm",progress:L,onClick:ie,disabled:L||V,children:i("settings.common.refreshAction",{loading:String(L)})})]})]}),w?.subscription?(()=>{const a=Da(w.subscription.stripePriceId,W??[]),s=a?.interval??null,o=a?.currency??w.plan?.currency??n?.billingCurrency??"",d=s&&w.planVersion?Pa(w.planVersion,o,s):null,p=o,m=w.planVersion?Ia(w.planVersion,o):null,h=m&&s?Ua(w.planVersion,o,s):null,f=Array.isArray(n?.users)?n.users.length:1,g=m?.includedSeats??0,b=Math.max(0,f-g),x=!!w.plan?.isFreemium,S=null!=d?0===d?i("subscription.free"):u(d,p):x?i("subscription.free"):null,k=s===da.Monthly?i("subscription.billingInterval.perMonth"):s===da.Quarterly?i("subscription.billingInterval.perQuarter"):s===da.Yearly?i("subscription.billingInterval.perYear"):"";return e("div",{className:"border rounded-lg overflow-hidden "+(B?"border-amber-300":"border-gray-200"),children:[w.subscription.subscriptionStatus===ma&&!w.subscription.cancelAtPeriodEnd&&(()=>{const r=w.subscription.trialEnd||w.subscription.stripeCurrentPeriodEnd,n=r?new Date(r):null,a=n&&!isNaN(n.getTime())?n:null,s=a?Math.max(0,Math.ceil((a.getTime()-Date.now())/864e5)):null,o=null!==s&&s<=3;return e("div",{className:"px-4 py-3 sm:px-5 text-sm flex flex-col sm:flex-row sm:items-center justify-between gap-2 "+(o?"bg-amber-50 text-amber-800 border-b border-amber-200":"bg-blue-50 text-blue-800 border-b border-blue-200"),children:[e("span",{children:[null!==s&&s<=0?i("subscription.trialEnded"):null!==s?i("subscription.trialEndsIn",{days:s}):i("subscription.onTrial")," ",i("subscription.upgradeToKeepAccess")]}),t(Hi,{size:"sm",variant:o?"default":"outline",className:"shrink-0 "+(o?"":"border-blue-300 text-blue-700 hover:bg-blue-100"),onClick:()=>J(!0),children:i("subscription.upgradePlan")})]})})(),e("div",{className:"p-4 sm:p-5 "+(B?"bg-amber-50/50":"bg-gray-50/50"),children:[e("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[t("h3",{className:"text-lg font-semibold text-gray-900",children:w.plan?.name||i("subscription.noPlanAssigned")}),e("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium "+(w.subscription.subscriptionStatus===pa?w.subscription.cancelAtPeriodEnd?"bg-amber-100 text-amber-800":"bg-green-100 text-green-800":w.subscription.subscriptionStatus===ma?"bg-blue-100 text-blue-800":w.subscription.subscriptionStatus===ha?"bg-gray-100 text-gray-800":"bg-red-100 text-red-800"),children:[w.subscription.subscriptionStatus===pa&&(w.subscription.cancelAtPeriodEnd?i("subscription.status.canceling"):i("subscription.status.active")),w.subscription.subscriptionStatus===ma&&i("subscription.status.trial"),w.subscription.subscriptionStatus===ha&&i("subscription.status.canceled"),w.subscription.subscriptionStatus===fa&&i("subscription.status.pastDue")]}),w.subscription.subscriptionStatus===ma&&yS(c,w.subscription.trialEnd||w.subscription.stripeCurrentPeriodEnd)&&e("span",{className:"text-xs text-gray-500",children:["(ends"," ",yS(c,w.subscription.trialEnd||w.subscription.stripeCurrentPeriodEnd),")"]}),B&&e("span",{className:"inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-xs font-medium bg-amber-100 text-amber-800",children:[t(Ci,{className:"h-3 w-3"}),i("subscription.status.deprecated")]})]}),w.plan?.description&&t("p",{className:"text-sm text-gray-600 mb-3",children:w.plan.description}),!x&&e("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 sm:gap-4",children:[e("div",{children:[e("div",{className:"flex items-baseline gap-1 whitespace-nowrap",children:[t("span",{className:"text-2xl font-bold text-gray-900",children:S||i("invoices.na")}),S&&S!==i("subscription.free")&&k&&t("span",{className:"text-sm text-gray-500",children:k})]}),m&&h&&h>0&&!y&&t("div",{className:"text-xs text-gray-500 mt-1",children:i("subscription.perSeatDisplay",{price:u(h,p),interval:k})}),!y&&m&&h&&h>0&&b>0&&S&&S!==i("subscription.free")&&null!=d&&t("div",{className:"text-xs text-gray-500 mt-1 pt-1 border-t border-gray-200",children:i("subscription.estTotalDisplay",{total:u(d+h*b,p),interval:k,count:b})})]}),(w.subscription.subscriptionStatus===pa||w.subscription.subscriptionStatus===ma)&&!w.subscription.cancelAtPeriodEnd&&yS(c,w.subscription.stripeCurrentPeriodEnd)&&e("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[t(ni,{className:"h-3.5 w-3.5 flex-shrink-0"}),t("span",{children:i("subscription.nextBillingDisplay",{date:yS(c,w.subscription.stripeCurrentPeriodEnd)??""})})]})]}),B&&e("p",{className:"text-xs text-amber-600 mt-2",children:["Version ",z?.version||i("invoices.na")]}),!x&&(w.subscription.subscriptionStatus===pa||w.subscription.subscriptionStatus===ma||w.subscription.subscriptionStatus===fa)&&e("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3 mt-4 pt-4 border-t border-gray-200",children:[w.subscription&&v&&w.subscription.subscriptionId&&t(Hi,{variant:"outline",size:"sm",onClick:()=>T(),disabled:R,progress:R,children:i(R?"subscription.openingPortal":"subscription.managePayment")}),v&&w.subscription.subscriptionId&&(w.subscription.subscriptionStatus===pa||w.subscription.subscriptionStatus===ma)&&t(r,{children:w.subscription.cancelAtPeriodEnd?t(Hi,{variant:"outline",size:"sm",onClick:()=>re(!0),disabled:V||A||P,progress:P,children:w.subscription.subscriptionStatus===ma?i("subscription.resumeTrial"):i("subscription.resumeTitle")}):t(Hi,{variant:"outline",size:"sm",className:"text-red-600 hover:text-red-700 hover:bg-red-50 border-red-200",onClick:()=>X(!0),disabled:V||A||P,progress:A||V,children:A||V?i("subscription.canceling"):w.subscription.subscriptionStatus===ma?i("subscription.cancelTrial"):i("subscription.cancelTitle")})})]})]}),w.subscription.subscriptionStatus===fa&&t("div",{className:"px-5 py-3 bg-red-50 border-t border-red-200",children:e("div",{className:"flex items-start gap-3",children:[t(Ci,{className:"h-5 w-5 text-red-600 flex-shrink-0 mt-0.5"}),e("div",{children:[t("p",{className:"text-sm font-medium text-red-800",children:i("subscription.paymentPastDue")}),t("p",{className:"text-sm text-red-700 mt-0.5",children:i("subscription.paymentPastDueDescription")}),t(Hi,{variant:"outline",size:"sm",className:"mt-2 border-red-200 text-red-700 hover:bg-red-100",onClick:()=>ae("invoices"),children:i("subscription.viewInvoices")})]})]})}),w.subscription.subscriptionStatus===fa&&w.subscription.dunningState&&w.subscription.dunningState!==Na&&t("div",{className:"px-5 py-3 bg-red-50 border-t border-red-200",children:e("div",{className:"flex items-start gap-3",children:[t(Ci,{className:"h-5 w-5 text-red-600 flex-shrink-0 mt-0.5"}),e("div",{children:[t("p",{className:"text-sm font-medium text-red-800",children:w.subscription.dunningState===Ca?i("subscription.dunningFinal"):w.subscription.dunningState===Aa?i("subscription.dunningSuspended"):i("subscription.dunningRecovery")}),t("p",{className:"text-sm text-red-700 mt-0.5",children:w.subscription.dunningState===Aa?i("subscription.dunningSuspendedDescription"):i("subscription.dunningRecoveryDescription")})]})]})}),w.subscription.subscriptionStatus===ga&&t("div",{className:"px-5 py-3 bg-blue-50 border-t border-blue-200",children:e("div",{className:"flex items-start gap-3",children:[t(ni,{className:"h-5 w-5 text-blue-600 flex-shrink-0 mt-0.5"}),e("div",{children:[t("p",{className:"text-sm font-medium text-blue-800",children:i("subscription.subscriptionPaused")}),t("p",{className:"text-sm text-blue-700 mt-0.5",children:i("subscription.subscriptionPausedDescription")})]})]})}),w.subscription.cancelAtPeriodEnd&&t("div",{className:"px-5 py-3 bg-amber-50 border-t border-amber-200",children:e("div",{className:"flex items-start gap-3",children:[t(ni,{className:"h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5"}),e("div",{children:[t("p",{className:"text-sm font-medium text-amber-800",children:w.subscription.subscriptionStatus===ma?i("subscription.scheduledTrialCancellation"):i("subscription.scheduledCancellation")}),t("p",{className:"text-sm text-amber-700 mt-0.5",children:yS(c,w.subscription.subscriptionStatus===ma&&w.subscription.trialEnd||w.subscription.stripeCurrentPeriodEnd)?e(r,{children:[w.subscription.subscriptionStatus===ma?i("subscription.trialEndDescription"):i("subscription.cancelEndDescription")," ",t("span",{className:"font-medium",children:yS(c,w.subscription.subscriptionStatus===ma&&w.subscription.trialEnd||w.subscription.stripeCurrentPeriodEnd)}),"."]}):i("subscription.cancelEndFallback")})]})]})}),w.planVersion&&(()=>{const r=((e,t,r=da.Monthly)=>{if(!e?.subscriptionItems)return{features:[],limits:[],quotas:[]};const n=[],a=[],i=[];return e.subscriptionItems.forEach(s=>{const o=s.slug;if(s.type===Sa){const t=e.features?.[o]??!1;n.push({item:s,enabled:t})}else if(s.type===ka){const t=e.limits?.[o]??0;a.push({item:s,value:t})}else if(s.type===Ea){const n=t&&e.pricingVariants?.length?Ra(e,t,o,r):oS(e.quotas?.[o],r);null!=n&&i.push({item:s,value:n})}}),{features:n,limits:a,quotas:i}})(w.planVersion,o,s??"monthly");return r.features.length>0||r.limits.length>0||r.quotas.length>0?t("div",{className:"px-4 py-4 sm:px-5 sm:py-5 border-t border-gray-100",children:e("div",{className:"space-y-5",children:[r.features.length>0&&e("div",{children:[t("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:i("subscription.items.features")}),t("ul",{className:"space-y-1.5",children:r.features.sort(e=>e.enabled?-1:1).map(({item:r,enabled:n})=>e("li",{className:"flex items-center gap-2 text-sm",children:[t("span",{className:"w-4 text-center shrink-0 "+(n?"text-green-500":"text-gray-300"),children:n?"✓":"✕"}),t("span",{className:n?"text-gray-700":"text-gray-400",children:r.name})]},r._id))})]}),r.limits.length>0&&e("div",{children:[t("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:i("subscription.items.limits")}),t("ul",{className:"space-y-1.5",children:r.limits.map(({item:r,value:n})=>e("li",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-gray-600",children:r.name}),t("span",{className:"font-medium text-gray-900",children:l(n)})]},r._id))})]}),r.quotas.length>0&&e("div",{children:[t("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:i("subscription.items.quotas")}),t("ul",{className:"space-y-1.5",children:r.quotas.map(({item:r,value:n})=>{const a=cS(n,r.name.toLowerCase(),{currency:o,locale:c}),s=a?a.hasOverage?i("quota.includedWithOverage",{count:a.included,price:a.price,unit:a.unit}):i("quota.includedOnly",{count:a.included}):"—";return t("li",{className:"text-sm",children:e("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-0.5",children:[t("span",{className:"text-gray-600",children:r.name}),t("span",{className:"font-medium text-gray-900 text-xs sm:text-sm",children:s})]})},r._id)})})]}),m&&!y&&e("div",{children:[t("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:i("subscription.seats.title")}),e("div",{className:"bg-gray-50 rounded-lg p-3 space-y-1.5",children:[e("div",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-gray-600",children:i("subscription.seats.members")}),t("span",{className:"font-semibold text-gray-900",children:l(f)})]}),e("div",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-gray-600",children:i("subscription.seats.included")}),t("span",{className:"text-gray-900",children:l(g)})]}),b>0&&e("div",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-gray-600",children:i("subscription.seats.billable")}),e("span",{className:"font-medium text-amber-600",children:[l(b)," ",i("subscription.seats.extra")]})]}),h&&h>0&&e("div",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-gray-600",children:i("subscription.seats.perExtraSeat")}),e("span",{className:"text-gray-900",children:[u(h,o),k]})]}),m.maxSeats>0&&e("div",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-gray-600",children:i("subscription.seats.limit")}),t("span",{className:"text-gray-900",children:l(m.maxSeats)})]})]})]})]})}):null})()]})})():e("div",{className:"border rounded-lg p-6 text-center",children:[e("div",{className:"mb-4",children:[t(oi,{className:"h-12 w-12 mx-auto text-gray-400 mb-3"}),t("p",{className:"text-lg font-medium text-gray-700",children:i("subscription.noSubscription")}),t("p",{className:"text-sm text-gray-500 mt-1",children:i("subscription.noSubscriptionDescription")})]}),W&&W.length>0&&t(Hi,{size:"sm",onClick:()=>J(!0),children:i("subscription.viewPricingPlans")})]})]}),!D&&!L&&e("div",{className:"border rounded-lg p-4 text-center",children:[e("div",{className:"text-gray-500 mb-2",children:[t("p",{className:"font-medium",children:i("subscription.errorLoading")}),O&&e("p",{className:"text-sm mt-2 text-red-600",children:["Error: ",O]}),!O&&t("p",{className:"text-sm mt-2",children:i("subscription.noPlansAvailable")})]}),t(Hi,{variant:"outline",size:"sm",progress:L,onClick:ie,disabled:L,className:"mt-4",children:i("settings.common.refreshAction",{loading:String(L)})})]})]}),"invoices"===ne&&e(r,{children:[L&&e("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-600",children:[t(pi,{className:"h-4 w-4 animate-spin flex-shrink-0"}),t("span",{children:i("settings.common.loading")})]}),t(bS,{workspaceId:a,hasActiveSubscription:null!==w?.subscription,onViewPricingPlans:()=>ae("subscription"),limit:20})]}),W&&W.length>0&&t(b,{fallback:Z?t("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:e("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t(pi,{className:"h-5 w-5 animate-spin"}),t("span",{children:i("settings.common.loading")})]})}):null,children:t(vS,{open:Z,onOpenChange:J,planVersions:W,currentPlanVersionId:ce||null,currentStripePriceId:w?.subscription?.stripePriceId,billingCurrency:n.billingCurrency,trialUsedAt:n.trialUsedAt,workspaceName:n.name,initialInterval:Q.current?.interval,initialCurrency:Q.current?.currency,currentMemberCount:Array.isArray(n?.users)?n.users.length:void 0,onSelectPlan:async(e,t=da.Monthly,r)=>{if(!a)return;const s=W?.find(t=>t._id===e),o=r??se?.currency??w?.plan?.currency??n?.billingCurrency??"",c=s?function(e,t,r){const n=_a(e,t);if(!n?.stripePrices)return null;const a=r===da.Monthly?"monthlyPriceId":r===da.Yearly?"yearlyPriceId":"quarterlyPriceId",i=r===da.Monthly?"monthly":r===da.Yearly?"yearly":void 0;return n.stripePrices[a]??(i?n.stripePrices[i]:void 0)??null}(s,o,t):null,l=w?.subscription?.stripePriceId;if(!c||!l||c!==l){j(!0),G(null),K(null);try{const{successUrl:r,cancelUrl:n}=function(e){const t="undefined"!=typeof window?window.location.href:void 0;return{successUrl:uS({action:"checkout",status:"success",ws:e,screen:"subscription"},t),cancelUrl:uS({action:"checkout",status:"cancel",ws:e,screen:"subscription"},t)}}(a);let c;if(s?.plan?.isFreemium){return w?.subscription?.subscriptionId?(J(!1),void X(!0)):(await p.selectFreePlan(a,e),J(!1),Zt(),await ie(),void K(i("subscription.updateSuccess")))}const l=w?.subscription?.subscriptionStatus===ha;if(c=w?.subscription&&!l?await k(e,{billingInterval:t,successUrl:r,cancelUrl:n}):await N({planVersionId:e,billingInterval:t,currency:o||void 0,successUrl:r,cancelUrl:n}),c&&"checkoutUrl"in c&&c.checkoutUrl)return void Rl(c.checkoutUrl);K(i("subscription.updateSuccess")),await ie()}catch(e){const t=e instanceof Error?e.message:i("subscription.errorProcessing");G(t)}finally{j(!1),q.current&&clearTimeout(q.current),q.current=setTimeout(()=>{G(null),K(null)},5e3)}}},loading:V||L})}),t(sl,{open:te,onOpenChange:re,children:e(ul,{children:[e(dl,{children:[t(ml,{children:i("subscription.resumeTitle")}),t(hl,{asChild:!0,children:e("div",{className:"space-y-3",children:[t("p",{children:i("subscription.resumeConfirm")}),e("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4 space-y-2 text-sm",children:[e("div",{className:"flex items-start gap-2",children:[t(Ci,{className:"h-4 w-4 text-amber-600 mt-0.5 flex-shrink-0"}),e("span",{children:[i("subscription.resumeChargeDate")," ",w?.subscription?.stripeCurrentPeriodEnd&&yS(c,w.subscription.stripeCurrentPeriodEnd)?t("span",{className:"font-medium",children:yS(c,w.subscription.stripeCurrentPeriodEnd)}):i("subscription.resumeChargeFallback")]})]}),e("div",{className:"flex items-start gap-2",children:[t("span",{className:"text-amber-600 mt-0.5",children:"•"}),t("span",{children:i("subscription.resumeContinue")})]}),e("div",{className:"flex items-start gap-2",children:[t("span",{className:"text-blue-600 mt-0.5",children:"ℹ"}),t("span",{children:i("subscription.resumeCancelAnytime")})]})]})]})})]}),e(pl,{children:[t(gl,{disabled:P,children:i("subscription.resumeKeep")}),t(fl,{onClick:async()=>{if(a){re(!1),j(!0),G(null),K(null);try{await _(),K(i("subscription.resumeSuccess")),await ie()}catch(e){const t=e instanceof Error?e.message:i("subscription.errorResuming");G(t)}finally{j(!1),q.current&&clearTimeout(q.current),q.current=setTimeout(()=>{G(null),K(null)},5e3)}}},disabled:P,children:i(P?"subscription.resuming":"subscription.resumeButton")})]})]})}),(()=>{const r=w?.subscription?.subscriptionStatus===ma,n=r&&w?.subscription?.trialEnd||w?.subscription?.stripeCurrentPeriodEnd;return t(sl,{open:Y,onOpenChange:X,children:e(ul,{children:[e(dl,{children:[t(ml,{children:i(r?"subscription.cancelTrialTitle":"subscription.cancelTitle")}),t(hl,{asChild:!0,children:e("div",{className:"space-y-3",children:[t("p",{children:i(r?"subscription.cancelTrialConfirm":"subscription.cancelConfirm")}),e("div",{className:"bg-gray-50 rounded-lg p-4 space-y-2 text-sm",children:[e("div",{className:"flex items-start gap-2",children:[t("span",{className:"text-green-600 mt-0.5",children:"✓"}),e("span",{children:[i(r?"subscription.cancelTrialAccess":"subscription.retainAccess")," ",n&&yS(c,n)?t("span",{className:"font-medium",children:yS(c,n)}):i("subscription.retainAccessFallback")]})]}),e("div",{className:"flex items-start gap-2",children:[t("span",{className:"text-green-600 mt-0.5",children:"✓"}),t("span",{children:i(r?"subscription.cancelTrialNoCharge":"subscription.cancelNotCharged")})]}),e("div",{className:"flex items-start gap-2",children:[t("span",{className:"text-blue-600 mt-0.5",children:"ℹ"}),t("span",{children:i(r?"subscription.cancelTrialResume":"subscription.cancelResumeAnytime")})]})]})]})})]}),e(pl,{children:[t(gl,{disabled:A,children:i(r?"subscription.cancelTrialKeep":"subscription.cancelKeep")}),t(fl,{onClick:oe,disabled:A,className:"bg-red-600 hover:bg-red-700 focus:ring-red-600",children:i(A?"subscription.canceling":r?"subscription.cancelTrialButton":"subscription.cancelButton")})]})]})})})()]}):t("div",{className:"border rounded-lg p-4 text-center text-gray-500",children:t("p",{children:i("subscription.invalidWorkspace")})})};function xS(e){return e.replace(/[_-]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function SS(e,t,r){return t+e.toLocaleString(r,{minimumFractionDigits:2,maximumFractionDigits:2})}function kS(e){try{const t=new Date(e);if(isNaN(t.getTime()))return null;const r=new Date;return Math.ceil((t.getTime()-r.getTime())/864e5)}catch{return null}}const ES=()=>{const{quotas:r,loading:n,error:a,refetch:i}=sE(),{t:s,formattingLocale:c,fmtNum:l}=xn(),{can:u}=Bl(),d=(e,t)=>SS(e,t,c),{response:p}=oa(),[h,f]=m(!1),g=o(()=>{const e={};if(!p?.planVersion||!p?.subscription)return e;const t=p.planVersion,n=p.subscription,a=n.billingInterval??"monthly",i=n.plan?.currency??"usd",s=ag(i);if(!r)return e;for(const n of Object.keys(r)){const o=Ta(t,i,n,a);if(null==o||o<=0)continue;const c=t.quotas?.[n],l=c?.[a],u=l?.unitSize??1,d=r[n].overage,p=(u>1?Math.ceil(d/u):d)*o/100;e[n]={overageCents:o,unitSize:u,currency:i,currencySymbol:s,estimatedCost:p}}return e},[p,r]),b=o(()=>{const e=p?.subscription?.stripeCurrentPeriodEnd;if(!e)return null;const t=function(e,t="en-US"){try{const r=new Date(e);return isNaN(r.getTime())?"":new Intl.DateTimeFormat(t,{month:"short",day:"numeric",year:"numeric"}).format(r)}catch{return""}}(e,c);return t?{endDate:t,daysRemaining:kS(e)}:null},[p,c]),v=async()=>{f(!0);try{await i()}finally{f(!1)}};if(n&&!r)return t(Vl,{});if(!u(El.WORKSPACE_USAGE_VIEW))return null;if(a)return e("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e("div",{children:[t("p",{className:"font-medium",children:s("usage.errorLoading")}),t("p",{className:"text-sm mt-1",children:a})]}),t(Hi,{variant:"outline",size:"sm",onClick:v,disabled:h,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:s("settings.common.retryAction",{loading:String(h)})})]});const y=function(e){return[...e].sort(([,e],[,t])=>{if(e.hasOverage&&!t.hasOverage)return-1;if(!e.hasOverage&&t.hasOverage)return 1;const r=e.included>0?e.consumed/e.included:e.consumed>0?1:0;return(t.included>0?t.consumed/t.included:t.consumed>0?1:0)-r})}(r?Object.entries(r):[]);if(0===y.length)return e("div",{className:"border rounded-lg p-8 text-center",children:[t(ai,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),t("p",{className:"text-sm text-gray-600",children:s("usage.noData")}),t("p",{className:"text-xs text-gray-500 mt-1",children:s("usage.noDataHint")})]});const w=y.filter(([,e])=>e.hasOverage).length,x=y.length>0?Math.round(y.reduce((e,[,t])=>e+(t.included>0?t.consumed/t.included*100:0),0)/y.length):0,S=Object.values(g).reduce((e,t)=>e+t.estimatedCost,0),k=Object.values(g)[0]?.currencySymbol??"$";return e("div",{className:"space-y-6",children:[e("div",{className:"flex items-center justify-between",children:[t("p",{className:"text-sm text-gray-600",children:s("usage.description")}),e(Hi,{variant:"ghost",size:"sm",onClick:v,disabled:h,children:[t(gi,{className:Oe("h-3.5 w-3.5 me-1.5",h&&"animate-spin")}),s("settings.common.refreshAction",{loading:String(h)})]})]}),b&&e("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50/50 px-4 py-3 text-sm text-gray-600",children:[t(ni,{className:"h-4 w-4 text-gray-400 flex-shrink-0"}),e("span",{children:[s("usage.resetDateDisplay",{date:b.endDate}),null!==b.daysRemaining&&b.daysRemaining>0&&e("span",{className:"text-gray-500",children:[" ","(",s("usage.daysRemainingDisplay",{count:b.daysRemaining}),")"]}),null!==b.daysRemaining&&b.daysRemaining<=0&&e("span",{className:"text-amber-600 font-medium",children:[" (",s("usage.renewingSoon"),")"]})]})]}),e("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2 sm:gap-3",children:[e("div",{className:"border border-gray-200 rounded-lg p-3 sm:p-4",children:[t("p",{className:"text-xs text-gray-500 font-medium",children:s("usage.totalResources")}),t("p",{className:"text-lg sm:text-xl font-semibold text-gray-900 mt-1",children:l(y.length)})]}),e("div",{className:"border border-gray-200 rounded-lg p-3 sm:p-4",children:[t("p",{className:"text-xs text-gray-500 font-medium",children:s("usage.overallUsage")}),t("p",{className:"text-lg sm:text-xl font-semibold text-gray-900 mt-1",children:l(x)+"%"})]}),e("div",{className:Oe("border rounded-lg p-3 sm:p-4",w>0?"border-red-200 bg-red-50":"border-gray-200"),children:[t("p",{className:"text-xs text-gray-500 font-medium",children:s("usage.inOverage")}),t("p",{className:Oe("text-lg sm:text-xl font-semibold mt-1",w>0?"text-red-600":"text-gray-900"),children:l(w)})]}),w>0&&S>0&&e("div",{className:"border border-red-200 bg-red-50 rounded-lg p-3 sm:p-4",children:[t("p",{className:"text-xs text-gray-500 font-medium",children:s("usage.estOverageCost")}),t("p",{className:"text-lg sm:text-xl font-semibold mt-1 text-red-600",children:d(S,k)})]})]}),w>0&&t("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4",children:e("div",{className:"flex items-start gap-3",children:[t(Ci,{className:"h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5 hidden sm:block"}),e("div",{className:"flex-1",children:[t("h3",{className:"text-sm font-semibold text-amber-800 mb-1",children:s("usage.overageDetected")}),t("p",{className:"text-sm text-amber-700",children:s("usage.overageWarning",{count:w})}),S>0&&t("p",{className:"text-sm text-amber-700 font-medium mt-1",children:s("usage.estOverageCharges",{amount:d(S,k)})})]})]})}),t("div",{className:"space-y-3",children:y.map(([e,r])=>{const n=(a=r.consumed,(i=r.included)<=0?a>0?100:0:Math.min(a/i*100,100));var a,i;const s=function(e,t){return t?{bar:"bg-red-500",bg:"bg-red-100",badge:"bg-red-100",badgeText:"text-red-800"}:e>=90?{bar:"bg-amber-500",bg:"bg-amber-100",badge:"bg-amber-100",badgeText:"text-amber-800"}:e>=75?{bar:"bg-yellow-500",bg:"bg-yellow-100",badge:"bg-yellow-100",badgeText:"text-yellow-800"}:{bar:"bg-blue-500",bg:"bg-blue-100",badge:"bg-blue-100",badgeText:"text-blue-800"}}(n,r.hasOverage),o=g[e];return t(NS,{slug:e,quota:r,percent:n,colors:s,pricing:o},e)})})]})};function NS({slug:r,quota:n,percent:a,colors:i,pricing:s}){const{t:o,formattingLocale:c}=xn(),l=e=>function(e,t){return e>=1e6?(e/1e6).toLocaleString(t,{maximumFractionDigits:1})+"M":e>=1e3?(e/1e3).toLocaleString(t,{maximumFractionDigits:1})+"K":e.toLocaleString(t)}(e,c),u=(e,t)=>SS(e,t,c);return e("div",{className:"border border-gray-200 rounded-lg p-4 sm:p-5",children:[e("div",{className:"flex flex-wrap items-center justify-between gap-y-1 mb-3",children:[e("div",{className:"flex items-center gap-2 min-w-0",children:[t("h3",{className:"text-sm font-semibold text-gray-900 truncate",children:xS(r)}),n.hasOverage&&t("span",{className:Oe("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",i.badge,i.badgeText),children:o("usage.overage")}),!n.hasOverage&&a>=90&&t("span",{className:Oe("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",i.badge,i.badgeText),children:o("usage.almostFull")})]}),e("span",{className:"text-sm text-gray-500 whitespace-nowrap",children:[l(n.consumed)," / ",l(n.included)]})]}),t("div",{className:Oe("h-2 rounded-full w-full",i.bg),children:t("div",{className:Oe("h-2 rounded-full transition-all duration-500",i.bar),style:{width:`${a}%`}})}),e("div",{className:"flex items-center justify-between mt-2 text-xs text-gray-500",children:[t("span",{children:o("usage.percentUsed",{percent:Math.round(a)})}),t("span",{children:n.available>0?o("usage.availableRemaining",{count:l(n.available)}):n.hasOverage?o("usage.overLimitCount",{count:l(n.overage)}):o("usage.fullyUsed")})]}),n.hasOverage&&s&&e("div",{className:"mt-3 pt-3 border-t border-gray-200 space-y-2",children:[e("div",{className:"flex items-center justify-between text-xs",children:[t("span",{className:"text-gray-500",children:o("usage.overageUnits")}),t("span",{className:"font-medium text-gray-900",children:l(n.overage)})]}),e("div",{className:"flex items-center justify-between text-xs",children:[t("span",{className:"text-gray-500",children:o("usage.rate")}),t("span",{className:"font-medium text-gray-900",children:o("usage.rateDisplay",{rate:u(s.overageCents/100,s.currencySymbol),unitSize:s.unitSize})})]}),s.unitSize>1&&e("div",{className:"flex items-center justify-between text-xs",children:[t("span",{className:"text-gray-500",children:o("usage.billableBlocks")}),t("span",{className:"font-medium text-gray-900",children:l(Math.ceil(n.overage/s.unitSize))})]}),e("div",{className:"flex items-center justify-between text-xs pt-2 border-t border-gray-200",children:[t("span",{className:"font-medium text-red-600",children:o("usage.estimatedCharge")}),t("span",{className:"font-semibold text-red-600",children:u(s.estimatedCost,s.currencySymbol)})]})]}),!n.hasOverage&&s&&t("div",{className:"mt-2 text-xs text-gray-500",children:o("usage.overageRateDisplay",{rate:o("usage.rateDisplay",{rate:u(s.overageCents/100,s.currencySymbol),unitSize:s.unitSize})})})]})}function CS(e){const t=n.forwardRef((e,t)=>{const{children:r,...a}=e;if(n.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),i=function(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{const t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}(a,r.props);return r.type!==n.Fragment&&(i.ref=t?Ti(t,e):e),n.cloneElement(r,i)}return n.Children.count(r)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var AS=Symbol("radix.slottable");function _S(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===AS}var PS=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});n.forwardRef((e,r)=>t(ns.span,{...e,ref:r,style:{...PS,...e.style}})).displayName="VisuallyHidden";var TS=[" ","Enter","ArrowUp","ArrowDown"],RS=[" ","Enter"],DS="Select",[IS,US,MS]=Ng(DS),[LS]=$i(DS,[MS,Xw]),OS=Xw(),[zS,FS]=LS(DS),[BS,WS]=LS(DS),VS=r=>{const{__scopeSelect:a,children:i,open:s,defaultOpen:o,onOpenChange:c,value:l,defaultValue:u,onValueChange:d,dir:p,name:m,autoComplete:h,disabled:f,required:g,form:b}=r,v=OS(a),[y,w]=n.useState(null),[x,S]=n.useState(null),[k,E]=n.useState(!1),N=Ag(p),[C,A]=Qi({prop:s,defaultProp:o??!1,onChange:c,caller:DS}),[_,P]=Qi({prop:l,defaultProp:u,onChange:d,caller:DS}),T=n.useRef(null),R=!y||(b||!!y.closest("form")),[D,I]=n.useState(new Set),U=Array.from(D).map(e=>e.props.value).join(";");return t(hx,{...v,children:e(zS,{required:g,scope:a,trigger:y,onTriggerChange:w,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:k,onValueNodeHasChildrenChange:E,contentId:Yi(),value:_,onValueChange:P,open:C,onOpenChange:A,dir:N,triggerPointerDownPosRef:T,disabled:f,children:[t(IS.Provider,{scope:a,children:t(BS,{scope:r.__scopeSelect,onNativeOptionAdd:n.useCallback(e=>{I(t=>new Set(t).add(e))},[]),onNativeOptionRemove:n.useCallback(e=>{I(t=>{const r=new Set(t);return r.delete(e),r})},[]),children:i})}),R?e(Ck,{"aria-hidden":!0,required:g,tabIndex:-1,name:m,autoComplete:h,value:_,onChange:e=>P(e.target.value),disabled:f,form:b,children:[void 0===_?t("option",{value:""}):null,Array.from(D)]},U):null]})})};VS.displayName=DS;var jS="SelectTrigger",HS=n.forwardRef((e,r)=>{const{__scopeSelect:a,disabled:i=!1,...s}=e,o=OS(a),c=FS(jS,a),l=c.disabled||i,u=Ri(r,c.onTriggerChange),d=US(a),p=n.useRef("touch"),[m,h,f]=_k(e=>{const t=d().filter(e=>!e.disabled),r=t.find(e=>e.value===c.value),n=Pk(t,e,r);void 0!==n&&c.onValueChange(n.value)}),g=e=>{l||(c.onOpenChange(!0),f()),e&&(c.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t(fx,{asChild:!0,...o,children:t(ns.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Ak(c.value)?"":void 0,...s,ref:u,onClick:Gi(s.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:Gi(s.onPointerDown,e=>{p.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:Gi(s.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||TS.includes(e.key)&&(g(),e.preventDefault())})})})});HS.displayName=jS;var GS="SelectValue",$S=n.forwardRef((e,n)=>{const{__scopeSelect:a,className:i,style:s,children:o,placeholder:c="",...l}=e,u=FS(GS,a),{onValueNodeHasChildrenChange:d}=u,p=void 0!==o,m=Ri(n,u.onValueNodeChange);return qi(()=>{d(p)},[d,p]),t(ns.span,{...l,ref:m,style:{pointerEvents:"none"},children:Ak(u.value)?t(r,{children:c}):o})});$S.displayName=GS;var KS=n.forwardRef((e,r)=>{const{__scopeSelect:n,children:a,...i}=e;return t(ns.span,{"aria-hidden":!0,...i,ref:r,children:a||"▼"})});KS.displayName="SelectIcon";var qS=e=>t(ks,{asChild:!0,...e});qS.displayName="SelectPortal";var ZS="SelectContent",JS=n.forwardRef((e,r)=>{const a=FS(ZS,e.__scopeSelect),[i,s]=n.useState();if(qi(()=>{s(new DocumentFragment)},[]),!a.open){const r=i;return r?y.createPortal(t(XS,{scope:e.__scopeSelect,children:t(IS.Slot,{scope:e.__scopeSelect,children:t("div",{children:e.children})})}),r):null}return t(tk,{...e,ref:r})});JS.displayName=ZS;var YS=10,[XS,QS]=LS(ZS),ek=function(e){const r=CS(e),a=n.forwardRef((e,a)=>{const{children:i,...s}=e,o=n.Children.toArray(i),c=o.find(_S);if(c){const e=c.props.children,i=o.map(t=>t===c?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t);return t(r,{...s,ref:a,children:n.isValidElement(e)?n.cloneElement(e,void 0,i):null})}return t(r,{...s,ref:a,children:i})});return a.displayName=`${e}.Slot`,a}("SelectContent.RemoveScroll"),tk=n.forwardRef((e,r)=>{const{__scopeSelect:a,position:i="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:c,side:l,sideOffset:u,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:b,avoidCollisions:v,...y}=e,w=FS(ZS,a),[x,S]=n.useState(null),[k,E]=n.useState(null),N=Ri(r,e=>S(e)),[C,A]=n.useState(null),[_,P]=n.useState(null),T=US(a),[R,D]=n.useState(!1),I=n.useRef(!1);n.useEffect(()=>{if(x)return ko(x)},[x]),As();const U=n.useCallback(e=>{const[t,...r]=T().map(e=>e.ref.current),[n]=r.slice(-1),a=document.activeElement;for(const r of e){if(r===a)return;if(r?.scrollIntoView({block:"nearest"}),r===t&&k&&(k.scrollTop=0),r===n&&k&&(k.scrollTop=k.scrollHeight),r?.focus(),document.activeElement!==a)return}},[T,k]),M=n.useCallback(()=>U([C,x]),[U,C,x]);n.useEffect(()=>{R&&M()},[R,M]);const{onOpenChange:L,triggerPointerDownPosRef:O}=w;n.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(O.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(O.current?.y??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():x.contains(r.target)||L(!1),document.removeEventListener("pointermove",t),O.current=null};return null!==O.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[x,L,O]),n.useEffect(()=>{const e=()=>L(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[L]);const[z,F]=_k(e=>{const t=T().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=Pk(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),B=n.useCallback((e,t,r)=>{const n=!I.current&&!r;(void 0!==w.value&&w.value===t||n)&&(A(e),n&&(I.current=!0))},[w.value]),W=n.useCallback(()=>x?.focus(),[x]),V=n.useCallback((e,t,r)=>{const n=!I.current&&!r;(void 0!==w.value&&w.value===t||n)&&P(e)},[w.value]),j="popper"===i?nk:rk,H=j===nk?{side:l,sideOffset:u,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:b,avoidCollisions:v}:{};return t(XS,{scope:a,content:x,viewport:k,onViewportChange:E,itemRefCallback:B,selectedItem:C,onItemLeave:W,itemTextRefCallback:V,focusSelectedItem:M,selectedItemText:_,position:i,isPositioned:R,searchRef:z,children:t(go,{as:ek,allowPinchZoom:!0,children:t(gs,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Gi(s,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:t(us,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:t(j,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault(),...y,...H,onPlaced:()=>D(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Gi(y.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||F(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=T().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout(()=>U(t)),e.preventDefault()}})})})})})})});tk.displayName="SelectContentImpl";var rk=n.forwardRef((e,r)=>{const{__scopeSelect:a,onPlaced:i,...s}=e,o=FS(ZS,a),c=QS(ZS,a),[l,u]=n.useState(null),[d,p]=n.useState(null),m=Ri(r,e=>p(e)),h=US(a),f=n.useRef(!1),g=n.useRef(!0),{viewport:b,selectedItem:v,selectedItemText:y,focusSelectedItem:w}=c,x=n.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&d&&b&&v&&y){const e=o.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),r=o.valueNode.getBoundingClientRect(),n=y.getBoundingClientRect();if("rtl"!==o.dir){const a=n.left-t.left,i=r.left-a,s=e.left-i,o=e.width+s,c=Math.max(o,t.width),u=window.innerWidth-YS,d=vb(i,[YS,Math.max(YS,u-c)]);l.style.minWidth=o+"px",l.style.left=d+"px"}else{const a=t.right-n.right,i=window.innerWidth-r.right-a,s=window.innerWidth-e.right-i,o=e.width+s,c=Math.max(o,t.width),u=window.innerWidth-YS,d=vb(i,[YS,Math.max(YS,u-c)]);l.style.minWidth=o+"px",l.style.right=d+"px"}const a=h(),s=window.innerHeight-2*YS,c=b.scrollHeight,u=window.getComputedStyle(d),p=parseInt(u.borderTopWidth,10),m=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),w=p+m+c+parseInt(u.paddingBottom,10)+g,x=Math.min(5*v.offsetHeight,w),S=window.getComputedStyle(b),k=parseInt(S.paddingTop,10),E=parseInt(S.paddingBottom,10),N=e.top+e.height/2-YS,C=s-N,A=v.offsetHeight/2,_=p+m+(v.offsetTop+A),P=w-_;if(_<=N){const e=a.length>0&&v===a[a.length-1].ref.current;l.style.bottom="0px";const t=d.clientHeight-b.offsetTop-b.offsetHeight,r=_+Math.max(C,A+(e?E:0)+t+g);l.style.height=r+"px"}else{const e=a.length>0&&v===a[0].ref.current;l.style.top="0px";const t=Math.max(N,p+b.offsetTop+(e?k:0)+A)+P;l.style.height=t+"px",b.scrollTop=_-N+b.offsetTop}l.style.margin=`${YS}px 0`,l.style.minHeight=x+"px",l.style.maxHeight=s+"px",i?.(),requestAnimationFrame(()=>f.current=!0)}},[h,o.trigger,o.valueNode,l,d,b,v,y,o.dir,i]);qi(()=>x(),[x]);const[S,k]=n.useState();qi(()=>{d&&k(window.getComputedStyle(d).zIndex)},[d]);const E=n.useCallback(e=>{e&&!0===g.current&&(x(),w?.(),g.current=!1)},[x,w]);return t(ak,{scope:a,contentWrapper:l,shouldExpandOnScrollRef:f,onScrollButtonChange:E,children:t("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:t(ns.div,{...s,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});rk.displayName="SelectItemAlignedPosition";var nk=n.forwardRef((e,r)=>{const{__scopeSelect:n,align:a="start",collisionPadding:i=YS,...s}=e,o=OS(n);return t(gx,{...o,...s,ref:r,align:a,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});nk.displayName="SelectPopperPosition";var[ak,ik]=LS(ZS,{}),sk="SelectViewport",ok=n.forwardRef((a,i)=>{const{__scopeSelect:s,nonce:o,...c}=a,l=QS(sk,s),u=ik(sk,s),d=Ri(i,l.onViewportChange),p=n.useRef(0);return e(r,{children:[t("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),t(IS.Slot,{scope:s,children:t(ns.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:Gi(c.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=u;if(n?.current&&r){const e=Math.abs(p.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*YS,a=parseFloat(r.style.minHeight),i=parseFloat(r.style.height),s=Math.max(a,i);if(s<n){const a=s+e,i=Math.min(n,a),o=a-i;r.style.height=i+"px","0px"===r.style.bottom&&(t.scrollTop=o>0?o:0,r.style.justifyContent="flex-end")}}}p.current=t.scrollTop})})})]})});ok.displayName=sk;var ck="SelectGroup",[lk,uk]=LS(ck);n.forwardRef((e,r)=>{const{__scopeSelect:n,...a}=e,i=Yi();return t(lk,{scope:n,id:i,children:t(ns.div,{role:"group","aria-labelledby":i,...a,ref:r})})}).displayName=ck;var dk="SelectLabel",pk=n.forwardRef((e,r)=>{const{__scopeSelect:n,...a}=e,i=uk(dk,n);return t(ns.div,{id:i.id,...a,ref:r})});pk.displayName=dk;var mk="SelectItem",[hk,fk]=LS(mk),gk=n.forwardRef((e,r)=>{const{__scopeSelect:a,value:i,disabled:s=!1,textValue:o,...c}=e,l=FS(mk,a),u=QS(mk,a),d=l.value===i,[p,m]=n.useState(o??""),[h,f]=n.useState(!1),g=Ri(r,e=>u.itemRefCallback?.(e,i,s)),b=Yi(),v=n.useRef("touch"),y=()=>{s||(l.onValueChange(i),l.onOpenChange(!1))};if(""===i)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t(hk,{scope:a,value:i,disabled:s,textId:b,isSelected:d,onItemTextChange:n.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:t(IS.ItemSlot,{scope:a,value:i,disabled:s,textValue:p,children:t(ns.div,{role:"option","aria-labelledby":b,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...c,ref:g,onFocus:Gi(c.onFocus,()=>f(!0)),onBlur:Gi(c.onBlur,()=>f(!1)),onClick:Gi(c.onClick,()=>{"mouse"!==v.current&&y()}),onPointerUp:Gi(c.onPointerUp,()=>{"mouse"===v.current&&y()}),onPointerDown:Gi(c.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:Gi(c.onPointerMove,e=>{v.current=e.pointerType,s?u.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Gi(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:Gi(c.onKeyDown,e=>{""!==u.searchRef?.current&&" "===e.key||(RS.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});gk.displayName=mk;var bk="SelectItemText",vk=n.forwardRef((a,i)=>{const{__scopeSelect:s,className:o,style:c,...l}=a,u=FS(bk,s),d=QS(bk,s),p=fk(bk,s),m=WS(bk,s),[h,f]=n.useState(null),g=Ri(i,e=>f(e),p.onItemTextChange,e=>d.itemTextRefCallback?.(e,p.value,p.disabled)),b=h?.textContent,v=n.useMemo(()=>t("option",{value:p.value,disabled:p.disabled,children:b},p.value),[p.disabled,p.value,b]),{onNativeOptionAdd:w,onNativeOptionRemove:x}=m;return qi(()=>(w(v),()=>x(v)),[w,x,v]),e(r,{children:[t(ns.span,{id:p.textId,...l,ref:g}),p.isSelected&&u.valueNode&&!u.valueNodeHasChildren?y.createPortal(l.children,u.valueNode):null]})});vk.displayName=bk;var yk="SelectItemIndicator",wk=n.forwardRef((e,r)=>{const{__scopeSelect:n,...a}=e;return fk(yk,n).isSelected?t(ns.span,{"aria-hidden":!0,...a,ref:r}):null});wk.displayName=yk;var xk="SelectScrollUpButton";n.forwardRef((e,r)=>{const a=QS(xk,e.__scopeSelect),i=ik(xk,e.__scopeSelect),[s,o]=n.useState(!1),c=Ri(r,i.onScrollButtonChange);return qi(()=>{if(a.viewport&&a.isPositioned){let e=function(){const e=t.scrollTop>0;o(e)};const t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),s?t(kk,{...e,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=xk;var Sk="SelectScrollDownButton";n.forwardRef((e,r)=>{const a=QS(Sk,e.__scopeSelect),i=ik(Sk,e.__scopeSelect),[s,o]=n.useState(!1),c=Ri(r,i.onScrollButtonChange);return qi(()=>{if(a.viewport&&a.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;o(r)};const t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),s?t(kk,{...e,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=Sk;var kk=n.forwardRef((e,r)=>{const{__scopeSelect:a,onAutoScroll:i,...s}=e,o=QS("SelectScrollButton",a),c=n.useRef(null),l=US(a),u=n.useCallback(()=>{null!==c.current&&(window.clearInterval(c.current),c.current=null)},[]);return n.useEffect(()=>()=>u(),[u]),qi(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),t(ns.div,{"aria-hidden":!0,...s,ref:r,style:{flexShrink:0,...s.style},onPointerDown:Gi(s.onPointerDown,()=>{null===c.current&&(c.current=window.setInterval(i,50))}),onPointerMove:Gi(s.onPointerMove,()=>{o.onItemLeave?.(),null===c.current&&(c.current=window.setInterval(i,50))}),onPointerLeave:Gi(s.onPointerLeave,()=>{u()})})}),Ek=n.forwardRef((e,r)=>{const{__scopeSelect:n,...a}=e;return t(ns.div,{"aria-hidden":!0,...a,ref:r})});Ek.displayName="SelectSeparator";var Nk="SelectArrow";n.forwardRef((e,r)=>{const{__scopeSelect:n,...a}=e,i=OS(n),s=FS(Nk,n),o=QS(Nk,n);return s.open&&"popper"===o.position?t(bx,{...i,...a,ref:r}):null}).displayName=Nk;var Ck=n.forwardRef(({__scopeSelect:e,value:r,...a},i)=>{const s=n.useRef(null),o=Ri(i,s),c=Hl(r);return n.useEffect(()=>{const e=s.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(c!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[c,r]),t(ns.select,{...a,style:{...PS,...a.style},ref:o,defaultValue:r})});function Ak(e){return""===e||void 0===e}function _k(e){const t=as(e),r=n.useRef(""),a=n.useRef(0),i=n.useCallback(e=>{const n=r.current+e;t(n),function e(t){r.current=t,window.clearTimeout(a.current),""!==t&&(a.current=window.setTimeout(()=>e(""),1e3))}(n)},[t]),s=n.useCallback(()=>{r.current="",window.clearTimeout(a.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(a.current),[]),[r,i,s]}function Pk(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=r?e.indexOf(r):-1;let i=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(a,0));1===n.length&&(i=i.filter(e=>e!==r));const s=i.find(e=>e.textValue.toLowerCase().startsWith(n.toLowerCase()));return s!==r?s:void 0}Ck.displayName="SelectBubbleInput";var Tk=HS,Rk=KS,Dk=qS,Ik=JS,Uk=ok,Mk=pk,Lk=gk,Ok=vk,zk=wk,Fk=Ek;const Bk=VS,Wk=n.forwardRef(({className:r,children:n,...a},i)=>e(Tk,{ref:i,className:Oe("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",r),...a,children:[n,t(Rk,{asChild:!0,children:t(gc,{className:"h-4 w-4 opacity-50"})})]}));Wk.displayName=Tk.displayName;const Vk=n.forwardRef(({className:e,children:r,position:a="popper",...i},s)=>{const{container:o}=n.useContext(kc);return t(Dk,{container:o,children:t(Ik,{ref:s,className:Oe("relative z-50 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","popper"===a&&"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:a,...i,children:t(Uk,{className:Oe("p-1","popper"===a&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r})})})});Vk.displayName=Ik.displayName;n.forwardRef(({className:e,...r},n)=>t(Mk,{ref:n,className:Oe("px-2 py-1.5 text-sm font-semibold",e),...r})).displayName=Mk.displayName;const jk=n.forwardRef(({className:r,children:n,...a},i)=>e(Lk,{ref:i,className:Oe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 ps-2 pe-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),...a,children:[t("span",{className:"absolute end-2 flex h-3.5 w-3.5 items-center justify-center",children:t(zk,{children:t(vc,{className:"h-4 w-4"})})}),t(Ok,{children:n})]}));jk.displayName=Lk.displayName;function Hk(e,t){const{response:r}=oa();return o(()=>{if(!e)return{hasSeatPricing:!1,memberCount:0,includedSeats:0,maxUsers:0,maxSeats:0,limitSource:"none",billableSeats:0,availableSeats:1/0,isAtMax:!1,isNearMax:!1,perSeatPriceCents:null,currency:"",canInvite:!0,inviteBlockReason:null,inviteBlockMessageKey:null,inviteBlockMessageValues:null};const n=e.users?.length??0,a=r?.planVersion,i=r?.subscription,s=e.billingCurrency||"usd",o=Ma({planVersion:a,currency:s,settingsMaxUsers:t?.settingsMaxUsers}),{maxUsers:c,hasSeatPricing:l,includedSeats:u}=o,d=l?Math.max(0,n-u):0,p=c>0?Math.max(0,c-n):1/0,m=c>0&&n>=c,h=c>0&&n>=.8*c&&!m,f=l&&a?Ua(a,s,i?.billingInterval??"monthly"):null,g=La({memberCount:n,maxUsersConfig:o});return{hasSeatPricing:l,memberCount:n,includedSeats:u,maxUsers:c,maxSeats:c,limitSource:o.source,billableSeats:d,availableSeats:p,isAtMax:m,isNearMax:h,perSeatPriceCents:f,currency:s,canInvite:g.canInvite,inviteBlockReason:g.blockReason,inviteBlockMessageKey:g.blockMessageKey,inviteBlockMessageValues:g.blockMessageValues}},[r,e,t?.settingsMaxUsers])}n.forwardRef(({className:e,...r},n)=>t(Fk,{ref:n,className:Oe("-mx-1 my-1 h-px bg-muted",e),...r})).displayName=Fk.displayName;const Gk=({workspace:n})=>{const{user:a}=Fl(),{t:i,fmtNum:s,fmtCents:o}=xn(),[c,l]=m(0),[u,p]=m(!1),[h,f]=m([]),[g,b]=m(null),{getUsers:v,removeUser:y,updateUser:w}=rE(),{settings:x}=Fn(),{can:S}=Bl(),{response:k}=oa(),E=Hk(n,{settingsMaxUsers:x?.workspace?.maxWorkspaceUsers});d(()=>{n&&(p(!0),v(n._id).then(e=>{f(e)}).catch(e=>{Ke(e,{component:"WorkspaceSettingsUsers",action:"getUsers",metadata:{workspaceId:n._id}})}).finally(()=>{p(!1)}))},[n,c]);const N=()=>{l(e=>e+1)},C=x?.workspace?.mode===mS;if(u||!n)return t(Vl,{});if(C)return null;const A=e=>"string"==typeof e?{name:i("users.unknownUser"),email:e,id:e,role:"-"}:{name:e.name,email:e.email,id:e._id},_=h.map(e=>({...e,...A(e.user)})),P=S(El.WORKSPACE_MEMBERS_INVITE),T=S(El.WORKSPACE_MEMBERS_REMOVE),R=S(El.WORKSPACE_MEMBERS_ROLE_CHANGE),{hasSeatPricing:D,includedSeats:I,maxUsers:U,canInvite:M,inviteBlockReason:L,inviteBlockMessageKey:O,inviteBlockMessageValues:z,perSeatPriceCents:F,currency:B}=E,W=h.length,V=k?.subscription?.billingInterval??"monthly",j=D&&W>=I;return e("div",{children:[!P&&!T&&!R&&t("div",{className:"text-red-500",children:i("users.adminOnly")}),P&&t("div",{className:"mb-4",children:M?e("div",{children:[t($k,{onInvite:N,workspaceId:n._id}),j&&F&&F>0&&t("div",{className:"flex items-center gap-1.5 mt-2 text-xs text-amber-600 bg-amber-50 px-3 py-1.5 rounded-md",children:t("span",{children:i("users.extraSeatCost",{price:o(F,B),interval:V})})})]}):t("div",{className:"flex items-center justify-between p-3 bg-red-50 border border-red-100 rounded-md",children:e("div",{children:[t("p",{className:"text-sm font-medium text-red-700",children:i("users.limitReached",{reason:L??"member_limit_reached"})}),t("p",{className:"text-xs text-red-600 mt-0.5",children:O?i(O,z??void 0):""})]})})}),(D||U>0)&&e("div",{className:"mb-4 rounded-lg border bg-gray-50 p-4",children:[e("div",{className:"flex items-center justify-between mb-2",children:[t("h4",{className:"text-sm font-semibold text-gray-900",children:i("users.seatHeading",{hasSeatPricing:String(D)})}),U>0&&e("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full "+(W>=U?"bg-red-100 text-red-700":W>=.8*U?"bg-amber-100 text-amber-700":"bg-emerald-100 text-emerald-700"),children:[s(W)," / ",s(U)]})]}),U>0&&t("div",{className:"w-full h-1.5 bg-gray-200 rounded-full mb-3",children:t("div",{className:"h-1.5 rounded-full transition-all "+(W>=U?"bg-red-500":W>=.8*U?"bg-amber-500":"bg-emerald-500"),style:{width:`${Math.min(100,W/U*100)}%`}})}),e("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[t("div",{children:D?e(r,{children:[t("span",{className:"text-gray-900 font-medium",children:s(I)})," ",i("users.included"),F&&F>0&&e("span",{className:"text-gray-400",children:[" ","· ",o(F,B),i("users.perExtraSeat")]})]}):e("span",{children:[t("span",{className:"text-gray-900 font-medium",children:s(U)})," ",i("users.maxMembers")]})}),U>0?e("span",{children:[s(Math.max(0,U-W))," ",i("users.available")]}):t("span",{className:"text-gray-400",children:i("users.noMemberLimit")})]})]}),e("div",{className:"mb-4 flex items-center justify-between",children:[t("div",{children:t("div",{className:"text-sm text-gray-600",children:i("users.memberCount",{count:W})})}),t("div",{children:t(Hi,{variant:"ghost",size:"sm",onClick:N,progress:u,children:i("settings.common.refreshAction",{loading:String(u)})})})]}),t("ul",{className:"space-y-2",children:_.map((r,s)=>{const o=r.id===a?.id,c=("object"==typeof n.createdBy&&null!==n.createdBy?n.createdBy._id:n.createdBy)===r.id;return e("li",{className:"border rounded p-3",children:[e("div",{className:"flex items-center justify-between gap-2",children:[e("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0",children:[t("div",{className:"w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center text-sm font-medium shrink-0",children:r.name.charAt(0).toUpperCase()}),e("div",{className:"min-w-0",children:[t("div",{className:"font-medium text-sm truncate",children:r.name}),t("div",{className:"text-xs text-gray-500 truncate",children:r.email})]})]}),e("div",{className:"flex items-center gap-1 shrink-0",children:[o&&t("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-0.5 rounded",children:i("users.you")}),c&&t("span",{className:"text-xs bg-purple-100 text-purple-800 px-2 py-0.5 rounded",children:i("users.owner")})]})]}),R&&e("div",{className:"flex items-center gap-2 mt-2 pt-2 border-t border-gray-100 sm:mt-0 sm:pt-0 sm:border-0",children:[e("div",{className:"relative flex-1 sm:flex-initial",children:[e(Bk,{disabled:o||!R||c||g===r.id,value:r.role,onValueChange:e=>{return t=n._id,a=r.id,i=e,void(Sl(n,a)?Ke(new Error("Cannot change the role of the workspace owner"),{component:"WorkspaceSettingsUsers",action:"handleUpdateRole",metadata:{workspaceId:t,userId:a,role:i}}):(b(a),w(t,a,{role:i}).then(()=>{N()}).catch(e=>{Ke(e,{component:"WorkspaceSettingsUsers",action:"handleUpdateRole",metadata:{workspaceId:t,userId:a,role:i}})}).finally(()=>{b(null)})));var t,a,i},children:[t(Wk,{children:t($S,{placeholder:i("users.selectRole")})}),t(Vk,{children:n?.roles.map(e=>t(jk,{value:e,children:e},e))})]}),g===r.id&&t("div",{className:"absolute end-8 top-1/2 -translate-y-1/2 pointer-events-none",children:t(pi,{className:"h-4 w-4 animate-spin text-gray-500"})})]}),!o&&!c&&T&&t(Hi,{variant:"destructive",size:"sm",startIcon:t(Ni,{}),onClick:()=>{return e=r.id,void(Sl(n,e)?Ke(new Error("Cannot remove the workspace owner"),{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:n._id,userId:e}}):y(n._id,e).then(()=>{N()}).catch(t=>{Ke(t,{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:n._id,userId:e}})}));var e}})]})]},s)})}),0===h.length&&t("div",{className:"text-center py-8 text-gray-500",children:i("users.noMembers")})]})};function $k({onInvite:r,workspaceId:n}){const{t:a}=xn(),{addUser:i,getWorkspace:o}=rE(),{settings:c}=Fn(),[l,u]=m(""),[p,h]=m("admin"),[f,g]=m(!1),[b,v]=m(null),[y,w]=m(null),[x,S]=m(null),k=s(null),E=c?.workspace.roles??x?.roles??[];d(()=>()=>{k.current&&clearTimeout(k.current)},[]),d(()=>{n&&o(n).then(S)},[n]);const N=()=>{v(null),w(null),u(""),h("admin")};return e("div",{className:"flex gap-2 flex-col gap-y-2",children:[b&&t("div",{className:"text-red-500",children:b}),y&&t("div",{className:"text-green-500",children:y}),e("div",{children:[t(lg,{children:a("users.inviteByEmail")}),t(wg,{type:"email",value:l,onChange:e=>u(e.target.value),placeholder:"example@example.com"})]}),e("div",{children:[t(lg,{children:a("users.role")}),e(Bk,{value:p,onValueChange:h,children:[t(Wk,{children:t($S,{placeholder:a("users.selectRole")})}),t(Vk,{children:E.map(e=>t(jk,{value:e,children:e},e))})]})]}),t("div",{children:t(Hi,{progress:f,onClick:async()=>{const e=l.trim();if(!e)return void v(a("users.emailRequired"));/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?(g(!0),await i(n,e,p).then(()=>{w(a("users.inviteSuccess")),r?.()}).catch(t=>{Ke(t,{component:"InviteMember",action:"addUser",metadata:{workspaceId:n,email:e,role:p}}),v(t instanceof Error?t.message:a("users.inviteFailed"))}).finally(()=>{g(!1),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{N()},6e3)})):v(a("users.invalidEmail"))},disabled:f||!l||!p,children:f?a("users.inviting"):a("users.inviteAs",{role:p})})})]})}const Kk=({workspace:r,section:n,setSection:a})=>{const{t:i}=xn(),{settings:s}=Fn(),{can:o}=Bl(),{appPermissions:c}=ua(),l=s?.workspace?.mode===mS,u=o(El.WORKSPACE_DELETE),d=c&&Object.keys(c).length>0;return e("div",{className:"w-44 sm:w-56 h-full flex flex-col space-y-4 sm:space-y-6 shrink-0",children:[r&&t("div",{className:"border-b p-2 py-4",children:e("div",{className:"flex items-center gap-x-2",children:[r.image&&r.image.trim()&&t("div",{className:"bg-blue-100 rounded flex items-center justify-center text-blue-600 font-medium px-0.5 py-0.5",style:{width:"40px",height:"40px",minWidth:"40px",minHeight:"40px"},children:t("img",{src:r.image,className:"w-full h-full object-contain",style:{width:"36px",height:"36px",maxWidth:"36px",maxHeight:"36px",objectFit:"contain"},alt:r.name})}),e("div",{className:Oe("flex-1 min-w-0",r.image?"":"ps-2"),children:[t("div",{className:"font-medium text-sm line-clamp-1 text-ellipsis overflow-hidden",children:r.name}),t("div",{className:"text-xs text-gray-500",children:r.workspaceId})]})]})}),t(qk,{title:i("settings.sidebar.account"),children:t(Zk,{activeSection:n,icon:t(Ai,{className:"h-3.5 w-3.5"}),label:i("settings.sidebar.profile"),section:Jk.Profile,onClick:()=>a(Jk.Profile)})}),e(qk,{title:i("settings.sidebar.workspace"),children:[o(El.WORKSPACE_SETTINGS_VIEW)&&t(Zk,{activeSection:n,icon:t(vi,{className:"h-3.5 w-3.5"}),label:i("settings.sidebar.general"),section:Jk.General,onClick:()=>a(Jk.General)}),!l&&o(El.WORKSPACE_MEMBERS_VIEW)&&t(Zk,{activeSection:n,icon:t(_i,{className:"h-3.5 w-3.5"}),label:i("settings.sidebar.users"),section:Jk.Users,onClick:()=>a(Jk.Users)}),o(El.WORKSPACE_BILLING_VIEW)&&t(Zk,{activeSection:n,icon:t(oi,{className:"h-3.5 w-3.5"}),label:i("settings.sidebar.subscription"),section:Jk.Subscription,onClick:()=>a(Jk.Subscription)}),o(El.WORKSPACE_USAGE_VIEW)&&t(Zk,{activeSection:n,icon:t(ai,{className:"h-3.5 w-3.5"}),label:i("settings.sidebar.usage"),section:Jk.Usage,onClick:()=>a(Jk.Usage)}),o(El.WORKSPACE_FEATURES_VIEW)&&t(Zk,{activeSection:n,icon:t(ki,{className:"h-3.5 w-3.5"}),label:i("settings.sidebar.features"),section:Jk.Features,onClick:()=>a(Jk.Features)}),t(Zk,{activeSection:n,icon:t(ti,{className:"h-3.5 w-3.5"}),label:i("settings.sidebar.notifications"),section:Jk.Notifications,onClick:()=>a(Jk.Notifications)}),d&&!l&&t(Zk,{activeSection:n,icon:t(wi,{className:"h-3.5 w-3.5"}),label:i("settings.sidebar.permissions"),section:Jk.Permissions,onClick:()=>a(Jk.Permissions)}),u&&!l&&t(Zk,{activeSection:n,icon:t(Ci,{className:"h-3.5 w-3.5"}),label:i("settings.sidebar.danger"),section:Jk.Danger,onClick:()=>a(Jk.Danger)})]})]})};function qk({title:r,children:n}){return e("div",{className:"px-2 flex flex-col space-y-1",children:[t("div",{className:"text-xs font-bold mb-2 text-gray-500 uppercase tracking-wide px-2",children:r}),n]})}function Zk({icon:t,label:r,section:n,onClick:a,activeSection:i}){return e("button",{className:Oe("flex w-full text-start px-2 py-1 rounded text-sm items-center gap-x-1",n===i?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-200 hover:text-gray-700"),onClick:()=>a(n),children:[t,r]})}const Jk={Profile:"profile",General:"general",Users:"users",Subscription:"subscription",Usage:"usage",Features:"features",Notifications:"notifications",Permissions:"permissions",Danger:"danger"},Yk=new Set(Object.values(Jk)),Xk={[Jk.Profile]:"settings.titles.profile",[Jk.General]:"settings.titles.general",[Jk.Users]:"settings.titles.users",[Jk.Subscription]:"settings.titles.subscription",[Jk.Usage]:"settings.titles.usage",[Jk.Features]:"settings.titles.features",[Jk.Notifications]:"settings.titles.notifications",[Jk.Permissions]:"settings.titles.permissions",[Jk.Danger]:"settings.titles.danger"},Qk=({workspace:r,onClose:n,open:a,onOpenChange:i,defaultSection:s=Jk.Profile,section:o,onSectionChange:c,showTrigger:l=!0,trigger:u})=>{const{t:d,dir:p}=xn(),[h,f]=m(!1),[g,b]=m(s),v=void 0!==a?a:h,y=i||f,w=void 0!==o?o:g,x=c||b;if(!r)return null;const S=t(Hi,{variant:"outline",size:"icon",children:t(vi,{className:"h-4 w-4"})});return e(Nc,{open:v,onOpenChange:e=>{y(e),!e&&n&&n()},children:[l&&t(Cc,{asChild:!0,children:u||S}),e(Pc,{dir:p,className:"flex max-w-2xl min-w-full sm:min-w-[800px] p-0 m-0 bg-muted sm:min-h-[600px] min-h-full gap-x-0 space-x-0",children:[t(Dc,{className:"sr-only",children:d(Xk[w])}),t(Kk,{workspace:r,section:w,setSection:x}),e("div",{className:"flex-1 p-6 overflow-auto flex flex-col bg-background",children:[t(Rc,{className:"text-xl font-bold mb-4",children:d(Xk[w])}),e("div",{className:"sm:max-h-[500px] overflow-y-auto",children:[w===Jk.Profile&&t(sS,{workspace:r}),w===Jk.General&&t(iv,{workspace:r}),w===Jk.Users&&t(Gk,{workspace:r}),w===Jk.Subscription&&t(wS,{workspace:r}),w===Jk.Usage&&t(ES,{}),w===Jk.Features&&t(au,{workspaceId:r._id?.toString()}),w===Jk.Notifications&&t(pv,{workspace:r}),w===Jk.Permissions&&t(mv,{workspace:r}),w===Jk.Danger&&t(jl,{workspace:r})]})]})]})]})};var eE=Object.freeze({__proto__:null,SETTINGS_SCREENS:Yk,SettingsScreen:Jk,WorkspaceSettingsDialog:Qk,default:Qk});const tE=new class{constructor(){this.listeners=new Set,this.currentState={open:!1,section:Jk.Profile}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}getState(){return{...this.currentState}}openWorkspaceSettings(e,t){this.currentState={open:!0,section:e||Jk.Profile,params:t},this.notifyListeners()}closeSettings(){this.currentState={...this.currentState,open:!1,params:void 0},this.notifyListeners()}setSection(e){this.currentState={...this.currentState,section:e},this.notifyListeners()}clearParams(){this.currentState={...this.currentState,params:void 0}}notifyListeners(){this.listeners.forEach(e=>{e(this.currentState)})}},rE=()=>{const e=In(),{os:t,api:r}=Bn(),{settings:n}=Fn(),i=Un(e=>e.workspaces),s=Un(e=>e.auth.session?.user),o=p((t,r)=>{if((!(t._id===i.currentWorkspace?._id)||r?.forceEmit)&&t){const r=i.currentWorkspace;vl(t),e.workspaces(Tt(t)),$a.emitWorkspaceChanged(t,r).catch(e=>{Ke(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceChanged",metadata:{workspaceId:t._id}})})}},[i.currentWorkspace,e]),c=p(async(r,n)=>{const a=++h.current;e.workspaces(Lt(r._id));try{const e=t.auth?.callbacks?.onWorkspaceChange;if(e){const t=kl(r,s?.id);try{await e({workspace:r,user:s??null,role:t})}catch(e){throw Ke(e,{component:"useSaaSWorkspaces",action:"onWorkspaceChange",metadata:{workspaceId:r._id}}),e}if(a!==h.current)return}o(r,n)}finally{a===h.current&&e.workspaces(Lt(null))}},[e,t.auth?.callbacks?.onWorkspaceChange,o,s]);d(()=>{if(!i.isInitialized){const t=yl();if(e.workspaces(Dt(!0)),t){const e=i.workspaces.find(e=>e._id===t);e&&c(e,{forceEmit:!0}).catch(()=>{})}}},[i.isInitialized,i.workspaces,i.currentWorkspace,e,c]);const l=p(()=>{wl(),e.workspaces(Rt())},[e]),u=a.useRef(!1),m=a.useRef(!1),h=a.useRef(0),f=p(async()=>{if(!i.loading&&!u.current){u.current=!0,e.workspaces(It(!0)),e.workspaces(Ut(null));try{const t=await r.getWorkspaces();if(e.workspaces(Nt(t)),t.length>0){const e=yl();if(e&&xl(e,t)){const r=t.find(t=>t._id===e);if(r)try{await c(r,{forceEmit:!0})}catch{}}else{const e=t[0];try{await c(e,{forceEmit:!0})}catch{}}}}catch(t){e.workspaces(Ut(t instanceof Error?t.message:"Failed to fetch workspaces"))}finally{e.workspaces(It(!1)),u.current=!1}}},[r,i.loading,e,c]),g=p(async()=>{if(!i.refreshing&&!u.current){u.current=!0,e.workspaces(Mt(!0));try{const t=await r.getWorkspaces();e.workspaces(Nt(t))}catch(e){}finally{e.workspaces(Mt(!1)),u.current=!1}}},[r,i.refreshing,e]),b=p(async(t,n)=>{const a=await r.createWorkspace({name:t,image:n});e.workspaces(Ct(a)),await c(a),$a.emitWorkspaceCreated(a).catch(e=>{Ke(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceCreated",metadata:{workspaceId:a._id}})}),setTimeout(()=>{tE.openWorkspaceSettings(Jk.Subscription)},300)},[r,e,c]),v=p(async(t,n)=>{const a=await r.updateWorkspace(t._id,n);e.workspaces(At(a)),$a.emitWorkspaceUpdated(a).catch(e=>{Ke(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceUpdated",metadata:{workspaceId:a._id}})})},[r,e]),y=p(async()=>{if(m.current)return i.allFeatures.length>0?i.allFeatures:null;if(i.allFeatures.length>0)return i.allFeatures;m.current=!0;try{const t=await r.getFeatures();return e.workspaces(Pt(t)),t}catch(e){return Ke(e,{component:"useSaaSWorkspaces",action:"getFeatures"}),null}finally{m.current=!1}},[r,e,i.allFeatures]),w=p(async(e,t,n)=>await r.updateFeature(e,t,n),[r]),x=p(async e=>r.updateSettings(e),[r]),S=p(async(e,t)=>{const n=await r.updateWorkspacePermissions(e,t);return await g(),n},[r,g]);d(()=>{if(!i.currentWorkspace?._id||0===i.workspaces.length)return;const t=i.currentWorkspace._id,r=i.workspaces.find(e=>e._id===t);if(r)r!==i.currentWorkspace&&(vl(r),e.workspaces(Tt(r)));else if(i.workspaces.length>0){const e=i.workspaces[0];e._id!==t&&c(e).catch(()=>{})}},[i.workspaces,i.currentWorkspace,e,c]);const k=p(async e=>await r.getWorkspaceUsers(e),[r]),E=p(async(e,t,a)=>{const s=i.workspaces.find(t=>t._id===e);if(s){const e=Ma({settingsMaxUsers:n?.workspace?.maxWorkspaceUsers}),t=La({memberCount:s.users?.length??0,maxUsersConfig:e});if(!t.canInvite)throw new Error(t.blockMessageKey||"users.memberLimitReached")}const o=await r.addUser(e,{email:t,role:a});return s&&$a.emitWorkspaceUserAdded(o.userId,s,a).catch(t=>{Ke(t,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserAdded",metadata:{workspaceId:e,userId:o.userId,role:a}})}),g().catch(()=>{}),Zt(),o},[r,i.workspaces,g,n]),N=p(async(e,t)=>{const n=i.workspaces.find(t=>t._id===e);if(n&&Sl(n,t))throw new Error("Cannot remove the workspace owner");const a=(await r.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user._id)===t),s=await r.removeUser(e,t);if(n&&a){const t=a.role;$a.emitWorkspaceUserRemoved(s.userId,n,t).catch(r=>{Ke(r,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRemoved",metadata:{workspaceId:e,userId:s.userId,role:t}})})}return g().catch(()=>{}),Zt(),s},[r,i.workspaces,g]),C=p(async(e,t,n)=>{if(n.role){const r=i.workspaces.find(t=>t._id===e);if(r&&Sl(r,t))throw new Error("Cannot change the role of the workspace owner")}let a;if(n.role){const n=(await r.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user._id)===t);a=n?.role}const s=await r.updateUser(e,t,n);return n.role&&a&&a!==n.role&&$a.emitWorkspaceUserRoleChanged(s.userId,s.workspace,a,n.role).catch(r=>{Ke(r,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRoleChanged",metadata:{workspaceId:e,userId:t,previousRole:a,newRole:n.role}})}),s},[r,i.workspaces]),A=p(async e=>{const t=await r.getProfile().catch(()=>null),n=await r.updateUserProfile(e);return $a.emitUserUpdated(n,t||void 0).catch(e=>{Ke(e,{component:"useSaaSWorkspaces",action:"emitUserUpdated",metadata:{userId:n._id}})}),n},[r]),_=p(async()=>await r.getProfile(),[r]),P=p(async e=>await r.getWorkspace(e),[r]),T=p(async t=>{if(!s)throw new Error("User must be authenticated to delete a workspace");const n=i.workspaces.find(e=>e._id===t);if(!n)throw new Error("Workspace not found");if(!Sl(n,s.id))throw new Error("Only the workspace creator can delete the workspace");const a=await r.deleteWorkspace(t);return e.workspaces(_t(t)),i.currentWorkspace?._id===t&&(wl(),e.workspaces(Rt())),n&&$a.emitWorkspaceDeleted(n).catch(e=>{Ke(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceDeleted",metadata:{workspaceId:t}})}),a},[r,i.workspaces,i.currentWorkspace,e,s]);return{workspaces:i.workspaces,loading:i.loading,error:i.error,fetchWorkspaces:f,refreshWorkspaces:g,refreshing:i.refreshing,currentWorkspace:i.currentWorkspace,setCurrentWorkspace:o,switchToWorkspace:c,resetCurrentWorkspace:l,createWorkspace:b,allFeatures:i.allFeatures,getFeatures:y,updateFeature:w,updateWorkspaceSettings:x,updateWorkspacePermissions:S,getWorkspace:P,updateWorkspace:v,getUsers:k,addUser:E,removeUser:N,updateUser:C,getProfile:_,updateUserProfile:A,deleteWorkspace:T,switching:null!==i.switchingToId,switchingToId:i.switchingToId}},nE=c(null);nE.displayName="QuotaUsageContext";const aE="useQuotaUsageContext must be used within QuotaUsageContextProvider. Make sure QuotaUsageContextProvider is wrapping your application (or the tree that uses quota gates).",iE=a.memo(function({children:e}){const{currentWorkspace:r}=rE(),{quotas:n,loading:a,error:i,refetch:s}=na(r?._id);d(()=>{return e=s,$t.add(e),()=>{$t.delete(e)};var e},[s]);const c=o(()=>({quotas:n,loading:a,error:i,refetch:s}),[n,a,i,s]);return t(nE.Provider,{value:c,children:e})});function sE(){const e=u(nE);if(null===e)throw new Error(aE);return e}iE.displayName="QuotaUsageContextProvider";let oE=!1,cE=null;const lE=a.memo(({children:e,callbacks:n})=>{const i=In(),s=zl(),o=On(),c=at(s.status).isAuthenticated,l=a.useRef(!1),u=a.useRef(null);a.useEffect(()=>{c||(oE=!1,cE=null)},[]);const m=p(async e=>{try{if(n?.handleAuthentication){const{sessionId:t}=await n.handleAuthentication(e);if(!t||"string"!=typeof t||""===t.trim())throw new Error("Invalid sessionId received from authentication callback");const r=o;if(!bt(r))throw new Error("OS configuration is not available");const{serverUrl:a,version:s,orgId:c}=r,l=new Pl({serverUrl:a,version:s}),u=await l.getProfile(t),d=Ol(Ll(u,c,r.auth?.clientId||""),t);An(d.sessionId),i.auth(Qe(d)),function(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.delete(Cn),window.history.replaceState({},"",e.toString())}catch(e){Ke(e,{component:"auth-utils",action:"removeTokenFromUrl",metadata:{param:Cn}})}}();const p=Ml();p&&p!==window.location.href&&Rl(p)}}catch(t){throw Ml(),Ke(t,{component:"AuthProviderWrapper",action:"handleAuthRedirect",metadata:{hasCode:!!e}}),i.auth(Xe()),t}},[i,n,o]);return a.useEffect(()=>{if("undefined"==typeof window)return;if(c)return;if(oE)return;if(cE)return;if(!bt(o))return;if(Pn())return;if(!n?.getSession)return oE=!0,void i.auth(Xe());const e=n.getSession,{serverUrl:t,version:r,orgId:a}=o,s=o.auth?.clientId||"";cE=(async()=>{let o=null;try{o=await e()}catch(e){Ke(e,{component:"AuthProviderWrapper",action:"getSession"})}if(!o)return oE=!0,i.auth(Xe()),"undefined"!=typeof window&&Ul(window.location.href),void n?.onSessionExpired?.("missing");try{const e=new Pl({serverUrl:t,version:r}),n=await e.getProfile(o),c=Ol(Ll(n,a,s),o);An(c.sessionId),oE=!0,i.auth(Qe(c));const l=Ml();l&&l!==window.location.href&&Rl(l)}catch(e){Ke(e,{component:"AuthProviderWrapper",action:"fetchUserProfile"}),oE=!0,i.auth(Xe()),"undefined"!=typeof window&&Ul(window.location.href),n?.onSessionExpired?.("expired")}finally{cE=null}})()},[c,i,o,n]),d(()=>{const e=Pn();if(!e)return;if(l.current||u.current===e)return;if(!bt(o))return;l.current=!0,u.current=e;let t=!1;return i.auth(Ye()),m(e).then(()=>{t||(u.current=null)}).catch(e=>{t||(Ke(e,{component:"AuthProviderWrapper",action:"handleAuthRedirectEffect",metadata:{hasCode:!0}}),u.current=null)}).finally(()=>{l.current=!1}),()=>{t=!0}},[m,o.serverUrl,o.version,o.orgId]),t(r,{children:e})});lE.displayName="AuthProviderWrapper";const uE=a.memo(({config:e,auth:n,children:i})=>{const s=In(),c=On(),l=a.useMemo(()=>({clientId:n?.clientId||"",redirectUrl:n?.redirectUrl||"",callbacks:n?.callbacks}),[n?.clientId,n?.redirectUrl,n?.callbacks]);d(()=>{s.os(ht({...e,auth:l}))},[e,l,s]);const u=o(()=>bt(c)?new Ln(c):null,[c.serverUrl,c.version,c.orgId]);return Mn(async e=>{if(!u||c.settings)return;const t=await u.getSettings(e);s.os(ft(t))},[u,c.settings,s],{onError:e=>Ke(e,{component:"ContextConfigProvider",action:"fetchSettings",metadata:{serverUrl:c.serverUrl,version:c.version,orgId:c.orgId}})}),t(r,{children:i})});uE.displayName="ContextConfigProvider";class dE extends Rn{constructor(e){super(e)}async getAttributes(e){const t=await this.fetchResponse("users/attributes",{signal:e});if(!t.ok)throw new Error(await Ve(t,"Failed to fetch user attributes"));const r=await t.json();return r&&"object"==typeof r&&!Array.isArray(r)?r:{}}async updateAttributes(e){return this.fetchJson("users/attributes",{method:"PATCH",body:JSON.stringify({attributes:e})},"Failed to update user attributes")}async updateAttribute(e,t){return this.fetchJson(`users/attributes/${e}`,{method:"PATCH",body:JSON.stringify({value:t})},"Failed to update user attribute")}async getFeatures(e){const t=await this.fetchResponse("users/features",{signal:e});if(!t.ok)throw new Error(await Ve(t,"Failed to fetch user features"));const r=await t.json();return"object"==typeof r&&null!==r?r:{}}}const pE=a.createContext(void 0),mE=a.memo(({children:e})=>{const{t:r}=xn(),n=On(),i=function(){const e=On();return o(()=>new dE(e),[e.serverUrl,e.version])}(),{isAuthenticated:s}=Fl(),{serverUrl:c,version:l}=n,[u,d]=m({}),[h,f]=m({}),[g,b]=m(!1),[v,y]=m(null),w=p(async e=>{if(c&&l&&s)try{const t=await i.getAttributes(e);d(t)}catch(e){if(We(e))return;const t=e instanceof Error?e:new Error(r("errors.generic"));y(t),Ke(e,{component:"UserProvider",action:"fetchAttributes"})}else d({})},[i,c,l,s]),x=p(async()=>{if(c&&l&&s){b(!0),y(null);try{await w()}finally{b(!1)}}},[c,l,s,w]),S=p(async e=>{b(!0),y(null);try{const t=await i.updateAttributes(e);return await w(),t}catch(t){const n=t instanceof Error?t:new Error(r("errors.generic"));throw y(n),Ke(t,{component:"UserProvider",action:"updateAttributes",metadata:{updates:e}}),t}finally{b(!1)}},[i,w]),k=p(async(e,t)=>{b(!0),y(null);try{const r=await i.updateAttribute(e,t);return await w(),r}catch(n){const a=n instanceof Error?n:new Error(r("errors.generic"));throw y(a),Ke(n,{component:"UserProvider",action:"updateAttribute",metadata:{attributeKey:e,value:t}}),n}finally{b(!1)}},[i,w]),E=p(async e=>{if(c&&l&&s)try{const t=await i.getFeatures(e);f(t)}catch(e){if(We(e))return;const t=e instanceof Error?e:new Error(r("errors.generic"));y(t),Ke(e,{component:"UserProvider",action:"fetchFeatures"})}else f({})},[i,c,l,s]),N=p(async()=>{if(c&&l&&s){b(!0),y(null);try{await E()}finally{b(!1)}}},[c,l,s,E]);Mn(async e=>{if(!s||!c||!l)return d({}),void f({});b(!0),y(null);try{await Promise.all([w(e),E(e)])}finally{b(!1)}},[s,c,l,w,E],{onError:e=>Ke(e,{component:"UserProvider",action:"initialFetch",metadata:{step:"fetchAttributesAndFeatures"}})});const C=a.useMemo(()=>({attributes:u,features:h,isLoading:g,error:v,updateAttributes:S,updateAttribute:k,refreshAttributes:x,refreshFeatures:N}),[u,h,g,v,S,k,x,N]);return t(pE.Provider,{value:C,children:e})});mE.displayName="UserProvider";const hE=v(()=>Promise.resolve().then(function(){return eE}).then(e=>({default:e.default})));const fE=({children:n})=>{const{currentWorkspace:a,switchToWorkspace:i,workspaces:o}=rE(),[c,l]=m(!1),[u,p]=m(Jk.Profile),h=s(!1);return d(()=>{const e=tE.getState();l(e.open),p(e.section);return tE.subscribe(e=>{l(e.open),p(e.section)})},[]),d(()=>{if(h.current)return;if(!a)return;const e=dS();if(!e)return;const t=function(e){if(e.screen&&Yk.has(e.screen))return e.screen;switch(e.action){case"checkout":case"billing":case"selectPlan":return Jk.Subscription;default:return null}}(e);if(!t)return h.current=!0,void pS();const r=e.ws;if(r&&r!==a._id){const e=o.find(e=>e._id===r);return e?void i(e).catch(()=>{h.current=!0,pS()}):(h.current=!0,void pS())}h.current=!0,tE.openWorkspaceSettings(t,e),pS()},[a,o,i]),e(r,{children:[n,a&&c&&t(b,{fallback:null,children:t(hE,{workspace:a,open:c,onOpenChange:e=>{e||tE.closeSettings()},section:u,onSectionChange:e=>{tE.setSection(e)},showTrigger:!1})})]})},gE=(e,t,r)=>{if(t!==gt.V1)throw new Error(`Invalid version: "${t}". Only "${gt.V1}" is currently supported.`);if(!e||"string"!=typeof e)throw new Error("serverUrl is required and must be a string");if(!(e=>{try{return new URL(e),!0}catch{return!1}})(e))throw new Error(`Invalid serverUrl: "${e}". Must be a valid URL.`);if(!r||"string"!=typeof r)throw new Error("orgId is required and must be a string");if(!/^[0-9a-fA-F]{24}$/.test(r))throw new Error(`Invalid orgId: "${r}". Must be a valid MongoDB ObjectId (24 hexadecimal characters).`)},bE=a.memo(({serverUrl:e,version:r,orgId:n,auth:i,locale:s,defaultPermissions:o,getCheckoutStripeParams:c,children:l})=>{gE(e,r,n);const u=a.useMemo(()=>({serverUrl:e,version:r,orgId:n}),[e,r,n]),p=a.useMemo(()=>i?.callbacks,[i?.callbacks?.handleAuthentication,i?.callbacks?.onSignOut,i?.callbacks?.handleEvent,i?.callbacks?.onWorkspaceChange]),m=i?.callbacks?.handleEvent;return d(()=>($a.setCallbacks(m?{handleEvent:m}:null),()=>{$a.setCallbacks(null)}),[m]),t(hn,{locale:s,children:t(jt,{children:t(lE,{callbacks:p,children:t(Ec,{children:t(uE,{config:u,auth:i,children:t(Gt,{getCheckoutStripeParams:c,children:t(la,{appPermissions:o,children:t(mE,{children:t(sa,{children:t(iE,{children:t(lv,{children:t(fE,{children:l})})})})})})})})})})})})});bE.displayName="SaaSOSProviderInner";const vE=({children:e,...r})=>t(Ze,{children:t(bE,{...r,children:e})});vE.displayName="SaaSOSProvider";const yE=e=>{const{children:t}=e,{status:r}=Fl();return r!==nt.authenticated?null:t},wE=e=>{const{children:t}=e,{status:r}=Fl();return r!==nt.unauthenticated?null:t};yE.displayName="WhenAuthenticated",wE.displayName="WhenUnauthenticated";const xE=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=Fl();return n.includes(a?.role??"")?t:r||null},SE=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=Fl(),{currentWorkspace:i}=rE(),s=i?.users.find(e=>e._id===a?.id);return s&&n.includes(s?.role??"")?t:r||null};xE.displayName="WhenRoles",SE.displayName="WhenWorkspaceRoles";const kE=e=>{const{children:t,fallback:r,permission:n}=e,{can:a}=Bl();return a(n)?t:r??null};function EE(){const e=u(pE);if(void 0===e)throw new Error("useUserAttributes must be used within a UserProvider");return e}function NE(){const e=u(pE);if(void 0===e)throw new Error("useUserFeatures must be used within a UserProvider");return{features:e.features,isLoading:e.isLoading,error:e.error,refreshFeatures:e.refreshFeatures,isFeatureEnabled:t=>Boolean(e.features[t])}}kE.displayName="WhenPermission";const CE=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=rE(),a=n?.features?.[r];return a?t:null},AE=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=rE(),a=n?.features?.[r];return a?null:t},_E=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=NE();return n(r)?t:null},PE=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=NE();return n(r)?null:t};CE.displayName="WhenWorkspaceFeatureEnabled",AE.displayName="WhenWorkspaceFeatureDisabled",_E.displayName="WhenUserFeatureEnabled",PE.displayName="WhenUserFeatureDisabled";const TE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:i}=oa();return i?r??null:a?.subscription?t:n??null},RE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:i}=oa();return i?r??null:a?.subscription?n??null:t},DE=e=>{const{children:t,plans:r,loadingComponent:n,fallbackComponent:a}=e,{response:i,loading:s}=oa();if(s)return n??null;if(!i?.subscription)return a??null;const o=i.plan??i.subscription?.plan;if(!o)return a??null;const c=r.map(e=>e.trim().toLowerCase()),l=(o.slug??"").toLowerCase();return c.includes(l)?t:a??null},IE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:i}=oa();return i?r??null:"trialing"!==a?.subscription?.subscriptionStatus?n??null:t},UE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:i}=oa();return i?r??null:a?.subscription?.subscriptionStatus===ma?n??null:t},ME=e=>{const{children:t,loadingComponent:r,fallbackComponent:n,daysThreshold:a=3}=e,{response:i,loading:s}=oa();if(s)return r??null;const o=i?.subscription;if(!o||"trialing"!==o.subscriptionStatus)return n??null;const c=o.trialEnd||o.stripeCurrentPeriodEnd;if(!c)return n??null;const l=new Date(c);if(isNaN(l.getTime()))return n??null;return Math.max(0,Math.ceil((l.getTime()-Date.now())/864e5))>a?n??null:t};TE.displayName="WhenSubscription",RE.displayName="WhenNoSubscription",DE.displayName="WhenSubscriptionToPlans",IE.displayName="WhenTrialing",UE.displayName="WhenNotTrialing",ME.displayName="WhenTrialEnding";const LE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:i,loading:s}=sE();if(s)return n??null;const o=i?.[t];return o?o.available<=0?a??null:r:a??null},OE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:i,loading:s}=sE();if(s)return n??null;const o=i?.[t];return o?o.available>0?a??null:r:a??null},zE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:i,loading:s}=sE();if(s)return n??null;const o=i?.[t];return o&&o.hasOverage&&!1!==o.allowOverage?r:a??null},FE=e=>{const{slug:t,threshold:r,children:n,loadingComponent:a,fallbackComponent:i}=e,{quotas:s,loading:o}=sE();if(o)return a??null;const c=s?.[t];if(!c)return i??null;return(c.included>0?c.consumed/c.included*100:c.consumed>0?100:0)<r?i??null:n};function BE(e){if(!e)return null;const t=new Date(e);return isNaN(t.getTime())?null:t}function WE(){const{response:e}=oa();return o(()=>{const t=e?.subscription;if(!t||"trialing"!==t.subscriptionStatus)return{isTrialing:!1,daysRemaining:0,trialEndsAt:null,trialStartedAt:null,isTrialEnding:!1};const r=BE(t.trialEnd)??BE(t.stripeCurrentPeriodEnd),n=BE(t.trialStart),a=r?Math.max(0,Math.ceil((r.getTime()-Date.now())/864e5)):0;return{isTrialing:!0,daysRemaining:a,trialEndsAt:r,trialStartedAt:n,isTrialEnding:a<=3}},[e])}LE.displayName="WhenQuotaAvailable",OE.displayName="WhenQuotaExhausted",zE.displayName="WhenQuotaOverage",FE.displayName="WhenQuotaThreshold";class VE extends Rn{constructor(e){super({...e,basePath:"beta",requireOrgId:!0})}getAuthHeaders(){return{}}async fetchConfig(){return this.fetchJson(`config?orgId=${encodeURIComponent(this.orgId)}`,{},"Failed to fetch beta form configuration")}async submitBetaUser(e){return this.fetchJson("submit",{method:"POST",body:JSON.stringify(e)},"Failed to submit beta user request")}}let jE=class{constructor(e){this.api=new VE(e),this.orgId=e.orgId}async fetchConfig(){return this.api.fetchConfig()}async submitBetaUser(e){const t=e?.context??{},r=t?.country??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[1]:void 0),n=t?.language??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[0]:void 0),a=t?.timezone??("undefined"!=typeof Intl&&Intl.DateTimeFormat?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0),i=t?.currency??("undefined"!=typeof Intl&&Intl.NumberFormat&&Intl.NumberFormat().resolvedOptions().currency?Intl.NumberFormat().resolvedOptions().currency:void 0);return this.api.submitBetaUser({orgId:this.orgId,formData:{...e,country:r,language:n,timezone:a,currency:i}})}};const HE=Of({name:uf().min(1,"Please enter your name").max(50,"Name must be less than 50 characters").regex(/^[\p{L}\p{M}\s'-]*$/u,"Name can only contain letters and spaces"),email:uf().min(1,"Please enter your email address").email("Please enter a valid email address").max(100,"Email must be less than 100 characters").regex(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,"Please enter a valid email format (e.g., name@domain.com)")}),GE=({onSuccess:n,onError:a,className:i="w-full",fieldClassName:s="flex flex-col gap-1.5 w-full",autoFocus:o=!0,showSuccessMessage:c=!0,hideLogo:l=!1,hideTitles:u=!1})=>{const{t:h}=xn(),[f,g]=m(!1),[b,v]=m(!1),{submitBetaForm:y,isLoading:w,isSubmitting:x,error:S,config:k,success:E,message:N}=(()=>{const{t:e}=xn(),t=On(),[r,n]=m(null),[a,i]=m(!0),[s,o]=m(!1),[c,l]=m(null),[u,h]=m(!1),[f,g]=m(null);return d(()=>{let r=!1;return(async()=>{i(!0),l(null);try{const e=new jE(t),a=await e.fetchConfig();r||n(a)}catch(t){r||l(t instanceof Error?t.message:e("beta.errorMessage"))}finally{r||i(!1)}})(),()=>{r=!0}},[t]),{isLoading:a,isSubmitting:s,config:r,error:c,success:u,message:f,submitBetaForm:p(async r=>{if(!t){const t=e("errors.generic");return l(t),{success:!1,message:t}}try{o(!0),l(null),h(!1),g(null);const e=new jE(t),n=await e.submitBetaUser({name:r.name||"",email:r.email}),a="success"===n.status;return h(a),g(n.message),{success:a,message:n.message}}catch(t){const r=t instanceof Error?t.message:e("beta.errorMessage");return l(r),h(!1),g(r),{success:!1,message:r}}finally{o(!1)}},[t])}})();d(()=>{E&&c&&(g(!0),v(!0)),S&&v(!0)},[E,c,S]);const C=Td({resolver:zh(HE),defaultValues:{email:"",name:""},mode:"onChange",reValidateMode:"onChange"});d(()=>{o&&C.setFocus("name")},[o,C]);const A=C.formState.isValid&&!x;return t("div",{className:"saas-os-ui",style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:e("div",w?{className:Oe("flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",i),children:[t(Wl,{className:"h-24 w-24 rounded-lg"}),t(Wl,{className:"h-6 w-32"}),e("div",{className:"w-full space-y-4",children:[e("div",{className:"space-y-2",children:[t(Wl,{className:"h-4 w-16"}),t(Wl,{className:"h-10 w-full"})]}),e("div",{className:"space-y-2",children:[t(Wl,{className:"h-4 w-16"}),t(Wl,{className:"h-10 w-full"})]}),t(Wl,{className:"h-10 w-full"})]})]}:{className:"flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",children:[!l&&e("div",{className:"flex flex-col items-center justify-center w-full",children:[k?.logo&&t(KE,{logo:k?.logo}),k?.name&&t("div",{children:k?.name})]}),t(qu,{...C,children:e("form",{onSubmit:C.handleSubmit(async e=>{try{const t=await y(e);t.success?(n?.(),C.reset(),c&&g(!0),v(!0)):(a?.(t.message),v(!0))}catch(e){a?.(e instanceof Error?e.message:h("beta.errorMessage")),v(!0)}}),className:i,noValidate:!0,"aria-busy":x,children:[!b&&e(r,{children:[!u&&k?.screen?.register&&t($E,{screen:k?.screen?.register}),t(pg,{control:C.control,name:"name",render:({field:r})=>e(fg,{className:s,children:[t(gg,{children:h("beta.nameLabel")}),t(bg,{children:t(wg,{...r})}),t(vg,{}),t(yg,{})]})}),t(pg,{control:C.control,name:"email",render:({field:r})=>e(fg,{className:s,children:[t(gg,{children:h("beta.emailLabel")}),t(bg,{children:t(wg,{...r})}),t(vg,{}),t(yg,{})]})}),t(Hi,{type:"submit",disabled:!A,className:s,children:h(x?"beta.submittingText":"beta.submitText")})]}),b&&S&&e("div",{className:"flex flex-col items-center justify-center w-full",children:[e("div",{className:"border-red-300 text-red-700",role:"alert","aria-live":"assertive","aria-atomic":!0,children:[t("span",{className:"text-4xl mb-2",role:"img","aria-label":h("settings.common.error"),children:"❗"}),S]}),t("div",{className:"mt-4 flex justify-center",children:t(Hi,{type:"button",onClick:()=>{v(!1),C.reset()},className:s,children:h("beta.tryAgain")})})]}),b&&f&&N&&t("div",{className:"flex flex-col items-center justify-center w-full text-green-700 border-green-300 text-center",children:k?.screen?.thankYou&&t($E,{screen:k?.screen?.thankYou})})]})}),!b&&t("div",{children:e("div",{children:[h("beta.privacyConsent")," ",t("a",{href:k?.privacyPolicy,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:h("beta.privacyPolicy")})," ",h("beta.and")," ",t("a",{href:k?.termsOfService,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:h("beta.termsOfService")}),"."]})})]})})};function $E({screen:r}){return e("div",{className:"flex flex-col items-center justify-center w-full",children:[t("p",{className:"text-2xl font-bold",children:r?.title}),t("p",{className:"text-sm text-muted-foreground",children:r?.description})]})}function KE({logo:e}){return t("img","string"==typeof e?{src:e,alt:"Logo",className:"max-h-24"}:{src:e.bucket?.url,alt:"Logo",className:"max-h-24"})}function qE({slug:n,children:a,loadingFallback:i,errorFallback:s,redirectBaseUrl:o}){const{items:c,plans:l,notes:u,loading:d,error:m,refetch:h}=Vn(n),{isAuthenticated:f,signIn:g}=Fl(),b=p((e,t,r)=>o?uS({action:"selectPlan",plan:e,interval:t,currency:r},o):null,[o]),v=p((e,t,r)=>{if(f)return void tE.openWorkspaceSettings("subscription",{action:"selectPlan",plan:e,interval:t,currency:r});const n=b(e,t,r);g(n??void 0)},[f,g,b]);return d?void 0!==i?t(r,{children:i}):e("div",{className:"space-y-4",children:[t(Wl,{className:"h-8 w-48"}),t("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[1,2,3].map(e=>t(Wl,{className:"h-64 rounded-lg"},e))})]}):m?s?t(r,{children:s(m)}):t("div",{className:"rounded-lg border border-destructive/50 bg-destructive/10 p-4 text-sm text-destructive",children:m}):t(r,{children:a({loading:d,error:m,items:c,plans:l,notes:u,refetch:h,selectPlan:v})})}function ZE(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const a=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return n.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}var JE,YE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{const a=Mi(`Primitive.${r}`),i=n.forwardRef((e,n)=>{const{asChild:i,...s}=e,o=i?a:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t(o,{...s,ref:n})});return i.displayName=`Primitive.${r}`,{...e,[r]:i}},{}),XE={exports:{}},QE={};function eN(){if(JE)return QE;JE=1;var e=a;var t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useState,n=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function o(e){var r=e.getSnapshot;e=e.value;try{var n=r();return!t(e,n)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var a=t(),c=r({inst:{value:a,getSnapshot:t}}),l=c[0].inst,u=c[1];return i(function(){l.value=a,l.getSnapshot=t,o(l)&&u({inst:l})},[e,a,t]),n(function(){return o(l)&&u({inst:l}),e(function(){o(l)&&u({inst:l})})},[e]),s(a),a};return QE.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:c,QE}var tN,rN,nN={};
27
+ */function Ns(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Es(...e){return t=>{let r=!1;const n=e.map(e=>{const n=Ns(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():Ns(e[t],null)}}}}function As(...e){return n.useCallback(Es(...e),e)}var _s=Symbol.for("react.lazy"),Ps=n[" use ".trim().toString()];function Ts(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===_s&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}function Rs(e){const r=Is(e),a=n.forwardRef((e,a)=>{let{children:i,...s}=e;Ts(i)&&"function"==typeof Ps&&(i=Ps(i._payload));const o=n.Children.toArray(i),c=o.find(Us);if(c){const e=c.props.children,i=o.map(t=>t===c?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t);return t(r,{...s,ref:a,children:n.isValidElement(e)?n.cloneElement(e,void 0,i):null})}return t(r,{...s,ref:a,children:i})});return a.displayName=`${e}.Slot`,a}var Ds=Rs("Slot");function Is(e){const t=n.forwardRef((e,t)=>{let{children:r,...a}=e;if(Ts(r)&&"function"==typeof Ps&&(r=Ps(r._payload)),n.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),i=function(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{const t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}(a,r.props);return r.type!==n.Fragment&&(i.ref=t?Es(t,e):e),n.cloneElement(r,i)}return n.Children.count(r)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ms=Symbol("radix.slottable");function Us(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Ms}const Ls=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Os=k,zs=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return Os(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:a,defaultVariants:i}=t,s=Object.keys(a).map(e=>{const t=null==r?void 0:r[e],n=null==i?void 0:i[e];if(null===t)return null;const s=Ls(t)||Ls(n);return a[e][s]}),o=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{}),c=null==t||null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:r,className:n,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...i,...o}[t]):{...i,...o}[t]===r})?[...e,r,n]:e},[]);return Os(e,s,c,null==r?void 0:r.class,null==r?void 0:r.className)},Fs=zs("inline-flex items-center justify-center rounded-full font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background",{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 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:"underline-offset-4 hover:underline text-primary"},withIcon:{true:"flex"},fullWidth:{true:"w-full"},size:{default:"h-9 py-2 px-4 text-sm",sm:"h-8 px-3 text-xs",lg:"h-10 px-6 text-base",icon:"h-9 w-9"}},compoundVariants:[{size:"lg",withIcon:!0,className:"gap-x-1.5"},{size:"default",withIcon:!0,className:"gap-x-1"},{size:"sm",withIcon:!0,className:"gap-x-0.5"}],defaultVariants:{variant:"default",size:"default"}}),Bs=n.forwardRef(({className:r,variant:a,progress:i,size:s,startIcon:o,endIcon:c,asChild:l=!1,...d},u)=>{const p=l?Ds:"button",m=function(e){switch(e){case"lg":return 20;case"sm":return 14;default:return 16}}(s);return e(p,{disabled:i||d.disabled,className:Oe(Fs({variant:a,size:s,withIcon:null!=i||null!=o||null!=c,className:r})),ref:u,...d,children:[i&&t(os,{size:m,className:"animate-spin"}),o&&n.cloneElement(o,{size:m}),d.children,c&&n.cloneElement(c,{size:m})]})});function Ws(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function Vs(e,r=[]){let a=[];const i=()=>{const t=a.map(e=>n.createContext(e));return function(r){const a=r?.[e]||t;return n.useMemo(()=>({[`__scope${e}`]:{...r,[e]:a}}),[r,a])}};return i.scopeName=e,[function(r,i){const s=n.createContext(i),o=a.length;a=[...a,i];const c=r=>{const{scope:a,children:i,...c}=r,l=a?.[e]?.[o]||s,d=n.useMemo(()=>c,Object.values(c));return t(l.Provider,{value:d,children:i})};return c.displayName=r+"Provider",[c,function(t,a){const c=a?.[e]?.[o]||s,l=n.useContext(c);if(l)return l;if(void 0!==i)return i;throw new Error(`\`${t}\` must be used within \`${r}\``)}]},Gs(i,...r)]}function Gs(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const a=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return n.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}Bs.displayName="Button";var Hs=globalThis?.document?n.useLayoutEffect:()=>{},js=n[" useId ".trim().toString()]||(()=>{}),$s=0;function Ks(e){const[t,r]=n.useState(js());return Hs(()=>{r(e=>e??String($s++))},[e]),e||(t?`radix-${t}`:"")}var qs=n[" useInsertionEffect ".trim().toString()]||Hs;function Zs({prop:e,defaultProp:t,onChange:r=()=>{},caller:a}){const[i,s,o]=function({defaultProp:e,onChange:t}){const[r,a]=n.useState(e),i=n.useRef(r),s=n.useRef(t);return qs(()=>{s.current=t},[t]),n.useEffect(()=>{i.current!==r&&(s.current?.(r),i.current=r)},[r,i]),[r,a,s]}({defaultProp:t,onChange:r}),c=void 0!==e,l=c?e:i;{const t=n.useRef(void 0!==e);n.useEffect(()=>{const e=t.current;if(e!==c){const t=e?"controlled":"uncontrolled",r=c?"controlled":"uncontrolled";console.warn(`${a} is changing from ${t} to ${r}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=c},[c,a])}const d=n.useCallback(t=>{if(c){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&o.current?.(r)}else s(t)},[c,e,s,o]);return[l,d]}function Js(e){const t=n.forwardRef((e,t)=>{const{children:r,...a}=e;if(n.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),i=function(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{const t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}(a,r.props);return r.type!==n.Fragment&&(i.ref=t?Es(t,e):e),n.cloneElement(r,i)}return n.Children.count(r)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ys=Symbol("radix.slottable");function Xs(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Ys}var Qs=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{const a=function(e){const r=Js(e),a=n.forwardRef((e,a)=>{const{children:i,...s}=e,o=n.Children.toArray(i),c=o.find(Xs);if(c){const e=c.props.children,i=o.map(t=>t===c?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t);return t(r,{...s,ref:a,children:n.isValidElement(e)?n.cloneElement(e,void 0,i):null})}return t(r,{...s,ref:a,children:i})});return a.displayName=`${e}.Slot`,a}(`Primitive.${r}`),i=n.forwardRef((e,n)=>{const{asChild:i,...s}=e,o=i?a:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t(o,{...s,ref:n})});return i.displayName=`Primitive.${r}`,{...e,[r]:i}},{});function eo(e){const t=n.useRef(e);return n.useEffect(()=>{t.current=e}),n.useMemo(()=>(...e)=>t.current?.(...e),[])}var to,ro="dismissableLayer.update",no="dismissableLayer.pointerDownOutside",ao="dismissableLayer.focusOutside",io=n.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),so=n.forwardRef((e,r)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:c,onDismiss:l,...d}=e,u=n.useContext(io),[p,m]=n.useState(null),h=p?.ownerDocument??globalThis?.document,[,f]=n.useState({}),g=As(r,e=>m(e)),b=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=b.indexOf(v),w=p?b.indexOf(p):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,k=w>=y,S=function(e,t=globalThis?.document){const r=eo(e),a=n.useRef(!1),i=n.useRef(()=>{});return n.useEffect(()=>{const e=e=>{if(e.target&&!a.current){let n=function(){co(no,r,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",i.current),i.current=n,t.addEventListener("click",i.current,{once:!0})):n()}else t.removeEventListener("click",i.current);a.current=!1},n=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(n),t.removeEventListener("pointerdown",e),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>a.current=!0}}(e=>{const t=e.target,r=[...u.branches].some(e=>e.contains(t));k&&!r&&(s?.(e),c?.(e),e.defaultPrevented||l?.())},h),C=function(e,t=globalThis?.document){const r=eo(e),a=n.useRef(!1);return n.useEffect(()=>{const e=e=>{if(e.target&&!a.current){co(ao,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),c?.(e),e.defaultPrevented||l?.())},h);return function(e,t=globalThis?.document){const r=eo(e);n.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{w===u.layers.size-1&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},h),n.useEffect(()=>{if(p)return a&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(to=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),oo(),()=>{a&&1===u.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=to)}},[p,h,a,u]),n.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),oo())},[p,u]),n.useEffect(()=>{const e=()=>f({});return document.addEventListener(ro,e),()=>document.removeEventListener(ro,e)},[]),t(Qs.div,{...d,ref:g,style:{pointerEvents:x?k?"auto":"none":void 0,...e.style},onFocusCapture:Ws(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Ws(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Ws(e.onPointerDownCapture,S.onPointerDownCapture)})});so.displayName="DismissableLayer";function oo(){const e=new CustomEvent(ro);document.dispatchEvent(e)}function co(e,t,r,{discrete:n}){const a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?function(e,t){e&&y.flushSync(()=>e.dispatchEvent(t))}(a,i):a.dispatchEvent(i)}n.forwardRef((e,r)=>{const a=n.useContext(io),i=n.useRef(null),s=As(r,i);return n.useEffect(()=>{const e=i.current;if(e)return a.branches.add(e),()=>{a.branches.delete(e)}},[a.branches]),t(Qs.div,{...e,ref:s})}).displayName="DismissableLayerBranch";var lo="focusScope.autoFocusOnMount",uo="focusScope.autoFocusOnUnmount",po={bubbles:!1,cancelable:!0},mo=n.forwardRef((e,r)=>{const{loop:a=!1,trapped:i=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...c}=e,[l,d]=n.useState(null),u=eo(s),p=eo(o),m=n.useRef(null),h=As(r,e=>d(e)),f=n.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;n.useEffect(()=>{if(i){let e=function(e){if(f.paused||!l)return;const t=e.target;l.contains(t)?m.current=t:bo(m.current,{select:!0})},t=function(e){if(f.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||bo(m.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&bo(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return l&&n.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[i,l,f.paused]),n.useEffect(()=>{if(l){vo.add(f);const t=document.activeElement;if(!l.contains(t)){const r=new CustomEvent(lo,po);l.addEventListener(lo,u),l.dispatchEvent(r),r.defaultPrevented||(!function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(bo(n,{select:t}),document.activeElement!==r)return}((e=ho(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&bo(l))}return()=>{l.removeEventListener(lo,u),setTimeout(()=>{const e=new CustomEvent(uo,po);l.addEventListener(uo,p),l.dispatchEvent(e),e.defaultPrevented||bo(t??document.body,{select:!0}),l.removeEventListener(uo,p),vo.remove(f)},0)}}var e},[l,u,p,f]);const g=n.useCallback(e=>{if(!a&&!i)return;if(f.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[n,i]=function(e){const t=ho(e),r=fo(t,e),n=fo(t.reverse(),e);return[r,n]}(t);n&&i?e.shiftKey||r!==i?e.shiftKey&&r===n&&(e.preventDefault(),a&&bo(i,{select:!0})):(e.preventDefault(),a&&bo(n,{select:!0})):r===t&&e.preventDefault()}},[a,i,f.paused]);return t(Qs.div,{tabIndex:-1,...c,ref:h,onKeyDown:g})});function ho(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function fo(e,t){for(const r of e)if(!go(r,{upTo:t}))return r}function go(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function bo(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}mo.displayName="FocusScope";var vo=function(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=yo(e,t),e.unshift(t)},remove(t){e=yo(e,t),e[0]?.resume()}}}();function yo(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var wo=n.forwardRef((e,r)=>{const{container:a,...i}=e,[s,o]=n.useState(!1);Hs(()=>o(!0),[]);const c=a||s&&globalThis?.document?.body;return c?w.createPortal(t(Qs.div,{...i,ref:r}),c):null});wo.displayName="Portal";var xo=e=>{const{present:t,children:r}=e,a=function(e){const[t,r]=n.useState(),a=n.useRef(null),i=n.useRef(e),s=n.useRef("none"),o=e?"mounted":"unmounted",[c,l]=function(e,t){return n.useReducer((e,r)=>t[e][r]??e,e)}(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return n.useEffect(()=>{const e=ko(a.current);s.current="mounted"===c?e:"none"},[c]),Hs(()=>{const t=a.current,r=i.current;if(r!==e){const n=s.current,a=ko(t);if(e)l("MOUNT");else if("none"===a||"none"===t?.display)l("UNMOUNT");else{l(r&&n!==a?"ANIMATION_OUT":"UNMOUNT")}i.current=e}},[e,l]),Hs(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,n=n=>{const s=ko(a.current).includes(CSS.escape(n.animationName));if(n.target===t&&s&&(l("ANIMATION_END"),!i.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},o=e=>{e.target===t&&(s.current=ko(a.current))};return t.addEventListener("animationstart",o),t.addEventListener("animationcancel",n),t.addEventListener("animationend",n),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",o),t.removeEventListener("animationcancel",n),t.removeEventListener("animationend",n)}}l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:n.useCallback(e=>{a.current=e?getComputedStyle(e):null,r(e)},[])}}(t),i="function"==typeof r?r({present:a.isPresent}):n.Children.only(r),s=As(a.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(i));return"function"==typeof r||a.isPresent?n.cloneElement(i,{ref:s}):null};function ko(e){return e?.animationName||"none"}xo.displayName="Presence";var So=0;function Co(){n.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??No()),document.body.insertAdjacentElement("beforeend",e[1]??No()),So++,()=>{1===So&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),So--}},[])}function No(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Eo=function(){return Eo=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Eo.apply(this,arguments)};function Ao(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}"function"==typeof SuppressedError&&SuppressedError;var _o="right-scroll-bar-position",Po="width-before-scroll-bar";function To(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Ro="undefined"!=typeof window?n.useLayoutEffect:n.useEffect,Do=new WeakMap;function Io(e,t){var r,n,a,i=(r=null,n=function(t){return e.forEach(function(e){return To(e,t)})},(a=m(function(){return{value:r,callback:n,facade:{get current(){return a.value},set current(e){var t=a.value;t!==e&&(a.value=e,a.callback(e,t))}}}})[0]).callback=n,a.facade);return Ro(function(){var t=Do.get(i);if(t){var r=new Set(t),n=new Set(e),a=i.current;r.forEach(function(e){n.has(e)||To(e,null)}),n.forEach(function(e){r.has(e)||To(e,a)})}Do.set(i,e)},[e]),i}function Mo(e){return e}var Uo=function(e){var t=e.sideCar,r=Ao(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return n.createElement(a,Eo({},r))};Uo.isSideCarExport=!0;var Lo=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Mo);var r=[],n=!1;return{read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(e){var a=t(e,n);return r.push(a),function(){r=r.filter(function(e){return e!==a})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var a=r;r=[],a.forEach(e),t=r}var i=function(){var r=t;t=[],r.forEach(e)},s=function(){return Promise.resolve().then(i)};s(),r={push:function(e){t.push(e),s()},filter:function(e){return t=t.filter(e),r}}}}}(null);return t.options=Eo({async:!0,ssr:!1},e),t}(),Oo=function(){},zo=n.forwardRef(function(e,t){var r=n.useRef(null),a=n.useState({onScrollCapture:Oo,onWheelCapture:Oo,onTouchMoveCapture:Oo}),i=a[0],s=a[1],o=e.forwardProps,c=e.children,l=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,m=e.sideCar,h=e.noRelative,f=e.noIsolation,g=e.inert,b=e.allowPinchZoom,v=e.as,y=void 0===v?"div":v,w=e.gapMode,x=Ao(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=m,S=Io([r,t]),C=Eo(Eo({},x),i);return n.createElement(n.Fragment,null,u&&n.createElement(k,{sideCar:Lo,removeScrollBar:d,shards:p,noRelative:h,noIsolation:f,inert:g,setCallbacks:s,allowPinchZoom:!!b,lockRef:r,gapMode:w}),o?n.cloneElement(n.Children.only(c),Eo(Eo({},C),{ref:S})):n.createElement(y,Eo({},C,{className:l,ref:S}),c))});zo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},zo.classNames={fullWidth:Po,zeroRight:_o};function Fo(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var Bo=function(){var e=0,t=null;return{add:function(r){var n,a;0==e&&(t=Fo())&&(a=r,(n=t).styleSheet?n.styleSheet.cssText=a:n.appendChild(document.createTextNode(a)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Wo=function(){var e,t=(e=Bo(),function(t,r){n.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])});return function(e){var r=e.styles,n=e.dynamic;return t(r,n),null}},Vo={left:0,top:0,right:0,gap:0},Go=function(e){return parseInt(e||"",10)||0},Ho=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Vo;var t=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[Go(r),Go(n),Go(a)]}(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},jo=Wo(),$o="data-scroll-locked",Ko=function(e,t,r,n){var a=e.left,i=e.top,s=e.right,o=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(o,"px ").concat(n,";\n }\n body[").concat($o,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(a,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(o,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(o,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(_o," {\n right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(Po," {\n margin-right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(_o," .").concat(_o," {\n right: 0 ").concat(n,";\n }\n \n .").concat(Po," .").concat(Po," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat($o,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(o,"px;\n }\n")},qo=function(){var e=parseInt(document.body.getAttribute($o)||"0",10);return isFinite(e)?e:0},Zo=function(e){var t=e.noRelative,r=e.noImportant,a=e.gapMode,i=void 0===a?"margin":a;n.useEffect(function(){return document.body.setAttribute($o,(qo()+1).toString()),function(){var e=qo()-1;e<=0?document.body.removeAttribute($o):document.body.setAttribute($o,e.toString())}},[]);var s=n.useMemo(function(){return Ho(i)},[i]);return n.createElement(jo,{styles:Ko(s,!t,i,r?"":"!important")})},Jo=!1;if("undefined"!=typeof window)try{var Yo=Object.defineProperty({},"passive",{get:function(){return Jo=!0,!0}});window.addEventListener("test",Yo,Yo),window.removeEventListener("test",Yo,Yo)}catch(e){Jo=!1}var Xo=!!Jo&&{passive:!1},Qo=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},ec=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),tc(e,n)){var a=rc(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},tc=function(e,t){return"v"===e?function(e){return Qo(e,"overflowY")}(t):function(e){return Qo(e,"overflowX")}(t)},rc=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},nc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ac=function(e){return[e.deltaX,e.deltaY]},ic=function(e){return e&&"current"in e?e.current:e},sc=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},oc=0,cc=[];function lc(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var dc,uc=(dc=function(e){var t=n.useRef([]),r=n.useRef([0,0]),a=n.useRef(),i=n.useState(oc++)[0],s=n.useState(Wo)[0],o=n.useRef(e);n.useEffect(function(){o.current=e},[e]),n.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var t=function(e,t,r){if(r||2===arguments.length)for(var n,a=0,i=t.length;a<i;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(ic),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var c=n.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!o.current.allowPinchZoom;var n,i=nc(e),s=r.current,c="deltaX"in e?e.deltaX:s[0]-i[0],l="deltaY"in e?e.deltaY:s[1]-i[1],d=e.target,u=Math.abs(c)>Math.abs(l)?"h":"v";if("touches"in e&&"h"===u&&"range"===d.type)return!1;var p=window.getSelection(),m=p&&p.anchorNode;if(m&&(m===d||m.contains(d)))return!1;var h=ec(u,d);if(!h)return!0;if(h?n=u:(n="v"===u?"h":"v",h=ec(u,d)),!h)return!1;if(!a.current&&"changedTouches"in e&&(c||l)&&(a.current=n),!n)return!0;var f=a.current||n;return function(e,t,r,n){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=a*n,s=r.target,o=t.contains(s),c=!1,l=i>0,d=0,u=0;do{if(!s)break;var p=rc(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&tc(e,s)&&(d+=h,u+=m);var f=s.parentNode;s=f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE?f.host:f}while(!o&&s!==document.body||o&&(t.contains(s)||t===s));return(l&&Math.abs(d)<1||!l&&Math.abs(u)<1)&&(c=!0),c}(f,t,e,"h"===f?c:l)},[]),l=n.useCallback(function(e){var r=e;if(cc.length&&cc[cc.length-1]===s){var n="deltaY"in r?ac(r):nc(r),a=t.current.filter(function(e){return e.name===r.type&&(e.target===r.target||r.target===e.shadowParent)&&(t=e.delta,a=n,t[0]===a[0]&&t[1]===a[1]);var t,a})[0];if(a&&a.should)r.cancelable&&r.preventDefault();else if(!a){var i=(o.current.shards||[]).map(ic).filter(Boolean).filter(function(e){return e.contains(r.target)});(i.length>0?c(r,i[0]):!o.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),d=n.useCallback(function(e,r,n,a){var i={name:e,delta:r,target:n,should:a,shadowParent:lc(n)};t.current.push(i),setTimeout(function(){t.current=t.current.filter(function(e){return e!==i})},1)},[]),u=n.useCallback(function(e){r.current=nc(e),a.current=void 0},[]),p=n.useCallback(function(t){d(t.type,ac(t),t.target,c(t,e.lockRef.current))},[]),m=n.useCallback(function(t){d(t.type,nc(t),t.target,c(t,e.lockRef.current))},[]);n.useEffect(function(){return cc.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Xo),document.addEventListener("touchmove",l,Xo),document.addEventListener("touchstart",u,Xo),function(){cc=cc.filter(function(e){return e!==s}),document.removeEventListener("wheel",l,Xo),document.removeEventListener("touchmove",l,Xo),document.removeEventListener("touchstart",u,Xo)}},[]);var h=e.removeScrollBar,f=e.inert;return n.createElement(n.Fragment,null,f?n.createElement(s,{styles:sc(i)}):null,h?n.createElement(Zo,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},Lo.useMedium(dc),Uo),pc=n.forwardRef(function(e,t){return n.createElement(zo,Eo({},e,{ref:t,sideCar:uc}))});pc.classNames=zo.classNames;var mc=new WeakMap,hc=new WeakMap,fc={},gc=0,bc=function(e){return e&&(e.host||bc(e.parentNode))},vc=function(e,t,r,n){var a=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=bc(t);return r&&e.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);fc[r]||(fc[r]=new WeakMap);var i=fc[r],s=[],o=new Set,c=new Set(a),l=function(e){e&&!o.has(e)&&(o.add(e),l(e.parentNode))};a.forEach(l);var d=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(o.has(e))d(e);else try{var t=e.getAttribute(n),a=null!==t&&"false"!==t,c=(mc.get(e)||0)+1,l=(i.get(e)||0)+1;mc.set(e,c),i.set(e,l),s.push(e),1===c&&a&&hc.set(e,!0),1===l&&e.setAttribute(r,"true"),a||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return d(t),o.clear(),gc++,function(){s.forEach(function(e){var t=mc.get(e)-1,a=i.get(e)-1;mc.set(e,t),i.set(e,a),t||(hc.has(e)||e.removeAttribute(n),hc.delete(e)),a||e.removeAttribute(r)}),--gc||(mc=new WeakMap,mc=new WeakMap,hc=new WeakMap,fc={})}},yc=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),vc(n,a,r,"aria-hidden")):function(){return null}};function wc(e){const t=n.forwardRef((e,t)=>{const{children:r,...a}=e;if(n.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),i=function(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{const t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}(a,r.props);return r.type!==n.Fragment&&(i.ref=t?Es(t,e):e),n.cloneElement(r,i)}return n.Children.count(r)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xc=Symbol("radix.slottable");function kc(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===xc}var Sc="Dialog",[Cc,Nc]=Vs(Sc),[Ec,Ac]=Cc(Sc),_c=e=>{const{__scopeDialog:r,children:a,open:i,defaultOpen:s,onOpenChange:o,modal:c=!0}=e,l=n.useRef(null),d=n.useRef(null),[u,p]=Zs({prop:i,defaultProp:s??!1,onChange:o,caller:Sc});return t(Ec,{scope:r,triggerRef:l,contentRef:d,contentId:Ks(),titleId:Ks(),descriptionId:Ks(),open:u,onOpenChange:p,onOpenToggle:n.useCallback(()=>p(e=>!e),[p]),modal:c,children:a})};_c.displayName=Sc;var Pc="DialogTrigger",Tc=n.forwardRef((e,r)=>{const{__scopeDialog:n,...a}=e,i=Ac(Pc,n),s=As(r,i.triggerRef);return t(Qs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Jc(i.open),...a,ref:s,onClick:Ws(e.onClick,i.onOpenToggle)})});Tc.displayName=Pc;var Rc="DialogPortal",[Dc,Ic]=Cc(Rc,{forceMount:void 0}),Mc=e=>{const{__scopeDialog:r,forceMount:a,children:i,container:s}=e,o=Ac(Rc,r);return t(Dc,{scope:r,forceMount:a,children:n.Children.map(i,e=>t(xo,{present:a||o.open,children:t(wo,{asChild:!0,container:s,children:e})}))})};Mc.displayName=Rc;var Uc="DialogOverlay",Lc=n.forwardRef((e,r)=>{const n=Ic(Uc,e.__scopeDialog),{forceMount:a=n.forceMount,...i}=e,s=Ac(Uc,e.__scopeDialog);return s.modal?t(xo,{present:a||s.open,children:t(zc,{...i,ref:r})}):null});Lc.displayName=Uc;var Oc=function(e){const r=wc(e),a=n.forwardRef((e,a)=>{const{children:i,...s}=e,o=n.Children.toArray(i),c=o.find(kc);if(c){const e=c.props.children,i=o.map(t=>t===c?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t);return t(r,{...s,ref:a,children:n.isValidElement(e)?n.cloneElement(e,void 0,i):null})}return t(r,{...s,ref:a,children:i})});return a.displayName=`${e}.Slot`,a}("DialogOverlay.RemoveScroll"),zc=n.forwardRef((e,r)=>{const{__scopeDialog:n,...a}=e,i=Ac(Uc,n);return t(pc,{as:Oc,allowPinchZoom:!0,shards:[i.contentRef],children:t(Qs.div,{"data-state":Jc(i.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),Fc="DialogContent",Bc=n.forwardRef((e,r)=>{const n=Ic(Fc,e.__scopeDialog),{forceMount:a=n.forceMount,...i}=e,s=Ac(Fc,e.__scopeDialog);return t(xo,{present:a||s.open,children:s.modal?t(Wc,{...i,ref:r}):t(Vc,{...i,ref:r})})});Bc.displayName=Fc;var Wc=n.forwardRef((e,r)=>{const a=Ac(Fc,e.__scopeDialog),i=n.useRef(null),s=As(r,a.contentRef,i);return n.useEffect(()=>{const e=i.current;if(e)return yc(e)},[]),t(Gc,{...e,ref:s,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ws(e.onCloseAutoFocus,e=>{e.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:Ws(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:Ws(e.onFocusOutside,e=>e.preventDefault())})}),Vc=n.forwardRef((e,r)=>{const a=Ac(Fc,e.__scopeDialog),i=n.useRef(!1),s=n.useRef(!1);return t(Gc,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||a.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));const r=t.target,n=a.triggerRef.current?.contains(r);n&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})}),Gc=n.forwardRef((a,i)=>{const{__scopeDialog:s,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:l,...d}=a,u=Ac(Fc,s),p=n.useRef(null),m=As(i,p);return Co(),e(r,{children:[t(mo,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:c,onUnmountAutoFocus:l,children:t(so,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Jc(u.open),...d,ref:m,onDismiss:()=>u.onOpenChange(!1)})}),e(r,{children:[t(el,{titleId:u.titleId}),t(tl,{contentRef:p,descriptionId:u.descriptionId})]})]})}),Hc="DialogTitle",jc=n.forwardRef((e,r)=>{const{__scopeDialog:n,...a}=e,i=Ac(Hc,n);return t(Qs.h2,{id:i.titleId,...a,ref:r})});jc.displayName=Hc;var $c="DialogDescription",Kc=n.forwardRef((e,r)=>{const{__scopeDialog:n,...a}=e,i=Ac($c,n);return t(Qs.p,{id:i.descriptionId,...a,ref:r})});Kc.displayName=$c;var qc="DialogClose",Zc=n.forwardRef((e,r)=>{const{__scopeDialog:n,...a}=e,i=Ac(qc,n);return t(Qs.button,{type:"button",...a,ref:r,onClick:Ws(e.onClick,()=>i.onOpenChange(!1))})});function Jc(e){return e?"open":"closed"}Zc.displayName=qc;var Yc="DialogTitleWarning",[Xc,Qc]=function(e,r){const a=n.createContext(r),i=e=>{const{children:r,...i}=e,s=n.useMemo(()=>i,Object.values(i));return t(a.Provider,{value:s,children:r})};return i.displayName=e+"Provider",[i,function(t){const i=n.useContext(a);if(i)return i;if(void 0!==r)return r;throw new Error(`\`${t}\` must be used within \`${e}\``)}]}(Yc,{contentName:Fc,titleName:Hc,docsSlug:"dialog"}),el=({titleId:e})=>{const t=Qc(Yc),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return n.useEffect(()=>{if(e){document.getElementById(e)||console.error(r)}},[r,e]),null},tl=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Qc("DialogDescriptionWarning").contentName}}.`;return n.useEffect(()=>{const n=e.current?.getAttribute("aria-describedby");if(t&&n){document.getElementById(t)||console.warn(r)}},[r,e,t]),null},rl=_c,nl=Tc,al=Mc,il=Lc,sl=Bc,ol=jc,cl=Kc,ll=Zc;function dl(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}var ul=["color"],pl=h(function(e,t){var r=e.color,n=void 0===r?"currentColor":r,a=dl(e,ul);return f("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),f("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),ml=["color"],hl=h(function(e,t){var r=e.color,n=void 0===r?"currentColor":r,a=dl(e,ml);return f("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),f("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),fl=["color"],gl=h(function(e,t){var r=e.color,n=void 0===r?"currentColor":r,a=dl(e,fl);return f("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),f("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),bl=["color"],vl=h(function(e,t){var r=e.color,n=void 0===r?"currentColor":r,a=dl(e,bl);return f("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),f("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))});const yl=c({container:null,setContainer:()=>{}}),wl=a.memo(({children:r})=>{const[n,i]=a.useState(null),s=a.useMemo(()=>({container:n,setContainer:i}),[n]);return e(yl.Provider,{value:s,children:[r,t("div",{ref:i,id:"saas-os-portal",className:"saas-os-ui",style:{width:"100%",height:"100%"}})]})});wl.displayName="PortalProvider";const xl=rl,kl=nl,Sl=al,Cl=n.forwardRef(({className:e,...r},n)=>t(il,{ref:n,className:Oe("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}));Cl.displayName=il.displayName;const Nl=n.forwardRef(({className:r,children:a,...i},s)=>{const{container:o}=n.useContext(yl);return e(Sl,{container:o,children:[t(Cl,{}),e(sl,{ref:s,className:Oe("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 md:w-full",r),...i,children:[a,e(ll,{className:"absolute right-4 rtl:right-auto rtl:left-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:[t(gl,{className:"h-4 w-4"}),t("span",{className:"sr-only",children:"Close"})]})]})]})});Nl.displayName=sl.displayName;const El=({className:e,...r})=>t("div",{className:Oe("flex flex-col space-y-1.5 text-center sm:text-start",e),...r});El.displayName="DialogHeader";const Al=n.forwardRef(({className:e,...r},n)=>t(ol,{ref:n,className:Oe("text-lg font-semibold leading-none tracking-tight",e),...r}));Al.displayName=ol.displayName;const _l=n.forwardRef(({className:e,...r},n)=>t(cl,{ref:n,className:Oe("text-sm text-muted-foreground",e),...r}));_l.displayName=cl.displayName;const Pl="saas-workspace-current",Tl=e=>{e?En(Pl,e._id):An(Pl)},Rl=()=>Nn(Pl),Dl=()=>{An(Pl)},Il=(e,t)=>!!e&&t.some(t=>t._id===e);function Ml(e,t){if(!t)return!1;const r=(n=e.createdBy)?"string"==typeof n?n:"object"==typeof n&&"_id"in n&&"string"==typeof n._id?n._id:null:null;var n;return null!==r&&r===t}function Ul(e,t){if(!t||!e.users||!Array.isArray(e.users))return null;const r=e.users.find(e=>"string"==typeof e?e===t:"object"==typeof e&&null!==e&&"_id"in e&&e._id===t);return r&&"object"==typeof r&&"role"in r&&"string"==typeof r.role?r.role:null}const Ll={WORKSPACE_SETTINGS_VIEW:"workspace:settings:view",WORKSPACE_SETTINGS_EDIT:"workspace:settings:edit",WORKSPACE_DELETE:"workspace:delete",WORKSPACE_MEMBERS_VIEW:"workspace:members:view",WORKSPACE_MEMBERS_INVITE:"workspace:members:invite",WORKSPACE_MEMBERS_REMOVE:"workspace:members:remove",WORKSPACE_MEMBERS_ROLE_CHANGE:"workspace:members:role-change",WORKSPACE_FEATURES_VIEW:"workspace:features:view",WORKSPACE_FEATURES_EDIT:"workspace:features:edit",WORKSPACE_BILLING_VIEW:"workspace:billing:view",WORKSPACE_BILLING_MANAGE:"workspace:billing:manage",WORKSPACE_USAGE_VIEW:"workspace:usage:view"},Ol=Object.values(Ll),zl={admin:Ol.filter(e=>e!==Ll.WORKSPACE_DELETE),member:[Ll.WORKSPACE_SETTINGS_VIEW,Ll.WORKSPACE_MEMBERS_VIEW,Ll.WORKSPACE_FEATURES_VIEW,Ll.WORKSPACE_BILLING_VIEW,Ll.WORKSPACE_USAGE_VIEW],viewer:[Ll.WORKSPACE_SETTINGS_VIEW,Ll.WORKSPACE_MEMBERS_VIEW]};function Fl(e){const t=new Set;for(const r of Object.values(e))for(const e of r)t.add(e);return Array.from(t)}function Bl(e){const{userId:t,workspace:r,settings:n,appPermissions:a}=e;if(!r||!t)return new Set;if(Ml(r,t)){const e=new Set(Ol);if(a)for(const t of Fl(a))e.add(t);if(r.permissions)for(const t of Fl(r.permissions))e.add(t);if(n?.workspace?.permissions)for(const t of Fl(n.workspace.permissions))e.add(t);return e}const i=e.workspaceRole??Ul(r,t);if(!i)return new Set;const s=r.permissions,o=n?.workspace?.permissions,c=e=>e.filter(e=>e.startsWith("workspace:")),l=e=>e.filter(e=>!e.startsWith("workspace:")),d=s?.[i]?c(s[i]):[],u=o?.[i]?c(o[i]):[],p=zl[i]??[];let m;if(d.length>0)m=d;else if(u.length>0)m=u;else if(p.length>0)m=p;else{m=zl[n?.workspace?.defaultRole??"member"]??zl.member??[]}const h=new Set(m),f=s?.[i]?l(s[i]):[],g=a?.[i]?l(a[i]):[],b=f.length>0?f:g;for(const e of b)h.add(e);return function(e,t,r){if(!r?.workspace)return;const{canInviteMembers:n}=r.workspace;(!1===n||"admin-only"===n&&"admin"!==t)&&e.delete(Ll.WORKSPACE_MEMBERS_INVITE)}(h,i,n),h}function Wl(e){const{user:t}=ZC(),{currentWorkspace:r}=jC(),{settings:n}=Vn(),{appPermissions:a}=Na(),i=e??r??null,s=t?.id??null,c=o(()=>i?Ul(i,s):null,[i,s]),l=o(()=>!!i&&Ml(i,s),[i,s]),d=o(()=>Bl({userId:s,workspaceRole:c,workspace:i,settings:n,appPermissions:a}),[s,c,i,n,a]),u=p(e=>Array.isArray(e)?e.every(e=>d.has(e)):d.has(e),[d]);return{can:u,permissions:d,isOwner:l,role:c}}const Vl={usd:"$",eur:"€",gbp:"£",jpy:"¥",cad:"CA$",aud:"A$",chf:"CHF",cny:"¥",hkd:"HK$",sgd:"S$",inr:"₹",mxn:"MX$",brl:"R$",nzd:"NZ$",sek:"kr",nok:"kr",dkk:"kr",pln:"zł",thb:"฿"},Gl={usd:"🇺🇸",eur:"🇪🇺",gbp:"🇬🇧",jpy:"🇯🇵",cad:"🇨🇦",aud:"🇦🇺",chf:"🇨🇭",cny:"🇨🇳",hkd:"🇭🇰",sgd:"🇸🇬",inr:"🇮🇳",mxn:"🇲🇽",brl:"🇧🇷",nzd:"🇳🇿",sek:"🇸🇪",nok:"🇳🇴",dkk:"🇩🇰",pln:"🇵🇱",thb:"🇹🇭"};function Hl(e){return e&&e.trim()?Gl[e.trim().toLowerCase()]??"":""}function jl(e){if(!e||!e.trim())return"";const t=e.trim().toLowerCase();return Vl[t]??t.toUpperCase()}["usd","eur","gbp","jpy","cad","aud","chf","cny","hkd","sgd","inr","mxn","brl","nzd","sek","nok","dkk","pln","thb"].map(e=>({value:e,label:`${e.toUpperCase()} (${jl(e)})`}));const $l=({open:r,onOpenChange:n,packages:a,billingCurrency:i,workspaceName:s,onSelectPackage:c,purchasingPackageId:l,loading:d=!1})=>{const{t:u,dir:p,fmtNum:h,fmtCents:f}=Cn(),g=o(()=>{const e=new Set;return a.forEach(t=>{t.pricingVariants?.forEach(t=>{t.currency&&e.add(t.currency.toLowerCase())})}),Array.from(e)},[a]),b=o(()=>{const e=i?.trim().toLowerCase();return e?g.includes(e)?[e]:[]:g},[i,g]),[v,y]=m(()=>b.length>0?b[0]:""),w=i?.trim().toLowerCase()||v,x=d||!!l;return t(xl,{open:r,onOpenChange:n,children:e(Nl,{dir:p,className:"inset-0 w-screen h-screen max-w-none rounded-none translate-x-0 translate-y-0 p-0 flex flex-col",children:[e("div",{className:"flex-shrink-0 px-4 py-4 sm:px-6 sm:py-6 border-b space-y-3 sm:space-y-4",children:[e("div",{children:[t(Al,{className:"text-xl sm:text-2xl font-bold",children:u("credits.dialogTitle")}),e(_l,{className:"mt-1 text-sm",children:[u("credits.dialogDescription"),s&&t("span",{className:"ms-1 font-medium text-foreground",children:u("credits.dialogDescriptionWorkspace",{workspace:s})})]})]}),!i?.trim()&&b.length>1&&e("div",{className:"flex items-center gap-2",children:[t("span",{className:"text-sm text-slate-600",children:u("pricing.currency")}),t("div",{className:"flex gap-1 rounded-lg border border-gray-200 bg-gray-50/50 p-1",children:b.map(t=>e("button",{type:"button",onClick:()=>y(t),className:Oe("rounded-md px-3 py-1.5 text-sm font-medium transition-colors",w===t?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-700"),children:[jl(t)," ",t.toUpperCase()]},t))})]})]}),t("div",{className:"flex-1 overflow-y-auto",children:0===a.length?e("div",{className:"flex flex-col items-center justify-center py-16 text-gray-400",children:[t(ts,{className:"h-12 w-12 mb-3"}),t("p",{className:"text-sm",children:u("credits.noPackages")})]}):t("div",{className:"max-w-2xl mx-auto px-4 py-6 sm:px-6 space-y-4",children:a.map(r=>{const n=r.pricingVariants?.find(e=>e.currency?.toLowerCase()===w)??r.pricingVariants?.[0],a=n?.amount,i=n?.currency??w,s=l===r._id,o=null!=a&&a>0&&r.creditAmount>0?Math.round(a/r.creditAmount):null;return e("div",{className:Oe("rounded-xl border p-5 sm:p-6 flex flex-col sm:flex-row sm:items-center gap-4 transition-all",s?"border-primary bg-primary/5 shadow-md":"border-gray-200 hover:border-gray-300 hover:shadow-sm"),children:[e("div",{className:"flex-1 min-w-0",children:[e("div",{className:"flex items-center gap-2 mb-1",children:[t("h3",{className:"text-lg font-semibold text-gray-900",children:r.name}),e("span",{className:"inline-flex items-center gap-1 rounded-full bg-blue-50 px-2.5 py-0.5 text-xs font-medium text-blue-700",children:[t(ts,{className:"h-3 w-3"}),u("credits.creditsAmount",{count:h(r.creditAmount)})]})]}),r.description&&t("p",{className:"text-sm text-gray-500 mb-2",children:r.description}),e("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-gray-400",children:[t("span",{children:r.validityDays?u("credits.validityDays",{count:r.validityDays}):u("credits.validityUnlimited")}),null!=o&&t("span",{children:u("credits.perCredit",{price:f(o,i)})})]})]}),e("div",{className:"flex items-center gap-4 sm:flex-col sm:items-end sm:gap-2 shrink-0",children:[null!=a&&t("span",{className:"text-2xl sm:text-3xl font-bold text-gray-900 whitespace-nowrap",children:f(a,i)}),t(Bs,{size:"sm",onClick:()=>c(r),disabled:x,progress:s,className:"whitespace-nowrap",children:s?u("credits.purchasing"):u("credits.buyAmount",{count:h(r.creditAmount)})})]})]},r._id)})})})]})})},Kl=({titleKey:r,descriptionKey:n})=>{const{t:a}=Cn();return t("div",{className:"border border-amber-200 bg-amber-50 rounded-lg p-4",children:e("div",{className:"flex items-start gap-3",children:[t(hs,{className:"h-5 w-5 text-amber-600 shrink-0 mt-0.5"}),e("div",{children:[t("h4",{className:"text-sm font-medium text-amber-800",children:a(r??"settings.common.noPermissionTitle")}),t("p",{className:"text-xs text-amber-700 mt-1",children:a(n??"settings.common.noPermissionDescription")})]})]})})};function ql({className:e,...r}){return t("div",{className:Oe("animate-pulse rounded-md bg-primary/10",e),...r})}function Zl(){return e("div",{className:"space-y-3.5",children:[t(ql,{className:"h-10 w-full"}),t(ql,{className:"h-10 w-full"}),t(ql,{className:"h-10 w-full"})]})}function Jl(e,t="en-US",r){try{const n=new Date(e);return isNaN(n.getTime())?"":new Intl.DateTimeFormat(t,r??{month:"short",day:"numeric",year:"numeric"}).format(n)}catch{return""}}function Yl(e,t="en-US"){return Jl(e,t,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function Xl(e,t="en-US"){return e?new Date(1e3*e).toLocaleDateString(t,{year:"numeric",month:"short",day:"numeric"}):""}const Ql={[hi]:"credits.type.plan_grant",[fi]:"credits.type.pack_purchased",[gi]:"credits.type.consumed",[bi]:"credits.type.expired",[vi]:"credits.type.admin_grant",[yi]:"credits.type.admin_revoke",[wi]:"credits.type.refund"};const ed=({workspace:n})=>{const a=n._id?.toString(),{t:i,fmtNum:o}=Cn(),{can:c}=Wl(),l=c(Ll.WORKSPACE_BILLING_VIEW),d=c(Ll.WORKSPACE_BILLING_MANAGE),{balance:h,loading:f,error:g,refetch:b}=ka(),{packages:v,loading:y}=ga(a),{expiringCredits:w,loading:x}=va(a,7),[k,S]=m(1),{transactions:C,hasNextPage:N,loading:E}=ba(a,{limit:10,page:k}),[A,_]=m([]);u(()=>{E||0===C.length||_(1===k?C:e=>{const t=new Set(e.map(e=>e._id)),r=C.filter(e=>!t.has(e._id));return r.length>0?[...e,...r]:e})},[C,k,E]);const P=p(()=>{N&&!E&&S(e=>e+1)},[N,E]),T=A,{purchaseCredits:R,loading:D}=fa(a),[I,M]=m(!1),[U,L]=m(null),[O,z]=m(!1),[F,B]=m(!1),[W,V]=m(null),[G,H]=m(!1),j=s(!1),$=f&&!h;u(()=>{if(j.current)return;const e=HC.getState();if(!e.params?.action)return;if(e.params.action===Wa)return j.current=!0,HC.clearParams(),void H(!0);if(e.params.action!==Ba)return;j.current=!0;const t=e.params.status;if(HC.clearParams(),t===Va){z(!0),pa();const e=setTimeout(()=>z(!1),8e3);return()=>clearTimeout(e)}if(t===Ga){B(!0);const e=setTimeout(()=>B(!1),5e3);return()=>clearTimeout(e)}t===Ha&&L(i("credits.purchaseFailed"))},[]);if($)return t(Zl,{});if(!l)return t(Kl,{});if(!a)return t("div",{className:"border rounded-lg p-4 text-center text-gray-500",children:t("p",{children:i("subscription.invalidWorkspace")})});const K=!y&&v.length>0;return e("div",{className:"space-y-6",children:[e("div",{className:"space-y-3",children:[t("p",{className:"text-sm text-gray-600",children:i("credits.description")}),e("div",{className:"flex flex-wrap items-center gap-2",children:[K&&d&&e(Bs,{size:"sm",onClick:()=>H(!0),children:[t(gs,{className:"h-3.5 w-3.5 me-1.5"}),i("credits.buyCredits")]}),e(Bs,{variant:"ghost",size:"sm",onClick:async()=>{M(!0);try{await b()}finally{M(!1)}},disabled:I,children:[t(us,{className:Oe("h-3.5 w-3.5 me-1.5",I&&"animate-spin")}),i("settings.common.refreshAction",{loading:String(I)})]})]})]}),g&&e("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg",children:[t("p",{className:"font-medium",children:i("credits.errorLoading")}),t("p",{className:"text-sm mt-1",children:g})]}),O&&e("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e("div",{className:"flex items-center gap-2",children:[t(es,{className:"h-4 w-4 flex-shrink-0"}),t("p",{className:"text-sm font-medium",children:i("credits.purchaseSuccess")})]}),t(Bs,{variant:"outline",size:"sm",onClick:()=>z(!1),className:"flex-shrink-0 border-green-200 text-green-700 hover:bg-green-100",children:i("settings.common.dismiss")})]}),F&&e("div",{className:"bg-amber-50 border border-amber-200 text-amber-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[t("p",{className:"text-sm font-medium",children:i("credits.purchaseCanceled")}),t(Bs,{variant:"outline",size:"sm",onClick:()=>B(!1),className:"flex-shrink-0 border-amber-200 text-amber-700 hover:bg-amber-100",children:i("settings.common.dismiss")})]}),U&&e("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[t("p",{className:"text-sm",children:U}),t(Bs,{variant:"outline",size:"sm",onClick:()=>L(null),className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:i("settings.common.dismiss")})]}),e("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[e("div",{className:"bg-gray-50/50 p-4 sm:p-5",children:[e("div",{className:"flex items-center justify-between mb-3",children:[t("h3",{className:"text-sm font-semibold text-gray-500 uppercase tracking-wider",children:i("credits.balance")}),t(ts,{className:"h-5 w-5 text-gray-400"})]}),h?e(r,{children:[t("div",{className:"text-3xl font-bold text-gray-900 mb-4",children:o(h.available)}),e("div",{className:"grid grid-cols-2 gap-3",children:[e("div",{children:[t("p",{className:"text-xs text-gray-500",children:i("credits.totalGranted")}),t("p",{className:"text-sm font-medium text-gray-900",children:o(h.totalGranted)})]}),e("div",{children:[t("p",{className:"text-xs text-gray-500",children:i("credits.totalConsumed")}),t("p",{className:"text-sm font-medium text-gray-900",children:o(h.totalConsumed)})]}),e("div",{children:[t("p",{className:"text-xs text-gray-500",children:i("credits.totalExpired")}),t("p",{className:"text-sm font-medium text-gray-900",children:o(h.totalExpired)})]}),e("div",{children:[t("p",{className:"text-xs text-gray-500",children:i("credits.available")}),t("p",{className:"text-sm font-semibold text-green-600",children:o(h.available)})]})]})]}):e("div",{className:"text-center py-4",children:[t(ts,{className:"h-10 w-10 text-gray-300 mx-auto mb-2"}),t("p",{className:"text-sm text-gray-600",children:i("credits.noCredits")}),t("p",{className:"text-xs text-gray-500 mt-1",children:i("credits.noCreditsHint")}),K&&d&&e(Bs,{size:"sm",className:"mt-3",onClick:()=>H(!0),children:[t(gs,{className:"h-3.5 w-3.5 me-1.5"}),i("credits.buyCredits")]})]})]}),!x&&w>0&&t("div",{className:"px-4 py-3 bg-amber-50 border-t border-amber-200 text-sm text-amber-800",children:i("credits.expiringInDays",{count:w,days:7})})]}),e("div",{children:[t("h3",{className:"text-sm font-semibold text-gray-900 mb-3",children:i("credits.transactions")}),E&&0===T.length?e("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-600",children:[t(os,{className:"h-4 w-4 animate-spin flex-shrink-0"}),t("span",{children:i("settings.common.loading")})]}):0===T.length?t("div",{className:"border rounded-lg p-6 text-center",children:t("p",{className:"text-sm text-gray-500",children:i("credits.noTransactions")})}):e("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[t("div",{className:"divide-y divide-gray-100",children:T.map(e=>t(td,{tx:e},e._id))}),N&&t("div",{className:"border-t border-gray-200 px-4 py-3 text-center",children:t(Bs,{variant:"ghost",size:"sm",onClick:P,disabled:E,progress:E&&k>1,children:i("credits.loadMore")})})]})]}),K&&d&&t($l,{open:G,onOpenChange:H,packages:v,billingCurrency:n.billingCurrency,workspaceName:n.name,onSelectPackage:async e=>{if(a){L(null),V(e._id);try{const{successUrl:t,cancelUrl:r}=qa(a),n=await R({creditPackageId:e._id,successUrl:t,cancelUrl:r});n.url&&Ta(n.url)}catch(e){L(e instanceof Error?e.message:i("errors.purchaseCredits")),V(null)}}},purchasingPackageId:W,loading:D})]})};function td({tx:r}){const{t:n,formattingLocale:a,fmtNum:i}=Cn(),s=Ql[r.type]??"credits.type.consumed",o=function(e){switch(e){case"plan_grant":case"admin_grant":case"refund":return"bg-green-100 text-green-800";case"pack_purchased":return"bg-blue-100 text-blue-800";case"consumed":default:return"bg-gray-100 text-gray-800";case"expired":case"admin_revoke":return"bg-red-100 text-red-800"}}(r.type),c=r.amount>0;return t("div",{className:"px-3 py-3 sm:px-4",children:e("div",{className:"flex items-start justify-between gap-2",children:[e("div",{className:"min-w-0 flex-1",children:[e("div",{className:"flex flex-wrap items-center gap-1.5 mb-0.5",children:[t("span",{className:Oe("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium shrink-0",o),children:n(s)}),r.description&&t("p",{className:"text-sm text-gray-700 truncate",children:r.description})]}),t("p",{className:"text-xs text-gray-400",children:Yl(r.createdAt,a)})]}),e("div",{className:"text-end shrink-0",children:[e("span",{className:Oe("text-sm font-semibold",c?"text-green-600":"text-gray-900"),children:[c?"+":"",i(r.amount)]}),t("p",{className:"text-xs text-gray-400",children:i(r.balanceAfter)})]})]})})}var rd=Symbol("radix.slottable");var nd="AlertDialog",[ad]=Vs(nd,[Nc]),id=Nc(),sd=e=>{const{__scopeAlertDialog:r,...n}=e,a=id(r);return t(rl,{...a,...n,modal:!0})};sd.displayName=nd;var od=n.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...a}=e,i=id(n);return t(nl,{...i,...a,ref:r})});od.displayName="AlertDialogTrigger";var cd=e=>{const{__scopeAlertDialog:r,...n}=e,a=id(r);return t(al,{...a,...n})};cd.displayName="AlertDialogPortal";var ld=n.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...a}=e,i=id(n);return t(il,{...i,...a,ref:r})});ld.displayName="AlertDialogOverlay";var dd="AlertDialogContent",[ud,pd]=ad(dd),md=function(e){const n=({children:e})=>t(r,{children:e});return n.displayName=`${e}.Slottable`,n.__radixId=rd,n}("AlertDialogContent"),hd=n.forwardRef((r,a)=>{const{__scopeAlertDialog:i,children:s,...o}=r,c=id(i),l=n.useRef(null),d=As(a,l),u=n.useRef(null);return t(Xc,{contentName:dd,titleName:fd,docsSlug:"alert-dialog",children:t(ud,{scope:i,cancelRef:u,children:e(sl,{role:"alertdialog",...c,...o,ref:d,onOpenAutoFocus:Ws(o.onOpenAutoFocus,e=>{e.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[t(md,{children:s}),t(kd,{contentRef:l})]})})})});hd.displayName=dd;var fd="AlertDialogTitle",gd=n.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...a}=e,i=id(n);return t(ol,{...i,...a,ref:r})});gd.displayName=fd;var bd="AlertDialogDescription",vd=n.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...a}=e,i=id(n);return t(cl,{...i,...a,ref:r})});vd.displayName=bd;var yd=n.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...a}=e,i=id(n);return t(ll,{...i,...a,ref:r})});yd.displayName="AlertDialogAction";var wd="AlertDialogCancel",xd=n.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...a}=e,{cancelRef:i}=pd(wd,n),s=id(n),o=As(r,i);return t(ll,{...s,...a,ref:o})});xd.displayName=wd;var kd=({contentRef:e})=>{const t=`\`${dd}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${dd}\` by passing a \`${bd}\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${dd}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return n.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Sd=ld,Cd=hd,Nd=yd,Ed=xd,Ad=gd,_d=vd;const Pd=sd,Td=od,Rd=cd,Dd=n.forwardRef(({className:e,...r},n)=>t(Sd,{className:Oe("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r,ref:n}));Dd.displayName=Sd.displayName;const Id=n.forwardRef(({className:r,...a},i)=>{const{container:s}=n.useContext(yl);return e(Rd,{container:s,children:[t(Dd,{}),t(Cd,{ref:i,className:Oe("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 md:w-full",r),...a})]})});Id.displayName=Cd.displayName;const Md=({className:e,...r})=>t("div",{className:Oe("flex flex-col space-y-2 text-center sm:text-start",e),...r});Md.displayName="AlertDialogHeader";const Ud=({className:e,...r})=>t("div",{className:Oe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});Ud.displayName="AlertDialogFooter";const Ld=n.forwardRef(({className:e,...r},n)=>t(Ad,{ref:n,className:Oe("text-lg font-semibold",e),...r}));Ld.displayName=Ad.displayName;const Od=n.forwardRef(({className:e,...r},n)=>t(_d,{ref:n,className:Oe("text-sm text-muted-foreground",e),...r}));Od.displayName=_d.displayName;const zd=n.forwardRef(({className:e,...r},n)=>t(Nd,{ref:n,className:Oe(Fs(),e),...r}));zd.displayName=Nd.displayName;const Fd=n.forwardRef(({className:e,...r},n)=>t(Ed,{ref:n,className:Oe(Fs({variant:"outline"}),"mt-2 sm:mt-0",e),...r}));Fd.displayName=Ed.displayName;const Bd=({workspace:n})=>{const[a,i]=m(!1),{deleteWorkspace:s}=jC(),{can:o}=Wl(),{settings:c}=Vn(),{t:l}=Cn();if(1===(c?.workspace?.maxWorkspacesPerUser??0))return null;if(!n)return t(Zl,{});return o(Ll.WORKSPACE_DELETE)?e("div",{className:"space-y-4",children:[e("div",{children:[t("h3",{className:"text-lg font-semibold text-destructive",children:l("danger.title")}),t("p",{className:"text-sm text-muted-foreground mt-2",children:l("danger.deleteDescription")})]}),e(Pd,{children:[t(Td,{asChild:!0,children:e(Bs,{variant:"destructive",disabled:a,progress:a,children:[t(ws,{className:"h-4 w-4 me-2"}),l("danger.deleteWorkspace")]})}),e(Id,{children:[e(Md,{children:[t(Ld,{children:l("danger.deleteConfirm")}),t(Od,{children:l("danger.deleteConfirmDescription")})]}),e(Ud,{children:[t(Fd,{disabled:a,children:l("settings.common.cancel")}),t(zd,{onClick:async()=>{i(!0);try{await s(n._id)}catch(e){$e(e,{component:"WorkspaceSettingsDanger",action:"handleDeleteWorkspace",metadata:{workspaceId:n._id}}),alert(e instanceof Error?e.message:l("danger.failedToDelete"))}finally{i(!1)}},disabled:a,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:a?e(r,{children:[t(os,{className:"me-2 h-4 w-4 animate-spin"}),l("danger.deleting")]}):l("danger.deleteWorkspace")})]})]})]})]}):t(Kl,{descriptionKey:"danger.adminOnly"})};function Wd(e){const t=n.useRef({value:e,previous:e});return n.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Vd(e){const[t,r]=n.useState(void 0);return Hs(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const n=t[0];let a,i;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;a=t.inlineSize,i=t.blockSize}else a=e.offsetWidth,i=e.offsetHeight;r({width:a,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}var Gd="Switch",[Hd]=Vs(Gd),[jd,$d]=Hd(Gd),Kd=n.forwardRef((r,a)=>{const{__scopeSwitch:i,name:s,checked:o,defaultChecked:c,required:l,disabled:d,value:u="on",onCheckedChange:p,form:m,...h}=r,[f,g]=n.useState(null),b=As(a,e=>g(e)),v=n.useRef(!1),y=!f||(m||!!f.closest("form")),[w,x]=Zs({prop:o,defaultProp:c??!1,onChange:p,caller:Gd});return e(jd,{scope:i,checked:w,disabled:d,children:[t(Qs.button,{type:"button",role:"switch","aria-checked":w,"aria-required":l,"data-state":Yd(w),"data-disabled":d?"":void 0,disabled:d,value:u,...h,ref:b,onClick:Ws(r.onClick,e=>{x(e=>!e),y&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),y&&t(Jd,{control:f,bubbles:!v.current,name:s,value:u,checked:w,required:l,disabled:d,form:m,style:{transform:"translateX(-100%)"}})]})});Kd.displayName=Gd;var qd="SwitchThumb",Zd=n.forwardRef((e,r)=>{const{__scopeSwitch:n,...a}=e,i=$d(qd,n);return t(Qs.span,{"data-state":Yd(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:r})});Zd.displayName=qd;var Jd=n.forwardRef(({__scopeSwitch:e,control:r,checked:a,bubbles:i=!0,...s},o)=>{const c=n.useRef(null),l=As(c,o),d=Wd(a),u=Vd(r);return n.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==a&&r){const t=new Event("click",{bubbles:i});r.call(e,a),e.dispatchEvent(t)}},[d,a,i]),t("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a,...s,tabIndex:-1,ref:l,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Yd(e){return e?"checked":"unchecked"}Jd.displayName="SwitchBubbleInput";var Xd=Kd,Qd=Zd;const eu=n.forwardRef(({className:e,...r},n)=>t(Xd,{className:Oe("peer inline-flex h-[20px] w-[36px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm 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),...r,ref:n,children:t(Qd,{className:Oe("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));function tu(e=5e3){const[t,r]=m(null),n=s(null);u(()=>()=>{n.current&&clearTimeout(n.current)},[]);return{message:t,show:p(t=>{r(t),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r(null)},e)},[e]),clear:p(()=>{r(null),n.current&&clearTimeout(n.current)},[])}}eu.displayName=Xd.displayName;const ru=({workspaceId:r})=>{const{t:n}=Cn(),{allFeatures:a,updateFeature:i,getWorkspace:s}=jC(),{can:o}=Wl(),[c,l]=m({}),d=tu(),[p,h]=m(null);if(u(()=>{s(r).then(h)},[r]),!p)return t(Zl,{});const f=o(Ll.WORKSPACE_FEATURES_EDIT);return e("div",{children:[d.message&&e("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[t("p",{className:"font-medium",children:n("settings.common.success")}),t("p",{className:"text-sm",children:d.message})]}),e("div",{className:"flex flex-col gap-y-3.5 pe-4",children:[!f&&t(Kl,{descriptionKey:"features.ownerOnly"}),!a.length&&t("div",{className:"text-muted-foreground",children:n("features.noFeatures")}),a.length>0&&t("div",{className:"flex flex-col gap-y-3.5",children:a.map(r=>{const s=p?.features?.[r.slug],o=null!==c[r.slug]&&void 0!==c[r.slug],u=c[r.slug],m=n("features.actionStatus",{action:!0===u?"enabling":!1===u?"disabling":"none"});return e("div",{className:"flex items-center gap-x-2 justify-between w-full",children:[e("div",{className:"flex gap-x-2 flex-col",children:[t("h3",{className:"font-medium text-ellipsis",children:r.name}),t("p",{className:"text-muted-foreground",children:r.description})]}),o?e("div",{className:"flex items-center gap-x-1",children:[t(os,{className:"h-4 w-4 animate-spin text-gray-500"}),e("span",{className:"text-sm text-gray-600",children:[m,"..."]})]}):t(eu,{disabled:!f,checked:s??r.defaultValue,onCheckedChange:e=>async function(e,t){if(p){l(r=>({...r,[e]:t})),d.clear();try{const r=await i(p._id,e,t);h(r);const s=a.find(t=>t.slug===e),o=s?.name||"Feature";d.show(n("features.updateSuccess",{feature:o,enabled:String(t)}))}catch(t){$e(t,{component:"WorkspaceSettingsFeatures",action:"updateFeature",metadata:{workspaceId:p._id,featureKey:e}})}finally{l(t=>({...t,[e]:null}))}}}(r.slug,e)})]},r._id)})})]})]})};var nu=e=>"checkbox"===e.type,au=e=>e instanceof Date,iu=e=>null==e;const su=e=>"object"==typeof e;var ou=e=>!iu(e)&&!Array.isArray(e)&&su(e)&&!au(e),cu=e=>ou(e)&&e.target?nu(e.target)?e.target.checked:e.target.value:e,lu=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),du="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function uu(e){if(e instanceof Date)return new Date(e);const t="undefined"!=typeof FileList&&e instanceof FileList;if(du&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!(r||ou(e)&&(e=>{const t=e.constructor&&e.constructor.prototype;return ou(t)&&t.hasOwnProperty("isPrototypeOf")})(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=uu(e[t]));return n}var pu=e=>/^\w*$/.test(e),mu=e=>void 0===e,hu=e=>Array.isArray(e)?e.filter(Boolean):[],fu=e=>hu(e.replace(/["|']|\]/g,"").split(/\.|\[/)),gu=(e,t,r)=>{if(!t||!ou(e))return r;const n=(pu(t)?[t]:fu(t)).reduce((e,t)=>iu(e)?e:e[t],e);return mu(n)||n===e?mu(e[t])?r:e[t]:n},bu=e=>"boolean"==typeof e,vu=e=>"function"==typeof e,yu=(e,t,r)=>{let n=-1;const a=pu(t)?[t]:fu(t),i=a.length,s=i-1;for(;++n<i;){const t=a[n];let i=r;if(n!==s){const r=e[t];i=ou(r)||Array.isArray(r)?r:isNaN(+a[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=i,e=e[t]}};const wu="blur",xu="focusout",ku="change",Su="onBlur",Cu="onChange",Nu="onSubmit",Eu="onTouched",Au="all",_u="max",Pu="min",Tu="maxLength",Ru="minLength",Du="pattern",Iu="required",Mu="validate",Uu=a.createContext(null);Uu.displayName="HookFormControlContext";const Lu=()=>a.useContext(Uu);var Ou=(e,t,r,n=!0)=>{const a={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(a,i,{get:()=>{const a=i;return t._proxyFormState[a]!==Au&&(t._proxyFormState[a]=!n||Au),r&&(r[a]=!0),e[a]}});return a};const zu="undefined"!=typeof window?a.useLayoutEffect:a.useEffect;var Fu=e=>"string"==typeof e,Bu=(e,t,r,n,a)=>Fu(e)?(n&&t.watch.add(e),gu(r,e,a)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),gu(r,e))):(n&&(t.watchAll=!0),r),Wu=e=>iu(e)||!su(e);function Vu(e,t,r=new WeakSet){if(Wu(e)||Wu(t))return Object.is(e,t);if(au(e)&&au(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const i of n){const n=e[i];if(!a.includes(i))return!1;if("ref"!==i){const e=t[i];if(au(n)&&au(e)||ou(n)&&ou(e)||Array.isArray(n)&&Array.isArray(e)?!Vu(n,e,r):!Object.is(n,e))return!1}}return!0}function Gu(e){const t=Lu(),{name:r,disabled:n,control:i=t,shouldUnregister:s,defaultValue:o,exact:c=!0}=e,l=lu(i._names.array,r),d=a.useMemo(()=>gu(i._formValues,r,gu(i._defaultValues,r,o)),[i,r,o]),u=function(e){const t=Lu(),{control:r=t,name:n,defaultValue:i,disabled:s,exact:o,compute:c}=e||{},l=a.useRef(i),d=a.useRef(c),u=a.useRef(void 0),p=a.useRef(r),m=a.useRef(n);d.current=c;const[h,f]=a.useState(()=>{const e=r._getWatch(n,l.current);return d.current?d.current(e):e}),g=a.useCallback(e=>{const t=Bu(n,r._names,e||r._formValues,!1,l.current);return d.current?d.current(t):t},[r._formValues,r._names,n]),b=a.useCallback(e=>{if(!s){const t=Bu(n,r._names,e||r._formValues,!1,l.current);if(d.current){const e=d.current(t);Vu(e,u.current)||(f(e),u.current=e)}else f(t)}},[r._formValues,r._names,s,n]);zu(()=>(p.current===r&&Vu(m.current,n)||(p.current=r,m.current=n,b()),r._subscribe({name:n,formState:{values:!0},exact:o,callback:e=>{b(e.values)}})),[r,o,n,b]),a.useEffect(()=>r._removeUnmounted());const v=p.current!==r,y=m.current,w=a.useMemo(()=>{if(s)return null;const e=!v&&!Vu(y,n);return v||e?g():null},[s,v,n,y,g]);return null!==w?w:h}({control:i,name:r,defaultValue:d,exact:c}),p=function(e){const t=Lu(),{control:r=t,disabled:n,name:i,exact:s}=e||{},[o,c]=a.useState(r._formState),l=a.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return zu(()=>r._subscribe({name:i,formState:l.current,exact:s,callback:e=>{!n&&c({...r._formState,...e})}}),[i,n,s]),a.useEffect(()=>{l.current.isValid&&r._setValid(!0)},[r]),a.useMemo(()=>Ou(o,r,l.current,!1),[o,r])}({control:i,name:r,exact:c}),m=a.useRef(e),h=a.useRef(void 0),f=a.useRef(i.register(r,{...e.rules,value:u,...bu(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const g=a.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!gu(p.errors,r)},isDirty:{enumerable:!0,get:()=>!!gu(p.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!gu(p.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!gu(p.validatingFields,r)},error:{enumerable:!0,get:()=>gu(p.errors,r)}}),[p,r]),b=a.useCallback(e=>f.current.onChange({target:{value:cu(e),name:r},type:ku}),[r]),v=a.useCallback(()=>f.current.onBlur({target:{value:gu(i._formValues,r),name:r},type:wu}),[r,i._formValues]),y=a.useCallback(e=>{const t=gu(i._fields,r);t&&t._f&&e&&(t._f.ref={focus:()=>vu(e.focus)&&e.focus(),select:()=>vu(e.select)&&e.select(),setCustomValidity:t=>vu(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>vu(e.reportValidity)&&e.reportValidity()})},[i._fields,r]),w=a.useMemo(()=>({name:r,value:u,...bu(n)||p.disabled?{disabled:p.disabled||n}:{},onChange:b,onBlur:v,ref:y}),[r,n,p.disabled,b,v,y,u]);return a.useEffect(()=>{const e=i._options.shouldUnregister||s,t=h.current;t&&t!==r&&!l&&i.unregister(t),i.register(r,{...m.current.rules,...bu(m.current.disabled)?{disabled:m.current.disabled}:{}});const n=(e,t)=>{const r=gu(i._fields,e);r&&r._f&&(r._f.mount=t)};if(n(r,!0),e){const e=uu(gu(i._options.defaultValues,r,m.current.defaultValue));yu(i._defaultValues,r,e),mu(gu(i._formValues,r))&&yu(i._formValues,r,e)}return!l&&i.register(r),h.current=r,()=>{(l?e&&!i._state.action:e)?i.unregister(r):n(r,!1)}},[r,i,l,s]),a.useEffect(()=>{i._setDisabledField({disabled:n,name:r})},[n,r,i]),a.useMemo(()=>({field:w,formState:p,fieldState:g}),[w,p,g])}const Hu=e=>e.render(Gu(e)),ju=a.createContext(null);ju.displayName="HookFormContext";const $u=e=>{const{children:t,watch:r,getValues:n,getFieldState:i,setError:s,clearErrors:o,setValue:c,trigger:l,formState:d,resetField:u,reset:p,handleSubmit:m,unregister:h,control:f,register:g,setFocus:b,subscribe:v}=e;return a.createElement(ju.Provider,{value:a.useMemo(()=>({watch:r,getValues:n,getFieldState:i,setError:s,clearErrors:o,setValue:c,trigger:l,formState:d,resetField:u,reset:p,handleSubmit:m,unregister:h,control:f,register:g,setFocus:b,subscribe:v}),[o,f,d,i,n,m,g,p,u,s,b,c,v,l,h,r])},a.createElement(Uu.Provider,{value:f},t))};var Ku=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},qu=e=>Array.isArray(e)?e:[e],Zu=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}};function Ju(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const a=e[n],i=t[n];if(a&&ou(a)&&i){const e=Ju(a,i);ou(e)&&(r[n]=e)}else e[n]&&(r[n]=i)}return r}var Yu=e=>ou(e)&&!Object.keys(e).length,Xu=e=>"file"===e.type,Qu=e=>{if(!du)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ep=e=>"select-multiple"===e.type,tp=e=>"radio"===e.type,rp=e=>Qu(e)&&e.isConnected;function np(e,t){const r=Array.isArray(t)?t:pu(t)?[t]:fu(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=mu(e)?n++:e[t[n++]];return e}(e,r),a=r.length-1,i=r[a];return n&&delete n[i],0!==a&&(ou(n)&&Yu(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!mu(e[t]))return!1;return!0}(n))&&np(e,r.slice(0,-1)),e}function ap(e){return Array.isArray(e)||ou(e)&&!(e=>{for(const t in e)if(vu(e[t]))return!0;return!1})(e)}function ip(e,t={}){for(const r in e){const n=e[r];ap(n)?(t[r]=Array.isArray(n)?[]:{},ip(n,t[r])):mu(n)||(t[r]=!0)}return t}function sp(e,t,r){r||(r=ip(t));for(const n in e){const a=e[n];if(ap(a))mu(t)||Wu(r[n])?r[n]=ip(a,Array.isArray(a)?[]:{}):sp(a,iu(t)?{}:t[n],r[n]);else{const e=t[n];r[n]=!Vu(a,e)}}return r}const op={value:!1,isValid:!1},cp={value:!0,isValid:!0};var lp=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!mu(e[0].attributes.value)?mu(e[0].value)||""===e[0].value?cp:{value:e[0].value,isValid:!0}:cp:op}return op},dp=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>mu(e)?e:t?""===e?NaN:e?+e:e:r&&Fu(e)?new Date(e):n?n(e):e;const up={isValid:!1,value:null};var pp=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,up):up;function mp(e){const t=e.ref;return Xu(t)?t.files:tp(t)?pp(e.refs).value:ep(t)?[...t.selectedOptions].map(({value:e})=>e):nu(t)?lp(e.refs).value:dp(mu(t.value)?e.ref.value:t.value,e)}var hp=e=>e instanceof RegExp,fp=e=>mu(e)?e:hp(e)?e.source:ou(e)?hp(e.value)?e.value.source:e.value:e,gp=e=>({isOnSubmit:!e||e===Nu,isOnBlur:e===Su,isOnChange:e===Cu,isOnAll:e===Au,isOnTouch:e===Eu});const bp="AsyncFunction";var vp=e=>!!e&&!!e.validate&&!!(vu(e.validate)&&e.validate.constructor.name===bp||ou(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===bp)),yp=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const wp=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const r=gu(e,a);if(r){const{_f:e,...i}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],a)&&!n)return!0;if(e.ref&&t(e.ref,e.name)&&!n)return!0;if(wp(i,t))break}else if(ou(i)&&wp(i,t))break}}};function xp(e,t,r){const n=gu(e,r);if(n||pu(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const n=a.join("."),i=gu(t,n),s=gu(e,n);if(i&&!Array.isArray(i)&&r!==n)return{name:r};if(s&&s.type)return{name:n,error:s};if(s&&s.root&&s.root.type)return{name:`${n}.root`,error:s.root};a.pop()}return{name:r}}var kp=(e,t,r)=>{const n=qu(gu(e,r));return yu(n,"root",t[r]),yu(e,r,n),e};function Sp(e,t,r="validate"){if(Fu(e)||Array.isArray(e)&&e.every(Fu)||bu(e)&&!e)return{type:r,message:Fu(e)?e:"",ref:t}}var Cp=e=>ou(e)&&!hp(e)?e:{value:e,message:""},Np=async(e,t,r,n,a,i)=>{const{ref:s,refs:o,required:c,maxLength:l,minLength:d,min:u,max:p,pattern:m,validate:h,name:f,valueAsNumber:g,mount:b}=e._f,v=gu(r,f);if(!b||t.has(f))return{};const y=o?o[0]:s,w=e=>{a&&y.reportValidity&&(y.setCustomValidity(bu(e)?"":e||""),y.reportValidity())},x={},k=tp(s),S=nu(s),C=k||S,N=(g||Xu(s))&&mu(s.value)&&mu(v)||Qu(s)&&""===s.value||""===v||Array.isArray(v)&&!v.length,E=Ku.bind(null,f,n,x),A=(e,t,r,n=Tu,a=Ru)=>{const i=e?t:r;x[f]={type:e?n:a,message:i,ref:s,...E(e?n:a,i)}};if(i?!Array.isArray(v)||!v.length:c&&(!C&&(N||iu(v))||bu(v)&&!v||S&&!lp(o).isValid||k&&!pp(o).isValid)){const{value:e,message:t}=Fu(c)?{value:!!c,message:c}:Cp(c);if(e&&(x[f]={type:Iu,message:t,ref:y,...E(Iu,t)},!n))return w(t),x}if(!(N||iu(u)&&iu(p))){let e,t;const r=Cp(p),a=Cp(u);if(iu(v)||isNaN(v)){const n=s.valueAsDate||new Date(v),i=e=>new Date((new Date).toDateString()+" "+e),o="time"==s.type,c="week"==s.type;Fu(r.value)&&v&&(e=o?i(v)>i(r.value):c?v>r.value:n>new Date(r.value)),Fu(a.value)&&v&&(t=o?i(v)<i(a.value):c?v<a.value:n<new Date(a.value))}else{const n=s.valueAsNumber||(v?+v:v);iu(r.value)||(e=n>r.value),iu(a.value)||(t=n<a.value)}if((e||t)&&(A(!!e,r.message,a.message,_u,Pu),!n))return w(x[f].message),x}if((l||d)&&!N&&(Fu(v)||i&&Array.isArray(v))){const e=Cp(l),t=Cp(d),r=!iu(e.value)&&v.length>+e.value,a=!iu(t.value)&&v.length<+t.value;if((r||a)&&(A(r,e.message,t.message),!n))return w(x[f].message),x}if(m&&!N&&Fu(v)){const{value:e,message:t}=Cp(m);if(hp(e)&&!v.match(e)&&(x[f]={type:Du,message:t,ref:s,...E(Du,t)},!n))return w(t),x}if(h)if(vu(h)){const e=Sp(await h(v,r),y);if(e&&(x[f]={...e,...E(Mu,e.message)},!n))return w(e.message),x}else if(ou(h)){let e={};for(const t in h){if(!Yu(e)&&!n)break;const a=Sp(await h[t](v,r),y,t);a&&(e={...a,...E(t,a.message)},w(a.message),n&&(x[f]=e))}if(!Yu(e)&&(x[f]={ref:y,...e},!n))return x}return w(!0),x};const Ep={mode:Nu,reValidateMode:Cu,shouldFocusError:!0};function Ap(e={}){let t,r={...Ep,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:vu(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},i=(ou(r.defaultValues)||ou(r.values))&&uu(r.defaultValues||r.values)||{},s=r.shouldUnregister?{}:uu(i),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},u={...d};let p={...u};const m={array:Zu(),state:Zu()},h=r.criteriaMode===Au,f=async e=>{if(!o.keepIsValid&&!r.disabled&&(u.isValid||p.isValid||e)){let e;r.resolver?(e=Yu((await w()).errors),g()):e=await x(a,!0),e!==n.isValid&&m.state.next({isValid:e})}},g=(e,t)=>{!r.disabled&&(u.isValidating||u.validatingFields||p.isValidating||p.validatingFields)&&((e||Array.from(c.mount)).forEach(e=>{e&&(t?yu(n.validatingFields,e,t):np(n.validatingFields,e))}),m.state.next({validatingFields:n.validatingFields,isValidating:!Yu(n.validatingFields)}))},b=(e,t,r,n)=>{const c=gu(a,e);if(c){const a=gu(s,e,mu(r)?gu(i,e):r);mu(a)||n&&n.defaultChecked||t?yu(s,e,t?a:mp(c._f)):C(e,a),o.mount&&!o.action&&f()}},v=(e,t,a,s,o)=>{let c=!1,l=!1;const d={name:e};if(!r.disabled){if(!a||s){(u.isDirty||p.isDirty)&&(l=n.isDirty,n.isDirty=d.isDirty=k(),c=l!==d.isDirty);const r=Vu(gu(i,e),t);l=!!gu(n.dirtyFields,e),r?np(n.dirtyFields,e):yu(n.dirtyFields,e,!0),d.dirtyFields=n.dirtyFields,c=c||(u.dirtyFields||p.dirtyFields)&&l!==!r}if(a){const t=gu(n.touchedFields,e);t||(yu(n.touchedFields,e,a),d.touchedFields=n.touchedFields,c=c||(u.touchedFields||p.touchedFields)&&t!==a)}c&&o&&m.state.next(d)}return c?d:{}},y=(e,a,i,s)=>{const o=gu(n.errors,e),c=(u.isValid||p.isValid)&&bu(a)&&n.isValid!==a;var d;if(r.delayError&&i?(d=()=>((e,t)=>{yu(n.errors,e,t),m.state.next({errors:n.errors})})(e,i),t=e=>{clearTimeout(l),l=setTimeout(d,e)},t(r.delayError)):(clearTimeout(l),t=null,i?yu(n.errors,e,i):np(n.errors,e)),(i?!Vu(o,i):o)||!Yu(s)||c){const t={...s,...c&&bu(a)?{isValid:a}:{},errors:n.errors,name:e};n={...n,...t},m.state.next(t)}},w=async e=>{g(e,!0);const t=await r.resolver(s,r.context,((e,t,r,n)=>{const a={};for(const r of e){const e=gu(t,r);e&&yu(a,r,e._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}})(e||c.mount,a,r.criteriaMode,r.shouldUseNativeValidation));return t},x=async(t,a,i={valid:!0})=>{for(const o in t){const l=t[o];if(l){const{_f:t,...o}=l;if(t){const o=c.array.has(t.name),d=l._f&&vp(l._f);d&&u.validatingFields&&g([t.name],!0);const p=await Np(l,c.disabled,s,h,r.shouldUseNativeValidation&&!a,o);if(d&&u.validatingFields&&g([t.name]),p[t.name]&&(i.valid=!1,a||e.shouldUseNativeValidation))break;!a&&(gu(p,t.name)?o?kp(n.errors,p,t.name):yu(n.errors,t.name,p[t.name]):np(n.errors,t.name))}!Yu(o)&&await x(o,a,i)}}return i.valid},k=(e,t)=>!r.disabled&&(e&&t&&yu(s,e,t),!Vu(T(),i)),S=(e,t,r)=>Bu(e,c,{...o.mount?s:mu(t)?i:Fu(e)?{[e]:t}:t},r,t),C=(e,t,r={})=>{const n=gu(a,e);let i=t;if(n){const r=n._f;r&&(!r.disabled&&yu(s,e,dp(t,r)),i=Qu(r.ref)&&iu(t)?"":t,ep(r.ref)?[...r.ref.options].forEach(e=>e.selected=i.includes(e.value)):r.refs?nu(r.ref)?r.refs.forEach(e=>{e.defaultChecked&&e.disabled||(Array.isArray(i)?e.checked=!!i.find(t=>t===e.value):e.checked=i===e.value||!!i)}):r.refs.forEach(e=>e.checked=e.value===i):Xu(r.ref)?r.ref.value="":(r.ref.value=i,r.ref.type||m.state.next({name:e,values:uu(s)})))}(r.shouldDirty||r.shouldTouch)&&v(e,i,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&P(e)},N=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const i=t[n],s=e+"."+n,o=gu(a,s);(c.array.has(e)||ou(i)||o&&!o._f)&&!au(i)?N(s,i,r):C(s,i,r)}},E=(e,t,r={})=>{const l=gu(a,e),d=c.array.has(e),h=uu(t);yu(s,e,h),d?(m.array.next({name:e,values:uu(s)}),(u.isDirty||u.dirtyFields||p.isDirty||p.dirtyFields)&&r.shouldDirty&&m.state.next({name:e,dirtyFields:sp(i,s),isDirty:k(e,h)})):!l||l._f||iu(h)?C(e,h,r):N(e,h,r),yp(e,c)?m.state.next({...n,name:e,values:uu(s)}):m.state.next({name:o.mount?e:void 0,values:uu(s)})},A=async e=>{o.mount=!0;const i=e.target;let l=i.name,d=!0;const b=gu(a,l),k=e=>{d=Number.isNaN(e)||au(e)&&isNaN(e.getTime())||Vu(e,gu(s,l,e))},S=gp(r.mode),C=gp(r.reValidateMode);if(b){let o,N;const E=i.type?mp(b._f):cu(e),A=e.type===wu||e.type===xu,_=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(b._f)&&!r.resolver&&!gu(n.errors,l)&&!b._f.deps||((e,t,r,n,a)=>!a.isOnAll&&(!r&&a.isOnTouch?!(t||e):(r?n.isOnBlur:a.isOnBlur)?!e:!(r?n.isOnChange:a.isOnChange)||e))(A,gu(n.touchedFields,l),n.isSubmitted,C,S),T=yp(l,c,A);yu(s,l,E),A?i&&i.readOnly||(b._f.onBlur&&b._f.onBlur(e),t&&t(0)):b._f.onChange&&b._f.onChange(e);const R=v(l,E,A),D=!Yu(R)||T;if(!A&&m.state.next({name:l,type:e.type,values:uu(s)}),_)return(u.isValid||p.isValid)&&("onBlur"===r.mode?A&&f():A||f()),D&&m.state.next({name:l,...T?{}:R});if(!A&&T&&m.state.next({...n}),r.resolver){const{errors:e}=await w([l]);if(g([l]),k(E),d){const t=xp(n.errors,a,l),r=xp(e,a,t.name||l);o=r.error,l=r.name,N=Yu(e)}}else g([l],!0),o=(await Np(b,c.disabled,s,h,r.shouldUseNativeValidation))[l],g([l]),k(E),d&&(o?N=!1:(u.isValid||p.isValid)&&(N=await x(a,!0)));d&&(b._f.deps&&(!Array.isArray(b._f.deps)||b._f.deps.length>0)&&P(b._f.deps),y(l,N,o,R))}},_=(e,t)=>{if(gu(n.errors,t)&&e.focus)return e.focus(),1},P=async(e,t={})=>{let i,s;const o=qu(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await w(e);if(g(e),e)for(const r of e){const e=gu(t,r);e?yu(n.errors,r,e):np(n.errors,r)}else n.errors=t;return t})(mu(e)?e:o);i=Yu(t),s=e?!o.some(e=>gu(t,e)):i}else e?(s=(await Promise.all(o.map(async e=>{const t=gu(a,e);return await x(t&&t._f?{[e]:t}:t)}))).every(Boolean),(s||n.isValid)&&f()):s=i=await x(a);return m.state.next({...!Fu(e)||(u.isValid||p.isValid)&&i!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:i}:{},errors:n.errors}),t.shouldFocus&&!s&&wp(a,_,e?o:c.mount),s},T=(e,t)=>{let r={...o.mount?s:i};return t&&(r=Ju(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),mu(e)?r:Fu(e)?gu(r,e):e.map(e=>gu(r,e))},R=(e,t)=>({invalid:!!gu((t||n).errors,e),isDirty:!!gu((t||n).dirtyFields,e),error:gu((t||n).errors,e),isValidating:!!gu(n.validatingFields,e),isTouched:!!gu((t||n).touchedFields,e)}),D=(e,t,r)=>{const i=(gu(a,e,{_f:{}})._f||{}).ref,s=gu(n.errors,e)||{},{ref:o,message:c,type:l,...d}=s;yu(n.errors,e,{...d,...t,ref:i}),m.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&i&&i.focus&&i.focus()},I=e=>m.state.subscribe({next:t=>{var r,a,o;r=e.name,a=t.name,o=e.exact,r&&a&&r!==a&&!qu(r).some(e=>e&&(o?e===a:e.startsWith(a)||a.startsWith(e)))||!((e,t,r,n)=>{r(e);const{name:a,...i}=e;return Yu(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(e=>t[e]===(!n||Au))})(t,e.formState||u,W,e.reRenderRoot)||e.callback({values:{...s},...n,...t,defaultValues:i})}}).unsubscribe,M=(e,t={})=>{for(const o of e?qu(e):c.mount)c.mount.delete(o),c.array.delete(o),t.keepValue||(np(a,o),np(s,o)),!t.keepError&&np(n.errors,o),!t.keepDirty&&np(n.dirtyFields,o),!t.keepTouched&&np(n.touchedFields,o),!t.keepIsValidating&&np(n.validatingFields,o),!r.shouldUnregister&&!t.keepDefaultValue&&np(i,o);m.state.next({values:uu(s)}),m.state.next({...n,...t.keepDirty?{isDirty:k()}:{}}),!t.keepIsValid&&f()},U=({disabled:e,name:t})=>{if(bu(e)&&o.mount||e||c.disabled.has(t)){const r=c.disabled.has(t)!==!!e;e?c.disabled.add(t):c.disabled.delete(t),r&&o.mount&&!o.action&&f()}},L=(e,t={})=>{let n=gu(a,e);const s=bu(t.disabled)||bu(r.disabled);return yu(a,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),c.mount.add(e),n?U({disabled:bu(t.disabled)?t.disabled:r.disabled,name:e}):b(e,!0,t.value),{...s?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:fp(t.min),max:fp(t.max),minLength:fp(t.minLength),maxLength:fp(t.maxLength),pattern:fp(t.pattern)}:{},name:e,onChange:A,onBlur:A,ref:s=>{if(s){L(e,t),n=gu(a,e);const r=mu(s.value)&&s.querySelectorAll&&s.querySelectorAll("input,select,textarea")[0]||s,o=(e=>tp(e)||nu(e))(r),c=n._f.refs||[];if(o?c.find(e=>e===r):r===n._f.ref)return;yu(a,e,{_f:{...n._f,...o?{refs:[...c.filter(rp),r,...Array.isArray(gu(i,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),b(e,!1,void 0,r)}else n=gu(a,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!lu(c.array,e)||!o.action)&&c.unMount.add(e)}}},O=()=>r.shouldFocusError&&wp(a,_,c.mount),z=(e,t)=>async i=>{let o;i&&(i.preventDefault&&i.preventDefault(),i.persist&&i.persist());let l=uu(s);if(m.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await w();g(),n.errors=e,l=uu(t)}else await x(a);if(c.disabled.size)for(const e of c.disabled)np(l,e);if(np(n.errors,"root"),Yu(n.errors)){m.state.next({errors:{}});try{await e(l,i)}catch(e){o=e}}else t&&await t({...n.errors},i),O(),setTimeout(O);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Yu(n.errors)&&!o,submitCount:n.submitCount+1,errors:n.errors}),o)throw o},F=(e,t={})=>{const l=e?uu(e):i,d=uu(l),p=Yu(e),h=p?i:d;if(t.keepDefaultValues||(i=l),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...c.mount,...Object.keys(sp(i,s))]);for(const t of Array.from(e)){const e=gu(n.dirtyFields,t),r=gu(s,t),a=gu(h,t);e&&!mu(r)?yu(h,t,r):e||mu(a)||E(t,a)}}else{if(du&&mu(e))for(const e of c.mount){const t=gu(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Qu(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of c.mount)E(e,gu(h,e));else a={}}s=r.shouldUnregister?t.keepDefaultValues?uu(i):{}:uu(h),m.array.next({values:{...h}}),m.state.next({values:{...h}})}c={mount:t.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!u.isValid||!!t.keepIsValid||!!t.keepDirtyValues||!r.shouldUnregister&&!Yu(h),o.watch=!!r.shouldUnregister,o.keepIsValid=!!t.keepIsValid,o.action=!1,t.keepErrors||(n.errors={}),m.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!p&&(t.keepDirty?n.isDirty:!(!t.keepDefaultValues||Vu(e,i))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:p?{}:t.keepDirtyValues?t.keepDefaultValues&&s?sp(i,s):n.dirtyFields:t.keepDefaultValues&&e?sp(i,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1,defaultValues:i})},B=(e,t)=>F(vu(e)?e(s):e,{...r.resetOptions,...t}),W=e=>{n={...n,...e}},V={control:{register:L,unregister:M,getFieldState:R,handleSubmit:z,setError:D,_subscribe:I,_runSchema:w,_updateIsValidating:g,_focusError:O,_getWatch:S,_getDirty:k,_setValid:f,_setFieldArray:(e,t=[],c,l,d=!0,h=!0)=>{if(l&&c&&!r.disabled){if(o.action=!0,h&&Array.isArray(gu(a,e))){const t=c(gu(a,e),l.argA,l.argB);d&&yu(a,e,t)}if(h&&Array.isArray(gu(n.errors,e))){const t=c(gu(n.errors,e),l.argA,l.argB);d&&yu(n.errors,e,t),((e,t)=>{!hu(gu(e,t)).length&&np(e,t)})(n.errors,e)}if((u.touchedFields||p.touchedFields)&&h&&Array.isArray(gu(n.touchedFields,e))){const t=c(gu(n.touchedFields,e),l.argA,l.argB);d&&yu(n.touchedFields,e,t)}(u.dirtyFields||p.dirtyFields)&&(n.dirtyFields=sp(i,s)),m.state.next({name:e,isDirty:k(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else yu(s,e,t)},_setDisabledField:U,_setErrors:e=>{n.errors=e,m.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>hu(gu(o.mount?s:i,e,r.shouldUnregister?gu(i,e,[]):[])),_reset:F,_resetDefaultValues:()=>vu(r.defaultValues)&&r.defaultValues().then(e=>{B(e,r.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of c.unMount){const t=gu(a,e);t&&(t._f.refs?t._f.refs.every(e=>!rp(e)):!rp(t._f.ref))&&M(e)}c.unMount=new Set},_disableForm:e=>{bu(e)&&(m.state.next({disabled:e}),wp(a,(t,r)=>{const n=gu(a,r);n&&(t.disabled=n._f.disabled||e,Array.isArray(n._f.refs)&&n._f.refs.forEach(t=>{t.disabled=n._f.disabled||e}))},0,!1))},_subjects:m,_proxyFormState:u,get _fields(){return a},get _formValues(){return s},get _state(){return o},set _state(e){o=e},get _defaultValues(){return i},get _names(){return c},set _names(e){c=e},get _formState(){return n},get _options(){return r},set _options(e){r={...r,...e}}},subscribe:e=>(o.mount=!0,p={...p,...e.formState},I({...e,formState:{...d,...e.formState}})),trigger:P,register:L,handleSubmit:z,watch:(e,t)=>vu(e)?m.state.subscribe({next:r=>"values"in r&&e(S(void 0,t),r)}):S(e,t,!0),setValue:E,getValues:T,reset:B,resetField:(e,t={})=>{gu(a,e)&&(mu(t.defaultValue)?E(e,uu(gu(i,e))):(E(e,t.defaultValue),yu(i,e,uu(t.defaultValue))),t.keepTouched||np(n.touchedFields,e),t.keepDirty||(np(n.dirtyFields,e),n.isDirty=t.defaultValue?k(e,uu(gu(i,e))):k()),t.keepError||(np(n.errors,e),u.isValid&&f()),m.state.next({...n}))},clearErrors:e=>{e&&qu(e).forEach(e=>np(n.errors,e)),m.state.next({errors:e?n.errors:{}})},unregister:M,setError:D,setFocus:(e,t={})=>{const r=gu(a,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&vu(e.select)&&e.select()})}},getFieldState:R};return{...V,formControl:V}}function _p(e={}){const t=a.useRef(void 0),r=a.useRef(void 0),[n,i]=a.useState({isDirty:!1,isValidating:!1,isLoading:vu(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:vu(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!vu(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:r,...a}=Ap(e);t.current={...a,formState:n}}const s=t.current.control;return s._options=e,zu(()=>{const e=s._subscribe({formState:s._proxyFormState,callback:()=>i({...s._formState}),reRenderRoot:!0});return i(e=>({...e,isReady:!0})),s._formState.isReady=!0,e},[s]),a.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),a.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),a.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),a.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),a.useEffect(()=>{if(s._proxyFormState.isDirty){const e=s._getDirty();e!==n.isDirty&&s._subjects.state.next({isDirty:e})}},[s,n.isDirty]),a.useEffect(()=>{var t;e.values&&!Vu(e.values,r.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),(null===(t=s._options.resetOptions)||void 0===t?void 0:t.keepIsValid)||s._setValid(),r.current=e.values,i(e=>({...e}))):s._resetDefaultValues()},[s,e.values]),a.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=a.useMemo(()=>Ou(n,s),[s,n]),t.current}const Pp=(e,t,r)=>{if(e&&"reportValidity"in e){const n=gu(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Tp=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Pp(n.ref,r,e):n&&n.refs&&n.refs.forEach(t=>Pp(t,r,e))}},Rp=(e,t)=>{t.shouldUseNativeValidation&&Tp(e,t);const r={};for(const n in e){const a=gu(t.fields,n),i=Object.assign(e[n]||{},{ref:a&&a.ref});if(Dp(t.names||Object.keys(e),n)){const e=Object.assign({},gu(r,n));yu(e,"root",i),yu(r,n,e)}else yu(r,n,i)}return r},Dp=(e,t)=>{const r=Ip(t);return e.some(e=>Ip(e).match(`^${r}\\.\\d+`))};function Ip(e){return e.replace(/\]|\[/g,"")}function Mp(e,t,r){function n(r,n){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:n,constr:s,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,n);const a=s.prototype,i=Object.keys(a);for(let e=0;e<i.length;e++){const t=i[e];t in r||(r[t]=a[t].bind(r))}}const a=r?.Parent??Object;class i extends a{}function s(e){var t;const a=r?.Parent?new i:this;n(a,e),(t=a._zod).deferred??(t.deferred=[]);for(const e of a._zod.deferred)e();return a}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(r?.Parent&&t instanceof r.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class Up extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Lp extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Op={};function zp(e){return Op}function Fp(e){const t=Object.values(e).filter(e=>"number"==typeof e),r=Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t);return r}function Bp(e,t){return"bigint"==typeof t?t.toString():t}function Wp(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Vp(e){return null==e}function Gp(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const Hp=Symbol("evaluating");function jp(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Hp)return void 0===n&&(n=Hp,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function $p(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Kp(...e){const t={};for(const r of e){const e=Object.getOwnPropertyDescriptors(r);Object.assign(t,e)}return Object.defineProperties({},t)}function qp(e){return JSON.stringify(e)}const Zp="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Jp(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Yp=Wp(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Xp(e){if(!1===Jp(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const r=t.prototype;return!1!==Jp(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function Qp(e){return Xp(e)?{...e}:Array.isArray(e)?[...e]:e}const em=new Set(["string","number","symbol"]);function tm(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rm(e,t,r){const n=new e._zod.constr(t??e._zod.def);return t&&!r?.parent||(n._zod.parent=e),n}function nm(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function am(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(!0!==e.issues[r]?.continue)return!0;return!1}function im(e,t){return t.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function sm(e){return"string"==typeof e?e:e?.message}function om(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const a=sm(e.inst?._zod.def?.error?.(e))??sm(t?.error?.(e))??sm(r.customError?.(e))??sm(r.localeError?.(e))??"Invalid input";n.message=a}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function cm(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function lm(...e){const[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}const dm=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Bp,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},um=Mp("$ZodError",dm),pm=Mp("$ZodError",dm,{Parent:Error});const mm=e=>(t,r,n,a)=>{const i=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new Up;if(s.issues.length){const t=new(a?.Err??e)(s.issues.map(e=>om(e,i,zp())));throw Zp(t,a?.callee),t}return s.value},hm=mm(pm),fm=e=>async(t,r,n,a)=>{const i=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(a?.Err??e)(s.issues.map(e=>om(e,i,zp())));throw Zp(t,a?.callee),t}return s.value},gm=fm(pm),bm=e=>(t,r,n)=>{const a=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},a);if(i instanceof Promise)throw new Up;return i.issues.length?{success:!1,error:new(e??um)(i.issues.map(e=>om(e,a,zp())))}:{success:!0,data:i.value}},vm=bm(pm),ym=e=>async(t,r,n)=>{const a=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},a);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>om(e,a,zp())))}:{success:!0,data:i.value}},wm=ym(pm),xm=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return mm(e)(t,r,a)},km=e=>(t,r,n)=>mm(e)(t,r,n),Sm=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return fm(e)(t,r,a)},Cm=e=>async(t,r,n)=>fm(e)(t,r,n),Nm=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return bm(e)(t,r,a)},Em=e=>(t,r,n)=>bm(e)(t,r,n),Am=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ym(e)(t,r,a)},_m=e=>async(t,r,n)=>ym(e)(t,r,n),Pm=/^[cC][^\s-]{8,}$/,Tm=/^[0-9a-z]+$/,Rm=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Dm=/^[0-9a-vA-V]{20}$/,Im=/^[A-Za-z0-9]{27}$/,Mm=/^[a-zA-Z0-9_-]{21}$/,Um=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Lm=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Om=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,zm=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const Fm=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Bm=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Wm=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Vm=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Gm=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Hm=/^[A-Za-z0-9_-]*$/,jm=/^\+[1-9]\d{6,14}$/,$m="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Km=new RegExp(`^${$m}$`);function qm(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const Zm=/^[^A-Z]*$/,Jm=/^[^a-z]*$/,Ym=Mp("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Xm=Mp("$ZodCheckMaxLength",(e,t)=>{var r;Ym.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Vp(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const n=r.value;if(n.length<=t.maximum)return;const a=cm(n);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Qm=Mp("$ZodCheckMinLength",(e,t)=>{var r;Ym.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Vp(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const n=r.value;if(n.length>=t.minimum)return;const a=cm(n);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),eh=Mp("$ZodCheckLengthEquals",(e,t)=>{var r;Ym.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Vp(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{const n=r.value,a=n.length;if(a===t.length)return;const i=cm(n),s=a>t.length;r.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),th=Mp("$ZodCheckStringFormat",(e,t)=>{var r,n;Ym.init(e,t),e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),rh=Mp("$ZodCheckRegex",(e,t)=>{th.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),nh=Mp("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Zm),th.init(e,t)}),ah=Mp("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Jm),th.init(e,t)}),ih=Mp("$ZodCheckIncludes",(e,t)=>{Ym.init(e,t);const r=tm(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),sh=Mp("$ZodCheckStartsWith",(e,t)=>{Ym.init(e,t);const r=new RegExp(`^${tm(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),oh=Mp("$ZodCheckEndsWith",(e,t)=>{Ym.init(e,t);const r=new RegExp(`.*${tm(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),ch=Mp("$ZodCheckOverwrite",(e,t)=>{Ym.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class lh{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length)),n=t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e);for(const e of n)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const dh={major:4,minor:3,patch:6},uh=Mp("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=dh;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const t of n)for(const r of t._zod.onattach)r(e);if(0===n.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,r)=>{let n,a=am(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(a)continue;const t=e.issues.length,s=i._zod.check(e);if(s instanceof Promise&&!1===r?.async)throw new Up;if(n||s instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await s;e.issues.length!==t&&(a||(a=am(e,t)))});else{if(e.issues.length===t)continue;a||(a=am(e,t))}}return n?n.then(()=>e):e},r=(r,a,i)=>{if(am(r))return r.aborted=!0,r;const s=t(a,n,i);if(s instanceof Promise){if(!1===i.async)throw new Up;return s.then(t=>e._zod.parse(t,i))}return e._zod.parse(s,i)};e._zod.run=(a,i)=>{if(i.skipChecks)return e._zod.parse(a,i);if("backward"===i.direction){const t=e._zod.parse({value:a.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,a,i)):r(t,a,i)}const s=e._zod.parse(a,i);if(s instanceof Promise){if(!1===i.async)throw new Up;return s.then(e=>t(e,n,i))}return t(s,n,i)}}jp(e,"~standard",()=>({validate:t=>{try{const r=vm(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return wm(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),ph=Mp("$ZodString",(e,t)=>{var r;uh.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(r=e._zod.bag,new RegExp(`^${r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),mh=Mp("$ZodStringFormat",(e,t)=>{th.init(e,t),ph.init(e,t)}),hh=Mp("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Lm),mh.init(e,t)}),fh=Mp("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Om(e))}else t.pattern??(t.pattern=Om());mh.init(e,t)}),gh=Mp("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=zm),mh.init(e,t)}),bh=Mp("$ZodURL",(e,t)=>{mh.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),a=new URL(n);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),void(t.normalize?r.value=a.href:r.value=n)}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),vh=Mp("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),mh.init(e,t)}),yh=Mp("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Mm),mh.init(e,t)}),wh=Mp("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Pm),mh.init(e,t)}),xh=Mp("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Tm),mh.init(e,t)}),kh=Mp("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Rm),mh.init(e,t)}),Sh=Mp("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Dm),mh.init(e,t)}),Ch=Mp("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Im),mh.init(e,t)}),Nh=Mp("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=qm({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${$m}T(?:${n})$`)}(t)),mh.init(e,t)}),Eh=Mp("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Km),mh.init(e,t)}),Ah=Mp("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${qm(t)}$`)),mh.init(e,t)}),_h=Mp("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Um),mh.init(e,t)}),Ph=Mp("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Fm),mh.init(e,t),e._zod.bag.format="ipv4"}),Th=Mp("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Bm),mh.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Rh=Mp("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Wm),mh.init(e,t)}),Dh=Mp("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Vm),mh.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(2!==n.length)throw new Error;const[e,t]=n;if(!t)throw new Error;const r=Number(t);if(`${r}`!==t)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Ih(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Mh=Mp("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Gm),mh.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Ih(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});const Uh=Mp("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Hm),mh.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{(function(e){if(!Hm.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Ih(t.padEnd(4*Math.ceil(t.length/4),"="))})(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Lh=Mp("$ZodE164",(e,t)=>{t.pattern??(t.pattern=jm),mh.init(e,t)});const Oh=Mp("$ZodJWT",(e,t)=>{mh.init(e,t),e._zod.check=r=>{(function(e,t=null){try{const r=e.split(".");if(3!==r.length)return!1;const[n]=r;if(!n)return!1;const a=JSON.parse(atob(n));return!("typ"in a&&"JWT"!==a?.typ||!a.alg||t&&(!("alg"in a)||a.alg!==t))}catch{return!1}})(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),zh=Mp("$ZodUnknown",(e,t)=>{uh.init(e,t),e._zod.parse=e=>e}),Fh=Mp("$ZodNever",(e,t)=>{uh.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function Bh(e,t,r){e.issues.length&&t.issues.push(...im(r,e.issues)),t.value[r]=e.value}const Wh=Mp("$ZodArray",(e,t)=>{uh.init(e,t),e._zod.parse=(r,n)=>{const a=r.value;if(!Array.isArray(a))return r.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),r;r.value=Array(a.length);const i=[];for(let e=0;e<a.length;e++){const s=a[e],o=t.element._zod.run({value:s,issues:[]},n);o instanceof Promise?i.push(o.then(t=>Bh(t,r,e))):Bh(o,r,e)}return i.length?Promise.all(i).then(()=>r):r}});function Vh(e,t,r,n,a){if(e.issues.length){if(a&&!(r in n))return;t.issues.push(...im(r,e.issues))}void 0===e.value?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function Gh(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const r=(n=e.shape,Object.keys(n).filter(e=>"optional"===n[e]._zod.optin&&"optional"===n[e]._zod.optout));var n;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Hh(e,t,r,n,a,i){const s=[],o=a.keySet,c=a.catchall._zod,l=c.def.type,d="optional"===c.optout;for(const a in t){if(o.has(a))continue;if("never"===l){s.push(a);continue}const i=c.run({value:t[a],issues:[]},n);i instanceof Promise?e.push(i.then(e=>Vh(e,r,a,t,d))):Vh(i,r,a,t,d)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}const jh=Mp("$ZodObject",(e,t)=>{uh.init(e,t);const r=Object.getOwnPropertyDescriptor(t,"shape");if(!r?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const r={...e};return Object.defineProperty(t,"shape",{value:r}),r}})}const n=Wp(()=>Gh(t));jp(e._zod,"propValues",()=>{const e=t.shape,r={};for(const t in e){const n=e[t]._zod;if(n.values){r[t]??(r[t]=new Set);for(const e of n.values)r[t].add(e)}}return r});const a=Jp,i=t.catchall;let s;e._zod.parse=(t,r)=>{s??(s=n.value);const o=t.value;if(!a(o))return t.issues.push({expected:"object",code:"invalid_type",input:o,inst:e}),t;t.value={};const c=[],l=s.shape;for(const e of s.keys){const n=l[e],a="optional"===n._zod.optout,i=n._zod.run({value:o[e],issues:[]},r);i instanceof Promise?c.push(i.then(r=>Vh(r,t,e,o,a))):Vh(i,t,e,o,a)}return i?Hh(c,o,t,r,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),$h=Mp("$ZodObjectJIT",(e,t)=>{jh.init(e,t);const r=e._zod.parse,n=Wp(()=>Gh(t));let a;const i=Jp,s=!Op.jitless,o=s&&Yp.value,c=t.catchall;let l;e._zod.parse=(d,u)=>{l??(l=n.value);const p=d.value;return i(p)?s&&o&&!1===u?.async&&!0!==u.jitless?(a||(a=(e=>{const t=new lh(["shape","payload","ctx"]),r=n.value,a=e=>{const t=qp(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let s=0;for(const e of r.keys)i[e]="key_"+s++;t.write("const newResult = {};");for(const n of r.keys){const r=i[n],s=qp(n),o=e[n],c="optional"===o?._zod?.optout;t.write(`const ${r} = ${a(n)};`),c?t.write(`\n if (${r}.issues.length) {\n if (${s} in input) {\n payload.issues = payload.issues.concat(${r}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${s}, ...iss.path] : [${s}]\n })));\n }\n }\n \n if (${r}.value === undefined) {\n if (${s} in input) {\n newResult[${s}] = undefined;\n }\n } else {\n newResult[${s}] = ${r}.value;\n }\n \n `):t.write(`\n if (${r}.issues.length) {\n payload.issues = payload.issues.concat(${r}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${s}, ...iss.path] : [${s}]\n })));\n }\n \n if (${r}.value === undefined) {\n if (${s} in input) {\n newResult[${s}] = undefined;\n }\n } else {\n newResult[${s}] = ${r}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const o=t.compile();return(t,r)=>o(e,t,r)})(t.shape)),d=a(d,u),c?Hh([],p,d,u,l,e):d):r(d,u):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}});function Kh(e,t,r,n){for(const r of e)if(0===r.issues.length)return t.value=r.value,t;const a=e.filter(e=>!am(e));return 1===a.length?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>om(e,n,zp())))}),t)}const qh=Mp("$ZodUnion",(e,t)=>{uh.init(e,t),jp(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),jp(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),jp(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),jp(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>Gp(e.source)).join("|")})$`)}});const r=1===t.options.length,n=t.options[0]._zod.run;e._zod.parse=(a,i)=>{if(r)return n(a,i);let s=!1;const o=[];for(const e of t.options){const t=e._zod.run({value:a.value,issues:[]},i);if(t instanceof Promise)o.push(t),s=!0;else{if(0===t.issues.length)return t;o.push(t)}}return s?Promise.all(o).then(t=>Kh(t,a,e,i)):Kh(o,a,e,i)}}),Zh=Mp("$ZodIntersection",(e,t)=>{uh.init(e,t),e._zod.parse=(e,r)=>{const n=e.value,a=t.left._zod.run({value:n,issues:[]},r),i=t.right._zod.run({value:n,issues:[]},r);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([t,r])=>Yh(e,t,r)):Yh(e,a,i)}});function Jh(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Xp(e)&&Xp(t)){const r=Object.keys(t),n=Object.keys(e).filter(e=>-1!==r.indexOf(e)),a={...e,...t};for(const r of n){const n=Jh(e[r],t[r]);if(!n.valid)return{valid:!1,mergeErrorPath:[r,...n.mergeErrorPath]};a[r]=n.data}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const a=Jh(e[n],t[n]);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Yh(e,t,r){const n=new Map;let a;for(const r of t.issues)if("unrecognized_keys"===r.code){a??(a=r);for(const e of r.keys)n.has(e)||n.set(e,{}),n.get(e).l=!0}else e.issues.push(r);for(const t of r.issues)if("unrecognized_keys"===t.code)for(const e of t.keys)n.has(e)||n.set(e,{}),n.get(e).r=!0;else e.issues.push(t);const i=[...n].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(i.length&&a&&e.issues.push({...a,keys:i}),am(e))return e;const s=Jh(t.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const Xh=Mp("$ZodEnum",(e,t)=>{uh.init(e,t);const r=Fp(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(e=>em.has(typeof e)).map(e=>"string"==typeof e?tm(e):e.toString()).join("|")})$`),e._zod.parse=(t,a)=>{const i=t.value;return n.has(i)||t.issues.push({code:"invalid_value",values:r,input:i,inst:e}),t}}),Qh=Mp("$ZodTransform",(e,t)=>{uh.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new Lp(e.constructor.name);const a=t.transform(r.value,r);if(n.async){return(a instanceof Promise?a:Promise.resolve(a)).then(e=>(r.value=e,r))}if(a instanceof Promise)throw new Up;return r.value=a,r}});function ef(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const tf=Mp("$ZodOptional",(e,t)=>{uh.init(e,t),e._zod.optin="optional",e._zod.optout="optional",jp(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),jp(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Gp(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if("optional"===t.innerType._zod.optin){const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(t=>ef(t,e.value)):ef(n,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),rf=Mp("$ZodExactOptional",(e,t)=>{tf.init(e,t),jp(e._zod,"values",()=>t.innerType._zod.values),jp(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),nf=Mp("$ZodNullable",(e,t)=>{uh.init(e,t),jp(e._zod,"optin",()=>t.innerType._zod.optin),jp(e._zod,"optout",()=>t.innerType._zod.optout),jp(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Gp(e.source)}|null)$`):void 0}),jp(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),af=Mp("$ZodDefault",(e,t)=>{uh.init(e,t),e._zod.optin="optional",jp(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>sf(e,t)):sf(n,t)}});function sf(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const of=Mp("$ZodPrefault",(e,t)=>{uh.init(e,t),e._zod.optin="optional",jp(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),cf=Mp("$ZodNonOptional",(e,t)=>{uh.init(e,t),jp(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{const a=t.innerType._zod.run(r,n);return a instanceof Promise?a.then(t=>lf(t,e)):lf(a,e)}});function lf(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const df=Mp("$ZodCatch",(e,t)=>{uh.init(e,t),jp(e._zod,"optin",()=>t.innerType._zod.optin),jp(e._zod,"optout",()=>t.innerType._zod.optout),jp(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(n=>(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>om(e,r,zp()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>om(e,r,zp()))},input:e.value}),e.issues=[]),e)}}),uf=Mp("$ZodPipe",(e,t)=>{uh.init(e,t),jp(e._zod,"values",()=>t.in._zod.values),jp(e._zod,"optin",()=>t.in._zod.optin),jp(e._zod,"optout",()=>t.out._zod.optout),jp(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){const n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>pf(e,t.in,r)):pf(n,t.in,r)}const n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>pf(e,t.out,r)):pf(n,t.out,r)}});function pf(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const mf=Mp("$ZodReadonly",(e,t)=>{uh.init(e,t),jp(e._zod,"propValues",()=>t.innerType._zod.propValues),jp(e._zod,"values",()=>t.innerType._zod.values),jp(e._zod,"optin",()=>t.innerType?._zod?.optin),jp(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(hf):hf(n)}});function hf(e){return e.value=Object.freeze(e.value),e}const ff=Mp("$ZodCustom",(e,t)=>{Ym.init(e,t),uh.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{const n=r.value,a=t.fn(n);if(a instanceof Promise)return a.then(t=>gf(t,r,n,e));gf(a,r,n,e)}});function gf(e,t,r,n){if(!e){const e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(lm(e))}}var bf;class vf{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const r={...this.get(t)??{}};delete r.id;const n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}(bf=globalThis).__zod_globalRegistry??(bf.__zod_globalRegistry=new vf);const yf=globalThis.__zod_globalRegistry;function wf(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...nm(t)})}function xf(e,t){return new Xm({check:"max_length",...nm(t),maximum:e})}function kf(e,t){return new Qm({check:"min_length",...nm(t),minimum:e})}function Sf(e,t){return new eh({check:"length_equals",...nm(t),length:e})}function Cf(e){return new ch({check:"overwrite",tx:e})}function Nf(e){const t=function(e,t){const r=new Ym({check:"custom",...nm(t)});return r._zod.check=e,r}(r=>(r.addIssue=e=>{if("string"==typeof e)r.issues.push(lm(e,r.value,t._zod.def));else{const n=e;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(lm(n))}},e(r.value,r)));return t}function Ef(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??yf,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Af(e,t,r={path:[],schemaPath:[]}){var n;const a=e._zod.def,i=t.seen.get(e);if(i){i.count++;return r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema}const s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);const o=e._zod.toJSONSchema?.();if(o)s.schema=o;else{const n={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,n);else{const r=s.schema,i=t.processors[a.type];if(!i)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);i(e,t,r,n)}const i=e._zod.parent;i&&(s.ref||(s.ref=i),Af(i,t,n),t.seen.get(i).isParent=!0)}const c=t.metadataRegistry.get(e);c&&Object.assign(s.schema,c),"input"===t.io&&Tf(e)&&(delete s.schema.examples,delete s.schema.default),"input"===t.io&&s.schema._prefault&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault;return t.seen.get(e).schema}function _f(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const t of e.seen.entries()){const r=e.metadataRegistry.get(t[0])?.id;if(r){const e=n.get(r);if(e&&e!==t[0])throw new Error(`Duplicate schema id "${r}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(r,t[0])}}const a=t=>{if(t[1].schema.$ref)return;const n=t[1],{ref:a,defId:i}=(t=>{const n="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const r=e.external.registry.get(t[0])?.id,a=e.external.uri??(e=>e);if(r)return{ref:a(r)};const i=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=i,{defId:i,ref:`${a("__shared")}#/${n}/${i}`}}if(t[1]===r)return{ref:"#"};const a=`#/${n}/`,i=t[1].schema.id??"__schema"+e.counter++;return{defId:i,ref:a+i}})(t);n.def={...n.schema},i&&(n.defId=i);const s=n.schema;for(const e in s)delete s[e];s.$ref=a};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const n=r[1];if(t===r[0]){a(r);continue}if(e.external){const n=e.external.registry.get(r[0])?.id;if(t!==r[0]&&n){a(r);continue}}const i=e.metadataRegistry.get(r[0])?.id;i?a(r):(n.cycle||n.count>1&&"ref"===e.reused)&&a(r)}}function Pf(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=t=>{const r=e.seen.get(t);if(null===r.ref)return;const a=r.def??r.schema,i={...a},s=r.ref;if(r.ref=null,s){n(s);const r=e.seen.get(s),o=r.schema;!o.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(a,o):(a.allOf=a.allOf??[],a.allOf.push(o)),Object.assign(a,i);if(t._zod.parent===s)for(const e in a)"$ref"!==e&&"allOf"!==e&&(e in i||delete a[e]);if(o.$ref&&r.def)for(const e in a)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(a[e])===JSON.stringify(r.def[e])&&delete a[e]}const o=t._zod.parent;if(o&&o!==s){n(o);const t=e.seen.get(o);if(t?.schema.$ref&&(a.$ref=t.schema.$ref,t.def))for(const e in a)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(a[e])===JSON.stringify(t.def[e])&&delete a[e]}e.override({zodSchema:t,jsonSchema:a,path:r.path??[]})};for(const t of[...e.seen.entries()].reverse())n(t[0]);const a={};if("draft-2020-12"===e.target?a.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?a.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?a.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const r=e.external.registry.get(t)?.id;if(!r)throw new Error("Schema is missing an `id` property");a.$id=e.external.uri(r)}Object.assign(a,r.def??r.schema);const i=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(i[e.defId]=e.def)}e.external||Object.keys(i).length>0&&("draft-2020-12"===e.target?a.$defs=i:a.definitions=i);try{const r=JSON.parse(JSON.stringify(a));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:Rf(t,"input",e.processors),output:Rf(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw new Error("Error converting schema to JSON.")}}function Tf(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if("transform"===n.type)return!0;if("array"===n.type)return Tf(n.element,r);if("set"===n.type)return Tf(n.valueType,r);if("lazy"===n.type)return Tf(n.getter(),r);if("promise"===n.type||"optional"===n.type||"nonoptional"===n.type||"nullable"===n.type||"readonly"===n.type||"default"===n.type||"prefault"===n.type)return Tf(n.innerType,r);if("intersection"===n.type)return Tf(n.left,r)||Tf(n.right,r);if("record"===n.type||"map"===n.type)return Tf(n.keyType,r)||Tf(n.valueType,r);if("pipe"===n.type)return Tf(n.in,r)||Tf(n.out,r);if("object"===n.type){for(const e in n.shape)if(Tf(n.shape[e],r))return!0;return!1}if("union"===n.type){for(const e of n.options)if(Tf(e,r))return!0;return!1}if("tuple"===n.type){for(const e of n.items)if(Tf(e,r))return!0;return!(!n.rest||!Tf(n.rest,r))}return!1}const Rf=(e,t,r={})=>n=>{const{libraryOptions:a,target:i}=n??{},s=Ef({...a??{},target:i,io:t,processors:r});return Af(e,s),_f(s,e),Pf(s,e)},Df={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},If=(e,t,r,n)=>{const a=e._zod.def;Af(a.innerType,t,n);t.seen.get(e).ref=a.innerType};function Mf(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}function Uf(e,t){for(var r={};e.length;){var n=e[0],a=n.code,i=n.message,s=n.path.join(".");if(!r[s])if("unionErrors"in n){var o=n.unionErrors[0].errors[0];r[s]={message:o.message,type:o.code}}else r[s]={message:i,type:a};if("unionErrors"in n&&n.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var c=r[s].types,l=c&&c[n.code];r[s]=Ku(s,t,r,a,l?[].concat(l,n.message):n.message)}e.shift()}return r}function Lf(e,t){for(var r={};e.length;){var n=e[0],a=n.code,i=n.message,s=n.path.join(".");if(!r[s])if("invalid_union"===n.code&&n.errors.length>0){var o=n.errors[0][0];r[s]={message:o.message,type:o.code}}else r[s]={message:i,type:a};if("invalid_union"===n.code&&n.errors.forEach(function(t){return t.forEach(function(t){return e.push(t)})}),t){var c=r[s].types,l=c&&c[n.code];r[s]=Ku(s,t,r,a,l?[].concat(l,n.message):n.message)}e.shift()}return r}function Of(e,t,r){if(void 0===r&&(r={}),function(e){return"_def"in e&&"object"==typeof e._def&&"typeName"in e._def}(e))return function(n,a,i){try{return Promise.resolve(Mf(function(){return Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return i.shouldUseNativeValidation&&Tp({},i),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return Array.isArray(null==e?void 0:e.issues)}(e))return{values:{},errors:Rp(Uf(e.errors,!i.shouldUseNativeValidation&&"all"===i.criteriaMode),i)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return"_zod"in e&&"object"==typeof e._zod}(e))return function(n,a,i){try{return Promise.resolve(Mf(function(){return Promise.resolve(("sync"===r.mode?hm:gm)(e,n,t)).then(function(e){return i.shouldUseNativeValidation&&Tp({},i),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return e instanceof um}(e))return{values:{},errors:Rp(Lf(e.issues,!i.shouldUseNativeValidation&&"all"===i.criteriaMode),i)};throw e}))}catch(e){return Promise.reject(e)}};throw new Error("Invalid input: not a Zod schema")}const zf=Mp("ZodISODateTime",(e,t)=>{Nh.init(e,t),lg.init(e,t)});function Ff(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...nm(t)})}(zf,e)}const Bf=Mp("ZodISODate",(e,t)=>{Eh.init(e,t),lg.init(e,t)});function Wf(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...nm(t)})}(Bf,e)}const Vf=Mp("ZodISOTime",(e,t)=>{Ah.init(e,t),lg.init(e,t)});function Gf(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...nm(t)})}(Vf,e)}const Hf=Mp("ZodISODuration",(e,t)=>{_h.init(e,t),lg.init(e,t)});function jf(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...nm(t)})}(Hf,e)}const $f=Mp("ZodError",(e,t)=>{um.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const r={_errors:[]},n=e=>{for(const a of e.issues)if("invalid_union"===a.code&&a.errors.length)a.errors.map(e=>n({issues:e}));else if("invalid_key"===a.code)n({issues:a.issues});else if("invalid_element"===a.code)n({issues:a.issues});else if(0===a.path.length)r._errors.push(t(a));else{let e=r,n=0;for(;n<a.path.length;){const r=a.path[n];n===a.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(a))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(e),r}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const r={},n=[];for(const a of e.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:r}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Bp,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Bp,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),Kf=mm($f),qf=fm($f),Zf=bm($f),Jf=ym($f),Yf=xm($f),Xf=km($f),Qf=Sm($f),eg=Cm($f),tg=Nm($f),rg=Em($f),ng=Am($f),ag=_m($f),ig=Mp("ZodType",(e,t)=>(uh.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Rf(e,"input"),output:Rf(e,"output")}}),e.toJSONSchema=((e,t={})=>r=>{const n=Ef({...r,processors:t});return Af(e,n),_f(n,e),Pf(n,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(Kp(t,{checks:[...t.checks??[],...r.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,r)=>rm(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>Kf(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>Zf(e,t,r),e.parseAsync=async(t,r)=>qf(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>Jf(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>Yf(e,t,r),e.decode=(t,r)=>Xf(e,t,r),e.encodeAsync=async(t,r)=>Qf(e,t,r),e.decodeAsync=async(t,r)=>eg(e,t,r),e.safeEncode=(t,r)=>tg(e,t,r),e.safeDecode=(t,r)=>rg(e,t,r),e.safeEncodeAsync=async(t,r)=>ng(e,t,r),e.safeDecodeAsync=async(t,r)=>ag(e,t,r),e.refine=(t,r)=>e.check(function(e,t={}){return function(e,t,r){return new e({type:"custom",check:"custom",fn:t,...nm(r)})}(Xg,e,t)}(t,r)),e.superRefine=t=>e.check(Nf(t)),e.overwrite=t=>e.check(Cf(t)),e.optional=()=>Wg(e),e.exactOptional=()=>new Vg({type:"optional",innerType:e}),e.nullable=()=>Hg(e),e.nullish=()=>Wg(Hg(e)),e.nonoptional=t=>function(e,t){return new Kg({type:"nonoptional",innerType:e,...nm(t)})}(e,t),e.array=()=>{return function(e,t,r){return new e({type:"array",element:t,...nm(r)})}(Ig,e,t);var t},e.or=t=>function(e,t){return new Lg({type:"union",options:e,...nm(t)})}([e,t]),e.and=t=>new Og({type:"intersection",left:e,right:t}),e.transform=t=>Jg(e,new Fg({type:"transform",transform:t})),e.default=t=>{return r=t,new jg({type:"default",innerType:e,get defaultValue(){return"function"==typeof r?r():Qp(r)}});var r},e.prefault=t=>{return r=t,new $g({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof r?r():Qp(r)}});var r},e.catch=t=>{return new qg({type:"catch",innerType:e,catchValue:"function"==typeof(r=t)?r:()=>r});var r},e.pipe=t=>Jg(e,t),e.readonly=()=>new Yg({type:"readonly",innerType:e}),e.describe=t=>{const r=e.clone();return yf.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>yf.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return yf.get(e);const r=e.clone();return yf.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),sg=Mp("_ZodString",(e,t)=>{ph.init(e,t),ig.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{const n=r;n.type="string";const{minimum:a,maximum:i,format:s,patterns:o,contentEncoding:c}=e._zod.bag;if("number"==typeof a&&(n.minLength=a),"number"==typeof i&&(n.maxLength=i),s&&(n.format=Df[s]??s,""===n.format&&delete n.format,"time"===s&&delete n.format),c&&(n.contentEncoding=c),o&&o.size>0){const e=[...o];1===e.length?n.pattern=e[0].source:e.length>1&&(n.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,r);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new rh({check:"string_format",format:"regex",...nm(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new ih({check:"string_format",format:"includes",...nm(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new sh({check:"string_format",format:"starts_with",...nm(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new oh({check:"string_format",format:"ends_with",...nm(t),suffix:e})}(...t)),e.min=(...t)=>e.check(kf(...t)),e.max=(...t)=>e.check(xf(...t)),e.length=(...t)=>e.check(Sf(...t)),e.nonempty=(...t)=>e.check(kf(1,...t)),e.lowercase=t=>e.check(function(e){return new nh({check:"string_format",format:"lowercase",...nm(e)})}(t)),e.uppercase=t=>e.check(function(e){return new ah({check:"string_format",format:"uppercase",...nm(e)})}(t)),e.trim=()=>e.check(Cf(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return Cf(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(Cf(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(Cf(e=>e.toUpperCase())),e.slugify=()=>e.check(Cf(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}),og=Mp("ZodString",(e,t)=>{ph.init(e,t),sg.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...nm(t)})}(dg,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...nm(t)})}(mg,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...nm(t)})}(_g,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...nm(t)})}(hg,t)),e.guid=t=>e.check(wf(ug,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...nm(t)})}(pg,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...nm(t)})}(pg,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...nm(t)})}(pg,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...nm(t)})}(pg,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...nm(t)})}(fg,t)),e.guid=t=>e.check(wf(ug,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...nm(t)})}(gg,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...nm(t)})}(bg,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...nm(t)})}(vg,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...nm(t)})}(Ng,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...nm(t)})}(Eg,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...nm(t)})}(yg,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...nm(t)})}(wg,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...nm(t)})}(xg,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...nm(t)})}(kg,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...nm(t)})}(Sg,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...nm(t)})}(Cg,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...nm(t)})}(Ag,t)),e.datetime=t=>e.check(Ff(t)),e.date=t=>e.check(Wf(t)),e.time=t=>e.check(Gf(t)),e.duration=t=>e.check(jf(t))});function cg(e){return function(e,t){return new e({type:"string",...nm(t)})}(og,e)}const lg=Mp("ZodStringFormat",(e,t)=>{mh.init(e,t),sg.init(e,t)}),dg=Mp("ZodEmail",(e,t)=>{gh.init(e,t),lg.init(e,t)}),ug=Mp("ZodGUID",(e,t)=>{hh.init(e,t),lg.init(e,t)}),pg=Mp("ZodUUID",(e,t)=>{fh.init(e,t),lg.init(e,t)}),mg=Mp("ZodURL",(e,t)=>{bh.init(e,t),lg.init(e,t)}),hg=Mp("ZodEmoji",(e,t)=>{vh.init(e,t),lg.init(e,t)}),fg=Mp("ZodNanoID",(e,t)=>{yh.init(e,t),lg.init(e,t)}),gg=Mp("ZodCUID",(e,t)=>{wh.init(e,t),lg.init(e,t)}),bg=Mp("ZodCUID2",(e,t)=>{xh.init(e,t),lg.init(e,t)}),vg=Mp("ZodULID",(e,t)=>{kh.init(e,t),lg.init(e,t)}),yg=Mp("ZodXID",(e,t)=>{Sh.init(e,t),lg.init(e,t)}),wg=Mp("ZodKSUID",(e,t)=>{Ch.init(e,t),lg.init(e,t)}),xg=Mp("ZodIPv4",(e,t)=>{Ph.init(e,t),lg.init(e,t)}),kg=Mp("ZodIPv6",(e,t)=>{Th.init(e,t),lg.init(e,t)}),Sg=Mp("ZodCIDRv4",(e,t)=>{Rh.init(e,t),lg.init(e,t)}),Cg=Mp("ZodCIDRv6",(e,t)=>{Dh.init(e,t),lg.init(e,t)}),Ng=Mp("ZodBase64",(e,t)=>{Mh.init(e,t),lg.init(e,t)}),Eg=Mp("ZodBase64URL",(e,t)=>{Uh.init(e,t),lg.init(e,t)}),Ag=Mp("ZodE164",(e,t)=>{Lh.init(e,t),lg.init(e,t)}),_g=Mp("ZodJWT",(e,t)=>{Oh.init(e,t),lg.init(e,t)}),Pg=Mp("ZodUnknown",(e,t)=>{zh.init(e,t),ig.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{}});function Tg(){return new Pg({type:"unknown"})}const Rg=Mp("ZodNever",(e,t)=>{Fh.init(e,t),ig.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r)=>{r.not={}})(0,0,t)});function Dg(e){return function(e,t){return new e({type:"never",...nm(t)})}(Rg,e)}const Ig=Mp("ZodArray",(e,t)=>{Wh.init(e,t),ig.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=r,i=e._zod.def,{minimum:s,maximum:o}=e._zod.bag;"number"==typeof s&&(a.minItems=s),"number"==typeof o&&(a.maxItems=o),a.type="array",a.items=Af(i.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element,e.min=(t,r)=>e.check(kf(t,r)),e.nonempty=t=>e.check(kf(1,t)),e.max=(t,r)=>e.check(xf(t,r)),e.length=(t,r)=>e.check(Sf(t,r)),e.unwrap=()=>e.element});const Mg=Mp("ZodObject",(e,t)=>{$h.init(e,t),ig.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=r,i=e._zod.def;a.type="object",a.properties={};const s=i.shape;for(const e in s)a.properties[e]=Af(s[e],t,{...n,path:[...n.path,"properties",e]});const o=new Set(Object.keys(s)),c=new Set([...o].filter(e=>{const r=i.shape[e]._zod;return"input"===t.io?void 0===r.optin:void 0===r.optout}));c.size>0&&(a.required=Array.from(c)),"never"===i.catchall?._zod.def.type?a.additionalProperties=!1:i.catchall?i.catchall&&(a.additionalProperties=Af(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(a.additionalProperties=!1)})(e,t,r,n),jp(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new zg({type:"enum",entries:r,...nm(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Tg()}),e.loose=()=>e.clone({...e._zod.def,catchall:Tg()}),e.strict=()=>e.clone({...e._zod.def,catchall:Dg()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Xp(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const r=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const n=Kp(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return $p(this,"shape",r),r}});return rm(e,n)}(e,t),e.safeExtend=t=>function(e,t){if(!Xp(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Kp(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return $p(this,"shape",r),r}});return rm(e,r)}(e,t),e.merge=t=>function(e,t){const r=Kp(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return $p(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return rm(e,r)}(e,t),e.pick=t=>function(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return rm(e,Kp(e._zod.def,{get shape(){const e={};for(const n in t){if(!(n in r.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&(e[n]=r.shape[n])}return $p(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=Kp(e._zod.def,{get shape(){const n={...e._zod.def.shape};for(const e in t){if(!(e in r.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return $p(this,"shape",n),n},checks:[]});return rm(e,a)}(e,t),e.partial=(...t)=>function(e,t,r){const n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=Kp(t._zod.def,{get shape(){const n=t._zod.def.shape,a={...n};if(r)for(const t in r){if(!(t in n))throw new Error(`Unrecognized key: "${t}"`);r[t]&&(a[t]=e?new e({type:"optional",innerType:n[t]}):n[t])}else for(const t in n)a[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return $p(this,"shape",a),a},checks:[]});return rm(t,a)}(Bg,e,t[0]),e.required=(...t)=>function(e,t,r){const n=Kp(t._zod.def,{get shape(){const n=t._zod.def.shape,a={...n};if(r)for(const t in r){if(!(t in a))throw new Error(`Unrecognized key: "${t}"`);r[t]&&(a[t]=new e({type:"nonoptional",innerType:n[t]}))}else for(const t in n)a[t]=new e({type:"nonoptional",innerType:n[t]});return $p(this,"shape",a),a}});return rm(t,n)}(Kg,e,t[0])});function Ug(e,t){const r={type:"object",shape:e??{},...nm(t)};return new Mg(r)}const Lg=Mp("ZodUnion",(e,t)=>{qh.init(e,t),ig.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,i=!1===a.inclusive,s=a.options.map((e,r)=>Af(e,t,{...n,path:[...n.path,i?"oneOf":"anyOf",r]}));i?r.oneOf=s:r.anyOf=s})(e,t,r,n),e.options=t.options});const Og=Mp("ZodIntersection",(e,t)=>{Zh.init(e,t),ig.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,i=Af(a.left,t,{...n,path:[...n.path,"allOf",0]}),s=Af(a.right,t,{...n,path:[...n.path,"allOf",1]}),o=e=>"allOf"in e&&1===Object.keys(e).length,c=[...o(i)?i.allOf:[i],...o(s)?s.allOf:[s]];r.allOf=c})(e,t,r,n)});const zg=Mp("ZodEnum",(e,t)=>{Xh.init(e,t),ig.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{const n=Fp(e._zod.def.entries);n.every(e=>"number"==typeof e)&&(r.type="number"),n.every(e=>"string"==typeof e)&&(r.type="string"),r.enum=n})(e,0,r),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{const a={};for(const n of e){if(!r.has(n))throw new Error(`Key ${n} not found in enum`);a[n]=t.entries[n]}return new zg({...t,checks:[],...nm(n),entries:a})},e.exclude=(e,n)=>{const a={...t.entries};for(const t of e){if(!r.has(t))throw new Error(`Key ${t} not found in enum`);delete a[t]}return new zg({...t,checks:[],...nm(n),entries:a})}});const Fg=Mp("ZodTransform",(e,t)=>{Qh.init(e,t),ig.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new Lp(e.constructor.name);r.addIssue=n=>{if("string"==typeof n)r.issues.push(lm(n,r.value,t));else{const t=n;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=r.value),t.inst??(t.inst=e),r.issues.push(lm(t))}};const a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r)):(r.value=a,r)}});const Bg=Mp("ZodOptional",(e,t)=>{tf.init(e,t),ig.init(e,t),e._zod.processJSONSchema=(t,r,n)=>If(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});function Wg(e){return new Bg({type:"optional",innerType:e})}const Vg=Mp("ZodExactOptional",(e,t)=>{rf.init(e,t),ig.init(e,t),e._zod.processJSONSchema=(t,r,n)=>If(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const Gg=Mp("ZodNullable",(e,t)=>{nf.init(e,t),ig.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,i=Af(a.innerType,t,n),s=t.seen.get(e);"openapi-3.0"===t.target?(s.ref=a.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function Hg(e){return new Gg({type:"nullable",innerType:e})}const jg=Mp("ZodDefault",(e,t)=>{af.init(e,t),ig.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;Af(a.innerType,t,n),t.seen.get(e).ref=a.innerType,r.default=JSON.parse(JSON.stringify(a.defaultValue))})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const $g=Mp("ZodPrefault",(e,t)=>{of.init(e,t),ig.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;Af(a.innerType,t,n),t.seen.get(e).ref=a.innerType,"input"===t.io&&(r._prefault=JSON.parse(JSON.stringify(a.defaultValue)))})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});const Kg=Mp("ZodNonOptional",(e,t)=>{cf.init(e,t),ig.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;Af(a.innerType,t,n),t.seen.get(e).ref=a.innerType})(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const qg=Mp("ZodCatch",(e,t)=>{df.init(e,t),ig.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;let i;Af(a.innerType,t,n),t.seen.get(e).ref=a.innerType;try{i=a.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const Zg=Mp("ZodPipe",(e,t)=>{uf.init(e,t),ig.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,i="input"===t.io?"transform"===a.in._zod.def.type?a.out:a.in:a.out;Af(i,t,n),t.seen.get(e).ref=i})(e,t,0,n),e.in=t.in,e.out=t.out});function Jg(e,t){return new Zg({type:"pipe",in:e,out:t})}const Yg=Mp("ZodReadonly",(e,t)=>{mf.init(e,t),ig.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;Af(a.innerType,t,n),t.seen.get(e).ref=a.innerType,r.readOnly=!0})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});const Xg=Mp("ZodCustom",(e,t)=>{ff.init(e,t),ig.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)});var Qg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{const a=Rs(`Primitive.${r}`),i=n.forwardRef((e,n)=>{const{asChild:i,...s}=e,o=i?a:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t(o,{...s,ref:n})});return i.displayName=`Primitive.${r}`,{...e,[r]:i}},{}),eb=n.forwardRef((e,r)=>t(Qg.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));eb.displayName="Label";var tb=eb;const rb=zs("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),nb=n.forwardRef(({className:e,...r},n)=>t(tb,{ref:n,className:Oe(rb(),e),...r}));nb.displayName=tb.displayName;const ab=$u,ib=n.createContext({}),sb=({...e})=>t(ib.Provider,{value:{name:e.name},children:t(Hu,{...e})}),ob=()=>{const e=n.useContext(ib),t=n.useContext(cb),{getFieldState:r,formState:i}=a.useContext(ju),s=r(e.name,i);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},cb=n.createContext({}),lb=n.forwardRef(({className:e,...r},a)=>{const i=n.useId();return t(cb.Provider,{value:{id:i},children:t("div",{ref:a,className:Oe("space-y-2",e),...r})})});lb.displayName="FormItem";const db=n.forwardRef(({className:e,...r},n)=>{const{error:a,formItemId:i}=ob();return t(nb,{ref:n,className:Oe(a&&"text-destructive",e),htmlFor:i,...r})});db.displayName="FormLabel";const ub=n.forwardRef(({...e},r)=>{const{error:n,formItemId:a,formDescriptionId:i,formMessageId:s}=ob();return t(Ds,{ref:r,id:a,"aria-describedby":n?`${i} ${s}`:`${i}`,"aria-invalid":!!n,...e})});ub.displayName="FormControl";const pb=n.forwardRef(({className:e,...r},n)=>{const{formDescriptionId:a}=ob();return t("p",{ref:n,id:a,className:Oe("text-sm text-muted-foreground",e),...r})});pb.displayName="FormDescription";const mb=n.forwardRef(({className:e,children:r,...n},a)=>{const{error:i,formMessageId:s}=ob(),o=i?String(i?.message):r;return o?t("p",{ref:a,id:s,className:Oe("text-sm font-medium text-destructive",e),...n,children:o}):null});mb.displayName="FormMessage";const hb=n.forwardRef(({className:e,type:r,...n},a)=>t("input",{type:r,className:Oe("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...n}));function fb(e){const r=gb(e),a=n.forwardRef((e,a)=>{const{children:i,...s}=e,o=n.Children.toArray(i),c=o.find(vb);if(c){const e=c.props.children,i=o.map(t=>t===c?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t);return t(r,{...s,ref:a,children:n.isValidElement(e)?n.cloneElement(e,void 0,i):null})}return t(r,{...s,ref:a,children:i})});return a.displayName=`${e}.Slot`,a}function gb(e){const t=n.forwardRef((e,t)=>{const{children:r,...a}=e;if(n.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),i=function(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{const t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}(a,r.props);return r.type!==n.Fragment&&(i.ref=t?Es(t,e):e),n.cloneElement(r,i)}return n.Children.count(r)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}hb.displayName="Input";var bb=Symbol("radix.slottable");function vb(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===bb}function yb(e){const r=e+"CollectionProvider",[n,i]=Vs(r),[s,o]=n(r,{collectionRef:{current:null},itemMap:new Map}),c=e=>{const{scope:r,children:n}=e,i=a.useRef(null),o=a.useRef(new Map).current;return t(s,{scope:r,itemMap:o,collectionRef:i,children:n})};c.displayName=r;const l=e+"CollectionSlot",d=fb(l),u=a.forwardRef((e,r)=>{const{scope:n,children:a}=e,i=As(r,o(l,n).collectionRef);return t(d,{ref:i,children:a})});u.displayName=l;const p=e+"CollectionItemSlot",m="data-radix-collection-item",h=fb(p),f=a.forwardRef((e,r)=>{const{scope:n,children:i,...s}=e,c=a.useRef(null),l=As(r,c),d=o(p,n);return a.useEffect(()=>(d.itemMap.set(c,{ref:c,...s}),()=>{d.itemMap.delete(c)})),t(h,{[m]:"",ref:l,children:i})});return f.displayName=p,[{Provider:c,Slot:u,ItemSlot:f},function(t){const r=o(e+"CollectionConsumer",t),n=a.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`)),n=Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current));return n},[r.collectionRef,r.itemMap]);return n},i]}var wb=n.createContext(void 0);function xb(e){const t=n.useContext(wb);return e||t||"ltr"}var kb="rovingFocusGroup.onEntryFocus",Sb={bubbles:!1,cancelable:!0},Cb="RovingFocusGroup",[Nb,Eb,Ab]=yb(Cb),[_b,Pb]=Vs(Cb,[Ab]),[Tb,Rb]=_b(Cb),Db=n.forwardRef((e,r)=>t(Nb.Provider,{scope:e.__scopeRovingFocusGroup,children:t(Nb.Slot,{scope:e.__scopeRovingFocusGroup,children:t(Ib,{...e,ref:r})})}));Db.displayName=Cb;var Ib=n.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:a,orientation:i,loop:s=!1,dir:o,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:p=!1,...m}=e,h=n.useRef(null),f=As(r,h),g=xb(o),[b,v]=Zs({prop:c,defaultProp:l??null,onChange:d,caller:Cb}),[y,w]=n.useState(!1),x=eo(u),k=Eb(a),S=n.useRef(!1),[C,N]=n.useState(0);return n.useEffect(()=>{const e=h.current;if(e)return e.addEventListener(kb,x),()=>e.removeEventListener(kb,x)},[x]),t(Tb,{scope:a,orientation:i,dir:g,loop:s,currentTabStopId:b,onItemFocus:n.useCallback(e=>v(e),[v]),onItemShiftTab:n.useCallback(()=>w(!0),[]),onFocusableItemAdd:n.useCallback(()=>N(e=>e+1),[]),onFocusableItemRemove:n.useCallback(()=>N(e=>e-1),[]),children:t(Qs.div,{tabIndex:y||0===C?-1:0,"data-orientation":i,...m,ref:f,style:{outline:"none",...e.style},onMouseDown:Ws(e.onMouseDown,()=>{S.current=!0}),onFocus:Ws(e.onFocus,e=>{const t=!S.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(kb,Sb);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=k().filter(e=>e.focusable);Ob([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),p)}}S.current=!1}),onBlur:Ws(e.onBlur,()=>w(!1))})})}),Mb="RovingFocusGroupItem",Ub=n.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:a,focusable:i=!0,active:s=!1,tabStopId:o,children:c,...l}=e,d=Ks(),u=o||d,p=Rb(Mb,a),m=p.currentTabStopId===u,h=Eb(a),{onFocusableItemAdd:f,onFocusableItemRemove:g,currentTabStopId:b}=p;return n.useEffect(()=>{if(i)return f(),()=>g()},[i,f,g]),t(Nb.ItemSlot,{scope:a,id:u,focusable:i,active:s,children:t(Qs.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...l,ref:r,onMouseDown:Ws(e.onMouseDown,e=>{i?p.onItemFocus(u):e.preventDefault()}),onFocus:Ws(e.onFocus,()=>p.onItemFocus(u)),onKeyDown:Ws(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,r){const n=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)?void 0:Lb[n]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=h().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const n=r.indexOf(e.currentTarget);r=p.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>Ob(r))}}),children:"function"==typeof c?c({isCurrentTabStop:m,hasTabStop:null!=b}):c})})});Ub.displayName=Mb;var Lb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ob(e,t=!1){const r=document.activeElement;for(const n of e){if(n===r)return;if(n.focus({preventScroll:t}),document.activeElement!==r)return}}var zb=Db,Fb=Ub,Bb="Radio",[Wb,Vb]=Vs(Bb),[Gb,Hb]=Wb(Bb),jb=n.forwardRef((r,a)=>{const{__scopeRadio:i,name:s,checked:o=!1,required:c,disabled:l,value:d="on",onCheck:u,form:p,...m}=r,[h,f]=n.useState(null),g=As(a,e=>f(e)),b=n.useRef(!1),v=!h||(p||!!h.closest("form"));return e(Gb,{scope:i,checked:o,disabled:l,children:[t(Qs.button,{type:"button",role:"radio","aria-checked":o,"data-state":Zb(o),"data-disabled":l?"":void 0,disabled:l,value:d,...m,ref:g,onClick:Ws(r.onClick,e=>{o||u?.(),v&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})}),v&&t(qb,{control:h,bubbles:!b.current,name:s,value:d,checked:o,required:c,disabled:l,form:p,style:{transform:"translateX(-100%)"}})]})});jb.displayName=Bb;var $b="RadioIndicator",Kb=n.forwardRef((e,r)=>{const{__scopeRadio:n,forceMount:a,...i}=e,s=Hb($b,n);return t(xo,{present:a||s.checked,children:t(Qs.span,{"data-state":Zb(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:r})})});Kb.displayName=$b;var qb=n.forwardRef(({__scopeRadio:e,control:r,checked:a,bubbles:i=!0,...s},o)=>{const c=n.useRef(null),l=As(c,o),d=Wd(a),u=Vd(r);return n.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==a&&r){const t=new Event("click",{bubbles:i});r.call(e,a),e.dispatchEvent(t)}},[d,a,i]),t(Qs.input,{type:"radio","aria-hidden":!0,defaultChecked:a,...s,tabIndex:-1,ref:l,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Zb(e){return e?"checked":"unchecked"}qb.displayName="RadioBubbleInput";var Jb=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Yb="RadioGroup",[Xb]=Vs(Yb,[Pb,Vb]),Qb=Pb(),ev=Vb(),[tv,rv]=Xb(Yb),nv=n.forwardRef((e,r)=>{const{__scopeRadioGroup:n,name:a,defaultValue:i,value:s,required:o=!1,disabled:c=!1,orientation:l,dir:d,loop:u=!0,onValueChange:p,...m}=e,h=Qb(n),f=xb(d),[g,b]=Zs({prop:s,defaultProp:i??null,onChange:p,caller:Yb});return t(tv,{scope:n,name:a,required:o,disabled:c,value:g,onValueChange:b,children:t(zb,{asChild:!0,...h,orientation:l,dir:f,loop:u,children:t(Qs.div,{role:"radiogroup","aria-required":o,"aria-orientation":l,"data-disabled":c?"":void 0,dir:f,...m,ref:r})})})});nv.displayName=Yb;var av="RadioGroupItem",iv=n.forwardRef((e,r)=>{const{__scopeRadioGroup:a,disabled:i,...s}=e,o=rv(av,a),c=o.disabled||i,l=Qb(a),d=ev(a),u=n.useRef(null),p=As(r,u),m=o.value===s.value,h=n.useRef(!1);return n.useEffect(()=>{const e=e=>{Jb.includes(e.key)&&(h.current=!0)},t=()=>h.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),t(Fb,{asChild:!0,...l,focusable:!c,active:m,children:t(jb,{disabled:c,required:o.required,checked:m,...d,...s,name:o.name,ref:p,onCheck:()=>o.onValueChange(s.value),onKeyDown:Ws(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:Ws(s.onFocus,()=>{h.current&&u.current?.click()})})})});iv.displayName=av;var sv=n.forwardRef((e,r)=>{const{__scopeRadioGroup:n,...a}=e,i=ev(n);return t(Kb,{...i,...a,ref:r})});sv.displayName="RadioGroupIndicator";var ov=nv,cv=iv,lv=sv;const dv=n.forwardRef(({className:e,...r},n)=>t(ov,{className:Oe("grid gap-2",e),...r,ref:n}));dv.displayName=ov.displayName;const uv=n.forwardRef(({className:e,...r},n)=>t(cv,{ref:n,className:Oe("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:t(lv,{className:"flex items-center justify-center",children:t(hl,{className:"h-3.5 w-3.5 fill-primary"})})}));function pv(e,[t,r]){return Math.min(r,Math.max(t,e))}uv.displayName=cv.displayName;var mv="ScrollArea",[hv]=Vs(mv),[fv,gv]=hv(mv),bv=n.forwardRef((e,r)=>{const{__scopeScrollArea:a,type:i="hover",dir:s,scrollHideDelay:o=600,...c}=e,[l,d]=n.useState(null),[u,p]=n.useState(null),[m,h]=n.useState(null),[f,g]=n.useState(null),[b,v]=n.useState(null),[y,w]=n.useState(0),[x,k]=n.useState(0),[S,C]=n.useState(!1),[N,E]=n.useState(!1),A=As(r,e=>d(e)),_=xb(s);return t(fv,{scope:a,type:i,dir:_,scrollHideDelay:o,scrollArea:l,viewport:u,onViewportChange:p,content:m,onContentChange:h,scrollbarX:f,onScrollbarXChange:g,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:b,onScrollbarYChange:v,scrollbarYEnabled:N,onScrollbarYEnabledChange:E,onCornerWidthChange:w,onCornerHeightChange:k,children:t(Qs.div,{dir:_,...c,ref:A,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});bv.displayName=mv;var vv="ScrollAreaViewport",yv=n.forwardRef((a,i)=>{const{__scopeScrollArea:s,children:o,nonce:c,...l}=a,d=gv(vv,s),u=As(i,n.useRef(null),d.onViewportChange);return e(r,{children:[t("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:c}),t(Qs.div,{"data-radix-scroll-area-viewport":"",...l,ref:u,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...a.style},children:t("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});yv.displayName=vv;var wv="ScrollAreaScrollbar",xv=n.forwardRef((e,r)=>{const{forceMount:a,...i}=e,s=gv(wv,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:c}=s,l="horizontal"===e.orientation;return n.useEffect(()=>(l?o(!0):c(!0),()=>{l?o(!1):c(!1)}),[l,o,c]),"hover"===s.type?t(kv,{...i,ref:r,forceMount:a}):"scroll"===s.type?t(Sv,{...i,ref:r,forceMount:a}):"auto"===s.type?t(Cv,{...i,ref:r,forceMount:a}):"always"===s.type?t(Nv,{...i,ref:r}):null});xv.displayName=wv;var kv=n.forwardRef((e,r)=>{const{forceMount:a,...i}=e,s=gv(wv,e.__scopeScrollArea),[o,c]=n.useState(!1);return n.useEffect(()=>{const e=s.scrollArea;let t=0;if(e){const r=()=>{window.clearTimeout(t),c(!0)},n=()=>{t=window.setTimeout(()=>c(!1),s.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[s.scrollArea,s.scrollHideDelay]),t(xo,{present:a||o,children:t(Cv,{"data-state":o?"visible":"hidden",...i,ref:r})})}),Sv=n.forwardRef((e,r)=>{const{forceMount:a,...i}=e,s=gv(wv,e.__scopeScrollArea),o="horizontal"===e.orientation,c=Hv(()=>d("SCROLL_END"),100),[l,d]=(u="hidden",p={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},n.useReducer((e,t)=>p[e][t]??e,u));var u,p;return n.useEffect(()=>{if("idle"===l){const e=window.setTimeout(()=>d("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(e)}},[l,s.scrollHideDelay,d]),n.useEffect(()=>{const e=s.viewport,t=o?"scrollLeft":"scrollTop";if(e){let r=e[t];const n=()=>{const n=e[t];r!==n&&(d("SCROLL"),c()),r=n};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}},[s.viewport,o,d,c]),t(xo,{present:a||"hidden"!==l,children:t(Nv,{"data-state":"hidden"===l?"hidden":"visible",...i,ref:r,onPointerEnter:Ws(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Ws(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),Cv=n.forwardRef((e,r)=>{const a=gv(wv,e.__scopeScrollArea),{forceMount:i,...s}=e,[o,c]=n.useState(!1),l="horizontal"===e.orientation,d=Hv(()=>{if(a.viewport){const e=a.viewport.offsetWidth<a.viewport.scrollWidth,t=a.viewport.offsetHeight<a.viewport.scrollHeight;c(l?e:t)}},10);return jv(a.viewport,d),jv(a.content,d),t(xo,{present:i||o,children:t(Nv,{"data-state":o?"visible":"hidden",...s,ref:r})})}),Nv=n.forwardRef((e,r)=>{const{orientation:a="vertical",...i}=e,s=gv(wv,e.__scopeScrollArea),o=n.useRef(null),c=n.useRef(0),[l,d]=n.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=zv(l.viewport,l.content),p={...i,sizes:l,onSizesChange:d,hasThumb:Boolean(u>0&&u<1),onThumbChange:e=>o.current=e,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:e=>c.current=e};function m(e,t){return function(e,t,r,n="ltr"){const a=Fv(r),i=a/2,s=t||i,o=a-s,c=r.scrollbar.paddingStart+s,l=r.scrollbar.size-r.scrollbar.paddingEnd-o,d=r.content-r.viewport,u="ltr"===n?[0,d]:[-1*d,0];return Wv([c,l],u)(e)}(e,c.current,l,t)}return"horizontal"===a?t(Ev,{...p,ref:r,onThumbPositionChange:()=>{if(s.viewport&&o.current){const e=Bv(s.viewport.scrollLeft,l,s.dir);o.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{s.viewport&&(s.viewport.scrollLeft=e)},onDragScroll:e=>{s.viewport&&(s.viewport.scrollLeft=m(e,s.dir))}}):"vertical"===a?t(Av,{...p,ref:r,onThumbPositionChange:()=>{if(s.viewport&&o.current){const e=Bv(s.viewport.scrollTop,l);o.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{s.viewport&&(s.viewport.scrollTop=e)},onDragScroll:e=>{s.viewport&&(s.viewport.scrollTop=m(e))}}):null}),Ev=n.forwardRef((e,r)=>{const{sizes:a,onSizesChange:i,...s}=e,o=gv(wv,e.__scopeScrollArea),[c,l]=n.useState(),d=n.useRef(null),u=As(r,d,o.onScrollbarXChange);return n.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),t(Tv,{"data-orientation":"horizontal",...s,ref:u,sizes:a,style:{bottom:0,left:"rtl"===o.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===o.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Fv(a)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,r)=>{if(o.viewport){const n=o.viewport.scrollLeft+t.deltaX;e.onWheelScroll(n),Vv(n,r)&&t.preventDefault()}},onResize:()=>{d.current&&o.viewport&&c&&i({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:Ov(c.paddingLeft),paddingEnd:Ov(c.paddingRight)}})}})}),Av=n.forwardRef((e,r)=>{const{sizes:a,onSizesChange:i,...s}=e,o=gv(wv,e.__scopeScrollArea),[c,l]=n.useState(),d=n.useRef(null),u=As(r,d,o.onScrollbarYChange);return n.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),t(Tv,{"data-orientation":"vertical",...s,ref:u,sizes:a,style:{top:0,right:"ltr"===o.dir?0:void 0,left:"rtl"===o.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Fv(a)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,r)=>{if(o.viewport){const n=o.viewport.scrollTop+t.deltaY;e.onWheelScroll(n),Vv(n,r)&&t.preventDefault()}},onResize:()=>{d.current&&o.viewport&&c&&i({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:Ov(c.paddingTop),paddingEnd:Ov(c.paddingBottom)}})}})}),[_v,Pv]=hv(wv),Tv=n.forwardRef((e,r)=>{const{__scopeScrollArea:a,sizes:i,hasThumb:s,onThumbChange:o,onThumbPointerUp:c,onThumbPointerDown:l,onThumbPositionChange:d,onDragScroll:u,onWheelScroll:p,onResize:m,...h}=e,f=gv(wv,a),[g,b]=n.useState(null),v=As(r,e=>b(e)),y=n.useRef(null),w=n.useRef(""),x=f.viewport,k=i.content-i.viewport,S=eo(p),C=eo(d),N=Hv(m,10);function E(e){if(y.current){const t=e.clientX-y.current.left,r=e.clientY-y.current.top;u({x:t,y:r})}}return n.useEffect(()=>{const e=e=>{const t=e.target,r=g?.contains(t);r&&S(e,k)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[x,g,k,S]),n.useEffect(C,[i,C]),jv(g,N),jv(f.content,N),t(_v,{scope:a,scrollbar:g,hasThumb:s,onThumbChange:eo(o),onThumbPointerUp:eo(c),onThumbPositionChange:C,onThumbPointerDown:eo(l),children:t(Qs.div,{...h,ref:v,style:{position:"absolute",...h.style},onPointerDown:Ws(e.onPointerDown,e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),y.current=g.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),E(e)}}),onPointerMove:Ws(e.onPointerMove,E),onPointerUp:Ws(e.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=w.current,f.viewport&&(f.viewport.style.scrollBehavior=""),y.current=null})})})}),Rv="ScrollAreaThumb",Dv=n.forwardRef((e,r)=>{const{forceMount:n,...a}=e,i=Pv(Rv,e.__scopeScrollArea);return t(xo,{present:n||i.hasThumb,children:t(Iv,{ref:r,...a})})}),Iv=n.forwardRef((e,r)=>{const{__scopeScrollArea:a,style:i,...s}=e,o=gv(Rv,a),c=Pv(Rv,a),{onThumbPositionChange:l}=c,d=As(r,e=>c.onThumbChange(e)),u=n.useRef(void 0),p=Hv(()=>{u.current&&(u.current(),u.current=void 0)},100);return n.useEffect(()=>{const e=o.viewport;if(e){const t=()=>{if(p(),!u.current){const t=Gv(e,l);u.current=t,l()}};return l(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,p,l]),t(Qs.div,{"data-state":c.hasThumb?"visible":"hidden",...s,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:Ws(e.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;c.onThumbPointerDown({x:r,y:n})}),onPointerUp:Ws(e.onPointerUp,c.onThumbPointerUp)})});Dv.displayName=Rv;var Mv="ScrollAreaCorner",Uv=n.forwardRef((e,r)=>{const n=gv(Mv,e.__scopeScrollArea),a=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&a?t(Lv,{...e,ref:r}):null});Uv.displayName=Mv;var Lv=n.forwardRef((e,r)=>{const{__scopeScrollArea:a,...i}=e,s=gv(Mv,a),[o,c]=n.useState(0),[l,d]=n.useState(0),u=Boolean(o&&l);return jv(s.scrollbarX,()=>{const e=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(e),d(e)}),jv(s.scrollbarY,()=>{const e=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(e),c(e)}),u?t(Qs.div,{...i,ref:r,style:{width:o,height:l,position:"absolute",right:"ltr"===s.dir?0:void 0,left:"rtl"===s.dir?0:void 0,bottom:0,...e.style}}):null});function Ov(e){return e?parseInt(e,10):0}function zv(e,t){const r=e/t;return isNaN(r)?0:r}function Fv(e){const t=zv(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function Bv(e,t,r="ltr"){const n=Fv(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,s=t.content-t.viewport,o=i-n,c=pv(e,"ltr"===r?[0,s]:[-1*s,0]);return Wv([0,s],[0,o])(c)}function Wv(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function Vv(e,t){return e>0&&e<t}var Gv=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function a(){const i={left:e.scrollLeft,top:e.scrollTop},s=r.left!==i.left,o=r.top!==i.top;(s||o)&&t(),r=i,n=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(n)};function Hv(e,t){const r=eo(e),a=n.useRef(0);return n.useEffect(()=>()=>window.clearTimeout(a.current),[]),n.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(r,t)},[r,t])}function jv(e,t){const r=eo(t);Hs(()=>{let t=0;if(e){const n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.unobserve(e)}}},[e,r])}var $v=bv,Kv=yv,qv=Uv;const Zv=n.forwardRef(({className:r,children:n,...a},i)=>e($v,{ref:i,className:Oe("relative overflow-hidden",r),...a,children:[t(Kv,{className:"h-full w-full rounded-[inherit]",children:n}),t(Jv,{}),t(qv,{})]}));Zv.displayName=$v.displayName;const Jv=n.forwardRef(({className:e,orientation:r="vertical",...n},a)=>t(xv,{ref:a,orientation:r,className:Oe("flex touch-none select-none transition-colors","vertical"===r&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===r&&"h-2.5 border-t border-t-transparent p-[1px]",e),...n,children:t(Dv,{className:Oe("relative rounded-full bg-border","vertical"===r&&"flex-1")})}));function Yv(e){return`data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="50%" y="50%" dominant-baseline="middle" alignment-baseline="middle" text-anchor="middle" font-size="50" font-family="sans-serif">${e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}</text></svg>`}Jv.displayName=xv.displayName;const Xv=["🏢","🏬","🏣","🏤","🏦","🏛️","🏠","🏡","🏭","🏗️","🏪","🏨","🏫","🏥","💼","📊","📈","📉","📋","📁","📂","🗂️","🗃️","🗄️","📅","🗓️","📝","🖋️","✏️","🖊️","🖌️","🖍️","📇","📌","📍","📎","🖇️","💻","🖥️","🖨️","🖱️","⌨️","📱","📲","📡","🌐","🔗","🔒","🔓","⚙️","🔧","🛠️","🧑‍💻","👨‍💻","👩‍💻","🕹️","💾","📟","🖥️","🖲️","🚀","💡","🎨","🖼️","🧪","🔬","🧬","🎯","⚡","🎲","🎮","🧩","📷","🎥","✉️","📨","📩","📧","📞","☎️","📠","🗣️","💬","🗨️","📢","📣","🔔","🛎️","💰","💸","💳","🏦","📈","📉","⚖️","🧾","🪙","🏛️","⚗️","🧪","🔭","🔬","🩺","🧬","🩻","🏥","🌱","🌍","🌏","🌎","🌡️","👨‍💼","👩‍💼","👨‍🏫","👩‍🏫","👨‍🔬","👩‍🔬","👨‍🎨","👩‍🎨","👨‍🔧","👩‍🔧","👨‍🚀","👩‍🚀","👨‍⚖️","👩‍⚖️","🏅","🎖️","🥇","🥈","🥉","🏆","🎗️","🔑","🗝️","🧭","🛡️","🚩","🏳️‍🌈","🎟️","🎫"],Qv=({workspace:r})=>{const{t:n}=Cn(),{updateWorkspace:a}=jC(),{can:i}=Wl(),[s,o]=m(!1),[c,l]=m("emoji"),[d,u]=m(),p=tu(),h=_p({resolver:Of(Ug({name:cg().min(2,{message:n("general.nameMinLength")}),image:cg().optional()})),defaultValues:{name:r.name||"",image:r.image||""}});if(!r)return t(Zl,{});const f=i(Ll.WORKSPACE_SETTINGS_EDIT);return e("div",{children:[p.message&&e("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[t("p",{className:"font-medium",children:n("settings.common.success")}),t("p",{className:"text-sm",children:p.message})]}),!f&&t(Kl,{descriptionKey:"general.ownerOnly"}),t(ab,{...h,children:e("form",{onSubmit:h.handleSubmit(async function(e){o(!0),p.clear();try{await a(r,e),p.show(n("general.success"))}catch(e){$e(e,{component:"WorkspaceSettingsGeneral",action:"updateWorkspace",metadata:{workspaceId:r._id}})}finally{o(!1)}}),className:"space-y-6",children:[t(sb,{control:h.control,name:"name",render:({field:r})=>e(lb,{children:[t(db,{children:n("general.name")}),t(ub,{children:t(hb,{placeholder:n("general.namePlaceholder"),...r,disabled:!f})}),t(mb,{})]})}),r.billingCurrency?.trim()&&e("div",{className:"space-y-1.5",children:[t(nb,{className:"text-sm font-medium text-muted-foreground",children:n("general.billingCurrency")}),e("div",{className:"flex items-center gap-2 text-sm",children:[Hl(r.billingCurrency)&&t("span",{className:"text-base",children:Hl(r.billingCurrency)}),t("span",{children:r.billingCurrency.trim().toUpperCase()})]})]}),e("div",{className:"space-y-4",children:[e("div",{children:[t(nb,{className:"text-sm font-medium",children:n("general.icon")}),t(pb,{children:n("general.iconDescription")})]}),e(dv,{value:c,disabled:!f,onValueChange:e=>l(e),className:"flex flex-col space-y-3",children:[e("div",{className:"flex items-center space-x-2",children:[t(uv,{value:"emoji",id:"emoji"}),e(nb,{htmlFor:"emoji",className:"flex items-center gap-2",children:[t(vs,{className:"h-4 w-4"}),n("general.chooseEmoji")]})]}),e("div",{className:"flex items-center space-x-2",children:[t(uv,{value:"url",id:"url"}),e(nb,{htmlFor:"url",className:"flex items-center gap-2",children:[t(ss,{className:"h-4 w-4"}),n("general.customImageUrl")]})]})]}),"emoji"===c&&e("div",{className:"space-y-3",children:[e("div",{className:"flex items-center gap-3",children:[t("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:[d&&t("span",{className:"text-2xl",children:d}),!d&&h.watch("image")?.trim()&&t("img",{src:h.watch("image")||void 0,alt:"Workspace preview"})]})]}),f&&t(Zv,{className:"h-32 w-full rounded-md border",children:t("div",{className:"p-4 grid grid-cols-8 gap-2",children:Xv.map((e,r)=>t("button",{type:"button",onClick:()=>(e=>{u(e),h.setValue("image",Yv(e))})(e),disabled:!f,className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(d===e?"bg-primary text-primary-foreground":""),children:e},r))})})]}),"url"===c&&e("div",{className:"space-y-3",children:[t(sb,{control:h.control,name:"image",render:({field:r})=>e(lb,{children:[t(db,{children:n("general.imageUrl")}),t(ub,{children:t(hb,{placeholder:n("general.imageUrlPlaceholder"),...r,disabled:!f})}),t(pb,{children:n("general.imageUrlDescription")}),t(mb,{})]})}),h.watch("image")&&h.watch("image")?.trim()&&e("div",{className:"flex items-center gap-3",children:[t("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),t("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:t("img",{src:h.watch("image")||void 0,className:"w-full h-full object-cover",alt:"Workspace preview"})})]})]})]}),t("div",{className:"flex justify-end gap-3 pt-4",children:f&&t(Bs,{type:"submit",disabled:s,progress:s,children:n("general.updateWorkspace")})})]})})]})};class ey extends Mn{constructor(e){super({...e,requireOrgId:!0})}async getVapidPublicKey(){return this.fetchJson("push/vapid-public-key")}async subscribe(e,t){await this.fetchJson("push/subscribe",{method:"POST",body:JSON.stringify({endpoint:e.endpoint,keys:e.keys,userAgent:t})})}async unsubscribe(e){await this.fetchJson("push/unsubscribe",{method:"DELETE",body:JSON.stringify({endpoint:e})})}}const ty=c(null);function ry(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/"),r=atob(t),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n}const ny=a.memo(function({children:e,serviceWorkerPath:r="/push-sw.js",autoSubscribe:n=!1}){const{t:a}=Cn(),i=Bn(),{isAuthenticated:s}=ZC(),c=o(()=>"undefined"!=typeof window&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window,[]),l=o(()=>new ey({serverUrl:i.serverUrl,version:i.version,orgId:i.orgId}),[i.serverUrl,i.version,i.orgId]),[d,h]=m({permission:c?Notification.permission:"default",isSubscribed:!1,isSupported:c,loading:!1,error:null});u(()=>{if(!s||!c)return;let e=!1;return(async()=>{try{const t=await navigator.serviceWorker.getRegistration(r);if(e)return;if(!t)return void h(e=>({...e,isSubscribed:!1}));const n=await t.pushManager.getSubscription();if(e)return;h(e=>({...e,isSubscribed:!!n,permission:Notification.permission}))}catch{e||h(e=>({...e,isSubscribed:!1}))}})(),()=>{e=!0}},[s,c,r]);const f=p(async()=>{if(!c)return!1;const e=await Notification.requestPermission();return h(t=>({...t,permission:e})),"granted"===e},[c]),g=p(async()=>{if(c&&s){h(e=>({...e,loading:!0,error:null}));try{if(!await f())return void h(e=>({...e,loading:!1,error:a("notifications.permissionDenied")}));const{publicKey:e}=await l.getVapidPublicKey(),t=await navigator.serviceWorker.register(r);await navigator.serviceWorker.ready;const n=(await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:ry(e)})).toJSON();await l.subscribe({endpoint:n.endpoint,keys:{p256dh:n.keys.p256dh,auth:n.keys.auth}},navigator.userAgent),h(e=>({...e,isSubscribed:!0,loading:!1}))}catch(e){const t=e instanceof Error?e.message:a("push.failedToSubscribe");h(e=>({...e,loading:!1,error:t})),$e(e,{component:"PushNotificationProvider",action:"subscribe"})}}},[c,s,l,r,f]),b=p(async()=>{if(c){h(e=>({...e,loading:!0,error:null}));try{const e=await navigator.serviceWorker.getRegistration(r);if(e){const t=await e.pushManager.getSubscription();if(t){const e=t.endpoint;await t.unsubscribe(),await l.unsubscribe(e)}}h(e=>({...e,isSubscribed:!1,loading:!1}))}catch(e){const t=e instanceof Error?e.message:a("push.failedToUnsubscribe");h(e=>({...e,loading:!1,error:t})),$e(e,{component:"PushNotificationProvider",action:"unsubscribe"})}}},[c,l,r]),v=o(()=>({...d,requestPermission:f,subscribe:g,unsubscribe:b}),[d,f,g,b]);return t(ty.Provider,{value:v,children:e})});function ay(){const e=d(ty);if(!e)throw new Error("usePushNotifications must be used within PushNotificationProvider");return e}const iy={firefox:4,safari:4,edge:4,chrome:4},sy=({workspace:n})=>{const{isSupported:a,permission:i,isSubscribed:c,loading:l,error:d,subscribe:h,unsubscribe:f}=ay(),{t:g}=Cn(),{api:b}=Gn(),{can:v}=Wl(),y=v(Ll.WORKSPACE_SETTINGS_EDIT),w=o(()=>function(){const e="undefined"!=typeof navigator?navigator.userAgent:"";return e.includes("Firefox")?"firefox":e.includes("Safari")&&!e.includes("Chrome")?"safari":e.includes("Edg")?"edge":"chrome"}(),[]),x=iy[w],[k,S]=m([]),[C,N]=m(!0),[E,A]=m({}),[_,P]=m(!0),[T,R]=m(null),[D,I]=m(null),M=s(null);u(()=>()=>{M.current&&clearTimeout(M.current)},[]),u(()=>{if(!n?._id)return;const e=n._id.toString();N(!0),P(!0),Promise.all([b.getNotificationEvents(e).catch(()=>[]),b.getNotificationPreferences(e).catch(()=>({}))]).then(([e,t])=>{S(e),A(t)}).finally(()=>{N(!1),P(!1)})},[n?._id]);const U=p(async(e,t,r)=>{if(!n?._id||!y)return;const a=!r;R(`${e}.${t}`),I(null),A(r=>({...r,[e]:{...r[e],[t]:a}}));try{const r=await b.updateNotificationPreferences(n._id.toString(),{[e]:{[t]:a}});A(r),I(g("notifications.prefsSaved")),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>I(null),3e3)}catch(n){A(n=>({...n,[e]:{...n[e],[t]:r}})),$e(n,{component:"SettingsNotifications",action:"toggleChannel"})}finally{R(null)}},[n?._id,y,b,g]),L=(e,t)=>!1!==E[e]?.[t],O=o(()=>{const e=new Map;for(const t of k){const r=t.category||"general";e.has(r)||e.set(r,[]),e.get(r).push(t)}return Array.from(e.entries())},[k]),z=C||_,F=k.length>0;return e("div",{className:"space-y-6",children:[t("p",{className:"text-sm text-gray-600",children:g("notifications.manageDescription")}),a&&e(r,{children:[d&&"denied"!==i&&t("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg text-sm",children:d}),"denied"===i&&t("div",{className:"border border-amber-200 bg-amber-50 rounded-lg p-4",children:e("div",{className:"flex items-start gap-3",children:[t(hs,{className:"h-5 w-5 text-amber-600 shrink-0 mt-0.5"}),e("div",{children:[t("h4",{className:"text-sm font-medium text-amber-800",children:g("notifications.blocked")}),t("p",{className:"text-xs text-amber-700 mt-1",children:g("notifications.blockedDescription")}),t("ol",{className:"text-xs text-amber-700 mt-2 space-y-1 list-decimal list-inside",children:Array.from({length:x},(e,r)=>t("li",{children:g(`notifications.unblock.${w}.step${r+1}`)},r))})]})]})}),"denied"!==i&&e("div",{className:"border rounded-lg p-4",children:[e("div",{className:"flex items-start justify-between gap-4",children:[e("div",{className:"flex items-start gap-3",children:[t("div",{className:"mt-0.5 p-2 rounded-lg "+(c?"bg-green-100":"bg-gray-100"),children:c?t(qi,{className:"h-4 w-4 text-green-600"}):t(Ki,{className:"h-4 w-4 text-gray-400"})}),e("div",{children:[t("h4",{className:"text-sm font-medium text-gray-900",children:g("notifications.pushTitle")}),t("p",{className:"text-xs text-gray-500 mt-0.5",children:g("notifications.pushDescription",{subscribed:String(c)})})]})]}),t(Bs,{variant:c?"outline":"default",size:"sm",className:"shrink-0",onClick:c?f:h,disabled:l,progress:l,children:g("notifications.toggleAction",{loading:String(l),subscribed:String(c)})})]}),c&&t("div",{className:"mt-3 pt-3 border-t border-gray-100 text-xs text-gray-500",children:g("notifications.deviceNote")})]})]}),z&&t("div",{className:"text-center text-sm text-gray-400 py-4",children:g("notifications.loadingPrefs")}),!z&&F&&y&&e(r,{children:[D&&t("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded-lg text-sm",children:D}),O.map(([r,n])=>e("div",{className:"border rounded-lg overflow-hidden",children:[t("div",{className:"bg-gray-50 px-4 py-2.5 border-b",children:t("h4",{className:"text-sm font-medium text-gray-700 capitalize",children:r})}),e("div",{className:"divide-y",children:[e("div",{className:"flex items-center px-4 py-2 bg-gray-50/50",children:[t("div",{className:"flex-1"}),e("div",{className:"flex items-center gap-6",children:[t("div",{className:"w-12 flex justify-center",children:t(cs,{className:"h-3.5 w-3.5 text-gray-400"})}),t("div",{className:"w-12 flex justify-center",children:t(bs,{className:"h-3.5 w-3.5 text-gray-400"})})]})]}),n.map(r=>{const n=L(r.slug,"email"),a=L(r.slug,"push"),i=T===`${r.slug}.email`,s=T===`${r.slug}.push`;return e("div",{className:"flex items-center px-4 py-3",children:[e("div",{className:"flex-1 min-w-0",children:[t("div",{className:"text-sm font-medium text-gray-900",children:r.name}),r.description&&t("div",{className:"text-xs text-gray-500 mt-0.5",children:r.description})]}),e("div",{className:"flex items-center gap-6 shrink-0",children:[t("div",{className:"w-12 flex justify-center",children:r.channels.email?t(eu,{checked:n,onCheckedChange:()=>U(r.slug,"email",n),disabled:i}):t("span",{className:"text-xs text-gray-300",children:"—"})}),t("div",{className:"w-12 flex justify-center",children:r.channels.push?t(eu,{checked:a,onCheckedChange:()=>U(r.slug,"push",a),disabled:s}):t("span",{className:"text-xs text-gray-300",children:"—"})})]})]},r.slug)})]})]},r))]})]})},oy=({workspace:r})=>{const{t:n}=Cn(),{isOwner:a}=Wl(),{settings:i}=Vn(),{appPermissions:s}=Na(),{updateWorkspacePermissions:c}=jC(),[l,d]=m(!1),p=tu(),h=o(()=>i?.workspace?.roles??r.roles??[],[i?.workspace?.roles,r.roles]),f=o(()=>{if(!s)return[];const e=new Set;for(const t of Object.values(s))for(const r of t)r.startsWith("workspace:")||e.add(r);return Array.from(e).sort()},[s]),[g,b]=m({});if(u(()=>{if(!s)return;const e=r.permissions,t={};for(const r of h)t[r]=e&&r in e?e[r].filter(e=>!e.startsWith("workspace:")):r in s?s[r].filter(e=>!e.startsWith("workspace:")):[];b(t)},[r.permissions,s,h]),!r)return t(Zl,{});if(!s||0===f.length)return null;return e("div",{children:[p.message&&e("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[t("p",{className:"font-medium",children:n("settings.common.success")}),t("p",{className:"text-sm",children:p.message})]}),!a&&t(Kl,{descriptionKey:"permissions.ownerOnly"}),t("p",{className:"text-sm text-muted-foreground mb-4",children:n("permissions.description")}),t("div",{className:"overflow-x-auto",children:e("table",{className:"w-full text-sm",children:[t("thead",{children:e("tr",{className:"border-b",children:[t("th",{className:"text-start py-2 pe-4 font-medium text-gray-500 min-w-[160px]"}),h.map(e=>t("th",{className:"text-center py-2 px-3 font-medium text-gray-700 capitalize min-w-[80px]",children:e},e))]})}),t("tbody",{children:f.map(r=>e("tr",{className:"border-b border-gray-50 hover:bg-gray-50/50",children:[t("td",{className:"py-2 pe-4 text-gray-700 font-mono text-xs",children:r}),h.map(e=>{const n="admin"===e,i=n||(g[e]??[]).includes(r);return t("td",{className:"text-center py-2 px-3",children:t(eu,{checked:i,disabled:!a||n,onCheckedChange:()=>((e,t)=>{b(r=>{const n=r[e]??[],a=n.includes(t);return{...r,[e]:a?n.filter(e=>e!==t):[...n,t]}})})(e,r),className:"mx-auto"})},e)})]},r))})]})}),a&&t("div",{className:"mt-6",children:t(Bs,{onClick:async()=>{d(!0),p.clear();try{const e=r.permissions??{},t={},a=new Set([...Object.keys(e),...Object.keys(g)]);for(const r of a){const n=(e[r]??[]).filter(e=>e.startsWith("workspace:")),a=g[r]??[];t[r]=[...n,...a]}await c(r._id,t),p.show(n("permissions.saveSuccess"))}catch(e){$e(e,{component:"WorkspaceSettingsPermissions",action:"savePermissions",metadata:{workspaceId:r._id}})}finally{d(!1)}},disabled:l,progress:l,children:n(l?"permissions.saving":"permissions.save")})})]})};var cy=.999,ly=/[\\\/_+.#"@\[\(\{&]/,dy=/[\\\/_+.#"@\[\(\{&]/g,uy=/[\s-]/,py=/[\s-]/g;function my(e,t,r,n,a,i,s){if(i===t.length)return a===e.length?1:.99;var o=`${a},${i}`;if(void 0!==s[o])return s[o];for(var c,l,d,u,p=n.charAt(i),m=r.indexOf(p,a),h=0;m>=0;)(c=my(e,t,r,n,m+1,i+1,s))>h&&(m===a?c*=1:ly.test(e.charAt(m-1))?(c*=.8,(d=e.slice(a,m-1).match(dy))&&a>0&&(c*=Math.pow(cy,d.length))):uy.test(e.charAt(m-1))?(c*=.9,(u=e.slice(a,m-1).match(py))&&a>0&&(c*=Math.pow(cy,u.length))):(c*=.17,a>0&&(c*=Math.pow(cy,m-a))),e.charAt(m)!==t.charAt(i)&&(c*=.9999)),(c<.1&&r.charAt(m-1)===n.charAt(i+1)||n.charAt(i+1)===n.charAt(i)&&r.charAt(m-1)!==n.charAt(i))&&(.1*(l=my(e,t,r,n,m+1,i+2,s))>c&&(c=.1*l)),c>h&&(h=c),m=r.indexOf(p,m+1);return s[o]=h,h}function hy(e){return e.toLowerCase().replace(py," ")}function fy(e,t,r){return my(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,hy(e),hy(t),0,0,{})}var gy='[cmdk-group=""]',by='[cmdk-group-items=""]',vy='[cmdk-item=""]',yy=`${vy}:not([aria-disabled="true"])`,wy="cmdk-item-select",xy="data-value",ky=(e,t,r)=>fy(e,t,r),Sy=n.createContext(void 0),Cy=()=>n.useContext(Sy),Ny=n.createContext(void 0),Ey=()=>n.useContext(Ny),Ay=n.createContext(void 0),_y=n.forwardRef((e,t)=>{let r=Vy(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=Vy(()=>new Set),i=Vy(()=>new Map),s=Vy(()=>new Map),o=Vy(()=>new Set),c=By(e),{label:l,children:d,value:u,onValueChange:p,filter:m,shouldFilter:h,loop:f,disablePointerSelection:g=!1,vimBindings:b=!0,...v}=e,y=Ks(),w=Ks(),x=Ks(),k=n.useRef(null),S=jy();Wy(()=>{if(void 0!==u){let e=u.trim();r.current.value=e,C.emit()}},[u]),Wy(()=>{S(6,T)},[]);let C=n.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var a,i,s,o;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)P(),A(),S(1,_);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(x);e?e.focus():null==(a=document.getElementById(y))||a.focus()}if(S(7,()=>{var e;r.current.selectedItemId=null==(e=R())?void 0:e.id,C.emit()}),n||S(5,T),void 0!==(null==(i=c.current)?void 0:i.value)){let e=null!=t?t:"";return void(null==(o=(s=c.current).onValueChange)||o.call(s,e))}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),N=n.useMemo(()=>({value:(e,t,n)=>{var a;t!==(null==(a=s.current.get(e))?void 0:a.value)&&(s.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,E(t,n)),S(2,()=>{A(),C.emit()}))},item:(e,t)=>(a.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{P(),A(),r.current.value||_(),C.emit()}),()=>{s.current.delete(e),a.current.delete(e),r.current.filtered.items.delete(e);let t=R();S(4,()=>{P(),(null==t?void 0:t.getAttribute("id"))===e&&_(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{s.current.delete(e),i.current.delete(e)}),filter:()=>c.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:y,inputId:x,labelId:w,listInnerRef:k}),[]);function E(e,t){var n,a;let i=null!=(a=null==(n=c.current)?void 0:n.filter)?a:ky;return e?i(e,r.current.search,t):0}function A(){if(!r.current.search||!1===c.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=i.current.get(r),a=0;n.forEach(t=>{let r=e.get(t);a=Math.max(r,a)}),t.push([r,a])});let n=k.current;D().sort((t,r)=>{var n,a;let i=t.getAttribute("id"),s=r.getAttribute("id");return(null!=(n=e.get(s))?n:0)-(null!=(a=e.get(i))?a:0)}).forEach(e=>{let t=e.closest(by);t?t.appendChild(e.parentElement===t?e:e.closest(`${by} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${by} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=k.current)?void 0:t.querySelector(`${gy}[${xy}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function _(){let e=D().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(xy);C.setState("value",t||void 0)}function P(){var e,t,n,o;if(!r.current.search||!1===c.current.shouldFilter)return void(r.current.filtered.count=a.current.size);r.current.filtered.groups=new Set;let l=0;for(let i of a.current){let a=E(null!=(t=null==(e=s.current.get(i))?void 0:e.value)?t:"",null!=(o=null==(n=s.current.get(i))?void 0:n.keywords)?o:[]);r.current.filtered.items.set(i,a),a>0&&l++}for(let[e,t]of i.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=l}function T(){var e,t,r;let n=R();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(gy))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function R(){var e;return null==(e=k.current)?void 0:e.querySelector(`${vy}[aria-selected="true"]`)}function D(){var e;return Array.from((null==(e=k.current)?void 0:e.querySelectorAll(yy))||[])}function I(e){let t=D()[e];t&&C.setState("value",t.getAttribute(xy))}function M(e){var t;let r=R(),n=D(),a=n.findIndex(e=>e===r),i=n[a+e];null!=(t=c.current)&&t.loop&&(i=a+e<0?n[n.length-1]:a+e===n.length?n[0]:n[a+e]),i&&C.setState("value",i.getAttribute(xy))}function U(e){let t,r=R(),n=null==r?void 0:r.closest(gy);for(;n&&!t;)n=e>0?zy(n,gy):Fy(n,gy),t=null==n?void 0:n.querySelector(yy);t?C.setState("value",t.getAttribute(xy)):M(e)}let L=()=>I(D().length-1),O=e=>{e.preventDefault(),e.metaKey?L():e.altKey?U(1):M(1)},z=e=>{e.preventDefault(),e.metaKey?I(0):e.altKey?U(-1):M(-1)};return n.createElement(Qs.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=v.onKeyDown)||t.call(v,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!e.defaultPrevented&&!r)switch(e.key){case"n":case"j":b&&e.ctrlKey&&O(e);break;case"ArrowDown":O(e);break;case"p":case"k":b&&e.ctrlKey&&z(e);break;case"ArrowUp":z(e);break;case"Home":e.preventDefault(),I(0);break;case"End":e.preventDefault(),L();break;case"Enter":{e.preventDefault();let t=R();if(t){let e=new Event(wy);t.dispatchEvent(e)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:Ky},l),$y(e,e=>n.createElement(Ny.Provider,{value:C},n.createElement(Sy.Provider,{value:N},e))))}),Py=n.forwardRef((e,t)=>{var r,a;let i=Ks(),s=n.useRef(null),o=n.useContext(Ay),c=Cy(),l=By(e),d=null!=(a=null==(r=l.current)?void 0:r.forceMount)?a:null==o?void 0:o.forceMount;Wy(()=>{if(!d)return c.item(i,null==o?void 0:o.id)},[d]);let u=Hy(i,s,[e.value,e.children,s],e.keywords),p=Ey(),m=Gy(e=>e.value&&e.value===u.current),h=Gy(e=>!(!d&&!1!==c.filter())||(!e.search||e.filtered.items.get(i)>0));function f(){var e,t;g(),null==(t=(e=l.current).onSelect)||t.call(e,u.current)}function g(){p.setState("value",u.current,!0)}if(n.useEffect(()=>{let t=s.current;if(t&&!e.disabled)return t.addEventListener(wy,f),()=>t.removeEventListener(wy,f)},[h,e.onSelect,e.disabled]),!h)return null;let{disabled:b,value:v,onSelect:y,forceMount:w,keywords:x,...k}=e;return n.createElement(Qs.div,{ref:Es(s,t),...k,id:i,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!m,"data-disabled":!!b,"data-selected":!!m,onPointerMove:b||c.getDisablePointerSelection()?void 0:g,onClick:b?void 0:f},e.children)}),Ty=n.forwardRef((e,t)=>{let{heading:r,children:a,forceMount:i,...s}=e,o=Ks(),c=n.useRef(null),l=n.useRef(null),d=Ks(),u=Cy(),p=Gy(e=>!(!i&&!1!==u.filter())||(!e.search||e.filtered.groups.has(o)));Wy(()=>u.group(o),[]),Hy(o,c,[e.value,e.heading,l]);let m=n.useMemo(()=>({id:o,forceMount:i}),[i]);return n.createElement(Qs.div,{ref:Es(c,t),...s,"cmdk-group":"",role:"presentation",hidden:!p||void 0},r&&n.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:d},r),$y(e,e=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?d:void 0},n.createElement(Ay.Provider,{value:m},e))))}),Ry=n.forwardRef((e,t)=>{let{alwaysRender:r,...a}=e,i=n.useRef(null),s=Gy(e=>!e.search);return r||s?n.createElement(Qs.div,{ref:Es(i,t),...a,"cmdk-separator":"",role:"separator"}):null}),Dy=n.forwardRef((e,t)=>{let{onValueChange:r,...a}=e,i=null!=e.value,s=Ey(),o=Gy(e=>e.search),c=Gy(e=>e.selectedItemId),l=Cy();return n.useEffect(()=>{null!=e.value&&s.setState("search",e.value)},[e.value]),n.createElement(Qs.input,{ref:t,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:"text",value:i?e.value:o,onChange:e=>{i||s.setState("search",e.target.value),null==r||r(e.target.value)}})}),Iy=n.forwardRef((e,t)=>{let{children:r,label:a="Suggestions",...i}=e,s=n.useRef(null),o=n.useRef(null),c=Gy(e=>e.selectedItemId),l=Cy();return n.useEffect(()=>{if(o.current&&s.current){let e,t=o.current,r=s.current,n=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;r.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return n.observe(t),()=>{cancelAnimationFrame(e),n.unobserve(t)}}},[]),n.createElement(Qs.div,{ref:Es(s,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":a,id:l.listId},$y(e,e=>n.createElement("div",{ref:Es(o,l.listInnerRef),"cmdk-list-sizer":""},e)))}),My=n.forwardRef((e,t)=>{let{open:r,onOpenChange:a,overlayClassName:i,contentClassName:s,container:o,...c}=e;return n.createElement(rl,{open:r,onOpenChange:a},n.createElement(al,{container:o},n.createElement(il,{"cmdk-overlay":"",className:i}),n.createElement(sl,{"aria-label":e.label,"cmdk-dialog":"",className:s},n.createElement(_y,{ref:t,...c}))))}),Uy=n.forwardRef((e,t)=>Gy(e=>0===e.filtered.count)?n.createElement(Qs.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Ly=n.forwardRef((e,t)=>{let{progress:r,children:a,label:i="Loading...",...s}=e;return n.createElement(Qs.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},$y(e,e=>n.createElement("div",{"aria-hidden":!0},e)))}),Oy=Object.assign(_y,{List:Iy,Item:Py,Input:Dy,Group:Ty,Separator:Ry,Dialog:My,Empty:Uy,Loading:Ly});function zy(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function Fy(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function By(e){let t=n.useRef(e);return Wy(()=>{t.current=e}),t}var Wy="undefined"==typeof window?n.useEffect:n.useLayoutEffect;function Vy(e){let t=n.useRef();return void 0===t.current&&(t.current=e()),t}function Gy(e){let t=Ey(),r=()=>e(t.snapshot());return n.useSyncExternalStore(t.subscribe,r,r)}function Hy(e,t,r,a=[]){let i=n.useRef(),s=Cy();return Wy(()=>{var n;let o=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():i.current}})(),c=a.map(e=>e.trim());s.value(e,o,c),null==(n=t.current)||n.setAttribute(xy,o),i.current=o}),i}var jy=()=>{let[e,t]=n.useState(),r=Vy(()=>new Map);return Wy(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function $y({asChild:e,children:t},r){return e&&n.isValidElement(t)?n.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},r(t.props.children)):r(t)}var Ky={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const qy=n.forwardRef(({className:e,...r},n)=>t(Oy,{ref:n,className:Oe("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...r}));qy.displayName=Oy.displayName;const Zy=n.forwardRef(({className:r,...n},a)=>e("div",{className:"flex items-center border-b px-3","data-cmdk-input-wrapper":"",children:[t(vl,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),t(Oy.Input,{ref:a,className:Oe("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",r),...n})]}));Zy.displayName=Oy.Input.displayName;const Jy=n.forwardRef(({className:e,...r},n)=>t(Oy.List,{ref:n,className:Oe("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...r}));Jy.displayName=Oy.List.displayName;n.forwardRef((e,r)=>t(Oy.Empty,{ref:r,className:"py-6 text-center text-sm",...e})).displayName=Oy.Empty.displayName;const Yy=n.forwardRef(({className:e,...r},n)=>t(Oy.Group,{ref:n,className:Oe("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),...r}));Yy.displayName=Oy.Group.displayName;n.forwardRef(({className:e,...r},n)=>t(Oy.Separator,{ref:n,className:Oe("-mx-1 h-px bg-border",e),...r})).displayName=Oy.Separator.displayName;const Xy=n.forwardRef(({className:e,...r},n)=>t(Oy.Item,{ref:n,className:Oe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r}));Xy.displayName=Oy.Item.displayName;const Qy=["top","right","bottom","left"],ew=Math.min,tw=Math.max,rw=Math.round,nw=Math.floor,aw=e=>({x:e,y:e}),iw={left:"right",right:"left",bottom:"top",top:"bottom"},sw={start:"end",end:"start"};function ow(e,t,r){return tw(e,ew(t,r))}function cw(e,t){return"function"==typeof e?e(t):e}function lw(e){return e.split("-")[0]}function dw(e){return e.split("-")[1]}function uw(e){return"x"===e?"y":"x"}function pw(e){return"y"===e?"height":"width"}const mw=new Set(["top","bottom"]);function hw(e){return mw.has(lw(e))?"y":"x"}function fw(e){return uw(hw(e))}function gw(e){return e.replace(/start|end/g,e=>sw[e])}const bw=["left","right"],vw=["right","left"],yw=["top","bottom"],ww=["bottom","top"];function xw(e,t,r,n){const a=dw(e);let i=function(e,t,r){switch(e){case"top":case"bottom":return r?t?vw:bw:t?bw:vw;case"left":case"right":return t?yw:ww;default:return[]}}(lw(e),"start"===r,n);return a&&(i=i.map(e=>e+"-"+a),t&&(i=i.concat(i.map(gw)))),i}function kw(e){return e.replace(/left|right|bottom|top/g,e=>iw[e])}function Sw(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Cw(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function Nw(e,t,r){let{reference:n,floating:a}=e;const i=hw(t),s=fw(t),o=pw(s),c=lw(t),l="y"===i,d=n.x+n.width/2-a.width/2,u=n.y+n.height/2-a.height/2,p=n[o]/2-a[o]/2;let m;switch(c){case"top":m={x:d,y:n.y-a.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:u};break;case"left":m={x:n.x-a.width,y:u};break;default:m={x:n.x,y:n.y}}switch(dw(t)){case"start":m[s]-=p*(r&&l?-1:1);break;case"end":m[s]+=p*(r&&l?-1:1)}return m}async function Ew(e,t){var r;void 0===t&&(t={});const{x:n,y:a,platform:i,rects:s,elements:o,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:m=0}=cw(t,e),h=Sw(m),f=o[p?"floating"===u?"reference":"floating":u],g=Cw(await i.getClippingRect({element:null==(r=await(null==i.isElement?void 0:i.isElement(f)))||r?f:f.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(o.floating)),boundary:l,rootBoundary:d,strategy:c})),b="floating"===u?{x:n,y:a,width:s.floating.width,height:s.floating.height}:s.reference,v=await(null==i.getOffsetParent?void 0:i.getOffsetParent(o.floating)),y=await(null==i.isElement?void 0:i.isElement(v))&&await(null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},w=Cw(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:b,offsetParent:v,strategy:c}):b);return{top:(g.top-w.top+h.top)/y.y,bottom:(w.bottom-g.bottom+h.bottom)/y.y,left:(g.left-w.left+h.left)/y.x,right:(w.right-g.right+h.right)/y.x}}function Aw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _w(e){return Qy.some(t=>e[t]>=0)}const Pw=new Set(["left","top"]);function Tw(){return"undefined"!=typeof window}function Rw(e){return Mw(e)?(e.nodeName||"").toLowerCase():"#document"}function Dw(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Iw(e){var t;return null==(t=(Mw(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Mw(e){return!!Tw()&&(e instanceof Node||e instanceof Dw(e).Node)}function Uw(e){return!!Tw()&&(e instanceof Element||e instanceof Dw(e).Element)}function Lw(e){return!!Tw()&&(e instanceof HTMLElement||e instanceof Dw(e).HTMLElement)}function Ow(e){return!(!Tw()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Dw(e).ShadowRoot)}const zw=new Set(["inline","contents"]);function Fw(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=Yw(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!zw.has(a)}const Bw=new Set(["table","td","th"]);function Ww(e){return Bw.has(Rw(e))}const Vw=[":popover-open",":modal"];function Gw(e){return Vw.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Hw=["transform","translate","scale","rotate","perspective"],jw=["transform","translate","scale","rotate","perspective","filter"],$w=["paint","layout","strict","content"];function Kw(e){const t=qw(),r=Uw(e)?Yw(e):e;return Hw.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||jw.some(e=>(r.willChange||"").includes(e))||$w.some(e=>(r.contain||"").includes(e))}function qw(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Zw=new Set(["html","body","#document"]);function Jw(e){return Zw.has(Rw(e))}function Yw(e){return Dw(e).getComputedStyle(e)}function Xw(e){return Uw(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Qw(e){if("html"===Rw(e))return e;const t=e.assignedSlot||e.parentNode||Ow(e)&&e.host||Iw(e);return Ow(t)?t.host:t}function ex(e){const t=Qw(e);return Jw(t)?e.ownerDocument?e.ownerDocument.body:e.body:Lw(t)&&Fw(t)?t:ex(t)}function tx(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const a=ex(e),i=a===(null==(n=e.ownerDocument)?void 0:n.body),s=Dw(a);if(i){const e=rx(s);return t.concat(s,s.visualViewport||[],Fw(a)?a:[],e&&r?tx(e):[])}return t.concat(a,tx(a,[],r))}function rx(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nx(e){const t=Yw(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=Lw(e),i=a?e.offsetWidth:r,s=a?e.offsetHeight:n,o=rw(r)!==i||rw(n)!==s;return o&&(r=i,n=s),{width:r,height:n,$:o}}function ax(e){return Uw(e)?e:e.contextElement}function ix(e){const t=ax(e);if(!Lw(t))return aw(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:i}=nx(t);let s=(i?rw(r.width):r.width)/n,o=(i?rw(r.height):r.height)/a;return s&&Number.isFinite(s)||(s=1),o&&Number.isFinite(o)||(o=1),{x:s,y:o}}const sx=aw(0);function ox(e){const t=Dw(e);return qw()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:sx}function cx(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const a=e.getBoundingClientRect(),i=ax(e);let s=aw(1);t&&(n?Uw(n)&&(s=ix(n)):s=ix(e));const o=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==Dw(e))&&t}(i,r,n)?ox(i):aw(0);let c=(a.left+o.x)/s.x,l=(a.top+o.y)/s.y,d=a.width/s.x,u=a.height/s.y;if(i){const e=Dw(i),t=n&&Uw(n)?Dw(n):n;let r=e,a=rx(r);for(;a&&n&&t!==r;){const e=ix(a),t=a.getBoundingClientRect(),n=Yw(a),i=t.left+(a.clientLeft+parseFloat(n.paddingLeft))*e.x,s=t.top+(a.clientTop+parseFloat(n.paddingTop))*e.y;c*=e.x,l*=e.y,d*=e.x,u*=e.y,c+=i,l+=s,r=Dw(a),a=rx(r)}}return Cw({width:d,height:u,x:c,y:l})}function lx(e,t){const r=Xw(e).scrollLeft;return t?t.left+r:cx(Iw(e)).left+r}function dx(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-lx(e,r),y:r.top+t.scrollTop}}const ux=new Set(["absolute","fixed"]);function px(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=Dw(e),n=Iw(e),a=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,o=0,c=0;if(a){i=a.width,s=a.height;const e=qw();(!e||e&&"fixed"===t)&&(o=a.offsetLeft,c=a.offsetTop)}const l=lx(n);if(l<=0){const e=n.ownerDocument,t=e.body,r=getComputedStyle(t),a="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,s=Math.abs(n.clientWidth-t.clientWidth-a);s<=25&&(i-=s)}else l<=25&&(i+=l);return{width:i,height:s,x:o,y:c}}(e,r);else if("document"===t)n=function(e){const t=Iw(e),r=Xw(e),n=e.ownerDocument.body,a=tw(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=tw(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+lx(e);const o=-r.scrollTop;return"rtl"===Yw(n).direction&&(s+=tw(t.clientWidth,n.clientWidth)-a),{width:a,height:i,x:s,y:o}}(Iw(e));else if(Uw(t))n=function(e,t){const r=cx(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,i=Lw(e)?ix(e):aw(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:a*i.x,y:n*i.y}}(t,r);else{const r=ox(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Cw(n)}function mx(e,t){const r=Qw(e);return!(r===t||!Uw(r)||Jw(r))&&("fixed"===Yw(r).position||mx(r,t))}function hx(e,t,r){const n=Lw(t),a=Iw(t),i="fixed"===r,s=cx(e,!0,i,t);let o={scrollLeft:0,scrollTop:0};const c=aw(0);function l(){c.x=lx(a)}if(n||!n&&!i)if(("body"!==Rw(t)||Fw(a))&&(o=Xw(t)),n){const e=cx(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else a&&l();i&&!n&&a&&l();const d=!a||n||i?aw(0):dx(a,o);return{x:s.left+o.scrollLeft-c.x-d.x,y:s.top+o.scrollTop-c.y-d.y,width:s.width,height:s.height}}function fx(e){return"static"===Yw(e).position}function gx(e,t){if(!Lw(e)||"fixed"===Yw(e).position)return null;if(t)return t(e);let r=e.offsetParent;return Iw(e)===r&&(r=r.ownerDocument.body),r}function bx(e,t){const r=Dw(e);if(Gw(e))return r;if(!Lw(e)){let t=Qw(e);for(;t&&!Jw(t);){if(Uw(t)&&!fx(t))return t;t=Qw(t)}return r}let n=gx(e,t);for(;n&&Ww(n)&&fx(n);)n=gx(n,t);return n&&Jw(n)&&fx(n)&&!Kw(n)?r:n||function(e){let t=Qw(e);for(;Lw(t)&&!Jw(t);){if(Kw(t))return t;if(Gw(t))return null;t=Qw(t)}return null}(e)||r}const vx={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const i="fixed"===a,s=Iw(n),o=!!t&&Gw(t.floating);if(n===s||o&&i)return r;let c={scrollLeft:0,scrollTop:0},l=aw(1);const d=aw(0),u=Lw(n);if((u||!u&&!i)&&(("body"!==Rw(n)||Fw(s))&&(c=Xw(n)),Lw(n))){const e=cx(n);l=ix(n),d.x=e.x+n.clientLeft,d.y=e.y+n.clientTop}const p=!s||u||i?aw(0):dx(s,c);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+d.x+p.x,y:r.y*l.y-c.scrollTop*l.y+d.y+p.y}},getDocumentElement:Iw,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const i=[..."clippingAncestors"===r?Gw(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=tx(e,[],!1).filter(e=>Uw(e)&&"body"!==Rw(e)),a=null;const i="fixed"===Yw(e).position;let s=i?Qw(e):e;for(;Uw(s)&&!Jw(s);){const t=Yw(s),r=Kw(s);r||"fixed"!==t.position||(a=null),(i?!r&&!a:!r&&"static"===t.position&&a&&ux.has(a.position)||Fw(s)&&!r&&mx(e,s))?n=n.filter(e=>e!==s):a=t,s=Qw(s)}return t.set(e,n),n}(t,this._c):[].concat(r),n],s=i[0],o=i.reduce((e,r)=>{const n=px(t,r,a);return e.top=tw(n.top,e.top),e.right=ew(n.right,e.right),e.bottom=ew(n.bottom,e.bottom),e.left=tw(n.left,e.left),e},px(t,s,a));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:bx,getElementRects:async function(e){const t=this.getOffsetParent||bx,r=this.getDimensions,n=await r(e.floating);return{reference:hx(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=nx(e);return{width:t,height:r}},getScale:ix,isElement:Uw,isRTL:function(e){return"rtl"===Yw(e).direction}};function yx(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function wx(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:o="function"==typeof IntersectionObserver,animationFrame:c=!1}=n,l=ax(e),d=a||i?[...l?tx(l):[],...tx(t)]:[];d.forEach(e=>{a&&e.addEventListener("scroll",r,{passive:!0}),i&&e.addEventListener("resize",r)});const u=l&&o?function(e,t){let r,n=null;const a=Iw(e);function i(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function s(o,c){void 0===o&&(o=!1),void 0===c&&(c=1),i();const l=e.getBoundingClientRect(),{left:d,top:u,width:p,height:m}=l;if(o||t(),!p||!m)return;const h={rootMargin:-nw(u)+"px "+-nw(a.clientWidth-(d+p))+"px "+-nw(a.clientHeight-(u+m))+"px "+-nw(d)+"px",threshold:tw(0,ew(1,c))||1};let f=!0;function g(t){const n=t[0].intersectionRatio;if(n!==c){if(!f)return s();n?s(!1,n):r=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==n||yx(l,e.getBoundingClientRect())||s(),f=!1}try{n=new IntersectionObserver(g,{...h,root:a.ownerDocument})}catch(e){n=new IntersectionObserver(g,h)}n.observe(e)}(!0),i}(l,r):null;let p,m=-1,h=null;s&&(h=new ResizeObserver(e=>{let[n]=e;n&&n.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),r()}),l&&!c&&h.observe(l),h.observe(t));let f=c?cx(e):null;return c&&function t(){const n=cx(e);f&&!yx(f,n)&&r();f=n,p=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{a&&e.removeEventListener("scroll",r),i&&e.removeEventListener("resize",r)}),null==u||u(),null==(e=h)||e.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const xx=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:i,placement:s,middlewareData:o}=t,c=await async function(e,t){const{placement:r,platform:n,elements:a}=e,i=await(null==n.isRTL?void 0:n.isRTL(a.floating)),s=lw(r),o=dw(r),c="y"===hw(r),l=Pw.has(s)?-1:1,d=i&&c?-1:1,u=cw(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:h}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return o&&"number"==typeof h&&(m="end"===o?-1*h:h),c?{x:m*d,y:p*l}:{x:p*l,y:m*d}}(t,e);return s===(null==(r=o.offset)?void 0:r.placement)&&null!=(n=o.arrow)&&n.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:s}}}}},kx=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a,platform:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:c={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=cw(e,t),d={x:r,y:n},u=await i.detectOverflow(t,l),p=hw(lw(a)),m=uw(p);let h=d[m],f=d[p];if(s){const e="y"===m?"bottom":"right";h=ow(h+u["y"===m?"top":"left"],h,h-u[e])}if(o){const e="y"===p?"bottom":"right";f=ow(f+u["y"===p?"top":"left"],f,f-u[e])}const g=c.fn({...t,[m]:h,[p]:f});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[m]:s,[p]:o}}}}}},Sx=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:i,rects:s,initialPlacement:o,platform:c,elements:l}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:f=!0,...g}=cw(e,t);if(null!=(r=i.arrow)&&r.alignmentOffset)return{};const b=lw(a),v=hw(o),y=lw(o)===o,w=await(null==c.isRTL?void 0:c.isRTL(l.floating)),x=p||(y||!f?[kw(o)]:function(e){const t=kw(e);return[gw(e),t,gw(t)]}(o)),k="none"!==h;!p&&k&&x.push(...xw(o,f,h,w));const S=[o,...x],C=await c.detectOverflow(t,g),N=[];let E=(null==(n=i.flip)?void 0:n.overflows)||[];if(d&&N.push(C[b]),u){const e=function(e,t,r){void 0===r&&(r=!1);const n=dw(e),a=fw(e),i=pw(a);let s="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=kw(s)),[s,kw(s)]}(a,s,w);N.push(C[e[0]],C[e[1]])}if(E=[...E,{placement:a,overflows:N}],!N.every(e=>e<=0)){var A,_;const e=((null==(A=i.flip)?void 0:A.index)||0)+1,t=S[e];if(t){if(!("alignment"===u&&v!==hw(t))||E.every(e=>hw(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:E},reset:{placement:t}}}let r=null==(_=E.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:_.placement;if(!r)switch(m){case"bestFit":{var P;const e=null==(P=E.filter(e=>{if(k){const t=hw(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:P[0];e&&(r=e);break}case"initialPlacement":r=o}if(a!==r)return{reset:{placement:r}}}return{}}}},Cx=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:i,platform:s,elements:o}=t,{apply:c=()=>{},...l}=cw(e,t),d=await s.detectOverflow(t,l),u=lw(a),p=dw(a),m="y"===hw(a),{width:h,height:f}=i.floating;let g,b;"top"===u||"bottom"===u?(g=u,b=p===(await(null==s.isRTL?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(b=u,g="end"===p?"top":"bottom");const v=f-d.top-d.bottom,y=h-d.left-d.right,w=ew(f-d[g],v),x=ew(h-d[b],y),k=!t.middlewareData.shift;let S=w,C=x;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(C=y),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(S=v),k&&!p){const e=tw(d.left,0),t=tw(d.right,0),r=tw(d.top,0),n=tw(d.bottom,0);m?C=h-2*(0!==e||0!==t?e+t:tw(d.left,d.right)):S=f-2*(0!==r||0!==n?r+n:tw(d.top,d.bottom))}await c({...t,availableWidth:C,availableHeight:S});const N=await s.getDimensions(o.floating);return h!==N.width||f!==N.height?{reset:{rects:!0}}:{}}}},Nx=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:a="referenceHidden",...i}=cw(e,t);switch(a){case"referenceHidden":{const e=Aw(await n.detectOverflow(t,{...i,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:_w(e)}}}case"escaped":{const e=Aw(await n.detectOverflow(t,{...i,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:_w(e)}}}default:return{}}}}},Ex=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:i,platform:s,elements:o,middlewareData:c}=t,{element:l,padding:d=0}=cw(e,t)||{};if(null==l)return{};const u=Sw(d),p={x:r,y:n},m=fw(a),h=pw(m),f=await s.getDimensions(l),g="y"===m,b=g?"top":"left",v=g?"bottom":"right",y=g?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[m]-p[m]-i.floating[h],x=p[m]-i.reference[m],k=await(null==s.getOffsetParent?void 0:s.getOffsetParent(l));let S=k?k[y]:0;S&&await(null==s.isElement?void 0:s.isElement(k))||(S=o.floating[y]||i.floating[h]);const C=w/2-x/2,N=S/2-f[h]/2-1,E=ew(u[b],N),A=ew(u[v],N),_=E,P=S-f[h]-A,T=S/2-f[h]/2+C,R=ow(_,T,P),D=!c.arrow&&null!=dw(a)&&T!==R&&i.reference[h]/2-(T<_?E:A)-f[h]/2<0,I=D?T<_?T-_:T-P:0;return{[m]:p[m]+I,data:{[m]:R,centerOffset:T-R-I,...D&&{alignmentOffset:I}},reset:D}}}),Ax=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:i,middlewareData:s}=t,{offset:o=0,mainAxis:c=!0,crossAxis:l=!0}=cw(e,t),d={x:r,y:n},u=hw(a),p=uw(u);let m=d[p],h=d[u];const f=cw(o,t),g="number"==typeof f?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+g.mainAxis,r=i.reference[p]+i.reference[e]-g.mainAxis;m<t?m=t:m>r&&(m=r)}if(l){var b,v;const e="y"===p?"width":"height",t=Pw.has(lw(a)),r=i.reference[u]-i.floating[e]+(t&&(null==(b=s.offset)?void 0:b[u])||0)+(t?0:g.crossAxis),n=i.reference[u]+i.reference[e]+(t?0:(null==(v=s.offset)?void 0:v[u])||0)-(t?g.crossAxis:0);h<r?h=r:h>n&&(h=n)}return{[p]:m,[u]:h}}}},_x=(e,t,r)=>{const n=new Map,a={platform:vx,...r},i={...a.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:s}=r,o=i.filter(Boolean),c=await(null==s.isRTL?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:u}=Nw(l,n,c),p=n,m={},h=0;for(let r=0;r<o.length;r++){var f;const{name:i,fn:g}=o[r],{x:b,y:v,data:y,reset:w}=await g({x:d,y:u,initialPlacement:n,placement:p,strategy:a,middlewareData:m,rects:l,platform:{...s,detectOverflow:null!=(f=s.detectOverflow)?f:Ew},elements:{reference:e,floating:t}});d=null!=b?b:d,u=null!=v?v:u,m={...m,[i]:{...m[i],...y}},w&&h<=50&&(h++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(l=!0===w.rects?await s.getElementRects({reference:e,floating:t,strategy:a}):w.rects),({x:d,y:u}=Nw(l,p,c))),r=-1)}return{x:d,y:u,placement:p,strategy:a,middlewareData:m}})(e,t,{...a,platform:i})};var Px="undefined"!=typeof document?g:function(){};function Tx(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,a;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!==n--;)if(!Tx(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;0!==n--;){const r=a[n];if(("_owner"!==r||!e.$$typeof)&&!Tx(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function Rx(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Dx(e,t){const r=Rx(e);return Math.round(t*r)/r}function Ix(e){const t=n.useRef(e);return Px(()=>{t.current=e}),t}const Mx=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&(a=r,{}.hasOwnProperty.call(a,"current"))?null!=r.current?Ex({element:r.current,padding:n}).fn(t):{}:r?Ex({element:r,padding:n}).fn(t):{};var a}}),Ux=(e,t)=>({...xx(e),options:[e,t]}),Lx=(e,t)=>({...kx(e),options:[e,t]}),Ox=(e,t)=>({...Ax(e),options:[e,t]}),zx=(e,t)=>({...Sx(e),options:[e,t]}),Fx=(e,t)=>({...Cx(e),options:[e,t]}),Bx=(e,t)=>({...Nx(e),options:[e,t]}),Wx=(e,t)=>({...Mx(e),options:[e,t]});var Vx=n.forwardRef((e,r)=>{const{children:n,width:a=10,height:i=5,...s}=e;return t(Qs.svg,{...s,ref:r,width:a,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:t("polygon",{points:"0,0 30,0 15,10"})})});Vx.displayName="Arrow";var Gx=Vx,Hx="Popper",[jx,$x]=Vs(Hx),[Kx,qx]=jx(Hx),Zx=e=>{const{__scopePopper:r,children:a}=e,[i,s]=n.useState(null);return t(Kx,{scope:r,anchor:i,onAnchorChange:s,children:a})};Zx.displayName=Hx;var Jx="PopperAnchor",Yx=n.forwardRef((e,r)=>{const{__scopePopper:a,virtualRef:i,...s}=e,o=qx(Jx,a),c=n.useRef(null),l=As(r,c),d=n.useRef(null);return n.useEffect(()=>{const e=d.current;d.current=i?.current||c.current,e!==d.current&&o.onAnchorChange(d.current)}),i?null:t(Qs.div,{...s,ref:l})});Yx.displayName=Jx;var Xx="PopperContent",[Qx,ek]=jx(Xx),tk=n.forwardRef((e,r)=>{const{__scopePopper:a,side:i="bottom",sideOffset:s=0,align:o="center",alignOffset:c=0,arrowPadding:l=0,avoidCollisions:d=!0,collisionBoundary:u=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:h=!1,updatePositionStrategy:f="optimized",onPlaced:g,...b}=e,v=qx(Xx,a),[w,x]=n.useState(null),k=As(r,e=>x(e)),[S,C]=n.useState(null),N=Vd(S),E=N?.width??0,A=N?.height??0,_=i+("center"!==o?"-"+o:""),P="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},T=Array.isArray(u)?u:[u],R=T.length>0,D={padding:P,boundary:T.filter(ik),altBoundary:R},{refs:I,floatingStyles:M,placement:U,isPositioned:L,middlewareData:O}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:a=[],platform:i,elements:{reference:s,floating:o}={},transform:c=!0,whileElementsMounted:l,open:d}=e,[u,p]=n.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=n.useState(a);Tx(m,a)||h(a);const[f,g]=n.useState(null),[b,v]=n.useState(null),w=n.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),x=n.useCallback(e=>{e!==N.current&&(N.current=e,v(e))},[]),k=s||f,S=o||b,C=n.useRef(null),N=n.useRef(null),E=n.useRef(u),A=null!=l,_=Ix(l),P=Ix(i),T=Ix(d),R=n.useCallback(()=>{if(!C.current||!N.current)return;const e={placement:t,strategy:r,middleware:m};P.current&&(e.platform=P.current),_x(C.current,N.current,e).then(e=>{const t={...e,isPositioned:!1!==T.current};D.current&&!Tx(E.current,t)&&(E.current=t,y.flushSync(()=>{p(t)}))})},[m,t,r,P,T]);Px(()=>{!1===d&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);const D=n.useRef(!1);Px(()=>(D.current=!0,()=>{D.current=!1}),[]),Px(()=>{if(k&&(C.current=k),S&&(N.current=S),k&&S){if(_.current)return _.current(k,S,R);R()}},[k,S,R,_,A]);const I=n.useMemo(()=>({reference:C,floating:N,setReference:w,setFloating:x}),[w,x]),M=n.useMemo(()=>({reference:k,floating:S}),[k,S]),U=n.useMemo(()=>{const e={position:r,left:0,top:0};if(!M.floating)return e;const t=Dx(M.floating,u.x),n=Dx(M.floating,u.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...Rx(M.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,c,M.floating,u.x,u.y]);return n.useMemo(()=>({...u,update:R,refs:I,elements:M,floatingStyles:U}),[u,R,I,M,U])}({strategy:"fixed",placement:_,whileElementsMounted:(...e)=>wx(...e,{animationFrame:"always"===f}),elements:{reference:v.anchor},middleware:[Ux({mainAxis:s+A,alignmentAxis:c}),d&&Lx({mainAxis:!0,crossAxis:!1,limiter:"partial"===m?Ox():void 0,...D}),d&&zx({...D}),Fx({...D,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:a,height:i}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${r}px`),s.setProperty("--radix-popper-available-height",`${n}px`),s.setProperty("--radix-popper-anchor-width",`${a}px`),s.setProperty("--radix-popper-anchor-height",`${i}px`)}}),S&&Wx({element:S,padding:l}),sk({arrowWidth:E,arrowHeight:A}),h&&Bx({strategy:"referenceHidden",...D})]}),[z,F]=ok(U),B=eo(g);Hs(()=>{L&&B?.()},[L,B]);const W=O.arrow?.x,V=O.arrow?.y,G=0!==O.arrow?.centerOffset,[H,j]=n.useState();return Hs(()=>{w&&j(window.getComputedStyle(w).zIndex)},[w]),t("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:L?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[O.transformOrigin?.x,O.transformOrigin?.y].join(" "),...O.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t(Qx,{scope:a,placedSide:z,onArrowChange:C,arrowX:W,arrowY:V,shouldHideArrow:G,children:t(Qs.div,{"data-side":z,"data-align":F,...b,ref:k,style:{...b.style,animation:L?void 0:"none"}})})})});tk.displayName=Xx;var rk="PopperArrow",nk={top:"bottom",right:"left",bottom:"top",left:"right"},ak=n.forwardRef(function(e,r){const{__scopePopper:n,...a}=e,i=ek(rk,n),s=nk[i.placedSide];return t("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:t(Gx,{...a,ref:r,style:{...a.style,display:"block"}})})});function ik(e){return null!==e}ak.displayName=rk;var sk=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:a}=t,i=0!==a.arrow?.centerOffset,s=i?0:e.arrowWidth,o=i?0:e.arrowHeight,[c,l]=ok(r),d={start:"0%",center:"50%",end:"100%"}[l],u=(a.arrow?.x??0)+s/2,p=(a.arrow?.y??0)+o/2;let m="",h="";return"bottom"===c?(m=i?d:`${u}px`,h=-o+"px"):"top"===c?(m=i?d:`${u}px`,h=`${n.floating.height+o}px`):"right"===c?(m=-o+"px",h=i?d:`${p}px`):"left"===c&&(m=`${n.floating.width+o}px`,h=i?d:`${p}px`),{data:{x:m,y:h}}}});function ok(e){const[t,r="center"]=e.split("-");return[t,r]}var ck=Zx,lk=Yx,dk=tk,uk=ak;function pk(e){const t=n.forwardRef((e,t)=>{const{children:r,...a}=e;if(n.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),i=function(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{const t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}(a,r.props);return r.type!==n.Fragment&&(i.ref=t?Es(t,e):e),n.cloneElement(r,i)}return n.Children.count(r)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mk=Symbol("radix.slottable");function hk(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===mk}var fk="Popover",[gk]=Vs(fk,[$x]),bk=$x(),[vk,yk]=gk(fk),wk=e=>{const{__scopePopover:r,children:a,open:i,defaultOpen:s,onOpenChange:o,modal:c=!1}=e,l=bk(r),d=n.useRef(null),[u,p]=n.useState(!1),[m,h]=Zs({prop:i,defaultProp:s??!1,onChange:o,caller:fk});return t(ck,{...l,children:t(vk,{scope:r,contentId:Ks(),triggerRef:d,open:m,onOpenChange:h,onOpenToggle:n.useCallback(()=>h(e=>!e),[h]),hasCustomAnchor:u,onCustomAnchorAdd:n.useCallback(()=>p(!0),[]),onCustomAnchorRemove:n.useCallback(()=>p(!1),[]),modal:c,children:a})})};wk.displayName=fk;var xk="PopoverAnchor";n.forwardRef((e,r)=>{const{__scopePopover:a,...i}=e,s=yk(xk,a),o=bk(a),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=s;return n.useEffect(()=>(c(),()=>l()),[c,l]),t(lk,{...o,...i,ref:r})}).displayName=xk;var kk="PopoverTrigger",Sk=n.forwardRef((e,r)=>{const{__scopePopover:n,...a}=e,i=yk(kk,n),s=bk(n),o=As(r,i.triggerRef),c=t(Qs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Uk(i.open),...a,ref:o,onClick:Ws(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?c:t(lk,{asChild:!0,...s,children:c})});Sk.displayName=kk;var Ck="PopoverPortal",[Nk,Ek]=gk(Ck,{forceMount:void 0}),Ak=e=>{const{__scopePopover:r,forceMount:n,children:a,container:i}=e,s=yk(Ck,r);return t(Nk,{scope:r,forceMount:n,children:t(xo,{present:n||s.open,children:t(wo,{asChild:!0,container:i,children:a})})})};Ak.displayName=Ck;var _k="PopoverContent",Pk=n.forwardRef((e,r)=>{const n=Ek(_k,e.__scopePopover),{forceMount:a=n.forceMount,...i}=e,s=yk(_k,e.__scopePopover);return t(xo,{present:a||s.open,children:s.modal?t(Rk,{...i,ref:r}):t(Dk,{...i,ref:r})})});Pk.displayName=_k;var Tk=function(e){const r=pk(e),a=n.forwardRef((e,a)=>{const{children:i,...s}=e,o=n.Children.toArray(i),c=o.find(hk);if(c){const e=c.props.children,i=o.map(t=>t===c?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t);return t(r,{...s,ref:a,children:n.isValidElement(e)?n.cloneElement(e,void 0,i):null})}return t(r,{...s,ref:a,children:i})});return a.displayName=`${e}.Slot`,a}("PopoverContent.RemoveScroll"),Rk=n.forwardRef((e,r)=>{const a=yk(_k,e.__scopePopover),i=n.useRef(null),s=As(r,i),o=n.useRef(!1);return n.useEffect(()=>{const e=i.current;if(e)return yc(e)},[]),t(pc,{as:Tk,allowPinchZoom:!0,children:t(Ik,{...e,ref:s,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ws(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||a.triggerRef.current?.focus()}),onPointerDownOutside:Ws(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;o.current=n},{checkForDefaultPrevented:!1}),onFocusOutside:Ws(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Dk=n.forwardRef((e,r)=>{const a=yk(_k,e.__scopePopover),i=n.useRef(!1),s=n.useRef(!1);return t(Ik,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||a.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));const r=t.target,n=a.triggerRef.current?.contains(r);n&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})}),Ik=n.forwardRef((e,r)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:u,...p}=e,m=yk(_k,n),h=bk(n);return Co(),t(mo,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:s,children:t(so,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:t(dk,{"data-state":Uk(m.open),role:"dialog",id:m.contentId,...h,...p,ref:r,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Mk="PopoverClose";n.forwardRef((e,r)=>{const{__scopePopover:n,...a}=e,i=yk(Mk,n);return t(Qs.button,{type:"button",...a,ref:r,onClick:Ws(e.onClick,()=>i.onOpenChange(!1))})}).displayName=Mk;function Uk(e){return e?"open":"closed"}n.forwardRef((e,r)=>{const{__scopePopover:n,...a}=e,i=bk(n);return t(uk,{...i,...a,ref:r})}).displayName="PopoverArrow";var Lk=Ak,Ok=Pk;const zk=wk,Fk=Sk,Bk=n.forwardRef(({className:e,align:r="center",sideOffset:a=4,...i},s)=>{const{container:o}=n.useContext(yl);return t(Lk,{container:o,children:t(Ok,{ref:s,align:r,sideOffset:a,className:Oe("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),...i})})});function Wk({options:r,value:n,onChange:a,placeholder:i="Search...",emptyLabel:s="Choose option"}){const[o,c]=m(n??""),[l,d]=m(!1);u(()=>{void 0!==n&&c(n)},[n]);const p=r.find(e=>e.value===o);return e(zk,{open:l,onOpenChange:d,children:[t(Fk,{asChild:!0,children:e(Bs,{variant:"outline",role:"combobox","aria-expanded":l,className:"justify-between overflow-hidden text-ellipsis",children:[p?e("div",{children:[String(p.label).trim(),p.icon&&t("span",{className:"ms-2 text-xs text-muted-foreground",children:p.icon})]}):t("span",{className:"text-muted-foreground",children:s}),t(Qi,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),t(Bk,{className:"p-0 overflow-hidden text-ellipsis",children:e(qy,{children:[t(Zy,{placeholder:i}),t(Jy,{children:t(Yy,{children:r.map(r=>e(Xy,{className:Oe("whitespace-nowrap text-start",{"text-green-500":o===r.value}),value:r.value,defaultValue:r.value,onSelect:()=>{return e=r.value,c(e),a?.(e),void d(!1);var e},children:[o===r.value&&t(Xi,{className:Oe("me-2 h-4 w-4 text-green-400",o===r.value?"opacity-100":"opacity-0")}),String(r.label).trim(),r.icon&&t("span",{className:"ms-2 text-xs text-muted-foreground",children:r.icon})]},r.value))})})]})})]})}Bk.displayName=Ok.displayName;const Vk={USD:"$",EUR:"€",JPY:"¥",GBP:"£",AUD:"A$",CAD:"C$",CHF:"CHF",CNY:"¥",SEK:"kr",NZD:"NZ$",INR:"₹",RUB:"₽",KRW:"₩",BRL:"R$",ZAR:"R",HKD:"HK$",SGD:"S$",MXN:"Mex$",NOK:"kr",TRY:"₺",IDR:"Rp",PLN:"zł",THB:"฿",ILS:"₪",PHP:"₱",MYR:"RM",CZK:"Kč",HUF:"Ft",DKK:"kr",PKR:"₨",EGP:"£",NGN:"₦",BDT:"৳",UAH:"₴",KZT:"₸",VND:"₫",ARS:"$",BGN:"лв",COP:"COL$",HRK:"kn",ISK:"kr",KES:"KSh",LKR:"Rs",MAD:"د.م.",MNT:"₮",NPR:"रू",RSD:"дин.",SAR:"ر.س",TWD:"NT$",UYU:"$U",YER:"﷼",FJD:"FJ$",JMD:"J$",HTG:"G",BHD:"ب.د",KWD:"د.ك",OMR:"ر.ع.",BND:"B$",KPW:"₩",GHS:"₵",SYP:"ل.س",SLL:"Le",SSP:"£",AFN:"؋",MGA:"Ar",MDL:"lei",FOK:"kr",GMD:"D",LTL:"Lt",LVL:"Ls",HNL:"L",GEL:"₾",BMD:"$",AWG:"Afl",BTN:"Nu",GTQ:"Q",TZS:"TSh",BBD:"Bds$",NAD:"N$",BZD:"$",JEP:"£",WST:"T",PGK:"K",KGS:"лв",AZN:"₼",QAR:"ر.ق",XOF:"CFA",XPF:"CFP"},Gk={AF:"AFN",AX:"EUR",AL:"ALL",DZ:"DZD",AS:"USD",AD:"EUR",AO:"AOA",AI:"XCD",AQ:"USD",AG:"XCD",AR:"ARS",AM:"AMD",AW:"AWG",AU:"AUD",AT:"EUR",AZ:"AZN",BS:"BSD",BH:"BHD",BD:"BDT",BB:"BBD",BY:"BYN",BE:"EUR",BZ:"BZD",BJ:"XOF",BM:"BMD",BT:"BTN",BO:"BOB",BA:"BAM",BW:"BWP",BV:"NOK",BR:"BRL",IO:"USD",BN:"BND",BG:"BGN",BF:"XOF",BI:"BIF",KH:"KHR",CM:"XAF",CA:"CAD",CV:"CVE",KY:"KYD",CF:"XAF",TD:"XAF",CL:"CLP",CN:"CNY",CX:"AUD",CC:"AUD",CO:"COP",KM:"KMF",CG:"XAF",CD:"CDF",CK:"NZD",CR:"CRC",CI:"XOF",HR:"HRK",CU:"CUP",CY:"EUR",CZ:"CZK",DK:"DKK",DJ:"DJF",DM:"XCD",DO:"DOP",EC:"USD",EG:"EGP",SV:"USD",GQ:"XAF",ER:"ERN",EE:"EUR",ET:"ETB",FK:"FKP",FO:"DKK",FJ:"FJD",FI:"EUR",FR:"EUR",GF:"EUR",PF:"XPF",TF:"EUR",GA:"XAF",GM:"GMD",GE:"GEL",DE:"EUR",GH:"GHS",GI:"GIP",GR:"EUR",GL:"DKK",GD:"XCD",GP:"EUR",GU:"USD",GT:"GTQ",GG:"GBP",GN:"GNF",GW:"XOF",GY:"GYD",HT:"HTG",HM:"AUD",VA:"EUR",HN:"HNL",HK:"HKD",HU:"HUF",IS:"ISK",IN:"INR",ID:"IDR",IR:"IRR",IQ:"IQD",IE:"EUR",IM:"GBP",IL:"ILS",IT:"EUR",JM:"JMD",JP:"JPY",JE:"GBP",JO:"JOD",KZ:"KZT",KE:"KES",KI:"AUD",KP:"KPW",KR:"KRW",KW:"KWD",KG:"KGS",LA:"LAK",LV:"EUR",LB:"LBP",LS:"LSL",LR:"LRD",LY:"LYD",LI:"CHF",LT:"EUR",LU:"EUR",MO:"MOP",MK:"MKD",MG:"MGA",MW:"MWK",MY:"MYR",MV:"MVR",ML:"XOF",MT:"EUR",MH:"USD",MQ:"EUR",MR:"MRU",MU:"MUR",YT:"EUR",MX:"MXN",FM:"USD",MD:"MDL",MC:"EUR",MN:"MNT",ME:"EUR",MS:"XCD",MA:"MAD",MZ:"MZN",MM:"MMK",NA:"NAD",NR:"AUD",NP:"NPR",NL:"EUR",AN:"ANG",NC:"XPF",NZ:"NZD",NI:"NIO",NE:"XOF",NG:"NGN",NU:"NZD",NF:"AUD",MP:"USD",NO:"NOK",OM:"OMR",PK:"PKR",PW:"USD",PS:"ILS",PA:"PAB",PG:"PGK",PY:"PYG",PE:"PEN",PH:"PHP",PN:"NZD",PL:"PLN",PT:"EUR",PR:"USD",QA:"QAR",RE:"EUR",RO:"RON",RU:"RUB",RW:"RWF",SH:"SHP",KN:"XCD",LC:"XCD",PM:"EUR",VC:"XCD",WS:"WST",SM:"EUR",ST:"STN",SA:"SAR",SN:"XOF",RS:"RSD",SC:"SCR",SL:"SLL",SG:"SGD",SK:"EUR",SI:"EUR",SB:"SBD",SO:"SOS",ZA:"ZAR",GS:"GBP",ES:"EUR",LK:"LKR",SD:"SDG",SR:"SRD",SJ:"NOK",SZ:"SZL",SE:"SEK",CH:"CHF",SY:"SYP",TW:"TWD",TJ:"TJS",TZ:"TZS",TH:"THB"},Hk=[{name:"Afghanistan",code:"AF"},{name:"land Islands",code:"AX"},{name:"Albania",code:"AL"},{name:"Algeria",code:"DZ"},{name:"American Samoa",code:"AS"},{name:"AndorrA",code:"AD"},{name:"Angola",code:"AO"},{name:"Anguilla",code:"AI"},{name:"Antarctica",code:"AQ"},{name:"Antigua and Barbuda",code:"AG"},{name:"Argentina",code:"AR"},{name:"Armenia",code:"AM"},{name:"Aruba",code:"AW"},{name:"Australia",code:"AU"},{name:"Austria",code:"AT"},{name:"Azerbaijan",code:"AZ"},{name:"Bahamas",code:"BS"},{name:"Bahrain",code:"BH"},{name:"Bangladesh",code:"BD"},{name:"Barbados",code:"BB"},{name:"Belarus",code:"BY"},{name:"Belgium",code:"BE"},{name:"Belize",code:"BZ"},{name:"Benin",code:"BJ"},{name:"Bermuda",code:"BM"},{name:"Bhutan",code:"BT"},{name:"Bolivia",code:"BO"},{name:"Bosnia and Herzegovina",code:"BA"},{name:"Botswana",code:"BW"},{name:"Bouvet Island",code:"BV"},{name:"Brazil",code:"BR"},{name:"British Indian Ocean Territory",code:"IO"},{name:"Brunei Darussalam",code:"BN"},{name:"Bulgaria",code:"BG"},{name:"Burkina Faso",code:"BF"},{name:"Burundi",code:"BI"},{name:"Cambodia",code:"KH"},{name:"Cameroon",code:"CM"},{name:"Canada",code:"CA"},{name:"Cape Verde",code:"CV"},{name:"Cayman Islands",code:"KY"},{name:"Central African Republic",code:"CF"},{name:"Chad",code:"TD"},{name:"Chile",code:"CL"},{name:"China",code:"CN"},{name:"Christmas Island",code:"CX"},{name:"Cocos (Keeling) Islands",code:"CC"},{name:"Colombia",code:"CO"},{name:"Comoros",code:"KM"},{name:"Congo",code:"CG"},{name:"Congo, The Democratic Republic of the",code:"CD"},{name:"Cook Islands",code:"CK"},{name:"Costa Rica",code:"CR"},{name:"Cote D Ivoire",code:"CI"},{name:"Croatia",code:"HR"},{name:"Cuba",code:"CU"},{name:"Cyprus",code:"CY"},{name:"Czech Republic",code:"CZ"},{name:"Denmark",code:"DK"},{name:"Djibouti",code:"DJ"},{name:"Dominica",code:"DM"},{name:"Dominican Republic",code:"DO"},{name:"Ecuador",code:"EC"},{name:"Egypt",code:"EG"},{name:"El Salvador",code:"SV"},{name:"Equatorial Guinea",code:"GQ"},{name:"Eritrea",code:"ER"},{name:"Estonia",code:"EE"},{name:"Ethiopia",code:"ET"},{name:"Falkland Islands (Malvinas)",code:"FK"},{name:"Faroe Islands",code:"FO"},{name:"Fiji",code:"FJ"},{name:"Finland",code:"FI"},{name:"France",code:"FR"},{name:"French Guiana",code:"GF"},{name:"French Polynesia",code:"PF"},{name:"French Southern Territories",code:"TF"},{name:"Gabon",code:"GA"},{name:"Gambia",code:"GM"},{name:"Georgia",code:"GE"},{name:"Germany",code:"DE"},{name:"Ghana",code:"GH"},{name:"Gibraltar",code:"GI"},{name:"Greece",code:"GR"},{name:"Greenland",code:"GL"},{name:"Grenada",code:"GD"},{name:"Guadeloupe",code:"GP"},{name:"Guam",code:"GU"},{name:"Guatemala",code:"GT"},{name:"Guernsey",code:"GG"},{name:"Guinea",code:"GN"},{name:"Guinea-Bissau",code:"GW"},{name:"Guyana",code:"GY"},{name:"Haiti",code:"HT"},{name:"Heard Island and Mcdonald Islands",code:"HM"},{name:"Holy See (Vatican City State)",code:"VA"},{name:"Honduras",code:"HN"},{name:"Hong Kong",code:"HK"},{name:"Hungary",code:"HU"},{name:"Iceland",code:"IS"},{name:"India",code:"IN"},{name:"Indonesia",code:"ID"},{name:"Iran, Islamic Republic Of",code:"IR"},{name:"Iraq",code:"IQ"},{name:"Ireland",code:"IE"},{name:"Isle of Man",code:"IM"},{name:"Israel",code:"IL"},{name:"Italy",code:"IT"},{name:"Jamaica",code:"JM"},{name:"Japan",code:"JP"},{name:"Jersey",code:"JE"},{name:"Jordan",code:"JO"},{name:"Kazakhstan",code:"KZ"},{name:"Kenya",code:"KE"},{name:"Kiribati",code:"KI"},{name:'Korea, Democratic People"S Republic of',code:"KP"},{name:"Korea, Republic of",code:"KR"},{name:"Kuwait",code:"KW"},{name:"Kyrgyzstan",code:"KG"},{name:'Lao People"S Democratic Republic',code:"LA"},{name:"Latvia",code:"LV"},{name:"Lebanon",code:"LB"},{name:"Lesotho",code:"LS"},{name:"Liberia",code:"LR"},{name:"Libyan Arab Jamahiriya",code:"LY"},{name:"Liechtenstein",code:"LI"},{name:"Lithuania",code:"LT"},{name:"Luxembourg",code:"LU"},{name:"Macao",code:"MO"},{name:"Macedonia, The Former Yugoslav Republic of",code:"MK"},{name:"Madagascar",code:"MG"},{name:"Malawi",code:"MW"},{name:"Malaysia",code:"MY"},{name:"Maldives",code:"MV"},{name:"Mali",code:"ML"},{name:"Malta",code:"MT"},{name:"Marshall Islands",code:"MH"},{name:"Martinique",code:"MQ"},{name:"Mauritania",code:"MR"},{name:"Mauritius",code:"MU"},{name:"Mayotte",code:"YT"},{name:"Mexico",code:"MX"},{name:"Micronesia, Federated States of",code:"FM"},{name:"Moldova, Republic of",code:"MD"},{name:"Monaco",code:"MC"},{name:"Mongolia",code:"MN"},{name:"Montenegro",code:"ME"},{name:"Montserrat",code:"MS"},{name:"Morocco",code:"MA"},{name:"Mozambique",code:"MZ"},{name:"Myanmar",code:"MM"},{name:"Namibia",code:"NA"},{name:"Nauru",code:"NR"},{name:"Nepal",code:"NP"},{name:"Netherlands",code:"NL"},{name:"Netherlands Antilles",code:"AN"},{name:"New Caledonia",code:"NC"},{name:"New Zealand",code:"NZ"},{name:"Nicaragua",code:"NI"},{name:"Niger",code:"NE"},{name:"Nigeria",code:"NG"},{name:"Niue",code:"NU"},{name:"Norfolk Island",code:"NF"},{name:"Northern Mariana Islands",code:"MP"},{name:"Norway",code:"NO"},{name:"Oman",code:"OM"},{name:"Pakistan",code:"PK"},{name:"Palau",code:"PW"},{name:"Palestinian Territory, Occupied",code:"PS"},{name:"Panama",code:"PA"},{name:"Papua New Guinea",code:"PG"},{name:"Paraguay",code:"PY"},{name:"Peru",code:"PE"},{name:"Philippines",code:"PH"},{name:"Pitcairn",code:"PN"},{name:"Poland",code:"PL"},{name:"Portugal",code:"PT"},{name:"Puerto Rico",code:"PR"},{name:"Qatar",code:"QA"},{name:"Reunion",code:"RE"},{name:"Romania",code:"RO"},{name:"Russian Federation",code:"RU"},{name:"RWANDA",code:"RW"},{name:"Saint Helena",code:"SH"},{name:"Saint Kitts and Nevis",code:"KN"},{name:"Saint Lucia",code:"LC"},{name:"Saint Pierre and Miquelon",code:"PM"},{name:"Saint Vincent and the Grenadines",code:"VC"},{name:"Samoa",code:"WS"},{name:"San Marino",code:"SM"},{name:"Sao Tome and Principe",code:"ST"},{name:"Saudi Arabia",code:"SA"},{name:"Senegal",code:"SN"},{name:"Serbia",code:"RS"},{name:"Seychelles",code:"SC"},{name:"Sierra Leone",code:"SL"},{name:"Singapore",code:"SG"},{name:"Slovakia",code:"SK"},{name:"Slovenia",code:"SI"},{name:"Solomon Islands",code:"SB"},{name:"Somalia",code:"SO"},{name:"South Africa",code:"ZA"},{name:"South Georgia and the South Sandwich Islands",code:"GS"},{name:"Spain",code:"ES"},{name:"Sri Lanka",code:"LK"},{name:"Sudan",code:"SD"},{name:"Suriname",code:"SR"},{name:"Svalbard and Jan Mayen",code:"SJ"},{name:"Swaziland",code:"SZ"},{name:"Sweden",code:"SE"},{name:"Switzerland",code:"CH"},{name:"Syrian Arab Republic",code:"SY"},{name:"Taiwan, Province of China",code:"TW"},{name:"Tajikistan",code:"TJ"},{name:"Tanzania, United Republic of",code:"TZ"},{name:"Thailand",code:"TH"},{name:"Timor-Leste",code:"TL"},{name:"Togo",code:"TG"},{name:"Tokelau",code:"TK"},{name:"Tonga",code:"TO"},{name:"Trinidad and Tobago",code:"TT"},{name:"Tunisia",code:"TN"},{name:"Turkey",code:"TR"},{name:"Turkmenistan",code:"TM"},{name:"Turks and Caicos Islands",code:"TC"},{name:"Tuvalu",code:"TV"},{name:"Uganda",code:"UG"},{name:"Ukraine",code:"UA"},{name:"United Arab Emirates",code:"AE"},{name:"United Kingdom",code:"GB"},{name:"United States",code:"US"},{name:"United States Minor Outlying Islands",code:"UM"},{name:"Uruguay",code:"UY"},{name:"Uzbekistan",code:"UZ"},{name:"Vanuatu",code:"VU"},{name:"Venezuela",code:"VE"},{name:"Viet Nam",code:"VN"},{name:"Virgin Islands, British",code:"VG"},{name:"Virgin Islands, U.S.",code:"VI"},{name:"Wallis and Futuna",code:"WF"},{name:"Western Sahara",code:"EH"},{name:"Yemen",code:"YE"},{name:"Zambia",code:"ZM"},{name:"Zimbabwe",code:"ZW"}].map(e=>{const t=Gk[e.code]||"USD",r=Vk[t]||"";return{value:e.code,flag:(n=e.code,n.toUpperCase().replace(/./g,e=>String.fromCodePoint(127397+e.charCodeAt(0)))),text:e.name,currencyCode:t,currencyIcon:r};var n});function jk({value:e,onChange:r}){const{t:n}=Cn(),a=Hk.map(e=>({value:e.value,label:e.text,icon:e.flag}));return t(Wk,{options:a,value:e,onChange:r,placeholder:n("dropdowns.searchCountry"),emptyLabel:n("dropdowns.chooseCountry")})}const $k=Hk.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),Kk=Array.from(new Set($k.map(e=>e.value))).map(e=>$k.find(t=>t.value===e)).filter(e=>void 0!==e);function qk({value:e,onChange:r}){const{t:n}=Cn(),a=Kk.map(e=>({value:e.value,label:e.text,icon:e.icon??void 0}));return t(Wk,{options:a,value:e,onChange:r,placeholder:n("dropdowns.searchCurrency"),emptyLabel:n("dropdowns.chooseCurrency")})}let Zk=[{code:"en",label:"English",flag:"🇬🇧"},{code:"en-GB",label:"English (United Kingdom)",flag:"🇬🇧"},{code:"en-US",label:"English (United States)",flag:"🇺🇸"},{code:"en-AU",label:"English (Australia)",flag:"🇦🇺"},{code:"en-CA",label:"English (Canada)",flag:"🇨🇦"},{code:"en-NZ",label:"English (New Zealand)",flag:"🇳🇿"},{code:"es",label:"Spanish",flag:"🇪🇸"},{code:"es-ES",label:"Spanish (Spain)",flag:"🇪🇸"},{code:"es-MX",label:"Spanish (Mexico)",flag:"🇲🇽"},{code:"fr",label:"French",flag:"🇫🇷"},{code:"fr-FR",label:"French (France)",flag:"🇫🇷"},{code:"de",label:"German",flag:"🇩🇪"},{code:"de-DE",label:"German (Germany)",flag:"🇩🇪"},{code:"it",label:"Italian",flag:"🇮🇹"},{code:"it-IT",label:"Italian (Italy)",flag:"🇮🇹"},{code:"pt",label:"Portuguese",flag:"🇵🇹"},{code:"pt-PT",label:"Portuguese (Portugal)",flag:"🇵🇹"},{code:"pt-BR",label:"Portuguese (Brazil)",flag:"🇧🇷"},{code:"ru",label:"Russian",flag:"🇷🇺"},{code:"ru-RU",label:"Russian (Russia)",flag:"🇷🇺"},{code:"zh",label:"Chinese",flag:"🇨🇳"},{code:"zh-CN",label:"Chinese (Simplified)",flag:"🇨🇳"},{code:"zh-TW",label:"Chinese (Traditional)",flag:"🇹🇼"},{code:"ja",label:"Japanese",flag:"🇯🇵"},{code:"ja-JP",label:"Japanese (Japan)",flag:"🇯🇵"},{code:"ko",label:"Korean",flag:"🇰🇷"},{code:"ko-KR",label:"Korean (South Korea)",flag:"🇰🇷"},{code:"ar",label:"Arabic",flag:"🇸🇦"},{code:"ar-SA",label:"Arabic (Saudi Arabia)",flag:"🇸🇦"},{code:"hi",label:"Hindi",flag:"🇮🇳"},{code:"hi-IN",label:"Hindi (India)",flag:"🇮🇳"},{code:"bn",label:"Bengali",flag:"🇮🇳"},{code:"bn-IN",label:"Bengali (India)",flag:"🇮🇳"},{code:"gu",label:"Gujarati",flag:"🇮🇳"},{code:"gu-IN",label:"Gujarati (India)",flag:"🇮🇳"},{code:"ta",label:"Tamil",flag:"🇮🇳"},{code:"ta-IN",label:"Tamil (India)",flag:"🇮🇳"},{code:"te",label:"Telugu",flag:"🇮🇳"},{code:"te-IN",label:"Telugu (India)",flag:"🇮🇳"},{code:"ml",label:"Malayalam",flag:"🇮🇳"},{code:"ml-IN",label:"Malayalam (India)",flag:"🇮🇳"},{code:"kn",label:"Kannada",flag:"🇮🇳"},{code:"kn-IN",label:"Kannada (India)",flag:"🇮🇳"},{code:"mr",label:"Marathi",flag:"🇮🇳"},{code:"mr-IN",label:"Marathi (India)",flag:"🇮🇳"},{code:"pa",label:"Punjabi",flag:"🇮🇳"},{code:"pa-IN",label:"Punjabi (India)",flag:"🇮🇳"},{code:"ur",label:"Urdu",flag:"🇮🇳"},{code:"ur-IN",label:"Urdu (India)",flag:"🇮🇳"},{code:"or",label:"Odia",flag:"🇮🇳"},{code:"or-IN",label:"Odia (India)",flag:"🇮🇳"},{code:"as",label:"Assamese",flag:"🇮🇳"},{code:"as-IN",label:"Assamese (India)",flag:"🇮🇳"},{code:"zh-HK",label:"Chinese (Hong Kong)",flag:"🇭🇰"},{code:"nl",label:"Dutch",flag:"🇳🇱"},{code:"nl-NL",label:"Dutch (Netherlands)",flag:"🇳🇱"},{code:"pl",label:"Polish",flag:"🇵🇱"},{code:"pl-PL",label:"Polish (Poland)",flag:"🇵🇱"},{code:"sv",label:"Swedish",flag:"🇸🇪"},{code:"sv-SE",label:"Swedish (Sweden)",flag:"🇸🇪"},{code:"da",label:"Danish",flag:"🇩🇰"},{code:"da-DK",label:"Danish (Denmark)",flag:"🇩🇰"},{code:"no",label:"Norwegian",flag:"🇳🇴"},{code:"no-NO",label:"Norwegian (Norway)",flag:"🇳🇴"},{code:"fi",label:"Finnish",flag:"🇫🇮"},{code:"fi-FI",label:"Finnish (Finland)",flag:"🇫🇮"},{code:"tr",label:"Turkish",flag:"🇹🇷"},{code:"tr-TR",label:"Turkish (Turkey)",flag:"🇹🇷"},{code:"cs",label:"Czech",flag:"🇨🇿"},{code:"cs-CZ",label:"Czech (Czech Republic)",flag:"🇨🇿"},{code:"sk",label:"Slovak",flag:"🇸🇰"},{code:"sk-SK",label:"Slovak (Slovakia)",flag:"🇸🇰"},{code:"hu",label:"Hungarian",flag:"🇭🇺"},{code:"hu-HU",label:"Hungarian (Hungary)",flag:"🇭🇺"},{code:"ro",label:"Romanian",flag:"🇷🇴"},{code:"ro-RO",label:"Romanian (Romania)",flag:"🇷🇴"},{code:"el",label:"Greek",flag:"🇬🇷"},{code:"el-GR",label:"Greek (Greece)",flag:"🇬🇷"},{code:"th",label:"Thai",flag:"🇹🇭"},{code:"th-TH",label:"Thai (Thailand)",flag:"🇹🇭"},{code:"id",label:"Indonesian",flag:"🇮🇩"},{code:"id-ID",label:"Indonesian (Indonesia)",flag:"🇮🇩"},{code:"ms",label:"Malay",flag:"🇲🇾"},{code:"ms-MY",label:"Malay (Malaysia)",flag:"🇲🇾"},{code:"vi",label:"Vietnamese",flag:"🇻🇳"},{code:"vi-VN",label:"Vietnamese (Vietnam)",flag:"🇻🇳"},{code:"he",label:"Hebrew",flag:"🇮🇱"},{code:"he-IL",label:"Hebrew (Israel)",flag:"🇮🇱"}];Zk=Zk.filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)),Zk.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const Jk=Zk.filter(e=>function(e){try{const t=new Intl.DateTimeFormat(e);return t.resolvedOptions().locale===e||t.resolvedOptions().locale.startsWith(e)}catch{return!1}}(e.code)).filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)).map(e=>({value:e.code,label:e.label,flag:e.flag}));function Yk({value:e,onChange:r}){const{t:n}=Cn(),a=Jk.map(e=>({value:e.value,label:e.label,icon:e.flag}));return t(Wk,{options:a,value:e,onChange:r,placeholder:n("dropdowns.searchLanguage"),emptyLabel:n("dropdowns.chooseLanguage")})}const Xk=[{value:"Dateline Standard Time",abbr:"DST",offset:-12,isdst:!1,text:"(UTC-12:00) International Date Line West",utc:["Etc/GMT+12"]},{value:"UTC-11",abbr:"U",offset:-11,isdst:!1,text:"(UTC-11:00) Coordinated Universal Time-11",utc:["Etc/GMT+11","Pacific/Midway","Pacific/Niue","Pacific/Pago_Pago"]},{value:"Hawaiian Standard Time",abbr:"HST",offset:-10,isdst:!1,text:"(UTC-10:00) Hawaii",utc:["Etc/GMT+10","Pacific/Honolulu","Pacific/Johnston","Pacific/Rarotonga","Pacific/Tahiti"]},{value:"Alaskan Standard Time",abbr:"AKDT",offset:-8,isdst:!0,text:"(UTC-09:00) Alaska",utc:["America/Anchorage","America/Juneau","America/Nome","America/Sitka","America/Yakutat"]},{value:"Pacific Standard Time (Mexico)",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-08:00) Baja California",utc:["America/Santa_Isabel"]},{value:"Pacific Daylight Time",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-07:00) Pacific Daylight Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver"]},{value:"Pacific Standard Time",abbr:"PST",offset:-8,isdst:!1,text:"(UTC-08:00) Pacific Standard Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver","PST8PDT"]},{value:"US Mountain Standard Time",abbr:"UMST",offset:-7,isdst:!1,text:"(UTC-07:00) Arizona",utc:["America/Creston","America/Dawson","America/Dawson_Creek","America/Hermosillo","America/Phoenix","America/Whitehorse","Etc/GMT+7"]},{value:"Mountain Standard Time (Mexico)",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Chihuahua, La Paz, Mazatlan",utc:["America/Chihuahua","America/Mazatlan"]},{value:"Mountain Standard Time",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Mountain Time (US & Canada)",utc:["America/Boise","America/Cambridge_Bay","America/Denver","America/Edmonton","America/Inuvik","America/Ojinaga","America/Yellowknife","MST7MDT"]},{value:"Central America Standard Time",abbr:"CAST",offset:-6,isdst:!1,text:"(UTC-06:00) Central America",utc:["America/Belize","America/Costa_Rica","America/El_Salvador","America/Guatemala","America/Managua","America/Tegucigalpa","Etc/GMT+6","Pacific/Galapagos"]},{value:"Central Standard Time",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Central Time (US & Canada)",utc:["America/Chicago","America/Indiana/Knox","America/Indiana/Tell_City","America/Matamoros","America/Menominee","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Rainy_River","America/Rankin_Inlet","America/Resolute","America/Winnipeg","CST6CDT"]},{value:"Central Standard Time (Mexico)",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Guadalajara, Mexico City, Monterrey",utc:["America/Bahia_Banderas","America/Cancun","America/Merida","America/Mexico_City","America/Monterrey"]},{value:"Canada Central Standard Time",abbr:"CCST",offset:-6,isdst:!1,text:"(UTC-06:00) Saskatchewan",utc:["America/Regina","America/Swift_Current"]},{value:"SA Pacific Standard Time",abbr:"SPST",offset:-5,isdst:!1,text:"(UTC-05:00) Bogota, Lima, Quito",utc:["America/Bogota","America/Cayman","America/Coral_Harbour","America/Eirunepe","America/Guayaquil","America/Jamaica","America/Lima","America/Panama","America/Rio_Branco","Etc/GMT+5"]},{value:"Eastern Standard Time",abbr:"EST",offset:-5,isdst:!1,text:"(UTC-05:00) Eastern Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"Eastern Daylight Time",abbr:"EDT",offset:-4,isdst:!0,text:"(UTC-04:00) Eastern Daylight Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"US Eastern Standard Time",abbr:"UEDT",offset:-5,isdst:!1,text:"(UTC-05:00) Indiana (East)",utc:["America/Indiana/Marengo","America/Indiana/Vevay","America/Indianapolis"]},{value:"Venezuela Standard Time",abbr:"VST",offset:-4.5,isdst:!1,text:"(UTC-04:30) Caracas",utc:["America/Caracas"]},{value:"Paraguay Standard Time",abbr:"PYT",offset:-4,isdst:!1,text:"(UTC-04:00) Asuncion",utc:["America/Asuncion"]},{value:"Atlantic Standard Time",abbr:"ADT",offset:-3,isdst:!0,text:"(UTC-04:00) Atlantic Time (Canada)",utc:["America/Glace_Bay","America/Goose_Bay","America/Halifax","America/Moncton","America/Thule","Atlantic/Bermuda"]},{value:"Central Brazilian Standard Time",abbr:"CBST",offset:-4,isdst:!1,text:"(UTC-04:00) Cuiaba",utc:["America/Campo_Grande","America/Cuiaba"]},{value:"SA Western Standard Time",abbr:"SWST",offset:-4,isdst:!1,text:"(UTC-04:00) Georgetown, La Paz, Manaus, San Juan",utc:["America/Anguilla","America/Antigua","America/Aruba","America/Barbados","America/Blanc-Sablon","America/Boa_Vista","America/Curacao","America/Dominica","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guyana","America/Kralendijk","America/La_Paz","America/Lower_Princes","America/Manaus","America/Marigot","America/Martinique","America/Montserrat","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Santo_Domingo","America/St_Barthelemy","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Tortola","Etc/GMT+4"]},{value:"Pacific SA Standard Time",abbr:"PSST",offset:-4,isdst:!1,text:"(UTC-04:00) Santiago",utc:["America/Santiago","Antarctica/Palmer"]},{value:"Newfoundland Standard Time",abbr:"NDT",offset:-2.5,isdst:!0,text:"(UTC-03:30) Newfoundland",utc:["America/St_Johns"]},{value:"E. South America Standard Time",abbr:"ESAST",offset:-3,isdst:!1,text:"(UTC-03:00) Brasilia",utc:["America/Sao_Paulo"]},{value:"Argentina Standard Time",abbr:"AST",offset:-3,isdst:!1,text:"(UTC-03:00) Buenos Aires",utc:["America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Buenos_Aires","America/Catamarca","America/Cordoba","America/Jujuy","America/Mendoza"]},{value:"SA Eastern Standard Time",abbr:"SEST",offset:-3,isdst:!1,text:"(UTC-03:00) Cayenne, Fortaleza",utc:["America/Araguaina","America/Belem","America/Cayenne","America/Fortaleza","America/Maceio","America/Paramaribo","America/Recife","America/Santarem","Antarctica/Rothera","Atlantic/Stanley","Etc/GMT+3"]},{value:"Greenland Standard Time",abbr:"GDT",offset:-3,isdst:!0,text:"(UTC-03:00) Greenland",utc:["America/Godthab"]},{value:"Montevideo Standard Time",abbr:"MST",offset:-3,isdst:!1,text:"(UTC-03:00) Montevideo",utc:["America/Montevideo"]},{value:"Bahia Standard Time",abbr:"BST",offset:-3,isdst:!1,text:"(UTC-03:00) Salvador",utc:["America/Bahia"]},{value:"UTC-02",abbr:"U",offset:-2,isdst:!1,text:"(UTC-02:00) Coordinated Universal Time-02",utc:["America/Noronha","Atlantic/South_Georgia","Etc/GMT+2"]},{value:"Mid-Atlantic Standard Time",abbr:"MDT",offset:-1,isdst:!0,text:"(UTC-02:00) Mid-Atlantic - Old",utc:[]},{value:"Azores Standard Time",abbr:"ADT",offset:0,isdst:!0,text:"(UTC-01:00) Azores",utc:["America/Scoresbysund","Atlantic/Azores"]},{value:"Cape Verde Standard Time",abbr:"CVST",offset:-1,isdst:!1,text:"(UTC-01:00) Cape Verde Is.",utc:["Atlantic/Cape_Verde","Etc/GMT+1"]},{value:"Morocco Standard Time",abbr:"MDT",offset:1,isdst:!0,text:"(UTC) Casablanca",utc:["Africa/Casablanca","Africa/El_Aaiun"]},{value:"UTC",abbr:"UTC",offset:0,isdst:!1,text:"(UTC) Coordinated Universal Time",utc:["America/Danmarkshavn","Etc/GMT"]},{value:"GMT Standard Time",abbr:"GMT",offset:0,isdst:!1,text:"(UTC) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"British Summer Time",abbr:"BST",offset:1,isdst:!0,text:"(UTC+01:00) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"GMT Standard Time",abbr:"GDT",offset:1,isdst:!0,text:"(UTC) Dublin, Lisbon",utc:["Atlantic/Canary","Atlantic/Faeroe","Atlantic/Madeira","Europe/Dublin","Europe/Lisbon"]},{value:"Greenwich Standard Time",abbr:"GST",offset:0,isdst:!1,text:"(UTC) Monrovia, Reykjavik",utc:["Africa/Abidjan","Africa/Accra","Africa/Bamako","Africa/Banjul","Africa/Bissau","Africa/Conakry","Africa/Dakar","Africa/Freetown","Africa/Lome","Africa/Monrovia","Africa/Nouakchott","Africa/Ouagadougou","Africa/Sao_Tome","Atlantic/Reykjavik","Atlantic/St_Helena"]},{value:"W. Europe Standard Time",abbr:"WEDT",offset:2,isdst:!0,text:"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",utc:["Arctic/Longyearbyen","Europe/Amsterdam","Europe/Andorra","Europe/Berlin","Europe/Busingen","Europe/Gibraltar","Europe/Luxembourg","Europe/Malta","Europe/Monaco","Europe/Oslo","Europe/Rome","Europe/San_Marino","Europe/Stockholm","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Zurich"]},{value:"Central Europe Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",utc:["Europe/Belgrade","Europe/Bratislava","Europe/Budapest","Europe/Ljubljana","Europe/Podgorica","Europe/Prague","Europe/Tirane"]},{value:"Romance Standard Time",abbr:"RDT",offset:2,isdst:!0,text:"(UTC+01:00) Brussels, Copenhagen, Madrid, Paris",utc:["Africa/Ceuta","Europe/Brussels","Europe/Copenhagen","Europe/Madrid","Europe/Paris"]},{value:"Central European Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb",utc:["Europe/Sarajevo","Europe/Skopje","Europe/Warsaw","Europe/Zagreb"]},{value:"W. Central Africa Standard Time",abbr:"WCAST",offset:1,isdst:!1,text:"(UTC+01:00) West Central Africa",utc:["Africa/Algiers","Africa/Bangui","Africa/Brazzaville","Africa/Douala","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Luanda","Africa/Malabo","Africa/Ndjamena","Africa/Niamey","Africa/Porto-Novo","Africa/Tunis","Etc/GMT-1"]},{value:"Namibia Standard Time",abbr:"NST",offset:1,isdst:!1,text:"(UTC+01:00) Windhoek",utc:["Africa/Windhoek"]},{value:"GTB Standard Time",abbr:"GDT",offset:3,isdst:!0,text:"(UTC+02:00) Athens, Bucharest",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau"]},{value:"Middle East Standard Time",abbr:"MEDT",offset:3,isdst:!0,text:"(UTC+02:00) Beirut",utc:["Asia/Beirut"]},{value:"Egypt Standard Time",abbr:"EST",offset:2,isdst:!1,text:"(UTC+02:00) Cairo",utc:["Africa/Cairo"]},{value:"Syria Standard Time",abbr:"SDT",offset:3,isdst:!0,text:"(UTC+02:00) Damascus",utc:["Asia/Damascus"]},{value:"E. Europe Standard Time",abbr:"EEDT",offset:3,isdst:!0,text:"(UTC+02:00) E. Europe",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau","Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Nicosia","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"South Africa Standard Time",abbr:"SAST",offset:2,isdst:!1,text:"(UTC+02:00) Harare, Pretoria",utc:["Africa/Blantyre","Africa/Bujumbura","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Kigali","Africa/Lubumbashi","Africa/Lusaka","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Etc/GMT-2"]},{value:"FLE Standard Time",abbr:"FDT",offset:3,isdst:!0,text:"(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",utc:["Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"Turkey Standard Time",abbr:"TDT",offset:3,isdst:!1,text:"(UTC+03:00) Istanbul",utc:["Europe/Istanbul"]},{value:"Israel Standard Time",abbr:"JDT",offset:3,isdst:!0,text:"(UTC+02:00) Jerusalem",utc:["Asia/Jerusalem"]},{value:"Libya Standard Time",abbr:"LST",offset:2,isdst:!1,text:"(UTC+02:00) Tripoli",utc:["Africa/Tripoli"]},{value:"Jordan Standard Time",abbr:"JST",offset:3,isdst:!1,text:"(UTC+03:00) Amman",utc:["Asia/Amman"]},{value:"Arabic Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Baghdad",utc:["Asia/Baghdad"]},{value:"Kaliningrad Standard Time",abbr:"KST",offset:3,isdst:!1,text:"(UTC+02:00) Kaliningrad",utc:["Europe/Kaliningrad"]},{value:"Arab Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Kuwait, Riyadh",utc:["Asia/Aden","Asia/Bahrain","Asia/Kuwait","Asia/Qatar","Asia/Riyadh"]},{value:"E. Africa Standard Time",abbr:"EAST",offset:3,isdst:!1,text:"(UTC+03:00) Nairobi",utc:["Africa/Addis_Ababa","Africa/Asmera","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Mogadishu","Africa/Nairobi","Antarctica/Syowa","Etc/GMT-3","Indian/Antananarivo","Indian/Comoro","Indian/Mayotte"]},{value:"Moscow Standard Time",abbr:"MSK",offset:3,isdst:!1,text:"(UTC+03:00) Moscow, St. Petersburg, Volgograd, Minsk",utc:["Europe/Kirov","Europe/Moscow","Europe/Simferopol","Europe/Volgograd","Europe/Minsk"]},{value:"Samara Time",abbr:"SAMT",offset:4,isdst:!1,text:"(UTC+04:00) Samara, Ulyanovsk, Saratov",utc:["Europe/Astrakhan","Europe/Samara","Europe/Ulyanovsk"]},{value:"Iran Standard Time",abbr:"IDT",offset:4.5,isdst:!0,text:"(UTC+03:30) Tehran",utc:["Asia/Tehran"]},{value:"Arabian Standard Time",abbr:"AST",offset:4,isdst:!1,text:"(UTC+04:00) Abu Dhabi, Muscat",utc:["Asia/Dubai","Asia/Muscat","Etc/GMT-4"]},{value:"Azerbaijan Standard Time",abbr:"ADT",offset:5,isdst:!0,text:"(UTC+04:00) Baku",utc:["Asia/Baku"]},{value:"Mauritius Standard Time",abbr:"MST",offset:4,isdst:!1,text:"(UTC+04:00) Port Louis",utc:["Indian/Mahe","Indian/Mauritius","Indian/Reunion"]},{value:"Georgian Standard Time",abbr:"GET",offset:4,isdst:!1,text:"(UTC+04:00) Tbilisi",utc:["Asia/Tbilisi"]},{value:"Caucasus Standard Time",abbr:"CST",offset:4,isdst:!1,text:"(UTC+04:00) Yerevan",utc:["Asia/Yerevan"]},{value:"Afghanistan Standard Time",abbr:"AST",offset:4.5,isdst:!1,text:"(UTC+04:30) Kabul",utc:["Asia/Kabul"]},{value:"West Asia Standard Time",abbr:"WAST",offset:5,isdst:!1,text:"(UTC+05:00) Ashgabat, Tashkent",utc:["Antarctica/Mawson","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Dushanbe","Asia/Oral","Asia/Samarkand","Asia/Tashkent","Etc/GMT-5","Indian/Kerguelen","Indian/Maldives"]},{value:"Yekaterinburg Time",abbr:"YEKT",offset:5,isdst:!1,text:"(UTC+05:00) Yekaterinburg",utc:["Asia/Yekaterinburg"]},{value:"Pakistan Standard Time",abbr:"PKT",offset:5,isdst:!1,text:"(UTC+05:00) Islamabad, Karachi",utc:["Asia/Karachi"]},{value:"India Standard Time",abbr:"IST",offset:5.5,isdst:!1,text:"(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi",utc:["Asia/Kolkata","Asia/Calcutta"]},{value:"Sri Lanka Standard Time",abbr:"SLST",offset:5.5,isdst:!1,text:"(UTC+05:30) Sri Jayawardenepura",utc:["Asia/Colombo"]},{value:"Nepal Standard Time",abbr:"NST",offset:5.75,isdst:!1,text:"(UTC+05:45) Kathmandu",utc:["Asia/Kathmandu"]},{value:"Central Asia Standard Time",abbr:"CAST",offset:6,isdst:!1,text:"(UTC+06:00) Nur-Sultan (Astana)",utc:["Antarctica/Vostok","Asia/Almaty","Asia/Bishkek","Asia/Qyzylorda","Asia/Urumqi","Etc/GMT-6","Indian/Chagos"]},{value:"Bangladesh Standard Time",abbr:"BST",offset:6,isdst:!1,text:"(UTC+06:00) Dhaka",utc:["Asia/Dhaka","Asia/Thimphu"]},{value:"Myanmar Standard Time",abbr:"MST",offset:6.5,isdst:!1,text:"(UTC+06:30) Yangon (Rangoon)",utc:["Asia/Rangoon","Indian/Cocos"]},{value:"SE Asia Standard Time",abbr:"SAST",offset:7,isdst:!1,text:"(UTC+07:00) Bangkok, Hanoi, Jakarta",utc:["Antarctica/Davis","Asia/Bangkok","Asia/Hovd","Asia/Jakarta","Asia/Phnom_Penh","Asia/Pontianak","Asia/Saigon","Asia/Vientiane","Etc/GMT-7","Indian/Christmas"]},{value:"N. Central Asia Standard Time",abbr:"NCAST",offset:7,isdst:!1,text:"(UTC+07:00) Novosibirsk",utc:["Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk"]},{value:"China Standard Time",abbr:"CST",offset:8,isdst:!1,text:"(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",utc:["Asia/Hong_Kong","Asia/Macau","Asia/Shanghai"]},{value:"North Asia Standard Time",abbr:"NAST",offset:8,isdst:!1,text:"(UTC+08:00) Krasnoyarsk",utc:["Asia/Krasnoyarsk"]},{value:"Singapore Standard Time",abbr:"MPST",offset:8,isdst:!1,text:"(UTC+08:00) Kuala Lumpur, Singapore",utc:["Asia/Brunei","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Makassar","Asia/Manila","Asia/Singapore","Etc/GMT-8"]},{value:"W. Australia Standard Time",abbr:"WAST",offset:8,isdst:!1,text:"(UTC+08:00) Perth",utc:["Antarctica/Casey","Australia/Perth"]},{value:"Taipei Standard Time",abbr:"TST",offset:8,isdst:!1,text:"(UTC+08:00) Taipei",utc:["Asia/Taipei"]},{value:"Ulaanbaatar Standard Time",abbr:"UST",offset:8,isdst:!1,text:"(UTC+08:00) Ulaanbaatar",utc:["Asia/Choibalsan","Asia/Ulaanbaatar"]},{value:"North Asia East Standard Time",abbr:"NAEST",offset:8,isdst:!1,text:"(UTC+08:00) Irkutsk",utc:["Asia/Irkutsk"]},{value:"Japan Standard Time",abbr:"JST",offset:9,isdst:!1,text:"(UTC+09:00) Osaka, Sapporo, Tokyo",utc:["Asia/Dili","Asia/Jayapura","Asia/Tokyo","Etc/GMT-9","Pacific/Palau"]},{value:"Korea Standard Time",abbr:"KST",offset:9,isdst:!1,text:"(UTC+09:00) Seoul",utc:["Asia/Pyongyang","Asia/Seoul"]},{value:"Cen. Australia Standard Time",abbr:"CAST",offset:9.5,isdst:!1,text:"(UTC+09:30) Adelaide",utc:["Australia/Adelaide","Australia/Broken_Hill"]},{value:"AUS Central Standard Time",abbr:"ACST",offset:9.5,isdst:!1,text:"(UTC+09:30) Darwin",utc:["Australia/Darwin"]},{value:"E. Australia Standard Time",abbr:"EAST",offset:10,isdst:!1,text:"(UTC+10:00) Brisbane",utc:["Australia/Brisbane","Australia/Lindeman"]},{value:"AUS Eastern Standard Time",abbr:"AEST",offset:10,isdst:!1,text:"(UTC+10:00) Canberra, Melbourne, Sydney",utc:["Australia/Melbourne","Australia/Sydney"]},{value:"West Pacific Standard Time",abbr:"WPST",offset:10,isdst:!1,text:"(UTC+10:00) Guam, Port Moresby",utc:["Antarctica/DumontDUrville","Etc/GMT-10","Pacific/Guam","Pacific/Port_Moresby","Pacific/Saipan","Pacific/Truk"]},{value:"Tasmania Standard Time",abbr:"TST",offset:10,isdst:!1,text:"(UTC+10:00) Hobart",utc:["Australia/Currie","Australia/Hobart"]},{value:"Yakutsk Standard Time",abbr:"YST",offset:9,isdst:!1,text:"(UTC+09:00) Yakutsk",utc:["Asia/Chita","Asia/Khandyga","Asia/Yakutsk"]},{value:"Central Pacific Standard Time",abbr:"CPST",offset:11,isdst:!1,text:"(UTC+11:00) Solomon Is., New Caledonia",utc:["Antarctica/Macquarie","Etc/GMT-11","Pacific/Efate","Pacific/Guadalcanal","Pacific/Kosrae","Pacific/Noumea","Pacific/Ponape"]},{value:"Vladivostok Standard Time",abbr:"VST",offset:11,isdst:!1,text:"(UTC+11:00) Vladivostok",utc:["Asia/Sakhalin","Asia/Ust-Nera","Asia/Vladivostok"]},{value:"New Zealand Standard Time",abbr:"NZST",offset:12,isdst:!1,text:"(UTC+12:00) Auckland, Wellington",utc:["Antarctica/McMurdo","Pacific/Auckland"]},{value:"UTC+12",abbr:"U",offset:12,isdst:!1,text:"(UTC+12:00) Coordinated Universal Time+12",utc:["Etc/GMT-12","Pacific/Funafuti","Pacific/Kwajalein","Pacific/Majuro","Pacific/Nauru","Pacific/Tarawa","Pacific/Wake","Pacific/Wallis"]},{value:"Fiji Standard Time",abbr:"FST",offset:12,isdst:!1,text:"(UTC+12:00) Fiji",utc:["Pacific/Fiji"]},{value:"Magadan Standard Time",abbr:"MST",offset:12,isdst:!1,text:"(UTC+12:00) Magadan",utc:["Asia/Anadyr","Asia/Kamchatka","Asia/Magadan","Asia/Srednekolymsk"]},{value:"Kamchatka Standard Time",abbr:"KDT",offset:13,isdst:!0,text:"(UTC+12:00) Petropavlovsk-Kamchatsky - Old",utc:["Asia/Kamchatka"]},{value:"Tonga Standard Time",abbr:"TST",offset:13,isdst:!1,text:"(UTC+13:00) Nuku'alofa",utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]},{value:"Samoa Standard Time",abbr:"SST",offset:13,isdst:!1,text:"(UTC+13:00) Samoa",utc:["Pacific/Apia"]}].filter(e=>e.utc.length).reduce((e,t)=>{let r=t.utc;for(let n=0;n<r.length;n++){const a=r[n],i=t.text;let s=i.substring(i.indexOf("(")+1,i.indexOf(")"));-1!==s.indexOf("UTC")&&e.push({value:a,abbr:t.abbr,offset:t.offset,isdst:t.isdst,text:`(${s}) ${a}`,utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]})}return e},[]).filter((e,t,r)=>t===r.findIndex(t=>t.value===e.value));function Qk({value:e,onChange:r}){const{t:n}=Cn(),a=Xk.map(e=>({value:e.value,label:e.text}));return t(Wk,{options:a,value:e,onChange:r,placeholder:n("dropdowns.searchTimezone"),emptyLabel:n("dropdowns.chooseTimezone")})}const eS=({workspace:r})=>{const{t:n}=Cn(),{updateUserProfile:a,getProfile:i}=jC(),[s,o]=m(!1),[c,l]=m(),[d,p]=m(0),h=tu(),f=_p({resolver:Of(Ug({name:cg().min(2,{message:n("profile.nameMinLength")}),country:cg().optional(),timezone:cg().optional(),language:cg().optional(),currency:cg().optional()})),defaultValues:{name:c?.name||"",country:c?.country||"",timezone:c?.timezone||"",language:c?.language||"",currency:c?.currency||""}});return u(()=>{i().then(e=>{l(e),f.setValue("name",e.name),f.setValue("country",e.country),f.setValue("timezone",e.timezone),f.setValue("language",e.language),f.setValue("currency",e.currency)})},[d]),c?e("div",{children:[h.message&&e("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[t("p",{className:"font-medium",children:n("settings.common.success")}),t("p",{className:"text-sm",children:h.message})]}),t("div",{className:"space-y-4",children:t(ab,{...f,children:e("form",{onSubmit:f.handleSubmit(async function(e){o(!0),h.clear();try{await a({name:e.name,country:e.country,timezone:e.timezone,language:e.language,currency:e.currency}),h.show(n("profile.success"))}catch(e){$e(e,{component:"WorkspaceSettingsProfile",action:"updateUserProfile",metadata:{workspaceId:r._id}})}finally{o(!1)}}),className:"space-y-4",children:[e("div",{children:[t("label",{className:"block text-sm font-medium mb-1",children:n("profile.email")}),t(hb,{disabled:!0,className:"w-full border rounded px-3 py-2 bg-gray-100",value:c?.email})]}),t(sb,{disabled:s,control:f.control,name:"name",render:({field:r})=>e(lb,{children:[t(db,{children:n("profile.name")}),t(ub,{children:t(hb,{...r})}),t(mb,{})]})}),e("div",{className:"flex gap-y-2 my-4 flex-col",children:[e("div",{className:"flex flex-col gap-0.5",children:[t("div",{className:"text-sm font-medium",children:n("profile.language")}),t(Yk,{value:f.watch("language"),onChange:e=>{f.setValue("language",e)}})]}),e("div",{className:"flex flex-col gap-0.5",children:[t("div",{className:"text-sm font-medium",children:n("profile.country")}),t(jk,{value:f.watch("country"),onChange:e=>{f.setValue("country",e)}})]}),e("div",{className:"flex flex-col gap-0.5",children:[t("div",{className:"text-sm font-medium",children:n("profile.currency")}),t(qk,{value:f.watch("currency"),onChange:e=>{f.setValue("currency",e)}})]}),e("div",{className:"flex flex-col gap-0.5",children:[t("div",{className:"text-sm font-medium",children:n("profile.timezone")}),t(Qk,{value:f.watch("timezone"),onChange:e=>{f.setValue("timezone",e)}})]})]}),e("div",{className:"flex justify-end gap-x-2",children:[t(Bs,{type:"submit",progress:s,disabled:s,children:n("profile.save")}),t(Bs,{type:"button",variant:"outline",onClick:()=>{p(e=>e+1)},disabled:s,children:n("profile.reset")})]})]})})}),c?.image&&e("div",{children:[t("label",{className:"block text-sm font-medium mb-1",children:n("profile.profileImage")}),t("div",{className:"w-16 h-16 rounded-full overflow-hidden",children:t("img",{src:c.image,alt:c.name,className:"w-full h-full object-cover"})})]})]}):t(Zl,{})};function tS(e,t){if(null==e)return null;const r=e[t??"monthly"];return r?{included:r.included,...void 0!==r.overage&&{overage:r.overage},...void 0!==r.unitSize&&{unitSize:r.unitSize},allowOverage:!1!==e.allowOverage}:null}function rS(e,t,r={}){if(null==e)return null;const{overageInCents:n=!0,currency:a,locale:i="en"}=r,{included:s,overage:o}=e;if(!(!1!==e.allowOverage))return{included:s,hasOverage:!1,allowOverage:!1,price:"",unit:""};if(null==o)return{included:s,hasOverage:!1,allowOverage:!0,price:"",unit:""};const c=n?o/100:o,l=(a??"").trim().toUpperCase();let d;if(l&&"number"==typeof c&&Number.isFinite(c))try{d=new Intl.NumberFormat(i,{style:"currency",currency:l,minimumFractionDigits:2}).format(c)}catch{d=`${r.currencySymbol??jl(a??"")}${c.toFixed(2)}`}else{d=`${r.currencySymbol??jl(a??"")}${"number"==typeof c?c.toFixed(2):String(o)}`}return{included:s,hasOverage:!0,allowOverage:!0,price:d,unit:t&&"unitSize"in e&&null!=e.unitSize&&e.unitSize>0?`${e.unitSize.toLocaleString(i)} ${t}`:t||""}}const nS="personal",aS=(e,t,r="en-US")=>{const n=(t??"").trim();return n?new Intl.NumberFormat(r,{style:"currency",currency:n.toUpperCase(),minimumFractionDigits:2}).format(e/100):(e/100).toFixed(2)},iS=e=>{switch(e){case ii:return"bg-green-100 text-green-800";case ai:return"bg-yellow-100 text-yellow-800";case ni:return"bg-gray-100 text-gray-800";case si:return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}},sS=({workspaceId:n,hasActiveSubscription:a=!1,onViewPricingPlans:i,limit:s=20})=>{const{t:o,formattingLocale:c}=Cn(),{can:l}=Wl(),d=l(Ll.WORKSPACE_BILLING_VIEW),{invoices:u,loading:p,error:m,refetch:h}=Xn(n,s);if(!d)return t(Kl,{});const f=u.length>0;return e("div",{className:"space-y-4",children:[e("div",{className:"flex items-center justify-between",children:[e("div",{children:[t("h3",{className:"text-lg font-semibold",children:o("invoices.title")}),t("p",{className:"text-sm text-gray-600",children:o("invoices.description")})]}),t(Bs,{variant:"ghost",size:"sm",progress:p,onClick:h,disabled:p,children:o("settings.common.refreshAction",{loading:String(p)})})]}),m&&e("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e("div",{children:[t("p",{className:"font-medium",children:o("invoices.errorLoading")}),t("p",{className:"text-sm mt-1",children:m})]}),t(Bs,{variant:"outline",size:"sm",onClick:h,disabled:p,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:o("settings.common.retryAction",{loading:String(p)})})]}),p&&!f?t("div",{className:"border rounded-lg p-6",children:t(Zl,{})}):f?t("div",{className:"space-y-2",children:u.map(n=>{const a=(e=>{switch(e.status){case ni:case ai:return{textKey:"invoices.pay",color:"bg-blue-600 hover:bg-blue-700"};case ii:return{textKey:"invoices.view",color:"bg-green-600 hover:bg-green-700"};case si:case oi:return{textKey:"invoices.viewDetails",color:"bg-gray-600 hover:bg-gray-700"};default:return{textKey:"invoices.view",color:"bg-gray-600 hover:bg-gray-700"}}})(n);return e("div",{className:"border rounded-lg bg-white hover:shadow-sm transition-shadow p-3",children:[e("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[t("span",{className:"text-sm font-medium text-gray-900 truncate min-w-0",children:n.description||n.number||n.id.slice(-8)}),t("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium shrink-0 ${iS(n.status)}`,children:o(`invoices.status.${n.status}`)})]}),e("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-0.5 text-sm text-gray-600 mb-2.5",children:[t("span",{className:"font-medium text-gray-900",children:aS(n.amount_due,n.currency,c)}),n.created&&e(r,{children:[t("span",{className:"text-gray-300 hidden sm:inline",children:"·"}),t("span",{children:Xl(n.created,c)})]}),n.amount_paid>0&&n.amount_due>0&&t("span",{className:"text-xs text-gray-500",children:o("invoices.paidAmount",{amount:aS(n.amount_paid,n.currency,c)})})]}),e("div",{className:"flex items-center gap-2",children:[e(Bs,{size:"sm",disabled:!n.hosted_invoice_url,onClick:()=>n.hosted_invoice_url&&window.open(n.hosted_invoice_url,"_blank","noopener,noreferrer"),className:a.color,children:[o(a.textKey),t(as,{className:"h-3 w-3 ms-1.5"})]}),n.invoice_pdf&&e(Bs,{size:"sm",variant:"outline",onClick:()=>window.open(n.invoice_pdf,"_blank","noopener,noreferrer"),children:[t(ns,{className:"h-3 w-3 me-1.5"}),o("invoices.download")]})]})]},n.id)})}):e("div",{className:"border rounded-lg p-6 text-center",children:[t(is,{className:"h-12 w-12 mx-auto text-gray-400 mb-3"}),t("p",{className:"text-sm text-gray-500",children:o(a?"invoices.noInvoicesWithSub":"invoices.noInvoices")}),!a&&i&&t(Bs,{size:"sm",className:"mt-4",onClick:i,children:o("subscription.viewPricingPlans")})]})]})},oS=v(()=>Promise.resolve().then(function(){return UE}).then(e=>({default:e.default}))),cS=(e,t)=>{if(!t)return"";try{const r=new Date(t);return isNaN(r.getTime())?"":new Intl.DateTimeFormat(e,{month:"long",day:"numeric",year:"numeric"}).format(r)}catch{return""}},lS=({workspace:n})=>{const a=n._id?.toString(),{t:i,formattingLocale:c,fmtNum:l,fmtCents:d}=Cn(),{api:p}=Gn(),{can:h}=Wl(),{settings:f}=Vn(),g=h(Ll.WORKSPACE_BILLING_VIEW),v=h(Ll.WORKSPACE_BILLING_MANAGE),y=f?.workspace?.mode===nS,{subscription:w,loading:x,error:k,updateSubscription:S,refetch:C}=Yn(a),{createCheckoutSession:N}=Zn(a),{cancelSubscription:E,loading:A}=ta(a),{resumeSubscription:_,loading:P}=ra(a),{openBillingPortal:T,loading:R}=Qn(a),{versions:D,loading:I,error:M,refetch:U}=qn(a),L=x||I,O=k||M,{currentVersion:z,latestVersion:F,isDeprecated:B,plansToShow:W}=o(()=>{const e=D?.currentVersion,t=D?.availableVersions||[],r=null!=w?.subscription;let n=null;t.length>0?n=t.reduce((e,t)=>t.version>e.version?t:e):e&&(n=e);const a=!!(r&&n&&e)&&n.version>e.version;return{currentVersion:e,latestVersion:n,hasNewerVersion:a,isDeprecated:a&&r,plansToShow:n?.plans&&n.plans.length>0?n.plans:[]}},[D,w?.subscription]),[V,G]=m(!1),[H,j]=m(null),[$,K]=m(null),q=s(null),[Z,J]=m(!1),[Y,X]=m(!1),Q=s(void 0),ee=s(!1);u(()=>{if(ee.current)return;if(x||!W||0===W.length)return;const e=HC.getState(),t=e.params?.action===Fa;w?.subscription&&!t||(ee.current=!0,t&&(Q.current=e.params,HC.clearParams()),J(!0))},[x,w?.subscription,W]),u(()=>()=>{q.current&&clearTimeout(q.current)},[]);const[te,re]=m(!1),[ne,ae]=m("subscription"),ie=async()=>{await Promise.all([C(),U()])},se=o(()=>Ni(w?.subscription?.stripePriceId,W??[]),[w?.subscription?.stripePriceId,W]),oe=async()=>{if(a){X(!1),G(!0),j(null),K(null);try{await E(),K(i("subscription.cancelSuccess")),await ie()}catch(e){const t=e instanceof Error?e.message:i("subscription.errorCanceling");j(t)}finally{G(!1),q.current&&clearTimeout(q.current),q.current=setTimeout(()=>{j(null),K(null)},5e3)}}};if(L&&!w&&!D)return t(Zl,{});if(!g)return null;const ce=w?.planVersion?._id||null;return a?e("div",{className:"space-y-6",children:[O&&e("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e("div",{children:[t("p",{className:"font-medium",children:i("subscription.errorLoading")}),t("p",{className:"text-sm mt-1",children:O}),t("p",{className:"text-xs mt-2 text-red-600",children:i("subscription.errorLoadingDescription")})]}),t(Bs,{variant:"outline",size:"sm",onClick:ie,disabled:L,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:i("settings.common.retryAction",{loading:String(L)})})]}),H&&e("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e("div",{children:[t("p",{className:"font-medium",children:i("subscription.updateFailed")}),t("p",{className:"text-sm mt-1",children:H})]}),t(Bs,{variant:"outline",size:"sm",onClick:()=>j(null),className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:i("settings.common.dismiss")})]}),$&&e("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e("div",{children:[t("p",{className:"font-medium",children:i("settings.common.success")}),t("p",{className:"text-sm mt-1",children:$})]}),t(Bs,{variant:"outline",size:"sm",onClick:()=>K(null),className:"flex-shrink-0 border-green-200 text-green-700 hover:bg-green-100",children:i("settings.common.dismiss")})]}),t("div",{className:"border-b border-gray-200",children:e("nav",{className:"-mb-px flex gap-6","aria-label":"Subscription tabs",children:[t("button",{type:"button",onClick:()=>ae("subscription"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("subscription"===ne?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:i("subscription.plan")}),t("button",{type:"button",onClick:()=>ae("invoices"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("invoices"===ne?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:i("subscription.invoicesTab")})]})}),"subscription"===ne&&e(r,{children:[L&&e("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-600",children:[t(os,{className:"h-4 w-4 animate-spin flex-shrink-0"}),t("span",{children:i("settings.common.loading")})]}),B&&w?.subscription&&e("div",{className:"bg-amber-50 border border-amber-200 rounded-lg px-4 py-3 flex flex-col sm:flex-row sm:items-center justify-between gap-2",children:[e("div",{className:"flex items-center gap-2 min-w-0",children:[t(ks,{className:"h-4 w-4 text-amber-600 shrink-0"}),e("span",{className:"text-sm text-amber-800",children:[t("span",{className:"font-medium",children:i("subscription.planUpdateAvailable")}),e("span",{className:"text-amber-600",children:[" ","— v",z?.version||"?"," → v",F?.version||"?"]})]})]}),t(Bs,{size:"sm",variant:"outline",className:"shrink-0 border-amber-300 text-amber-700 hover:bg-amber-100",onClick:()=>J(!0),children:i("subscription.viewPlans")})]}),e("div",{className:"space-y-4",children:[e("div",{className:"flex items-center justify-between",children:[t("div",{children:t("p",{className:"text-sm text-gray-600",children:i("subscription.managePlan")})}),e("div",{className:"flex items-center gap-2",children:[(()=>{const e=w?.subscription?.subscriptionStatus===ei,r=w?.subscription?.cancelAtPeriodEnd;return r||A?null:e&&W&&W.length>0?t(Bs,{size:"sm",onClick:()=>J(!0),children:i("subscription.viewPricingPlans")}):w?.subscription&&!e&&v?t(Bs,{variant:"outline",size:"sm",onClick:()=>J(!0),children:i("subscription.changePlanButton")}):!w?.subscription&&W&&W.length>0?t(Bs,{size:"sm",onClick:()=>J(!0),children:i("subscription.viewPricingPlans")}):null})(),t(Bs,{variant:"ghost",size:"sm",progress:L,onClick:ie,disabled:L||V,children:i("settings.common.refreshAction",{loading:String(L)})})]})]}),w?.subscription?(()=>{const a=Ni(w.subscription.stripePriceId,W??[]),s=a?.interval??null,o=a?.currency??w.plan?.currency??n?.billingCurrency??"",u=s&&w.planVersion?ki(w.planVersion,o,s):null,p=o,m=w.planVersion?Ei(w.planVersion,o):null,h=m&&s?Ai(w.planVersion,o,s):null,f=Array.isArray(n?.users)?n.users.length:1,g=m?.includedSeats??0,b=Math.max(0,f-g),x=!!w.plan?.isFreemium,k=null!=u?0===u?i("subscription.free"):d(u,p):x?i("subscription.free"):null,S=s===Ya.Monthly?i("subscription.billingInterval.perMonth"):s===Ya.Quarterly?i("subscription.billingInterval.perQuarter"):s===Ya.Yearly?i("subscription.billingInterval.perYear"):"";return e("div",{className:"border rounded-lg overflow-hidden "+(B?"border-amber-300":"border-gray-200"),children:[w.subscription.subscriptionStatus===Qa&&!w.subscription.cancelAtPeriodEnd&&(()=>{const r=w.subscription.trialEnd||w.subscription.stripeCurrentPeriodEnd,n=r?new Date(r):null,a=n&&!isNaN(n.getTime())?n:null,s=a?Math.max(0,Math.ceil((a.getTime()-Date.now())/864e5)):null,o=null!==s&&s<=3;return e("div",{className:"px-4 py-3 sm:px-5 text-sm flex flex-col sm:flex-row sm:items-center justify-between gap-2 "+(o?"bg-amber-50 text-amber-800 border-b border-amber-200":"bg-blue-50 text-blue-800 border-b border-blue-200"),children:[e("span",{children:[null!==s&&s<=0?i("subscription.trialEnded"):null!==s?i("subscription.trialEndsIn",{days:s}):i("subscription.onTrial")," ",i("subscription.upgradeToKeepAccess")]}),t(Bs,{size:"sm",variant:o?"default":"outline",className:"shrink-0 "+(o?"":"border-blue-300 text-blue-700 hover:bg-blue-100"),onClick:()=>J(!0),children:i("subscription.upgradePlan")})]})})(),e("div",{className:"p-4 sm:p-5 "+(B?"bg-amber-50/50":"bg-gray-50/50"),children:[e("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[t("h3",{className:"text-lg font-semibold text-gray-900",children:w.plan?.name||i("subscription.noPlanAssigned")}),e("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium "+(w.subscription.subscriptionStatus===Xa?w.subscription.cancelAtPeriodEnd?"bg-amber-100 text-amber-800":"bg-green-100 text-green-800":w.subscription.subscriptionStatus===Qa?"bg-blue-100 text-blue-800":w.subscription.subscriptionStatus===ei?"bg-gray-100 text-gray-800":"bg-red-100 text-red-800"),children:[w.subscription.subscriptionStatus===Xa&&(w.subscription.cancelAtPeriodEnd?i("subscription.status.canceling"):i("subscription.status.active")),w.subscription.subscriptionStatus===Qa&&i("subscription.status.trial"),w.subscription.subscriptionStatus===ei&&i("subscription.status.canceled"),w.subscription.subscriptionStatus===ti&&i("subscription.status.pastDue")]}),w.subscription.subscriptionStatus===Qa&&cS(c,w.subscription.trialEnd||w.subscription.stripeCurrentPeriodEnd)&&e("span",{className:"text-xs text-gray-500",children:["(ends"," ",cS(c,w.subscription.trialEnd||w.subscription.stripeCurrentPeriodEnd),")"]}),B&&e("span",{className:"inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-xs font-medium bg-amber-100 text-amber-800",children:[t(ks,{className:"h-3 w-3"}),i("subscription.status.deprecated")]})]}),w.plan?.description&&t("p",{className:"text-sm text-gray-600 mb-3",children:w.plan.description}),!x&&e("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 sm:gap-4",children:[e("div",{children:[e("div",{className:"flex items-baseline gap-1 whitespace-nowrap",children:[t("span",{className:"text-2xl font-bold text-gray-900",children:k||i("invoices.na")}),k&&k!==i("subscription.free")&&S&&t("span",{className:"text-sm text-gray-500",children:S})]}),m&&h&&h>0&&!y&&t("div",{className:"text-xs text-gray-500 mt-1",children:i("subscription.perSeatDisplay",{price:d(h,p),interval:S})}),!y&&m&&h&&h>0&&b>0&&k&&k!==i("subscription.free")&&null!=u&&t("div",{className:"text-xs text-gray-500 mt-1 pt-1 border-t border-gray-200",children:i("subscription.estTotalDisplay",{total:d(u+h*b,p),interval:S,count:b})})]}),(w.subscription.subscriptionStatus===Xa||w.subscription.subscriptionStatus===Qa)&&!w.subscription.cancelAtPeriodEnd&&cS(c,w.subscription.stripeCurrentPeriodEnd)&&e("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[t(Ji,{className:"h-3.5 w-3.5 flex-shrink-0"}),t("span",{children:i("subscription.nextBillingDisplay",{date:cS(c,w.subscription.stripeCurrentPeriodEnd)??""})})]})]}),B&&e("p",{className:"text-xs text-amber-600 mt-2",children:["Version ",z?.version||i("invoices.na")]}),!x&&(w.subscription.subscriptionStatus===Xa||w.subscription.subscriptionStatus===Qa||w.subscription.subscriptionStatus===ti)&&e("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3 mt-4 pt-4 border-t border-gray-200",children:[w.subscription&&v&&w.subscription?.subscriptionId&&t(Bs,{variant:"outline",size:"sm",onClick:()=>T(),disabled:R,progress:R,children:i(R?"subscription.openingPortal":"subscription.managePayment")}),v&&w.subscription?.subscriptionId&&(w.subscription.subscriptionStatus===Xa||w.subscription.subscriptionStatus===Qa)&&t(r,{children:w.subscription.cancelAtPeriodEnd?t(Bs,{variant:"outline",size:"sm",onClick:()=>re(!0),disabled:V||A||P,progress:P,children:w.subscription.subscriptionStatus===Qa?i("subscription.resumeTrial"):i("subscription.resumeTitle")}):t(Bs,{variant:"outline",size:"sm",className:"text-red-600 hover:text-red-700 hover:bg-red-50 border-red-200",onClick:()=>X(!0),disabled:V||A||P,progress:A||V,children:A||V?i("subscription.canceling"):w.subscription.subscriptionStatus===Qa?i("subscription.cancelTrial"):i("subscription.cancelTitle")})})]})]}),w.subscription.subscriptionStatus===ti&&t("div",{className:"px-5 py-3 bg-red-50 border-t border-red-200",children:e("div",{className:"flex items-start gap-3",children:[t(ks,{className:"h-5 w-5 text-red-600 flex-shrink-0 mt-0.5"}),e("div",{children:[t("p",{className:"text-sm font-medium text-red-800",children:i("subscription.paymentPastDue")}),t("p",{className:"text-sm text-red-700 mt-0.5",children:i("subscription.paymentPastDueDescription")}),t(Bs,{variant:"outline",size:"sm",className:"mt-2 border-red-200 text-red-700 hover:bg-red-100",onClick:()=>ae("invoices"),children:i("subscription.viewInvoices")})]})]})}),w.subscription.subscriptionStatus===ti&&w.subscription.dunningState&&w.subscription.dunningState!==ui&&t("div",{className:"px-5 py-3 bg-red-50 border-t border-red-200",children:e("div",{className:"flex items-start gap-3",children:[t(ks,{className:"h-5 w-5 text-red-600 flex-shrink-0 mt-0.5"}),e("div",{children:[t("p",{className:"text-sm font-medium text-red-800",children:w.subscription.dunningState===pi?i("subscription.dunningFinal"):w.subscription.dunningState===mi?i("subscription.dunningSuspended"):i("subscription.dunningRecovery")}),t("p",{className:"text-sm text-red-700 mt-0.5",children:w.subscription.dunningState===mi?i("subscription.dunningSuspendedDescription"):i("subscription.dunningRecoveryDescription")})]})]})}),w.subscription.subscriptionStatus===ri&&t("div",{className:"px-5 py-3 bg-blue-50 border-t border-blue-200",children:e("div",{className:"flex items-start gap-3",children:[t(Ji,{className:"h-5 w-5 text-blue-600 flex-shrink-0 mt-0.5"}),e("div",{children:[t("p",{className:"text-sm font-medium text-blue-800",children:i("subscription.subscriptionPaused")}),t("p",{className:"text-sm text-blue-700 mt-0.5",children:i("subscription.subscriptionPausedDescription")})]})]})}),w.subscription.cancelAtPeriodEnd&&t("div",{className:"px-5 py-3 bg-amber-50 border-t border-amber-200",children:e("div",{className:"flex items-start gap-3",children:[t(Ji,{className:"h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5"}),e("div",{children:[t("p",{className:"text-sm font-medium text-amber-800",children:w.subscription.subscriptionStatus===Qa?i("subscription.scheduledTrialCancellation"):i("subscription.scheduledCancellation")}),t("p",{className:"text-sm text-amber-700 mt-0.5",children:cS(c,w.subscription.subscriptionStatus===Qa&&w.subscription.trialEnd||w.subscription.stripeCurrentPeriodEnd)?e(r,{children:[w.subscription.subscriptionStatus===Qa?i("subscription.trialEndDescription"):i("subscription.cancelEndDescription")," ",t("span",{className:"font-medium",children:cS(c,w.subscription.subscriptionStatus===Qa&&w.subscription.trialEnd||w.subscription.stripeCurrentPeriodEnd)}),"."]}):i("subscription.cancelEndFallback")})]})]})}),w.planVersion&&(()=>{const r=((e,t,r=Ya.Monthly)=>{if(!e?.subscriptionItems)return{features:[],limits:[],quotas:[]};const n=[],a=[],i=[];return e.subscriptionItems.forEach(s=>{const o=s.slug;if(s.type===ci){const t=e.features?.[o]??!1;n.push({item:s,enabled:t})}else if(s.type===li){const t=e.limits?.[o]??0;a.push({item:s,value:t})}else if(s.type===di){const n=t&&e.pricingVariants?.length?Ci(e,t,o,r):tS(e.quotas?.[o],r);null!=n&&i.push({item:s,value:n})}}),{features:n,limits:a,quotas:i}})(w.planVersion,o,s??"monthly");return r.features.length>0||r.limits.length>0||r.quotas.length>0?t("div",{className:"px-4 py-4 sm:px-5 sm:py-5 border-t border-gray-100",children:e("div",{className:"space-y-5",children:[r.features.length>0&&e("div",{children:[t("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:i("subscription.items.features")}),t("ul",{className:"space-y-1.5",children:r.features.sort(e=>e.enabled?-1:1).map(({item:r,enabled:n})=>e("li",{className:"flex items-center gap-2 text-sm",children:[t("span",{className:"w-4 text-center shrink-0 "+(n?"text-green-500":"text-gray-300"),children:n?"✓":"✕"}),t("span",{className:n?"text-gray-700":"text-gray-400",children:r.name})]},r._id))})]}),r.limits.length>0&&e("div",{children:[t("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:i("subscription.items.limits")}),t("ul",{className:"space-y-1.5",children:r.limits.map(({item:r,value:n})=>e("li",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-gray-600",children:r.name}),t("span",{className:"font-medium text-gray-900",children:l(n)})]},r._id))})]}),r.quotas.length>0&&e("div",{children:[t("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:i("subscription.items.quotas")}),t("ul",{className:"space-y-1.5",children:r.quotas.map(({item:r,value:n})=>{const a=rS(n,r.name.toLowerCase(),{currency:o,locale:c}),s=a?a.hasOverage?i("quota.includedWithOverage",{count:a.included,price:a.price,unit:a.unit}):i("quota.includedOnly",{count:a.included}):"—";return t("li",{className:"text-sm",children:e("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-0.5",children:[t("span",{className:"text-gray-600",children:r.name}),t("span",{className:"font-medium text-gray-900 text-xs sm:text-sm",children:s})]})},r._id)})})]}),m&&!y&&e("div",{children:[t("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:i("subscription.seats.title")}),e("div",{className:"bg-gray-50 rounded-lg p-3 space-y-1.5",children:[e("div",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-gray-600",children:i("subscription.seats.members")}),t("span",{className:"font-semibold text-gray-900",children:l(f)})]}),e("div",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-gray-600",children:i("subscription.seats.included")}),t("span",{className:"text-gray-900",children:l(g)})]}),b>0&&e("div",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-gray-600",children:i("subscription.seats.billable")}),e("span",{className:"font-medium text-amber-600",children:[l(b)," ",i("subscription.seats.extra")]})]}),h&&h>0&&e("div",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-gray-600",children:i("subscription.seats.perExtraSeat")}),e("span",{className:"text-gray-900",children:[d(h,o),S]})]}),(m?.maxSeats??0)>0&&e("div",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-gray-600",children:i("subscription.seats.limit")}),t("span",{className:"text-gray-900",children:l(m.maxSeats)})]})]})]}),w.planVersion?.creditGrant?.enabled&&"object"==typeof w.planVersion.creditGrant.creditPackage&&null!==w.planVersion.creditGrant.creditPackage&&e("div",{children:[t("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:i("subscription.items.credits")}),e("div",{className:"bg-purple-50 rounded-lg p-3 space-y-1.5",children:[e("div",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-gray-600",children:w.planVersion.creditGrant.renewOnPeriod?i("subscription.items.creditsPerMonth"):i("subscription.items.creditsOneTime")}),t("span",{className:"font-semibold text-purple-700",children:l("object"==typeof w.planVersion.creditGrant.creditPackage?w.planVersion.creditGrant.creditPackage.creditAmount:0)})]}),e("div",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-gray-600",children:i("subscription.items.creditRenewal")}),t("span",{className:"font-medium text-gray-900",children:w.planVersion.creditGrant.renewOnPeriod?"reset"===w.planVersion.creditGrant.mode?i("subscription.items.creditModeReset"):i("subscription.items.creditModeTopup"):i("subscription.items.creditModeLifetime")})]})]})]})]})}):null})()]})})():e("div",{className:"border rounded-lg p-6 text-center",children:[e("div",{className:"mb-4",children:[t(rs,{className:"h-12 w-12 mx-auto text-gray-400 mb-3"}),t("p",{className:"text-lg font-medium text-gray-700",children:i("subscription.noSubscription")}),t("p",{className:"text-sm text-gray-500 mt-1",children:i("subscription.noSubscriptionDescription")})]}),W&&W.length>0&&t(Bs,{size:"sm",onClick:()=>J(!0),children:i("subscription.viewPricingPlans")})]})]}),!D&&!L&&e("div",{className:"border rounded-lg p-4 text-center",children:[e("div",{className:"text-gray-500 mb-2",children:[t("p",{className:"font-medium",children:i("subscription.errorLoading")}),O&&e("p",{className:"text-sm mt-2 text-red-600",children:["Error: ",O]}),!O&&t("p",{className:"text-sm mt-2",children:i("subscription.noPlansAvailable")})]}),t(Bs,{variant:"outline",size:"sm",progress:L,onClick:ie,disabled:L,className:"mt-4",children:i("settings.common.refreshAction",{loading:String(L)})})]})]}),"invoices"===ne&&e(r,{children:[L&&e("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-600",children:[t(os,{className:"h-4 w-4 animate-spin flex-shrink-0"}),t("span",{children:i("settings.common.loading")})]}),t(sS,{workspaceId:a,hasActiveSubscription:null!==w?.subscription,onViewPricingPlans:()=>ae("subscription"),limit:20})]}),W&&W.length>0&&t(b,{fallback:Z?t("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:e("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t(os,{className:"h-5 w-5 animate-spin"}),t("span",{children:i("settings.common.loading")})]})}):null,children:t(oS,{open:Z,onOpenChange:J,planVersions:W,currentPlanVersionId:ce||null,currentStripePriceId:w?.subscription?.stripePriceId,billingCurrency:n.billingCurrency,trialUsedAt:n.trialUsedAt,workspaceName:n.name,initialInterval:Q.current?.interval,initialCurrency:Q.current?.currency,currentMemberCount:Array.isArray(n?.users)?n.users.length:void 0,onSelectPlan:async(e,t=Ya.Monthly,r)=>{if(!a)return;const s=W?.find(t=>t._id===e),o=r??se?.currency??w?.plan?.currency??n?.billingCurrency??"",c=s?function(e,t,r){const n=xi(e,t);if(!n?.stripePrices)return null;const a=r===Ya.Monthly?"monthlyPriceId":r===Ya.Yearly?"yearlyPriceId":"quarterlyPriceId",i=r===Ya.Monthly?"monthly":r===Ya.Yearly?"yearly":void 0;return n.stripePrices[a]??(i?n.stripePrices[i]:void 0)??null}(s,o,t):null,l=w?.subscription?.stripePriceId;if(!c||!l||c!==l){G(!0),j(null),K(null);try{const{successUrl:r,cancelUrl:n}=function(e){const t="undefined"!=typeof window?window.location.href:void 0;return{successUrl:Ka({action:Oa,status:Va,ws:e,screen:ja},t),cancelUrl:Ka({action:Oa,status:Ga,ws:e,screen:ja},t)}}(a);let c;if(s?.plan?.isFreemium){return w?.subscription?.subscriptionId?(J(!1),void X(!0)):(await p.selectFreePlan(a,e),J(!1),Xt(),await ie(),void K(i("subscription.updateSuccess")))}const l=w?.subscription?.subscriptionStatus===ei;if(c=w?.subscription&&!l?await S(e,{billingInterval:t,successUrl:r,cancelUrl:n}):await N({planVersionId:e,billingInterval:t,currency:o||void 0,successUrl:r,cancelUrl:n}),c&&"checkoutUrl"in c&&c.checkoutUrl)return void Ta(c.checkoutUrl);K(i("subscription.updateSuccess")),await ie()}catch(e){const t=e instanceof Error?e.message:i("subscription.errorProcessing");j(t)}finally{G(!1),q.current&&clearTimeout(q.current),q.current=setTimeout(()=>{j(null),K(null)},5e3)}}},loading:V||L})}),t(Pd,{open:te,onOpenChange:re,children:e(Id,{children:[e(Md,{children:[t(Ld,{children:i("subscription.resumeTitle")}),t(Od,{asChild:!0,children:e("div",{className:"space-y-3",children:[t("p",{children:i("subscription.resumeConfirm")}),e("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4 space-y-2 text-sm",children:[e("div",{className:"flex items-start gap-2",children:[t(ks,{className:"h-4 w-4 text-amber-600 mt-0.5 flex-shrink-0"}),e("span",{children:[i("subscription.resumeChargeDate")," ",w?.subscription?.stripeCurrentPeriodEnd&&cS(c,w.subscription.stripeCurrentPeriodEnd)?t("span",{className:"font-medium",children:cS(c,w.subscription.stripeCurrentPeriodEnd)}):i("subscription.resumeChargeFallback")]})]}),e("div",{className:"flex items-start gap-2",children:[t("span",{className:"text-amber-600 mt-0.5",children:"•"}),t("span",{children:i("subscription.resumeContinue")})]}),e("div",{className:"flex items-start gap-2",children:[t("span",{className:"text-blue-600 mt-0.5",children:"ℹ"}),t("span",{children:i("subscription.resumeCancelAnytime")})]})]})]})})]}),e(Ud,{children:[t(Fd,{disabled:P,children:i("subscription.resumeKeep")}),t(zd,{onClick:async()=>{if(a){re(!1),G(!0),j(null),K(null);try{await _(),K(i("subscription.resumeSuccess")),await ie()}catch(e){const t=e instanceof Error?e.message:i("subscription.errorResuming");j(t)}finally{G(!1),q.current&&clearTimeout(q.current),q.current=setTimeout(()=>{j(null),K(null)},5e3)}}},disabled:P,children:i(P?"subscription.resuming":"subscription.resumeButton")})]})]})}),(()=>{const r=w?.subscription?.subscriptionStatus===Qa,n=r&&w?.subscription?.trialEnd||w?.subscription?.stripeCurrentPeriodEnd;return t(Pd,{open:Y,onOpenChange:X,children:e(Id,{children:[e(Md,{children:[t(Ld,{children:i(r?"subscription.cancelTrialTitle":"subscription.cancelTitle")}),t(Od,{asChild:!0,children:e("div",{className:"space-y-3",children:[t("p",{children:i(r?"subscription.cancelTrialConfirm":"subscription.cancelConfirm")}),e("div",{className:"bg-gray-50 rounded-lg p-4 space-y-2 text-sm",children:[e("div",{className:"flex items-start gap-2",children:[t("span",{className:"text-green-600 mt-0.5",children:"✓"}),e("span",{children:[i(r?"subscription.cancelTrialAccess":"subscription.retainAccess")," ",n&&cS(c,n)?t("span",{className:"font-medium",children:cS(c,n)}):i("subscription.retainAccessFallback")]})]}),e("div",{className:"flex items-start gap-2",children:[t("span",{className:"text-green-600 mt-0.5",children:"✓"}),t("span",{children:i(r?"subscription.cancelTrialNoCharge":"subscription.cancelNotCharged")})]}),e("div",{className:"flex items-start gap-2",children:[t("span",{className:"text-blue-600 mt-0.5",children:"ℹ"}),t("span",{children:i(r?"subscription.cancelTrialResume":"subscription.cancelResumeAnytime")})]})]})]})})]}),e(Ud,{children:[t(Fd,{disabled:A,children:i(r?"subscription.cancelTrialKeep":"subscription.cancelKeep")}),t(zd,{onClick:oe,disabled:A,className:"bg-red-600 hover:bg-red-700 focus:ring-red-600",children:i(A?"subscription.canceling":r?"subscription.cancelTrialButton":"subscription.cancelButton")})]})]})})})()]}):t("div",{className:"border rounded-lg p-4 text-center text-gray-500",children:t("p",{children:i("subscription.invalidWorkspace")})})};function dS(e){return e.replace(/[_-]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function uS(e,t,r){return t+e.toLocaleString(r,{minimumFractionDigits:2,maximumFractionDigits:2})}function pS(e){try{const t=new Date(e);if(isNaN(t.getTime()))return null;const r=new Date;return Math.ceil((t.getTime()-r.getTime())/864e5)}catch{return null}}const mS=()=>{const{quotas:r,loading:n,error:a,refetch:i}=_a(),{t:s,formattingLocale:c,fmtNum:l}=Cn(),{can:d}=Wl(),u=(e,t)=>uS(e,t,c),{response:p}=la(),[h,f]=m(!1),g=o(()=>{const e={};if(!p?.planVersion||!p?.subscription)return e;const t=p.planVersion,n=p.subscription,a=n.billingInterval??"monthly",i=n.plan?.currency??"usd",s=jl(i);if(!r)return e;for(const n of Object.keys(r)){const o=Si(t,i,n,a);if(null==o||o<=0)continue;const c=t.quotas?.[n],l=c?.[a],d=l?.unitSize??1,u=r[n].overage,p=(d>1?Math.ceil(u/d):u)*o/100;e[n]={overageCents:o,unitSize:d,currency:i,currencySymbol:s,estimatedCost:p}}return e},[p,r]),b=o(()=>{const e=p?.subscription?.usageCurrentPeriodEnd||p?.subscription?.stripeCurrentPeriodEnd;if(!e)return null;const t=Jl(e,c);return t?{endDate:t,daysRemaining:pS(e)}:null},[p,c]),v=async()=>{f(!0);try{await i()}finally{f(!1)}};if(n&&!r)return t(Zl,{});if(!d(Ll.WORKSPACE_USAGE_VIEW))return null;if(a)return e("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e("div",{children:[t("p",{className:"font-medium",children:s("usage.errorLoading")}),t("p",{className:"text-sm mt-1",children:a})]}),t(Bs,{variant:"outline",size:"sm",onClick:v,disabled:h,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:s("settings.common.retryAction",{loading:String(h)})})]});const y=function(e){return[...e].sort(([,e],[,t])=>{if(e.hasOverage&&!t.hasOverage)return-1;if(!e.hasOverage&&t.hasOverage)return 1;const r=e.included>0?e.consumed/e.included:e.consumed>0?1:0;return(t.included>0?t.consumed/t.included:t.consumed>0?1:0)-r})}(r?Object.entries(r):[]);if(0===y.length)return e("div",{className:"border rounded-lg p-8 text-center",children:[t(Yi,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),t("p",{className:"text-sm text-gray-600",children:s("usage.noData")}),t("p",{className:"text-xs text-gray-500 mt-1",children:s("usage.noDataHint")})]});const w=y.filter(([,e])=>e.hasOverage).length,x=y.length>0?Math.round(y.reduce((e,[,t])=>e+(t.included>0?t.consumed/t.included*100:0),0)/y.length):0,k=Object.values(g).reduce((e,t)=>e+t.estimatedCost,0),S=Object.values(g)[0]?.currencySymbol??"$";return e("div",{className:"space-y-6",children:[e("div",{className:"flex items-center justify-between",children:[t("p",{className:"text-sm text-gray-600",children:s("usage.description")}),e(Bs,{variant:"ghost",size:"sm",onClick:v,disabled:h,children:[t(us,{className:Oe("h-3.5 w-3.5 me-1.5",h&&"animate-spin")}),s("settings.common.refreshAction",{loading:String(h)})]})]}),b&&e("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50/50 px-4 py-3 text-sm text-gray-600",children:[t(Ji,{className:"h-4 w-4 text-gray-400 flex-shrink-0"}),e("span",{children:[s("usage.resetDateDisplay",{date:b.endDate}),null!==b.daysRemaining&&b.daysRemaining>0&&e("span",{className:"text-gray-500",children:[" ","(",s("usage.daysRemainingDisplay",{count:b.daysRemaining}),")"]}),null!==b.daysRemaining&&b.daysRemaining<=0&&e("span",{className:"text-amber-600 font-medium",children:[" (",s("usage.renewingSoon"),")"]})]})]}),e("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2 sm:gap-3",children:[e("div",{className:"border border-gray-200 rounded-lg p-3 sm:p-4",children:[t("p",{className:"text-xs text-gray-500 font-medium",children:s("usage.totalResources")}),t("p",{className:"text-lg sm:text-xl font-semibold text-gray-900 mt-1",children:l(y.length)})]}),e("div",{className:"border border-gray-200 rounded-lg p-3 sm:p-4",children:[t("p",{className:"text-xs text-gray-500 font-medium",children:s("usage.overallUsage")}),t("p",{className:"text-lg sm:text-xl font-semibold text-gray-900 mt-1",children:l(x)+"%"})]}),e("div",{className:Oe("border rounded-lg p-3 sm:p-4",w>0?"border-red-200 bg-red-50":"border-gray-200"),children:[t("p",{className:"text-xs text-gray-500 font-medium",children:s("usage.inOverage")}),t("p",{className:Oe("text-lg sm:text-xl font-semibold mt-1",w>0?"text-red-600":"text-gray-900"),children:l(w)})]}),w>0&&k>0&&e("div",{className:"border border-red-200 bg-red-50 rounded-lg p-3 sm:p-4",children:[t("p",{className:"text-xs text-gray-500 font-medium",children:s("usage.estOverageCost")}),t("p",{className:"text-lg sm:text-xl font-semibold mt-1 text-red-600",children:u(k,S)})]})]}),w>0&&t("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4",children:e("div",{className:"flex items-start gap-3",children:[t(ks,{className:"h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5 hidden sm:block"}),e("div",{className:"flex-1",children:[t("h3",{className:"text-sm font-semibold text-amber-800 mb-1",children:s("usage.overageDetected")}),t("p",{className:"text-sm text-amber-700",children:s("usage.overageWarning",{count:w})}),k>0&&t("p",{className:"text-sm text-amber-700 font-medium mt-1",children:s("usage.estOverageCharges",{amount:u(k,S)})})]})]})}),t("div",{className:"space-y-3",children:y.map(([e,r])=>{const n=(a=r.consumed,(i=r.included)<=0?a>0?100:0:Math.min(a/i*100,100));var a,i;const s=function(e,t){return t?{bar:"bg-red-500",bg:"bg-red-100",badge:"bg-red-100",badgeText:"text-red-800"}:e>=90?{bar:"bg-amber-500",bg:"bg-amber-100",badge:"bg-amber-100",badgeText:"text-amber-800"}:e>=75?{bar:"bg-yellow-500",bg:"bg-yellow-100",badge:"bg-yellow-100",badgeText:"text-yellow-800"}:{bar:"bg-blue-500",bg:"bg-blue-100",badge:"bg-blue-100",badgeText:"text-blue-800"}}(n,r.hasOverage),o=g[e];return t(hS,{slug:e,quota:r,percent:n,colors:s,pricing:o},e)})})]})};function hS({slug:r,quota:n,percent:a,colors:i,pricing:s}){const{t:o,formattingLocale:c}=Cn(),l=e=>function(e,t){return e>=1e6?(e/1e6).toLocaleString(t,{maximumFractionDigits:1})+"M":e>=1e3?(e/1e3).toLocaleString(t,{maximumFractionDigits:1})+"K":e.toLocaleString(t)}(e,c),d=(e,t)=>uS(e,t,c);return e("div",{className:"border border-gray-200 rounded-lg p-4 sm:p-5",children:[e("div",{className:"flex flex-wrap items-center justify-between gap-y-1 mb-3",children:[e("div",{className:"flex items-center gap-2 min-w-0",children:[t("h3",{className:"text-sm font-semibold text-gray-900 truncate",children:dS(r)}),n.hasOverage&&t("span",{className:Oe("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",i.badge,i.badgeText),children:o("usage.overage")}),!n.hasOverage&&a>=90&&t("span",{className:Oe("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",i.badge,i.badgeText),children:o("usage.almostFull")})]}),e("span",{className:"text-sm text-gray-500 whitespace-nowrap",children:[l(n.consumed)," / ",l(n.included)]})]}),t("div",{className:Oe("h-2 rounded-full w-full",i.bg),children:t("div",{className:Oe("h-2 rounded-full transition-all duration-500",i.bar),style:{width:`${a}%`}})}),e("div",{className:"flex items-center justify-between mt-2 text-xs text-gray-500",children:[t("span",{children:o("usage.percentUsed",{percent:Math.round(a)})}),t("span",{children:n.available>0?o("usage.availableRemaining",{count:l(n.available)}):n.hasOverage?o("usage.overLimitCount",{count:l(n.overage)}):o("usage.fullyUsed")})]}),n.hasOverage&&s&&e("div",{className:"mt-3 pt-3 border-t border-gray-200 space-y-2",children:[e("div",{className:"flex items-center justify-between text-xs",children:[t("span",{className:"text-gray-500",children:o("usage.overageUnits")}),t("span",{className:"font-medium text-gray-900",children:l(n.overage)})]}),e("div",{className:"flex items-center justify-between text-xs",children:[t("span",{className:"text-gray-500",children:o("usage.rate")}),t("span",{className:"font-medium text-gray-900",children:o("usage.rateDisplay",{rate:d(s.overageCents/100,s.currencySymbol),unitSize:s.unitSize})})]}),s.unitSize>1&&e("div",{className:"flex items-center justify-between text-xs",children:[t("span",{className:"text-gray-500",children:o("usage.billableBlocks")}),t("span",{className:"font-medium text-gray-900",children:l(Math.ceil(n.overage/s.unitSize))})]}),e("div",{className:"flex items-center justify-between text-xs pt-2 border-t border-gray-200",children:[t("span",{className:"font-medium text-red-600",children:o("usage.estimatedCharge")}),t("span",{className:"font-semibold text-red-600",children:d(s.estimatedCost,s.currencySymbol)})]})]}),!n.hasOverage&&s&&t("div",{className:"mt-2 text-xs text-gray-500",children:o("usage.overageRateDisplay",{rate:o("usage.rateDisplay",{rate:d(s.overageCents/100,s.currencySymbol),unitSize:s.unitSize})})})]})}function fS(e){const t=n.forwardRef((e,t)=>{const{children:r,...a}=e;if(n.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),i=function(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{const t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}(a,r.props);return r.type!==n.Fragment&&(i.ref=t?Es(t,e):e),n.cloneElement(r,i)}return n.Children.count(r)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gS=Symbol("radix.slottable");function bS(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===gS}var vS=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});n.forwardRef((e,r)=>t(Qs.span,{...e,ref:r,style:{...vS,...e.style}})).displayName="VisuallyHidden";var yS=[" ","Enter","ArrowUp","ArrowDown"],wS=[" ","Enter"],xS="Select",[kS,SS,CS]=yb(xS),[NS]=Vs(xS,[CS,$x]),ES=$x(),[AS,_S]=NS(xS),[PS,TS]=NS(xS),RS=r=>{const{__scopeSelect:a,children:i,open:s,defaultOpen:o,onOpenChange:c,value:l,defaultValue:d,onValueChange:u,dir:p,name:m,autoComplete:h,disabled:f,required:g,form:b}=r,v=ES(a),[y,w]=n.useState(null),[x,k]=n.useState(null),[S,C]=n.useState(!1),N=xb(p),[E,A]=Zs({prop:s,defaultProp:o??!1,onChange:c,caller:xS}),[_,P]=Zs({prop:l,defaultProp:d,onChange:u,caller:xS}),T=n.useRef(null),R=!y||(b||!!y.closest("form")),[D,I]=n.useState(new Set),M=Array.from(D).map(e=>e.props.value).join(";");return t(ck,{...v,children:e(AS,{required:g,scope:a,trigger:y,onTriggerChange:w,valueNode:x,onValueNodeChange:k,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Ks(),value:_,onValueChange:P,open:E,onOpenChange:A,dir:N,triggerPointerDownPosRef:T,disabled:f,children:[t(kS.Provider,{scope:a,children:t(PS,{scope:r.__scopeSelect,onNativeOptionAdd:n.useCallback(e=>{I(t=>new Set(t).add(e))},[]),onNativeOptionRemove:n.useCallback(e=>{I(t=>{const r=new Set(t);return r.delete(e),r})},[]),children:i})}),R?e(fC,{"aria-hidden":!0,required:g,tabIndex:-1,name:m,autoComplete:h,value:_,onChange:e=>P(e.target.value),disabled:f,form:b,children:[void 0===_?t("option",{value:""}):null,Array.from(D)]},M):null]})})};RS.displayName=xS;var DS="SelectTrigger",IS=n.forwardRef((e,r)=>{const{__scopeSelect:a,disabled:i=!1,...s}=e,o=ES(a),c=_S(DS,a),l=c.disabled||i,d=As(r,c.onTriggerChange),u=SS(a),p=n.useRef("touch"),[m,h,f]=bC(e=>{const t=u().filter(e=>!e.disabled),r=t.find(e=>e.value===c.value),n=vC(t,e,r);void 0!==n&&c.onValueChange(n.value)}),g=e=>{l||(c.onOpenChange(!0),f()),e&&(c.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t(lk,{asChild:!0,...o,children:t(Qs.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":gC(c.value)?"":void 0,...s,ref:d,onClick:Ws(s.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:Ws(s.onPointerDown,e=>{p.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:Ws(s.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||yS.includes(e.key)&&(g(),e.preventDefault())})})})});IS.displayName=DS;var MS="SelectValue",US=n.forwardRef((e,n)=>{const{__scopeSelect:a,className:i,style:s,children:o,placeholder:c="",...l}=e,d=_S(MS,a),{onValueNodeHasChildrenChange:u}=d,p=void 0!==o,m=As(n,d.onValueNodeChange);return Hs(()=>{u(p)},[u,p]),t(Qs.span,{...l,ref:m,style:{pointerEvents:"none"},children:gC(d.value)?t(r,{children:c}):o})});US.displayName=MS;var LS=n.forwardRef((e,r)=>{const{__scopeSelect:n,children:a,...i}=e;return t(Qs.span,{"aria-hidden":!0,...i,ref:r,children:a||"▼"})});LS.displayName="SelectIcon";var OS=e=>t(wo,{asChild:!0,...e});OS.displayName="SelectPortal";var zS="SelectContent",FS=n.forwardRef((e,r)=>{const a=_S(zS,e.__scopeSelect),[i,s]=n.useState();if(Hs(()=>{s(new DocumentFragment)},[]),!a.open){const r=i;return r?y.createPortal(t(WS,{scope:e.__scopeSelect,children:t(kS.Slot,{scope:e.__scopeSelect,children:t("div",{children:e.children})})}),r):null}return t(HS,{...e,ref:r})});FS.displayName=zS;var BS=10,[WS,VS]=NS(zS),GS=function(e){const r=fS(e),a=n.forwardRef((e,a)=>{const{children:i,...s}=e,o=n.Children.toArray(i),c=o.find(bS);if(c){const e=c.props.children,i=o.map(t=>t===c?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t);return t(r,{...s,ref:a,children:n.isValidElement(e)?n.cloneElement(e,void 0,i):null})}return t(r,{...s,ref:a,children:i})});return a.displayName=`${e}.Slot`,a}("SelectContent.RemoveScroll"),HS=n.forwardRef((e,r)=>{const{__scopeSelect:a,position:i="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:c,side:l,sideOffset:d,align:u,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:b,avoidCollisions:v,...y}=e,w=_S(zS,a),[x,k]=n.useState(null),[S,C]=n.useState(null),N=As(r,e=>k(e)),[E,A]=n.useState(null),[_,P]=n.useState(null),T=SS(a),[R,D]=n.useState(!1),I=n.useRef(!1);n.useEffect(()=>{if(x)return yc(x)},[x]),Co();const M=n.useCallback(e=>{const[t,...r]=T().map(e=>e.ref.current),[n]=r.slice(-1),a=document.activeElement;for(const r of e){if(r===a)return;if(r?.scrollIntoView({block:"nearest"}),r===t&&S&&(S.scrollTop=0),r===n&&S&&(S.scrollTop=S.scrollHeight),r?.focus(),document.activeElement!==a)return}},[T,S]),U=n.useCallback(()=>M([E,x]),[M,E,x]);n.useEffect(()=>{R&&U()},[R,U]);const{onOpenChange:L,triggerPointerDownPosRef:O}=w;n.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(O.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(O.current?.y??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():x.contains(r.target)||L(!1),document.removeEventListener("pointermove",t),O.current=null};return null!==O.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[x,L,O]),n.useEffect(()=>{const e=()=>L(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[L]);const[z,F]=bC(e=>{const t=T().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=vC(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),B=n.useCallback((e,t,r)=>{const n=!I.current&&!r;(void 0!==w.value&&w.value===t||n)&&(A(e),n&&(I.current=!0))},[w.value]),W=n.useCallback(()=>x?.focus(),[x]),V=n.useCallback((e,t,r)=>{const n=!I.current&&!r;(void 0!==w.value&&w.value===t||n)&&P(e)},[w.value]),G="popper"===i?$S:jS,H=G===$S?{side:l,sideOffset:d,align:u,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:b,avoidCollisions:v}:{};return t(WS,{scope:a,content:x,viewport:S,onViewportChange:C,itemRefCallback:B,selectedItem:E,onItemLeave:W,itemTextRefCallback:V,focusSelectedItem:U,selectedItemText:_,position:i,isPositioned:R,searchRef:z,children:t(pc,{as:GS,allowPinchZoom:!0,children:t(mo,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Ws(s,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:t(so,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:t(G,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault(),...y,...H,onPlaced:()=>D(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Ws(y.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||F(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=T().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout(()=>M(t)),e.preventDefault()}})})})})})})});HS.displayName="SelectContentImpl";var jS=n.forwardRef((e,r)=>{const{__scopeSelect:a,onPlaced:i,...s}=e,o=_S(zS,a),c=VS(zS,a),[l,d]=n.useState(null),[u,p]=n.useState(null),m=As(r,e=>p(e)),h=SS(a),f=n.useRef(!1),g=n.useRef(!0),{viewport:b,selectedItem:v,selectedItemText:y,focusSelectedItem:w}=c,x=n.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&u&&b&&v&&y){const e=o.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),r=o.valueNode.getBoundingClientRect(),n=y.getBoundingClientRect();if("rtl"!==o.dir){const a=n.left-t.left,i=r.left-a,s=e.left-i,o=e.width+s,c=Math.max(o,t.width),d=window.innerWidth-BS,u=pv(i,[BS,Math.max(BS,d-c)]);l.style.minWidth=o+"px",l.style.left=u+"px"}else{const a=t.right-n.right,i=window.innerWidth-r.right-a,s=window.innerWidth-e.right-i,o=e.width+s,c=Math.max(o,t.width),d=window.innerWidth-BS,u=pv(i,[BS,Math.max(BS,d-c)]);l.style.minWidth=o+"px",l.style.right=u+"px"}const a=h(),s=window.innerHeight-2*BS,c=b.scrollHeight,d=window.getComputedStyle(u),p=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),w=p+m+c+parseInt(d.paddingBottom,10)+g,x=Math.min(5*v.offsetHeight,w),k=window.getComputedStyle(b),S=parseInt(k.paddingTop,10),C=parseInt(k.paddingBottom,10),N=e.top+e.height/2-BS,E=s-N,A=v.offsetHeight/2,_=p+m+(v.offsetTop+A),P=w-_;if(_<=N){const e=a.length>0&&v===a[a.length-1].ref.current;l.style.bottom="0px";const t=u.clientHeight-b.offsetTop-b.offsetHeight,r=_+Math.max(E,A+(e?C:0)+t+g);l.style.height=r+"px"}else{const e=a.length>0&&v===a[0].ref.current;l.style.top="0px";const t=Math.max(N,p+b.offsetTop+(e?S:0)+A)+P;l.style.height=t+"px",b.scrollTop=_-N+b.offsetTop}l.style.margin=`${BS}px 0`,l.style.minHeight=x+"px",l.style.maxHeight=s+"px",i?.(),requestAnimationFrame(()=>f.current=!0)}},[h,o.trigger,o.valueNode,l,u,b,v,y,o.dir,i]);Hs(()=>x(),[x]);const[k,S]=n.useState();Hs(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const C=n.useCallback(e=>{e&&!0===g.current&&(x(),w?.(),g.current=!1)},[x,w]);return t(KS,{scope:a,contentWrapper:l,shouldExpandOnScrollRef:f,onScrollButtonChange:C,children:t("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:t(Qs.div,{...s,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});jS.displayName="SelectItemAlignedPosition";var $S=n.forwardRef((e,r)=>{const{__scopeSelect:n,align:a="start",collisionPadding:i=BS,...s}=e,o=ES(n);return t(dk,{...o,...s,ref:r,align:a,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});$S.displayName="SelectPopperPosition";var[KS,qS]=NS(zS,{}),ZS="SelectViewport",JS=n.forwardRef((a,i)=>{const{__scopeSelect:s,nonce:o,...c}=a,l=VS(ZS,s),d=qS(ZS,s),u=As(i,l.onViewportChange),p=n.useRef(0);return e(r,{children:[t("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),t(kS.Slot,{scope:s,children:t(Qs.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:Ws(c.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=d;if(n?.current&&r){const e=Math.abs(p.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*BS,a=parseFloat(r.style.minHeight),i=parseFloat(r.style.height),s=Math.max(a,i);if(s<n){const a=s+e,i=Math.min(n,a),o=a-i;r.style.height=i+"px","0px"===r.style.bottom&&(t.scrollTop=o>0?o:0,r.style.justifyContent="flex-end")}}}p.current=t.scrollTop})})})]})});JS.displayName=ZS;var YS="SelectGroup",[XS,QS]=NS(YS);n.forwardRef((e,r)=>{const{__scopeSelect:n,...a}=e,i=Ks();return t(XS,{scope:n,id:i,children:t(Qs.div,{role:"group","aria-labelledby":i,...a,ref:r})})}).displayName=YS;var eC="SelectLabel",tC=n.forwardRef((e,r)=>{const{__scopeSelect:n,...a}=e,i=QS(eC,n);return t(Qs.div,{id:i.id,...a,ref:r})});tC.displayName=eC;var rC="SelectItem",[nC,aC]=NS(rC),iC=n.forwardRef((e,r)=>{const{__scopeSelect:a,value:i,disabled:s=!1,textValue:o,...c}=e,l=_S(rC,a),d=VS(rC,a),u=l.value===i,[p,m]=n.useState(o??""),[h,f]=n.useState(!1),g=As(r,e=>d.itemRefCallback?.(e,i,s)),b=Ks(),v=n.useRef("touch"),y=()=>{s||(l.onValueChange(i),l.onOpenChange(!1))};if(""===i)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t(nC,{scope:a,value:i,disabled:s,textId:b,isSelected:u,onItemTextChange:n.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:t(kS.ItemSlot,{scope:a,value:i,disabled:s,textValue:p,children:t(Qs.div,{role:"option","aria-labelledby":b,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...c,ref:g,onFocus:Ws(c.onFocus,()=>f(!0)),onBlur:Ws(c.onBlur,()=>f(!1)),onClick:Ws(c.onClick,()=>{"mouse"!==v.current&&y()}),onPointerUp:Ws(c.onPointerUp,()=>{"mouse"===v.current&&y()}),onPointerDown:Ws(c.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:Ws(c.onPointerMove,e=>{v.current=e.pointerType,s?d.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ws(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Ws(c.onKeyDown,e=>{""!==d.searchRef?.current&&" "===e.key||(wS.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});iC.displayName=rC;var sC="SelectItemText",oC=n.forwardRef((a,i)=>{const{__scopeSelect:s,className:o,style:c,...l}=a,d=_S(sC,s),u=VS(sC,s),p=aC(sC,s),m=TS(sC,s),[h,f]=n.useState(null),g=As(i,e=>f(e),p.onItemTextChange,e=>u.itemTextRefCallback?.(e,p.value,p.disabled)),b=h?.textContent,v=n.useMemo(()=>t("option",{value:p.value,disabled:p.disabled,children:b},p.value),[p.disabled,p.value,b]),{onNativeOptionAdd:w,onNativeOptionRemove:x}=m;return Hs(()=>(w(v),()=>x(v)),[w,x,v]),e(r,{children:[t(Qs.span,{id:p.textId,...l,ref:g}),p.isSelected&&d.valueNode&&!d.valueNodeHasChildren?y.createPortal(l.children,d.valueNode):null]})});oC.displayName=sC;var cC="SelectItemIndicator",lC=n.forwardRef((e,r)=>{const{__scopeSelect:n,...a}=e;return aC(cC,n).isSelected?t(Qs.span,{"aria-hidden":!0,...a,ref:r}):null});lC.displayName=cC;var dC="SelectScrollUpButton";n.forwardRef((e,r)=>{const a=VS(dC,e.__scopeSelect),i=qS(dC,e.__scopeSelect),[s,o]=n.useState(!1),c=As(r,i.onScrollButtonChange);return Hs(()=>{if(a.viewport&&a.isPositioned){let e=function(){const e=t.scrollTop>0;o(e)};const t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),s?t(pC,{...e,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=dC;var uC="SelectScrollDownButton";n.forwardRef((e,r)=>{const a=VS(uC,e.__scopeSelect),i=qS(uC,e.__scopeSelect),[s,o]=n.useState(!1),c=As(r,i.onScrollButtonChange);return Hs(()=>{if(a.viewport&&a.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;o(r)};const t=a.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[a.viewport,a.isPositioned]),s?t(pC,{...e,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=a;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=uC;var pC=n.forwardRef((e,r)=>{const{__scopeSelect:a,onAutoScroll:i,...s}=e,o=VS("SelectScrollButton",a),c=n.useRef(null),l=SS(a),d=n.useCallback(()=>{null!==c.current&&(window.clearInterval(c.current),c.current=null)},[]);return n.useEffect(()=>()=>d(),[d]),Hs(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),t(Qs.div,{"aria-hidden":!0,...s,ref:r,style:{flexShrink:0,...s.style},onPointerDown:Ws(s.onPointerDown,()=>{null===c.current&&(c.current=window.setInterval(i,50))}),onPointerMove:Ws(s.onPointerMove,()=>{o.onItemLeave?.(),null===c.current&&(c.current=window.setInterval(i,50))}),onPointerLeave:Ws(s.onPointerLeave,()=>{d()})})}),mC=n.forwardRef((e,r)=>{const{__scopeSelect:n,...a}=e;return t(Qs.div,{"aria-hidden":!0,...a,ref:r})});mC.displayName="SelectSeparator";var hC="SelectArrow";n.forwardRef((e,r)=>{const{__scopeSelect:n,...a}=e,i=ES(n),s=_S(hC,n),o=VS(hC,n);return s.open&&"popper"===o.position?t(uk,{...i,...a,ref:r}):null}).displayName=hC;var fC=n.forwardRef(({__scopeSelect:e,value:r,...a},i)=>{const s=n.useRef(null),o=As(i,s),c=Wd(r);return n.useEffect(()=>{const e=s.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(c!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[c,r]),t(Qs.select,{...a,style:{...vS,...a.style},ref:o,defaultValue:r})});function gC(e){return""===e||void 0===e}function bC(e){const t=eo(e),r=n.useRef(""),a=n.useRef(0),i=n.useCallback(e=>{const n=r.current+e;t(n),function e(t){r.current=t,window.clearTimeout(a.current),""!==t&&(a.current=window.setTimeout(()=>e(""),1e3))}(n)},[t]),s=n.useCallback(()=>{r.current="",window.clearTimeout(a.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(a.current),[]),[r,i,s]}function vC(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=r?e.indexOf(r):-1;let i=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(a,0));1===n.length&&(i=i.filter(e=>e!==r));const s=i.find(e=>e.textValue.toLowerCase().startsWith(n.toLowerCase()));return s!==r?s:void 0}fC.displayName="SelectBubbleInput";var yC=IS,wC=LS,xC=OS,kC=FS,SC=JS,CC=tC,NC=iC,EC=oC,AC=lC,_C=mC;const PC=RS,TC=n.forwardRef(({className:r,children:n,...a},i)=>e(yC,{ref:i,className:Oe("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",r),...a,children:[n,t(wC,{asChild:!0,children:t(pl,{className:"h-4 w-4 opacity-50"})})]}));TC.displayName=yC.displayName;const RC=n.forwardRef(({className:e,children:r,position:a="popper",...i},s)=>{const{container:o}=n.useContext(yl);return t(xC,{container:o,children:t(kC,{ref:s,className:Oe("relative z-50 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","popper"===a&&"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:a,...i,children:t(SC,{className:Oe("p-1","popper"===a&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r})})})});RC.displayName=kC.displayName;n.forwardRef(({className:e,...r},n)=>t(CC,{ref:n,className:Oe("px-2 py-1.5 text-sm font-semibold",e),...r})).displayName=CC.displayName;const DC=n.forwardRef(({className:r,children:n,...a},i)=>e(NC,{ref:i,className:Oe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 ps-2 pe-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),...a,children:[t("span",{className:"absolute end-2 flex h-3.5 w-3.5 items-center justify-center",children:t(AC,{children:t(hl,{className:"h-4 w-4"})})}),t(EC,{children:n})]}));DC.displayName=NC.displayName;function IC(e,t){const{response:r}=la();return o(()=>{if(!e)return{hasSeatPricing:!1,memberCount:0,includedSeats:0,maxUsers:0,maxSeats:0,limitSource:"none",billableSeats:0,availableSeats:1/0,isAtMax:!1,isNearMax:!1,perSeatPriceCents:null,currency:"",canInvite:!0,inviteBlockReason:null,inviteBlockMessageKey:null,inviteBlockMessageValues:null};const n=e.users?.length??0,a=r?.planVersion,i=r?.subscription,s=e.billingCurrency||"usd",o=_i({planVersion:a,currency:s,settingsMaxUsers:t?.settingsMaxUsers}),{maxUsers:c,hasSeatPricing:l,includedSeats:d}=o,u=l?Math.max(0,n-d):0,p=c>0?Math.max(0,c-n):1/0,m=c>0&&n>=c,h=c>0&&n>=.8*c&&!m,f=l&&a?Ai(a,s,i?.billingInterval??"monthly"):null,g=Pi({memberCount:n,maxUsersConfig:o});return{hasSeatPricing:l,memberCount:n,includedSeats:d,maxUsers:c,maxSeats:c,limitSource:o.source,billableSeats:u,availableSeats:p,isAtMax:m,isNearMax:h,perSeatPriceCents:f,currency:s,canInvite:g.canInvite,inviteBlockReason:g.blockReason,inviteBlockMessageKey:g.blockMessageKey,inviteBlockMessageValues:g.blockMessageValues}},[r,e,t?.settingsMaxUsers])}n.forwardRef(({className:e,...r},n)=>t(_C,{ref:n,className:Oe("-mx-1 my-1 h-px bg-muted",e),...r})).displayName=_C.displayName;const MC=({workspace:n})=>{const{user:a}=ZC(),{t:i,fmtNum:s,fmtCents:o}=Cn(),[c,l]=m(0),[d,p]=m(!1),[h,f]=m([]),[g,b]=m(null),{getUsers:v,removeUser:y,updateUser:w}=jC(),{settings:x}=Vn(),{can:k}=Wl(),{response:S}=la(),C=IC(n,{settingsMaxUsers:x?.workspace?.maxWorkspaceUsers});u(()=>{n&&(p(!0),v(n._id).then(e=>{f(e)}).catch(e=>{$e(e,{component:"WorkspaceSettingsUsers",action:"getUsers",metadata:{workspaceId:n._id}})}).finally(()=>{p(!1)}))},[n,c,v]);const N=()=>{l(e=>e+1)},E=x?.workspace?.mode===nS;if(d||!n)return t(Zl,{});if(E)return null;const A=e=>"string"==typeof e?{name:i("users.unknownUser"),email:e,id:e,role:"-"}:{name:e.name,email:e.email,id:e._id},_=h.map(e=>({...e,...A(e.user)})),P=k(Ll.WORKSPACE_MEMBERS_INVITE),T=k(Ll.WORKSPACE_MEMBERS_REMOVE),R=k(Ll.WORKSPACE_MEMBERS_ROLE_CHANGE),{hasSeatPricing:D,includedSeats:I,maxUsers:M,canInvite:U,inviteBlockReason:L,inviteBlockMessageKey:O,inviteBlockMessageValues:z,perSeatPriceCents:F,currency:B}=C,W=h.length,V=S?.subscription?.billingInterval??"monthly",G=D&&W>=I;return e("div",{children:[!P&&!T&&!R&&t(Kl,{descriptionKey:"users.adminOnly"}),P&&t("div",{className:"mb-4",children:U?e("div",{children:[t(UC,{onInvite:N,workspaceId:n._id}),G&&F&&F>0&&t("div",{className:"flex items-center gap-1.5 mt-2 text-xs text-amber-600 bg-amber-50 px-3 py-1.5 rounded-md",children:t("span",{children:i("users.extraSeatCost",{price:o(F,B),interval:V})})})]}):t("div",{className:"flex items-center justify-between p-3 bg-red-50 border border-red-100 rounded-md",children:e("div",{children:[t("p",{className:"text-sm font-medium text-red-700",children:i("users.limitReached",{reason:L??"member_limit_reached"})}),t("p",{className:"text-xs text-red-600 mt-0.5",children:O?i(O,z??void 0):""})]})})}),(D||M>0)&&e("div",{className:"mb-4 rounded-lg border bg-gray-50 p-4",children:[e("div",{className:"flex items-center justify-between mb-2",children:[t("h4",{className:"text-sm font-semibold text-gray-900",children:i("users.seatHeading",{hasSeatPricing:String(D)})}),M>0&&e("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full "+(W>=M?"bg-red-100 text-red-700":W>=.8*M?"bg-amber-100 text-amber-700":"bg-emerald-100 text-emerald-700"),children:[s(W)," / ",s(M)]})]}),M>0&&t("div",{className:"w-full h-1.5 bg-gray-200 rounded-full mb-3",children:t("div",{className:"h-1.5 rounded-full transition-all "+(W>=M?"bg-red-500":W>=.8*M?"bg-amber-500":"bg-emerald-500"),style:{width:`${Math.min(100,W/M*100)}%`}})}),e("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[t("div",{children:D?e(r,{children:[t("span",{className:"text-gray-900 font-medium",children:s(I)})," ",i("users.included"),F&&F>0&&e("span",{className:"text-gray-400",children:[" ","· ",o(F,B),i("users.perExtraSeat")]})]}):e("span",{children:[t("span",{className:"text-gray-900 font-medium",children:s(M)})," ",i("users.maxMembers")]})}),M>0?e("span",{children:[s(Math.max(0,M-W))," ",i("users.available")]}):t("span",{className:"text-gray-400",children:i("users.noMemberLimit")})]})]}),e("div",{className:"mb-4 flex items-center justify-between",children:[t("div",{children:t("div",{className:"text-sm text-gray-600",children:i("users.memberCount",{count:W})})}),t("div",{children:t(Bs,{variant:"ghost",size:"sm",onClick:N,progress:d,children:i("settings.common.refreshAction",{loading:String(d)})})})]}),t("ul",{className:"space-y-2",children:_.map((r,s)=>{const o=r.id===a?.id,c=("object"==typeof n.createdBy&&null!==n.createdBy?n.createdBy._id:n.createdBy)===r.id;return e("li",{className:"border rounded p-3",children:[e("div",{className:"flex items-center justify-between gap-2",children:[e("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0",children:[t("div",{className:"w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center text-sm font-medium shrink-0",children:r.name.charAt(0).toUpperCase()}),e("div",{className:"min-w-0",children:[t("div",{className:"font-medium text-sm truncate",children:r.name}),t("div",{className:"text-xs text-gray-500 truncate",children:r.email})]})]}),e("div",{className:"flex items-center gap-1 shrink-0",children:[o&&t("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-0.5 rounded",children:i("users.you")}),c&&t("span",{className:"text-xs bg-purple-100 text-purple-800 px-2 py-0.5 rounded",children:i("users.owner")})]})]}),R&&e("div",{className:"flex items-center gap-2 mt-2 pt-2 border-t border-gray-100 sm:mt-0 sm:pt-0 sm:border-0",children:[e("div",{className:"relative flex-1 sm:flex-initial",children:[e(PC,{disabled:o||!R||c||g===r.id,value:r.role,onValueChange:e=>{return t=n._id,a=r.id,i=e,void(Ml(n,a)?$e(new Error("Cannot change the role of the workspace owner"),{component:"WorkspaceSettingsUsers",action:"handleUpdateRole",metadata:{workspaceId:t,userId:a,role:i}}):(b(a),w(t,a,{role:i}).then(()=>{N()}).catch(e=>{$e(e,{component:"WorkspaceSettingsUsers",action:"handleUpdateRole",metadata:{workspaceId:t,userId:a,role:i}})}).finally(()=>{b(null)})));var t,a,i},children:[t(TC,{children:t(US,{placeholder:i("users.selectRole")})}),t(RC,{children:n?.roles.map(e=>t(DC,{value:e,children:e},e))})]}),g===r.id&&t("div",{className:"absolute end-8 top-1/2 -translate-y-1/2 pointer-events-none",children:t(os,{className:"h-4 w-4 animate-spin text-gray-500"})})]}),!o&&!c&&T&&t(Bs,{variant:"destructive",size:"sm",startIcon:t(xs,{}),onClick:()=>{return e=r.id,void(Ml(n,e)?$e(new Error("Cannot remove the workspace owner"),{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:n._id,userId:e}}):y(n._id,e).then(()=>{N()}).catch(t=>{$e(t,{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:n._id,userId:e}})}));var e}})]})]},s)})}),0===h.length&&t("div",{className:"text-center py-8 text-gray-500",children:i("users.noMembers")})]})};function UC({onInvite:r,workspaceId:n}){const{t:a}=Cn(),{addUser:i,getWorkspace:o}=jC(),{settings:c}=Vn(),[l,d]=m(""),[p,h]=m("admin"),[f,g]=m(!1),[b,v]=m(null),[y,w]=m(null),[x,k]=m(null),S=s(null),C=c?.workspace.roles??x?.roles??[];u(()=>()=>{S.current&&clearTimeout(S.current)},[]),u(()=>{n&&o(n).then(k)},[n]);const N=()=>{v(null),w(null),d(""),h("admin")};return e("div",{className:"flex gap-2 flex-col gap-y-2",children:[b&&t("div",{className:"text-red-500",children:b}),y&&t("div",{className:"text-green-500",children:y}),e("div",{children:[t(nb,{children:a("users.inviteByEmail")}),t(hb,{type:"email",value:l,onChange:e=>d(e.target.value),placeholder:"example@example.com"})]}),e("div",{children:[t(nb,{children:a("users.role")}),e(PC,{value:p,onValueChange:h,children:[t(TC,{children:t(US,{placeholder:a("users.selectRole")})}),t(RC,{children:C.map(e=>t(DC,{value:e,children:e},e))})]})]}),t("div",{children:t(Bs,{progress:f,onClick:async()=>{const e=l.trim();if(!e)return void v(a("users.emailRequired"));/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?(g(!0),await i(n,e,p).then(()=>{w(a("users.inviteSuccess")),r?.()}).catch(t=>{$e(t,{component:"InviteMember",action:"addUser",metadata:{workspaceId:n,email:e,role:p}}),v(t instanceof Error?t.message:a("users.inviteFailed"))}).finally(()=>{g(!1),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{N()},6e3)})):v(a("users.invalidEmail"))},disabled:f||!l||!p,children:f?a("users.inviting"):a("users.inviteAs",{role:p})})})]})}const LC=({workspace:r,section:n,setSection:a})=>{const{t:i}=Cn(),{settings:s}=Vn(),{can:o}=Wl(),{appPermissions:c}=Na(),l=s?.workspace?.mode===nS,d=o(Ll.WORKSPACE_DELETE),u=c&&Object.keys(c).length>0;return e("div",{className:"w-44 sm:w-56 h-full flex flex-col space-y-4 sm:space-y-6 shrink-0",children:[r&&t("div",{className:"border-b p-2 py-4",children:e("div",{className:"flex items-center gap-x-2",children:[r.image&&r.image.trim()&&t("div",{className:"bg-blue-100 rounded flex items-center justify-center text-blue-600 font-medium px-0.5 py-0.5",style:{width:"40px",height:"40px",minWidth:"40px",minHeight:"40px"},children:t("img",{src:r.image,className:"w-full h-full object-contain",style:{width:"36px",height:"36px",maxWidth:"36px",maxHeight:"36px",objectFit:"contain"},alt:r.name})}),e("div",{className:Oe("flex-1 min-w-0",r.image?"":"ps-2"),children:[t("div",{className:"font-medium text-sm line-clamp-1 text-ellipsis overflow-hidden",children:r.name}),t("div",{className:"text-xs text-gray-500",children:r.workspaceId})]})]})}),t(OC,{title:i("settings.sidebar.account"),children:t(zC,{activeSection:n,icon:t(Ss,{className:"h-3.5 w-3.5"}),label:i("settings.sidebar.profile"),section:FC.Profile,onClick:()=>a(FC.Profile)})}),e(OC,{title:i("settings.sidebar.workspace"),children:[o(Ll.WORKSPACE_SETTINGS_VIEW)&&t(zC,{activeSection:n,icon:t(ms,{className:"h-3.5 w-3.5"}),label:i("settings.sidebar.general"),section:FC.General,onClick:()=>a(FC.General)}),!l&&o(Ll.WORKSPACE_MEMBERS_VIEW)&&t(zC,{activeSection:n,icon:t(Cs,{className:"h-3.5 w-3.5"}),label:i("settings.sidebar.users"),section:FC.Users,onClick:()=>a(FC.Users)}),o(Ll.WORKSPACE_BILLING_VIEW)&&t(zC,{activeSection:n,icon:t(rs,{className:"h-3.5 w-3.5"}),label:i("settings.sidebar.subscription"),section:FC.Subscription,onClick:()=>a(FC.Subscription)}),o(Ll.WORKSPACE_USAGE_VIEW)&&t(zC,{activeSection:n,icon:t(Yi,{className:"h-3.5 w-3.5"}),label:i("settings.sidebar.usage"),section:FC.Usage,onClick:()=>a(FC.Usage)}),o(Ll.WORKSPACE_BILLING_VIEW)&&t(zC,{activeSection:n,icon:t(ts,{className:"h-3.5 w-3.5"}),label:i("settings.sidebar.credits"),section:FC.Credits,onClick:()=>a(FC.Credits)}),o(Ll.WORKSPACE_FEATURES_VIEW)&&t(zC,{activeSection:n,icon:t(ys,{className:"h-3.5 w-3.5"}),label:i("settings.sidebar.features"),section:FC.Features,onClick:()=>a(FC.Features)}),t(zC,{activeSection:n,icon:t(qi,{className:"h-3.5 w-3.5"}),label:i("settings.sidebar.notifications"),section:FC.Notifications,onClick:()=>a(FC.Notifications)}),u&&!l&&t(zC,{activeSection:n,icon:t(fs,{className:"h-3.5 w-3.5"}),label:i("settings.sidebar.permissions"),section:FC.Permissions,onClick:()=>a(FC.Permissions)}),d&&!l&&t(zC,{activeSection:n,icon:t(ks,{className:"h-3.5 w-3.5"}),label:i("settings.sidebar.danger"),section:FC.Danger,onClick:()=>a(FC.Danger)})]})]})};function OC({title:r,children:n}){return e("div",{className:"px-2 flex flex-col space-y-1",children:[t("div",{className:"text-xs font-bold mb-2 text-gray-500 uppercase tracking-wide px-2",children:r}),n]})}function zC({icon:t,label:r,section:n,onClick:a,activeSection:i}){return e("button",{className:Oe("flex w-full text-start px-2 py-1 rounded text-sm items-center gap-x-1",n===i?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-200 hover:text-gray-700"),onClick:()=>a(n),children:[t,r]})}const FC={Profile:"profile",General:"general",Users:"users",Subscription:"subscription",Usage:"usage",Credits:"credits",Features:"features",Notifications:"notifications",Permissions:"permissions",Danger:"danger"},BC=new Set(Object.values(FC)),WC={[FC.Profile]:"settings.titles.profile",[FC.General]:"settings.titles.general",[FC.Users]:"settings.titles.users",[FC.Subscription]:"settings.titles.subscription",[FC.Usage]:"settings.titles.usage",[FC.Credits]:"settings.titles.credits",[FC.Features]:"settings.titles.features",[FC.Notifications]:"settings.titles.notifications",[FC.Permissions]:"settings.titles.permissions",[FC.Danger]:"settings.titles.danger"},VC=({workspace:r,onClose:n,open:a,onOpenChange:i,defaultSection:s=FC.Profile,section:o,onSectionChange:c,showTrigger:l=!0,trigger:d})=>{const{t:u,dir:p}=Cn(),[h,f]=m(!1),[g,b]=m(s),v=void 0!==a?a:h,y=i||f,w=void 0!==o?o:g,x=c||b;if(!r)return null;const k=t(Bs,{variant:"outline",size:"icon",children:t(ms,{className:"h-4 w-4"})});return e(xl,{open:v,onOpenChange:e=>{y(e),!e&&n&&n()},children:[l&&t(kl,{asChild:!0,children:d||k}),e(Nl,{dir:p,className:"flex max-w-2xl min-w-full sm:min-w-[800px] p-0 m-0 bg-muted sm:min-h-[600px] min-h-full gap-x-0 space-x-0",children:[t(_l,{className:"sr-only",children:u(WC[w])}),t(LC,{workspace:r,section:w,setSection:x}),e("div",{className:"flex-1 p-6 overflow-auto flex flex-col bg-background",children:[t(Al,{className:"text-xl font-bold mb-4",children:u(WC[w])}),e("div",{className:"sm:max-h-[500px] overflow-y-auto",children:[w===FC.Profile&&t(eS,{workspace:r}),w===FC.General&&t(Qv,{workspace:r}),w===FC.Users&&t(MC,{workspace:r}),w===FC.Subscription&&t(lS,{workspace:r}),w===FC.Usage&&t(mS,{}),w===FC.Credits&&t(ed,{workspace:r}),w===FC.Features&&t(ru,{workspaceId:r._id?.toString()}),w===FC.Notifications&&t(sy,{workspace:r}),w===FC.Permissions&&t(oy,{workspace:r}),w===FC.Danger&&t(Bd,{workspace:r})]})]})]})]})};var GC=Object.freeze({__proto__:null,SETTINGS_SCREENS:BC,SettingsScreen:FC,WorkspaceSettingsDialog:VC,default:VC});const HC=new class{constructor(){this.listeners=new Set,this.currentState={open:!1,section:FC.Profile}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}getState(){return{...this.currentState}}openWorkspaceSettings(e,t){this.currentState={open:!0,section:e||FC.Profile,params:t},this.notifyListeners()}closeSettings(){this.currentState={...this.currentState,open:!1,params:void 0},this.notifyListeners()}setSection(e){this.currentState={...this.currentState,section:e},this.notifyListeners()}clearParams(){this.currentState={...this.currentState,params:void 0}}notifyListeners(){this.listeners.forEach(e=>{e(this.currentState)})}},jC=()=>{const e=Ln(),{os:t,api:r}=Gn(),{settings:n}=Vn(),i=On(e=>e.workspaces),s=On(e=>e.auth.session?.user),o=p((t,r)=>{if((!(t._id===i.currentWorkspace?._id)||r?.forceEmit)&&t){const r=i.currentWorkspace;Tl(t),e.workspaces(Tt(t)),Fi.emitWorkspaceChanged(t,r).catch(e=>{$e(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceChanged",metadata:{workspaceId:t._id}})})}},[i.currentWorkspace,e]),c=p(async(r,n)=>{const a=++f.current;e.workspaces(Lt(r._id));try{const e=t.auth?.callbacks?.onWorkspaceChange;if(e){const t=Ul(r,s?.id);try{await e({workspace:r,user:s??null,role:t})}catch(e){throw $e(e,{component:"useSaaSWorkspaces",action:"onWorkspaceChange",metadata:{workspaceId:r._id}}),e}if(a!==f.current)return}o(r,n)}finally{a===f.current&&e.workspaces(Lt(null))}},[e,t.auth?.callbacks?.onWorkspaceChange,o,s]),l=a.useRef(c);l.current=c,u(()=>{if(!i.isInitialized){const t=Rl();if(e.workspaces(Dt(!0)),t){const e=i.workspaces.find(e=>e._id===t);e&&l.current(e,{forceEmit:!0}).catch(e=>{$e(e,{component:"useSaaSWorkspaces",action:"initWorkspaceSwitch",metadata:{savedWorkspaceId:t}})})}}},[i.isInitialized,i.workspaces,e]);const d=p(()=>{Dl(),e.workspaces(Rt())},[e]),m=a.useRef(!1),h=a.useRef(!1),f=a.useRef(0),g=p(async()=>{if(!i.loading&&!m.current){m.current=!0,e.workspaces(It(!0)),e.workspaces(Mt(null));try{const t=await r.getWorkspaces();if(e.workspaces(Nt(t)),t.length>0){const e=Rl();if(e&&Il(e,t)){const r=t.find(t=>t._id===e);if(r)try{await c(r,{forceEmit:!0})}catch{}}else{const e=t[0];try{await c(e,{forceEmit:!0})}catch{}}}}catch(t){e.workspaces(Mt(t instanceof Error?t.message:"Failed to fetch workspaces"))}finally{e.workspaces(It(!1)),m.current=!1}}},[r,i.loading,e,c]),b=p(async()=>{if(!i.refreshing&&!m.current){m.current=!0,e.workspaces(Ut(!0));try{const t=await r.getWorkspaces();e.workspaces(Nt(t))}catch(e){}finally{e.workspaces(Ut(!1)),m.current=!1}}},[r,i.refreshing,e]),v=p(async(t,n)=>{const a=await r.createWorkspace({name:t,image:n});e.workspaces(Et(a)),await c(a),Fi.emitWorkspaceCreated(a).catch(e=>{$e(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceCreated",metadata:{workspaceId:a._id}})}),setTimeout(()=>{HC.openWorkspaceSettings(FC.Subscription)},300)},[r,e,c]),y=p(async(t,n)=>{const a=await r.updateWorkspace(t._id,n);e.workspaces(At(a)),Fi.emitWorkspaceUpdated(a).catch(e=>{$e(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceUpdated",metadata:{workspaceId:a._id}})})},[r,e]),w=p(async()=>{if(h.current)return i.allFeatures.length>0?i.allFeatures:null;if(i.allFeatures.length>0)return i.allFeatures;h.current=!0;try{const t=await r.getFeatures();return e.workspaces(Pt(t)),t}catch(e){return $e(e,{component:"useSaaSWorkspaces",action:"getFeatures"}),null}finally{h.current=!1}},[r,e,i.allFeatures]),x=p(async(e,t,n)=>await r.updateFeature(e,t,n),[r]),k=p(async e=>r.updateSettings(e),[r]),S=p(async(e,t)=>{const n=await r.updateWorkspacePermissions(e,t);return await b(),n},[r,b]);u(()=>{if(!i.currentWorkspace?._id||0===i.workspaces.length)return;const t=i.currentWorkspace._id,r=i.workspaces.find(e=>e._id===t);if(r)r!==i.currentWorkspace&&(Tl(r),e.workspaces(Tt(r)));else if(i.workspaces.length>0){const e=i.workspaces[0];e._id!==t&&c(e).catch(t=>{$e(t,{component:"useSaaSWorkspaces",action:"fallbackWorkspaceSwitch",metadata:{workspaceId:e._id}})})}},[i.workspaces,i.currentWorkspace,e,c]);const C=p(async e=>await r.getWorkspaceUsers(e),[r]),N=p(async(e,t,a)=>{const s=i.workspaces.find(t=>t._id===e);if(s){const e=_i({settingsMaxUsers:n?.workspace?.maxWorkspaceUsers}),t=Pi({memberCount:s.users?.length??0,maxUsersConfig:e});if(!t.canInvite)throw new Error(t.blockMessageKey||"users.memberLimitReached")}const o=await r.addUser(e,{email:t,role:a});return s&&Fi.emitWorkspaceUserAdded(o.userId,s,a).catch(t=>{$e(t,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserAdded",metadata:{workspaceId:e,userId:o.userId,role:a}})}),b().catch(e=>{$e(e,{component:"useSaaSWorkspaces",action:"refreshAfterAddUser"})}),Xt(),o},[r,i.workspaces,b,n]),E=p(async(e,t)=>{const n=i.workspaces.find(t=>t._id===e);if(n&&Ml(n,t))throw new Error("Cannot remove the workspace owner");const a=(await r.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user._id)===t),s=await r.removeUser(e,t);if(n&&a){const t=a.role;Fi.emitWorkspaceUserRemoved(s.userId,n,t).catch(r=>{$e(r,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRemoved",metadata:{workspaceId:e,userId:s.userId,role:t}})})}return b().catch(e=>{$e(e,{component:"useSaaSWorkspaces",action:"refreshAfterRemoveUser"})}),Xt(),s},[r,i.workspaces,b]),A=p(async(e,t,n)=>{if(n.role){const r=i.workspaces.find(t=>t._id===e);if(r&&Ml(r,t))throw new Error("Cannot change the role of the workspace owner")}let a;if(n.role){const n=(await r.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user._id)===t);a=n?.role}const s=await r.updateUser(e,t,n);return n.role&&a&&a!==n.role&&Fi.emitWorkspaceUserRoleChanged(s.userId,s.workspace,a,n.role).catch(r=>{$e(r,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRoleChanged",metadata:{workspaceId:e,userId:t,previousRole:a,newRole:n.role}})}),s},[r,i.workspaces]),_=p(async e=>{const t=await r.getProfile().catch(()=>null),n=await r.updateUserProfile(e);return Fi.emitUserUpdated(n,t||void 0).catch(e=>{$e(e,{component:"useSaaSWorkspaces",action:"emitUserUpdated",metadata:{userId:n._id}})}),n},[r]),P=p(async()=>await r.getProfile(),[r]),T=p(async e=>await r.getWorkspace(e),[r]),R=p(async t=>{if(!s)throw new Error("User must be authenticated to delete a workspace");const n=i.workspaces.find(e=>e._id===t);if(!n)throw new Error("Workspace not found");if(!Ml(n,s.id))throw new Error("Only the workspace creator can delete the workspace");const a=await r.deleteWorkspace(t);return e.workspaces(_t(t)),i.currentWorkspace?._id===t&&(Dl(),e.workspaces(Rt())),n&&Fi.emitWorkspaceDeleted(n).catch(e=>{$e(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceDeleted",metadata:{workspaceId:t}})}),a},[r,i.workspaces,i.currentWorkspace,e,s]);return{workspaces:i.workspaces,loading:i.loading,error:i.error,fetchWorkspaces:g,refreshWorkspaces:b,refreshing:i.refreshing,currentWorkspace:i.currentWorkspace,setCurrentWorkspace:o,switchToWorkspace:c,resetCurrentWorkspace:d,createWorkspace:v,allFeatures:i.allFeatures,getFeatures:w,updateFeature:x,updateWorkspaceSettings:k,updateWorkspacePermissions:S,getWorkspace:T,updateWorkspace:y,getUsers:C,addUser:N,removeUser:E,updateUser:A,getProfile:P,updateUserProfile:_,deleteWorkspace:R,switching:null!==i.switchingToId,switchingToId:i.switchingToId}};function $C(e,t,r){const n=e._id||e.id;if(!n||"string"!=typeof n)throw new Error("User data missing required ID field");if(!e.email||"string"!=typeof e.email)throw new Error("User data missing required email field");return{id:n,name:e.name||"",org:t,email:e.email,emailVerified:!1!==e.emailVerified,clientId:r,role:e.role||"",image:e.image}}function KC(e,t){return{user:e,sessionId:t,expires:new Date(Date.now()+864e5).toISOString()}}function qC(){return On(e=>e.auth)}function ZC(){const{t:e}=Cn(),t=Ln(),r=qC(),n=Bn(),{serverUrl:a,orgId:i,auth:s}=n,{resetCurrentWorkspace:c,currentWorkspace:l}=jC(),d=o(()=>new Ua({serverUrl:a,version:n.version}),[a,n.version]),u=p(async r=>{Ia(r||window.location.href),t.auth(Je());try{const r=await d.requestAuth({orgId:i,clientId:s?.clientId??"",redirect:{success:s?.redirectUrl||window.location.href,error:s?.redirectUrl||window.location.href}});if(!r.success)throw t.auth(Xe()),new Error(r.message||e("errors.generic"));Ta(r.data.redirectUrl)}catch(e){throw t.auth(Xe()),$e(e,{component:"useSaaSAuth",action:"signIn"}),e}},[d,i,s,t]),m=p(async()=>{try{s?.callbacks?.onSignOut&&"function"==typeof s.callbacks.onSignOut&&await s.callbacks.onSignOut()}catch(e){$e(e,{component:"useSaaSAuth",action:"signOut"})}finally{An(_n),t.auth(et()),c()}},[t,c,s?.callbacks?.onSignOut]),h=p(e=>{l?HC.openWorkspaceSettings(e):$e(new Error("Cannot open settings: No current workspace"),{component:"useSaaSAuth",action:"openWorkspaceSettings"})},[l]),f=p(()=>{l?HC.openWorkspaceSettings(FC.Credits,{action:Wa}):$e(new Error("Cannot open credit store: No current workspace"),{component:"useSaaSAuth",action:"openCreditStore"})},[l]),g=p(()=>{l?HC.openWorkspaceSettings(FC.Subscription,{action:Fa}):$e(new Error("Cannot open plan picker: No current workspace"),{component:"useSaaSAuth",action:"openPlanPicker"})},[l]),b=o(()=>at(r.status),[r.status]);return o(()=>({user:r.session?.user,session:r.session,status:r.status,...b,signIn:u,signOut:m,openWorkspaceSettings:h,openCreditStore:f,openPlanPicker:g}),[r.session,r.status,b,u,m,h,f,g])}const JC=a.memo(({children:e,callbacks:n})=>{const i=Ln(),s=qC(),o=Bn(),c=at(s.status).isAuthenticated,l=a.useRef(!1),d=a.useRef(null),m=a.useRef(!1),h=a.useRef(null),f=p(async e=>{try{if(n?.handleAuthentication){const{sessionId:t}=await n.handleAuthentication(e);if(!t||"string"!=typeof t||""===t.trim())throw new Error("Invalid sessionId received from authentication callback");const r=o;if(!bt(r))throw new Error("OS configuration is not available");const{serverUrl:a,version:s,orgId:c}=r,l=new Ua({serverUrl:a,version:s}),d=await l.getProfile(t),u=KC($C(d,c,r.auth?.clientId||""),t);Tn(u.sessionId),i.auth(Qe(u)),function(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.delete(Pn),window.history.replaceState({},"",e.toString())}catch(e){$e(e,{component:"auth-utils",action:"removeTokenFromUrl",metadata:{param:Pn}})}}();const p=Ma();p&&p!==window.location.href&&Ta(p)}}catch(t){throw Ma(),$e(t,{component:"AuthProviderWrapper",action:"handleAuthRedirect",metadata:{hasCode:!!e}}),i.auth(Xe()),t}},[i,n,o]);return a.useEffect(()=>{if("undefined"==typeof window)return;if(c)return;if(m.current)return;if(h.current)return;if(!bt(o))return;if(Dn())return;if(!n?.getSession)return m.current=!0,void i.auth(Xe());const e=n.getSession,{serverUrl:t,version:r,orgId:a}=o,s=o.auth?.clientId||"";h.current=(async()=>{let o=null;try{o=await e()}catch(e){$e(e,{component:"AuthProviderWrapper",action:"getSession"})}if(!o)return m.current=!0,i.auth(Xe()),"undefined"!=typeof window&&Ia(window.location.href),void n?.onSessionExpired?.("missing");try{const e=new Ua({serverUrl:t,version:r}),n=await e.getProfile(o),c=KC($C(n,a,s),o);Tn(c.sessionId),m.current=!0,i.auth(Qe(c));const l=Ma();l&&l!==window.location.href&&Ta(l)}catch(e){$e(e,{component:"AuthProviderWrapper",action:"fetchUserProfile"}),m.current=!0,i.auth(Xe()),"undefined"!=typeof window&&Ia(window.location.href),n?.onSessionExpired?.("expired")}finally{h.current=null}})()},[c,i,o,n]),u(()=>{const e=Dn();if(!e)return;if(l.current||d.current===e)return;if(!bt(o))return;l.current=!0,d.current=e;let t=!1;return i.auth(Ye()),f(e).then(()=>{t||(d.current=null)}).catch(e=>{t||($e(e,{component:"AuthProviderWrapper",action:"handleAuthRedirectEffect",metadata:{hasCode:!0}}),d.current=null)}).finally(()=>{l.current=!1}),()=>{t=!0}},[f,o.serverUrl,o.version,o.orgId]),t(r,{children:e})});JC.displayName="AuthProviderWrapper";const YC=a.memo(({config:e,auth:n,children:i})=>{const s=Ln();Bn();const o=a.useMemo(()=>({clientId:n?.clientId||"",redirectUrl:n?.redirectUrl||"",callbacks:n?.callbacks}),[n?.clientId,n?.redirectUrl,n?.callbacks]);return u(()=>{s.os(ht({...e,auth:o}))},[e,o,s]),t(r,{children:i})});YC.displayName="ContextConfigProvider";class XC extends Mn{constructor(e){super(e)}async getAttributes(e){const t=await this.fetchResponse("users/attributes",{signal:e});t.ok||await this.throwResponseError(t,"Failed to fetch user attributes");const r=await this.unwrapResponse(t,"Failed to fetch user attributes");return r&&"object"==typeof r&&!Array.isArray(r)?r:{}}async updateAttributes(e){return this.fetchJson("users/attributes",{method:"PATCH",body:JSON.stringify({attributes:e})},"Failed to update user attributes")}async updateAttribute(e,t){return this.fetchJson(`users/attributes/${e}`,{method:"PATCH",body:JSON.stringify({value:t})},"Failed to update user attribute")}async getFeatures(e){const t=await this.fetchResponse("users/features",{signal:e});t.ok||await this.throwResponseError(t,"Failed to fetch user features");const r=await this.unwrapResponse(t,"Failed to fetch user features");return"object"==typeof r&&null!==r?r:{}}}const QC=a.createContext(void 0),eN=a.memo(({children:e})=>{const{t:r}=Cn(),n=Bn(),i=function(){const e=Bn();return o(()=>new XC(e),[e.serverUrl,e.version])}(),{isAuthenticated:s}=ZC(),{serverUrl:c,version:l}=n,[d,u]=m({}),[h,f]=m({}),[g,b]=m(!1),[v,y]=m(null),w=p(async e=>{if(c&&l&&s)try{const t=await i.getAttributes(e);u(t)}catch(e){if(We(e))return;const t=e instanceof Error?e:new Error(r("errors.generic"));y(t),$e(e,{component:"UserProvider",action:"fetchAttributes"})}else u({})},[i,c,l,s]),x=p(async()=>{if(c&&l&&s){b(!0),y(null);try{await w()}finally{b(!1)}}},[c,l,s,w]),k=p(async e=>{b(!0),y(null);try{const t=await i.updateAttributes(e);return await w(),t}catch(t){const n=t instanceof Error?t:new Error(r("errors.generic"));throw y(n),$e(t,{component:"UserProvider",action:"updateAttributes",metadata:{updates:e}}),t}finally{b(!1)}},[i,w]),S=p(async(e,t)=>{b(!0),y(null);try{const r=await i.updateAttribute(e,t);return await w(),r}catch(n){const a=n instanceof Error?n:new Error(r("errors.generic"));throw y(a),$e(n,{component:"UserProvider",action:"updateAttribute",metadata:{attributeKey:e,value:t}}),n}finally{b(!1)}},[i,w]),C=p(async e=>{if(c&&l&&s)try{const t=await i.getFeatures(e);f(t)}catch(e){if(We(e))return;const t=e instanceof Error?e:new Error(r("errors.generic"));y(t),$e(e,{component:"UserProvider",action:"fetchFeatures"})}else f({})},[i,c,l,s]),N=p(async()=>{if(c&&l&&s){b(!0),y(null);try{await C()}finally{b(!1)}}},[c,l,s,C]);zn(async e=>{if(!s||!c||!l)return u({}),void f({});b(!0),y(null);try{await Promise.all([w(e),C(e)])}finally{b(!1)}},[s,c,l,w,C],{onError:e=>$e(e,{component:"UserProvider",action:"initialFetch",metadata:{step:"fetchAttributesAndFeatures"}})});const E=a.useMemo(()=>({attributes:d,features:h,isLoading:g,error:v,updateAttributes:k,updateAttribute:S,refreshAttributes:x,refreshFeatures:N}),[d,h,g,v,k,S,x,N]);return t(QC.Provider,{value:E,children:e})});eN.displayName="UserProvider";const tN=v(()=>Promise.resolve().then(function(){return GC}).then(e=>({default:e.default})));const rN=({children:n})=>{const{currentWorkspace:a,switchToWorkspace:i,workspaces:o}=jC(),[c,l]=m(!1),[d,p]=m(FC.Profile),h=s(!1);return u(()=>{const e=HC.getState();l(e.open),p(e.section);return HC.subscribe(e=>{l(e.open),p(e.section)})},[]),u(()=>{if(h.current)return;if(!a)return;const e=Za();if(!e)return;const t=function(e){if(e.screen&&BC.has(e.screen))return e.screen;switch(e.action){case Oa:case za:case Fa:return FC.Subscription;case Ba:return FC.Credits;default:return null}}(e);if(!t)return h.current=!0,void Ja();const r=e.ws;if(r&&r!==a._id){const e=o.find(e=>e._id===r);return e?void i(e).catch(e=>{$e(e,{component:"WorkspaceSettingsProvider",action:"switchWorkspaceFromUrl",metadata:{targetWs:r}}),h.current=!0,Ja()}):(h.current=!0,void Ja())}h.current=!0,HC.openWorkspaceSettings(t,e),Ja()},[a,o,i]),e(r,{children:[n,a&&c&&t(Ze,{fallback:null,children:t(b,{fallback:null,children:t(tN,{workspace:a,open:c,onOpenChange:e=>{e||HC.closeSettings()},section:d,onSectionChange:e=>{HC.setSection(e)},showTrigger:!1})})})]})},nN=(e,t,r)=>{if(t!==gt.V1)throw new Error(`Invalid version: "${t}". Only "${gt.V1}" is currently supported.`);if(!e||"string"!=typeof e)throw new Error("serverUrl is required and must be a string");if(!(e=>{try{return new URL(e),!0}catch{return!1}})(e))throw new Error(`Invalid serverUrl: "${e}". Must be a valid URL.`);if(!r||"string"!=typeof r)throw new Error("orgId is required and must be a string");if(!/^[0-9a-fA-F]{24}$/.test(r))throw new Error(`Invalid orgId: "${r}". Must be a valid MongoDB ObjectId (24 hexadecimal characters).`)},aN=a.memo(({serverUrl:e,version:r,orgId:n,auth:i,locale:s,defaultPermissions:o,getCheckoutStripeParams:c,children:l})=>{nN(e,r,n);const d=a.useMemo(()=>({serverUrl:e,version:r,orgId:n}),[e,r,n]),p=a.useMemo(()=>i?.callbacks,[i?.callbacks?.handleAuthentication,i?.callbacks?.onSignOut,i?.callbacks?.getSession,i?.callbacks?.onSessionExpired,i?.callbacks?.handleEvent,i?.callbacks?.onWorkspaceChange]),m=i?.callbacks?.handleEvent;return u(()=>(Fi.setCallbacks(m?{handleEvent:m}:null),()=>{Fi.setCallbacks(null)}),[m]),t(bn,{locale:s,children:t(Gt,{children:t(JC,{callbacks:p,children:t(wl,{children:t(YC,{config:d,auth:i,children:t(jt,{getCheckoutStripeParams:c,children:t(Ca,{appPermissions:o,children:t(eN,{children:t(ca,{children:t(Aa,{children:t(xa,{children:t(ny,{children:t(rN,{children:l})})})})})})})})})})})})})});aN.displayName="SaaSOSProviderInner";const iN=({children:e,...r})=>t(Ze,{children:t(aN,{...r,children:e})});iN.displayName="SaaSOSProvider";const sN=e=>{const{children:t}=e,{status:r}=ZC();return r!==nt.authenticated?null:t},oN=e=>{const{children:t}=e,{status:r}=ZC();return r!==nt.unauthenticated?null:t};sN.displayName="WhenAuthenticated",oN.displayName="WhenUnauthenticated";const cN=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=ZC();return n.includes(a?.role??"")?t:r||null},lN=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=ZC(),{currentWorkspace:i}=jC(),s=i?.users.find(e=>e._id===a?.id);return s&&n.includes(s?.role??"")?t:r||null};cN.displayName="WhenRoles",lN.displayName="WhenWorkspaceRoles";const dN=e=>{const{children:t,fallback:r,permission:n}=e,{can:a}=Wl();return a(n)?t:r??null};function uN(){const e=d(QC);if(void 0===e)throw new Error("useUserAttributes must be used within a UserProvider");return e}function pN(){const e=d(QC);if(void 0===e)throw new Error("useUserFeatures must be used within a UserProvider");return{features:e.features,isLoading:e.isLoading,error:e.error,refreshFeatures:e.refreshFeatures,isFeatureEnabled:t=>Boolean(e.features[t])}}dN.displayName="WhenPermission";const mN=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=jC(),a=n?.features?.[r];return a?t:null},hN=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=jC(),a=n?.features?.[r];return a?null:t},fN=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=pN();return n(r)?t:null},gN=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=pN();return n(r)?null:t};mN.displayName="WhenWorkspaceFeatureEnabled",hN.displayName="WhenWorkspaceFeatureDisabled",fN.displayName="WhenUserFeatureEnabled",gN.displayName="WhenUserFeatureDisabled";const bN=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:i}=la();return i?r??null:a?.subscription?t:n??null},vN=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:i}=la();return i?r??null:a?.subscription?n??null:t},yN=e=>{const{children:t,plans:r,loadingComponent:n,fallbackComponent:a}=e,{response:i,loading:s}=la();if(s)return n??null;if(!i?.subscription)return a??null;const o=i.plan??i.subscription?.plan;if(!o)return a??null;const c=r.map(e=>e.trim().toLowerCase()),l=(o.slug??"").toLowerCase();return c.includes(l)?t:a??null},wN=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:i}=la();return i?r??null:"trialing"!==a?.subscription?.subscriptionStatus?n??null:t},xN=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:i}=la();return i?r??null:a?.subscription?.subscriptionStatus===Qa?n??null:t},kN=e=>{const{children:t,loadingComponent:r,fallbackComponent:n,daysThreshold:a=3}=e,{response:i,loading:s}=la();if(s)return r??null;const o=i?.subscription;if(!o||"trialing"!==o.subscriptionStatus)return n??null;const c=o.trialEnd||o.stripeCurrentPeriodEnd;if(!c)return n??null;const l=new Date(c);if(isNaN(l.getTime()))return n??null;return Math.max(0,Math.ceil((l.getTime()-Date.now())/864e5))>a?n??null:t};bN.displayName="WhenSubscription",vN.displayName="WhenNoSubscription",yN.displayName="WhenSubscriptionToPlans",wN.displayName="WhenTrialing",xN.displayName="WhenNotTrialing",kN.displayName="WhenTrialEnding";const SN=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:i,loading:s}=_a();if(s)return n??null;const o=i?.[t];return o?o.available<=0?a??null:r:a??null},CN=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:i,loading:s}=_a();if(s)return n??null;const o=i?.[t];return o?o.available>0?a??null:r:a??null},NN=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:i,loading:s}=_a();if(s)return n??null;const o=i?.[t];return o&&o.hasOverage&&!1!==o.allowOverage?r:a??null},EN=e=>{const{slug:t,threshold:r,children:n,loadingComponent:a,fallbackComponent:i}=e,{quotas:s,loading:o}=_a();if(o)return a??null;const c=s?.[t];if(!c)return i??null;return(c.included>0?c.consumed/c.included*100:c.consumed>0?100:0)<r?i??null:n};SN.displayName="WhenQuotaAvailable",CN.displayName="WhenQuotaExhausted",NN.displayName="WhenQuotaOverage",EN.displayName="WhenQuotaThreshold";const AN=({children:e})=>{const{currentWorkspace:t}=jC(),r=t?._id,{balance:n,loading:a,error:i,refetch:s}=ka(),{packages:o,loading:c}=ga(r),{consumeCredits:l,loading:d,error:u}=ha(r),{purchaseCredits:p,loading:m,error:h}=fa(r);return e({balance:n,loading:a,packages:o,packagesLoading:c,consume:l,consuming:d,purchase:async e=>{if(!r)throw new Error("No workspace selected");const{successUrl:t,cancelUrl:n}=qa(r),a=await p({creditPackageId:e._id,successUrl:t,cancelUrl:n});a.url&&Ta(a.url)},purchasing:m,refetch:s,error:u||h||i})};AN.displayName="CreditActionsProvider";const _N=({children:e})=>{const{balance:t,loading:r,error:n,refetch:a}=ka();return e({balance:t,loading:r,error:n,refetch:a})};function PN({children:n,loadingFallback:a,errorFallback:i,redirectBaseUrl:s}){const{packages:o,notes:c,loading:l,error:d,refetch:u}=ya(),{isAuthenticated:m,signIn:h}=ZC(),f=p(e=>{if(m)HC.openWorkspaceSettings(FC.Credits,{action:Ba,packageId:e});else if(s){const t=Ka({action:Ba,screen:"credits",packageId:e},s);h(t)}else h()},[m,h,s]);return l?void 0!==a?t(r,{children:a}):e("div",{className:"space-y-4",children:[t(ql,{className:"h-8 w-48"}),t("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[1,2,3].map(e=>t(ql,{className:"h-48 rounded-lg"},e))})]}):d?i?t(r,{children:i(d)}):t("div",{className:"rounded-lg border border-destructive/50 bg-destructive/10 p-4 text-sm text-destructive",children:d}):t(r,{children:n({loading:l,error:d,packages:o,notes:c,refetch:u,selectPackage:f})})}_N.displayName="CreditBalance";const TN=e=>{const{min:t=1,children:r,loadingComponent:n,fallbackComponent:a}=e,{balance:i,loading:s}=ka();return s?n??null:i?i.available<t?a??null:r:a??null},RN=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{balance:a,loading:i}=ka();return i?r??null:a?a.available>0?n??null:t:n??null},DN=e=>{const{threshold:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{balance:i,loading:s}=ka();return s?n??null:i?i.available>t?a??null:r:a??null};function IN(e){if(!e)return null;const t=new Date(e);return isNaN(t.getTime())?null:t}function MN(){const{response:e}=la();return o(()=>{const t=e?.subscription;if(!t||"trialing"!==t.subscriptionStatus)return{isTrialing:!1,daysRemaining:0,trialEndsAt:null,trialStartedAt:null,isTrialEnding:!1};const r=IN(t.trialEnd)??IN(t.stripeCurrentPeriodEnd),n=IN(t.trialStart),a=r?Math.max(0,Math.ceil((r.getTime()-Date.now())/864e5)):0;return{isTrialing:!0,daysRemaining:a,trialEndsAt:r,trialStartedAt:n,isTrialEnding:a<=3}},[e])}TN.displayName="WhenCreditsAvailable",RN.displayName="WhenCreditsExhausted",DN.displayName="WhenCreditsLow";class UN extends Mn{constructor(e){super({...e,basePath:"beta",requireOrgId:!0})}getAuthHeaders(){return{}}async fetchConfig(){return this.fetchJson(`config?orgId=${encodeURIComponent(this.orgId)}`,{},"Failed to fetch beta form configuration")}async submitBetaUser(e){return this.fetchJson("submit",{method:"POST",body:JSON.stringify(e)},"Failed to submit beta user request")}}let LN=class{constructor(e){this.api=new UN(e),this.orgId=e.orgId}async fetchConfig(){return this.api.fetchConfig()}async submitBetaUser(e){const t=e?.context??{},r=t?.country??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[1]:void 0),n=t?.language??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[0]:void 0),a=t?.timezone??("undefined"!=typeof Intl&&Intl.DateTimeFormat?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0),i=t?.currency??("undefined"!=typeof Intl&&Intl.NumberFormat&&Intl.NumberFormat().resolvedOptions().currency?Intl.NumberFormat().resolvedOptions().currency:void 0);return this.api.submitBetaUser({orgId:this.orgId,formData:{...e,country:r,language:n,timezone:a,currency:i}})}};const ON=Ug({name:cg().min(1,"Please enter your name").max(50,"Name must be less than 50 characters").regex(/^[\p{L}\p{M}\s'-]*$/u,"Name can only contain letters and spaces"),email:cg().min(1,"Please enter your email address").email("Please enter a valid email address").max(100,"Email must be less than 100 characters").regex(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,"Please enter a valid email format (e.g., name@domain.com)")}),zN=({onSuccess:n,onError:a,className:i="w-full",fieldClassName:s="flex flex-col gap-1.5 w-full",autoFocus:o=!0,showSuccessMessage:c=!0,hideLogo:l=!1,hideTitles:d=!1})=>{const{t:h}=Cn(),[f,g]=m(!1),[b,v]=m(!1),{submitBetaForm:y,isLoading:w,isSubmitting:x,error:k,config:S,success:C,message:N}=(()=>{const{t:e}=Cn(),t=Bn(),[r,n]=m(null),[a,i]=m(!0),[s,o]=m(!1),[c,l]=m(null),[d,h]=m(!1),[f,g]=m(null);return u(()=>{let r=!1;return(async()=>{i(!0),l(null);try{const e=new LN(t),a=await e.fetchConfig();r||n(a)}catch(t){r||l(t instanceof Error?t.message:e("beta.errorMessage"))}finally{r||i(!1)}})(),()=>{r=!0}},[t]),{isLoading:a,isSubmitting:s,config:r,error:c,success:d,message:f,submitBetaForm:p(async r=>{if(!t){const t=e("errors.generic");return l(t),{success:!1,message:t}}try{o(!0),l(null),h(!1),g(null);const e=new LN(t),n=await e.submitBetaUser({name:r.name||"",email:r.email}),a="success"===n.status;return h(a),g(n.message),{success:a,message:n.message}}catch(t){const r=t instanceof Error?t.message:e("beta.errorMessage");return l(r),h(!1),g(r),{success:!1,message:r}}finally{o(!1)}},[t])}})();u(()=>{C&&c&&(g(!0),v(!0)),k&&v(!0)},[C,c,k]);const E=_p({resolver:Of(ON),defaultValues:{email:"",name:""},mode:"onChange",reValidateMode:"onChange"});u(()=>{o&&E.setFocus("name")},[o,E]);const A=E.formState.isValid&&!x;return t("div",{className:"saas-os-ui",style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:e("div",w?{className:Oe("flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",i),children:[t(ql,{className:"h-24 w-24 rounded-lg"}),t(ql,{className:"h-6 w-32"}),e("div",{className:"w-full space-y-4",children:[e("div",{className:"space-y-2",children:[t(ql,{className:"h-4 w-16"}),t(ql,{className:"h-10 w-full"})]}),e("div",{className:"space-y-2",children:[t(ql,{className:"h-4 w-16"}),t(ql,{className:"h-10 w-full"})]}),t(ql,{className:"h-10 w-full"})]})]}:{className:"flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",children:[!l&&e("div",{className:"flex flex-col items-center justify-center w-full",children:[S?.logo&&t(BN,{logo:S?.logo}),S?.name&&t("div",{children:S?.name})]}),t($u,{...E,children:e("form",{onSubmit:E.handleSubmit(async e=>{try{const t=await y(e);t.success?(n?.(),E.reset(),c&&g(!0),v(!0)):(a?.(t.message),v(!0))}catch(e){a?.(e instanceof Error?e.message:h("beta.errorMessage")),v(!0)}}),className:i,noValidate:!0,"aria-busy":x,children:[!b&&e(r,{children:[!d&&S?.screen?.register&&t(FN,{screen:S?.screen?.register}),t(sb,{control:E.control,name:"name",render:({field:r})=>e(lb,{className:s,children:[t(db,{children:h("beta.nameLabel")}),t(ub,{children:t(hb,{...r})}),t(pb,{}),t(mb,{})]})}),t(sb,{control:E.control,name:"email",render:({field:r})=>e(lb,{className:s,children:[t(db,{children:h("beta.emailLabel")}),t(ub,{children:t(hb,{...r})}),t(pb,{}),t(mb,{})]})}),t(Bs,{type:"submit",disabled:!A,className:s,children:h(x?"beta.submittingText":"beta.submitText")})]}),b&&k&&e("div",{className:"flex flex-col items-center justify-center w-full",children:[e("div",{className:"border-red-300 text-red-700",role:"alert","aria-live":"assertive","aria-atomic":!0,children:[t("span",{className:"text-4xl mb-2",role:"img","aria-label":h("settings.common.error"),children:"❗"}),k]}),t("div",{className:"mt-4 flex justify-center",children:t(Bs,{type:"button",onClick:()=>{v(!1),E.reset()},className:s,children:h("beta.tryAgain")})})]}),b&&f&&N&&t("div",{className:"flex flex-col items-center justify-center w-full text-green-700 border-green-300 text-center",children:S?.screen?.thankYou&&t(FN,{screen:S?.screen?.thankYou})})]})}),!b&&t("div",{children:e("div",{children:[h("beta.privacyConsent")," ",t("a",{href:S?.privacyPolicy,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:h("beta.privacyPolicy")})," ",h("beta.and")," ",t("a",{href:S?.termsOfService,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:h("beta.termsOfService")}),"."]})})]})})};function FN({screen:r}){return e("div",{className:"flex flex-col items-center justify-center w-full",children:[t("p",{className:"text-2xl font-bold",children:r?.title}),t("p",{className:"text-sm text-muted-foreground",children:r?.description})]})}function BN({logo:e}){return t("img","string"==typeof e?{src:e,alt:"Logo",className:"max-h-24"}:{src:e.bucket?.url,alt:"Logo",className:"max-h-24"})}function WN({slug:n,children:a,loadingFallback:i,errorFallback:s,redirectBaseUrl:o}){const{items:c,plans:l,notes:d,loading:u,error:m,refetch:h}=Hn(n),{isAuthenticated:f,signIn:g}=ZC(),b=p((e,t,r)=>o?Ka({action:"selectPlan",plan:e,interval:t,currency:r},o):null,[o]),v=p((e,t,r)=>{if(f)return void HC.openWorkspaceSettings(FC.Subscription,{action:"selectPlan",plan:e,interval:t,currency:r});const n=b(e,t,r);g(n??void 0)},[f,g,b]);return u?void 0!==i?t(r,{children:i}):e("div",{className:"space-y-4",children:[t(ql,{className:"h-8 w-48"}),t("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[1,2,3].map(e=>t(ql,{className:"h-64 rounded-lg"},e))})]}):m?s?t(r,{children:s(m)}):t("div",{className:"rounded-lg border border-destructive/50 bg-destructive/10 p-4 text-sm text-destructive",children:m}):t(r,{children:a({loading:u,error:m,items:c,plans:l,notes:d,refetch:h,selectPlan:v})})}function VN(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const a=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return n.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}var GN,HN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{const a=Rs(`Primitive.${r}`),i=n.forwardRef((e,n)=>{const{asChild:i,...s}=e,o=i?a:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t(o,{...s,ref:n})});return i.displayName=`Primitive.${r}`,{...e,[r]:i}},{}),jN={exports:{}},$N={};function KN(){if(GN)return $N;GN=1;var e=a;var t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useState,n=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function o(e){var r=e.getSnapshot;e=e.value;try{var n=r();return!t(e,n)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var a=t(),c=r({inst:{value:a,getSnapshot:t}}),l=c[0].inst,d=c[1];return i(function(){l.value=a,l.getSnapshot=t,o(l)&&d({inst:l})},[e,a,t]),n(function(){return o(l)&&d({inst:l}),e(function(){o(l)&&d({inst:l})})},[e]),s(a),a};return $N.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:c,$N}var qN,ZN,JN={};
28
28
  /**
29
29
  * @license React
30
30
  * use-sync-external-store-shim.development.js
@@ -33,4 +33,4 @@ var Ya={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
33
33
  *
34
34
  * This source code is licensed under the MIT license found in the
35
35
  * LICENSE file in the root directory of this source tree.
36
- */function aN(){return tN||(tN=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=a,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=t.useState,i=t.useEffect,s=t.useLayoutEffect,o=t.useDebugValue,c=!1,l=!1,u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(a,u){c||void 0===t.startTransition||(c=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var d=u();if(!l){var p=u();r(d,p)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),l=!0)}var m=(p=n({inst:{value:d,getSnapshot:u}}))[0].inst,h=p[1];return s(function(){m.value=d,m.getSnapshot=u,e(m)&&h({inst:m})},[a,d,u]),i(function(){return e(m)&&h({inst:m}),a(function(){e(m)&&h({inst:m})})},[a]),o(d),d};nN.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:u,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),nN}function iN(){return rN||(rN=1,"production"===process.env.NODE_ENV?XE.exports=eN():XE.exports=aN()),XE.exports}var sN=iN();function oN(){return()=>{}}var cN="Avatar",[lN]=function(e,r=[]){let a=[];const i=()=>{const t=a.map(e=>n.createContext(e));return function(r){const a=r?.[e]||t;return n.useMemo(()=>({[`__scope${e}`]:{...r,[e]:a}}),[r,a])}};return i.scopeName=e,[function(r,i){const s=n.createContext(i);s.displayName=r+"Context";const o=a.length;a=[...a,i];const c=r=>{const{scope:a,children:i,...c}=r,l=a?.[e]?.[o]||s,u=n.useMemo(()=>c,Object.values(c));return t(l.Provider,{value:u,children:i})};return c.displayName=r+"Provider",[c,function(t,a){const c=a?.[e]?.[o]||s,l=n.useContext(c);if(l)return l;if(void 0!==i)return i;throw new Error(`\`${t}\` must be used within \`${r}\``)}]},ZE(i,...r)]}(cN),[uN,dN]=lN(cN),pN=n.forwardRef((e,r)=>{const{__scopeAvatar:a,...i}=e,[s,o]=n.useState("idle");return t(uN,{scope:a,imageLoadingStatus:s,onImageLoadingStatusChange:o,children:t(YE.span,{...i,ref:r})})});pN.displayName=cN;var mN="AvatarImage",hN=n.forwardRef((e,r)=>{const{__scopeAvatar:a,src:i,onLoadingStatusChange:s=()=>{},...o}=e,c=dN(mN,a),l=function(e,{referrerPolicy:t,crossOrigin:r}){const a=sN.useSyncExternalStore(oN,()=>!0,()=>!1),i=n.useRef(null),s=a?(i.current||(i.current=new window.Image),i.current):null,[o,c]=n.useState(()=>bN(s,e));return qi(()=>{c(bN(s,e))},[s,e]),qi(()=>{const e=e=>()=>{c(e)};if(!s)return;const n=e("loaded"),a=e("error");return s.addEventListener("load",n),s.addEventListener("error",a),t&&(s.referrerPolicy=t),"string"==typeof r&&(s.crossOrigin=r),()=>{s.removeEventListener("load",n),s.removeEventListener("error",a)}},[s,r,t]),o}(i,o),u=as(e=>{s(e),c.onImageLoadingStatusChange(e)});return qi(()=>{"idle"!==l&&u(l)},[l,u]),"loaded"===l?t(YE.img,{...o,ref:r,src:i}):null});hN.displayName=mN;var fN="AvatarFallback",gN=n.forwardRef((e,r)=>{const{__scopeAvatar:a,delayMs:i,...s}=e,o=dN(fN,a),[c,l]=n.useState(void 0===i);return n.useEffect(()=>{if(void 0!==i){const e=window.setTimeout(()=>l(!0),i);return()=>window.clearTimeout(e)}},[i]),c&&"loaded"!==o.imageLoadingStatus?t(YE.span,{...s,ref:r}):null});function bN(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}gN.displayName=fN;var vN=pN,yN=hN,wN=gN;const xN=n.forwardRef(({className:e,...r},n)=>t(vN,{ref:n,className:Oe("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...r}));xN.displayName=vN.displayName;const SN=n.forwardRef(({className:e,...r},n)=>t(yN,{ref:n,className:Oe("aspect-square h-full w-full",e),...r}));SN.displayName=yN.displayName;const kN=n.forwardRef(({className:e,...r},n)=>t(wN,{ref:n,className:Oe("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...r}));kN.displayName=wN.displayName;var EN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{const a=Mi(`Primitive.${r}`),i=n.forwardRef((e,n)=>{const{asChild:i,...s}=e,o=i?a:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t(o,{...s,ref:n})});return i.displayName=`Primitive.${r}`,{...e,[r]:i}},{}),NN="horizontal",CN=["horizontal","vertical"],AN=n.forwardRef((e,r)=>{const{decorative:n,orientation:a=NN,...i}=e,s=function(e){return CN.includes(e)}(a)?a:NN,o=n?{role:"none"}:{"aria-orientation":"vertical"===s?s:void 0,role:"separator"};return t(EN.div,{"data-orientation":s,...o,...i,ref:r})});AN.displayName="Separator";var _N=AN;const PN=n.forwardRef(({className:e,orientation:r="horizontal",decorative:n=!0,...a},i)=>t(_N,{ref:i,decorative:n,orientation:r,className:Oe("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",e),...a}));function TN(n){const{t:a,dir:i}=xn(),{isAuthenticated:s,user:o}=Fl(),c=bt(On()),{workspaces:l,currentWorkspace:u,loading:p,refreshing:h,switchingToId:f,fetchWorkspaces:g,getFeatures:b,refreshWorkspaces:v,setCurrentWorkspace:y,switchToWorkspace:w}=rE(),{settings:x}=Fn(),[S,k]=m(!1),[E,N]=m(0),[C,A]=m(""),_=p||h;d(()=>{s&&c&&(0===l.length?(g(),b()):b())},[s,c]),d(()=>{s&&c&&E>0&&v()},[E,s,c]);const P=l,T=P.filter(e=>e._id!==u?._id).filter(e=>e.name.toLowerCase().includes(C.toLowerCase())),R=x?.workspace?.canCreateWorkspace??!0,D=x?.workspace?.showSwitcher??!0,I=x?.workspace?.maxWorkspacesPerUser??0,U=P?.filter(e=>("object"==typeof e.createdBy?e.createdBy._id?.toString():e.createdBy?.toString())===o?.id?.toString()).length??0,M=!1!==R&&(0===I||U<I);return d(()=>{!D&&l.length>0&&!u&&w(l[0]).catch(()=>{})},[D,l,u]),!D&&u?e(r,{children:[t("div",{onClick:()=>k(!0),children:n.trigger?.(_,u)}),t(Qk,{workspace:u,open:S,onOpenChange:k,showTrigger:!1})]}):e(Nc,{open:S,onOpenChange:k,children:[t(Cc,{children:n.trigger?.(_,u)}),e(Pc,{dir:i,className:"max-w-2xl min-w-full sm:min-w-[800px]",children:[e(Tc,{dir:i,children:[e(Rc,{className:"flex items-center gap-2",children:[t(ri,{className:"h-5 w-5"}),a("workspace.switchTitle")]}),t(Dc,{children:a("workspace.switchDescription")})]}),!o&&t("div",{className:"flex flex-col items-center justify-center h-full py-4 sm:py-8",children:t("div",{className:"text-sm font-medium text-muted-foreground",children:a("workspace.notLoggedIn")})}),o&&e("div",{dir:i,className:"flex flex-col gap-4",children:[u&&t(RN,{workspace:u,isCurrentWorkspace:!0,switchToWorkspace:w,switchingToId:f,onClose:()=>k(!1),setCurrentWorkspace:y,setOpen:k,workspacesToUse:P}),t(PN,{}),e("div",{children:[e("div",{className:"flex items-center justify-between",children:[t("div",{className:"text-sm font-medium text-muted-foreground",children:a("workspace.availableWorkspaces",{count:T.length})}),t("div",{children:t(Hi,{progress:h,disabled:h,variant:"ghost",onClick:function(){s&&c&&N(e=>e+1)},startIcon:t(fi,{}),children:a("settings.common.refreshAction",{loading:String(h)})})})]}),e("div",{className:"relative",children:[t(bi,{className:"absolute start-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),t(wg,{placeholder:a("workspace.searchPlaceholder"),value:C,onChange:e=>A(e.target.value),className:"ps-10"})]}),p?e("div",{className:"flex items-center justify-center py-8",children:[t(pi,{className:"h-6 w-6 animate-spin text-muted-foreground"}),t("span",{className:"ms-2 text-sm text-muted-foreground",children:a("workspace.loadingWorkspaces")})]}):0===T.length?e("div",{className:"text-center py-8",children:[t(ri,{className:"mx-auto h-12 w-12 text-muted-foreground"}),t("p",{className:"mt-2 text-sm text-muted-foreground",children:a(C?"workspace.noWorkspacesFound":"workspace.noWorkspacesAvailable")})]}):t(tv,{className:"h-64",dir:i,children:t("div",{dir:i,className:"flex flex-col gap-2 my-2.5",children:T.map(e=>{const r=e._id===u?._id;return t(RN,{workspace:e,isCurrentWorkspace:r,switchToWorkspace:w,switchingToId:f,onClose:()=>k(!1),setCurrentWorkspace:y,setOpen:k,workspacesToUse:P},e._id)})})})]}),M&&e(r,{children:[t(PN,{}),t(DN,{onCreated:()=>{g()}})]})]})]})]})}function RN(r){const{t:n}=xn(),{workspace:a,setCurrentWorkspace:i,setOpen:s,workspacesToUse:o,switchingToId:c}=r,l=r.isCurrentWorkspace??!1,u=c===a._id,d=a.subscription??null,p=null!=d&&"object"==typeof d?d.plan??null:null,m=p?.name??"";return e("div",{className:Oe("flex items-center gap-3 rounded-lg border-2 p-3 border-border",{"bg-muted text-muted-foreground":l}),children:[e(xN,{className:"h-8 w-8 flex items-center justify-center",children:[t("div",{children:t(SN,{src:a.image&&a.image.trim()?a.image:void 0})}),t(kN,{children:(h=a.name,h.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2))})]}),e("div",{className:"flex-1 min-w-0 max-w-full",children:[t("div",{className:"flex items-center gap-2",children:t("span",{className:"font-medium line-clamp-1 text-ellipsis overflow-hidden max-w-full",children:a.name})}),e("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[t(_i,{className:"h-3 w-3"}),t("span",{children:n("workspace.membersCount",{count:a.users?.length||0})})]}),m&&t("div",{className:"max-w-fit",children:t("div",{className:"flex items-center gap-1 text-sm text-muted-foreground bg-green-500 text-white rounded-full px-2 py-0.5",children:t("span",{className:"text-xs",children:m})})})]}),e("div",{className:"flex items-center gap-2",children:[l?null:t(Hi,{size:"sm",disabled:null!==c||u,progress:u,onClick:()=>{r.switchToWorkspace(a).then(()=>s(!1)).catch(e=>{Ke(e,{component:"WorkspaceItem",action:"switchToWorkspace",metadata:{workspaceId:a._id}})})},children:n("workspace.switchTo")}),t(Qk,{workspace:a,onClose:()=>{if(l){const e=o.findIndex(e=>e._id?.toString()===a._id?.toString());-1!==e&&i(o[e])}}})]})]});var h}function DN(n){const{t:a,dir:i}=xn(),{switching:s}=rE(),[o,c]=m(!1),[l,u]=m("emoji"),[d,p]=m("🏢"),[h,f]=m(!1),{createWorkspace:g}=rE(),b=Td({resolver:zh(Of({name:uf().min(2,{message:a("workspace.workspaceNameMinLength")}),image:uf().optional()})),defaultValues:{name:"",image:""}});return e(Nc,{open:o,onOpenChange:c,children:[t(Cc,{asChild:!0,children:e(Hi,{className:"w-full rounded-none",disabled:s,children:[t(hi,{className:"h-4 w-4 me-2"}),a("workspace.createNew")]})}),e(Pc,{dir:i,className:"max-w-xl min-w-full sm:min-w-[600px]",children:[e(Tc,{children:[t(Rc,{children:a("workspace.createTitle")}),t(Dc,{children:a("workspace.createDescription")})]}),t(ug,{...b,children:e("form",{onSubmit:b.handleSubmit(async function(e){let t="";if("emoji"===l)t=nv(d);else if("url"===l&&e.image)try{new URL(e.image),t=e.image}catch{return void b.setError("image",{message:a("workspace.invalidUrl")})}f(!0);try{await g(e.name,t),c(!1),b.reset(),p("🏢"),u("emoji"),n?.onCreated?.()}catch(t){Ke(t,{component:"WorkspaceProvider",action:"createWorkspace",metadata:{name:e.name}})}finally{f(!1)}}),children:[t(pg,{control:b.control,name:"name",render:({field:r})=>e(fg,{children:[t(gg,{children:a("workspace.workspaceName")}),t(bg,{children:t(wg,{placeholder:a("workspace.workspaceNamePlaceholder"),...r})}),t(yg,{})]})}),e("div",{className:"flex flex-col gap-y-2 my-2",children:[e("div",{children:[t(lg,{className:"text-sm font-medium",children:a("workspace.workspaceIcon")}),t(vg,{children:a("workspace.iconDescription")})]}),e(gb,{value:l,onValueChange:e=>u(e),className:"flex flex-col gap-y-2",children:[e("div",{className:"flex items-center gap-x-2 my-1",children:[t(bb,{value:"emoji",id:"emoji"}),e(lg,{htmlFor:"emoji",className:"flex items-center gap-2",children:[t(Si,{className:"h-4 w-4"}),a("workspace.chooseEmoji")]})]}),e("div",{className:"flex items-center gap-x-2 my-1",children:[t(bb,{value:"url",id:"url"}),e(lg,{htmlFor:"url",className:"flex items-center gap-2",children:[t(di,{className:"h-4 w-4"}),a("workspace.customImageUrl")]})]})]}),"emoji"===l&&e("div",{className:"flex flex-col gap-y-2",children:[e("div",{className:"flex items-center gap-3",children:[t("span",{className:"text-sm font-medium",children:a("general.previewLabel")}),t("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:d})]}),t(tv,{className:"h-32 w-full rounded-md border",children:t("div",{className:"p-4 grid grid-cols-8 gap-2",children:av.map((e,r)=>t("button",{type:"button",onClick:()=>(e=>{p(e),b.setValue("image",nv(e))})(e),className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(d===e?"bg-primary text-primary-foreground":""),children:e},r))})})]}),"url"===l&&e("div",{className:"flex flex-col gap-y-2",children:[t(pg,{control:b.control,name:"image",render:({field:r})=>e(fg,{children:[t(gg,{children:a("workspace.imageUrl")}),t(bg,{children:t(wg,{placeholder:a("workspace.imageUrlPlaceholder"),...r})}),t(vg,{children:a("workspace.imageUrlDescription")}),t(yg,{})]})}),b.watch("image")&&b.watch("image")?.trim()&&e("div",{className:"flex items-center gap-3",children:[t("span",{className:"text-sm font-medium",children:a("general.previewLabel")}),t("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:t("img",{src:b.watch("image")||void 0,alt:"Workspace preview",className:"w-full h-full object-cover",onError:e=>{e.currentTarget.style.display="none"}})})]})]})]}),e("div",{className:"flex justify-end gap-3 pt-4",children:[t(Hi,{type:"button",variant:"outline",onClick:()=>{c(!1),b.reset(),p("🏢"),u("emoji")},disabled:h,children:a("settings.common.cancel")}),t(Hi,{type:"submit",disabled:h,children:h?e(r,{children:[t(pi,{className:"me-2 h-4 w-4 animate-spin"}),a("workspace.creating")]}):a("workspace.createWorkspace")})]})]})})]})]})}PN.displayName=_N.displayName;var IN=Object.freeze({__proto__:null,es:{settings:{titles:{profile:"Cuenta",general:"Configuración del espacio de trabajo",users:"Miembros del espacio de trabajo",subscription:"Plan y facturación",usage:"Uso",features:"Funciones del espacio de trabajo",notifications:"Notificaciones",permissions:"Permisos",danger:"Zona de peligro"},sidebar:{account:"Cuenta",workspace:"Espacio de trabajo",profile:"Cuenta",general:"Configuración",users:"Miembros",subscription:"Plan y facturación",usage:"Uso",features:"Funciones",notifications:"Notificaciones",permissions:"Permisos",danger:"Zona de peligro"},common:{refresh:"Actualizar",refreshing:"Actualizando...",retry:"Reintentar",retrying:"Reintentando...",save:"Guardar",saving:"Guardando...",cancel:"Cancelar",delete:"Eliminar",dismiss:"Descartar",loading:"Cargando...",success:"¡Éxito!",error:"Error",refreshAction:"{loading, select, true {Actualizando...} other {Actualizar}}",retryAction:"{loading, select, true {Reintentando...} other {Reintentar}}"}},subscription:{managePlan:"Administra tu plan y facturación",changePlan:"Cambiar plan",viewPricingPlans:"Ver planes de precios",viewPlans:"Ver planes",upgradePlan:"Mejorar ahora",subscribe:"Suscribirse",currentPlan:"Plan actual",noSubscription:"No tienes una suscripción activa",choosePlan:"Elige tu plan",choosePlanDescription:"Compara los planes y selecciona el que mejor se adapte a tus necesidades",forWorkspace:"para {name}",planUpdateAvailable:"Actualización de plan disponible",updateSuccess:"¡Suscripción actualizada correctamente!",updateFailed:"Error en la actualización",cancelTitle:"Cancelar suscripción",cancelConfirm:"¿Estás seguro de que deseas cancelar tu suscripción?",cancelKeep:"Mantener suscripción",cancelButton:"Sí, cancelar suscripción",cancelTrialTitle:"Cancelar prueba",cancelTrialConfirm:"¿Estás seguro de que deseas cancelar tu período de prueba?",cancelTrialAccess:"Tu período de prueba continuará hasta",cancelTrialNoCharge:"No se te cobrará — tu período de prueba simplemente expirará",cancelTrialResume:"Puedes reanudar tu prueba en cualquier momento antes de que termine",cancelTrialKeep:"Mantener prueba",cancelTrialButton:"Sí, cancelar prueba",canceling:"Cancelando...",cancelSuccess:"La suscripción se cancelará al final del período de facturación.",cancelNotCharged:"No se te cobrará de nuevo después de la cancelación",cancelResumeAnytime:"Puedes reanudar tu suscripción en cualquier momento antes de que termine",resumeTitle:"Reanudar suscripción",resumeTrial:"Reanudar prueba",resumeConfirm:"¿Estás seguro de que deseas reanudar tu suscripción?",resumeKeep:"Mantener cancelada",resumeButton:"Sí, reanudar suscripción",resuming:"Reanudando...",resumeSuccess:"La suscripción ha sido reanudada.",managePayment:"Administrar pago",openingPortal:"Abriendo...",viewAllPlans:"Ver todos los planes",scheduledCancellation:"Cancelación de suscripción programada",scheduledTrialCancellation:"Cancelación de prueba programada",paymentPastDue:"Pago vencido",paymentPastDueDescription:"Por favor, actualiza tu método de pago para evitar la interrupción del servicio.",subscriptionPaused:"Suscripción pausada",subscriptionPausedDescription:"Tu suscripción está actualmente pausada. Reanúdala para restaurar el acceso completo.",errorLoading:"Error al cargar los datos de la suscripción",errorLoadingDescription:"Por favor, verifica tu conexión e inténtalo de nuevo.",errorProcessing:"Error al procesar la suscripción",errorCanceling:"Error al cancelar la suscripción",errorResuming:"Error al reanudar la suscripción",invalidWorkspace:"ID de espacio de trabajo no válido",billingInterval:{monthly:"Mensual",quarterly:"Trimestral",yearly:"Anual",perMonth:"/mes",perQuarter:"/trimestre",perYear:"/año"},seats:{title:"Puestos",members:"Miembros",included:"Incluidos",billable:"Facturables",perExtraSeat:"Por puesto adicional",limit:"Límite",includedSeats:"Puestos incluidos",maxSeats:"Máx. puestos",freeWithBase:"Gratis con el precio base",allIncluded:"Todos incluidos",extra:"adicional",unlimited:"Ilimitado"},items:{features:"Funciones",limits:"Límites",quotas:"Cuotas de uso"},checkout:{upgrade:"Mejorar",downgrade:"Reducir",switchTo:"Cambiar a",select:"Seleccionar"},status:{active:"Activa",canceling:"Cancelando",trial:"Prueba",canceled:"Cancelada",pastDue:"Vencida",paused:"Pausada",deprecated:"Obsoleta",unknown:"Desconocida"},plan:"Plan",invoicesTab:"Facturas",changePlanButton:"Cambiar plan",noPlanAssigned:"Sin plan asignado",free:"Gratis",perSeatDisplay:"+ {price}/puesto{interval}",estTotalDisplay:"Total est.: {total}{interval} ({count, plural, one {# puesto adicional} other {# puestos adicionales}})",nextBillingDisplay:"Próxima facturación: {date}",membersInWorkspace:"{count, plural, one {# miembro} other {# miembros}} en el espacio de trabajo",billingInCurrency:"Facturación en {currency}",savingsPercent:"Ahorra {percent, number}%",switchToInterval:"Cambiar a {interval}",seatPriceDisplay:"+ {price}/puesto{interval} ({included} {includedLabel})",trialEnded:"Tu período de prueba ha terminado.",trialEndsIn:"Tu período de prueba termina en {days, plural, one {# día} other {# días}}.",onTrial:"Estás en un período de prueba.",upgradeToKeepAccess:"Mejora tu plan para mantener el acceso.",viewInvoices:"Ver facturas",cancelTrial:"Cancelar prueba",dunningFinal:"Última advertencia: La suscripción será suspendida",dunningSuspended:"Suscripción suspendida",dunningRecovery:"Recuperación de pago en curso",dunningSuspendedDescription:"Tu suscripción ha sido suspendida debido a fallos de pago repetidos. Actualiza tu método de pago para restaurar el acceso.",dunningRecoveryDescription:"No pudimos procesar tu pago. Por favor, actualiza tu método de pago para no perder el acceso.",cancelEndDescription:"Tu suscripción terminará el",trialEndDescription:"Tu período de prueba terminará el",cancelEndFallback:"Tu suscripción se cancelará al final del período de facturación actual. No se te cobrará de nuevo.",resumeChargeDate:"Se te cobrará de nuevo el",resumeChargeFallback:"la próxima fecha de facturación",resumeContinue:"Tu suscripción continuará automáticamente y se te facturará según tu plan",resumeCancelAnytime:"Puedes cancelar en cualquier momento antes de la próxima fecha de facturación si cambias de opinión",retainAccess:"Mantendrás acceso completo a este plan hasta",retainAccessFallback:"el final de tu período de facturación actual",noPlansAvailable:"No hay grupos de planes disponibles para este espacio de trabajo. Por favor, contacta a soporte si crees que esto es un error.",noPlansAvailableHint:"No hay grupos de planes disponibles para este espacio de trabajo.",startTrialDescription:"Prueba el plan completo sin compromiso. Puedes mejorar o cancelar en cualquier momento.",noSubscriptionDescription:"Elige un plan para comenzar con tu espacio de trabajo",startFreeTrial:"Comenzar prueba gratuita",startTrialDays:"Comenzar prueba gratuita de {days} días",trialBadge:"Prueba de {days} días"},users:{title:"Miembros del espacio de trabajo",adminOnly:"Solo el administrador del espacio de trabajo puede gestionar usuarios y roles.",inviteByEmail:"Invitar miembro por correo electrónico",inviteButton:"Invitar",inviting:"Invitando...",inviteSuccess:"Usuario invitado correctamente",emailRequired:"El correo electrónico es obligatorio",invalidEmail:"Formato de dirección de correo electrónico no válido",inviteFailed:"Error al invitar al miembro",seatLimitReached:"Límite de puestos alcanzado",memberLimitReached:"Límite de miembros alcanzado",role:"Rol",you:"Tú",owner:"Propietario",noMembers:"No se encontraron miembros en este espacio de trabajo.",extraSeatCost:"Cada miembro adicional añade {price}/{interval, select, yearly {año} quarterly {trim.} other {mes}} a tu suscripción",unknownUser:"Usuario desconocido",seats:"Puestos",members:"Miembros",included:"incluidos",perExtraSeat:"/puesto adicional",maxMembers:"máx. miembros",available:"disponibles",noMemberLimit:"Sin límite de miembros",seatHeading:"{hasSeatPricing, select, true {Puestos} other {Miembros}}",limitReached:"{reason, select, seat_limit_reached {Límite de puestos alcanzado} other {Límite de miembros alcanzado}}",memberCount:"{count, plural, one {# miembro} other {# miembros}}",subscriptionRequired:"Se requiere una suscripción para invitar miembros.",seatLimitMessage:"Tu plan permite hasta {maxUsers, number} miembros. Mejora tu plan para más puestos.",settingsLimitMessage:"Este espacio de trabajo permite hasta {maxUsers, number} miembros.",memberLimitMessage:"Límite de miembros de {maxUsers, number} alcanzado.",selectRole:"Seleccionar un rol",inviteAs:"Invitar como {role}"},invoices:{title:"Historial de facturación",description:"Ver y descargar tus facturas",pay:"Pagar",view:"Ver",viewDetails:"Ver detalles",download:"PDF",errorLoading:"Error al cargar las facturas",noInvoices:"Aún no hay facturas. Suscríbete a un plan para recibir facturas.",noInvoicesWithSub:"No se encontraron facturas con opción de descarga",paidAmount:"Pagado: {amount}",na:"N/D",status:{draft:"Borrador",open:"Abierta",paid:"Pagada",uncollectible:"Incobrable",void:"Anulada"}},usage:{title:"Uso",description:"Monitorea tu consumo de recursos y cuotas",totalResources:"Total de recursos",overallUsage:"Uso general",inOverage:"En exceso",estOverageCost:"Costo est. por exceso",overageDetected:"Exceso detectado",overageDescription:"El uso adicional se facturará como exceso en tu próxima factura.",overageUnits:"Unidades en exceso",rate:"Tarifa",billableBlocks:"Bloques facturables",estimatedCharge:"Cargo estimado",noData:"No hay datos de uso de cuotas disponibles para este espacio de trabajo.",noDataHint:"Las cuotas aparecerán aquí una vez que tu plan incluya recursos medidos.",used:"usado",remaining:"restante",overLimit:"sobre el límite",percentUsed:"{percent, number}% usado",availableRemaining:"{count} restantes",overLimitCount:"{count} sobre el límite",overageWarning:"{count, plural, one {# recurso ha excedido la cuota incluida.} other {# recursos han excedido la cuota incluida.}} El uso adicional se facturará como exceso en tu próxima factura.",fullyUsed:"Completamente usado",renewingSoon:"se renueva pronto",almostFull:"Casi lleno",overage:"Exceso",errorLoading:"Error al cargar los datos de uso",perUnit:"/ unidad",perUnits:"/ unidades",rateDisplay:"{rate} {unitSize, plural, =1 {/ unidad} other {/ {unitSize, number} unidades}}",resourcesExceeded:"{count, plural, one {# recurso ha excedido la cuota incluida.} other {# recursos han excedido la cuota incluida.}}",estOverageCharges:"Cargos estimados por exceso este período: {amount}",overageRateDisplay:"Tarifa de exceso: {rate}",resetDateDisplay:"El uso se restablece el {date}",daysRemainingDisplay:"{count, plural, one {# día restante} other {# días restantes}}"},profile:{email:"Correo electrónico",name:"Nombre",language:"Idioma",country:"País",currency:"Moneda",timezone:"Zona horaria",profileImage:"Imagen de perfil",success:"Perfil guardado correctamente",nameMinLength:"El nombre debe tener al menos 2 caracteres.",save:"Guardar",reset:"Restablecer"},general:{ownerOnly:"Solo el propietario del espacio de trabajo puede cambiar la configuración.",name:"Nombre",namePlaceholder:"Mi espacio de trabajo",nameMinLength:"El nombre del espacio de trabajo debe tener al menos 2 caracteres.",billingCurrency:"Moneda de facturación",icon:"Icono",iconDescription:"Elige un emoji o sube una imagen personalizada para tu espacio de trabajo.",imageUrl:"URL de imagen",imageUrlPlaceholder:"https://ejemplo.com/imagen.png",imageUrlDescription:"Introduce una URL válida para la imagen de tu espacio de trabajo. Compatible con formatos PNG, JPG y SVG.",previewLabel:"Vista previa:",success:"Configuración del espacio de trabajo guardada correctamente",chooseEmoji:"Elegir emoji",customImageUrl:"URL de imagen personalizada",updateWorkspace:"Actualizar espacio de trabajo"},features:{title:"Funciones del espacio de trabajo",ownerOnly:"Solo el propietario del espacio de trabajo puede cambiar las funciones.",noFeatures:"El espacio de trabajo no tiene funciones para gestionar.",enabled:"habilitada",disabled:"deshabilitada",enabling:"Habilitando",disabling:"Deshabilitando",featureSuccess:"correctamente",updateSuccess:"{feature} {enabled, select, true {habilitada} other {deshabilitada}} correctamente",actionStatus:"{action, select, enabling {Habilitando} disabling {Deshabilitando} other {}}"},danger:{title:"Eliminar espacio de trabajo",adminOnly:"Solo los administradores pueden eliminar espacios de trabajo.",deleteWorkspace:"Eliminar espacio de trabajo",deleteConfirm:"¿Estás completamente seguro?",deleteWarning:"Esta acción no se puede deshacer. Esto eliminará permanentemente el espacio de trabajo y todos los datos asociados.",deleting:"Eliminando...",deleteDescription:"Una vez que elimines un espacio de trabajo, no hay vuelta atrás. Esto eliminará permanentemente el espacio de trabajo y todos sus datos, incluidos miembros, configuración y funciones.",deleteConfirmDescription:"Esta acción no se puede deshacer. Esto eliminará permanentemente el espacio de trabajo y todos sus datos.",failedToDelete:"Error al eliminar el espacio de trabajo"},notifications:{title:"Preferencias de notificaciones",permissionDenied:"Permiso de notificaciones denegado",notSupported:"Las notificaciones push no son compatibles con este navegador.",manageDescription:"Administra cómo recibes notificaciones de este espacio de trabajo.",blocked:"Notificaciones bloqueadas",blockedDescription:"Previamente bloqueaste las notificaciones para este sitio. Para habilitarlas, actualiza la configuración de tu navegador:",pushTitle:"Notificaciones push",pushEnabledDescription:"Recibirás notificaciones del navegador para actualizaciones importantes.",pushDisabledDescription:"Recibe notificaciones sobre problemas de pago, expiración de prueba y otras actualizaciones importantes.",enabling:"Habilitando...",disabling:"Deshabilitando...",enable:"Habilitar",disable:"Deshabilitar",toggleAction:"{loading, select, true {{subscribed, select, true {Deshabilitando...} other {Habilitando...}}} other {{subscribed, select, true {Deshabilitar} other {Habilitar}}}}",pushDescription:"{subscribed, select, true {Recibirás notificaciones del navegador para actualizaciones importantes.} other {Recibe notificaciones sobre problemas de pago, expiración de prueba y otras actualizaciones importantes.}}",deviceNote:"Las notificaciones se envían a este dispositivo. Habilítalas en otros dispositivos por separado.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"Haz clic en el icono del candado (o del escudo) en la barra de direcciones",step2:'Busca "Notificaciones" en la lista de permisos',step3:'Cambia de "Bloqueado" a "Permitir"',step4:"Recarga esta página"},safari:{step1:"Abre Safari → Configuración → Sitios web → Notificaciones",step2:"Busca este sitio web en la lista",step3:'Cambia de "Denegar" a "Permitir"',step4:"Recarga esta página"},edge:{step1:"Haz clic en el icono del candado en la barra de direcciones",step2:'Haz clic en "Permisos para este sitio"',step3:'Configura "Notificaciones" como "Permitir"',step4:"Recarga esta página"},chrome:{step1:"Haz clic en el icono del candado (o del ajuste) en la barra de direcciones",step2:'Haz clic en "Configuración del sitio"',step3:'Configura "Notificaciones" como "Permitir"',step4:"Recarga esta página"}}},quota:{includedOnly:"{count, number} incluidos",includedWithOverage:"{count, number} incluidos, luego {price} / {unit}",includedHardLimit:"{count, number} incluidos (límite estricto)",unitFallback:"unidad"},pricing:{title:"Elige tu plan",description:"Compara los planes y selecciona el que mejor se adapte a tus necesidades",currency:"Moneda",billingIn:"Facturación en",noPlansCurrency:"No hay planes disponibles para tu moneda de facturación.",noPlansCurrencyHint:"Algo salió mal. Por favor, contacta a soporte.",noPlans:"No hay planes disponibles",free:"Gratis",included:"incluido",save:"Ahorra",current:"Actual",processing:"Procesando...",unavailable:"No disponible",selectCurrency:"Seleccionar moneda de facturación",billingInterval:"Intervalo de facturación"},beta:{nameLabel:"Nombre",emailLabel:"Correo electrónico",submitText:"Enviar",submittingText:"Enviando...",errorMessage:"Ocurrió un error",tryAgain:"Intentar de nuevo",privacyConsent:"Al enviar este formulario, aceptas nuestra",privacyPolicy:"Política de privacidad",and:"y",termsOfService:"Términos de servicio"},workspace:{switchTitle:"Cambiar espacio de trabajo",switchDescription:"Selecciona un espacio de trabajo o crea uno nuevo.",notLoggedIn:"Parece que no has iniciado sesión. Por favor, inicia sesión para continuar.",availableWorkspaces:"Espacios de trabajo disponibles ({count, number})",loadingWorkspaces:"Cargando espacios de trabajo...",searchPlaceholder:"Buscar espacios de trabajo...",noWorkspacesFound:"No se encontraron espacios de trabajo",noWorkspacesAvailable:"No hay espacios de trabajo disponibles",switchTo:"Cambiar a",membersCount:"{count, plural, one {# miembro} other {# miembros}}",createNew:"Crear nuevo espacio de trabajo",createTitle:"Crear nuevo espacio de trabajo",createDescription:"Crea un nuevo espacio de trabajo para comenzar.",workspaceName:"Nombre del espacio de trabajo",workspaceNamePlaceholder:"Mi espacio de trabajo",workspaceNameMinLength:"El nombre del espacio de trabajo debe tener al menos 2 caracteres.",workspaceIcon:"Icono del espacio de trabajo",iconDescription:"Elige un emoji o sube una imagen personalizada para tu espacio de trabajo.",chooseEmoji:"Elegir emoji",customImageUrl:"URL de imagen personalizada",imageUrl:"URL de imagen",imageUrlPlaceholder:"https://ejemplo.com/imagen.png",imageUrlDescription:"Introduce una URL válida para la imagen de tu espacio de trabajo. Compatible con formatos PNG, JPG y SVG.",invalidUrl:"Por favor, introduce una URL válida",creating:"Creando...",createWorkspace:"Crear espacio de trabajo"},dropdowns:{search:"Buscar...",chooseOption:"Elegir opción",chooseCountry:"Elegir país",searchCountry:"Elegir país...",chooseLanguage:"Elegir idioma",searchLanguage:"Elegir idioma...",chooseCurrency:"Elegir moneda",searchCurrency:"Elegir moneda...",chooseTimezone:"Elegir zona horaria",searchTimezone:"Elegir zona horaria..."},push:{failedToSubscribe:"Error al suscribirse a las notificaciones push",failedToUnsubscribe:"Error al cancelar la suscripción a las notificaciones push"},permissions:{title:"Permisos",description:"Configura lo que cada rol puede hacer en este espacio de trabajo.",ownerOnly:"Solo el propietario del espacio de trabajo puede gestionar los permisos.",save:"Guardar permisos",saving:"Guardando...",saveSuccess:"Permisos guardados correctamente"},errors:{networkError:"Error de red: Por favor, verifica tu conexión a internet",unauthorized:"No autorizado — Por favor, verifica tu sesión",notFound:"Recurso no encontrado",generic:"Ocurrió un error",fetchPlans:"Error al obtener los planes",fetchPlanGroup:"Error al obtener el grupo de planes",fetchPlanGroupVersion:"Error al obtener la versión del grupo de planes",fetchPlanGroupVersions:"Error al obtener las versiones del grupo de planes",fetchSubscription:"Error al obtener la suscripción",createCheckout:"Error al crear la sesión de pago",updateSubscription:"Error al actualizar la suscripción",fetchInvoices:"Error al obtener las facturas",fetchInvoice:"Error al obtener la factura",openBillingPortal:"Error al abrir el portal de facturación",cancelSubscription:"Error al cancelar la suscripción",resumeSubscription:"Error al reanudar la suscripción",recordUsage:"Error al registrar el uso",fetchQuotaUsage:"Error al obtener el estado de uso de cuotas",fetchAllQuotaUsage:"Error al obtener todo el uso de cuotas",fetchUsageLogs:"Error al obtener los registros de uso"}}});var UN=Object.freeze({__proto__:null,fr:{settings:{titles:{profile:"Compte",general:"Paramètres de l'espace de travail",users:"Membres de l'espace de travail",subscription:"Plan et facturation",usage:"Utilisation",features:"Fonctionnalités de l'espace de travail",notifications:"Notifications",permissions:"Permissions",danger:"Zone de danger"},sidebar:{account:"Compte",workspace:"Espace de travail",profile:"Compte",general:"Paramètres",users:"Membres",subscription:"Plan et facturation",usage:"Utilisation",features:"Fonctionnalités",notifications:"Notifications",permissions:"Permissions",danger:"Zone de danger"},common:{refresh:"Actualiser",refreshing:"Actualisation...",retry:"Réessayer",retrying:"Nouvelle tentative...",save:"Enregistrer",saving:"Enregistrement...",cancel:"Annuler",delete:"Supprimer",dismiss:"Ignorer",loading:"Chargement...",success:"Succès !",error:"Erreur",refreshAction:"{loading, select, true {Actualisation...} other {Actualiser}}",retryAction:"{loading, select, true {Nouvelle tentative...} other {Réessayer}}"}},subscription:{managePlan:"Gérez votre plan et votre facturation",changePlan:"Changer de plan",viewPricingPlans:"Voir les plans tarifaires",viewPlans:"Voir les plans",upgradePlan:"Mettre à niveau",subscribe:"S'abonner",currentPlan:"Plan actuel",noSubscription:"Vous n'avez pas d'abonnement actif",choosePlan:"Choisissez votre plan",choosePlanDescription:"Comparez les plans et sélectionnez celui qui correspond à vos besoins",forWorkspace:"pour {name}",planUpdateAvailable:"Mise à jour du plan disponible",updateSuccess:"Abonnement mis à jour avec succès !",updateFailed:"Échec de la mise à jour",cancelTitle:"Annuler l'abonnement",cancelConfirm:"Êtes-vous sûr de vouloir annuler votre abonnement ?",cancelKeep:"Conserver l'abonnement",cancelButton:"Oui, annuler l'abonnement",cancelTrialTitle:"Annuler l'essai",cancelTrialConfirm:"Êtes-vous sûr de vouloir annuler votre période d'essai ?",cancelTrialAccess:"Votre période d'essai continuera jusqu'au",cancelTrialNoCharge:"Vous ne serez pas facturé — votre période d'essai expirera simplement",cancelTrialResume:"Vous pouvez reprendre votre essai à tout moment avant qu'il ne se termine",cancelTrialKeep:"Conserver l'essai",cancelTrialButton:"Oui, annuler l'essai",canceling:"Annulation...",cancelSuccess:"L'abonnement sera annulé à la fin de la période de facturation.",cancelNotCharged:"Vous ne serez plus facturé après l'annulation",cancelResumeAnytime:"Vous pouvez reprendre votre abonnement à tout moment avant qu'il ne se termine",resumeTitle:"Reprendre l'abonnement",resumeTrial:"Reprendre l'essai",resumeConfirm:"Êtes-vous sûr de vouloir reprendre votre abonnement ?",resumeKeep:"Maintenir annulé",resumeButton:"Oui, reprendre l'abonnement",resuming:"Reprise...",resumeSuccess:"L'abonnement a été repris.",managePayment:"Gérer le paiement",openingPortal:"Ouverture...",viewAllPlans:"Voir tous les plans",scheduledCancellation:"Annulation de l'abonnement programmée",scheduledTrialCancellation:"Annulation de l'essai programmée",paymentPastDue:"Paiement en retard",paymentPastDueDescription:"Veuillez mettre à jour votre moyen de paiement pour éviter une interruption de service.",subscriptionPaused:"Abonnement suspendu",subscriptionPausedDescription:"Votre abonnement est actuellement suspendu. Reprenez-le pour restaurer l'accès complet.",errorLoading:"Erreur lors du chargement des données d'abonnement",errorLoadingDescription:"Veuillez vérifier votre connexion et réessayer.",errorProcessing:"Échec du traitement de l'abonnement",errorCanceling:"Échec de l'annulation de l'abonnement",errorResuming:"Échec de la reprise de l'abonnement",invalidWorkspace:"ID d'espace de travail invalide",billingInterval:{monthly:"Mensuel",quarterly:"Trimestriel",yearly:"Annuel",perMonth:"/mois",perQuarter:"/trimestre",perYear:"/an"},seats:{title:"Sièges",members:"Membres",included:"Inclus",billable:"Facturables",perExtraSeat:"Par siège supplémentaire",limit:"Limite",includedSeats:"Sièges inclus",maxSeats:"Sièges max.",freeWithBase:"Gratuit avec le prix de base",allIncluded:"Tous inclus",extra:"supplémentaire",unlimited:"Illimité"},items:{features:"Fonctionnalités",limits:"Limites",quotas:"Quotas d'utilisation"},checkout:{upgrade:"Mettre à niveau",downgrade:"Rétrograder",switchTo:"Passer à",select:"Sélectionner"},status:{active:"Actif",canceling:"En annulation",trial:"Essai",canceled:"Annulé",pastDue:"En retard",paused:"Suspendu",deprecated:"Obsolète",unknown:"Inconnu"},plan:"Plan",invoicesTab:"Factures",changePlanButton:"Changer de plan",noPlanAssigned:"Aucun plan attribué",free:"Gratuit",perSeatDisplay:"+ {price}/siège{interval}",estTotalDisplay:"Total est. : {total}{interval} ({count, plural, one {# siège supplémentaire} other {# sièges supplémentaires}})",nextBillingDisplay:"Prochaine facturation : {date}",membersInWorkspace:"{count, plural, one {# membre} other {# membres}} dans l'espace de travail",billingInCurrency:"Facturation en {currency}",savingsPercent:"Économisez {percent, number}%",switchToInterval:"Passer à {interval}",seatPriceDisplay:"+ {price}/siège{interval} ({included} {includedLabel})",trialEnded:"Votre période d'essai est terminée.",trialEndsIn:"Votre période d'essai se termine dans {days, plural, one {# jour} other {# jours}}.",onTrial:"Vous êtes en période d'essai.",upgradeToKeepAccess:"Mettez à niveau pour conserver l'accès.",viewInvoices:"Voir les factures",cancelTrial:"Annuler l'essai",dunningFinal:"Dernier avertissement : l'abonnement sera suspendu",dunningSuspended:"Abonnement suspendu",dunningRecovery:"Récupération de paiement en cours",dunningSuspendedDescription:"Votre abonnement a été suspendu en raison d'échecs de paiement répétés. Mettez à jour votre moyen de paiement pour restaurer l'accès.",dunningRecoveryDescription:"Nous n'avons pas pu traiter votre paiement. Veuillez mettre à jour votre moyen de paiement pour ne pas perdre l'accès.",cancelEndDescription:"Votre abonnement prendra fin le",trialEndDescription:"Votre période d'essai prendra fin le",cancelEndFallback:"Votre abonnement sera annulé à la fin de la période de facturation en cours. Vous ne serez plus facturé.",resumeChargeDate:"Vous serez de nouveau facturé le",resumeChargeFallback:"la prochaine date de facturation",resumeContinue:"Votre abonnement continuera automatiquement et vous serez facturé selon votre plan",resumeCancelAnytime:"Vous pouvez annuler à tout moment avant la prochaine date de facturation si vous changez d'avis",retainAccess:"Vous conserverez l'accès complet à ce plan jusqu'au",retainAccessFallback:"la fin de votre période de facturation actuelle",noPlansAvailable:"Aucun groupe de plans n'est disponible pour cet espace de travail. Veuillez contacter le support si vous pensez qu'il s'agit d'une erreur.",noPlansAvailableHint:"Aucun groupe de plans n'est disponible pour cet espace de travail.",startTrialDescription:"Essayez le plan complet sans engagement. Vous pouvez mettre à niveau ou annuler à tout moment.",noSubscriptionDescription:"Choisissez un plan pour commencer avec votre espace de travail",startFreeTrial:"Commencer l'essai gratuit",startTrialDays:"Commencer l'essai gratuit de {days} jours",trialBadge:"Essai de {days} jours"},users:{title:"Membres de l'espace de travail",adminOnly:"Seul l'administrateur de l'espace de travail peut gérer les utilisateurs et les rôles.",inviteByEmail:"Inviter un membre par e-mail",inviteButton:"Inviter",inviting:"Invitation...",inviteSuccess:"Utilisateur invité avec succès",emailRequired:"L'adresse e-mail est obligatoire",invalidEmail:"Format d'adresse e-mail invalide",inviteFailed:"Échec de l'invitation du membre",seatLimitReached:"Limite de sièges atteinte",memberLimitReached:"Limite de membres atteinte",role:"Rôle",you:"Vous",owner:"Propriétaire",noMembers:"Aucun membre trouvé dans cet espace de travail.",extraSeatCost:"Chaque membre supplémentaire ajoute {price}/{interval, select, yearly {an} quarterly {trim.} other {mois}} à votre abonnement",unknownUser:"Utilisateur inconnu",seats:"Sièges",members:"Membres",included:"inclus",perExtraSeat:"/siège supplémentaire",maxMembers:"membres max.",available:"disponibles",noMemberLimit:"Pas de limite de membres",seatHeading:"{hasSeatPricing, select, true {Sièges} other {Membres}}",limitReached:"{reason, select, seat_limit_reached {Limite de sièges atteinte} other {Limite de membres atteinte}}",memberCount:"{count, plural, one {# membre} other {# membres}}",subscriptionRequired:"Un abonnement est requis pour inviter des membres.",seatLimitMessage:"Votre plan autorise jusqu'à {maxUsers, number} membres. Mettez à niveau pour plus de sièges.",settingsLimitMessage:"Cet espace de travail autorise jusqu'à {maxUsers, number} membres.",memberLimitMessage:"Limite de membres de {maxUsers, number} atteinte.",selectRole:"Sélectionner un rôle",inviteAs:"Inviter en tant que {role}"},invoices:{title:"Historique de facturation",description:"Consultez et téléchargez vos factures",pay:"Payer",view:"Voir",viewDetails:"Voir les détails",download:"PDF",errorLoading:"Erreur lors du chargement des factures",noInvoices:"Pas encore de factures. Abonnez-vous à un plan pour recevoir des factures.",noInvoicesWithSub:"Aucune facture avec option de téléchargement trouvée",paidAmount:"Payé : {amount}",na:"N/D",status:{draft:"Brouillon",open:"Ouverte",paid:"Payée",uncollectible:"Irrécouvrable",void:"Annulée"}},usage:{title:"Utilisation",description:"Surveillez votre consommation de ressources et vos quotas",totalResources:"Total des ressources",overallUsage:"Utilisation globale",inOverage:"En dépassement",estOverageCost:"Coût est. de dépassement",overageDetected:"Dépassement détecté",overageDescription:"L'utilisation supplémentaire sera facturée en dépassement sur votre prochaine facture.",overageUnits:"Unités en dépassement",rate:"Tarif",billableBlocks:"Blocs facturables",estimatedCharge:"Charge estimée",noData:"Aucune donnée d'utilisation de quotas disponible pour cet espace de travail.",noDataHint:"Les quotas apparaîtront ici une fois que votre plan inclura des ressources mesurées.",used:"utilisé",remaining:"restant",overLimit:"au-dessus de la limite",percentUsed:"{percent, number}% utilisé",availableRemaining:"{count} restants",overLimitCount:"{count} au-dessus de la limite",overageWarning:"{count, plural, one {# ressource a dépassé le quota inclus.} other {# ressources ont dépassé le quota inclus.}} L'utilisation supplémentaire sera facturée en dépassement sur votre prochaine facture.",fullyUsed:"Entièrement utilisé",renewingSoon:"renouvellement imminent",almostFull:"Presque plein",overage:"Dépassement",errorLoading:"Échec du chargement des données d'utilisation",perUnit:"/ unité",perUnits:"/ unités",rateDisplay:"{rate} {unitSize, plural, =1 {/ unité} other {/ {unitSize, number} unités}}",resourcesExceeded:"{count, plural, one {# ressource a dépassé le quota inclus.} other {# ressources ont dépassé le quota inclus.}}",estOverageCharges:"Charges de dépassement estimées pour cette période : {amount}",overageRateDisplay:"Tarif de dépassement : {rate}",resetDateDisplay:"L'utilisation se réinitialise le {date}",daysRemainingDisplay:"{count, plural, one {# jour restant} other {# jours restants}}"},profile:{email:"E-mail",name:"Nom",language:"Langue",country:"Pays",currency:"Devise",timezone:"Fuseau horaire",profileImage:"Image de profil",success:"Profil enregistré avec succès",nameMinLength:"Le nom doit comporter au moins 2 caractères.",save:"Enregistrer",reset:"Réinitialiser"},general:{ownerOnly:"Seul le propriétaire de l'espace de travail peut modifier les paramètres.",name:"Nom",namePlaceholder:"Mon espace de travail",nameMinLength:"Le nom de l'espace de travail doit comporter au moins 2 caractères.",billingCurrency:"Devise de facturation",icon:"Icône",iconDescription:"Choisissez un emoji ou téléchargez une image personnalisée pour votre espace de travail.",imageUrl:"URL de l'image",imageUrlPlaceholder:"https://exemple.com/image.png",imageUrlDescription:"Entrez une URL valide pour l'image de votre espace de travail. Formats pris en charge : PNG, JPG et SVG.",previewLabel:"Aperçu :",success:"Paramètres de l'espace de travail enregistrés avec succès",chooseEmoji:"Choisir un emoji",customImageUrl:"URL d'image personnalisée",updateWorkspace:"Mettre à jour l'espace de travail"},features:{title:"Fonctionnalités de l'espace de travail",ownerOnly:"Seul le propriétaire de l'espace de travail peut modifier les fonctionnalités.",noFeatures:"L'espace de travail n'a pas de fonctionnalités à gérer.",enabled:"activée",disabled:"désactivée",enabling:"Activation",disabling:"Désactivation",featureSuccess:"avec succès",updateSuccess:"{feature} {enabled, select, true {activée} other {désactivée}} avec succès",actionStatus:"{action, select, enabling {Activation} disabling {Désactivation} other {}}"},danger:{title:"Supprimer l'espace de travail",adminOnly:"Seuls les administrateurs peuvent supprimer les espaces de travail.",deleteWorkspace:"Supprimer l'espace de travail",deleteConfirm:"Êtes-vous absolument sûr ?",deleteWarning:"Cette action est irréversible. Cela supprimera définitivement l'espace de travail et toutes les données associées.",deleting:"Suppression...",deleteDescription:"Une fois l'espace de travail supprimé, il n'y a pas de retour en arrière. Cela supprimera définitivement l'espace de travail et toutes ses données, y compris les membres, les paramètres et les fonctionnalités.",deleteConfirmDescription:"Cette action est irréversible. Cela supprimera définitivement l'espace de travail et toutes ses données.",failedToDelete:"Échec de la suppression de l'espace de travail"},notifications:{title:"Préférences de notifications",permissionDenied:"Autorisation de notifications refusée",notSupported:"Les notifications push ne sont pas prises en charge par ce navigateur.",manageDescription:"Gérez la façon dont vous recevez les notifications de cet espace de travail.",blocked:"Notifications bloquées",blockedDescription:"Vous avez précédemment bloqué les notifications pour ce site. Pour les activer, mettez à jour les paramètres de votre navigateur :",pushTitle:"Notifications push",pushEnabledDescription:"Vous recevrez des notifications du navigateur pour les mises à jour importantes.",pushDisabledDescription:"Recevez des notifications concernant les problèmes de paiement, l'expiration de l'essai et d'autres mises à jour importantes.",enabling:"Activation...",disabling:"Désactivation...",enable:"Activer",disable:"Désactiver",toggleAction:"{loading, select, true {{subscribed, select, true {Désactivation...} other {Activation...}}} other {{subscribed, select, true {Désactiver} other {Activer}}}}",pushDescription:"{subscribed, select, true {Vous recevrez des notifications du navigateur pour les mises à jour importantes.} other {Recevez des notifications concernant les problèmes de paiement, l'expiration de l'essai et d'autres mises à jour importantes.}}",deviceNote:"Les notifications sont envoyées à cet appareil. Activez-les sur vos autres appareils séparément.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"Cliquez sur l'icône du cadenas (ou du bouclier) dans la barre d'adresse",step2:'Trouvez "Notifications" dans la liste des autorisations',step3:'Changez de "Bloqué" à "Autoriser"',step4:"Rechargez cette page"},safari:{step1:"Ouvrez Safari → Réglages → Sites web → Notifications",step2:"Trouvez ce site web dans la liste",step3:'Changez de "Refuser" à "Autoriser"',step4:"Rechargez cette page"},edge:{step1:"Cliquez sur l'icône du cadenas dans la barre d'adresse",step2:'Cliquez sur "Autorisations pour ce site"',step3:'Réglez "Notifications" sur "Autoriser"',step4:"Rechargez cette page"},chrome:{step1:"Cliquez sur l'icône du cadenas (ou de réglage) dans la barre d'adresse",step2:'Cliquez sur "Paramètres du site"',step3:'Réglez "Notifications" sur "Autoriser"',step4:"Rechargez cette page"}}},quota:{includedOnly:"{count, number} inclus",includedWithOverage:"{count, number} inclus, puis {price} / {unit}",includedHardLimit:"{count, number} inclus (limite stricte)",unitFallback:"unité"},pricing:{title:"Choisissez votre plan",description:"Comparez les plans et sélectionnez celui qui correspond à vos besoins",currency:"Devise",billingIn:"Facturation en",noPlansCurrency:"Aucun plan disponible pour votre devise de facturation.",noPlansCurrencyHint:"Une erreur s'est produite. Veuillez contacter le support.",noPlans:"Aucun plan disponible",free:"Gratuit",included:"inclus",save:"Économisez",current:"Actuel",processing:"Traitement...",unavailable:"Indisponible",selectCurrency:"Sélectionner la devise de facturation",billingInterval:"Intervalle de facturation"},beta:{nameLabel:"Nom",emailLabel:"E-mail",submitText:"Envoyer",submittingText:"Envoi...",errorMessage:"Une erreur s'est produite",tryAgain:"Réessayer",privacyConsent:"En soumettant ce formulaire, vous acceptez notre",privacyPolicy:"Politique de confidentialité",and:"et",termsOfService:"Conditions d'utilisation"},workspace:{switchTitle:"Changer d'espace de travail",switchDescription:"Sélectionnez un espace de travail ou créez-en un nouveau.",notLoggedIn:"Il semble que vous n'êtes pas connecté. Veuillez vous connecter pour continuer.",availableWorkspaces:"Espaces de travail disponibles ({count, number})",loadingWorkspaces:"Chargement des espaces de travail...",searchPlaceholder:"Rechercher des espaces de travail...",noWorkspacesFound:"Aucun espace de travail trouvé",noWorkspacesAvailable:"Aucun espace de travail disponible",switchTo:"Passer à",membersCount:"{count, plural, one {# membre} other {# membres}}",createNew:"Créer un nouvel espace de travail",createTitle:"Créer un nouvel espace de travail",createDescription:"Créez un nouvel espace de travail pour commencer.",workspaceName:"Nom de l'espace de travail",workspaceNamePlaceholder:"Mon espace de travail",workspaceNameMinLength:"Le nom de l'espace de travail doit comporter au moins 2 caractères.",workspaceIcon:"Icône de l'espace de travail",iconDescription:"Choisissez un emoji ou téléchargez une image personnalisée pour votre espace de travail.",chooseEmoji:"Choisir un emoji",customImageUrl:"URL d'image personnalisée",imageUrl:"URL de l'image",imageUrlPlaceholder:"https://exemple.com/image.png",imageUrlDescription:"Entrez une URL valide pour l'image de votre espace de travail. Formats pris en charge : PNG, JPG et SVG.",invalidUrl:"Veuillez entrer une URL valide",creating:"Création...",createWorkspace:"Créer l'espace de travail"},dropdowns:{search:"Rechercher...",chooseOption:"Choisir une option",chooseCountry:"Choisir un pays",searchCountry:"Choisir un pays...",chooseLanguage:"Choisir une langue",searchLanguage:"Choisir une langue...",chooseCurrency:"Choisir une devise",searchCurrency:"Choisir une devise...",chooseTimezone:"Choisir un fuseau horaire",searchTimezone:"Choisir un fuseau horaire..."},push:{failedToSubscribe:"Échec de l'abonnement aux notifications push",failedToUnsubscribe:"Échec de la désinscription des notifications push"},permissions:{title:"Permissions",description:"Configurez ce que chaque rôle peut faire dans cet espace de travail.",ownerOnly:"Seul le propriétaire de l'espace de travail peut gérer les permissions.",save:"Enregistrer les permissions",saving:"Enregistrement...",saveSuccess:"Permissions enregistrées avec succès"},errors:{networkError:"Erreur réseau : Veuillez vérifier votre connexion Internet",unauthorized:"Non autorisé — Veuillez vérifier votre session",notFound:"Ressource introuvable",generic:"Une erreur s'est produite",fetchPlans:"Échec de la récupération des plans",fetchPlanGroup:"Échec de la récupération du groupe de plans",fetchPlanGroupVersion:"Échec de la récupération de la version du groupe de plans",fetchPlanGroupVersions:"Échec de la récupération des versions du groupe de plans",fetchSubscription:"Échec de la récupération de l'abonnement",createCheckout:"Échec de la création de la session de paiement",updateSubscription:"Échec de la mise à jour de l'abonnement",fetchInvoices:"Échec de la récupération des factures",fetchInvoice:"Échec de la récupération de la facture",openBillingPortal:"Échec de l'ouverture du portail de facturation",cancelSubscription:"Échec de l'annulation de l'abonnement",resumeSubscription:"Échec de la reprise de l'abonnement",recordUsage:"Échec de l'enregistrement de l'utilisation",fetchQuotaUsage:"Échec de la récupération du statut d'utilisation des quotas",fetchAllQuotaUsage:"Échec de la récupération de toute l'utilisation des quotas",fetchUsageLogs:"Échec de la récupération des journaux d'utilisation"}}});var MN=Object.freeze({__proto__:null,de:{settings:{titles:{profile:"Konto",general:"Arbeitsbereich-Einstellungen",users:"Arbeitsbereich-Mitglieder",subscription:"Plan & Abrechnung",usage:"Nutzung",features:"Arbeitsbereich-Funktionen",notifications:"Benachrichtigungen",permissions:"Berechtigungen",danger:"Gefahrenzone"},sidebar:{account:"Konto",workspace:"Arbeitsbereich",profile:"Konto",general:"Einstellungen",users:"Mitglieder",subscription:"Plan & Abrechnung",usage:"Nutzung",features:"Funktionen",notifications:"Benachrichtigungen",permissions:"Berechtigungen",danger:"Gefahrenzone"},common:{refresh:"Aktualisieren",refreshing:"Wird aktualisiert...",retry:"Erneut versuchen",retrying:"Wird erneut versucht...",save:"Speichern",saving:"Wird gespeichert...",cancel:"Abbrechen",delete:"Löschen",dismiss:"Verwerfen",loading:"Wird geladen...",success:"Erfolg!",error:"Fehler",refreshAction:"{loading, select, true {Wird aktualisiert...} other {Aktualisieren}}",retryAction:"{loading, select, true {Wird erneut versucht...} other {Erneut versuchen}}"}},subscription:{managePlan:"Verwalte deinen Plan und deine Abrechnung",changePlan:"Plan ändern",viewPricingPlans:"Preispläne ansehen",viewPlans:"Pläne ansehen",upgradePlan:"Jetzt upgraden",subscribe:"Abonnieren",currentPlan:"Aktueller Plan",noSubscription:"Du hast kein aktives Abonnement",choosePlan:"Wähle deinen Plan",choosePlanDescription:"Vergleiche Pläne und wähle den, der zu deinen Anforderungen passt",forWorkspace:"für {name}",planUpdateAvailable:"Plan-Update verfügbar",updateSuccess:"Abonnement erfolgreich aktualisiert!",updateFailed:"Aktualisierung fehlgeschlagen",cancelTitle:"Abonnement kündigen",cancelConfirm:"Bist du sicher, dass du dein Abonnement kündigen möchtest?",cancelKeep:"Abonnement behalten",cancelButton:"Ja, Abonnement kündigen",cancelTrialTitle:"Testversion abbrechen",cancelTrialConfirm:"Bist du sicher, dass du deine Testversion abbrechen möchtest?",cancelTrialAccess:"Deine Testversion läuft weiter bis",cancelTrialNoCharge:"Dir wird nichts berechnet — deine Testversion läuft einfach ab",cancelTrialResume:"Du kannst deine Testversion jederzeit vor Ablauf wieder aufnehmen",cancelTrialKeep:"Testversion behalten",cancelTrialButton:"Ja, Testversion abbrechen",canceling:"Wird gekündigt...",cancelSuccess:"Das Abonnement wird zum Ende des Abrechnungszeitraums gekündigt.",cancelNotCharged:"Nach der Kündigung wird dir nichts mehr berechnet",cancelResumeAnytime:"Du kannst dein Abonnement jederzeit vor Ablauf wieder aufnehmen",resumeTitle:"Abonnement fortsetzen",resumeTrial:"Testversion fortsetzen",resumeConfirm:"Bist du sicher, dass du dein Abonnement fortsetzen möchtest?",resumeKeep:"Gekündigt lassen",resumeButton:"Ja, Abonnement fortsetzen",resuming:"Wird fortgesetzt...",resumeSuccess:"Das Abonnement wurde fortgesetzt.",managePayment:"Zahlung verwalten",openingPortal:"Wird geöffnet...",viewAllPlans:"Alle Pläne ansehen",scheduledCancellation:"Kündigung des Abonnements geplant",scheduledTrialCancellation:"Kündigung der Testversion geplant",paymentPastDue:"Zahlung überfällig",paymentPastDueDescription:"Bitte aktualisiere deine Zahlungsmethode, um eine Dienstunterbrechung zu vermeiden.",subscriptionPaused:"Abonnement pausiert",subscriptionPausedDescription:"Dein Abonnement ist derzeit pausiert. Setze es fort, um den vollen Zugang wiederherzustellen.",errorLoading:"Fehler beim Laden der Abonnementdaten",errorLoadingDescription:"Bitte überprüfe deine Verbindung und versuche es erneut.",errorProcessing:"Abonnement konnte nicht verarbeitet werden",errorCanceling:"Abonnement konnte nicht gekündigt werden",errorResuming:"Abonnement konnte nicht fortgesetzt werden",invalidWorkspace:"Ungültige Arbeitsbereich-ID",billingInterval:{monthly:"Monatlich",quarterly:"Vierteljährlich",yearly:"Jährlich",perMonth:"/Monat",perQuarter:"/Quartal",perYear:"/Jahr"},seats:{title:"Plätze",members:"Mitglieder",included:"Enthalten",billable:"Abrechenbar",perExtraSeat:"Pro zusätzlichem Platz",limit:"Limit",includedSeats:"Enthaltene Plätze",maxSeats:"Max. Plätze",freeWithBase:"Im Grundpreis enthalten",allIncluded:"Alle enthalten",extra:"zusätzlich",unlimited:"Unbegrenzt"},items:{features:"Funktionen",limits:"Limits",quotas:"Nutzungskontingente"},checkout:{upgrade:"Upgraden",downgrade:"Downgraden",switchTo:"Wechseln zu",select:"Auswählen"},status:{active:"Aktiv",canceling:"Wird gekündigt",trial:"Testversion",canceled:"Gekündigt",pastDue:"Überfällig",paused:"Pausiert",deprecated:"Veraltet",unknown:"Unbekannt"},plan:"Plan",invoicesTab:"Rechnungen",changePlanButton:"Plan ändern",noPlanAssigned:"Kein Plan zugewiesen",free:"Kostenlos",perSeatDisplay:"+ {price}/Platz{interval}",estTotalDisplay:"Geschätztes Gesamt: {total}{interval} ({count, plural, one {# zusätzlicher Platz} other {# zusätzliche Plätze}})",nextBillingDisplay:"Nächste Abrechnung: {date}",membersInWorkspace:"{count, plural, one {# Mitglied} other {# Mitglieder}} im Arbeitsbereich",billingInCurrency:"Abrechnung in {currency}",savingsPercent:"{percent, number}% sparen",switchToInterval:"Zu {interval} wechseln",seatPriceDisplay:"+ {price}/Platz{interval} ({included} {includedLabel})",trialEnded:"Deine Testversion ist abgelaufen.",trialEndsIn:"Deine Testversion endet in {days, plural, one {# Tag} other {# Tagen}}.",onTrial:"Du befindest dich in der Testversion.",upgradeToKeepAccess:"Upgrade, um den Zugang zu behalten.",viewInvoices:"Rechnungen ansehen",cancelTrial:"Testversion abbrechen",dunningFinal:"Letzte Warnung: Abonnement wird ausgesetzt",dunningSuspended:"Abonnement ausgesetzt",dunningRecovery:"Zahlungswiederherstellung läuft",dunningSuspendedDescription:"Dein Abonnement wurde aufgrund wiederholter Zahlungsfehler ausgesetzt. Aktualisiere deine Zahlungsmethode, um den Zugang wiederherzustellen.",dunningRecoveryDescription:"Wir konnten deine Zahlung nicht verarbeiten. Bitte aktualisiere deine Zahlungsmethode, um den Zugang nicht zu verlieren.",cancelEndDescription:"Dein Abonnement endet am",trialEndDescription:"Deine Testversion endet am",cancelEndFallback:"Dein Abonnement wird zum Ende des aktuellen Abrechnungszeitraums gekündigt. Dir wird nichts mehr berechnet.",resumeChargeDate:"Dir wird erneut berechnet am",resumeChargeFallback:"dem nächsten Abrechnungsdatum",resumeContinue:"Dein Abonnement wird automatisch fortgesetzt und gemäß deinem Plan abgerechnet",resumeCancelAnytime:"Du kannst jederzeit vor dem nächsten Abrechnungsdatum kündigen, wenn du es dir anders überlegst",retainAccess:"Du behältst den vollen Zugang zu diesem Plan bis",retainAccessFallback:"zum Ende deines aktuellen Abrechnungszeitraums",noPlansAvailable:"Für diesen Arbeitsbereich sind keine Plangruppen verfügbar. Bitte kontaktiere den Support, wenn du glaubst, dass dies ein Fehler ist.",noPlansAvailableHint:"Für diesen Arbeitsbereich sind keine Plangruppen verfügbar.",startTrialDescription:"Teste den vollständigen Plan ohne Verpflichtung. Du kannst jederzeit upgraden oder kündigen.",noSubscriptionDescription:"Wähle einen Plan, um mit deinem Arbeitsbereich loszulegen",startFreeTrial:"Kostenlose Testversion starten",startTrialDays:"{days}-tägige kostenlose Testversion starten",trialBadge:"{days}-Tage-Testversion"},users:{title:"Arbeitsbereich-Mitglieder",adminOnly:"Nur der Arbeitsbereich-Administrator kann Benutzer und Rollen verwalten.",inviteByEmail:"Mitglied per E-Mail einladen",inviteButton:"Einladen",inviting:"Wird eingeladen...",inviteSuccess:"Benutzer erfolgreich eingeladen",emailRequired:"E-Mail-Adresse ist erforderlich",invalidEmail:"Ungültiges E-Mail-Adressformat",inviteFailed:"Einladung des Mitglieds fehlgeschlagen",seatLimitReached:"Platzlimit erreicht",memberLimitReached:"Mitgliederlimit erreicht",role:"Rolle",you:"Du",owner:"Eigentümer",noMembers:"Keine Mitglieder in diesem Arbeitsbereich gefunden.",extraSeatCost:"Jedes zusätzliche Mitglied fügt {price}/{interval, select, yearly {Jahr} quarterly {Quartal} other {Monat}} zu deinem Abonnement hinzu",unknownUser:"Unbekannter Benutzer",seats:"Plätze",members:"Mitglieder",included:"enthalten",perExtraSeat:"/zusätzlicher Platz",maxMembers:"max. Mitglieder",available:"verfügbar",noMemberLimit:"Kein Mitgliederlimit",seatHeading:"{hasSeatPricing, select, true {Plätze} other {Mitglieder}}",limitReached:"{reason, select, seat_limit_reached {Platzlimit erreicht} other {Mitgliederlimit erreicht}}",memberCount:"{count, plural, one {# Mitglied} other {# Mitglieder}}",subscriptionRequired:"Ein Abonnement ist erforderlich, um Mitglieder einzuladen.",seatLimitMessage:"Dein Plan erlaubt bis zu {maxUsers, number} Mitglieder. Upgrade für mehr Plätze.",settingsLimitMessage:"Dieser Arbeitsbereich erlaubt bis zu {maxUsers, number} Mitglieder.",memberLimitMessage:"Mitgliederlimit von {maxUsers, number} erreicht.",selectRole:"Rolle auswählen",inviteAs:"Einladen als {role}"},invoices:{title:"Abrechnungsverlauf",description:"Rechnungen ansehen und herunterladen",pay:"Bezahlen",view:"Ansehen",viewDetails:"Details ansehen",download:"PDF",errorLoading:"Fehler beim Laden der Rechnungen",noInvoices:"Noch keine Rechnungen. Abonniere einen Plan, um Rechnungen zu erhalten.",noInvoicesWithSub:"Keine Rechnungen mit Download-Option gefunden",paidAmount:"Bezahlt: {amount}",na:"k. A.",status:{draft:"Entwurf",open:"Offen",paid:"Bezahlt",uncollectible:"Uneinbringlich",void:"Storniert"}},usage:{title:"Nutzung",description:"Überwache deinen Ressourcenverbrauch und deine Kontingente",totalResources:"Ressourcen gesamt",overallUsage:"Gesamtnutzung",inOverage:"Im Überschuss",estOverageCost:"Geschätzte Überschusskosten",overageDetected:"Überschuss erkannt",overageDescription:"Zusätzliche Nutzung wird als Überschuss auf deiner nächsten Rechnung berechnet.",overageUnits:"Überschusseinheiten",rate:"Tarif",billableBlocks:"Abrechenbare Blöcke",estimatedCharge:"Geschätzte Kosten",noData:"Keine Kontingentnutzungsdaten für diesen Arbeitsbereich verfügbar.",noDataHint:"Kontingente erscheinen hier, sobald dein Plan gemessene Ressourcen enthält.",used:"genutzt",remaining:"verbleibend",overLimit:"über dem Limit",percentUsed:"{percent, number}% genutzt",availableRemaining:"{count} verbleibend",overLimitCount:"{count} über dem Limit",overageWarning:"{count, plural, one {# Ressource hat das enthaltene Kontingent überschritten.} other {# Ressourcen haben das enthaltene Kontingent überschritten.}} Zusätzliche Nutzung wird als Überschuss auf deiner nächsten Rechnung berechnet.",fullyUsed:"Vollständig genutzt",renewingSoon:"wird bald erneuert",almostFull:"Fast voll",overage:"Überschuss",errorLoading:"Nutzungsdaten konnten nicht geladen werden",perUnit:"/ Einheit",perUnits:"/ Einheiten",rateDisplay:"{rate} {unitSize, plural, =1 {/ Einheit} other {/ {unitSize, number} Einheiten}}",resourcesExceeded:"{count, plural, one {# Ressource hat das enthaltene Kontingent überschritten.} other {# Ressourcen haben das enthaltene Kontingent überschritten.}}",estOverageCharges:"Geschätzte Überschusskosten in diesem Zeitraum: {amount}",overageRateDisplay:"Überschusstarif: {rate}",resetDateDisplay:"Nutzung wird zurückgesetzt am {date}",daysRemainingDisplay:"{count, plural, one {# Tag verbleibend} other {# Tage verbleibend}}"},profile:{email:"E-Mail",name:"Name",language:"Sprache",country:"Land",currency:"Währung",timezone:"Zeitzone",profileImage:"Profilbild",success:"Profil erfolgreich gespeichert",nameMinLength:"Der Name muss mindestens 2 Zeichen lang sein.",save:"Speichern",reset:"Zurücksetzen"},general:{ownerOnly:"Nur der Eigentümer des Arbeitsbereichs kann die Einstellungen ändern.",name:"Name",namePlaceholder:"Mein Arbeitsbereich",nameMinLength:"Der Arbeitsbereichname muss mindestens 2 Zeichen lang sein.",billingCurrency:"Abrechnungswährung",icon:"Symbol",iconDescription:"Wähle ein Emoji oder lade ein benutzerdefiniertes Bild für deinen Arbeitsbereich hoch.",imageUrl:"Bild-URL",imageUrlPlaceholder:"https://beispiel.de/bild.png",imageUrlDescription:"Gib eine gültige URL für dein Arbeitsbereich-Bild ein. Unterstützt PNG-, JPG- und SVG-Formate.",previewLabel:"Vorschau:",success:"Arbeitsbereich-Einstellungen erfolgreich gespeichert",chooseEmoji:"Emoji wählen",customImageUrl:"Benutzerdefinierte Bild-URL",updateWorkspace:"Arbeitsbereich aktualisieren"},features:{title:"Arbeitsbereich-Funktionen",ownerOnly:"Nur der Eigentümer des Arbeitsbereichs kann die Funktionen ändern.",noFeatures:"Der Arbeitsbereich hat keine zu verwaltenden Funktionen.",enabled:"aktiviert",disabled:"deaktiviert",enabling:"Wird aktiviert",disabling:"Wird deaktiviert",featureSuccess:"erfolgreich",updateSuccess:"{feature} erfolgreich {enabled, select, true {aktiviert} other {deaktiviert}}",actionStatus:"{action, select, enabling {Wird aktiviert} disabling {Wird deaktiviert} other {}}"},danger:{title:"Arbeitsbereich löschen",adminOnly:"Nur Administratoren können Arbeitsbereiche löschen.",deleteWorkspace:"Arbeitsbereich löschen",deleteConfirm:"Bist du dir absolut sicher?",deleteWarning:"Diese Aktion kann nicht rückgängig gemacht werden. Der Arbeitsbereich und alle zugehörigen Daten werden dauerhaft gelöscht.",deleting:"Wird gelöscht...",deleteDescription:"Sobald du einen Arbeitsbereich löschst, gibt es kein Zurück. Der Arbeitsbereich und alle seine Daten werden dauerhaft gelöscht, einschließlich Mitglieder, Einstellungen und Funktionen.",deleteConfirmDescription:"Diese Aktion kann nicht rückgängig gemacht werden. Der Arbeitsbereich und alle seine Daten werden dauerhaft gelöscht.",failedToDelete:"Arbeitsbereich konnte nicht gelöscht werden"},notifications:{title:"Benachrichtigungseinstellungen",permissionDenied:"Benachrichtigungsberechtigung verweigert",notSupported:"Push-Benachrichtigungen werden in diesem Browser nicht unterstützt.",manageDescription:"Verwalte, wie du Benachrichtigungen von diesem Arbeitsbereich erhältst.",blocked:"Benachrichtigungen blockiert",blockedDescription:"Du hast Benachrichtigungen für diese Seite zuvor blockiert. Um sie zu aktivieren, aktualisiere deine Browsereinstellungen:",pushTitle:"Push-Benachrichtigungen",pushEnabledDescription:"Du erhältst Browser-Benachrichtigungen für wichtige Updates.",pushDisabledDescription:"Erhalte Benachrichtigungen über Zahlungsprobleme, Ablauf der Testversion und andere wichtige Updates.",enabling:"Wird aktiviert...",disabling:"Wird deaktiviert...",enable:"Aktivieren",disable:"Deaktivieren",toggleAction:"{loading, select, true {{subscribed, select, true {Wird deaktiviert...} other {Wird aktiviert...}}} other {{subscribed, select, true {Deaktivieren} other {Aktivieren}}}}",pushDescription:"{subscribed, select, true {Du erhältst Browser-Benachrichtigungen für wichtige Updates.} other {Erhalte Benachrichtigungen über Zahlungsprobleme, Ablauf der Testversion und andere wichtige Updates.}}",deviceNote:"Benachrichtigungen werden an dieses Gerät gesendet. Aktiviere sie auf anderen Geräten separat.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"Klicke auf das Schloss-Symbol (oder Schild-Symbol) in der Adressleiste",step2:'Finde "Benachrichtigungen" in der Berechtigungsliste',step3:'Ändere von "Blockiert" zu "Erlauben"',step4:"Lade diese Seite neu"},safari:{step1:"Öffne Safari → Einstellungen → Websites → Benachrichtigungen",step2:"Finde diese Website in der Liste",step3:'Ändere von "Ablehnen" zu "Erlauben"',step4:"Lade diese Seite neu"},edge:{step1:"Klicke auf das Schloss-Symbol in der Adressleiste",step2:'Klicke auf "Berechtigungen für diese Website"',step3:'Setze "Benachrichtigungen" auf "Erlauben"',step4:"Lade diese Seite neu"},chrome:{step1:"Klicke auf das Schloss-Symbol (oder Einstellungssymbol) in der Adressleiste",step2:'Klicke auf "Website-Einstellungen"',step3:'Setze "Benachrichtigungen" auf "Erlauben"',step4:"Lade diese Seite neu"}}},quota:{includedOnly:"{count, number} enthalten",includedWithOverage:"{count, number} enthalten, dann {price} / {unit}",includedHardLimit:"{count, number} enthalten (festes Limit)",unitFallback:"Einheit"},pricing:{title:"Wähle deinen Plan",description:"Vergleiche Pläne und wähle den, der zu deinen Anforderungen passt",currency:"Währung",billingIn:"Abrechnung in",noPlansCurrency:"Keine Pläne für deine Abrechnungswährung verfügbar.",noPlansCurrencyHint:"Etwas ist schiefgelaufen. Bitte kontaktiere den Support.",noPlans:"Keine Pläne verfügbar",free:"Kostenlos",included:"enthalten",save:"Sparen",current:"Aktuell",processing:"Wird verarbeitet...",unavailable:"Nicht verfügbar",selectCurrency:"Abrechnungswährung auswählen",billingInterval:"Abrechnungsintervall"},beta:{nameLabel:"Name",emailLabel:"E-Mail",submitText:"Absenden",submittingText:"Wird gesendet...",errorMessage:"Ein Fehler ist aufgetreten",tryAgain:"Erneut versuchen",privacyConsent:"Mit dem Absenden dieses Formulars stimmst du unserer",privacyPolicy:"Datenschutzrichtlinie",and:"und",termsOfService:"Nutzungsbedingungen"},workspace:{switchTitle:"Arbeitsbereich wechseln",switchDescription:"Wähle einen Arbeitsbereich aus oder erstelle einen neuen.",notLoggedIn:"Es sieht so aus, als wärst du nicht eingeloggt. Bitte melde dich an, um fortzufahren.",availableWorkspaces:"Verfügbare Arbeitsbereiche ({count, number})",loadingWorkspaces:"Arbeitsbereiche werden geladen...",searchPlaceholder:"Arbeitsbereiche suchen...",noWorkspacesFound:"Keine Arbeitsbereiche gefunden",noWorkspacesAvailable:"Keine Arbeitsbereiche verfügbar",switchTo:"Wechseln zu",membersCount:"{count, plural, one {# Mitglied} other {# Mitglieder}}",createNew:"Neuen Arbeitsbereich erstellen",createTitle:"Neuen Arbeitsbereich erstellen",createDescription:"Erstelle einen neuen Arbeitsbereich, um loszulegen.",workspaceName:"Name des Arbeitsbereichs",workspaceNamePlaceholder:"Mein Arbeitsbereich",workspaceNameMinLength:"Der Arbeitsbereichname muss mindestens 2 Zeichen lang sein.",workspaceIcon:"Arbeitsbereich-Symbol",iconDescription:"Wähle ein Emoji oder lade ein benutzerdefiniertes Bild für deinen Arbeitsbereich hoch.",chooseEmoji:"Emoji wählen",customImageUrl:"Benutzerdefinierte Bild-URL",imageUrl:"Bild-URL",imageUrlPlaceholder:"https://beispiel.de/bild.png",imageUrlDescription:"Gib eine gültige URL für dein Arbeitsbereich-Bild ein. Unterstützt PNG-, JPG- und SVG-Formate.",invalidUrl:"Bitte gib eine gültige URL ein",creating:"Wird erstellt...",createWorkspace:"Arbeitsbereich erstellen"},dropdowns:{search:"Suchen...",chooseOption:"Option wählen",chooseCountry:"Land wählen",searchCountry:"Land wählen...",chooseLanguage:"Sprache wählen",searchLanguage:"Sprache wählen...",chooseCurrency:"Währung wählen",searchCurrency:"Währung wählen...",chooseTimezone:"Zeitzone wählen",searchTimezone:"Zeitzone wählen..."},push:{failedToSubscribe:"Push-Benachrichtigungen konnten nicht abonniert werden",failedToUnsubscribe:"Push-Benachrichtigungen konnten nicht abbestellt werden"},permissions:{title:"Berechtigungen",description:"Konfiguriere, was jede Rolle in diesem Arbeitsbereich tun kann.",ownerOnly:"Nur der Eigentümer des Arbeitsbereichs kann Berechtigungen verwalten.",save:"Berechtigungen speichern",saving:"Wird gespeichert...",saveSuccess:"Berechtigungen erfolgreich gespeichert"},errors:{networkError:"Netzwerkfehler: Bitte überprüfe deine Internetverbindung",unauthorized:"Nicht autorisiert — Bitte überprüfe deine Sitzung",notFound:"Ressource nicht gefunden",generic:"Ein Fehler ist aufgetreten",fetchPlans:"Pläne konnten nicht abgerufen werden",fetchPlanGroup:"Plangruppe konnte nicht abgerufen werden",fetchPlanGroupVersion:"Plangruppenversion konnte nicht abgerufen werden",fetchPlanGroupVersions:"Plangruppenversionen konnten nicht abgerufen werden",fetchSubscription:"Abonnement konnte nicht abgerufen werden",createCheckout:"Checkout-Sitzung konnte nicht erstellt werden",updateSubscription:"Abonnement konnte nicht aktualisiert werden",fetchInvoices:"Rechnungen konnten nicht abgerufen werden",fetchInvoice:"Rechnung konnte nicht abgerufen werden",openBillingPortal:"Abrechnungsportal konnte nicht geöffnet werden",cancelSubscription:"Abonnement konnte nicht gekündigt werden",resumeSubscription:"Abonnement konnte nicht fortgesetzt werden",recordUsage:"Nutzung konnte nicht erfasst werden",fetchQuotaUsage:"Kontingentnutzungsstatus konnte nicht abgerufen werden",fetchAllQuotaUsage:"Gesamte Kontingentnutzung konnte nicht abgerufen werden",fetchUsageLogs:"Nutzungsprotokolle konnten nicht abgerufen werden"}}});var LN=Object.freeze({__proto__:null,ja:{settings:{titles:{profile:"アカウント",general:"ワークスペース設定",users:"ワークスペースメンバー",subscription:"プランと請求",usage:"使用状況",features:"ワークスペース機能",notifications:"通知",permissions:"権限",danger:"危険ゾーン"},sidebar:{account:"アカウント",workspace:"ワークスペース",profile:"アカウント",general:"設定",users:"メンバー",subscription:"プランと請求",usage:"使用状況",features:"機能",notifications:"通知",permissions:"権限",danger:"危険ゾーン"},common:{refresh:"更新",refreshing:"更新中...",retry:"再試行",retrying:"再試行中...",save:"保存",saving:"保存中...",cancel:"キャンセル",delete:"削除",dismiss:"閉じる",loading:"読み込み中...",success:"成功しました!",error:"エラー",refreshAction:"{loading, select, true {更新中...} other {更新}}",retryAction:"{loading, select, true {再試行中...} other {再試行}}"}},subscription:{managePlan:"プランと請求を管理",changePlan:"プランを変更",viewPricingPlans:"料金プランを見る",viewPlans:"プランを見る",upgradePlan:"今すぐアップグレード",subscribe:"登録する",currentPlan:"現在のプラン",noSubscription:"有効なサブスクリプションがありません",choosePlan:"プランを選択",choosePlanDescription:"プランを比較して、ニーズに合ったものを選択してください",forWorkspace:"{name} 向け",planUpdateAvailable:"プランの更新が利用可能です",updateSuccess:"サブスクリプションが正常に更新されました!",updateFailed:"更新に失敗しました",cancelTitle:"サブスクリプションをキャンセル",cancelConfirm:"サブスクリプションをキャンセルしてもよろしいですか?",cancelKeep:"サブスクリプションを維持",cancelButton:"はい、キャンセルします",cancelTrialTitle:"トライアルをキャンセル",cancelTrialConfirm:"トライアルをキャンセルしてもよろしいですか?",cancelTrialAccess:"トライアルは次の日まで継続されます",cancelTrialNoCharge:"課金されることはありません — トライアルはそのまま終了します",cancelTrialResume:"終了前であればいつでもトライアルを再開できます",cancelTrialKeep:"トライアルを維持",cancelTrialButton:"はい、トライアルをキャンセル",canceling:"キャンセル中...",cancelSuccess:"サブスクリプションは請求期間の終了時にキャンセルされます。",cancelNotCharged:"キャンセル後は課金されません",cancelResumeAnytime:"終了前であればいつでもサブスクリプションを再開できます",resumeTitle:"サブスクリプションを再開",resumeTrial:"トライアルを再開",resumeConfirm:"サブスクリプションを再開してもよろしいですか?",resumeKeep:"キャンセルのまま維持",resumeButton:"はい、再開します",resuming:"再開中...",resumeSuccess:"サブスクリプションが再開されました。",managePayment:"支払いを管理",openingPortal:"開いています...",viewAllPlans:"すべてのプランを見る",scheduledCancellation:"サブスクリプションのキャンセルが予定されています",scheduledTrialCancellation:"トライアルのキャンセルが予定されています",paymentPastDue:"支払い期限超過",paymentPastDueDescription:"サービスの中断を避けるため、お支払い方法を更新してください。",subscriptionPaused:"サブスクリプション一時停止中",subscriptionPausedDescription:"サブスクリプションは現在一時停止中です。再開してフルアクセスを復元してください。",errorLoading:"サブスクリプションデータの読み込みエラー",errorLoadingDescription:"接続を確認して、もう一度お試しください。",errorProcessing:"サブスクリプションの処理に失敗しました",errorCanceling:"サブスクリプションのキャンセルに失敗しました",errorResuming:"サブスクリプションの再開に失敗しました",invalidWorkspace:"無効なワークスペースID",billingInterval:{monthly:"月額",quarterly:"四半期",yearly:"年額",perMonth:"/月",perQuarter:"/四半期",perYear:"/年"},seats:{title:"シート",members:"メンバー",included:"含まれる",billable:"課金対象",perExtraSeat:"追加シートあたり",limit:"上限",includedSeats:"含まれるシート数",maxSeats:"最大シート数",freeWithBase:"基本料金に含まれる",allIncluded:"すべて含まれる",extra:"追加",unlimited:"無制限"},items:{features:"機能",limits:"制限",quotas:"使用量クォータ"},checkout:{upgrade:"アップグレード",downgrade:"ダウングレード",switchTo:"切り替え",select:"選択"},status:{active:"有効",canceling:"キャンセル中",trial:"トライアル",canceled:"キャンセル済み",pastDue:"期限超過",paused:"一時停止中",deprecated:"非推奨",unknown:"不明"},plan:"プラン",invoicesTab:"請求書",changePlanButton:"プランを変更",noPlanAssigned:"プランが割り当てられていません",free:"無料",perSeatDisplay:"+ {price}/シート{interval}",estTotalDisplay:"推定合計: {total}{interval} ({count, plural, one {追加シート #} other {追加シート #}})",nextBillingDisplay:"次回請求日: {date}",membersInWorkspace:"ワークスペースに{count, plural, one {# メンバー} other {# メンバー}}",billingInCurrency:"{currency}で請求",savingsPercent:"{percent, number}%お得",switchToInterval:"{interval}に切り替え",seatPriceDisplay:"+ {price}/シート{interval} ({included} {includedLabel})",trialEnded:"トライアル期間が終了しました。",trialEndsIn:"トライアル期間は{days, plural, one {# 日} other {# 日}}で終了します。",onTrial:"トライアル期間中です。",upgradeToKeepAccess:"アクセスを維持するにはアップグレードしてください。",viewInvoices:"請求書を見る",cancelTrial:"トライアルをキャンセル",dunningFinal:"最終警告:サブスクリプションが停止されます",dunningSuspended:"サブスクリプションが停止されました",dunningRecovery:"支払い回収中",dunningSuspendedDescription:"支払いの失敗が繰り返されたため、サブスクリプションが停止されました。アクセスを復元するには、お支払い方法を更新してください。",dunningRecoveryDescription:"お支払いを処理できませんでした。アクセスを失わないよう、お支払い方法を更新してください。",cancelEndDescription:"サブスクリプションの終了日:",trialEndDescription:"トライアルの終了日:",cancelEndFallback:"サブスクリプションは現在の請求期間の終了時にキャンセルされます。以降の課金はありません。",resumeChargeDate:"次回の課金日:",resumeChargeFallback:"次回の請求日",resumeContinue:"サブスクリプションは自動的に継続され、プランに基づいて請求されます",resumeCancelAnytime:"次回の請求日前であれば、いつでもキャンセルできます",retainAccess:"このプランへのフルアクセスは次の日まで維持されます:",retainAccessFallback:"現在の請求期間の終了まで",noPlansAvailable:"このワークスペースで利用可能なプラングループがありません。エラーだと思われる場合は、サポートにお問い合わせください。",noPlansAvailableHint:"このワークスペースで利用可能なプラングループがありません。",startTrialDescription:"コミットなしでフルプランをお試しください。いつでもアップグレードまたはキャンセルできます。",noSubscriptionDescription:"ワークスペースを始めるにはプランを選択してください",startFreeTrial:"無料トライアルを開始",startTrialDays:"{days}日間の無料トライアルを開始",trialBadge:"{days}日間トライアル"},users:{title:"ワークスペースメンバー",adminOnly:"ワークスペース管理者のみがユーザーとロールを管理できます。",inviteByEmail:"メールでメンバーを招待",inviteButton:"招待",inviting:"招待中...",inviteSuccess:"ユーザーが正常に招待されました",emailRequired:"メールアドレスは必須です",invalidEmail:"メールアドレスの形式が無効です",inviteFailed:"メンバーの招待に失敗しました",seatLimitReached:"シート上限に達しました",memberLimitReached:"メンバー上限に達しました",role:"ロール",you:"あなた",owner:"オーナー",noMembers:"このワークスペースにメンバーが見つかりません。",extraSeatCost:"追加メンバーごとにサブスクリプションに{price}/{interval, select, yearly {年} quarterly {四半期} other {月}}が追加されます",unknownUser:"不明なユーザー",seats:"シート",members:"メンバー",included:"含まれる",perExtraSeat:"/追加シート",maxMembers:"最大メンバー数",available:"利用可能",noMemberLimit:"メンバー制限なし",seatHeading:"{hasSeatPricing, select, true {シート} other {メンバー}}",limitReached:"{reason, select, seat_limit_reached {シート上限に達しました} other {メンバー上限に達しました}}",memberCount:"{count, plural, one {# メンバー} other {# メンバー}}",subscriptionRequired:"メンバーを招待するにはサブスクリプションが必要です。",seatLimitMessage:"プランでは最大{maxUsers, number}メンバーまで許可されています。シートを増やすにはアップグレードしてください。",settingsLimitMessage:"このワークスペースでは最大{maxUsers, number}メンバーまで許可されています。",memberLimitMessage:"メンバー上限の{maxUsers, number}に達しました。",selectRole:"ロールを選択",inviteAs:"{role}として招待"},invoices:{title:"請求履歴",description:"請求書の確認とダウンロード",pay:"支払う",view:"表示",viewDetails:"詳細を表示",download:"PDF",errorLoading:"請求書の読み込みエラー",noInvoices:"請求書はまだありません。プランに登録すると請求書が発行されます。",noInvoicesWithSub:"ダウンロード可能な請求書が見つかりません",paidAmount:"支払済: {amount}",na:"該当なし",status:{draft:"下書き",open:"未払い",paid:"支払済",uncollectible:"回収不能",void:"無効"}},usage:{title:"使用状況",description:"リソース消費量とクォータを監視",totalResources:"合計リソース",overallUsage:"全体の使用状況",inOverage:"超過中",estOverageCost:"推定超過コスト",overageDetected:"超過を検出",overageDescription:"追加使用分は次回の請求書で超過分として課金されます。",overageUnits:"超過ユニット",rate:"料金",billableBlocks:"課金対象ブロック",estimatedCharge:"推定料金",noData:"このワークスペースのクォータ使用データがありません。",noDataHint:"プランに従量制リソースが含まれると、ここにクォータが表示されます。",used:"使用済み",remaining:"残り",overLimit:"上限超過",percentUsed:"{percent, number}%使用済み",availableRemaining:"残り{count}",overLimitCount:"{count}が上限超過",overageWarning:"{count, plural, one {# リソースが含まれるクォータを超過しました。} other {# リソースが含まれるクォータを超過しました。}}追加使用分は次回の請求書で超過分として課金されます。",fullyUsed:"全量使用済み",renewingSoon:"まもなく更新",almostFull:"ほぼ上限",overage:"超過",errorLoading:"使用状況データの読み込みに失敗しました",perUnit:"/ ユニット",perUnits:"/ ユニット",rateDisplay:"{rate} {unitSize, plural, =1 {/ ユニット} other {/ {unitSize, number} ユニット}}",resourcesExceeded:"{count, plural, one {# リソースが含まれるクォータを超過しました。} other {# リソースが含まれるクォータを超過しました。}}",estOverageCharges:"この期間の推定超過料金: {amount}",overageRateDisplay:"超過料金: {rate}",resetDateDisplay:"使用量は{date}にリセットされます",daysRemainingDisplay:"{count, plural, one {残り # 日} other {残り # 日}}"},profile:{email:"メールアドレス",name:"名前",language:"言語",country:"国",currency:"通貨",timezone:"タイムゾーン",profileImage:"プロフィール画像",success:"プロフィールが正常に保存されました",nameMinLength:"名前は2文字以上で入力してください。",save:"保存",reset:"リセット"},general:{ownerOnly:"ワークスペースのオーナーのみが設定を変更できます。",name:"名前",namePlaceholder:"マイワークスペース",nameMinLength:"ワークスペース名は2文字以上で入力してください。",billingCurrency:"請求通貨",icon:"アイコン",iconDescription:"絵文字を選択するか、ワークスペース用のカスタム画像をアップロードしてください。",imageUrl:"画像URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"ワークスペース画像の有効なURLを入力してください。PNG、JPG、SVG形式に対応しています。",previewLabel:"プレビュー:",success:"ワークスペース設定が正常に保存されました",chooseEmoji:"絵文字を選択",customImageUrl:"カスタム画像URL",updateWorkspace:"ワークスペースを更新"},features:{title:"ワークスペース機能",ownerOnly:"ワークスペースのオーナーのみが機能を変更できます。",noFeatures:"ワークスペースに管理可能な機能がありません。",enabled:"有効",disabled:"無効",enabling:"有効化中",disabling:"無効化中",featureSuccess:"成功",updateSuccess:"{feature}が正常に{enabled, select, true {有効化} other {無効化}}されました",actionStatus:"{action, select, enabling {有効化中} disabling {無効化中} other {}}"},danger:{title:"ワークスペースを削除",adminOnly:"管理者のみがワークスペースを削除できます。",deleteWorkspace:"ワークスペースを削除",deleteConfirm:"本当によろしいですか?",deleteWarning:"この操作は取り消せません。ワークスペースと関連するすべてのデータが完全に削除されます。",deleting:"削除中...",deleteDescription:"ワークスペースを削除すると元に戻すことはできません。ワークスペースとメンバー、設定、機能を含むすべてのデータが完全に削除されます。",deleteConfirmDescription:"この操作は取り消せません。ワークスペースと関連するすべてのデータが完全に削除されます。",failedToDelete:"ワークスペースの削除に失敗しました"},notifications:{title:"通知設定",permissionDenied:"通知の権限が拒否されました",notSupported:"このブラウザではプッシュ通知はサポートされていません。",manageDescription:"このワークスペースからの通知の受信方法を管理します。",blocked:"通知がブロックされています",blockedDescription:"このサイトの通知を以前ブロックしました。有効にするには、ブラウザの設定を更新してください:",pushTitle:"プッシュ通知",pushEnabledDescription:"重要な更新についてブラウザ通知を受信します。",pushDisabledDescription:"支払い問題、トライアル期限、その他の重要な更新についての通知を受け取ります。",enabling:"有効化中...",disabling:"無効化中...",enable:"有効にする",disable:"無効にする",toggleAction:"{loading, select, true {{subscribed, select, true {無効化中...} other {有効化中...}}} other {{subscribed, select, true {無効にする} other {有効にする}}}}",pushDescription:"{subscribed, select, true {重要な更新についてブラウザ通知を受信します。} other {支払い問題、トライアル期限、その他の重要な更新についての通知を受け取ります。}}",deviceNote:"通知はこのデバイスに送信されます。他のデバイスでは個別に有効にしてください。",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"アドレスバーの鍵アイコン(またはシールドアイコン)をクリック",step2:"権限リストで「通知」を見つける",step3:"「ブロック」から「許可」に変更",step4:"このページを再読み込み"},safari:{step1:"Safari → 設定 → Webサイト → 通知 を開く",step2:"リストからこのWebサイトを見つける",step3:"「拒否」から「許可」に変更",step4:"このページを再読み込み"},edge:{step1:"アドレスバーの鍵アイコンをクリック",step2:"「このサイトの権限」をクリック",step3:"「通知」を「許可」に設定",step4:"このページを再読み込み"},chrome:{step1:"アドレスバーの鍵アイコン(またはチューンアイコン)をクリック",step2:"「サイトの設定」をクリック",step3:"「通知」を「許可」に設定",step4:"このページを再読み込み"}}},quota:{includedOnly:"{count, number}件含まれる",includedWithOverage:"{count, number}件含まれる、以降{price} / {unit}",includedHardLimit:"{count, number}件含まれる(上限)",unitFallback:"ユニット"},pricing:{title:"プランを選択",description:"プランを比較して、ニーズに合ったものを選択してください",currency:"通貨",billingIn:"請求通貨",noPlansCurrency:"お使いの請求通貨で利用可能なプランがありません。",noPlansCurrencyHint:"エラーが発生しました。サポートにお問い合わせください。",noPlans:"利用可能なプランがありません",free:"無料",included:"含まれる",save:"お得",current:"現在",processing:"処理中...",unavailable:"利用不可",selectCurrency:"請求通貨を選択",billingInterval:"請求間隔"},beta:{nameLabel:"名前",emailLabel:"メールアドレス",submitText:"送信",submittingText:"送信中...",errorMessage:"エラーが発生しました",tryAgain:"再試行",privacyConsent:"このフォームを送信することで、以下に同意したことになります:",privacyPolicy:"プライバシーポリシー",and:"および",termsOfService:"利用規約"},workspace:{switchTitle:"ワークスペースを切り替え",switchDescription:"ワークスペースを選択するか、新しく作成してください。",notLoggedIn:"ログインしていないようです。続行するにはログインしてください。",availableWorkspaces:"利用可能なワークスペース ({count, number})",loadingWorkspaces:"ワークスペースを読み込み中...",searchPlaceholder:"ワークスペースを検索...",noWorkspacesFound:"ワークスペースが見つかりません",noWorkspacesAvailable:"利用可能なワークスペースがありません",switchTo:"切り替え",membersCount:"{count, plural, one {# メンバー} other {# メンバー}}",createNew:"新しいワークスペースを作成",createTitle:"新しいワークスペースを作成",createDescription:"新しいワークスペースを作成して始めましょう。",workspaceName:"ワークスペース名",workspaceNamePlaceholder:"マイワークスペース",workspaceNameMinLength:"ワークスペース名は2文字以上で入力してください。",workspaceIcon:"ワークスペースアイコン",iconDescription:"絵文字を選択するか、ワークスペース用のカスタム画像をアップロードしてください。",chooseEmoji:"絵文字を選択",customImageUrl:"カスタム画像URL",imageUrl:"画像URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"ワークスペース画像の有効なURLを入力してください。PNG、JPG、SVG形式に対応しています。",invalidUrl:"有効なURLを入力してください",creating:"作成中...",createWorkspace:"ワークスペースを作成"},dropdowns:{search:"検索...",chooseOption:"オプションを選択",chooseCountry:"国を選択",searchCountry:"国を選択...",chooseLanguage:"言語を選択",searchLanguage:"言語を選択...",chooseCurrency:"通貨を選択",searchCurrency:"通貨を選択...",chooseTimezone:"タイムゾーンを選択",searchTimezone:"タイムゾーンを選択..."},push:{failedToSubscribe:"プッシュ通知の登録に失敗しました",failedToUnsubscribe:"プッシュ通知の解除に失敗しました"},permissions:{title:"権限",description:"このワークスペースで各ロールができることを設定します。",ownerOnly:"ワークスペースのオーナーのみが権限を管理できます。",save:"権限を保存",saving:"保存中...",saveSuccess:"権限が正常に保存されました"},errors:{networkError:"ネットワークエラー:インターネット接続を確認してください",unauthorized:"認証エラー — セッションを確認してください",notFound:"リソースが見つかりません",generic:"エラーが発生しました",fetchPlans:"プランの取得に失敗しました",fetchPlanGroup:"プラングループの取得に失敗しました",fetchPlanGroupVersion:"プラングループバージョンの取得に失敗しました",fetchPlanGroupVersions:"プラングループバージョン一覧の取得に失敗しました",fetchSubscription:"サブスクリプションの取得に失敗しました",createCheckout:"チェックアウトセッションの作成に失敗しました",updateSubscription:"サブスクリプションの更新に失敗しました",fetchInvoices:"請求書の取得に失敗しました",fetchInvoice:"請求書の取得に失敗しました",openBillingPortal:"請求ポータルを開けませんでした",cancelSubscription:"サブスクリプションのキャンセルに失敗しました",resumeSubscription:"サブスクリプションの再開に失敗しました",recordUsage:"使用量の記録に失敗しました",fetchQuotaUsage:"クォータ使用状況の取得に失敗しました",fetchAllQuotaUsage:"全クォータ使用状況の取得に失敗しました",fetchUsageLogs:"使用ログの取得に失敗しました"}}});var ON=Object.freeze({__proto__:null,zh:{settings:{titles:{profile:"账户",general:"工作区设置",users:"工作区成员",subscription:"套餐与账单",usage:"用量",features:"工作区功能",notifications:"通知",permissions:"权限",danger:"危险区域"},sidebar:{account:"账户",workspace:"工作区",profile:"账户",general:"设置",users:"成员",subscription:"套餐与账单",usage:"用量",features:"功能",notifications:"通知",permissions:"权限",danger:"危险区域"},common:{refresh:"刷新",refreshing:"正在刷新...",retry:"重试",retrying:"正在重试...",save:"保存",saving:"正在保存...",cancel:"取消",delete:"删除",dismiss:"关闭",loading:"正在加载...",success:"操作成功!",error:"错误",refreshAction:"{loading, select, true {正在刷新...} other {刷新}}",retryAction:"{loading, select, true {正在重试...} other {重试}}"}},subscription:{managePlan:"管理您的套餐和账单",changePlan:"更改套餐",viewPricingPlans:"查看价格方案",viewPlans:"查看套餐",upgradePlan:"立即升级",subscribe:"订阅",currentPlan:"当前套餐",noSubscription:"您没有有效的订阅",choosePlan:"选择您的套餐",choosePlanDescription:"比较各套餐,选择最适合您需求的方案",forWorkspace:"适用于 {name}",planUpdateAvailable:"套餐更新可用",updateSuccess:"订阅已成功更新!",updateFailed:"更新失败",cancelTitle:"取消订阅",cancelConfirm:"您确定要取消订阅吗?",cancelKeep:"保留订阅",cancelButton:"是的,取消订阅",cancelTrialTitle:"取消试用",cancelTrialConfirm:"您确定要取消试用吗?",cancelTrialAccess:"您的试用将持续到",cancelTrialNoCharge:"不会向您收费 — 试用期将自动到期",cancelTrialResume:"您可以在试用结束前随时恢复试用",cancelTrialKeep:"保留试用",cancelTrialButton:"是的,取消试用",canceling:"正在取消...",cancelSuccess:"订阅将在当前计费周期结束时取消。",cancelNotCharged:"取消后将不再收费",cancelResumeAnytime:"您可以在订阅结束前随时恢复",resumeTitle:"恢复订阅",resumeTrial:"恢复试用",resumeConfirm:"您确定要恢复订阅吗?",resumeKeep:"保持取消状态",resumeButton:"是的,恢复订阅",resuming:"正在恢复...",resumeSuccess:"订阅已恢复。",managePayment:"管理支付方式",openingPortal:"正在打开...",viewAllPlans:"查看所有套餐",scheduledCancellation:"订阅已安排取消",scheduledTrialCancellation:"试用已安排取消",paymentPastDue:"付款逾期",paymentPastDueDescription:"请更新您的支付方式以避免服务中断。",subscriptionPaused:"订阅已暂停",subscriptionPausedDescription:"您的订阅当前已暂停。恢复订阅以获得完整访问权限。",errorLoading:"加载订阅数据时出错",errorLoadingDescription:"请检查您的网络连接并重试。",errorProcessing:"订阅处理失败",errorCanceling:"取消订阅失败",errorResuming:"恢复订阅失败",invalidWorkspace:"无效的工作区 ID",billingInterval:{monthly:"月付",quarterly:"季付",yearly:"年付",perMonth:"/月",perQuarter:"/季",perYear:"/年"},seats:{title:"席位",members:"成员",included:"包含",billable:"计费",perExtraSeat:"每增加一个席位",limit:"上限",includedSeats:"包含席位数",maxSeats:"最大席位数",freeWithBase:"包含在基础价格中",allIncluded:"全部包含",extra:"额外",unlimited:"不限"},items:{features:"功能",limits:"限制",quotas:"用量配额"},checkout:{upgrade:"升级",downgrade:"降级",switchTo:"切换至",select:"选择"},status:{active:"有效",canceling:"取消中",trial:"试用",canceled:"已取消",pastDue:"逾期",paused:"已暂停",deprecated:"已弃用",unknown:"未知"},plan:"套餐",invoicesTab:"账单",changePlanButton:"更改套餐",noPlanAssigned:"未分配套餐",free:"免费",perSeatDisplay:"+ {price}/席位{interval}",estTotalDisplay:"预估总计:{total}{interval}({count, plural, one {# 个额外席位} other {# 个额外席位}})",nextBillingDisplay:"下次计费日:{date}",membersInWorkspace:"工作区有 {count, plural, one {# 名成员} other {# 名成员}}",billingInCurrency:"以{currency}计费",savingsPercent:"节省 {percent, number}%",switchToInterval:"切换至{interval}",seatPriceDisplay:"+ {price}/席位{interval}({included} {includedLabel})",trialEnded:"您的试用期已结束。",trialEndsIn:"您的试用期将在 {days, plural, one {# 天} other {# 天}}后结束。",onTrial:"您正在试用中。",upgradeToKeepAccess:"升级以保留访问权限。",viewInvoices:"查看账单",cancelTrial:"取消试用",dunningFinal:"最终警告:订阅将被暂停",dunningSuspended:"订阅已暂停",dunningRecovery:"付款恢复中",dunningSuspendedDescription:"由于多次付款失败,您的订阅已被暂停。请更新支付方式以恢复访问权限。",dunningRecoveryDescription:"我们无法处理您的付款。请更新您的支付方式以避免失去访问权限。",cancelEndDescription:"您的订阅将于以下日期结束:",trialEndDescription:"您的试用将于以下日期结束:",cancelEndFallback:"您的订阅将在当前计费周期结束时取消,之后将不再收费。",resumeChargeDate:"将于以下日期再次收费:",resumeChargeFallback:"下一个计费日",resumeContinue:"您的订阅将自动继续,并按照套餐计费",resumeCancelAnytime:"如果您改变主意,可以在下一个计费日之前随时取消",retainAccess:"您将保留此套餐的完整访问权限直到",retainAccessFallback:"当前计费周期结束",noPlansAvailable:"此工作区没有可用的套餐组。如果您认为这是一个错误,请联系客服。",noPlansAvailableHint:"此工作区没有可用的套餐组。",startTrialDescription:"免费试用完整套餐,无需承诺。您可以随时升级或取消。",noSubscriptionDescription:"选择一个套餐来开始使用您的工作区",startFreeTrial:"开始免费试用",startTrialDays:"开始 {days} 天免费试用",trialBadge:"{days} 天试用"},users:{title:"工作区成员",adminOnly:"只有工作区管理员才能管理用户和角色。",inviteByEmail:"通过电子邮件邀请成员",inviteButton:"邀请",inviting:"正在邀请...",inviteSuccess:"用户邀请成功",emailRequired:"电子邮件为必填项",invalidEmail:"电子邮件地址格式无效",inviteFailed:"邀请成员失败",seatLimitReached:"已达到席位上限",memberLimitReached:"已达到成员上限",role:"角色",you:"您",owner:"拥有者",noMembers:"此工作区未找到成员。",extraSeatCost:"每增加一名成员将增加{price}/{interval, select, yearly {年} quarterly {季} other {月}}的订阅费用",unknownUser:"未知用户",seats:"席位",members:"成员",included:"包含",perExtraSeat:"/额外席位",maxMembers:"最大成员数",available:"可用",noMemberLimit:"无成员限制",seatHeading:"{hasSeatPricing, select, true {席位} other {成员}}",limitReached:"{reason, select, seat_limit_reached {已达到席位上限} other {已达到成员上限}}",memberCount:"{count, plural, one {# 名成员} other {# 名成员}}",subscriptionRequired:"邀请成员需要有效订阅。",seatLimitMessage:"您的套餐最多允许 {maxUsers, number} 名成员。升级以获得更多席位。",settingsLimitMessage:"此工作区最多允许 {maxUsers, number} 名成员。",memberLimitMessage:"已达到成员上限 {maxUsers, number}。",selectRole:"选择角色",inviteAs:"以{role}身份邀请"},invoices:{title:"账单历史",description:"查看和下载您的账单",pay:"支付",view:"查看",viewDetails:"查看详情",download:"PDF",errorLoading:"加载账单时出错",noInvoices:"暂无账单。订阅套餐后将生成账单。",noInvoicesWithSub:"未找到可下载的账单",paidAmount:"已支付:{amount}",na:"不适用",status:{draft:"草稿",open:"待支付",paid:"已支付",uncollectible:"无法收回",void:"已作废"}},usage:{title:"用量",description:"监控您的资源消耗和配额",totalResources:"总资源",overallUsage:"总体用量",inOverage:"超额中",estOverageCost:"预估超额费用",overageDetected:"检测到超额",overageDescription:"额外用量将作为超额部分在下次账单中收取。",overageUnits:"超额单位",rate:"费率",billableBlocks:"计费块",estimatedCharge:"预估费用",noData:"此工作区没有可用的配额使用数据。",noDataHint:"当您的套餐包含计量资源时,配额将在此处显示。",used:"已使用",remaining:"剩余",overLimit:"超出上限",percentUsed:"已使用 {percent, number}%",availableRemaining:"剩余 {count}",overLimitCount:"{count} 超出上限",overageWarning:"{count, plural, one {# 项资源已超出包含的配额。} other {# 项资源已超出包含的配额。}}额外用量将作为超额部分在下次账单中收取。",fullyUsed:"已全部使用",renewingSoon:"即将续期",almostFull:"即将用完",overage:"超额",errorLoading:"加载用量数据失败",perUnit:"/ 单位",perUnits:"/ 单位",rateDisplay:"{rate} {unitSize, plural, =1 {/ 单位} other {/ {unitSize, number} 单位}}",resourcesExceeded:"{count, plural, one {# 项资源已超出包含的配额。} other {# 项资源已超出包含的配额。}}",estOverageCharges:"本期预估超额费用:{amount}",overageRateDisplay:"超额费率:{rate}",resetDateDisplay:"用量将于 {date} 重置",daysRemainingDisplay:"{count, plural, one {剩余 # 天} other {剩余 # 天}}"},profile:{email:"电子邮件",name:"姓名",language:"语言",country:"国家/地区",currency:"货币",timezone:"时区",profileImage:"头像",success:"个人资料保存成功",nameMinLength:"姓名至少需要2个字符。",save:"保存",reset:"重置"},general:{ownerOnly:"只有工作区拥有者才能更改设置。",name:"名称",namePlaceholder:"我的工作区",nameMinLength:"工作区名称至少需要2个字符。",billingCurrency:"计费货币",icon:"图标",iconDescription:"选择一个表情符号或为您的工作区上传自定义图片。",imageUrl:"图片 URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"输入工作区图片的有效 URL。支持 PNG、JPG 和 SVG 格式。",previewLabel:"预览:",success:"工作区设置保存成功",chooseEmoji:"选择表情",customImageUrl:"自定义图片 URL",updateWorkspace:"更新工作区"},features:{title:"工作区功能",ownerOnly:"只有工作区拥有者才能更改功能。",noFeatures:"工作区没有可管理的功能。",enabled:"已启用",disabled:"已禁用",enabling:"正在启用",disabling:"正在禁用",featureSuccess:"成功",updateSuccess:"{feature}已成功{enabled, select, true {启用} other {禁用}}",actionStatus:"{action, select, enabling {正在启用} disabling {正在禁用} other {}}"},danger:{title:"删除工作区",adminOnly:"只有管理员才能删除工作区。",deleteWorkspace:"删除工作区",deleteConfirm:"您确定吗?",deleteWarning:"此操作不可撤销。这将永久删除工作区及所有相关数据。",deleting:"正在删除...",deleteDescription:"一旦删除工作区,将无法恢复。这将永久删除工作区及其所有数据,包括成员、设置和功能。",deleteConfirmDescription:"此操作不可撤销。这将永久删除工作区及所有相关数据。",failedToDelete:"删除工作区失败"},notifications:{title:"通知偏好设置",permissionDenied:"通知权限被拒绝",notSupported:"此浏览器不支持推送通知。",manageDescription:"管理您从此工作区接收通知的方式。",blocked:"通知已被阻止",blockedDescription:"您之前阻止了此网站的通知。要启用通知,请更新浏览器设置:",pushTitle:"推送通知",pushEnabledDescription:"您将收到重要更新的浏览器通知。",pushDisabledDescription:"接收有关付款问题、试用到期和其他重要更新的通知。",enabling:"正在启用...",disabling:"正在禁用...",enable:"启用",disable:"禁用",toggleAction:"{loading, select, true {{subscribed, select, true {正在禁用...} other {正在启用...}}} other {{subscribed, select, true {禁用} other {启用}}}}",pushDescription:"{subscribed, select, true {您将收到重要更新的浏览器通知。} other {接收有关付款问题、试用到期和其他重要更新的通知。}}",deviceNote:"通知将发送到此设备。请在其他设备上单独启用。",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"点击地址栏中的锁形图标(或盾形图标)",step2:'在权限列表中找到"通知"',step3:'将"阻止"更改为"允许"',step4:"重新加载此页面"},safari:{step1:"打开 Safari → 设置 → 网站 → 通知",step2:"在列表中找到此网站",step3:'将"拒绝"更改为"允许"',step4:"重新加载此页面"},edge:{step1:"点击地址栏中的锁形图标",step2:'点击"此站点的权限"',step3:'将"通知"设置为"允许"',step4:"重新加载此页面"},chrome:{step1:"点击地址栏中的锁形图标(或调节图标)",step2:'点击"网站设置"',step3:'将"通知"设置为"允许"',step4:"重新加载此页面"}}},quota:{includedOnly:"包含 {count, number} 个",includedWithOverage:"包含 {count, number} 个,之后 {price} / {unit}",includedHardLimit:"包含 {count, number} 个(硬性限制)",unitFallback:"单位"},pricing:{title:"选择您的套餐",description:"比较各套餐,选择最适合您需求的方案",currency:"货币",billingIn:"计费货币",noPlansCurrency:"没有适用于您的计费货币的套餐。",noPlansCurrencyHint:"出现错误,请联系客服。",noPlans:"没有可用的套餐",free:"免费",included:"包含",save:"节省",current:"当前",processing:"正在处理...",unavailable:"不可用",selectCurrency:"选择计费货币",billingInterval:"计费周期"},beta:{nameLabel:"姓名",emailLabel:"电子邮件",submitText:"提交",submittingText:"正在提交...",errorMessage:"发生错误",tryAgain:"重试",privacyConsent:"提交此表单即表示您同意我们的",privacyPolicy:"隐私政策",and:"和",termsOfService:"服务条款"},workspace:{switchTitle:"切换工作区",switchDescription:"选择一个工作区或创建新的工作区。",notLoggedIn:"您似乎尚未登录。请登录后继续。",availableWorkspaces:"可用工作区 ({count, number})",loadingWorkspaces:"正在加载工作区...",searchPlaceholder:"搜索工作区...",noWorkspacesFound:"未找到工作区",noWorkspacesAvailable:"没有可用的工作区",switchTo:"切换至",membersCount:"{count, plural, one {# 名成员} other {# 名成员}}",createNew:"创建新工作区",createTitle:"创建新工作区",createDescription:"创建一个新的工作区来开始使用。",workspaceName:"工作区名称",workspaceNamePlaceholder:"我的工作区",workspaceNameMinLength:"工作区名称至少需要2个字符。",workspaceIcon:"工作区图标",iconDescription:"选择一个表情符号或为您的工作区上传自定义图片。",chooseEmoji:"选择表情",customImageUrl:"自定义图片 URL",imageUrl:"图片 URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"输入工作区图片的有效 URL。支持 PNG、JPG 和 SVG 格式。",invalidUrl:"请输入有效的 URL",creating:"正在创建...",createWorkspace:"创建工作区"},dropdowns:{search:"搜索...",chooseOption:"选择选项",chooseCountry:"选择国家/地区",searchCountry:"选择国家/地区...",chooseLanguage:"选择语言",searchLanguage:"选择语言...",chooseCurrency:"选择货币",searchCurrency:"选择货币...",chooseTimezone:"选择时区",searchTimezone:"选择时区..."},push:{failedToSubscribe:"订阅推送通知失败",failedToUnsubscribe:"取消订阅推送通知失败"},permissions:{title:"权限",description:"配置每个角色在此工作区中的操作权限。",ownerOnly:"只有工作区拥有者才能管理权限。",save:"保存权限",saving:"正在保存...",saveSuccess:"权限保存成功"},errors:{networkError:"网络错误:请检查您的网络连接",unauthorized:"未授权 — 请检查您的会话",notFound:"资源未找到",generic:"发生错误",fetchPlans:"获取套餐失败",fetchPlanGroup:"获取套餐组失败",fetchPlanGroupVersion:"获取套餐组版本失败",fetchPlanGroupVersions:"获取套餐组版本列表失败",fetchSubscription:"获取订阅信息失败",createCheckout:"创建结账会话失败",updateSubscription:"更新订阅失败",fetchInvoices:"获取账单失败",fetchInvoice:"获取账单失败",openBillingPortal:"打开账单门户失败",cancelSubscription:"取消订阅失败",resumeSubscription:"恢复订阅失败",recordUsage:"记录用量失败",fetchQuotaUsage:"获取配额使用状态失败",fetchAllQuotaUsage:"获取所有配额使用情况失败",fetchUsageLogs:"获取使用日志失败"}}});var zN=Object.freeze({__proto__:null,hi:{settings:{titles:{profile:"खाता",general:"वर्कस्पेस सेटिंग्स",users:"वर्कस्पेस सदस्य",subscription:"प्लान और बिलिंग",usage:"उपयोग",features:"वर्कस्पेस फ़ीचर्स",notifications:"सूचनाएँ",permissions:"अनुमतियाँ",danger:"खतरनाक ज़ोन"},sidebar:{account:"खाता",workspace:"वर्कस्पेस",profile:"खाता",general:"सेटिंग्स",users:"सदस्य",subscription:"प्लान और बिलिंग",usage:"उपयोग",features:"फ़ीचर्स",notifications:"सूचनाएँ",permissions:"अनुमतियाँ",danger:"खतरनाक ज़ोन"},common:{refresh:"रीफ़्रेश",refreshing:"रीफ़्रेश हो रहा है...",retry:"पुनः प्रयास",retrying:"पुनः प्रयास हो रहा है...",save:"सहेजें",saving:"सहेजा जा रहा है...",cancel:"रद्द करें",delete:"हटाएँ",dismiss:"खारिज करें",loading:"लोड हो रहा है...",success:"सफल!",error:"त्रुटि",refreshAction:"{loading, select, true {रीफ़्रेश हो रहा है...} other {रीफ़्रेश}}",retryAction:"{loading, select, true {पुनः प्रयास हो रहा है...} other {पुनः प्रयास}}"}},subscription:{managePlan:"अपना प्लान और बिलिंग प्रबंधित करें",changePlan:"प्लान बदलें",viewPricingPlans:"मूल्य निर्धारण प्लान देखें",viewPlans:"प्लान देखें",upgradePlan:"अभी अपग्रेड करें",subscribe:"सदस्यता लें",currentPlan:"वर्तमान प्लान",noSubscription:"आपके पास कोई सक्रिय सदस्यता नहीं है",choosePlan:"अपना प्लान चुनें",choosePlanDescription:"प्लान की तुलना करें और अपनी ज़रूरत के अनुसार चुनें",forWorkspace:"{name} के लिए",planUpdateAvailable:"प्लान अपडेट उपलब्ध है",updateSuccess:"सदस्यता सफलतापूर्वक अपडेट हो गई!",updateFailed:"अपडेट विफल",cancelTitle:"सदस्यता रद्द करें",cancelConfirm:"क्या आप वाकई अपनी सदस्यता रद्द करना चाहते हैं?",cancelKeep:"सदस्यता बनाए रखें",cancelButton:"हाँ, सदस्यता रद्द करें",cancelTrialTitle:"ट्रायल रद्द करें",cancelTrialConfirm:"क्या आप वाकई अपना ट्रायल रद्द करना चाहते हैं?",cancelTrialAccess:"आपका ट्रायल इस तारीख तक जारी रहेगा",cancelTrialNoCharge:"आपसे कोई शुल्क नहीं लिया जाएगा — आपका ट्रायल बस समाप्त हो जाएगा",cancelTrialResume:"आप समाप्त होने से पहले कभी भी अपना ट्रायल फिर से शुरू कर सकते हैं",cancelTrialKeep:"ट्रायल बनाए रखें",cancelTrialButton:"हाँ, ट्रायल रद्द करें",canceling:"रद्द किया जा रहा है...",cancelSuccess:"बिलिंग अवधि के अंत में सदस्यता रद्द कर दी जाएगी।",cancelNotCharged:"रद्द करने के बाद आपसे दोबारा शुल्क नहीं लिया जाएगा",cancelResumeAnytime:"आप सदस्यता समाप्त होने से पहले कभी भी इसे फिर से शुरू कर सकते हैं",resumeTitle:"सदस्यता फिर से शुरू करें",resumeTrial:"ट्रायल फिर से शुरू करें",resumeConfirm:"क्या आप वाकई अपनी सदस्यता फिर से शुरू करना चाहते हैं?",resumeKeep:"रद्द रखें",resumeButton:"हाँ, सदस्यता फिर से शुरू करें",resuming:"फिर से शुरू हो रहा है...",resumeSuccess:"सदस्यता फिर से शुरू हो गई है।",managePayment:"भुगतान प्रबंधित करें",openingPortal:"खोला जा रहा है...",viewAllPlans:"सभी प्लान देखें",scheduledCancellation:"सदस्यता रद्द करने के लिए निर्धारित",scheduledTrialCancellation:"ट्रायल रद्द करने के लिए निर्धारित",paymentPastDue:"भुगतान अतिदेय",paymentPastDueDescription:"सेवा में रुकावट से बचने के लिए कृपया अपना भुगतान तरीका अपडेट करें।",subscriptionPaused:"सदस्यता रुकी हुई है",subscriptionPausedDescription:"आपकी सदस्यता वर्तमान में रुकी हुई है। पूर्ण पहुँच बहाल करने के लिए फिर से शुरू करें।",errorLoading:"सदस्यता डेटा लोड करने में त्रुटि",errorLoadingDescription:"कृपया अपना कनेक्शन जाँचें और पुनः प्रयास करें।",errorProcessing:"सदस्यता प्रोसेस करने में विफल",errorCanceling:"सदस्यता रद्द करने में विफल",errorResuming:"सदस्यता फिर से शुरू करने में विफल",invalidWorkspace:"अमान्य वर्कस्पेस ID",billingInterval:{monthly:"मासिक",quarterly:"तिमाही",yearly:"वार्षिक",perMonth:"/माह",perQuarter:"/तिमाही",perYear:"/वर्ष"},seats:{title:"सीटें",members:"सदस्य",included:"शामिल",billable:"बिल योग्य",perExtraSeat:"प्रति अतिरिक्त सीट",limit:"सीमा",includedSeats:"शामिल सीटें",maxSeats:"अधिकतम सीटें",freeWithBase:"मूल कीमत में मुफ़्त",allIncluded:"सभी शामिल",extra:"अतिरिक्त",unlimited:"असीमित"},items:{features:"फ़ीचर्स",limits:"सीमाएँ",quotas:"उपयोग कोटा"},checkout:{upgrade:"अपग्रेड",downgrade:"डाउनग्रेड",switchTo:"बदलें",select:"चुनें"},status:{active:"सक्रिय",canceling:"रद्द हो रहा है",trial:"ट्रायल",canceled:"रद्द",pastDue:"अतिदेय",paused:"रुका हुआ",deprecated:"पुराना",unknown:"अज्ञात"},plan:"प्लान",invoicesTab:"चालान",changePlanButton:"प्लान बदलें",noPlanAssigned:"कोई प्लान नहीं",free:"मुफ़्त",perSeatDisplay:"+ {price}/सीट{interval}",estTotalDisplay:"अनुमानित कुल: {total}{interval} ({count, plural, one {# अतिरिक्त सीट} other {# अतिरिक्त सीटें}})",nextBillingDisplay:"अगली बिलिंग: {date}",membersInWorkspace:"वर्कस्पेस में {count, plural, one {# सदस्य} other {# सदस्य}}",billingInCurrency:"{currency} में बिलिंग",savingsPercent:"{percent, number}% बचाएँ",switchToInterval:"{interval} पर बदलें",seatPriceDisplay:"+ {price}/सीट{interval} ({included} {includedLabel})",trialEnded:"आपका ट्रायल समाप्त हो गया है।",trialEndsIn:"आपका ट्रायल {days, plural, one {# दिन} other {# दिनों}} में समाप्त होगा।",onTrial:"आप ट्रायल पर हैं।",upgradeToKeepAccess:"पहुँच बनाए रखने के लिए अपग्रेड करें।",viewInvoices:"चालान देखें",cancelTrial:"ट्रायल रद्द करें",dunningFinal:"अंतिम चेतावनी: सदस्यता निलंबित की जाएगी",dunningSuspended:"सदस्यता निलंबित",dunningRecovery:"भुगतान वसूली प्रक्रिया चल रही है",dunningSuspendedDescription:"बार-बार भुगतान विफल होने के कारण आपकी सदस्यता निलंबित कर दी गई है। पहुँच बहाल करने के लिए अपना भुगतान तरीका अपडेट करें।",dunningRecoveryDescription:"हम आपका भुगतान प्रोसेस करने में असमर्थ रहे। पहुँच न खोने के लिए कृपया अपना भुगतान तरीका अपडेट करें।",cancelEndDescription:"आपकी सदस्यता इस तारीख को समाप्त होगी",trialEndDescription:"आपका ट्रायल इस तारीख को समाप्त होगा",cancelEndFallback:"वर्तमान बिलिंग अवधि के अंत में आपकी सदस्यता रद्द कर दी जाएगी। आपसे दोबारा शुल्क नहीं लिया जाएगा।",resumeChargeDate:"आपसे फिर से शुल्क लिया जाएगा",resumeChargeFallback:"अगली बिलिंग तिथि",resumeContinue:"आपकी सदस्यता स्वचालित रूप से जारी रहेगी और आपसे आपके प्लान के अनुसार बिल लिया जाएगा",resumeCancelAnytime:"अगर आप अपना मन बदलते हैं तो अगली बिलिंग तिथि से पहले कभी भी रद्द कर सकते हैं",retainAccess:"आपके पास इस प्लान की पूर्ण पहुँच बनी रहेगी",retainAccessFallback:"आपकी वर्तमान बिलिंग अवधि के अंत तक",noPlansAvailable:"इस वर्कस्पेस के लिए कोई प्लान ग्रुप उपलब्ध नहीं है। अगर आपको लगता है कि यह त्रुटि है तो कृपया सहायता से संपर्क करें।",noPlansAvailableHint:"इस वर्कस्पेस के लिए कोई प्लान ग्रुप उपलब्ध नहीं है।",startTrialDescription:"बिना किसी प्रतिबद्धता के पूरा प्लान आज़माएँ। आप कभी भी अपग्रेड या रद्द कर सकते हैं।",noSubscriptionDescription:"अपने वर्कस्पेस के लिए एक प्लान चुनें",startFreeTrial:"मुफ़्त ट्रायल शुरू करें",startTrialDays:"{days} दिन का मुफ़्त ट्रायल शुरू करें",trialBadge:"{days} दिन का ट्रायल"},users:{title:"वर्कस्पेस सदस्य",adminOnly:"केवल वर्कस्पेस एडमिन ही उपयोगकर्ताओं और भूमिकाओं को प्रबंधित कर सकते हैं।",inviteByEmail:"ईमेल से सदस्य आमंत्रित करें",inviteButton:"आमंत्रित करें",inviting:"आमंत्रित किया जा रहा है...",inviteSuccess:"उपयोगकर्ता सफलतापूर्वक आमंत्रित किया गया",emailRequired:"ईमेल आवश्यक है",invalidEmail:"अमान्य ईमेल पता प्रारूप",inviteFailed:"सदस्य को आमंत्रित करने में विफल",seatLimitReached:"सीट सीमा पूरी हो गई",memberLimitReached:"सदस्य सीमा पूरी हो गई",role:"भूमिका",you:"आप",owner:"मालिक",noMembers:"इस वर्कस्पेस में कोई सदस्य नहीं मिला।",extraSeatCost:"प्रत्येक अतिरिक्त सदस्य आपकी सदस्यता में {price}/{interval, select, yearly {वर्ष} quarterly {तिमाही} other {माह}} जोड़ता है",unknownUser:"अज्ञात उपयोगकर्ता",seats:"सीटें",members:"सदस्य",included:"शामिल",perExtraSeat:"/अतिरिक्त सीट",maxMembers:"अधिकतम सदस्य",available:"उपलब्ध",noMemberLimit:"कोई सदस्य सीमा नहीं",seatHeading:"{hasSeatPricing, select, true {सीटें} other {सदस्य}}",limitReached:"{reason, select, seat_limit_reached {सीट सीमा पूरी हो गई} other {सदस्य सीमा पूरी हो गई}}",memberCount:"{count, plural, one {# सदस्य} other {# सदस्य}}",subscriptionRequired:"सदस्यों को आमंत्रित करने के लिए सदस्यता आवश्यक है।",seatLimitMessage:"आपका प्लान अधिकतम {maxUsers, number} सदस्यों की अनुमति देता है। अधिक सीटों के लिए अपग्रेड करें।",settingsLimitMessage:"यह वर्कस्पेस अधिकतम {maxUsers, number} सदस्यों की अनुमति देता है।",memberLimitMessage:"{maxUsers, number} सदस्यों की सीमा पूरी हो गई है।",selectRole:"भूमिका चुनें",inviteAs:"{role} के रूप में आमंत्रित करें"},invoices:{title:"बिलिंग इतिहास",description:"अपने चालान देखें और डाउनलोड करें",pay:"भुगतान करें",view:"देखें",viewDetails:"विवरण देखें",download:"PDF",errorLoading:"चालान लोड करने में त्रुटि",noInvoices:"अभी कोई चालान नहीं। चालान प्राप्त करने के लिए एक प्लान की सदस्यता लें।",noInvoicesWithSub:"डाउनलोड विकल्प वाला कोई चालान नहीं मिला",paidAmount:"भुगतान किया: {amount}",na:"लागू नहीं",status:{draft:"ड्राफ़्ट",open:"खुला",paid:"भुगतान हो गया",uncollectible:"अप्राप्य",void:"शून्य"}},usage:{title:"उपयोग",description:"अपने संसाधन उपभोग और कोटा की निगरानी करें",totalResources:"कुल संसाधन",overallUsage:"समग्र उपयोग",inOverage:"अतिरिक्त उपयोग में",estOverageCost:"अनुमानित अतिरिक्त लागत",overageDetected:"अतिरिक्त उपयोग पाया गया",overageDescription:"अतिरिक्त उपयोग आपके अगले चालान में अतिरिक्त शुल्क के रूप में बिल किया जाएगा।",overageUnits:"अतिरिक्त इकाइयाँ",rate:"दर",billableBlocks:"बिल योग्य ब्लॉक",estimatedCharge:"अनुमानित शुल्क",noData:"इस वर्कस्पेस के लिए कोई कोटा उपयोग डेटा उपलब्ध नहीं है।",noDataHint:"जब आपके प्लान में मीटर्ड संसाधन शामिल होंगे तो कोटा यहाँ दिखाई देंगे।",used:"उपयोग किया",remaining:"शेष",overLimit:"सीमा से अधिक",percentUsed:"{percent, number}% उपयोग किया",availableRemaining:"{count} शेष",overLimitCount:"{count} सीमा से अधिक",overageWarning:"{count, plural, one {# संसाधन ने शामिल कोटा पार कर लिया है।} other {# संसाधनों ने शामिल कोटा पार कर लिया है।}} अतिरिक्त उपयोग आपके अगले चालान में अतिरिक्त शुल्क के रूप में बिल किया जाएगा।",fullyUsed:"पूरी तरह उपयोग किया",renewingSoon:"जल्द नवीनीकरण",almostFull:"लगभग भरा",overage:"अतिरिक्त",errorLoading:"उपयोग डेटा लोड करने में विफल",perUnit:"/ इकाई",perUnits:"/ इकाइयाँ",rateDisplay:"{rate} {unitSize, plural, =1 {/ इकाई} other {/ {unitSize, number} इकाइयाँ}}",resourcesExceeded:"{count, plural, one {# संसाधन ने शामिल कोटा पार कर लिया है।} other {# संसाधनों ने शामिल कोटा पार कर लिया है।}}",estOverageCharges:"इस अवधि का अनुमानित अतिरिक्त शुल्क: {amount}",overageRateDisplay:"अतिरिक्त दर: {rate}",resetDateDisplay:"उपयोग {date} को रीसेट होगा",daysRemainingDisplay:"{count, plural, one {# दिन शेष} other {# दिन शेष}}"},profile:{email:"ईमेल",name:"नाम",language:"भाषा",country:"देश",currency:"मुद्रा",timezone:"समय क्षेत्र",profileImage:"प्रोफ़ाइल छवि",success:"प्रोफ़ाइल सफलतापूर्वक सहेजी गई",nameMinLength:"नाम कम से कम 2 अक्षरों का होना चाहिए।",save:"सहेजें",reset:"रीसेट"},general:{ownerOnly:"केवल वर्कस्पेस का मालिक ही वर्कस्पेस सेटिंग्स बदल सकता है।",name:"नाम",namePlaceholder:"मेरा शानदार वर्कस्पेस",nameMinLength:"वर्कस्पेस का नाम कम से कम 2 अक्षरों का होना चाहिए।",billingCurrency:"बिलिंग मुद्रा",icon:"आइकन",iconDescription:"अपने वर्कस्पेस के लिए एक इमोजी चुनें या कस्टम छवि अपलोड करें।",imageUrl:"छवि URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"अपने वर्कस्पेस की छवि के लिए एक मान्य URL दर्ज करें। PNG, JPG और SVG प्रारूप समर्थित हैं।",previewLabel:"पूर्वावलोकन:",success:"वर्कस्पेस सेटिंग्स सफलतापूर्वक सहेजी गईं",chooseEmoji:"इमोजी चुनें",customImageUrl:"कस्टम छवि URL",updateWorkspace:"वर्कस्पेस अपडेट करें"},features:{title:"वर्कस्पेस फ़ीचर्स",ownerOnly:"केवल वर्कस्पेस का मालिक ही फ़ीचर्स बदल सकता है।",noFeatures:"प्रबंधित करने के लिए कोई फ़ीचर नहीं है।",enabled:"सक्रिय",disabled:"निष्क्रिय",enabling:"सक्रिय किया जा रहा है",disabling:"निष्क्रिय किया जा रहा है",featureSuccess:"सफलतापूर्वक",updateSuccess:"{feature} सफलतापूर्वक {enabled, select, true {सक्रिय} other {निष्क्रिय}} किया गया",actionStatus:"{action, select, enabling {सक्रिय किया जा रहा है} disabling {निष्क्रिय किया जा रहा है} other {}}"},danger:{title:"वर्कस्पेस हटाएँ",adminOnly:"केवल वर्कस्पेस एडमिन ही वर्कस्पेस हटा सकते हैं।",deleteWorkspace:"वर्कस्पेस हटाएँ",deleteConfirm:"क्या आप बिल्कुल सुनिश्चित हैं?",deleteWarning:"यह क्रिया पूर्ववत नहीं की जा सकती। यह वर्कस्पेस और सभी संबंधित डेटा को स्थायी रूप से हटा देगी।",deleting:"हटाया जा रहा है...",deleteDescription:"एक बार वर्कस्पेस हटाने के बाद वापस नहीं जा सकते। यह वर्कस्पेस और उसका सभी डेटा स्थायी रूप से हटा देगा, जिसमें सदस्य, सेटिंग्स और फ़ीचर्स शामिल हैं।",deleteConfirmDescription:"यह क्रिया पूर्ववत नहीं की जा सकती। यह वर्कस्पेस और उसके सभी डेटा को स्थायी रूप से हटा देगी।",failedToDelete:"वर्कस्पेस हटाने में विफल"},notifications:{title:"सूचना प्राथमिकताएँ",permissionDenied:"सूचना अनुमति अस्वीकृत",notSupported:"इस ब्राउज़र में पुश सूचनाएँ समर्थित नहीं हैं।",manageDescription:"प्रबंधित करें कि आप इस वर्कस्पेस से कैसे सूचनाएँ प्राप्त करते हैं।",blocked:"सूचनाएँ अवरुद्ध हैं",blockedDescription:"आपने पहले इस साइट के लिए सूचनाएँ अवरुद्ध की थीं। उन्हें सक्रिय करने के लिए अपनी ब्राउज़र सेटिंग्स अपडेट करें:",pushTitle:"पुश सूचनाएँ",pushEnabledDescription:"आपको महत्वपूर्ण अपडेट के लिए ब्राउज़र सूचनाएँ प्राप्त होंगी।",pushDisabledDescription:"भुगतान समस्याओं, ट्रायल समाप्ति और अन्य महत्वपूर्ण अपडेट के बारे में सूचित रहें।",enabling:"सक्रिय किया जा रहा है...",disabling:"निष्क्रिय किया जा रहा है...",enable:"सक्रिय करें",disable:"निष्क्रिय करें",toggleAction:"{loading, select, true {{subscribed, select, true {निष्क्रिय किया जा रहा है...} other {सक्रिय किया जा रहा है...}}} other {{subscribed, select, true {निष्क्रिय करें} other {सक्रिय करें}}}}",pushDescription:"{subscribed, select, true {आपको महत्वपूर्ण अपडेट के लिए ब्राउज़र सूचनाएँ प्राप्त होंगी।} other {भुगतान समस्याओं, ट्रायल समाप्ति और अन्य महत्वपूर्ण अपडेट के बारे में सूचित रहें।}}",deviceNote:"सूचनाएँ इस डिवाइस पर भेजी जाती हैं। अन्य डिवाइसों पर अलग से सक्रिय करें।",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"एड्रेस बार में लॉक आइकन (या शील्ड आइकन) पर क्लिक करें",step2:'अनुमतियों की सूची में "Notifications" खोजें',step3:'"Blocked" से "Allow" में बदलें',step4:"इस पेज को रीलोड करें"},safari:{step1:"Safari → Settings → Websites → Notifications खोलें",step2:"सूची में यह वेबसाइट खोजें",step3:'"Deny" से "Allow" में बदलें',step4:"इस पेज को रीलोड करें"},edge:{step1:"एड्रेस बार में लॉक आइकन पर क्लिक करें",step2:'"Permissions for this site" पर क्लिक करें',step3:'"Notifications" को "Allow" पर सेट करें',step4:"इस पेज को रीलोड करें"},chrome:{step1:"एड्रेस बार में लॉक आइकन (या ट्यून आइकन) पर क्लिक करें",step2:'"Site settings" पर क्लिक करें',step3:'"Notifications" को "Allow" पर सेट करें',step4:"इस पेज को रीलोड करें"}}},quota:{includedOnly:"{count, number} शामिल",includedWithOverage:"{count, number} शामिल, फिर {price} / {unit}",includedHardLimit:"{count, number} शामिल (सख्त सीमा)",unitFallback:"इकाई"},pricing:{title:"अपना प्लान चुनें",description:"प्लान की तुलना करें और अपनी ज़रूरत के अनुसार चुनें",currency:"मुद्रा",billingIn:"बिलिंग",noPlansCurrency:"आपकी बिलिंग मुद्रा के लिए कोई प्लान उपलब्ध नहीं है।",noPlansCurrencyHint:"कुछ गलत हो गया। कृपया सहायता से संपर्क करें।",noPlans:"कोई प्लान उपलब्ध नहीं",free:"मुफ़्त",included:"शामिल",save:"बचाएँ",current:"वर्तमान",processing:"प्रोसेस हो रहा है...",unavailable:"अनुपलब्ध",selectCurrency:"बिलिंग मुद्रा चुनें",billingInterval:"बिलिंग अवधि"},beta:{nameLabel:"नाम",emailLabel:"ईमेल",submitText:"जमा करें",submittingText:"जमा किया जा रहा है...",errorMessage:"एक त्रुटि हुई",tryAgain:"पुनः प्रयास करें",privacyConsent:"यह फ़ॉर्म जमा करके, आप हमारी",privacyPolicy:"गोपनीयता नीति",and:"और",termsOfService:"सेवा की शर्तों"},workspace:{switchTitle:"वर्कस्पेस बदलें",switchDescription:"एक वर्कस्पेस चुनें या नया बनाएँ।",notLoggedIn:"ऐसा लगता है कि आपने लॉगिन नहीं किया है। जारी रखने के लिए कृपया लॉगिन करें।",availableWorkspaces:"उपलब्ध वर्कस्पेस ({count, number})",loadingWorkspaces:"वर्कस्पेस लोड हो रहे हैं...",searchPlaceholder:"वर्कस्पेस खोजें...",noWorkspacesFound:"कोई वर्कस्पेस नहीं मिला",noWorkspacesAvailable:"कोई वर्कस्पेस उपलब्ध नहीं",switchTo:"बदलें",membersCount:"{count, plural, one {# सदस्य} other {# सदस्य}}",createNew:"नया वर्कस्पेस बनाएँ",createTitle:"नया वर्कस्पेस बनाएँ",createDescription:"शुरू करने के लिए एक नया वर्कस्पेस बनाएँ।",workspaceName:"वर्कस्पेस का नाम",workspaceNamePlaceholder:"मेरा शानदार वर्कस्पेस",workspaceNameMinLength:"वर्कस्पेस का नाम कम से कम 2 अक्षरों का होना चाहिए।",workspaceIcon:"वर्कस्पेस आइकन",iconDescription:"अपने वर्कस्पेस के लिए एक इमोजी चुनें या कस्टम छवि अपलोड करें।",chooseEmoji:"इमोजी चुनें",customImageUrl:"कस्टम छवि URL",imageUrl:"छवि URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"अपने वर्कस्पेस की छवि के लिए एक मान्य URL दर्ज करें। PNG, JPG और SVG प्रारूप समर्थित हैं।",invalidUrl:"कृपया एक मान्य URL दर्ज करें",creating:"बनाया जा रहा है...",createWorkspace:"वर्कस्पेस बनाएँ"},dropdowns:{search:"खोजें...",chooseOption:"विकल्प चुनें",chooseCountry:"देश चुनें",searchCountry:"देश चुनें...",chooseLanguage:"भाषा चुनें",searchLanguage:"भाषा चुनें...",chooseCurrency:"मुद्रा चुनें",searchCurrency:"मुद्रा चुनें...",chooseTimezone:"समय क्षेत्र चुनें",searchTimezone:"समय क्षेत्र चुनें..."},push:{failedToSubscribe:"पुश सूचनाओं की सदस्यता लेने में विफल",failedToUnsubscribe:"पुश सूचनाओं की सदस्यता रद्द करने में विफल"},permissions:{title:"अनुमतियाँ",description:"इस कार्यक्षेत्र में प्रत्येक भूमिका क्या कर सकती है, यह कॉन्फ़िगर करें।",ownerOnly:"केवल कार्यक्षेत्र का स्वामी ही अनुमतियाँ प्रबंधित कर सकता है।",save:"अनुमतियाँ सहेजें",saving:"सहेजा जा रहा है...",saveSuccess:"अनुमतियाँ सफलतापूर्वक सहेजी गईं"},errors:{networkError:"नेटवर्क त्रुटि: कृपया अपना इंटरनेट कनेक्शन जाँचें",unauthorized:"अनधिकृत - कृपया अपना सत्र जाँचें",notFound:"संसाधन नहीं मिला",generic:"एक त्रुटि हुई",fetchPlans:"प्लान लाने में विफल",fetchPlanGroup:"प्लान ग्रुप लाने में विफल",fetchPlanGroupVersion:"प्लान ग्रुप वर्शन लाने में विफल",fetchPlanGroupVersions:"प्लान ग्रुप वर्शन लाने में विफल",fetchSubscription:"सदस्यता लाने में विफल",createCheckout:"चेकआउट सत्र बनाने में विफल",updateSubscription:"सदस्यता अपडेट करने में विफल",fetchInvoices:"चालान लाने में विफल",fetchInvoice:"चालान लाने में विफल",openBillingPortal:"बिलिंग पोर्टल खोलने में विफल",cancelSubscription:"सदस्यता रद्द करने में विफल",resumeSubscription:"सदस्यता फिर से शुरू करने में विफल",recordUsage:"उपयोग दर्ज करने में विफल",fetchQuotaUsage:"कोटा उपयोग स्थिति लाने में विफल",fetchAllQuotaUsage:"सभी कोटा उपयोग लाने में विफल",fetchUsageLogs:"उपयोग लॉग लाने में विफल"}}});var FN=Object.freeze({__proto__:null,ar:{settings:{titles:{profile:"الحساب",general:"إعدادات مساحة العمل",users:"أعضاء مساحة العمل",subscription:"الخطة والفوترة",usage:"الاستخدام",features:"ميزات مساحة العمل",notifications:"الإشعارات",permissions:"الصلاحيات",danger:"منطقة الخطر"},sidebar:{account:"الحساب",workspace:"مساحة العمل",profile:"الحساب",general:"الإعدادات",users:"الأعضاء",subscription:"الخطة والفوترة",usage:"الاستخدام",features:"الميزات",notifications:"الإشعارات",permissions:"الصلاحيات",danger:"منطقة الخطر"},common:{refresh:"تحديث",refreshing:"جارٍ التحديث...",retry:"إعادة المحاولة",retrying:"جارٍ إعادة المحاولة...",save:"حفظ",saving:"جارٍ الحفظ...",cancel:"إلغاء",delete:"حذف",dismiss:"تجاهل",loading:"جارٍ التحميل...",success:"تم بنجاح!",error:"خطأ",refreshAction:"{loading, select, true {جارٍ التحديث...} other {تحديث}}",retryAction:"{loading, select, true {جارٍ إعادة المحاولة...} other {إعادة المحاولة}}"}},subscription:{managePlan:"إدارة خطتك وفوترتك",changePlan:"تغيير الخطة",viewPricingPlans:"عرض خطط الأسعار",viewPlans:"عرض الخطط",upgradePlan:"ترقية الآن",subscribe:"اشتراك",currentPlan:"الخطة الحالية",noSubscription:"ليس لديك اشتراك نشط",choosePlan:"اختر خطتك",choosePlanDescription:"قارن بين الخطط واختر ما يناسب احتياجاتك",forWorkspace:"لـ {name}",planUpdateAvailable:"تحديث الخطة متوفر",updateSuccess:"تم تحديث الاشتراك بنجاح!",updateFailed:"فشل التحديث",cancelTitle:"إلغاء الاشتراك",cancelConfirm:"هل أنت متأكد من رغبتك في إلغاء اشتراكك؟",cancelKeep:"الاحتفاظ بالاشتراك",cancelButton:"نعم، إلغاء الاشتراك",cancelTrialTitle:"إلغاء التجربة",cancelTrialConfirm:"هل أنت متأكد من رغبتك في إلغاء فترتك التجريبية؟",cancelTrialAccess:"ستستمر فترتك التجريبية حتى",cancelTrialNoCharge:"لن يتم تحصيل أي رسوم منك — ستنتهي فترتك التجريبية ببساطة",cancelTrialResume:"يمكنك استئناف فترتك التجريبية في أي وقت قبل انتهائها",cancelTrialKeep:"الاحتفاظ بالتجربة",cancelTrialButton:"نعم، إلغاء التجربة",canceling:"جارٍ الإلغاء...",cancelSuccess:"سيتم إلغاء الاشتراك في نهاية فترة الفوترة.",cancelNotCharged:"لن يتم تحصيل رسوم منك مرة أخرى بعد الإلغاء",cancelResumeAnytime:"يمكنك استئناف اشتراكك في أي وقت قبل انتهائه",resumeTitle:"استئناف الاشتراك",resumeTrial:"استئناف التجربة",resumeConfirm:"هل أنت متأكد من رغبتك في استئناف اشتراكك؟",resumeKeep:"إبقاء الإلغاء",resumeButton:"نعم، استئناف الاشتراك",resuming:"جارٍ الاستئناف...",resumeSuccess:"تم استئناف الاشتراك.",managePayment:"إدارة الدفع",openingPortal:"جارٍ الفتح...",viewAllPlans:"عرض جميع الخطط",scheduledCancellation:"تم جدولة إلغاء الاشتراك",scheduledTrialCancellation:"تم جدولة إلغاء التجربة",paymentPastDue:"الدفع متأخر",paymentPastDueDescription:"يرجى تحديث طريقة الدفع لتجنب انقطاع الخدمة.",subscriptionPaused:"الاشتراك موقوف",subscriptionPausedDescription:"اشتراكك موقوف حالياً. استأنف لاستعادة الوصول الكامل.",errorLoading:"خطأ في تحميل بيانات الاشتراك",errorLoadingDescription:"يرجى التحقق من اتصالك والمحاولة مرة أخرى.",errorProcessing:"فشل في معالجة الاشتراك",errorCanceling:"فشل في إلغاء الاشتراك",errorResuming:"فشل في استئناف الاشتراك",invalidWorkspace:"معرّف مساحة العمل غير صالح",billingInterval:{monthly:"شهري",quarterly:"ربع سنوي",yearly:"سنوي",perMonth:"/شهر",perQuarter:"/ربع سنة",perYear:"/سنة"},seats:{title:"المقاعد",members:"الأعضاء",included:"مشمول",billable:"قابل للفوترة",perExtraSeat:"لكل مقعد إضافي",limit:"الحد",includedSeats:"المقاعد المشمولة",maxSeats:"الحد الأقصى للمقاعد",freeWithBase:"مجاني مع السعر الأساسي",allIncluded:"الكل مشمول",extra:"إضافي",unlimited:"غير محدود"},items:{features:"الميزات",limits:"الحدود",quotas:"حصص الاستخدام"},checkout:{upgrade:"ترقية",downgrade:"تخفيض",switchTo:"التبديل إلى",select:"اختيار"},status:{active:"نشط",canceling:"جارٍ الإلغاء",trial:"تجريبي",canceled:"ملغى",pastDue:"متأخر",paused:"موقوف",deprecated:"قديم",unknown:"غير معروف"},plan:"الخطة",invoicesTab:"الفواتير",changePlanButton:"تغيير الخطة",noPlanAssigned:"لم يتم تعيين خطة",free:"مجاني",perSeatDisplay:"+ {price}/مقعد{interval}",estTotalDisplay:"الإجمالي التقديري: {total}{interval} ({count, plural, zero {بدون مقاعد إضافية} one {مقعد إضافي واحد} two {مقعدان إضافيان} few {# مقاعد إضافية} many {# مقعداً إضافياً} other {# مقعد إضافي}})",nextBillingDisplay:"الفوترة التالية: {date}",membersInWorkspace:"{count, plural, zero {لا أعضاء} one {عضو واحد} two {عضوان} few {# أعضاء} many {# عضواً} other {# عضو}} في مساحة العمل",billingInCurrency:"الفوترة بـ {currency}",savingsPercent:"وفّر {percent, number}%",switchToInterval:"التبديل إلى {interval}",seatPriceDisplay:"+ {price}/مقعد{interval} ({included} {includedLabel})",trialEnded:"انتهت فترتك التجريبية.",trialEndsIn:"تنتهي فترتك التجريبية خلال {days, plural, zero {اليوم} one {يوم واحد} two {يومين} few {# أيام} many {# يوماً} other {# يوم}}.",onTrial:"أنت في فترة تجريبية.",upgradeToKeepAccess:"قم بالترقية للحفاظ على الوصول.",viewInvoices:"عرض الفواتير",cancelTrial:"إلغاء التجربة",dunningFinal:"تحذير أخير: سيتم تعليق الاشتراك",dunningSuspended:"الاشتراك معلق",dunningRecovery:"جارٍ استرداد الدفع",dunningSuspendedDescription:"تم تعليق اشتراكك بسبب فشل الدفع المتكرر. حدّث طريقة الدفع لاستعادة الوصول.",dunningRecoveryDescription:"لم نتمكن من معالجة دفعتك. يرجى تحديث طريقة الدفع لتجنب فقدان الوصول.",cancelEndDescription:"سينتهي اشتراكك في",trialEndDescription:"ستنتهي فترتك التجريبية في",cancelEndFallback:"سيتم إلغاء اشتراكك في نهاية فترة الفوترة الحالية. لن يتم تحصيل رسوم منك مرة أخرى.",resumeChargeDate:"سيتم تحصيل الرسوم منك مرة أخرى في",resumeChargeFallback:"تاريخ الفوترة التالي",resumeContinue:"سيستمر اشتراكك تلقائياً وسيتم فوترتك وفقاً لخطتك",resumeCancelAnytime:"يمكنك الإلغاء في أي وقت قبل تاريخ الفوترة التالي إذا غيرت رأيك",retainAccess:"ستحتفظ بالوصول الكامل إلى هذه الخطة حتى",retainAccessFallback:"نهاية فترة الفوترة الحالية",noPlansAvailable:"لا توجد مجموعات خطط متاحة لمساحة العمل هذه. يرجى الاتصال بالدعم إذا كنت تعتقد أن هذا خطأ.",noPlansAvailableHint:"لا توجد مجموعات خطط متاحة لمساحة العمل هذه.",startTrialDescription:"جرب الخطة الكاملة بدون التزام. يمكنك الترقية أو الإلغاء في أي وقت.",noSubscriptionDescription:"اختر خطة للبدء مع مساحة العمل الخاصة بك",startFreeTrial:"ابدأ التجربة المجانية",startTrialDays:"ابدأ تجربة مجانية لمدة {days} يوم",trialBadge:"تجربة {days} يوم"},users:{title:"أعضاء مساحة العمل",adminOnly:"فقط مدير مساحة العمل يمكنه إدارة المستخدمين والأدوار.",inviteByEmail:"دعوة عضو عبر البريد الإلكتروني",inviteButton:"دعوة",inviting:"جارٍ الدعوة...",inviteSuccess:"تمت دعوة المستخدم بنجاح",emailRequired:"البريد الإلكتروني مطلوب",invalidEmail:"صيغة البريد الإلكتروني غير صالحة",inviteFailed:"فشل في دعوة العضو",seatLimitReached:"تم الوصول لحد المقاعد",memberLimitReached:"تم الوصول لحد الأعضاء",role:"الدور",you:"أنت",owner:"المالك",noMembers:"لم يتم العثور على أعضاء في مساحة العمل هذه.",extraSeatCost:"كل عضو إضافي يضيف {price}/{interval, select, yearly {سنة} quarterly {ربع سنة} other {شهر}} لاشتراكك",unknownUser:"مستخدم غير معروف",seats:"المقاعد",members:"الأعضاء",included:"مشمول",perExtraSeat:"/مقعد إضافي",maxMembers:"الحد الأقصى للأعضاء",available:"متاح",noMemberLimit:"لا حد للأعضاء",seatHeading:"{hasSeatPricing, select, true {المقاعد} other {الأعضاء}}",limitReached:"{reason, select, seat_limit_reached {تم الوصول لحد المقاعد} other {تم الوصول لحد الأعضاء}}",memberCount:"{count, plural, zero {لا أعضاء} one {عضو واحد} two {عضوان} few {# أعضاء} many {# عضواً} other {# عضو}}",subscriptionRequired:"الاشتراك مطلوب لدعوة الأعضاء.",seatLimitMessage:"خطتك تسمح بحد أقصى {maxUsers, number} {maxUsers, plural, zero {أعضاء} one {عضو} two {عضوين} few {أعضاء} many {عضواً} other {عضو}}. قم بالترقية للحصول على مقاعد إضافية.",settingsLimitMessage:"مساحة العمل هذه تسمح بحد أقصى {maxUsers, number} {maxUsers, plural, zero {أعضاء} one {عضو} two {عضوين} few {أعضاء} many {عضواً} other {عضو}}.",memberLimitMessage:"تم الوصول لحد الأعضاء: {maxUsers, number}.",selectRole:"اختر دوراً",inviteAs:"دعوة كـ {role}"},invoices:{title:"سجل الفوترة",description:"عرض وتحميل فواتيرك",pay:"دفع",view:"عرض",viewDetails:"عرض التفاصيل",download:"PDF",errorLoading:"خطأ في تحميل الفواتير",noInvoices:"لا توجد فواتير بعد. اشترك في خطة لاستلام الفواتير.",noInvoicesWithSub:"لم يتم العثور على فواتير مع خيار التحميل",paidAmount:"المدفوع: {amount}",na:"غ/م",status:{draft:"مسودة",open:"مفتوح",paid:"مدفوع",uncollectible:"غير قابل للتحصيل",void:"ملغى"}},usage:{title:"الاستخدام",description:"راقب استهلاك مواردك وحصصك",totalResources:"إجمالي الموارد",overallUsage:"الاستخدام الإجمالي",inOverage:"تجاوز الحد",estOverageCost:"التكلفة التقديرية للتجاوز",overageDetected:"تم اكتشاف تجاوز",overageDescription:"سيتم فوترة الاستخدام الإضافي كتجاوز في فاتورتك التالية.",overageUnits:"وحدات التجاوز",rate:"المعدل",billableBlocks:"الكتل القابلة للفوترة",estimatedCharge:"الرسوم التقديرية",noData:"لا تتوفر بيانات استخدام الحصص لمساحة العمل هذه.",noDataHint:"ستظهر الحصص هنا عندما تتضمن خطتك موارد مقاسة.",used:"مستخدم",remaining:"متبقٍ",overLimit:"فوق الحد",percentUsed:"{percent, number}% مستخدم",availableRemaining:"{count} متبقٍ",overLimitCount:"{count} فوق الحد",overageWarning:"{count, plural, zero {لم تتجاوز أي موارد الحصة المشمولة.} one {مورد واحد تجاوز الحصة المشمولة.} two {مورداً تجاوزا الحصة المشمولة.} few {# موارد تجاوزت الحصة المشمولة.} many {# مورداً تجاوز الحصة المشمولة.} other {# مورد تجاوز الحصة المشمولة.}} سيتم فوترة الاستخدام الإضافي كتجاوز في فاتورتك التالية.",fullyUsed:"مستخدم بالكامل",renewingSoon:"يتجدد قريباً",almostFull:"ممتلئ تقريباً",overage:"تجاوز",errorLoading:"فشل في تحميل بيانات الاستخدام",perUnit:"/ وحدة",perUnits:"/ وحدات",rateDisplay:"{rate} {unitSize, plural, =1 {/ وحدة} other {/ {unitSize, number} وحدة}}",resourcesExceeded:"{count, plural, zero {لم تتجاوز أي موارد الحصة المشمولة.} one {مورد واحد تجاوز الحصة المشمولة.} two {مورداً تجاوزا الحصة المشمولة.} few {# موارد تجاوزت الحصة المشمولة.} many {# مورداً تجاوز الحصة المشمولة.} other {# مورد تجاوز الحصة المشمولة.}}",estOverageCharges:"الرسوم التقديرية للتجاوز في هذه الفترة: {amount}",overageRateDisplay:"معدل التجاوز: {rate}",resetDateDisplay:"يتم إعادة تعيين الاستخدام في {date}",daysRemainingDisplay:"{count, plural, zero {اليوم} one {يوم واحد متبقٍ} two {يومان متبقيان} few {# أيام متبقية} many {# يوماً متبقياً} other {# يوم متبقٍ}}"},profile:{email:"البريد الإلكتروني",name:"الاسم",language:"اللغة",country:"البلد",currency:"العملة",timezone:"المنطقة الزمنية",profileImage:"صورة الملف الشخصي",success:"تم حفظ الملف الشخصي بنجاح",nameMinLength:"يجب أن يتكون الاسم من حرفين على الأقل.",save:"حفظ",reset:"إعادة تعيين"},general:{ownerOnly:"فقط مالك مساحة العمل يمكنه تغيير إعدادات مساحة العمل.",name:"الاسم",namePlaceholder:"مساحة العمل الرائعة",nameMinLength:"يجب أن يتكون اسم مساحة العمل من حرفين على الأقل.",billingCurrency:"عملة الفوترة",icon:"الأيقونة",iconDescription:"اختر رمزاً تعبيرياً أو حمّل صورة مخصصة لمساحة العمل.",imageUrl:"رابط الصورة",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"أدخل رابطاً صالحاً لصورة مساحة العمل. الصيغ المدعومة: PNG و JPG و SVG.",previewLabel:"معاينة:",success:"تم حفظ إعدادات مساحة العمل بنجاح",chooseEmoji:"اختر رمزاً تعبيرياً",customImageUrl:"رابط صورة مخصص",updateWorkspace:"تحديث مساحة العمل"},features:{title:"ميزات مساحة العمل",ownerOnly:"فقط مالك مساحة العمل يمكنه تغيير الميزات.",noFeatures:"لا توجد ميزات لإدارتها.",enabled:"مفعّل",disabled:"معطّل",enabling:"جارٍ التفعيل",disabling:"جارٍ التعطيل",featureSuccess:"بنجاح",updateSuccess:"تم {enabled, select, true {تفعيل} other {تعطيل}} {feature} بنجاح",actionStatus:"{action, select, enabling {جارٍ التفعيل} disabling {جارٍ التعطيل} other {}}"},danger:{title:"حذف مساحة العمل",adminOnly:"فقط مديرو مساحة العمل يمكنهم حذف مساحات العمل.",deleteWorkspace:"حذف مساحة العمل",deleteConfirm:"هل أنت متأكد تماماً؟",deleteWarning:"لا يمكن التراجع عن هذا الإجراء. سيتم حذف مساحة العمل وجميع البيانات المرتبطة نهائياً.",deleting:"جارٍ الحذف...",deleteDescription:"بمجرد حذف مساحة العمل لا يمكن العودة. سيتم حذف مساحة العمل وجميع بياناتها نهائياً، بما في ذلك الأعضاء والإعدادات والميزات.",deleteConfirmDescription:"لا يمكن التراجع عن هذا الإجراء. سيتم حذف مساحة العمل وجميع بياناتها نهائياً.",failedToDelete:"فشل في حذف مساحة العمل"},notifications:{title:"تفضيلات الإشعارات",permissionDenied:"تم رفض إذن الإشعارات",notSupported:"الإشعارات الفورية غير مدعومة في هذا المتصفح.",manageDescription:"أدِر كيفية تلقي الإشعارات من مساحة العمل هذه.",blocked:"الإشعارات محظورة",blockedDescription:"لقد حظرت الإشعارات لهذا الموقع سابقاً. لتفعيلها، حدّث إعدادات متصفحك:",pushTitle:"الإشعارات الفورية",pushEnabledDescription:"ستتلقى إشعارات المتصفح للتحديثات المهمة.",pushDisabledDescription:"احصل على إشعارات حول مشاكل الدفع وانتهاء التجربة والتحديثات المهمة الأخرى.",enabling:"جارٍ التفعيل...",disabling:"جارٍ التعطيل...",enable:"تفعيل",disable:"تعطيل",toggleAction:"{loading, select, true {{subscribed, select, true {جارٍ التعطيل...} other {جارٍ التفعيل...}}} other {{subscribed, select, true {تعطيل} other {تفعيل}}}}",pushDescription:"{subscribed, select, true {ستتلقى إشعارات المتصفح للتحديثات المهمة.} other {احصل على إشعارات حول مشاكل الدفع وانتهاء التجربة والتحديثات المهمة الأخرى.}}",deviceNote:"يتم إرسال الإشعارات إلى هذا الجهاز. فعّلها على الأجهزة الأخرى بشكل منفصل.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"انقر على أيقونة القفل (أو الدرع) في شريط العنوان",step2:'ابحث عن "Notifications" في قائمة الأذونات',step3:'غيّر من "Blocked" إلى "Allow"',step4:"أعد تحميل هذه الصفحة"},safari:{step1:"افتح Safari ← الإعدادات ← مواقع الويب ← الإشعارات",step2:"ابحث عن هذا الموقع في القائمة",step3:'غيّر من "Deny" إلى "Allow"',step4:"أعد تحميل هذه الصفحة"},edge:{step1:"انقر على أيقونة القفل في شريط العنوان",step2:'انقر على "Permissions for this site"',step3:'اضبط "Notifications" على "Allow"',step4:"أعد تحميل هذه الصفحة"},chrome:{step1:"انقر على أيقونة القفل (أو الضبط) في شريط العنوان",step2:'انقر على "Site settings"',step3:'اضبط "Notifications" على "Allow"',step4:"أعد تحميل هذه الصفحة"}}},quota:{includedOnly:"{count, number} مشمول",includedWithOverage:"{count, number} مشمول، ثم {price} / {unit}",includedHardLimit:"{count, number} مشمول (حد أقصى)",unitFallback:"وحدة"},pricing:{title:"اختر خطتك",description:"قارن بين الخطط واختر ما يناسب احتياجاتك",currency:"العملة",billingIn:"الفوترة بـ",noPlansCurrency:"لا توجد خطط متاحة لعملة الفوترة الخاصة بك.",noPlansCurrencyHint:"حدث خطأ ما. يرجى الاتصال بالدعم.",noPlans:"لا توجد خطط متاحة",free:"مجاني",included:"مشمول",save:"وفّر",current:"الحالي",processing:"جارٍ المعالجة...",unavailable:"غير متاح",selectCurrency:"اختر عملة الفوترة",billingInterval:"فترة الفوترة"},beta:{nameLabel:"الاسم",emailLabel:"البريد الإلكتروني",submitText:"إرسال",submittingText:"جارٍ الإرسال...",errorMessage:"حدث خطأ",tryAgain:"حاول مرة أخرى",privacyConsent:"بإرسال هذا النموذج، فإنك توافق على",privacyPolicy:"سياسة الخصوصية",and:"و",termsOfService:"شروط الخدمة"},workspace:{switchTitle:"تبديل مساحة العمل",switchDescription:"اختر مساحة عمل للتبديل إليها أو أنشئ واحدة جديدة.",notLoggedIn:"يبدو أنك لم تسجل الدخول. يرجى تسجيل الدخول للمتابعة.",availableWorkspaces:"مساحات العمل المتاحة ({count, number})",loadingWorkspaces:"جارٍ تحميل مساحات العمل...",searchPlaceholder:"بحث في مساحات العمل...",noWorkspacesFound:"لم يتم العثور على مساحات عمل",noWorkspacesAvailable:"لا تتوفر مساحات عمل",switchTo:"التبديل إلى",membersCount:"{count, plural, zero {لا أعضاء} one {عضو واحد} two {عضوان} few {# أعضاء} many {# عضواً} other {# عضو}}",createNew:"إنشاء مساحة عمل جديدة",createTitle:"إنشاء مساحة عمل جديدة",createDescription:"أنشئ مساحة عمل جديدة للبدء.",workspaceName:"اسم مساحة العمل",workspaceNamePlaceholder:"مساحة العمل الرائعة",workspaceNameMinLength:"يجب أن يتكون اسم مساحة العمل من حرفين على الأقل.",workspaceIcon:"أيقونة مساحة العمل",iconDescription:"اختر رمزاً تعبيرياً أو حمّل صورة مخصصة لمساحة العمل.",chooseEmoji:"اختر رمزاً تعبيرياً",customImageUrl:"رابط صورة مخصص",imageUrl:"رابط الصورة",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"أدخل رابطاً صالحاً لصورة مساحة العمل. الصيغ المدعومة: PNG و JPG و SVG.",invalidUrl:"يرجى إدخال رابط صالح",creating:"جارٍ الإنشاء...",createWorkspace:"إنشاء مساحة العمل"},dropdowns:{search:"بحث...",chooseOption:"اختر خياراً",chooseCountry:"اختر البلد",searchCountry:"اختر البلد...",chooseLanguage:"اختر اللغة",searchLanguage:"اختر اللغة...",chooseCurrency:"اختر العملة",searchCurrency:"اختر العملة...",chooseTimezone:"اختر المنطقة الزمنية",searchTimezone:"اختر المنطقة الزمنية..."},push:{failedToSubscribe:"فشل في الاشتراك في الإشعارات الفورية",failedToUnsubscribe:"فشل في إلغاء الاشتراك من الإشعارات الفورية"},permissions:{title:"الصلاحيات",description:"قم بتكوين ما يمكن لكل دور القيام به في مساحة العمل هذه.",ownerOnly:"يمكن لمالك مساحة العمل فقط إدارة الصلاحيات.",save:"حفظ الصلاحيات",saving:"جارٍ الحفظ...",saveSuccess:"تم حفظ الصلاحيات بنجاح"},errors:{networkError:"خطأ في الشبكة: يرجى التحقق من اتصالك بالإنترنت",unauthorized:"غير مصرح - يرجى التحقق من جلستك",notFound:"المورد غير موجود",generic:"حدث خطأ",fetchPlans:"فشل في جلب الخطط",fetchPlanGroup:"فشل في جلب مجموعة الخطط",fetchPlanGroupVersion:"فشل في جلب إصدار مجموعة الخطط",fetchPlanGroupVersions:"فشل في جلب إصدارات مجموعة الخطط",fetchSubscription:"فشل في جلب الاشتراك",createCheckout:"فشل في إنشاء جلسة الدفع",updateSubscription:"فشل في تحديث الاشتراك",fetchInvoices:"فشل في جلب الفواتير",fetchInvoice:"فشل في جلب الفاتورة",openBillingPortal:"فشل في فتح بوابة الفوترة",cancelSubscription:"فشل في إلغاء الاشتراك",resumeSubscription:"فشل في استئناف الاشتراك",recordUsage:"فشل في تسجيل الاستخدام",fetchQuotaUsage:"فشل في جلب حالة استخدام الحصص",fetchAllQuotaUsage:"فشل في جلب جميع استخدامات الحصص",fetchUsageLogs:"فشل في جلب سجلات الاستخدام"}}});const BN={[da.Monthly]:"subscription.billingInterval.perMonth",[da.Quarterly]:"subscription.billingInterval.perQuarter",[da.Yearly]:"subscription.billingInterval.perYear"},WN=(e,t,r)=>{if(!e||0===e)return null;let n;switch(r){case da.Yearly:n=t/12;break;case da.Quarterly:n=t/3;break;default:return null}const a=(e-n)/e*100;return a>0?Math.round(a):null};var VN=Object.freeze({__proto__:null,default:({open:n,onOpenChange:i,planVersions:s,currentPlanVersionId:c,currentStripePriceId:l,billingCurrency:u,currentMemberCount:p,trialUsedAt:h,workspaceName:f,initialInterval:g,initialCurrency:b,onSelectPlan:v,loading:y=!1})=>{const[w,x]=m(!1),{t:S,formattingLocale:k,dir:E,fmtNum:N,fmtCents:C}=xn(),{settings:A}=Fn(),_=A?.workspace?.mode===mS,P=(e,t)=>null==e||0===e?"":C(e,t),T=e=>S(BN[e]??BN[da.Monthly]),[R,D]=m(null),I=a.useRef(!1),U=o(()=>Da(l,s),[l,s]),M=U?.interval??null,L=U?.currency??null,O=o(()=>function(e){const t=new Set;for(const r of e)r.pricingVariants?.forEach(e=>{e.currency&&t.add(e.currency.toLowerCase())});return Array.from(t).sort()}(s),[s]),z=o(()=>{const e=u?.trim().toLowerCase();return e?O.includes(e)?[e]:[]:O},[u,O]),[F,B]=m(g||M||da.Monthly),[W,V]=m(()=>b&&z.includes(b)?b:L&&z.includes(L)?L:z.length>0?z[0]:""),j=u?.trim()||W;d(()=>{if(n){B(g||M||da.Monthly);const e=b||L;e&&z.includes(e)?V(e):z.length>0&&!z.includes(W)&&V(z[0])}},[n,g,b,M,L,z]);const H=o(()=>[...s],[s]),G=(e=>{const t=new Map;return e.forEach(e=>{e.subscriptionItems?.forEach(e=>{t.has(e._id)||t.set(e._id,e)})}),Array.from(t.values())})(H),$=G.filter(e=>e.type===Sa),K=G.filter(e=>e.type===ka),q=G.filter(e=>e.type===Ea),Z=async e=>{if(!(e===c&&M===F||y||w||I.current)){I.current=!0,x(!0),D(e);try{await v(e,F,j),i(!1)}catch(e){}finally{I.current=!1,x(!1),D(null)}}},J=e=>Pa(e,j,F),Y=e=>!!e.pricingVariants?.some(e=>e.currency?.toLowerCase()===j.toLowerCase()),X=y||w,Q=e=>{switch(e){case da.Monthly:return S("subscription.billingInterval.monthly");case da.Quarterly:return S("subscription.billingInterval.quarterly");case da.Yearly:return S("subscription.billingInterval.yearly");default:return S("subscription.billingInterval.monthly")}},ee=e=>{const t=e._id===c,r=M===F;if(t&&r)return{labelKey:"subscription.currentPlan",variant:"outline",disabled:!0};if(t&&!r)return e.plan?.isFreemium?{labelKey:"subscription.currentPlan",variant:"outline",disabled:!0}:{labelKey:"_dynamic",dynamicLabel:S("subscription.switchToInterval",{interval:Q(F)}),variant:"default",disabled:!1};const n=e.trial?.enabled&&e.trial.durationDays>0&&!h&&!l;if(!c)return n?{labelKey:"_dynamic",dynamicLabel:S("subscription.startTrialDays",{days:e.trial.durationDays}),variant:"default",disabled:!1}:{labelKey:"subscription.subscribe",variant:"default",disabled:!1};const a=H.findIndex(e=>e._id===c),i=H.findIndex(t=>t._id===e._id);return-1===a||-1===i?n?{labelKey:"_dynamic",dynamicLabel:S("subscription.startTrialDays",{days:e.trial.durationDays}),variant:"default",disabled:!1}:{labelKey:"subscription.checkout.select",variant:"default",disabled:!1}:i<a?{labelKey:"subscription.checkout.downgrade",variant:"outline",disabled:!1}:i>a?n?{labelKey:"_dynamic",dynamicLabel:S("subscription.startTrialDays",{days:e.trial.durationDays}),variant:"default",disabled:!1}:{labelKey:"subscription.checkout.upgrade",variant:"default",disabled:!1}:{labelKey:"subscription.checkout.select",variant:"default",disabled:!1}},te=(e,t,r=da.Monthly)=>{if(t.type===Sa)return e.features?.[t.slug]??!1;if(t.type===ka)return e.limits?.[t.slug]??null;if(t.type===Ea){const n=Ra(e,j,t.slug,r);return n||oS(e.quotas?.[t.slug],r)}return null},re=(e,t,r)=>{if(t.type===Sa)return!0===e?"✓":"—";if(t.type===ka)return null!=e&&"number"==typeof e?N(e):"—";if(t.type===Ea){const n=cS("object"==typeof e&&null!==e&&"included"in e?e:null,t.name.toLowerCase(),{currency:r,locale:k});return n?n.allowOverage?n.hasOverage?S("quota.includedWithOverage",{count:n.included,price:n.price,unit:n.unit}):S("quota.includedOnly",{count:n.included}):S("quota.includedHardLimit",{count:n.included}):"—"}return"—"};return t(Nc,{open:n,onOpenChange:i,children:e(Pc,{dir:E,className:"inset-0 w-screen h-screen max-w-none rounded-none translate-x-0 translate-y-0 p-0 flex flex-col",children:[e("div",{className:"flex-shrink-0 px-4 py-4 sm:px-6 sm:py-6 border-b space-y-3 sm:space-y-4",children:[e("div",{children:[t(Rc,{className:"text-xl sm:text-2xl font-bold",children:S("pricing.title")}),e(Dc,{className:"mt-1 text-sm",children:[S("subscription.choosePlanDescription"),f&&t("span",{className:"ml-1 font-medium text-foreground",children:S("subscription.forWorkspace",{name:f})})]})]}),e("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 sm:gap-4",children:[e("div",{className:"flex items-center gap-2",children:[!u?.trim()&&z.length>1&&e(r,{children:[t("span",{className:"text-sm text-slate-600",children:S("pricing.currency")}),t("select",{"aria-label":S("pricing.selectCurrency"),value:W,onChange:e=>V(e.target.value),className:"rounded-md border border-slate-200 bg-white px-3 py-2 text-sm font-medium text-slate-900 shadow-sm focus:outline-none focus:ring-2 focus:ring-primary",children:z.map(e=>{const r=ng(e);return t("option",{value:e,children:r?`${r} ${e.toUpperCase()}`:e.toUpperCase()},e)})})]}),u?.trim()&&t("span",{className:"text-xs text-slate-500",children:S("subscription.billingInCurrency",{currency:u.toUpperCase()})})]}),t("div",{className:"flex items-center gap-0.5 sm:gap-1 p-1 bg-slate-100 rounded-lg w-full sm:w-auto",role:"group","aria-label":S("pricing.billingInterval"),children:[da.Monthly,da.Quarterly,da.Yearly].map(r=>{const n=M===r;return t("button",{onClick:()=>B(r),"aria-pressed":F===r,className:"flex-1 sm:flex-initial px-3 sm:px-4 py-2 text-sm font-medium rounded-md transition-all relative "+(F===r?"bg-white text-slate-900 shadow-sm":"text-slate-600 hover:text-slate-900"),children:e("span",{className:"flex items-center justify-center gap-1 sm:gap-1.5",children:[r===da.Monthly&&S("subscription.billingInterval.monthly"),r===da.Quarterly&&S("subscription.billingInterval.quarterly"),r===da.Yearly&&S("subscription.billingInterval.yearly"),r===da.Yearly&&t("span",{className:"text-[10px] sm:text-xs px-1 sm:px-1.5 py-0.5 bg-emerald-100 text-emerald-700 rounded-full font-semibold",children:S("pricing.save")}),n&&c&&t("span",{className:"hidden sm:inline text-xs px-1.5 py-0.5 bg-blue-100 text-blue-700 rounded-full font-semibold",children:S("pricing.current")})]})},r)})})]})]}),t("div",{className:"flex-1 min-h-0 flex flex-col",children:u?.trim()&&0===z.length?e("div",{className:"text-center py-12 px-4",children:[t("p",{className:"text-slate-600 font-medium",children:S("pricing.noPlansCurrency")}),t("p",{className:"text-slate-500 text-sm mt-2",children:S("pricing.noPlansCurrencyHint")})]}):0===H.length?t("div",{className:"text-center py-12 text-gray-500",children:t("p",{children:S("pricing.noPlans")})}):e("div",{className:"flex-1 min-h-0 overflow-hidden bg-white",children:[t("div",{className:"md:hidden overflow-auto h-full",style:{maxHeight:"calc(100vh - 13rem)"},children:t("div",{className:"p-4 space-y-4",children:H.map(r=>{const n=r._id===c,a=ee(r),i=X&&r._id===R,s=J(r),o=Y(r),u=r.pricingVariants?.length&&r.pricingVariants.some(e=>e.currency?.toLowerCase()===j.toLowerCase())?j:r.plan?.currency??j??"",d=Pa(r,j,da.Monthly)??0,m=F!==da.Monthly&&null!==s?WN(d,s,F):null,f=Ia(r,j),g=f?Ua(r,j,F):null;return e("div",{className:"rounded-xl border-2 p-4 "+(n?"border-blue-500 bg-blue-50/30":"border-slate-200 bg-white"),children:[e("div",{className:"flex items-start justify-between mb-3",children:[e("div",{children:[e("div",{className:"flex items-center gap-2",children:[t("h3",{className:"text-lg font-bold text-slate-900",children:r.plan.name}),r.trial?.enabled&&r.trial.durationDays>0&&!n&&!h&&!l&&t("span",{className:"shrink-0 rounded-md bg-emerald-100 text-emerald-700 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider",children:S("subscription.trialBadge",{days:r.trial.durationDays})})]}),r.plan.description&&t("p",{className:"text-xs text-slate-500 mt-0.5 line-clamp-2",children:r.plan.description})]}),n&&t("span",{className:"shrink-0 rounded-md bg-blue-600 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",children:S("pricing.current")})]}),e("div",{className:"mb-4",children:[e("div",{className:"flex items-baseline gap-1 whitespace-nowrap",children:[t("span",{className:"text-2xl font-bold text-slate-900",children:o&&null!==s||o?P(s,u)||S("pricing.free"):"—"}),null!==s&&s>0&&o&&t("span",{className:"text-sm text-slate-500",children:T(F)})]}),null!==m&&m>0&&o&&t("span",{className:"text-xs text-emerald-600 font-medium",children:S("subscription.savingsPercent",{percent:m})}),f?.enabled&&g&&g>0&&!_&&t("div",{className:"text-xs text-slate-500 mt-1",children:S("subscription.seatPriceDisplay",{price:C(g,u),interval:T(F),included:N(f.includedSeats),includedLabel:S("pricing.included")})})]}),$.length>0&&e("div",{className:"mb-3",children:[t("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-1.5",children:S("subscription.items.features")}),t("div",{className:"space-y-1",children:$.map(n=>{const a=te(r,n,F),i=n.type===Sa&&!0===a;return e("div",{className:"flex items-center gap-2 text-sm",children:[n.type===Sa?t("span",i?{className:"text-emerald-500 text-xs",children:"✓"}:{className:"text-slate-300 text-xs",children:"✕"}):null,t("span",{className:i?"text-slate-700":"text-slate-400",children:n.name})]},n._id)})})]}),K.length>0&&e("div",{className:"mb-3",children:[t("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-1.5",children:S("subscription.items.limits")}),t("div",{className:"space-y-1",children:K.map(n=>{const a=te(r,n,F);return e("div",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-slate-600",children:n.name}),t("span",{className:"font-medium text-slate-700",children:"number"==typeof a?N(a):"—"})]},n._id)})})]}),f?.enabled&&!_&&e("div",{className:"mb-3",children:[t("div",{className:"text-xs font-semibold text-emerald-600 uppercase tracking-wider mb-1.5",children:S("subscription.seats.title")}),e("div",{className:"space-y-1 text-sm",children:[e("div",{className:"flex justify-between",children:[t("span",{className:"text-slate-600",children:S("subscription.seats.included")}),t("span",{className:"font-medium",children:N(f.includedSeats||0)})]}),e("div",{className:"flex justify-between",children:[t("span",{className:"text-slate-600",children:S("subscription.seats.maxSeats")}),t("span",{className:"font-medium",children:f.maxSeats>0?N(f.maxSeats):S("subscription.seats.unlimited")})]}),null!=p&&p>0&&(()=>{const r=Math.max(0,p-(f.includedSeats||0));return e("div",{className:"flex justify-between",children:[t("span",{className:"text-slate-600",children:S("subscription.seats.billable")}),t("span",{className:"font-medium "+(0===r?"text-emerald-600":"text-amber-600"),children:0===r?S("subscription.seats.allIncluded"):`${N(r)} ${S("subscription.seats.extra")}`})]})})()]})]}),t(Hi,{className:"w-full mt-2",variant:a.variant,disabled:a.disabled||X||!o,progress:i,onClick:()=>Z(r._id),children:i?S("pricing.processing"):o?a.dynamicLabel??S(a.labelKey):S("pricing.unavailable")})]},r._id)})})}),t("div",{className:"hidden md:block overflow-auto h-full",style:{maxHeight:"calc(100vh - 12rem)"},children:e("table",{className:"w-full border-separate border-spacing-0",style:{minWidth:260+220*H.length+"px",borderCollapse:"separate"},children:[e("colgroup",{children:[t("col",{style:{width:260,minWidth:260}}),H.map(e=>t("col",{style:{width:220,minWidth:220}},e._id))]}),t("thead",{children:e("tr",{className:"align-top",children:[t("th",{className:"sticky top-0 start-0 z-30 p-0 bg-white text-start"}),H.map(r=>{const n=r._id===c,a=ee(r),i=X&&r._id===R,s=J(r),o=Pa(r,j,da.Monthly)??0,u=F!==da.Monthly&&null!==s?WN(o,s,F):null,d=Y(r),p=r.pricingVariants?.length&&r.pricingVariants.some(e=>e.currency?.toLowerCase()===j.toLowerCase())?j:r.plan?.currency??j??"";return t("th",{className:"sticky top-0 z-20 border-b border-slate-200 p-3 shadow-[0_2px_4px_-2px_rgba(0,0,0,0.06)] "+(r._id===c?"bg-blue-50/80":"bg-white"),children:e("div",{className:"flex h-full flex-col gap-2",children:[e("div",{className:"flex items-center justify-between gap-2",children:[e("div",{className:"flex items-center gap-2 min-w-0",children:[t("h3",{className:"text-base font-bold text-slate-900 truncate",children:r.plan.name}),r.trial?.enabled&&r.trial.durationDays>0&&!n&&!h&&!l&&t("span",{className:"shrink-0 rounded-md bg-emerald-100 text-emerald-700 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider",children:S("subscription.trialBadge",{days:r.trial.durationDays})})]}),n&&t("span",{className:"shrink-0 rounded-md bg-blue-600 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",children:S("pricing.current")})]}),e("div",{className:"flex flex-col items-start min-h-[3rem]",children:[e("div",{className:"flex items-baseline gap-1 flex-wrap",children:[t("span",{className:"text-2xl font-bold text-slate-900",children:d&&null!==s||d?P(s,p)||S("pricing.free"):"—"}),null!==s&&s>0&&d&&t("span",{className:"text-sm text-slate-500",children:T(F)}),null!==u&&u>0&&d&&t("span",{className:"text-[10px] px-1.5 py-0.5 bg-emerald-100 text-emerald-700 rounded-full font-semibold whitespace-nowrap",children:S("subscription.savingsPercent",{percent:u})})]}),(()=>{if(_)return null;const e=Ia(r,j);if(!e)return null;const n=Ua(r,j,F);return!n||n<=0?null:t("div",{className:"text-[11px] text-slate-500 mt-1.5 border-t border-slate-100 pt-1 leading-tight",children:t("div",{children:S("subscription.seatPriceDisplay",{price:C(n,p),interval:T(F),included:N(e.includedSeats),includedLabel:S("pricing.included")})})})})()]}),r.plan.description&&t("p",{className:"text-xs text-slate-500 line-clamp-2 leading-relaxed text-start",children:r.plan.description}),t(Hi,{className:"mt-auto w-full",variant:a.variant,disabled:a.disabled||X||!d,progress:i,onClick:()=>Z(r._id),children:i?S("pricing.processing"):d?a.dynamicLabel??S(a.labelKey):S("pricing.unavailable")})]})},r._id)})]})}),e("tbody",{children:[$.length>0&&e(r,{children:[e("tr",{children:[t("td",{className:"sticky start-0 z-10 border-t border-slate-200 bg-slate-100 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-slate-600 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:S("subscription.items.features")}),t("td",{colSpan:H.length,className:"border-t border-slate-200 bg-slate-100"})]}),$.map(r=>e("tr",{className:"group hover:bg-slate-50/50",children:[e("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[t("div",{className:"font-medium text-sm text-slate-900",children:r.name}),r.description&&t("div",{className:"text-xs text-slate-500 mt-0.5",children:r.description})]}),H.map(e=>{const n=te(e,r,F),a=e.pricingVariants?.length?j:e.plan?.currency??j??"",i=re(n,r,a),s=r.type===Sa&&!0===n;return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(e._id===c?"bg-blue-50/50":"bg-white"),children:t("span",{className:"text-sm font-medium "+(s?"text-emerald-600":"—"===i?"text-slate-400":"text-slate-700"),children:i})},e._id)})]},r._id))]}),K.length>0&&e(r,{children:[e("tr",{children:[t("td",{className:"sticky start-0 z-10 border-t border-slate-200 bg-slate-100 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-slate-600 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:S("subscription.items.limits")}),t("td",{colSpan:H.length,className:"border-t border-slate-200 bg-slate-100"})]}),K.map(r=>e("tr",{className:"group hover:bg-slate-50/50",children:[e("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[t("div",{className:"font-medium text-sm text-slate-900",children:r.name}),r.description&&t("div",{className:"text-xs text-slate-500 mt-0.5",children:r.description})]}),H.map(e=>{const n=te(e,r,F),a=e.pricingVariants?.length?j:e.plan?.currency??j??"",i=re(n,r,a);return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(e._id===c?"bg-blue-50/50":"bg-white"),children:t("span",{className:"text-sm font-medium "+("—"===i?"text-slate-400":"text-slate-700"),children:i})},e._id)})]},r._id))]}),q.length>0&&e(r,{children:[e("tr",{children:[t("td",{className:"sticky start-0 z-10 border-t border-slate-200 bg-slate-100 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-slate-600 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:S("subscription.items.quotas")}),t("td",{colSpan:H.length,className:"border-t border-slate-200 bg-slate-100"})]}),q.map(r=>e("tr",{className:"group hover:bg-slate-50/50",children:[e("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[t("div",{className:"font-medium text-sm text-slate-900",children:r.name}),r.description&&t("div",{className:"text-xs text-slate-500 mt-0.5",children:r.description})]}),H.map(e=>{const n=te(e,r,F),a=e.pricingVariants?.length?j:e.plan?.currency??j??"",i=re(n,r,a);return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(e._id===c?"bg-blue-50/50":"bg-white"),children:t("span",{className:"text-sm font-medium "+("—"===i?"text-slate-400":"text-slate-700"),children:i})},e._id)})]},r._id))]}),!_&&H.some(e=>{const t=Ia(e,j);return t?.enabled})&&e(r,{children:[e("tr",{children:[t("td",{className:"sticky start-0 z-10 border-t border-emerald-200 bg-emerald-50 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-emerald-700 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:S("subscription.seats.title")}),t("td",{colSpan:H.length,className:"border-t border-emerald-200 bg-emerald-50"})]}),e("tr",{className:"group hover:bg-slate-50/50",children:[e("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[t("div",{className:"font-medium text-sm text-slate-900",children:S("subscription.seats.includedSeats")}),t("div",{className:"text-xs text-slate-500 mt-0.5",children:S("subscription.seats.freeWithBase")})]}),H.map(e=>{const r=Ia(e,j);return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(e._id===c?"bg-blue-50/50":"bg-white"),children:t("span",{className:"text-sm font-medium text-slate-700",children:r?.enabled?N(r.includedSeats||0):"—"})},e._id)})]}),e("tr",{className:"group hover:bg-slate-50/50",children:[t("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:t("div",{className:"font-medium text-sm text-slate-900",children:S("subscription.seats.maxSeats")})}),H.map(e=>{const r=Ia(e,j);return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(e._id===c?"bg-blue-50/50":"bg-white"),children:t("span",{className:"text-sm font-medium text-slate-700",children:r?.enabled?r.maxSeats>0?N(r.maxSeats):S("subscription.seats.unlimited"):"—"})},e._id)})]}),e("tr",{className:"group hover:bg-slate-50/50",children:[t("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:t("div",{className:"font-medium text-sm text-slate-900",children:S("subscription.seats.perExtraSeat")})}),H.map(e=>{const r=Ua(e,j,F),n=e.pricingVariants?.length?j:e.plan?.currency??j??"";return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(e._id===c?"bg-blue-50/50":"bg-white"),children:t("span",{className:"text-sm font-medium text-slate-700",children:r&&r>0?`${C(r,n)}${T(F)}`:"—"})},e._id)})]}),null!=p&&p>0&&e("tr",{className:"group hover:bg-slate-50/50",children:[e("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[t("div",{className:"font-medium text-sm text-slate-900",children:S("subscription.seats.billable")}),t("div",{className:"text-xs text-slate-500 mt-0.5",children:S("subscription.membersInWorkspace",{count:p})})]}),H.map(r=>{const n=Ia(r,j);if(!n?.enabled)return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(r._id===c?"bg-blue-50/50":"bg-white"),children:t("span",{className:"text-sm text-slate-400",children:"—"})},r._id);const a=n.includedSeats||0,i=Math.max(0,p-a);return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(r._id===c?"bg-blue-50/50":"bg-white"),children:0===i?t("span",{className:"text-sm font-medium text-emerald-600",children:S("subscription.seats.allIncluded")}):e("span",{className:"text-sm font-medium text-amber-600",children:[N(i)," ",S("subscription.seats.extra")]})},r._id)})]})]})]})]})})]})})]})})}});export{GE as BetaForm,qE as PricingPage,lv as PushNotificationProvider,iE as QuotaUsageContextProvider,Yk as SETTINGS_SCREENS,dn as SUPPORTED_LOCALES,vE as SaaSOSProvider,Jk as SettingsScreen,sa as SubscriptionContextProvider,yE as WhenAuthenticated,RE as WhenNoSubscription,UE as WhenNotTrialing,kE as WhenPermission,LE as WhenQuotaAvailable,OE as WhenQuotaExhausted,zE as WhenQuotaOverage,FE as WhenQuotaThreshold,xE as WhenRoles,TE as WhenSubscription,DE as WhenSubscriptionToPlans,ME as WhenTrialEnding,IE as WhenTrialing,wE as WhenUnauthenticated,PE as WhenUserFeatureDisabled,_E as WhenUserFeatureEnabled,AE as WhenWorkspaceFeatureDisabled,CE as WhenWorkspaceFeatureEnabled,SE as WhenWorkspaceRoles,TN as WorkspaceSwitcher,na as useAllQuotaUsage,Yn as useBillingPortal,Qn as useCancelSubscription,Kn as useCreateCheckoutSession,Xn as useInvoice,Jn as useInvoices,Bl as usePermissions,Gn as usePlanGroup,$n as usePlanGroupVersions,jn as usePublicPlanGroupVersion,Vn as usePublicPlans,uv as usePushNotifications,sE as useQuotaUsageContext,ra as useQuotaUsageStatus,ta as useRecordUsage,ea as useResumeSubscription,Fl as useSaaSAuth,On as useSaaSOs,Fn as useSaaSSettings,rE as useSaaSWorkspaces,Hk as useSeatStatus,Hn as useSubscription,oa as useSubscriptionContext,Zn as useSubscriptionManagement,xn as useTranslation,WE as useTrialStatus,qn as useUpdateSubscription,aa as useUsageLogs,EE as useUserAttributes,NE as useUserFeatures};
36
+ */function YN(){return qN||(qN=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=a,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=t.useState,i=t.useEffect,s=t.useLayoutEffect,o=t.useDebugValue,c=!1,l=!1,d="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(a,d){c||void 0===t.startTransition||(c=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var u=d();if(!l){var p=d();r(u,p)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),l=!0)}var m=(p=n({inst:{value:u,getSnapshot:d}}))[0].inst,h=p[1];return s(function(){m.value=u,m.getSnapshot=d,e(m)&&h({inst:m})},[a,u,d]),i(function(){return e(m)&&h({inst:m}),a(function(){e(m)&&h({inst:m})})},[a]),o(u),u};JN.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:d,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),JN}function XN(){return ZN||(ZN=1,"production"===process.env.NODE_ENV?jN.exports=KN():jN.exports=YN()),jN.exports}var QN=XN();function eE(){return()=>{}}var tE="Avatar",[rE]=function(e,r=[]){let a=[];const i=()=>{const t=a.map(e=>n.createContext(e));return function(r){const a=r?.[e]||t;return n.useMemo(()=>({[`__scope${e}`]:{...r,[e]:a}}),[r,a])}};return i.scopeName=e,[function(r,i){const s=n.createContext(i);s.displayName=r+"Context";const o=a.length;a=[...a,i];const c=r=>{const{scope:a,children:i,...c}=r,l=a?.[e]?.[o]||s,d=n.useMemo(()=>c,Object.values(c));return t(l.Provider,{value:d,children:i})};return c.displayName=r+"Provider",[c,function(t,a){const c=a?.[e]?.[o]||s,l=n.useContext(c);if(l)return l;if(void 0!==i)return i;throw new Error(`\`${t}\` must be used within \`${r}\``)}]},VN(i,...r)]}(tE),[nE,aE]=rE(tE),iE=n.forwardRef((e,r)=>{const{__scopeAvatar:a,...i}=e,[s,o]=n.useState("idle");return t(nE,{scope:a,imageLoadingStatus:s,onImageLoadingStatusChange:o,children:t(HN.span,{...i,ref:r})})});iE.displayName=tE;var sE="AvatarImage",oE=n.forwardRef((e,r)=>{const{__scopeAvatar:a,src:i,onLoadingStatusChange:s=()=>{},...o}=e,c=aE(sE,a),l=function(e,{referrerPolicy:t,crossOrigin:r}){const a=QN.useSyncExternalStore(eE,()=>!0,()=>!1),i=n.useRef(null),s=a?(i.current||(i.current=new window.Image),i.current):null,[o,c]=n.useState(()=>dE(s,e));return Hs(()=>{c(dE(s,e))},[s,e]),Hs(()=>{const e=e=>()=>{c(e)};if(!s)return;const n=e("loaded"),a=e("error");return s.addEventListener("load",n),s.addEventListener("error",a),t&&(s.referrerPolicy=t),"string"==typeof r&&(s.crossOrigin=r),()=>{s.removeEventListener("load",n),s.removeEventListener("error",a)}},[s,r,t]),o}(i,o),d=eo(e=>{s(e),c.onImageLoadingStatusChange(e)});return Hs(()=>{"idle"!==l&&d(l)},[l,d]),"loaded"===l?t(HN.img,{...o,ref:r,src:i}):null});oE.displayName=sE;var cE="AvatarFallback",lE=n.forwardRef((e,r)=>{const{__scopeAvatar:a,delayMs:i,...s}=e,o=aE(cE,a),[c,l]=n.useState(void 0===i);return n.useEffect(()=>{if(void 0!==i){const e=window.setTimeout(()=>l(!0),i);return()=>window.clearTimeout(e)}},[i]),c&&"loaded"!==o.imageLoadingStatus?t(HN.span,{...s,ref:r}):null});function dE(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}lE.displayName=cE;var uE=iE,pE=oE,mE=lE;const hE=n.forwardRef(({className:e,...r},n)=>t(uE,{ref:n,className:Oe("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...r}));hE.displayName=uE.displayName;const fE=n.forwardRef(({className:e,...r},n)=>t(pE,{ref:n,className:Oe("aspect-square h-full w-full",e),...r}));fE.displayName=pE.displayName;const gE=n.forwardRef(({className:e,...r},n)=>t(mE,{ref:n,className:Oe("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...r}));gE.displayName=mE.displayName;var bE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{const a=Rs(`Primitive.${r}`),i=n.forwardRef((e,n)=>{const{asChild:i,...s}=e,o=i?a:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t(o,{...s,ref:n})});return i.displayName=`Primitive.${r}`,{...e,[r]:i}},{}),vE="horizontal",yE=["horizontal","vertical"],wE=n.forwardRef((e,r)=>{const{decorative:n,orientation:a=vE,...i}=e,s=function(e){return yE.includes(e)}(a)?a:vE,o=n?{role:"none"}:{"aria-orientation":"vertical"===s?s:void 0,role:"separator"};return t(bE.div,{"data-orientation":s,...o,...i,ref:r})});wE.displayName="Separator";var xE=wE;const kE=n.forwardRef(({className:e,orientation:r="horizontal",decorative:n=!0,...a},i)=>t(xE,{ref:i,decorative:n,orientation:r,className:Oe("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",e),...a}));function SE(n){const{t:a,dir:i}=Cn(),{isAuthenticated:s,user:o}=ZC(),c=bt(Bn()),{workspaces:l,currentWorkspace:d,loading:p,refreshing:h,switchingToId:f,fetchWorkspaces:g,getFeatures:b,refreshWorkspaces:v,setCurrentWorkspace:y,switchToWorkspace:w}=jC(),{settings:x}=Vn(),[k,S]=m(!1),[C,N]=m(0),[E,A]=m(""),_=p||h;u(()=>{s&&c&&(0===l.length?(g(),b()):b())},[s,c]),u(()=>{s&&c&&C>0&&v()},[C,s,c]);const P=l,T=P.filter(e=>e._id!==d?._id).filter(e=>e.name.toLowerCase().includes(E.toLowerCase())),R=x?.workspace?.canCreateWorkspace??!0,D=x?.workspace?.showSwitcher??!0,I=x?.workspace?.maxWorkspacesPerUser??0,M=P?.filter(e=>("object"==typeof e.createdBy?e.createdBy._id?.toString():e.createdBy?.toString())===o?.id?.toString()).length??0,U=!1!==R&&(0===I||M<I);return u(()=>{!D&&l.length>0&&!d&&w(l[0]).catch(e=>{$e(e,{component:"WorkspaceProvider",action:"autoSelectWorkspace"})})},[D,l,d]),!D&&d?e(r,{children:[t("div",{onClick:()=>S(!0),children:n.trigger?.(_,d)}),t(VC,{workspace:d,open:k,onOpenChange:S,showTrigger:!1})]}):e(xl,{open:k,onOpenChange:S,children:[t(kl,{children:n.trigger?.(_,d)}),e(Nl,{dir:i,className:"max-w-2xl min-w-full sm:min-w-[800px]",children:[e(El,{dir:i,children:[e(Al,{className:"flex items-center gap-2",children:[t(Zi,{className:"h-5 w-5"}),a("workspace.switchTitle")]}),t(_l,{children:a("workspace.switchDescription")})]}),!o&&t("div",{className:"flex flex-col items-center justify-center h-full py-4 sm:py-8",children:t("div",{className:"text-sm font-medium text-muted-foreground",children:a("workspace.notLoggedIn")})}),o&&e("div",{dir:i,className:"flex flex-col gap-4",children:[d&&t(CE,{workspace:d,isCurrentWorkspace:!0,switchToWorkspace:w,switchingToId:f,onClose:()=>S(!1),setCurrentWorkspace:y,setOpen:S,workspacesToUse:P}),t(kE,{}),e("div",{children:[e("div",{className:"flex items-center justify-between",children:[t("div",{className:"text-sm font-medium text-muted-foreground",children:a("workspace.availableWorkspaces",{count:T.length})}),t("div",{children:t(Bs,{progress:h,disabled:h,variant:"ghost",onClick:function(){s&&c&&N(e=>e+1)},startIcon:t(ds,{}),children:a("settings.common.refreshAction",{loading:String(h)})})})]}),e("div",{className:"relative",children:[t(ps,{className:"absolute start-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),t(hb,{placeholder:a("workspace.searchPlaceholder"),value:E,onChange:e=>A(e.target.value),className:"ps-10"})]}),p?e("div",{className:"flex items-center justify-center py-8",children:[t(os,{className:"h-6 w-6 animate-spin text-muted-foreground"}),t("span",{className:"ms-2 text-sm text-muted-foreground",children:a("workspace.loadingWorkspaces")})]}):0===T.length?e("div",{className:"text-center py-8",children:[t(Zi,{className:"mx-auto h-12 w-12 text-muted-foreground"}),t("p",{className:"mt-2 text-sm text-muted-foreground",children:a(E?"workspace.noWorkspacesFound":"workspace.noWorkspacesAvailable")})]}):t(Zv,{className:"h-64",dir:i,children:t("div",{dir:i,className:"flex flex-col gap-2 my-2.5",children:T.map(e=>{const r=e._id===d?._id;return t(CE,{workspace:e,isCurrentWorkspace:r,switchToWorkspace:w,switchingToId:f,onClose:()=>S(!1),setCurrentWorkspace:y,setOpen:S,workspacesToUse:P},e._id)})})})]}),U&&e(r,{children:[t(kE,{}),t(NE,{onCreated:()=>{g()}})]})]})]})]})}function CE(r){const{t:n}=Cn(),{workspace:a,setCurrentWorkspace:i,setOpen:s,workspacesToUse:o,switchingToId:c}=r,l=r.isCurrentWorkspace??!1,d=c===a._id,u=a.subscription??null,p=null!=u&&"object"==typeof u?u.plan??null:null,m=p?.name??"";return e("div",{className:Oe("flex items-center gap-3 rounded-lg border-2 p-3 border-border",{"bg-muted text-muted-foreground":l}),children:[e(hE,{className:"h-8 w-8 flex items-center justify-center",children:[t("div",{children:t(fE,{src:a.image&&a.image.trim()?a.image:void 0})}),t(gE,{children:(h=a.name,h.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2))})]}),e("div",{className:"flex-1 min-w-0 max-w-full",children:[t("div",{className:"flex items-center gap-2",children:t("span",{className:"font-medium line-clamp-1 text-ellipsis overflow-hidden max-w-full",children:a.name})}),e("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[t(Cs,{className:"h-3 w-3"}),t("span",{children:n("workspace.membersCount",{count:a.users?.length||0})})]}),m&&t("div",{className:"max-w-fit",children:t("div",{className:"flex items-center gap-1 text-sm text-muted-foreground bg-green-500 text-white rounded-full px-2 py-0.5",children:t("span",{className:"text-xs",children:m})})})]}),e("div",{className:"flex items-center gap-2",children:[l?null:t(Bs,{size:"sm",disabled:null!==c||d,progress:d,onClick:()=>{r.switchToWorkspace(a).then(()=>s(!1)).catch(e=>{$e(e,{component:"WorkspaceItem",action:"switchToWorkspace",metadata:{workspaceId:a._id}})})},children:n("workspace.switchTo")}),t(VC,{workspace:a,onClose:()=>{if(l){const e=o.findIndex(e=>e._id?.toString()===a._id?.toString());-1!==e&&i(o[e])}}})]})]});var h}function NE(n){const{t:a,dir:i}=Cn(),{switching:s}=jC(),[o,c]=m(!1),[l,d]=m("emoji"),[u,p]=m("🏢"),[h,f]=m(!1),{createWorkspace:g}=jC(),b=_p({resolver:Of(Ug({name:cg().min(2,{message:a("workspace.workspaceNameMinLength")}),image:cg().optional()})),defaultValues:{name:"",image:""}});return e(xl,{open:o,onOpenChange:c,children:[t(kl,{asChild:!0,children:e(Bs,{className:"w-full rounded-none",disabled:s,children:[t(ls,{className:"h-4 w-4 me-2"}),a("workspace.createNew")]})}),e(Nl,{dir:i,className:"max-w-xl min-w-full sm:min-w-[600px]",children:[e(El,{children:[t(Al,{children:a("workspace.createTitle")}),t(_l,{children:a("workspace.createDescription")})]}),t(ab,{...b,children:e("form",{onSubmit:b.handleSubmit(async function(e){let t="";if("emoji"===l)t=Yv(u);else if("url"===l&&e.image)try{new URL(e.image),t=e.image}catch{return void b.setError("image",{message:a("workspace.invalidUrl")})}f(!0);try{await g(e.name,t),c(!1),b.reset(),p("🏢"),d("emoji"),n?.onCreated?.()}catch(t){$e(t,{component:"WorkspaceProvider",action:"createWorkspace",metadata:{name:e.name}})}finally{f(!1)}}),children:[t(sb,{control:b.control,name:"name",render:({field:r})=>e(lb,{children:[t(db,{children:a("workspace.workspaceName")}),t(ub,{children:t(hb,{placeholder:a("workspace.workspaceNamePlaceholder"),...r})}),t(mb,{})]})}),e("div",{className:"flex flex-col gap-y-2 my-2",children:[e("div",{children:[t(nb,{className:"text-sm font-medium",children:a("workspace.workspaceIcon")}),t(pb,{children:a("workspace.iconDescription")})]}),e(dv,{value:l,onValueChange:e=>d(e),className:"flex flex-col gap-y-2",children:[e("div",{className:"flex items-center gap-x-2 my-1",children:[t(uv,{value:"emoji",id:"emoji"}),e(nb,{htmlFor:"emoji",className:"flex items-center gap-2",children:[t(vs,{className:"h-4 w-4"}),a("workspace.chooseEmoji")]})]}),e("div",{className:"flex items-center gap-x-2 my-1",children:[t(uv,{value:"url",id:"url"}),e(nb,{htmlFor:"url",className:"flex items-center gap-2",children:[t(ss,{className:"h-4 w-4"}),a("workspace.customImageUrl")]})]})]}),"emoji"===l&&e("div",{className:"flex flex-col gap-y-2",children:[e("div",{className:"flex items-center gap-3",children:[t("span",{className:"text-sm font-medium",children:a("general.previewLabel")}),t("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:u})]}),t(Zv,{className:"h-32 w-full rounded-md border",children:t("div",{className:"p-4 grid grid-cols-8 gap-2",children:Xv.map((e,r)=>t("button",{type:"button",onClick:()=>(e=>{p(e),b.setValue("image",Yv(e))})(e),className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(u===e?"bg-primary text-primary-foreground":""),children:e},r))})})]}),"url"===l&&e("div",{className:"flex flex-col gap-y-2",children:[t(sb,{control:b.control,name:"image",render:({field:r})=>e(lb,{children:[t(db,{children:a("workspace.imageUrl")}),t(ub,{children:t(hb,{placeholder:a("workspace.imageUrlPlaceholder"),...r})}),t(pb,{children:a("workspace.imageUrlDescription")}),t(mb,{})]})}),b.watch("image")&&b.watch("image")?.trim()&&e("div",{className:"flex items-center gap-3",children:[t("span",{className:"text-sm font-medium",children:a("general.previewLabel")}),t("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:t("img",{src:b.watch("image")||void 0,alt:"Workspace preview",className:"w-full h-full object-cover",onError:e=>{e.currentTarget.style.display="none"}})})]})]})]}),e("div",{className:"flex justify-end gap-3 pt-4",children:[t(Bs,{type:"button",variant:"outline",onClick:()=>{c(!1),b.reset(),p("🏢"),d("emoji")},disabled:h,children:a("settings.common.cancel")}),t(Bs,{type:"submit",disabled:h,children:h?e(r,{children:[t(os,{className:"me-2 h-4 w-4 animate-spin"}),a("workspace.creating")]}):a("workspace.createWorkspace")})]})]})})]})]})}kE.displayName=xE.displayName;var EE=Object.freeze({__proto__:null,es:{settings:{titles:{profile:"Cuenta",general:"Configuración del espacio de trabajo",users:"Miembros del espacio de trabajo",subscription:"Plan y facturación",usage:"Uso",credits:"Créditos",features:"Funciones del espacio de trabajo",notifications:"Notificaciones",permissions:"Permisos",danger:"Zona de peligro"},sidebar:{account:"Cuenta",workspace:"Espacio de trabajo",profile:"Cuenta",general:"Configuración",users:"Miembros",subscription:"Plan y facturación",usage:"Uso",credits:"Créditos",features:"Funciones",notifications:"Notificaciones",permissions:"Permisos",danger:"Zona de peligro"},common:{refresh:"Actualizar",refreshing:"Actualizando...",retry:"Reintentar",retrying:"Reintentando...",save:"Guardar",saving:"Guardando...",cancel:"Cancelar",delete:"Eliminar",dismiss:"Descartar",loading:"Cargando...",success:"¡Éxito!",error:"Error",refreshAction:"{loading, select, true {Actualizando...} other {Actualizar}}",retryAction:"{loading, select, true {Reintentando...} other {Reintentar}}",noPermissionTitle:"Acceso restringido",noPermissionDescription:"No tienes permiso para acceder a esta sección. Contacta a un administrador del espacio de trabajo si necesitas acceso.",billingManageOnly:"Solo los usuarios con permisos de gestión de facturación pueden realizar esta acción."}},subscription:{managePlan:"Administra tu plan y facturación",changePlan:"Cambiar plan",viewPricingPlans:"Ver planes de precios",viewPlans:"Ver planes",upgradePlan:"Mejorar ahora",subscribe:"Suscribirse",currentPlan:"Plan actual",noSubscription:"No tienes una suscripción activa",choosePlan:"Elige tu plan",choosePlanDescription:"Compara los planes y selecciona el que mejor se adapte a tus necesidades",forWorkspace:"para {name}",planUpdateAvailable:"Actualización de plan disponible",updateSuccess:"¡Suscripción actualizada correctamente!",updateFailed:"Error en la actualización",cancelTitle:"Cancelar suscripción",cancelConfirm:"¿Estás seguro de que deseas cancelar tu suscripción?",cancelKeep:"Mantener suscripción",cancelButton:"Sí, cancelar suscripción",cancelTrialTitle:"Cancelar prueba",cancelTrialConfirm:"¿Estás seguro de que deseas cancelar tu período de prueba?",cancelTrialAccess:"Tu período de prueba continuará hasta",cancelTrialNoCharge:"No se te cobrará — tu período de prueba simplemente expirará",cancelTrialResume:"Puedes reanudar tu prueba en cualquier momento antes de que termine",cancelTrialKeep:"Mantener prueba",cancelTrialButton:"Sí, cancelar prueba",canceling:"Cancelando...",cancelSuccess:"La suscripción se cancelará al final del período de facturación.",cancelNotCharged:"No se te cobrará de nuevo después de la cancelación",cancelResumeAnytime:"Puedes reanudar tu suscripción en cualquier momento antes de que termine",resumeTitle:"Reanudar suscripción",resumeTrial:"Reanudar prueba",resumeConfirm:"¿Estás seguro de que deseas reanudar tu suscripción?",resumeKeep:"Mantener cancelada",resumeButton:"Sí, reanudar suscripción",resuming:"Reanudando...",resumeSuccess:"La suscripción ha sido reanudada.",managePayment:"Administrar pago",openingPortal:"Abriendo...",viewAllPlans:"Ver todos los planes",scheduledCancellation:"Cancelación de suscripción programada",scheduledTrialCancellation:"Cancelación de prueba programada",paymentPastDue:"Pago vencido",paymentPastDueDescription:"Por favor, actualiza tu método de pago para evitar la interrupción del servicio.",subscriptionPaused:"Suscripción pausada",subscriptionPausedDescription:"Tu suscripción está actualmente pausada. Reanúdala para restaurar el acceso completo.",errorLoading:"Error al cargar los datos de la suscripción",errorLoadingDescription:"Por favor, verifica tu conexión e inténtalo de nuevo.",errorProcessing:"Error al procesar la suscripción",errorCanceling:"Error al cancelar la suscripción",errorResuming:"Error al reanudar la suscripción",invalidWorkspace:"ID de espacio de trabajo no válido",billingInterval:{monthly:"Mensual",quarterly:"Trimestral",yearly:"Anual",perMonth:"/mes",perQuarter:"/trimestre",perYear:"/año"},seats:{title:"Puestos",members:"Miembros",included:"Incluidos",billable:"Facturables",perExtraSeat:"Por puesto adicional",limit:"Límite",includedSeats:"Puestos incluidos",maxSeats:"Máx. puestos",freeWithBase:"Gratis con el precio base",allIncluded:"Todos incluidos",extra:"adicional",unlimited:"Ilimitado"},items:{features:"Funciones",limits:"Límites",quotas:"Cuotas de uso",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month"},checkout:{upgrade:"Mejorar",downgrade:"Reducir",switchTo:"Cambiar a",select:"Seleccionar"},status:{active:"Activa",canceling:"Cancelando",trial:"Prueba",canceled:"Cancelada",pastDue:"Vencida",paused:"Pausada",deprecated:"Obsoleta",unknown:"Desconocida"},plan:"Plan",invoicesTab:"Facturas",changePlanButton:"Cambiar plan",noPlanAssigned:"Sin plan asignado",free:"Gratis",perSeatDisplay:"+ {price}/puesto{interval}",estTotalDisplay:"Total est.: {total}{interval} ({count, plural, one {# puesto adicional} other {# puestos adicionales}})",nextBillingDisplay:"Próxima facturación: {date}",membersInWorkspace:"{count, plural, one {# miembro} other {# miembros}} en el espacio de trabajo",billingInCurrency:"Facturación en {currency}",savingsPercent:"Ahorra {percent, number}%",switchToInterval:"Cambiar a {interval}",seatPriceDisplay:"+ {price}/puesto{interval} ({included} {includedLabel})",trialEnded:"Tu período de prueba ha terminado.",trialEndsIn:"Tu período de prueba termina en {days, plural, one {# día} other {# días}}.",onTrial:"Estás en un período de prueba.",upgradeToKeepAccess:"Mejora tu plan para mantener el acceso.",viewInvoices:"Ver facturas",cancelTrial:"Cancelar prueba",dunningFinal:"Última advertencia: La suscripción será suspendida",dunningSuspended:"Suscripción suspendida",dunningRecovery:"Recuperación de pago en curso",dunningSuspendedDescription:"Tu suscripción ha sido suspendida debido a fallos de pago repetidos. Actualiza tu método de pago para restaurar el acceso.",dunningRecoveryDescription:"No pudimos procesar tu pago. Por favor, actualiza tu método de pago para no perder el acceso.",cancelEndDescription:"Tu suscripción terminará el",trialEndDescription:"Tu período de prueba terminará el",cancelEndFallback:"Tu suscripción se cancelará al final del período de facturación actual. No se te cobrará de nuevo.",resumeChargeDate:"Se te cobrará de nuevo el",resumeChargeFallback:"la próxima fecha de facturación",resumeContinue:"Tu suscripción continuará automáticamente y se te facturará según tu plan",resumeCancelAnytime:"Puedes cancelar en cualquier momento antes de la próxima fecha de facturación si cambias de opinión",retainAccess:"Mantendrás acceso completo a este plan hasta",retainAccessFallback:"el final de tu período de facturación actual",noPlansAvailable:"No hay grupos de planes disponibles para este espacio de trabajo. Por favor, contacta a soporte si crees que esto es un error.",noPlansAvailableHint:"No hay grupos de planes disponibles para este espacio de trabajo.",startTrialDescription:"Prueba el plan completo sin compromiso. Puedes mejorar o cancelar en cualquier momento.",noSubscriptionDescription:"Elige un plan para comenzar con tu espacio de trabajo",startFreeTrial:"Comenzar prueba gratuita",startTrialDays:"Comenzar prueba gratuita de {days} días",trialBadge:"Prueba de {days} días"},users:{title:"Miembros del espacio de trabajo",adminOnly:"Solo el administrador del espacio de trabajo puede gestionar usuarios y roles.",inviteByEmail:"Invitar miembro por correo electrónico",inviteButton:"Invitar",inviting:"Invitando...",inviteSuccess:"Usuario invitado correctamente",emailRequired:"El correo electrónico es obligatorio",invalidEmail:"Formato de dirección de correo electrónico no válido",inviteFailed:"Error al invitar al miembro",seatLimitReached:"Límite de puestos alcanzado",memberLimitReached:"Límite de miembros alcanzado",role:"Rol",you:"Tú",owner:"Propietario",noMembers:"No se encontraron miembros en este espacio de trabajo.",extraSeatCost:"Cada miembro adicional añade {price}/{interval, select, yearly {año} quarterly {trim.} other {mes}} a tu suscripción",unknownUser:"Usuario desconocido",seats:"Puestos",members:"Miembros",included:"incluidos",perExtraSeat:"/puesto adicional",maxMembers:"máx. miembros",available:"disponibles",noMemberLimit:"Sin límite de miembros",seatHeading:"{hasSeatPricing, select, true {Puestos} other {Miembros}}",limitReached:"{reason, select, seat_limit_reached {Límite de puestos alcanzado} other {Límite de miembros alcanzado}}",memberCount:"{count, plural, one {# miembro} other {# miembros}}",subscriptionRequired:"Se requiere una suscripción para invitar miembros.",seatLimitMessage:"Tu plan permite hasta {maxUsers, number} miembros. Mejora tu plan para más puestos.",settingsLimitMessage:"Este espacio de trabajo permite hasta {maxUsers, number} miembros.",memberLimitMessage:"Límite de miembros de {maxUsers, number} alcanzado.",selectRole:"Seleccionar un rol",inviteAs:"Invitar como {role}"},invoices:{title:"Historial de facturación",description:"Ver y descargar tus facturas",pay:"Pagar",view:"Ver",viewDetails:"Ver detalles",download:"PDF",errorLoading:"Error al cargar las facturas",noInvoices:"Aún no hay facturas. Suscríbete a un plan para recibir facturas.",noInvoicesWithSub:"No se encontraron facturas con opción de descarga",paidAmount:"Pagado: {amount}",na:"N/D",status:{draft:"Borrador",open:"Abierta",paid:"Pagada",uncollectible:"Incobrable",void:"Anulada"}},usage:{title:"Uso",description:"Monitorea tu consumo de recursos y cuotas",totalResources:"Total de recursos",overallUsage:"Uso general",inOverage:"En exceso",estOverageCost:"Costo est. por exceso",overageDetected:"Exceso detectado",overageDescription:"El uso adicional se facturará como exceso en tu próxima factura.",overageUnits:"Unidades en exceso",rate:"Tarifa",billableBlocks:"Bloques facturables",estimatedCharge:"Cargo estimado",noData:"No hay datos de uso de cuotas disponibles para este espacio de trabajo.",noDataHint:"Las cuotas aparecerán aquí una vez que tu plan incluya recursos medidos.",used:"usado",remaining:"restante",overLimit:"sobre el límite",percentUsed:"{percent, number}% usado",availableRemaining:"{count} restantes",overLimitCount:"{count} sobre el límite",overageWarning:"{count, plural, one {# recurso ha excedido la cuota incluida.} other {# recursos han excedido la cuota incluida.}} El uso adicional se facturará como exceso en tu próxima factura.",fullyUsed:"Completamente usado",renewingSoon:"se renueva pronto",almostFull:"Casi lleno",overage:"Exceso",errorLoading:"Error al cargar los datos de uso",perUnit:"/ unidad",perUnits:"/ unidades",rateDisplay:"{rate} {unitSize, plural, =1 {/ unidad} other {/ {unitSize, number} unidades}}",resourcesExceeded:"{count, plural, one {# recurso ha excedido la cuota incluida.} other {# recursos han excedido la cuota incluida.}}",estOverageCharges:"Cargos estimados por exceso este período: {amount}",overageRateDisplay:"Tarifa de exceso: {rate}",resetDateDisplay:"El uso se restablece el {date}",daysRemainingDisplay:"{count, plural, one {# día restante} other {# días restantes}}"},profile:{email:"Correo electrónico",name:"Nombre",language:"Idioma",country:"País",currency:"Moneda",timezone:"Zona horaria",profileImage:"Imagen de perfil",success:"Perfil guardado correctamente",nameMinLength:"El nombre debe tener al menos 2 caracteres.",save:"Guardar",reset:"Restablecer"},general:{ownerOnly:"Solo el propietario del espacio de trabajo puede cambiar la configuración.",name:"Nombre",namePlaceholder:"Mi espacio de trabajo",nameMinLength:"El nombre del espacio de trabajo debe tener al menos 2 caracteres.",billingCurrency:"Moneda de facturación",icon:"Icono",iconDescription:"Elige un emoji o sube una imagen personalizada para tu espacio de trabajo.",imageUrl:"URL de imagen",imageUrlPlaceholder:"https://ejemplo.com/imagen.png",imageUrlDescription:"Introduce una URL válida para la imagen de tu espacio de trabajo. Compatible con formatos PNG, JPG y SVG.",previewLabel:"Vista previa:",success:"Configuración del espacio de trabajo guardada correctamente",chooseEmoji:"Elegir emoji",customImageUrl:"URL de imagen personalizada",updateWorkspace:"Actualizar espacio de trabajo"},features:{title:"Funciones del espacio de trabajo",ownerOnly:"Solo el propietario del espacio de trabajo puede cambiar las funciones.",noFeatures:"El espacio de trabajo no tiene funciones para gestionar.",enabled:"habilitada",disabled:"deshabilitada",enabling:"Habilitando",disabling:"Deshabilitando",featureSuccess:"correctamente",updateSuccess:"{feature} {enabled, select, true {habilitada} other {deshabilitada}} correctamente",actionStatus:"{action, select, enabling {Habilitando} disabling {Deshabilitando} other {}}"},danger:{title:"Eliminar espacio de trabajo",adminOnly:"Solo los administradores pueden eliminar espacios de trabajo.",deleteWorkspace:"Eliminar espacio de trabajo",deleteConfirm:"¿Estás completamente seguro?",deleteWarning:"Esta acción no se puede deshacer. Esto eliminará permanentemente el espacio de trabajo y todos los datos asociados.",deleting:"Eliminando...",deleteDescription:"Una vez que elimines un espacio de trabajo, no hay vuelta atrás. Esto eliminará permanentemente el espacio de trabajo y todos sus datos, incluidos miembros, configuración y funciones.",deleteConfirmDescription:"Esta acción no se puede deshacer. Esto eliminará permanentemente el espacio de trabajo y todos sus datos.",failedToDelete:"Error al eliminar el espacio de trabajo"},notifications:{title:"Preferencias de notificaciones",permissionDenied:"Permiso de notificaciones denegado",notSupported:"Las notificaciones push no son compatibles con este navegador.",manageDescription:"Administra cómo recibes notificaciones de este espacio de trabajo.",blocked:"Notificaciones bloqueadas",blockedDescription:"Previamente bloqueaste las notificaciones para este sitio. Para habilitarlas, actualiza la configuración de tu navegador:",pushTitle:"Notificaciones push",pushEnabledDescription:"Recibirás notificaciones del navegador para actualizaciones importantes.",pushDisabledDescription:"Recibe notificaciones sobre problemas de pago, expiración de prueba y otras actualizaciones importantes.",enabling:"Habilitando...",disabling:"Deshabilitando...",enable:"Habilitar",disable:"Deshabilitar",toggleAction:"{loading, select, true {{subscribed, select, true {Deshabilitando...} other {Habilitando...}}} other {{subscribed, select, true {Deshabilitar} other {Habilitar}}}}",pushDescription:"{subscribed, select, true {Recibirás notificaciones del navegador para actualizaciones importantes.} other {Recibe notificaciones sobre problemas de pago, expiración de prueba y otras actualizaciones importantes.}}",deviceNote:"Las notificaciones se envían a este dispositivo. Habilítalas en otros dispositivos por separado.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"Haz clic en el icono del candado (o del escudo) en la barra de direcciones",step2:'Busca "Notificaciones" en la lista de permisos',step3:'Cambia de "Bloqueado" a "Permitir"',step4:"Recarga esta página"},safari:{step1:"Abre Safari → Configuración → Sitios web → Notificaciones",step2:"Busca este sitio web en la lista",step3:'Cambia de "Denegar" a "Permitir"',step4:"Recarga esta página"},edge:{step1:"Haz clic en el icono del candado en la barra de direcciones",step2:'Haz clic en "Permisos para este sitio"',step3:'Configura "Notificaciones" como "Permitir"',step4:"Recarga esta página"},chrome:{step1:"Haz clic en el icono del candado (o del ajuste) en la barra de direcciones",step2:'Haz clic en "Configuración del sitio"',step3:'Configura "Notificaciones" como "Permitir"',step4:"Recarga esta página"}}},quota:{includedOnly:"{count, number} incluidos",includedWithOverage:"{count, number} incluidos, luego {price} / {unit}",includedHardLimit:"{count, number} incluidos (límite estricto)",unitFallback:"unidad"},pricing:{title:"Elige tu plan",description:"Compara los planes y selecciona el que mejor se adapte a tus necesidades",currency:"Moneda",billingIn:"Facturación en",noPlansCurrency:"No hay planes disponibles para tu moneda de facturación.",noPlansCurrencyHint:"Algo salió mal. Por favor, contacta a soporte.",noPlans:"No hay planes disponibles",free:"Gratis",included:"incluido",save:"Ahorra",current:"Actual",processing:"Procesando...",unavailable:"No disponible",selectCurrency:"Seleccionar moneda de facturación",billingInterval:"Intervalo de facturación"},beta:{nameLabel:"Nombre",emailLabel:"Correo electrónico",submitText:"Enviar",submittingText:"Enviando...",errorMessage:"Ocurrió un error",tryAgain:"Intentar de nuevo",privacyConsent:"Al enviar este formulario, aceptas nuestra",privacyPolicy:"Política de privacidad",and:"y",termsOfService:"Términos de servicio"},workspace:{switchTitle:"Cambiar espacio de trabajo",switchDescription:"Selecciona un espacio de trabajo o crea uno nuevo.",notLoggedIn:"Parece que no has iniciado sesión. Por favor, inicia sesión para continuar.",availableWorkspaces:"Espacios de trabajo disponibles ({count, number})",loadingWorkspaces:"Cargando espacios de trabajo...",searchPlaceholder:"Buscar espacios de trabajo...",noWorkspacesFound:"No se encontraron espacios de trabajo",noWorkspacesAvailable:"No hay espacios de trabajo disponibles",switchTo:"Cambiar a",membersCount:"{count, plural, one {# miembro} other {# miembros}}",createNew:"Crear nuevo espacio de trabajo",createTitle:"Crear nuevo espacio de trabajo",createDescription:"Crea un nuevo espacio de trabajo para comenzar.",workspaceName:"Nombre del espacio de trabajo",workspaceNamePlaceholder:"Mi espacio de trabajo",workspaceNameMinLength:"El nombre del espacio de trabajo debe tener al menos 2 caracteres.",workspaceIcon:"Icono del espacio de trabajo",iconDescription:"Elige un emoji o sube una imagen personalizada para tu espacio de trabajo.",chooseEmoji:"Elegir emoji",customImageUrl:"URL de imagen personalizada",imageUrl:"URL de imagen",imageUrlPlaceholder:"https://ejemplo.com/imagen.png",imageUrlDescription:"Introduce una URL válida para la imagen de tu espacio de trabajo. Compatible con formatos PNG, JPG y SVG.",invalidUrl:"Por favor, introduce una URL válida",creating:"Creando...",createWorkspace:"Crear espacio de trabajo"},dropdowns:{search:"Buscar...",chooseOption:"Elegir opción",chooseCountry:"Elegir país",searchCountry:"Elegir país...",chooseLanguage:"Elegir idioma",searchLanguage:"Elegir idioma...",chooseCurrency:"Elegir moneda",searchCurrency:"Elegir moneda...",chooseTimezone:"Elegir zona horaria",searchTimezone:"Elegir zona horaria..."},push:{failedToSubscribe:"Error al suscribirse a las notificaciones push",failedToUnsubscribe:"Error al cancelar la suscripción a las notificaciones push"},permissions:{title:"Permisos",description:"Configura lo que cada rol puede hacer en este espacio de trabajo.",ownerOnly:"Solo el propietario del espacio de trabajo puede gestionar los permisos.",save:"Guardar permisos",saving:"Guardando...",saveSuccess:"Permisos guardados correctamente"},credits:{title:"Créditos",description:"Los créditos se pueden usar para acciones premium como la generación con IA.",balance:"Saldo de créditos",available:"Disponible",totalGranted:"Total otorgado",totalConsumed:"Total consumido",totalExpired:"Total expirado",noCredits:"Aún no hay créditos",noCreditsHint:"Los créditos aparecerán aquí cuando sean otorgados por tu plan o comprados.",buyCredits:"Comprar créditos",buyAmount:"Buy {count} Credits",purchasing:"Redirigiendo...",packages:"Paquetes de créditos",noPackages:"No hay paquetes de créditos disponibles.",creditsAmount:"{count} créditos",validityDays:"Válido por {count} días",validityUnlimited:"Sin expiración",transactions:"Transacciones recientes",noTransactions:"Aún no hay transacciones.",loadMore:"Load More",viewAll:"Ver todo",expiringSoon:"Próximos a expirar",expiringInDays:"{count} créditos expiran dentro de {days} días",noExpiring:"No hay créditos próximos a expirar.",type:{plan_grant:"Otorgado por el plan",pack_purchased:"Comprado",consumed:"Consumido",expired:"Expirado",admin_grant:"Otorgado",admin_revoke:"Revocado",refund:"Reembolso"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"¡Créditos comprados correctamente! Tu saldo ha sido actualizado.",purchaseCanceled:"La compra de créditos fue cancelada. No se realizaron cargos.",purchaseFailed:"La compra de créditos falló. Por favor, inténtalo de nuevo o contacta a soporte.",errorLoading:"Error al cargar los datos de créditos",insufficientCredits:"Créditos insuficientes"},errors:{networkError:"Error de red: Por favor, verifica tu conexión a internet",unauthorized:"No autorizado — Por favor, verifica tu sesión",notFound:"Recurso no encontrado",generic:"Ocurrió un error",fetchPlans:"Error al obtener los planes",fetchPlanGroup:"Error al obtener el grupo de planes",fetchPlanGroupVersion:"Error al obtener la versión del grupo de planes",fetchPlanGroupVersions:"Error al obtener las versiones del grupo de planes",fetchSubscription:"Error al obtener la suscripción",createCheckout:"Error al crear la sesión de pago",updateSubscription:"Error al actualizar la suscripción",fetchInvoices:"Error al obtener las facturas",fetchInvoice:"Error al obtener la factura",openBillingPortal:"Error al abrir el portal de facturación",cancelSubscription:"Error al cancelar la suscripción",resumeSubscription:"Error al reanudar la suscripción",recordUsage:"Error al registrar el uso",fetchQuotaUsage:"Error al obtener el estado de uso de cuotas",fetchAllQuotaUsage:"Error al obtener todo el uso de cuotas",fetchUsageLogs:"Error al obtener los registros de uso",fetchCreditBalance:"Error al obtener el saldo de créditos",consumeCredits:"Error al consumir créditos",purchaseCredits:"Error al comprar créditos",fetchCreditPackages:"Error al obtener los paquetes de créditos",fetchCreditTransactions:"Error al obtener las transacciones de créditos",fetchExpiringCredits:"Error al obtener los créditos próximos a expirar"}}});var AE=Object.freeze({__proto__:null,fr:{settings:{titles:{profile:"Compte",general:"Paramètres de l'espace de travail",users:"Membres de l'espace de travail",subscription:"Plan et facturation",usage:"Utilisation",credits:"Crédits",features:"Fonctionnalités de l'espace de travail",notifications:"Notifications",permissions:"Permissions",danger:"Zone de danger"},sidebar:{account:"Compte",workspace:"Espace de travail",profile:"Compte",general:"Paramètres",users:"Membres",subscription:"Plan et facturation",usage:"Utilisation",credits:"Crédits",features:"Fonctionnalités",notifications:"Notifications",permissions:"Permissions",danger:"Zone de danger"},common:{refresh:"Actualiser",refreshing:"Actualisation...",retry:"Réessayer",retrying:"Nouvelle tentative...",save:"Enregistrer",saving:"Enregistrement...",cancel:"Annuler",delete:"Supprimer",dismiss:"Ignorer",loading:"Chargement...",success:"Succès !",error:"Erreur",refreshAction:"{loading, select, true {Actualisation...} other {Actualiser}}",retryAction:"{loading, select, true {Nouvelle tentative...} other {Réessayer}}",noPermissionTitle:"Accès restreint",noPermissionDescription:"Vous n'avez pas la permission d'accéder à cette section. Contactez un administrateur de l'espace de travail si vous avez besoin d'un accès.",billingManageOnly:"Seuls les utilisateurs disposant des autorisations de gestion de la facturation peuvent effectuer cette action."}},subscription:{managePlan:"Gérez votre plan et votre facturation",changePlan:"Changer de plan",viewPricingPlans:"Voir les plans tarifaires",viewPlans:"Voir les plans",upgradePlan:"Mettre à niveau",subscribe:"S'abonner",currentPlan:"Plan actuel",noSubscription:"Vous n'avez pas d'abonnement actif",choosePlan:"Choisissez votre plan",choosePlanDescription:"Comparez les plans et sélectionnez celui qui correspond à vos besoins",forWorkspace:"pour {name}",planUpdateAvailable:"Mise à jour du plan disponible",updateSuccess:"Abonnement mis à jour avec succès !",updateFailed:"Échec de la mise à jour",cancelTitle:"Annuler l'abonnement",cancelConfirm:"Êtes-vous sûr de vouloir annuler votre abonnement ?",cancelKeep:"Conserver l'abonnement",cancelButton:"Oui, annuler l'abonnement",cancelTrialTitle:"Annuler l'essai",cancelTrialConfirm:"Êtes-vous sûr de vouloir annuler votre période d'essai ?",cancelTrialAccess:"Votre période d'essai continuera jusqu'au",cancelTrialNoCharge:"Vous ne serez pas facturé — votre période d'essai expirera simplement",cancelTrialResume:"Vous pouvez reprendre votre essai à tout moment avant qu'il ne se termine",cancelTrialKeep:"Conserver l'essai",cancelTrialButton:"Oui, annuler l'essai",canceling:"Annulation...",cancelSuccess:"L'abonnement sera annulé à la fin de la période de facturation.",cancelNotCharged:"Vous ne serez plus facturé après l'annulation",cancelResumeAnytime:"Vous pouvez reprendre votre abonnement à tout moment avant qu'il ne se termine",resumeTitle:"Reprendre l'abonnement",resumeTrial:"Reprendre l'essai",resumeConfirm:"Êtes-vous sûr de vouloir reprendre votre abonnement ?",resumeKeep:"Maintenir annulé",resumeButton:"Oui, reprendre l'abonnement",resuming:"Reprise...",resumeSuccess:"L'abonnement a été repris.",managePayment:"Gérer le paiement",openingPortal:"Ouverture...",viewAllPlans:"Voir tous les plans",scheduledCancellation:"Annulation de l'abonnement programmée",scheduledTrialCancellation:"Annulation de l'essai programmée",paymentPastDue:"Paiement en retard",paymentPastDueDescription:"Veuillez mettre à jour votre moyen de paiement pour éviter une interruption de service.",subscriptionPaused:"Abonnement suspendu",subscriptionPausedDescription:"Votre abonnement est actuellement suspendu. Reprenez-le pour restaurer l'accès complet.",errorLoading:"Erreur lors du chargement des données d'abonnement",errorLoadingDescription:"Veuillez vérifier votre connexion et réessayer.",errorProcessing:"Échec du traitement de l'abonnement",errorCanceling:"Échec de l'annulation de l'abonnement",errorResuming:"Échec de la reprise de l'abonnement",invalidWorkspace:"ID d'espace de travail invalide",billingInterval:{monthly:"Mensuel",quarterly:"Trimestriel",yearly:"Annuel",perMonth:"/mois",perQuarter:"/trimestre",perYear:"/an"},seats:{title:"Sièges",members:"Membres",included:"Inclus",billable:"Facturables",perExtraSeat:"Par siège supplémentaire",limit:"Limite",includedSeats:"Sièges inclus",maxSeats:"Sièges max.",freeWithBase:"Gratuit avec le prix de base",allIncluded:"Tous inclus",extra:"supplémentaire",unlimited:"Illimité"},items:{features:"Fonctionnalités",limits:"Limites",quotas:"Quotas d'utilisation",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month"},checkout:{upgrade:"Mettre à niveau",downgrade:"Rétrograder",switchTo:"Passer à",select:"Sélectionner"},status:{active:"Actif",canceling:"En annulation",trial:"Essai",canceled:"Annulé",pastDue:"En retard",paused:"Suspendu",deprecated:"Obsolète",unknown:"Inconnu"},plan:"Plan",invoicesTab:"Factures",changePlanButton:"Changer de plan",noPlanAssigned:"Aucun plan attribué",free:"Gratuit",perSeatDisplay:"+ {price}/siège{interval}",estTotalDisplay:"Total est. : {total}{interval} ({count, plural, one {# siège supplémentaire} other {# sièges supplémentaires}})",nextBillingDisplay:"Prochaine facturation : {date}",membersInWorkspace:"{count, plural, one {# membre} other {# membres}} dans l'espace de travail",billingInCurrency:"Facturation en {currency}",savingsPercent:"Économisez {percent, number}%",switchToInterval:"Passer à {interval}",seatPriceDisplay:"+ {price}/siège{interval} ({included} {includedLabel})",trialEnded:"Votre période d'essai est terminée.",trialEndsIn:"Votre période d'essai se termine dans {days, plural, one {# jour} other {# jours}}.",onTrial:"Vous êtes en période d'essai.",upgradeToKeepAccess:"Mettez à niveau pour conserver l'accès.",viewInvoices:"Voir les factures",cancelTrial:"Annuler l'essai",dunningFinal:"Dernier avertissement : l'abonnement sera suspendu",dunningSuspended:"Abonnement suspendu",dunningRecovery:"Récupération de paiement en cours",dunningSuspendedDescription:"Votre abonnement a été suspendu en raison d'échecs de paiement répétés. Mettez à jour votre moyen de paiement pour restaurer l'accès.",dunningRecoveryDescription:"Nous n'avons pas pu traiter votre paiement. Veuillez mettre à jour votre moyen de paiement pour ne pas perdre l'accès.",cancelEndDescription:"Votre abonnement prendra fin le",trialEndDescription:"Votre période d'essai prendra fin le",cancelEndFallback:"Votre abonnement sera annulé à la fin de la période de facturation en cours. Vous ne serez plus facturé.",resumeChargeDate:"Vous serez de nouveau facturé le",resumeChargeFallback:"la prochaine date de facturation",resumeContinue:"Votre abonnement continuera automatiquement et vous serez facturé selon votre plan",resumeCancelAnytime:"Vous pouvez annuler à tout moment avant la prochaine date de facturation si vous changez d'avis",retainAccess:"Vous conserverez l'accès complet à ce plan jusqu'au",retainAccessFallback:"la fin de votre période de facturation actuelle",noPlansAvailable:"Aucun groupe de plans n'est disponible pour cet espace de travail. Veuillez contacter le support si vous pensez qu'il s'agit d'une erreur.",noPlansAvailableHint:"Aucun groupe de plans n'est disponible pour cet espace de travail.",startTrialDescription:"Essayez le plan complet sans engagement. Vous pouvez mettre à niveau ou annuler à tout moment.",noSubscriptionDescription:"Choisissez un plan pour commencer avec votre espace de travail",startFreeTrial:"Commencer l'essai gratuit",startTrialDays:"Commencer l'essai gratuit de {days} jours",trialBadge:"Essai de {days} jours"},users:{title:"Membres de l'espace de travail",adminOnly:"Seul l'administrateur de l'espace de travail peut gérer les utilisateurs et les rôles.",inviteByEmail:"Inviter un membre par e-mail",inviteButton:"Inviter",inviting:"Invitation...",inviteSuccess:"Utilisateur invité avec succès",emailRequired:"L'adresse e-mail est obligatoire",invalidEmail:"Format d'adresse e-mail invalide",inviteFailed:"Échec de l'invitation du membre",seatLimitReached:"Limite de sièges atteinte",memberLimitReached:"Limite de membres atteinte",role:"Rôle",you:"Vous",owner:"Propriétaire",noMembers:"Aucun membre trouvé dans cet espace de travail.",extraSeatCost:"Chaque membre supplémentaire ajoute {price}/{interval, select, yearly {an} quarterly {trim.} other {mois}} à votre abonnement",unknownUser:"Utilisateur inconnu",seats:"Sièges",members:"Membres",included:"inclus",perExtraSeat:"/siège supplémentaire",maxMembers:"membres max.",available:"disponibles",noMemberLimit:"Pas de limite de membres",seatHeading:"{hasSeatPricing, select, true {Sièges} other {Membres}}",limitReached:"{reason, select, seat_limit_reached {Limite de sièges atteinte} other {Limite de membres atteinte}}",memberCount:"{count, plural, one {# membre} other {# membres}}",subscriptionRequired:"Un abonnement est requis pour inviter des membres.",seatLimitMessage:"Votre plan autorise jusqu'à {maxUsers, number} membres. Mettez à niveau pour plus de sièges.",settingsLimitMessage:"Cet espace de travail autorise jusqu'à {maxUsers, number} membres.",memberLimitMessage:"Limite de membres de {maxUsers, number} atteinte.",selectRole:"Sélectionner un rôle",inviteAs:"Inviter en tant que {role}"},invoices:{title:"Historique de facturation",description:"Consultez et téléchargez vos factures",pay:"Payer",view:"Voir",viewDetails:"Voir les détails",download:"PDF",errorLoading:"Erreur lors du chargement des factures",noInvoices:"Pas encore de factures. Abonnez-vous à un plan pour recevoir des factures.",noInvoicesWithSub:"Aucune facture avec option de téléchargement trouvée",paidAmount:"Payé : {amount}",na:"N/D",status:{draft:"Brouillon",open:"Ouverte",paid:"Payée",uncollectible:"Irrécouvrable",void:"Annulée"}},usage:{title:"Utilisation",description:"Surveillez votre consommation de ressources et vos quotas",totalResources:"Total des ressources",overallUsage:"Utilisation globale",inOverage:"En dépassement",estOverageCost:"Coût est. de dépassement",overageDetected:"Dépassement détecté",overageDescription:"L'utilisation supplémentaire sera facturée en dépassement sur votre prochaine facture.",overageUnits:"Unités en dépassement",rate:"Tarif",billableBlocks:"Blocs facturables",estimatedCharge:"Charge estimée",noData:"Aucune donnée d'utilisation de quotas disponible pour cet espace de travail.",noDataHint:"Les quotas apparaîtront ici une fois que votre plan inclura des ressources mesurées.",used:"utilisé",remaining:"restant",overLimit:"au-dessus de la limite",percentUsed:"{percent, number}% utilisé",availableRemaining:"{count} restants",overLimitCount:"{count} au-dessus de la limite",overageWarning:"{count, plural, one {# ressource a dépassé le quota inclus.} other {# ressources ont dépassé le quota inclus.}} L'utilisation supplémentaire sera facturée en dépassement sur votre prochaine facture.",fullyUsed:"Entièrement utilisé",renewingSoon:"renouvellement imminent",almostFull:"Presque plein",overage:"Dépassement",errorLoading:"Échec du chargement des données d'utilisation",perUnit:"/ unité",perUnits:"/ unités",rateDisplay:"{rate} {unitSize, plural, =1 {/ unité} other {/ {unitSize, number} unités}}",resourcesExceeded:"{count, plural, one {# ressource a dépassé le quota inclus.} other {# ressources ont dépassé le quota inclus.}}",estOverageCharges:"Charges de dépassement estimées pour cette période : {amount}",overageRateDisplay:"Tarif de dépassement : {rate}",resetDateDisplay:"L'utilisation se réinitialise le {date}",daysRemainingDisplay:"{count, plural, one {# jour restant} other {# jours restants}}"},profile:{email:"E-mail",name:"Nom",language:"Langue",country:"Pays",currency:"Devise",timezone:"Fuseau horaire",profileImage:"Image de profil",success:"Profil enregistré avec succès",nameMinLength:"Le nom doit comporter au moins 2 caractères.",save:"Enregistrer",reset:"Réinitialiser"},general:{ownerOnly:"Seul le propriétaire de l'espace de travail peut modifier les paramètres.",name:"Nom",namePlaceholder:"Mon espace de travail",nameMinLength:"Le nom de l'espace de travail doit comporter au moins 2 caractères.",billingCurrency:"Devise de facturation",icon:"Icône",iconDescription:"Choisissez un emoji ou téléchargez une image personnalisée pour votre espace de travail.",imageUrl:"URL de l'image",imageUrlPlaceholder:"https://exemple.com/image.png",imageUrlDescription:"Entrez une URL valide pour l'image de votre espace de travail. Formats pris en charge : PNG, JPG et SVG.",previewLabel:"Aperçu :",success:"Paramètres de l'espace de travail enregistrés avec succès",chooseEmoji:"Choisir un emoji",customImageUrl:"URL d'image personnalisée",updateWorkspace:"Mettre à jour l'espace de travail"},features:{title:"Fonctionnalités de l'espace de travail",ownerOnly:"Seul le propriétaire de l'espace de travail peut modifier les fonctionnalités.",noFeatures:"L'espace de travail n'a pas de fonctionnalités à gérer.",enabled:"activée",disabled:"désactivée",enabling:"Activation",disabling:"Désactivation",featureSuccess:"avec succès",updateSuccess:"{feature} {enabled, select, true {activée} other {désactivée}} avec succès",actionStatus:"{action, select, enabling {Activation} disabling {Désactivation} other {}}"},danger:{title:"Supprimer l'espace de travail",adminOnly:"Seuls les administrateurs peuvent supprimer les espaces de travail.",deleteWorkspace:"Supprimer l'espace de travail",deleteConfirm:"Êtes-vous absolument sûr ?",deleteWarning:"Cette action est irréversible. Cela supprimera définitivement l'espace de travail et toutes les données associées.",deleting:"Suppression...",deleteDescription:"Une fois l'espace de travail supprimé, il n'y a pas de retour en arrière. Cela supprimera définitivement l'espace de travail et toutes ses données, y compris les membres, les paramètres et les fonctionnalités.",deleteConfirmDescription:"Cette action est irréversible. Cela supprimera définitivement l'espace de travail et toutes ses données.",failedToDelete:"Échec de la suppression de l'espace de travail"},notifications:{title:"Préférences de notifications",permissionDenied:"Autorisation de notifications refusée",notSupported:"Les notifications push ne sont pas prises en charge par ce navigateur.",manageDescription:"Gérez la façon dont vous recevez les notifications de cet espace de travail.",blocked:"Notifications bloquées",blockedDescription:"Vous avez précédemment bloqué les notifications pour ce site. Pour les activer, mettez à jour les paramètres de votre navigateur :",pushTitle:"Notifications push",pushEnabledDescription:"Vous recevrez des notifications du navigateur pour les mises à jour importantes.",pushDisabledDescription:"Recevez des notifications concernant les problèmes de paiement, l'expiration de l'essai et d'autres mises à jour importantes.",enabling:"Activation...",disabling:"Désactivation...",enable:"Activer",disable:"Désactiver",toggleAction:"{loading, select, true {{subscribed, select, true {Désactivation...} other {Activation...}}} other {{subscribed, select, true {Désactiver} other {Activer}}}}",pushDescription:"{subscribed, select, true {Vous recevrez des notifications du navigateur pour les mises à jour importantes.} other {Recevez des notifications concernant les problèmes de paiement, l'expiration de l'essai et d'autres mises à jour importantes.}}",deviceNote:"Les notifications sont envoyées à cet appareil. Activez-les sur vos autres appareils séparément.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"Cliquez sur l'icône du cadenas (ou du bouclier) dans la barre d'adresse",step2:'Trouvez "Notifications" dans la liste des autorisations',step3:'Changez de "Bloqué" à "Autoriser"',step4:"Rechargez cette page"},safari:{step1:"Ouvrez Safari → Réglages → Sites web → Notifications",step2:"Trouvez ce site web dans la liste",step3:'Changez de "Refuser" à "Autoriser"',step4:"Rechargez cette page"},edge:{step1:"Cliquez sur l'icône du cadenas dans la barre d'adresse",step2:'Cliquez sur "Autorisations pour ce site"',step3:'Réglez "Notifications" sur "Autoriser"',step4:"Rechargez cette page"},chrome:{step1:"Cliquez sur l'icône du cadenas (ou de réglage) dans la barre d'adresse",step2:'Cliquez sur "Paramètres du site"',step3:'Réglez "Notifications" sur "Autoriser"',step4:"Rechargez cette page"}}},quota:{includedOnly:"{count, number} inclus",includedWithOverage:"{count, number} inclus, puis {price} / {unit}",includedHardLimit:"{count, number} inclus (limite stricte)",unitFallback:"unité"},pricing:{title:"Choisissez votre plan",description:"Comparez les plans et sélectionnez celui qui correspond à vos besoins",currency:"Devise",billingIn:"Facturation en",noPlansCurrency:"Aucun plan disponible pour votre devise de facturation.",noPlansCurrencyHint:"Une erreur s'est produite. Veuillez contacter le support.",noPlans:"Aucun plan disponible",free:"Gratuit",included:"inclus",save:"Économisez",current:"Actuel",processing:"Traitement...",unavailable:"Indisponible",selectCurrency:"Sélectionner la devise de facturation",billingInterval:"Intervalle de facturation"},beta:{nameLabel:"Nom",emailLabel:"E-mail",submitText:"Envoyer",submittingText:"Envoi...",errorMessage:"Une erreur s'est produite",tryAgain:"Réessayer",privacyConsent:"En soumettant ce formulaire, vous acceptez notre",privacyPolicy:"Politique de confidentialité",and:"et",termsOfService:"Conditions d'utilisation"},workspace:{switchTitle:"Changer d'espace de travail",switchDescription:"Sélectionnez un espace de travail ou créez-en un nouveau.",notLoggedIn:"Il semble que vous n'êtes pas connecté. Veuillez vous connecter pour continuer.",availableWorkspaces:"Espaces de travail disponibles ({count, number})",loadingWorkspaces:"Chargement des espaces de travail...",searchPlaceholder:"Rechercher des espaces de travail...",noWorkspacesFound:"Aucun espace de travail trouvé",noWorkspacesAvailable:"Aucun espace de travail disponible",switchTo:"Passer à",membersCount:"{count, plural, one {# membre} other {# membres}}",createNew:"Créer un nouvel espace de travail",createTitle:"Créer un nouvel espace de travail",createDescription:"Créez un nouvel espace de travail pour commencer.",workspaceName:"Nom de l'espace de travail",workspaceNamePlaceholder:"Mon espace de travail",workspaceNameMinLength:"Le nom de l'espace de travail doit comporter au moins 2 caractères.",workspaceIcon:"Icône de l'espace de travail",iconDescription:"Choisissez un emoji ou téléchargez une image personnalisée pour votre espace de travail.",chooseEmoji:"Choisir un emoji",customImageUrl:"URL d'image personnalisée",imageUrl:"URL de l'image",imageUrlPlaceholder:"https://exemple.com/image.png",imageUrlDescription:"Entrez une URL valide pour l'image de votre espace de travail. Formats pris en charge : PNG, JPG et SVG.",invalidUrl:"Veuillez entrer une URL valide",creating:"Création...",createWorkspace:"Créer l'espace de travail"},dropdowns:{search:"Rechercher...",chooseOption:"Choisir une option",chooseCountry:"Choisir un pays",searchCountry:"Choisir un pays...",chooseLanguage:"Choisir une langue",searchLanguage:"Choisir une langue...",chooseCurrency:"Choisir une devise",searchCurrency:"Choisir une devise...",chooseTimezone:"Choisir un fuseau horaire",searchTimezone:"Choisir un fuseau horaire..."},push:{failedToSubscribe:"Échec de l'abonnement aux notifications push",failedToUnsubscribe:"Échec de la désinscription des notifications push"},permissions:{title:"Permissions",description:"Configurez ce que chaque rôle peut faire dans cet espace de travail.",ownerOnly:"Seul le propriétaire de l'espace de travail peut gérer les permissions.",save:"Enregistrer les permissions",saving:"Enregistrement...",saveSuccess:"Permissions enregistrées avec succès"},credits:{title:"Crédits",description:"Les crédits peuvent être utilisés pour des actions premium comme la génération par IA.",balance:"Solde de crédits",available:"Disponible",totalGranted:"Total accordé",totalConsumed:"Total consommé",totalExpired:"Total expiré",noCredits:"Pas encore de crédits",noCreditsHint:"Les crédits apparaîtront ici lorsqu'ils seront accordés par votre plan ou achetés.",buyCredits:"Acheter des crédits",buyAmount:"Buy {count} Credits",purchasing:"Redirection...",packages:"Packs de crédits",noPackages:"Aucun pack de crédits disponible.",creditsAmount:"{count} crédits",validityDays:"Valable {count} jours",validityUnlimited:"Sans expiration",transactions:"Transactions récentes",noTransactions:"Pas encore de transactions.",loadMore:"Load More",viewAll:"Tout voir",expiringSoon:"Expiration imminente",expiringInDays:"{count} crédits expirent dans {days} jours",noExpiring:"Aucun crédit n'expire prochainement.",type:{plan_grant:"Octroi du plan",pack_purchased:"Acheté",consumed:"Consommé",expired:"Expiré",admin_grant:"Accordé",admin_revoke:"Révoqué",refund:"Remboursement"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"Crédits achetés avec succès ! Votre solde a été mis à jour.",purchaseCanceled:"L'achat de crédits a été annulé. Aucun frais n'a été facturé.",purchaseFailed:"L'achat de crédits a échoué. Veuillez réessayer ou contacter le support.",errorLoading:"Échec du chargement des données de crédits",insufficientCredits:"Crédits insuffisants"},errors:{networkError:"Erreur réseau : Veuillez vérifier votre connexion Internet",unauthorized:"Non autorisé — Veuillez vérifier votre session",notFound:"Ressource introuvable",generic:"Une erreur s'est produite",fetchPlans:"Échec de la récupération des plans",fetchPlanGroup:"Échec de la récupération du groupe de plans",fetchPlanGroupVersion:"Échec de la récupération de la version du groupe de plans",fetchPlanGroupVersions:"Échec de la récupération des versions du groupe de plans",fetchSubscription:"Échec de la récupération de l'abonnement",createCheckout:"Échec de la création de la session de paiement",updateSubscription:"Échec de la mise à jour de l'abonnement",fetchInvoices:"Échec de la récupération des factures",fetchInvoice:"Échec de la récupération de la facture",openBillingPortal:"Échec de l'ouverture du portail de facturation",cancelSubscription:"Échec de l'annulation de l'abonnement",resumeSubscription:"Échec de la reprise de l'abonnement",recordUsage:"Échec de l'enregistrement de l'utilisation",fetchQuotaUsage:"Échec de la récupération du statut d'utilisation des quotas",fetchAllQuotaUsage:"Échec de la récupération de toute l'utilisation des quotas",fetchUsageLogs:"Échec de la récupération des journaux d'utilisation",fetchCreditBalance:"Échec de la récupération du solde de crédits",consumeCredits:"Échec de la consommation des crédits",purchaseCredits:"Échec de l'achat de crédits",fetchCreditPackages:"Échec de la récupération des packs de crédits",fetchCreditTransactions:"Échec de la récupération des transactions de crédits",fetchExpiringCredits:"Échec de la récupération des crédits expirant bientôt"}}});var _E=Object.freeze({__proto__:null,de:{settings:{titles:{profile:"Konto",general:"Arbeitsbereich-Einstellungen",users:"Arbeitsbereich-Mitglieder",subscription:"Plan & Abrechnung",usage:"Nutzung",credits:"Guthaben",features:"Arbeitsbereich-Funktionen",notifications:"Benachrichtigungen",permissions:"Berechtigungen",danger:"Gefahrenzone"},sidebar:{account:"Konto",workspace:"Arbeitsbereich",profile:"Konto",general:"Einstellungen",users:"Mitglieder",subscription:"Plan & Abrechnung",usage:"Nutzung",credits:"Guthaben",features:"Funktionen",notifications:"Benachrichtigungen",permissions:"Berechtigungen",danger:"Gefahrenzone"},common:{refresh:"Aktualisieren",refreshing:"Wird aktualisiert...",retry:"Erneut versuchen",retrying:"Wird erneut versucht...",save:"Speichern",saving:"Wird gespeichert...",cancel:"Abbrechen",delete:"Löschen",dismiss:"Verwerfen",loading:"Wird geladen...",success:"Erfolg!",error:"Fehler",refreshAction:"{loading, select, true {Wird aktualisiert...} other {Aktualisieren}}",retryAction:"{loading, select, true {Wird erneut versucht...} other {Erneut versuchen}}",noPermissionTitle:"Zugriff eingeschränkt",noPermissionDescription:"Sie haben keine Berechtigung, auf diesen Bereich zuzugreifen. Kontaktieren Sie einen Workspace-Administrator, wenn Sie Zugriff benötigen.",billingManageOnly:"Nur Benutzer mit Abrechnungsverwaltungsberechtigungen können diese Aktion durchführen."}},subscription:{managePlan:"Verwalte deinen Plan und deine Abrechnung",changePlan:"Plan ändern",viewPricingPlans:"Preispläne ansehen",viewPlans:"Pläne ansehen",upgradePlan:"Jetzt upgraden",subscribe:"Abonnieren",currentPlan:"Aktueller Plan",noSubscription:"Du hast kein aktives Abonnement",choosePlan:"Wähle deinen Plan",choosePlanDescription:"Vergleiche Pläne und wähle den, der zu deinen Anforderungen passt",forWorkspace:"für {name}",planUpdateAvailable:"Plan-Update verfügbar",updateSuccess:"Abonnement erfolgreich aktualisiert!",updateFailed:"Aktualisierung fehlgeschlagen",cancelTitle:"Abonnement kündigen",cancelConfirm:"Bist du sicher, dass du dein Abonnement kündigen möchtest?",cancelKeep:"Abonnement behalten",cancelButton:"Ja, Abonnement kündigen",cancelTrialTitle:"Testversion abbrechen",cancelTrialConfirm:"Bist du sicher, dass du deine Testversion abbrechen möchtest?",cancelTrialAccess:"Deine Testversion läuft weiter bis",cancelTrialNoCharge:"Dir wird nichts berechnet — deine Testversion läuft einfach ab",cancelTrialResume:"Du kannst deine Testversion jederzeit vor Ablauf wieder aufnehmen",cancelTrialKeep:"Testversion behalten",cancelTrialButton:"Ja, Testversion abbrechen",canceling:"Wird gekündigt...",cancelSuccess:"Das Abonnement wird zum Ende des Abrechnungszeitraums gekündigt.",cancelNotCharged:"Nach der Kündigung wird dir nichts mehr berechnet",cancelResumeAnytime:"Du kannst dein Abonnement jederzeit vor Ablauf wieder aufnehmen",resumeTitle:"Abonnement fortsetzen",resumeTrial:"Testversion fortsetzen",resumeConfirm:"Bist du sicher, dass du dein Abonnement fortsetzen möchtest?",resumeKeep:"Gekündigt lassen",resumeButton:"Ja, Abonnement fortsetzen",resuming:"Wird fortgesetzt...",resumeSuccess:"Das Abonnement wurde fortgesetzt.",managePayment:"Zahlung verwalten",openingPortal:"Wird geöffnet...",viewAllPlans:"Alle Pläne ansehen",scheduledCancellation:"Kündigung des Abonnements geplant",scheduledTrialCancellation:"Kündigung der Testversion geplant",paymentPastDue:"Zahlung überfällig",paymentPastDueDescription:"Bitte aktualisiere deine Zahlungsmethode, um eine Dienstunterbrechung zu vermeiden.",subscriptionPaused:"Abonnement pausiert",subscriptionPausedDescription:"Dein Abonnement ist derzeit pausiert. Setze es fort, um den vollen Zugang wiederherzustellen.",errorLoading:"Fehler beim Laden der Abonnementdaten",errorLoadingDescription:"Bitte überprüfe deine Verbindung und versuche es erneut.",errorProcessing:"Abonnement konnte nicht verarbeitet werden",errorCanceling:"Abonnement konnte nicht gekündigt werden",errorResuming:"Abonnement konnte nicht fortgesetzt werden",invalidWorkspace:"Ungültige Arbeitsbereich-ID",billingInterval:{monthly:"Monatlich",quarterly:"Vierteljährlich",yearly:"Jährlich",perMonth:"/Monat",perQuarter:"/Quartal",perYear:"/Jahr"},seats:{title:"Plätze",members:"Mitglieder",included:"Enthalten",billable:"Abrechenbar",perExtraSeat:"Pro zusätzlichem Platz",limit:"Limit",includedSeats:"Enthaltene Plätze",maxSeats:"Max. Plätze",freeWithBase:"Im Grundpreis enthalten",allIncluded:"Alle enthalten",extra:"zusätzlich",unlimited:"Unbegrenzt"},items:{features:"Funktionen",limits:"Limits",quotas:"Nutzungskontingente",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month"},checkout:{upgrade:"Upgraden",downgrade:"Downgraden",switchTo:"Wechseln zu",select:"Auswählen"},status:{active:"Aktiv",canceling:"Wird gekündigt",trial:"Testversion",canceled:"Gekündigt",pastDue:"Überfällig",paused:"Pausiert",deprecated:"Veraltet",unknown:"Unbekannt"},plan:"Plan",invoicesTab:"Rechnungen",changePlanButton:"Plan ändern",noPlanAssigned:"Kein Plan zugewiesen",free:"Kostenlos",perSeatDisplay:"+ {price}/Platz{interval}",estTotalDisplay:"Geschätztes Gesamt: {total}{interval} ({count, plural, one {# zusätzlicher Platz} other {# zusätzliche Plätze}})",nextBillingDisplay:"Nächste Abrechnung: {date}",membersInWorkspace:"{count, plural, one {# Mitglied} other {# Mitglieder}} im Arbeitsbereich",billingInCurrency:"Abrechnung in {currency}",savingsPercent:"{percent, number}% sparen",switchToInterval:"Zu {interval} wechseln",seatPriceDisplay:"+ {price}/Platz{interval} ({included} {includedLabel})",trialEnded:"Deine Testversion ist abgelaufen.",trialEndsIn:"Deine Testversion endet in {days, plural, one {# Tag} other {# Tagen}}.",onTrial:"Du befindest dich in der Testversion.",upgradeToKeepAccess:"Upgrade, um den Zugang zu behalten.",viewInvoices:"Rechnungen ansehen",cancelTrial:"Testversion abbrechen",dunningFinal:"Letzte Warnung: Abonnement wird ausgesetzt",dunningSuspended:"Abonnement ausgesetzt",dunningRecovery:"Zahlungswiederherstellung läuft",dunningSuspendedDescription:"Dein Abonnement wurde aufgrund wiederholter Zahlungsfehler ausgesetzt. Aktualisiere deine Zahlungsmethode, um den Zugang wiederherzustellen.",dunningRecoveryDescription:"Wir konnten deine Zahlung nicht verarbeiten. Bitte aktualisiere deine Zahlungsmethode, um den Zugang nicht zu verlieren.",cancelEndDescription:"Dein Abonnement endet am",trialEndDescription:"Deine Testversion endet am",cancelEndFallback:"Dein Abonnement wird zum Ende des aktuellen Abrechnungszeitraums gekündigt. Dir wird nichts mehr berechnet.",resumeChargeDate:"Dir wird erneut berechnet am",resumeChargeFallback:"dem nächsten Abrechnungsdatum",resumeContinue:"Dein Abonnement wird automatisch fortgesetzt und gemäß deinem Plan abgerechnet",resumeCancelAnytime:"Du kannst jederzeit vor dem nächsten Abrechnungsdatum kündigen, wenn du es dir anders überlegst",retainAccess:"Du behältst den vollen Zugang zu diesem Plan bis",retainAccessFallback:"zum Ende deines aktuellen Abrechnungszeitraums",noPlansAvailable:"Für diesen Arbeitsbereich sind keine Plangruppen verfügbar. Bitte kontaktiere den Support, wenn du glaubst, dass dies ein Fehler ist.",noPlansAvailableHint:"Für diesen Arbeitsbereich sind keine Plangruppen verfügbar.",startTrialDescription:"Teste den vollständigen Plan ohne Verpflichtung. Du kannst jederzeit upgraden oder kündigen.",noSubscriptionDescription:"Wähle einen Plan, um mit deinem Arbeitsbereich loszulegen",startFreeTrial:"Kostenlose Testversion starten",startTrialDays:"{days}-tägige kostenlose Testversion starten",trialBadge:"{days}-Tage-Testversion"},users:{title:"Arbeitsbereich-Mitglieder",adminOnly:"Nur der Arbeitsbereich-Administrator kann Benutzer und Rollen verwalten.",inviteByEmail:"Mitglied per E-Mail einladen",inviteButton:"Einladen",inviting:"Wird eingeladen...",inviteSuccess:"Benutzer erfolgreich eingeladen",emailRequired:"E-Mail-Adresse ist erforderlich",invalidEmail:"Ungültiges E-Mail-Adressformat",inviteFailed:"Einladung des Mitglieds fehlgeschlagen",seatLimitReached:"Platzlimit erreicht",memberLimitReached:"Mitgliederlimit erreicht",role:"Rolle",you:"Du",owner:"Eigentümer",noMembers:"Keine Mitglieder in diesem Arbeitsbereich gefunden.",extraSeatCost:"Jedes zusätzliche Mitglied fügt {price}/{interval, select, yearly {Jahr} quarterly {Quartal} other {Monat}} zu deinem Abonnement hinzu",unknownUser:"Unbekannter Benutzer",seats:"Plätze",members:"Mitglieder",included:"enthalten",perExtraSeat:"/zusätzlicher Platz",maxMembers:"max. Mitglieder",available:"verfügbar",noMemberLimit:"Kein Mitgliederlimit",seatHeading:"{hasSeatPricing, select, true {Plätze} other {Mitglieder}}",limitReached:"{reason, select, seat_limit_reached {Platzlimit erreicht} other {Mitgliederlimit erreicht}}",memberCount:"{count, plural, one {# Mitglied} other {# Mitglieder}}",subscriptionRequired:"Ein Abonnement ist erforderlich, um Mitglieder einzuladen.",seatLimitMessage:"Dein Plan erlaubt bis zu {maxUsers, number} Mitglieder. Upgrade für mehr Plätze.",settingsLimitMessage:"Dieser Arbeitsbereich erlaubt bis zu {maxUsers, number} Mitglieder.",memberLimitMessage:"Mitgliederlimit von {maxUsers, number} erreicht.",selectRole:"Rolle auswählen",inviteAs:"Einladen als {role}"},invoices:{title:"Abrechnungsverlauf",description:"Rechnungen ansehen und herunterladen",pay:"Bezahlen",view:"Ansehen",viewDetails:"Details ansehen",download:"PDF",errorLoading:"Fehler beim Laden der Rechnungen",noInvoices:"Noch keine Rechnungen. Abonniere einen Plan, um Rechnungen zu erhalten.",noInvoicesWithSub:"Keine Rechnungen mit Download-Option gefunden",paidAmount:"Bezahlt: {amount}",na:"k. A.",status:{draft:"Entwurf",open:"Offen",paid:"Bezahlt",uncollectible:"Uneinbringlich",void:"Storniert"}},usage:{title:"Nutzung",description:"Überwache deinen Ressourcenverbrauch und deine Kontingente",totalResources:"Ressourcen gesamt",overallUsage:"Gesamtnutzung",inOverage:"Im Überschuss",estOverageCost:"Geschätzte Überschusskosten",overageDetected:"Überschuss erkannt",overageDescription:"Zusätzliche Nutzung wird als Überschuss auf deiner nächsten Rechnung berechnet.",overageUnits:"Überschusseinheiten",rate:"Tarif",billableBlocks:"Abrechenbare Blöcke",estimatedCharge:"Geschätzte Kosten",noData:"Keine Kontingentnutzungsdaten für diesen Arbeitsbereich verfügbar.",noDataHint:"Kontingente erscheinen hier, sobald dein Plan gemessene Ressourcen enthält.",used:"genutzt",remaining:"verbleibend",overLimit:"über dem Limit",percentUsed:"{percent, number}% genutzt",availableRemaining:"{count} verbleibend",overLimitCount:"{count} über dem Limit",overageWarning:"{count, plural, one {# Ressource hat das enthaltene Kontingent überschritten.} other {# Ressourcen haben das enthaltene Kontingent überschritten.}} Zusätzliche Nutzung wird als Überschuss auf deiner nächsten Rechnung berechnet.",fullyUsed:"Vollständig genutzt",renewingSoon:"wird bald erneuert",almostFull:"Fast voll",overage:"Überschuss",errorLoading:"Nutzungsdaten konnten nicht geladen werden",perUnit:"/ Einheit",perUnits:"/ Einheiten",rateDisplay:"{rate} {unitSize, plural, =1 {/ Einheit} other {/ {unitSize, number} Einheiten}}",resourcesExceeded:"{count, plural, one {# Ressource hat das enthaltene Kontingent überschritten.} other {# Ressourcen haben das enthaltene Kontingent überschritten.}}",estOverageCharges:"Geschätzte Überschusskosten in diesem Zeitraum: {amount}",overageRateDisplay:"Überschusstarif: {rate}",resetDateDisplay:"Nutzung wird zurückgesetzt am {date}",daysRemainingDisplay:"{count, plural, one {# Tag verbleibend} other {# Tage verbleibend}}"},profile:{email:"E-Mail",name:"Name",language:"Sprache",country:"Land",currency:"Währung",timezone:"Zeitzone",profileImage:"Profilbild",success:"Profil erfolgreich gespeichert",nameMinLength:"Der Name muss mindestens 2 Zeichen lang sein.",save:"Speichern",reset:"Zurücksetzen"},general:{ownerOnly:"Nur der Eigentümer des Arbeitsbereichs kann die Einstellungen ändern.",name:"Name",namePlaceholder:"Mein Arbeitsbereich",nameMinLength:"Der Arbeitsbereichname muss mindestens 2 Zeichen lang sein.",billingCurrency:"Abrechnungswährung",icon:"Symbol",iconDescription:"Wähle ein Emoji oder lade ein benutzerdefiniertes Bild für deinen Arbeitsbereich hoch.",imageUrl:"Bild-URL",imageUrlPlaceholder:"https://beispiel.de/bild.png",imageUrlDescription:"Gib eine gültige URL für dein Arbeitsbereich-Bild ein. Unterstützt PNG-, JPG- und SVG-Formate.",previewLabel:"Vorschau:",success:"Arbeitsbereich-Einstellungen erfolgreich gespeichert",chooseEmoji:"Emoji wählen",customImageUrl:"Benutzerdefinierte Bild-URL",updateWorkspace:"Arbeitsbereich aktualisieren"},features:{title:"Arbeitsbereich-Funktionen",ownerOnly:"Nur der Eigentümer des Arbeitsbereichs kann die Funktionen ändern.",noFeatures:"Der Arbeitsbereich hat keine zu verwaltenden Funktionen.",enabled:"aktiviert",disabled:"deaktiviert",enabling:"Wird aktiviert",disabling:"Wird deaktiviert",featureSuccess:"erfolgreich",updateSuccess:"{feature} erfolgreich {enabled, select, true {aktiviert} other {deaktiviert}}",actionStatus:"{action, select, enabling {Wird aktiviert} disabling {Wird deaktiviert} other {}}"},danger:{title:"Arbeitsbereich löschen",adminOnly:"Nur Administratoren können Arbeitsbereiche löschen.",deleteWorkspace:"Arbeitsbereich löschen",deleteConfirm:"Bist du dir absolut sicher?",deleteWarning:"Diese Aktion kann nicht rückgängig gemacht werden. Der Arbeitsbereich und alle zugehörigen Daten werden dauerhaft gelöscht.",deleting:"Wird gelöscht...",deleteDescription:"Sobald du einen Arbeitsbereich löschst, gibt es kein Zurück. Der Arbeitsbereich und alle seine Daten werden dauerhaft gelöscht, einschließlich Mitglieder, Einstellungen und Funktionen.",deleteConfirmDescription:"Diese Aktion kann nicht rückgängig gemacht werden. Der Arbeitsbereich und alle seine Daten werden dauerhaft gelöscht.",failedToDelete:"Arbeitsbereich konnte nicht gelöscht werden"},notifications:{title:"Benachrichtigungseinstellungen",permissionDenied:"Benachrichtigungsberechtigung verweigert",notSupported:"Push-Benachrichtigungen werden in diesem Browser nicht unterstützt.",manageDescription:"Verwalte, wie du Benachrichtigungen von diesem Arbeitsbereich erhältst.",blocked:"Benachrichtigungen blockiert",blockedDescription:"Du hast Benachrichtigungen für diese Seite zuvor blockiert. Um sie zu aktivieren, aktualisiere deine Browsereinstellungen:",pushTitle:"Push-Benachrichtigungen",pushEnabledDescription:"Du erhältst Browser-Benachrichtigungen für wichtige Updates.",pushDisabledDescription:"Erhalte Benachrichtigungen über Zahlungsprobleme, Ablauf der Testversion und andere wichtige Updates.",enabling:"Wird aktiviert...",disabling:"Wird deaktiviert...",enable:"Aktivieren",disable:"Deaktivieren",toggleAction:"{loading, select, true {{subscribed, select, true {Wird deaktiviert...} other {Wird aktiviert...}}} other {{subscribed, select, true {Deaktivieren} other {Aktivieren}}}}",pushDescription:"{subscribed, select, true {Du erhältst Browser-Benachrichtigungen für wichtige Updates.} other {Erhalte Benachrichtigungen über Zahlungsprobleme, Ablauf der Testversion und andere wichtige Updates.}}",deviceNote:"Benachrichtigungen werden an dieses Gerät gesendet. Aktiviere sie auf anderen Geräten separat.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"Klicke auf das Schloss-Symbol (oder Schild-Symbol) in der Adressleiste",step2:'Finde "Benachrichtigungen" in der Berechtigungsliste',step3:'Ändere von "Blockiert" zu "Erlauben"',step4:"Lade diese Seite neu"},safari:{step1:"Öffne Safari → Einstellungen → Websites → Benachrichtigungen",step2:"Finde diese Website in der Liste",step3:'Ändere von "Ablehnen" zu "Erlauben"',step4:"Lade diese Seite neu"},edge:{step1:"Klicke auf das Schloss-Symbol in der Adressleiste",step2:'Klicke auf "Berechtigungen für diese Website"',step3:'Setze "Benachrichtigungen" auf "Erlauben"',step4:"Lade diese Seite neu"},chrome:{step1:"Klicke auf das Schloss-Symbol (oder Einstellungssymbol) in der Adressleiste",step2:'Klicke auf "Website-Einstellungen"',step3:'Setze "Benachrichtigungen" auf "Erlauben"',step4:"Lade diese Seite neu"}}},quota:{includedOnly:"{count, number} enthalten",includedWithOverage:"{count, number} enthalten, dann {price} / {unit}",includedHardLimit:"{count, number} enthalten (festes Limit)",unitFallback:"Einheit"},pricing:{title:"Wähle deinen Plan",description:"Vergleiche Pläne und wähle den, der zu deinen Anforderungen passt",currency:"Währung",billingIn:"Abrechnung in",noPlansCurrency:"Keine Pläne für deine Abrechnungswährung verfügbar.",noPlansCurrencyHint:"Etwas ist schiefgelaufen. Bitte kontaktiere den Support.",noPlans:"Keine Pläne verfügbar",free:"Kostenlos",included:"enthalten",save:"Sparen",current:"Aktuell",processing:"Wird verarbeitet...",unavailable:"Nicht verfügbar",selectCurrency:"Abrechnungswährung auswählen",billingInterval:"Abrechnungsintervall"},beta:{nameLabel:"Name",emailLabel:"E-Mail",submitText:"Absenden",submittingText:"Wird gesendet...",errorMessage:"Ein Fehler ist aufgetreten",tryAgain:"Erneut versuchen",privacyConsent:"Mit dem Absenden dieses Formulars stimmst du unserer",privacyPolicy:"Datenschutzrichtlinie",and:"und",termsOfService:"Nutzungsbedingungen"},workspace:{switchTitle:"Arbeitsbereich wechseln",switchDescription:"Wähle einen Arbeitsbereich aus oder erstelle einen neuen.",notLoggedIn:"Es sieht so aus, als wärst du nicht eingeloggt. Bitte melde dich an, um fortzufahren.",availableWorkspaces:"Verfügbare Arbeitsbereiche ({count, number})",loadingWorkspaces:"Arbeitsbereiche werden geladen...",searchPlaceholder:"Arbeitsbereiche suchen...",noWorkspacesFound:"Keine Arbeitsbereiche gefunden",noWorkspacesAvailable:"Keine Arbeitsbereiche verfügbar",switchTo:"Wechseln zu",membersCount:"{count, plural, one {# Mitglied} other {# Mitglieder}}",createNew:"Neuen Arbeitsbereich erstellen",createTitle:"Neuen Arbeitsbereich erstellen",createDescription:"Erstelle einen neuen Arbeitsbereich, um loszulegen.",workspaceName:"Name des Arbeitsbereichs",workspaceNamePlaceholder:"Mein Arbeitsbereich",workspaceNameMinLength:"Der Arbeitsbereichname muss mindestens 2 Zeichen lang sein.",workspaceIcon:"Arbeitsbereich-Symbol",iconDescription:"Wähle ein Emoji oder lade ein benutzerdefiniertes Bild für deinen Arbeitsbereich hoch.",chooseEmoji:"Emoji wählen",customImageUrl:"Benutzerdefinierte Bild-URL",imageUrl:"Bild-URL",imageUrlPlaceholder:"https://beispiel.de/bild.png",imageUrlDescription:"Gib eine gültige URL für dein Arbeitsbereich-Bild ein. Unterstützt PNG-, JPG- und SVG-Formate.",invalidUrl:"Bitte gib eine gültige URL ein",creating:"Wird erstellt...",createWorkspace:"Arbeitsbereich erstellen"},dropdowns:{search:"Suchen...",chooseOption:"Option wählen",chooseCountry:"Land wählen",searchCountry:"Land wählen...",chooseLanguage:"Sprache wählen",searchLanguage:"Sprache wählen...",chooseCurrency:"Währung wählen",searchCurrency:"Währung wählen...",chooseTimezone:"Zeitzone wählen",searchTimezone:"Zeitzone wählen..."},push:{failedToSubscribe:"Push-Benachrichtigungen konnten nicht abonniert werden",failedToUnsubscribe:"Push-Benachrichtigungen konnten nicht abbestellt werden"},permissions:{title:"Berechtigungen",description:"Konfiguriere, was jede Rolle in diesem Arbeitsbereich tun kann.",ownerOnly:"Nur der Eigentümer des Arbeitsbereichs kann Berechtigungen verwalten.",save:"Berechtigungen speichern",saving:"Wird gespeichert...",saveSuccess:"Berechtigungen erfolgreich gespeichert"},credits:{title:"Guthaben",description:"Guthaben kann für Premium-Aktionen wie KI-Generierung verwendet werden.",balance:"Guthabenstand",available:"Verfügbar",totalGranted:"Gesamt gewährt",totalConsumed:"Gesamt verbraucht",totalExpired:"Gesamt abgelaufen",noCredits:"Noch kein Guthaben",noCreditsHint:"Guthaben wird hier angezeigt, wenn es durch deinen Plan gewährt oder gekauft wurde.",buyCredits:"Guthaben kaufen",buyAmount:"Buy {count} Credits",purchasing:"Weiterleitung...",packages:"Guthabenpakete",noPackages:"Keine Guthabenpakete verfügbar.",creditsAmount:"{count} Guthaben",validityDays:"Gültig für {count} Tage",validityUnlimited:"Kein Ablaufdatum",transactions:"Letzte Transaktionen",noTransactions:"Noch keine Transaktionen.",loadMore:"Load More",viewAll:"Alle anzeigen",expiringSoon:"Läuft bald ab",expiringInDays:"{count} Guthaben läuft innerhalb von {days} Tagen ab",noExpiring:"Kein Guthaben läuft bald ab.",type:{plan_grant:"Plan-Gewährung",pack_purchased:"Gekauft",consumed:"Verbraucht",expired:"Abgelaufen",admin_grant:"Gewährt",admin_revoke:"Widerrufen",refund:"Erstattung"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"Guthaben erfolgreich gekauft! Dein Kontostand wurde aktualisiert.",purchaseCanceled:"Guthabenkauf wurde abgebrochen. Es wurden keine Gebühren erhoben.",purchaseFailed:"Guthabenkauf fehlgeschlagen. Bitte versuche es erneut oder kontaktiere den Support.",errorLoading:"Guthabendaten konnten nicht geladen werden",insufficientCredits:"Nicht genügend Guthaben"},errors:{networkError:"Netzwerkfehler: Bitte überprüfe deine Internetverbindung",unauthorized:"Nicht autorisiert — Bitte überprüfe deine Sitzung",notFound:"Ressource nicht gefunden",generic:"Ein Fehler ist aufgetreten",fetchPlans:"Pläne konnten nicht abgerufen werden",fetchPlanGroup:"Plangruppe konnte nicht abgerufen werden",fetchPlanGroupVersion:"Plangruppenversion konnte nicht abgerufen werden",fetchPlanGroupVersions:"Plangruppenversionen konnten nicht abgerufen werden",fetchSubscription:"Abonnement konnte nicht abgerufen werden",createCheckout:"Checkout-Sitzung konnte nicht erstellt werden",updateSubscription:"Abonnement konnte nicht aktualisiert werden",fetchInvoices:"Rechnungen konnten nicht abgerufen werden",fetchInvoice:"Rechnung konnte nicht abgerufen werden",openBillingPortal:"Abrechnungsportal konnte nicht geöffnet werden",cancelSubscription:"Abonnement konnte nicht gekündigt werden",resumeSubscription:"Abonnement konnte nicht fortgesetzt werden",recordUsage:"Nutzung konnte nicht erfasst werden",fetchQuotaUsage:"Kontingentnutzungsstatus konnte nicht abgerufen werden",fetchAllQuotaUsage:"Gesamte Kontingentnutzung konnte nicht abgerufen werden",fetchUsageLogs:"Nutzungsprotokolle konnten nicht abgerufen werden",fetchCreditBalance:"Guthabenstand konnte nicht abgerufen werden",consumeCredits:"Guthaben konnte nicht verbraucht werden",purchaseCredits:"Guthaben konnte nicht gekauft werden",fetchCreditPackages:"Guthabenpakete konnten nicht abgerufen werden",fetchCreditTransactions:"Guthabentransaktionen konnten nicht abgerufen werden",fetchExpiringCredits:"Ablaufendes Guthaben konnte nicht abgerufen werden"}}});var PE=Object.freeze({__proto__:null,ja:{settings:{titles:{profile:"アカウント",general:"ワークスペース設定",users:"ワークスペースメンバー",subscription:"プランと請求",usage:"使用状況",credits:"クレジット",features:"ワークスペース機能",notifications:"通知",permissions:"権限",danger:"危険ゾーン"},sidebar:{account:"アカウント",workspace:"ワークスペース",profile:"アカウント",general:"設定",users:"メンバー",subscription:"プランと請求",usage:"使用状況",credits:"クレジット",features:"機能",notifications:"通知",permissions:"権限",danger:"危険ゾーン"},common:{refresh:"更新",refreshing:"更新中...",retry:"再試行",retrying:"再試行中...",save:"保存",saving:"保存中...",cancel:"キャンセル",delete:"削除",dismiss:"閉じる",loading:"読み込み中...",success:"成功しました!",error:"エラー",refreshAction:"{loading, select, true {更新中...} other {更新}}",retryAction:"{loading, select, true {再試行中...} other {再試行}}",noPermissionTitle:"アクセス制限",noPermissionDescription:"このセクションにアクセスする権限がありません。アクセスが必要な場合は、ワークスペース管理者にお問い合わせください。",billingManageOnly:"請求管理権限を持つユーザーのみがこの操作を実行できます。"}},subscription:{managePlan:"プランと請求を管理",changePlan:"プランを変更",viewPricingPlans:"料金プランを見る",viewPlans:"プランを見る",upgradePlan:"今すぐアップグレード",subscribe:"登録する",currentPlan:"現在のプラン",noSubscription:"有効なサブスクリプションがありません",choosePlan:"プランを選択",choosePlanDescription:"プランを比較して、ニーズに合ったものを選択してください",forWorkspace:"{name} 向け",planUpdateAvailable:"プランの更新が利用可能です",updateSuccess:"サブスクリプションが正常に更新されました!",updateFailed:"更新に失敗しました",cancelTitle:"サブスクリプションをキャンセル",cancelConfirm:"サブスクリプションをキャンセルしてもよろしいですか?",cancelKeep:"サブスクリプションを維持",cancelButton:"はい、キャンセルします",cancelTrialTitle:"トライアルをキャンセル",cancelTrialConfirm:"トライアルをキャンセルしてもよろしいですか?",cancelTrialAccess:"トライアルは次の日まで継続されます",cancelTrialNoCharge:"課金されることはありません — トライアルはそのまま終了します",cancelTrialResume:"終了前であればいつでもトライアルを再開できます",cancelTrialKeep:"トライアルを維持",cancelTrialButton:"はい、トライアルをキャンセル",canceling:"キャンセル中...",cancelSuccess:"サブスクリプションは請求期間の終了時にキャンセルされます。",cancelNotCharged:"キャンセル後は課金されません",cancelResumeAnytime:"終了前であればいつでもサブスクリプションを再開できます",resumeTitle:"サブスクリプションを再開",resumeTrial:"トライアルを再開",resumeConfirm:"サブスクリプションを再開してもよろしいですか?",resumeKeep:"キャンセルのまま維持",resumeButton:"はい、再開します",resuming:"再開中...",resumeSuccess:"サブスクリプションが再開されました。",managePayment:"支払いを管理",openingPortal:"開いています...",viewAllPlans:"すべてのプランを見る",scheduledCancellation:"サブスクリプションのキャンセルが予定されています",scheduledTrialCancellation:"トライアルのキャンセルが予定されています",paymentPastDue:"支払い期限超過",paymentPastDueDescription:"サービスの中断を避けるため、お支払い方法を更新してください。",subscriptionPaused:"サブスクリプション一時停止中",subscriptionPausedDescription:"サブスクリプションは現在一時停止中です。再開してフルアクセスを復元してください。",errorLoading:"サブスクリプションデータの読み込みエラー",errorLoadingDescription:"接続を確認して、もう一度お試しください。",errorProcessing:"サブスクリプションの処理に失敗しました",errorCanceling:"サブスクリプションのキャンセルに失敗しました",errorResuming:"サブスクリプションの再開に失敗しました",invalidWorkspace:"無効なワークスペースID",billingInterval:{monthly:"月額",quarterly:"四半期",yearly:"年額",perMonth:"/月",perQuarter:"/四半期",perYear:"/年"},seats:{title:"シート",members:"メンバー",included:"含まれる",billable:"課金対象",perExtraSeat:"追加シートあたり",limit:"上限",includedSeats:"含まれるシート数",maxSeats:"最大シート数",freeWithBase:"基本料金に含まれる",allIncluded:"すべて含まれる",extra:"追加",unlimited:"無制限"},items:{features:"機能",limits:"制限",quotas:"使用量クォータ",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month"},checkout:{upgrade:"アップグレード",downgrade:"ダウングレード",switchTo:"切り替え",select:"選択"},status:{active:"有効",canceling:"キャンセル中",trial:"トライアル",canceled:"キャンセル済み",pastDue:"期限超過",paused:"一時停止中",deprecated:"非推奨",unknown:"不明"},plan:"プラン",invoicesTab:"請求書",changePlanButton:"プランを変更",noPlanAssigned:"プランが割り当てられていません",free:"無料",perSeatDisplay:"+ {price}/シート{interval}",estTotalDisplay:"推定合計: {total}{interval} ({count, plural, one {追加シート #} other {追加シート #}})",nextBillingDisplay:"次回請求日: {date}",membersInWorkspace:"ワークスペースに{count, plural, one {# メンバー} other {# メンバー}}",billingInCurrency:"{currency}で請求",savingsPercent:"{percent, number}%お得",switchToInterval:"{interval}に切り替え",seatPriceDisplay:"+ {price}/シート{interval} ({included} {includedLabel})",trialEnded:"トライアル期間が終了しました。",trialEndsIn:"トライアル期間は{days, plural, one {# 日} other {# 日}}で終了します。",onTrial:"トライアル期間中です。",upgradeToKeepAccess:"アクセスを維持するにはアップグレードしてください。",viewInvoices:"請求書を見る",cancelTrial:"トライアルをキャンセル",dunningFinal:"最終警告:サブスクリプションが停止されます",dunningSuspended:"サブスクリプションが停止されました",dunningRecovery:"支払い回収中",dunningSuspendedDescription:"支払いの失敗が繰り返されたため、サブスクリプションが停止されました。アクセスを復元するには、お支払い方法を更新してください。",dunningRecoveryDescription:"お支払いを処理できませんでした。アクセスを失わないよう、お支払い方法を更新してください。",cancelEndDescription:"サブスクリプションの終了日:",trialEndDescription:"トライアルの終了日:",cancelEndFallback:"サブスクリプションは現在の請求期間の終了時にキャンセルされます。以降の課金はありません。",resumeChargeDate:"次回の課金日:",resumeChargeFallback:"次回の請求日",resumeContinue:"サブスクリプションは自動的に継続され、プランに基づいて請求されます",resumeCancelAnytime:"次回の請求日前であれば、いつでもキャンセルできます",retainAccess:"このプランへのフルアクセスは次の日まで維持されます:",retainAccessFallback:"現在の請求期間の終了まで",noPlansAvailable:"このワークスペースで利用可能なプラングループがありません。エラーだと思われる場合は、サポートにお問い合わせください。",noPlansAvailableHint:"このワークスペースで利用可能なプラングループがありません。",startTrialDescription:"コミットなしでフルプランをお試しください。いつでもアップグレードまたはキャンセルできます。",noSubscriptionDescription:"ワークスペースを始めるにはプランを選択してください",startFreeTrial:"無料トライアルを開始",startTrialDays:"{days}日間の無料トライアルを開始",trialBadge:"{days}日間トライアル"},users:{title:"ワークスペースメンバー",adminOnly:"ワークスペース管理者のみがユーザーとロールを管理できます。",inviteByEmail:"メールでメンバーを招待",inviteButton:"招待",inviting:"招待中...",inviteSuccess:"ユーザーが正常に招待されました",emailRequired:"メールアドレスは必須です",invalidEmail:"メールアドレスの形式が無効です",inviteFailed:"メンバーの招待に失敗しました",seatLimitReached:"シート上限に達しました",memberLimitReached:"メンバー上限に達しました",role:"ロール",you:"あなた",owner:"オーナー",noMembers:"このワークスペースにメンバーが見つかりません。",extraSeatCost:"追加メンバーごとにサブスクリプションに{price}/{interval, select, yearly {年} quarterly {四半期} other {月}}が追加されます",unknownUser:"不明なユーザー",seats:"シート",members:"メンバー",included:"含まれる",perExtraSeat:"/追加シート",maxMembers:"最大メンバー数",available:"利用可能",noMemberLimit:"メンバー制限なし",seatHeading:"{hasSeatPricing, select, true {シート} other {メンバー}}",limitReached:"{reason, select, seat_limit_reached {シート上限に達しました} other {メンバー上限に達しました}}",memberCount:"{count, plural, one {# メンバー} other {# メンバー}}",subscriptionRequired:"メンバーを招待するにはサブスクリプションが必要です。",seatLimitMessage:"プランでは最大{maxUsers, number}メンバーまで許可されています。シートを増やすにはアップグレードしてください。",settingsLimitMessage:"このワークスペースでは最大{maxUsers, number}メンバーまで許可されています。",memberLimitMessage:"メンバー上限の{maxUsers, number}に達しました。",selectRole:"ロールを選択",inviteAs:"{role}として招待"},invoices:{title:"請求履歴",description:"請求書の確認とダウンロード",pay:"支払う",view:"表示",viewDetails:"詳細を表示",download:"PDF",errorLoading:"請求書の読み込みエラー",noInvoices:"請求書はまだありません。プランに登録すると請求書が発行されます。",noInvoicesWithSub:"ダウンロード可能な請求書が見つかりません",paidAmount:"支払済: {amount}",na:"該当なし",status:{draft:"下書き",open:"未払い",paid:"支払済",uncollectible:"回収不能",void:"無効"}},usage:{title:"使用状況",description:"リソース消費量とクォータを監視",totalResources:"合計リソース",overallUsage:"全体の使用状況",inOverage:"超過中",estOverageCost:"推定超過コスト",overageDetected:"超過を検出",overageDescription:"追加使用分は次回の請求書で超過分として課金されます。",overageUnits:"超過ユニット",rate:"料金",billableBlocks:"課金対象ブロック",estimatedCharge:"推定料金",noData:"このワークスペースのクォータ使用データがありません。",noDataHint:"プランに従量制リソースが含まれると、ここにクォータが表示されます。",used:"使用済み",remaining:"残り",overLimit:"上限超過",percentUsed:"{percent, number}%使用済み",availableRemaining:"残り{count}",overLimitCount:"{count}が上限超過",overageWarning:"{count, plural, one {# リソースが含まれるクォータを超過しました。} other {# リソースが含まれるクォータを超過しました。}}追加使用分は次回の請求書で超過分として課金されます。",fullyUsed:"全量使用済み",renewingSoon:"まもなく更新",almostFull:"ほぼ上限",overage:"超過",errorLoading:"使用状況データの読み込みに失敗しました",perUnit:"/ ユニット",perUnits:"/ ユニット",rateDisplay:"{rate} {unitSize, plural, =1 {/ ユニット} other {/ {unitSize, number} ユニット}}",resourcesExceeded:"{count, plural, one {# リソースが含まれるクォータを超過しました。} other {# リソースが含まれるクォータを超過しました。}}",estOverageCharges:"この期間の推定超過料金: {amount}",overageRateDisplay:"超過料金: {rate}",resetDateDisplay:"使用量は{date}にリセットされます",daysRemainingDisplay:"{count, plural, one {残り # 日} other {残り # 日}}"},profile:{email:"メールアドレス",name:"名前",language:"言語",country:"国",currency:"通貨",timezone:"タイムゾーン",profileImage:"プロフィール画像",success:"プロフィールが正常に保存されました",nameMinLength:"名前は2文字以上で入力してください。",save:"保存",reset:"リセット"},general:{ownerOnly:"ワークスペースのオーナーのみが設定を変更できます。",name:"名前",namePlaceholder:"マイワークスペース",nameMinLength:"ワークスペース名は2文字以上で入力してください。",billingCurrency:"請求通貨",icon:"アイコン",iconDescription:"絵文字を選択するか、ワークスペース用のカスタム画像をアップロードしてください。",imageUrl:"画像URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"ワークスペース画像の有効なURLを入力してください。PNG、JPG、SVG形式に対応しています。",previewLabel:"プレビュー:",success:"ワークスペース設定が正常に保存されました",chooseEmoji:"絵文字を選択",customImageUrl:"カスタム画像URL",updateWorkspace:"ワークスペースを更新"},features:{title:"ワークスペース機能",ownerOnly:"ワークスペースのオーナーのみが機能を変更できます。",noFeatures:"ワークスペースに管理可能な機能がありません。",enabled:"有効",disabled:"無効",enabling:"有効化中",disabling:"無効化中",featureSuccess:"成功",updateSuccess:"{feature}が正常に{enabled, select, true {有効化} other {無効化}}されました",actionStatus:"{action, select, enabling {有効化中} disabling {無効化中} other {}}"},danger:{title:"ワークスペースを削除",adminOnly:"管理者のみがワークスペースを削除できます。",deleteWorkspace:"ワークスペースを削除",deleteConfirm:"本当によろしいですか?",deleteWarning:"この操作は取り消せません。ワークスペースと関連するすべてのデータが完全に削除されます。",deleting:"削除中...",deleteDescription:"ワークスペースを削除すると元に戻すことはできません。ワークスペースとメンバー、設定、機能を含むすべてのデータが完全に削除されます。",deleteConfirmDescription:"この操作は取り消せません。ワークスペースと関連するすべてのデータが完全に削除されます。",failedToDelete:"ワークスペースの削除に失敗しました"},notifications:{title:"通知設定",permissionDenied:"通知の権限が拒否されました",notSupported:"このブラウザではプッシュ通知はサポートされていません。",manageDescription:"このワークスペースからの通知の受信方法を管理します。",blocked:"通知がブロックされています",blockedDescription:"このサイトの通知を以前ブロックしました。有効にするには、ブラウザの設定を更新してください:",pushTitle:"プッシュ通知",pushEnabledDescription:"重要な更新についてブラウザ通知を受信します。",pushDisabledDescription:"支払い問題、トライアル期限、その他の重要な更新についての通知を受け取ります。",enabling:"有効化中...",disabling:"無効化中...",enable:"有効にする",disable:"無効にする",toggleAction:"{loading, select, true {{subscribed, select, true {無効化中...} other {有効化中...}}} other {{subscribed, select, true {無効にする} other {有効にする}}}}",pushDescription:"{subscribed, select, true {重要な更新についてブラウザ通知を受信します。} other {支払い問題、トライアル期限、その他の重要な更新についての通知を受け取ります。}}",deviceNote:"通知はこのデバイスに送信されます。他のデバイスでは個別に有効にしてください。",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"アドレスバーの鍵アイコン(またはシールドアイコン)をクリック",step2:"権限リストで「通知」を見つける",step3:"「ブロック」から「許可」に変更",step4:"このページを再読み込み"},safari:{step1:"Safari → 設定 → Webサイト → 通知 を開く",step2:"リストからこのWebサイトを見つける",step3:"「拒否」から「許可」に変更",step4:"このページを再読み込み"},edge:{step1:"アドレスバーの鍵アイコンをクリック",step2:"「このサイトの権限」をクリック",step3:"「通知」を「許可」に設定",step4:"このページを再読み込み"},chrome:{step1:"アドレスバーの鍵アイコン(またはチューンアイコン)をクリック",step2:"「サイトの設定」をクリック",step3:"「通知」を「許可」に設定",step4:"このページを再読み込み"}}},quota:{includedOnly:"{count, number}件含まれる",includedWithOverage:"{count, number}件含まれる、以降{price} / {unit}",includedHardLimit:"{count, number}件含まれる(上限)",unitFallback:"ユニット"},pricing:{title:"プランを選択",description:"プランを比較して、ニーズに合ったものを選択してください",currency:"通貨",billingIn:"請求通貨",noPlansCurrency:"お使いの請求通貨で利用可能なプランがありません。",noPlansCurrencyHint:"エラーが発生しました。サポートにお問い合わせください。",noPlans:"利用可能なプランがありません",free:"無料",included:"含まれる",save:"お得",current:"現在",processing:"処理中...",unavailable:"利用不可",selectCurrency:"請求通貨を選択",billingInterval:"請求間隔"},beta:{nameLabel:"名前",emailLabel:"メールアドレス",submitText:"送信",submittingText:"送信中...",errorMessage:"エラーが発生しました",tryAgain:"再試行",privacyConsent:"このフォームを送信することで、以下に同意したことになります:",privacyPolicy:"プライバシーポリシー",and:"および",termsOfService:"利用規約"},workspace:{switchTitle:"ワークスペースを切り替え",switchDescription:"ワークスペースを選択するか、新しく作成してください。",notLoggedIn:"ログインしていないようです。続行するにはログインしてください。",availableWorkspaces:"利用可能なワークスペース ({count, number})",loadingWorkspaces:"ワークスペースを読み込み中...",searchPlaceholder:"ワークスペースを検索...",noWorkspacesFound:"ワークスペースが見つかりません",noWorkspacesAvailable:"利用可能なワークスペースがありません",switchTo:"切り替え",membersCount:"{count, plural, one {# メンバー} other {# メンバー}}",createNew:"新しいワークスペースを作成",createTitle:"新しいワークスペースを作成",createDescription:"新しいワークスペースを作成して始めましょう。",workspaceName:"ワークスペース名",workspaceNamePlaceholder:"マイワークスペース",workspaceNameMinLength:"ワークスペース名は2文字以上で入力してください。",workspaceIcon:"ワークスペースアイコン",iconDescription:"絵文字を選択するか、ワークスペース用のカスタム画像をアップロードしてください。",chooseEmoji:"絵文字を選択",customImageUrl:"カスタム画像URL",imageUrl:"画像URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"ワークスペース画像の有効なURLを入力してください。PNG、JPG、SVG形式に対応しています。",invalidUrl:"有効なURLを入力してください",creating:"作成中...",createWorkspace:"ワークスペースを作成"},dropdowns:{search:"検索...",chooseOption:"オプションを選択",chooseCountry:"国を選択",searchCountry:"国を選択...",chooseLanguage:"言語を選択",searchLanguage:"言語を選択...",chooseCurrency:"通貨を選択",searchCurrency:"通貨を選択...",chooseTimezone:"タイムゾーンを選択",searchTimezone:"タイムゾーンを選択..."},push:{failedToSubscribe:"プッシュ通知の登録に失敗しました",failedToUnsubscribe:"プッシュ通知の解除に失敗しました"},permissions:{title:"権限",description:"このワークスペースで各ロールができることを設定します。",ownerOnly:"ワークスペースのオーナーのみが権限を管理できます。",save:"権限を保存",saving:"保存中...",saveSuccess:"権限が正常に保存されました"},credits:{title:"クレジット",description:"クレジットはAI生成などのプレミアムアクションに使用できます。",balance:"クレジット残高",available:"利用可能",totalGranted:"付与合計",totalConsumed:"消費合計",totalExpired:"期限切れ合計",noCredits:"クレジットがありません",noCreditsHint:"プランによる付与または購入時にクレジットがここに表示されます。",buyCredits:"クレジットを購入",buyAmount:"Buy {count} Credits",purchasing:"リダイレクト中...",packages:"クレジットパッケージ",noPackages:"利用可能なクレジットパッケージがありません。",creditsAmount:"{count} クレジット",validityDays:"{count} 日間有効",validityUnlimited:"有効期限なし",transactions:"最近の取引",noTransactions:"取引はまだありません。",loadMore:"Load More",viewAll:"すべて表示",expiringSoon:"まもなく期限切れ",expiringInDays:"{count} クレジットが {days} 日以内に期限切れ",noExpiring:"まもなく期限切れになるクレジットはありません。",type:{plan_grant:"プラン付与",pack_purchased:"購入済み",consumed:"消費済み",expired:"期限切れ",admin_grant:"付与",admin_revoke:"取消",refund:"返金"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"クレジットの購入が完了しました!残高が更新されました。",purchaseCanceled:"クレジットの購入がキャンセルされました。課金は発生していません。",purchaseFailed:"クレジットの購入に失敗しました。再度お試しいただくか、サポートにお問い合わせください。",errorLoading:"クレジットデータの読み込みに失敗しました",insufficientCredits:"クレジットが不足しています"},errors:{networkError:"ネットワークエラー:インターネット接続を確認してください",unauthorized:"認証エラー — セッションを確認してください",notFound:"リソースが見つかりません",generic:"エラーが発生しました",fetchPlans:"プランの取得に失敗しました",fetchPlanGroup:"プラングループの取得に失敗しました",fetchPlanGroupVersion:"プラングループバージョンの取得に失敗しました",fetchPlanGroupVersions:"プラングループバージョン一覧の取得に失敗しました",fetchSubscription:"サブスクリプションの取得に失敗しました",createCheckout:"チェックアウトセッションの作成に失敗しました",updateSubscription:"サブスクリプションの更新に失敗しました",fetchInvoices:"請求書の取得に失敗しました",fetchInvoice:"請求書の取得に失敗しました",openBillingPortal:"請求ポータルを開けませんでした",cancelSubscription:"サブスクリプションのキャンセルに失敗しました",resumeSubscription:"サブスクリプションの再開に失敗しました",recordUsage:"使用量の記録に失敗しました",fetchQuotaUsage:"クォータ使用状況の取得に失敗しました",fetchAllQuotaUsage:"全クォータ使用状況の取得に失敗しました",fetchUsageLogs:"使用ログの取得に失敗しました",fetchCreditBalance:"クレジット残高の取得に失敗しました",consumeCredits:"クレジットの消費に失敗しました",purchaseCredits:"クレジットの購入に失敗しました",fetchCreditPackages:"クレジットパッケージの取得に失敗しました",fetchCreditTransactions:"クレジット取引履歴の取得に失敗しました",fetchExpiringCredits:"期限切れ間近のクレジットの取得に失敗しました"}}});var TE=Object.freeze({__proto__:null,zh:{settings:{titles:{profile:"账户",general:"工作区设置",users:"工作区成员",subscription:"套餐与账单",usage:"用量",credits:"积分",features:"工作区功能",notifications:"通知",permissions:"权限",danger:"危险区域"},sidebar:{account:"账户",workspace:"工作区",profile:"账户",general:"设置",users:"成员",subscription:"套餐与账单",usage:"用量",credits:"积分",features:"功能",notifications:"通知",permissions:"权限",danger:"危险区域"},common:{refresh:"刷新",refreshing:"正在刷新...",retry:"重试",retrying:"正在重试...",save:"保存",saving:"正在保存...",cancel:"取消",delete:"删除",dismiss:"关闭",loading:"正在加载...",success:"操作成功!",error:"错误",refreshAction:"{loading, select, true {正在刷新...} other {刷新}}",retryAction:"{loading, select, true {正在重试...} other {重试}}",noPermissionTitle:"访问受限",noPermissionDescription:"您没有权限访问此部分。如需访问权限,请联系工作区管理员。",billingManageOnly:"只有具有账单管理权限的用户才能执行此操作。"}},subscription:{managePlan:"管理您的套餐和账单",changePlan:"更改套餐",viewPricingPlans:"查看价格方案",viewPlans:"查看套餐",upgradePlan:"立即升级",subscribe:"订阅",currentPlan:"当前套餐",noSubscription:"您没有有效的订阅",choosePlan:"选择您的套餐",choosePlanDescription:"比较各套餐,选择最适合您需求的方案",forWorkspace:"适用于 {name}",planUpdateAvailable:"套餐更新可用",updateSuccess:"订阅已成功更新!",updateFailed:"更新失败",cancelTitle:"取消订阅",cancelConfirm:"您确定要取消订阅吗?",cancelKeep:"保留订阅",cancelButton:"是的,取消订阅",cancelTrialTitle:"取消试用",cancelTrialConfirm:"您确定要取消试用吗?",cancelTrialAccess:"您的试用将持续到",cancelTrialNoCharge:"不会向您收费 — 试用期将自动到期",cancelTrialResume:"您可以在试用结束前随时恢复试用",cancelTrialKeep:"保留试用",cancelTrialButton:"是的,取消试用",canceling:"正在取消...",cancelSuccess:"订阅将在当前计费周期结束时取消。",cancelNotCharged:"取消后将不再收费",cancelResumeAnytime:"您可以在订阅结束前随时恢复",resumeTitle:"恢复订阅",resumeTrial:"恢复试用",resumeConfirm:"您确定要恢复订阅吗?",resumeKeep:"保持取消状态",resumeButton:"是的,恢复订阅",resuming:"正在恢复...",resumeSuccess:"订阅已恢复。",managePayment:"管理支付方式",openingPortal:"正在打开...",viewAllPlans:"查看所有套餐",scheduledCancellation:"订阅已安排取消",scheduledTrialCancellation:"试用已安排取消",paymentPastDue:"付款逾期",paymentPastDueDescription:"请更新您的支付方式以避免服务中断。",subscriptionPaused:"订阅已暂停",subscriptionPausedDescription:"您的订阅当前已暂停。恢复订阅以获得完整访问权限。",errorLoading:"加载订阅数据时出错",errorLoadingDescription:"请检查您的网络连接并重试。",errorProcessing:"订阅处理失败",errorCanceling:"取消订阅失败",errorResuming:"恢复订阅失败",invalidWorkspace:"无效的工作区 ID",billingInterval:{monthly:"月付",quarterly:"季付",yearly:"年付",perMonth:"/月",perQuarter:"/季",perYear:"/年"},seats:{title:"席位",members:"成员",included:"包含",billable:"计费",perExtraSeat:"每增加一个席位",limit:"上限",includedSeats:"包含席位数",maxSeats:"最大席位数",freeWithBase:"包含在基础价格中",allIncluded:"全部包含",extra:"额外",unlimited:"不限"},items:{features:"功能",limits:"限制",quotas:"用量配额",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month"},checkout:{upgrade:"升级",downgrade:"降级",switchTo:"切换至",select:"选择"},status:{active:"有效",canceling:"取消中",trial:"试用",canceled:"已取消",pastDue:"逾期",paused:"已暂停",deprecated:"已弃用",unknown:"未知"},plan:"套餐",invoicesTab:"账单",changePlanButton:"更改套餐",noPlanAssigned:"未分配套餐",free:"免费",perSeatDisplay:"+ {price}/席位{interval}",estTotalDisplay:"预估总计:{total}{interval}({count, plural, one {# 个额外席位} other {# 个额外席位}})",nextBillingDisplay:"下次计费日:{date}",membersInWorkspace:"工作区有 {count, plural, one {# 名成员} other {# 名成员}}",billingInCurrency:"以{currency}计费",savingsPercent:"节省 {percent, number}%",switchToInterval:"切换至{interval}",seatPriceDisplay:"+ {price}/席位{interval}({included} {includedLabel})",trialEnded:"您的试用期已结束。",trialEndsIn:"您的试用期将在 {days, plural, one {# 天} other {# 天}}后结束。",onTrial:"您正在试用中。",upgradeToKeepAccess:"升级以保留访问权限。",viewInvoices:"查看账单",cancelTrial:"取消试用",dunningFinal:"最终警告:订阅将被暂停",dunningSuspended:"订阅已暂停",dunningRecovery:"付款恢复中",dunningSuspendedDescription:"由于多次付款失败,您的订阅已被暂停。请更新支付方式以恢复访问权限。",dunningRecoveryDescription:"我们无法处理您的付款。请更新您的支付方式以避免失去访问权限。",cancelEndDescription:"您的订阅将于以下日期结束:",trialEndDescription:"您的试用将于以下日期结束:",cancelEndFallback:"您的订阅将在当前计费周期结束时取消,之后将不再收费。",resumeChargeDate:"将于以下日期再次收费:",resumeChargeFallback:"下一个计费日",resumeContinue:"您的订阅将自动继续,并按照套餐计费",resumeCancelAnytime:"如果您改变主意,可以在下一个计费日之前随时取消",retainAccess:"您将保留此套餐的完整访问权限直到",retainAccessFallback:"当前计费周期结束",noPlansAvailable:"此工作区没有可用的套餐组。如果您认为这是一个错误,请联系客服。",noPlansAvailableHint:"此工作区没有可用的套餐组。",startTrialDescription:"免费试用完整套餐,无需承诺。您可以随时升级或取消。",noSubscriptionDescription:"选择一个套餐来开始使用您的工作区",startFreeTrial:"开始免费试用",startTrialDays:"开始 {days} 天免费试用",trialBadge:"{days} 天试用"},users:{title:"工作区成员",adminOnly:"只有工作区管理员才能管理用户和角色。",inviteByEmail:"通过电子邮件邀请成员",inviteButton:"邀请",inviting:"正在邀请...",inviteSuccess:"用户邀请成功",emailRequired:"电子邮件为必填项",invalidEmail:"电子邮件地址格式无效",inviteFailed:"邀请成员失败",seatLimitReached:"已达到席位上限",memberLimitReached:"已达到成员上限",role:"角色",you:"您",owner:"拥有者",noMembers:"此工作区未找到成员。",extraSeatCost:"每增加一名成员将增加{price}/{interval, select, yearly {年} quarterly {季} other {月}}的订阅费用",unknownUser:"未知用户",seats:"席位",members:"成员",included:"包含",perExtraSeat:"/额外席位",maxMembers:"最大成员数",available:"可用",noMemberLimit:"无成员限制",seatHeading:"{hasSeatPricing, select, true {席位} other {成员}}",limitReached:"{reason, select, seat_limit_reached {已达到席位上限} other {已达到成员上限}}",memberCount:"{count, plural, one {# 名成员} other {# 名成员}}",subscriptionRequired:"邀请成员需要有效订阅。",seatLimitMessage:"您的套餐最多允许 {maxUsers, number} 名成员。升级以获得更多席位。",settingsLimitMessage:"此工作区最多允许 {maxUsers, number} 名成员。",memberLimitMessage:"已达到成员上限 {maxUsers, number}。",selectRole:"选择角色",inviteAs:"以{role}身份邀请"},invoices:{title:"账单历史",description:"查看和下载您的账单",pay:"支付",view:"查看",viewDetails:"查看详情",download:"PDF",errorLoading:"加载账单时出错",noInvoices:"暂无账单。订阅套餐后将生成账单。",noInvoicesWithSub:"未找到可下载的账单",paidAmount:"已支付:{amount}",na:"不适用",status:{draft:"草稿",open:"待支付",paid:"已支付",uncollectible:"无法收回",void:"已作废"}},usage:{title:"用量",description:"监控您的资源消耗和配额",totalResources:"总资源",overallUsage:"总体用量",inOverage:"超额中",estOverageCost:"预估超额费用",overageDetected:"检测到超额",overageDescription:"额外用量将作为超额部分在下次账单中收取。",overageUnits:"超额单位",rate:"费率",billableBlocks:"计费块",estimatedCharge:"预估费用",noData:"此工作区没有可用的配额使用数据。",noDataHint:"当您的套餐包含计量资源时,配额将在此处显示。",used:"已使用",remaining:"剩余",overLimit:"超出上限",percentUsed:"已使用 {percent, number}%",availableRemaining:"剩余 {count}",overLimitCount:"{count} 超出上限",overageWarning:"{count, plural, one {# 项资源已超出包含的配额。} other {# 项资源已超出包含的配额。}}额外用量将作为超额部分在下次账单中收取。",fullyUsed:"已全部使用",renewingSoon:"即将续期",almostFull:"即将用完",overage:"超额",errorLoading:"加载用量数据失败",perUnit:"/ 单位",perUnits:"/ 单位",rateDisplay:"{rate} {unitSize, plural, =1 {/ 单位} other {/ {unitSize, number} 单位}}",resourcesExceeded:"{count, plural, one {# 项资源已超出包含的配额。} other {# 项资源已超出包含的配额。}}",estOverageCharges:"本期预估超额费用:{amount}",overageRateDisplay:"超额费率:{rate}",resetDateDisplay:"用量将于 {date} 重置",daysRemainingDisplay:"{count, plural, one {剩余 # 天} other {剩余 # 天}}"},profile:{email:"电子邮件",name:"姓名",language:"语言",country:"国家/地区",currency:"货币",timezone:"时区",profileImage:"头像",success:"个人资料保存成功",nameMinLength:"姓名至少需要2个字符。",save:"保存",reset:"重置"},general:{ownerOnly:"只有工作区拥有者才能更改设置。",name:"名称",namePlaceholder:"我的工作区",nameMinLength:"工作区名称至少需要2个字符。",billingCurrency:"计费货币",icon:"图标",iconDescription:"选择一个表情符号或为您的工作区上传自定义图片。",imageUrl:"图片 URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"输入工作区图片的有效 URL。支持 PNG、JPG 和 SVG 格式。",previewLabel:"预览:",success:"工作区设置保存成功",chooseEmoji:"选择表情",customImageUrl:"自定义图片 URL",updateWorkspace:"更新工作区"},features:{title:"工作区功能",ownerOnly:"只有工作区拥有者才能更改功能。",noFeatures:"工作区没有可管理的功能。",enabled:"已启用",disabled:"已禁用",enabling:"正在启用",disabling:"正在禁用",featureSuccess:"成功",updateSuccess:"{feature}已成功{enabled, select, true {启用} other {禁用}}",actionStatus:"{action, select, enabling {正在启用} disabling {正在禁用} other {}}"},danger:{title:"删除工作区",adminOnly:"只有管理员才能删除工作区。",deleteWorkspace:"删除工作区",deleteConfirm:"您确定吗?",deleteWarning:"此操作不可撤销。这将永久删除工作区及所有相关数据。",deleting:"正在删除...",deleteDescription:"一旦删除工作区,将无法恢复。这将永久删除工作区及其所有数据,包括成员、设置和功能。",deleteConfirmDescription:"此操作不可撤销。这将永久删除工作区及所有相关数据。",failedToDelete:"删除工作区失败"},notifications:{title:"通知偏好设置",permissionDenied:"通知权限被拒绝",notSupported:"此浏览器不支持推送通知。",manageDescription:"管理您从此工作区接收通知的方式。",blocked:"通知已被阻止",blockedDescription:"您之前阻止了此网站的通知。要启用通知,请更新浏览器设置:",pushTitle:"推送通知",pushEnabledDescription:"您将收到重要更新的浏览器通知。",pushDisabledDescription:"接收有关付款问题、试用到期和其他重要更新的通知。",enabling:"正在启用...",disabling:"正在禁用...",enable:"启用",disable:"禁用",toggleAction:"{loading, select, true {{subscribed, select, true {正在禁用...} other {正在启用...}}} other {{subscribed, select, true {禁用} other {启用}}}}",pushDescription:"{subscribed, select, true {您将收到重要更新的浏览器通知。} other {接收有关付款问题、试用到期和其他重要更新的通知。}}",deviceNote:"通知将发送到此设备。请在其他设备上单独启用。",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"点击地址栏中的锁形图标(或盾形图标)",step2:'在权限列表中找到"通知"',step3:'将"阻止"更改为"允许"',step4:"重新加载此页面"},safari:{step1:"打开 Safari → 设置 → 网站 → 通知",step2:"在列表中找到此网站",step3:'将"拒绝"更改为"允许"',step4:"重新加载此页面"},edge:{step1:"点击地址栏中的锁形图标",step2:'点击"此站点的权限"',step3:'将"通知"设置为"允许"',step4:"重新加载此页面"},chrome:{step1:"点击地址栏中的锁形图标(或调节图标)",step2:'点击"网站设置"',step3:'将"通知"设置为"允许"',step4:"重新加载此页面"}}},quota:{includedOnly:"包含 {count, number} 个",includedWithOverage:"包含 {count, number} 个,之后 {price} / {unit}",includedHardLimit:"包含 {count, number} 个(硬性限制)",unitFallback:"单位"},pricing:{title:"选择您的套餐",description:"比较各套餐,选择最适合您需求的方案",currency:"货币",billingIn:"计费货币",noPlansCurrency:"没有适用于您的计费货币的套餐。",noPlansCurrencyHint:"出现错误,请联系客服。",noPlans:"没有可用的套餐",free:"免费",included:"包含",save:"节省",current:"当前",processing:"正在处理...",unavailable:"不可用",selectCurrency:"选择计费货币",billingInterval:"计费周期"},beta:{nameLabel:"姓名",emailLabel:"电子邮件",submitText:"提交",submittingText:"正在提交...",errorMessage:"发生错误",tryAgain:"重试",privacyConsent:"提交此表单即表示您同意我们的",privacyPolicy:"隐私政策",and:"和",termsOfService:"服务条款"},workspace:{switchTitle:"切换工作区",switchDescription:"选择一个工作区或创建新的工作区。",notLoggedIn:"您似乎尚未登录。请登录后继续。",availableWorkspaces:"可用工作区 ({count, number})",loadingWorkspaces:"正在加载工作区...",searchPlaceholder:"搜索工作区...",noWorkspacesFound:"未找到工作区",noWorkspacesAvailable:"没有可用的工作区",switchTo:"切换至",membersCount:"{count, plural, one {# 名成员} other {# 名成员}}",createNew:"创建新工作区",createTitle:"创建新工作区",createDescription:"创建一个新的工作区来开始使用。",workspaceName:"工作区名称",workspaceNamePlaceholder:"我的工作区",workspaceNameMinLength:"工作区名称至少需要2个字符。",workspaceIcon:"工作区图标",iconDescription:"选择一个表情符号或为您的工作区上传自定义图片。",chooseEmoji:"选择表情",customImageUrl:"自定义图片 URL",imageUrl:"图片 URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"输入工作区图片的有效 URL。支持 PNG、JPG 和 SVG 格式。",invalidUrl:"请输入有效的 URL",creating:"正在创建...",createWorkspace:"创建工作区"},dropdowns:{search:"搜索...",chooseOption:"选择选项",chooseCountry:"选择国家/地区",searchCountry:"选择国家/地区...",chooseLanguage:"选择语言",searchLanguage:"选择语言...",chooseCurrency:"选择货币",searchCurrency:"选择货币...",chooseTimezone:"选择时区",searchTimezone:"选择时区..."},push:{failedToSubscribe:"订阅推送通知失败",failedToUnsubscribe:"取消订阅推送通知失败"},permissions:{title:"权限",description:"配置每个角色在此工作区中的操作权限。",ownerOnly:"只有工作区拥有者才能管理权限。",save:"保存权限",saving:"正在保存...",saveSuccess:"权限保存成功"},credits:{title:"积分",description:"积分可用于 AI 生成等高级操作。",balance:"积分余额",available:"可用",totalGranted:"总授予",totalConsumed:"总消耗",totalExpired:"总过期",noCredits:"暂无积分",noCreditsHint:"当您的套餐授予或购买积分时,积分将显示在此处。",buyCredits:"购买积分",buyAmount:"Buy {count} Credits",purchasing:"正在跳转...",packages:"积分套餐包",noPackages:"没有可用的积分套餐包。",creditsAmount:"{count} 积分",validityDays:"有效期 {count} 天",validityUnlimited:"永不过期",transactions:"最近交易",noTransactions:"暂无交易记录。",loadMore:"Load More",viewAll:"查看全部",expiringSoon:"即将过期",expiringInDays:"{count} 积分将在 {days} 天内过期",noExpiring:"没有即将过期的积分。",type:{plan_grant:"套餐授予",pack_purchased:"已购买",consumed:"已消耗",expired:"已过期",admin_grant:"已授予",admin_revoke:"已撤销",refund:"退款"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"积分购买成功!您的余额已更新。",purchaseCanceled:"积分购买已取消,未产生任何费用。",purchaseFailed:"积分购买失败。请重试或联系客服。",errorLoading:"加载积分数据失败",insufficientCredits:"积分不足"},errors:{networkError:"网络错误:请检查您的网络连接",unauthorized:"未授权 — 请检查您的会话",notFound:"资源未找到",generic:"发生错误",fetchPlans:"获取套餐失败",fetchPlanGroup:"获取套餐组失败",fetchPlanGroupVersion:"获取套餐组版本失败",fetchPlanGroupVersions:"获取套餐组版本列表失败",fetchSubscription:"获取订阅信息失败",createCheckout:"创建结账会话失败",updateSubscription:"更新订阅失败",fetchInvoices:"获取账单失败",fetchInvoice:"获取账单失败",openBillingPortal:"打开账单门户失败",cancelSubscription:"取消订阅失败",resumeSubscription:"恢复订阅失败",recordUsage:"记录用量失败",fetchQuotaUsage:"获取配额使用状态失败",fetchAllQuotaUsage:"获取所有配额使用情况失败",fetchUsageLogs:"获取使用日志失败",fetchCreditBalance:"获取积分余额失败",consumeCredits:"消耗积分失败",purchaseCredits:"购买积分失败",fetchCreditPackages:"获取积分套餐包失败",fetchCreditTransactions:"获取积分交易记录失败",fetchExpiringCredits:"获取即将过期的积分失败"}}});var RE=Object.freeze({__proto__:null,hi:{settings:{titles:{profile:"खाता",general:"वर्कस्पेस सेटिंग्स",users:"वर्कस्पेस सदस्य",subscription:"प्लान और बिलिंग",usage:"उपयोग",credits:"क्रेडिट",features:"वर्कस्पेस फ़ीचर्स",notifications:"सूचनाएँ",permissions:"अनुमतियाँ",danger:"खतरनाक ज़ोन"},sidebar:{account:"खाता",workspace:"वर्कस्पेस",profile:"खाता",general:"सेटिंग्स",users:"सदस्य",subscription:"प्लान और बिलिंग",usage:"उपयोग",credits:"क्रेडिट",features:"फ़ीचर्स",notifications:"सूचनाएँ",permissions:"अनुमतियाँ",danger:"खतरनाक ज़ोन"},common:{refresh:"रीफ़्रेश",refreshing:"रीफ़्रेश हो रहा है...",retry:"पुनः प्रयास",retrying:"पुनः प्रयास हो रहा है...",save:"सहेजें",saving:"सहेजा जा रहा है...",cancel:"रद्द करें",delete:"हटाएँ",dismiss:"खारिज करें",loading:"लोड हो रहा है...",success:"सफल!",error:"त्रुटि",refreshAction:"{loading, select, true {रीफ़्रेश हो रहा है...} other {रीफ़्रेश}}",retryAction:"{loading, select, true {पुनः प्रयास हो रहा है...} other {पुनः प्रयास}}",noPermissionTitle:"पहुँच प्रतिबंधित",noPermissionDescription:"आपके पास इस अनुभाग तक पहुँचने की अनुमति नहीं है। यदि आपको पहुँच की आवश्यकता है तो कार्यक्षेत्र व्यवस्थापक से संपर्क करें।",billingManageOnly:"केवल बिलिंग प्रबंधन अनुमतियों वाले उपयोगकर्ता ही यह कार्य कर सकते हैं।"}},subscription:{managePlan:"अपना प्लान और बिलिंग प्रबंधित करें",changePlan:"प्लान बदलें",viewPricingPlans:"मूल्य निर्धारण प्लान देखें",viewPlans:"प्लान देखें",upgradePlan:"अभी अपग्रेड करें",subscribe:"सदस्यता लें",currentPlan:"वर्तमान प्लान",noSubscription:"आपके पास कोई सक्रिय सदस्यता नहीं है",choosePlan:"अपना प्लान चुनें",choosePlanDescription:"प्लान की तुलना करें और अपनी ज़रूरत के अनुसार चुनें",forWorkspace:"{name} के लिए",planUpdateAvailable:"प्लान अपडेट उपलब्ध है",updateSuccess:"सदस्यता सफलतापूर्वक अपडेट हो गई!",updateFailed:"अपडेट विफल",cancelTitle:"सदस्यता रद्द करें",cancelConfirm:"क्या आप वाकई अपनी सदस्यता रद्द करना चाहते हैं?",cancelKeep:"सदस्यता बनाए रखें",cancelButton:"हाँ, सदस्यता रद्द करें",cancelTrialTitle:"ट्रायल रद्द करें",cancelTrialConfirm:"क्या आप वाकई अपना ट्रायल रद्द करना चाहते हैं?",cancelTrialAccess:"आपका ट्रायल इस तारीख तक जारी रहेगा",cancelTrialNoCharge:"आपसे कोई शुल्क नहीं लिया जाएगा — आपका ट्रायल बस समाप्त हो जाएगा",cancelTrialResume:"आप समाप्त होने से पहले कभी भी अपना ट्रायल फिर से शुरू कर सकते हैं",cancelTrialKeep:"ट्रायल बनाए रखें",cancelTrialButton:"हाँ, ट्रायल रद्द करें",canceling:"रद्द किया जा रहा है...",cancelSuccess:"बिलिंग अवधि के अंत में सदस्यता रद्द कर दी जाएगी।",cancelNotCharged:"रद्द करने के बाद आपसे दोबारा शुल्क नहीं लिया जाएगा",cancelResumeAnytime:"आप सदस्यता समाप्त होने से पहले कभी भी इसे फिर से शुरू कर सकते हैं",resumeTitle:"सदस्यता फिर से शुरू करें",resumeTrial:"ट्रायल फिर से शुरू करें",resumeConfirm:"क्या आप वाकई अपनी सदस्यता फिर से शुरू करना चाहते हैं?",resumeKeep:"रद्द रखें",resumeButton:"हाँ, सदस्यता फिर से शुरू करें",resuming:"फिर से शुरू हो रहा है...",resumeSuccess:"सदस्यता फिर से शुरू हो गई है।",managePayment:"भुगतान प्रबंधित करें",openingPortal:"खोला जा रहा है...",viewAllPlans:"सभी प्लान देखें",scheduledCancellation:"सदस्यता रद्द करने के लिए निर्धारित",scheduledTrialCancellation:"ट्रायल रद्द करने के लिए निर्धारित",paymentPastDue:"भुगतान अतिदेय",paymentPastDueDescription:"सेवा में रुकावट से बचने के लिए कृपया अपना भुगतान तरीका अपडेट करें।",subscriptionPaused:"सदस्यता रुकी हुई है",subscriptionPausedDescription:"आपकी सदस्यता वर्तमान में रुकी हुई है। पूर्ण पहुँच बहाल करने के लिए फिर से शुरू करें।",errorLoading:"सदस्यता डेटा लोड करने में त्रुटि",errorLoadingDescription:"कृपया अपना कनेक्शन जाँचें और पुनः प्रयास करें।",errorProcessing:"सदस्यता प्रोसेस करने में विफल",errorCanceling:"सदस्यता रद्द करने में विफल",errorResuming:"सदस्यता फिर से शुरू करने में विफल",invalidWorkspace:"अमान्य वर्कस्पेस ID",billingInterval:{monthly:"मासिक",quarterly:"तिमाही",yearly:"वार्षिक",perMonth:"/माह",perQuarter:"/तिमाही",perYear:"/वर्ष"},seats:{title:"सीटें",members:"सदस्य",included:"शामिल",billable:"बिल योग्य",perExtraSeat:"प्रति अतिरिक्त सीट",limit:"सीमा",includedSeats:"शामिल सीटें",maxSeats:"अधिकतम सीटें",freeWithBase:"मूल कीमत में मुफ़्त",allIncluded:"सभी शामिल",extra:"अतिरिक्त",unlimited:"असीमित"},items:{features:"फ़ीचर्स",limits:"सीमाएँ",quotas:"उपयोग कोटा",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month"},checkout:{upgrade:"अपग्रेड",downgrade:"डाउनग्रेड",switchTo:"बदलें",select:"चुनें"},status:{active:"सक्रिय",canceling:"रद्द हो रहा है",trial:"ट्रायल",canceled:"रद्द",pastDue:"अतिदेय",paused:"रुका हुआ",deprecated:"पुराना",unknown:"अज्ञात"},plan:"प्लान",invoicesTab:"चालान",changePlanButton:"प्लान बदलें",noPlanAssigned:"कोई प्लान नहीं",free:"मुफ़्त",perSeatDisplay:"+ {price}/सीट{interval}",estTotalDisplay:"अनुमानित कुल: {total}{interval} ({count, plural, one {# अतिरिक्त सीट} other {# अतिरिक्त सीटें}})",nextBillingDisplay:"अगली बिलिंग: {date}",membersInWorkspace:"वर्कस्पेस में {count, plural, one {# सदस्य} other {# सदस्य}}",billingInCurrency:"{currency} में बिलिंग",savingsPercent:"{percent, number}% बचाएँ",switchToInterval:"{interval} पर बदलें",seatPriceDisplay:"+ {price}/सीट{interval} ({included} {includedLabel})",trialEnded:"आपका ट्रायल समाप्त हो गया है।",trialEndsIn:"आपका ट्रायल {days, plural, one {# दिन} other {# दिनों}} में समाप्त होगा।",onTrial:"आप ट्रायल पर हैं।",upgradeToKeepAccess:"पहुँच बनाए रखने के लिए अपग्रेड करें।",viewInvoices:"चालान देखें",cancelTrial:"ट्रायल रद्द करें",dunningFinal:"अंतिम चेतावनी: सदस्यता निलंबित की जाएगी",dunningSuspended:"सदस्यता निलंबित",dunningRecovery:"भुगतान वसूली प्रक्रिया चल रही है",dunningSuspendedDescription:"बार-बार भुगतान विफल होने के कारण आपकी सदस्यता निलंबित कर दी गई है। पहुँच बहाल करने के लिए अपना भुगतान तरीका अपडेट करें।",dunningRecoveryDescription:"हम आपका भुगतान प्रोसेस करने में असमर्थ रहे। पहुँच न खोने के लिए कृपया अपना भुगतान तरीका अपडेट करें।",cancelEndDescription:"आपकी सदस्यता इस तारीख को समाप्त होगी",trialEndDescription:"आपका ट्रायल इस तारीख को समाप्त होगा",cancelEndFallback:"वर्तमान बिलिंग अवधि के अंत में आपकी सदस्यता रद्द कर दी जाएगी। आपसे दोबारा शुल्क नहीं लिया जाएगा।",resumeChargeDate:"आपसे फिर से शुल्क लिया जाएगा",resumeChargeFallback:"अगली बिलिंग तिथि",resumeContinue:"आपकी सदस्यता स्वचालित रूप से जारी रहेगी और आपसे आपके प्लान के अनुसार बिल लिया जाएगा",resumeCancelAnytime:"अगर आप अपना मन बदलते हैं तो अगली बिलिंग तिथि से पहले कभी भी रद्द कर सकते हैं",retainAccess:"आपके पास इस प्लान की पूर्ण पहुँच बनी रहेगी",retainAccessFallback:"आपकी वर्तमान बिलिंग अवधि के अंत तक",noPlansAvailable:"इस वर्कस्पेस के लिए कोई प्लान ग्रुप उपलब्ध नहीं है। अगर आपको लगता है कि यह त्रुटि है तो कृपया सहायता से संपर्क करें।",noPlansAvailableHint:"इस वर्कस्पेस के लिए कोई प्लान ग्रुप उपलब्ध नहीं है।",startTrialDescription:"बिना किसी प्रतिबद्धता के पूरा प्लान आज़माएँ। आप कभी भी अपग्रेड या रद्द कर सकते हैं।",noSubscriptionDescription:"अपने वर्कस्पेस के लिए एक प्लान चुनें",startFreeTrial:"मुफ़्त ट्रायल शुरू करें",startTrialDays:"{days} दिन का मुफ़्त ट्रायल शुरू करें",trialBadge:"{days} दिन का ट्रायल"},users:{title:"वर्कस्पेस सदस्य",adminOnly:"केवल वर्कस्पेस एडमिन ही उपयोगकर्ताओं और भूमिकाओं को प्रबंधित कर सकते हैं।",inviteByEmail:"ईमेल से सदस्य आमंत्रित करें",inviteButton:"आमंत्रित करें",inviting:"आमंत्रित किया जा रहा है...",inviteSuccess:"उपयोगकर्ता सफलतापूर्वक आमंत्रित किया गया",emailRequired:"ईमेल आवश्यक है",invalidEmail:"अमान्य ईमेल पता प्रारूप",inviteFailed:"सदस्य को आमंत्रित करने में विफल",seatLimitReached:"सीट सीमा पूरी हो गई",memberLimitReached:"सदस्य सीमा पूरी हो गई",role:"भूमिका",you:"आप",owner:"मालिक",noMembers:"इस वर्कस्पेस में कोई सदस्य नहीं मिला।",extraSeatCost:"प्रत्येक अतिरिक्त सदस्य आपकी सदस्यता में {price}/{interval, select, yearly {वर्ष} quarterly {तिमाही} other {माह}} जोड़ता है",unknownUser:"अज्ञात उपयोगकर्ता",seats:"सीटें",members:"सदस्य",included:"शामिल",perExtraSeat:"/अतिरिक्त सीट",maxMembers:"अधिकतम सदस्य",available:"उपलब्ध",noMemberLimit:"कोई सदस्य सीमा नहीं",seatHeading:"{hasSeatPricing, select, true {सीटें} other {सदस्य}}",limitReached:"{reason, select, seat_limit_reached {सीट सीमा पूरी हो गई} other {सदस्य सीमा पूरी हो गई}}",memberCount:"{count, plural, one {# सदस्य} other {# सदस्य}}",subscriptionRequired:"सदस्यों को आमंत्रित करने के लिए सदस्यता आवश्यक है।",seatLimitMessage:"आपका प्लान अधिकतम {maxUsers, number} सदस्यों की अनुमति देता है। अधिक सीटों के लिए अपग्रेड करें।",settingsLimitMessage:"यह वर्कस्पेस अधिकतम {maxUsers, number} सदस्यों की अनुमति देता है।",memberLimitMessage:"{maxUsers, number} सदस्यों की सीमा पूरी हो गई है।",selectRole:"भूमिका चुनें",inviteAs:"{role} के रूप में आमंत्रित करें"},invoices:{title:"बिलिंग इतिहास",description:"अपने चालान देखें और डाउनलोड करें",pay:"भुगतान करें",view:"देखें",viewDetails:"विवरण देखें",download:"PDF",errorLoading:"चालान लोड करने में त्रुटि",noInvoices:"अभी कोई चालान नहीं। चालान प्राप्त करने के लिए एक प्लान की सदस्यता लें।",noInvoicesWithSub:"डाउनलोड विकल्प वाला कोई चालान नहीं मिला",paidAmount:"भुगतान किया: {amount}",na:"लागू नहीं",status:{draft:"ड्राफ़्ट",open:"खुला",paid:"भुगतान हो गया",uncollectible:"अप्राप्य",void:"शून्य"}},usage:{title:"उपयोग",description:"अपने संसाधन उपभोग और कोटा की निगरानी करें",totalResources:"कुल संसाधन",overallUsage:"समग्र उपयोग",inOverage:"अतिरिक्त उपयोग में",estOverageCost:"अनुमानित अतिरिक्त लागत",overageDetected:"अतिरिक्त उपयोग पाया गया",overageDescription:"अतिरिक्त उपयोग आपके अगले चालान में अतिरिक्त शुल्क के रूप में बिल किया जाएगा।",overageUnits:"अतिरिक्त इकाइयाँ",rate:"दर",billableBlocks:"बिल योग्य ब्लॉक",estimatedCharge:"अनुमानित शुल्क",noData:"इस वर्कस्पेस के लिए कोई कोटा उपयोग डेटा उपलब्ध नहीं है।",noDataHint:"जब आपके प्लान में मीटर्ड संसाधन शामिल होंगे तो कोटा यहाँ दिखाई देंगे।",used:"उपयोग किया",remaining:"शेष",overLimit:"सीमा से अधिक",percentUsed:"{percent, number}% उपयोग किया",availableRemaining:"{count} शेष",overLimitCount:"{count} सीमा से अधिक",overageWarning:"{count, plural, one {# संसाधन ने शामिल कोटा पार कर लिया है।} other {# संसाधनों ने शामिल कोटा पार कर लिया है।}} अतिरिक्त उपयोग आपके अगले चालान में अतिरिक्त शुल्क के रूप में बिल किया जाएगा।",fullyUsed:"पूरी तरह उपयोग किया",renewingSoon:"जल्द नवीनीकरण",almostFull:"लगभग भरा",overage:"अतिरिक्त",errorLoading:"उपयोग डेटा लोड करने में विफल",perUnit:"/ इकाई",perUnits:"/ इकाइयाँ",rateDisplay:"{rate} {unitSize, plural, =1 {/ इकाई} other {/ {unitSize, number} इकाइयाँ}}",resourcesExceeded:"{count, plural, one {# संसाधन ने शामिल कोटा पार कर लिया है।} other {# संसाधनों ने शामिल कोटा पार कर लिया है।}}",estOverageCharges:"इस अवधि का अनुमानित अतिरिक्त शुल्क: {amount}",overageRateDisplay:"अतिरिक्त दर: {rate}",resetDateDisplay:"उपयोग {date} को रीसेट होगा",daysRemainingDisplay:"{count, plural, one {# दिन शेष} other {# दिन शेष}}"},profile:{email:"ईमेल",name:"नाम",language:"भाषा",country:"देश",currency:"मुद्रा",timezone:"समय क्षेत्र",profileImage:"प्रोफ़ाइल छवि",success:"प्रोफ़ाइल सफलतापूर्वक सहेजी गई",nameMinLength:"नाम कम से कम 2 अक्षरों का होना चाहिए।",save:"सहेजें",reset:"रीसेट"},general:{ownerOnly:"केवल वर्कस्पेस का मालिक ही वर्कस्पेस सेटिंग्स बदल सकता है।",name:"नाम",namePlaceholder:"मेरा शानदार वर्कस्पेस",nameMinLength:"वर्कस्पेस का नाम कम से कम 2 अक्षरों का होना चाहिए।",billingCurrency:"बिलिंग मुद्रा",icon:"आइकन",iconDescription:"अपने वर्कस्पेस के लिए एक इमोजी चुनें या कस्टम छवि अपलोड करें।",imageUrl:"छवि URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"अपने वर्कस्पेस की छवि के लिए एक मान्य URL दर्ज करें। PNG, JPG और SVG प्रारूप समर्थित हैं।",previewLabel:"पूर्वावलोकन:",success:"वर्कस्पेस सेटिंग्स सफलतापूर्वक सहेजी गईं",chooseEmoji:"इमोजी चुनें",customImageUrl:"कस्टम छवि URL",updateWorkspace:"वर्कस्पेस अपडेट करें"},features:{title:"वर्कस्पेस फ़ीचर्स",ownerOnly:"केवल वर्कस्पेस का मालिक ही फ़ीचर्स बदल सकता है।",noFeatures:"प्रबंधित करने के लिए कोई फ़ीचर नहीं है।",enabled:"सक्रिय",disabled:"निष्क्रिय",enabling:"सक्रिय किया जा रहा है",disabling:"निष्क्रिय किया जा रहा है",featureSuccess:"सफलतापूर्वक",updateSuccess:"{feature} सफलतापूर्वक {enabled, select, true {सक्रिय} other {निष्क्रिय}} किया गया",actionStatus:"{action, select, enabling {सक्रिय किया जा रहा है} disabling {निष्क्रिय किया जा रहा है} other {}}"},danger:{title:"वर्कस्पेस हटाएँ",adminOnly:"केवल वर्कस्पेस एडमिन ही वर्कस्पेस हटा सकते हैं।",deleteWorkspace:"वर्कस्पेस हटाएँ",deleteConfirm:"क्या आप बिल्कुल सुनिश्चित हैं?",deleteWarning:"यह क्रिया पूर्ववत नहीं की जा सकती। यह वर्कस्पेस और सभी संबंधित डेटा को स्थायी रूप से हटा देगी।",deleting:"हटाया जा रहा है...",deleteDescription:"एक बार वर्कस्पेस हटाने के बाद वापस नहीं जा सकते। यह वर्कस्पेस और उसका सभी डेटा स्थायी रूप से हटा देगा, जिसमें सदस्य, सेटिंग्स और फ़ीचर्स शामिल हैं।",deleteConfirmDescription:"यह क्रिया पूर्ववत नहीं की जा सकती। यह वर्कस्पेस और उसके सभी डेटा को स्थायी रूप से हटा देगी।",failedToDelete:"वर्कस्पेस हटाने में विफल"},notifications:{title:"सूचना प्राथमिकताएँ",permissionDenied:"सूचना अनुमति अस्वीकृत",notSupported:"इस ब्राउज़र में पुश सूचनाएँ समर्थित नहीं हैं।",manageDescription:"प्रबंधित करें कि आप इस वर्कस्पेस से कैसे सूचनाएँ प्राप्त करते हैं।",blocked:"सूचनाएँ अवरुद्ध हैं",blockedDescription:"आपने पहले इस साइट के लिए सूचनाएँ अवरुद्ध की थीं। उन्हें सक्रिय करने के लिए अपनी ब्राउज़र सेटिंग्स अपडेट करें:",pushTitle:"पुश सूचनाएँ",pushEnabledDescription:"आपको महत्वपूर्ण अपडेट के लिए ब्राउज़र सूचनाएँ प्राप्त होंगी।",pushDisabledDescription:"भुगतान समस्याओं, ट्रायल समाप्ति और अन्य महत्वपूर्ण अपडेट के बारे में सूचित रहें।",enabling:"सक्रिय किया जा रहा है...",disabling:"निष्क्रिय किया जा रहा है...",enable:"सक्रिय करें",disable:"निष्क्रिय करें",toggleAction:"{loading, select, true {{subscribed, select, true {निष्क्रिय किया जा रहा है...} other {सक्रिय किया जा रहा है...}}} other {{subscribed, select, true {निष्क्रिय करें} other {सक्रिय करें}}}}",pushDescription:"{subscribed, select, true {आपको महत्वपूर्ण अपडेट के लिए ब्राउज़र सूचनाएँ प्राप्त होंगी।} other {भुगतान समस्याओं, ट्रायल समाप्ति और अन्य महत्वपूर्ण अपडेट के बारे में सूचित रहें।}}",deviceNote:"सूचनाएँ इस डिवाइस पर भेजी जाती हैं। अन्य डिवाइसों पर अलग से सक्रिय करें।",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"एड्रेस बार में लॉक आइकन (या शील्ड आइकन) पर क्लिक करें",step2:'अनुमतियों की सूची में "Notifications" खोजें',step3:'"Blocked" से "Allow" में बदलें',step4:"इस पेज को रीलोड करें"},safari:{step1:"Safari → Settings → Websites → Notifications खोलें",step2:"सूची में यह वेबसाइट खोजें",step3:'"Deny" से "Allow" में बदलें',step4:"इस पेज को रीलोड करें"},edge:{step1:"एड्रेस बार में लॉक आइकन पर क्लिक करें",step2:'"Permissions for this site" पर क्लिक करें',step3:'"Notifications" को "Allow" पर सेट करें',step4:"इस पेज को रीलोड करें"},chrome:{step1:"एड्रेस बार में लॉक आइकन (या ट्यून आइकन) पर क्लिक करें",step2:'"Site settings" पर क्लिक करें',step3:'"Notifications" को "Allow" पर सेट करें',step4:"इस पेज को रीलोड करें"}}},quota:{includedOnly:"{count, number} शामिल",includedWithOverage:"{count, number} शामिल, फिर {price} / {unit}",includedHardLimit:"{count, number} शामिल (सख्त सीमा)",unitFallback:"इकाई"},pricing:{title:"अपना प्लान चुनें",description:"प्लान की तुलना करें और अपनी ज़रूरत के अनुसार चुनें",currency:"मुद्रा",billingIn:"बिलिंग",noPlansCurrency:"आपकी बिलिंग मुद्रा के लिए कोई प्लान उपलब्ध नहीं है।",noPlansCurrencyHint:"कुछ गलत हो गया। कृपया सहायता से संपर्क करें।",noPlans:"कोई प्लान उपलब्ध नहीं",free:"मुफ़्त",included:"शामिल",save:"बचाएँ",current:"वर्तमान",processing:"प्रोसेस हो रहा है...",unavailable:"अनुपलब्ध",selectCurrency:"बिलिंग मुद्रा चुनें",billingInterval:"बिलिंग अवधि"},beta:{nameLabel:"नाम",emailLabel:"ईमेल",submitText:"जमा करें",submittingText:"जमा किया जा रहा है...",errorMessage:"एक त्रुटि हुई",tryAgain:"पुनः प्रयास करें",privacyConsent:"यह फ़ॉर्म जमा करके, आप हमारी",privacyPolicy:"गोपनीयता नीति",and:"और",termsOfService:"सेवा की शर्तों"},workspace:{switchTitle:"वर्कस्पेस बदलें",switchDescription:"एक वर्कस्पेस चुनें या नया बनाएँ।",notLoggedIn:"ऐसा लगता है कि आपने लॉगिन नहीं किया है। जारी रखने के लिए कृपया लॉगिन करें।",availableWorkspaces:"उपलब्ध वर्कस्पेस ({count, number})",loadingWorkspaces:"वर्कस्पेस लोड हो रहे हैं...",searchPlaceholder:"वर्कस्पेस खोजें...",noWorkspacesFound:"कोई वर्कस्पेस नहीं मिला",noWorkspacesAvailable:"कोई वर्कस्पेस उपलब्ध नहीं",switchTo:"बदलें",membersCount:"{count, plural, one {# सदस्य} other {# सदस्य}}",createNew:"नया वर्कस्पेस बनाएँ",createTitle:"नया वर्कस्पेस बनाएँ",createDescription:"शुरू करने के लिए एक नया वर्कस्पेस बनाएँ।",workspaceName:"वर्कस्पेस का नाम",workspaceNamePlaceholder:"मेरा शानदार वर्कस्पेस",workspaceNameMinLength:"वर्कस्पेस का नाम कम से कम 2 अक्षरों का होना चाहिए।",workspaceIcon:"वर्कस्पेस आइकन",iconDescription:"अपने वर्कस्पेस के लिए एक इमोजी चुनें या कस्टम छवि अपलोड करें।",chooseEmoji:"इमोजी चुनें",customImageUrl:"कस्टम छवि URL",imageUrl:"छवि URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"अपने वर्कस्पेस की छवि के लिए एक मान्य URL दर्ज करें। PNG, JPG और SVG प्रारूप समर्थित हैं।",invalidUrl:"कृपया एक मान्य URL दर्ज करें",creating:"बनाया जा रहा है...",createWorkspace:"वर्कस्पेस बनाएँ"},dropdowns:{search:"खोजें...",chooseOption:"विकल्प चुनें",chooseCountry:"देश चुनें",searchCountry:"देश चुनें...",chooseLanguage:"भाषा चुनें",searchLanguage:"भाषा चुनें...",chooseCurrency:"मुद्रा चुनें",searchCurrency:"मुद्रा चुनें...",chooseTimezone:"समय क्षेत्र चुनें",searchTimezone:"समय क्षेत्र चुनें..."},push:{failedToSubscribe:"पुश सूचनाओं की सदस्यता लेने में विफल",failedToUnsubscribe:"पुश सूचनाओं की सदस्यता रद्द करने में विफल"},permissions:{title:"अनुमतियाँ",description:"इस कार्यक्षेत्र में प्रत्येक भूमिका क्या कर सकती है, यह कॉन्फ़िगर करें।",ownerOnly:"केवल कार्यक्षेत्र का स्वामी ही अनुमतियाँ प्रबंधित कर सकता है।",save:"अनुमतियाँ सहेजें",saving:"सहेजा जा रहा है...",saveSuccess:"अनुमतियाँ सफलतापूर्वक सहेजी गईं"},credits:{title:"क्रेडिट",description:"क्रेडिट का उपयोग AI जनरेशन जैसी प्रीमियम कार्रवाइयों के लिए किया जा सकता है।",balance:"क्रेडिट शेष",available:"उपलब्ध",totalGranted:"कुल प्रदान किया गया",totalConsumed:"कुल उपभोग किया गया",totalExpired:"कुल समाप्त हुआ",noCredits:"अभी कोई क्रेडिट नहीं",noCreditsHint:"जब आपके प्लान द्वारा प्रदान किया जाएगा या खरीदा जाएगा तो क्रेडिट यहाँ दिखाई देंगे।",buyCredits:"क्रेडिट खरीदें",buyAmount:"Buy {count} Credits",purchasing:"रीडायरेक्ट हो रहा है...",packages:"क्रेडिट पैकेज",noPackages:"कोई क्रेडिट पैकेज उपलब्ध नहीं।",creditsAmount:"{count} क्रेडिट",validityDays:"{count} दिनों के लिए मान्य",validityUnlimited:"कोई समाप्ति नहीं",transactions:"हाल की लेनदेन",noTransactions:"अभी कोई लेनदेन नहीं।",loadMore:"Load More",viewAll:"सभी देखें",expiringSoon:"जल्द समाप्त हो रहे हैं",expiringInDays:"{count} क्रेडिट {days} दिनों में समाप्त हो रहे हैं",noExpiring:"कोई क्रेडिट जल्द समाप्त नहीं हो रहे।",type:{plan_grant:"प्लान अनुदान",pack_purchased:"खरीदा गया",consumed:"उपभोग किया गया",expired:"समाप्त",admin_grant:"प्रदान किया गया",admin_revoke:"वापस लिया गया",refund:"वापसी"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"क्रेडिट सफलतापूर्वक खरीदे गए! आपका शेष अपडेट कर दिया गया है।",purchaseCanceled:"क्रेडिट खरीदारी रद्द कर दी गई। कोई शुल्क नहीं लिया गया।",purchaseFailed:"क्रेडिट खरीदारी विफल रही। कृपया पुनः प्रयास करें या सहायता से संपर्क करें।",errorLoading:"क्रेडिट डेटा लोड करने में विफल",insufficientCredits:"पर्याप्त क्रेडिट नहीं"},errors:{networkError:"नेटवर्क त्रुटि: कृपया अपना इंटरनेट कनेक्शन जाँचें",unauthorized:"अनधिकृत - कृपया अपना सत्र जाँचें",notFound:"संसाधन नहीं मिला",generic:"एक त्रुटि हुई",fetchPlans:"प्लान लाने में विफल",fetchPlanGroup:"प्लान ग्रुप लाने में विफल",fetchPlanGroupVersion:"प्लान ग्रुप वर्शन लाने में विफल",fetchPlanGroupVersions:"प्लान ग्रुप वर्शन लाने में विफल",fetchSubscription:"सदस्यता लाने में विफल",createCheckout:"चेकआउट सत्र बनाने में विफल",updateSubscription:"सदस्यता अपडेट करने में विफल",fetchInvoices:"चालान लाने में विफल",fetchInvoice:"चालान लाने में विफल",openBillingPortal:"बिलिंग पोर्टल खोलने में विफल",cancelSubscription:"सदस्यता रद्द करने में विफल",resumeSubscription:"सदस्यता फिर से शुरू करने में विफल",recordUsage:"उपयोग दर्ज करने में विफल",fetchQuotaUsage:"कोटा उपयोग स्थिति लाने में विफल",fetchAllQuotaUsage:"सभी कोटा उपयोग लाने में विफल",fetchUsageLogs:"उपयोग लॉग लाने में विफल",fetchCreditBalance:"क्रेडिट शेष लाने में विफल",consumeCredits:"क्रेडिट उपभोग करने में विफल",purchaseCredits:"क्रेडिट खरीदने में विफल",fetchCreditPackages:"क्रेडिट पैकेज लाने में विफल",fetchCreditTransactions:"क्रेडिट लेनदेन लाने में विफल",fetchExpiringCredits:"समाप्त होने वाले क्रेडिट लाने में विफल"}}});var DE=Object.freeze({__proto__:null,ar:{settings:{titles:{profile:"الحساب",general:"إعدادات مساحة العمل",users:"أعضاء مساحة العمل",subscription:"الخطة والفوترة",usage:"الاستخدام",credits:"الرصيد",features:"ميزات مساحة العمل",notifications:"الإشعارات",permissions:"الصلاحيات",danger:"منطقة الخطر"},sidebar:{account:"الحساب",workspace:"مساحة العمل",profile:"الحساب",general:"الإعدادات",users:"الأعضاء",subscription:"الخطة والفوترة",usage:"الاستخدام",credits:"الرصيد",features:"الميزات",notifications:"الإشعارات",permissions:"الصلاحيات",danger:"منطقة الخطر"},common:{refresh:"تحديث",refreshing:"جارٍ التحديث...",retry:"إعادة المحاولة",retrying:"جارٍ إعادة المحاولة...",save:"حفظ",saving:"جارٍ الحفظ...",cancel:"إلغاء",delete:"حذف",dismiss:"تجاهل",loading:"جارٍ التحميل...",success:"تم بنجاح!",error:"خطأ",refreshAction:"{loading, select, true {جارٍ التحديث...} other {تحديث}}",retryAction:"{loading, select, true {جارٍ إعادة المحاولة...} other {إعادة المحاولة}}",noPermissionTitle:"الوصول مقيد",noPermissionDescription:"ليس لديك إذن للوصول إلى هذا القسم. تواصل مع مسؤول مساحة العمل إذا كنت بحاجة إلى الوصول.",billingManageOnly:"فقط المستخدمون الذين لديهم أذونات إدارة الفواتير يمكنهم تنفيذ هذا الإجراء."}},subscription:{managePlan:"إدارة خطتك وفوترتك",changePlan:"تغيير الخطة",viewPricingPlans:"عرض خطط الأسعار",viewPlans:"عرض الخطط",upgradePlan:"ترقية الآن",subscribe:"اشتراك",currentPlan:"الخطة الحالية",noSubscription:"ليس لديك اشتراك نشط",choosePlan:"اختر خطتك",choosePlanDescription:"قارن بين الخطط واختر ما يناسب احتياجاتك",forWorkspace:"لـ {name}",planUpdateAvailable:"تحديث الخطة متوفر",updateSuccess:"تم تحديث الاشتراك بنجاح!",updateFailed:"فشل التحديث",cancelTitle:"إلغاء الاشتراك",cancelConfirm:"هل أنت متأكد من رغبتك في إلغاء اشتراكك؟",cancelKeep:"الاحتفاظ بالاشتراك",cancelButton:"نعم، إلغاء الاشتراك",cancelTrialTitle:"إلغاء التجربة",cancelTrialConfirm:"هل أنت متأكد من رغبتك في إلغاء فترتك التجريبية؟",cancelTrialAccess:"ستستمر فترتك التجريبية حتى",cancelTrialNoCharge:"لن يتم تحصيل أي رسوم منك — ستنتهي فترتك التجريبية ببساطة",cancelTrialResume:"يمكنك استئناف فترتك التجريبية في أي وقت قبل انتهائها",cancelTrialKeep:"الاحتفاظ بالتجربة",cancelTrialButton:"نعم، إلغاء التجربة",canceling:"جارٍ الإلغاء...",cancelSuccess:"سيتم إلغاء الاشتراك في نهاية فترة الفوترة.",cancelNotCharged:"لن يتم تحصيل رسوم منك مرة أخرى بعد الإلغاء",cancelResumeAnytime:"يمكنك استئناف اشتراكك في أي وقت قبل انتهائه",resumeTitle:"استئناف الاشتراك",resumeTrial:"استئناف التجربة",resumeConfirm:"هل أنت متأكد من رغبتك في استئناف اشتراكك؟",resumeKeep:"إبقاء الإلغاء",resumeButton:"نعم، استئناف الاشتراك",resuming:"جارٍ الاستئناف...",resumeSuccess:"تم استئناف الاشتراك.",managePayment:"إدارة الدفع",openingPortal:"جارٍ الفتح...",viewAllPlans:"عرض جميع الخطط",scheduledCancellation:"تم جدولة إلغاء الاشتراك",scheduledTrialCancellation:"تم جدولة إلغاء التجربة",paymentPastDue:"الدفع متأخر",paymentPastDueDescription:"يرجى تحديث طريقة الدفع لتجنب انقطاع الخدمة.",subscriptionPaused:"الاشتراك موقوف",subscriptionPausedDescription:"اشتراكك موقوف حالياً. استأنف لاستعادة الوصول الكامل.",errorLoading:"خطأ في تحميل بيانات الاشتراك",errorLoadingDescription:"يرجى التحقق من اتصالك والمحاولة مرة أخرى.",errorProcessing:"فشل في معالجة الاشتراك",errorCanceling:"فشل في إلغاء الاشتراك",errorResuming:"فشل في استئناف الاشتراك",invalidWorkspace:"معرّف مساحة العمل غير صالح",billingInterval:{monthly:"شهري",quarterly:"ربع سنوي",yearly:"سنوي",perMonth:"/شهر",perQuarter:"/ربع سنة",perYear:"/سنة"},seats:{title:"المقاعد",members:"الأعضاء",included:"مشمول",billable:"قابل للفوترة",perExtraSeat:"لكل مقعد إضافي",limit:"الحد",includedSeats:"المقاعد المشمولة",maxSeats:"الحد الأقصى للمقاعد",freeWithBase:"مجاني مع السعر الأساسي",allIncluded:"الكل مشمول",extra:"إضافي",unlimited:"غير محدود"},items:{features:"الميزات",limits:"الحدود",quotas:"حصص الاستخدام",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month"},checkout:{upgrade:"ترقية",downgrade:"تخفيض",switchTo:"التبديل إلى",select:"اختيار"},status:{active:"نشط",canceling:"جارٍ الإلغاء",trial:"تجريبي",canceled:"ملغى",pastDue:"متأخر",paused:"موقوف",deprecated:"قديم",unknown:"غير معروف"},plan:"الخطة",invoicesTab:"الفواتير",changePlanButton:"تغيير الخطة",noPlanAssigned:"لم يتم تعيين خطة",free:"مجاني",perSeatDisplay:"+ {price}/مقعد{interval}",estTotalDisplay:"الإجمالي التقديري: {total}{interval} ({count, plural, zero {بدون مقاعد إضافية} one {مقعد إضافي واحد} two {مقعدان إضافيان} few {# مقاعد إضافية} many {# مقعداً إضافياً} other {# مقعد إضافي}})",nextBillingDisplay:"الفوترة التالية: {date}",membersInWorkspace:"{count, plural, zero {لا أعضاء} one {عضو واحد} two {عضوان} few {# أعضاء} many {# عضواً} other {# عضو}} في مساحة العمل",billingInCurrency:"الفوترة بـ {currency}",savingsPercent:"وفّر {percent, number}%",switchToInterval:"التبديل إلى {interval}",seatPriceDisplay:"+ {price}/مقعد{interval} ({included} {includedLabel})",trialEnded:"انتهت فترتك التجريبية.",trialEndsIn:"تنتهي فترتك التجريبية خلال {days, plural, zero {اليوم} one {يوم واحد} two {يومين} few {# أيام} many {# يوماً} other {# يوم}}.",onTrial:"أنت في فترة تجريبية.",upgradeToKeepAccess:"قم بالترقية للحفاظ على الوصول.",viewInvoices:"عرض الفواتير",cancelTrial:"إلغاء التجربة",dunningFinal:"تحذير أخير: سيتم تعليق الاشتراك",dunningSuspended:"الاشتراك معلق",dunningRecovery:"جارٍ استرداد الدفع",dunningSuspendedDescription:"تم تعليق اشتراكك بسبب فشل الدفع المتكرر. حدّث طريقة الدفع لاستعادة الوصول.",dunningRecoveryDescription:"لم نتمكن من معالجة دفعتك. يرجى تحديث طريقة الدفع لتجنب فقدان الوصول.",cancelEndDescription:"سينتهي اشتراكك في",trialEndDescription:"ستنتهي فترتك التجريبية في",cancelEndFallback:"سيتم إلغاء اشتراكك في نهاية فترة الفوترة الحالية. لن يتم تحصيل رسوم منك مرة أخرى.",resumeChargeDate:"سيتم تحصيل الرسوم منك مرة أخرى في",resumeChargeFallback:"تاريخ الفوترة التالي",resumeContinue:"سيستمر اشتراكك تلقائياً وسيتم فوترتك وفقاً لخطتك",resumeCancelAnytime:"يمكنك الإلغاء في أي وقت قبل تاريخ الفوترة التالي إذا غيرت رأيك",retainAccess:"ستحتفظ بالوصول الكامل إلى هذه الخطة حتى",retainAccessFallback:"نهاية فترة الفوترة الحالية",noPlansAvailable:"لا توجد مجموعات خطط متاحة لمساحة العمل هذه. يرجى الاتصال بالدعم إذا كنت تعتقد أن هذا خطأ.",noPlansAvailableHint:"لا توجد مجموعات خطط متاحة لمساحة العمل هذه.",startTrialDescription:"جرب الخطة الكاملة بدون التزام. يمكنك الترقية أو الإلغاء في أي وقت.",noSubscriptionDescription:"اختر خطة للبدء مع مساحة العمل الخاصة بك",startFreeTrial:"ابدأ التجربة المجانية",startTrialDays:"ابدأ تجربة مجانية لمدة {days} يوم",trialBadge:"تجربة {days} يوم"},users:{title:"أعضاء مساحة العمل",adminOnly:"فقط مدير مساحة العمل يمكنه إدارة المستخدمين والأدوار.",inviteByEmail:"دعوة عضو عبر البريد الإلكتروني",inviteButton:"دعوة",inviting:"جارٍ الدعوة...",inviteSuccess:"تمت دعوة المستخدم بنجاح",emailRequired:"البريد الإلكتروني مطلوب",invalidEmail:"صيغة البريد الإلكتروني غير صالحة",inviteFailed:"فشل في دعوة العضو",seatLimitReached:"تم الوصول لحد المقاعد",memberLimitReached:"تم الوصول لحد الأعضاء",role:"الدور",you:"أنت",owner:"المالك",noMembers:"لم يتم العثور على أعضاء في مساحة العمل هذه.",extraSeatCost:"كل عضو إضافي يضيف {price}/{interval, select, yearly {سنة} quarterly {ربع سنة} other {شهر}} لاشتراكك",unknownUser:"مستخدم غير معروف",seats:"المقاعد",members:"الأعضاء",included:"مشمول",perExtraSeat:"/مقعد إضافي",maxMembers:"الحد الأقصى للأعضاء",available:"متاح",noMemberLimit:"لا حد للأعضاء",seatHeading:"{hasSeatPricing, select, true {المقاعد} other {الأعضاء}}",limitReached:"{reason, select, seat_limit_reached {تم الوصول لحد المقاعد} other {تم الوصول لحد الأعضاء}}",memberCount:"{count, plural, zero {لا أعضاء} one {عضو واحد} two {عضوان} few {# أعضاء} many {# عضواً} other {# عضو}}",subscriptionRequired:"الاشتراك مطلوب لدعوة الأعضاء.",seatLimitMessage:"خطتك تسمح بحد أقصى {maxUsers, number} {maxUsers, plural, zero {أعضاء} one {عضو} two {عضوين} few {أعضاء} many {عضواً} other {عضو}}. قم بالترقية للحصول على مقاعد إضافية.",settingsLimitMessage:"مساحة العمل هذه تسمح بحد أقصى {maxUsers, number} {maxUsers, plural, zero {أعضاء} one {عضو} two {عضوين} few {أعضاء} many {عضواً} other {عضو}}.",memberLimitMessage:"تم الوصول لحد الأعضاء: {maxUsers, number}.",selectRole:"اختر دوراً",inviteAs:"دعوة كـ {role}"},invoices:{title:"سجل الفوترة",description:"عرض وتحميل فواتيرك",pay:"دفع",view:"عرض",viewDetails:"عرض التفاصيل",download:"PDF",errorLoading:"خطأ في تحميل الفواتير",noInvoices:"لا توجد فواتير بعد. اشترك في خطة لاستلام الفواتير.",noInvoicesWithSub:"لم يتم العثور على فواتير مع خيار التحميل",paidAmount:"المدفوع: {amount}",na:"غ/م",status:{draft:"مسودة",open:"مفتوح",paid:"مدفوع",uncollectible:"غير قابل للتحصيل",void:"ملغى"}},usage:{title:"الاستخدام",description:"راقب استهلاك مواردك وحصصك",totalResources:"إجمالي الموارد",overallUsage:"الاستخدام الإجمالي",inOverage:"تجاوز الحد",estOverageCost:"التكلفة التقديرية للتجاوز",overageDetected:"تم اكتشاف تجاوز",overageDescription:"سيتم فوترة الاستخدام الإضافي كتجاوز في فاتورتك التالية.",overageUnits:"وحدات التجاوز",rate:"المعدل",billableBlocks:"الكتل القابلة للفوترة",estimatedCharge:"الرسوم التقديرية",noData:"لا تتوفر بيانات استخدام الحصص لمساحة العمل هذه.",noDataHint:"ستظهر الحصص هنا عندما تتضمن خطتك موارد مقاسة.",used:"مستخدم",remaining:"متبقٍ",overLimit:"فوق الحد",percentUsed:"{percent, number}% مستخدم",availableRemaining:"{count} متبقٍ",overLimitCount:"{count} فوق الحد",overageWarning:"{count, plural, zero {لم تتجاوز أي موارد الحصة المشمولة.} one {مورد واحد تجاوز الحصة المشمولة.} two {مورداً تجاوزا الحصة المشمولة.} few {# موارد تجاوزت الحصة المشمولة.} many {# مورداً تجاوز الحصة المشمولة.} other {# مورد تجاوز الحصة المشمولة.}} سيتم فوترة الاستخدام الإضافي كتجاوز في فاتورتك التالية.",fullyUsed:"مستخدم بالكامل",renewingSoon:"يتجدد قريباً",almostFull:"ممتلئ تقريباً",overage:"تجاوز",errorLoading:"فشل في تحميل بيانات الاستخدام",perUnit:"/ وحدة",perUnits:"/ وحدات",rateDisplay:"{rate} {unitSize, plural, =1 {/ وحدة} other {/ {unitSize, number} وحدة}}",resourcesExceeded:"{count, plural, zero {لم تتجاوز أي موارد الحصة المشمولة.} one {مورد واحد تجاوز الحصة المشمولة.} two {مورداً تجاوزا الحصة المشمولة.} few {# موارد تجاوزت الحصة المشمولة.} many {# مورداً تجاوز الحصة المشمولة.} other {# مورد تجاوز الحصة المشمولة.}}",estOverageCharges:"الرسوم التقديرية للتجاوز في هذه الفترة: {amount}",overageRateDisplay:"معدل التجاوز: {rate}",resetDateDisplay:"يتم إعادة تعيين الاستخدام في {date}",daysRemainingDisplay:"{count, plural, zero {اليوم} one {يوم واحد متبقٍ} two {يومان متبقيان} few {# أيام متبقية} many {# يوماً متبقياً} other {# يوم متبقٍ}}"},profile:{email:"البريد الإلكتروني",name:"الاسم",language:"اللغة",country:"البلد",currency:"العملة",timezone:"المنطقة الزمنية",profileImage:"صورة الملف الشخصي",success:"تم حفظ الملف الشخصي بنجاح",nameMinLength:"يجب أن يتكون الاسم من حرفين على الأقل.",save:"حفظ",reset:"إعادة تعيين"},general:{ownerOnly:"فقط مالك مساحة العمل يمكنه تغيير إعدادات مساحة العمل.",name:"الاسم",namePlaceholder:"مساحة العمل الرائعة",nameMinLength:"يجب أن يتكون اسم مساحة العمل من حرفين على الأقل.",billingCurrency:"عملة الفوترة",icon:"الأيقونة",iconDescription:"اختر رمزاً تعبيرياً أو حمّل صورة مخصصة لمساحة العمل.",imageUrl:"رابط الصورة",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"أدخل رابطاً صالحاً لصورة مساحة العمل. الصيغ المدعومة: PNG و JPG و SVG.",previewLabel:"معاينة:",success:"تم حفظ إعدادات مساحة العمل بنجاح",chooseEmoji:"اختر رمزاً تعبيرياً",customImageUrl:"رابط صورة مخصص",updateWorkspace:"تحديث مساحة العمل"},features:{title:"ميزات مساحة العمل",ownerOnly:"فقط مالك مساحة العمل يمكنه تغيير الميزات.",noFeatures:"لا توجد ميزات لإدارتها.",enabled:"مفعّل",disabled:"معطّل",enabling:"جارٍ التفعيل",disabling:"جارٍ التعطيل",featureSuccess:"بنجاح",updateSuccess:"تم {enabled, select, true {تفعيل} other {تعطيل}} {feature} بنجاح",actionStatus:"{action, select, enabling {جارٍ التفعيل} disabling {جارٍ التعطيل} other {}}"},danger:{title:"حذف مساحة العمل",adminOnly:"فقط مديرو مساحة العمل يمكنهم حذف مساحات العمل.",deleteWorkspace:"حذف مساحة العمل",deleteConfirm:"هل أنت متأكد تماماً؟",deleteWarning:"لا يمكن التراجع عن هذا الإجراء. سيتم حذف مساحة العمل وجميع البيانات المرتبطة نهائياً.",deleting:"جارٍ الحذف...",deleteDescription:"بمجرد حذف مساحة العمل لا يمكن العودة. سيتم حذف مساحة العمل وجميع بياناتها نهائياً، بما في ذلك الأعضاء والإعدادات والميزات.",deleteConfirmDescription:"لا يمكن التراجع عن هذا الإجراء. سيتم حذف مساحة العمل وجميع بياناتها نهائياً.",failedToDelete:"فشل في حذف مساحة العمل"},notifications:{title:"تفضيلات الإشعارات",permissionDenied:"تم رفض إذن الإشعارات",notSupported:"الإشعارات الفورية غير مدعومة في هذا المتصفح.",manageDescription:"أدِر كيفية تلقي الإشعارات من مساحة العمل هذه.",blocked:"الإشعارات محظورة",blockedDescription:"لقد حظرت الإشعارات لهذا الموقع سابقاً. لتفعيلها، حدّث إعدادات متصفحك:",pushTitle:"الإشعارات الفورية",pushEnabledDescription:"ستتلقى إشعارات المتصفح للتحديثات المهمة.",pushDisabledDescription:"احصل على إشعارات حول مشاكل الدفع وانتهاء التجربة والتحديثات المهمة الأخرى.",enabling:"جارٍ التفعيل...",disabling:"جارٍ التعطيل...",enable:"تفعيل",disable:"تعطيل",toggleAction:"{loading, select, true {{subscribed, select, true {جارٍ التعطيل...} other {جارٍ التفعيل...}}} other {{subscribed, select, true {تعطيل} other {تفعيل}}}}",pushDescription:"{subscribed, select, true {ستتلقى إشعارات المتصفح للتحديثات المهمة.} other {احصل على إشعارات حول مشاكل الدفع وانتهاء التجربة والتحديثات المهمة الأخرى.}}",deviceNote:"يتم إرسال الإشعارات إلى هذا الجهاز. فعّلها على الأجهزة الأخرى بشكل منفصل.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},unblock:{firefox:{step1:"انقر على أيقونة القفل (أو الدرع) في شريط العنوان",step2:'ابحث عن "Notifications" في قائمة الأذونات',step3:'غيّر من "Blocked" إلى "Allow"',step4:"أعد تحميل هذه الصفحة"},safari:{step1:"افتح Safari ← الإعدادات ← مواقع الويب ← الإشعارات",step2:"ابحث عن هذا الموقع في القائمة",step3:'غيّر من "Deny" إلى "Allow"',step4:"أعد تحميل هذه الصفحة"},edge:{step1:"انقر على أيقونة القفل في شريط العنوان",step2:'انقر على "Permissions for this site"',step3:'اضبط "Notifications" على "Allow"',step4:"أعد تحميل هذه الصفحة"},chrome:{step1:"انقر على أيقونة القفل (أو الضبط) في شريط العنوان",step2:'انقر على "Site settings"',step3:'اضبط "Notifications" على "Allow"',step4:"أعد تحميل هذه الصفحة"}}},quota:{includedOnly:"{count, number} مشمول",includedWithOverage:"{count, number} مشمول، ثم {price} / {unit}",includedHardLimit:"{count, number} مشمول (حد أقصى)",unitFallback:"وحدة"},pricing:{title:"اختر خطتك",description:"قارن بين الخطط واختر ما يناسب احتياجاتك",currency:"العملة",billingIn:"الفوترة بـ",noPlansCurrency:"لا توجد خطط متاحة لعملة الفوترة الخاصة بك.",noPlansCurrencyHint:"حدث خطأ ما. يرجى الاتصال بالدعم.",noPlans:"لا توجد خطط متاحة",free:"مجاني",included:"مشمول",save:"وفّر",current:"الحالي",processing:"جارٍ المعالجة...",unavailable:"غير متاح",selectCurrency:"اختر عملة الفوترة",billingInterval:"فترة الفوترة"},beta:{nameLabel:"الاسم",emailLabel:"البريد الإلكتروني",submitText:"إرسال",submittingText:"جارٍ الإرسال...",errorMessage:"حدث خطأ",tryAgain:"حاول مرة أخرى",privacyConsent:"بإرسال هذا النموذج، فإنك توافق على",privacyPolicy:"سياسة الخصوصية",and:"و",termsOfService:"شروط الخدمة"},workspace:{switchTitle:"تبديل مساحة العمل",switchDescription:"اختر مساحة عمل للتبديل إليها أو أنشئ واحدة جديدة.",notLoggedIn:"يبدو أنك لم تسجل الدخول. يرجى تسجيل الدخول للمتابعة.",availableWorkspaces:"مساحات العمل المتاحة ({count, number})",loadingWorkspaces:"جارٍ تحميل مساحات العمل...",searchPlaceholder:"بحث في مساحات العمل...",noWorkspacesFound:"لم يتم العثور على مساحات عمل",noWorkspacesAvailable:"لا تتوفر مساحات عمل",switchTo:"التبديل إلى",membersCount:"{count, plural, zero {لا أعضاء} one {عضو واحد} two {عضوان} few {# أعضاء} many {# عضواً} other {# عضو}}",createNew:"إنشاء مساحة عمل جديدة",createTitle:"إنشاء مساحة عمل جديدة",createDescription:"أنشئ مساحة عمل جديدة للبدء.",workspaceName:"اسم مساحة العمل",workspaceNamePlaceholder:"مساحة العمل الرائعة",workspaceNameMinLength:"يجب أن يتكون اسم مساحة العمل من حرفين على الأقل.",workspaceIcon:"أيقونة مساحة العمل",iconDescription:"اختر رمزاً تعبيرياً أو حمّل صورة مخصصة لمساحة العمل.",chooseEmoji:"اختر رمزاً تعبيرياً",customImageUrl:"رابط صورة مخصص",imageUrl:"رابط الصورة",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"أدخل رابطاً صالحاً لصورة مساحة العمل. الصيغ المدعومة: PNG و JPG و SVG.",invalidUrl:"يرجى إدخال رابط صالح",creating:"جارٍ الإنشاء...",createWorkspace:"إنشاء مساحة العمل"},dropdowns:{search:"بحث...",chooseOption:"اختر خياراً",chooseCountry:"اختر البلد",searchCountry:"اختر البلد...",chooseLanguage:"اختر اللغة",searchLanguage:"اختر اللغة...",chooseCurrency:"اختر العملة",searchCurrency:"اختر العملة...",chooseTimezone:"اختر المنطقة الزمنية",searchTimezone:"اختر المنطقة الزمنية..."},push:{failedToSubscribe:"فشل في الاشتراك في الإشعارات الفورية",failedToUnsubscribe:"فشل في إلغاء الاشتراك من الإشعارات الفورية"},permissions:{title:"الصلاحيات",description:"قم بتكوين ما يمكن لكل دور القيام به في مساحة العمل هذه.",ownerOnly:"يمكن لمالك مساحة العمل فقط إدارة الصلاحيات.",save:"حفظ الصلاحيات",saving:"جارٍ الحفظ...",saveSuccess:"تم حفظ الصلاحيات بنجاح"},credits:{title:"الرصيد",description:"يمكن استخدام الرصيد للإجراءات المميزة مثل التوليد بالذكاء الاصطناعي.",balance:"رصيد الائتمان",available:"متاح",totalGranted:"إجمالي الممنوح",totalConsumed:"إجمالي المستهلك",totalExpired:"إجمالي المنتهي",noCredits:"لا يوجد رصيد بعد",noCreditsHint:"سيظهر الرصيد هنا عند منحه من خطتك أو شرائه.",buyCredits:"شراء رصيد",buyAmount:"Buy {count} Credits",purchasing:"جارٍ إعادة التوجيه...",packages:"حزم الرصيد",noPackages:"لا تتوفر حزم رصيد.",creditsAmount:"{count} رصيد",validityDays:"صالح لمدة {count} يوم",validityUnlimited:"بدون انتهاء صلاحية",transactions:"المعاملات الأخيرة",noTransactions:"لا توجد معاملات بعد.",loadMore:"Load More",viewAll:"عرض الكل",expiringSoon:"ينتهي قريباً",expiringInDays:"{count} رصيد ينتهي خلال {days} يوم",noExpiring:"لا يوجد رصيد ينتهي قريباً.",type:{plan_grant:"منحة الخطة",pack_purchased:"تم الشراء",consumed:"مستهلك",expired:"منتهي",admin_grant:"ممنوح",admin_revoke:"مسحوب",refund:"استرداد"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"تم شراء الرصيد بنجاح! تم تحديث رصيدك.",purchaseCanceled:"تم إلغاء شراء الرصيد. لم يتم تحصيل أي رسوم.",purchaseFailed:"فشل شراء الرصيد. يرجى المحاولة مرة أخرى أو التواصل مع الدعم.",errorLoading:"فشل في تحميل بيانات الرصيد",insufficientCredits:"رصيد غير كافٍ"},errors:{networkError:"خطأ في الشبكة: يرجى التحقق من اتصالك بالإنترنت",unauthorized:"غير مصرح - يرجى التحقق من جلستك",notFound:"المورد غير موجود",generic:"حدث خطأ",fetchPlans:"فشل في جلب الخطط",fetchPlanGroup:"فشل في جلب مجموعة الخطط",fetchPlanGroupVersion:"فشل في جلب إصدار مجموعة الخطط",fetchPlanGroupVersions:"فشل في جلب إصدارات مجموعة الخطط",fetchSubscription:"فشل في جلب الاشتراك",createCheckout:"فشل في إنشاء جلسة الدفع",updateSubscription:"فشل في تحديث الاشتراك",fetchInvoices:"فشل في جلب الفواتير",fetchInvoice:"فشل في جلب الفاتورة",openBillingPortal:"فشل في فتح بوابة الفوترة",cancelSubscription:"فشل في إلغاء الاشتراك",resumeSubscription:"فشل في استئناف الاشتراك",recordUsage:"فشل في تسجيل الاستخدام",fetchQuotaUsage:"فشل في جلب حالة استخدام الحصص",fetchAllQuotaUsage:"فشل في جلب جميع استخدامات الحصص",fetchUsageLogs:"فشل في جلب سجلات الاستخدام",fetchCreditBalance:"فشل في جلب رصيد الائتمان",consumeCredits:"فشل في استهلاك الرصيد",purchaseCredits:"فشل في شراء الرصيد",fetchCreditPackages:"فشل في جلب حزم الرصيد",fetchCreditTransactions:"فشل في جلب معاملات الرصيد",fetchExpiringCredits:"فشل في جلب الرصيد المنتهي قريباً"}}});const IE={[Ya.Monthly]:"subscription.billingInterval.perMonth",[Ya.Quarterly]:"subscription.billingInterval.perQuarter",[Ya.Yearly]:"subscription.billingInterval.perYear"},ME=(e,t,r)=>{if(!e||0===e)return null;let n;switch(r){case Ya.Yearly:n=t/12;break;case Ya.Quarterly:n=t/3;break;default:return null}const a=(e-n)/e*100;return a>0?Math.round(a):null};var UE=Object.freeze({__proto__:null,default:({open:n,onOpenChange:i,planVersions:s,currentPlanVersionId:c,currentStripePriceId:l,billingCurrency:d,currentMemberCount:p,trialUsedAt:h,workspaceName:f,initialInterval:g,initialCurrency:b,onSelectPlan:v,loading:y=!1})=>{const[w,x]=m(!1),{t:k,formattingLocale:S,dir:C,fmtNum:N,fmtCents:E}=Cn(),{settings:A}=Vn(),_=A?.workspace?.mode===nS,P=(e,t)=>null==e||0===e?"":E(e,t),T=e=>k(IE[e]??IE[Ya.Monthly]),[R,D]=m(null),I=a.useRef(!1),M=o(()=>Ni(l,s),[l,s]),U=M?.interval??null,L=M?.currency??null,O=o(()=>function(e){const t=new Set;for(const r of e)r.pricingVariants?.forEach(e=>{e.currency&&t.add(e.currency.toLowerCase())});return Array.from(t).sort()}(s),[s]),z=o(()=>{const e=d?.trim().toLowerCase();return e?O.includes(e)?[e]:[]:O},[d,O]),[F,B]=m(g||U||Ya.Monthly),[W,V]=m(()=>b&&z.includes(b)?b:L&&z.includes(L)?L:z.length>0?z[0]:""),G=d?.trim()||W;u(()=>{if(n){B(g||U||Ya.Monthly);const e=b||L;e&&z.includes(e)?V(e):z.length>0&&!z.includes(W)&&V(z[0])}},[n,g,b,U,L,z]);const H=o(()=>[...s],[s]),j=(e=>{const t=new Map;return e.forEach(e=>{e.subscriptionItems?.forEach(e=>{t.has(e._id)||t.set(e._id,e)})}),Array.from(t.values())})(H),$=j.filter(e=>e.type===ci),K=j.filter(e=>e.type===li),q=j.filter(e=>e.type===di),Z=async e=>{if(!(e===c&&U===F||y||w||I.current)){I.current=!0,x(!0),D(e);try{await v(e,F,G),i(!1)}catch(e){}finally{I.current=!1,x(!1),D(null)}}},J=e=>ki(e,G,F),Y=e=>!!e.pricingVariants?.some(e=>e.currency?.toLowerCase()===G.toLowerCase()),X=y||w,Q=e=>{switch(e){case Ya.Monthly:return k("subscription.billingInterval.monthly");case Ya.Quarterly:return k("subscription.billingInterval.quarterly");case Ya.Yearly:return k("subscription.billingInterval.yearly");default:return k("subscription.billingInterval.monthly")}},ee=e=>{const t=e._id===c,r=U===F;if(t&&r)return{labelKey:"subscription.currentPlan",variant:"outline",disabled:!0};if(t&&!r)return e.plan?.isFreemium?{labelKey:"subscription.currentPlan",variant:"outline",disabled:!0}:{labelKey:"_dynamic",dynamicLabel:k("subscription.switchToInterval",{interval:Q(F)}),variant:"default",disabled:!1};const n=e.trial?.enabled&&e.trial.durationDays>0&&!h&&!l;if(!c)return n?{labelKey:"_dynamic",dynamicLabel:k("subscription.startTrialDays",{days:e.trial.durationDays}),variant:"default",disabled:!1}:{labelKey:"subscription.subscribe",variant:"default",disabled:!1};const a=H.findIndex(e=>e._id===c),i=H.findIndex(t=>t._id===e._id);return-1===a||-1===i?n?{labelKey:"_dynamic",dynamicLabel:k("subscription.startTrialDays",{days:e.trial.durationDays}),variant:"default",disabled:!1}:{labelKey:"subscription.checkout.select",variant:"default",disabled:!1}:i<a?{labelKey:"subscription.checkout.downgrade",variant:"outline",disabled:!1}:i>a?n?{labelKey:"_dynamic",dynamicLabel:k("subscription.startTrialDays",{days:e.trial.durationDays}),variant:"default",disabled:!1}:{labelKey:"subscription.checkout.upgrade",variant:"default",disabled:!1}:{labelKey:"subscription.checkout.select",variant:"default",disabled:!1}},te=(e,t,r=Ya.Monthly)=>{if(t.type===ci)return e.features?.[t.slug]??!1;if(t.type===li)return e.limits?.[t.slug]??null;if(t.type===di){const n=Ci(e,G,t.slug,r);return n||tS(e.quotas?.[t.slug],r)}return null},re=(e,t,r)=>{if(t.type===ci)return!0===e?"✓":"—";if(t.type===li)return null!=e&&"number"==typeof e?N(e):"—";if(t.type===di){const n=rS("object"==typeof e&&null!==e&&"included"in e?e:null,t.name.toLowerCase(),{currency:r,locale:S});return n?n.allowOverage?n.hasOverage?k("quota.includedWithOverage",{count:n.included,price:n.price,unit:n.unit}):k("quota.includedOnly",{count:n.included}):k("quota.includedHardLimit",{count:n.included}):"—"}return"—"};return t(xl,{open:n,onOpenChange:i,children:e(Nl,{dir:C,className:"inset-0 w-screen h-screen max-w-none rounded-none translate-x-0 translate-y-0 p-0 flex flex-col",children:[e("div",{className:"flex-shrink-0 px-4 py-4 sm:px-6 sm:py-6 border-b space-y-3 sm:space-y-4",children:[e("div",{children:[t(Al,{className:"text-xl sm:text-2xl font-bold",children:k("pricing.title")}),e(_l,{className:"mt-1 text-sm",children:[k("subscription.choosePlanDescription"),f&&t("span",{className:"ml-1 font-medium text-foreground",children:k("subscription.forWorkspace",{name:f})})]})]}),e("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 sm:gap-4",children:[e("div",{className:"flex items-center gap-2",children:[!d?.trim()&&z.length>1&&e(r,{children:[t("span",{className:"text-sm text-slate-600",children:k("pricing.currency")}),t("select",{"aria-label":k("pricing.selectCurrency"),value:W,onChange:e=>V(e.target.value),className:"rounded-md border border-slate-200 bg-white px-3 py-2 text-sm font-medium text-slate-900 shadow-sm focus:outline-none focus:ring-2 focus:ring-primary",children:z.map(e=>{const r=Hl(e);return t("option",{value:e,children:r?`${r} ${e.toUpperCase()}`:e.toUpperCase()},e)})})]}),d?.trim()&&t("span",{className:"text-xs text-slate-500",children:k("subscription.billingInCurrency",{currency:d.toUpperCase()})})]}),t("div",{className:"flex items-center gap-0.5 sm:gap-1 p-1 bg-slate-100 rounded-lg w-full sm:w-auto",role:"group","aria-label":k("pricing.billingInterval"),children:[Ya.Monthly,Ya.Quarterly,Ya.Yearly].map(r=>{const n=U===r;return t("button",{onClick:()=>B(r),"aria-pressed":F===r,className:"flex-1 sm:flex-initial px-3 sm:px-4 py-2 text-sm font-medium rounded-md transition-all relative "+(F===r?"bg-white text-slate-900 shadow-sm":"text-slate-600 hover:text-slate-900"),children:e("span",{className:"flex items-center justify-center gap-1 sm:gap-1.5",children:[r===Ya.Monthly&&k("subscription.billingInterval.monthly"),r===Ya.Quarterly&&k("subscription.billingInterval.quarterly"),r===Ya.Yearly&&k("subscription.billingInterval.yearly"),r===Ya.Yearly&&t("span",{className:"text-[10px] sm:text-xs px-1 sm:px-1.5 py-0.5 bg-emerald-100 text-emerald-700 rounded-full font-semibold",children:k("pricing.save")}),n&&c&&t("span",{className:"hidden sm:inline text-xs px-1.5 py-0.5 bg-blue-100 text-blue-700 rounded-full font-semibold",children:k("pricing.current")})]})},r)})})]})]}),t("div",{className:"flex-1 min-h-0 flex flex-col",children:d?.trim()&&0===z.length?e("div",{className:"text-center py-12 px-4",children:[t("p",{className:"text-slate-600 font-medium",children:k("pricing.noPlansCurrency")}),t("p",{className:"text-slate-500 text-sm mt-2",children:k("pricing.noPlansCurrencyHint")})]}):0===H.length?t("div",{className:"text-center py-12 text-gray-500",children:t("p",{children:k("pricing.noPlans")})}):e("div",{className:"flex-1 min-h-0 overflow-hidden bg-white",children:[t("div",{className:"md:hidden overflow-auto h-full",style:{maxHeight:"calc(100vh - 13rem)"},children:t("div",{className:"p-4 space-y-4",children:H.map(r=>{const n=r._id===c,a=ee(r),i=X&&r._id===R,s=J(r),o=Y(r),d=r.pricingVariants?.length&&r.pricingVariants.some(e=>e.currency?.toLowerCase()===G.toLowerCase())?G:r.plan?.currency??G??"",u=ki(r,G,Ya.Monthly)??0,m=F!==Ya.Monthly&&null!==s?ME(u,s,F):null,f=Ei(r,G),g=f?Ai(r,G,F):null;return e("div",{className:"rounded-xl border-2 p-4 "+(n?"border-blue-500 bg-blue-50/30":"border-slate-200 bg-white"),children:[e("div",{className:"flex items-start justify-between mb-3",children:[e("div",{children:[e("div",{className:"flex items-center gap-2",children:[t("h3",{className:"text-lg font-bold text-slate-900",children:r.plan.name}),r.trial?.enabled&&r.trial.durationDays>0&&!n&&!h&&!l&&t("span",{className:"shrink-0 rounded-md bg-emerald-100 text-emerald-700 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider",children:k("subscription.trialBadge",{days:r.trial.durationDays})})]}),r.plan.description&&t("p",{className:"text-xs text-slate-500 mt-0.5 line-clamp-2",children:r.plan.description})]}),n&&t("span",{className:"shrink-0 rounded-md bg-blue-600 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",children:k("pricing.current")})]}),e("div",{className:"mb-4",children:[e("div",{className:"flex items-baseline gap-1 whitespace-nowrap",children:[t("span",{className:"text-2xl font-bold text-slate-900",children:o&&null!==s||o?P(s,d)||k("pricing.free"):"—"}),null!==s&&s>0&&o&&t("span",{className:"text-sm text-slate-500",children:T(F)})]}),null!==m&&m>0&&o&&t("span",{className:"text-xs text-emerald-600 font-medium",children:k("subscription.savingsPercent",{percent:m})}),f?.enabled&&g&&g>0&&!_&&t("div",{className:"text-xs text-slate-500 mt-1",children:k("subscription.seatPriceDisplay",{price:E(g,d),interval:T(F),included:N(f.includedSeats),includedLabel:k("pricing.included")})})]}),$.length>0&&e("div",{className:"mb-3",children:[t("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-1.5",children:k("subscription.items.features")}),t("div",{className:"space-y-1",children:$.map(n=>{const a=te(r,n,F),i=n.type===ci&&!0===a;return e("div",{className:"flex items-center gap-2 text-sm",children:[n.type===ci?t("span",i?{className:"text-emerald-500 text-xs",children:"✓"}:{className:"text-slate-300 text-xs",children:"✕"}):null,t("span",{className:i?"text-slate-700":"text-slate-400",children:n.name})]},n._id)})})]}),K.length>0&&e("div",{className:"mb-3",children:[t("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-1.5",children:k("subscription.items.limits")}),t("div",{className:"space-y-1",children:K.map(n=>{const a=te(r,n,F);return e("div",{className:"flex items-center justify-between text-sm",children:[t("span",{className:"text-slate-600",children:n.name}),t("span",{className:"font-medium text-slate-700",children:"number"==typeof a?N(a):"—"})]},n._id)})})]}),f?.enabled&&!_&&e("div",{className:"mb-3",children:[t("div",{className:"text-xs font-semibold text-emerald-600 uppercase tracking-wider mb-1.5",children:k("subscription.seats.title")}),e("div",{className:"space-y-1 text-sm",children:[e("div",{className:"flex justify-between",children:[t("span",{className:"text-slate-600",children:k("subscription.seats.included")}),t("span",{className:"font-medium",children:N(f.includedSeats||0)})]}),e("div",{className:"flex justify-between",children:[t("span",{className:"text-slate-600",children:k("subscription.seats.maxSeats")}),t("span",{className:"font-medium",children:(f?.maxSeats??0)>0?N(f.maxSeats):k("subscription.seats.unlimited")})]}),null!=p&&p>0&&(()=>{const r=Math.max(0,p-(f.includedSeats||0));return e("div",{className:"flex justify-between",children:[t("span",{className:"text-slate-600",children:k("subscription.seats.billable")}),t("span",{className:"font-medium "+(0===r?"text-emerald-600":"text-amber-600"),children:0===r?k("subscription.seats.allIncluded"):`${N(r)} ${k("subscription.seats.extra")}`})]})})()]})]}),r.creditGrant?.enabled&&"object"==typeof r.creditGrant.creditPackage&&null!==r.creditGrant.creditPackage&&e("div",{className:"mb-3",children:[t("div",{className:"text-xs font-semibold text-purple-600 uppercase tracking-wider mb-1.5",children:k("subscription.items.credits")}),e("div",{className:"space-y-1 text-sm",children:[e("div",{className:"flex justify-between",children:[t("span",{className:"text-slate-600",children:r.creditGrant.renewOnPeriod?k("subscription.items.creditsPerMonth"):k("subscription.items.creditsOneTime")}),t("span",{className:"font-semibold text-purple-700",children:N(r.creditGrant.creditPackage.creditAmount)})]}),e("div",{className:"flex justify-between",children:[t("span",{className:"text-slate-600",children:k("subscription.items.creditRenewal")}),t("span",{className:"font-medium text-slate-700",children:r.creditGrant.renewOnPeriod?"reset"===r.creditGrant.mode?k("subscription.items.creditModeReset"):k("subscription.items.creditModeTopup"):k("subscription.items.creditModeLifetime")})]})]})]}),t(Bs,{className:"w-full mt-2",variant:a.variant,disabled:a.disabled||X||!o,progress:i,onClick:()=>Z(r._id),children:i?k("pricing.processing"):o?a.dynamicLabel??k(a.labelKey):k("pricing.unavailable")})]},r._id)})})}),t("div",{className:"hidden md:block overflow-auto h-full",style:{maxHeight:"calc(100vh - 12rem)"},children:e("table",{className:"w-full border-separate border-spacing-0",style:{minWidth:260+220*H.length+"px",borderCollapse:"separate"},children:[e("colgroup",{children:[t("col",{style:{width:260,minWidth:260}}),H.map(e=>t("col",{style:{width:220,minWidth:220}},e._id))]}),t("thead",{children:e("tr",{className:"align-top",children:[t("th",{className:"sticky top-0 start-0 z-30 p-0 bg-white text-start"}),H.map(r=>{const n=r._id===c,a=ee(r),i=X&&r._id===R,s=J(r),o=ki(r,G,Ya.Monthly)??0,d=F!==Ya.Monthly&&null!==s?ME(o,s,F):null,u=Y(r),p=r.pricingVariants?.length&&r.pricingVariants.some(e=>e.currency?.toLowerCase()===G.toLowerCase())?G:r.plan?.currency??G??"";return t("th",{className:"sticky top-0 z-20 border-b border-slate-200 p-3 shadow-[0_2px_4px_-2px_rgba(0,0,0,0.06)] "+(r._id===c?"bg-blue-50/80":"bg-white"),children:e("div",{className:"flex h-full flex-col gap-2",children:[e("div",{className:"flex items-center justify-between gap-2",children:[e("div",{className:"flex items-center gap-2 min-w-0",children:[t("h3",{className:"text-base font-bold text-slate-900 truncate",children:r.plan.name}),r.trial?.enabled&&r.trial.durationDays>0&&!n&&!h&&!l&&t("span",{className:"shrink-0 rounded-md bg-emerald-100 text-emerald-700 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider",children:k("subscription.trialBadge",{days:r.trial.durationDays})})]}),n&&t("span",{className:"shrink-0 rounded-md bg-blue-600 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",children:k("pricing.current")})]}),e("div",{className:"flex flex-col items-start min-h-[3rem]",children:[e("div",{className:"flex items-baseline gap-1 flex-wrap",children:[t("span",{className:"text-2xl font-bold text-slate-900",children:u&&null!==s||u?P(s,p)||k("pricing.free"):"—"}),null!==s&&s>0&&u&&t("span",{className:"text-sm text-slate-500",children:T(F)}),null!==d&&d>0&&u&&t("span",{className:"text-[10px] px-1.5 py-0.5 bg-emerald-100 text-emerald-700 rounded-full font-semibold whitespace-nowrap",children:k("subscription.savingsPercent",{percent:d})})]}),(()=>{if(_)return null;const e=Ei(r,G);if(!e)return null;const n=Ai(r,G,F);return!n||n<=0?null:t("div",{className:"text-[11px] text-slate-500 mt-1.5 border-t border-slate-100 pt-1 leading-tight",children:t("div",{children:k("subscription.seatPriceDisplay",{price:E(n,p),interval:T(F),included:N(e.includedSeats),includedLabel:k("pricing.included")})})})})()]}),r.plan.description&&t("p",{className:"text-xs text-slate-500 line-clamp-2 leading-relaxed text-start",children:r.plan.description}),t(Bs,{className:"mt-auto w-full",variant:a.variant,disabled:a.disabled||X||!u,progress:i,onClick:()=>Z(r._id),children:i?k("pricing.processing"):u?a.dynamicLabel??k(a.labelKey):k("pricing.unavailable")})]})},r._id)})]})}),e("tbody",{children:[$.length>0&&e(r,{children:[e("tr",{children:[t("td",{className:"sticky start-0 z-10 border-t border-slate-200 bg-slate-100 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-slate-600 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:k("subscription.items.features")}),t("td",{colSpan:H.length,className:"border-t border-slate-200 bg-slate-100"})]}),$.map(r=>e("tr",{className:"group hover:bg-slate-50/50",children:[e("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[t("div",{className:"font-medium text-sm text-slate-900",children:r.name}),r.description&&t("div",{className:"text-xs text-slate-500 mt-0.5",children:r.description})]}),H.map(e=>{const n=te(e,r,F),a=e.pricingVariants?.length?G:e.plan?.currency??G??"",i=re(n,r,a),s=r.type===ci&&!0===n;return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(e._id===c?"bg-blue-50/50":"bg-white"),children:t("span",{className:"text-sm font-medium "+(s?"text-emerald-600":"—"===i?"text-slate-400":"text-slate-700"),children:i})},e._id)})]},r._id))]}),K.length>0&&e(r,{children:[e("tr",{children:[t("td",{className:"sticky start-0 z-10 border-t border-slate-200 bg-slate-100 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-slate-600 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:k("subscription.items.limits")}),t("td",{colSpan:H.length,className:"border-t border-slate-200 bg-slate-100"})]}),K.map(r=>e("tr",{className:"group hover:bg-slate-50/50",children:[e("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[t("div",{className:"font-medium text-sm text-slate-900",children:r.name}),r.description&&t("div",{className:"text-xs text-slate-500 mt-0.5",children:r.description})]}),H.map(e=>{const n=te(e,r,F),a=e.pricingVariants?.length?G:e.plan?.currency??G??"",i=re(n,r,a);return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(e._id===c?"bg-blue-50/50":"bg-white"),children:t("span",{className:"text-sm font-medium "+("—"===i?"text-slate-400":"text-slate-700"),children:i})},e._id)})]},r._id))]}),q.length>0&&e(r,{children:[e("tr",{children:[t("td",{className:"sticky start-0 z-10 border-t border-slate-200 bg-slate-100 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-slate-600 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:k("subscription.items.quotas")}),t("td",{colSpan:H.length,className:"border-t border-slate-200 bg-slate-100"})]}),q.map(r=>e("tr",{className:"group hover:bg-slate-50/50",children:[e("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[t("div",{className:"font-medium text-sm text-slate-900",children:r.name}),r.description&&t("div",{className:"text-xs text-slate-500 mt-0.5",children:r.description})]}),H.map(e=>{const n=te(e,r,F),a=e.pricingVariants?.length?G:e.plan?.currency??G??"",i=re(n,r,a);return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(e._id===c?"bg-blue-50/50":"bg-white"),children:t("span",{className:"text-sm font-medium "+("—"===i?"text-slate-400":"text-slate-700"),children:i})},e._id)})]},r._id))]}),!_&&H.some(e=>{const t=Ei(e,G);return t?.enabled})&&e(r,{children:[e("tr",{children:[t("td",{className:"sticky start-0 z-10 border-t border-emerald-200 bg-emerald-50 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-emerald-700 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:k("subscription.seats.title")}),t("td",{colSpan:H.length,className:"border-t border-emerald-200 bg-emerald-50"})]}),e("tr",{className:"group hover:bg-slate-50/50",children:[e("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[t("div",{className:"font-medium text-sm text-slate-900",children:k("subscription.seats.includedSeats")}),t("div",{className:"text-xs text-slate-500 mt-0.5",children:k("subscription.seats.freeWithBase")})]}),H.map(e=>{const r=Ei(e,G);return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(e._id===c?"bg-blue-50/50":"bg-white"),children:t("span",{className:"text-sm font-medium text-slate-700",children:r?.enabled?N(r.includedSeats||0):"—"})},e._id)})]}),e("tr",{className:"group hover:bg-slate-50/50",children:[t("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:t("div",{className:"font-medium text-sm text-slate-900",children:k("subscription.seats.maxSeats")})}),H.map(e=>{const r=Ei(e,G);return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(e._id===c?"bg-blue-50/50":"bg-white"),children:t("span",{className:"text-sm font-medium text-slate-700",children:r?.enabled?(r?.maxSeats??0)>0?N(r.maxSeats):k("subscription.seats.unlimited"):"—"})},e._id)})]}),e("tr",{className:"group hover:bg-slate-50/50",children:[t("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:t("div",{className:"font-medium text-sm text-slate-900",children:k("subscription.seats.perExtraSeat")})}),H.map(e=>{const r=Ai(e,G,F),n=e.pricingVariants?.length?G:e.plan?.currency??G??"";return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(e._id===c?"bg-blue-50/50":"bg-white"),children:t("span",{className:"text-sm font-medium text-slate-700",children:r&&r>0?`${E(r,n)}${T(F)}`:"—"})},e._id)})]}),null!=p&&p>0&&e("tr",{className:"group hover:bg-slate-50/50",children:[e("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[t("div",{className:"font-medium text-sm text-slate-900",children:k("subscription.seats.billable")}),t("div",{className:"text-xs text-slate-500 mt-0.5",children:k("subscription.membersInWorkspace",{count:p})})]}),H.map(r=>{const n=Ei(r,G);if(!n?.enabled)return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(r._id===c?"bg-blue-50/50":"bg-white"),children:t("span",{className:"text-sm text-slate-400",children:"—"})},r._id);const a=n.includedSeats||0,i=Math.max(0,p-a);return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(r._id===c?"bg-blue-50/50":"bg-white"),children:0===i?t("span",{className:"text-sm font-medium text-emerald-600",children:k("subscription.seats.allIncluded")}):e("span",{className:"text-sm font-medium text-amber-600",children:[N(i)," ",k("subscription.seats.extra")]})},r._id)})]})]}),H.some(e=>e.creditGrant?.enabled&&"object"==typeof e.creditGrant.creditPackage&&null!==e.creditGrant.creditPackage)&&e(r,{children:[e("tr",{children:[t("td",{className:"sticky start-0 z-10 border-t border-purple-200 bg-purple-50 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-purple-700 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:k("subscription.items.credits")}),t("td",{colSpan:H.length,className:"border-t border-purple-200 bg-purple-50"})]}),e("tr",{className:"group hover:bg-slate-50/50",children:[t("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:t("div",{className:"font-medium text-sm text-slate-900",children:H.every(e=>!e.creditGrant?.enabled||!e.creditGrant.renewOnPeriod)?k("subscription.items.creditsOneTime"):k("subscription.items.creditsPerMonth")})}),H.map(e=>{const r=e.creditGrant,n=r?.enabled&&"object"==typeof r.creditPackage&&null!==r.creditPackage?r.creditPackage:null;return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(e._id===c?"bg-blue-50/50":"bg-white"),children:t("span",n?{className:"text-sm font-semibold text-purple-700",children:N(n.creditAmount)}:{className:"text-sm text-slate-400",children:"—"})},e._id)})]}),e("tr",{className:"group hover:bg-slate-50/50",children:[t("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:t("div",{className:"font-medium text-sm text-slate-900",children:k("subscription.items.creditRenewal")})}),H.map(e=>{const r=e.creditGrant;return t("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(e._id===c?"bg-blue-50/50":"bg-white"),children:t("span",r?.enabled?{className:"text-sm font-medium text-slate-700",children:r.renewOnPeriod?"reset"===r.mode?k("subscription.items.creditModeReset"):k("subscription.items.creditModeTopup"):k("subscription.items.creditModeLifetime")}:{className:"text-sm text-slate-400",children:"—"})},e._id)})]})]})]})]})})]})})]})})}});export{zN as BetaForm,AN as CreditActionsProvider,_N as CreditBalance,xa as CreditBalanceContextProvider,PN as CreditStorePage,WN as PricingPage,ny as PushNotificationProvider,Aa as QuotaUsageContextProvider,BC as SETTINGS_SCREENS,hn as SUPPORTED_LOCALES,iN as SaaSOSProvider,FC as SettingsScreen,ca as SubscriptionContextProvider,sN as WhenAuthenticated,TN as WhenCreditsAvailable,RN as WhenCreditsExhausted,DN as WhenCreditsLow,vN as WhenNoSubscription,xN as WhenNotTrialing,dN as WhenPermission,SN as WhenQuotaAvailable,CN as WhenQuotaExhausted,NN as WhenQuotaOverage,EN as WhenQuotaThreshold,cN as WhenRoles,bN as WhenSubscription,yN as WhenSubscriptionToPlans,kN as WhenTrialEnding,wN as WhenTrialing,oN as WhenUnauthenticated,gN as WhenUserFeatureDisabled,fN as WhenUserFeatureEnabled,hN as WhenWorkspaceFeatureDisabled,mN as WhenWorkspaceFeatureEnabled,lN as WhenWorkspaceRoles,SE as WorkspaceSwitcher,ia as useAllQuotaUsage,Qn as useBillingPortal,ta as useCancelSubscription,ha as useConsumeCredits,Zn as useCreateCheckoutSession,ma as useCreditBalance,ka as useCreditBalanceContext,ga as useCreditPackages,ba as useCreditTransactions,va as useExpiringCredits,ea as useInvoice,Xn as useInvoices,Wl as usePermissions,Kn as usePlanGroup,qn as usePlanGroupVersions,ya as usePublicCreditPackages,jn as usePublicPlanGroupVersion,Hn as usePublicPlans,fa as usePurchaseCredits,ay as usePushNotifications,_a as useQuotaUsageContext,aa as useQuotaUsageStatus,na as useRecordUsage,ra as useResumeSubscription,ZC as useSaaSAuth,Bn as useSaaSOs,Vn as useSaaSSettings,jC as useSaaSWorkspaces,IC as useSeatStatus,$n as useSubscription,la as useSubscriptionContext,Yn as useSubscriptionManagement,Cn as useTranslation,MN as useTrialStatus,Jn as useUpdateSubscription,sa as useUsageLogs,uN as useUserAttributes,pN as useUserFeatures};