@buildbase/sdk 0.0.44 → 0.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/styles.css +1 -1
- package/dist/index.d.ts +313 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/react/index.d.ts +908 -2
- package/dist/react/index.js +5 -5
- package/dist/react/index.mjs +5 -5
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("react-dom");function n(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var a=n(t),s=n(r);function i(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=i(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function o(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=i(e))&&(n&&(n+=" "),n+=t);return n}const c=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),l="-",u=[],d=e=>{const t=h(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return m(e);const r=e.split(l),n=""===r[0]&&r.length>1?1:0;return p(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||u}return r[e]||u}}},p=(e,t,r)=>{if(0===e.length-t)return r.classGroupId;const n=e[t],a=r.nextPart.get(n);if(a){const r=p(e,t+1,a);if(r)return r}const s=r.validators;if(null===s)return;const i=0===t?e.join(l):e.slice(t).join(l),o=s.length;for(let e=0;e<o;e++){const t=s[e];if(t.validator(i))return t.classGroupId}},m=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})(),h=e=>{const{theme:t,classGroups:r}=e;return f(r,t)},f=(e,t)=>{const r=c();for(const n in e){const a=e[n];g(a,r,n,t)}return r},g=(e,t,r,n)=>{const a=e.length;for(let s=0;s<a;s++){const a=e[s];b(a,t,r,n)}},b=(e,t,r,n)=>{"string"!=typeof e?"function"!=typeof e?x(e,t,r,n):y(e,t,r,n):v(e,t,r)},v=(e,t,r)=>{(""===e?t:w(t,e)).classGroupId=r},y=(e,t,r,n)=>{S(e)?g(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(r,e)))},x=(e,t,r,n)=>{const a=Object.entries(e),s=a.length;for(let e=0;e<s;e++){const[s,i]=a[e];g(i,w(t,s),r,n)}},w=(e,t)=>{let r=e;const n=t.split(l),a=n.length;for(let e=0;e<a;e++){const t=n[e];let a=r.nextPart.get(t);a||(a=c(),r.nextPart.set(t,a)),r=a}return r},S=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,k=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const a=(a,s)=>{r[a]=s,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)}}},E=[],C=(e,t,r,n,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:a}),N=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=e=>{const t=[];let r,n=0,a=0,s=0;const i=e.length;for(let o=0;o<i;o++){const i=e[o];if(0===n&&0===a){if(":"===i){t.push(e.slice(s,o)),s=o+1;continue}if("/"===i){r=o;continue}}"["===i?n++:"]"===i?n--:"("===i?a++:")"===i&&a--}const o=0===t.length?e:e.slice(s);let c=o,l=!1;o.endsWith("!")?(c=o.slice(0,-1),l=!0):o.startsWith("!")&&(c=o.slice(1),l=!0);return C(t,l,c,r&&r>s?r-s:void 0)};if(t){const e=t+":",r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):C(E,!1,t,void 0,!0)}if(r){const e=n;n=t=>r({className:t,parseClassName:e})}return n},A=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 s=e[a],i="["===s[0],o=t.has(s);i||o?(n.length>0&&(n.sort(),r.push(...n),n=[]),r.push(s)):n.push(s)}return n.length>0&&(n.sort(),r.push(...n)),r}},_=/\s+/,j=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=j(e[n]))&&(r&&(r+=" "),r+=t);return r},P=(e,...t)=>{let r,n,a,s;const i=e=>{const t=n(e);if(t)return t;const s=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:s}=t,i=[],o=e.trim().split(_);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]:s(u).join(":"),b=d?g+"!":g,v=b+f;if(i.indexOf(v)>-1)continue;i.push(v);const y=a(f,h);for(let e=0;e<y.length;++e){const t=y[e];i.push(b+t)}c=t+(c.length>0?" "+c:c)}return c})(e,r);return a(e,s),s};return s=o=>{const c=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:k(e.cacheSize),parseClassName:N(e),sortModifiers:A(e),...d(e)}))(c),n=r.cache.get,a=r.cache.set,s=i,i(o)},(...e)=>s(((...e)=>{let t,r,n=0,a="";for(;n<e.length;)(t=e[n++])&&(r=j(t))&&(a&&(a+=" "),a+=r);return a})(...e))},T=[],R=e=>{const t=t=>t[e]||T;return t.isThemeGetter=!0,t},D=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,I=/^\((?:(\w[\w-]*):)?(.+)\)$/i,U=/^\d+\/\d+$/,M=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,O=/\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$/,L=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,z=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,F=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,B=e=>U.test(e),W=e=>!!e&&!Number.isNaN(Number(e)),V=e=>!!e&&Number.isInteger(Number(e)),H=e=>e.endsWith("%")&&W(e.slice(0,-1)),G=e=>M.test(e),$=()=>!0,K=e=>O.test(e)&&!L.test(e),q=()=>!1,Z=e=>z.test(e),J=e=>F.test(e),Y=e=>!Q(e)&&!se(e),X=e=>pe(e,ge,q),Q=e=>D.test(e),ee=e=>pe(e,be,K),te=e=>pe(e,ve,W),re=e=>pe(e,he,q),ne=e=>pe(e,fe,J),ae=e=>pe(e,xe,Z),se=e=>I.test(e),ie=e=>me(e,be),oe=e=>me(e,ye),ce=e=>me(e,he),le=e=>me(e,ge),ue=e=>me(e,fe),de=e=>me(e,xe,!0),pe=(e,t,r)=>{const n=D.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},me=(e,t,r=!1)=>{const n=I.exec(e);return!!n&&(n[1]?t(n[1]):r)},he=e=>"position"===e||"percentage"===e,fe=e=>"image"===e||"url"===e,ge=e=>"length"===e||"size"===e||"bg-size"===e,be=e=>"length"===e,ve=e=>"number"===e,ye=e=>"family-name"===e,xe=e=>"shadow"===e,we=P(()=>{const e=R("color"),t=R("font"),r=R("text"),n=R("font-weight"),a=R("tracking"),s=R("leading"),i=R("breakpoint"),o=R("container"),c=R("spacing"),l=R("radius"),u=R("shadow"),d=R("inset-shadow"),p=R("text-shadow"),m=R("drop-shadow"),h=R("blur"),f=R("perspective"),g=R("aspect"),b=R("ease"),v=R("animate"),y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",se,Q],x=()=>[se,Q,c],w=()=>[B,"full","auto",...x()],S=()=>[V,"none","subgrid",se,Q],k=()=>["auto",{span:["full",V,se,Q]},V,se,Q],E=()=>[V,"auto",se,Q],C=()=>["auto","min","max","fr",se,Q],N=()=>["auto",...x()],A=()=>[B,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],_=()=>[e,se,Q],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ce,re,{position:[se,Q]}],P=()=>["auto","cover","contain",le,X,{size:[se,Q]}],T=()=>[H,ie,ee],D=()=>["","none","full",l,se,Q],I=()=>["",W,ie,ee],U=()=>[W,H,ce,re],M=()=>["","none",h,se,Q],O=()=>["none",W,se,Q],L=()=>["none",W,se,Q],z=()=>[W,se,Q],F=()=>[B,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[G],breakpoint:[G],color:[$],container:[G],"drop-shadow":[G],ease:["in","out","in-out"],font:[Y],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[G],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[G],shadow:[G],spacing:["px",W],text:[G],"text-shadow":[G],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",B,Q,se,g]}],container:["container"],columns:[{columns:[W,Q,se,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:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{start:w()}],end:[{end:w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[V,"auto",se,Q]}],basis:[{basis:[B,"full","auto",o,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[W,B,"auto","initial","none",Q]}],grow:[{grow:["",W,se,Q]}],shrink:[{shrink:["",W,se,Q]}],order:[{order:[V,"first","last","none",se,Q]}],"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":C()}],"auto-rows":[{"auto-rows":C()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"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:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"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:[i]},...A()]}],h:[{h:["screen","lh",...A()]}],"min-h":[{"min-h":["screen","lh","none",...A()]}],"max-h":[{"max-h":["screen","lh",...A()]}],"font-size":[{text:["base",r,ie,ee]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,se,te]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",H,Q]}],"font-family":[{font:[oe,Q,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,se,Q]}],"line-clamp":[{"line-clamp":[W,"none",se,te]}],leading:[{leading:[s,...x()]}],"list-image":[{"list-image":["none",se,Q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",se,Q]}],"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:[W,"from-font","auto",se,ee]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[W,"auto",se,Q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",se,Q]}],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",se,Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},V,se,Q],radial:["",se,Q],conic:[V,se,Q]},ue,ne]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:T()}],"gradient-via-pos":[{via:T()}],"gradient-to-pos":[{to:T()}],"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":[W,se,Q]}],"outline-w":[{outline:["",W,ie,ee]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",u,de,ae]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",d,de,ae]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[W,ee]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",p,de,ae]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[W,se,Q]}],"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":[W]}],"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":[se,Q]}],"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":[W]}],"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:j()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",se,Q]}],filter:[{filter:["","none",se,Q]}],blur:[{blur:M()}],brightness:[{brightness:[W,se,Q]}],contrast:[{contrast:[W,se,Q]}],"drop-shadow":[{"drop-shadow":["","none",m,de,ae]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",W,se,Q]}],"hue-rotate":[{"hue-rotate":[W,se,Q]}],invert:[{invert:["",W,se,Q]}],saturate:[{saturate:[W,se,Q]}],sepia:[{sepia:["",W,se,Q]}],"backdrop-filter":[{"backdrop-filter":["","none",se,Q]}],"backdrop-blur":[{"backdrop-blur":M()}],"backdrop-brightness":[{"backdrop-brightness":[W,se,Q]}],"backdrop-contrast":[{"backdrop-contrast":[W,se,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",W,se,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[W,se,Q]}],"backdrop-invert":[{"backdrop-invert":["",W,se,Q]}],"backdrop-opacity":[{"backdrop-opacity":[W,se,Q]}],"backdrop-saturate":[{"backdrop-saturate":[W,se,Q]}],"backdrop-sepia":[{"backdrop-sepia":["",W,se,Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",se,Q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[W,"initial",se,Q]}],ease:[{ease:["linear","initial",b,se,Q]}],delay:[{delay:[W,se,Q]}],animate:[{animate:["none",v,se,Q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[f,se,Q]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:O()}],"rotate-x":[{"rotate-x":O()}],"rotate-y":[{"rotate-y":O()}],"rotate-z":[{"rotate-z":O()}],scale:[{scale:L()}],"scale-x":[{"scale-x":L()}],"scale-y":[{"scale-y":L()}],"scale-z":[{"scale-z":L()}],"scale-3d":["scale-3d"],skew:[{skew:z()}],"skew-x":[{"skew-x":z()}],"skew-y":[{"skew-y":z()}],transform:[{transform:[se,Q,"","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",se,Q]}],"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":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"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",se,Q]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[W,ie,ee,te]}],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 Se(...e){return we(o(e))}let ke=!0;function Ee(e,...t){ke&&function(){try{const e="undefined"!=typeof globalThis?globalThis:null;return"development"===e?.process?.env?.NODE_ENV}catch{return!1}}()&&console.error(e,...t)}function Ce(e,...t){console.error(e,...t)}function Ne(e){return e instanceof Error&&("AbortError"===e.name||"ERR_CANCELED"===e.code)}async function Ae(e,t){try{const r=await e.json();return r?.message||r?.error||t}catch{return t}}async function _e(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 je(e,t="Request failed"){if(!e.ok){let r=t;try{const t=await _e(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 _e(e)}catch(e){if(e instanceof Error&&e.message.includes("Invalid JSON"))throw e;throw new Error("Failed to parse response as JSON")}}class Pe 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,Pe)}}const Te=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&&(ke=e.enableLogging)}({enableLogging:e.enableConsoleLogging})}handleError(e,t={}){if(Ne(e))return;const r=e instanceof Error?e:new Pe("string"==typeof e?e:"An unknown error occurred","UNKNOWN_ERROR",t),n=r instanceof Pe?r:new Pe(r.message,"SDK_ERROR",t,r);if(this.config.enableConsoleLogging&&Ee(`[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){Ce("[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 Re(e,t={}){Te.handleError(e,t)}function De(e,t={}){return!Ne(e)&&(Te.handleError(e,t),!0)}class Ie extends t.Component{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(Re(e,{component:"ErrorBoundary",action:"componentDidCatch",metadata:{componentStack:t.componentStack,errorBoundary:this.constructor.name}}),this.props.onError)try{this.props.onError(e,t)}catch(e){Ce("[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.jsxs("div",{style:{padding:"1rem",border:"1px solid #ef4444",borderRadius:"0.5rem",backgroundColor:"#fef2f2",color:"#991b1b"},children:[e.jsx("h3",{style:{margin:"0 0 0.5rem 0",fontSize:"1rem",fontWeight:600},children:"Something went wrong"}),e.jsx("p",{style:{margin:"0 0 1rem 0",fontSize:"0.875rem"},children:this.state.error.message||"An unexpected error occurred"}),e.jsx("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 Ue=()=>({type:"AUTHENTICATION_STARTED"}),Me=()=>({type:"AUTHENTICATION_PROCESSING"}),Oe=()=>({type:"AUTHENTICATION_FAILED"}),Le=e=>({type:"SET_SESSION",payload:e}),ze=()=>({type:"REMOVE_SESSION"});function Fe(e,r,n){const a=t.useRef(r),s=t.useRef(n),i=t.useRef(void 0),o=t.useRef(!1);return a.current=r,s.current=n,t.useMemo(()=>{const t=a.current(e);if(o.current){if(s.current?s.current(i.current,t):Object.is(i.current,t))return i.current}return i.current=t,o.current=!0,t},[e])}function Be({name:r,initialState:n,reducer:a,initializer:s}){const i=t.createContext(null),o=t.createContext(null),c=t.createContext(null),l=t.memo(({children:r})=>{const[l,u]=t.useReducer(a,n,s||(e=>e)),d=t.useMemo(()=>({state:l,dispatch:u}),[l,u]);return e.jsx(c.Provider,{value:d,children:e.jsx(i.Provider,{value:l,children:e.jsx(o.Provider,{value:u,children:r})})})});l.displayName=`${r}Provider`;const u=e=>new Error(`use${r}${e} must be used within a ${r}Provider. Make sure SaaSOSProvider is wrapping your application.`),d=()=>{const e=t.useContext(i);if(null===e)throw u("State");return e};return{Provider:l,useContext:()=>{const e=t.useContext(c);if(!e)throw u("Context");return e},useState:d,useDispatch:()=>{const e=t.useContext(o);if(null===e)throw u("Dispatch");return e},useSelector:(e,t)=>{const r=e||(e=>e);return Fe(d(),r,t)}}}var We;function Ve(e){return{isAuthenticated:e===We.authenticated,isLoading:e===We.loading||e===We.redirecting||e===We.authenticating,isRedirecting:e===We.redirecting}}function He(e,t,r){return{...e,[t]:r}}function Ge(e,t){return{...e,...t}}!function(e){e.loading="loading",e.redirecting="redirecting",e.authenticated="authenticated",e.unauthenticated="unauthenticated",e.authenticating="authenticating"}(We||(We={}));const $e=()=>({session:null,status:We.loading}),{Provider:Ke,useState:qe,useDispatch:Ze}=Be({name:"Auth",initialState:$e(),reducer:(e,t)=>{switch(t.type){case"AUTHENTICATION_STARTED":return He(e,"status",We.redirecting);case"AUTHENTICATION_PROCESSING":return He(e,"status",We.authenticating);case"AUTHENTICATION_FAILED":case"REMOVE_SESSION":return Ge(e,{session:null,status:We.unauthenticated});case"SET_SESSION":return Ge(e,{session:t.payload,status:We.authenticated});default:return e}},initializer:$e}),Je=Ke,Ye=qe,Xe=Ze,Qe=e=>({type:"SET_SAAS_OS_CONFIG",payload:e}),et=e=>({type:"SET_SETTINGS",payload:e});var tt;function rt(e){return Boolean(e?.serverUrl&&e?.version&&e?.orgId)}!function(e){e.V1="v1"}(tt||(tt={}));const nt=()=>({serverUrl:"",version:tt.V1,orgId:"",settings:null}),{Provider:at,useState:st,useDispatch:it}=Be({name:"OS",initialState:nt(),reducer:(e,t)=>{switch(t.type){case"SET_SAAS_OS_CONFIG":return Ge(e,t.payload);case"REMOVE_SAAS_OS_CONFIG":return nt();case"SET_SETTINGS":return He(e,"settings",t.payload);default:return e}}}),ot=at,ct=st,lt=it,ut=e=>({type:"SET_WORKSPACES",payload:e}),dt=e=>({type:"ADD_WORKSPACE",payload:e}),pt=e=>({type:"UPDATE_WORKSPACE",payload:e}),mt=e=>({type:"REMOVE_WORKSPACE",payload:e}),ht=e=>({type:"SET_ALL_FEATURES",payload:e}),ft=e=>({type:"SET_CURRENT_WORKSPACE",payload:e}),gt=()=>({type:"RESET_CURRENT_WORKSPACE"}),bt=e=>({type:"SET_IS_INITIALIZED",payload:e}),vt=e=>({type:"SET_LOADING",payload:e}),yt=e=>({type:"SET_ERROR",payload:e}),xt=e=>({type:"SET_REFRESHING",payload:e}),wt=e=>({type:"SET_SWITCHING_TO_ID",payload:e}),{Provider:St,useState:kt,useDispatch:Et}=Be({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 He(e,"workspaces",t.payload);case"ADD_WORKSPACE":return He(e,"workspaces",[...e.workspaces,t.payload]);case"UPDATE_WORKSPACE":return He(e,"workspaces",e.workspaces.map(e=>e._id===t.payload._id?t.payload:e));case"REMOVE_WORKSPACE":return He(e,"workspaces",e.workspaces.filter(e=>e._id!==t.payload));case"SET_ALL_FEATURES":return He(e,"allFeatures",t.payload);case"SET_CURRENT_WORKSPACE":return He(e,"currentWorkspace",t.payload);case"RESET_CURRENT_WORKSPACE":return He(e,"currentWorkspace",null);case"SET_IS_INITIALIZED":return He(e,"isInitialized",t.payload);case"SET_LOADING":return He(e,"loading",t.payload);case"SET_ERROR":return He(e,"error",t.payload);case"SET_REFRESHING":return He(e,"refreshing",t.payload);case"SET_SWITCHING_TO_ID":return He(e,"switchingToId",t.payload);default:return e}}}),Ct=St,Nt=kt,At=Et,_t=t.memo(({children:t})=>e.jsx(ot,{children:e.jsx(Je,{children:e.jsx(Ct,{children:t})})}));_t.displayName="SDKContextProvider";const jt=t.createContext({});jt.displayName="CheckoutConfigContext";const Pt=t.memo(({getCheckoutStripeParams:r,children:n})=>{const a=t.useMemo(()=>({getCheckoutStripeParams:r}),[r]);return e.jsx(jt.Provider,{value:a,children:n})});Pt.displayName="CheckoutConfigProvider";const Tt=new Set;function Rt(){Tt.forEach(e=>e())}const Dt=new Set;function It(){Dt.forEach(e=>e())}function Ut(e,t){const r=t&&t.cache?t.cache:Wt,n=t&&t.serializer?t.serializer:Ft;return(t&&t.strategy?t.strategy:zt)(e,{cache:r,serializer:n})}function Mt(e,t,r,n){const a=null==(s=n)||"number"==typeof s||"boolean"==typeof s?n:r(n);var s;let i=t.get(a);return void 0===i&&(i=e.call(this,n),t.set(a,i)),i}function Ot(e,t,r){const n=Array.prototype.slice.call(arguments,3),a=r(n);let s=t.get(a);return void 0===s&&(s=e.apply(this,n),t.set(a,s)),s}function Lt(e,t,r,n,a){return r.bind(t,e,n,a)}function zt(e,t){return Lt(e,this,1===e.length?Mt:Ot,t.cache.create(),t.serializer)}const Ft=function(){return JSON.stringify(arguments)};class Bt{cache;constructor(){this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}}const Wt={create:function(){return new Bt}},Vt={variadic:function(e,t){return Lt(e,this,Ot,t.cache.create(),t.serializer)}},Ht=/(?:[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 Gt(e){const t={};return e.replace(Ht,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 $t=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function Kt(e){return e.replace(/^(.*?)-/,"")}const qt=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,Zt=/^(@+)?(\+|#+)?[rs]?$/g,Jt=/(\*)(0+)|(#+)(0+)|(0+)/g,Yt=/^(0+)$/;function Xt(e){const t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(Zt,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 Qt(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 er(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)),!Yt.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function tr(e){const t=Qt(e);return t||{}}function rr(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=Kt(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,...tr(t)}),{})};continue;case"engineering":t={...t,notation:"engineering",...r.options.reduce((e,t)=>({...e,...tr(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(Jt,function(e,r,n,a,s,i){if(r)t.minimumIntegerDigits=n.length;else{if(a&&s)throw new Error("We currently do not support maximum integer digits");if(i)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Yt.test(r.stem)){t.minimumIntegerDigits=r.stem.length;continue}if(qt.test(r.stem)){if(r.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(qt,function(e,r,n,a,s,i){return"*"===n?t.minimumFractionDigits=r.length:a&&"#"===a[0]?t.maximumFractionDigits=a.length:s&&i?(t.minimumFractionDigits=s.length,t.maximumFractionDigits=s.length+i.length):(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length),""});const e=r.options[0];"w"===e?t={...t,trailingZeroDisplay:"stripIfInteger"}:e&&(t={...t,...Xt(e)});continue}if(Zt.test(r.stem)){t={...t,...Xt(r.stem)};continue}const e=Qt(r.stem);e&&(t={...t,...e});const n=er(r.stem);n&&(t={...t,...n})}return t}let nr=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}({}),ar=function(e){return e[e.number=0]="number",e[e.dateTime=1]="dateTime",e}({});function sr(e){return e.type===nr.literal}function ir(e){return e.type===nr.argument}function or(e){return e.type===nr.number}function cr(e){return e.type===nr.date}function lr(e){return e.type===nr.time}function ur(e){return e.type===nr.select}function dr(e){return e.type===nr.plural}function pr(e){return e.type===nr.pound}function mr(e){return e.type===nr.tag}function hr(e){return!(!e||"object"!=typeof e||e.type!==ar.number)}function fr(e){return!(!e||"object"!=typeof e||e.type!==ar.dateTime)}let gr=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 br=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,vr={"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 yr(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(vr[n||""]||vr[r||""]||vr[`${r}-001`]||vr["001"])[0]}const xr=new RegExp(`^${br.source}*`),wr=new RegExp(`${br.source}*$`);function Sr(e,t){return{start:e,end:t}}const kr=!!Object.fromEntries,Er=!!String.prototype.trimStart,Cr=!!String.prototype.trimEnd,Nr=kr?Object.fromEntries:function(e){const t={};for(const[r,n]of e)t[r]=n;return t},Ar=Er?function(e){return e.trimStart()}:function(e){return e.replace(xr,"")},_r=Cr?function(e){return e.trimEnd()}:function(e){return e.replace(wr,"")},jr=new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");class Pr{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(gr.UNMATCHED_CLOSING_TAG,Sr(this.clonePosition(),this.clonePosition()))}if(60===a&&!this.ignoreTag&&Tr(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:nr.pound,location:Sr(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:nr.literal,value:`<${n}/>`,location:Sr(r,this.clonePosition())},err:null};if(this.bumpIf(">")){const a=this.parseMessage(e+1,t,!0);if(a.err)return a;const s=a.val,i=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!Tr(this.char()))return this.error(gr.INVALID_TAG,Sr(i,this.clonePosition()));const e=this.clonePosition();return n!==this.parseTagName()?this.error(gr.UNMATCHED_CLOSING_TAG,Sr(e,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:nr.tag,value:n,children:s,location:Sr(r,this.clonePosition())},err:null}:this.error(gr.INVALID_TAG,Sr(i,this.clonePosition())))}return this.error(gr.UNCLOSED_TAG,Sr(r,this.clonePosition()))}return this.error(gr.INVALID_TAG,Sr(r,this.clonePosition()))}parseTagName(){const e=this.offset();for(this.bump();!this.isEOF()&&Rr(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 s=this.tryParseLeftAngleBracket();if(!s)break;n+=s}const a=Sr(r,this.clonePosition());return{val:{type:nr.literal,value:n,location:a},err:null}}tryParseLeftAngleBracket(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(Tr(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(gr.EXPECT_ARGUMENT_CLOSING_BRACE,Sr(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(gr.EMPTY_ARGUMENT,Sr(r,this.clonePosition()));let n=this.parseIdentifierIfPossible().value;if(!n)return this.error(gr.MALFORMED_ARGUMENT,Sr(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(gr.EXPECT_ARGUMENT_CLOSING_BRACE,Sr(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:nr.argument,value:n,location:Sr(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(gr.EXPECT_ARGUMENT_CLOSING_BRACE,Sr(r,this.clonePosition())):this.parseArgumentOptions(e,t,n,r);default:return this.error(gr.MALFORMED_ARGUMENT,Sr(r,this.clonePosition()))}}parseIdentifierIfPossible(){const e=this.clonePosition(),t=this.offset(),r=function(e,t){return jr.lastIndex=t,jr.exec(e)[1]??""}(this.message,t),n=t+r.length;this.bumpTo(n);return{value:r,location:Sr(e,this.clonePosition())}}parseArgumentOptions(e,t,r,n){let a=this.clonePosition(),s=this.parseIdentifierIfPossible().value,i=this.clonePosition();switch(s){case"":return this.error(gr.EXPECT_ARGUMENT_TYPE,Sr(a,i));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(gr.EXPECT_ARGUMENT_STYLE,Sr(this.clonePosition(),this.clonePosition()));e={style:n,styleLocation:Sr(t,this.clonePosition())}}const t=this.tryParseArgumentClose(n);if(t.err)return t;const a=Sr(n,this.clonePosition());if(e&&e.style.startsWith("::")){let t=Ar(e.style.slice(2));if("number"===s){const n=this.parseNumberSkeletonFromString(t,e.styleLocation);return n.err?n:{val:{type:nr.number,value:r,location:a,style:n.val},err:null}}{if(0===t.length)return this.error(gr.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 s=0;for(;n+1<e.length&&e.charAt(n+1)===a;)s++,n++;let i=1+(1&s),o=s<2?1:3+(s>>1),c="a",l=yr(t);for("H"!=l&&"k"!=l||(o=0);o-- >0;)r+=c;for(;i-- >0;)r=l+r}else r+="J"===a?"H":a}return r}(t,this.locale));const i={type:ar.dateTime,pattern:n,location:e.styleLocation,parsedOptions:this.shouldParseSkeletons?Gt(n):{}};return{val:{type:"date"===s?nr.date:nr.time,value:r,location:a,style:i},err:null}}}return{val:{type:"number"===s?nr.number:"date"===s?nr.date:nr.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(gr.EXPECT_SELECT_ARGUMENT_OPTIONS,Sr(a,{...a}));this.bumpSpace();let i=this.parseIdentifierIfPossible(),o=0;if("select"!==s&&"offset"===i.value){if(!this.bumpIf(":"))return this.error(gr.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Sr(this.clonePosition(),this.clonePosition()));this.bumpSpace();const e=this.tryParseDecimalInteger(gr.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,gr.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(e.err)return e;this.bumpSpace(),i=this.parseIdentifierIfPossible(),o=e.val}const c=this.tryParsePluralOrSelectOptions(e,s,t,i);if(c.err)return c;const l=this.tryParseArgumentClose(n);if(l.err)return l;const u=Sr(n,this.clonePosition());return"select"===s?{val:{type:nr.select,value:r,options:Nr(c.val),location:u},err:null}:{val:{type:nr.plural,value:r,options:Nr(c.val),offset:o,pluralType:"plural"===s?"cardinal":"ordinal",location:u},err:null}}default:return this.error(gr.INVALID_ARGUMENT_TYPE,Sr(a,i))}}tryParseArgumentClose(e){return this.isEOF()||125!==this.char()?this.error(gr.EXPECT_ARGUMENT_CLOSING_BRACE,Sr(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(gr.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Sr(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($t).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(gr.INVALID_NUMBER_SKELETON,t)}return{val:{type:ar.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?rr(r):{}},err:null}}tryParsePluralOrSelectOptions(e,t,r,n){let a=!1;const s=[],i=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(gr.EXPECT_PLURAL_ARGUMENT_SELECTOR,gr.INVALID_PLURAL_ARGUMENT_SELECTOR);if(t.err)return t;c=Sr(e,this.clonePosition()),o=this.message.slice(e.offset,this.offset())}}if(i.has(o))return this.error("select"===t?gr.DUPLICATE_SELECT_ARGUMENT_SELECTOR:gr.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===o&&(a=!0),this.bumpSpace();const n=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?gr.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:gr.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Sr(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;s.push([o,{value:l.val,location:Sr(n,this.clonePosition())}]),i.add(o),this.bumpSpace(),({value:o,location:c}=this.parseIdentifierIfPossible())}return 0===s.length?this.error("select"===t?gr.EXPECT_SELECT_ARGUMENT_SELECTOR:gr.EXPECT_PLURAL_ARGUMENT_SELECTOR,Sr(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!a?this.error(gr.MISSING_OTHER_CLAUSE,Sr(this.clonePosition(),this.clonePosition())):{val:s,err:null}}tryParseDecimalInteger(e,t){let r=1;const n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);let a=!1,s=0;for(;!this.isEOF();){const e=this.char();if(!(e>=48&&e<=57))break;a=!0,s=10*s+(e-48),this.bump()}const i=Sr(n,this.clonePosition());return a?(s*=r,Number.isSafeInteger(s)?{val:s,err:null}:this.error(t,i)):this.error(e,i)}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()&&Dr(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 Tr(e){return e>=97&&e<=122||e>=65&&e<=90}function Rr(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 Dr(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Ir(e){e.forEach(e=>{if(delete e.location,ur(e)||dr(e))for(const t in e.options)delete e.options[t].location,Ir(e.options[t].value);else or(e)&&hr(e.style)||(cr(e)||lr(e))&&fr(e.style)?delete e.style.location:mr(e)&&Ir(e.children)})}function Ur(e,t={}){t={shouldParseSkeletons:!0,requiresOtherClause:!0,...t};const r=new Pr(e,t).parse();if(r.err){const e=SyntaxError(gr[r.err.kind]);throw e.location=r.err.location,e.originalMessage=r.err.message,e}return t?.captureLocation||Ir(r.val),r.val}let Mr=function(e){return e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API",e}({});class Or 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 Lr extends Or{constructor(e,t,r,n){super(`Invalid values for "${e}": "${t}". Options are "${Object.keys(r).join('", "')}"`,Mr.INVALID_VALUE,n)}}class zr extends Or{constructor(e,t,r){super(`Value for "${e}" must be of type ${t}`,Mr.INVALID_VALUE,r)}}class Fr extends Or{constructor(e,t){super(`The intl string context variable "${e}" was not provided to the string "${t}"`,Mr.MISSING_VALUE,t)}}let Br=function(e){return e[e.literal=0]="literal",e[e.object=1]="object",e}({});function Wr(e){return"function"==typeof e}function Vr(e,t,r,n,a,s,i){if(1===e.length&&sr(e[0]))return[{type:Br.literal,value:e[0].value}];const o=[];for(const c of e){if(sr(c)){o.push({type:Br.literal,value:c.value});continue}if(pr(c)){"number"==typeof s&&o.push({type:Br.literal,value:r.getNumberFormat(t).format(s)});continue}const{value:e}=c;if(!a||!(e in a))throw new Fr(e,i);let l=a[e];if(ir(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?Br.literal:Br.object,value:l});else{if(cr(c)){const e="string"==typeof c.style?n.date[c.style]:fr(c.style)?c.style.parsedOptions:void 0;o.push({type:Br.literal,value:r.getDateTimeFormat(t,e).format(l)});continue}if(lr(c)){const e="string"==typeof c.style?n.time[c.style]:fr(c.style)?c.style.parsedOptions:n.time.medium;o.push({type:Br.literal,value:r.getDateTimeFormat(t,e).format(l)});continue}if(or(c)){const e="string"==typeof c.style?n.number[c.style]:hr(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:Br.literal,value:r.getNumberFormat(t,e).format(l)});continue}if(mr(c)){const{children:e,value:l}=c,u=a[l];if(!Wr(u))throw new zr(l,"function",i);let d=u(Vr(e,t,r,n,a,s).map(e=>e.value));Array.isArray(d)||(d=[d]),o.push(...d.map(e=>({type:"string"==typeof e?Br.literal:Br.object,value:e})))}if(ur(c)){const e=l,s=(Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0)||c.options.other;if(!s)throw new Lr(c.value,l,Object.keys(c.options),i);o.push(...Vr(s.value,t,r,n,a));continue}if(dr(c)){const e=`=${l}`;let s=Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0;if(!s){if(!Intl.PluralRules)throw new Or('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Mr.MISSING_INTL_API,i);const e="bigint"==typeof l?Number(l):l,n=r.getPluralRules(t,{type:c.pluralType}).select(e-(c.offset||0));s=(Object.prototype.hasOwnProperty.call(c.options,n)?c.options[n]:void 0)||c.options.other}if(!s)throw new Lr(c.value,l,Object.keys(c.options),i);const u="bigint"==typeof l?Number(l):l;o.push(...Vr(s.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===Br.literal&&t.type===Br.literal?r.value+=t.value:e.push(t),e},[]);var c}function Hr(e,t){return t?Object.keys(e).reduce((r,n)=>{var a,s;return r[n]=(a=e[n],(s=t[n])?{...a,...s,...Object.keys(a).reduce((e,t)=>(e[t]={...a[t],...s[t]},e),{})}:a),r},{...e}):e}function Gr(e){return{create:()=>({get:t=>e[t],set(t,r){e[t]=r}})}}class $r{ast;locales;resolvedLocale;formatters;formats;message;formatterCache={number:{},dateTime:{},pluralRules:{}};constructor(e,t=$r.defaultLocale,r,n){if(this.locales=t,this.resolvedLocale=$r.resolveLocale(t),"string"==typeof e){if(this.message=e,!$r.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");const{...t}=n||{};this.ast=$r.__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=Hr($r.formats,r),this.formatters=n&&n.formatters||function(e={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:Ut((...e)=>new Intl.NumberFormat(...e),{cache:Gr(e.number),strategy:Vt.variadic}),getDateTimeFormat:Ut((...e)=>new Intl.DateTimeFormat(...e),{cache:Gr(e.dateTime),strategy:Vt.variadic}),getPluralRules:Ut((...e)=>new Intl.PluralRules(...e),{cache:Gr(e.pluralRules),strategy:Vt.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===Br.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=>Vr(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 $r.memoizedDefaultLocale||($r.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),$r.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=Ur;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 Kr={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"}},qr={en:async()=>Kr,es:async()=>(await Promise.resolve().then(function(){return cC})).es,fr:async()=>(await Promise.resolve().then(function(){return lC})).fr,de:async()=>(await Promise.resolve().then(function(){return uC})).de,ja:async()=>(await Promise.resolve().then(function(){return dC})).ja,zh:async()=>(await Promise.resolve().then(function(){return pC})).zh,hi:async()=>(await Promise.resolve().then(function(){return mC})).hi,ar:async()=>(await Promise.resolve().then(function(){return hC})).ar},Zr=["en","es","fr","de","ja","zh","hi","ar"];const Jr={hi:"hi-u-nu-deva",ar:"ar-u-nu-arab"};const Yr=t.createContext({messages:Kr,locale:"en",formattingLocale:"en"});function Xr({locale:e="en",children:r}){const n=function(e){const t=e.toLowerCase().replace("_","-");if(Zr.includes(t))return t;const r=t.split("-")[0];return Zr.includes(r)?r:"en"}(e),[a,s]=t.useState(Kr);t.useEffect(()=>{if("en"===n)return void s(Kr);let e=!1;const t=qr[n];return t&&t().then(t=>{e||s(t)}),()=>{e=!0}},[n]);const i=function(e){return Jr[e]??e}(n),o=t.useMemo(()=>({messages:a,locale:n,formattingLocale:i}),[a,n,i]);return t.createElement(Yr.Provider,{value:o},r)}const Qr=new Map,en=new Map,tn=new Map;function rn(e,t){return t?`${e}:${JSON.stringify(t)}`:e}const nn={getNumberFormat(e,t){const r=rn(e,t);let n=Qr.get(r);return n||(n=new Intl.NumberFormat(e,t),Qr.set(r,n)),n},getDateTimeFormat(e,t){const r=rn(e,t);let n=en.get(r);return n||(n=new Intl.DateTimeFormat(e,t),en.set(r,n)),n},getPluralRules(e,t){const r=rn(e,t);let n=tn.get(r);return n||(n=new Intl.PluralRules(e,t),tn.set(r,n)),n}},an=new Map;function sn(){const{messages:e,locale:r,formattingLocale:n}=t.useContext(Yr),a=t.useMemo(()=>(t,r)=>{const a=t.split(".");let s=e;for(const e of a){if(!s||"object"!=typeof s||!(e in s))return t;s=s[e]}const i="string"==typeof s?s:t;if(!r)return i;try{const e=function(e,t){const r=`${t}:${e}`;let n=an.get(r);return n||(n=new $r(e,t,void 0,{formatters:nn}),an.set(r,n)),n}(i,n),t=e.format(r);return"string"==typeof t?t:String(t)}catch{return i.replace(/\{(\w+)\}/g,(e,t)=>String(r[t]??`{${t}}`))}},[e,n]),s="ar"===r?"rtl":"ltr",i=t.useMemo(()=>e=>e.toLocaleString(n),[n]),o=t.useMemo(()=>(e,t)=>{const r=(t??"").trim().toUpperCase();if(!r)return(e/100).toLocaleString(n,{minimumFractionDigits:2});try{return new Intl.NumberFormat(n,{style:"currency",currency:r,minimumFractionDigits:2}).format(e/100)}catch{return(e/100).toLocaleString(n,{minimumFractionDigits:2})}},[n]);return{t:a,locale:r,formattingLocale:n,dir:s,fmtNum:i,fmtCents:o,messages:e}}function on(e){if("undefined"==typeof window)return null;try{return localStorage.getItem(e)}catch(t){return Re(t,{component:"storage",action:"getStorageItem",metadata:{key:e}}),null}}function cn(e,t){if("undefined"!=typeof window)try{localStorage.setItem(e,t)}catch(t){Re(t,{component:"storage",action:"setStorageItem",metadata:{key:e}})}}function ln(e){if("undefined"!=typeof window)try{localStorage.removeItem(e)}catch(t){Re(t,{component:"storage",action:"removeStorageItem",metadata:{key:e}})}}const un="saas-session-id",dn="code";function pn(e){cn(un,e)}function mn(){return function(){if("undefined"==typeof window)return null;try{return on(un)}catch(e){return Re(e,{component:"auth-utils",action:"getSessionId",metadata:{key:un}}),null}}()}function hn(){if("undefined"==typeof window)return null;try{return new URLSearchParams(window.location.search).get(dn)}catch(e){return Re(e,{component:"auth-utils",action:"getTokenFromUrl",metadata:{param:dn}}),null}}const fn="SDK is not ready (missing serverUrl, version, or orgId)";class gn{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(fn);if(this.requireOrgId&&!this.orgId?.trim())throw new Error(fn)}get baseUrl(){return this.ensureReady(),`${this.serverUrl}/api/${this.version}/${this.basePath}`}getAuthHeaders(){return this._sessionId?{"x-session-id":this._sessionId}:function(){const e=mn(),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),s={...t,headers:a};let i;if(this._timeout>0){const e=new AbortController;i=setTimeout(()=>e.abort(),this._timeout),s.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,s);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!==i){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!==i&&clearTimeout(i)}}async fetchJson(e,t={},r="Request failed"){this.ensureReady();try{const n=await this.executeFetch(e,t);return await je(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 bn extends gn{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 s=await a.json();if(void 0!==s.success){if(!s.success)throw new Error(s.message||"Failed to fetch invoices");return s}return s}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}`:""}`,s=await this.fetchResponse(a);if(!s.ok){let e="Failed to fetch usage logs";try{e=(await s.json()).message||e}catch{e=404===s.status?"Workspace not found":401===s.status?"Unauthorized - Please check your session":`Failed to fetch usage logs (${s.status}: ${s.statusText})`}throw new Error(e)}const i=await s.json();if(void 0!==i.success){if(!i.success)throw new Error(i.message||"Failed to fetch usage logs");return i.data||i}return i}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 vn(){const e=Xe(),r=lt(),n=At();return t.useMemo(()=>({auth:e,os:r,workspaces:n}),[e,r,n])}function yn(e,r){const n=ct(),a=Ye(),s=Nt(),i=e||(e=>e);return Fe(t.useMemo(()=>({os:n,auth:a,workspaces:s}),[n,a,s]),i,r)}function xn(e,r,n){t.useEffect(()=>{const t=new AbortController;return e(t.signal).catch(e=>{Ne(e)||(n?.onError?n.onError(e):Re(e,{component:"useAsyncEffect",action:"effect",metadata:{note:"Unhandled rejection - consider passing onError"}}))}),()=>t.abort()},r)}class wn extends gn{constructor(e){super({...e,requireOrgId:!0})}async getSettings(e){return this.fetchJson(`${this.orgId}/settings`,{signal:e},"Failed to fetch settings")}}function Sn(){return yn(e=>e.os)}let kn=null;function En(){const e=vn(),r=Sn(),{serverUrl:n,version:a,orgId:s,settings:i}=r,o=t.useMemo(()=>rt(r)?new wn({serverUrl:n,version:a,orgId:s}):null,[n,a,s]),c=t.useCallback(async t=>o?kn||(kn=(async()=>{try{const r=await o.getSettings(t);return e.os(et(r)),r}catch(e){return De(e,{component:"useSaaSSettings",action:"getSettings",metadata:{serverUrl:n,version:a,orgId:s}}),null}finally{kn=null}})(),kn):null,[o,e,n,a,s]);return xn(async e=>{i||rt(r)&&await c(e)},[n,a,s],{onError:e=>De(e,{component:"useSaaSSettings",action:"fetchSettings",metadata:{serverUrl:n,version:a,orgId:s}})}),t.useMemo(()=>({settings:i,getSettings:c}),[i,c])}function Cn(){const e=Sn(),r=function(e){return t.useMemo(()=>new bn(e),[e.serverUrl,e.version,e.orgId])}(e);return t.useMemo(()=>({os:e,api:r}),[e,r])}function Nn(e,t,r){return e instanceof Error?e.message:r(t)}const An=e=>{const{t:r}=sn(),{os:n,api:a}=Cn(),s=rt(n),[i,o]=t.useState(null),[c,l]=t.useState(!1),[u,d]=t.useState(null),p=t.useCallback(async()=>{if(e&&s){l(!0),d(null);try{const t=await a.getPublicPlans(e);o(t)}catch(t){const n=Nn(t,"errors.fetchPlans",r);d(n),Re(t,{component:"usePublicPlans",action:"fetchPlans",metadata:{slug:e}})}finally{l(!1)}}else o(null)},[a,e,s]);t.useEffect(()=>{p()},[p]);const m=e&&!s||c;return{items:i?.items??[],plans:i?.plans??[],notes:i?.notes,loading:m,error:u,refetch:p}},_n=e=>{const{t:r}=sn(),{api:n}=Cn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),u=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getCurrentSubscription(e);s(t)}catch(t){const n=Nn(t,"errors.fetchSubscription",r);l(n),Re(t,{component:"useSubscription",action:"fetchSubscription",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{u()},[u]),{subscription:a,loading:i,error:c,refetch:u}},jn=(e,r)=>{const{t:n}=sn(),{api:a}=Cn(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,u]=t.useState(null),d=t.useCallback(async()=>{if(e){c(!0),u(null);try{const t=r?await a.getPlanGroupByVersion(e,r):await a.getPlanGroup(e);i(t)}catch(t){const a=Nn(t,"errors.fetchPlanGroup",n);u(a),Re(t,{component:"usePlanGroup",action:"fetchPlanGroup",metadata:{workspaceId:e,groupVersionId:r}})}finally{c(!1)}}else i(null)},[a,e,r]);return t.useEffect(()=>{d()},[d]),{planGroup:s,loading:o,error:l,refetch:d}},Pn=e=>{const{t:r}=sn(),{api:n}=Cn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),u=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getPlanGroupVersions(e);s(t)}catch(t){const n=Nn(t,"errors.fetchPlanGroupVersions",r);l(n),Re(t,{component:"usePlanGroupVersions",action:"fetchVersions",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{u()},[u]),{versions:a,loading:i,error:c,refetch:u}},Tn=e=>{const{t:r}=sn(),{api:n}=Cn(),{getCheckoutStripeParams:a}=t.useContext(jt),[s,i]=t.useState(!1),[o,c]=t.useState(null);return{createCheckoutSession:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");i(!0),c(null);try{let r=t;if(a){const e=await a(t);e&&(r={...t,stripeOptions:{...t.stripeOptions,...e,metadata:{...t.stripeOptions?.metadata,...e.metadata},subscriptionMetadata:{...t.stripeOptions?.subscriptionMetadata,...e.subscriptionMetadata}}})}const s=await n.createCheckoutSession(e,r);return"trial_started"===s.type&&(It(),Rt()),s}catch(n){const a=Nn(n,"errors.createCheckout",r);throw c(a),Re(n,{component:"useCreateCheckoutSession",action:"createCheckoutSession",metadata:{workspaceId:e,request:t}}),n}finally{i(!1)}},[n,e,a]),loading:s,error:o}},Rn=e=>{const{t:r}=sn(),{api:n}=Cn(),[a,s]=t.useState(!1),[i,o]=t.useState(null),c=t.useCallback(async(t,a)=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const r={planVersionId:t,...a?.billingInterval&&{billingInterval:a.billingInterval},...a?.successUrl&&{successUrl:a.successUrl},...a?.cancelUrl&&{cancelUrl:a.cancelUrl}},s=await n.updateSubscription(e,r);return It(),s}catch(n){const s=Nn(n,"errors.updateSubscription",r);throw o(s),Re(n,{component:"useUpdateSubscription",action:"updateSubscription",metadata:{workspaceId:e,planVersionId:t,options:a}}),n}finally{s(!1)}},[n,e]);return{updateSubscription:c,loading:a,error:i}},Dn=(e,r)=>{const n=_n(e),a=jn(e,r),s=Rn(e),i=t.useCallback(async()=>{await Promise.all([n.refetch(),a.refetch()])},[n.refetch,a.refetch]);return{subscription:n.subscription,planGroup:a.planGroup,loading:n.loading||a.loading||s.loading,error:n.error||a.error||s.error,updateSubscription:s.updateSubscription,refetch:i}},In=(e,r=10,n)=>{const{t:a}=sn(),{api:s}=Cn(),[i,o]=t.useState([]),[c,l]=t.useState(!1),[u,d]=t.useState(!1),[p,m]=t.useState(null),h=t.useCallback(async()=>{if(!e)return o([]),void l(!1);d(!0),m(null);try{const t=await s.listInvoices(e,r,n);o(t.invoices||[]),l(t.has_more||!1)}catch(t){const s=Nn(t,"errors.fetchInvoices",a);m(s),Re(t,{component:"useInvoices",action:"fetchInvoices",metadata:{workspaceId:e,limit:r,startingAfter:n}})}finally{d(!1)}},[s,e,r,n]);return t.useEffect(()=>{h()},[h]),{invoices:i,hasMore:c,loading:u,error:p,refetch:h}},Un=e=>{const{t:r}=sn(),{api:n}=Cn(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{openBillingPortal:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const r=t||window.location.href,a=await n.createBillingPortalSession(e,r);return a.url&&window.open(a.url,"_blank","noopener,noreferrer"),a}catch(t){const n=Nn(t,"errors.openBillingPortal",r);throw o(n),Re(t,{component:"useBillingPortal",action:"openBillingPortal",metadata:{workspaceId:e}}),t}finally{s(!1)}},[e,n]),loading:a,error:i}},Mn=e=>{const{t:r}=sn(),{api:n}=Cn(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{cancelSubscription:t.useCallback(async()=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const t=await n.cancelSubscriptionAtPeriodEnd(e);return It(),t}catch(t){const n=Nn(t,"errors.cancelSubscription",r);throw o(n),Re(t,{component:"useCancelSubscription",action:"cancelSubscription",metadata:{workspaceId:e}}),t}finally{s(!1)}},[n,e]),loading:a,error:i}},On=e=>{const{t:r}=sn(),{api:n}=Cn(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{resumeSubscription:t.useCallback(async()=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const t=await n.resumeSubscription(e);return It(),t}catch(t){const n=Nn(t,"errors.resumeSubscription",r);throw o(n),Re(t,{component:"useResumeSubscription",action:"resumeSubscription",metadata:{workspaceId:e}}),t}finally{s(!1)}},[n,e]),loading:a,error:i}},Ln=e=>{const{t:r}=sn(),{api:n}=Cn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),u=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getAllQuotaUsage(e);s(t.quotas)}catch(t){const n=Nn(t,"errors.fetchAllQuotaUsage",r);l(n),Re(t,{component:"useAllQuotaUsage",action:"fetchAllUsage",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{u()},[u]),{quotas:a,loading:i,error:c,refetch:u}},zn=t.createContext(null);zn.displayName="SubscriptionContext";const Fn=t.memo(function({children:r}){const n=yn(e=>e.workspaces.currentWorkspace),{subscription:a,loading:s,error:i,refetch:o}=_n(n?._id);t.useEffect(()=>{return e=o,Dt.add(e),()=>{Dt.delete(e)};var e},[o]);const c=t.useMemo(()=>({response:a,loading:s,error:i,refetch:o}),[a,s,i,o]);return e.jsx(zn.Provider,{value:c,children:r})});function Bn(){const e=t.useContext(zn);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}Fn.displayName="SubscriptionContextProvider";const Wn=t.createContext({appPermissions:void 0});function Vn({appPermissions:r,children:n}){const a=t.useMemo(()=>({appPermissions:r}),[r]);return e.jsx(Wn.Provider,{value:a,children:n})}function Hn(){return t.useContext(Wn)}const Gn={Monthly:"monthly",Yearly:"yearly",Quarterly:"quarterly"},$n="active",Kn="trialing",qn="canceled",Zn="past_due",Jn="paused",Yn="draft",Xn="open",Qn="paid",ea="uncollectible",ta="void",ra="feature",na="limit",aa="quota",sa="none",ia="final",oa="suspended";function ca(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 la(e,t,r){const n=ca(e,t);if(!n?.basePricing)return null;const a=n.basePricing[r];return null!=a?a:null}function ua(e,t,r,n){const a=ca(e,t),s=a?.quotaOverages?.[r];if(s)return s[n]}function da(e,t,r,n){const a=e.quotas?.[r];if(null==a)return null;const s=a[n];if(!s)return null;const i=ua(e,t,r,n);return{included:s.included,...void 0!==s.unitSize&&{unitSize:s.unitSize},...void 0!==i&&{overage:i},allowOverage:!1!==a.allowOverage}}function pa(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 ma(e,t){const r=ca(e,t);return r?.seatPricing?.enabled?r.seatPricing:null}function ha(e,t,r){const n=ma(e,t);return n?.perSeat?n.perSeat[r]??null:null}function fa(e){const{planVersion:t,currency:r="usd",settingsMaxUsers:n}=e;if(t){const e=ma(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 ga(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:s,source:i}=r;if(s<=0)return{canInvite:!0,blockReason:null,blockMessageKey:null,blockMessageValues:null};if(t>=s){return{canInvite:!1,blockReason:{seat_pricing:"seat_limit_reached",settings:"settings_user_limit_reached"}[i]??"seat_limit_reached",blockMessageKey:{seat_pricing:"users.seatLimitMessage",settings:"users.settingsLimitMessage"}[i]??"users.memberLimitMessage",blockMessageValues:{maxUsers:s}}}return{canInvite:!0,blockReason:null,blockMessageKey:null,blockMessageValues:null}}const ba="user:created",va="user:updated",ya="workspace:changed",xa="workspace:updated",wa="workspace:user-added",Sa="workspace:user-removed",ka="workspace:user-role-changed",Ea="workspace:created",Ca="workspace:deleted";const Na=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){Re(t,{component:"EventEmitter",action:"emit",metadata:{eventType:e}})}}async emitUserCreated(e){await this.emit(ba,{user:e})}async emitUserUpdated(e,t){await this.emit(va,{user:e,previousUser:t})}async emitWorkspaceChanged(e,t){await this.emit(ya,{workspace:e,previousWorkspace:t})}async emitWorkspaceUpdated(e){await this.emit(xa,{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(Sa,{userId:e,workspace:t,role:r})}async emitWorkspaceUserRoleChanged(e,t,r,n){await this.emit(ka,{userId:e,workspace:t,previousRole:r,newRole:n})}async emitWorkspaceCreated(e){await this.emit(Ea,{workspace:e})}async emitWorkspaceDeleted(e){await this.emit(Ca,{workspace:e})}},Aa=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_a=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)},ja=(...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),Pa=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
|
|
2
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("react-dom");function n(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var a=n(t),s=n(r);function i(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=i(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function o(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=i(e))&&(n&&(n+=" "),n+=t);return n}const c=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),l="-",d=[],u=e=>{const t=h(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return m(e);const r=e.split(l),n=""===r[0]&&r.length>1?1:0;return p(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||d}return r[e]||d}}},p=(e,t,r)=>{if(0===e.length-t)return r.classGroupId;const n=e[t],a=r.nextPart.get(n);if(a){const r=p(e,t+1,a);if(r)return r}const s=r.validators;if(null===s)return;const i=0===t?e.join(l):e.slice(t).join(l),o=s.length;for(let e=0;e<o;e++){const t=s[e];if(t.validator(i))return t.classGroupId}},m=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})(),h=e=>{const{theme:t,classGroups:r}=e;return f(r,t)},f=(e,t)=>{const r=c();for(const n in e){const a=e[n];g(a,r,n,t)}return r},g=(e,t,r,n)=>{const a=e.length;for(let s=0;s<a;s++){const a=e[s];b(a,t,r,n)}},b=(e,t,r,n)=>{"string"!=typeof e?"function"!=typeof e?x(e,t,r,n):y(e,t,r,n):v(e,t,r)},v=(e,t,r)=>{(""===e?t:w(t,e)).classGroupId=r},y=(e,t,r,n)=>{S(e)?g(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(r,e)))},x=(e,t,r,n)=>{const a=Object.entries(e),s=a.length;for(let e=0;e<s;e++){const[s,i]=a[e];g(i,w(t,s),r,n)}},w=(e,t)=>{let r=e;const n=t.split(l),a=n.length;for(let e=0;e<a;e++){const t=n[e];let a=r.nextPart.get(t);a||(a=c(),r.nextPart.set(t,a)),r=a}return r},S=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,k=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const a=(a,s)=>{r[a]=s,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)}}},C=[],E=(e,t,r,n,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:a}),N=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=e=>{const t=[];let r,n=0,a=0,s=0;const i=e.length;for(let o=0;o<i;o++){const i=e[o];if(0===n&&0===a){if(":"===i){t.push(e.slice(s,o)),s=o+1;continue}if("/"===i){r=o;continue}}"["===i?n++:"]"===i?n--:"("===i?a++:")"===i&&a--}const o=0===t.length?e:e.slice(s);let c=o,l=!1;o.endsWith("!")?(c=o.slice(0,-1),l=!0):o.startsWith("!")&&(c=o.slice(1),l=!0);return E(t,l,c,r&&r>s?r-s:void 0)};if(t){const e=t+":",r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):E(C,!1,t,void 0,!0)}if(r){const e=n;n=t=>r({className:t,parseClassName:e})}return n},j=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 s=e[a],i="["===s[0],o=t.has(s);i||o?(n.length>0&&(n.sort(),r.push(...n),n=[]),r.push(s)):n.push(s)}return n.length>0&&(n.sort(),r.push(...n)),r}},A=/\s+/,_=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=_(e[n]))&&(r&&(r+=" "),r+=t);return r},P=(e,...t)=>{let r,n,a,s;const i=e=>{const t=n(e);if(t)return t;const s=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:s}=t,i=[],o=e.trim().split(A);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]:s(d).join(":"),b=u?g+"!":g,v=b+f;if(i.indexOf(v)>-1)continue;i.push(v);const y=a(f,h);for(let e=0;e<y.length;++e){const t=y[e];i.push(b+t)}c=t+(c.length>0?" "+c:c)}return c})(e,r);return a(e,s),s};return s=o=>{const c=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:k(e.cacheSize),parseClassName:N(e),sortModifiers:j(e),...u(e)}))(c),n=r.cache.get,a=r.cache.set,s=i,i(o)},(...e)=>s(((...e)=>{let t,r,n=0,a="";for(;n<e.length;)(t=e[n++])&&(r=_(t))&&(a&&(a+=" "),a+=r);return a})(...e))},T=[],R=e=>{const t=t=>t[e]||T;return t.isThemeGetter=!0,t},D=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,I=/^\((?:(\w[\w-]*):)?(.+)\)$/i,M=/^\d+\/\d+$/,U=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,L=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,O=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,z=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,F=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,B=e=>M.test(e),W=e=>!!e&&!Number.isNaN(Number(e)),V=e=>!!e&&Number.isInteger(Number(e)),G=e=>e.endsWith("%")&&W(e.slice(0,-1)),H=e=>U.test(e),$=()=>!0,K=e=>L.test(e)&&!O.test(e),q=()=>!1,Z=e=>z.test(e),J=e=>F.test(e),Y=e=>!Q(e)&&!se(e),X=e=>pe(e,ge,q),Q=e=>D.test(e),ee=e=>pe(e,be,K),te=e=>pe(e,ve,W),re=e=>pe(e,he,q),ne=e=>pe(e,fe,J),ae=e=>pe(e,xe,Z),se=e=>I.test(e),ie=e=>me(e,be),oe=e=>me(e,ye),ce=e=>me(e,he),le=e=>me(e,ge),de=e=>me(e,fe),ue=e=>me(e,xe,!0),pe=(e,t,r)=>{const n=D.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},me=(e,t,r=!1)=>{const n=I.exec(e);return!!n&&(n[1]?t(n[1]):r)},he=e=>"position"===e||"percentage"===e,fe=e=>"image"===e||"url"===e,ge=e=>"length"===e||"size"===e||"bg-size"===e,be=e=>"length"===e,ve=e=>"number"===e,ye=e=>"family-name"===e,xe=e=>"shadow"===e,we=P(()=>{const e=R("color"),t=R("font"),r=R("text"),n=R("font-weight"),a=R("tracking"),s=R("leading"),i=R("breakpoint"),o=R("container"),c=R("spacing"),l=R("radius"),d=R("shadow"),u=R("inset-shadow"),p=R("text-shadow"),m=R("drop-shadow"),h=R("blur"),f=R("perspective"),g=R("aspect"),b=R("ease"),v=R("animate"),y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",se,Q],x=()=>[se,Q,c],w=()=>[B,"full","auto",...x()],S=()=>[V,"none","subgrid",se,Q],k=()=>["auto",{span:["full",V,se,Q]},V,se,Q],C=()=>[V,"auto",se,Q],E=()=>["auto","min","max","fr",se,Q],N=()=>["auto",...x()],j=()=>[B,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],A=()=>[e,se,Q],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ce,re,{position:[se,Q]}],P=()=>["auto","cover","contain",le,X,{size:[se,Q]}],T=()=>[G,ie,ee],D=()=>["","none","full",l,se,Q],I=()=>["",W,ie,ee],M=()=>[W,G,ce,re],U=()=>["","none",h,se,Q],L=()=>["none",W,se,Q],O=()=>["none",W,se,Q],z=()=>[W,se,Q],F=()=>[B,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[H],breakpoint:[H],color:[$],container:[H],"drop-shadow":[H],ease:["in","out","in-out"],font:[Y],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[H],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[H],shadow:[H],spacing:["px",W],text:[H],"text-shadow":[H],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",B,Q,se,g]}],container:["container"],columns:[{columns:[W,Q,se,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:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{start:w()}],end:[{end:w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[V,"auto",se,Q]}],basis:[{basis:[B,"full","auto",o,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[W,B,"auto","initial","none",Q]}],grow:[{grow:["",W,se,Q]}],shrink:[{shrink:["",W,se,Q]}],order:[{order:[V,"first","last","none",se,Q]}],"grid-cols":[{"grid-cols":S()}],"col-start-end":[{col:k()}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":S()}],"row-start-end":[{row:k()}],"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":E()}],"auto-rows":[{"auto-rows":E()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"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:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:j()}],w:[{w:[o,"screen",...j()]}],"min-w":[{"min-w":[o,"screen","none",...j()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[i]},...j()]}],h:[{h:["screen","lh",...j()]}],"min-h":[{"min-h":["screen","lh","none",...j()]}],"max-h":[{"max-h":["screen","lh",...j()]}],"font-size":[{text:["base",r,ie,ee]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,se,te]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",G,Q]}],"font-family":[{font:[oe,Q,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,se,Q]}],"line-clamp":[{"line-clamp":[W,"none",se,te]}],leading:[{leading:[s,...x()]}],"list-image":[{"list-image":["none",se,Q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",se,Q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[W,"from-font","auto",se,ee]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[W,"auto",se,Q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",se,Q]}],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",se,Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:_()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},V,se,Q],radial:["",se,Q],conic:[V,se,Q]},de,ne]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:T()}],"gradient-via-pos":[{via:T()}],"gradient-to-pos":[{to:T()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],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:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[W,se,Q]}],"outline-w":[{outline:["",W,ie,ee]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",d,ue,ae]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",u,ue,ae]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[W,ee]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",p,ue,ae]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[W,se,Q]}],"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":[W]}],"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":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"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":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"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":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"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":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"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":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"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":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"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":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[se,Q]}],"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":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["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":[W]}],"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":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:_()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",se,Q]}],filter:[{filter:["","none",se,Q]}],blur:[{blur:U()}],brightness:[{brightness:[W,se,Q]}],contrast:[{contrast:[W,se,Q]}],"drop-shadow":[{"drop-shadow":["","none",m,ue,ae]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",W,se,Q]}],"hue-rotate":[{"hue-rotate":[W,se,Q]}],invert:[{invert:["",W,se,Q]}],saturate:[{saturate:[W,se,Q]}],sepia:[{sepia:["",W,se,Q]}],"backdrop-filter":[{"backdrop-filter":["","none",se,Q]}],"backdrop-blur":[{"backdrop-blur":U()}],"backdrop-brightness":[{"backdrop-brightness":[W,se,Q]}],"backdrop-contrast":[{"backdrop-contrast":[W,se,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",W,se,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[W,se,Q]}],"backdrop-invert":[{"backdrop-invert":["",W,se,Q]}],"backdrop-opacity":[{"backdrop-opacity":[W,se,Q]}],"backdrop-saturate":[{"backdrop-saturate":[W,se,Q]}],"backdrop-sepia":[{"backdrop-sepia":["",W,se,Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",se,Q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[W,"initial",se,Q]}],ease:[{ease:["linear","initial",b,se,Q]}],delay:[{delay:[W,se,Q]}],animate:[{animate:["none",v,se,Q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[f,se,Q]}],"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:[se,Q,"","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:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",se,Q]}],"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":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"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",se,Q]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[W,ie,ee,te]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Se(...e){return we(o(e))}let ke=!0;function Ce(e,...t){ke&&function(){try{const e="undefined"!=typeof globalThis?globalThis:null;return"development"===e?.process?.env?.NODE_ENV}catch{return!1}}()&&console.error(e,...t)}function Ee(e,...t){console.error(e,...t)}function Ne(e){return e instanceof Error&&("AbortError"===e.name||"ERR_CANCELED"===e.code)}async function je(e,t){try{const r=await e.json();return r?.message||r?.error||t}catch{return t}}async function Ae(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 _e(e,t="Request failed"){if(!e.ok){let r=t;try{const t=await Ae(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 Ae(e)}catch(e){if(e instanceof Error&&e.message.includes("Invalid JSON"))throw e;throw new Error("Failed to parse response as JSON")}}class Pe 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,Pe)}}const Te=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&&(ke=e.enableLogging)}({enableLogging:e.enableConsoleLogging})}handleError(e,t={}){if(Ne(e))return;const r=e instanceof Error?e:new Pe("string"==typeof e?e:"An unknown error occurred","UNKNOWN_ERROR",t),n=r instanceof Pe?r:new Pe(r.message,"SDK_ERROR",t,r);if(this.config.enableConsoleLogging&&Ce(`[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){Ee("[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 Re(e,t={}){Te.handleError(e,t)}function De(e,t={}){return!Ne(e)&&(Te.handleError(e,t),!0)}class Ie extends t.Component{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(Re(e,{component:"ErrorBoundary",action:"componentDidCatch",metadata:{componentStack:t.componentStack,errorBoundary:this.constructor.name}}),this.props.onError)try{this.props.onError(e,t)}catch(e){Ee("[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.jsxs("div",{style:{padding:"1rem",border:"1px solid #ef4444",borderRadius:"0.5rem",backgroundColor:"#fef2f2",color:"#991b1b"},children:[e.jsx("h3",{style:{margin:"0 0 0.5rem 0",fontSize:"1rem",fontWeight:600},children:"Something went wrong"}),e.jsx("p",{style:{margin:"0 0 1rem 0",fontSize:"0.875rem"},children:this.state.error.message||"An unexpected error occurred"}),e.jsx("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 Me=()=>({type:"AUTHENTICATION_STARTED"}),Ue=()=>({type:"AUTHENTICATION_PROCESSING"}),Le=()=>({type:"AUTHENTICATION_FAILED"}),Oe=e=>({type:"SET_SESSION",payload:e}),ze=()=>({type:"REMOVE_SESSION"});function Fe(e,r,n){const a=t.useRef(r),s=t.useRef(n),i=t.useRef(void 0),o=t.useRef(!1);return a.current=r,s.current=n,t.useMemo(()=>{const t=a.current(e);if(o.current){if(s.current?s.current(i.current,t):Object.is(i.current,t))return i.current}return i.current=t,o.current=!0,t},[e])}function Be({name:r,initialState:n,reducer:a,initializer:s}){const i=t.createContext(null),o=t.createContext(null),c=t.createContext(null),l=t.memo(({children:r})=>{const[l,d]=t.useReducer(a,n,s||(e=>e)),u=t.useMemo(()=>({state:l,dispatch:d}),[l,d]);return e.jsx(c.Provider,{value:u,children:e.jsx(i.Provider,{value:l,children:e.jsx(o.Provider,{value:d,children:r})})})});l.displayName=`${r}Provider`;const d=e=>new Error(`use${r}${e} must be used within a ${r}Provider. Make sure SaaSOSProvider is wrapping your application.`),u=()=>{const e=t.useContext(i);if(null===e)throw d("State");return e};return{Provider:l,useContext:()=>{const e=t.useContext(c);if(!e)throw d("Context");return e},useState:u,useDispatch:()=>{const e=t.useContext(o);if(null===e)throw d("Dispatch");return e},useSelector:(e,t)=>{const r=e||(e=>e);return Fe(u(),r,t)}}}var We;function Ve(e){return{isAuthenticated:e===We.authenticated,isLoading:e===We.loading||e===We.redirecting||e===We.authenticating,isRedirecting:e===We.redirecting}}function Ge(e,t,r){return{...e,[t]:r}}function He(e,t){return{...e,...t}}!function(e){e.loading="loading",e.redirecting="redirecting",e.authenticated="authenticated",e.unauthenticated="unauthenticated",e.authenticating="authenticating"}(We||(We={}));const $e=()=>({session:null,status:We.loading}),{Provider:Ke,useState:qe,useDispatch:Ze}=Be({name:"Auth",initialState:$e(),reducer:(e,t)=>{switch(t.type){case"AUTHENTICATION_STARTED":return Ge(e,"status",We.redirecting);case"AUTHENTICATION_PROCESSING":return Ge(e,"status",We.authenticating);case"AUTHENTICATION_FAILED":case"REMOVE_SESSION":return He(e,{session:null,status:We.unauthenticated});case"SET_SESSION":return He(e,{session:t.payload,status:We.authenticated});default:return e}},initializer:$e}),Je=Ke,Ye=qe,Xe=Ze,Qe=e=>({type:"SET_SAAS_OS_CONFIG",payload:e}),et=e=>({type:"SET_SETTINGS",payload:e});var tt;function rt(e){return Boolean(e?.serverUrl&&e?.version&&e?.orgId)}!function(e){e.V1="v1"}(tt||(tt={}));const nt=()=>({serverUrl:"",version:tt.V1,orgId:"",settings:null}),{Provider:at,useState:st,useDispatch:it}=Be({name:"OS",initialState:nt(),reducer:(e,t)=>{switch(t.type){case"SET_SAAS_OS_CONFIG":return He(e,t.payload);case"REMOVE_SAAS_OS_CONFIG":return nt();case"SET_SETTINGS":return Ge(e,"settings",t.payload);default:return e}}}),ot=at,ct=st,lt=it,dt=e=>({type:"SET_WORKSPACES",payload:e}),ut=e=>({type:"ADD_WORKSPACE",payload:e}),pt=e=>({type:"UPDATE_WORKSPACE",payload:e}),mt=e=>({type:"REMOVE_WORKSPACE",payload:e}),ht=e=>({type:"SET_ALL_FEATURES",payload:e}),ft=e=>({type:"SET_CURRENT_WORKSPACE",payload:e}),gt=()=>({type:"RESET_CURRENT_WORKSPACE"}),bt=e=>({type:"SET_IS_INITIALIZED",payload:e}),vt=e=>({type:"SET_LOADING",payload:e}),yt=e=>({type:"SET_ERROR",payload:e}),xt=e=>({type:"SET_REFRESHING",payload:e}),wt=e=>({type:"SET_SWITCHING_TO_ID",payload:e}),{Provider:St,useState:kt,useDispatch:Ct}=Be({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 Ge(e,"workspaces",t.payload);case"ADD_WORKSPACE":return Ge(e,"workspaces",[...e.workspaces,t.payload]);case"UPDATE_WORKSPACE":return Ge(e,"workspaces",e.workspaces.map(e=>e._id===t.payload._id?t.payload:e));case"REMOVE_WORKSPACE":return Ge(e,"workspaces",e.workspaces.filter(e=>e._id!==t.payload));case"SET_ALL_FEATURES":return Ge(e,"allFeatures",t.payload);case"SET_CURRENT_WORKSPACE":return Ge(e,"currentWorkspace",t.payload);case"RESET_CURRENT_WORKSPACE":return Ge(e,"currentWorkspace",null);case"SET_IS_INITIALIZED":return Ge(e,"isInitialized",t.payload);case"SET_LOADING":return Ge(e,"loading",t.payload);case"SET_ERROR":return Ge(e,"error",t.payload);case"SET_REFRESHING":return Ge(e,"refreshing",t.payload);case"SET_SWITCHING_TO_ID":return Ge(e,"switchingToId",t.payload);default:return e}}}),Et=St,Nt=kt,jt=Ct,At=t.memo(({children:t})=>e.jsx(ot,{children:e.jsx(Je,{children:e.jsx(Et,{children:t})})}));At.displayName="SDKContextProvider";const _t=t.createContext({});_t.displayName="CheckoutConfigContext";const Pt=t.memo(({getCheckoutStripeParams:r,children:n})=>{const a=t.useMemo(()=>({getCheckoutStripeParams:r}),[r]);return e.jsx(_t.Provider,{value:a,children:n})});Pt.displayName="CheckoutConfigProvider";const Tt=new Set;function Rt(){Tt.forEach(e=>e())}const Dt=new Set;function It(){Dt.forEach(e=>e())}function Mt(e,t){const r=t&&t.cache?t.cache:Wt,n=t&&t.serializer?t.serializer:Ft;return(t&&t.strategy?t.strategy:zt)(e,{cache:r,serializer:n})}function Ut(e,t,r,n){const a=null==(s=n)||"number"==typeof s||"boolean"==typeof s?n:r(n);var s;let i=t.get(a);return void 0===i&&(i=e.call(this,n),t.set(a,i)),i}function Lt(e,t,r){const n=Array.prototype.slice.call(arguments,3),a=r(n);let s=t.get(a);return void 0===s&&(s=e.apply(this,n),t.set(a,s)),s}function Ot(e,t,r,n,a){return r.bind(t,e,n,a)}function zt(e,t){return Ot(e,this,1===e.length?Ut:Lt,t.cache.create(),t.serializer)}const Ft=function(){return JSON.stringify(arguments)};class Bt{cache;constructor(){this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}}const Wt={create:function(){return new Bt}},Vt={variadic:function(e,t){return Ot(e,this,Lt,t.cache.create(),t.serializer)}},Gt=/(?:[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 Ht(e){const t={};return e.replace(Gt,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 $t=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function Kt(e){return e.replace(/^(.*?)-/,"")}const qt=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,Zt=/^(@+)?(\+|#+)?[rs]?$/g,Jt=/(\*)(0+)|(#+)(0+)|(0+)/g,Yt=/^(0+)$/;function Xt(e){const t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(Zt,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 Qt(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 er(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)),!Yt.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function tr(e){const t=Qt(e);return t||{}}function rr(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=Kt(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,...tr(t)}),{})};continue;case"engineering":t={...t,notation:"engineering",...r.options.reduce((e,t)=>({...e,...tr(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(Jt,function(e,r,n,a,s,i){if(r)t.minimumIntegerDigits=n.length;else{if(a&&s)throw new Error("We currently do not support maximum integer digits");if(i)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Yt.test(r.stem)){t.minimumIntegerDigits=r.stem.length;continue}if(qt.test(r.stem)){if(r.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(qt,function(e,r,n,a,s,i){return"*"===n?t.minimumFractionDigits=r.length:a&&"#"===a[0]?t.maximumFractionDigits=a.length:s&&i?(t.minimumFractionDigits=s.length,t.maximumFractionDigits=s.length+i.length):(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length),""});const e=r.options[0];"w"===e?t={...t,trailingZeroDisplay:"stripIfInteger"}:e&&(t={...t,...Xt(e)});continue}if(Zt.test(r.stem)){t={...t,...Xt(r.stem)};continue}const e=Qt(r.stem);e&&(t={...t,...e});const n=er(r.stem);n&&(t={...t,...n})}return t}let nr=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}({}),ar=function(e){return e[e.number=0]="number",e[e.dateTime=1]="dateTime",e}({});function sr(e){return e.type===nr.literal}function ir(e){return e.type===nr.argument}function or(e){return e.type===nr.number}function cr(e){return e.type===nr.date}function lr(e){return e.type===nr.time}function dr(e){return e.type===nr.select}function ur(e){return e.type===nr.plural}function pr(e){return e.type===nr.pound}function mr(e){return e.type===nr.tag}function hr(e){return!(!e||"object"!=typeof e||e.type!==ar.number)}function fr(e){return!(!e||"object"!=typeof e||e.type!==ar.dateTime)}let gr=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 br=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,vr={"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 yr(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(vr[n||""]||vr[r||""]||vr[`${r}-001`]||vr["001"])[0]}const xr=new RegExp(`^${br.source}*`),wr=new RegExp(`${br.source}*$`);function Sr(e,t){return{start:e,end:t}}const kr=!!Object.fromEntries,Cr=!!String.prototype.trimStart,Er=!!String.prototype.trimEnd,Nr=kr?Object.fromEntries:function(e){const t={};for(const[r,n]of e)t[r]=n;return t},jr=Cr?function(e){return e.trimStart()}:function(e){return e.replace(xr,"")},Ar=Er?function(e){return e.trimEnd()}:function(e){return e.replace(wr,"")},_r=new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");class Pr{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(gr.UNMATCHED_CLOSING_TAG,Sr(this.clonePosition(),this.clonePosition()))}if(60===a&&!this.ignoreTag&&Tr(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:nr.pound,location:Sr(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:nr.literal,value:`<${n}/>`,location:Sr(r,this.clonePosition())},err:null};if(this.bumpIf(">")){const a=this.parseMessage(e+1,t,!0);if(a.err)return a;const s=a.val,i=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!Tr(this.char()))return this.error(gr.INVALID_TAG,Sr(i,this.clonePosition()));const e=this.clonePosition();return n!==this.parseTagName()?this.error(gr.UNMATCHED_CLOSING_TAG,Sr(e,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:nr.tag,value:n,children:s,location:Sr(r,this.clonePosition())},err:null}:this.error(gr.INVALID_TAG,Sr(i,this.clonePosition())))}return this.error(gr.UNCLOSED_TAG,Sr(r,this.clonePosition()))}return this.error(gr.INVALID_TAG,Sr(r,this.clonePosition()))}parseTagName(){const e=this.offset();for(this.bump();!this.isEOF()&&Rr(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 s=this.tryParseLeftAngleBracket();if(!s)break;n+=s}const a=Sr(r,this.clonePosition());return{val:{type:nr.literal,value:n,location:a},err:null}}tryParseLeftAngleBracket(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(Tr(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(gr.EXPECT_ARGUMENT_CLOSING_BRACE,Sr(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(gr.EMPTY_ARGUMENT,Sr(r,this.clonePosition()));let n=this.parseIdentifierIfPossible().value;if(!n)return this.error(gr.MALFORMED_ARGUMENT,Sr(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(gr.EXPECT_ARGUMENT_CLOSING_BRACE,Sr(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:nr.argument,value:n,location:Sr(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(gr.EXPECT_ARGUMENT_CLOSING_BRACE,Sr(r,this.clonePosition())):this.parseArgumentOptions(e,t,n,r);default:return this.error(gr.MALFORMED_ARGUMENT,Sr(r,this.clonePosition()))}}parseIdentifierIfPossible(){const e=this.clonePosition(),t=this.offset(),r=function(e,t){return _r.lastIndex=t,_r.exec(e)[1]??""}(this.message,t),n=t+r.length;this.bumpTo(n);return{value:r,location:Sr(e,this.clonePosition())}}parseArgumentOptions(e,t,r,n){let a=this.clonePosition(),s=this.parseIdentifierIfPossible().value,i=this.clonePosition();switch(s){case"":return this.error(gr.EXPECT_ARGUMENT_TYPE,Sr(a,i));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=Ar(r.val);if(0===n.length)return this.error(gr.EXPECT_ARGUMENT_STYLE,Sr(this.clonePosition(),this.clonePosition()));e={style:n,styleLocation:Sr(t,this.clonePosition())}}const t=this.tryParseArgumentClose(n);if(t.err)return t;const a=Sr(n,this.clonePosition());if(e&&e.style.startsWith("::")){let t=jr(e.style.slice(2));if("number"===s){const n=this.parseNumberSkeletonFromString(t,e.styleLocation);return n.err?n:{val:{type:nr.number,value:r,location:a,style:n.val},err:null}}{if(0===t.length)return this.error(gr.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 s=0;for(;n+1<e.length&&e.charAt(n+1)===a;)s++,n++;let i=1+(1&s),o=s<2?1:3+(s>>1),c="a",l=yr(t);for("H"!=l&&"k"!=l||(o=0);o-- >0;)r+=c;for(;i-- >0;)r=l+r}else r+="J"===a?"H":a}return r}(t,this.locale));const i={type:ar.dateTime,pattern:n,location:e.styleLocation,parsedOptions:this.shouldParseSkeletons?Ht(n):{}};return{val:{type:"date"===s?nr.date:nr.time,value:r,location:a,style:i},err:null}}}return{val:{type:"number"===s?nr.number:"date"===s?nr.date:nr.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(gr.EXPECT_SELECT_ARGUMENT_OPTIONS,Sr(a,{...a}));this.bumpSpace();let i=this.parseIdentifierIfPossible(),o=0;if("select"!==s&&"offset"===i.value){if(!this.bumpIf(":"))return this.error(gr.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Sr(this.clonePosition(),this.clonePosition()));this.bumpSpace();const e=this.tryParseDecimalInteger(gr.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,gr.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(e.err)return e;this.bumpSpace(),i=this.parseIdentifierIfPossible(),o=e.val}const c=this.tryParsePluralOrSelectOptions(e,s,t,i);if(c.err)return c;const l=this.tryParseArgumentClose(n);if(l.err)return l;const d=Sr(n,this.clonePosition());return"select"===s?{val:{type:nr.select,value:r,options:Nr(c.val),location:d},err:null}:{val:{type:nr.plural,value:r,options:Nr(c.val),offset:o,pluralType:"plural"===s?"cardinal":"ordinal",location:d},err:null}}default:return this.error(gr.INVALID_ARGUMENT_TYPE,Sr(a,i))}}tryParseArgumentClose(e){return this.isEOF()||125!==this.char()?this.error(gr.EXPECT_ARGUMENT_CLOSING_BRACE,Sr(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(gr.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Sr(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($t).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(gr.INVALID_NUMBER_SKELETON,t)}return{val:{type:ar.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?rr(r):{}},err:null}}tryParsePluralOrSelectOptions(e,t,r,n){let a=!1;const s=[],i=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(gr.EXPECT_PLURAL_ARGUMENT_SELECTOR,gr.INVALID_PLURAL_ARGUMENT_SELECTOR);if(t.err)return t;c=Sr(e,this.clonePosition()),o=this.message.slice(e.offset,this.offset())}}if(i.has(o))return this.error("select"===t?gr.DUPLICATE_SELECT_ARGUMENT_SELECTOR:gr.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===o&&(a=!0),this.bumpSpace();const n=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?gr.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:gr.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Sr(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;s.push([o,{value:l.val,location:Sr(n,this.clonePosition())}]),i.add(o),this.bumpSpace(),({value:o,location:c}=this.parseIdentifierIfPossible())}return 0===s.length?this.error("select"===t?gr.EXPECT_SELECT_ARGUMENT_SELECTOR:gr.EXPECT_PLURAL_ARGUMENT_SELECTOR,Sr(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!a?this.error(gr.MISSING_OTHER_CLAUSE,Sr(this.clonePosition(),this.clonePosition())):{val:s,err:null}}tryParseDecimalInteger(e,t){let r=1;const n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);let a=!1,s=0;for(;!this.isEOF();){const e=this.char();if(!(e>=48&&e<=57))break;a=!0,s=10*s+(e-48),this.bump()}const i=Sr(n,this.clonePosition());return a?(s*=r,Number.isSafeInteger(s)?{val:s,err:null}:this.error(t,i)):this.error(e,i)}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()&&Dr(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 Tr(e){return e>=97&&e<=122||e>=65&&e<=90}function Rr(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 Dr(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Ir(e){e.forEach(e=>{if(delete e.location,dr(e)||ur(e))for(const t in e.options)delete e.options[t].location,Ir(e.options[t].value);else or(e)&&hr(e.style)||(cr(e)||lr(e))&&fr(e.style)?delete e.style.location:mr(e)&&Ir(e.children)})}function Mr(e,t={}){t={shouldParseSkeletons:!0,requiresOtherClause:!0,...t};const r=new Pr(e,t).parse();if(r.err){const e=SyntaxError(gr[r.err.kind]);throw e.location=r.err.location,e.originalMessage=r.err.message,e}return t?.captureLocation||Ir(r.val),r.val}let Ur=function(e){return e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API",e}({});class Lr 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 Or extends Lr{constructor(e,t,r,n){super(`Invalid values for "${e}": "${t}". Options are "${Object.keys(r).join('", "')}"`,Ur.INVALID_VALUE,n)}}class zr extends Lr{constructor(e,t,r){super(`Value for "${e}" must be of type ${t}`,Ur.INVALID_VALUE,r)}}class Fr extends Lr{constructor(e,t){super(`The intl string context variable "${e}" was not provided to the string "${t}"`,Ur.MISSING_VALUE,t)}}let Br=function(e){return e[e.literal=0]="literal",e[e.object=1]="object",e}({});function Wr(e){return"function"==typeof e}function Vr(e,t,r,n,a,s,i){if(1===e.length&&sr(e[0]))return[{type:Br.literal,value:e[0].value}];const o=[];for(const c of e){if(sr(c)){o.push({type:Br.literal,value:c.value});continue}if(pr(c)){"number"==typeof s&&o.push({type:Br.literal,value:r.getNumberFormat(t).format(s)});continue}const{value:e}=c;if(!a||!(e in a))throw new Fr(e,i);let l=a[e];if(ir(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?Br.literal:Br.object,value:l});else{if(cr(c)){const e="string"==typeof c.style?n.date[c.style]:fr(c.style)?c.style.parsedOptions:void 0;o.push({type:Br.literal,value:r.getDateTimeFormat(t,e).format(l)});continue}if(lr(c)){const e="string"==typeof c.style?n.time[c.style]:fr(c.style)?c.style.parsedOptions:n.time.medium;o.push({type:Br.literal,value:r.getDateTimeFormat(t,e).format(l)});continue}if(or(c)){const e="string"==typeof c.style?n.number[c.style]:hr(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:Br.literal,value:r.getNumberFormat(t,e).format(l)});continue}if(mr(c)){const{children:e,value:l}=c,d=a[l];if(!Wr(d))throw new zr(l,"function",i);let u=d(Vr(e,t,r,n,a,s).map(e=>e.value));Array.isArray(u)||(u=[u]),o.push(...u.map(e=>({type:"string"==typeof e?Br.literal:Br.object,value:e})))}if(dr(c)){const e=l,s=(Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0)||c.options.other;if(!s)throw new Or(c.value,l,Object.keys(c.options),i);o.push(...Vr(s.value,t,r,n,a));continue}if(ur(c)){const e=`=${l}`;let s=Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0;if(!s){if(!Intl.PluralRules)throw new Lr('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Ur.MISSING_INTL_API,i);const e="bigint"==typeof l?Number(l):l,n=r.getPluralRules(t,{type:c.pluralType}).select(e-(c.offset||0));s=(Object.prototype.hasOwnProperty.call(c.options,n)?c.options[n]:void 0)||c.options.other}if(!s)throw new Or(c.value,l,Object.keys(c.options),i);const d="bigint"==typeof l?Number(l):l;o.push(...Vr(s.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===Br.literal&&t.type===Br.literal?r.value+=t.value:e.push(t),e},[]);var c}function Gr(e,t){return t?Object.keys(e).reduce((r,n)=>{var a,s;return r[n]=(a=e[n],(s=t[n])?{...a,...s,...Object.keys(a).reduce((e,t)=>(e[t]={...a[t],...s[t]},e),{})}:a),r},{...e}):e}function Hr(e){return{create:()=>({get:t=>e[t],set(t,r){e[t]=r}})}}class $r{ast;locales;resolvedLocale;formatters;formats;message;formatterCache={number:{},dateTime:{},pluralRules:{}};constructor(e,t=$r.defaultLocale,r,n){if(this.locales=t,this.resolvedLocale=$r.resolveLocale(t),"string"==typeof e){if(this.message=e,!$r.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");const{...t}=n||{};this.ast=$r.__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=Gr($r.formats,r),this.formatters=n&&n.formatters||function(e={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:Mt((...e)=>new Intl.NumberFormat(...e),{cache:Hr(e.number),strategy:Vt.variadic}),getDateTimeFormat:Mt((...e)=>new Intl.DateTimeFormat(...e),{cache:Hr(e.dateTime),strategy:Vt.variadic}),getPluralRules:Mt((...e)=>new Intl.PluralRules(...e),{cache:Hr(e.pluralRules),strategy:Vt.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===Br.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=>Vr(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 $r.memoizedDefaultLocale||($r.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),$r.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=Mr;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 Kr={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}}"}},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"}},qr={en:async()=>Kr,es:async()=>(await Promise.resolve().then(function(){return XE})).es,fr:async()=>(await Promise.resolve().then(function(){return QE})).fr,de:async()=>(await Promise.resolve().then(function(){return eN})).de,ja:async()=>(await Promise.resolve().then(function(){return tN})).ja,zh:async()=>(await Promise.resolve().then(function(){return rN})).zh,hi:async()=>(await Promise.resolve().then(function(){return nN})).hi,ar:async()=>(await Promise.resolve().then(function(){return aN})).ar},Zr=["en","es","fr","de","ja","zh","hi","ar"];const Jr={hi:"hi-u-nu-deva",ar:"ar-u-nu-arab"};const Yr=t.createContext({messages:Kr,locale:"en",formattingLocale:"en"});function Xr({locale:e="en",children:r}){const n=function(e){const t=e.toLowerCase().replace("_","-");if(Zr.includes(t))return t;const r=t.split("-")[0];return Zr.includes(r)?r:"en"}(e),[a,s]=t.useState(Kr);t.useEffect(()=>{if("en"===n)return void s(Kr);let e=!1;const t=qr[n];return t&&t().then(t=>{e||s(t)}),()=>{e=!0}},[n]);const i=function(e){return Jr[e]??e}(n),o=t.useMemo(()=>({messages:a,locale:n,formattingLocale:i}),[a,n,i]);return t.createElement(Yr.Provider,{value:o},r)}const Qr=new Map,en=new Map,tn=new Map;function rn(e,t){return t?`${e}:${JSON.stringify(t)}`:e}const nn={getNumberFormat(e,t){const r=rn(e,t);let n=Qr.get(r);return n||(n=new Intl.NumberFormat(e,t),Qr.set(r,n)),n},getDateTimeFormat(e,t){const r=rn(e,t);let n=en.get(r);return n||(n=new Intl.DateTimeFormat(e,t),en.set(r,n)),n},getPluralRules(e,t){const r=rn(e,t);let n=tn.get(r);return n||(n=new Intl.PluralRules(e,t),tn.set(r,n)),n}},an=new Map;function sn(){const{messages:e,locale:r,formattingLocale:n}=t.useContext(Yr),a=t.useMemo(()=>(t,r)=>{const a=t.split(".");let s=e;for(const e of a){if(!s||"object"!=typeof s||!(e in s))return t;s=s[e]}const i="string"==typeof s?s:t;if(!r)return i;try{const e=function(e,t){const r=`${t}:${e}`;let n=an.get(r);return n||(n=new $r(e,t,void 0,{formatters:nn}),an.set(r,n)),n}(i,n),t=e.format(r);return"string"==typeof t?t:String(t)}catch{return i.replace(/\{(\w+)\}/g,(e,t)=>String(r[t]??`{${t}}`))}},[e,n]),s="ar"===r?"rtl":"ltr",i=t.useMemo(()=>e=>e.toLocaleString(n),[n]),o=t.useMemo(()=>(e,t)=>{const r=(t??"").trim().toUpperCase();if(!r)return(e/100).toLocaleString(n,{minimumFractionDigits:2});try{return new Intl.NumberFormat(n,{style:"currency",currency:r,minimumFractionDigits:2}).format(e/100)}catch{return(e/100).toLocaleString(n,{minimumFractionDigits:2})}},[n]);return{t:a,locale:r,formattingLocale:n,dir:s,fmtNum:i,fmtCents:o,messages:e}}function on(e){if("undefined"==typeof window)return null;try{return localStorage.getItem(e)}catch(t){return Re(t,{component:"storage",action:"getStorageItem",metadata:{key:e}}),null}}function cn(e,t){if("undefined"!=typeof window)try{localStorage.setItem(e,t)}catch(t){Re(t,{component:"storage",action:"setStorageItem",metadata:{key:e}})}}function ln(e){if("undefined"!=typeof window)try{localStorage.removeItem(e)}catch(t){Re(t,{component:"storage",action:"removeStorageItem",metadata:{key:e}})}}const dn="saas-session-id",un="code";function pn(e){cn(dn,e)}function mn(){return function(){if("undefined"==typeof window)return null;try{return on(dn)}catch(e){return Re(e,{component:"auth-utils",action:"getSessionId",metadata:{key:dn}}),null}}()}function hn(){if("undefined"==typeof window)return null;try{return new URLSearchParams(window.location.search).get(un)}catch(e){return Re(e,{component:"auth-utils",action:"getTokenFromUrl",metadata:{param:un}}),null}}const fn="SDK is not ready (missing serverUrl, version, or orgId)";class gn{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(fn);if(this.requireOrgId&&!this.orgId?.trim())throw new Error(fn)}get baseUrl(){return this.ensureReady(),`${this.serverUrl}/api/${this.version}/${this.basePath}`}getAuthHeaders(){return this._sessionId?{"x-session-id":this._sessionId}:function(){const e=mn(),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),s={...t,headers:a};let i;if(this._timeout>0){const e=new AbortController;i=setTimeout(()=>e.abort(),this._timeout),s.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,s);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!==i){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!==i&&clearTimeout(i)}}async fetchJson(e,t={},r="Request failed"){this.ensureReady();try{const n=await this.executeFetch(e,t);return await _e(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 bn extends gn{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 getPublicCreditPackages(){if(!this.orgId)throw new Error("orgId is required for getPublicCreditPackages");const e=await this.fetchResponse(`${this.orgId}/credit-packages`);if(!e.ok){let t="Failed to fetch credit packages";try{t=(await e.json()).message||t}catch{t=`Failed to fetch credit packages (${e.status}: ${e.statusText})`}throw new Error(t)}const t=await e.json();if(void 0!==t.success&&!t.success)throw new Error(t.message||"Failed to fetch credit packages");return t.data??t}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 s=await a.json();if(void 0!==s.success){if(!s.success)throw new Error(s.message||"Failed to fetch invoices");return s}return s}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}`:""}`,s=await this.fetchResponse(a);if(!s.ok){let e="Failed to fetch usage logs";try{e=(await s.json()).message||e}catch{e=404===s.status?"Workspace not found":401===s.status?"Unauthorized - Please check your session":`Failed to fetch usage logs (${s.status}: ${s.statusText})`}throw new Error(e)}const i=await s.json();if(void 0!==i.success){if(!i.success)throw new Error(i.message||"Failed to fetch usage logs");return i.data||i}return i}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`);if(!t.ok){let e="Failed to fetch credit balance";try{e=(await t.json()).message||e}catch{e=404===t.status?"Workspace not found":401===t.status?"Unauthorized - Please check your session":`Failed to fetch credit balance (${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 credit balance");return r.data||r}return r}async consumeCredits(e,t){const r=await this.fetchResponse(`workspaces/${e}/credits/consume`,{method:"POST",body:JSON.stringify(t)});if(!r.ok){const e=await r.json().catch(()=>({}));if(402===r.status){const t=new Error(e.message||"Insufficient credits");throw t.available=e.available,t.requested=e.requested,t.code="INSUFFICIENT_CREDITS",t}throw new Error(e.message||`Failed to consume credits (${r.status}: ${r.statusText})`)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to consume credits");return n.data||n}return n}async purchaseCredits(e,t){const r=await this.fetchResponse(`workspaces/${e}/credits/purchase`,{method:"POST",body:JSON.stringify(t)});if(!r.ok){let e="Failed to create credit purchase checkout";try{e=(await r.json()).message||e}catch{e=`Failed to create credit purchase checkout (${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 credit purchase checkout");return n.data||n}return n}async getCreditPackages(e){const t=await this.fetchResponse(`workspaces/${e}/credits/packages`);if(!t.ok){let e="Failed to fetch credit packages";try{e=(await t.json()).message||e}catch{e=`Failed to fetch credit packages (${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 credit packages");const e=r.data||r;return e.docs??e}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}`:""}`,s=await this.fetchResponse(a);if(!s.ok){let e="Failed to fetch credit transactions";try{e=(await s.json()).message||e}catch{e=`Failed to fetch credit transactions (${s.status}: ${s.statusText})`}throw new Error(e)}const i=await s.json();if(void 0!==i.success){if(!i.success)throw new Error(i.message||"Failed to fetch credit transactions");return i.data||i}return i}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}`:""}`,s=await this.fetchResponse(a);if(!s.ok){let e="Failed to fetch credit buckets";try{e=(await s.json()).message||e}catch{e=`Failed to fetch credit buckets (${s.status}: ${s.statusText})`}throw new Error(e)}const i=await s.json();if(void 0!==i.success){if(!i.success)throw new Error(i.message||"Failed to fetch credit buckets");return i.data||i}return i}async getExpiringCredits(e,t){const r=t?`?days=${t}`:"",n=await this.fetchResponse(`workspaces/${e}/credits/expiring${r}`);if(!n.ok){let e="Failed to fetch expiring credits";try{e=(await n.json()).message||e}catch{e=`Failed to fetch expiring credits (${n.status}: ${n.statusText})`}throw new Error(e)}const a=await n.json();if(void 0!==a.success){if(!a.success)throw new Error(a.message||"Failed to fetch expiring credits");return a.data||a}return a}}function vn(){const e=Xe(),r=lt(),n=jt();return t.useMemo(()=>({auth:e,os:r,workspaces:n}),[e,r,n])}function yn(e,r){const n=ct(),a=Ye(),s=Nt(),i=e||(e=>e);return Fe(t.useMemo(()=>({os:n,auth:a,workspaces:s}),[n,a,s]),i,r)}function xn(e,r,n){t.useEffect(()=>{const t=new AbortController;return e(t.signal).catch(e=>{Ne(e)||(n?.onError?n.onError(e):Re(e,{component:"useAsyncEffect",action:"effect",metadata:{note:"Unhandled rejection - consider passing onError"}}))}),()=>t.abort()},r)}class wn extends gn{constructor(e){super({...e,requireOrgId:!0})}async getSettings(e){return this.fetchJson(`${this.orgId}/settings`,{signal:e},"Failed to fetch settings")}}function Sn(){return yn(e=>e.os)}let kn=null;function Cn(){const e=vn(),r=Sn(),{serverUrl:n,version:a,orgId:s,settings:i}=r,o=t.useMemo(()=>rt(r)?new wn({serverUrl:n,version:a,orgId:s}):null,[n,a,s]),c=t.useCallback(async t=>o?kn||(kn=(async()=>{try{const r=await o.getSettings(t);return e.os(et(r)),r}catch(e){return De(e,{component:"useSaaSSettings",action:"getSettings",metadata:{serverUrl:n,version:a,orgId:s}}),null}finally{kn=null}})(),kn):null,[o,e,n,a,s]);return xn(async e=>{i||rt(r)&&await c(e)},[n,a,s],{onError:e=>De(e,{component:"useSaaSSettings",action:"fetchSettings",metadata:{serverUrl:n,version:a,orgId:s}})}),t.useMemo(()=>({settings:i,getSettings:c}),[i,c])}function En(){const e=Sn(),r=function(e){return t.useMemo(()=>new bn(e),[e.serverUrl,e.version,e.orgId])}(e);return t.useMemo(()=>({os:e,api:r}),[e,r])}function Nn(e,t,r){return e instanceof Error?e.message:r(t)}const jn=e=>{const{t:r}=sn(),{os:n,api:a}=En(),s=rt(n),[i,o]=t.useState(null),[c,l]=t.useState(!1),[d,u]=t.useState(null),p=t.useCallback(async()=>{if(e&&s){l(!0),u(null);try{const t=await a.getPublicPlans(e);o(t)}catch(t){const n=Nn(t,"errors.fetchPlans",r);u(n),Re(t,{component:"usePublicPlans",action:"fetchPlans",metadata:{slug:e}})}finally{l(!1)}}else o(null)},[a,e,s]);t.useEffect(()=>{p()},[p]);const m=e&&!s||c;return{items:i?.items??[],plans:i?.plans??[],notes:i?.notes,loading:m,error:d,refetch:p}},An=e=>{const{t:r}=sn(),{api:n}=En(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),d=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getCurrentSubscription(e);s(t)}catch(t){const n=Nn(t,"errors.fetchSubscription",r);l(n),Re(t,{component:"useSubscription",action:"fetchSubscription",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{d()},[d]),{subscription:a,loading:i,error:c,refetch:d}},_n=(e,r)=>{const{t:n}=sn(),{api:a}=En(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,d]=t.useState(null),u=t.useCallback(async()=>{if(e){c(!0),d(null);try{const t=r?await a.getPlanGroupByVersion(e,r):await a.getPlanGroup(e);i(t)}catch(t){const a=Nn(t,"errors.fetchPlanGroup",n);d(a),Re(t,{component:"usePlanGroup",action:"fetchPlanGroup",metadata:{workspaceId:e,groupVersionId:r}})}finally{c(!1)}}else i(null)},[a,e,r]);return t.useEffect(()=>{u()},[u]),{planGroup:s,loading:o,error:l,refetch:u}},Pn=e=>{const{t:r}=sn(),{api:n}=En(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),d=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getPlanGroupVersions(e);s(t)}catch(t){const n=Nn(t,"errors.fetchPlanGroupVersions",r);l(n),Re(t,{component:"usePlanGroupVersions",action:"fetchVersions",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{d()},[d]),{versions:a,loading:i,error:c,refetch:d}},Tn=e=>{const{t:r}=sn(),{api:n}=En(),{getCheckoutStripeParams:a}=t.useContext(_t),[s,i]=t.useState(!1),[o,c]=t.useState(null);return{createCheckoutSession:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");i(!0),c(null);try{let r=t;if(a){const e=await a(t);e&&(r={...t,stripeOptions:{...t.stripeOptions,...e,metadata:{...t.stripeOptions?.metadata,...e.metadata},subscriptionMetadata:{...t.stripeOptions?.subscriptionMetadata,...e.subscriptionMetadata}}})}const s=await n.createCheckoutSession(e,r);return"trial_started"===s.type&&(It(),Rt()),s}catch(n){const a=Nn(n,"errors.createCheckout",r);throw c(a),Re(n,{component:"useCreateCheckoutSession",action:"createCheckoutSession",metadata:{workspaceId:e,request:t}}),n}finally{i(!1)}},[n,e,a]),loading:s,error:o}},Rn=e=>{const{t:r}=sn(),{api:n}=En(),[a,s]=t.useState(!1),[i,o]=t.useState(null),c=t.useCallback(async(t,a)=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const r={planVersionId:t,...a?.billingInterval&&{billingInterval:a.billingInterval},...a?.successUrl&&{successUrl:a.successUrl},...a?.cancelUrl&&{cancelUrl:a.cancelUrl}},s=await n.updateSubscription(e,r);return It(),s}catch(n){const s=Nn(n,"errors.updateSubscription",r);throw o(s),Re(n,{component:"useUpdateSubscription",action:"updateSubscription",metadata:{workspaceId:e,planVersionId:t,options:a}}),n}finally{s(!1)}},[n,e]);return{updateSubscription:c,loading:a,error:i}},Dn=(e,r)=>{const n=An(e),a=_n(e,r),s=Rn(e),i=t.useCallback(async()=>{await Promise.all([n.refetch(),a.refetch()])},[n.refetch,a.refetch]);return{subscription:n.subscription,planGroup:a.planGroup,loading:n.loading||a.loading||s.loading,error:n.error||a.error||s.error,updateSubscription:s.updateSubscription,refetch:i}},In=(e,r=10,n)=>{const{t:a}=sn(),{api:s}=En(),[i,o]=t.useState([]),[c,l]=t.useState(!1),[d,u]=t.useState(!1),[p,m]=t.useState(null),h=t.useCallback(async()=>{if(!e)return o([]),void l(!1);u(!0),m(null);try{const t=await s.listInvoices(e,r,n);o(t.invoices||[]),l(t.has_more||!1)}catch(t){const s=Nn(t,"errors.fetchInvoices",a);m(s),Re(t,{component:"useInvoices",action:"fetchInvoices",metadata:{workspaceId:e,limit:r,startingAfter:n}})}finally{u(!1)}},[s,e,r,n]);return t.useEffect(()=>{h()},[h]),{invoices:i,hasMore:c,loading:d,error:p,refetch:h}},Mn=e=>{const{t:r}=sn(),{api:n}=En(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{openBillingPortal:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const r=t||window.location.href,a=await n.createBillingPortalSession(e,r);return a.url&&window.open(a.url,"_blank","noopener,noreferrer"),a}catch(t){const n=Nn(t,"errors.openBillingPortal",r);throw o(n),Re(t,{component:"useBillingPortal",action:"openBillingPortal",metadata:{workspaceId:e}}),t}finally{s(!1)}},[e,n]),loading:a,error:i}},Un=e=>{const{t:r}=sn(),{api:n}=En(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{cancelSubscription:t.useCallback(async()=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const t=await n.cancelSubscriptionAtPeriodEnd(e);return It(),t}catch(t){const n=Nn(t,"errors.cancelSubscription",r);throw o(n),Re(t,{component:"useCancelSubscription",action:"cancelSubscription",metadata:{workspaceId:e}}),t}finally{s(!1)}},[n,e]),loading:a,error:i}},Ln=e=>{const{t:r}=sn(),{api:n}=En(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{resumeSubscription:t.useCallback(async()=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const t=await n.resumeSubscription(e);return It(),t}catch(t){const n=Nn(t,"errors.resumeSubscription",r);throw o(n),Re(t,{component:"useResumeSubscription",action:"resumeSubscription",metadata:{workspaceId:e}}),t}finally{s(!1)}},[n,e]),loading:a,error:i}},On=e=>{const{t:r}=sn(),{api:n}=En(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),d=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getAllQuotaUsage(e);s(t.quotas)}catch(t){const n=Nn(t,"errors.fetchAllQuotaUsage",r);l(n),Re(t,{component:"useAllQuotaUsage",action:"fetchAllUsage",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{d()},[d]),{quotas:a,loading:i,error:c,refetch:d}},zn=t.createContext(null);zn.displayName="SubscriptionContext";const Fn=t.memo(function({children:r}){const n=yn(e=>e.workspaces.currentWorkspace),{subscription:a,loading:s,error:i,refetch:o}=An(n?._id);t.useEffect(()=>{return e=o,Dt.add(e),()=>{Dt.delete(e)};var e},[o]);const c=t.useMemo(()=>({response:a,loading:s,error:i,refetch:o}),[a,s,i,o]);return e.jsx(zn.Provider,{value:c,children:r})});function Bn(){const e=t.useContext(zn);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}Fn.displayName="SubscriptionContextProvider";const Wn=t.createContext({appPermissions:void 0});function Vn({appPermissions:r,children:n}){const a=t.useMemo(()=>({appPermissions:r}),[r]);return e.jsx(Wn.Provider,{value:a,children:n})}function Gn(){return t.useContext(Wn)}const Hn=new Set;function $n(){Hn.forEach(e=>e())}function Kn(e,t,r){return e instanceof Error?e.message:r(t)}const qn=e=>{const{t:r}=sn(),{api:n}=En(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),d=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getCreditBalance(e);s(t)}catch(t){const n=Kn(t,"errors.fetchCreditBalance",r);l(n),Re(t,{component:"useCreditBalance",action:"fetchBalance",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{d()},[d]),{balance:a,loading:i,error:c,refetch:d}},Zn=e=>{const{t:r}=sn(),{api:n}=En(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{consumeCredits:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const r=await n.consumeCredits(e,t);return $n(),r}catch(n){const a="INSUFFICIENT_CREDITS"===n.code?`Insufficient credits. Available: ${n.available}, requested: ${n.requested}`:Kn(n,"errors.consumeCredits",r);throw o(a),Re(n,{component:"useConsumeCredits",action:"consumeCredits",metadata:{workspaceId:e,request:t}}),n}finally{s(!1)}},[n,e]),loading:a,error:i}},Jn=e=>{const{t:r}=sn(),{api:n}=En(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{purchaseCredits:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{return await n.purchaseCredits(e,t)}catch(n){const a=Kn(n,"errors.purchaseCredits",r);throw o(a),Re(n,{component:"usePurchaseCredits",action:"purchaseCredits",metadata:{workspaceId:e,request:t}}),n}finally{s(!1)}},[n,e]),loading:a,error:i}},Yn=e=>{const{t:r}=sn(),{api:n}=En(),[a,s]=t.useState([]),[i,o]=t.useState(!1),[c,l]=t.useState(null),d=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getCreditPackages(e);s(t)}catch(t){const n=Kn(t,"errors.fetchCreditPackages",r);l(n),Re(t,{component:"useCreditPackages",action:"fetchPackages",metadata:{workspaceId:e}})}finally{o(!1)}}else s([])},[n,e]);return t.useEffect(()=>{d()},[d]),{packages:a,loading:i,error:c,refetch:d}},Xn=(e,r)=>{const{t:n}=sn(),{api:a}=En(),[s,i]=t.useState([]),[o,c]=t.useState(0),[l,d]=t.useState(0),[u,p]=t.useState(1),[m,h]=t.useState(!1),[f,g]=t.useState(!1),[b,v]=t.useState(!1),[y,x]=t.useState(null),w=r?.type,S=r?.page,k=r?.limit,C=t.useCallback(async()=>{if(!e)return i([]),c(0),d(0),p(1),h(!1),void g(!1);v(!0),x(null);try{const t=await a.getCreditTransactions(e,{type:w,page:S,limit:k});i(t.docs||[]),c(t.totalDocs||0),d(t.totalPages||0),p(t.page||1),h(t.hasNextPage||!1),g(t.hasPrevPage||!1)}catch(t){const r=Kn(t,"errors.fetchCreditTransactions",n);x(r),Re(t,{component:"useCreditTransactions",action:"fetchTransactions",metadata:{workspaceId:e}})}finally{v(!1)}},[a,e,w,S,k]);return t.useEffect(()=>{C()},[C]),{transactions:s,totalDocs:o,totalPages:l,page:u,hasNextPage:m,hasPrevPage:f,loading:b,error:y,refetch:C}},Qn=(e,r)=>{const{t:n}=sn(),{api:a}=En(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,d]=t.useState(null),u=t.useCallback(async()=>{if(e){c(!0),d(null);try{const t=await a.getExpiringCredits(e,r);i(t)}catch(t){const a=Kn(t,"errors.fetchExpiringCredits",n);d(a),Re(t,{component:"useExpiringCredits",action:"fetchExpiring",metadata:{workspaceId:e,days:r}})}finally{c(!1)}}else i(null)},[a,e,r]);return t.useEffect(()=>{u()},[u]),{expiringCredits:s?.expiringCredits??0,buckets:s?.buckets??[],days:s?.days??r??7,loading:o,error:l,refetch:u}},ea=()=>{const{t:e}=sn(),{os:r,api:n}=En(),a=rt(r),[s,i]=t.useState([]),[o,c]=t.useState(),[l,d]=t.useState(!1),[u,p]=t.useState(null),m=t.useCallback(async()=>{if(a){d(!0),p(null);try{const e=await n.getPublicCreditPackages();i(e.packages||[]),c(e.notes)}catch(t){const r=Kn(t,"errors.fetchCreditPackages",e);p(r),Re(t,{component:"usePublicCreditPackages",action:"fetchPackages"})}finally{d(!1)}}else i([])},[n,a]);t.useEffect(()=>{m()},[m]);return{packages:s,notes:o,loading:!a||l,error:u,refetch:m}},ta=t.createContext(null);ta.displayName="CreditBalanceContext";const ra=t.memo(function({children:r}){const n=yn(e=>e.workspaces.currentWorkspace),{balance:a,loading:s,error:i,refetch:o}=qn(n?._id);t.useEffect(()=>{return e=o,Hn.add(e),()=>{Hn.delete(e)};var e},[o]);const c=t.useMemo(()=>({balance:a,loading:s,error:i,refetch:o}),[a,s,i,o]);return e.jsx(ta.Provider,{value:c,children:r})});function na(){const e=t.useContext(ta);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}ra.displayName="CreditBalanceContextProvider";const aa={Monthly:"monthly",Yearly:"yearly",Quarterly:"quarterly"},sa="active",ia="trialing",oa="canceled",ca="past_due",la="paused",da="draft",ua="open",pa="paid",ma="uncollectible",ha="void",fa="feature",ga="limit",ba="quota",va="none",ya="final",xa="suspended",wa="plan_grant",Sa="pack_purchased",ka="consumed",Ca="expired",Ea="admin_grant",Na="admin_revoke",ja="refund";function Aa(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 _a(e,t,r){const n=Aa(e,t);if(!n?.basePricing)return null;const a=n.basePricing[r];return null!=a?a:null}function Pa(e,t,r,n){const a=Aa(e,t),s=a?.quotaOverages?.[r];if(s)return s[n]}function Ta(e,t,r,n){const a=e.quotas?.[r];if(null==a)return null;const s=a[n];if(!s)return null;const i=Pa(e,t,r,n);return{included:s.included,...void 0!==s.unitSize&&{unitSize:s.unitSize},...void 0!==i&&{overage:i},allowOverage:!1!==a.allowOverage}}function Ra(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 Da(e,t){const r=Aa(e,t);return r?.seatPricing?.enabled?r.seatPricing:null}function Ia(e,t,r){const n=Da(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=Da(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 Ua(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:s,source:i}=r;if(s<=0)return{canInvite:!0,blockReason:null,blockMessageKey:null,blockMessageValues:null};if(t>=s){return{canInvite:!1,blockReason:{seat_pricing:"seat_limit_reached",settings:"settings_user_limit_reached"}[i]??"seat_limit_reached",blockMessageKey:{seat_pricing:"users.seatLimitMessage",settings:"users.settingsLimitMessage"}[i]??"users.memberLimitMessage",blockMessageValues:{maxUsers:s}}}return{canInvite:!0,blockReason:null,blockMessageKey:null,blockMessageValues:null}}const La="user:created",Oa="user:updated",za="workspace:changed",Fa="workspace:updated",Ba="workspace:user-added",Wa="workspace:user-removed",Va="workspace:user-role-changed",Ga="workspace:created",Ha="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){Re(t,{component:"EventEmitter",action:"emit",metadata:{eventType:e}})}}async emitUserCreated(e){await this.emit(La,{user:e})}async emitUserUpdated(e,t){await this.emit(Oa,{user:e,previousUser:t})}async emitWorkspaceChanged(e,t){await this.emit(za,{workspace:e,previousWorkspace:t})}async emitWorkspaceUpdated(e){await this.emit(Fa,{workspace:e})}async emitWorkspaceUserAdded(e,t,r){await this.emit(Ba,{userId:e,workspace:t,role:r})}async emitWorkspaceUserRemoved(e,t,r){await this.emit(Wa,{userId:e,workspace:t,role:r})}async emitWorkspaceUserRoleChanged(e,t,r,n){await this.emit(Va,{userId:e,workspace:t,previousRole:r,newRole:n})}async emitWorkspaceCreated(e){await this.emit(Ga,{workspace:e})}async emitWorkspaceDeleted(e){await this.emit(Ha,{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};
|
|
3
3
|
/**
|
|
4
4
|
* @license lucide-react v0.544.0 - ISC
|
|
5
5
|
*
|
|
@@ -12,19 +12,19 @@
|
|
|
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
|
|
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"};
|
|
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
|
|
21
|
+
*/const Xa=t.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:s="",children:i,iconNode:o,...c},l)=>t.createElement("svg",{ref:l,...Ya,width:r,height:r,stroke:e,strokeWidth:a?24*Number(n)/Number(r):n,className:Za("lucide",s),...!i&&!Ja(c)&&{"aria-hidden":"true"},...c},[...o.map(([e,r])=>t.createElement(e,r)),...Array.isArray(i)?i:[i]])),Qa=(e,r)=>{const n=t.forwardRef(({className:n,...a},s)=>t.createElement(Xa,{ref:s,iconNode:r,className:Za(`lucide-${Ka(qa(e))}`,`lucide-${e}`,n),...a}));return n.displayName=qa(e),n},es=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"}]]),ts=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"}]]),rs=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"}]]),ns=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"}]]),as=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"}]]),ss=Qa("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),is=Qa("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),os=Qa("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),cs=Qa("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"}]]),ls=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"}]]),ds=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"}]]),us=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"}]]),ps=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"}]]),ms=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"}]]),hs=Qa("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),fs=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"}]]),gs=Qa("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),bs=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"}]]),vs=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"}]]),ys=Qa("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),xs=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"}]]),ws=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"}]]),Ss=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"}]]),ks=Qa("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"}]]),Cs=Qa("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),Es=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"}]]),Ns=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"}]]),js=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"}]]),As=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"}]]),_s=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"}]]),Ps=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"}]]),Ts=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"}]]);
|
|
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 ls(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function us(...e){return t=>{let r=!1;const n=e.map(e=>{const n=ls(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():ls(e[t],null)}}}}function ds(...e){return a.useCallback(us(...e),e)}var ps=Symbol.for("react.lazy"),ms=a[" use ".trim().toString()];function hs(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===ps&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}function fs(t){const r=bs(t),n=a.forwardRef((t,n)=>{let{children:s,...i}=t;hs(s)&&"function"==typeof ms&&(s=ms(s._payload));const o=a.Children.toArray(s),c=o.find(ys);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}var gs=fs("Slot");function bs(e){const t=a.forwardRef((e,t)=>{let{children:r,...n}=e;if(hs(r)&&"function"==typeof ms&&(r=ms(r._payload)),a.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),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?us(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vs=Symbol("radix.slottable");function ys(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===vs}const xs=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,ws=o,Ss=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return ws(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:a,defaultVariants:s}=t,i=Object.keys(a).map(e=>{const t=null==r?void 0:r[e],n=null==s?void 0:s[e];if(null===t)return null;const i=xs(t)||xs(n);return a[e][i]}),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({...s,...o}[t]):{...s,...o}[t]===r})?[...e,r,n]:e},[]);return ws(e,i,c,null==r?void 0:r.class,null==r?void 0:r.className)},ks=Ss("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"}}),Es=a.forwardRef(({className:t,variant:r,progress:n,size:s,startIcon:i,endIcon:o,asChild:c=!1,...l},u)=>{const d=c?gs:"button",p=function(e){switch(e){case"lg":return 20;case"sm":return 14;default:return 16}}(s);return e.jsxs(d,{disabled:n||l.disabled,className:Se(ks({variant:r,size:s,withIcon:null!=n||null!=i||null!=o,className:t})),ref:u,...l,children:[n&&e.jsx($a,{size:p,className:"animate-spin"}),i&&a.cloneElement(i,{size:p}),l.children,o&&a.cloneElement(o,{size:p})]})});function Cs(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function Ns(t,r=[]){let n=[];const s=()=>{const e=n.map(e=>a.createContext(e));return function(r){const n=r?.[t]||e;return a.useMemo(()=>({[`__scope${t}`]:{...r,[t]:n}}),[r,n])}};return s.scopeName=t,[function(r,s){const i=a.createContext(s),o=n.length;n=[...n,s];const c=r=>{const{scope:n,children:s,...c}=r,l=n?.[t]?.[o]||i,u=a.useMemo(()=>c,Object.values(c));return e.jsx(l.Provider,{value:u,children:s})};return c.displayName=r+"Provider",[c,function(e,n){const c=n?.[t]?.[o]||i,l=a.useContext(c);if(l)return l;if(void 0!==s)return s;throw new Error(`\`${e}\` must be used within \`${r}\``)}]},As(s,...r)]}function As(...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 n=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}Es.displayName="Button";var _s=globalThis?.document?a.useLayoutEffect:()=>{},js=a[" useId ".trim().toString()]||(()=>{}),Ps=0;function Ts(e){const[t,r]=a.useState(js());return _s(()=>{r(e=>e??String(Ps++))},[e]),e||(t?`radix-${t}`:"")}var Rs=a[" useInsertionEffect ".trim().toString()]||_s;function Ds({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,i,o]=function({defaultProp:e,onChange:t}){const[r,n]=a.useState(e),s=a.useRef(r),i=a.useRef(t);return Rs(()=>{i.current=t},[t]),a.useEffect(()=>{s.current!==r&&(i.current?.(r),s.current=r)},[r,s]),[r,n,i]}({defaultProp:t,onChange:r}),c=void 0!==e,l=c?e:s;{const t=a.useRef(void 0!==e);a.useEffect(()=>{const e=t.current;if(e!==c){const t=e?"controlled":"uncontrolled",r=c?"controlled":"uncontrolled";console.warn(`${n} 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,n])}const u=a.useCallback(t=>{if(c){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&o.current?.(r)}else i(t)},[c,e,i,o]);return[l,u]}function Is(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.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),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?us(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Us=Symbol("radix.slottable");function Ms(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Us}var Os=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=function(t){const r=Is(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(Ms);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}(`Primitive.${r}`),s=a.forwardRef((t,a)=>{const{asChild:s,...i}=t,o=s?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(o,{...i,ref:a})});return s.displayName=`Primitive.${r}`,{...t,[r]:s}},{});function Ls(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...e)=>t.current?.(...e),[])}var zs,Fs="dismissableLayer.update",Bs="dismissableLayer.pointerDownOutside",Ws="dismissableLayer.focusOutside",Vs=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hs=a.forwardRef((t,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:c,onDismiss:l,...u}=t,d=a.useContext(Vs),[p,m]=a.useState(null),h=p?.ownerDocument??globalThis?.document,[,f]=a.useState({}),g=ds(r,e=>m(e)),b=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=b.indexOf(v),x=p?b.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=y,k=function(e,t=globalThis?.document){const r=Ls(e),n=a.useRef(!1),s=a.useRef(()=>{});return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){$s(Bs,r,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",s.current),s.current=n,t.addEventListener("click",s.current,{once:!0})):n()}else t.removeEventListener("click",s.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{const t=e.target,r=[...d.branches].some(e=>e.contains(t));S&&!r&&(i?.(e),c?.(e),e.defaultPrevented||l?.())},h),E=function(e,t=globalThis?.document){const r=Ls(e),n=a.useRef(!1);return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){$s(Ws,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.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=Ls(e);a.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=>{x===d.layers.size-1&&(s?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},h),a.useEffect(()=>{if(p)return n&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(zs=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),Gs(),()=>{n&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=zs)}},[p,h,n,d]),a.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),Gs())},[p,d]),a.useEffect(()=>{const e=()=>f({});return document.addEventListener(Fs,e),()=>document.removeEventListener(Fs,e)},[]),e.jsx(Os.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...t.style},onFocusCapture:Cs(t.onFocusCapture,E.onFocusCapture),onBlurCapture:Cs(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Cs(t.onPointerDownCapture,k.onPointerDownCapture)})});Hs.displayName="DismissableLayer";function Gs(){const e=new CustomEvent(Fs);document.dispatchEvent(e)}function $s(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&&s.flushSync(()=>e.dispatchEvent(t))}(a,i):a.dispatchEvent(i)}a.forwardRef((t,r)=>{const n=a.useContext(Vs),s=a.useRef(null),i=ds(r,s);return a.useEffect(()=>{const e=s.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),e.jsx(Os.div,{...t,ref:i})}).displayName="DismissableLayerBranch";var Ks="focusScope.autoFocusOnMount",qs="focusScope.autoFocusOnUnmount",Zs={bubbles:!1,cancelable:!0},Js=a.forwardRef((t,r)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...c}=t,[l,u]=a.useState(null),d=Ls(i),p=Ls(o),m=a.useRef(null),h=ds(r,e=>u(e)),f=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(s){let e=function(e){if(f.paused||!l)return;const t=e.target;l.contains(t)?m.current=t:ei(m.current,{select:!0})},t=function(e){if(f.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||ei(m.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&ei(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()}}},[s,l,f.paused]),a.useEffect(()=>{if(l){ti.add(f);const t=document.activeElement;if(!l.contains(t)){const r=new CustomEvent(Ks,Zs);l.addEventListener(Ks,d),l.dispatchEvent(r),r.defaultPrevented||(!function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(ei(n,{select:t}),document.activeElement!==r)return}((e=Ys(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&ei(l))}return()=>{l.removeEventListener(Ks,d),setTimeout(()=>{const e=new CustomEvent(qs,Zs);l.addEventListener(qs,p),l.dispatchEvent(e),e.defaultPrevented||ei(t??document.body,{select:!0}),l.removeEventListener(qs,p),ti.remove(f)},0)}}var e},[l,d,p,f]);const g=a.useCallback(e=>{if(!n&&!s)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,[a,s]=function(e){const t=Ys(e),r=Xs(t,e),n=Xs(t.reverse(),e);return[r,n]}(t);a&&s?e.shiftKey||r!==s?e.shiftKey&&r===a&&(e.preventDefault(),n&&ei(s,{select:!0})):(e.preventDefault(),n&&ei(a,{select:!0})):r===t&&e.preventDefault()}},[n,s,f.paused]);return e.jsx(Os.div,{tabIndex:-1,...c,ref:h,onKeyDown:g})});function Ys(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 Xs(e,t){for(const r of e)if(!Qs(r,{upTo:t}))return r}function Qs(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 ei(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()}}Js.displayName="FocusScope";var ti=function(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=ri(e,t),e.unshift(t)},remove(t){e=ri(e,t),e[0]?.resume()}}}();function ri(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var ni=a.forwardRef((t,n)=>{const{container:s,...i}=t,[o,c]=a.useState(!1);_s(()=>c(!0),[]);const l=s||o&&globalThis?.document?.body;return l?r.createPortal(e.jsx(Os.div,{...i,ref:n}),l):null});ni.displayName="Portal";var ai=e=>{const{present:t,children:r}=e,n=function(e){const[t,r]=a.useState(),n=a.useRef(null),s=a.useRef(e),i=a.useRef("none"),o=e?"mounted":"unmounted",[c,l]=function(e,t){return a.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 a.useEffect(()=>{const e=si(n.current);i.current="mounted"===c?e:"none"},[c]),_s(()=>{const t=n.current,r=s.current;if(r!==e){const n=i.current,a=si(t);if(e)l("MOUNT");else if("none"===a||"none"===t?.display)l("UNMOUNT");else{l(r&&n!==a?"ANIMATION_OUT":"UNMOUNT")}s.current=e}},[e,l]),_s(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,a=a=>{const i=si(n.current).includes(CSS.escape(a.animationName));if(a.target===t&&i&&(l("ANIMATION_END"),!s.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&&(i.current=si(n.current))};return t.addEventListener("animationstart",o),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",o),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:a.useCallback(e=>{n.current=e?getComputedStyle(e):null,r(e)},[])}}(t),s="function"==typeof r?r({present:n.isPresent}):a.Children.only(r),i=ds(n.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}(s));return"function"==typeof r||n.isPresent?a.cloneElement(s,{ref:i}):null};function si(e){return e?.animationName||"none"}ai.displayName="Presence";var ii=0;function oi(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ci()),document.body.insertAdjacentElement("beforeend",e[1]??ci()),ii++,()=>{1===ii&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),ii--}},[])}function ci(){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 li=function(){return li=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},li.apply(this,arguments)};function ui(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 di="right-scroll-bar-position",pi="width-before-scroll-bar";function mi(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var hi="undefined"!=typeof window?a.useLayoutEffect:a.useEffect,fi=new WeakMap;function gi(e,r){var n,a,s,i=(n=null,a=function(t){return e.forEach(function(e){return mi(e,t)})},(s=t.useState(function(){return{value:n,callback:a,facade:{get current(){return s.value},set current(e){var t=s.value;t!==e&&(s.value=e,s.callback(e,t))}}}})[0]).callback=a,s.facade);return hi(function(){var t=fi.get(i);if(t){var r=new Set(t),n=new Set(e),a=i.current;r.forEach(function(e){n.has(e)||mi(e,null)}),n.forEach(function(e){r.has(e)||mi(e,a)})}fi.set(i,e)},[e]),i}function bi(e){return e}var vi=function(e){var t=e.sideCar,r=ui(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return a.createElement(n,li({},r))};vi.isSideCarExport=!0;var yi=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=bi);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 s=function(){var r=t;t=[],r.forEach(e)},i=function(){return Promise.resolve().then(s)};i(),r={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),r}}}}}(null);return t.options=li({async:!0,ssr:!1},e),t}(),xi=function(){},wi=a.forwardRef(function(e,t){var r=a.useRef(null),n=a.useState({onScrollCapture:xi,onWheelCapture:xi,onTouchMoveCapture:xi}),s=n[0],i=n[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,x=e.gapMode,w=ui(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,k=gi([r,t]),E=li(li({},w),s);return a.createElement(a.Fragment,null,d&&a.createElement(S,{sideCar:yi,removeScrollBar:u,shards:p,noRelative:h,noIsolation:f,inert:g,setCallbacks:i,allowPinchZoom:!!b,lockRef:r,gapMode:x}),o?a.cloneElement(a.Children.only(c),li(li({},E),{ref:k})):a.createElement(y,li({},E,{className:l,ref:k}),c))});wi.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},wi.classNames={fullWidth:pi,zeroRight:di};function Si(){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 ki=function(){var e=0,t=null;return{add:function(r){var n,a;0==e&&(t=Si())&&(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)}}},Ei=function(){var e,t=(e=ki(),function(t,r){a.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}},Ci={left:0,top:0,right:0,gap:0},Ni=function(e){return parseInt(e||"",10)||0},Ai=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Ci;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[Ni(r),Ni(n),Ni(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])}},_i=Ei(),ji="data-scroll-locked",Pi=function(e,t,r,n){var a=e.left,s=e.top,i=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(ji,"] {\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(s,"px;\n padding-right: ").concat(i,"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(di," {\n right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(pi," {\n margin-right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(di," .").concat(di," {\n right: 0 ").concat(n,";\n }\n \n .").concat(pi," .").concat(pi," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(ji,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(o,"px;\n }\n")},Ti=function(){var e=parseInt(document.body.getAttribute(ji)||"0",10);return isFinite(e)?e:0},Ri=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=void 0===n?"margin":n;a.useEffect(function(){return document.body.setAttribute(ji,(Ti()+1).toString()),function(){var e=Ti()-1;e<=0?document.body.removeAttribute(ji):document.body.setAttribute(ji,e.toString())}},[]);var i=a.useMemo(function(){return Ai(s)},[s]);return a.createElement(_i,{styles:Pi(i,!t,s,r?"":"!important")})},Di=!1;if("undefined"!=typeof window)try{var Ii=Object.defineProperty({},"passive",{get:function(){return Di=!0,!0}});window.addEventListener("test",Ii,Ii),window.removeEventListener("test",Ii,Ii)}catch(e){Di=!1}var Ui=!!Di&&{passive:!1},Mi=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])},Oi=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),Li(e,n)){var a=zi(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Li=function(e,t){return"v"===e?function(e){return Mi(e,"overflowY")}(t):function(e){return Mi(e,"overflowX")}(t)},zi=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)},Fi=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Bi=function(e){return[e.deltaX,e.deltaY]},Wi=function(e){return e&&"current"in e?e.current:e},Vi=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Hi=0,Gi=[];function $i(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ki,qi=(Ki=function(e){var t=a.useRef([]),r=a.useRef([0,0]),n=a.useRef(),s=a.useState(Hi++)[0],i=a.useState(Ei)[0],o=a.useRef(e);a.useEffect(function(){o.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var t=function(e,t,r){if(r||2===arguments.length)for(var n,a=0,s=t.length;a<s;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(Wi),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=a.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!o.current.allowPinchZoom;var a,s=Fi(e),i=r.current,c="deltaX"in e?e.deltaX:i[0]-s[0],l="deltaY"in e?e.deltaY:i[1]-s[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=Oi(d,u);if(!h)return!0;if(h?a=d:(a="v"===d?"h":"v",h=Oi(d,u)),!h)return!1;if(!n.current&&"changedTouches"in e&&(c||l)&&(n.current=a),!a)return!0;var f=n.current||a;return function(e,t,r,n){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),s=a*n,i=r.target,o=t.contains(i),c=!1,l=s>0,u=0,d=0;do{if(!i)break;var p=zi(e,i),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Li(e,i)&&(u+=h,d+=m);var f=i.parentNode;i=f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE?f.host:f}while(!o&&i!==document.body||o&&(t.contains(i)||t===i));return(l&&Math.abs(u)<1||!l&&Math.abs(d)<1)&&(c=!0),c}(f,t,e,"h"===f?c:l)},[]),l=a.useCallback(function(e){var r=e;if(Gi.length&&Gi[Gi.length-1]===i){var n="deltaY"in r?Bi(r):Fi(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 s=(o.current.shards||[]).map(Wi).filter(Boolean).filter(function(e){return e.contains(r.target)});(s.length>0?c(r,s[0]):!o.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),u=a.useCallback(function(e,r,n,a){var s={name:e,delta:r,target:n,should:a,shadowParent:$i(n)};t.current.push(s),setTimeout(function(){t.current=t.current.filter(function(e){return e!==s})},1)},[]),d=a.useCallback(function(e){r.current=Fi(e),n.current=void 0},[]),p=a.useCallback(function(t){u(t.type,Bi(t),t.target,c(t,e.lockRef.current))},[]),m=a.useCallback(function(t){u(t.type,Fi(t),t.target,c(t,e.lockRef.current))},[]);a.useEffect(function(){return Gi.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Ui),document.addEventListener("touchmove",l,Ui),document.addEventListener("touchstart",d,Ui),function(){Gi=Gi.filter(function(e){return e!==i}),document.removeEventListener("wheel",l,Ui),document.removeEventListener("touchmove",l,Ui),document.removeEventListener("touchstart",d,Ui)}},[]);var h=e.removeScrollBar,f=e.inert;return a.createElement(a.Fragment,null,f?a.createElement(i,{styles:Vi(s)}):null,h?a.createElement(Ri,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},yi.useMedium(Ki),vi),Zi=a.forwardRef(function(e,t){return a.createElement(wi,li({},e,{ref:t,sideCar:qi}))});Zi.classNames=wi.classNames;var Ji=new WeakMap,Yi=new WeakMap,Xi={},Qi=0,eo=function(e){return e&&(e.host||eo(e.parentNode))},to=function(e,t,r,n){var a=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=eo(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]);Xi[r]||(Xi[r]=new WeakMap);var s=Xi[r],i=[],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=(Ji.get(e)||0)+1,l=(s.get(e)||0)+1;Ji.set(e,c),s.set(e,l),i.push(e),1===c&&a&&Yi.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(),Qi++,function(){i.forEach(function(e){var t=Ji.get(e)-1,a=s.get(e)-1;Ji.set(e,t),s.set(e,a),t||(Yi.has(e)||e.removeAttribute(n),Yi.delete(e)),a||e.removeAttribute(r)}),--Qi||(Ji=new WeakMap,Ji=new WeakMap,Yi=new WeakMap,Xi={})}},ro=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"))),to(n,a,r,"aria-hidden")):function(){return null}};function no(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.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),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?us(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ao=Symbol("radix.slottable");function so(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===ao}var io="Dialog",[oo,co]=Ns(io),[lo,uo]=oo(io),po=t=>{const{__scopeDialog:r,children:n,open:s,defaultOpen:i,onOpenChange:o,modal:c=!0}=t,l=a.useRef(null),u=a.useRef(null),[d,p]=Ds({prop:s,defaultProp:i??!1,onChange:o,caller:io});return e.jsx(lo,{scope:r,triggerRef:l,contentRef:u,contentId:Ts(),titleId:Ts(),descriptionId:Ts(),open:d,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:c,children:n})};po.displayName=io;var mo="DialogTrigger",ho=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=uo(mo,n),i=ds(r,s.triggerRef);return e.jsx(Os.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Io(s.open),...a,ref:i,onClick:Cs(t.onClick,s.onOpenToggle)})});ho.displayName=mo;var fo="DialogPortal",[go,bo]=oo(fo,{forceMount:void 0}),vo=t=>{const{__scopeDialog:r,forceMount:n,children:s,container:i}=t,o=uo(fo,r);return e.jsx(go,{scope:r,forceMount:n,children:a.Children.map(s,t=>e.jsx(ai,{present:n||o.open,children:e.jsx(ni,{asChild:!0,container:i,children:t})}))})};vo.displayName=fo;var yo="DialogOverlay",xo=a.forwardRef((t,r)=>{const n=bo(yo,t.__scopeDialog),{forceMount:a=n.forceMount,...s}=t,i=uo(yo,t.__scopeDialog);return i.modal?e.jsx(ai,{present:a||i.open,children:e.jsx(So,{...s,ref:r})}):null});xo.displayName=yo;var wo=function(t){const r=no(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(so);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}("DialogOverlay.RemoveScroll"),So=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=uo(yo,n);return e.jsx(Zi,{as:wo,allowPinchZoom:!0,shards:[s.contentRef],children:e.jsx(Os.div,{"data-state":Io(s.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),ko="DialogContent",Eo=a.forwardRef((t,r)=>{const n=bo(ko,t.__scopeDialog),{forceMount:a=n.forceMount,...s}=t,i=uo(ko,t.__scopeDialog);return e.jsx(ai,{present:a||i.open,children:i.modal?e.jsx(Co,{...s,ref:r}):e.jsx(No,{...s,ref:r})})});Eo.displayName=ko;var Co=a.forwardRef((t,r)=>{const n=uo(ko,t.__scopeDialog),s=a.useRef(null),i=ds(r,n.contentRef,s);return a.useEffect(()=>{const e=s.current;if(e)return ro(e)},[]),e.jsx(Ao,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Cs(t.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Cs(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:Cs(t.onFocusOutside,e=>e.preventDefault())})}),No=a.forwardRef((t,r)=>{const n=uo(ko,t.__scopeDialog),s=a.useRef(!1),i=a.useRef(!1);return e.jsx(Ao,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(s.current||n.triggerRef.current?.focus(),e.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(s.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const r=e.target,a=n.triggerRef.current?.contains(r);a&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),Ao=a.forwardRef((t,r)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,...c}=t,l=uo(ko,n),u=a.useRef(null),d=ds(r,u);return oi(),e.jsxs(e.Fragment,{children:[e.jsx(Js,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:o,children:e.jsx(Hs,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Io(l.open),...c,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(Lo,{titleId:l.titleId}),e.jsx(zo,{contentRef:u,descriptionId:l.descriptionId})]})]})}),_o="DialogTitle",jo=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=uo(_o,n);return e.jsx(Os.h2,{id:s.titleId,...a,ref:r})});jo.displayName=_o;var Po="DialogDescription",To=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=uo(Po,n);return e.jsx(Os.p,{id:s.descriptionId,...a,ref:r})});To.displayName=Po;var Ro="DialogClose",Do=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=uo(Ro,n);return e.jsx(Os.button,{type:"button",...a,ref:r,onClick:Cs(t.onClick,()=>s.onOpenChange(!1))})});function Io(e){return e?"open":"closed"}Do.displayName=Ro;var Uo="DialogTitleWarning",[Mo,Oo]=function(t,r){const n=a.createContext(r),s=t=>{const{children:r,...s}=t,i=a.useMemo(()=>s,Object.values(s));return e.jsx(n.Provider,{value:i,children:r})};return s.displayName=t+"Provider",[s,function(e){const s=a.useContext(n);if(s)return s;if(void 0!==r)return r;throw new Error(`\`${e}\` must be used within \`${t}\``)}]}(Uo,{contentName:ko,titleName:_o,docsSlug:"dialog"}),Lo=({titleId:e})=>{const t=Oo(Uo),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 a.useEffect(()=>{if(e){document.getElementById(e)||console.error(r)}},[r,e]),null},zo=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Oo("DialogDescriptionWarning").contentName}}.`;return a.useEffect(()=>{const n=e.current?.getAttribute("aria-describedby");if(t&&n){document.getElementById(t)||console.warn(r)}},[r,e,t]),null},Fo=po,Bo=ho,Wo=vo,Vo=xo,Ho=Eo,Go=jo,$o=To,Ko=Do;function qo(e,t){if(null==e)return{};var r,n,a={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}var Zo=["color"],Jo=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=qo(e,Zo);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s,{ref:r}),t.createElement("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:a,fillRule:"evenodd",clipRule:"evenodd"}))}),Yo=["color"],Xo=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=qo(e,Yo);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s,{ref:r}),t.createElement("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:a,fillRule:"evenodd",clipRule:"evenodd"}))}),Qo=["color"],ec=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=qo(e,Qo);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s,{ref:r}),t.createElement("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:a,fillRule:"evenodd",clipRule:"evenodd"}))}),tc=["color"],rc=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=qo(e,tc);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s,{ref:r}),t.createElement("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:a,fillRule:"evenodd",clipRule:"evenodd"}))});const nc=t.createContext({container:null,setContainer:()=>{}}),ac=t.memo(({children:r})=>{const[n,a]=t.useState(null),s=t.useMemo(()=>({container:n,setContainer:a}),[n]),i=t.useMemo(()=>r,[r]);return e.jsxs(nc.Provider,{value:s,children:[i,e.jsx("div",{ref:a,id:"saas-os-portal",className:"saas-os-ui",style:{width:"100%",height:"100%"}})]})});ac.displayName="PortalProvider";const sc=Fo,ic=Bo,oc=Wo,cc=a.forwardRef(({className:t,...r},n)=>e.jsx(Vo,{ref:n,className:Se("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",t),...r}));cc.displayName=Vo.displayName;const lc=a.forwardRef(({className:t,children:r,...n},s)=>{const{container:i}=a.useContext(nc);return e.jsxs(oc,{container:i,children:[e.jsx(cc,{}),e.jsxs(Ho,{ref:s,className:Se("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",t),...n,children:[r,e.jsxs(Ko,{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:[e.jsx(ec,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});lc.displayName=Ho.displayName;const uc=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col space-y-1.5 text-center sm:text-start",t),...r});uc.displayName="DialogHeader";const dc=a.forwardRef(({className:t,...r},n)=>e.jsx(Go,{ref:n,className:Se("text-lg font-semibold leading-none tracking-tight",t),...r}));dc.displayName=Go.displayName;const pc=a.forwardRef(({className:t,...r},n)=>e.jsx($o,{ref:n,className:Se("text-sm text-muted-foreground",t),...r}));pc.displayName=$o.displayName;var mc=Symbol("radix.slottable");var hc="AlertDialog",[fc]=Ns(hc,[co]),gc=co(),bc=t=>{const{__scopeAlertDialog:r,...n}=t,a=gc(r);return e.jsx(Fo,{...a,...n,modal:!0})};bc.displayName=hc;var vc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=gc(n);return e.jsx(Bo,{...s,...a,ref:r})});vc.displayName="AlertDialogTrigger";var yc=t=>{const{__scopeAlertDialog:r,...n}=t,a=gc(r);return e.jsx(Wo,{...a,...n})};yc.displayName="AlertDialogPortal";var xc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=gc(n);return e.jsx(Vo,{...s,...a,ref:r})});xc.displayName="AlertDialogOverlay";var wc="AlertDialogContent",[Sc,kc]=fc(wc),Ec=function(t){const r=({children:t})=>e.jsx(e.Fragment,{children:t});return r.displayName=`${t}.Slottable`,r.__radixId=mc,r}("AlertDialogContent"),Cc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,children:s,...i}=t,o=gc(n),c=a.useRef(null),l=ds(r,c),u=a.useRef(null);return e.jsx(Mo,{contentName:wc,titleName:Nc,docsSlug:"alert-dialog",children:e.jsx(Sc,{scope:n,cancelRef:u,children:e.jsxs(Ho,{role:"alertdialog",...o,...i,ref:l,onOpenAutoFocus:Cs(i.onOpenAutoFocus,e=>{e.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[e.jsx(Ec,{children:s}),e.jsx(Dc,{contentRef:c})]})})})});Cc.displayName=wc;var Nc="AlertDialogTitle",Ac=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=gc(n);return e.jsx(Go,{...s,...a,ref:r})});Ac.displayName=Nc;var _c="AlertDialogDescription",jc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=gc(n);return e.jsx($o,{...s,...a,ref:r})});jc.displayName=_c;var Pc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=gc(n);return e.jsx(Ko,{...s,...a,ref:r})});Pc.displayName="AlertDialogAction";var Tc="AlertDialogCancel",Rc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,{cancelRef:s}=kc(Tc,n),i=gc(n),o=ds(r,s);return e.jsx(Ko,{...i,...a,ref:o})});Rc.displayName=Tc;var Dc=({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 \`${_c}\` 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 a.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Ic=xc,Uc=Cc,Mc=Pc,Oc=Rc,Lc=Ac,zc=jc;const Fc=bc,Bc=vc,Wc=yc,Vc=a.forwardRef(({className:t,...r},n)=>e.jsx(Ic,{className:Se("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",t),...r,ref:n}));Vc.displayName=Ic.displayName;const Hc=a.forwardRef(({className:t,...r},n)=>{const{container:s}=a.useContext(nc);return e.jsxs(Wc,{container:s,children:[e.jsx(Vc,{}),e.jsx(Uc,{ref:n,className:Se("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",t),...r})]})});Hc.displayName=Uc.displayName;const Gc=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-start",t),...r});Gc.displayName="AlertDialogHeader";const $c=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r});$c.displayName="AlertDialogFooter";const Kc=a.forwardRef(({className:t,...r},n)=>e.jsx(Lc,{ref:n,className:Se("text-lg font-semibold",t),...r}));Kc.displayName=Lc.displayName;const qc=a.forwardRef(({className:t,...r},n)=>e.jsx(zc,{ref:n,className:Se("text-sm text-muted-foreground",t),...r}));qc.displayName=zc.displayName;const Zc=a.forwardRef(({className:t,...r},n)=>e.jsx(Mc,{ref:n,className:Se(ks(),t),...r}));Zc.displayName=Mc.displayName;const Jc=a.forwardRef(({className:t,...r},n)=>e.jsx(Oc,{ref:n,className:Se(ks({variant:"outline"}),"mt-2 sm:mt-0",t),...r}));Jc.displayName=Oc.displayName;const Yc="saas-workspace-current",Xc=e=>{e?cn(Yc,e._id):ln(Yc)},Qc=()=>on(Yc),el=()=>{ln(Yc)},tl=(e,t)=>!!e&&t.some(t=>t._id===e);function rl(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 nl(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 al={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"},sl=Object.values(al),il={admin:sl.filter(e=>e!==al.WORKSPACE_DELETE),member:[al.WORKSPACE_SETTINGS_VIEW,al.WORKSPACE_MEMBERS_VIEW,al.WORKSPACE_FEATURES_VIEW,al.WORKSPACE_BILLING_VIEW,al.WORKSPACE_USAGE_VIEW],viewer:[al.WORKSPACE_SETTINGS_VIEW,al.WORKSPACE_MEMBERS_VIEW]};function ol(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 cl(e){const{userId:t,workspace:r,settings:n,appPermissions:a}=e;if(!r||!t)return new Set;if(rl(r,t)){const e=new Set(sl);if(a)for(const t of ol(a))e.add(t);if(r.permissions)for(const t of ol(r.permissions))e.add(t);if(n?.workspace?.permissions)for(const t of ol(n.workspace.permissions))e.add(t);return e}const s=e.workspaceRole??nl(r,t);if(!s)return new Set;const i=r.permissions,o=n?.workspace?.permissions,c=e=>e.filter(e=>e.startsWith("workspace:")),l=e=>e.filter(e=>!e.startsWith("workspace:")),u=i?.[s]?c(i[s]):[],d=o?.[s]?c(o[s]):[],p=il[s]??[];let m;if(u.length>0)m=u;else if(d.length>0)m=d;else if(p.length>0)m=p;else{m=il[n?.workspace?.defaultRole??"member"]??il.member??[]}const h=new Set(m),f=i?.[s]?l(i[s]):[],g=a?.[s]?l(a[s]):[],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(al.WORKSPACE_MEMBERS_INVITE)}(h,s,n),h}class ll extends gn{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 ul(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 dl(e,t="/"){const r=ul(e);window.location.href=r||t}const pl="saas-auth-intent";function ml(e){return"object"==typeof e&&null!==e&&"string"==typeof e.returnUrl&&"number"==typeof e.createdAt}function hl(e){ul(e)&&function(e,t){try{cn(e,JSON.stringify(t))}catch(t){Re(t,{component:"storage",action:"setStorageJSON",metadata:{key:e}})}}(pl,{returnUrl:e,createdAt:Date.now()})}function fl(){const e=function(e,t){const r=on(e);if(!r)return null;try{const n=JSON.parse(r);return t&&!t(n)?(Re(new Error("Storage data failed validation"),{component:"storage",action:"getStorageJSON",metadata:{key:e}}),ln(e),null):n}catch(t){return Re(t,{component:"storage",action:"getStorageJSON",metadata:{key:e}}),ln(e),null}}(pl,ml);return ln(pl),e?Date.now()-e.createdAt>6e5?null:ul(e.returnUrl):null}function gl(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 bl(e,t){return{user:e,sessionId:t,expires:new Date(Date.now()+864e5).toISOString()}}function vl(){return yn(e=>e.auth)}function yl(){const{t:e}=sn(),r=vn(),n=vl(),a=Sn(),{serverUrl:s,orgId:i,auth:o}=a,{resetCurrentWorkspace:c,currentWorkspace:l}=Mk(),u=t.useMemo(()=>new ll({serverUrl:s,version:a.version}),[s,a.version]),d=t.useCallback(async t=>{hl(t||window.location.href),r.auth(Ue());try{const t=await u.requestAuth({orgId:i,clientId:o?.clientId??"",redirect:{success:o?.redirectUrl||window.location.href,error:o?.redirectUrl||window.location.href}});if(!t.success)throw r.auth(Oe()),new Error(t.message||e("errors.generic"));dl(t.data.redirectUrl)}catch(e){throw r.auth(Oe()),Re(e,{component:"useSaaSAuth",action:"signIn"}),e}},[u,i,o,r]),p=t.useCallback(async()=>{try{o?.callbacks?.onSignOut&&"function"==typeof o.callbacks.onSignOut&&await o.callbacks.onSignOut()}catch(e){Re(e,{component:"useSaaSAuth",action:"signOut"})}finally{ln(un),r.auth(ze()),c()}},[r,c,o?.callbacks?.onSignOut]),m=t.useCallback(e=>{l?Uk.openWorkspaceSettings(e):Re(new Error("Cannot open settings: No current workspace"),{component:"useSaaSAuth",action:"openWorkspaceSettings"})},[l]),h=t.useMemo(()=>Ve(n.status),[n.status]);return t.useMemo(()=>({user:n.session?.user,session:n.session,status:n.status,...h,signIn:d,signOut:p,openWorkspaceSettings:m}),[n.session,n.status,h,d,p,m])}function xl(e){const{user:r}=yl(),{currentWorkspace:n}=Mk(),{settings:a}=En(),{appPermissions:s}=Hn(),i=e??n??null,o=r?.id??null,c=t.useMemo(()=>i?nl(i,o):null,[i,o]),l=t.useMemo(()=>!!i&&rl(i,o),[i,o]),u=t.useMemo(()=>cl({userId:o,workspaceRole:c,workspace:i,settings:a,appPermissions:s}),[o,c,i,a,s]),d=t.useCallback(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:t,...r}){return e.jsx("div",{className:Se("animate-pulse rounded-md bg-primary/10",t),...r})}function Sl(){return e.jsxs("div",{className:"space-y-3.5",children:[e.jsx(wl,{className:"h-10 w-full"}),e.jsx(wl,{className:"h-10 w-full"}),e.jsx(wl,{className:"h-10 w-full"})]})}const kl=({workspace:r})=>{const[n,a]=t.useState(!1),{deleteWorkspace:s}=Mk(),{can:i}=xl(),{settings:o}=En(),{t:c}=sn();if(1===(o?.workspace?.maxWorkspacesPerUser??0))return null;if(!r)return e.jsx(Sl,{});return i(al.WORKSPACE_DELETE)?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-destructive",children:c("danger.title")}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:c("danger.deleteDescription")})]}),e.jsxs(Fc,{children:[e.jsx(Bc,{asChild:!0,children:e.jsxs(Es,{variant:"destructive",disabled:n,progress:n,children:[e.jsx(as,{className:"h-4 w-4 me-2"}),c("danger.deleteWorkspace")]})}),e.jsxs(Hc,{children:[e.jsxs(Gc,{children:[e.jsx(Kc,{children:c("danger.deleteConfirm")}),e.jsx(qc,{children:c("danger.deleteConfirmDescription")})]}),e.jsxs($c,{children:[e.jsx(Jc,{disabled:n,children:c("settings.common.cancel")}),e.jsx(Zc,{onClick:async()=>{a(!0);try{await s(r._id)}catch(e){Re(e,{component:"WorkspaceSettingsDanger",action:"handleDeleteWorkspace",metadata:{workspaceId:r._id}}),alert(e instanceof Error?e.message:c("danger.failedToDelete"))}finally{a(!1)}},disabled:n,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:n?e.jsxs(e.Fragment,{children:[e.jsx($a,{className:"me-2 h-4 w-4 animate-spin"}),c("danger.deleting")]}):c("danger.deleteWorkspace")})]})]})]})]}):e.jsx("div",{className:"space-y-4",children:e.jsx("div",{className:"text-red-500",children:c("danger.adminOnly")})})};function El(e){const t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Cl(e){const[t,r]=a.useState(void 0);return _s(()=>{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,s;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;a=t.inlineSize,s=t.blockSize}else a=e.offsetWidth,s=e.offsetHeight;r({width:a,height:s})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}var Nl="Switch",[Al]=Ns(Nl),[_l,jl]=Al(Nl),Pl=a.forwardRef((t,r)=>{const{__scopeSwitch:n,name:s,checked:i,defaultChecked:o,required:c,disabled:l,value:u="on",onCheckedChange:d,form:p,...m}=t,[h,f]=a.useState(null),g=ds(r,e=>f(e)),b=a.useRef(!1),v=!h||(p||!!h.closest("form")),[y,x]=Ds({prop:i,defaultProp:o??!1,onChange:d,caller:Nl});return e.jsxs(_l,{scope:n,checked:y,disabled:l,children:[e.jsx(Os.button,{type:"button",role:"switch","aria-checked":y,"aria-required":c,"data-state":Il(y),"data-disabled":l?"":void 0,disabled:l,value:u,...m,ref:g,onClick:Cs(t.onClick,e=>{x(e=>!e),v&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})}),v&&e.jsx(Dl,{control:h,bubbles:!b.current,name:s,value:u,checked:y,required:c,disabled:l,form:p,style:{transform:"translateX(-100%)"}})]})});Pl.displayName=Nl;var Tl="SwitchThumb",Rl=a.forwardRef((t,r)=>{const{__scopeSwitch:n,...a}=t,s=jl(Tl,n);return e.jsx(Os.span,{"data-state":Il(s.checked),"data-disabled":s.disabled?"":void 0,...a,ref:r})});Rl.displayName=Tl;var Dl=a.forwardRef(({__scopeSwitch:t,control:r,checked:n,bubbles:s=!0,...i},o)=>{const c=a.useRef(null),l=ds(c,o),u=El(n),d=Cl(r);return a.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==n&&r){const t=new Event("click",{bubbles:s});r.call(e,n),e.dispatchEvent(t)}},[u,n,s]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Il(e){return e?"checked":"unchecked"}Dl.displayName="SwitchBubbleInput";var Ul=Pl,Ml=Rl;const Ol=a.forwardRef(({className:t,...r},n)=>e.jsx(Ul,{className:Se("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",t),...r,ref:n,children:e.jsx(Ml,{className:Se("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")})}));Ol.displayName=Ul.displayName;const Ll=({workspaceId:r})=>{const{t:n}=sn(),{allFeatures:a,updateFeature:s,getWorkspace:i}=Mk(),{can:o}=xl(),[c,l]=t.useState({}),[u,d]=t.useState(null),[p,m]=t.useState(null),h=t.useRef(null);if(t.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]),t.useEffect(()=>{i(r).then(m)},[r]),!p)return e.jsx(Sl,{});const f=o(al.WORKSPACE_FEATURES_EDIT);return e.jsxs("div",{children:[u&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:n("settings.common.success")}),e.jsx("p",{className:"text-sm",children:u})]}),e.jsxs("div",{className:"flex flex-col gap-y-3.5 pe-4",children:[!f&&e.jsx("div",{className:"text-red-500",children:n("features.ownerOnly")}),!a.length&&e.jsx("div",{className:"text-muted-foreground",children:n("features.noFeatures")}),a.length>0&&e.jsx("div",{className:"flex flex-col gap-y-3.5",children:a.map(t=>{const r=p?.features?.[t.slug],i=null!==c[t.slug]&&void 0!==c[t.slug],o=c[t.slug],u=n("features.actionStatus",{action:!0===o?"enabling":!1===o?"disabling":"none"});return e.jsxs("div",{className:"flex items-center gap-x-2 justify-between w-full",children:[e.jsxs("div",{className:"flex gap-x-2 flex-col",children:[e.jsx("h3",{className:"font-medium text-ellipsis",children:t.name}),e.jsx("p",{className:"text-muted-foreground",children:t.description})]}),i?e.jsxs("div",{className:"flex items-center gap-x-1",children:[e.jsx($a,{className:"h-4 w-4 animate-spin text-gray-500"}),e.jsxs("span",{className:"text-sm text-gray-600",children:[u,"..."]})]}):e.jsx(Ol,{disabled:!f,checked:r??t.defaultValue,onCheckedChange:e=>async function(e,t){if(p){l(r=>({...r,[e]:t})),d(null);try{const r=await s(p._id,e,t);m(r);const i=a.find(t=>t.slug===e);d(n("features.updateSuccess",{feature:i?.name||"Feature",enabled:String(t)})),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{d(null)},5e3)}catch(t){Re(t,{component:"WorkspaceSettingsFeatures",action:"updateFeature",metadata:{workspaceId:p._id,featureKey:e}})}finally{l(t=>({...t,[e]:null}))}}}(t.slug,e)})]},t._id)})})]})]})};var zl=e=>"checkbox"===e.type,Fl=e=>e instanceof Date,Bl=e=>null==e;const Wl=e=>"object"==typeof e;var Vl=e=>!Bl(e)&&!Array.isArray(e)&&Wl(e)&&!Fl(e),Hl=e=>Vl(e)&&e.target?zl(e.target)?e.target.checked:e.target.value:e,Gl=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),$l="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function Kl(e){if(e instanceof Date)return new Date(e);const t="undefined"!=typeof FileList&&e instanceof FileList;if($l&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!(r||Vl(e)&&(e=>{const t=e.constructor&&e.constructor.prototype;return Vl(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]=Kl(e[t]));return n}var ql=e=>/^\w*$/.test(e),Zl=e=>void 0===e,Jl=e=>Array.isArray(e)?e.filter(Boolean):[],Yl=e=>Jl(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Xl=(e,t,r)=>{if(!t||!Vl(e))return r;const n=(ql(t)?[t]:Yl(t)).reduce((e,t)=>Bl(e)?e:e[t],e);return Zl(n)||n===e?Zl(e[t])?r:e[t]:n},Ql=e=>"boolean"==typeof e,eu=e=>"function"==typeof e,tu=(e,t,r)=>{let n=-1;const a=ql(t)?[t]:Yl(t),s=a.length,i=s-1;for(;++n<s;){const t=a[n];let s=r;if(n!==i){const r=e[t];s=Vl(r)||Array.isArray(r)?r:isNaN(+a[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=s,e=e[t]}};const ru="blur",nu="focusout",au="change",su="onBlur",iu="onChange",ou="onSubmit",cu="onTouched",lu="all",uu="max",du="min",pu="maxLength",mu="minLength",hu="pattern",fu="required",gu="validate",bu=t.createContext(null);bu.displayName="HookFormControlContext";const vu=()=>t.useContext(bu);var yu=(e,t,r,n=!0)=>{const a={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(a,s,{get:()=>{const a=s;return t._proxyFormState[a]!==lu&&(t._proxyFormState[a]=!n||lu),r&&(r[a]=!0),e[a]}});return a};const xu="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;var wu=e=>"string"==typeof e,Su=(e,t,r,n,a)=>wu(e)?(n&&t.watch.add(e),Xl(r,e,a)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),Xl(r,e))):(n&&(t.watchAll=!0),r),ku=e=>Bl(e)||!Wl(e);function Eu(e,t,r=new WeakSet){if(ku(e)||ku(t))return Object.is(e,t);if(Fl(e)&&Fl(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 s of n){const n=e[s];if(!a.includes(s))return!1;if("ref"!==s){const e=t[s];if(Fl(n)&&Fl(e)||Vl(n)&&Vl(e)||Array.isArray(n)&&Array.isArray(e)?!Eu(n,e,r):!Object.is(n,e))return!1}}return!0}function Cu(e){const r=vu(),{name:n,disabled:a,control:s=r,shouldUnregister:i,defaultValue:o,exact:c=!0}=e,l=Gl(s._names.array,n),u=t.useMemo(()=>Xl(s._formValues,n,Xl(s._defaultValues,n,o)),[s,n,o]),d=function(e){const r=vu(),{control:n=r,name:a,defaultValue:s,disabled:i,exact:o,compute:c}=e||{},l=t.useRef(s),u=t.useRef(c),d=t.useRef(void 0),p=t.useRef(n),m=t.useRef(a);u.current=c;const[h,f]=t.useState(()=>{const e=n._getWatch(a,l.current);return u.current?u.current(e):e}),g=t.useCallback(e=>{const t=Su(a,n._names,e||n._formValues,!1,l.current);return u.current?u.current(t):t},[n._formValues,n._names,a]),b=t.useCallback(e=>{if(!i){const t=Su(a,n._names,e||n._formValues,!1,l.current);if(u.current){const e=u.current(t);Eu(e,d.current)||(f(e),d.current=e)}else f(t)}},[n._formValues,n._names,i,a]);xu(()=>(p.current===n&&Eu(m.current,a)||(p.current=n,m.current=a,b()),n._subscribe({name:a,formState:{values:!0},exact:o,callback:e=>{b(e.values)}})),[n,o,a,b]),t.useEffect(()=>n._removeUnmounted());const v=p.current!==n,y=m.current,x=t.useMemo(()=>{if(i)return null;const e=!v&&!Eu(y,a);return v||e?g():null},[i,v,a,y,g]);return null!==x?x:h}({control:s,name:n,defaultValue:u,exact:c}),p=function(e){const r=vu(),{control:n=r,disabled:a,name:s,exact:i}=e||{},[o,c]=t.useState(n._formState),l=t.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return xu(()=>n._subscribe({name:s,formState:l.current,exact:i,callback:e=>{!a&&c({...n._formState,...e})}}),[s,a,i]),t.useEffect(()=>{l.current.isValid&&n._setValid(!0)},[n]),t.useMemo(()=>yu(o,n,l.current,!1),[o,n])}({control:s,name:n,exact:c}),m=t.useRef(e),h=t.useRef(void 0),f=t.useRef(s.register(n,{...e.rules,value:d,...Ql(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const g=t.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Xl(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!Xl(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Xl(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Xl(p.validatingFields,n)},error:{enumerable:!0,get:()=>Xl(p.errors,n)}}),[p,n]),b=t.useCallback(e=>f.current.onChange({target:{value:Hl(e),name:n},type:au}),[n]),v=t.useCallback(()=>f.current.onBlur({target:{value:Xl(s._formValues,n),name:n},type:ru}),[n,s._formValues]),y=t.useCallback(e=>{const t=Xl(s._fields,n);t&&t._f&&e&&(t._f.ref={focus:()=>eu(e.focus)&&e.focus(),select:()=>eu(e.select)&&e.select(),setCustomValidity:t=>eu(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>eu(e.reportValidity)&&e.reportValidity()})},[s._fields,n]),x=t.useMemo(()=>({name:n,value:d,...Ql(a)||p.disabled?{disabled:p.disabled||a}:{},onChange:b,onBlur:v,ref:y}),[n,a,p.disabled,b,v,y,d]);return t.useEffect(()=>{const e=s._options.shouldUnregister||i,t=h.current;t&&t!==n&&!l&&s.unregister(t),s.register(n,{...m.current.rules,...Ql(m.current.disabled)?{disabled:m.current.disabled}:{}});const r=(e,t)=>{const r=Xl(s._fields,e);r&&r._f&&(r._f.mount=t)};if(r(n,!0),e){const e=Kl(Xl(s._options.defaultValues,n,m.current.defaultValue));tu(s._defaultValues,n,e),Zl(Xl(s._formValues,n))&&tu(s._formValues,n,e)}return!l&&s.register(n),h.current=n,()=>{(l?e&&!s._state.action:e)?s.unregister(n):r(n,!1)}},[n,s,l,i]),t.useEffect(()=>{s._setDisabledField({disabled:a,name:n})},[a,n,s]),t.useMemo(()=>({field:x,formState:p,fieldState:g}),[x,p,g])}const Nu=e=>e.render(Cu(e)),Au=t.createContext(null);Au.displayName="HookFormContext";const _u=e=>{const{children:r,watch:n,getValues:a,getFieldState:s,setError:i,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 t.createElement(Au.Provider,{value:t.useMemo(()=>({watch:n,getValues:a,getFieldState:s,setError:i,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,s,a,m,g,p,d,i,b,c,v,l,h,n])},t.createElement(bu.Provider,{value:f},r))};var ju=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},Pu=e=>Array.isArray(e)?e:[e],Tu=()=>{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 Ru(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const a=e[n],s=t[n];if(a&&Vl(a)&&s){const e=Ru(a,s);Vl(e)&&(r[n]=e)}else e[n]&&(r[n]=s)}return r}var Du=e=>Vl(e)&&!Object.keys(e).length,Iu=e=>"file"===e.type,Uu=e=>{if(!$l)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Mu=e=>"select-multiple"===e.type,Ou=e=>"radio"===e.type,Lu=e=>Uu(e)&&e.isConnected;function zu(e,t){const r=Array.isArray(t)?t:ql(t)?[t]:Yl(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Zl(e)?n++:e[t[n++]];return e}(e,r),a=r.length-1,s=r[a];return n&&delete n[s],0!==a&&(Vl(n)&&Du(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!Zl(e[t]))return!1;return!0}(n))&&zu(e,r.slice(0,-1)),e}function Fu(e){return Array.isArray(e)||Vl(e)&&!(e=>{for(const t in e)if(eu(e[t]))return!0;return!1})(e)}function Bu(e,t={}){for(const r in e){const n=e[r];Fu(n)?(t[r]=Array.isArray(n)?[]:{},Bu(n,t[r])):Zl(n)||(t[r]=!0)}return t}function Wu(e,t,r){r||(r=Bu(t));for(const n in e){const a=e[n];if(Fu(a))Zl(t)||ku(r[n])?r[n]=Bu(a,Array.isArray(a)?[]:{}):Wu(a,Bl(t)?{}:t[n],r[n]);else{const e=t[n];r[n]=!Eu(a,e)}}return r}const Vu={value:!1,isValid:!1},Hu={value:!0,isValid:!0};var Gu=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&&!Zl(e[0].attributes.value)?Zl(e[0].value)||""===e[0].value?Hu:{value:e[0].value,isValid:!0}:Hu:Vu}return Vu},$u=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Zl(e)?e:t?""===e?NaN:e?+e:e:r&&wu(e)?new Date(e):n?n(e):e;const Ku={isValid:!1,value:null};var qu=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Ku):Ku;function Zu(e){const t=e.ref;return Iu(t)?t.files:Ou(t)?qu(e.refs).value:Mu(t)?[...t.selectedOptions].map(({value:e})=>e):zl(t)?Gu(e.refs).value:$u(Zl(t.value)?e.ref.value:t.value,e)}var Ju=e=>e instanceof RegExp,Yu=e=>Zl(e)?e:Ju(e)?e.source:Vl(e)?Ju(e.value)?e.value.source:e.value:e,Xu=e=>({isOnSubmit:!e||e===ou,isOnBlur:e===su,isOnChange:e===iu,isOnAll:e===lu,isOnTouch:e===cu});const Qu="AsyncFunction";var ed=e=>!!e&&!!e.validate&&!!(eu(e.validate)&&e.validate.constructor.name===Qu||Vl(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===Qu)),td=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const rd=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const r=Xl(e,a);if(r){const{_f:e,...s}=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(rd(s,t))break}else if(Vl(s)&&rd(s,t))break}}};function nd(e,t,r){const n=Xl(e,r);if(n||ql(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const n=a.join("."),s=Xl(t,n),i=Xl(e,n);if(s&&!Array.isArray(s)&&r!==n)return{name:r};if(i&&i.type)return{name:n,error:i};if(i&&i.root&&i.root.type)return{name:`${n}.root`,error:i.root};a.pop()}return{name:r}}var ad=(e,t,r)=>{const n=Pu(Xl(e,r));return tu(n,"root",t[r]),tu(e,r,n),e};function sd(e,t,r="validate"){if(wu(e)||Array.isArray(e)&&e.every(wu)||Ql(e)&&!e)return{type:r,message:wu(e)?e:"",ref:t}}var id=e=>Vl(e)&&!Ju(e)?e:{value:e,message:""},od=async(e,t,r,n,a,s)=>{const{ref:i,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=Xl(r,f);if(!b||t.has(f))return{};const y=o?o[0]:i,x=e=>{a&&y.reportValidity&&(y.setCustomValidity(Ql(e)?"":e||""),y.reportValidity())},w={},S=Ou(i),k=zl(i),E=S||k,C=(g||Iu(i))&&Zl(i.value)&&Zl(v)||Uu(i)&&""===i.value||""===v||Array.isArray(v)&&!v.length,N=ju.bind(null,f,n,w),A=(e,t,r,n=pu,a=mu)=>{const s=e?t:r;w[f]={type:e?n:a,message:s,ref:i,...N(e?n:a,s)}};if(s?!Array.isArray(v)||!v.length:c&&(!E&&(C||Bl(v))||Ql(v)&&!v||k&&!Gu(o).isValid||S&&!qu(o).isValid)){const{value:e,message:t}=wu(c)?{value:!!c,message:c}:id(c);if(e&&(w[f]={type:fu,message:t,ref:y,...N(fu,t)},!n))return x(t),w}if(!(C||Bl(d)&&Bl(p))){let e,t;const r=id(p),a=id(d);if(Bl(v)||isNaN(v)){const n=i.valueAsDate||new Date(v),s=e=>new Date((new Date).toDateString()+" "+e),o="time"==i.type,c="week"==i.type;wu(r.value)&&v&&(e=o?s(v)>s(r.value):c?v>r.value:n>new Date(r.value)),wu(a.value)&&v&&(t=o?s(v)<s(a.value):c?v<a.value:n<new Date(a.value))}else{const n=i.valueAsNumber||(v?+v:v);Bl(r.value)||(e=n>r.value),Bl(a.value)||(t=n<a.value)}if((e||t)&&(A(!!e,r.message,a.message,uu,du),!n))return x(w[f].message),w}if((l||u)&&!C&&(wu(v)||s&&Array.isArray(v))){const e=id(l),t=id(u),r=!Bl(e.value)&&v.length>+e.value,a=!Bl(t.value)&&v.length<+t.value;if((r||a)&&(A(r,e.message,t.message),!n))return x(w[f].message),w}if(m&&!C&&wu(v)){const{value:e,message:t}=id(m);if(Ju(e)&&!v.match(e)&&(w[f]={type:hu,message:t,ref:i,...N(hu,t)},!n))return x(t),w}if(h)if(eu(h)){const e=sd(await h(v,r),y);if(e&&(w[f]={...e,...N(gu,e.message)},!n))return x(e.message),w}else if(Vl(h)){let e={};for(const t in h){if(!Du(e)&&!n)break;const a=sd(await h[t](v,r),y,t);a&&(e={...a,...N(t,a.message)},x(a.message),n&&(w[f]=e))}if(!Du(e)&&(w[f]={ref:y,...e},!n))return w}return x(!0),w};const cd={mode:ou,reValidateMode:iu,shouldFocusError:!0};function ld(e={}){let t,r={...cd,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:eu(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},s=(Vl(r.defaultValues)||Vl(r.values))&&Kl(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:Kl(s),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:Tu(),state:Tu()},h=r.criteriaMode===lu,f=async e=>{if(!o.keepIsValid&&!r.disabled&&(d.isValid||p.isValid||e)){let e;r.resolver?(e=Du((await x()).errors),g()):e=await w(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?tu(n.validatingFields,e,t):zu(n.validatingFields,e))}),m.state.next({validatingFields:n.validatingFields,isValidating:!Du(n.validatingFields)}))},b=(e,t,r,n)=>{const c=Xl(a,e);if(c){const a=Xl(i,e,Zl(r)?Xl(s,e):r);Zl(a)||n&&n.defaultChecked||t?tu(i,e,t?a:Zu(c._f)):E(e,a),o.mount&&!o.action&&f()}},v=(e,t,a,i,o)=>{let c=!1,l=!1;const u={name:e};if(!r.disabled){if(!a||i){(d.isDirty||p.isDirty)&&(l=n.isDirty,n.isDirty=u.isDirty=S(),c=l!==u.isDirty);const r=Eu(Xl(s,e),t);l=!!Xl(n.dirtyFields,e),r?zu(n.dirtyFields,e):tu(n.dirtyFields,e,!0),u.dirtyFields=n.dirtyFields,c=c||(d.dirtyFields||p.dirtyFields)&&l!==!r}if(a){const t=Xl(n.touchedFields,e);t||(tu(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,s,i)=>{const o=Xl(n.errors,e),c=(d.isValid||p.isValid)&&Ql(a)&&n.isValid!==a;var u;if(r.delayError&&s?(u=()=>((e,t)=>{tu(n.errors,e,t),m.state.next({errors:n.errors})})(e,s),t=e=>{clearTimeout(l),l=setTimeout(u,e)},t(r.delayError)):(clearTimeout(l),t=null,s?tu(n.errors,e,s):zu(n.errors,e)),(s?!Eu(o,s):o)||!Du(i)||c){const t={...i,...c&&Ql(a)?{isValid:a}:{},errors:n.errors,name:e};n={...n,...t},m.state.next(t)}},x=async e=>{g(e,!0);const t=await r.resolver(i,r.context,((e,t,r,n)=>{const a={};for(const r of e){const e=Xl(t,r);e&&tu(a,r,e._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}})(e||c.mount,a,r.criteriaMode,r.shouldUseNativeValidation));return t},w=async(t,a,s={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&&ed(l._f);u&&d.validatingFields&&g([t.name],!0);const p=await od(l,c.disabled,i,h,r.shouldUseNativeValidation&&!a,o);if(u&&d.validatingFields&&g([t.name]),p[t.name]&&(s.valid=!1,a||e.shouldUseNativeValidation))break;!a&&(Xl(p,t.name)?o?ad(n.errors,p,t.name):tu(n.errors,t.name,p[t.name]):zu(n.errors,t.name))}!Du(o)&&await w(o,a,s)}}return s.valid},S=(e,t)=>!r.disabled&&(e&&t&&tu(i,e,t),!Eu(P(),s)),k=(e,t,r)=>Su(e,c,{...o.mount?i:Zl(t)?s:wu(e)?{[e]:t}:t},r,t),E=(e,t,r={})=>{const n=Xl(a,e);let s=t;if(n){const r=n._f;r&&(!r.disabled&&tu(i,e,$u(t,r)),s=Uu(r.ref)&&Bl(t)?"":t,Mu(r.ref)?[...r.ref.options].forEach(e=>e.selected=s.includes(e.value)):r.refs?zl(r.ref)?r.refs.forEach(e=>{e.defaultChecked&&e.disabled||(Array.isArray(s)?e.checked=!!s.find(t=>t===e.value):e.checked=s===e.value||!!s)}):r.refs.forEach(e=>e.checked=e.value===s):Iu(r.ref)?r.ref.value="":(r.ref.value=s,r.ref.type||m.state.next({name:e,values:Kl(i)})))}(r.shouldDirty||r.shouldTouch)&&v(e,s,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&j(e)},C=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const s=t[n],i=e+"."+n,o=Xl(a,i);(c.array.has(e)||Vl(s)||o&&!o._f)&&!Fl(s)?C(i,s,r):E(i,s,r)}},N=(e,t,r={})=>{const l=Xl(a,e),u=c.array.has(e),h=Kl(t);tu(i,e,h),u?(m.array.next({name:e,values:Kl(i)}),(d.isDirty||d.dirtyFields||p.isDirty||p.dirtyFields)&&r.shouldDirty&&m.state.next({name:e,dirtyFields:Wu(s,i),isDirty:S(e,h)})):!l||l._f||Bl(h)?E(e,h,r):C(e,h,r),td(e,c)?m.state.next({...n,name:e,values:Kl(i)}):m.state.next({name:o.mount?e:void 0,values:Kl(i)})},A=async e=>{o.mount=!0;const s=e.target;let l=s.name,u=!0;const b=Xl(a,l),S=e=>{u=Number.isNaN(e)||Fl(e)&&isNaN(e.getTime())||Eu(e,Xl(i,l,e))},k=Xu(r.mode),E=Xu(r.reValidateMode);if(b){let o,C;const N=s.type?Zu(b._f):Hl(e),A=e.type===ru||e.type===nu,_=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(b._f)&&!r.resolver&&!Xl(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,Xl(n.touchedFields,l),n.isSubmitted,E,k),P=td(l,c,A);tu(i,l,N),A?s&&s.readOnly||(b._f.onBlur&&b._f.onBlur(e),t&&t(0)):b._f.onChange&&b._f.onChange(e);const T=v(l,N,A),R=!Du(T)||P;if(!A&&m.state.next({name:l,type:e.type,values:Kl(i)}),_)return(d.isValid||p.isValid)&&("onBlur"===r.mode?A&&f():A||f()),R&&m.state.next({name:l,...P?{}:T});if(!A&&P&&m.state.next({...n}),r.resolver){const{errors:e}=await x([l]);if(g([l]),S(N),u){const t=nd(n.errors,a,l),r=nd(e,a,t.name||l);o=r.error,l=r.name,C=Du(e)}}else g([l],!0),o=(await od(b,c.disabled,i,h,r.shouldUseNativeValidation))[l],g([l]),S(N),u&&(o?C=!1:(d.isValid||p.isValid)&&(C=await w(a,!0)));u&&(b._f.deps&&(!Array.isArray(b._f.deps)||b._f.deps.length>0)&&j(b._f.deps),y(l,C,o,T))}},_=(e,t)=>{if(Xl(n.errors,t)&&e.focus)return e.focus(),1},j=async(e,t={})=>{let s,i;const o=Pu(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await x(e);if(g(e),e)for(const r of e){const e=Xl(t,r);e?tu(n.errors,r,e):zu(n.errors,r)}else n.errors=t;return t})(Zl(e)?e:o);s=Du(t),i=e?!o.some(e=>Xl(t,e)):s}else e?(i=(await Promise.all(o.map(async e=>{const t=Xl(a,e);return await w(t&&t._f?{[e]:t}:t)}))).every(Boolean),(i||n.isValid)&&f()):i=s=await w(a);return m.state.next({...!wu(e)||(d.isValid||p.isValid)&&s!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:s}:{},errors:n.errors}),t.shouldFocus&&!i&&rd(a,_,e?o:c.mount),i},P=(e,t)=>{let r={...o.mount?i:s};return t&&(r=Ru(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),Zl(e)?r:wu(e)?Xl(r,e):e.map(e=>Xl(r,e))},T=(e,t)=>({invalid:!!Xl((t||n).errors,e),isDirty:!!Xl((t||n).dirtyFields,e),error:Xl((t||n).errors,e),isValidating:!!Xl(n.validatingFields,e),isTouched:!!Xl((t||n).touchedFields,e)}),R=(e,t,r)=>{const s=(Xl(a,e,{_f:{}})._f||{}).ref,i=Xl(n.errors,e)||{},{ref:o,message:c,type:l,...u}=i;tu(n.errors,e,{...u,...t,ref:s}),m.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&s&&s.focus&&s.focus()},D=e=>m.state.subscribe({next:t=>{var r,a,o;r=e.name,a=t.name,o=e.exact,r&&a&&r!==a&&!Pu(r).some(e=>e&&(o?e===a:e.startsWith(a)||a.startsWith(e)))||!((e,t,r,n)=>{r(e);const{name:a,...s}=e;return Du(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(e=>t[e]===(!n||lu))})(t,e.formState||d,B,e.reRenderRoot)||e.callback({values:{...i},...n,...t,defaultValues:s})}}).unsubscribe,I=(e,t={})=>{for(const o of e?Pu(e):c.mount)c.mount.delete(o),c.array.delete(o),t.keepValue||(zu(a,o),zu(i,o)),!t.keepError&&zu(n.errors,o),!t.keepDirty&&zu(n.dirtyFields,o),!t.keepTouched&&zu(n.touchedFields,o),!t.keepIsValidating&&zu(n.validatingFields,o),!r.shouldUnregister&&!t.keepDefaultValue&&zu(s,o);m.state.next({values:Kl(i)}),m.state.next({...n,...t.keepDirty?{isDirty:S()}:{}}),!t.keepIsValid&&f()},U=({disabled:e,name:t})=>{if(Ql(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()}},M=(e,t={})=>{let n=Xl(a,e);const i=Ql(t.disabled)||Ql(r.disabled);return tu(a,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),c.mount.add(e),n?U({disabled:Ql(t.disabled)?t.disabled:r.disabled,name:e}):b(e,!0,t.value),{...i?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:Yu(t.min),max:Yu(t.max),minLength:Yu(t.minLength),maxLength:Yu(t.maxLength),pattern:Yu(t.pattern)}:{},name:e,onChange:A,onBlur:A,ref:i=>{if(i){M(e,t),n=Xl(a,e);const r=Zl(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,o=(e=>Ou(e)||zl(e))(r),c=n._f.refs||[];if(o?c.find(e=>e===r):r===n._f.ref)return;tu(a,e,{_f:{...n._f,...o?{refs:[...c.filter(Lu),r,...Array.isArray(Xl(s,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),b(e,!1,void 0,r)}else n=Xl(a,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!Gl(c.array,e)||!o.action)&&c.unMount.add(e)}}},O=()=>r.shouldFocusError&&rd(a,_,c.mount),L=(e,t)=>async s=>{let o;s&&(s.preventDefault&&s.preventDefault(),s.persist&&s.persist());let l=Kl(i);if(m.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await x();g(),n.errors=e,l=Kl(t)}else await w(a);if(c.disabled.size)for(const e of c.disabled)zu(l,e);if(zu(n.errors,"root"),Du(n.errors)){m.state.next({errors:{}});try{await e(l,s)}catch(e){o=e}}else t&&await t({...n.errors},s),O(),setTimeout(O);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Du(n.errors)&&!o,submitCount:n.submitCount+1,errors:n.errors}),o)throw o},z=(e,t={})=>{const l=e?Kl(e):s,u=Kl(l),p=Du(e),h=p?s:u;if(t.keepDefaultValues||(s=l),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...c.mount,...Object.keys(Wu(s,i))]);for(const t of Array.from(e)){const e=Xl(n.dirtyFields,t),r=Xl(i,t),a=Xl(h,t);e&&!Zl(r)?tu(h,t,r):e||Zl(a)||N(t,a)}}else{if($l&&Zl(e))for(const e of c.mount){const t=Xl(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Uu(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of c.mount)N(e,Xl(h,e));else a={}}i=r.shouldUnregister?t.keepDefaultValues?Kl(s):{}:Kl(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&&!Du(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||Eu(e,s))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:p?{}:t.keepDirtyValues?t.keepDefaultValues&&i?Wu(s,i):n.dirtyFields:t.keepDefaultValues&&e?Wu(s,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1,defaultValues:s})},F=(e,t)=>z(eu(e)?e(i):e,{...r.resetOptions,...t}),B=e=>{n={...n,...e}},W={control:{register:M,unregister:I,getFieldState:T,handleSubmit:L,setError:R,_subscribe:D,_runSchema:x,_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(Xl(a,e))){const t=c(Xl(a,e),l.argA,l.argB);u&&tu(a,e,t)}if(h&&Array.isArray(Xl(n.errors,e))){const t=c(Xl(n.errors,e),l.argA,l.argB);u&&tu(n.errors,e,t),((e,t)=>{!Jl(Xl(e,t)).length&&zu(e,t)})(n.errors,e)}if((d.touchedFields||p.touchedFields)&&h&&Array.isArray(Xl(n.touchedFields,e))){const t=c(Xl(n.touchedFields,e),l.argA,l.argB);u&&tu(n.touchedFields,e,t)}(d.dirtyFields||p.dirtyFields)&&(n.dirtyFields=Wu(s,i)),m.state.next({name:e,isDirty:S(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else tu(i,e,t)},_setDisabledField:U,_setErrors:e=>{n.errors=e,m.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>Jl(Xl(o.mount?i:s,e,r.shouldUnregister?Xl(s,e,[]):[])),_reset:z,_resetDefaultValues:()=>eu(r.defaultValues)&&r.defaultValues().then(e=>{F(e,r.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of c.unMount){const t=Xl(a,e);t&&(t._f.refs?t._f.refs.every(e=>!Lu(e)):!Lu(t._f.ref))&&I(e)}c.unMount=new Set},_disableForm:e=>{Ql(e)&&(m.state.next({disabled:e}),rd(a,(t,r)=>{const n=Xl(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 i},get _state(){return o},set _state(e){o=e},get _defaultValues(){return s},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},D({...e,formState:{...u,...e.formState}})),trigger:j,register:M,handleSubmit:L,watch:(e,t)=>eu(e)?m.state.subscribe({next:r=>"values"in r&&e(k(void 0,t),r)}):k(e,t,!0),setValue:N,getValues:P,reset:F,resetField:(e,t={})=>{Xl(a,e)&&(Zl(t.defaultValue)?N(e,Kl(Xl(s,e))):(N(e,t.defaultValue),tu(s,e,Kl(t.defaultValue))),t.keepTouched||zu(n.touchedFields,e),t.keepDirty||(zu(n.dirtyFields,e),n.isDirty=t.defaultValue?S(e,Kl(Xl(s,e))):S()),t.keepError||(zu(n.errors,e),d.isValid&&f()),m.state.next({...n}))},clearErrors:e=>{e&&Pu(e).forEach(e=>zu(n.errors,e)),m.state.next({errors:e?n.errors:{}})},unregister:I,setError:R,setFocus:(e,t={})=>{const r=Xl(a,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&eu(e.select)&&e.select()})}},getFieldState:T};return{...W,formControl:W}}function ud(e={}){const r=t.useRef(void 0),n=t.useRef(void 0),[a,s]=t.useState({isDirty:!1,isValidating:!1,isLoading:eu(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:eu(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:a},e.defaultValues&&!eu(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:t,...n}=ld(e);r.current={...n,formState:a}}const i=r.current.control;return i._options=e,xu(()=>{const e=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0});return s(e=>({...e,isReady:!0})),i._formState.isReady=!0,e},[i]),t.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),t.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),t.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),t.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),t.useEffect(()=>{if(i._proxyFormState.isDirty){const e=i._getDirty();e!==a.isDirty&&i._subjects.state.next({isDirty:e})}},[i,a.isDirty]),t.useEffect(()=>{var t;e.values&&!Eu(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),(null===(t=i._options.resetOptions)||void 0===t?void 0:t.keepIsValid)||i._setValid(),n.current=e.values,s(e=>({...e}))):i._resetDefaultValues()},[i,e.values]),t.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),r.current.formState=t.useMemo(()=>yu(a,i),[i,a]),r.current}const dd=(e,t,r)=>{if(e&&"reportValidity"in e){const n=Xl(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},pd=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?dd(n.ref,r,e):n&&n.refs&&n.refs.forEach(t=>dd(t,r,e))}},md=(e,t)=>{t.shouldUseNativeValidation&&pd(e,t);const r={};for(const n in e){const a=Xl(t.fields,n),s=Object.assign(e[n]||{},{ref:a&&a.ref});if(hd(t.names||Object.keys(e),n)){const e=Object.assign({},Xl(r,n));tu(e,"root",s),tu(r,n,e)}else tu(r,n,s)}return r},hd=(e,t)=>{const r=fd(t);return e.some(e=>fd(e).match(`^${r}\\.\\d+`))};function fd(e){return e.replace(/\]|\[/g,"")}function gd(e,t,r){function n(r,n){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:n,constr:i,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,n);const a=i.prototype,s=Object.keys(a);for(let e=0;e<s.length;e++){const t=s[e];t in r||(r[t]=a[t].bind(r))}}const a=r?.Parent??Object;class s extends a{}function i(e){var t;const a=r?.Parent?new s:this;n(a,e),(t=a._zod).deferred??(t.deferred=[]);for(const e of a._zod.deferred)e();return a}return Object.defineProperty(s,"name",{value:e}),Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:t=>!!(r?.Parent&&t instanceof r.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class bd extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class vd extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const yd={};function xd(e){return yd}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 Sd(e,t){return"bigint"==typeof t?t.toString():t}function kd(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ed(e){return null==e}function Cd(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const Nd=Symbol("evaluating");function Ad(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Nd)return void 0===n&&(n=Nd,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function _d(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function jd(...e){const t={};for(const r of e){const e=Object.getOwnPropertyDescriptors(r);Object.assign(t,e)}return Object.defineProperties({},t)}function Pd(e){return JSON.stringify(e)}const Td="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Rd(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Dd=kd(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Id(e){if(!1===Rd(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!==Rd(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function Ud(e){return Id(e)?{...e}:Array.isArray(e)?[...e]:e}const Md=new Set(["string","number","symbol"]);function Od(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ld(e,t,r){const n=new e._zod.constr(t??e._zod.def);return t&&!r?.parent||(n._zod.parent=e),n}function zd(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 Fd(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 Bd(e,t){return t.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function Wd(e){return"string"==typeof e?e:e?.message}function Vd(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const a=Wd(e.inst?._zod.def?.error?.(e))??Wd(t?.error?.(e))??Wd(r.customError?.(e))??Wd(r.localeError?.(e))??"Invalid input";n.message=a}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function Hd(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Gd(...e){const[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}const $d=(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,Sd,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Kd=gd("$ZodError",$d),qd=gd("$ZodError",$d,{Parent:Error});const Zd=e=>(t,r,n,a)=>{const s=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new bd;if(i.issues.length){const t=new(a?.Err??e)(i.issues.map(e=>Vd(e,s,xd())));throw Td(t,a?.callee),t}return i.value},Jd=Zd(qd),Yd=e=>async(t,r,n,a)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const t=new(a?.Err??e)(i.issues.map(e=>Vd(e,s,xd())));throw Td(t,a?.callee),t}return i.value},Xd=Yd(qd),Qd=e=>(t,r,n)=>{const a=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},a);if(s instanceof Promise)throw new bd;return s.issues.length?{success:!1,error:new(e??Kd)(s.issues.map(e=>Vd(e,a,xd())))}:{success:!0,data:s.value}},ep=Qd(qd),tp=e=>async(t,r,n)=>{const a=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},a);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(e=>Vd(e,a,xd())))}:{success:!0,data:s.value}},rp=tp(qd),np=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Zd(e)(t,r,a)},ap=e=>(t,r,n)=>Zd(e)(t,r,n),sp=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Yd(e)(t,r,a)},ip=e=>async(t,r,n)=>Yd(e)(t,r,n),op=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Qd(e)(t,r,a)},cp=e=>(t,r,n)=>Qd(e)(t,r,n),lp=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return tp(e)(t,r,a)},up=e=>async(t,r,n)=>tp(e)(t,r,n),dp=/^[cC][^\s-]{8,}$/,pp=/^[0-9a-z]+$/,mp=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,hp=/^[0-9a-vA-V]{20}$/,fp=/^[A-Za-z0-9]{27}$/,gp=/^[a-zA-Z0-9_-]{21}$/,bp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,vp=/^([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})$/,yp=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)$/,xp=/^(?!\.)(?!.*\.\.)([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])$/,Sp=/^(([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}|:))$/,kp=/^((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])$/,Ep=/^(([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])$/,Cp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Np=/^[A-Za-z0-9_-]*$/,Ap=/^\+[1-9]\d{6,14}$/,_p="(?:(?:\\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])))",jp=new RegExp(`^${_p}$`);function Pp(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 Tp=/^[^A-Z]*$/,Rp=/^[^a-z]*$/,Dp=gd("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Ip=gd("$ZodCheckMaxLength",(e,t)=>{var r;Dp.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Ed(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=Hd(n);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Up=gd("$ZodCheckMinLength",(e,t)=>{var r;Dp.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Ed(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=Hd(n);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Mp=gd("$ZodCheckLengthEquals",(e,t)=>{var r;Dp.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Ed(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 s=Hd(n),i=a>t.length;r.issues.push({origin:s,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Op=gd("$ZodCheckStringFormat",(e,t)=>{var r,n;Dp.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=()=>{})}),Lp=gd("$ZodCheckRegex",(e,t)=>{Op.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})}}),zp=gd("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Tp),Op.init(e,t)}),Fp=gd("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Rp),Op.init(e,t)}),Bp=gd("$ZodCheckIncludes",(e,t)=>{Dp.init(e,t);const r=Od(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})}}),Wp=gd("$ZodCheckStartsWith",(e,t)=>{Dp.init(e,t);const r=new RegExp(`^${Od(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})}}),Vp=gd("$ZodCheckEndsWith",(e,t)=>{Dp.init(e,t);const r=new RegExp(`.*${Od(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})}}),Hp=gd("$ZodCheckOverwrite",(e,t)=>{Dp.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class Gp{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 $p={major:4,minor:3,patch:6},Kp=gd("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=$p;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=Fd(e);for(const s of t){if(s._zod.def.when){if(!s._zod.def.when(e))continue}else if(a)continue;const t=e.issues.length,i=s._zod.check(e);if(i instanceof Promise&&!1===r?.async)throw new bd;if(n||i instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await i;e.issues.length!==t&&(a||(a=Fd(e,t)))});else{if(e.issues.length===t)continue;a||(a=Fd(e,t))}}return n?n.then(()=>e):e},r=(r,a,s)=>{if(Fd(r))return r.aborted=!0,r;const i=t(a,n,s);if(i instanceof Promise){if(!1===s.async)throw new bd;return i.then(t=>e._zod.parse(t,s))}return e._zod.parse(i,s)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if("backward"===s.direction){const t=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,a,s)):r(t,a,s)}const i=e._zod.parse(a,s);if(i instanceof Promise){if(!1===s.async)throw new bd;return i.then(e=>t(e,n,s))}return t(i,n,s)}}Ad(e,"~standard",()=>({validate:t=>{try{const r=ep(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return rp(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),qp=gd("$ZodString",(e,t)=>{var r;Kp.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}}),Zp=gd("$ZodStringFormat",(e,t)=>{Op.init(e,t),qp.init(e,t)}),Jp=gd("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=vp),Zp.init(e,t)}),Yp=gd("$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=yp(e))}else t.pattern??(t.pattern=yp());Zp.init(e,t)}),Xp=gd("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=xp),Zp.init(e,t)}),Qp=gd("$ZodURL",(e,t)=>{Zp.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})}}}),em=gd("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Zp.init(e,t)}),tm=gd("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=gp),Zp.init(e,t)}),rm=gd("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=dp),Zp.init(e,t)}),nm=gd("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=pp),Zp.init(e,t)}),am=gd("$ZodULID",(e,t)=>{t.pattern??(t.pattern=mp),Zp.init(e,t)}),sm=gd("$ZodXID",(e,t)=>{t.pattern??(t.pattern=hp),Zp.init(e,t)}),im=gd("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=fp),Zp.init(e,t)}),om=gd("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Pp({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(`^${_p}T(?:${n})$`)}(t)),Zp.init(e,t)}),cm=gd("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=jp),Zp.init(e,t)}),lm=gd("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Pp(t)}$`)),Zp.init(e,t)}),um=gd("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=bp),Zp.init(e,t)}),dm=gd("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=wp),Zp.init(e,t),e._zod.bag.format="ipv4"}),pm=gd("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Sp),Zp.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})}}}),mm=gd("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=kp),Zp.init(e,t)}),hm=gd("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ep),Zp.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 fm(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const gm=gd("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Cp),Zp.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{fm(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});const bm=gd("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Np),Zp.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{(function(e){if(!Np.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return fm(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})}}),vm=gd("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ap),Zp.init(e,t)});const ym=gd("$ZodJWT",(e,t)=>{Zp.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})}}),xm=gd("$ZodUnknown",(e,t)=>{Kp.init(e,t),e._zod.parse=e=>e}),wm=gd("$ZodNever",(e,t)=>{Kp.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function Sm(e,t,r){e.issues.length&&t.issues.push(...Bd(r,e.issues)),t.value[r]=e.value}const km=gd("$ZodArray",(e,t)=>{Kp.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 s=[];for(let e=0;e<a.length;e++){const i=a[e],o=t.element._zod.run({value:i,issues:[]},n);o instanceof Promise?s.push(o.then(t=>Sm(t,r,e))):Sm(o,r,e)}return s.length?Promise.all(s).then(()=>r):r}});function Em(e,t,r,n,a){if(e.issues.length){if(a&&!(r in n))return;t.issues.push(...Bd(r,e.issues))}void 0===e.value?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function Cm(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 Nm(e,t,r,n,a,s){const i=[],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){i.push(a);continue}const s=c.run({value:t[a],issues:[]},n);s instanceof Promise?e.push(s.then(e=>Em(e,r,a,t,u))):Em(s,r,a,t,u)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}const Am=gd("$ZodObject",(e,t)=>{Kp.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=kd(()=>Cm(t));Ad(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=Rd,s=t.catchall;let i;e._zod.parse=(t,r)=>{i??(i=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=i.shape;for(const e of i.keys){const n=l[e],a="optional"===n._zod.optout,s=n._zod.run({value:o[e],issues:[]},r);s instanceof Promise?c.push(s.then(r=>Em(r,t,e,o,a))):Em(s,t,e,o,a)}return s?Nm(c,o,t,r,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),_m=gd("$ZodObjectJIT",(e,t)=>{Am.init(e,t);const r=e._zod.parse,n=kd(()=>Cm(t));let a;const s=Rd,i=!yd.jitless,o=i&&Dd.value,c=t.catchall;let l;e._zod.parse=(u,d)=>{l??(l=n.value);const p=u.value;return s(p)?i&&o&&!1===d?.async&&!0!==d.jitless?(a||(a=(e=>{const t=new Gp(["shape","payload","ctx"]),r=n.value,a=e=>{const t=Pd(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const s=Object.create(null);let i=0;for(const e of r.keys)s[e]="key_"+i++;t.write("const newResult = {};");for(const n of r.keys){const r=s[n],i=Pd(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 (${i} in input) {\n payload.issues = payload.issues.concat(${r}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n }\n \n if (${r}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${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 ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${r}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${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?Nm([],p,u,d,l,e):u):r(u,d):(u.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),u)}});function jm(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=>!Fd(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=>Vd(e,n,xd())))}),t)}const Pm=gd("$ZodUnion",(e,t)=>{Kp.init(e,t),Ad(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Ad(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Ad(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Ad(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=>Cd(e.source)).join("|")})$`)}});const r=1===t.options.length,n=t.options[0]._zod.run;e._zod.parse=(a,s)=>{if(r)return n(a,s);let i=!1;const o=[];for(const e of t.options){const t=e._zod.run({value:a.value,issues:[]},s);if(t instanceof Promise)o.push(t),i=!0;else{if(0===t.issues.length)return t;o.push(t)}}return i?Promise.all(o).then(t=>jm(t,a,e,s)):jm(o,a,e,s)}}),Tm=gd("$ZodIntersection",(e,t)=>{Kp.init(e,t),e._zod.parse=(e,r)=>{const n=e.value,a=t.left._zod.run({value:n,issues:[]},r),s=t.right._zod.run({value:n,issues:[]},r);return a instanceof Promise||s instanceof Promise?Promise.all([a,s]).then(([t,r])=>Dm(e,t,r)):Dm(e,a,s)}});function Rm(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(Id(e)&&Id(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=Rm(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=Rm(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 Dm(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 s=[...n].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length&&a&&e.issues.push({...a,keys:s}),Fd(e))return e;const i=Rm(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const Im=gd("$ZodEnum",(e,t)=>{Kp.init(e,t);const r=wd(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(e=>Md.has(typeof e)).map(e=>"string"==typeof e?Od(e):e.toString()).join("|")})$`),e._zod.parse=(t,a)=>{const s=t.value;return n.has(s)||t.issues.push({code:"invalid_value",values:r,input:s,inst:e}),t}}),Um=gd("$ZodTransform",(e,t)=>{Kp.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new vd(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 bd;return r.value=a,r}});function Mm(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Om=gd("$ZodOptional",(e,t)=>{Kp.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ad(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ad(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Cd(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=>Mm(t,e.value)):Mm(n,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),Lm=gd("$ZodExactOptional",(e,t)=>{Om.init(e,t),Ad(e._zod,"values",()=>t.innerType._zod.values),Ad(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),zm=gd("$ZodNullable",(e,t)=>{Kp.init(e,t),Ad(e._zod,"optin",()=>t.innerType._zod.optin),Ad(e._zod,"optout",()=>t.innerType._zod.optout),Ad(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Cd(e.source)}|null)$`):void 0}),Ad(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)}),Fm=gd("$ZodDefault",(e,t)=>{Kp.init(e,t),e._zod.optin="optional",Ad(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=>Bm(e,t)):Bm(n,t)}});function Bm(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Wm=gd("$ZodPrefault",(e,t)=>{Kp.init(e,t),e._zod.optin="optional",Ad(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))}),Vm=gd("$ZodNonOptional",(e,t)=>{Kp.init(e,t),Ad(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=>Hm(t,e)):Hm(a,e)}});function Hm(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 Gm=gd("$ZodCatch",(e,t)=>{Kp.init(e,t),Ad(e._zod,"optin",()=>t.innerType._zod.optin),Ad(e._zod,"optout",()=>t.innerType._zod.optout),Ad(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=>Vd(e,r,xd()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>Vd(e,r,xd()))},input:e.value}),e.issues=[]),e)}}),$m=gd("$ZodPipe",(e,t)=>{Kp.init(e,t),Ad(e._zod,"values",()=>t.in._zod.values),Ad(e._zod,"optin",()=>t.in._zod.optin),Ad(e._zod,"optout",()=>t.out._zod.optout),Ad(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=>Km(e,t.in,r)):Km(n,t.in,r)}const n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>Km(e,t.out,r)):Km(n,t.out,r)}});function Km(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const qm=gd("$ZodReadonly",(e,t)=>{Kp.init(e,t),Ad(e._zod,"propValues",()=>t.innerType._zod.propValues),Ad(e._zod,"values",()=>t.innerType._zod.values),Ad(e._zod,"optin",()=>t.innerType?._zod?.optin),Ad(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(Zm):Zm(n)}});function Zm(e){return e.value=Object.freeze(e.value),e}const Jm=gd("$ZodCustom",(e,t)=>{Dp.init(e,t),Kp.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=>Ym(t,r,n,e));Ym(a,r,n,e)}});function Ym(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(Gd(e))}}var Xm;class Qm{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)}}(Xm=globalThis).__zod_globalRegistry??(Xm.__zod_globalRegistry=new Qm);const eh=globalThis.__zod_globalRegistry;function th(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...zd(t)})}function rh(e,t){return new Ip({check:"max_length",...zd(t),maximum:e})}function nh(e,t){return new Up({check:"min_length",...zd(t),minimum:e})}function ah(e,t){return new Mp({check:"length_equals",...zd(t),length:e})}function sh(e){return new Hp({check:"overwrite",tx:e})}function ih(e){const t=function(e,t){const r=new Dp({check:"custom",...zd(t)});return r._zod.check=e,r}(r=>(r.addIssue=e=>{if("string"==typeof e)r.issues.push(Gd(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(Gd(n))}},e(r.value,r)));return t}function oh(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??eh,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 ch(e,t,r={path:[],schemaPath:[]}){var n;const a=e._zod.def,s=t.seen.get(e);if(s){s.count++;return r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema}const i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);const o=e._zod.toJSONSchema?.();if(o)i.schema=o;else{const n={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,n);else{const r=i.schema,s=t.processors[a.type];if(!s)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);s(e,t,r,n)}const s=e._zod.parent;s&&(i.ref||(i.ref=s),ch(s,t,n),t.seen.get(s).isParent=!0)}const c=t.metadataRegistry.get(e);c&&Object.assign(i.schema,c),"input"===t.io&&dh(e)&&(delete i.schema.examples,delete i.schema.default),"input"===t.io&&i.schema._prefault&&((n=i.schema).default??(n.default=i.schema._prefault)),delete i.schema._prefault;return t.seen.get(e).schema}function lh(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:s}=(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 s=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=s,{defId:s,ref:`${a("__shared")}#/${n}/${s}`}}if(t[1]===r)return{ref:"#"};const a=`#/${n}/`,s=t[1].schema.id??"__schema"+e.counter++;return{defId:s,ref:a+s}})(t);n.def={...n.schema},s&&(n.defId=s);const i=n.schema;for(const e in i)delete i[e];i.$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 s=e.metadataRegistry.get(r[0])?.id;s?a(r):(n.cycle||n.count>1&&"ref"===e.reused)&&a(r)}}function uh(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,s={...a},i=r.ref;if(r.ref=null,i){n(i);const r=e.seen.get(i),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,s);if(t._zod.parent===i)for(const e in a)"$ref"!==e&&"allOf"!==e&&(e in s||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!==i){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 s=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(s[e.defId]=e.def)}e.external||Object.keys(s).length>0&&("draft-2020-12"===e.target?a.$defs=s:a.definitions=s);try{const r=JSON.parse(JSON.stringify(a));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:ph(t,"input",e.processors),output:ph(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw new Error("Error converting schema to JSON.")}}function dh(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 dh(n.element,r);if("set"===n.type)return dh(n.valueType,r);if("lazy"===n.type)return dh(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 dh(n.innerType,r);if("intersection"===n.type)return dh(n.left,r)||dh(n.right,r);if("record"===n.type||"map"===n.type)return dh(n.keyType,r)||dh(n.valueType,r);if("pipe"===n.type)return dh(n.in,r)||dh(n.out,r);if("object"===n.type){for(const e in n.shape)if(dh(n.shape[e],r))return!0;return!1}if("union"===n.type){for(const e of n.options)if(dh(e,r))return!0;return!1}if("tuple"===n.type){for(const e of n.items)if(dh(e,r))return!0;return!(!n.rest||!dh(n.rest,r))}return!1}const ph=(e,t,r={})=>n=>{const{libraryOptions:a,target:s}=n??{},i=oh({...a??{},target:s,io:t,processors:r});return ch(e,i),lh(i,e),uh(i,e)},mh={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},hh=(e,t,r,n)=>{const a=e._zod.def;ch(a.innerType,t,n);t.seen.get(e).ref=a.innerType};function fh(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}function gh(e,t){for(var r={};e.length;){var n=e[0],a=n.code,s=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var o=n.unionErrors[0].errors[0];r[i]={message:o.message,type:o.code}}else r[i]={message:s,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[i].types,l=c&&c[n.code];r[i]=ju(i,t,r,a,l?[].concat(l,n.message):n.message)}e.shift()}return r}function bh(e,t){for(var r={};e.length;){var n=e[0],a=n.code,s=n.message,i=n.path.join(".");if(!r[i])if("invalid_union"===n.code&&n.errors.length>0){var o=n.errors[0][0];r[i]={message:o.message,type:o.code}}else r[i]={message:s,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[i].types,l=c&&c[n.code];r[i]=ju(i,t,r,a,l?[].concat(l,n.message):n.message)}e.shift()}return r}function vh(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,s){try{return Promise.resolve(fh(function(){return Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return s.shouldUseNativeValidation&&pd({},s),{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:md(gh(e.errors,!s.shouldUseNativeValidation&&"all"===s.criteriaMode),s)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return"_zod"in e&&"object"==typeof e._zod}(e))return function(n,a,s){try{return Promise.resolve(fh(function(){return Promise.resolve(("sync"===r.mode?Jd:Xd)(e,n,t)).then(function(e){return s.shouldUseNativeValidation&&pd({},s),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return e instanceof Kd}(e))return{values:{},errors:md(bh(e.issues,!s.shouldUseNativeValidation&&"all"===s.criteriaMode),s)};throw e}))}catch(e){return Promise.reject(e)}};throw new Error("Invalid input: not a Zod schema")}const yh=gd("ZodISODateTime",(e,t)=>{om.init(e,t),Hh.init(e,t)});function xh(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...zd(t)})}(yh,e)}const wh=gd("ZodISODate",(e,t)=>{cm.init(e,t),Hh.init(e,t)});function Sh(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...zd(t)})}(wh,e)}const kh=gd("ZodISOTime",(e,t)=>{lm.init(e,t),Hh.init(e,t)});function Eh(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...zd(t)})}(kh,e)}const Ch=gd("ZodISODuration",(e,t)=>{um.init(e,t),Hh.init(e,t)});function Nh(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...zd(t)})}(Ch,e)}const Ah=gd("ZodError",(e,t)=>{Kd.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,Sd,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Sd,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),_h=Zd(Ah),jh=Yd(Ah),Ph=Qd(Ah),Th=tp(Ah),Rh=np(Ah),Dh=ap(Ah),Ih=sp(Ah),Uh=ip(Ah),Mh=op(Ah),Oh=cp(Ah),Lh=lp(Ah),zh=up(Ah),Fh=gd("ZodType",(e,t)=>(Kp.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ph(e,"input"),output:ph(e,"output")}}),e.toJSONSchema=((e,t={})=>r=>{const n=oh({...r,processors:t});return ch(e,n),lh(n,e),uh(n,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(jd(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)=>Ld(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>_h(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>Ph(e,t,r),e.parseAsync=async(t,r)=>jh(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>Th(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>Rh(e,t,r),e.decode=(t,r)=>Dh(e,t,r),e.encodeAsync=async(t,r)=>Ih(e,t,r),e.decodeAsync=async(t,r)=>Uh(e,t,r),e.safeEncode=(t,r)=>Mh(e,t,r),e.safeDecode=(t,r)=>Oh(e,t,r),e.safeEncodeAsync=async(t,r)=>Lh(e,t,r),e.safeDecodeAsync=async(t,r)=>zh(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,...zd(r)})}(If,e,t)}(t,r)),e.superRefine=t=>e.check(ih(t)),e.overwrite=t=>e.check(sh(t)),e.optional=()=>kf(e),e.exactOptional=()=>new Ef({type:"optional",innerType:e}),e.nullable=()=>Nf(e),e.nullish=()=>kf(Nf(e)),e.nonoptional=t=>function(e,t){return new jf({type:"nonoptional",innerType:e,...zd(t)})}(e,t),e.array=()=>{return function(e,t,r){return new e({type:"array",element:t,...zd(r)})}(ff,e,t);var t},e.or=t=>function(e,t){return new vf({type:"union",options:e,...zd(t)})}([e,t]),e.and=t=>new yf({type:"intersection",left:e,right:t}),e.transform=t=>Rf(e,new wf({type:"transform",transform:t})),e.default=t=>{return r=t,new Af({type:"default",innerType:e,get defaultValue(){return"function"==typeof r?r():Ud(r)}});var r},e.prefault=t=>{return r=t,new _f({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof r?r():Ud(r)}});var r},e.catch=t=>{return new Pf({type:"catch",innerType:e,catchValue:"function"==typeof(r=t)?r:()=>r});var r},e.pipe=t=>Rf(e,t),e.readonly=()=>new Df({type:"readonly",innerType:e}),e.describe=t=>{const r=e.clone();return eh.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>eh.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return eh.get(e);const r=e.clone();return eh.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Bh=gd("_ZodString",(e,t)=>{qp.init(e,t),Fh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{const n=r;n.type="string";const{minimum:a,maximum:s,format:i,patterns:o,contentEncoding:c}=e._zod.bag;if("number"==typeof a&&(n.minLength=a),"number"==typeof s&&(n.maxLength=s),i&&(n.format=mh[i]??i,""===n.format&&delete n.format,"time"===i&&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 Lp({check:"string_format",format:"regex",...zd(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Bp({check:"string_format",format:"includes",...zd(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Wp({check:"string_format",format:"starts_with",...zd(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Vp({check:"string_format",format:"ends_with",...zd(t),suffix:e})}(...t)),e.min=(...t)=>e.check(nh(...t)),e.max=(...t)=>e.check(rh(...t)),e.length=(...t)=>e.check(ah(...t)),e.nonempty=(...t)=>e.check(nh(1,...t)),e.lowercase=t=>e.check(function(e){return new zp({check:"string_format",format:"lowercase",...zd(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Fp({check:"string_format",format:"uppercase",...zd(e)})}(t)),e.trim=()=>e.check(sh(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return sh(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(sh(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(sh(e=>e.toUpperCase())),e.slugify=()=>e.check(sh(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}),Wh=gd("ZodString",(e,t)=>{qp.init(e,t),Bh.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...zd(t)})}(Gh,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...zd(t)})}(qh,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...zd(t)})}(uf,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...zd(t)})}(Zh,t)),e.guid=t=>e.check(th($h,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...zd(t)})}(Kh,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...zd(t)})}(Kh,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...zd(t)})}(Kh,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...zd(t)})}(Kh,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...zd(t)})}(Jh,t)),e.guid=t=>e.check(th($h,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...zd(t)})}(Yh,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...zd(t)})}(Xh,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...zd(t)})}(Qh,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...zd(t)})}(of,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...zd(t)})}(cf,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...zd(t)})}(ef,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...zd(t)})}(tf,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...zd(t)})}(rf,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...zd(t)})}(nf,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...zd(t)})}(af,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...zd(t)})}(sf,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...zd(t)})}(lf,t)),e.datetime=t=>e.check(xh(t)),e.date=t=>e.check(Sh(t)),e.time=t=>e.check(Eh(t)),e.duration=t=>e.check(Nh(t))});function Vh(e){return function(e,t){return new e({type:"string",...zd(t)})}(Wh,e)}const Hh=gd("ZodStringFormat",(e,t)=>{Zp.init(e,t),Bh.init(e,t)}),Gh=gd("ZodEmail",(e,t)=>{Xp.init(e,t),Hh.init(e,t)}),$h=gd("ZodGUID",(e,t)=>{Jp.init(e,t),Hh.init(e,t)}),Kh=gd("ZodUUID",(e,t)=>{Yp.init(e,t),Hh.init(e,t)}),qh=gd("ZodURL",(e,t)=>{Qp.init(e,t),Hh.init(e,t)}),Zh=gd("ZodEmoji",(e,t)=>{em.init(e,t),Hh.init(e,t)}),Jh=gd("ZodNanoID",(e,t)=>{tm.init(e,t),Hh.init(e,t)}),Yh=gd("ZodCUID",(e,t)=>{rm.init(e,t),Hh.init(e,t)}),Xh=gd("ZodCUID2",(e,t)=>{nm.init(e,t),Hh.init(e,t)}),Qh=gd("ZodULID",(e,t)=>{am.init(e,t),Hh.init(e,t)}),ef=gd("ZodXID",(e,t)=>{sm.init(e,t),Hh.init(e,t)}),tf=gd("ZodKSUID",(e,t)=>{im.init(e,t),Hh.init(e,t)}),rf=gd("ZodIPv4",(e,t)=>{dm.init(e,t),Hh.init(e,t)}),nf=gd("ZodIPv6",(e,t)=>{pm.init(e,t),Hh.init(e,t)}),af=gd("ZodCIDRv4",(e,t)=>{mm.init(e,t),Hh.init(e,t)}),sf=gd("ZodCIDRv6",(e,t)=>{hm.init(e,t),Hh.init(e,t)}),of=gd("ZodBase64",(e,t)=>{gm.init(e,t),Hh.init(e,t)}),cf=gd("ZodBase64URL",(e,t)=>{bm.init(e,t),Hh.init(e,t)}),lf=gd("ZodE164",(e,t)=>{vm.init(e,t),Hh.init(e,t)}),uf=gd("ZodJWT",(e,t)=>{ym.init(e,t),Hh.init(e,t)}),df=gd("ZodUnknown",(e,t)=>{xm.init(e,t),Fh.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{}});function pf(){return new df({type:"unknown"})}const mf=gd("ZodNever",(e,t)=>{wm.init(e,t),Fh.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r)=>{r.not={}})(0,0,t)});function hf(e){return function(e,t){return new e({type:"never",...zd(t)})}(mf,e)}const ff=gd("ZodArray",(e,t)=>{km.init(e,t),Fh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=r,s=e._zod.def,{minimum:i,maximum:o}=e._zod.bag;"number"==typeof i&&(a.minItems=i),"number"==typeof o&&(a.maxItems=o),a.type="array",a.items=ch(s.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element,e.min=(t,r)=>e.check(nh(t,r)),e.nonempty=t=>e.check(nh(1,t)),e.max=(t,r)=>e.check(rh(t,r)),e.length=(t,r)=>e.check(ah(t,r)),e.unwrap=()=>e.element});const gf=gd("ZodObject",(e,t)=>{_m.init(e,t),Fh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=r,s=e._zod.def;a.type="object",a.properties={};const i=s.shape;for(const e in i)a.properties[e]=ch(i[e],t,{...n,path:[...n.path,"properties",e]});const o=new Set(Object.keys(i)),c=new Set([...o].filter(e=>{const r=s.shape[e]._zod;return"input"===t.io?void 0===r.optin:void 0===r.optout}));c.size>0&&(a.required=Array.from(c)),"never"===s.catchall?._zod.def.type?a.additionalProperties=!1:s.catchall?s.catchall&&(a.additionalProperties=ch(s.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(a.additionalProperties=!1)})(e,t,r,n),Ad(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new xf({type:"enum",entries:r,...zd(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:pf()}),e.loose=()=>e.clone({...e._zod.def,catchall:pf()}),e.strict=()=>e.clone({...e._zod.def,catchall:hf()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Id(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=jd(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return _d(this,"shape",r),r}});return Ld(e,n)}(e,t),e.safeExtend=t=>function(e,t){if(!Id(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=jd(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return _d(this,"shape",r),r}});return Ld(e,r)}(e,t),e.merge=t=>function(e,t){const r=jd(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return _d(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Ld(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 Ld(e,jd(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 _d(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=jd(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 _d(this,"shape",n),n},checks:[]});return Ld(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=jd(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 _d(this,"shape",a),a},checks:[]});return Ld(t,a)}(Sf,e,t[0]),e.required=(...t)=>function(e,t,r){const n=jd(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 _d(this,"shape",a),a}});return Ld(t,n)}(jf,e,t[0])});function bf(e,t){const r={type:"object",shape:e??{},...zd(t)};return new gf(r)}const vf=gd("ZodUnion",(e,t)=>{Pm.init(e,t),Fh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s=!1===a.inclusive,i=a.options.map((e,r)=>ch(e,t,{...n,path:[...n.path,s?"oneOf":"anyOf",r]}));s?r.oneOf=i:r.anyOf=i})(e,t,r,n),e.options=t.options});const yf=gd("ZodIntersection",(e,t)=>{Tm.init(e,t),Fh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s=ch(a.left,t,{...n,path:[...n.path,"allOf",0]}),i=ch(a.right,t,{...n,path:[...n.path,"allOf",1]}),o=e=>"allOf"in e&&1===Object.keys(e).length,c=[...o(s)?s.allOf:[s],...o(i)?i.allOf:[i]];r.allOf=c})(e,t,r,n)});const xf=gd("ZodEnum",(e,t)=>{Im.init(e,t),Fh.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 xf({...t,checks:[],...zd(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 xf({...t,checks:[],...zd(n),entries:a})}});const wf=gd("ZodTransform",(e,t)=>{Um.init(e,t),Fh.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 vd(e.constructor.name);r.addIssue=n=>{if("string"==typeof n)r.issues.push(Gd(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(Gd(t))}};const a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r)):(r.value=a,r)}});const Sf=gd("ZodOptional",(e,t)=>{Om.init(e,t),Fh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>hh(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});function kf(e){return new Sf({type:"optional",innerType:e})}const Ef=gd("ZodExactOptional",(e,t)=>{Lm.init(e,t),Fh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>hh(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const Cf=gd("ZodNullable",(e,t)=>{zm.init(e,t),Fh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s=ch(a.innerType,t,n),i=t.seen.get(e);"openapi-3.0"===t.target?(i.ref=a.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function Nf(e){return new Cf({type:"nullable",innerType:e})}const Af=gd("ZodDefault",(e,t)=>{Fm.init(e,t),Fh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;ch(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 _f=gd("ZodPrefault",(e,t)=>{Wm.init(e,t),Fh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;ch(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 jf=gd("ZodNonOptional",(e,t)=>{Vm.init(e,t),Fh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;ch(a.innerType,t,n),t.seen.get(e).ref=a.innerType})(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const Pf=gd("ZodCatch",(e,t)=>{Gm.init(e,t),Fh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;let s;ch(a.innerType,t,n),t.seen.get(e).ref=a.innerType;try{s=a.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const Tf=gd("ZodPipe",(e,t)=>{$m.init(e,t),Fh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s="input"===t.io?"transform"===a.in._zod.def.type?a.out:a.in:a.out;ch(s,t,n),t.seen.get(e).ref=s})(e,t,0,n),e.in=t.in,e.out=t.out});function Rf(e,t){return new Tf({type:"pipe",in:e,out:t})}const Df=gd("ZodReadonly",(e,t)=>{qm.init(e,t),Fh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;ch(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 If=gd("ZodCustom",(e,t)=>{Jm.init(e,t),Fh.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 Uf={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:"฿"},Mf={usd:"🇺🇸",eur:"🇪🇺",gbp:"🇬🇧",jpy:"🇯🇵",cad:"🇨🇦",aud:"🇦🇺",chf:"🇨🇭",cny:"🇨🇳",hkd:"🇭🇰",sgd:"🇸🇬",inr:"🇮🇳",mxn:"🇲🇽",brl:"🇧🇷",nzd:"🇳🇿",sek:"🇸🇪",nok:"🇳🇴",dkk:"🇩🇰",pln:"🇵🇱",thb:"🇹🇭"};function Of(e){return e&&e.trim()?Mf[e.trim().toLowerCase()]??"":""}function Lf(e){if(!e||!e.trim())return"";const t=e.trim().toLowerCase();return Uf[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()} (${Lf(e)})`}));var zf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=fs(`Primitive.${r}`),s=a.forwardRef((t,a)=>{const{asChild:s,...i}=t,o=s?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(o,{...i,ref:a})});return s.displayName=`Primitive.${r}`,{...t,[r]:s}},{}),Ff=a.forwardRef((t,r)=>e.jsx(zf.label,{...t,ref:r,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));Ff.displayName="Label";var Bf=Ff;const Wf=Ss("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Vf=a.forwardRef(({className:t,...r},n)=>e.jsx(Bf,{ref:n,className:Se(Wf(),t),...r}));Vf.displayName=Bf.displayName;const Hf=_u,Gf=a.createContext({}),$f=({...t})=>e.jsx(Gf.Provider,{value:{name:t.name},children:e.jsx(Nu,{...t})}),Kf=()=>{const e=a.useContext(Gf),r=a.useContext(qf),{getFieldState:n,formState:s}=t.useContext(Au),i=n(e.name,s);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=r;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...i}},qf=a.createContext({}),Zf=a.forwardRef(({className:t,...r},n)=>{const s=a.useId();return e.jsx(qf.Provider,{value:{id:s},children:e.jsx("div",{ref:n,className:Se("space-y-2",t),...r})})});Zf.displayName="FormItem";const Jf=a.forwardRef(({className:t,...r},n)=>{const{error:a,formItemId:s}=Kf();return e.jsx(Vf,{ref:n,className:Se(a&&"text-destructive",t),htmlFor:s,...r})});Jf.displayName="FormLabel";const Yf=a.forwardRef(({...t},r)=>{const{error:n,formItemId:a,formDescriptionId:s,formMessageId:i}=Kf();return e.jsx(gs,{ref:r,id:a,"aria-describedby":n?`${s} ${i}`:`${s}`,"aria-invalid":!!n,...t})});Yf.displayName="FormControl";const Xf=a.forwardRef(({className:t,...r},n)=>{const{formDescriptionId:a}=Kf();return e.jsx("p",{ref:n,id:a,className:Se("text-sm text-muted-foreground",t),...r})});Xf.displayName="FormDescription";const Qf=a.forwardRef(({className:t,children:r,...n},a)=>{const{error:s,formMessageId:i}=Kf(),o=s?String(s?.message):r;return o?e.jsx("p",{ref:a,id:i,className:Se("text-sm font-medium text-destructive",t),...n,children:o}):null});Qf.displayName="FormMessage";const eg=a.forwardRef(({className:t,type:r,...n},a)=>e.jsx("input",{type:r,className:Se("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",t),ref:a,...n}));function tg(t){const r=rg(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(ag);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}function rg(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.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),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?us(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}eg.displayName="Input";var ng=Symbol("radix.slottable");function ag(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===ng}function sg(r){const n=r+"CollectionProvider",[a,s]=Ns(n),[i,o]=a(n,{collectionRef:{current:null},itemMap:new Map}),c=r=>{const{scope:n,children:a}=r,s=t.useRef(null),o=t.useRef(new Map).current;return e.jsx(i,{scope:n,itemMap:o,collectionRef:s,children:a})};c.displayName=n;const l=r+"CollectionSlot",u=tg(l),d=t.forwardRef((t,r)=>{const{scope:n,children:a}=t,s=ds(r,o(l,n).collectionRef);return e.jsx(u,{ref:s,children:a})});d.displayName=l;const p=r+"CollectionItemSlot",m="data-radix-collection-item",h=tg(p),f=t.forwardRef((r,n)=>{const{scope:a,children:s,...i}=r,c=t.useRef(null),l=ds(n,c),u=o(p,a);return t.useEffect(()=>(u.itemMap.set(c,{ref:c,...i}),()=>{u.itemMap.delete(c)})),e.jsx(h,{[m]:"",ref:l,children:s})});return f.displayName=p,[{Provider:c,Slot:d,ItemSlot:f},function(e){const n=o(r+"CollectionConsumer",e),a=t.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`)),r=Array.from(n.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current));return r},[n.collectionRef,n.itemMap]);return a},s]}var ig=a.createContext(void 0);function og(e){const t=a.useContext(ig);return e||t||"ltr"}var cg="rovingFocusGroup.onEntryFocus",lg={bubbles:!1,cancelable:!0},ug="RovingFocusGroup",[dg,pg,mg]=sg(ug),[hg,fg]=Ns(ug,[mg]),[gg,bg]=hg(ug),vg=a.forwardRef((t,r)=>e.jsx(dg.Provider,{scope:t.__scopeRovingFocusGroup,children:e.jsx(dg.Slot,{scope:t.__scopeRovingFocusGroup,children:e.jsx(yg,{...t,ref:r})})}));vg.displayName=ug;var yg=a.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:i=!1,dir:o,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...m}=t,h=a.useRef(null),f=ds(r,h),g=og(o),[b,v]=Ds({prop:c,defaultProp:l??null,onChange:u,caller:ug}),[y,x]=a.useState(!1),w=Ls(d),S=pg(n),k=a.useRef(!1),[E,C]=a.useState(0);return a.useEffect(()=>{const e=h.current;if(e)return e.addEventListener(cg,w),()=>e.removeEventListener(cg,w)},[w]),e.jsx(gg,{scope:n,orientation:s,dir:g,loop:i,currentTabStopId:b,onItemFocus:a.useCallback(e=>v(e),[v]),onItemShiftTab:a.useCallback(()=>x(!0),[]),onFocusableItemAdd:a.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:a.useCallback(()=>C(e=>e-1),[]),children:e.jsx(Os.div,{tabIndex:y||0===E?-1:0,"data-orientation":s,...m,ref:f,style:{outline:"none",...t.style},onMouseDown:Cs(t.onMouseDown,()=>{k.current=!0}),onFocus:Cs(t.onFocus,e=>{const t=!k.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(cg,lg);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter(e=>e.focusable);kg([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),p)}}k.current=!1}),onBlur:Cs(t.onBlur,()=>x(!1))})})}),xg="RovingFocusGroupItem",wg=a.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:i=!1,tabStopId:o,children:c,...l}=t,u=Ts(),d=o||u,p=bg(xg,n),m=p.currentTabStopId===d,h=pg(n),{onFocusableItemAdd:f,onFocusableItemRemove:g,currentTabStopId:b}=p;return a.useEffect(()=>{if(s)return f(),()=>g()},[s,f,g]),e.jsx(dg.ItemSlot,{scope:n,id:d,focusable:s,active:i,children:e.jsx(Os.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...l,ref:r,onMouseDown:Cs(t.onMouseDown,e=>{s?p.onItemFocus(d):e.preventDefault()}),onFocus:Cs(t.onFocus,()=>p.onItemFocus(d)),onKeyDown:Cs(t.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:Sg[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(()=>kg(r))}}),children:"function"==typeof c?c({isCurrentTabStop:m,hasTabStop:null!=b}):c})})});wg.displayName=xg;var Sg={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function kg(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 Eg=vg,Cg=wg,Ng="Radio",[Ag,_g]=Ns(Ng),[jg,Pg]=Ag(Ng),Tg=a.forwardRef((t,r)=>{const{__scopeRadio:n,name:s,checked:i=!1,required:o,disabled:c,value:l="on",onCheck:u,form:d,...p}=t,[m,h]=a.useState(null),f=ds(r,e=>h(e)),g=a.useRef(!1),b=!m||(d||!!m.closest("form"));return e.jsxs(jg,{scope:n,checked:i,disabled:c,children:[e.jsx(Os.button,{type:"button",role:"radio","aria-checked":i,"data-state":Ug(i),"data-disabled":c?"":void 0,disabled:c,value:l,...p,ref:f,onClick:Cs(t.onClick,e=>{i||u?.(),b&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),b&&e.jsx(Ig,{control:m,bubbles:!g.current,name:s,value:l,checked:i,required:o,disabled:c,form:d,style:{transform:"translateX(-100%)"}})]})});Tg.displayName=Ng;var Rg="RadioIndicator",Dg=a.forwardRef((t,r)=>{const{__scopeRadio:n,forceMount:a,...s}=t,i=Pg(Rg,n);return e.jsx(ai,{present:a||i.checked,children:e.jsx(Os.span,{"data-state":Ug(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:r})})});Dg.displayName=Rg;var Ig=a.forwardRef(({__scopeRadio:t,control:r,checked:n,bubbles:s=!0,...i},o)=>{const c=a.useRef(null),l=ds(c,o),u=El(n),d=Cl(r);return a.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==n&&r){const t=new Event("click",{bubbles:s});r.call(e,n),e.dispatchEvent(t)}},[u,n,s]),e.jsx(Os.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Ug(e){return e?"checked":"unchecked"}Ig.displayName="RadioBubbleInput";var Mg=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Og="RadioGroup",[Lg]=Ns(Og,[fg,_g]),zg=fg(),Fg=_g(),[Bg,Wg]=Lg(Og),Vg=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,name:a,defaultValue:s,value:i,required:o=!1,disabled:c=!1,orientation:l,dir:u,loop:d=!0,onValueChange:p,...m}=t,h=zg(n),f=og(u),[g,b]=Ds({prop:i,defaultProp:s??null,onChange:p,caller:Og});return e.jsx(Bg,{scope:n,name:a,required:o,disabled:c,value:g,onValueChange:b,children:e.jsx(Eg,{asChild:!0,...h,orientation:l,dir:f,loop:d,children:e.jsx(Os.div,{role:"radiogroup","aria-required":o,"aria-orientation":l,"data-disabled":c?"":void 0,dir:f,...m,ref:r})})})});Vg.displayName=Og;var Hg="RadioGroupItem",Gg=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,disabled:s,...i}=t,o=Wg(Hg,n),c=o.disabled||s,l=zg(n),u=Fg(n),d=a.useRef(null),p=ds(r,d),m=o.value===i.value,h=a.useRef(!1);return a.useEffect(()=>{const e=e=>{Mg.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)}},[]),e.jsx(Cg,{asChild:!0,...l,focusable:!c,active:m,children:e.jsx(Tg,{disabled:c,required:o.required,checked:m,...u,...i,name:o.name,ref:p,onCheck:()=>o.onValueChange(i.value),onKeyDown:Cs(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:Cs(i.onFocus,()=>{h.current&&d.current?.click()})})})});Gg.displayName=Hg;var $g=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,...a}=t,s=Fg(n);return e.jsx(Dg,{...s,...a,ref:r})});$g.displayName="RadioGroupIndicator";var Kg=Vg,qg=Gg,Zg=$g;const Jg=a.forwardRef(({className:t,...r},n)=>e.jsx(Kg,{className:Se("grid gap-2",t),...r,ref:n}));Jg.displayName=Kg.displayName;const Yg=a.forwardRef(({className:t,...r},n)=>e.jsx(qg,{ref:n,className:Se("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",t),...r,children:e.jsx(Zg,{className:"flex items-center justify-center",children:e.jsx(Xo,{className:"h-3.5 w-3.5 fill-primary"})})}));function Xg(e,[t,r]){return Math.min(r,Math.max(t,e))}Yg.displayName=qg.displayName;var Qg="ScrollArea",[eb]=Ns(Qg),[tb,rb]=eb(Qg),nb=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,type:s="hover",dir:i,scrollHideDelay:o=600,...c}=t,[l,u]=a.useState(null),[d,p]=a.useState(null),[m,h]=a.useState(null),[f,g]=a.useState(null),[b,v]=a.useState(null),[y,x]=a.useState(0),[w,S]=a.useState(0),[k,E]=a.useState(!1),[C,N]=a.useState(!1),A=ds(r,e=>u(e)),_=og(i);return e.jsx(tb,{scope:n,type:s,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:C,onScrollbarYEnabledChange:N,onCornerWidthChange:x,onCornerHeightChange:S,children:e.jsx(Os.div,{dir:_,...c,ref:A,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":w+"px",...t.style}})})});nb.displayName=Qg;var ab="ScrollAreaViewport",sb=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,children:s,nonce:i,...o}=t,c=rb(ab,n),l=ds(r,a.useRef(null),c.onViewportChange);return e.jsxs(e.Fragment,{children:[e.jsx("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:i}),e.jsx(Os.div,{"data-radix-scroll-area-viewport":"",...o,ref:l,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...t.style},children:e.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})});sb.displayName=ab;var ib="ScrollAreaScrollbar",ob=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=rb(ib,t.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:c}=i,l="horizontal"===t.orientation;return a.useEffect(()=>(l?o(!0):c(!0),()=>{l?o(!1):c(!1)}),[l,o,c]),"hover"===i.type?e.jsx(cb,{...s,ref:r,forceMount:n}):"scroll"===i.type?e.jsx(lb,{...s,ref:r,forceMount:n}):"auto"===i.type?e.jsx(ub,{...s,ref:r,forceMount:n}):"always"===i.type?e.jsx(db,{...s,ref:r}):null});ob.displayName=ib;var cb=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=rb(ib,t.__scopeScrollArea),[o,c]=a.useState(!1);return a.useEffect(()=>{const e=i.scrollArea;let t=0;if(e){const r=()=>{window.clearTimeout(t),c(!0)},n=()=>{t=window.setTimeout(()=>c(!1),i.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[i.scrollArea,i.scrollHideDelay]),e.jsx(ai,{present:n||o,children:e.jsx(ub,{"data-state":o?"visible":"hidden",...s,ref:r})})}),lb=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=rb(ib,t.__scopeScrollArea),o="horizontal"===t.orientation,c=Pb(()=>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"}},a.useReducer((e,t)=>p[e][t]??e,d));var d,p;return a.useEffect(()=>{if("idle"===l){const e=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[l,i.scrollHideDelay,u]),a.useEffect(()=>{const e=i.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)}},[i.viewport,o,u,c]),e.jsx(ai,{present:n||"hidden"!==l,children:e.jsx(db,{"data-state":"hidden"===l?"hidden":"visible",...s,ref:r,onPointerEnter:Cs(t.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Cs(t.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),ub=a.forwardRef((t,r)=>{const n=rb(ib,t.__scopeScrollArea),{forceMount:s,...i}=t,[o,c]=a.useState(!1),l="horizontal"===t.orientation,u=Pb(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;c(l?e:t)}},10);return Tb(n.viewport,u),Tb(n.content,u),e.jsx(ai,{present:s||o,children:e.jsx(db,{"data-state":o?"visible":"hidden",...i,ref:r})})}),db=a.forwardRef((t,r)=>{const{orientation:n="vertical",...s}=t,i=rb(ib,t.__scopeScrollArea),o=a.useRef(null),c=a.useRef(0),[l,u]=a.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=Eb(l.viewport,l.content),p={...s,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=Cb(r),s=a/2,i=t||s,o=a-i,c=r.scrollbar.paddingStart+i,l=r.scrollbar.size-r.scrollbar.paddingEnd-o,u=r.content-r.viewport,d="ltr"===n?[0,u]:[-1*u,0];return Ab([c,l],d)(e)}(e,c.current,l,t)}return"horizontal"===n?e.jsx(pb,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&o.current){const e=Nb(i.viewport.scrollLeft,l,i.dir);o.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=m(e,i.dir))}}):"vertical"===n?e.jsx(mb,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&o.current){const e=Nb(i.viewport.scrollTop,l);o.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=m(e))}}):null}),pb=a.forwardRef((t,r)=>{const{sizes:n,onSizesChange:s,...i}=t,o=rb(ib,t.__scopeScrollArea),[c,l]=a.useState(),u=a.useRef(null),d=ds(r,u,o.onScrollbarXChange);return a.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),e.jsx(gb,{"data-orientation":"horizontal",...i,ref:d,sizes:n,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":Cb(n)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.x),onDragScroll:e=>t.onDragScroll(e.x),onWheelScroll:(e,r)=>{if(o.viewport){const n=o.viewport.scrollLeft+e.deltaX;t.onWheelScroll(n),_b(n,r)&&e.preventDefault()}},onResize:()=>{u.current&&o.viewport&&c&&s({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:kb(c.paddingLeft),paddingEnd:kb(c.paddingRight)}})}})}),mb=a.forwardRef((t,r)=>{const{sizes:n,onSizesChange:s,...i}=t,o=rb(ib,t.__scopeScrollArea),[c,l]=a.useState(),u=a.useRef(null),d=ds(r,u,o.onScrollbarYChange);return a.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),e.jsx(gb,{"data-orientation":"vertical",...i,ref:d,sizes:n,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":Cb(n)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.y),onDragScroll:e=>t.onDragScroll(e.y),onWheelScroll:(e,r)=>{if(o.viewport){const n=o.viewport.scrollTop+e.deltaY;t.onWheelScroll(n),_b(n,r)&&e.preventDefault()}},onResize:()=>{u.current&&o.viewport&&c&&s({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:kb(c.paddingTop),paddingEnd:kb(c.paddingBottom)}})}})}),[hb,fb]=eb(ib),gb=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,sizes:s,hasThumb:i,onThumbChange:o,onThumbPointerUp:c,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:p,onResize:m,...h}=t,f=rb(ib,n),[g,b]=a.useState(null),v=ds(r,e=>b(e)),y=a.useRef(null),x=a.useRef(""),w=f.viewport,S=s.content-s.viewport,k=Ls(p),E=Ls(u),C=Pb(m,10);function N(e){if(y.current){const t=e.clientX-y.current.left,r=e.clientY-y.current.top;d({x:t,y:r})}}return a.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})},[w,g,S,k]),a.useEffect(E,[s,E]),Tb(g,C),Tb(f.content,C),e.jsx(hb,{scope:n,scrollbar:g,hasThumb:i,onThumbChange:Ls(o),onThumbPointerUp:Ls(c),onThumbPositionChange:E,onThumbPointerDown:Ls(l),children:e.jsx(Os.div,{...h,ref:v,style:{position:"absolute",...h.style},onPointerDown:Cs(t.onPointerDown,e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),y.current=g.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),N(e)}}),onPointerMove:Cs(t.onPointerMove,N),onPointerUp:Cs(t.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=x.current,f.viewport&&(f.viewport.style.scrollBehavior=""),y.current=null})})})}),bb="ScrollAreaThumb",vb=a.forwardRef((t,r)=>{const{forceMount:n,...a}=t,s=fb(bb,t.__scopeScrollArea);return e.jsx(ai,{present:n||s.hasThumb,children:e.jsx(yb,{ref:r,...a})})}),yb=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,style:s,...i}=t,o=rb(bb,n),c=fb(bb,n),{onThumbPositionChange:l}=c,u=ds(r,e=>c.onThumbChange(e)),d=a.useRef(void 0),p=Pb(()=>{d.current&&(d.current(),d.current=void 0)},100);return a.useEffect(()=>{const e=o.viewport;if(e){const t=()=>{if(p(),!d.current){const t=jb(e,l);d.current=t,l()}};return l(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,p,l]),e.jsx(Os.div,{"data-state":c.hasThumb?"visible":"hidden",...i,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:Cs(t.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;c.onThumbPointerDown({x:r,y:n})}),onPointerUp:Cs(t.onPointerUp,c.onThumbPointerUp)})});vb.displayName=bb;var xb="ScrollAreaCorner",wb=a.forwardRef((t,r)=>{const n=rb(xb,t.__scopeScrollArea),a=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&a?e.jsx(Sb,{...t,ref:r}):null});wb.displayName=xb;var Sb=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,...s}=t,i=rb(xb,n),[o,c]=a.useState(0),[l,u]=a.useState(0),d=Boolean(o&&l);return Tb(i.scrollbarX,()=>{const e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),u(e)}),Tb(i.scrollbarY,()=>{const e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),c(e)}),d?e.jsx(Os.div,{...s,ref:r,style:{width:o,height:l,position:"absolute",right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:0,...t.style}}):null});function kb(e){return e?parseInt(e,10):0}function Eb(e,t){const r=e/t;return isNaN(r)?0:r}function Cb(e){const t=Eb(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function Nb(e,t,r="ltr"){const n=Cb(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-a,i=t.content-t.viewport,o=s-n,c=Xg(e,"ltr"===r?[0,i]:[-1*i,0]);return Ab([0,i],[0,o])(c)}function Ab(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 _b(e,t){return e>0&&e<t}var jb=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function a(){const s={left:e.scrollLeft,top:e.scrollTop},i=r.left!==s.left,o=r.top!==s.top;(i||o)&&t(),r=s,n=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(n)};function Pb(e,t){const r=Ls(e),n=a.useRef(0);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),a.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function Tb(e,t){const r=Ls(t);_s(()=>{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 Rb=nb,Db=sb,Ib=wb;const Ub=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(Rb,{ref:a,className:Se("relative overflow-hidden",t),...n,children:[e.jsx(Db,{className:"h-full w-full rounded-[inherit]",children:r}),e.jsx(Mb,{}),e.jsx(Ib,{})]}));Ub.displayName=Rb.displayName;const Mb=a.forwardRef(({className:t,orientation:r="vertical",...n},a)=>e.jsx(ob,{ref:a,orientation:r,className:Se("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]",t),...n,children:e.jsx(vb,{className:Se("relative rounded-full bg-border","vertical"===r&&"flex-1")})}));function Ob(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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}</text></svg>`}Mb.displayName=ob.displayName;const Lb=["🏢","🏬","🏣","🏤","🏦","🏛️","🏠","🏡","🏭","🏗️","🏪","🏨","🏫","🏥","💼","📊","📈","📉","📋","📁","📂","🗂️","🗃️","🗄️","📅","🗓️","📝","🖋️","✏️","🖊️","🖌️","🖍️","📇","📌","📍","📎","🖇️","💻","🖥️","🖨️","🖱️","⌨️","📱","📲","📡","🌐","🔗","🔒","🔓","⚙️","🔧","🛠️","🧑💻","👨💻","👩💻","🕹️","💾","📟","🖥️","🖲️","🚀","💡","🎨","🖼️","🧪","🔬","🧬","🎯","⚡","🎲","🎮","🧩","📷","🎥","✉️","📨","📩","📧","📞","☎️","📠","🗣️","💬","🗨️","📢","📣","🔔","🛎️","💰","💸","💳","🏦","📈","📉","⚖️","🧾","🪙","🏛️","⚗️","🧪","🔭","🔬","🩺","🧬","🩻","🏥","🌱","🌍","🌏","🌎","🌡️","👨💼","👩💼","👨🏫","👩🏫","👨🔬","👩🔬","👨🎨","👩🎨","👨🔧","👩🔧","👨🚀","👩🚀","👨⚖️","👩⚖️","🏅","🎖️","🥇","🥈","🥉","🏆","🎗️","🔑","🗝️","🧭","🛡️","🚩","🏳️🌈","🎟️","🎫"],zb=({workspace:r})=>{const{t:n}=sn(),{updateWorkspace:a}=Mk(),{can:s}=xl(),[i,o]=t.useState(!1),[c,l]=t.useState("emoji"),[u,d]=t.useState(),[p,m]=t.useState(null),h=t.useRef(null);t.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const f=ud({resolver:vh(bf({name:Vh().min(2,{message:n("general.nameMinLength")}),image:Vh().optional()})),defaultValues:{name:r.name||"",image:r.image||""}});if(!r)return e.jsx(Sl,{});const g=s(al.WORKSPACE_SETTINGS_EDIT);return e.jsxs("div",{children:[p&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:n("settings.common.success")}),e.jsx("p",{className:"text-sm",children:p})]}),!g&&e.jsx("div",{className:"text-red-500",children:n("general.ownerOnly")}),e.jsx(Hf,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){o(!0),m(null);try{await a(r,e),m(n("general.success")),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{m(null)},5e3)}catch(e){Re(e,{component:"WorkspaceSettingsGeneral",action:"updateWorkspace",metadata:{workspaceId:r._id}})}finally{o(!1)}}),className:"space-y-6",children:[e.jsx($f,{control:f.control,name:"name",render:({field:t})=>e.jsxs(Zf,{children:[e.jsx(Jf,{children:n("general.name")}),e.jsx(Yf,{children:e.jsx(eg,{placeholder:n("general.namePlaceholder"),...t,disabled:!g})}),e.jsx(Qf,{})]})}),r.billingCurrency?.trim()&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Vf,{className:"text-sm font-medium text-muted-foreground",children:n("general.billingCurrency")}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[Of(r.billingCurrency)&&e.jsx("span",{className:"text-base",children:Of(r.billingCurrency)}),e.jsx("span",{children:r.billingCurrency.trim().toUpperCase()})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(Vf,{className:"text-sm font-medium",children:n("general.icon")}),e.jsx(Xf,{children:n("general.iconDescription")})]}),e.jsxs(Jg,{value:c,disabled:!g,onValueChange:e=>l(e),className:"flex flex-col space-y-3",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Yg,{value:"emoji",id:"emoji"}),e.jsxs(Vf,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(rs,{className:"h-4 w-4"}),n("general.chooseEmoji")]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Yg,{value:"url",id:"url"}),e.jsxs(Vf,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(Ga,{className:"h-4 w-4"}),n("general.customImageUrl")]})]})]}),"emoji"===c&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e.jsxs("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:[u&&e.jsx("span",{className:"text-2xl",children:u}),!u&&f.watch("image")?.trim()&&e.jsx("img",{src:f.watch("image")||void 0,alt:"Workspace preview"})]})]}),g&&e.jsx(Ub,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Lb.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{d(e),f.setValue("image",Ob(e))})(t),disabled:!g,className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(u===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===c&&e.jsxs("div",{className:"space-y-3",children:[e.jsx($f,{control:f.control,name:"image",render:({field:t})=>e.jsxs(Zf,{children:[e.jsx(Jf,{children:n("general.imageUrl")}),e.jsx(Yf,{children:e.jsx(eg,{placeholder:n("general.imageUrlPlaceholder"),...t,disabled:!g})}),e.jsx(Xf,{children:n("general.imageUrlDescription")}),e.jsx(Qf,{})]})}),f.watch("image")&&f.watch("image")?.trim()&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e.jsx("img",{src:f.watch("image")||void 0,className:"w-full h-full object-cover",alt:"Workspace preview"})})]})]})]}),e.jsx("div",{className:"flex justify-end gap-3 pt-4",children:g&&e.jsx(Es,{type:"submit",disabled:i,progress:i,children:n("general.updateWorkspace")})})]})})]})};class Fb extends gn{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 Bb=t.createContext(null);function Wb(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 Vb=t.memo(function({children:r,serviceWorkerPath:n="/push-sw.js",autoSubscribe:a=!1}){const{t:s}=sn(),i=Sn(),{isAuthenticated:o}=yl(),c=t.useMemo(()=>"undefined"!=typeof window&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window,[]),l=t.useMemo(()=>new Fb({serverUrl:i.serverUrl,version:i.version,orgId:i.orgId}),[i.serverUrl,i.version,i.orgId]),[u,d]=t.useState({permission:c?Notification.permission:"default",isSubscribed:!1,isSupported:c,loading:!1,error:null});t.useEffect(()=>{if(!o||!c)return;let e=!1;return(async()=>{try{const t=await navigator.serviceWorker.getRegistration(n);if(e)return;if(!t)return void d(e=>({...e,isSubscribed:!1}));const r=await t.pushManager.getSubscription();if(e)return;d(e=>({...e,isSubscribed:!!r,permission:Notification.permission}))}catch{e||d(e=>({...e,isSubscribed:!1}))}})(),()=>{e=!0}},[o,c,n]);const p=t.useCallback(async()=>{if(!c)return!1;const e=await Notification.requestPermission();return d(t=>({...t,permission:e})),"granted"===e},[c]),m=t.useCallback(async()=>{if(c&&o){d(e=>({...e,loading:!0,error:null}));try{if(!await p())return void d(e=>({...e,loading:!1,error:s("notifications.permissionDenied")}));const{publicKey:e}=await l.getVapidPublicKey(),t=await navigator.serviceWorker.register(n);await navigator.serviceWorker.ready;const r=(await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Wb(e)})).toJSON();await l.subscribe({endpoint:r.endpoint,keys:{p256dh:r.keys.p256dh,auth:r.keys.auth}},navigator.userAgent),d(e=>({...e,isSubscribed:!0,loading:!1}))}catch(e){const t=e instanceof Error?e.message:s("push.failedToSubscribe");d(e=>({...e,loading:!1,error:t})),Re(e,{component:"PushNotificationProvider",action:"subscribe"})}}},[c,o,l,n,p]),h=t.useCallback(async()=>{if(c){d(e=>({...e,loading:!0,error:null}));try{const e=await navigator.serviceWorker.getRegistration(n);if(e){const t=await e.pushManager.getSubscription();if(t){const e=t.endpoint;await t.unsubscribe(),await l.unsubscribe(e)}}d(e=>({...e,isSubscribed:!1,loading:!1}))}catch(e){const t=e instanceof Error?e.message:s("push.failedToUnsubscribe");d(e=>({...e,loading:!1,error:t})),Re(e,{component:"PushNotificationProvider",action:"unsubscribe"})}}},[c,l,n]),f=t.useMemo(()=>({...u,requestPermission:p,subscribe:m,unsubscribe:h}),[u,p,m,h]);return e.jsx(Bb.Provider,{value:f,children:r})});function Hb(){const e=t.useContext(Bb);if(!e)throw new Error("usePushNotifications must be used within PushNotificationProvider");return e}const Gb={firefox:4,safari:4,edge:4,chrome:4},$b=({workspace:r})=>{const{isSupported:n,permission:a,isSubscribed:s,loading:i,error:o,subscribe:c,unsubscribe:l}=Hb(),{t:u}=sn(),{api:d}=Cn(),{can:p}=xl(),m=p(al.WORKSPACE_SETTINGS_EDIT),h=t.useMemo(()=>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"}(),[]),f=Gb[h],[g,b]=t.useState([]),[v,y]=t.useState(!0),[x,w]=t.useState({}),[S,k]=t.useState(!0),[E,C]=t.useState(null),[N,A]=t.useState(null),_=t.useRef(null);t.useEffect(()=>()=>{_.current&&clearTimeout(_.current)},[]),t.useEffect(()=>{if(!r?._id)return;const e=r._id.toString();y(!0),k(!0),Promise.all([d.getNotificationEvents(e).catch(()=>[]),d.getNotificationPreferences(e).catch(()=>({}))]).then(([e,t])=>{b(e),w(t)}).finally(()=>{y(!1),k(!1)})},[r?._id]);const j=t.useCallback(async(e,t,n)=>{if(!r?._id||!m)return;const a=!n;C(`${e}.${t}`),A(null),w(r=>({...r,[e]:{...r[e],[t]:a}}));try{const n=await d.updateNotificationPreferences(r._id.toString(),{[e]:{[t]:a}});w(n),A(u("notifications.prefsSaved")),_.current&&clearTimeout(_.current),_.current=setTimeout(()=>A(null),3e3)}catch(r){w(r=>({...r,[e]:{...r[e],[t]:n}})),Re(r,{component:"SettingsNotifications",action:"toggleChannel"})}finally{C(null)}},[r?._id,m,d,u]),P=(e,t)=>!1!==x[e]?.[t],T=t.useMemo(()=>{const e=new Map;for(const t of g){const r=t.category||"general";e.has(r)||e.set(r,[]),e.get(r).push(t)}return Array.from(e.entries())},[g]),R=v||S,D=g.length>0;return e.jsxs("div",{className:"space-y-6",children:[e.jsx("p",{className:"text-sm text-gray-600",children:u("notifications.manageDescription")}),n&&e.jsxs(e.Fragment,{children:[o&&"denied"!==a&&e.jsx("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg text-sm",children:o}),"denied"===a&&e.jsx("div",{className:"border border-amber-200 bg-amber-50 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Qa,{className:"h-5 w-5 text-amber-600 shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-amber-800",children:u("notifications.blocked")}),e.jsx("p",{className:"text-xs text-amber-700 mt-1",children:u("notifications.blockedDescription")}),e.jsx("ol",{className:"text-xs text-amber-700 mt-2 space-y-1 list-decimal list-inside",children:Array.from({length:f},(t,r)=>e.jsx("li",{children:u(`notifications.unblock.${h}.step${r+1}`)},r))})]})]})}),"denied"!==a&&e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5 p-2 rounded-lg "+(s?"bg-green-100":"bg-gray-100"),children:s?e.jsx(Ua,{className:"h-4 w-4 text-green-600"}):e.jsx(Ia,{className:"h-4 w-4 text-gray-400"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900",children:u("notifications.pushTitle")}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:u("notifications.pushDescription",{subscribed:String(s)})})]})]}),e.jsx(Es,{variant:s?"outline":"default",size:"sm",className:"shrink-0",onClick:s?l:c,disabled:i,progress:i,children:u("notifications.toggleAction",{loading:String(i),subscribed:String(s)})})]}),s&&e.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 text-xs text-gray-500",children:u("notifications.deviceNote")})]})]}),R&&e.jsx("div",{className:"text-center text-sm text-gray-400 py-4",children:u("notifications.loadingPrefs")}),!R&&D&&m&&e.jsxs(e.Fragment,{children:[N&&e.jsx("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded-lg text-sm",children:N}),T.map(([t,r])=>e.jsxs("div",{className:"border rounded-lg overflow-hidden",children:[e.jsx("div",{className:"bg-gray-50 px-4 py-2.5 border-b",children:e.jsx("h4",{className:"text-sm font-medium text-gray-700 capitalize",children:t})}),e.jsxs("div",{className:"divide-y",children:[e.jsxs("div",{className:"flex items-center px-4 py-2 bg-gray-50/50",children:[e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsx("div",{className:"w-12 flex justify-center",children:e.jsx(Ka,{className:"h-3.5 w-3.5 text-gray-400"})}),e.jsx("div",{className:"w-12 flex justify-center",children:e.jsx(ts,{className:"h-3.5 w-3.5 text-gray-400"})})]})]}),r.map(t=>{const r=P(t.slug,"email"),n=P(t.slug,"push"),a=E===`${t.slug}.email`,s=E===`${t.slug}.push`;return e.jsxs("div",{className:"flex items-center px-4 py-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-gray-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:t.description})]}),e.jsxs("div",{className:"flex items-center gap-6 shrink-0",children:[e.jsx("div",{className:"w-12 flex justify-center",children:t.channels.email?e.jsx(Ol,{checked:r,onCheckedChange:()=>j(t.slug,"email",r),disabled:a}):e.jsx("span",{className:"text-xs text-gray-300",children:"—"})}),e.jsx("div",{className:"w-12 flex justify-center",children:t.channels.push?e.jsx(Ol,{checked:n,onCheckedChange:()=>j(t.slug,"push",n),disabled:s}):e.jsx("span",{className:"text-xs text-gray-300",children:"—"})})]})]},t.slug)})]})]},t))]})]})},Kb=({workspace:r})=>{const{t:n}=sn(),{isOwner:a}=xl(),{settings:s}=En(),{appPermissions:i}=Hn(),{updateWorkspacePermissions:o}=Mk(),[c,l]=t.useState(!1),[u,d]=t.useState(null),p=t.useRef(null);t.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const m=t.useMemo(()=>s?.workspace?.roles??r.roles??[],[s?.workspace?.roles,r.roles]),h=t.useMemo(()=>{if(!i)return[];const e=new Set;for(const t of Object.values(i))for(const r of t)r.startsWith("workspace:")||e.add(r);return Array.from(e).sort()},[i]),[f,g]=t.useState({});if(t.useEffect(()=>{if(!i)return;const e=r.permissions,t={};for(const r of m)t[r]=e&&r in e?e[r].filter(e=>!e.startsWith("workspace:")):r in i?i[r].filter(e=>!e.startsWith("workspace:")):[];g(t)},[r.permissions,i,m]),!r)return e.jsx(Sl,{});if(!i||0===h.length)return null;return e.jsxs("div",{children:[u&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:n("settings.common.success")}),e.jsx("p",{className:"text-sm",children:u})]}),!a&&e.jsx("div",{className:"text-red-500 mb-4",children:n("permissions.ownerOnly")}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:n("permissions.description")}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b",children:[e.jsx("th",{className:"text-start py-2 pe-4 font-medium text-gray-500 min-w-[160px]"}),m.map(t=>e.jsx("th",{className:"text-center py-2 px-3 font-medium text-gray-700 capitalize min-w-[80px]",children:t},t))]})}),e.jsx("tbody",{children:h.map(t=>e.jsxs("tr",{className:"border-b border-gray-50 hover:bg-gray-50/50",children:[e.jsx("td",{className:"py-2 pe-4 text-gray-700 font-mono text-xs",children:t}),m.map(r=>{const n="admin"===r,s=n||(f[r]??[]).includes(t);return e.jsx("td",{className:"text-center py-2 px-3",children:e.jsx(Ol,{checked:s,disabled:!a||n,onCheckedChange:()=>((e,t)=>{g(r=>{const n=r[e]??[],a=n.includes(t);return{...r,[e]:a?n.filter(e=>e!==t):[...n,t]}})})(r,t),className:"mx-auto"})},r)})]},t))})]})}),a&&e.jsx("div",{className:"mt-6",children:e.jsx(Es,{onClick:async()=>{l(!0),d(null);try{const e=r.permissions??{},t={},a=new Set([...Object.keys(e),...Object.keys(f)]);for(const r of a){const n=(e[r]??[]).filter(e=>e.startsWith("workspace:")),a=f[r]??[];t[r]=[...n,...a]}await o(r._id,t),d(n("permissions.saveSuccess")),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>d(null),5e3)}catch(e){Re(e,{component:"WorkspaceSettingsPermissions",action:"savePermissions",metadata:{workspaceId:r._id}})}finally{l(!1)}},disabled:c,progress:c,children:n(c?"permissions.saving":"permissions.save")})})]})};var qb=.999,Zb=/[\\\/_+.#"@\[\(\{&]/,Jb=/[\\\/_+.#"@\[\(\{&]/g,Yb=/[\s-]/,Xb=/[\s-]/g;function Qb(e,t,r,n,a,s,i){if(s===t.length)return a===e.length?1:.99;var o=`${a},${s}`;if(void 0!==i[o])return i[o];for(var c,l,u,d,p=n.charAt(s),m=r.indexOf(p,a),h=0;m>=0;)(c=Qb(e,t,r,n,m+1,s+1,i))>h&&(m===a?c*=1:Zb.test(e.charAt(m-1))?(c*=.8,(u=e.slice(a,m-1).match(Jb))&&a>0&&(c*=Math.pow(qb,u.length))):Yb.test(e.charAt(m-1))?(c*=.9,(d=e.slice(a,m-1).match(Xb))&&a>0&&(c*=Math.pow(qb,d.length))):(c*=.17,a>0&&(c*=Math.pow(qb,m-a))),e.charAt(m)!==t.charAt(s)&&(c*=.9999)),(c<.1&&r.charAt(m-1)===n.charAt(s+1)||n.charAt(s+1)===n.charAt(s)&&r.charAt(m-1)!==n.charAt(s))&&(.1*(l=Qb(e,t,r,n,m+1,s+2,i))>c&&(c=.1*l)),c>h&&(h=c),m=r.indexOf(p,m+1);return i[o]=h,h}function ev(e){return e.toLowerCase().replace(Xb," ")}function tv(e,t,r){return Qb(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,ev(e),ev(t),0,0,{})}var rv='[cmdk-group=""]',nv='[cmdk-group-items=""]',av='[cmdk-item=""]',sv=`${av}:not([aria-disabled="true"])`,iv="cmdk-item-select",ov="data-value",cv=(e,t,r)=>tv(e,t,r),lv=a.createContext(void 0),uv=()=>a.useContext(lv),dv=a.createContext(void 0),pv=()=>a.useContext(dv),mv=a.createContext(void 0),hv=a.forwardRef((e,t)=>{let r=_v(()=>{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}}}),n=_v(()=>new Set),s=_v(()=>new Map),i=_v(()=>new Map),o=_v(()=>new Set),c=Nv(e),{label:l,children:u,value:d,onValueChange:p,filter:m,shouldFilter:h,loop:f,disablePointerSelection:g=!1,vimBindings:b=!0,...v}=e,y=Ts(),x=Ts(),w=Ts(),S=a.useRef(null),k=Tv();Av(()=>{if(void 0!==d){let e=d.trim();r.current.value=e,E.emit()}},[d]),Av(()=>{k(6,P)},[]);let E=a.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var a,s,i,o;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)j(),A(),k(1,_);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(w);e?e.focus():null==(a=document.getElementById(y))||a.focus()}if(k(7,()=>{var e;r.current.selectedItemId=null==(e=T())?void 0:e.id,E.emit()}),n||k(5,P),void 0!==(null==(s=c.current)?void 0:s.value)){let e=null!=t?t:"";return void(null==(o=(i=c.current).onValueChange)||o.call(i,e))}}E.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),C=a.useMemo(()=>({value:(e,t,n)=>{var a;t!==(null==(a=i.current.get(e))?void 0:a.value)&&(i.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,N(t,n)),k(2,()=>{A(),E.emit()}))},item:(e,t)=>(n.current.add(e),t&&(s.current.has(t)?s.current.get(t).add(e):s.current.set(t,new Set([e]))),k(3,()=>{j(),A(),r.current.value||_(),E.emit()}),()=>{i.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=T();k(4,()=>{j(),(null==t?void 0:t.getAttribute("id"))===e&&_(),E.emit()})}),group:e=>(s.current.has(e)||s.current.set(e,new Set),()=>{i.current.delete(e),s.current.delete(e)}),filter:()=>c.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:y,inputId:w,labelId:x,listInnerRef:S}),[]);function N(e,t){var n,a;let s=null!=(a=null==(n=c.current)?void 0:n.filter)?a:cv;return e?s(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=s.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;R().sort((t,r)=>{var n,a;let s=t.getAttribute("id"),i=r.getAttribute("id");return(null!=(n=e.get(i))?n:0)-(null!=(a=e.get(s))?a:0)}).forEach(e=>{let t=e.closest(nv);t?t.appendChild(e.parentElement===t?e:e.closest(`${nv} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${nv} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=S.current)?void 0:t.querySelector(`${rv}[${ov}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function _(){let e=R().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(ov);E.setState("value",t||void 0)}function j(){var e,t,a,o;if(!r.current.search||!1===c.current.shouldFilter)return void(r.current.filtered.count=n.current.size);r.current.filtered.groups=new Set;let l=0;for(let s of n.current){let n=N(null!=(t=null==(e=i.current.get(s))?void 0:e.value)?t:"",null!=(o=null==(a=i.current.get(s))?void 0:a.keywords)?o:[]);r.current.filtered.items.set(s,n),n>0&&l++}for(let[e,t]of s.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 P(){var e,t,r;let n=T();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(rv))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function T(){var e;return null==(e=S.current)?void 0:e.querySelector(`${av}[aria-selected="true"]`)}function R(){var e;return Array.from((null==(e=S.current)?void 0:e.querySelectorAll(sv))||[])}function D(e){let t=R()[e];t&&E.setState("value",t.getAttribute(ov))}function I(e){var t;let r=T(),n=R(),a=n.findIndex(e=>e===r),s=n[a+e];null!=(t=c.current)&&t.loop&&(s=a+e<0?n[n.length-1]:a+e===n.length?n[0]:n[a+e]),s&&E.setState("value",s.getAttribute(ov))}function U(e){let t,r=T(),n=null==r?void 0:r.closest(rv);for(;n&&!t;)n=e>0?Ev(n,rv):Cv(n,rv),t=null==n?void 0:n.querySelector(sv);t?E.setState("value",t.getAttribute(ov)):I(e)}let M=()=>D(R().length-1),O=e=>{e.preventDefault(),e.metaKey?M():e.altKey?U(1):I(1)},L=e=>{e.preventDefault(),e.metaKey?D(0):e.altKey?U(-1):I(-1)};return a.createElement(Os.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&&L(e);break;case"ArrowUp":L(e);break;case"Home":e.preventDefault(),D(0);break;case"End":e.preventDefault(),M();break;case"Enter":{e.preventDefault();let t=T();if(t){let e=new Event(iv);t.dispatchEvent(e)}}}}},a.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:Dv},l),Rv(e,e=>a.createElement(dv.Provider,{value:E},a.createElement(lv.Provider,{value:C},e))))}),fv=a.forwardRef((e,t)=>{var r,n;let s=Ts(),i=a.useRef(null),o=a.useContext(mv),c=uv(),l=Nv(e),u=null!=(n=null==(r=l.current)?void 0:r.forceMount)?n:null==o?void 0:o.forceMount;Av(()=>{if(!u)return c.item(s,null==o?void 0:o.id)},[u]);let d=Pv(s,i,[e.value,e.children,i],e.keywords),p=pv(),m=jv(e=>e.value&&e.value===d.current),h=jv(e=>!(!u&&!1!==c.filter())||(!e.search||e.filtered.items.get(s)>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(a.useEffect(()=>{let t=i.current;if(t&&!e.disabled)return t.addEventListener(iv,f),()=>t.removeEventListener(iv,f)},[h,e.onSelect,e.disabled]),!h)return null;let{disabled:b,value:v,onSelect:y,forceMount:x,keywords:w,...S}=e;return a.createElement(Os.div,{ref:us(i,t),...S,id:s,"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)}),gv=a.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:s,...i}=e,o=Ts(),c=a.useRef(null),l=a.useRef(null),u=Ts(),d=uv(),p=jv(e=>!(!s&&!1!==d.filter())||(!e.search||e.filtered.groups.has(o)));Av(()=>d.group(o),[]),Pv(o,c,[e.value,e.heading,l]);let m=a.useMemo(()=>({id:o,forceMount:s}),[s]);return a.createElement(Os.div,{ref:us(c,t),...i,"cmdk-group":"",role:"presentation",hidden:!p||void 0},r&&a.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),Rv(e,e=>a.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},a.createElement(mv.Provider,{value:m},e))))}),bv=a.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,s=a.useRef(null),i=jv(e=>!e.search);return r||i?a.createElement(Os.div,{ref:us(s,t),...n,"cmdk-separator":"",role:"separator"}):null}),vv=a.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,s=null!=e.value,i=pv(),o=jv(e=>e.search),c=jv(e=>e.selectedItemId),l=uv();return a.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),a.createElement(Os.input,{ref:t,...n,"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:s?e.value:o,onChange:e=>{s||i.setState("search",e.target.value),null==r||r(e.target.value)}})}),yv=a.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...s}=e,i=a.useRef(null),o=a.useRef(null),c=jv(e=>e.selectedItemId),l=uv();return a.useEffect(()=>{if(o.current&&i.current){let e,t=o.current,r=i.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)}}},[]),a.createElement(Os.div,{ref:us(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":n,id:l.listId},Rv(e,e=>a.createElement("div",{ref:us(o,l.listInnerRef),"cmdk-list-sizer":""},e)))}),xv=a.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:i,container:o,...c}=e;return a.createElement(Fo,{open:r,onOpenChange:n},a.createElement(Wo,{container:o},a.createElement(Vo,{"cmdk-overlay":"",className:s}),a.createElement(Ho,{"aria-label":e.label,"cmdk-dialog":"",className:i},a.createElement(hv,{ref:t,...c}))))}),wv=a.forwardRef((e,t)=>jv(e=>0===e.filtered.count)?a.createElement(Os.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Sv=a.forwardRef((e,t)=>{let{progress:r,children:n,label:s="Loading...",...i}=e;return a.createElement(Os.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Rv(e,e=>a.createElement("div",{"aria-hidden":!0},e)))}),kv=Object.assign(hv,{List:yv,Item:fv,Input:vv,Group:gv,Separator:bv,Dialog:xv,Empty:wv,Loading:Sv});function Ev(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function Cv(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function Nv(e){let t=a.useRef(e);return Av(()=>{t.current=e}),t}var Av="undefined"==typeof window?a.useEffect:a.useLayoutEffect;function _v(e){let t=a.useRef();return void 0===t.current&&(t.current=e()),t}function jv(e){let t=pv(),r=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,r,r)}function Pv(e,t,r,n=[]){let s=a.useRef(),i=uv();return Av(()=>{var a;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():s.current}})(),c=n.map(e=>e.trim());i.value(e,o,c),null==(a=t.current)||a.setAttribute(ov,o),s.current=o}),s}var Tv=()=>{let[e,t]=a.useState(),r=_v(()=>new Map);return Av(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function Rv({asChild:e,children:t},r){return e&&a.isValidElement(t)?a.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 Dv={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Iv=a.forwardRef(({className:t,...r},n)=>e.jsx(kv,{ref:n,className:Se("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...r}));Iv.displayName=kv.displayName;const Uv=a.forwardRef(({className:t,...r},n)=>e.jsxs("div",{className:"flex items-center border-b px-3","data-cmdk-input-wrapper":"",children:[e.jsx(rc,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(kv.Input,{ref:n,className:Se("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",t),...r})]}));Uv.displayName=kv.Input.displayName;const Mv=a.forwardRef(({className:t,...r},n)=>e.jsx(kv.List,{ref:n,className:Se("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...r}));Mv.displayName=kv.List.displayName;a.forwardRef((t,r)=>e.jsx(kv.Empty,{ref:r,className:"py-6 text-center text-sm",...t})).displayName=kv.Empty.displayName;const Ov=a.forwardRef(({className:t,...r},n)=>e.jsx(kv.Group,{ref:n,className:Se("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",t),...r}));Ov.displayName=kv.Group.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(kv.Separator,{ref:n,className:Se("-mx-1 h-px bg-border",t),...r})).displayName=kv.Separator.displayName;const Lv=a.forwardRef(({className:t,...r},n)=>e.jsx(kv.Item,{ref:n,className:Se("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",t),...r}));Lv.displayName=kv.Item.displayName;const zv=["top","right","bottom","left"],Fv=Math.min,Bv=Math.max,Wv=Math.round,Vv=Math.floor,Hv=e=>({x:e,y:e}),Gv={left:"right",right:"left",bottom:"top",top:"bottom"},$v={start:"end",end:"start"};function Kv(e,t,r){return Bv(e,Fv(t,r))}function qv(e,t){return"function"==typeof e?e(t):e}function Zv(e){return e.split("-")[0]}function Jv(e){return e.split("-")[1]}function Yv(e){return"x"===e?"y":"x"}function Xv(e){return"y"===e?"height":"width"}const Qv=new Set(["top","bottom"]);function ey(e){return Qv.has(Zv(e))?"y":"x"}function ty(e){return Yv(ey(e))}function ry(e){return e.replace(/start|end/g,e=>$v[e])}const ny=["left","right"],ay=["right","left"],sy=["top","bottom"],iy=["bottom","top"];function oy(e,t,r,n){const a=Jv(e);let s=function(e,t,r){switch(e){case"top":case"bottom":return r?t?ay:ny:t?ny:ay;case"left":case"right":return t?sy:iy;default:return[]}}(Zv(e),"start"===r,n);return a&&(s=s.map(e=>e+"-"+a),t&&(s=s.concat(s.map(ry)))),s}function cy(e){return e.replace(/left|right|bottom|top/g,e=>Gv[e])}function ly(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 uy(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 dy(e,t,r){let{reference:n,floating:a}=e;const s=ey(t),i=ty(t),o=Xv(i),c=Zv(t),l="y"===s,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(Jv(t)){case"start":m[i]-=p*(r&&l?-1:1);break;case"end":m[i]+=p*(r&&l?-1:1)}return m}async function py(e,t){var r;void 0===t&&(t={});const{x:n,y:a,platform:s,rects:i,elements:o,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:m=0}=qv(t,e),h=ly(m),f=o[p?"floating"===d?"reference":"floating":d],g=uy(await s.getClippingRect({element:null==(r=await(null==s.isElement?void 0:s.isElement(f)))||r?f:f.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(o.floating)),boundary:l,rootBoundary:u,strategy:c})),b="floating"===d?{x:n,y:a,width:i.floating.width,height:i.floating.height}:i.reference,v=await(null==s.getOffsetParent?void 0:s.getOffsetParent(o.floating)),y=await(null==s.isElement?void 0:s.isElement(v))&&await(null==s.getScale?void 0:s.getScale(v))||{x:1,y:1},x=uy(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:b,offsetParent:v,strategy:c}):b);return{top:(g.top-x.top+h.top)/y.y,bottom:(x.bottom-g.bottom+h.bottom)/y.y,left:(g.left-x.left+h.left)/y.x,right:(x.right-g.right+h.right)/y.x}}function my(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function hy(e){return zv.some(t=>e[t]>=0)}const fy=new Set(["left","top"]);function gy(){return"undefined"!=typeof window}function by(e){return xy(e)?(e.nodeName||"").toLowerCase():"#document"}function vy(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function yy(e){var t;return null==(t=(xy(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function xy(e){return!!gy()&&(e instanceof Node||e instanceof vy(e).Node)}function wy(e){return!!gy()&&(e instanceof Element||e instanceof vy(e).Element)}function Sy(e){return!!gy()&&(e instanceof HTMLElement||e instanceof vy(e).HTMLElement)}function ky(e){return!(!gy()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof vy(e).ShadowRoot)}const Ey=new Set(["inline","contents"]);function Cy(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=Oy(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Ey.has(a)}const Ny=new Set(["table","td","th"]);function Ay(e){return Ny.has(by(e))}const _y=[":popover-open",":modal"];function jy(e){return _y.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Py=["transform","translate","scale","rotate","perspective"],Ty=["transform","translate","scale","rotate","perspective","filter"],Ry=["paint","layout","strict","content"];function Dy(e){const t=Iy(),r=wy(e)?Oy(e):e;return Py.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||Ty.some(e=>(r.willChange||"").includes(e))||Ry.some(e=>(r.contain||"").includes(e))}function Iy(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Uy=new Set(["html","body","#document"]);function My(e){return Uy.has(by(e))}function Oy(e){return vy(e).getComputedStyle(e)}function Ly(e){return wy(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function zy(e){if("html"===by(e))return e;const t=e.assignedSlot||e.parentNode||ky(e)&&e.host||yy(e);return ky(t)?t.host:t}function Fy(e){const t=zy(e);return My(t)?e.ownerDocument?e.ownerDocument.body:e.body:Sy(t)&&Cy(t)?t:Fy(t)}function By(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const a=Fy(e),s=a===(null==(n=e.ownerDocument)?void 0:n.body),i=vy(a);if(s){const e=Wy(i);return t.concat(i,i.visualViewport||[],Cy(a)?a:[],e&&r?By(e):[])}return t.concat(a,By(a,[],r))}function Wy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vy(e){const t=Oy(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=Sy(e),s=a?e.offsetWidth:r,i=a?e.offsetHeight:n,o=Wv(r)!==s||Wv(n)!==i;return o&&(r=s,n=i),{width:r,height:n,$:o}}function Hy(e){return wy(e)?e:e.contextElement}function Gy(e){const t=Hy(e);if(!Sy(t))return Hv(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:s}=Vy(t);let i=(s?Wv(r.width):r.width)/n,o=(s?Wv(r.height):r.height)/a;return i&&Number.isFinite(i)||(i=1),o&&Number.isFinite(o)||(o=1),{x:i,y:o}}const $y=Hv(0);function Ky(e){const t=vy(e);return Iy()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:$y}function qy(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const a=e.getBoundingClientRect(),s=Hy(e);let i=Hv(1);t&&(n?wy(n)&&(i=Gy(n)):i=Gy(e));const o=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==vy(e))&&t}(s,r,n)?Ky(s):Hv(0);let c=(a.left+o.x)/i.x,l=(a.top+o.y)/i.y,u=a.width/i.x,d=a.height/i.y;if(s){const e=vy(s),t=n&&wy(n)?vy(n):n;let r=e,a=Wy(r);for(;a&&n&&t!==r;){const e=Gy(a),t=a.getBoundingClientRect(),n=Oy(a),s=t.left+(a.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(a.clientTop+parseFloat(n.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=s,l+=i,r=vy(a),a=Wy(r)}}return uy({width:u,height:d,x:c,y:l})}function Zy(e,t){const r=Ly(e).scrollLeft;return t?t.left+r:qy(yy(e)).left+r}function Jy(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-Zy(e,r),y:r.top+t.scrollTop}}const Yy=new Set(["absolute","fixed"]);function Xy(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=vy(e),n=yy(e),a=r.visualViewport;let s=n.clientWidth,i=n.clientHeight,o=0,c=0;if(a){s=a.width,i=a.height;const e=Iy();(!e||e&&"fixed"===t)&&(o=a.offsetLeft,c=a.offsetTop)}const l=Zy(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,i=Math.abs(n.clientWidth-t.clientWidth-a);i<=25&&(s-=i)}else l<=25&&(s+=l);return{width:s,height:i,x:o,y:c}}(e,r);else if("document"===t)n=function(e){const t=yy(e),r=Ly(e),n=e.ownerDocument.body,a=Bv(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=Bv(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Zy(e);const o=-r.scrollTop;return"rtl"===Oy(n).direction&&(i+=Bv(t.clientWidth,n.clientWidth)-a),{width:a,height:s,x:i,y:o}}(yy(e));else if(wy(t))n=function(e,t){const r=qy(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,s=Sy(e)?Gy(e):Hv(1);return{width:e.clientWidth*s.x,height:e.clientHeight*s.y,x:a*s.x,y:n*s.y}}(t,r);else{const r=Ky(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return uy(n)}function Qy(e,t){const r=zy(e);return!(r===t||!wy(r)||My(r))&&("fixed"===Oy(r).position||Qy(r,t))}function ex(e,t,r){const n=Sy(t),a=yy(t),s="fixed"===r,i=qy(e,!0,s,t);let o={scrollLeft:0,scrollTop:0};const c=Hv(0);function l(){c.x=Zy(a)}if(n||!n&&!s)if(("body"!==by(t)||Cy(a))&&(o=Ly(t)),n){const e=qy(t,!0,s,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else a&&l();s&&!n&&a&&l();const u=!a||n||s?Hv(0):Jy(a,o);return{x:i.left+o.scrollLeft-c.x-u.x,y:i.top+o.scrollTop-c.y-u.y,width:i.width,height:i.height}}function tx(e){return"static"===Oy(e).position}function rx(e,t){if(!Sy(e)||"fixed"===Oy(e).position)return null;if(t)return t(e);let r=e.offsetParent;return yy(e)===r&&(r=r.ownerDocument.body),r}function nx(e,t){const r=vy(e);if(jy(e))return r;if(!Sy(e)){let t=zy(e);for(;t&&!My(t);){if(wy(t)&&!tx(t))return t;t=zy(t)}return r}let n=rx(e,t);for(;n&&Ay(n)&&tx(n);)n=rx(n,t);return n&&My(n)&&tx(n)&&!Dy(n)?r:n||function(e){let t=zy(e);for(;Sy(t)&&!My(t);){if(Dy(t))return t;if(jy(t))return null;t=zy(t)}return null}(e)||r}const ax={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const s="fixed"===a,i=yy(n),o=!!t&&jy(t.floating);if(n===i||o&&s)return r;let c={scrollLeft:0,scrollTop:0},l=Hv(1);const u=Hv(0),d=Sy(n);if((d||!d&&!s)&&(("body"!==by(n)||Cy(i))&&(c=Ly(n)),Sy(n))){const e=qy(n);l=Gy(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}const p=!i||d||s?Hv(0):Jy(i,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:yy,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const s=[..."clippingAncestors"===r?jy(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=By(e,[],!1).filter(e=>wy(e)&&"body"!==by(e)),a=null;const s="fixed"===Oy(e).position;let i=s?zy(e):e;for(;wy(i)&&!My(i);){const t=Oy(i),r=Dy(i);r||"fixed"!==t.position||(a=null),(s?!r&&!a:!r&&"static"===t.position&&a&&Yy.has(a.position)||Cy(i)&&!r&&Qy(e,i))?n=n.filter(e=>e!==i):a=t,i=zy(i)}return t.set(e,n),n}(t,this._c):[].concat(r),n],i=s[0],o=s.reduce((e,r)=>{const n=Xy(t,r,a);return e.top=Bv(n.top,e.top),e.right=Fv(n.right,e.right),e.bottom=Fv(n.bottom,e.bottom),e.left=Bv(n.left,e.left),e},Xy(t,i,a));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:nx,getElementRects:async function(e){const t=this.getOffsetParent||nx,r=this.getDimensions,n=await r(e.floating);return{reference:ex(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}=Vy(e);return{width:t,height:r}},getScale:Gy,isElement:wy,isRTL:function(e){return"rtl"===Oy(e).direction}};function sx(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ix(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:o="function"==typeof IntersectionObserver,animationFrame:c=!1}=n,l=Hy(e),u=a||s?[...l?By(l):[],...By(t)]:[];u.forEach(e=>{a&&e.addEventListener("scroll",r,{passive:!0}),s&&e.addEventListener("resize",r)});const d=l&&o?function(e,t){let r,n=null;const a=yy(e);function s(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function i(o,c){void 0===o&&(o=!1),void 0===c&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:d,width:p,height:m}=l;if(o||t(),!p||!m)return;const h={rootMargin:-Vv(d)+"px "+-Vv(a.clientWidth-(u+p))+"px "+-Vv(a.clientHeight-(d+m))+"px "+-Vv(u)+"px",threshold:Bv(0,Fv(1,c))||1};let f=!0;function g(t){const n=t[0].intersectionRatio;if(n!==c){if(!f)return i();n?i(!1,n):r=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==n||sx(l,e.getBoundingClientRect())||i(),f=!1}try{n=new IntersectionObserver(g,{...h,root:a.ownerDocument})}catch(e){n=new IntersectionObserver(g,h)}n.observe(e)}(!0),s}(l,r):null;let p,m=-1,h=null;i&&(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?qy(e):null;return c&&function t(){const n=qy(e);f&&!sx(f,n)&&r();f=n,p=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach(e=>{a&&e.removeEventListener("scroll",r),s&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const ox=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:s,placement:i,middlewareData:o}=t,c=await async function(e,t){const{placement:r,platform:n,elements:a}=e,s=await(null==n.isRTL?void 0:n.isRTL(a.floating)),i=Zv(r),o=Jv(r),c="y"===ey(r),l=fy.has(i)?-1:1,u=s&&c?-1:1,d=qv(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 i===(null==(r=o.offset)?void 0:r.placement)&&null!=(n=o.arrow)&&n.alignmentOffset?{}:{x:a+c.x,y:s+c.y,data:{...c,placement:i}}}}},cx=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a,platform:s}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:c={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=qv(e,t),u={x:r,y:n},d=await s.detectOverflow(t,l),p=ey(Zv(a)),m=Yv(p);let h=u[m],f=u[p];if(i){const e="y"===m?"bottom":"right";h=Kv(h+d["y"===m?"top":"left"],h,h-d[e])}if(o){const e="y"===p?"bottom":"right";f=Kv(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]:i,[p]:o}}}}}},lx=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:s,rects:i,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}=qv(e,t);if(null!=(r=s.arrow)&&r.alignmentOffset)return{};const b=Zv(a),v=ey(o),y=Zv(o)===o,x=await(null==c.isRTL?void 0:c.isRTL(l.floating)),w=p||(y||!f?[cy(o)]:function(e){const t=cy(e);return[ry(e),t,ry(t)]}(o)),S="none"!==h;!p&&S&&w.push(...oy(o,f,h,x));const k=[o,...w],E=await c.detectOverflow(t,g),C=[];let N=(null==(n=s.flip)?void 0:n.overflows)||[];if(u&&C.push(E[b]),d){const e=function(e,t,r){void 0===r&&(r=!1);const n=Jv(e),a=ty(e),s=Xv(a);let i="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=cy(i)),[i,cy(i)]}(a,i,x);C.push(E[e[0]],E[e[1]])}if(N=[...N,{placement:a,overflows:C}],!C.every(e=>e<=0)){var A,_;const e=((null==(A=s.flip)?void 0:A.index)||0)+1,t=k[e];if(t){if(!("alignment"===d&&v!==ey(t))||N.every(e=>ey(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:N},reset:{placement:t}}}let r=null==(_=N.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 j;const e=null==(j=N.filter(e=>{if(S){const t=ey(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:j[0];e&&(r=e);break}case"initialPlacement":r=o}if(a!==r)return{reset:{placement:r}}}return{}}}},ux=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:s,platform:i,elements:o}=t,{apply:c=()=>{},...l}=qv(e,t),u=await i.detectOverflow(t,l),d=Zv(a),p=Jv(a),m="y"===ey(a),{width:h,height:f}=s.floating;let g,b;"top"===d||"bottom"===d?(g=d,b=p===(await(null==i.isRTL?void 0:i.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,x=Fv(f-u[g],v),w=Fv(h-u[b],y),S=!t.middlewareData.shift;let k=x,E=w;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=Bv(u.left,0),t=Bv(u.right,0),r=Bv(u.top,0),n=Bv(u.bottom,0);m?E=h-2*(0!==e||0!==t?e+t:Bv(u.left,u.right)):k=f-2*(0!==r||0!==n?r+n:Bv(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:k});const C=await i.getDimensions(o.floating);return h!==C.width||f!==C.height?{reset:{rects:!0}}:{}}}},dx=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:a="referenceHidden",...s}=qv(e,t);switch(a){case"referenceHidden":{const e=my(await n.detectOverflow(t,{...s,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:hy(e)}}}case"escaped":{const e=my(await n.detectOverflow(t,{...s,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:hy(e)}}}default:return{}}}}},px=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:s,platform:i,elements:o,middlewareData:c}=t,{element:l,padding:u=0}=qv(e,t)||{};if(null==l)return{};const d=ly(u),p={x:r,y:n},m=ty(a),h=Xv(m),f=await i.getDimensions(l),g="y"===m,b=g?"top":"left",v=g?"bottom":"right",y=g?"clientHeight":"clientWidth",x=s.reference[h]+s.reference[m]-p[m]-s.floating[h],w=p[m]-s.reference[m],S=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l));let k=S?S[y]:0;k&&await(null==i.isElement?void 0:i.isElement(S))||(k=o.floating[y]||s.floating[h]);const E=x/2-w/2,C=k/2-f[h]/2-1,N=Fv(d[b],C),A=Fv(d[v],C),_=N,j=k-f[h]-A,P=k/2-f[h]/2+E,T=Kv(_,P,j),R=!c.arrow&&null!=Jv(a)&&P!==T&&s.reference[h]/2-(P<_?N:A)-f[h]/2<0,D=R?P<_?P-_:P-j:0;return{[m]:p[m]+D,data:{[m]:T,centerOffset:P-T-D,...R&&{alignmentOffset:D}},reset:R}}}),mx=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:s,middlewareData:i}=t,{offset:o=0,mainAxis:c=!0,crossAxis:l=!0}=qv(e,t),u={x:r,y:n},d=ey(a),p=Yv(d);let m=u[p],h=u[d];const f=qv(o,t),g="number"==typeof f?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const e="y"===p?"height":"width",t=s.reference[p]-s.floating[e]+g.mainAxis,r=s.reference[p]+s.reference[e]-g.mainAxis;m<t?m=t:m>r&&(m=r)}if(l){var b,v;const e="y"===p?"width":"height",t=fy.has(Zv(a)),r=s.reference[d]-s.floating[e]+(t&&(null==(b=i.offset)?void 0:b[d])||0)+(t?0:g.crossAxis),n=s.reference[d]+s.reference[e]+(t?0:(null==(v=i.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);h<r?h=r:h>n&&(h=n)}return{[p]:m,[d]:h}}}},hx=(e,t,r)=>{const n=new Map,a={platform:ax,...r},s={...a.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:s=[],platform:i}=r,o=s.filter(Boolean),c=await(null==i.isRTL?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:d}=dy(l,n,c),p=n,m={},h=0;for(let r=0;r<o.length;r++){var f;const{name:s,fn:g}=o[r],{x:b,y:v,data:y,reset:x}=await g({x:u,y:d,initialPlacement:n,placement:p,strategy:a,middlewareData:m,rects:l,platform:{...i,detectOverflow:null!=(f=i.detectOverflow)?f:py},elements:{reference:e,floating:t}});u=null!=b?b:u,d=null!=v?v:d,m={...m,[s]:{...m[s],...y}},x&&h<=50&&(h++,"object"==typeof x&&(x.placement&&(p=x.placement),x.rects&&(l=!0===x.rects?await i.getElementRects({reference:e,floating:t,strategy:a}):x.rects),({x:u,y:d}=dy(l,p,c))),r=-1)}return{x:u,y:d,placement:p,strategy:a,middlewareData:m}})(e,t,{...a,platform:s})};var fx="undefined"!=typeof document?t.useLayoutEffect:function(){};function gx(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(!gx(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)&&!gx(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function bx(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vx(e,t){const r=bx(e);return Math.round(t*r)/r}function yx(e){const t=a.useRef(e);return fx(()=>{t.current=e}),t}const xx=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?px({element:r.current,padding:n}).fn(t):{}:r?px({element:r,padding:n}).fn(t):{};var a}}),wx=(e,t)=>({...ox(e),options:[e,t]}),Sx=(e,t)=>({...cx(e),options:[e,t]}),kx=(e,t)=>({...mx(e),options:[e,t]}),Ex=(e,t)=>({...lx(e),options:[e,t]}),Cx=(e,t)=>({...ux(e),options:[e,t]}),Nx=(e,t)=>({...dx(e),options:[e,t]}),Ax=(e,t)=>({...xx(e),options:[e,t]});var _x=a.forwardRef((t,r)=>{const{children:n,width:a=10,height:s=5,...i}=t;return e.jsx(Os.svg,{...i,ref:r,width:a,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});_x.displayName="Arrow";var jx=_x,Px="Popper",[Tx,Rx]=Ns(Px),[Dx,Ix]=Tx(Px),Ux=t=>{const{__scopePopper:r,children:n}=t,[s,i]=a.useState(null);return e.jsx(Dx,{scope:r,anchor:s,onAnchorChange:i,children:n})};Ux.displayName=Px;var Mx="PopperAnchor",Ox=a.forwardRef((t,r)=>{const{__scopePopper:n,virtualRef:s,...i}=t,o=Ix(Mx,n),c=a.useRef(null),l=ds(r,c),u=a.useRef(null);return a.useEffect(()=>{const e=u.current;u.current=s?.current||c.current,e!==u.current&&o.onAnchorChange(u.current)}),s?null:e.jsx(Os.div,{...i,ref:l})});Ox.displayName=Mx;var Lx="PopperContent",[zx,Fx]=Tx(Lx),Bx=a.forwardRef((t,r)=>{const{__scopePopper:n,side:i="bottom",sideOffset:o=0,align:c="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:p=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:b,...v}=t,y=Ix(Lx,n),[x,w]=a.useState(null),S=ds(r,e=>w(e)),[k,E]=a.useState(null),C=Cl(k),N=C?.width??0,A=C?.height??0,_=i+("center"!==c?"-"+c:""),j="number"==typeof m?m:{top:0,right:0,bottom:0,left:0,...m},P=Array.isArray(p)?p:[p],T=P.length>0,R={padding:j,boundary:P.filter(Gx),altBoundary:T},{refs:D,floatingStyles:I,placement:U,isPositioned:M,middlewareData:O}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:o,floating:c}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[p,m]=a.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=a.useState(n);gx(h,n)||f(n);const[g,b]=a.useState(null),[v,y]=a.useState(null),x=a.useCallback(e=>{e!==E.current&&(E.current=e,b(e))},[]),w=a.useCallback(e=>{e!==C.current&&(C.current=e,y(e))},[]),S=o||g,k=c||v,E=a.useRef(null),C=a.useRef(null),N=a.useRef(p),A=null!=u,_=yx(u),j=yx(i),P=yx(d),T=a.useCallback(()=>{if(!E.current||!C.current)return;const e={placement:t,strategy:r,middleware:h};j.current&&(e.platform=j.current),hx(E.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};R.current&&!gx(N.current,t)&&(N.current=t,s.flushSync(()=>{m(t)}))})},[h,t,r,j,P]);fx(()=>{!1===d&&N.current.isPositioned&&(N.current.isPositioned=!1,m(e=>({...e,isPositioned:!1})))},[d]);const R=a.useRef(!1);fx(()=>(R.current=!0,()=>{R.current=!1}),[]),fx(()=>{if(S&&(E.current=S),k&&(C.current=k),S&&k){if(_.current)return _.current(S,k,T);T()}},[S,k,T,_,A]);const D=a.useMemo(()=>({reference:E,floating:C,setReference:x,setFloating:w}),[x,w]),I=a.useMemo(()=>({reference:S,floating:k}),[S,k]),U=a.useMemo(()=>{const e={position:r,left:0,top:0};if(!I.floating)return e;const t=vx(I.floating,p.x),n=vx(I.floating,p.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...bx(I.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,I.floating,p.x,p.y]);return a.useMemo(()=>({...p,update:T,refs:D,elements:I,floatingStyles:U}),[p,T,D,I,U])}({strategy:"fixed",placement:_,whileElementsMounted:(...e)=>ix(...e,{animationFrame:"always"===g}),elements:{reference:y.anchor},middleware:[wx({mainAxis:o+A,alignmentAxis:l}),d&&Sx({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?kx():void 0,...R}),d&&Ex({...R}),Cx({...R,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:a,height:s}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${r}px`),i.setProperty("--radix-popper-available-height",`${n}px`),i.setProperty("--radix-popper-anchor-width",`${a}px`),i.setProperty("--radix-popper-anchor-height",`${s}px`)}}),k&&Ax({element:k,padding:u}),$x({arrowWidth:N,arrowHeight:A}),f&&Nx({strategy:"referenceHidden",...R})]}),[L,z]=Kx(U),F=Ls(b);_s(()=>{M&&F?.()},[M,F]);const B=O.arrow?.x,W=O.arrow?.y,V=0!==O.arrow?.centerOffset,[H,G]=a.useState();return _s(()=>{x&&G(window.getComputedStyle(x).zIndex)},[x]),e.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:M?I.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:t.dir,children:e.jsx(zx,{scope:n,placedSide:L,onArrowChange:E,arrowX:B,arrowY:W,shouldHideArrow:V,children:e.jsx(Os.div,{"data-side":L,"data-align":z,...v,ref:S,style:{...v.style,animation:M?void 0:"none"}})})})});Bx.displayName=Lx;var Wx="PopperArrow",Vx={top:"bottom",right:"left",bottom:"top",left:"right"},Hx=a.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,s=Fx(Wx,n),i=Vx[s.placedSide];return e.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:e.jsx(jx,{...a,ref:r,style:{...a.style,display:"block"}})})});function Gx(e){return null!==e}Hx.displayName=Wx;var $x=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:a}=t,s=0!==a.arrow?.centerOffset,i=s?0:e.arrowWidth,o=s?0:e.arrowHeight,[c,l]=Kx(r),u={start:"0%",center:"50%",end:"100%"}[l],d=(a.arrow?.x??0)+i/2,p=(a.arrow?.y??0)+o/2;let m="",h="";return"bottom"===c?(m=s?u:`${d}px`,h=-o+"px"):"top"===c?(m=s?u:`${d}px`,h=`${n.floating.height+o}px`):"right"===c?(m=-o+"px",h=s?u:`${p}px`):"left"===c&&(m=`${n.floating.width+o}px`,h=s?u:`${p}px`),{data:{x:m,y:h}}}});function Kx(e){const[t,r="center"]=e.split("-");return[t,r]}var qx=Ux,Zx=Ox,Jx=Bx,Yx=Hx;function Xx(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.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),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?us(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qx=Symbol("radix.slottable");function ew(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Qx}var tw="Popover",[rw]=Ns(tw,[Rx]),nw=Rx(),[aw,sw]=rw(tw),iw=t=>{const{__scopePopover:r,children:n,open:s,defaultOpen:i,onOpenChange:o,modal:c=!1}=t,l=nw(r),u=a.useRef(null),[d,p]=a.useState(!1),[m,h]=Ds({prop:s,defaultProp:i??!1,onChange:o,caller:tw});return e.jsx(qx,{...l,children:e.jsx(aw,{scope:r,contentId:Ts(),triggerRef:u,open:m,onOpenChange:h,onOpenToggle:a.useCallback(()=>h(e=>!e),[h]),hasCustomAnchor:d,onCustomAnchorAdd:a.useCallback(()=>p(!0),[]),onCustomAnchorRemove:a.useCallback(()=>p(!1),[]),modal:c,children:n})})};iw.displayName=tw;var ow="PopoverAnchor";a.forwardRef((t,r)=>{const{__scopePopover:n,...s}=t,i=sw(ow,n),o=nw(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=i;return a.useEffect(()=>(c(),()=>l()),[c,l]),e.jsx(Zx,{...o,...s,ref:r})}).displayName=ow;var cw="PopoverTrigger",lw=a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=sw(cw,n),i=nw(n),o=ds(r,s.triggerRef),c=e.jsx(Os.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":ww(s.open),...a,ref:o,onClick:Cs(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:e.jsx(Zx,{asChild:!0,...i,children:c})});lw.displayName=cw;var uw="PopoverPortal",[dw,pw]=rw(uw,{forceMount:void 0}),mw=t=>{const{__scopePopover:r,forceMount:n,children:a,container:s}=t,i=sw(uw,r);return e.jsx(dw,{scope:r,forceMount:n,children:e.jsx(ai,{present:n||i.open,children:e.jsx(ni,{asChild:!0,container:s,children:a})})})};mw.displayName=uw;var hw="PopoverContent",fw=a.forwardRef((t,r)=>{const n=pw(hw,t.__scopePopover),{forceMount:a=n.forceMount,...s}=t,i=sw(hw,t.__scopePopover);return e.jsx(ai,{present:a||i.open,children:i.modal?e.jsx(bw,{...s,ref:r}):e.jsx(vw,{...s,ref:r})})});fw.displayName=hw;var gw=function(t){const r=Xx(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(ew);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}("PopoverContent.RemoveScroll"),bw=a.forwardRef((t,r)=>{const n=sw(hw,t.__scopePopover),s=a.useRef(null),i=ds(r,s),o=a.useRef(!1);return a.useEffect(()=>{const e=s.current;if(e)return ro(e)},[]),e.jsx(Zi,{as:gw,allowPinchZoom:!0,children:e.jsx(yw,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Cs(t.onCloseAutoFocus,e=>{e.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Cs(t.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:Cs(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),vw=a.forwardRef((t,r)=>{const n=sw(hw,t.__scopePopover),s=a.useRef(!1),i=a.useRef(!1);return e.jsx(yw,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(s.current||n.triggerRef.current?.focus(),e.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(s.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const r=e.target,a=n.triggerRef.current?.contains(r);a&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),yw=a.forwardRef((t,r)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...p}=t,m=sw(hw,n),h=nw(n);return oi(),e.jsx(Js,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:i,children:e.jsx(Hs,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:e.jsx(Jx,{"data-state":ww(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)"}})})})}),xw="PopoverClose";a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=sw(xw,n);return e.jsx(Os.button,{type:"button",...a,ref:r,onClick:Cs(t.onClick,()=>s.onOpenChange(!1))})}).displayName=xw;function ww(e){return e?"open":"closed"}a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=nw(n);return e.jsx(Yx,{...s,...a,ref:r})}).displayName="PopoverArrow";var Sw=mw,kw=fw;const Ew=iw,Cw=lw,Nw=a.forwardRef(({className:t,align:r="center",sideOffset:n=4,...s},i)=>{const{container:o}=a.useContext(nc);return e.jsx(Sw,{container:o,children:e.jsx(kw,{ref:i,align:r,sideOffset:n,className:Se("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",t),...s})})});function Aw({options:r,value:n,onChange:a,placeholder:s="Search...",emptyLabel:i="Choose option"}){const[o,c]=t.useState(n??""),[l,u]=t.useState(!1);t.useEffect(()=>{void 0!==n&&c(n)},[n]);const d=r.find(e=>e.value===o);return e.jsxs(Ew,{open:l,onOpenChange:u,children:[e.jsx(Cw,{asChild:!0,children:e.jsxs(Es,{variant:"outline",role:"combobox","aria-expanded":l,className:"justify-between overflow-hidden text-ellipsis",children:[d?e.jsxs("div",{children:[String(d.label).trim(),d.icon&&e.jsx("span",{className:"ms-2 text-xs text-muted-foreground",children:d.icon})]}):e.jsx("span",{className:"text-muted-foreground",children:i}),e.jsx(Fa,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(Nw,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(Iv,{children:[e.jsx(Uv,{placeholder:s}),e.jsx(Mv,{children:e.jsx(Ov,{children:r.map(t=>e.jsxs(Lv,{className:Se("whitespace-nowrap text-start",{"text-green-500":o===t.value}),value:t.value,defaultValue:t.value,onSelect:()=>{return e=t.value,c(e),a?.(e),void u(!1);var e},children:[o===t.value&&e.jsx(za,{className:Se("me-2 h-4 w-4 text-green-400",o===t.value?"opacity-100":"opacity-0")}),String(t.label).trim(),t.icon&&e.jsx("span",{className:"ms-2 text-xs text-muted-foreground",children:t.icon})]},t.value))})})]})})]})}Nw.displayName=kw.displayName;const _w={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"},jw={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"},Pw=[{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=jw[e.code]||"USD",r=_w[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 Tw({value:t,onChange:r}){const{t:n}=sn(),a=Pw.map(e=>({value:e.value,label:e.text,icon:e.flag}));return e.jsx(Aw,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchCountry"),emptyLabel:n("dropdowns.chooseCountry")})}const Rw=Pw.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),Dw=Array.from(new Set(Rw.map(e=>e.value))).map(e=>Rw.find(t=>t.value===e)).filter(e=>void 0!==e);function Iw({value:t,onChange:r}){const{t:n}=sn(),a=Dw.map(e=>({value:e.value,label:e.text,icon:e.icon??void 0}));return e.jsx(Aw,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchCurrency"),emptyLabel:n("dropdowns.chooseCurrency")})}let Uw=[{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:"🇮🇱"}];Uw=Uw.filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)),Uw.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const Mw=Uw.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 Ow({value:t,onChange:r}){const{t:n}=sn(),a=Mw.map(e=>({value:e.value,label:e.label,icon:e.flag}));return e.jsx(Aw,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchLanguage"),emptyLabel:n("dropdowns.chooseLanguage")})}const Lw=[{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],s=t.text;let i=s.substring(s.indexOf("(")+1,s.indexOf(")"));-1!==i.indexOf("UTC")&&e.push({value:a,abbr:t.abbr,offset:t.offset,isdst:t.isdst,text:`(${i}) ${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 zw({value:t,onChange:r}){const{t:n}=sn(),a=Lw.map(e=>({value:e.value,label:e.text}));return e.jsx(Aw,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchTimezone"),emptyLabel:n("dropdowns.chooseTimezone")})}const Fw=({workspace:r})=>{const{t:n}=sn(),{updateUserProfile:a,getProfile:s}=Mk(),[i,o]=t.useState(!1),[c,l]=t.useState(),[u,d]=t.useState(0),[p,m]=t.useState(null),h=t.useRef(null);t.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const f=ud({resolver:vh(bf({name:Vh().min(2,{message:n("profile.nameMinLength")}),country:Vh().optional(),timezone:Vh().optional(),language:Vh().optional(),currency:Vh().optional()})),defaultValues:{name:c?.name||"",country:c?.country||"",timezone:c?.timezone||"",language:c?.language||"",currency:c?.currency||""}});return t.useEffect(()=>{s().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)})},[u]),c?e.jsxs("div",{children:[p&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:n("settings.common.success")}),e.jsx("p",{className:"text-sm",children:p})]}),e.jsx("div",{className:"space-y-4",children:e.jsx(Hf,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){o(!0),m(null);try{await a({name:e.name,country:e.country,timezone:e.timezone,language:e.language,currency:e.currency}),m(n("profile.success")),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{m(null)},5e3)}catch(e){Re(e,{component:"WorkspaceSettingsProfile",action:"updateUserProfile",metadata:{workspaceId:r._id}})}finally{o(!1)}}),className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:n("profile.email")}),e.jsx(eg,{disabled:!0,className:"w-full border rounded px-3 py-2 bg-gray-100",value:c?.email})]}),e.jsx($f,{disabled:i,control:f.control,name:"name",render:({field:t})=>e.jsxs(Zf,{children:[e.jsx(Jf,{children:n("profile.name")}),e.jsx(Yf,{children:e.jsx(eg,{...t})}),e.jsx(Qf,{})]})}),e.jsxs("div",{className:"flex gap-y-2 my-4 flex-col",children:[e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:n("profile.language")}),e.jsx(Ow,{value:f.watch("language"),onChange:e=>{f.setValue("language",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:n("profile.country")}),e.jsx(Tw,{value:f.watch("country"),onChange:e=>{f.setValue("country",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:n("profile.currency")}),e.jsx(Iw,{value:f.watch("currency"),onChange:e=>{f.setValue("currency",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:n("profile.timezone")}),e.jsx(zw,{value:f.watch("timezone"),onChange:e=>{f.setValue("timezone",e)}})]})]}),e.jsxs("div",{className:"flex justify-end gap-x-2",children:[e.jsx(Es,{type:"submit",progress:i,disabled:i,children:n("profile.save")}),e.jsx(Es,{type:"button",variant:"outline",onClick:()=>{d(e=>e+1)},disabled:i,children:n("profile.reset")})]})]})})}),c?.image&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:n("profile.profileImage")}),e.jsx("div",{className:"w-16 h-16 rounded-full overflow-hidden",children:e.jsx("img",{src:c.image,alt:c.name,className:"w-full h-full object-cover"})})]})]}):e.jsx(Sl,{})};function Bw(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 Ww(e,t,r={}){if(null==e)return null;const{overageInCents:n=!0,currency:a,locale:s="en"}=r,{included:i,overage:o}=e;if(!(!1!==e.allowOverage))return{included:i,hasOverage:!1,allowOverage:!1,price:"",unit:""};if(null==o)return{included:i,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(s,{style:"currency",currency:l,minimumFractionDigits:2}).format(c)}catch{u=`${r.currencySymbol??Lf(a??"")}${c.toFixed(2)}`}else{u=`${r.currencySymbol??Lf(a??"")}${"number"==typeof c?c.toFixed(2):String(o)}`}return{included:i,hasOverage:!0,allowOverage:!0,price:u,unit:t&&"unitSize"in e&&null!=e.unitSize&&e.unitSize>0?`${e.unitSize.toLocaleString(s)} ${t}`:t||""}}const Vw="bb";function Hw(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(Vw,function(e){return Object.entries(e).filter(([,e])=>null!=e&&""!==e).map(([e,t])=>`${encodeURIComponent(e)}:${encodeURIComponent(t)}`).join(",")}(e)),r.toString()}function Gw(){if("undefined"==typeof window)return null;try{const e=new URLSearchParams(window.location.search).get(Vw);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 $w(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.has(Vw)&&(e.searchParams.delete(Vw),window.history.replaceState({},"",e.toString()))}catch{}}const Kw="personal",qw=(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)},Zw=(e,t="en-US")=>e?new Date(1e3*e).toLocaleDateString(t,{year:"numeric",month:"short",day:"numeric"}):"",Jw=e=>{switch(e){case Qn:return"bg-green-100 text-green-800";case Xn:return"bg-yellow-100 text-yellow-800";case Yn:return"bg-gray-100 text-gray-800";case ea:return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}},Yw=({workspaceId:t,hasActiveSubscription:r=!1,onViewPricingPlans:n,limit:a=20})=>{const{t:s,formattingLocale:i}=sn(),{invoices:o,loading:c,error:l,refetch:u}=In(t,a),d=o.length>0;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:s("invoices.title")}),e.jsx("p",{className:"text-sm text-gray-600",children:s("invoices.description")})]}),e.jsx(Es,{variant:"ghost",size:"sm",progress:c,onClick:u,disabled:c,children:s("settings.common.refreshAction",{loading:String(c)})})]}),l&&e.jsxs("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.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s("invoices.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:l})]}),e.jsx(Es,{variant:"outline",size:"sm",onClick:u,disabled:c,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:s("settings.common.retryAction",{loading:String(c)})})]}),c&&!d?e.jsx("div",{className:"border rounded-lg p-6",children:e.jsx(Sl,{})}):d?e.jsx("div",{className:"space-y-2",children:o.map(t=>{const r=(e=>{switch(e.status){case Yn:case Xn:return{textKey:"invoices.pay",color:"bg-blue-600 hover:bg-blue-700"};case Qn:return{textKey:"invoices.view",color:"bg-green-600 hover:bg-green-700"};case ea:case ta: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"}}})(t);return e.jsxs("div",{className:"border rounded-lg bg-white hover:shadow-sm transition-shadow p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[e.jsx("span",{className:"text-sm font-medium text-gray-900 truncate min-w-0",children:t.description||t.number||t.id.slice(-8)}),e.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium shrink-0 ${Jw(t.status)}`,children:s(`invoices.status.${t.status}`)})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-0.5 text-sm text-gray-600 mb-2.5",children:[e.jsx("span",{className:"font-medium text-gray-900",children:qw(t.amount_due,t.currency,i)}),t.created&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-300 hidden sm:inline",children:"·"}),e.jsx("span",{children:Zw(t.created,i)})]}),t.amount_paid>0&&t.amount_due>0&&e.jsx("span",{className:"text-xs text-gray-500",children:s("invoices.paidAmount",{amount:qw(t.amount_paid,t.currency,i)})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(Es,{size:"sm",disabled:!t.hosted_invoice_url,onClick:()=>t.hosted_invoice_url&&window.open(t.hosted_invoice_url,"_blank","noopener,noreferrer"),className:r.color,children:[s(r.textKey),e.jsx(Va,{className:"h-3 w-3 ms-1.5"})]}),t.invoice_pdf&&e.jsxs(Es,{size:"sm",variant:"outline",onClick:()=>window.open(t.invoice_pdf,"_blank","noopener,noreferrer"),children:[e.jsx(Wa,{className:"h-3 w-3 me-1.5"}),s("invoices.download")]})]})]},t.id)})}):e.jsxs("div",{className:"border rounded-lg p-6 text-center",children:[e.jsx(Ha,{className:"h-12 w-12 mx-auto text-gray-400 mb-3"}),e.jsx("p",{className:"text-sm text-gray-500",children:s(r?"invoices.noInvoicesWithSub":"invoices.noInvoices")}),!r&&n&&e.jsx(Es,{size:"sm",className:"mt-4",onClick:n,children:s("subscription.viewPricingPlans")})]})]})},Xw=t.lazy(()=>Promise.resolve().then(function(){return bC}).then(e=>({default:e.default}))),Qw=(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""}},eS=({workspace:r})=>{const n=r._id?.toString(),{t:a,formattingLocale:s,fmtNum:i,fmtCents:o}=sn(),{api:c}=Cn(),{can:l}=xl(),{settings:u}=En(),d=l(al.WORKSPACE_BILLING_VIEW),p=l(al.WORKSPACE_BILLING_MANAGE),m=u?.workspace?.mode===Kw,{subscription:h,loading:f,error:g,updateSubscription:b,refetch:v}=Dn(n),{createCheckoutSession:y}=Tn(n),{cancelSubscription:x,loading:w}=Mn(n),{resumeSubscription:S,loading:k}=On(n),{openBillingPortal:E,loading:C}=Un(n),{versions:N,loading:A,error:_,refetch:j}=Pn(n),P=f||A,T=g||_,{currentVersion:R,latestVersion:D,isDeprecated:I,plansToShow:U}=t.useMemo(()=>{const e=N?.currentVersion,t=N?.availableVersions||[],r=null!=h?.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:[]}},[N,h?.subscription]),[M,O]=t.useState(!1),[L,z]=t.useState(null),[F,B]=t.useState(null),W=t.useRef(null),[V,H]=t.useState(!1),[G,$]=t.useState(!1),K=t.useRef(void 0),q=t.useRef(!1);t.useEffect(()=>{if(q.current)return;if(f||!U||0===U.length)return;const e=Uk.getState(),t="selectPlan"===e.params?.action;h?.subscription&&!t||(q.current=!0,t&&(K.current=e.params,Uk.clearParams()),H(!0))},[f,h?.subscription,U]),t.useEffect(()=>()=>{W.current&&clearTimeout(W.current)},[]);const[Z,J]=t.useState(!1),[Y,X]=t.useState("subscription"),Q=async()=>{await Promise.all([v(),j()])},ee=t.useMemo(()=>pa(h?.subscription?.stripePriceId,U??[]),[h?.subscription?.stripePriceId,U]),te=async()=>{if(n){$(!1),O(!0),z(null),B(null);try{await x(),B(a("subscription.cancelSuccess")),await Q()}catch(e){const t=e instanceof Error?e.message:a("subscription.errorCanceling");z(t)}finally{O(!1),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{z(null),B(null)},5e3)}}};if(P&&!h&&!N)return e.jsx(Sl,{});if(!d)return null;const re=h?.planVersion?._id||null;return n?e.jsxs("div",{className:"space-y-6",children:[T&&e.jsxs("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.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:a("subscription.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:T}),e.jsx("p",{className:"text-xs mt-2 text-red-600",children:a("subscription.errorLoadingDescription")})]}),e.jsx(Es,{variant:"outline",size:"sm",onClick:Q,disabled:P,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:a("settings.common.retryAction",{loading:String(P)})})]}),L&&e.jsxs("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.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:a("subscription.updateFailed")}),e.jsx("p",{className:"text-sm mt-1",children:L})]}),e.jsx(Es,{variant:"outline",size:"sm",onClick:()=>z(null),className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:a("settings.common.dismiss")})]}),F&&e.jsxs("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.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:a("settings.common.success")}),e.jsx("p",{className:"text-sm mt-1",children:F})]}),e.jsx(Es,{variant:"outline",size:"sm",onClick:()=>B(null),className:"flex-shrink-0 border-green-200 text-green-700 hover:bg-green-100",children:a("settings.common.dismiss")})]}),e.jsx("div",{className:"border-b border-gray-200",children:e.jsxs("nav",{className:"-mb-px flex gap-6","aria-label":"Subscription tabs",children:[e.jsx("button",{type:"button",onClick:()=>X("subscription"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("subscription"===Y?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:a("subscription.plan")}),e.jsx("button",{type:"button",onClick:()=>X("invoices"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("invoices"===Y?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:a("subscription.invoicesTab")})]})}),"subscription"===Y&&e.jsxs(e.Fragment,{children:[P&&e.jsxs("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:[e.jsx($a,{className:"h-4 w-4 animate-spin flex-shrink-0"}),e.jsx("span",{children:a("settings.common.loading")})]}),I&&h?.subscription&&e.jsxs("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.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(is,{className:"h-4 w-4 text-amber-600 shrink-0"}),e.jsxs("span",{className:"text-sm text-amber-800",children:[e.jsx("span",{className:"font-medium",children:a("subscription.planUpdateAvailable")}),e.jsxs("span",{className:"text-amber-600",children:[" ","— v",R?.version||"?"," → v",D?.version||"?"]})]})]}),e.jsx(Es,{size:"sm",variant:"outline",className:"shrink-0 border-amber-300 text-amber-700 hover:bg-amber-100",onClick:()=>H(!0),children:a("subscription.viewPlans")})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{children:e.jsx("p",{className:"text-sm text-gray-600",children:a("subscription.managePlan")})}),e.jsxs("div",{className:"flex items-center gap-2",children:[(()=>{const t=h?.subscription?.subscriptionStatus===qn,r=h?.subscription?.cancelAtPeriodEnd;return r||w?null:t&&U&&U.length>0?e.jsx(Es,{size:"sm",onClick:()=>H(!0),children:a("subscription.viewPricingPlans")}):h?.subscription&&!t&&p?e.jsx(Es,{variant:"outline",size:"sm",onClick:()=>H(!0),children:a("subscription.changePlanButton")}):!h?.subscription&&U&&U.length>0?e.jsx(Es,{size:"sm",onClick:()=>H(!0),children:a("subscription.viewPricingPlans")}):null})(),e.jsx(Es,{variant:"ghost",size:"sm",progress:P,onClick:Q,disabled:P||M,children:a("settings.common.refreshAction",{loading:String(P)})})]})]}),h?.subscription?(()=>{const t=pa(h.subscription.stripePriceId,U??[]),n=t?.interval??null,c=t?.currency??h.plan?.currency??r?.billingCurrency??"",l=n&&h.planVersion?la(h.planVersion,c,n):null,u=c,d=h.planVersion?ma(h.planVersion,c):null,f=d&&n?ha(h.planVersion,c,n):null,g=Array.isArray(r?.users)?r.users.length:1,b=d?.includedSeats??0,v=Math.max(0,g-b),y=!!h.plan?.isFreemium,x=null!=l?0===l?a("subscription.free"):o(l,u):y?a("subscription.free"):null,S=n===Gn.Monthly?a("subscription.billingInterval.perMonth"):n===Gn.Quarterly?a("subscription.billingInterval.perQuarter"):n===Gn.Yearly?a("subscription.billingInterval.perYear"):"";return e.jsxs("div",{className:"border rounded-lg overflow-hidden "+(I?"border-amber-300":"border-gray-200"),children:[h.subscription.subscriptionStatus===Kn&&!h.subscription.cancelAtPeriodEnd&&(()=>{const t=h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd,r=t?new Date(t):null,n=r&&!isNaN(r.getTime())?r:null,s=n?Math.max(0,Math.ceil((n.getTime()-Date.now())/864e5)):null,i=null!==s&&s<=3;return e.jsxs("div",{className:"px-4 py-3 sm:px-5 text-sm flex flex-col sm:flex-row sm:items-center justify-between gap-2 "+(i?"bg-amber-50 text-amber-800 border-b border-amber-200":"bg-blue-50 text-blue-800 border-b border-blue-200"),children:[e.jsxs("span",{children:[null!==s&&s<=0?a("subscription.trialEnded"):null!==s?a("subscription.trialEndsIn",{days:s}):a("subscription.onTrial")," ",a("subscription.upgradeToKeepAccess")]}),e.jsx(Es,{size:"sm",variant:i?"default":"outline",className:"shrink-0 "+(i?"":"border-blue-300 text-blue-700 hover:bg-blue-100"),onClick:()=>H(!0),children:a("subscription.upgradePlan")})]})})(),e.jsxs("div",{className:"p-4 sm:p-5 "+(I?"bg-amber-50/50":"bg-gray-50/50"),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:h.plan?.name||a("subscription.noPlanAssigned")}),e.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium "+(h.subscription.subscriptionStatus===$n?h.subscription.cancelAtPeriodEnd?"bg-amber-100 text-amber-800":"bg-green-100 text-green-800":h.subscription.subscriptionStatus===Kn?"bg-blue-100 text-blue-800":h.subscription.subscriptionStatus===qn?"bg-gray-100 text-gray-800":"bg-red-100 text-red-800"),children:[h.subscription.subscriptionStatus===$n&&(h.subscription.cancelAtPeriodEnd?a("subscription.status.canceling"):a("subscription.status.active")),h.subscription.subscriptionStatus===Kn&&a("subscription.status.trial"),h.subscription.subscriptionStatus===qn&&a("subscription.status.canceled"),h.subscription.subscriptionStatus===Zn&&a("subscription.status.pastDue")]}),h.subscription.subscriptionStatus===Kn&&Qw(s,h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd)&&e.jsxs("span",{className:"text-xs text-gray-500",children:["(ends"," ",Qw(s,h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd),")"]}),I&&e.jsxs("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:[e.jsx(is,{className:"h-3 w-3"}),a("subscription.status.deprecated")]})]}),h.plan?.description&&e.jsx("p",{className:"text-sm text-gray-600 mb-3",children:h.plan.description}),!y&&e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 sm:gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline gap-1 whitespace-nowrap",children:[e.jsx("span",{className:"text-2xl font-bold text-gray-900",children:x||a("invoices.na")}),x&&x!==a("subscription.free")&&S&&e.jsx("span",{className:"text-sm text-gray-500",children:S})]}),d&&f&&f>0&&!m&&e.jsx("div",{className:"text-xs text-gray-500 mt-1",children:a("subscription.perSeatDisplay",{price:o(f,u),interval:S})}),!m&&d&&f&&f>0&&v>0&&x&&x!==a("subscription.free")&&null!=l&&e.jsx("div",{className:"text-xs text-gray-500 mt-1 pt-1 border-t border-gray-200",children:a("subscription.estTotalDisplay",{total:o(l+f*v,u),interval:S,count:v})})]}),(h.subscription.subscriptionStatus===$n||h.subscription.subscriptionStatus===Kn)&&!h.subscription.cancelAtPeriodEnd&&Qw(s,h.subscription.stripeCurrentPeriodEnd)&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[e.jsx(Oa,{className:"h-3.5 w-3.5 flex-shrink-0"}),e.jsx("span",{children:a("subscription.nextBillingDisplay",{date:Qw(s,h.subscription.stripeCurrentPeriodEnd)??""})})]})]}),I&&e.jsxs("p",{className:"text-xs text-amber-600 mt-2",children:["Version ",R?.version||a("invoices.na")]}),!y&&(h.subscription.subscriptionStatus===$n||h.subscription.subscriptionStatus===Kn||h.subscription.subscriptionStatus===Zn)&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3 mt-4 pt-4 border-t border-gray-200",children:[h.subscription&&p&&h.subscription.subscriptionId&&e.jsx(Es,{variant:"outline",size:"sm",onClick:()=>E(),disabled:C,progress:C,children:a(C?"subscription.openingPortal":"subscription.managePayment")}),p&&h.subscription.subscriptionId&&(h.subscription.subscriptionStatus===$n||h.subscription.subscriptionStatus===Kn)&&e.jsx(e.Fragment,{children:h.subscription.cancelAtPeriodEnd?e.jsx(Es,{variant:"outline",size:"sm",onClick:()=>J(!0),disabled:M||w||k,progress:k,children:h.subscription.subscriptionStatus===Kn?a("subscription.resumeTrial"):a("subscription.resumeTitle")}):e.jsx(Es,{variant:"outline",size:"sm",className:"text-red-600 hover:text-red-700 hover:bg-red-50 border-red-200",onClick:()=>$(!0),disabled:M||w||k,progress:w||M,children:w||M?a("subscription.canceling"):h.subscription.subscriptionStatus===Kn?a("subscription.cancelTrial"):a("subscription.cancelTitle")})})]})]}),h.subscription.subscriptionStatus===Zn&&e.jsx("div",{className:"px-5 py-3 bg-red-50 border-t border-red-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(is,{className:"h-5 w-5 text-red-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-800",children:a("subscription.paymentPastDue")}),e.jsx("p",{className:"text-sm text-red-700 mt-0.5",children:a("subscription.paymentPastDueDescription")}),e.jsx(Es,{variant:"outline",size:"sm",className:"mt-2 border-red-200 text-red-700 hover:bg-red-100",onClick:()=>X("invoices"),children:a("subscription.viewInvoices")})]})]})}),h.subscription.subscriptionStatus===Zn&&h.subscription.dunningState&&h.subscription.dunningState!==sa&&e.jsx("div",{className:"px-5 py-3 bg-red-50 border-t border-red-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(is,{className:"h-5 w-5 text-red-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-800",children:h.subscription.dunningState===ia?a("subscription.dunningFinal"):h.subscription.dunningState===oa?a("subscription.dunningSuspended"):a("subscription.dunningRecovery")}),e.jsx("p",{className:"text-sm text-red-700 mt-0.5",children:h.subscription.dunningState===oa?a("subscription.dunningSuspendedDescription"):a("subscription.dunningRecoveryDescription")})]})]})}),h.subscription.subscriptionStatus===Jn&&e.jsx("div",{className:"px-5 py-3 bg-blue-50 border-t border-blue-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Oa,{className:"h-5 w-5 text-blue-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-blue-800",children:a("subscription.subscriptionPaused")}),e.jsx("p",{className:"text-sm text-blue-700 mt-0.5",children:a("subscription.subscriptionPausedDescription")})]})]})}),h.subscription.cancelAtPeriodEnd&&e.jsx("div",{className:"px-5 py-3 bg-amber-50 border-t border-amber-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Oa,{className:"h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-amber-800",children:h.subscription.subscriptionStatus===Kn?a("subscription.scheduledTrialCancellation"):a("subscription.scheduledCancellation")}),e.jsx("p",{className:"text-sm text-amber-700 mt-0.5",children:Qw(s,h.subscription.subscriptionStatus===Kn&&h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd)?e.jsxs(e.Fragment,{children:[h.subscription.subscriptionStatus===Kn?a("subscription.trialEndDescription"):a("subscription.cancelEndDescription")," ",e.jsx("span",{className:"font-medium",children:Qw(s,h.subscription.subscriptionStatus===Kn&&h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd)}),"."]}):a("subscription.cancelEndFallback")})]})]})}),h.planVersion&&(()=>{const t=((e,t,r=Gn.Monthly)=>{if(!e?.subscriptionItems)return{features:[],limits:[],quotas:[]};const n=[],a=[],s=[];return e.subscriptionItems.forEach(i=>{const o=i.slug;if(i.type===ra){const t=e.features?.[o]??!1;n.push({item:i,enabled:t})}else if(i.type===na){const t=e.limits?.[o]??0;a.push({item:i,value:t})}else if(i.type===aa){const n=t&&e.pricingVariants?.length?da(e,t,o,r):Bw(e.quotas?.[o],r);null!=n&&s.push({item:i,value:n})}}),{features:n,limits:a,quotas:s}})(h.planVersion,c,n??"monthly");return t.features.length>0||t.limits.length>0||t.quotas.length>0?e.jsx("div",{className:"px-4 py-4 sm:px-5 sm:py-5 border-t border-gray-100",children:e.jsxs("div",{className:"space-y-5",children:[t.features.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:a("subscription.items.features")}),e.jsx("ul",{className:"space-y-1.5",children:t.features.sort(e=>e.enabled?-1:1).map(({item:t,enabled:r})=>e.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"w-4 text-center shrink-0 "+(r?"text-green-500":"text-gray-300"),children:r?"✓":"✕"}),e.jsx("span",{className:r?"text-gray-700":"text-gray-400",children:t.name})]},t._id))})]}),t.limits.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:a("subscription.items.limits")}),e.jsx("ul",{className:"space-y-1.5",children:t.limits.map(({item:t,value:r})=>e.jsxs("li",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:t.name}),e.jsx("span",{className:"font-medium text-gray-900",children:i(r)})]},t._id))})]}),t.quotas.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:a("subscription.items.quotas")}),e.jsx("ul",{className:"space-y-1.5",children:t.quotas.map(({item:t,value:r})=>{const n=Ww(r,t.name.toLowerCase(),{currency:c,locale:s}),i=n?n.hasOverage?a("quota.includedWithOverage",{count:n.included,price:n.price,unit:n.unit}):a("quota.includedOnly",{count:n.included}):"—";return e.jsx("li",{className:"text-sm",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-0.5",children:[e.jsx("span",{className:"text-gray-600",children:t.name}),e.jsx("span",{className:"font-medium text-gray-900 text-xs sm:text-sm",children:i})]})},t._id)})})]}),d&&!m&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:a("subscription.seats.title")}),e.jsxs("div",{className:"bg-gray-50 rounded-lg p-3 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.seats.members")}),e.jsx("span",{className:"font-semibold text-gray-900",children:i(g)})]}),e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.seats.included")}),e.jsx("span",{className:"text-gray-900",children:i(b)})]}),v>0&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.seats.billable")}),e.jsxs("span",{className:"font-medium text-amber-600",children:[i(v)," ",a("subscription.seats.extra")]})]}),f&&f>0&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.seats.perExtraSeat")}),e.jsxs("span",{className:"text-gray-900",children:[o(f,c),S]})]}),d.maxSeats>0&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.seats.limit")}),e.jsx("span",{className:"text-gray-900",children:i(d.maxSeats)})]})]})]})]})}):null})()]})})():e.jsxs("div",{className:"border rounded-lg p-6 text-center",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx(Ba,{className:"h-12 w-12 mx-auto text-gray-400 mb-3"}),e.jsx("p",{className:"text-lg font-medium text-gray-700",children:a("subscription.noSubscription")}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:a("subscription.noSubscriptionDescription")})]}),U&&U.length>0&&e.jsx(Es,{size:"sm",onClick:()=>H(!0),children:a("subscription.viewPricingPlans")})]})]}),!N&&!P&&e.jsxs("div",{className:"border rounded-lg p-4 text-center",children:[e.jsxs("div",{className:"text-gray-500 mb-2",children:[e.jsx("p",{className:"font-medium",children:a("subscription.errorLoading")}),T&&e.jsxs("p",{className:"text-sm mt-2 text-red-600",children:["Error: ",T]}),!T&&e.jsx("p",{className:"text-sm mt-2",children:a("subscription.noPlansAvailable")})]}),e.jsx(Es,{variant:"outline",size:"sm",progress:P,onClick:Q,disabled:P,className:"mt-4",children:a("settings.common.refreshAction",{loading:String(P)})})]})]}),"invoices"===Y&&e.jsxs(e.Fragment,{children:[P&&e.jsxs("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:[e.jsx($a,{className:"h-4 w-4 animate-spin flex-shrink-0"}),e.jsx("span",{children:a("settings.common.loading")})]}),e.jsx(Yw,{workspaceId:n,hasActiveSubscription:null!==h?.subscription,onViewPricingPlans:()=>X("subscription"),limit:20})]}),U&&U.length>0&&e.jsx(t.Suspense,{fallback:V?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx($a,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{children:a("settings.common.loading")})]})}):null,children:e.jsx(Xw,{open:V,onOpenChange:H,planVersions:U,currentPlanVersionId:re||null,currentStripePriceId:h?.subscription?.stripePriceId,billingCurrency:r.billingCurrency,trialUsedAt:r.trialUsedAt,workspaceName:r.name,initialInterval:K.current?.interval,initialCurrency:K.current?.currency,currentMemberCount:Array.isArray(r?.users)?r.users.length:void 0,onSelectPlan:async(e,t=Gn.Monthly,s)=>{if(!n)return;const i=U?.find(t=>t._id===e),o=s??ee?.currency??h?.plan?.currency??r?.billingCurrency??"",l=i?function(e,t,r){const n=ca(e,t);if(!n?.stripePrices)return null;const a=r===Gn.Monthly?"monthlyPriceId":r===Gn.Yearly?"yearlyPriceId":"quarterlyPriceId",s=r===Gn.Monthly?"monthly":r===Gn.Yearly?"yearly":void 0;return n.stripePrices[a]??(s?n.stripePrices[s]:void 0)??null}(i,o,t):null,u=h?.subscription?.stripePriceId;if(!l||!u||l!==u){O(!0),z(null),B(null);try{const{successUrl:r,cancelUrl:s}=function(e){const t="undefined"!=typeof window?window.location.href:void 0;return{successUrl:Hw({action:"checkout",status:"success",ws:e,screen:"subscription"},t),cancelUrl:Hw({action:"checkout",status:"cancel",ws:e,screen:"subscription"},t)}}(n);let l;if(i?.plan?.isFreemium){return h?.subscription?.subscriptionId?(H(!1),void $(!0)):(await c.selectFreePlan(n,e),H(!1),It(),await Q(),void B(a("subscription.updateSuccess")))}const u=h?.subscription?.subscriptionStatus===qn;if(l=h?.subscription&&!u?await b(e,{billingInterval:t,successUrl:r,cancelUrl:s}):await y({planVersionId:e,billingInterval:t,currency:o||void 0,successUrl:r,cancelUrl:s}),l&&"checkoutUrl"in l&&l.checkoutUrl)return void dl(l.checkoutUrl);B(a("subscription.updateSuccess")),await Q()}catch(e){const t=e instanceof Error?e.message:a("subscription.errorProcessing");z(t)}finally{O(!1),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{z(null),B(null)},5e3)}}},loading:M||P})}),e.jsx(Fc,{open:Z,onOpenChange:J,children:e.jsxs(Hc,{children:[e.jsxs(Gc,{children:[e.jsx(Kc,{children:a("subscription.resumeTitle")}),e.jsx(qc,{asChild:!0,children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:a("subscription.resumeConfirm")}),e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4 space-y-2 text-sm",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(is,{className:"h-4 w-4 text-amber-600 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[a("subscription.resumeChargeDate")," ",h?.subscription?.stripeCurrentPeriodEnd&&Qw(s,h.subscription.stripeCurrentPeriodEnd)?e.jsx("span",{className:"font-medium",children:Qw(s,h.subscription.stripeCurrentPeriodEnd)}):a("subscription.resumeChargeFallback")]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-amber-600 mt-0.5",children:"•"}),e.jsx("span",{children:a("subscription.resumeContinue")})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-blue-600 mt-0.5",children:"ℹ"}),e.jsx("span",{children:a("subscription.resumeCancelAnytime")})]})]})]})})]}),e.jsxs($c,{children:[e.jsx(Jc,{disabled:k,children:a("subscription.resumeKeep")}),e.jsx(Zc,{onClick:async()=>{if(n){J(!1),O(!0),z(null),B(null);try{await S(),B(a("subscription.resumeSuccess")),await Q()}catch(e){const t=e instanceof Error?e.message:a("subscription.errorResuming");z(t)}finally{O(!1),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{z(null),B(null)},5e3)}}},disabled:k,children:a(k?"subscription.resuming":"subscription.resumeButton")})]})]})}),(()=>{const t=h?.subscription?.subscriptionStatus===Kn,r=t&&h?.subscription?.trialEnd||h?.subscription?.stripeCurrentPeriodEnd;return e.jsx(Fc,{open:G,onOpenChange:$,children:e.jsxs(Hc,{children:[e.jsxs(Gc,{children:[e.jsx(Kc,{children:a(t?"subscription.cancelTrialTitle":"subscription.cancelTitle")}),e.jsx(qc,{asChild:!0,children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:a(t?"subscription.cancelTrialConfirm":"subscription.cancelConfirm")}),e.jsxs("div",{className:"bg-gray-50 rounded-lg p-4 space-y-2 text-sm",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600 mt-0.5",children:"✓"}),e.jsxs("span",{children:[a(t?"subscription.cancelTrialAccess":"subscription.retainAccess")," ",r&&Qw(s,r)?e.jsx("span",{className:"font-medium",children:Qw(s,r)}):a("subscription.retainAccessFallback")]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600 mt-0.5",children:"✓"}),e.jsx("span",{children:a(t?"subscription.cancelTrialNoCharge":"subscription.cancelNotCharged")})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-blue-600 mt-0.5",children:"ℹ"}),e.jsx("span",{children:a(t?"subscription.cancelTrialResume":"subscription.cancelResumeAnytime")})]})]})]})})]}),e.jsxs($c,{children:[e.jsx(Jc,{disabled:w,children:a(t?"subscription.cancelTrialKeep":"subscription.cancelKeep")}),e.jsx(Zc,{onClick:te,disabled:w,className:"bg-red-600 hover:bg-red-700 focus:ring-red-600",children:a(w?"subscription.canceling":t?"subscription.cancelTrialButton":"subscription.cancelButton")})]})]})})})()]}):e.jsx("div",{className:"border rounded-lg p-4 text-center text-gray-500",children:e.jsx("p",{children:a("subscription.invalidWorkspace")})})};function tS(e){return e.replace(/[_-]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function rS(e,t,r){return t+e.toLocaleString(r,{minimumFractionDigits:2,maximumFractionDigits:2})}function nS(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 aS=()=>{const{quotas:r,loading:n,error:a,refetch:s}=Fk(),{t:i,formattingLocale:o,fmtNum:c}=sn(),{can:l}=xl(),u=(e,t)=>rS(e,t,o),{response:d}=Bn(),[p,m]=t.useState(!1),h=t.useMemo(()=>{const e={};if(!d?.planVersion||!d?.subscription)return e;const t=d.planVersion,n=d.subscription,a=n.billingInterval??"monthly",s=n.plan?.currency??"usd",i=Lf(s);if(!r)return e;for(const n of Object.keys(r)){const o=ua(t,s,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:s,currencySymbol:i,estimatedCost:p}}return e},[d,r]),f=t.useMemo(()=>{const e=d?.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,o);return t?{endDate:t,daysRemaining:nS(e)}:null},[d,o]),g=async()=>{m(!0);try{await s()}finally{m(!1)}};if(n&&!r)return e.jsx(Sl,{});if(!l(al.WORKSPACE_USAGE_VIEW))return null;if(a)return e.jsxs("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.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:i("usage.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:a})]}),e.jsx(Es,{variant:"outline",size:"sm",onClick:g,disabled:p,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:i("settings.common.retryAction",{loading:String(p)})})]});const b=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===b.length)return e.jsxs("div",{className:"border rounded-lg p-8 text-center",children:[e.jsx(La,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-gray-600",children:i("usage.noData")}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:i("usage.noDataHint")})]});const v=b.filter(([,e])=>e.hasOverage).length,y=b.length>0?Math.round(b.reduce((e,[,t])=>e+(t.included>0?t.consumed/t.included*100:0),0)/b.length):0,x=Object.values(h).reduce((e,t)=>e+t.estimatedCost,0),w=Object.values(h)[0]?.currencySymbol??"$";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-sm text-gray-600",children:i("usage.description")}),e.jsxs(Es,{variant:"ghost",size:"sm",onClick:g,disabled:p,children:[e.jsx(Ja,{className:Se("h-3.5 w-3.5 me-1.5",p&&"animate-spin")}),i("settings.common.refreshAction",{loading:String(p)})]})]}),f&&e.jsxs("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:[e.jsx(Oa,{className:"h-4 w-4 text-gray-400 flex-shrink-0"}),e.jsxs("span",{children:[i("usage.resetDateDisplay",{date:f.endDate}),null!==f.daysRemaining&&f.daysRemaining>0&&e.jsxs("span",{className:"text-gray-500",children:[" ","(",i("usage.daysRemainingDisplay",{count:f.daysRemaining}),")"]}),null!==f.daysRemaining&&f.daysRemaining<=0&&e.jsxs("span",{className:"text-amber-600 font-medium",children:[" (",i("usage.renewingSoon"),")"]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2 sm:gap-3",children:[e.jsxs("div",{className:"border border-gray-200 rounded-lg p-3 sm:p-4",children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:i("usage.totalResources")}),e.jsx("p",{className:"text-lg sm:text-xl font-semibold text-gray-900 mt-1",children:c(b.length)})]}),e.jsxs("div",{className:"border border-gray-200 rounded-lg p-3 sm:p-4",children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:i("usage.overallUsage")}),e.jsx("p",{className:"text-lg sm:text-xl font-semibold text-gray-900 mt-1",children:c(y)+"%"})]}),e.jsxs("div",{className:Se("border rounded-lg p-3 sm:p-4",v>0?"border-red-200 bg-red-50":"border-gray-200"),children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:i("usage.inOverage")}),e.jsx("p",{className:Se("text-lg sm:text-xl font-semibold mt-1",v>0?"text-red-600":"text-gray-900"),children:c(v)})]}),v>0&&x>0&&e.jsxs("div",{className:"border border-red-200 bg-red-50 rounded-lg p-3 sm:p-4",children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:i("usage.estOverageCost")}),e.jsx("p",{className:"text-lg sm:text-xl font-semibold mt-1 text-red-600",children:u(x,w)})]})]}),v>0&&e.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(is,{className:"h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5 hidden sm:block"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-sm font-semibold text-amber-800 mb-1",children:i("usage.overageDetected")}),e.jsx("p",{className:"text-sm text-amber-700",children:i("usage.overageWarning",{count:v})}),x>0&&e.jsx("p",{className:"text-sm text-amber-700 font-medium mt-1",children:i("usage.estOverageCharges",{amount:u(x,w)})})]})]})}),e.jsx("div",{className:"space-y-3",children:b.map(([t,r])=>{const n=(a=r.consumed,(s=r.included)<=0?a>0?100:0:Math.min(a/s*100,100));var a,s;const i=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=h[t];return e.jsx(sS,{slug:t,quota:r,percent:n,colors:i,pricing:o},t)})})]})};function sS({slug:t,quota:r,percent:n,colors:a,pricing:s}){const{t:i,formattingLocale:o}=sn(),c=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,o),l=(e,t)=>rS(e,t,o);return e.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 sm:p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-y-1 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900 truncate",children:tS(t)}),r.hasOverage&&e.jsx("span",{className:Se("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",a.badge,a.badgeText),children:i("usage.overage")}),!r.hasOverage&&n>=90&&e.jsx("span",{className:Se("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",a.badge,a.badgeText),children:i("usage.almostFull")})]}),e.jsxs("span",{className:"text-sm text-gray-500 whitespace-nowrap",children:[c(r.consumed)," / ",c(r.included)]})]}),e.jsx("div",{className:Se("h-2 rounded-full w-full",a.bg),children:e.jsx("div",{className:Se("h-2 rounded-full transition-all duration-500",a.bar),style:{width:`${n}%`}})}),e.jsxs("div",{className:"flex items-center justify-between mt-2 text-xs text-gray-500",children:[e.jsx("span",{children:i("usage.percentUsed",{percent:Math.round(n)})}),e.jsx("span",{children:r.available>0?i("usage.availableRemaining",{count:c(r.available)}):r.hasOverage?i("usage.overLimitCount",{count:c(r.overage)}):i("usage.fullyUsed")})]}),r.hasOverage&&s&&e.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-200 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-500",children:i("usage.overageUnits")}),e.jsx("span",{className:"font-medium text-gray-900",children:c(r.overage)})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-500",children:i("usage.rate")}),e.jsx("span",{className:"font-medium text-gray-900",children:i("usage.rateDisplay",{rate:l(s.overageCents/100,s.currencySymbol),unitSize:s.unitSize})})]}),s.unitSize>1&&e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-500",children:i("usage.billableBlocks")}),e.jsx("span",{className:"font-medium text-gray-900",children:c(Math.ceil(r.overage/s.unitSize))})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs pt-2 border-t border-gray-200",children:[e.jsx("span",{className:"font-medium text-red-600",children:i("usage.estimatedCharge")}),e.jsx("span",{className:"font-semibold text-red-600",children:l(s.estimatedCost,s.currencySymbol)})]})]}),!r.hasOverage&&s&&e.jsx("div",{className:"mt-2 text-xs text-gray-500",children:i("usage.overageRateDisplay",{rate:i("usage.rateDisplay",{rate:l(s.overageCents/100,s.currencySymbol),unitSize:s.unitSize})})})]})}function iS(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.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),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?us(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var oS=Symbol("radix.slottable");function cS(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===oS}var lS=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"});a.forwardRef((t,r)=>e.jsx(Os.span,{...t,ref:r,style:{...lS,...t.style}})).displayName="VisuallyHidden";var uS=[" ","Enter","ArrowUp","ArrowDown"],dS=[" ","Enter"],pS="Select",[mS,hS,fS]=sg(pS),[gS]=Ns(pS,[fS,Rx]),bS=Rx(),[vS,yS]=gS(pS),[xS,wS]=gS(pS),SS=t=>{const{__scopeSelect:r,children:n,open:s,defaultOpen:i,onOpenChange:o,value:c,defaultValue:l,onValueChange:u,dir:d,name:p,autoComplete:m,disabled:h,required:f,form:g}=t,b=bS(r),[v,y]=a.useState(null),[x,w]=a.useState(null),[S,k]=a.useState(!1),E=og(d),[C,N]=Ds({prop:s,defaultProp:i??!1,onChange:o,caller:pS}),[A,_]=Ds({prop:c,defaultProp:l,onChange:u,caller:pS}),j=a.useRef(null),P=!v||(g||!!v.closest("form")),[T,R]=a.useState(new Set),D=Array.from(T).map(e=>e.props.value).join(";");return e.jsx(qx,{...b,children:e.jsxs(vS,{required:f,scope:r,trigger:v,onTriggerChange:y,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:k,contentId:Ts(),value:A,onValueChange:_,open:C,onOpenChange:N,dir:E,triggerPointerDownPosRef:j,disabled:h,children:[e.jsx(mS.Provider,{scope:r,children:e.jsx(xS,{scope:t.__scopeSelect,onNativeOptionAdd:a.useCallback(e=>{R(t=>new Set(t).add(e))},[]),onNativeOptionRemove:a.useCallback(e=>{R(t=>{const r=new Set(t);return r.delete(e),r})},[]),children:n})}),P?e.jsxs(ik,{"aria-hidden":!0,required:f,tabIndex:-1,name:p,autoComplete:m,value:A,onChange:e=>_(e.target.value),disabled:h,form:g,children:[void 0===A?e.jsx("option",{value:""}):null,Array.from(T)]},D):null]})})};SS.displayName=pS;var kS="SelectTrigger",ES=a.forwardRef((t,r)=>{const{__scopeSelect:n,disabled:s=!1,...i}=t,o=bS(n),c=yS(kS,n),l=c.disabled||s,u=ds(r,c.onTriggerChange),d=hS(n),p=a.useRef("touch"),[m,h,f]=ck(e=>{const t=d().filter(e=>!e.disabled),r=t.find(e=>e.value===c.value),n=lk(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 e.jsx(Zx,{asChild:!0,...o,children:e.jsx(Os.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":ok(c.value)?"":void 0,...i,ref:u,onClick:Cs(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:Cs(i.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:Cs(i.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||uS.includes(e.key)&&(g(),e.preventDefault())})})})});ES.displayName=kS;var CS="SelectValue",NS=a.forwardRef((t,r)=>{const{__scopeSelect:n,className:a,style:s,children:i,placeholder:o="",...c}=t,l=yS(CS,n),{onValueNodeHasChildrenChange:u}=l,d=void 0!==i,p=ds(r,l.onValueNodeChange);return _s(()=>{u(d)},[u,d]),e.jsx(Os.span,{...c,ref:p,style:{pointerEvents:"none"},children:ok(l.value)?e.jsx(e.Fragment,{children:o}):i})});NS.displayName=CS;var AS=a.forwardRef((t,r)=>{const{__scopeSelect:n,children:a,...s}=t;return e.jsx(Os.span,{"aria-hidden":!0,...s,ref:r,children:a||"▼"})});AS.displayName="SelectIcon";var _S=t=>e.jsx(ni,{asChild:!0,...t});_S.displayName="SelectPortal";var jS="SelectContent",PS=a.forwardRef((t,r)=>{const n=yS(jS,t.__scopeSelect),[i,o]=a.useState();if(_s(()=>{o(new DocumentFragment)},[]),!n.open){const r=i;return r?s.createPortal(e.jsx(RS,{scope:t.__scopeSelect,children:e.jsx(mS.Slot,{scope:t.__scopeSelect,children:e.jsx("div",{children:t.children})})}),r):null}return e.jsx(US,{...t,ref:r})});PS.displayName=jS;var TS=10,[RS,DS]=gS(jS),IS=function(t){const r=iS(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(cS);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}("SelectContent.RemoveScroll"),US=a.forwardRef((t,r)=>{const{__scopeSelect:n,position:s="item-aligned",onCloseAutoFocus:i,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}=t,x=yS(jS,n),[w,S]=a.useState(null),[k,E]=a.useState(null),C=ds(r,e=>S(e)),[N,A]=a.useState(null),[_,j]=a.useState(null),P=hS(n),[T,R]=a.useState(!1),D=a.useRef(!1);a.useEffect(()=>{if(w)return ro(w)},[w]),oi();const I=a.useCallback(e=>{const[t,...r]=P().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}},[P,k]),U=a.useCallback(()=>I([N,w]),[I,N,w]);a.useEffect(()=>{T&&U()},[T,U]);const{onOpenChange:M,triggerPointerDownPosRef:O}=x;a.useEffect(()=>{if(w){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():w.contains(r.target)||M(!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})}}},[w,M,O]),a.useEffect(()=>{const e=()=>M(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[M]);const[L,z]=ck(e=>{const t=P().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=lk(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),F=a.useCallback((e,t,r)=>{const n=!D.current&&!r;(void 0!==x.value&&x.value===t||n)&&(A(e),n&&(D.current=!0))},[x.value]),B=a.useCallback(()=>w?.focus(),[w]),W=a.useCallback((e,t,r)=>{const n=!D.current&&!r;(void 0!==x.value&&x.value===t||n)&&j(e)},[x.value]),V="popper"===s?OS:MS,H=V===OS?{side:l,sideOffset:u,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:b,avoidCollisions:v}:{};return e.jsx(RS,{scope:n,content:w,viewport:k,onViewportChange:E,itemRefCallback:F,selectedItem:N,onItemLeave:B,itemTextRefCallback:W,focusSelectedItem:U,selectedItemText:_,position:s,isPositioned:T,searchRef:L,children:e.jsx(Zi,{as:IS,allowPinchZoom:!0,children:e.jsx(Js,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Cs(i,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:e.jsx(Hs,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:e.jsx(V,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...y,...H,onPlaced:()=>R(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Cs(y.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||z(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=P().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(()=>I(t)),e.preventDefault()}})})})})})})});US.displayName="SelectContentImpl";var MS=a.forwardRef((t,r)=>{const{__scopeSelect:n,onPlaced:s,...i}=t,o=yS(jS,n),c=DS(jS,n),[l,u]=a.useState(null),[d,p]=a.useState(null),m=ds(r,e=>p(e)),h=hS(n),f=a.useRef(!1),g=a.useRef(!0),{viewport:b,selectedItem:v,selectedItemText:y,focusSelectedItem:x}=c,w=a.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,s=r.left-a,i=e.left-s,o=e.width+i,c=Math.max(o,t.width),u=window.innerWidth-TS,d=Xg(s,[TS,Math.max(TS,u-c)]);l.style.minWidth=o+"px",l.style.left=d+"px"}else{const a=t.right-n.right,s=window.innerWidth-r.right-a,i=window.innerWidth-e.right-s,o=e.width+i,c=Math.max(o,t.width),u=window.innerWidth-TS,d=Xg(s,[TS,Math.max(TS,u-c)]);l.style.minWidth=o+"px",l.style.right=d+"px"}const a=h(),i=window.innerHeight-2*TS,c=b.scrollHeight,u=window.getComputedStyle(d),p=parseInt(u.borderTopWidth,10),m=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),x=p+m+c+parseInt(u.paddingBottom,10)+g,w=Math.min(5*v.offsetHeight,x),S=window.getComputedStyle(b),k=parseInt(S.paddingTop,10),E=parseInt(S.paddingBottom,10),C=e.top+e.height/2-TS,N=i-C,A=v.offsetHeight/2,_=p+m+(v.offsetTop+A),j=x-_;if(_<=C){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(N,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(C,p+b.offsetTop+(e?k:0)+A)+j;l.style.height=t+"px",b.scrollTop=_-C+b.offsetTop}l.style.margin=`${TS}px 0`,l.style.minHeight=w+"px",l.style.maxHeight=i+"px",s?.(),requestAnimationFrame(()=>f.current=!0)}},[h,o.trigger,o.valueNode,l,d,b,v,y,o.dir,s]);_s(()=>w(),[w]);const[S,k]=a.useState();_s(()=>{d&&k(window.getComputedStyle(d).zIndex)},[d]);const E=a.useCallback(e=>{e&&!0===g.current&&(w(),x?.(),g.current=!1)},[w,x]);return e.jsx(LS,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:f,onScrollButtonChange:E,children:e.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:e.jsx(Os.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});MS.displayName="SelectItemAlignedPosition";var OS=a.forwardRef((t,r)=>{const{__scopeSelect:n,align:a="start",collisionPadding:s=TS,...i}=t,o=bS(n);return e.jsx(Jx,{...o,...i,ref:r,align:a,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});OS.displayName="SelectPopperPosition";var[LS,zS]=gS(jS,{}),FS="SelectViewport",BS=a.forwardRef((t,r)=>{const{__scopeSelect:n,nonce:s,...i}=t,o=DS(FS,n),c=zS(FS,n),l=ds(r,o.onViewportChange),u=a.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),e.jsx(mS.Slot,{scope:n,children:e.jsx(Os.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Cs(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=c;if(n?.current&&r){const e=Math.abs(u.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*TS,a=parseFloat(r.style.minHeight),s=parseFloat(r.style.height),i=Math.max(a,s);if(i<n){const a=i+e,s=Math.min(n,a),o=a-s;r.style.height=s+"px","0px"===r.style.bottom&&(t.scrollTop=o>0?o:0,r.style.justifyContent="flex-end")}}}u.current=t.scrollTop})})})]})});BS.displayName=FS;var WS="SelectGroup",[VS,HS]=gS(WS);a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=Ts();return e.jsx(VS,{scope:n,id:s,children:e.jsx(Os.div,{role:"group","aria-labelledby":s,...a,ref:r})})}).displayName=WS;var GS="SelectLabel",$S=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=HS(GS,n);return e.jsx(Os.div,{id:s.id,...a,ref:r})});$S.displayName=GS;var KS="SelectItem",[qS,ZS]=gS(KS),JS=a.forwardRef((t,r)=>{const{__scopeSelect:n,value:s,disabled:i=!1,textValue:o,...c}=t,l=yS(KS,n),u=DS(KS,n),d=l.value===s,[p,m]=a.useState(o??""),[h,f]=a.useState(!1),g=ds(r,e=>u.itemRefCallback?.(e,s,i)),b=Ts(),v=a.useRef("touch"),y=()=>{i||(l.onValueChange(s),l.onOpenChange(!1))};if(""===s)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 e.jsx(qS,{scope:n,value:s,disabled:i,textId:b,isSelected:d,onItemTextChange:a.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:e.jsx(mS.ItemSlot,{scope:n,value:s,disabled:i,textValue:p,children:e.jsx(Os.div,{role:"option","aria-labelledby":b,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...c,ref:g,onFocus:Cs(c.onFocus,()=>f(!0)),onBlur:Cs(c.onBlur,()=>f(!1)),onClick:Cs(c.onClick,()=>{"mouse"!==v.current&&y()}),onPointerUp:Cs(c.onPointerUp,()=>{"mouse"===v.current&&y()}),onPointerDown:Cs(c.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:Cs(c.onPointerMove,e=>{v.current=e.pointerType,i?u.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Cs(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:Cs(c.onKeyDown,e=>{""!==u.searchRef?.current&&" "===e.key||(dS.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});JS.displayName=KS;var YS="SelectItemText",XS=a.forwardRef((t,r)=>{const{__scopeSelect:n,className:i,style:o,...c}=t,l=yS(YS,n),u=DS(YS,n),d=ZS(YS,n),p=wS(YS,n),[m,h]=a.useState(null),f=ds(r,e=>h(e),d.onItemTextChange,e=>u.itemTextRefCallback?.(e,d.value,d.disabled)),g=m?.textContent,b=a.useMemo(()=>e.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=p;return _s(()=>(v(b),()=>y(b)),[v,y,b]),e.jsxs(e.Fragment,{children:[e.jsx(Os.span,{id:d.textId,...c,ref:f}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?s.createPortal(c.children,l.valueNode):null]})});XS.displayName=YS;var QS="SelectItemIndicator",ek=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return ZS(QS,n).isSelected?e.jsx(Os.span,{"aria-hidden":!0,...a,ref:r}):null});ek.displayName=QS;var tk="SelectScrollUpButton";a.forwardRef((t,r)=>{const n=DS(tk,t.__scopeSelect),s=zS(tk,t.__scopeSelect),[i,o]=a.useState(!1),c=ds(r,s.onScrollButtonChange);return _s(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;o(e)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),i?e.jsx(nk,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=tk;var rk="SelectScrollDownButton";a.forwardRef((t,r)=>{const n=DS(rk,t.__scopeSelect),s=zS(rk,t.__scopeSelect),[i,o]=a.useState(!1),c=ds(r,s.onScrollButtonChange);return _s(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;o(r)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),i?e.jsx(nk,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=rk;var nk=a.forwardRef((t,r)=>{const{__scopeSelect:n,onAutoScroll:s,...i}=t,o=DS("SelectScrollButton",n),c=a.useRef(null),l=hS(n),u=a.useCallback(()=>{null!==c.current&&(window.clearInterval(c.current),c.current=null)},[]);return a.useEffect(()=>()=>u(),[u]),_s(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),e.jsx(Os.div,{"aria-hidden":!0,...i,ref:r,style:{flexShrink:0,...i.style},onPointerDown:Cs(i.onPointerDown,()=>{null===c.current&&(c.current=window.setInterval(s,50))}),onPointerMove:Cs(i.onPointerMove,()=>{o.onItemLeave?.(),null===c.current&&(c.current=window.setInterval(s,50))}),onPointerLeave:Cs(i.onPointerLeave,()=>{u()})})}),ak=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return e.jsx(Os.div,{"aria-hidden":!0,...a,ref:r})});ak.displayName="SelectSeparator";var sk="SelectArrow";a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=bS(n),i=yS(sk,n),o=DS(sk,n);return i.open&&"popper"===o.position?e.jsx(Yx,{...s,...a,ref:r}):null}).displayName=sk;var ik=a.forwardRef(({__scopeSelect:t,value:r,...n},s)=>{const i=a.useRef(null),o=ds(s,i),c=El(r);return a.useEffect(()=>{const e=i.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]),e.jsx(Os.select,{...n,style:{...lS,...n.style},ref:o,defaultValue:r})});function ok(e){return""===e||void 0===e}function ck(e){const t=Ls(e),r=a.useRef(""),n=a.useRef(0),s=a.useCallback(e=>{const a=r.current+e;t(a),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(a)},[t]),i=a.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,i]}function lk(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 s=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(a,0));1===n.length&&(s=s.filter(e=>e!==r));const i=s.find(e=>e.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==r?i:void 0}ik.displayName="SelectBubbleInput";var uk=ES,dk=AS,pk=_S,mk=PS,hk=BS,fk=$S,gk=JS,bk=XS,vk=ek,yk=ak;const xk=SS,wk=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(uk,{ref:a,className:Se("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",t),...n,children:[r,e.jsx(dk,{asChild:!0,children:e.jsx(Jo,{className:"h-4 w-4 opacity-50"})})]}));wk.displayName=uk.displayName;const Sk=a.forwardRef(({className:t,children:r,position:n="popper",...s},i)=>{const{container:o}=a.useContext(nc);return e.jsx(pk,{container:o,children:e.jsx(mk,{ref:i,className:Se("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"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...s,children:e.jsx(hk,{className:Se("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r})})})});Sk.displayName=mk.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(fk,{ref:n,className:Se("px-2 py-1.5 text-sm font-semibold",t),...r})).displayName=fk.displayName;const kk=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(gk,{ref:a,className:Se("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",t),...n,children:[e.jsx("span",{className:"absolute end-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(vk,{children:e.jsx(Xo,{className:"h-4 w-4"})})}),e.jsx(bk,{children:r})]}));kk.displayName=gk.displayName;function Ek(e,r){const{response:n}=Bn();return t.useMemo(()=>{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 t=e.users?.length??0,a=n?.planVersion,s=n?.subscription,i=e.billingCurrency||"usd",o=fa({planVersion:a,currency:i,settingsMaxUsers:r?.settingsMaxUsers}),{maxUsers:c,hasSeatPricing:l,includedSeats:u}=o,d=l?Math.max(0,t-u):0,p=c>0?Math.max(0,c-t):1/0,m=c>0&&t>=c,h=c>0&&t>=.8*c&&!m,f=l&&a?ha(a,i,s?.billingInterval??"monthly"):null,g=ga({memberCount:t,maxUsersConfig:o});return{hasSeatPricing:l,memberCount:t,includedSeats:u,maxUsers:c,maxSeats:c,limitSource:o.source,billableSeats:d,availableSeats:p,isAtMax:m,isNearMax:h,perSeatPriceCents:f,currency:i,canInvite:g.canInvite,inviteBlockReason:g.blockReason,inviteBlockMessageKey:g.blockMessageKey,inviteBlockMessageValues:g.blockMessageValues}},[n,e,r?.settingsMaxUsers])}a.forwardRef(({className:t,...r},n)=>e.jsx(yk,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",t),...r})).displayName=yk.displayName;const Ck=({workspace:r})=>{const{user:n}=yl(),{t:a,fmtNum:s,fmtCents:i}=sn(),[o,c]=t.useState(0),[l,u]=t.useState(!1),[d,p]=t.useState([]),[m,h]=t.useState(null),{getUsers:f,removeUser:g,updateUser:b}=Mk(),{settings:v}=En(),{can:y}=xl(),{response:x}=Bn(),w=Ek(r,{settingsMaxUsers:v?.workspace?.maxWorkspaceUsers});t.useEffect(()=>{r&&(u(!0),f(r._id).then(e=>{p(e)}).catch(e=>{Re(e,{component:"WorkspaceSettingsUsers",action:"getUsers",metadata:{workspaceId:r._id}})}).finally(()=>{u(!1)}))},[r,o]);const S=()=>{c(e=>e+1)},k=v?.workspace?.mode===Kw;if(l||!r)return e.jsx(Sl,{});if(k)return null;const E=e=>"string"==typeof e?{name:a("users.unknownUser"),email:e,id:e,role:"-"}:{name:e.name,email:e.email,id:e._id},C=d.map(e=>({...e,...E(e.user)})),N=y(al.WORKSPACE_MEMBERS_INVITE),A=y(al.WORKSPACE_MEMBERS_REMOVE),_=y(al.WORKSPACE_MEMBERS_ROLE_CHANGE),{hasSeatPricing:j,includedSeats:P,maxUsers:T,canInvite:R,inviteBlockReason:D,inviteBlockMessageKey:I,inviteBlockMessageValues:U,perSeatPriceCents:M,currency:O}=w,L=d.length,z=x?.subscription?.billingInterval??"monthly",F=j&&L>=P;return e.jsxs("div",{children:[!N&&!A&&!_&&e.jsx("div",{className:"text-red-500",children:a("users.adminOnly")}),N&&e.jsx("div",{className:"mb-4",children:R?e.jsxs("div",{children:[e.jsx(Nk,{onInvite:S,workspaceId:r._id}),F&&M&&M>0&&e.jsx("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:e.jsx("span",{children:a("users.extraSeatCost",{price:i(M,O),interval:z})})})]}):e.jsx("div",{className:"flex items-center justify-between p-3 bg-red-50 border border-red-100 rounded-md",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-700",children:a("users.limitReached",{reason:D??"member_limit_reached"})}),e.jsx("p",{className:"text-xs text-red-600 mt-0.5",children:I?a(I,U??void 0):""})]})})}),(j||T>0)&&e.jsxs("div",{className:"mb-4 rounded-lg border bg-gray-50 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-900",children:a("users.seatHeading",{hasSeatPricing:String(j)})}),T>0&&e.jsxs("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full "+(L>=T?"bg-red-100 text-red-700":L>=.8*T?"bg-amber-100 text-amber-700":"bg-emerald-100 text-emerald-700"),children:[s(L)," / ",s(T)]})]}),T>0&&e.jsx("div",{className:"w-full h-1.5 bg-gray-200 rounded-full mb-3",children:e.jsx("div",{className:"h-1.5 rounded-full transition-all "+(L>=T?"bg-red-500":L>=.8*T?"bg-amber-500":"bg-emerald-500"),style:{width:`${Math.min(100,L/T*100)}%`}})}),e.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[e.jsx("div",{children:j?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-900 font-medium",children:s(P)})," ",a("users.included"),M&&M>0&&e.jsxs("span",{className:"text-gray-400",children:[" ","· ",i(M,O),a("users.perExtraSeat")]})]}):e.jsxs("span",{children:[e.jsx("span",{className:"text-gray-900 font-medium",children:s(T)})," ",a("users.maxMembers")]})}),T>0?e.jsxs("span",{children:[s(Math.max(0,T-L))," ",a("users.available")]}):e.jsx("span",{className:"text-gray-400",children:a("users.noMemberLimit")})]})]}),e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("div",{children:e.jsx("div",{className:"text-sm text-gray-600",children:a("users.memberCount",{count:L})})}),e.jsx("div",{children:e.jsx(Es,{variant:"ghost",size:"sm",onClick:S,progress:l,children:a("settings.common.refreshAction",{loading:String(l)})})})]}),e.jsx("ul",{className:"space-y-2",children:C.map((t,s)=>{const i=t.id===n?.id,o=("object"==typeof r.createdBy&&null!==r.createdBy?r.createdBy._id:r.createdBy)===t.id;return e.jsxs("li",{className:"border rounded p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0",children:[e.jsx("div",{className:"w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center text-sm font-medium shrink-0",children:t.name.charAt(0).toUpperCase()}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500 truncate",children:t.email})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[i&&e.jsx("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-0.5 rounded",children:a("users.you")}),o&&e.jsx("span",{className:"text-xs bg-purple-100 text-purple-800 px-2 py-0.5 rounded",children:a("users.owner")})]})]}),_&&e.jsxs("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.jsxs("div",{className:"relative flex-1 sm:flex-initial",children:[e.jsxs(xk,{disabled:i||!_||o||m===t.id,value:t.role,onValueChange:e=>{return n=r._id,a=t.id,s=e,void(rl(r,a)?Re(new Error("Cannot change the role of the workspace owner"),{component:"WorkspaceSettingsUsers",action:"handleUpdateRole",metadata:{workspaceId:n,userId:a,role:s}}):(h(a),b(n,a,{role:s}).then(()=>{S()}).catch(e=>{Re(e,{component:"WorkspaceSettingsUsers",action:"handleUpdateRole",metadata:{workspaceId:n,userId:a,role:s}})}).finally(()=>{h(null)})));var n,a,s},children:[e.jsx(wk,{children:e.jsx(NS,{placeholder:a("users.selectRole")})}),e.jsx(Sk,{children:r?.roles.map(t=>e.jsx(kk,{value:t,children:t},t))})]}),m===t.id&&e.jsx("div",{className:"absolute end-8 top-1/2 -translate-y-1/2 pointer-events-none",children:e.jsx($a,{className:"h-4 w-4 animate-spin text-gray-500"})})]}),!i&&!o&&A&&e.jsx(Es,{variant:"destructive",size:"sm",startIcon:e.jsx(ss,{}),onClick:()=>{return e=t.id,void(rl(r,e)?Re(new Error("Cannot remove the workspace owner"),{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:r._id,userId:e}}):g(r._id,e).then(()=>{S()}).catch(t=>{Re(t,{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:r._id,userId:e}})}));var e}})]})]},s)})}),0===d.length&&e.jsx("div",{className:"text-center py-8 text-gray-500",children:a("users.noMembers")})]})};function Nk({onInvite:r,workspaceId:n}){const{t:a}=sn(),{addUser:s,getWorkspace:i}=Mk(),{settings:o}=En(),[c,l]=t.useState(""),[u,d]=t.useState("admin"),[p,m]=t.useState(!1),[h,f]=t.useState(null),[g,b]=t.useState(null),[v,y]=t.useState(null),x=t.useRef(null),w=o?.workspace.roles??v?.roles??[];t.useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]),t.useEffect(()=>{n&&i(n).then(y)},[n]);const S=()=>{f(null),b(null),l(""),d("admin")};return e.jsxs("div",{className:"flex gap-2 flex-col gap-y-2",children:[h&&e.jsx("div",{className:"text-red-500",children:h}),g&&e.jsx("div",{className:"text-green-500",children:g}),e.jsxs("div",{children:[e.jsx(Vf,{children:a("users.inviteByEmail")}),e.jsx(eg,{type:"email",value:c,onChange:e=>l(e.target.value),placeholder:"example@example.com"})]}),e.jsxs("div",{children:[e.jsx(Vf,{children:a("users.role")}),e.jsxs(xk,{value:u,onValueChange:d,children:[e.jsx(wk,{children:e.jsx(NS,{placeholder:a("users.selectRole")})}),e.jsx(Sk,{children:w.map(t=>e.jsx(kk,{value:t,children:t},t))})]})]}),e.jsx("div",{children:e.jsx(Es,{progress:p,onClick:async()=>{const e=c.trim();if(!e)return void f(a("users.emailRequired"));/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?(m(!0),await s(n,e,u).then(()=>{b(a("users.inviteSuccess")),r?.()}).catch(t=>{Re(t,{component:"InviteMember",action:"addUser",metadata:{workspaceId:n,email:e,role:u}}),f(t instanceof Error?t.message:a("users.inviteFailed"))}).finally(()=>{m(!1),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{S()},6e3)})):f(a("users.invalidEmail"))},disabled:p||!c||!u,children:p?a("users.inviting"):a("users.inviteAs",{role:u})})})]})}const Ak=({workspace:t,section:r,setSection:n})=>{const{t:a}=sn(),{settings:s}=En(),{can:i}=xl(),{appPermissions:o}=Hn(),c=s?.workspace?.mode===Kw,l=i(al.WORKSPACE_DELETE),u=o&&Object.keys(o).length>0;return e.jsxs("div",{className:"w-44 sm:w-56 h-full flex flex-col space-y-4 sm:space-y-6 shrink-0",children:[t&&e.jsx("div",{className:"border-b p-2 py-4",children:e.jsxs("div",{className:"flex items-center gap-x-2",children:[t.image&&t.image.trim()&&e.jsx("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:e.jsx("img",{src:t.image,className:"w-full h-full object-contain",style:{width:"36px",height:"36px",maxWidth:"36px",maxHeight:"36px",objectFit:"contain"},alt:t.name})}),e.jsxs("div",{className:Se("flex-1 min-w-0",t.image?"":"ps-2"),children:[e.jsx("div",{className:"font-medium text-sm line-clamp-1 text-ellipsis overflow-hidden",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500",children:t.workspaceId})]})]})}),e.jsx(_k,{title:a("settings.sidebar.account"),children:e.jsx(jk,{activeSection:r,icon:e.jsx(os,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.profile"),section:Pk.Profile,onClick:()=>n(Pk.Profile)})}),e.jsxs(_k,{title:a("settings.sidebar.workspace"),children:[i(al.WORKSPACE_SETTINGS_VIEW)&&e.jsx(jk,{activeSection:r,icon:e.jsx(Xa,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.general"),section:Pk.General,onClick:()=>n(Pk.General)}),!c&&i(al.WORKSPACE_MEMBERS_VIEW)&&e.jsx(jk,{activeSection:r,icon:e.jsx(cs,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.users"),section:Pk.Users,onClick:()=>n(Pk.Users)}),i(al.WORKSPACE_BILLING_VIEW)&&e.jsx(jk,{activeSection:r,icon:e.jsx(Ba,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.subscription"),section:Pk.Subscription,onClick:()=>n(Pk.Subscription)}),i(al.WORKSPACE_USAGE_VIEW)&&e.jsx(jk,{activeSection:r,icon:e.jsx(La,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.usage"),section:Pk.Usage,onClick:()=>n(Pk.Usage)}),i(al.WORKSPACE_FEATURES_VIEW)&&e.jsx(jk,{activeSection:r,icon:e.jsx(ns,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.features"),section:Pk.Features,onClick:()=>n(Pk.Features)}),e.jsx(jk,{activeSection:r,icon:e.jsx(Ua,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.notifications"),section:Pk.Notifications,onClick:()=>n(Pk.Notifications)}),u&&!c&&e.jsx(jk,{activeSection:r,icon:e.jsx(es,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.permissions"),section:Pk.Permissions,onClick:()=>n(Pk.Permissions)}),l&&!c&&e.jsx(jk,{activeSection:r,icon:e.jsx(is,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.danger"),section:Pk.Danger,onClick:()=>n(Pk.Danger)})]})]})};function _k({title:t,children:r}){return e.jsxs("div",{className:"px-2 flex flex-col space-y-1",children:[e.jsx("div",{className:"text-xs font-bold mb-2 text-gray-500 uppercase tracking-wide px-2",children:t}),r]})}function jk({icon:t,label:r,section:n,onClick:a,activeSection:s}){return e.jsxs("button",{className:Se("flex w-full text-start px-2 py-1 rounded text-sm items-center gap-x-1",n===s?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-200 hover:text-gray-700"),onClick:()=>a(n),children:[t,r]})}const Pk={Profile:"profile",General:"general",Users:"users",Subscription:"subscription",Usage:"usage",Features:"features",Notifications:"notifications",Permissions:"permissions",Danger:"danger"},Tk=new Set(Object.values(Pk)),Rk={[Pk.Profile]:"settings.titles.profile",[Pk.General]:"settings.titles.general",[Pk.Users]:"settings.titles.users",[Pk.Subscription]:"settings.titles.subscription",[Pk.Usage]:"settings.titles.usage",[Pk.Features]:"settings.titles.features",[Pk.Notifications]:"settings.titles.notifications",[Pk.Permissions]:"settings.titles.permissions",[Pk.Danger]:"settings.titles.danger"},Dk=({workspace:r,onClose:n,open:a,onOpenChange:s,defaultSection:i=Pk.Profile,section:o,onSectionChange:c,showTrigger:l=!0,trigger:u})=>{const{t:d,dir:p}=sn(),[m,h]=t.useState(!1),[f,g]=t.useState(i),b=void 0!==a?a:m,v=s||h,y=void 0!==o?o:f,x=c||g;if(!r)return null;const w=e.jsx(Es,{variant:"outline",size:"icon",children:e.jsx(Xa,{className:"h-4 w-4"})});return e.jsxs(sc,{open:b,onOpenChange:e=>{v(e),!e&&n&&n()},children:[l&&e.jsx(ic,{asChild:!0,children:u||w}),e.jsxs(lc,{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:[e.jsx(pc,{className:"sr-only",children:d(Rk[y])}),e.jsx(Ak,{workspace:r,section:y,setSection:x}),e.jsxs("div",{className:"flex-1 p-6 overflow-auto flex flex-col bg-background",children:[e.jsx(dc,{className:"text-xl font-bold mb-4",children:d(Rk[y])}),e.jsxs("div",{className:"sm:max-h-[500px] overflow-y-auto",children:[y===Pk.Profile&&e.jsx(Fw,{workspace:r}),y===Pk.General&&e.jsx(zb,{workspace:r}),y===Pk.Users&&e.jsx(Ck,{workspace:r}),y===Pk.Subscription&&e.jsx(eS,{workspace:r}),y===Pk.Usage&&e.jsx(aS,{}),y===Pk.Features&&e.jsx(Ll,{workspaceId:r._id?.toString()}),y===Pk.Notifications&&e.jsx($b,{workspace:r}),y===Pk.Permissions&&e.jsx(Kb,{workspace:r}),y===Pk.Danger&&e.jsx(kl,{workspace:r})]})]})]})]})};var Ik=Object.freeze({__proto__:null,SETTINGS_SCREENS:Tk,SettingsScreen:Pk,WorkspaceSettingsDialog:Dk,default:Dk});const Uk=new class{constructor(){this.listeners=new Set,this.currentState={open:!1,section:Pk.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||Pk.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)})}},Mk=()=>{const e=vn(),{os:r,api:n}=Cn(),{settings:a}=En(),s=yn(e=>e.workspaces),i=yn(e=>e.auth.session?.user),o=t.useCallback((t,r)=>{if((!(t._id===s.currentWorkspace?._id)||r?.forceEmit)&&t){const r=s.currentWorkspace;Xc(t),e.workspaces(ft(t)),Na.emitWorkspaceChanged(t,r).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceChanged",metadata:{workspaceId:t._id}})})}},[s.currentWorkspace,e]),c=t.useCallback(async(t,n)=>{const a=++p.current;e.workspaces(wt(t._id));try{const e=r.auth?.callbacks?.onWorkspaceChange;if(e){const r=nl(t,i?.id);try{await e({workspace:t,user:i??null,role:r})}catch(e){throw Re(e,{component:"useSaaSWorkspaces",action:"onWorkspaceChange",metadata:{workspaceId:t._id}}),e}if(a!==p.current)return}o(t,n)}finally{a===p.current&&e.workspaces(wt(null))}},[e,r.auth?.callbacks?.onWorkspaceChange,o,i]);t.useEffect(()=>{if(!s.isInitialized){const t=Qc();if(e.workspaces(bt(!0)),t){const e=s.workspaces.find(e=>e._id===t);e&&c(e,{forceEmit:!0}).catch(()=>{})}}},[s.isInitialized,s.workspaces,s.currentWorkspace,e,c]);const l=t.useCallback(()=>{el(),e.workspaces(gt())},[e]),u=t.useRef(!1),d=t.useRef(!1),p=t.useRef(0),m=t.useCallback(async()=>{if(!s.loading&&!u.current){u.current=!0,e.workspaces(vt(!0)),e.workspaces(yt(null));try{const t=await n.getWorkspaces();if(e.workspaces(ut(t)),t.length>0){const e=Qc();if(e&&tl(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(yt(t instanceof Error?t.message:"Failed to fetch workspaces"))}finally{e.workspaces(vt(!1)),u.current=!1}}},[n,s.loading,e,c]),h=t.useCallback(async()=>{if(!s.refreshing&&!u.current){u.current=!0,e.workspaces(xt(!0));try{const t=await n.getWorkspaces();e.workspaces(ut(t))}catch(e){}finally{e.workspaces(xt(!1)),u.current=!1}}},[n,s.refreshing,e]),f=t.useCallback(async(t,r)=>{const a=await n.createWorkspace({name:t,image:r});e.workspaces(dt(a)),await c(a),Na.emitWorkspaceCreated(a).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceCreated",metadata:{workspaceId:a._id}})}),setTimeout(()=>{Uk.openWorkspaceSettings(Pk.Subscription)},300)},[n,e,c]),g=t.useCallback(async(t,r)=>{const a=await n.updateWorkspace(t._id,r);e.workspaces(pt(a)),Na.emitWorkspaceUpdated(a).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceUpdated",metadata:{workspaceId:a._id}})})},[n,e]),b=t.useCallback(async()=>{if(d.current)return s.allFeatures.length>0?s.allFeatures:null;if(s.allFeatures.length>0)return s.allFeatures;d.current=!0;try{const t=await n.getFeatures();return e.workspaces(ht(t)),t}catch(e){return Re(e,{component:"useSaaSWorkspaces",action:"getFeatures"}),null}finally{d.current=!1}},[n,e,s.allFeatures]),v=t.useCallback(async(e,t,r)=>await n.updateFeature(e,t,r),[n]),y=t.useCallback(async e=>n.updateSettings(e),[n]),x=t.useCallback(async(e,t)=>{const r=await n.updateWorkspacePermissions(e,t);return await h(),r},[n,h]);t.useEffect(()=>{if(!s.currentWorkspace?._id||0===s.workspaces.length)return;const t=s.currentWorkspace._id,r=s.workspaces.find(e=>e._id===t);if(r)r!==s.currentWorkspace&&(Xc(r),e.workspaces(ft(r)));else if(s.workspaces.length>0){const e=s.workspaces[0];e._id!==t&&c(e).catch(()=>{})}},[s.workspaces,s.currentWorkspace,e,c]);const w=t.useCallback(async e=>await n.getWorkspaceUsers(e),[n]),S=t.useCallback(async(e,t,r)=>{const i=s.workspaces.find(t=>t._id===e);if(i){const e=fa({settingsMaxUsers:a?.workspace?.maxWorkspaceUsers}),t=ga({memberCount:i.users?.length??0,maxUsersConfig:e});if(!t.canInvite)throw new Error(t.blockMessageKey||"users.memberLimitReached")}const o=await n.addUser(e,{email:t,role:r});return i&&Na.emitWorkspaceUserAdded(o.userId,i,r).catch(t=>{Re(t,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserAdded",metadata:{workspaceId:e,userId:o.userId,role:r}})}),h().catch(()=>{}),It(),o},[n,s.workspaces,h,a]),k=t.useCallback(async(e,t)=>{const r=s.workspaces.find(t=>t._id===e);if(r&&rl(r,t))throw new Error("Cannot remove the workspace owner");const a=(await n.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user._id)===t),i=await n.removeUser(e,t);if(r&&a){const t=a.role;Na.emitWorkspaceUserRemoved(i.userId,r,t).catch(r=>{Re(r,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRemoved",metadata:{workspaceId:e,userId:i.userId,role:t}})})}return h().catch(()=>{}),It(),i},[n,s.workspaces,h]),E=t.useCallback(async(e,t,r)=>{if(r.role){const r=s.workspaces.find(t=>t._id===e);if(r&&rl(r,t))throw new Error("Cannot change the role of the workspace owner")}let a;if(r.role){const r=(await n.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user._id)===t);a=r?.role}const i=await n.updateUser(e,t,r);return r.role&&a&&a!==r.role&&Na.emitWorkspaceUserRoleChanged(i.userId,i.workspace,a,r.role).catch(n=>{Re(n,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRoleChanged",metadata:{workspaceId:e,userId:t,previousRole:a,newRole:r.role}})}),i},[n,s.workspaces]),C=t.useCallback(async e=>{const t=await n.getProfile().catch(()=>null),r=await n.updateUserProfile(e);return Na.emitUserUpdated(r,t||void 0).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitUserUpdated",metadata:{userId:r._id}})}),r},[n]),N=t.useCallback(async()=>await n.getProfile(),[n]),A=t.useCallback(async e=>await n.getWorkspace(e),[n]),_=t.useCallback(async t=>{if(!i)throw new Error("User must be authenticated to delete a workspace");const r=s.workspaces.find(e=>e._id===t);if(!r)throw new Error("Workspace not found");if(!rl(r,i.id))throw new Error("Only the workspace creator can delete the workspace");const a=await n.deleteWorkspace(t);return e.workspaces(mt(t)),s.currentWorkspace?._id===t&&(el(),e.workspaces(gt())),r&&Na.emitWorkspaceDeleted(r).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceDeleted",metadata:{workspaceId:t}})}),a},[n,s.workspaces,s.currentWorkspace,e,i]);return{workspaces:s.workspaces,loading:s.loading,error:s.error,fetchWorkspaces:m,refreshWorkspaces:h,refreshing:s.refreshing,currentWorkspace:s.currentWorkspace,setCurrentWorkspace:o,switchToWorkspace:c,resetCurrentWorkspace:l,createWorkspace:f,allFeatures:s.allFeatures,getFeatures:b,updateFeature:v,updateWorkspaceSettings:y,updateWorkspacePermissions:x,getWorkspace:A,updateWorkspace:g,getUsers:w,addUser:S,removeUser:k,updateUser:E,getProfile:N,updateUserProfile:C,deleteWorkspace:_,switching:null!==s.switchingToId,switchingToId:s.switchingToId}},Ok=t.createContext(null);Ok.displayName="QuotaUsageContext";const Lk="useQuotaUsageContext must be used within QuotaUsageContextProvider. Make sure QuotaUsageContextProvider is wrapping your application (or the tree that uses quota gates).",zk=t.memo(function({children:r}){const{currentWorkspace:n}=Mk(),{quotas:a,loading:s,error:i,refetch:o}=Ln(n?._id);t.useEffect(()=>{return e=o,Tt.add(e),()=>{Tt.delete(e)};var e},[o]);const c=t.useMemo(()=>({quotas:a,loading:s,error:i,refetch:o}),[a,s,i,o]);return e.jsx(Ok.Provider,{value:c,children:r})});function Fk(){const e=t.useContext(Ok);if(null===e)throw new Error(Lk);return e}zk.displayName="QuotaUsageContextProvider";let Bk=!1,Wk=null;const Vk=t.memo(({children:r,callbacks:n})=>{const a=vn(),s=vl(),i=Sn(),o=Ve(s.status).isAuthenticated,c=t.useRef(!1),l=t.useRef(null);t.useEffect(()=>{o||(Bk=!1,Wk=null)},[]);const u=t.useCallback(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=i;if(!rt(r))throw new Error("OS configuration is not available");const{serverUrl:s,version:o,orgId:c}=r,l=new ll({serverUrl:s,version:o}),u=await l.getProfile(t),d=bl(gl(u,c,r.auth?.clientId||""),t);pn(d.sessionId),a.auth(Le(d)),function(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.delete(dn),window.history.replaceState({},"",e.toString())}catch(e){Re(e,{component:"auth-utils",action:"removeTokenFromUrl",metadata:{param:dn}})}}();const p=fl();p&&p!==window.location.href&&dl(p)}}catch(t){throw fl(),Re(t,{component:"AuthProviderWrapper",action:"handleAuthRedirect",metadata:{hasCode:!!e}}),a.auth(Oe()),t}},[a,n,i]);return t.useEffect(()=>{if("undefined"==typeof window)return;if(o)return;if(Bk)return;if(Wk)return;if(!rt(i))return;if(hn())return;if(!n?.getSession)return Bk=!0,void a.auth(Oe());const e=n.getSession,{serverUrl:t,version:r,orgId:s}=i,c=i.auth?.clientId||"";Wk=(async()=>{let i=null;try{i=await e()}catch(e){Re(e,{component:"AuthProviderWrapper",action:"getSession"})}if(!i)return Bk=!0,a.auth(Oe()),"undefined"!=typeof window&&hl(window.location.href),void n?.onSessionExpired?.("missing");try{const e=new ll({serverUrl:t,version:r}),n=await e.getProfile(i),o=bl(gl(n,s,c),i);pn(o.sessionId),Bk=!0,a.auth(Le(o));const l=fl();l&&l!==window.location.href&&dl(l)}catch(e){Re(e,{component:"AuthProviderWrapper",action:"fetchUserProfile"}),Bk=!0,a.auth(Oe()),"undefined"!=typeof window&&hl(window.location.href),n?.onSessionExpired?.("expired")}finally{Wk=null}})()},[o,a,i,n]),t.useEffect(()=>{const e=hn();if(!e)return;if(c.current||l.current===e)return;if(!rt(i))return;c.current=!0,l.current=e;let t=!1;return a.auth(Me()),u(e).then(()=>{t||(l.current=null)}).catch(e=>{t||(Re(e,{component:"AuthProviderWrapper",action:"handleAuthRedirectEffect",metadata:{hasCode:!0}}),l.current=null)}).finally(()=>{c.current=!1}),()=>{t=!0}},[u,i.serverUrl,i.version,i.orgId]),e.jsx(e.Fragment,{children:r})});Vk.displayName="AuthProviderWrapper";const Hk=t.memo(({config:r,auth:n,children:a})=>{const s=vn(),i=Sn(),o=t.useMemo(()=>({clientId:n?.clientId||"",redirectUrl:n?.redirectUrl||"",callbacks:n?.callbacks}),[n?.clientId,n?.redirectUrl,n?.callbacks]);t.useEffect(()=>{s.os(Qe({...r,auth:o}))},[r,o,s]);const c=t.useMemo(()=>rt(i)?new wn(i):null,[i.serverUrl,i.version,i.orgId]);return xn(async e=>{if(!c||i.settings)return;const t=await c.getSettings(e);s.os(et(t))},[c,i.settings,s],{onError:e=>Re(e,{component:"ContextConfigProvider",action:"fetchSettings",metadata:{serverUrl:i.serverUrl,version:i.version,orgId:i.orgId}})}),e.jsx(e.Fragment,{children:a})});Hk.displayName="ContextConfigProvider";class Gk extends gn{constructor(e){super(e)}async getAttributes(e){const t=await this.fetchResponse("users/attributes",{signal:e});if(!t.ok)throw new Error(await Ae(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 Ae(t,"Failed to fetch user features"));const r=await t.json();return"object"==typeof r&&null!==r?r:{}}}const $k=t.createContext(void 0),Kk=t.memo(({children:r})=>{const{t:n}=sn(),a=Sn(),s=function(){const e=Sn();return t.useMemo(()=>new Gk(e),[e.serverUrl,e.version])}(),{isAuthenticated:i}=yl(),{serverUrl:o,version:c}=a,[l,u]=t.useState({}),[d,p]=t.useState({}),[m,h]=t.useState(!1),[f,g]=t.useState(null),b=t.useCallback(async e=>{if(o&&c&&i)try{const t=await s.getAttributes(e);u(t)}catch(e){if(Ne(e))return;const t=e instanceof Error?e:new Error(n("errors.generic"));g(t),Re(e,{component:"UserProvider",action:"fetchAttributes"})}else u({})},[s,o,c,i]),v=t.useCallback(async()=>{if(o&&c&&i){h(!0),g(null);try{await b()}finally{h(!1)}}},[o,c,i,b]),y=t.useCallback(async e=>{h(!0),g(null);try{const t=await s.updateAttributes(e);return await b(),t}catch(t){const r=t instanceof Error?t:new Error(n("errors.generic"));throw g(r),Re(t,{component:"UserProvider",action:"updateAttributes",metadata:{updates:e}}),t}finally{h(!1)}},[s,b]),x=t.useCallback(async(e,t)=>{h(!0),g(null);try{const r=await s.updateAttribute(e,t);return await b(),r}catch(r){const a=r instanceof Error?r:new Error(n("errors.generic"));throw g(a),Re(r,{component:"UserProvider",action:"updateAttribute",metadata:{attributeKey:e,value:t}}),r}finally{h(!1)}},[s,b]),w=t.useCallback(async e=>{if(o&&c&&i)try{const t=await s.getFeatures(e);p(t)}catch(e){if(Ne(e))return;const t=e instanceof Error?e:new Error(n("errors.generic"));g(t),Re(e,{component:"UserProvider",action:"fetchFeatures"})}else p({})},[s,o,c,i]),S=t.useCallback(async()=>{if(o&&c&&i){h(!0),g(null);try{await w()}finally{h(!1)}}},[o,c,i,w]);xn(async e=>{if(!i||!o||!c)return u({}),void p({});h(!0),g(null);try{await Promise.all([b(e),w(e)])}finally{h(!1)}},[i,o,c,b,w],{onError:e=>Re(e,{component:"UserProvider",action:"initialFetch",metadata:{step:"fetchAttributesAndFeatures"}})});const k=t.useMemo(()=>({attributes:l,features:d,isLoading:m,error:f,updateAttributes:y,updateAttribute:x,refreshAttributes:v,refreshFeatures:S}),[l,d,m,f,y,x,v,S]);return e.jsx($k.Provider,{value:k,children:r})});Kk.displayName="UserProvider";const qk=t.lazy(()=>Promise.resolve().then(function(){return Ik}).then(e=>({default:e.default})));const Zk=({children:r})=>{const{currentWorkspace:n,switchToWorkspace:a,workspaces:s}=Mk(),[i,o]=t.useState(!1),[c,l]=t.useState(Pk.Profile),u=t.useRef(!1);return t.useEffect(()=>{const e=Uk.getState();o(e.open),l(e.section);return Uk.subscribe(e=>{o(e.open),l(e.section)})},[]),t.useEffect(()=>{if(u.current)return;if(!n)return;const e=Gw();if(!e)return;const t=function(e){if(e.screen&&Tk.has(e.screen))return e.screen;switch(e.action){case"checkout":case"billing":case"selectPlan":return Pk.Subscription;default:return null}}(e);if(!t)return u.current=!0,void $w();const r=e.ws;if(r&&r!==n._id){const e=s.find(e=>e._id===r);return e?void a(e).catch(()=>{u.current=!0,$w()}):(u.current=!0,void $w())}u.current=!0,Uk.openWorkspaceSettings(t,e),$w()},[n,s,a]),e.jsxs(e.Fragment,{children:[r,n&&i&&e.jsx(t.Suspense,{fallback:null,children:e.jsx(qk,{workspace:n,open:i,onOpenChange:e=>{e||Uk.closeSettings()},section:c,onSectionChange:e=>{Uk.setSection(e)},showTrigger:!1})})]})},Jk=(e,t,r)=>{if(t!==tt.V1)throw new Error(`Invalid version: "${t}". Only "${tt.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).`)},Yk=t.memo(({serverUrl:r,version:n,orgId:a,auth:s,locale:i,defaultPermissions:o,getCheckoutStripeParams:c,children:l})=>{Jk(r,n,a);const u=t.useMemo(()=>({serverUrl:r,version:n,orgId:a}),[r,n,a]),d=t.useMemo(()=>s?.callbacks,[s?.callbacks?.handleAuthentication,s?.callbacks?.onSignOut,s?.callbacks?.handleEvent,s?.callbacks?.onWorkspaceChange]),p=s?.callbacks?.handleEvent;return t.useEffect(()=>(Na.setCallbacks(p?{handleEvent:p}:null),()=>{Na.setCallbacks(null)}),[p]),e.jsx(Xr,{locale:i,children:e.jsx(_t,{children:e.jsx(Vk,{callbacks:d,children:e.jsx(ac,{children:e.jsx(Hk,{config:u,auth:s,children:e.jsx(Pt,{getCheckoutStripeParams:c,children:e.jsx(Vn,{appPermissions:o,children:e.jsx(Kk,{children:e.jsx(Fn,{children:e.jsx(zk,{children:e.jsx(Vb,{children:e.jsx(Zk,{children:l})})})})})})})})})})})})});Yk.displayName="SaaSOSProviderInner";const Xk=({children:t,...r})=>e.jsx(Ie,{children:e.jsx(Yk,{...r,children:t})});Xk.displayName="SaaSOSProvider";const Qk=e=>{const{children:t}=e,{status:r}=yl();return r!==We.authenticated?null:t},eE=e=>{const{children:t}=e,{status:r}=yl();return r!==We.unauthenticated?null:t};Qk.displayName="WhenAuthenticated",eE.displayName="WhenUnauthenticated";const tE=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=yl();return n.includes(a?.role??"")?t:r||null},rE=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=yl(),{currentWorkspace:s}=Mk(),i=s?.users.find(e=>e._id===a?.id);return i&&n.includes(i?.role??"")?t:r||null};tE.displayName="WhenRoles",rE.displayName="WhenWorkspaceRoles";const nE=e=>{const{children:t,fallback:r,permission:n}=e,{can:a}=xl();return a(n)?t:r??null};function aE(){const e=t.useContext($k);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])}}nE.displayName="WhenPermission";const sE=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=Mk(),a=n?.features?.[r];return a?t:null},iE=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=Mk(),a=n?.features?.[r];return a?null:t},oE=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=aE();return n(r)?t:null},cE=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=aE();return n(r)?null:t};sE.displayName="WhenWorkspaceFeatureEnabled",iE.displayName="WhenWorkspaceFeatureDisabled",oE.displayName="WhenUserFeatureEnabled",cE.displayName="WhenUserFeatureDisabled";const lE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=Bn();return s?r??null:a?.subscription?t:n??null},uE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=Bn();return s?r??null:a?.subscription?n??null:t},dE=e=>{const{children:t,plans:r,loadingComponent:n,fallbackComponent:a}=e,{response:s,loading:i}=Bn();if(i)return n??null;if(!s?.subscription)return a??null;const o=s.plan??s.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},pE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=Bn();return s?r??null:"trialing"!==a?.subscription?.subscriptionStatus?n??null:t},mE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=Bn();return s?r??null:a?.subscription?.subscriptionStatus===Kn?n??null:t},hE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n,daysThreshold:a=3}=e,{response:s,loading:i}=Bn();if(i)return r??null;const o=s?.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};lE.displayName="WhenSubscription",uE.displayName="WhenNoSubscription",dE.displayName="WhenSubscriptionToPlans",pE.displayName="WhenTrialing",mE.displayName="WhenNotTrialing",hE.displayName="WhenTrialEnding";const fE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=Fk();if(i)return n??null;const o=s?.[t];return o?o.available<=0?a??null:r:a??null},gE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=Fk();if(i)return n??null;const o=s?.[t];return o?o.available>0?a??null:r:a??null},bE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=Fk();if(i)return n??null;const o=s?.[t];return o&&o.hasOverage&&!1!==o.allowOverage?r:a??null},vE=e=>{const{slug:t,threshold:r,children:n,loadingComponent:a,fallbackComponent:s}=e,{quotas:i,loading:o}=Fk();if(o)return a??null;const c=i?.[t];if(!c)return s??null;return(c.included>0?c.consumed/c.included*100:c.consumed>0?100:0)<r?s??null:n};function yE(e){if(!e)return null;const t=new Date(e);return isNaN(t.getTime())?null:t}fE.displayName="WhenQuotaAvailable",gE.displayName="WhenQuotaExhausted",bE.displayName="WhenQuotaOverage",vE.displayName="WhenQuotaThreshold";class xE extends gn{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 wE=class{constructor(e){this.api=new xE(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),s=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:s}})}};const SE=bf({name:Vh().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:Vh().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)")});function kE({screen:t}){return e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[e.jsx("p",{className:"text-2xl font-bold",children:t?.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t?.description})]})}function EE({logo:t}){return"string"==typeof t?e.jsx("img",{src:t,alt:"Logo",className:"max-h-24"}):e.jsx("img",{src:t.bucket?.url,alt:"Logo",className:"max-h-24"})}function CE(...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 n=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}var NE,AE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=fs(`Primitive.${r}`),s=a.forwardRef((t,a)=>{const{asChild:s,...i}=t,o=s?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(o,{...i,ref:a})});return s.displayName=`Primitive.${r}`,{...t,[r]:s}},{}),_E={exports:{}},jE={};function PE(){if(NE)return jE;NE=1;var e=t;var r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,a=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function o(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(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 r=t(),c=n({inst:{value:r,getSnapshot:t}}),l=c[0].inst,u=c[1];return s(function(){l.value=r,l.getSnapshot=t,o(l)&&u({inst:l})},[e,r,t]),a(function(){return o(l)&&u({inst:l}),e(function(){o(l)&&u({inst:l})})},[e]),i(r),r};return jE.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:c,jE}var TE,RE,DE={};
|
|
27
|
+
*/function Rs(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Ds(...e){return t=>{let r=!1;const n=e.map(e=>{const n=Rs(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():Rs(e[t],null)}}}}function Is(...e){return a.useCallback(Ds(...e),e)}var Ms=Symbol.for("react.lazy"),Us=a[" use ".trim().toString()];function Ls(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===Ms&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}function Os(t){const r=Fs(t),n=a.forwardRef((t,n)=>{let{children:s,...i}=t;Ls(s)&&"function"==typeof Us&&(s=Us(s._payload));const o=a.Children.toArray(s),c=o.find(Ws);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}var zs=Os("Slot");function Fs(e){const t=a.forwardRef((e,t)=>{let{children:r,...n}=e;if(Ls(r)&&"function"==typeof Us&&(r=Us(r._payload)),a.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),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?Ds(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Bs=Symbol("radix.slottable");function Ws(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Bs}const Vs=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Gs=o,Hs=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return Gs(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:a,defaultVariants:s}=t,i=Object.keys(a).map(e=>{const t=null==r?void 0:r[e],n=null==s?void 0:s[e];if(null===t)return null;const i=Vs(t)||Vs(n);return a[e][i]}),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({...s,...o}[t]):{...s,...o}[t]===r})?[...e,r,n]:e},[]);return Gs(e,i,c,null==r?void 0:r.class,null==r?void 0:r.className)},$s=Hs("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"}}),Ks=a.forwardRef(({className:t,variant:r,progress:n,size:s,startIcon:i,endIcon:o,asChild:c=!1,...l},d)=>{const u=c?zs:"button",p=function(e){switch(e){case"lg":return 20;case"sm":return 14;default:return 16}}(s);return e.jsxs(u,{disabled:n||l.disabled,className:Se($s({variant:r,size:s,withIcon:null!=n||null!=i||null!=o,className:t})),ref:d,...l,children:[n&&e.jsx(hs,{size:p,className:"animate-spin"}),i&&a.cloneElement(i,{size:p}),l.children,o&&a.cloneElement(o,{size:p})]})});function qs(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function Zs(t,r=[]){let n=[];const s=()=>{const e=n.map(e=>a.createContext(e));return function(r){const n=r?.[t]||e;return a.useMemo(()=>({[`__scope${t}`]:{...r,[t]:n}}),[r,n])}};return s.scopeName=t,[function(r,s){const i=a.createContext(s),o=n.length;n=[...n,s];const c=r=>{const{scope:n,children:s,...c}=r,l=n?.[t]?.[o]||i,d=a.useMemo(()=>c,Object.values(c));return e.jsx(l.Provider,{value:d,children:s})};return c.displayName=r+"Provider",[c,function(e,n){const c=n?.[t]?.[o]||i,l=a.useContext(c);if(l)return l;if(void 0!==s)return s;throw new Error(`\`${e}\` must be used within \`${r}\``)}]},Js(s,...r)]}function Js(...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 n=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}Ks.displayName="Button";var Ys=globalThis?.document?a.useLayoutEffect:()=>{},Xs=a[" useId ".trim().toString()]||(()=>{}),Qs=0;function ei(e){const[t,r]=a.useState(Xs());return Ys(()=>{r(e=>e??String(Qs++))},[e]),e||(t?`radix-${t}`:"")}var ti=a[" useInsertionEffect ".trim().toString()]||Ys;function ri({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,i,o]=function({defaultProp:e,onChange:t}){const[r,n]=a.useState(e),s=a.useRef(r),i=a.useRef(t);return ti(()=>{i.current=t},[t]),a.useEffect(()=>{s.current!==r&&(i.current?.(r),s.current=r)},[r,s]),[r,n,i]}({defaultProp:t,onChange:r}),c=void 0!==e,l=c?e:s;{const t=a.useRef(void 0!==e);a.useEffect(()=>{const e=t.current;if(e!==c){const t=e?"controlled":"uncontrolled",r=c?"controlled":"uncontrolled";console.warn(`${n} 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,n])}const d=a.useCallback(t=>{if(c){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&o.current?.(r)}else i(t)},[c,e,i,o]);return[l,d]}function ni(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.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),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?Ds(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ai=Symbol("radix.slottable");function si(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===ai}var ii=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=function(t){const r=ni(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(si);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}(`Primitive.${r}`),s=a.forwardRef((t,a)=>{const{asChild:s,...i}=t,o=s?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(o,{...i,ref:a})});return s.displayName=`Primitive.${r}`,{...t,[r]:s}},{});function oi(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...e)=>t.current?.(...e),[])}var ci,li="dismissableLayer.update",di="dismissableLayer.pointerDownOutside",ui="dismissableLayer.focusOutside",pi=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),mi=a.forwardRef((t,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:c,onDismiss:l,...d}=t,u=a.useContext(pi),[p,m]=a.useState(null),h=p?.ownerDocument??globalThis?.document,[,f]=a.useState({}),g=Is(r,e=>m(e)),b=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=b.indexOf(v),x=p?b.indexOf(p):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=x>=y,k=function(e,t=globalThis?.document){const r=oi(e),n=a.useRef(!1),s=a.useRef(()=>{});return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){fi(di,r,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",s.current),s.current=n,t.addEventListener("click",s.current,{once:!0})):n()}else t.removeEventListener("click",s.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{const t=e.target,r=[...u.branches].some(e=>e.contains(t));S&&!r&&(i?.(e),c?.(e),e.defaultPrevented||l?.())},h),C=function(e,t=globalThis?.document){const r=oi(e),n=a.useRef(!1);return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){fi(ui,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.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=oi(e);a.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=>{x===u.layers.size-1&&(s?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},h),a.useEffect(()=>{if(p)return n&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(ci=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),hi(),()=>{n&&1===u.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=ci)}},[p,h,n,u]),a.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),hi())},[p,u]),a.useEffect(()=>{const e=()=>f({});return document.addEventListener(li,e),()=>document.removeEventListener(li,e)},[]),e.jsx(ii.div,{...d,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...t.style},onFocusCapture:qs(t.onFocusCapture,C.onFocusCapture),onBlurCapture:qs(t.onBlurCapture,C.onBlurCapture),onPointerDownCapture:qs(t.onPointerDownCapture,k.onPointerDownCapture)})});mi.displayName="DismissableLayer";function hi(){const e=new CustomEvent(li);document.dispatchEvent(e)}function fi(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&&s.flushSync(()=>e.dispatchEvent(t))}(a,i):a.dispatchEvent(i)}a.forwardRef((t,r)=>{const n=a.useContext(pi),s=a.useRef(null),i=Is(r,s);return a.useEffect(()=>{const e=s.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),e.jsx(ii.div,{...t,ref:i})}).displayName="DismissableLayerBranch";var gi="focusScope.autoFocusOnMount",bi="focusScope.autoFocusOnUnmount",vi={bubbles:!1,cancelable:!0},yi=a.forwardRef((t,r)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...c}=t,[l,d]=a.useState(null),u=oi(i),p=oi(o),m=a.useRef(null),h=Is(r,e=>d(e)),f=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(s){let e=function(e){if(f.paused||!l)return;const t=e.target;l.contains(t)?m.current=t:ki(m.current,{select:!0})},t=function(e){if(f.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||ki(m.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&ki(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()}}},[s,l,f.paused]),a.useEffect(()=>{if(l){Ci.add(f);const t=document.activeElement;if(!l.contains(t)){const r=new CustomEvent(gi,vi);l.addEventListener(gi,u),l.dispatchEvent(r),r.defaultPrevented||(!function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(ki(n,{select:t}),document.activeElement!==r)return}((e=xi(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&ki(l))}return()=>{l.removeEventListener(gi,u),setTimeout(()=>{const e=new CustomEvent(bi,vi);l.addEventListener(bi,p),l.dispatchEvent(e),e.defaultPrevented||ki(t??document.body,{select:!0}),l.removeEventListener(bi,p),Ci.remove(f)},0)}}var e},[l,u,p,f]);const g=a.useCallback(e=>{if(!n&&!s)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,[a,s]=function(e){const t=xi(e),r=wi(t,e),n=wi(t.reverse(),e);return[r,n]}(t);a&&s?e.shiftKey||r!==s?e.shiftKey&&r===a&&(e.preventDefault(),n&&ki(s,{select:!0})):(e.preventDefault(),n&&ki(a,{select:!0})):r===t&&e.preventDefault()}},[n,s,f.paused]);return e.jsx(ii.div,{tabIndex:-1,...c,ref:h,onKeyDown:g})});function xi(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 wi(e,t){for(const r of e)if(!Si(r,{upTo:t}))return r}function Si(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 ki(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()}}yi.displayName="FocusScope";var Ci=function(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=Ei(e,t),e.unshift(t)},remove(t){e=Ei(e,t),e[0]?.resume()}}}();function Ei(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var Ni=a.forwardRef((t,n)=>{const{container:s,...i}=t,[o,c]=a.useState(!1);Ys(()=>c(!0),[]);const l=s||o&&globalThis?.document?.body;return l?r.createPortal(e.jsx(ii.div,{...i,ref:n}),l):null});Ni.displayName="Portal";var ji=e=>{const{present:t,children:r}=e,n=function(e){const[t,r]=a.useState(),n=a.useRef(null),s=a.useRef(e),i=a.useRef("none"),o=e?"mounted":"unmounted",[c,l]=function(e,t){return a.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 a.useEffect(()=>{const e=Ai(n.current);i.current="mounted"===c?e:"none"},[c]),Ys(()=>{const t=n.current,r=s.current;if(r!==e){const n=i.current,a=Ai(t);if(e)l("MOUNT");else if("none"===a||"none"===t?.display)l("UNMOUNT");else{l(r&&n!==a?"ANIMATION_OUT":"UNMOUNT")}s.current=e}},[e,l]),Ys(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,a=a=>{const i=Ai(n.current).includes(CSS.escape(a.animationName));if(a.target===t&&i&&(l("ANIMATION_END"),!s.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&&(i.current=Ai(n.current))};return t.addEventListener("animationstart",o),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",o),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:a.useCallback(e=>{n.current=e?getComputedStyle(e):null,r(e)},[])}}(t),s="function"==typeof r?r({present:n.isPresent}):a.Children.only(r),i=Is(n.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}(s));return"function"==typeof r||n.isPresent?a.cloneElement(s,{ref:i}):null};function Ai(e){return e?.animationName||"none"}ji.displayName="Presence";var _i=0;function Pi(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ti()),document.body.insertAdjacentElement("beforeend",e[1]??Ti()),_i++,()=>{1===_i&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),_i--}},[])}function Ti(){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 Ri=function(){return Ri=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},Ri.apply(this,arguments)};function Di(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 Ii="right-scroll-bar-position",Mi="width-before-scroll-bar";function Ui(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Li="undefined"!=typeof window?a.useLayoutEffect:a.useEffect,Oi=new WeakMap;function zi(e,r){var n,a,s,i=(n=null,a=function(t){return e.forEach(function(e){return Ui(e,t)})},(s=t.useState(function(){return{value:n,callback:a,facade:{get current(){return s.value},set current(e){var t=s.value;t!==e&&(s.value=e,s.callback(e,t))}}}})[0]).callback=a,s.facade);return Li(function(){var t=Oi.get(i);if(t){var r=new Set(t),n=new Set(e),a=i.current;r.forEach(function(e){n.has(e)||Ui(e,null)}),n.forEach(function(e){r.has(e)||Ui(e,a)})}Oi.set(i,e)},[e]),i}function Fi(e){return e}var Bi=function(e){var t=e.sideCar,r=Di(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return a.createElement(n,Ri({},r))};Bi.isSideCarExport=!0;var Wi=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Fi);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 s=function(){var r=t;t=[],r.forEach(e)},i=function(){return Promise.resolve().then(s)};i(),r={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),r}}}}}(null);return t.options=Ri({async:!0,ssr:!1},e),t}(),Vi=function(){},Gi=a.forwardRef(function(e,t){var r=a.useRef(null),n=a.useState({onScrollCapture:Vi,onWheelCapture:Vi,onTouchMoveCapture:Vi}),s=n[0],i=n[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,x=e.gapMode,w=Di(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,k=zi([r,t]),C=Ri(Ri({},w),s);return a.createElement(a.Fragment,null,u&&a.createElement(S,{sideCar:Wi,removeScrollBar:d,shards:p,noRelative:h,noIsolation:f,inert:g,setCallbacks:i,allowPinchZoom:!!b,lockRef:r,gapMode:x}),o?a.cloneElement(a.Children.only(c),Ri(Ri({},C),{ref:k})):a.createElement(y,Ri({},C,{className:l,ref:k}),c))});Gi.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Gi.classNames={fullWidth:Mi,zeroRight:Ii};function Hi(){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 $i=function(){var e=0,t=null;return{add:function(r){var n,a;0==e&&(t=Hi())&&(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)}}},Ki=function(){var e,t=(e=$i(),function(t,r){a.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}},qi={left:0,top:0,right:0,gap:0},Zi=function(e){return parseInt(e||"",10)||0},Ji=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return qi;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[Zi(r),Zi(n),Zi(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])}},Yi=Ki(),Xi="data-scroll-locked",Qi=function(e,t,r,n){var a=e.left,s=e.top,i=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(Xi,"] {\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(s,"px;\n padding-right: ").concat(i,"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(Ii," {\n right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(Mi," {\n margin-right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(Ii," .").concat(Ii," {\n right: 0 ").concat(n,";\n }\n \n .").concat(Mi," .").concat(Mi," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(Xi,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(o,"px;\n }\n")},eo=function(){var e=parseInt(document.body.getAttribute(Xi)||"0",10);return isFinite(e)?e:0},to=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=void 0===n?"margin":n;a.useEffect(function(){return document.body.setAttribute(Xi,(eo()+1).toString()),function(){var e=eo()-1;e<=0?document.body.removeAttribute(Xi):document.body.setAttribute(Xi,e.toString())}},[]);var i=a.useMemo(function(){return Ji(s)},[s]);return a.createElement(Yi,{styles:Qi(i,!t,s,r?"":"!important")})},ro=!1;if("undefined"!=typeof window)try{var no=Object.defineProperty({},"passive",{get:function(){return ro=!0,!0}});window.addEventListener("test",no,no),window.removeEventListener("test",no,no)}catch(e){ro=!1}var ao=!!ro&&{passive:!1},so=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])},io=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),oo(e,n)){var a=co(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},oo=function(e,t){return"v"===e?function(e){return so(e,"overflowY")}(t):function(e){return so(e,"overflowX")}(t)},co=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)},lo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},uo=function(e){return[e.deltaX,e.deltaY]},po=function(e){return e&&"current"in e?e.current:e},mo=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},ho=0,fo=[];function go(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var bo,vo=(bo=function(e){var t=a.useRef([]),r=a.useRef([0,0]),n=a.useRef(),s=a.useState(ho++)[0],i=a.useState(Ki)[0],o=a.useRef(e);a.useEffect(function(){o.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var t=function(e,t,r){if(r||2===arguments.length)for(var n,a=0,s=t.length;a<s;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(po),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=a.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!o.current.allowPinchZoom;var a,s=lo(e),i=r.current,c="deltaX"in e?e.deltaX:i[0]-s[0],l="deltaY"in e?e.deltaY:i[1]-s[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=io(u,d);if(!h)return!0;if(h?a=u:(a="v"===u?"h":"v",h=io(u,d)),!h)return!1;if(!n.current&&"changedTouches"in e&&(c||l)&&(n.current=a),!a)return!0;var f=n.current||a;return function(e,t,r,n){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),s=a*n,i=r.target,o=t.contains(i),c=!1,l=s>0,d=0,u=0;do{if(!i)break;var p=co(e,i),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&oo(e,i)&&(d+=h,u+=m);var f=i.parentNode;i=f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE?f.host:f}while(!o&&i!==document.body||o&&(t.contains(i)||t===i));return(l&&Math.abs(d)<1||!l&&Math.abs(u)<1)&&(c=!0),c}(f,t,e,"h"===f?c:l)},[]),l=a.useCallback(function(e){var r=e;if(fo.length&&fo[fo.length-1]===i){var n="deltaY"in r?uo(r):lo(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 s=(o.current.shards||[]).map(po).filter(Boolean).filter(function(e){return e.contains(r.target)});(s.length>0?c(r,s[0]):!o.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),d=a.useCallback(function(e,r,n,a){var s={name:e,delta:r,target:n,should:a,shadowParent:go(n)};t.current.push(s),setTimeout(function(){t.current=t.current.filter(function(e){return e!==s})},1)},[]),u=a.useCallback(function(e){r.current=lo(e),n.current=void 0},[]),p=a.useCallback(function(t){d(t.type,uo(t),t.target,c(t,e.lockRef.current))},[]),m=a.useCallback(function(t){d(t.type,lo(t),t.target,c(t,e.lockRef.current))},[]);a.useEffect(function(){return fo.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",l,ao),document.addEventListener("touchmove",l,ao),document.addEventListener("touchstart",u,ao),function(){fo=fo.filter(function(e){return e!==i}),document.removeEventListener("wheel",l,ao),document.removeEventListener("touchmove",l,ao),document.removeEventListener("touchstart",u,ao)}},[]);var h=e.removeScrollBar,f=e.inert;return a.createElement(a.Fragment,null,f?a.createElement(i,{styles:mo(s)}):null,h?a.createElement(to,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},Wi.useMedium(bo),Bi),yo=a.forwardRef(function(e,t){return a.createElement(Gi,Ri({},e,{ref:t,sideCar:vo}))});yo.classNames=Gi.classNames;var xo=new WeakMap,wo=new WeakMap,So={},ko=0,Co=function(e){return e&&(e.host||Co(e.parentNode))},Eo=function(e,t,r,n){var a=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=Co(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]);So[r]||(So[r]=new WeakMap);var s=So[r],i=[],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=(xo.get(e)||0)+1,l=(s.get(e)||0)+1;xo.set(e,c),s.set(e,l),i.push(e),1===c&&a&&wo.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(),ko++,function(){i.forEach(function(e){var t=xo.get(e)-1,a=s.get(e)-1;xo.set(e,t),s.set(e,a),t||(wo.has(e)||e.removeAttribute(n),wo.delete(e)),a||e.removeAttribute(r)}),--ko||(xo=new WeakMap,xo=new WeakMap,wo=new WeakMap,So={})}},No=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"))),Eo(n,a,r,"aria-hidden")):function(){return null}};function jo(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.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),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?Ds(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ao=Symbol("radix.slottable");function _o(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Ao}var Po="Dialog",[To,Ro]=Zs(Po),[Do,Io]=To(Po),Mo=t=>{const{__scopeDialog:r,children:n,open:s,defaultOpen:i,onOpenChange:o,modal:c=!0}=t,l=a.useRef(null),d=a.useRef(null),[u,p]=ri({prop:s,defaultProp:i??!1,onChange:o,caller:Po});return e.jsx(Do,{scope:r,triggerRef:l,contentRef:d,contentId:ei(),titleId:ei(),descriptionId:ei(),open:u,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:c,children:n})};Mo.displayName=Po;var Uo="DialogTrigger",Lo=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=Io(Uo,n),i=Is(r,s.triggerRef);return e.jsx(ii.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":nc(s.open),...a,ref:i,onClick:qs(t.onClick,s.onOpenToggle)})});Lo.displayName=Uo;var Oo="DialogPortal",[zo,Fo]=To(Oo,{forceMount:void 0}),Bo=t=>{const{__scopeDialog:r,forceMount:n,children:s,container:i}=t,o=Io(Oo,r);return e.jsx(zo,{scope:r,forceMount:n,children:a.Children.map(s,t=>e.jsx(ji,{present:n||o.open,children:e.jsx(Ni,{asChild:!0,container:i,children:t})}))})};Bo.displayName=Oo;var Wo="DialogOverlay",Vo=a.forwardRef((t,r)=>{const n=Fo(Wo,t.__scopeDialog),{forceMount:a=n.forceMount,...s}=t,i=Io(Wo,t.__scopeDialog);return i.modal?e.jsx(ji,{present:a||i.open,children:e.jsx(Ho,{...s,ref:r})}):null});Vo.displayName=Wo;var Go=function(t){const r=jo(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(_o);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}("DialogOverlay.RemoveScroll"),Ho=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=Io(Wo,n);return e.jsx(yo,{as:Go,allowPinchZoom:!0,shards:[s.contentRef],children:e.jsx(ii.div,{"data-state":nc(s.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),$o="DialogContent",Ko=a.forwardRef((t,r)=>{const n=Fo($o,t.__scopeDialog),{forceMount:a=n.forceMount,...s}=t,i=Io($o,t.__scopeDialog);return e.jsx(ji,{present:a||i.open,children:i.modal?e.jsx(qo,{...s,ref:r}):e.jsx(Zo,{...s,ref:r})})});Ko.displayName=$o;var qo=a.forwardRef((t,r)=>{const n=Io($o,t.__scopeDialog),s=a.useRef(null),i=Is(r,n.contentRef,s);return a.useEffect(()=>{const e=s.current;if(e)return No(e)},[]),e.jsx(Jo,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:qs(t.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:qs(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:qs(t.onFocusOutside,e=>e.preventDefault())})}),Zo=a.forwardRef((t,r)=>{const n=Io($o,t.__scopeDialog),s=a.useRef(!1),i=a.useRef(!1);return e.jsx(Jo,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(s.current||n.triggerRef.current?.focus(),e.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(s.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const r=e.target,a=n.triggerRef.current?.contains(r);a&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),Jo=a.forwardRef((t,r)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,...c}=t,l=Io($o,n),d=a.useRef(null),u=Is(r,d);return Pi(),e.jsxs(e.Fragment,{children:[e.jsx(yi,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:o,children:e.jsx(mi,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":nc(l.open),...c,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(oc,{titleId:l.titleId}),e.jsx(cc,{contentRef:d,descriptionId:l.descriptionId})]})]})}),Yo="DialogTitle",Xo=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=Io(Yo,n);return e.jsx(ii.h2,{id:s.titleId,...a,ref:r})});Xo.displayName=Yo;var Qo="DialogDescription",ec=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=Io(Qo,n);return e.jsx(ii.p,{id:s.descriptionId,...a,ref:r})});ec.displayName=Qo;var tc="DialogClose",rc=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=Io(tc,n);return e.jsx(ii.button,{type:"button",...a,ref:r,onClick:qs(t.onClick,()=>s.onOpenChange(!1))})});function nc(e){return e?"open":"closed"}rc.displayName=tc;var ac="DialogTitleWarning",[sc,ic]=function(t,r){const n=a.createContext(r),s=t=>{const{children:r,...s}=t,i=a.useMemo(()=>s,Object.values(s));return e.jsx(n.Provider,{value:i,children:r})};return s.displayName=t+"Provider",[s,function(e){const s=a.useContext(n);if(s)return s;if(void 0!==r)return r;throw new Error(`\`${e}\` must be used within \`${t}\``)}]}(ac,{contentName:$o,titleName:Yo,docsSlug:"dialog"}),oc=({titleId:e})=>{const t=ic(ac),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 a.useEffect(()=>{if(e){document.getElementById(e)||console.error(r)}},[r,e]),null},cc=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ic("DialogDescriptionWarning").contentName}}.`;return a.useEffect(()=>{const n=e.current?.getAttribute("aria-describedby");if(t&&n){document.getElementById(t)||console.warn(r)}},[r,e,t]),null},lc=Mo,dc=Lo,uc=Bo,pc=Vo,mc=Ko,hc=Xo,fc=ec,gc=rc;function bc(e,t){if(null==e)return{};var r,n,a={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}var vc=["color"],yc=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=bc(e,vc);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s,{ref:r}),t.createElement("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:a,fillRule:"evenodd",clipRule:"evenodd"}))}),xc=["color"],wc=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=bc(e,xc);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s,{ref:r}),t.createElement("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:a,fillRule:"evenodd",clipRule:"evenodd"}))}),Sc=["color"],kc=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=bc(e,Sc);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s,{ref:r}),t.createElement("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:a,fillRule:"evenodd",clipRule:"evenodd"}))}),Cc=["color"],Ec=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=bc(e,Cc);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s,{ref:r}),t.createElement("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:a,fillRule:"evenodd",clipRule:"evenodd"}))});const Nc=t.createContext({container:null,setContainer:()=>{}}),jc=t.memo(({children:r})=>{const[n,a]=t.useState(null),s=t.useMemo(()=>({container:n,setContainer:a}),[n]),i=t.useMemo(()=>r,[r]);return e.jsxs(Nc.Provider,{value:s,children:[i,e.jsx("div",{ref:a,id:"saas-os-portal",className:"saas-os-ui",style:{width:"100%",height:"100%"}})]})});jc.displayName="PortalProvider";const Ac=lc,_c=dc,Pc=uc,Tc=a.forwardRef(({className:t,...r},n)=>e.jsx(pc,{ref:n,className:Se("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",t),...r}));Tc.displayName=pc.displayName;const Rc=a.forwardRef(({className:t,children:r,...n},s)=>{const{container:i}=a.useContext(Nc);return e.jsxs(Pc,{container:i,children:[e.jsx(Tc,{}),e.jsxs(mc,{ref:s,className:Se("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",t),...n,children:[r,e.jsxs(gc,{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:[e.jsx(kc,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});Rc.displayName=mc.displayName;const Dc=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col space-y-1.5 text-center sm:text-start",t),...r});Dc.displayName="DialogHeader";const Ic=a.forwardRef(({className:t,...r},n)=>e.jsx(hc,{ref:n,className:Se("text-lg font-semibold leading-none tracking-tight",t),...r}));Ic.displayName=hc.displayName;const Mc=a.forwardRef(({className:t,...r},n)=>e.jsx(fc,{ref:n,className:Se("text-sm text-muted-foreground",t),...r}));Mc.displayName=fc.displayName;var Uc=Symbol("radix.slottable");var Lc="AlertDialog",[Oc]=Zs(Lc,[Ro]),zc=Ro(),Fc=t=>{const{__scopeAlertDialog:r,...n}=t,a=zc(r);return e.jsx(lc,{...a,...n,modal:!0})};Fc.displayName=Lc;var Bc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=zc(n);return e.jsx(dc,{...s,...a,ref:r})});Bc.displayName="AlertDialogTrigger";var Wc=t=>{const{__scopeAlertDialog:r,...n}=t,a=zc(r);return e.jsx(uc,{...a,...n})};Wc.displayName="AlertDialogPortal";var Vc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=zc(n);return e.jsx(pc,{...s,...a,ref:r})});Vc.displayName="AlertDialogOverlay";var Gc="AlertDialogContent",[Hc,$c]=Oc(Gc),Kc=function(t){const r=({children:t})=>e.jsx(e.Fragment,{children:t});return r.displayName=`${t}.Slottable`,r.__radixId=Uc,r}("AlertDialogContent"),qc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,children:s,...i}=t,o=zc(n),c=a.useRef(null),l=Is(r,c),d=a.useRef(null);return e.jsx(sc,{contentName:Gc,titleName:Zc,docsSlug:"alert-dialog",children:e.jsx(Hc,{scope:n,cancelRef:d,children:e.jsxs(mc,{role:"alertdialog",...o,...i,ref:l,onOpenAutoFocus:qs(i.onOpenAutoFocus,e=>{e.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[e.jsx(Kc,{children:s}),e.jsx(rl,{contentRef:c})]})})})});qc.displayName=Gc;var Zc="AlertDialogTitle",Jc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=zc(n);return e.jsx(hc,{...s,...a,ref:r})});Jc.displayName=Zc;var Yc="AlertDialogDescription",Xc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=zc(n);return e.jsx(fc,{...s,...a,ref:r})});Xc.displayName=Yc;var Qc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=zc(n);return e.jsx(gc,{...s,...a,ref:r})});Qc.displayName="AlertDialogAction";var el="AlertDialogCancel",tl=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,{cancelRef:s}=$c(el,n),i=zc(n),o=Is(r,s);return e.jsx(gc,{...i,...a,ref:o})});tl.displayName=el;var rl=({contentRef:e})=>{const t=`\`${Gc}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${Gc}\` by passing a \`${Yc}\` 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 \`${Gc}\`. 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 a.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},nl=Vc,al=qc,sl=Qc,il=tl,ol=Jc,cl=Xc;const ll=Fc,dl=Bc,ul=Wc,pl=a.forwardRef(({className:t,...r},n)=>e.jsx(nl,{className:Se("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",t),...r,ref:n}));pl.displayName=nl.displayName;const ml=a.forwardRef(({className:t,...r},n)=>{const{container:s}=a.useContext(Nc);return e.jsxs(ul,{container:s,children:[e.jsx(pl,{}),e.jsx(al,{ref:n,className:Se("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",t),...r})]})});ml.displayName=al.displayName;const hl=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-start",t),...r});hl.displayName="AlertDialogHeader";const fl=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r});fl.displayName="AlertDialogFooter";const gl=a.forwardRef(({className:t,...r},n)=>e.jsx(ol,{ref:n,className:Se("text-lg font-semibold",t),...r}));gl.displayName=ol.displayName;const bl=a.forwardRef(({className:t,...r},n)=>e.jsx(cl,{ref:n,className:Se("text-sm text-muted-foreground",t),...r}));bl.displayName=cl.displayName;const vl=a.forwardRef(({className:t,...r},n)=>e.jsx(sl,{ref:n,className:Se($s(),t),...r}));vl.displayName=sl.displayName;const yl=a.forwardRef(({className:t,...r},n)=>e.jsx(il,{ref:n,className:Se($s({variant:"outline"}),"mt-2 sm:mt-0",t),...r}));yl.displayName=il.displayName;const xl="saas-workspace-current",wl=e=>{e?cn(xl,e._id):ln(xl)},Sl=()=>on(xl),kl=()=>{ln(xl)},Cl=(e,t)=>!!e&&t.some(t=>t._id===e);function El(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 Nl(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 jl={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"},Al=Object.values(jl),_l={admin:Al.filter(e=>e!==jl.WORKSPACE_DELETE),member:[jl.WORKSPACE_SETTINGS_VIEW,jl.WORKSPACE_MEMBERS_VIEW,jl.WORKSPACE_FEATURES_VIEW,jl.WORKSPACE_BILLING_VIEW,jl.WORKSPACE_USAGE_VIEW],viewer:[jl.WORKSPACE_SETTINGS_VIEW,jl.WORKSPACE_MEMBERS_VIEW]};function Pl(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 Tl(e){const{userId:t,workspace:r,settings:n,appPermissions:a}=e;if(!r||!t)return new Set;if(El(r,t)){const e=new Set(Al);if(a)for(const t of Pl(a))e.add(t);if(r.permissions)for(const t of Pl(r.permissions))e.add(t);if(n?.workspace?.permissions)for(const t of Pl(n.workspace.permissions))e.add(t);return e}const s=e.workspaceRole??Nl(r,t);if(!s)return new Set;const i=r.permissions,o=n?.workspace?.permissions,c=e=>e.filter(e=>e.startsWith("workspace:")),l=e=>e.filter(e=>!e.startsWith("workspace:")),d=i?.[s]?c(i[s]):[],u=o?.[s]?c(o[s]):[],p=_l[s]??[];let m;if(d.length>0)m=d;else if(u.length>0)m=u;else if(p.length>0)m=p;else{m=_l[n?.workspace?.defaultRole??"member"]??_l.member??[]}const h=new Set(m),f=i?.[s]?l(i[s]):[],g=a?.[s]?l(a[s]):[],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(jl.WORKSPACE_MEMBERS_INVITE)}(h,s,n),h}class Rl extends gn{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 Dl(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 Il(e,t="/"){const r=Dl(e);window.location.href=r||t}const Ml="saas-auth-intent";function Ul(e){return"object"==typeof e&&null!==e&&"string"==typeof e.returnUrl&&"number"==typeof e.createdAt}function Ll(e){Dl(e)&&function(e,t){try{cn(e,JSON.stringify(t))}catch(t){Re(t,{component:"storage",action:"setStorageJSON",metadata:{key:e}})}}(Ml,{returnUrl:e,createdAt:Date.now()})}function Ol(){const e=function(e,t){const r=on(e);if(!r)return null;try{const n=JSON.parse(r);return t&&!t(n)?(Re(new Error("Storage data failed validation"),{component:"storage",action:"getStorageJSON",metadata:{key:e}}),ln(e),null):n}catch(t){return Re(t,{component:"storage",action:"getStorageJSON",metadata:{key:e}}),ln(e),null}}(Ml,Ul);return ln(Ml),e?Date.now()-e.createdAt>6e5?null:Dl(e.returnUrl):null}const zl="bb",Fl="checkout",Bl="billing",Wl="selectPlan",Vl="creditPurchase",Gl="openCreditStore",Hl="success",$l="cancel",Kl="error",ql="subscription",Zl="credits";function Jl(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(zl,function(e){return Object.entries(e).filter(([,e])=>null!=e&&""!==e).map(([e,t])=>`${encodeURIComponent(e)}:${encodeURIComponent(t)}`).join(",")}(e)),r.toString()}function Yl(e,t){const r="undefined"!=typeof window?window.location.href:void 0;return{successUrl:Jl({action:Vl,status:Hl,ws:e,screen:Zl},r),cancelUrl:Jl({action:Vl,status:$l,ws:e,screen:Zl},r)}}function Xl(){if("undefined"==typeof window)return null;try{const e=new URLSearchParams(window.location.search).get(zl);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 Ql(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.has(zl)&&(e.searchParams.delete(zl),window.history.replaceState({},"",e.toString()))}catch{}}function ed(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 td(e,t){return{user:e,sessionId:t,expires:new Date(Date.now()+864e5).toISOString()}}function rd(){return yn(e=>e.auth)}function nd(){const{t:e}=sn(),r=vn(),n=rd(),a=Sn(),{serverUrl:s,orgId:i,auth:o}=a,{resetCurrentWorkspace:c,currentWorkspace:l}=wC(),d=t.useMemo(()=>new Rl({serverUrl:s,version:a.version}),[s,a.version]),u=t.useCallback(async t=>{Ll(t||window.location.href),r.auth(Me());try{const t=await d.requestAuth({orgId:i,clientId:o?.clientId??"",redirect:{success:o?.redirectUrl||window.location.href,error:o?.redirectUrl||window.location.href}});if(!t.success)throw r.auth(Le()),new Error(t.message||e("errors.generic"));Il(t.data.redirectUrl)}catch(e){throw r.auth(Le()),Re(e,{component:"useSaaSAuth",action:"signIn"}),e}},[d,i,o,r]),p=t.useCallback(async()=>{try{o?.callbacks?.onSignOut&&"function"==typeof o.callbacks.onSignOut&&await o.callbacks.onSignOut()}catch(e){Re(e,{component:"useSaaSAuth",action:"signOut"})}finally{ln(dn),r.auth(ze()),c()}},[r,c,o?.callbacks?.onSignOut]),m=t.useCallback(e=>{l?xC.openWorkspaceSettings(e):Re(new Error("Cannot open settings: No current workspace"),{component:"useSaaSAuth",action:"openWorkspaceSettings"})},[l]),h=t.useCallback(()=>{l?xC.openWorkspaceSettings(fC.Credits,{action:Gl}):Re(new Error("Cannot open credit store: No current workspace"),{component:"useSaaSAuth",action:"openCreditStore"})},[l]),f=t.useCallback(()=>{l?xC.openWorkspaceSettings(fC.Subscription,{action:Wl}):Re(new Error("Cannot open plan picker: No current workspace"),{component:"useSaaSAuth",action:"openPlanPicker"})},[l]),g=t.useMemo(()=>Ve(n.status),[n.status]);return t.useMemo(()=>({user:n.session?.user,session:n.session,status:n.status,...g,signIn:u,signOut:p,openWorkspaceSettings:m,openCreditStore:h,openPlanPicker:f}),[n.session,n.status,g,u,p,m,h,f])}function ad(e){const{user:r}=nd(),{currentWorkspace:n}=wC(),{settings:a}=Cn(),{appPermissions:s}=Gn(),i=e??n??null,o=r?.id??null,c=t.useMemo(()=>i?Nl(i,o):null,[i,o]),l=t.useMemo(()=>!!i&&El(i,o),[i,o]),d=t.useMemo(()=>Tl({userId:o,workspaceRole:c,workspace:i,settings:a,appPermissions:s}),[o,c,i,a,s]),u=t.useCallback(e=>Array.isArray(e)?e.every(e=>d.has(e)):d.has(e),[d]);return{can:u,permissions:d,isOwner:l,role:c}}function sd({className:t,...r}){return e.jsx("div",{className:Se("animate-pulse rounded-md bg-primary/10",t),...r})}function id(){return e.jsxs("div",{className:"space-y-3.5",children:[e.jsx(sd,{className:"h-10 w-full"}),e.jsx(sd,{className:"h-10 w-full"}),e.jsx(sd,{className:"h-10 w-full"})]})}const od=({workspace:r})=>{const[n,a]=t.useState(!1),{deleteWorkspace:s}=wC(),{can:i}=ad(),{settings:o}=Cn(),{t:c}=sn();if(1===(o?.workspace?.maxWorkspacesPerUser??0))return null;if(!r)return e.jsx(id,{});return i(jl.WORKSPACE_DELETE)?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-destructive",children:c("danger.title")}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:c("danger.deleteDescription")})]}),e.jsxs(ll,{children:[e.jsx(dl,{asChild:!0,children:e.jsxs(Ks,{variant:"destructive",disabled:n,progress:n,children:[e.jsx(js,{className:"h-4 w-4 me-2"}),c("danger.deleteWorkspace")]})}),e.jsxs(ml,{children:[e.jsxs(hl,{children:[e.jsx(gl,{children:c("danger.deleteConfirm")}),e.jsx(bl,{children:c("danger.deleteConfirmDescription")})]}),e.jsxs(fl,{children:[e.jsx(yl,{disabled:n,children:c("settings.common.cancel")}),e.jsx(vl,{onClick:async()=>{a(!0);try{await s(r._id)}catch(e){Re(e,{component:"WorkspaceSettingsDanger",action:"handleDeleteWorkspace",metadata:{workspaceId:r._id}}),alert(e instanceof Error?e.message:c("danger.failedToDelete"))}finally{a(!1)}},disabled:n,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:n?e.jsxs(e.Fragment,{children:[e.jsx(hs,{className:"me-2 h-4 w-4 animate-spin"}),c("danger.deleting")]}):c("danger.deleteWorkspace")})]})]})]})]}):e.jsx("div",{className:"space-y-4",children:e.jsx("div",{className:"text-red-500",children:c("danger.adminOnly")})})};function cd(e){const t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function ld(e){const[t,r]=a.useState(void 0);return Ys(()=>{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,s;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;a=t.inlineSize,s=t.blockSize}else a=e.offsetWidth,s=e.offsetHeight;r({width:a,height:s})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}var dd="Switch",[ud]=Zs(dd),[pd,md]=ud(dd),hd=a.forwardRef((t,r)=>{const{__scopeSwitch:n,name:s,checked:i,defaultChecked:o,required:c,disabled:l,value:d="on",onCheckedChange:u,form:p,...m}=t,[h,f]=a.useState(null),g=Is(r,e=>f(e)),b=a.useRef(!1),v=!h||(p||!!h.closest("form")),[y,x]=ri({prop:i,defaultProp:o??!1,onChange:u,caller:dd});return e.jsxs(pd,{scope:n,checked:y,disabled:l,children:[e.jsx(ii.button,{type:"button",role:"switch","aria-checked":y,"aria-required":c,"data-state":vd(y),"data-disabled":l?"":void 0,disabled:l,value:d,...m,ref:g,onClick:qs(t.onClick,e=>{x(e=>!e),v&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})}),v&&e.jsx(bd,{control:h,bubbles:!b.current,name:s,value:d,checked:y,required:c,disabled:l,form:p,style:{transform:"translateX(-100%)"}})]})});hd.displayName=dd;var fd="SwitchThumb",gd=a.forwardRef((t,r)=>{const{__scopeSwitch:n,...a}=t,s=md(fd,n);return e.jsx(ii.span,{"data-state":vd(s.checked),"data-disabled":s.disabled?"":void 0,...a,ref:r})});gd.displayName=fd;var bd=a.forwardRef(({__scopeSwitch:t,control:r,checked:n,bubbles:s=!0,...i},o)=>{const c=a.useRef(null),l=Is(c,o),d=cd(n),u=ld(r);return a.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==n&&r){const t=new Event("click",{bubbles:s});r.call(e,n),e.dispatchEvent(t)}},[d,n,s]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function vd(e){return e?"checked":"unchecked"}bd.displayName="SwitchBubbleInput";var yd=hd,xd=gd;const wd=a.forwardRef(({className:t,...r},n)=>e.jsx(yd,{className:Se("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",t),...r,ref:n,children:e.jsx(xd,{className:Se("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")})}));wd.displayName=yd.displayName;const Sd=({workspaceId:r})=>{const{t:n}=sn(),{allFeatures:a,updateFeature:s,getWorkspace:i}=wC(),{can:o}=ad(),[c,l]=t.useState({}),[d,u]=t.useState(null),[p,m]=t.useState(null),h=t.useRef(null);if(t.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]),t.useEffect(()=>{i(r).then(m)},[r]),!p)return e.jsx(id,{});const f=o(jl.WORKSPACE_FEATURES_EDIT);return e.jsxs("div",{children:[d&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:n("settings.common.success")}),e.jsx("p",{className:"text-sm",children:d})]}),e.jsxs("div",{className:"flex flex-col gap-y-3.5 pe-4",children:[!f&&e.jsx("div",{className:"text-red-500",children:n("features.ownerOnly")}),!a.length&&e.jsx("div",{className:"text-muted-foreground",children:n("features.noFeatures")}),a.length>0&&e.jsx("div",{className:"flex flex-col gap-y-3.5",children:a.map(t=>{const r=p?.features?.[t.slug],i=null!==c[t.slug]&&void 0!==c[t.slug],o=c[t.slug],d=n("features.actionStatus",{action:!0===o?"enabling":!1===o?"disabling":"none"});return e.jsxs("div",{className:"flex items-center gap-x-2 justify-between w-full",children:[e.jsxs("div",{className:"flex gap-x-2 flex-col",children:[e.jsx("h3",{className:"font-medium text-ellipsis",children:t.name}),e.jsx("p",{className:"text-muted-foreground",children:t.description})]}),i?e.jsxs("div",{className:"flex items-center gap-x-1",children:[e.jsx(hs,{className:"h-4 w-4 animate-spin text-gray-500"}),e.jsxs("span",{className:"text-sm text-gray-600",children:[d,"..."]})]}):e.jsx(wd,{disabled:!f,checked:r??t.defaultValue,onCheckedChange:e=>async function(e,t){if(p){l(r=>({...r,[e]:t})),u(null);try{const r=await s(p._id,e,t);m(r);const i=a.find(t=>t.slug===e);u(n("features.updateSuccess",{feature:i?.name||"Feature",enabled:String(t)})),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{u(null)},5e3)}catch(t){Re(t,{component:"WorkspaceSettingsFeatures",action:"updateFeature",metadata:{workspaceId:p._id,featureKey:e}})}finally{l(t=>({...t,[e]:null}))}}}(t.slug,e)})]},t._id)})})]})]})};var kd=e=>"checkbox"===e.type,Cd=e=>e instanceof Date,Ed=e=>null==e;const Nd=e=>"object"==typeof e;var jd=e=>!Ed(e)&&!Array.isArray(e)&&Nd(e)&&!Cd(e),Ad=e=>jd(e)&&e.target?kd(e.target)?e.target.checked:e.target.value:e,_d=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),Pd="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function Td(e){if(e instanceof Date)return new Date(e);const t="undefined"!=typeof FileList&&e instanceof FileList;if(Pd&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!(r||jd(e)&&(e=>{const t=e.constructor&&e.constructor.prototype;return jd(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]=Td(e[t]));return n}var Rd=e=>/^\w*$/.test(e),Dd=e=>void 0===e,Id=e=>Array.isArray(e)?e.filter(Boolean):[],Md=e=>Id(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ud=(e,t,r)=>{if(!t||!jd(e))return r;const n=(Rd(t)?[t]:Md(t)).reduce((e,t)=>Ed(e)?e:e[t],e);return Dd(n)||n===e?Dd(e[t])?r:e[t]:n},Ld=e=>"boolean"==typeof e,Od=e=>"function"==typeof e,zd=(e,t,r)=>{let n=-1;const a=Rd(t)?[t]:Md(t),s=a.length,i=s-1;for(;++n<s;){const t=a[n];let s=r;if(n!==i){const r=e[t];s=jd(r)||Array.isArray(r)?r:isNaN(+a[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=s,e=e[t]}};const Fd="blur",Bd="focusout",Wd="change",Vd="onBlur",Gd="onChange",Hd="onSubmit",$d="onTouched",Kd="all",qd="max",Zd="min",Jd="maxLength",Yd="minLength",Xd="pattern",Qd="required",eu="validate",tu=t.createContext(null);tu.displayName="HookFormControlContext";const ru=()=>t.useContext(tu);var nu=(e,t,r,n=!0)=>{const a={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(a,s,{get:()=>{const a=s;return t._proxyFormState[a]!==Kd&&(t._proxyFormState[a]=!n||Kd),r&&(r[a]=!0),e[a]}});return a};const au="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;var su=e=>"string"==typeof e,iu=(e,t,r,n,a)=>su(e)?(n&&t.watch.add(e),Ud(r,e,a)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),Ud(r,e))):(n&&(t.watchAll=!0),r),ou=e=>Ed(e)||!Nd(e);function cu(e,t,r=new WeakSet){if(ou(e)||ou(t))return Object.is(e,t);if(Cd(e)&&Cd(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 s of n){const n=e[s];if(!a.includes(s))return!1;if("ref"!==s){const e=t[s];if(Cd(n)&&Cd(e)||jd(n)&&jd(e)||Array.isArray(n)&&Array.isArray(e)?!cu(n,e,r):!Object.is(n,e))return!1}}return!0}function lu(e){const r=ru(),{name:n,disabled:a,control:s=r,shouldUnregister:i,defaultValue:o,exact:c=!0}=e,l=_d(s._names.array,n),d=t.useMemo(()=>Ud(s._formValues,n,Ud(s._defaultValues,n,o)),[s,n,o]),u=function(e){const r=ru(),{control:n=r,name:a,defaultValue:s,disabled:i,exact:o,compute:c}=e||{},l=t.useRef(s),d=t.useRef(c),u=t.useRef(void 0),p=t.useRef(n),m=t.useRef(a);d.current=c;const[h,f]=t.useState(()=>{const e=n._getWatch(a,l.current);return d.current?d.current(e):e}),g=t.useCallback(e=>{const t=iu(a,n._names,e||n._formValues,!1,l.current);return d.current?d.current(t):t},[n._formValues,n._names,a]),b=t.useCallback(e=>{if(!i){const t=iu(a,n._names,e||n._formValues,!1,l.current);if(d.current){const e=d.current(t);cu(e,u.current)||(f(e),u.current=e)}else f(t)}},[n._formValues,n._names,i,a]);au(()=>(p.current===n&&cu(m.current,a)||(p.current=n,m.current=a,b()),n._subscribe({name:a,formState:{values:!0},exact:o,callback:e=>{b(e.values)}})),[n,o,a,b]),t.useEffect(()=>n._removeUnmounted());const v=p.current!==n,y=m.current,x=t.useMemo(()=>{if(i)return null;const e=!v&&!cu(y,a);return v||e?g():null},[i,v,a,y,g]);return null!==x?x:h}({control:s,name:n,defaultValue:d,exact:c}),p=function(e){const r=ru(),{control:n=r,disabled:a,name:s,exact:i}=e||{},[o,c]=t.useState(n._formState),l=t.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return au(()=>n._subscribe({name:s,formState:l.current,exact:i,callback:e=>{!a&&c({...n._formState,...e})}}),[s,a,i]),t.useEffect(()=>{l.current.isValid&&n._setValid(!0)},[n]),t.useMemo(()=>nu(o,n,l.current,!1),[o,n])}({control:s,name:n,exact:c}),m=t.useRef(e),h=t.useRef(void 0),f=t.useRef(s.register(n,{...e.rules,value:u,...Ld(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const g=t.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ud(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ud(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ud(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ud(p.validatingFields,n)},error:{enumerable:!0,get:()=>Ud(p.errors,n)}}),[p,n]),b=t.useCallback(e=>f.current.onChange({target:{value:Ad(e),name:n},type:Wd}),[n]),v=t.useCallback(()=>f.current.onBlur({target:{value:Ud(s._formValues,n),name:n},type:Fd}),[n,s._formValues]),y=t.useCallback(e=>{const t=Ud(s._fields,n);t&&t._f&&e&&(t._f.ref={focus:()=>Od(e.focus)&&e.focus(),select:()=>Od(e.select)&&e.select(),setCustomValidity:t=>Od(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>Od(e.reportValidity)&&e.reportValidity()})},[s._fields,n]),x=t.useMemo(()=>({name:n,value:u,...Ld(a)||p.disabled?{disabled:p.disabled||a}:{},onChange:b,onBlur:v,ref:y}),[n,a,p.disabled,b,v,y,u]);return t.useEffect(()=>{const e=s._options.shouldUnregister||i,t=h.current;t&&t!==n&&!l&&s.unregister(t),s.register(n,{...m.current.rules,...Ld(m.current.disabled)?{disabled:m.current.disabled}:{}});const r=(e,t)=>{const r=Ud(s._fields,e);r&&r._f&&(r._f.mount=t)};if(r(n,!0),e){const e=Td(Ud(s._options.defaultValues,n,m.current.defaultValue));zd(s._defaultValues,n,e),Dd(Ud(s._formValues,n))&&zd(s._formValues,n,e)}return!l&&s.register(n),h.current=n,()=>{(l?e&&!s._state.action:e)?s.unregister(n):r(n,!1)}},[n,s,l,i]),t.useEffect(()=>{s._setDisabledField({disabled:a,name:n})},[a,n,s]),t.useMemo(()=>({field:x,formState:p,fieldState:g}),[x,p,g])}const du=e=>e.render(lu(e)),uu=t.createContext(null);uu.displayName="HookFormContext";const pu=e=>{const{children:r,watch:n,getValues:a,getFieldState:s,setError:i,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 t.createElement(uu.Provider,{value:t.useMemo(()=>({watch:n,getValues:a,getFieldState:s,setError:i,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,s,a,m,g,p,u,i,b,c,v,l,h,n])},t.createElement(tu.Provider,{value:f},r))};var mu=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},hu=e=>Array.isArray(e)?e:[e],fu=()=>{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 gu(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const a=e[n],s=t[n];if(a&&jd(a)&&s){const e=gu(a,s);jd(e)&&(r[n]=e)}else e[n]&&(r[n]=s)}return r}var bu=e=>jd(e)&&!Object.keys(e).length,vu=e=>"file"===e.type,yu=e=>{if(!Pd)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},xu=e=>"select-multiple"===e.type,wu=e=>"radio"===e.type,Su=e=>yu(e)&&e.isConnected;function ku(e,t){const r=Array.isArray(t)?t:Rd(t)?[t]:Md(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Dd(e)?n++:e[t[n++]];return e}(e,r),a=r.length-1,s=r[a];return n&&delete n[s],0!==a&&(jd(n)&&bu(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!Dd(e[t]))return!1;return!0}(n))&&ku(e,r.slice(0,-1)),e}function Cu(e){return Array.isArray(e)||jd(e)&&!(e=>{for(const t in e)if(Od(e[t]))return!0;return!1})(e)}function Eu(e,t={}){for(const r in e){const n=e[r];Cu(n)?(t[r]=Array.isArray(n)?[]:{},Eu(n,t[r])):Dd(n)||(t[r]=!0)}return t}function Nu(e,t,r){r||(r=Eu(t));for(const n in e){const a=e[n];if(Cu(a))Dd(t)||ou(r[n])?r[n]=Eu(a,Array.isArray(a)?[]:{}):Nu(a,Ed(t)?{}:t[n],r[n]);else{const e=t[n];r[n]=!cu(a,e)}}return r}const ju={value:!1,isValid:!1},Au={value:!0,isValid:!0};var _u=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&&!Dd(e[0].attributes.value)?Dd(e[0].value)||""===e[0].value?Au:{value:e[0].value,isValid:!0}:Au:ju}return ju},Pu=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Dd(e)?e:t?""===e?NaN:e?+e:e:r&&su(e)?new Date(e):n?n(e):e;const Tu={isValid:!1,value:null};var Ru=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Tu):Tu;function Du(e){const t=e.ref;return vu(t)?t.files:wu(t)?Ru(e.refs).value:xu(t)?[...t.selectedOptions].map(({value:e})=>e):kd(t)?_u(e.refs).value:Pu(Dd(t.value)?e.ref.value:t.value,e)}var Iu=e=>e instanceof RegExp,Mu=e=>Dd(e)?e:Iu(e)?e.source:jd(e)?Iu(e.value)?e.value.source:e.value:e,Uu=e=>({isOnSubmit:!e||e===Hd,isOnBlur:e===Vd,isOnChange:e===Gd,isOnAll:e===Kd,isOnTouch:e===$d});const Lu="AsyncFunction";var Ou=e=>!!e&&!!e.validate&&!!(Od(e.validate)&&e.validate.constructor.name===Lu||jd(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===Lu)),zu=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const Fu=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const r=Ud(e,a);if(r){const{_f:e,...s}=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(Fu(s,t))break}else if(jd(s)&&Fu(s,t))break}}};function Bu(e,t,r){const n=Ud(e,r);if(n||Rd(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const n=a.join("."),s=Ud(t,n),i=Ud(e,n);if(s&&!Array.isArray(s)&&r!==n)return{name:r};if(i&&i.type)return{name:n,error:i};if(i&&i.root&&i.root.type)return{name:`${n}.root`,error:i.root};a.pop()}return{name:r}}var Wu=(e,t,r)=>{const n=hu(Ud(e,r));return zd(n,"root",t[r]),zd(e,r,n),e};function Vu(e,t,r="validate"){if(su(e)||Array.isArray(e)&&e.every(su)||Ld(e)&&!e)return{type:r,message:su(e)?e:"",ref:t}}var Gu=e=>jd(e)&&!Iu(e)?e:{value:e,message:""},Hu=async(e,t,r,n,a,s)=>{const{ref:i,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=Ud(r,f);if(!b||t.has(f))return{};const y=o?o[0]:i,x=e=>{a&&y.reportValidity&&(y.setCustomValidity(Ld(e)?"":e||""),y.reportValidity())},w={},S=wu(i),k=kd(i),C=S||k,E=(g||vu(i))&&Dd(i.value)&&Dd(v)||yu(i)&&""===i.value||""===v||Array.isArray(v)&&!v.length,N=mu.bind(null,f,n,w),j=(e,t,r,n=Jd,a=Yd)=>{const s=e?t:r;w[f]={type:e?n:a,message:s,ref:i,...N(e?n:a,s)}};if(s?!Array.isArray(v)||!v.length:c&&(!C&&(E||Ed(v))||Ld(v)&&!v||k&&!_u(o).isValid||S&&!Ru(o).isValid)){const{value:e,message:t}=su(c)?{value:!!c,message:c}:Gu(c);if(e&&(w[f]={type:Qd,message:t,ref:y,...N(Qd,t)},!n))return x(t),w}if(!(E||Ed(u)&&Ed(p))){let e,t;const r=Gu(p),a=Gu(u);if(Ed(v)||isNaN(v)){const n=i.valueAsDate||new Date(v),s=e=>new Date((new Date).toDateString()+" "+e),o="time"==i.type,c="week"==i.type;su(r.value)&&v&&(e=o?s(v)>s(r.value):c?v>r.value:n>new Date(r.value)),su(a.value)&&v&&(t=o?s(v)<s(a.value):c?v<a.value:n<new Date(a.value))}else{const n=i.valueAsNumber||(v?+v:v);Ed(r.value)||(e=n>r.value),Ed(a.value)||(t=n<a.value)}if((e||t)&&(j(!!e,r.message,a.message,qd,Zd),!n))return x(w[f].message),w}if((l||d)&&!E&&(su(v)||s&&Array.isArray(v))){const e=Gu(l),t=Gu(d),r=!Ed(e.value)&&v.length>+e.value,a=!Ed(t.value)&&v.length<+t.value;if((r||a)&&(j(r,e.message,t.message),!n))return x(w[f].message),w}if(m&&!E&&su(v)){const{value:e,message:t}=Gu(m);if(Iu(e)&&!v.match(e)&&(w[f]={type:Xd,message:t,ref:i,...N(Xd,t)},!n))return x(t),w}if(h)if(Od(h)){const e=Vu(await h(v,r),y);if(e&&(w[f]={...e,...N(eu,e.message)},!n))return x(e.message),w}else if(jd(h)){let e={};for(const t in h){if(!bu(e)&&!n)break;const a=Vu(await h[t](v,r),y,t);a&&(e={...a,...N(t,a.message)},x(a.message),n&&(w[f]=e))}if(!bu(e)&&(w[f]={ref:y,...e},!n))return w}return x(!0),w};const $u={mode:Hd,reValidateMode:Gd,shouldFocusError:!0};function Ku(e={}){let t,r={...$u,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Od(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},s=(jd(r.defaultValues)||jd(r.values))&&Td(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:Td(s),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:fu(),state:fu()},h=r.criteriaMode===Kd,f=async e=>{if(!o.keepIsValid&&!r.disabled&&(u.isValid||p.isValid||e)){let e;r.resolver?(e=bu((await x()).errors),g()):e=await w(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?zd(n.validatingFields,e,t):ku(n.validatingFields,e))}),m.state.next({validatingFields:n.validatingFields,isValidating:!bu(n.validatingFields)}))},b=(e,t,r,n)=>{const c=Ud(a,e);if(c){const a=Ud(i,e,Dd(r)?Ud(s,e):r);Dd(a)||n&&n.defaultChecked||t?zd(i,e,t?a:Du(c._f)):C(e,a),o.mount&&!o.action&&f()}},v=(e,t,a,i,o)=>{let c=!1,l=!1;const d={name:e};if(!r.disabled){if(!a||i){(u.isDirty||p.isDirty)&&(l=n.isDirty,n.isDirty=d.isDirty=S(),c=l!==d.isDirty);const r=cu(Ud(s,e),t);l=!!Ud(n.dirtyFields,e),r?ku(n.dirtyFields,e):zd(n.dirtyFields,e,!0),d.dirtyFields=n.dirtyFields,c=c||(u.dirtyFields||p.dirtyFields)&&l!==!r}if(a){const t=Ud(n.touchedFields,e);t||(zd(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,s,i)=>{const o=Ud(n.errors,e),c=(u.isValid||p.isValid)&&Ld(a)&&n.isValid!==a;var d;if(r.delayError&&s?(d=()=>((e,t)=>{zd(n.errors,e,t),m.state.next({errors:n.errors})})(e,s),t=e=>{clearTimeout(l),l=setTimeout(d,e)},t(r.delayError)):(clearTimeout(l),t=null,s?zd(n.errors,e,s):ku(n.errors,e)),(s?!cu(o,s):o)||!bu(i)||c){const t={...i,...c&&Ld(a)?{isValid:a}:{},errors:n.errors,name:e};n={...n,...t},m.state.next(t)}},x=async e=>{g(e,!0);const t=await r.resolver(i,r.context,((e,t,r,n)=>{const a={};for(const r of e){const e=Ud(t,r);e&&zd(a,r,e._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}})(e||c.mount,a,r.criteriaMode,r.shouldUseNativeValidation));return t},w=async(t,a,s={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&&Ou(l._f);d&&u.validatingFields&&g([t.name],!0);const p=await Hu(l,c.disabled,i,h,r.shouldUseNativeValidation&&!a,o);if(d&&u.validatingFields&&g([t.name]),p[t.name]&&(s.valid=!1,a||e.shouldUseNativeValidation))break;!a&&(Ud(p,t.name)?o?Wu(n.errors,p,t.name):zd(n.errors,t.name,p[t.name]):ku(n.errors,t.name))}!bu(o)&&await w(o,a,s)}}return s.valid},S=(e,t)=>!r.disabled&&(e&&t&&zd(i,e,t),!cu(P(),s)),k=(e,t,r)=>iu(e,c,{...o.mount?i:Dd(t)?s:su(e)?{[e]:t}:t},r,t),C=(e,t,r={})=>{const n=Ud(a,e);let s=t;if(n){const r=n._f;r&&(!r.disabled&&zd(i,e,Pu(t,r)),s=yu(r.ref)&&Ed(t)?"":t,xu(r.ref)?[...r.ref.options].forEach(e=>e.selected=s.includes(e.value)):r.refs?kd(r.ref)?r.refs.forEach(e=>{e.defaultChecked&&e.disabled||(Array.isArray(s)?e.checked=!!s.find(t=>t===e.value):e.checked=s===e.value||!!s)}):r.refs.forEach(e=>e.checked=e.value===s):vu(r.ref)?r.ref.value="":(r.ref.value=s,r.ref.type||m.state.next({name:e,values:Td(i)})))}(r.shouldDirty||r.shouldTouch)&&v(e,s,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&_(e)},E=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const s=t[n],i=e+"."+n,o=Ud(a,i);(c.array.has(e)||jd(s)||o&&!o._f)&&!Cd(s)?E(i,s,r):C(i,s,r)}},N=(e,t,r={})=>{const l=Ud(a,e),d=c.array.has(e),h=Td(t);zd(i,e,h),d?(m.array.next({name:e,values:Td(i)}),(u.isDirty||u.dirtyFields||p.isDirty||p.dirtyFields)&&r.shouldDirty&&m.state.next({name:e,dirtyFields:Nu(s,i),isDirty:S(e,h)})):!l||l._f||Ed(h)?C(e,h,r):E(e,h,r),zu(e,c)?m.state.next({...n,name:e,values:Td(i)}):m.state.next({name:o.mount?e:void 0,values:Td(i)})},j=async e=>{o.mount=!0;const s=e.target;let l=s.name,d=!0;const b=Ud(a,l),S=e=>{d=Number.isNaN(e)||Cd(e)&&isNaN(e.getTime())||cu(e,Ud(i,l,e))},k=Uu(r.mode),C=Uu(r.reValidateMode);if(b){let o,E;const N=s.type?Du(b._f):Ad(e),j=e.type===Fd||e.type===Bd,A=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(b._f)&&!r.resolver&&!Ud(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))(j,Ud(n.touchedFields,l),n.isSubmitted,C,k),P=zu(l,c,j);zd(i,l,N),j?s&&s.readOnly||(b._f.onBlur&&b._f.onBlur(e),t&&t(0)):b._f.onChange&&b._f.onChange(e);const T=v(l,N,j),R=!bu(T)||P;if(!j&&m.state.next({name:l,type:e.type,values:Td(i)}),A)return(u.isValid||p.isValid)&&("onBlur"===r.mode?j&&f():j||f()),R&&m.state.next({name:l,...P?{}:T});if(!j&&P&&m.state.next({...n}),r.resolver){const{errors:e}=await x([l]);if(g([l]),S(N),d){const t=Bu(n.errors,a,l),r=Bu(e,a,t.name||l);o=r.error,l=r.name,E=bu(e)}}else g([l],!0),o=(await Hu(b,c.disabled,i,h,r.shouldUseNativeValidation))[l],g([l]),S(N),d&&(o?E=!1:(u.isValid||p.isValid)&&(E=await w(a,!0)));d&&(b._f.deps&&(!Array.isArray(b._f.deps)||b._f.deps.length>0)&&_(b._f.deps),y(l,E,o,T))}},A=(e,t)=>{if(Ud(n.errors,t)&&e.focus)return e.focus(),1},_=async(e,t={})=>{let s,i;const o=hu(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await x(e);if(g(e),e)for(const r of e){const e=Ud(t,r);e?zd(n.errors,r,e):ku(n.errors,r)}else n.errors=t;return t})(Dd(e)?e:o);s=bu(t),i=e?!o.some(e=>Ud(t,e)):s}else e?(i=(await Promise.all(o.map(async e=>{const t=Ud(a,e);return await w(t&&t._f?{[e]:t}:t)}))).every(Boolean),(i||n.isValid)&&f()):i=s=await w(a);return m.state.next({...!su(e)||(u.isValid||p.isValid)&&s!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:s}:{},errors:n.errors}),t.shouldFocus&&!i&&Fu(a,A,e?o:c.mount),i},P=(e,t)=>{let r={...o.mount?i:s};return t&&(r=gu(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),Dd(e)?r:su(e)?Ud(r,e):e.map(e=>Ud(r,e))},T=(e,t)=>({invalid:!!Ud((t||n).errors,e),isDirty:!!Ud((t||n).dirtyFields,e),error:Ud((t||n).errors,e),isValidating:!!Ud(n.validatingFields,e),isTouched:!!Ud((t||n).touchedFields,e)}),R=(e,t,r)=>{const s=(Ud(a,e,{_f:{}})._f||{}).ref,i=Ud(n.errors,e)||{},{ref:o,message:c,type:l,...d}=i;zd(n.errors,e,{...d,...t,ref:s}),m.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&s&&s.focus&&s.focus()},D=e=>m.state.subscribe({next:t=>{var r,a,o;r=e.name,a=t.name,o=e.exact,r&&a&&r!==a&&!hu(r).some(e=>e&&(o?e===a:e.startsWith(a)||a.startsWith(e)))||!((e,t,r,n)=>{r(e);const{name:a,...s}=e;return bu(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(e=>t[e]===(!n||Kd))})(t,e.formState||u,B,e.reRenderRoot)||e.callback({values:{...i},...n,...t,defaultValues:s})}}).unsubscribe,I=(e,t={})=>{for(const o of e?hu(e):c.mount)c.mount.delete(o),c.array.delete(o),t.keepValue||(ku(a,o),ku(i,o)),!t.keepError&&ku(n.errors,o),!t.keepDirty&&ku(n.dirtyFields,o),!t.keepTouched&&ku(n.touchedFields,o),!t.keepIsValidating&&ku(n.validatingFields,o),!r.shouldUnregister&&!t.keepDefaultValue&&ku(s,o);m.state.next({values:Td(i)}),m.state.next({...n,...t.keepDirty?{isDirty:S()}:{}}),!t.keepIsValid&&f()},M=({disabled:e,name:t})=>{if(Ld(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()}},U=(e,t={})=>{let n=Ud(a,e);const i=Ld(t.disabled)||Ld(r.disabled);return zd(a,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),c.mount.add(e),n?M({disabled:Ld(t.disabled)?t.disabled:r.disabled,name:e}):b(e,!0,t.value),{...i?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:Mu(t.min),max:Mu(t.max),minLength:Mu(t.minLength),maxLength:Mu(t.maxLength),pattern:Mu(t.pattern)}:{},name:e,onChange:j,onBlur:j,ref:i=>{if(i){U(e,t),n=Ud(a,e);const r=Dd(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,o=(e=>wu(e)||kd(e))(r),c=n._f.refs||[];if(o?c.find(e=>e===r):r===n._f.ref)return;zd(a,e,{_f:{...n._f,...o?{refs:[...c.filter(Su),r,...Array.isArray(Ud(s,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),b(e,!1,void 0,r)}else n=Ud(a,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!_d(c.array,e)||!o.action)&&c.unMount.add(e)}}},L=()=>r.shouldFocusError&&Fu(a,A,c.mount),O=(e,t)=>async s=>{let o;s&&(s.preventDefault&&s.preventDefault(),s.persist&&s.persist());let l=Td(i);if(m.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await x();g(),n.errors=e,l=Td(t)}else await w(a);if(c.disabled.size)for(const e of c.disabled)ku(l,e);if(ku(n.errors,"root"),bu(n.errors)){m.state.next({errors:{}});try{await e(l,s)}catch(e){o=e}}else t&&await t({...n.errors},s),L(),setTimeout(L);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:bu(n.errors)&&!o,submitCount:n.submitCount+1,errors:n.errors}),o)throw o},z=(e,t={})=>{const l=e?Td(e):s,d=Td(l),p=bu(e),h=p?s:d;if(t.keepDefaultValues||(s=l),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...c.mount,...Object.keys(Nu(s,i))]);for(const t of Array.from(e)){const e=Ud(n.dirtyFields,t),r=Ud(i,t),a=Ud(h,t);e&&!Dd(r)?zd(h,t,r):e||Dd(a)||N(t,a)}}else{if(Pd&&Dd(e))for(const e of c.mount){const t=Ud(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(yu(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of c.mount)N(e,Ud(h,e));else a={}}i=r.shouldUnregister?t.keepDefaultValues?Td(s):{}:Td(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&&!bu(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||cu(e,s))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:p?{}:t.keepDirtyValues?t.keepDefaultValues&&i?Nu(s,i):n.dirtyFields:t.keepDefaultValues&&e?Nu(s,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1,defaultValues:s})},F=(e,t)=>z(Od(e)?e(i):e,{...r.resetOptions,...t}),B=e=>{n={...n,...e}},W={control:{register:U,unregister:I,getFieldState:T,handleSubmit:O,setError:R,_subscribe:D,_runSchema:x,_updateIsValidating:g,_focusError:L,_getWatch:k,_getDirty:S,_setValid:f,_setFieldArray:(e,t=[],c,l,d=!0,h=!0)=>{if(l&&c&&!r.disabled){if(o.action=!0,h&&Array.isArray(Ud(a,e))){const t=c(Ud(a,e),l.argA,l.argB);d&&zd(a,e,t)}if(h&&Array.isArray(Ud(n.errors,e))){const t=c(Ud(n.errors,e),l.argA,l.argB);d&&zd(n.errors,e,t),((e,t)=>{!Id(Ud(e,t)).length&&ku(e,t)})(n.errors,e)}if((u.touchedFields||p.touchedFields)&&h&&Array.isArray(Ud(n.touchedFields,e))){const t=c(Ud(n.touchedFields,e),l.argA,l.argB);d&&zd(n.touchedFields,e,t)}(u.dirtyFields||p.dirtyFields)&&(n.dirtyFields=Nu(s,i)),m.state.next({name:e,isDirty:S(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else zd(i,e,t)},_setDisabledField:M,_setErrors:e=>{n.errors=e,m.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>Id(Ud(o.mount?i:s,e,r.shouldUnregister?Ud(s,e,[]):[])),_reset:z,_resetDefaultValues:()=>Od(r.defaultValues)&&r.defaultValues().then(e=>{F(e,r.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of c.unMount){const t=Ud(a,e);t&&(t._f.refs?t._f.refs.every(e=>!Su(e)):!Su(t._f.ref))&&I(e)}c.unMount=new Set},_disableForm:e=>{Ld(e)&&(m.state.next({disabled:e}),Fu(a,(t,r)=>{const n=Ud(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 i},get _state(){return o},set _state(e){o=e},get _defaultValues(){return s},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},D({...e,formState:{...d,...e.formState}})),trigger:_,register:U,handleSubmit:O,watch:(e,t)=>Od(e)?m.state.subscribe({next:r=>"values"in r&&e(k(void 0,t),r)}):k(e,t,!0),setValue:N,getValues:P,reset:F,resetField:(e,t={})=>{Ud(a,e)&&(Dd(t.defaultValue)?N(e,Td(Ud(s,e))):(N(e,t.defaultValue),zd(s,e,Td(t.defaultValue))),t.keepTouched||ku(n.touchedFields,e),t.keepDirty||(ku(n.dirtyFields,e),n.isDirty=t.defaultValue?S(e,Td(Ud(s,e))):S()),t.keepError||(ku(n.errors,e),u.isValid&&f()),m.state.next({...n}))},clearErrors:e=>{e&&hu(e).forEach(e=>ku(n.errors,e)),m.state.next({errors:e?n.errors:{}})},unregister:I,setError:R,setFocus:(e,t={})=>{const r=Ud(a,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&Od(e.select)&&e.select()})}},getFieldState:T};return{...W,formControl:W}}function qu(e={}){const r=t.useRef(void 0),n=t.useRef(void 0),[a,s]=t.useState({isDirty:!1,isValidating:!1,isLoading:Od(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:Od(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:a},e.defaultValues&&!Od(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:t,...n}=Ku(e);r.current={...n,formState:a}}const i=r.current.control;return i._options=e,au(()=>{const e=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0});return s(e=>({...e,isReady:!0})),i._formState.isReady=!0,e},[i]),t.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),t.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),t.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),t.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),t.useEffect(()=>{if(i._proxyFormState.isDirty){const e=i._getDirty();e!==a.isDirty&&i._subjects.state.next({isDirty:e})}},[i,a.isDirty]),t.useEffect(()=>{var t;e.values&&!cu(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),(null===(t=i._options.resetOptions)||void 0===t?void 0:t.keepIsValid)||i._setValid(),n.current=e.values,s(e=>({...e}))):i._resetDefaultValues()},[i,e.values]),t.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),r.current.formState=t.useMemo(()=>nu(a,i),[i,a]),r.current}const Zu=(e,t,r)=>{if(e&&"reportValidity"in e){const n=Ud(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Ju=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Zu(n.ref,r,e):n&&n.refs&&n.refs.forEach(t=>Zu(t,r,e))}},Yu=(e,t)=>{t.shouldUseNativeValidation&&Ju(e,t);const r={};for(const n in e){const a=Ud(t.fields,n),s=Object.assign(e[n]||{},{ref:a&&a.ref});if(Xu(t.names||Object.keys(e),n)){const e=Object.assign({},Ud(r,n));zd(e,"root",s),zd(r,n,e)}else zd(r,n,s)}return r},Xu=(e,t)=>{const r=Qu(t);return e.some(e=>Qu(e).match(`^${r}\\.\\d+`))};function Qu(e){return e.replace(/\]|\[/g,"")}function ep(e,t,r){function n(r,n){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:n,constr:i,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,n);const a=i.prototype,s=Object.keys(a);for(let e=0;e<s.length;e++){const t=s[e];t in r||(r[t]=a[t].bind(r))}}const a=r?.Parent??Object;class s extends a{}function i(e){var t;const a=r?.Parent?new s:this;n(a,e),(t=a._zod).deferred??(t.deferred=[]);for(const e of a._zod.deferred)e();return a}return Object.defineProperty(s,"name",{value:e}),Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:t=>!!(r?.Parent&&t instanceof r.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class tp extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class rp extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const np={};function ap(e){return np}function sp(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 ip(e,t){return"bigint"==typeof t?t.toString():t}function op(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function cp(e){return null==e}function lp(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const dp=Symbol("evaluating");function up(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==dp)return void 0===n&&(n=dp,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function pp(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function mp(...e){const t={};for(const r of e){const e=Object.getOwnPropertyDescriptors(r);Object.assign(t,e)}return Object.defineProperties({},t)}function hp(e){return JSON.stringify(e)}const fp="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function gp(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const bp=op(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function vp(e){if(!1===gp(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!==gp(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function yp(e){return vp(e)?{...e}:Array.isArray(e)?[...e]:e}const xp=new Set(["string","number","symbol"]);function wp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Sp(e,t,r){const n=new e._zod.constr(t??e._zod.def);return t&&!r?.parent||(n._zod.parent=e),n}function kp(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 Cp(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 Ep(e,t){return t.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function Np(e){return"string"==typeof e?e:e?.message}function jp(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const a=Np(e.inst?._zod.def?.error?.(e))??Np(t?.error?.(e))??Np(r.customError?.(e))??Np(r.localeError?.(e))??"Invalid input";n.message=a}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function Ap(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function _p(...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,ip,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Tp=ep("$ZodError",Pp),Rp=ep("$ZodError",Pp,{Parent:Error});const Dp=e=>(t,r,n,a)=>{const s=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new tp;if(i.issues.length){const t=new(a?.Err??e)(i.issues.map(e=>jp(e,s,ap())));throw fp(t,a?.callee),t}return i.value},Ip=Dp(Rp),Mp=e=>async(t,r,n,a)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const t=new(a?.Err??e)(i.issues.map(e=>jp(e,s,ap())));throw fp(t,a?.callee),t}return i.value},Up=Mp(Rp),Lp=e=>(t,r,n)=>{const a=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},a);if(s instanceof Promise)throw new tp;return s.issues.length?{success:!1,error:new(e??Tp)(s.issues.map(e=>jp(e,a,ap())))}:{success:!0,data:s.value}},Op=Lp(Rp),zp=e=>async(t,r,n)=>{const a=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},a);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(e=>jp(e,a,ap())))}:{success:!0,data:s.value}},Fp=zp(Rp),Bp=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Dp(e)(t,r,a)},Wp=e=>(t,r,n)=>Dp(e)(t,r,n),Vp=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Mp(e)(t,r,a)},Gp=e=>async(t,r,n)=>Mp(e)(t,r,n),Hp=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Lp(e)(t,r,a)},$p=e=>(t,r,n)=>Lp(e)(t,r,n),Kp=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return zp(e)(t,r,a)},qp=e=>async(t,r,n)=>zp(e)(t,r,n),Zp=/^[cC][^\s-]{8,}$/,Jp=/^[0-9a-z]+$/,Yp=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Xp=/^[0-9a-vA-V]{20}$/,Qp=/^[A-Za-z0-9]{27}$/,em=/^[a-zA-Z0-9_-]{21}$/,tm=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,rm=/^([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})$/,nm=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)$/,am=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const sm=/^(?:(?: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])$/,im=/^(([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}|:))$/,om=/^((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])$/,cm=/^(([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])$/,lm=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dm=/^[A-Za-z0-9_-]*$/,um=/^\+[1-9]\d{6,14}$/,pm="(?:(?:\\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])))",mm=new RegExp(`^${pm}$`);function hm(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 fm=/^[^A-Z]*$/,gm=/^[^a-z]*$/,bm=ep("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),vm=ep("$ZodCheckMaxLength",(e,t)=>{var r;bm.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!cp(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=Ap(n);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ym=ep("$ZodCheckMinLength",(e,t)=>{var r;bm.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!cp(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=Ap(n);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),xm=ep("$ZodCheckLengthEquals",(e,t)=>{var r;bm.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!cp(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 s=Ap(n),i=a>t.length;r.issues.push({origin:s,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),wm=ep("$ZodCheckStringFormat",(e,t)=>{var r,n;bm.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=()=>{})}),Sm=ep("$ZodCheckRegex",(e,t)=>{wm.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})}}),km=ep("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=fm),wm.init(e,t)}),Cm=ep("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=gm),wm.init(e,t)}),Em=ep("$ZodCheckIncludes",(e,t)=>{bm.init(e,t);const r=wp(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})}}),Nm=ep("$ZodCheckStartsWith",(e,t)=>{bm.init(e,t);const r=new RegExp(`^${wp(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})}}),jm=ep("$ZodCheckEndsWith",(e,t)=>{bm.init(e,t);const r=new RegExp(`.*${wp(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})}}),Am=ep("$ZodCheckOverwrite",(e,t)=>{bm.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class _m{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},Tm=ep("$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=Cp(e);for(const s of t){if(s._zod.def.when){if(!s._zod.def.when(e))continue}else if(a)continue;const t=e.issues.length,i=s._zod.check(e);if(i instanceof Promise&&!1===r?.async)throw new tp;if(n||i instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await i;e.issues.length!==t&&(a||(a=Cp(e,t)))});else{if(e.issues.length===t)continue;a||(a=Cp(e,t))}}return n?n.then(()=>e):e},r=(r,a,s)=>{if(Cp(r))return r.aborted=!0,r;const i=t(a,n,s);if(i instanceof Promise){if(!1===s.async)throw new tp;return i.then(t=>e._zod.parse(t,s))}return e._zod.parse(i,s)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if("backward"===s.direction){const t=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,a,s)):r(t,a,s)}const i=e._zod.parse(a,s);if(i instanceof Promise){if(!1===s.async)throw new tp;return i.then(e=>t(e,n,s))}return t(i,n,s)}}up(e,"~standard",()=>({validate:t=>{try{const r=Op(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return Fp(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),Rm=ep("$ZodString",(e,t)=>{var r;Tm.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}}),Dm=ep("$ZodStringFormat",(e,t)=>{wm.init(e,t),Rm.init(e,t)}),Im=ep("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=rm),Dm.init(e,t)}),Mm=ep("$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=nm(e))}else t.pattern??(t.pattern=nm());Dm.init(e,t)}),Um=ep("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=am),Dm.init(e,t)}),Lm=ep("$ZodURL",(e,t)=>{Dm.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})}}}),Om=ep("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Dm.init(e,t)}),zm=ep("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=em),Dm.init(e,t)}),Fm=ep("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Zp),Dm.init(e,t)}),Bm=ep("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Jp),Dm.init(e,t)}),Wm=ep("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Yp),Dm.init(e,t)}),Vm=ep("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Xp),Dm.init(e,t)}),Gm=ep("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Qp),Dm.init(e,t)}),Hm=ep("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=hm({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(`^${pm}T(?:${n})$`)}(t)),Dm.init(e,t)}),$m=ep("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=mm),Dm.init(e,t)}),Km=ep("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${hm(t)}$`)),Dm.init(e,t)}),qm=ep("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=tm),Dm.init(e,t)}),Zm=ep("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=sm),Dm.init(e,t),e._zod.bag.format="ipv4"}),Jm=ep("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=im),Dm.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})}}}),Ym=ep("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=om),Dm.init(e,t)}),Xm=ep("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=cm),Dm.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 Qm(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const eh=ep("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=lm),Dm.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Qm(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});const th=ep("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=dm),Dm.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{(function(e){if(!dm.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Qm(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})}}),rh=ep("$ZodE164",(e,t)=>{t.pattern??(t.pattern=um),Dm.init(e,t)});const nh=ep("$ZodJWT",(e,t)=>{Dm.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})}}),ah=ep("$ZodUnknown",(e,t)=>{Tm.init(e,t),e._zod.parse=e=>e}),sh=ep("$ZodNever",(e,t)=>{Tm.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function ih(e,t,r){e.issues.length&&t.issues.push(...Ep(r,e.issues)),t.value[r]=e.value}const oh=ep("$ZodArray",(e,t)=>{Tm.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 s=[];for(let e=0;e<a.length;e++){const i=a[e],o=t.element._zod.run({value:i,issues:[]},n);o instanceof Promise?s.push(o.then(t=>ih(t,r,e))):ih(o,r,e)}return s.length?Promise.all(s).then(()=>r):r}});function ch(e,t,r,n,a){if(e.issues.length){if(a&&!(r in n))return;t.issues.push(...Ep(r,e.issues))}void 0===e.value?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function lh(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 dh(e,t,r,n,a,s){const i=[],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){i.push(a);continue}const s=c.run({value:t[a],issues:[]},n);s instanceof Promise?e.push(s.then(e=>ch(e,r,a,t,d))):ch(s,r,a,t,d)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}const uh=ep("$ZodObject",(e,t)=>{Tm.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=op(()=>lh(t));up(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=gp,s=t.catchall;let i;e._zod.parse=(t,r)=>{i??(i=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=i.shape;for(const e of i.keys){const n=l[e],a="optional"===n._zod.optout,s=n._zod.run({value:o[e],issues:[]},r);s instanceof Promise?c.push(s.then(r=>ch(r,t,e,o,a))):ch(s,t,e,o,a)}return s?dh(c,o,t,r,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),ph=ep("$ZodObjectJIT",(e,t)=>{uh.init(e,t);const r=e._zod.parse,n=op(()=>lh(t));let a;const s=gp,i=!np.jitless,o=i&&bp.value,c=t.catchall;let l;e._zod.parse=(d,u)=>{l??(l=n.value);const p=d.value;return s(p)?i&&o&&!1===u?.async&&!0!==u.jitless?(a||(a=(e=>{const t=new _m(["shape","payload","ctx"]),r=n.value,a=e=>{const t=hp(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const s=Object.create(null);let i=0;for(const e of r.keys)s[e]="key_"+i++;t.write("const newResult = {};");for(const n of r.keys){const r=s[n],i=hp(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 (${i} in input) {\n payload.issues = payload.issues.concat(${r}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n }\n \n if (${r}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${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 ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${r}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${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?dh([],p,d,u,l,e):d):r(d,u):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}});function mh(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=>!Cp(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=>jp(e,n,ap())))}),t)}const hh=ep("$ZodUnion",(e,t)=>{Tm.init(e,t),up(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),up(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),up(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),up(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=>lp(e.source)).join("|")})$`)}});const r=1===t.options.length,n=t.options[0]._zod.run;e._zod.parse=(a,s)=>{if(r)return n(a,s);let i=!1;const o=[];for(const e of t.options){const t=e._zod.run({value:a.value,issues:[]},s);if(t instanceof Promise)o.push(t),i=!0;else{if(0===t.issues.length)return t;o.push(t)}}return i?Promise.all(o).then(t=>mh(t,a,e,s)):mh(o,a,e,s)}}),fh=ep("$ZodIntersection",(e,t)=>{Tm.init(e,t),e._zod.parse=(e,r)=>{const n=e.value,a=t.left._zod.run({value:n,issues:[]},r),s=t.right._zod.run({value:n,issues:[]},r);return a instanceof Promise||s instanceof Promise?Promise.all([a,s]).then(([t,r])=>bh(e,t,r)):bh(e,a,s)}});function gh(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(vp(e)&&vp(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=gh(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=gh(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 bh(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 s=[...n].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length&&a&&e.issues.push({...a,keys:s}),Cp(e))return e;const i=gh(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const vh=ep("$ZodEnum",(e,t)=>{Tm.init(e,t);const r=sp(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(e=>xp.has(typeof e)).map(e=>"string"==typeof e?wp(e):e.toString()).join("|")})$`),e._zod.parse=(t,a)=>{const s=t.value;return n.has(s)||t.issues.push({code:"invalid_value",values:r,input:s,inst:e}),t}}),yh=ep("$ZodTransform",(e,t)=>{Tm.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new rp(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 tp;return r.value=a,r}});function xh(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const wh=ep("$ZodOptional",(e,t)=>{Tm.init(e,t),e._zod.optin="optional",e._zod.optout="optional",up(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),up(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${lp(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=>xh(t,e.value)):xh(n,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),Sh=ep("$ZodExactOptional",(e,t)=>{wh.init(e,t),up(e._zod,"values",()=>t.innerType._zod.values),up(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),kh=ep("$ZodNullable",(e,t)=>{Tm.init(e,t),up(e._zod,"optin",()=>t.innerType._zod.optin),up(e._zod,"optout",()=>t.innerType._zod.optout),up(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${lp(e.source)}|null)$`):void 0}),up(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)}),Ch=ep("$ZodDefault",(e,t)=>{Tm.init(e,t),e._zod.optin="optional",up(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=>Eh(e,t)):Eh(n,t)}});function Eh(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Nh=ep("$ZodPrefault",(e,t)=>{Tm.init(e,t),e._zod.optin="optional",up(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))}),jh=ep("$ZodNonOptional",(e,t)=>{Tm.init(e,t),up(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=>Ah(t,e)):Ah(a,e)}});function Ah(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 _h=ep("$ZodCatch",(e,t)=>{Tm.init(e,t),up(e._zod,"optin",()=>t.innerType._zod.optin),up(e._zod,"optout",()=>t.innerType._zod.optout),up(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=>jp(e,r,ap()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>jp(e,r,ap()))},input:e.value}),e.issues=[]),e)}}),Ph=ep("$ZodPipe",(e,t)=>{Tm.init(e,t),up(e._zod,"values",()=>t.in._zod.values),up(e._zod,"optin",()=>t.in._zod.optin),up(e._zod,"optout",()=>t.out._zod.optout),up(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=>Th(e,t.in,r)):Th(n,t.in,r)}const n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>Th(e,t.out,r)):Th(n,t.out,r)}});function Th(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const Rh=ep("$ZodReadonly",(e,t)=>{Tm.init(e,t),up(e._zod,"propValues",()=>t.innerType._zod.propValues),up(e._zod,"values",()=>t.innerType._zod.values),up(e._zod,"optin",()=>t.innerType?._zod?.optin),up(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(Dh):Dh(n)}});function Dh(e){return e.value=Object.freeze(e.value),e}const Ih=ep("$ZodCustom",(e,t)=>{bm.init(e,t),Tm.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=>Mh(t,r,n,e));Mh(a,r,n,e)}});function Mh(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(_p(e))}}var Uh;class Lh{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)}}(Uh=globalThis).__zod_globalRegistry??(Uh.__zod_globalRegistry=new Lh);const Oh=globalThis.__zod_globalRegistry;function zh(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...kp(t)})}function Fh(e,t){return new vm({check:"max_length",...kp(t),maximum:e})}function Bh(e,t){return new ym({check:"min_length",...kp(t),minimum:e})}function Wh(e,t){return new xm({check:"length_equals",...kp(t),length:e})}function Vh(e){return new Am({check:"overwrite",tx:e})}function Gh(e){const t=function(e,t){const r=new bm({check:"custom",...kp(t)});return r._zod.check=e,r}(r=>(r.addIssue=e=>{if("string"==typeof e)r.issues.push(_p(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(_p(n))}},e(r.value,r)));return t}function Hh(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??Oh,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,s=t.seen.get(e);if(s){s.count++;return r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema}const i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);const o=e._zod.toJSONSchema?.();if(o)i.schema=o;else{const n={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,n);else{const r=i.schema,s=t.processors[a.type];if(!s)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);s(e,t,r,n)}const s=e._zod.parent;s&&(i.ref||(i.ref=s),$h(s,t,n),t.seen.get(s).isParent=!0)}const c=t.metadataRegistry.get(e);c&&Object.assign(i.schema,c),"input"===t.io&&Zh(e)&&(delete i.schema.examples,delete i.schema.default),"input"===t.io&&i.schema._prefault&&((n=i.schema).default??(n.default=i.schema._prefault)),delete i.schema._prefault;return t.seen.get(e).schema}function Kh(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:s}=(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 s=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=s,{defId:s,ref:`${a("__shared")}#/${n}/${s}`}}if(t[1]===r)return{ref:"#"};const a=`#/${n}/`,s=t[1].schema.id??"__schema"+e.counter++;return{defId:s,ref:a+s}})(t);n.def={...n.schema},s&&(n.defId=s);const i=n.schema;for(const e in i)delete i[e];i.$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 s=e.metadataRegistry.get(r[0])?.id;s?a(r):(n.cycle||n.count>1&&"ref"===e.reused)&&a(r)}}function qh(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,s={...a},i=r.ref;if(r.ref=null,i){n(i);const r=e.seen.get(i),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,s);if(t._zod.parent===i)for(const e in a)"$ref"!==e&&"allOf"!==e&&(e in s||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!==i){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 s=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(s[e.defId]=e.def)}e.external||Object.keys(s).length>0&&("draft-2020-12"===e.target?a.$defs=s:a.definitions=s);try{const r=JSON.parse(JSON.stringify(a));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:Jh(t,"input",e.processors),output:Jh(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw new Error("Error converting schema to JSON.")}}function Zh(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 Zh(n.element,r);if("set"===n.type)return Zh(n.valueType,r);if("lazy"===n.type)return Zh(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 Zh(n.innerType,r);if("intersection"===n.type)return Zh(n.left,r)||Zh(n.right,r);if("record"===n.type||"map"===n.type)return Zh(n.keyType,r)||Zh(n.valueType,r);if("pipe"===n.type)return Zh(n.in,r)||Zh(n.out,r);if("object"===n.type){for(const e in n.shape)if(Zh(n.shape[e],r))return!0;return!1}if("union"===n.type){for(const e of n.options)if(Zh(e,r))return!0;return!1}if("tuple"===n.type){for(const e of n.items)if(Zh(e,r))return!0;return!(!n.rest||!Zh(n.rest,r))}return!1}const Jh=(e,t,r={})=>n=>{const{libraryOptions:a,target:s}=n??{},i=Hh({...a??{},target:s,io:t,processors:r});return $h(e,i),Kh(i,e),qh(i,e)},Yh={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Xh=(e,t,r,n)=>{const a=e._zod.def;$h(a.innerType,t,n);t.seen.get(e).ref=a.innerType};function Qh(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}function ef(e,t){for(var r={};e.length;){var n=e[0],a=n.code,s=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var o=n.unionErrors[0].errors[0];r[i]={message:o.message,type:o.code}}else r[i]={message:s,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[i].types,l=c&&c[n.code];r[i]=mu(i,t,r,a,l?[].concat(l,n.message):n.message)}e.shift()}return r}function tf(e,t){for(var r={};e.length;){var n=e[0],a=n.code,s=n.message,i=n.path.join(".");if(!r[i])if("invalid_union"===n.code&&n.errors.length>0){var o=n.errors[0][0];r[i]={message:o.message,type:o.code}}else r[i]={message:s,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[i].types,l=c&&c[n.code];r[i]=mu(i,t,r,a,l?[].concat(l,n.message):n.message)}e.shift()}return r}function rf(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,s){try{return Promise.resolve(Qh(function(){return Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return s.shouldUseNativeValidation&&Ju({},s),{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:Yu(ef(e.errors,!s.shouldUseNativeValidation&&"all"===s.criteriaMode),s)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return"_zod"in e&&"object"==typeof e._zod}(e))return function(n,a,s){try{return Promise.resolve(Qh(function(){return Promise.resolve(("sync"===r.mode?Ip:Up)(e,n,t)).then(function(e){return s.shouldUseNativeValidation&&Ju({},s),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return e instanceof Tp}(e))return{values:{},errors:Yu(tf(e.issues,!s.shouldUseNativeValidation&&"all"===s.criteriaMode),s)};throw e}))}catch(e){return Promise.reject(e)}};throw new Error("Invalid input: not a Zod schema")}const nf=ep("ZodISODateTime",(e,t)=>{Hm.init(e,t),_f.init(e,t)});function af(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...kp(t)})}(nf,e)}const sf=ep("ZodISODate",(e,t)=>{$m.init(e,t),_f.init(e,t)});function of(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...kp(t)})}(sf,e)}const cf=ep("ZodISOTime",(e,t)=>{Km.init(e,t),_f.init(e,t)});function lf(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...kp(t)})}(cf,e)}const df=ep("ZodISODuration",(e,t)=>{qm.init(e,t),_f.init(e,t)});function uf(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...kp(t)})}(df,e)}const pf=ep("ZodError",(e,t)=>{Tp.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,ip,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ip,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),mf=Dp(pf),hf=Mp(pf),ff=Lp(pf),gf=zp(pf),bf=Bp(pf),vf=Wp(pf),yf=Vp(pf),xf=Gp(pf),wf=Hp(pf),Sf=$p(pf),kf=Kp(pf),Cf=qp(pf),Ef=ep("ZodType",(e,t)=>(Tm.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Jh(e,"input"),output:Jh(e,"output")}}),e.toJSONSchema=((e,t={})=>r=>{const n=Hh({...r,processors:t});return $h(e,n),Kh(n,e),qh(n,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(mp(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)=>Sp(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>mf(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>ff(e,t,r),e.parseAsync=async(t,r)=>hf(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>gf(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>bf(e,t,r),e.decode=(t,r)=>vf(e,t,r),e.encodeAsync=async(t,r)=>yf(e,t,r),e.decodeAsync=async(t,r)=>xf(e,t,r),e.safeEncode=(t,r)=>wf(e,t,r),e.safeDecode=(t,r)=>Sf(e,t,r),e.safeEncodeAsync=async(t,r)=>kf(e,t,r),e.safeDecodeAsync=async(t,r)=>Cf(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,...kp(r)})}(vg,e,t)}(t,r)),e.superRefine=t=>e.check(Gh(t)),e.overwrite=t=>e.check(Vh(t)),e.optional=()=>og(e),e.exactOptional=()=>new cg({type:"optional",innerType:e}),e.nullable=()=>dg(e),e.nullish=()=>og(dg(e)),e.nonoptional=t=>function(e,t){return new mg({type:"nonoptional",innerType:e,...kp(t)})}(e,t),e.array=()=>{return function(e,t,r){return new e({type:"array",element:t,...kp(r)})}(Qf,e,t);var t},e.or=t=>function(e,t){return new rg({type:"union",options:e,...kp(t)})}([e,t]),e.and=t=>new ng({type:"intersection",left:e,right:t}),e.transform=t=>gg(e,new sg({type:"transform",transform:t})),e.default=t=>{return r=t,new ug({type:"default",innerType:e,get defaultValue(){return"function"==typeof r?r():yp(r)}});var r},e.prefault=t=>{return r=t,new pg({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof r?r():yp(r)}});var r},e.catch=t=>{return new hg({type:"catch",innerType:e,catchValue:"function"==typeof(r=t)?r:()=>r});var r},e.pipe=t=>gg(e,t),e.readonly=()=>new bg({type:"readonly",innerType:e}),e.describe=t=>{const r=e.clone();return Oh.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>Oh.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Oh.get(e);const r=e.clone();return Oh.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Nf=ep("_ZodString",(e,t)=>{Rm.init(e,t),Ef.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{const n=r;n.type="string";const{minimum:a,maximum:s,format:i,patterns:o,contentEncoding:c}=e._zod.bag;if("number"==typeof a&&(n.minLength=a),"number"==typeof s&&(n.maxLength=s),i&&(n.format=Yh[i]??i,""===n.format&&delete n.format,"time"===i&&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 Sm({check:"string_format",format:"regex",...kp(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Em({check:"string_format",format:"includes",...kp(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Nm({check:"string_format",format:"starts_with",...kp(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new jm({check:"string_format",format:"ends_with",...kp(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Bh(...t)),e.max=(...t)=>e.check(Fh(...t)),e.length=(...t)=>e.check(Wh(...t)),e.nonempty=(...t)=>e.check(Bh(1,...t)),e.lowercase=t=>e.check(function(e){return new km({check:"string_format",format:"lowercase",...kp(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Cm({check:"string_format",format:"uppercase",...kp(e)})}(t)),e.trim=()=>e.check(Vh(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return Vh(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(Vh(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(Vh(e=>e.toUpperCase())),e.slugify=()=>e.check(Vh(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}),jf=ep("ZodString",(e,t)=>{Rm.init(e,t),Nf.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...kp(t)})}(Pf,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...kp(t)})}(Df,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...kp(t)})}(qf,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...kp(t)})}(If,t)),e.guid=t=>e.check(zh(Tf,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...kp(t)})}(Rf,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...kp(t)})}(Rf,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...kp(t)})}(Rf,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...kp(t)})}(Rf,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...kp(t)})}(Mf,t)),e.guid=t=>e.check(zh(Tf,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...kp(t)})}(Uf,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...kp(t)})}(Lf,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...kp(t)})}(Of,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...kp(t)})}(Hf,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...kp(t)})}($f,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...kp(t)})}(zf,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...kp(t)})}(Ff,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...kp(t)})}(Bf,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...kp(t)})}(Wf,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...kp(t)})}(Vf,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...kp(t)})}(Gf,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...kp(t)})}(Kf,t)),e.datetime=t=>e.check(af(t)),e.date=t=>e.check(of(t)),e.time=t=>e.check(lf(t)),e.duration=t=>e.check(uf(t))});function Af(e){return function(e,t){return new e({type:"string",...kp(t)})}(jf,e)}const _f=ep("ZodStringFormat",(e,t)=>{Dm.init(e,t),Nf.init(e,t)}),Pf=ep("ZodEmail",(e,t)=>{Um.init(e,t),_f.init(e,t)}),Tf=ep("ZodGUID",(e,t)=>{Im.init(e,t),_f.init(e,t)}),Rf=ep("ZodUUID",(e,t)=>{Mm.init(e,t),_f.init(e,t)}),Df=ep("ZodURL",(e,t)=>{Lm.init(e,t),_f.init(e,t)}),If=ep("ZodEmoji",(e,t)=>{Om.init(e,t),_f.init(e,t)}),Mf=ep("ZodNanoID",(e,t)=>{zm.init(e,t),_f.init(e,t)}),Uf=ep("ZodCUID",(e,t)=>{Fm.init(e,t),_f.init(e,t)}),Lf=ep("ZodCUID2",(e,t)=>{Bm.init(e,t),_f.init(e,t)}),Of=ep("ZodULID",(e,t)=>{Wm.init(e,t),_f.init(e,t)}),zf=ep("ZodXID",(e,t)=>{Vm.init(e,t),_f.init(e,t)}),Ff=ep("ZodKSUID",(e,t)=>{Gm.init(e,t),_f.init(e,t)}),Bf=ep("ZodIPv4",(e,t)=>{Zm.init(e,t),_f.init(e,t)}),Wf=ep("ZodIPv6",(e,t)=>{Jm.init(e,t),_f.init(e,t)}),Vf=ep("ZodCIDRv4",(e,t)=>{Ym.init(e,t),_f.init(e,t)}),Gf=ep("ZodCIDRv6",(e,t)=>{Xm.init(e,t),_f.init(e,t)}),Hf=ep("ZodBase64",(e,t)=>{eh.init(e,t),_f.init(e,t)}),$f=ep("ZodBase64URL",(e,t)=>{th.init(e,t),_f.init(e,t)}),Kf=ep("ZodE164",(e,t)=>{rh.init(e,t),_f.init(e,t)}),qf=ep("ZodJWT",(e,t)=>{nh.init(e,t),_f.init(e,t)}),Zf=ep("ZodUnknown",(e,t)=>{ah.init(e,t),Ef.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{}});function Jf(){return new Zf({type:"unknown"})}const Yf=ep("ZodNever",(e,t)=>{sh.init(e,t),Ef.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r)=>{r.not={}})(0,0,t)});function Xf(e){return function(e,t){return new e({type:"never",...kp(t)})}(Yf,e)}const Qf=ep("ZodArray",(e,t)=>{oh.init(e,t),Ef.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=r,s=e._zod.def,{minimum:i,maximum:o}=e._zod.bag;"number"==typeof i&&(a.minItems=i),"number"==typeof o&&(a.maxItems=o),a.type="array",a.items=$h(s.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element,e.min=(t,r)=>e.check(Bh(t,r)),e.nonempty=t=>e.check(Bh(1,t)),e.max=(t,r)=>e.check(Fh(t,r)),e.length=(t,r)=>e.check(Wh(t,r)),e.unwrap=()=>e.element});const eg=ep("ZodObject",(e,t)=>{ph.init(e,t),Ef.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=r,s=e._zod.def;a.type="object",a.properties={};const i=s.shape;for(const e in i)a.properties[e]=$h(i[e],t,{...n,path:[...n.path,"properties",e]});const o=new Set(Object.keys(i)),c=new Set([...o].filter(e=>{const r=s.shape[e]._zod;return"input"===t.io?void 0===r.optin:void 0===r.optout}));c.size>0&&(a.required=Array.from(c)),"never"===s.catchall?._zod.def.type?a.additionalProperties=!1:s.catchall?s.catchall&&(a.additionalProperties=$h(s.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(a.additionalProperties=!1)})(e,t,r,n),up(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new ag({type:"enum",entries:r,...kp(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:Jf()}),e.loose=()=>e.clone({...e._zod.def,catchall:Jf()}),e.strict=()=>e.clone({...e._zod.def,catchall:Xf()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!vp(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=mp(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return pp(this,"shape",r),r}});return Sp(e,n)}(e,t),e.safeExtend=t=>function(e,t){if(!vp(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=mp(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return pp(this,"shape",r),r}});return Sp(e,r)}(e,t),e.merge=t=>function(e,t){const r=mp(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return pp(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Sp(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 Sp(e,mp(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 pp(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=mp(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 pp(this,"shape",n),n},checks:[]});return Sp(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=mp(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 pp(this,"shape",a),a},checks:[]});return Sp(t,a)}(ig,e,t[0]),e.required=(...t)=>function(e,t,r){const n=mp(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 pp(this,"shape",a),a}});return Sp(t,n)}(mg,e,t[0])});function tg(e,t){const r={type:"object",shape:e??{},...kp(t)};return new eg(r)}const rg=ep("ZodUnion",(e,t)=>{hh.init(e,t),Ef.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s=!1===a.inclusive,i=a.options.map((e,r)=>$h(e,t,{...n,path:[...n.path,s?"oneOf":"anyOf",r]}));s?r.oneOf=i:r.anyOf=i})(e,t,r,n),e.options=t.options});const ng=ep("ZodIntersection",(e,t)=>{fh.init(e,t),Ef.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s=$h(a.left,t,{...n,path:[...n.path,"allOf",0]}),i=$h(a.right,t,{...n,path:[...n.path,"allOf",1]}),o=e=>"allOf"in e&&1===Object.keys(e).length,c=[...o(s)?s.allOf:[s],...o(i)?i.allOf:[i]];r.allOf=c})(e,t,r,n)});const ag=ep("ZodEnum",(e,t)=>{vh.init(e,t),Ef.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{const n=sp(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 ag({...t,checks:[],...kp(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 ag({...t,checks:[],...kp(n),entries:a})}});const sg=ep("ZodTransform",(e,t)=>{yh.init(e,t),Ef.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 rp(e.constructor.name);r.addIssue=n=>{if("string"==typeof n)r.issues.push(_p(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(_p(t))}};const a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r)):(r.value=a,r)}});const ig=ep("ZodOptional",(e,t)=>{wh.init(e,t),Ef.init(e,t),e._zod.processJSONSchema=(t,r,n)=>Xh(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});function og(e){return new ig({type:"optional",innerType:e})}const cg=ep("ZodExactOptional",(e,t)=>{Sh.init(e,t),Ef.init(e,t),e._zod.processJSONSchema=(t,r,n)=>Xh(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const lg=ep("ZodNullable",(e,t)=>{kh.init(e,t),Ef.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s=$h(a.innerType,t,n),i=t.seen.get(e);"openapi-3.0"===t.target?(i.ref=a.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function dg(e){return new lg({type:"nullable",innerType:e})}const ug=ep("ZodDefault",(e,t)=>{Ch.init(e,t),Ef.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 pg=ep("ZodPrefault",(e,t)=>{Nh.init(e,t),Ef.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 mg=ep("ZodNonOptional",(e,t)=>{jh.init(e,t),Ef.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 hg=ep("ZodCatch",(e,t)=>{_h.init(e,t),Ef.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;let s;$h(a.innerType,t,n),t.seen.get(e).ref=a.innerType;try{s=a.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const fg=ep("ZodPipe",(e,t)=>{Ph.init(e,t),Ef.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s="input"===t.io?"transform"===a.in._zod.def.type?a.out:a.in:a.out;$h(s,t,n),t.seen.get(e).ref=s})(e,t,0,n),e.in=t.in,e.out=t.out});function gg(e,t){return new fg({type:"pipe",in:e,out:t})}const bg=ep("ZodReadonly",(e,t)=>{Rh.init(e,t),Ef.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 vg=ep("ZodCustom",(e,t)=>{Ih.init(e,t),Ef.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 yg={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:"฿"},xg={usd:"🇺🇸",eur:"🇪🇺",gbp:"🇬🇧",jpy:"🇯🇵",cad:"🇨🇦",aud:"🇦🇺",chf:"🇨🇭",cny:"🇨🇳",hkd:"🇭🇰",sgd:"🇸🇬",inr:"🇮🇳",mxn:"🇲🇽",brl:"🇧🇷",nzd:"🇳🇿",sek:"🇸🇪",nok:"🇳🇴",dkk:"🇩🇰",pln:"🇵🇱",thb:"🇹🇭"};function wg(e){return e&&e.trim()?xg[e.trim().toLowerCase()]??"":""}function Sg(e){if(!e||!e.trim())return"";const t=e.trim().toLowerCase();return yg[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()} (${Sg(e)})`}));var kg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=Os(`Primitive.${r}`),s=a.forwardRef((t,a)=>{const{asChild:s,...i}=t,o=s?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(o,{...i,ref:a})});return s.displayName=`Primitive.${r}`,{...t,[r]:s}},{}),Cg=a.forwardRef((t,r)=>e.jsx(kg.label,{...t,ref:r,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));Cg.displayName="Label";var Eg=Cg;const Ng=Hs("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),jg=a.forwardRef(({className:t,...r},n)=>e.jsx(Eg,{ref:n,className:Se(Ng(),t),...r}));jg.displayName=Eg.displayName;const Ag=pu,_g=a.createContext({}),Pg=({...t})=>e.jsx(_g.Provider,{value:{name:t.name},children:e.jsx(du,{...t})}),Tg=()=>{const e=a.useContext(_g),r=a.useContext(Rg),{getFieldState:n,formState:s}=t.useContext(uu),i=n(e.name,s);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=r;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...i}},Rg=a.createContext({}),Dg=a.forwardRef(({className:t,...r},n)=>{const s=a.useId();return e.jsx(Rg.Provider,{value:{id:s},children:e.jsx("div",{ref:n,className:Se("space-y-2",t),...r})})});Dg.displayName="FormItem";const Ig=a.forwardRef(({className:t,...r},n)=>{const{error:a,formItemId:s}=Tg();return e.jsx(jg,{ref:n,className:Se(a&&"text-destructive",t),htmlFor:s,...r})});Ig.displayName="FormLabel";const Mg=a.forwardRef(({...t},r)=>{const{error:n,formItemId:a,formDescriptionId:s,formMessageId:i}=Tg();return e.jsx(zs,{ref:r,id:a,"aria-describedby":n?`${s} ${i}`:`${s}`,"aria-invalid":!!n,...t})});Mg.displayName="FormControl";const Ug=a.forwardRef(({className:t,...r},n)=>{const{formDescriptionId:a}=Tg();return e.jsx("p",{ref:n,id:a,className:Se("text-sm text-muted-foreground",t),...r})});Ug.displayName="FormDescription";const Lg=a.forwardRef(({className:t,children:r,...n},a)=>{const{error:s,formMessageId:i}=Tg(),o=s?String(s?.message):r;return o?e.jsx("p",{ref:a,id:i,className:Se("text-sm font-medium text-destructive",t),...n,children:o}):null});Lg.displayName="FormMessage";const Og=a.forwardRef(({className:t,type:r,...n},a)=>e.jsx("input",{type:r,className:Se("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",t),ref:a,...n}));function zg(t){const r=Fg(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(Wg);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}function Fg(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.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),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?Ds(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}Og.displayName="Input";var Bg=Symbol("radix.slottable");function Wg(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Bg}function Vg(r){const n=r+"CollectionProvider",[a,s]=Zs(n),[i,o]=a(n,{collectionRef:{current:null},itemMap:new Map}),c=r=>{const{scope:n,children:a}=r,s=t.useRef(null),o=t.useRef(new Map).current;return e.jsx(i,{scope:n,itemMap:o,collectionRef:s,children:a})};c.displayName=n;const l=r+"CollectionSlot",d=zg(l),u=t.forwardRef((t,r)=>{const{scope:n,children:a}=t,s=Is(r,o(l,n).collectionRef);return e.jsx(d,{ref:s,children:a})});u.displayName=l;const p=r+"CollectionItemSlot",m="data-radix-collection-item",h=zg(p),f=t.forwardRef((r,n)=>{const{scope:a,children:s,...i}=r,c=t.useRef(null),l=Is(n,c),d=o(p,a);return t.useEffect(()=>(d.itemMap.set(c,{ref:c,...i}),()=>{d.itemMap.delete(c)})),e.jsx(h,{[m]:"",ref:l,children:s})});return f.displayName=p,[{Provider:c,Slot:u,ItemSlot:f},function(e){const n=o(r+"CollectionConsumer",e),a=t.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`)),r=Array.from(n.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current));return r},[n.collectionRef,n.itemMap]);return a},s]}var Gg=a.createContext(void 0);function Hg(e){const t=a.useContext(Gg);return e||t||"ltr"}var $g="rovingFocusGroup.onEntryFocus",Kg={bubbles:!1,cancelable:!0},qg="RovingFocusGroup",[Zg,Jg,Yg]=Vg(qg),[Xg,Qg]=Zs(qg,[Yg]),[eb,tb]=Xg(qg),rb=a.forwardRef((t,r)=>e.jsx(Zg.Provider,{scope:t.__scopeRovingFocusGroup,children:e.jsx(Zg.Slot,{scope:t.__scopeRovingFocusGroup,children:e.jsx(nb,{...t,ref:r})})}));rb.displayName=qg;var nb=a.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:i=!1,dir:o,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:p=!1,...m}=t,h=a.useRef(null),f=Is(r,h),g=Hg(o),[b,v]=ri({prop:c,defaultProp:l??null,onChange:d,caller:qg}),[y,x]=a.useState(!1),w=oi(u),S=Jg(n),k=a.useRef(!1),[C,E]=a.useState(0);return a.useEffect(()=>{const e=h.current;if(e)return e.addEventListener($g,w),()=>e.removeEventListener($g,w)},[w]),e.jsx(eb,{scope:n,orientation:s,dir:g,loop:i,currentTabStopId:b,onItemFocus:a.useCallback(e=>v(e),[v]),onItemShiftTab:a.useCallback(()=>x(!0),[]),onFocusableItemAdd:a.useCallback(()=>E(e=>e+1),[]),onFocusableItemRemove:a.useCallback(()=>E(e=>e-1),[]),children:e.jsx(ii.div,{tabIndex:y||0===C?-1:0,"data-orientation":s,...m,ref:f,style:{outline:"none",...t.style},onMouseDown:qs(t.onMouseDown,()=>{k.current=!0}),onFocus:qs(t.onFocus,e=>{const t=!k.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent($g,Kg);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().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)}}k.current=!1}),onBlur:qs(t.onBlur,()=>x(!1))})})}),ab="RovingFocusGroupItem",sb=a.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:i=!1,tabStopId:o,children:c,...l}=t,d=ei(),u=o||d,p=tb(ab,n),m=p.currentTabStopId===u,h=Jg(n),{onFocusableItemAdd:f,onFocusableItemRemove:g,currentTabStopId:b}=p;return a.useEffect(()=>{if(s)return f(),()=>g()},[s,f,g]),e.jsx(Zg.ItemSlot,{scope:n,id:u,focusable:s,active:i,children:e.jsx(ii.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...l,ref:r,onMouseDown:qs(t.onMouseDown,e=>{s?p.onItemFocus(u):e.preventDefault()}),onFocus:qs(t.onFocus,()=>p.onItemFocus(u)),onKeyDown:qs(t.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:ib[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})})});sb.displayName=ab;var ib={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 cb=rb,lb=sb,db="Radio",[ub,pb]=Zs(db),[mb,hb]=ub(db),fb=a.forwardRef((t,r)=>{const{__scopeRadio:n,name:s,checked:i=!1,required:o,disabled:c,value:l="on",onCheck:d,form:u,...p}=t,[m,h]=a.useState(null),f=Is(r,e=>h(e)),g=a.useRef(!1),b=!m||(u||!!m.closest("form"));return e.jsxs(mb,{scope:n,checked:i,disabled:c,children:[e.jsx(ii.button,{type:"button",role:"radio","aria-checked":i,"data-state":yb(i),"data-disabled":c?"":void 0,disabled:c,value:l,...p,ref:f,onClick:qs(t.onClick,e=>{i||d?.(),b&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),b&&e.jsx(vb,{control:m,bubbles:!g.current,name:s,value:l,checked:i,required:o,disabled:c,form:u,style:{transform:"translateX(-100%)"}})]})});fb.displayName=db;var gb="RadioIndicator",bb=a.forwardRef((t,r)=>{const{__scopeRadio:n,forceMount:a,...s}=t,i=hb(gb,n);return e.jsx(ji,{present:a||i.checked,children:e.jsx(ii.span,{"data-state":yb(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:r})})});bb.displayName=gb;var vb=a.forwardRef(({__scopeRadio:t,control:r,checked:n,bubbles:s=!0,...i},o)=>{const c=a.useRef(null),l=Is(c,o),d=cd(n),u=ld(r);return a.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==n&&r){const t=new Event("click",{bubbles:s});r.call(e,n),e.dispatchEvent(t)}},[d,n,s]),e.jsx(ii.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function yb(e){return e?"checked":"unchecked"}vb.displayName="RadioBubbleInput";var xb=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],wb="RadioGroup",[Sb]=Zs(wb,[Qg,pb]),kb=Qg(),Cb=pb(),[Eb,Nb]=Sb(wb),jb=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,name:a,defaultValue:s,value:i,required:o=!1,disabled:c=!1,orientation:l,dir:d,loop:u=!0,onValueChange:p,...m}=t,h=kb(n),f=Hg(d),[g,b]=ri({prop:i,defaultProp:s??null,onChange:p,caller:wb});return e.jsx(Eb,{scope:n,name:a,required:o,disabled:c,value:g,onValueChange:b,children:e.jsx(cb,{asChild:!0,...h,orientation:l,dir:f,loop:u,children:e.jsx(ii.div,{role:"radiogroup","aria-required":o,"aria-orientation":l,"data-disabled":c?"":void 0,dir:f,...m,ref:r})})})});jb.displayName=wb;var Ab="RadioGroupItem",_b=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,disabled:s,...i}=t,o=Nb(Ab,n),c=o.disabled||s,l=kb(n),d=Cb(n),u=a.useRef(null),p=Is(r,u),m=o.value===i.value,h=a.useRef(!1);return a.useEffect(()=>{const e=e=>{xb.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)}},[]),e.jsx(lb,{asChild:!0,...l,focusable:!c,active:m,children:e.jsx(fb,{disabled:c,required:o.required,checked:m,...d,...i,name:o.name,ref:p,onCheck:()=>o.onValueChange(i.value),onKeyDown:qs(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:qs(i.onFocus,()=>{h.current&&u.current?.click()})})})});_b.displayName=Ab;var Pb=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,...a}=t,s=Cb(n);return e.jsx(bb,{...s,...a,ref:r})});Pb.displayName="RadioGroupIndicator";var Tb=jb,Rb=_b,Db=Pb;const Ib=a.forwardRef(({className:t,...r},n)=>e.jsx(Tb,{className:Se("grid gap-2",t),...r,ref:n}));Ib.displayName=Tb.displayName;const Mb=a.forwardRef(({className:t,...r},n)=>e.jsx(Rb,{ref:n,className:Se("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",t),...r,children:e.jsx(Db,{className:"flex items-center justify-center",children:e.jsx(wc,{className:"h-3.5 w-3.5 fill-primary"})})}));function Ub(e,[t,r]){return Math.min(r,Math.max(t,e))}Mb.displayName=Rb.displayName;var Lb="ScrollArea",[Ob]=Zs(Lb),[zb,Fb]=Ob(Lb),Bb=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,type:s="hover",dir:i,scrollHideDelay:o=600,...c}=t,[l,d]=a.useState(null),[u,p]=a.useState(null),[m,h]=a.useState(null),[f,g]=a.useState(null),[b,v]=a.useState(null),[y,x]=a.useState(0),[w,S]=a.useState(0),[k,C]=a.useState(!1),[E,N]=a.useState(!1),j=Is(r,e=>d(e)),A=Hg(i);return e.jsx(zb,{scope:n,type:s,dir:A,scrollHideDelay:o,scrollArea:l,viewport:u,onViewportChange:p,content:m,onContentChange:h,scrollbarX:f,onScrollbarXChange:g,scrollbarXEnabled:k,onScrollbarXEnabledChange:C,scrollbarY:b,onScrollbarYChange:v,scrollbarYEnabled:E,onScrollbarYEnabledChange:N,onCornerWidthChange:x,onCornerHeightChange:S,children:e.jsx(ii.div,{dir:A,...c,ref:j,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":w+"px",...t.style}})})});Bb.displayName=Lb;var Wb="ScrollAreaViewport",Vb=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,children:s,nonce:i,...o}=t,c=Fb(Wb,n),l=Is(r,a.useRef(null),c.onViewportChange);return e.jsxs(e.Fragment,{children:[e.jsx("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:i}),e.jsx(ii.div,{"data-radix-scroll-area-viewport":"",...o,ref:l,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...t.style},children:e.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})});Vb.displayName=Wb;var Gb="ScrollAreaScrollbar",Hb=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=Fb(Gb,t.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:c}=i,l="horizontal"===t.orientation;return a.useEffect(()=>(l?o(!0):c(!0),()=>{l?o(!1):c(!1)}),[l,o,c]),"hover"===i.type?e.jsx($b,{...s,ref:r,forceMount:n}):"scroll"===i.type?e.jsx(Kb,{...s,ref:r,forceMount:n}):"auto"===i.type?e.jsx(qb,{...s,ref:r,forceMount:n}):"always"===i.type?e.jsx(Zb,{...s,ref:r}):null});Hb.displayName=Gb;var $b=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=Fb(Gb,t.__scopeScrollArea),[o,c]=a.useState(!1);return a.useEffect(()=>{const e=i.scrollArea;let t=0;if(e){const r=()=>{window.clearTimeout(t),c(!0)},n=()=>{t=window.setTimeout(()=>c(!1),i.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[i.scrollArea,i.scrollHideDelay]),e.jsx(ji,{present:n||o,children:e.jsx(qb,{"data-state":o?"visible":"hidden",...s,ref:r})})}),Kb=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=Fb(Gb,t.__scopeScrollArea),o="horizontal"===t.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"}},a.useReducer((e,t)=>p[e][t]??e,u));var u,p;return a.useEffect(()=>{if("idle"===l){const e=window.setTimeout(()=>d("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[l,i.scrollHideDelay,d]),a.useEffect(()=>{const e=i.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)}},[i.viewport,o,d,c]),e.jsx(ji,{present:n||"hidden"!==l,children:e.jsx(Zb,{"data-state":"hidden"===l?"hidden":"visible",...s,ref:r,onPointerEnter:qs(t.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:qs(t.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),qb=a.forwardRef((t,r)=>{const n=Fb(Gb,t.__scopeScrollArea),{forceMount:s,...i}=t,[o,c]=a.useState(!1),l="horizontal"===t.orientation,d=hv(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;c(l?e:t)}},10);return fv(n.viewport,d),fv(n.content,d),e.jsx(ji,{present:s||o,children:e.jsx(Zb,{"data-state":o?"visible":"hidden",...i,ref:r})})}),Zb=a.forwardRef((t,r)=>{const{orientation:n="vertical",...s}=t,i=Fb(Gb,t.__scopeScrollArea),o=a.useRef(null),c=a.useRef(0),[l,d]=a.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=cv(l.viewport,l.content),p={...s,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=lv(r),s=a/2,i=t||s,o=a-i,c=r.scrollbar.paddingStart+i,l=r.scrollbar.size-r.scrollbar.paddingEnd-o,d=r.content-r.viewport,u="ltr"===n?[0,d]:[-1*d,0];return uv([c,l],u)(e)}(e,c.current,l,t)}return"horizontal"===n?e.jsx(Jb,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&o.current){const e=dv(i.viewport.scrollLeft,l,i.dir);o.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=m(e,i.dir))}}):"vertical"===n?e.jsx(Yb,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&o.current){const e=dv(i.viewport.scrollTop,l);o.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=m(e))}}):null}),Jb=a.forwardRef((t,r)=>{const{sizes:n,onSizesChange:s,...i}=t,o=Fb(Gb,t.__scopeScrollArea),[c,l]=a.useState(),d=a.useRef(null),u=Is(r,d,o.onScrollbarXChange);return a.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),e.jsx(ev,{"data-orientation":"horizontal",...i,ref:u,sizes:n,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":lv(n)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.x),onDragScroll:e=>t.onDragScroll(e.x),onWheelScroll:(e,r)=>{if(o.viewport){const n=o.viewport.scrollLeft+e.deltaX;t.onWheelScroll(n),pv(n,r)&&e.preventDefault()}},onResize:()=>{d.current&&o.viewport&&c&&s({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:ov(c.paddingLeft),paddingEnd:ov(c.paddingRight)}})}})}),Yb=a.forwardRef((t,r)=>{const{sizes:n,onSizesChange:s,...i}=t,o=Fb(Gb,t.__scopeScrollArea),[c,l]=a.useState(),d=a.useRef(null),u=Is(r,d,o.onScrollbarYChange);return a.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),e.jsx(ev,{"data-orientation":"vertical",...i,ref:u,sizes:n,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":lv(n)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.y),onDragScroll:e=>t.onDragScroll(e.y),onWheelScroll:(e,r)=>{if(o.viewport){const n=o.viewport.scrollTop+e.deltaY;t.onWheelScroll(n),pv(n,r)&&e.preventDefault()}},onResize:()=>{d.current&&o.viewport&&c&&s({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:ov(c.paddingTop),paddingEnd:ov(c.paddingBottom)}})}})}),[Xb,Qb]=Ob(Gb),ev=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,sizes:s,hasThumb:i,onThumbChange:o,onThumbPointerUp:c,onThumbPointerDown:l,onThumbPositionChange:d,onDragScroll:u,onWheelScroll:p,onResize:m,...h}=t,f=Fb(Gb,n),[g,b]=a.useState(null),v=Is(r,e=>b(e)),y=a.useRef(null),x=a.useRef(""),w=f.viewport,S=s.content-s.viewport,k=oi(p),C=oi(d),E=hv(m,10);function N(e){if(y.current){const t=e.clientX-y.current.left,r=e.clientY-y.current.top;u({x:t,y:r})}}return a.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})},[w,g,S,k]),a.useEffect(C,[s,C]),fv(g,E),fv(f.content,E),e.jsx(Xb,{scope:n,scrollbar:g,hasThumb:i,onThumbChange:oi(o),onThumbPointerUp:oi(c),onThumbPositionChange:C,onThumbPointerDown:oi(l),children:e.jsx(ii.div,{...h,ref:v,style:{position:"absolute",...h.style},onPointerDown:qs(t.onPointerDown,e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),y.current=g.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),N(e)}}),onPointerMove:qs(t.onPointerMove,N),onPointerUp:qs(t.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=x.current,f.viewport&&(f.viewport.style.scrollBehavior=""),y.current=null})})})}),tv="ScrollAreaThumb",rv=a.forwardRef((t,r)=>{const{forceMount:n,...a}=t,s=Qb(tv,t.__scopeScrollArea);return e.jsx(ji,{present:n||s.hasThumb,children:e.jsx(nv,{ref:r,...a})})}),nv=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,style:s,...i}=t,o=Fb(tv,n),c=Qb(tv,n),{onThumbPositionChange:l}=c,d=Is(r,e=>c.onThumbChange(e)),u=a.useRef(void 0),p=hv(()=>{u.current&&(u.current(),u.current=void 0)},100);return a.useEffect(()=>{const e=o.viewport;if(e){const t=()=>{if(p(),!u.current){const t=mv(e,l);u.current=t,l()}};return l(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,p,l]),e.jsx(ii.div,{"data-state":c.hasThumb?"visible":"hidden",...i,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:qs(t.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;c.onThumbPointerDown({x:r,y:n})}),onPointerUp:qs(t.onPointerUp,c.onThumbPointerUp)})});rv.displayName=tv;var av="ScrollAreaCorner",sv=a.forwardRef((t,r)=>{const n=Fb(av,t.__scopeScrollArea),a=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&a?e.jsx(iv,{...t,ref:r}):null});sv.displayName=av;var iv=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,...s}=t,i=Fb(av,n),[o,c]=a.useState(0),[l,d]=a.useState(0),u=Boolean(o&&l);return fv(i.scrollbarX,()=>{const e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),d(e)}),fv(i.scrollbarY,()=>{const e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),c(e)}),u?e.jsx(ii.div,{...s,ref:r,style:{width:o,height:l,position:"absolute",right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:0,...t.style}}):null});function ov(e){return e?parseInt(e,10):0}function cv(e,t){const r=e/t;return isNaN(r)?0:r}function lv(e){const t=cv(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function dv(e,t,r="ltr"){const n=lv(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-a,i=t.content-t.viewport,o=s-n,c=Ub(e,"ltr"===r?[0,i]:[-1*i,0]);return uv([0,i],[0,o])(c)}function uv(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 pv(e,t){return e>0&&e<t}var mv=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function a(){const s={left:e.scrollLeft,top:e.scrollTop},i=r.left!==s.left,o=r.top!==s.top;(i||o)&&t(),r=s,n=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(n)};function hv(e,t){const r=oi(e),n=a.useRef(0);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),a.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function fv(e,t){const r=oi(t);Ys(()=>{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 gv=Bb,bv=Vb,vv=sv;const yv=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(gv,{ref:a,className:Se("relative overflow-hidden",t),...n,children:[e.jsx(bv,{className:"h-full w-full rounded-[inherit]",children:r}),e.jsx(xv,{}),e.jsx(vv,{})]}));yv.displayName=gv.displayName;const xv=a.forwardRef(({className:t,orientation:r="vertical",...n},a)=>e.jsx(Hb,{ref:a,orientation:r,className:Se("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]",t),...n,children:e.jsx(rv,{className:Se("relative rounded-full bg-border","vertical"===r&&"flex-1")})}));function wv(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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}</text></svg>`}xv.displayName=Hb.displayName;const Sv=["🏢","🏬","🏣","🏤","🏦","🏛️","🏠","🏡","🏭","🏗️","🏪","🏨","🏫","🏥","💼","📊","📈","📉","📋","📁","📂","🗂️","🗃️","🗄️","📅","🗓️","📝","🖋️","✏️","🖊️","🖌️","🖍️","📇","📌","📍","📎","🖇️","💻","🖥️","🖨️","🖱️","⌨️","📱","📲","📡","🌐","🔗","🔒","🔓","⚙️","🔧","🛠️","🧑💻","👨💻","👩💻","🕹️","💾","📟","🖥️","🖲️","🚀","💡","🎨","🖼️","🧪","🔬","🧬","🎯","⚡","🎲","🎮","🧩","📷","🎥","✉️","📨","📩","📧","📞","☎️","📠","🗣️","💬","🗨️","📢","📣","🔔","🛎️","💰","💸","💳","🏦","📈","📉","⚖️","🧾","🪙","🏛️","⚗️","🧪","🔭","🔬","🩺","🧬","🩻","🏥","🌱","🌍","🌏","🌎","🌡️","👨💼","👩💼","👨🏫","👩🏫","👨🔬","👩🔬","👨🎨","👩🎨","👨🔧","👩🔧","👨🚀","👩🚀","👨⚖️","👩⚖️","🏅","🎖️","🥇","🥈","🥉","🏆","🎗️","🔑","🗝️","🧭","🛡️","🚩","🏳️🌈","🎟️","🎫"],kv=({workspace:r})=>{const{t:n}=sn(),{updateWorkspace:a}=wC(),{can:s}=ad(),[i,o]=t.useState(!1),[c,l]=t.useState("emoji"),[d,u]=t.useState(),[p,m]=t.useState(null),h=t.useRef(null);t.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const f=qu({resolver:rf(tg({name:Af().min(2,{message:n("general.nameMinLength")}),image:Af().optional()})),defaultValues:{name:r.name||"",image:r.image||""}});if(!r)return e.jsx(id,{});const g=s(jl.WORKSPACE_SETTINGS_EDIT);return e.jsxs("div",{children:[p&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:n("settings.common.success")}),e.jsx("p",{className:"text-sm",children:p})]}),!g&&e.jsx("div",{className:"text-red-500",children:n("general.ownerOnly")}),e.jsx(Ag,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){o(!0),m(null);try{await a(r,e),m(n("general.success")),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{m(null)},5e3)}catch(e){Re(e,{component:"WorkspaceSettingsGeneral",action:"updateWorkspace",metadata:{workspaceId:r._id}})}finally{o(!1)}}),className:"space-y-6",children:[e.jsx(Pg,{control:f.control,name:"name",render:({field:t})=>e.jsxs(Dg,{children:[e.jsx(Ig,{children:n("general.name")}),e.jsx(Mg,{children:e.jsx(Og,{placeholder:n("general.namePlaceholder"),...t,disabled:!g})}),e.jsx(Lg,{})]})}),r.billingCurrency?.trim()&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(jg,{className:"text-sm font-medium text-muted-foreground",children:n("general.billingCurrency")}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[wg(r.billingCurrency)&&e.jsx("span",{className:"text-base",children:wg(r.billingCurrency)}),e.jsx("span",{children:r.billingCurrency.trim().toUpperCase()})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(jg,{className:"text-sm font-medium",children:n("general.icon")}),e.jsx(Ug,{children:n("general.iconDescription")})]}),e.jsxs(Ib,{value:c,disabled:!g,onValueChange:e=>l(e),className:"flex flex-col space-y-3",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Mb,{value:"emoji",id:"emoji"}),e.jsxs(jg,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(Es,{className:"h-4 w-4"}),n("general.chooseEmoji")]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Mb,{value:"url",id:"url"}),e.jsxs(jg,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(ms,{className:"h-4 w-4"}),n("general.customImageUrl")]})]})]}),"emoji"===c&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e.jsxs("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:[d&&e.jsx("span",{className:"text-2xl",children:d}),!d&&f.watch("image")?.trim()&&e.jsx("img",{src:f.watch("image")||void 0,alt:"Workspace preview"})]})]}),g&&e.jsx(yv,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Sv.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{u(e),f.setValue("image",wv(e))})(t),disabled:!g,className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(d===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===c&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(Pg,{control:f.control,name:"image",render:({field:t})=>e.jsxs(Dg,{children:[e.jsx(Ig,{children:n("general.imageUrl")}),e.jsx(Mg,{children:e.jsx(Og,{placeholder:n("general.imageUrlPlaceholder"),...t,disabled:!g})}),e.jsx(Ug,{children:n("general.imageUrlDescription")}),e.jsx(Lg,{})]})}),f.watch("image")&&f.watch("image")?.trim()&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e.jsx("img",{src:f.watch("image")||void 0,className:"w-full h-full object-cover",alt:"Workspace preview"})})]})]})]}),e.jsx("div",{className:"flex justify-end gap-3 pt-4",children:g&&e.jsx(Ks,{type:"submit",disabled:i,progress:i,children:n("general.updateWorkspace")})})]})})]})};class Cv extends gn{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 Ev=t.createContext(null);function Nv(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 jv=t.memo(function({children:r,serviceWorkerPath:n="/push-sw.js",autoSubscribe:a=!1}){const{t:s}=sn(),i=Sn(),{isAuthenticated:o}=nd(),c=t.useMemo(()=>"undefined"!=typeof window&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window,[]),l=t.useMemo(()=>new Cv({serverUrl:i.serverUrl,version:i.version,orgId:i.orgId}),[i.serverUrl,i.version,i.orgId]),[d,u]=t.useState({permission:c?Notification.permission:"default",isSubscribed:!1,isSupported:c,loading:!1,error:null});t.useEffect(()=>{if(!o||!c)return;let e=!1;return(async()=>{try{const t=await navigator.serviceWorker.getRegistration(n);if(e)return;if(!t)return void u(e=>({...e,isSubscribed:!1}));const r=await t.pushManager.getSubscription();if(e)return;u(e=>({...e,isSubscribed:!!r,permission:Notification.permission}))}catch{e||u(e=>({...e,isSubscribed:!1}))}})(),()=>{e=!0}},[o,c,n]);const p=t.useCallback(async()=>{if(!c)return!1;const e=await Notification.requestPermission();return u(t=>({...t,permission:e})),"granted"===e},[c]),m=t.useCallback(async()=>{if(c&&o){u(e=>({...e,loading:!0,error:null}));try{if(!await p())return void u(e=>({...e,loading:!1,error:s("notifications.permissionDenied")}));const{publicKey:e}=await l.getVapidPublicKey(),t=await navigator.serviceWorker.register(n);await navigator.serviceWorker.ready;const r=(await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Nv(e)})).toJSON();await l.subscribe({endpoint:r.endpoint,keys:{p256dh:r.keys.p256dh,auth:r.keys.auth}},navigator.userAgent),u(e=>({...e,isSubscribed:!0,loading:!1}))}catch(e){const t=e instanceof Error?e.message:s("push.failedToSubscribe");u(e=>({...e,loading:!1,error:t})),Re(e,{component:"PushNotificationProvider",action:"subscribe"})}}},[c,o,l,n,p]),h=t.useCallback(async()=>{if(c){u(e=>({...e,loading:!0,error:null}));try{const e=await navigator.serviceWorker.getRegistration(n);if(e){const t=await e.pushManager.getSubscription();if(t){const e=t.endpoint;await t.unsubscribe(),await l.unsubscribe(e)}}u(e=>({...e,isSubscribed:!1,loading:!1}))}catch(e){const t=e instanceof Error?e.message:s("push.failedToUnsubscribe");u(e=>({...e,loading:!1,error:t})),Re(e,{component:"PushNotificationProvider",action:"unsubscribe"})}}},[c,l,n]),f=t.useMemo(()=>({...d,requestPermission:p,subscribe:m,unsubscribe:h}),[d,p,m,h]);return e.jsx(Ev.Provider,{value:f,children:r})});function Av(){const e=t.useContext(Ev);if(!e)throw new Error("usePushNotifications must be used within PushNotificationProvider");return e}const _v={firefox:4,safari:4,edge:4,chrome:4},Pv=({workspace:r})=>{const{isSupported:n,permission:a,isSubscribed:s,loading:i,error:o,subscribe:c,unsubscribe:l}=Av(),{t:d}=sn(),{api:u}=En(),{can:p}=ad(),m=p(jl.WORKSPACE_SETTINGS_EDIT),h=t.useMemo(()=>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"}(),[]),f=_v[h],[g,b]=t.useState([]),[v,y]=t.useState(!0),[x,w]=t.useState({}),[S,k]=t.useState(!0),[C,E]=t.useState(null),[N,j]=t.useState(null),A=t.useRef(null);t.useEffect(()=>()=>{A.current&&clearTimeout(A.current)},[]),t.useEffect(()=>{if(!r?._id)return;const e=r._id.toString();y(!0),k(!0),Promise.all([u.getNotificationEvents(e).catch(()=>[]),u.getNotificationPreferences(e).catch(()=>({}))]).then(([e,t])=>{b(e),w(t)}).finally(()=>{y(!1),k(!1)})},[r?._id]);const _=t.useCallback(async(e,t,n)=>{if(!r?._id||!m)return;const a=!n;E(`${e}.${t}`),j(null),w(r=>({...r,[e]:{...r[e],[t]:a}}));try{const n=await u.updateNotificationPreferences(r._id.toString(),{[e]:{[t]:a}});w(n),j(d("notifications.prefsSaved")),A.current&&clearTimeout(A.current),A.current=setTimeout(()=>j(null),3e3)}catch(r){w(r=>({...r,[e]:{...r[e],[t]:n}})),Re(r,{component:"SettingsNotifications",action:"toggleChannel"})}finally{E(null)}},[r?._id,m,u,d]),P=(e,t)=>!1!==x[e]?.[t],T=t.useMemo(()=>{const e=new Map;for(const t of g){const r=t.category||"general";e.has(r)||e.set(r,[]),e.get(r).push(t)}return Array.from(e.entries())},[g]),R=v||S,D=g.length>0;return e.jsxs("div",{className:"space-y-6",children:[e.jsx("p",{className:"text-sm text-gray-600",children:d("notifications.manageDescription")}),n&&e.jsxs(e.Fragment,{children:[o&&"denied"!==a&&e.jsx("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg text-sm",children:o}),"denied"===a&&e.jsx("div",{className:"border border-amber-200 bg-amber-50 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ws,{className:"h-5 w-5 text-amber-600 shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-amber-800",children:d("notifications.blocked")}),e.jsx("p",{className:"text-xs text-amber-700 mt-1",children:d("notifications.blockedDescription")}),e.jsx("ol",{className:"text-xs text-amber-700 mt-2 space-y-1 list-decimal list-inside",children:Array.from({length:f},(t,r)=>e.jsx("li",{children:d(`notifications.unblock.${h}.step${r+1}`)},r))})]})]})}),"denied"!==a&&e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5 p-2 rounded-lg "+(s?"bg-green-100":"bg-gray-100"),children:s?e.jsx(ts,{className:"h-4 w-4 text-green-600"}):e.jsx(es,{className:"h-4 w-4 text-gray-400"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900",children:d("notifications.pushTitle")}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:d("notifications.pushDescription",{subscribed:String(s)})})]})]}),e.jsx(Ks,{variant:s?"outline":"default",size:"sm",className:"shrink-0",onClick:s?l:c,disabled:i,progress:i,children:d("notifications.toggleAction",{loading:String(i),subscribed:String(s)})})]}),s&&e.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 text-xs text-gray-500",children:d("notifications.deviceNote")})]})]}),R&&e.jsx("div",{className:"text-center text-sm text-gray-400 py-4",children:d("notifications.loadingPrefs")}),!R&&D&&m&&e.jsxs(e.Fragment,{children:[N&&e.jsx("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded-lg text-sm",children:N}),T.map(([t,r])=>e.jsxs("div",{className:"border rounded-lg overflow-hidden",children:[e.jsx("div",{className:"bg-gray-50 px-4 py-2.5 border-b",children:e.jsx("h4",{className:"text-sm font-medium text-gray-700 capitalize",children:t})}),e.jsxs("div",{className:"divide-y",children:[e.jsxs("div",{className:"flex items-center px-4 py-2 bg-gray-50/50",children:[e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsx("div",{className:"w-12 flex justify-center",children:e.jsx(fs,{className:"h-3.5 w-3.5 text-gray-400"})}),e.jsx("div",{className:"w-12 flex justify-center",children:e.jsx(Cs,{className:"h-3.5 w-3.5 text-gray-400"})})]})]}),r.map(t=>{const r=P(t.slug,"email"),n=P(t.slug,"push"),a=C===`${t.slug}.email`,s=C===`${t.slug}.push`;return e.jsxs("div",{className:"flex items-center px-4 py-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-gray-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:t.description})]}),e.jsxs("div",{className:"flex items-center gap-6 shrink-0",children:[e.jsx("div",{className:"w-12 flex justify-center",children:t.channels.email?e.jsx(wd,{checked:r,onCheckedChange:()=>_(t.slug,"email",r),disabled:a}):e.jsx("span",{className:"text-xs text-gray-300",children:"—"})}),e.jsx("div",{className:"w-12 flex justify-center",children:t.channels.push?e.jsx(wd,{checked:n,onCheckedChange:()=>_(t.slug,"push",n),disabled:s}):e.jsx("span",{className:"text-xs text-gray-300",children:"—"})})]})]},t.slug)})]})]},t))]})]})},Tv=({workspace:r})=>{const{t:n}=sn(),{isOwner:a}=ad(),{settings:s}=Cn(),{appPermissions:i}=Gn(),{updateWorkspacePermissions:o}=wC(),[c,l]=t.useState(!1),[d,u]=t.useState(null),p=t.useRef(null);t.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const m=t.useMemo(()=>s?.workspace?.roles??r.roles??[],[s?.workspace?.roles,r.roles]),h=t.useMemo(()=>{if(!i)return[];const e=new Set;for(const t of Object.values(i))for(const r of t)r.startsWith("workspace:")||e.add(r);return Array.from(e).sort()},[i]),[f,g]=t.useState({});if(t.useEffect(()=>{if(!i)return;const e=r.permissions,t={};for(const r of m)t[r]=e&&r in e?e[r].filter(e=>!e.startsWith("workspace:")):r in i?i[r].filter(e=>!e.startsWith("workspace:")):[];g(t)},[r.permissions,i,m]),!r)return e.jsx(id,{});if(!i||0===h.length)return null;return e.jsxs("div",{children:[d&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:n("settings.common.success")}),e.jsx("p",{className:"text-sm",children:d})]}),!a&&e.jsx("div",{className:"text-red-500 mb-4",children:n("permissions.ownerOnly")}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:n("permissions.description")}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b",children:[e.jsx("th",{className:"text-start py-2 pe-4 font-medium text-gray-500 min-w-[160px]"}),m.map(t=>e.jsx("th",{className:"text-center py-2 px-3 font-medium text-gray-700 capitalize min-w-[80px]",children:t},t))]})}),e.jsx("tbody",{children:h.map(t=>e.jsxs("tr",{className:"border-b border-gray-50 hover:bg-gray-50/50",children:[e.jsx("td",{className:"py-2 pe-4 text-gray-700 font-mono text-xs",children:t}),m.map(r=>{const n="admin"===r,s=n||(f[r]??[]).includes(t);return e.jsx("td",{className:"text-center py-2 px-3",children:e.jsx(wd,{checked:s,disabled:!a||n,onCheckedChange:()=>((e,t)=>{g(r=>{const n=r[e]??[],a=n.includes(t);return{...r,[e]:a?n.filter(e=>e!==t):[...n,t]}})})(r,t),className:"mx-auto"})},r)})]},t))})]})}),a&&e.jsx("div",{className:"mt-6",children:e.jsx(Ks,{onClick:async()=>{l(!0),u(null);try{const e=r.permissions??{},t={},a=new Set([...Object.keys(e),...Object.keys(f)]);for(const r of a){const n=(e[r]??[]).filter(e=>e.startsWith("workspace:")),a=f[r]??[];t[r]=[...n,...a]}await o(r._id,t),u(n("permissions.saveSuccess")),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>u(null),5e3)}catch(e){Re(e,{component:"WorkspaceSettingsPermissions",action:"savePermissions",metadata:{workspaceId:r._id}})}finally{l(!1)}},disabled:c,progress:c,children:n(c?"permissions.saving":"permissions.save")})})]})};var Rv=.999,Dv=/[\\\/_+.#"@\[\(\{&]/,Iv=/[\\\/_+.#"@\[\(\{&]/g,Mv=/[\s-]/,Uv=/[\s-]/g;function Lv(e,t,r,n,a,s,i){if(s===t.length)return a===e.length?1:.99;var o=`${a},${s}`;if(void 0!==i[o])return i[o];for(var c,l,d,u,p=n.charAt(s),m=r.indexOf(p,a),h=0;m>=0;)(c=Lv(e,t,r,n,m+1,s+1,i))>h&&(m===a?c*=1:Dv.test(e.charAt(m-1))?(c*=.8,(d=e.slice(a,m-1).match(Iv))&&a>0&&(c*=Math.pow(Rv,d.length))):Mv.test(e.charAt(m-1))?(c*=.9,(u=e.slice(a,m-1).match(Uv))&&a>0&&(c*=Math.pow(Rv,u.length))):(c*=.17,a>0&&(c*=Math.pow(Rv,m-a))),e.charAt(m)!==t.charAt(s)&&(c*=.9999)),(c<.1&&r.charAt(m-1)===n.charAt(s+1)||n.charAt(s+1)===n.charAt(s)&&r.charAt(m-1)!==n.charAt(s))&&(.1*(l=Lv(e,t,r,n,m+1,s+2,i))>c&&(c=.1*l)),c>h&&(h=c),m=r.indexOf(p,m+1);return i[o]=h,h}function Ov(e){return e.toLowerCase().replace(Uv," ")}function zv(e,t,r){return Lv(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,Ov(e),Ov(t),0,0,{})}var Fv='[cmdk-group=""]',Bv='[cmdk-group-items=""]',Wv='[cmdk-item=""]',Vv=`${Wv}:not([aria-disabled="true"])`,Gv="cmdk-item-select",Hv="data-value",$v=(e,t,r)=>zv(e,t,r),Kv=a.createContext(void 0),qv=()=>a.useContext(Kv),Zv=a.createContext(void 0),Jv=()=>a.useContext(Zv),Yv=a.createContext(void 0),Xv=a.forwardRef((e,t)=>{let r=py(()=>{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}}}),n=py(()=>new Set),s=py(()=>new Map),i=py(()=>new Map),o=py(()=>new Set),c=dy(e),{label:l,children:d,value:u,onValueChange:p,filter:m,shouldFilter:h,loop:f,disablePointerSelection:g=!1,vimBindings:b=!0,...v}=e,y=ei(),x=ei(),w=ei(),S=a.useRef(null),k=fy();uy(()=>{if(void 0!==u){let e=u.trim();r.current.value=e,C.emit()}},[u]),uy(()=>{k(6,P)},[]);let C=a.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var a,s,i,o;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)_(),j(),k(1,A);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(w);e?e.focus():null==(a=document.getElementById(y))||a.focus()}if(k(7,()=>{var e;r.current.selectedItemId=null==(e=T())?void 0:e.id,C.emit()}),n||k(5,P),void 0!==(null==(s=c.current)?void 0:s.value)){let e=null!=t?t:"";return void(null==(o=(i=c.current).onValueChange)||o.call(i,e))}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),E=a.useMemo(()=>({value:(e,t,n)=>{var a;t!==(null==(a=i.current.get(e))?void 0:a.value)&&(i.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,N(t,n)),k(2,()=>{j(),C.emit()}))},item:(e,t)=>(n.current.add(e),t&&(s.current.has(t)?s.current.get(t).add(e):s.current.set(t,new Set([e]))),k(3,()=>{_(),j(),r.current.value||A(),C.emit()}),()=>{i.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=T();k(4,()=>{_(),(null==t?void 0:t.getAttribute("id"))===e&&A(),C.emit()})}),group:e=>(s.current.has(e)||s.current.set(e,new Set),()=>{i.current.delete(e),s.current.delete(e)}),filter:()=>c.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:y,inputId:w,labelId:x,listInnerRef:S}),[]);function N(e,t){var n,a;let s=null!=(a=null==(n=c.current)?void 0:n.filter)?a:$v;return e?s(e,r.current.search,t):0}function j(){if(!r.current.search||!1===c.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=s.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;R().sort((t,r)=>{var n,a;let s=t.getAttribute("id"),i=r.getAttribute("id");return(null!=(n=e.get(i))?n:0)-(null!=(a=e.get(s))?a:0)}).forEach(e=>{let t=e.closest(Bv);t?t.appendChild(e.parentElement===t?e:e.closest(`${Bv} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${Bv} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=S.current)?void 0:t.querySelector(`${Fv}[${Hv}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function A(){let e=R().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(Hv);C.setState("value",t||void 0)}function _(){var e,t,a,o;if(!r.current.search||!1===c.current.shouldFilter)return void(r.current.filtered.count=n.current.size);r.current.filtered.groups=new Set;let l=0;for(let s of n.current){let n=N(null!=(t=null==(e=i.current.get(s))?void 0:e.value)?t:"",null!=(o=null==(a=i.current.get(s))?void 0:a.keywords)?o:[]);r.current.filtered.items.set(s,n),n>0&&l++}for(let[e,t]of s.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 P(){var e,t,r;let n=T();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(Fv))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function T(){var e;return null==(e=S.current)?void 0:e.querySelector(`${Wv}[aria-selected="true"]`)}function R(){var e;return Array.from((null==(e=S.current)?void 0:e.querySelectorAll(Vv))||[])}function D(e){let t=R()[e];t&&C.setState("value",t.getAttribute(Hv))}function I(e){var t;let r=T(),n=R(),a=n.findIndex(e=>e===r),s=n[a+e];null!=(t=c.current)&&t.loop&&(s=a+e<0?n[n.length-1]:a+e===n.length?n[0]:n[a+e]),s&&C.setState("value",s.getAttribute(Hv))}function M(e){let t,r=T(),n=null==r?void 0:r.closest(Fv);for(;n&&!t;)n=e>0?cy(n,Fv):ly(n,Fv),t=null==n?void 0:n.querySelector(Vv);t?C.setState("value",t.getAttribute(Hv)):I(e)}let U=()=>D(R().length-1),L=e=>{e.preventDefault(),e.metaKey?U():e.altKey?M(1):I(1)},O=e=>{e.preventDefault(),e.metaKey?D(0):e.altKey?M(-1):I(-1)};return a.createElement(ii.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&&L(e);break;case"ArrowDown":L(e);break;case"p":case"k":b&&e.ctrlKey&&O(e);break;case"ArrowUp":O(e);break;case"Home":e.preventDefault(),D(0);break;case"End":e.preventDefault(),U();break;case"Enter":{e.preventDefault();let t=T();if(t){let e=new Event(Gv);t.dispatchEvent(e)}}}}},a.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:by},l),gy(e,e=>a.createElement(Zv.Provider,{value:C},a.createElement(Kv.Provider,{value:E},e))))}),Qv=a.forwardRef((e,t)=>{var r,n;let s=ei(),i=a.useRef(null),o=a.useContext(Yv),c=qv(),l=dy(e),d=null!=(n=null==(r=l.current)?void 0:r.forceMount)?n:null==o?void 0:o.forceMount;uy(()=>{if(!d)return c.item(s,null==o?void 0:o.id)},[d]);let u=hy(s,i,[e.value,e.children,i],e.keywords),p=Jv(),m=my(e=>e.value&&e.value===u.current),h=my(e=>!(!d&&!1!==c.filter())||(!e.search||e.filtered.items.get(s)>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(a.useEffect(()=>{let t=i.current;if(t&&!e.disabled)return t.addEventListener(Gv,f),()=>t.removeEventListener(Gv,f)},[h,e.onSelect,e.disabled]),!h)return null;let{disabled:b,value:v,onSelect:y,forceMount:x,keywords:w,...S}=e;return a.createElement(ii.div,{ref:Ds(i,t),...S,id:s,"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)}),ey=a.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:s,...i}=e,o=ei(),c=a.useRef(null),l=a.useRef(null),d=ei(),u=qv(),p=my(e=>!(!s&&!1!==u.filter())||(!e.search||e.filtered.groups.has(o)));uy(()=>u.group(o),[]),hy(o,c,[e.value,e.heading,l]);let m=a.useMemo(()=>({id:o,forceMount:s}),[s]);return a.createElement(ii.div,{ref:Ds(c,t),...i,"cmdk-group":"",role:"presentation",hidden:!p||void 0},r&&a.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:d},r),gy(e,e=>a.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?d:void 0},a.createElement(Yv.Provider,{value:m},e))))}),ty=a.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,s=a.useRef(null),i=my(e=>!e.search);return r||i?a.createElement(ii.div,{ref:Ds(s,t),...n,"cmdk-separator":"",role:"separator"}):null}),ry=a.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,s=null!=e.value,i=Jv(),o=my(e=>e.search),c=my(e=>e.selectedItemId),l=qv();return a.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),a.createElement(ii.input,{ref:t,...n,"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:s?e.value:o,onChange:e=>{s||i.setState("search",e.target.value),null==r||r(e.target.value)}})}),ny=a.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...s}=e,i=a.useRef(null),o=a.useRef(null),c=my(e=>e.selectedItemId),l=qv();return a.useEffect(()=>{if(o.current&&i.current){let e,t=o.current,r=i.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)}}},[]),a.createElement(ii.div,{ref:Ds(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":n,id:l.listId},gy(e,e=>a.createElement("div",{ref:Ds(o,l.listInnerRef),"cmdk-list-sizer":""},e)))}),ay=a.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:i,container:o,...c}=e;return a.createElement(lc,{open:r,onOpenChange:n},a.createElement(uc,{container:o},a.createElement(pc,{"cmdk-overlay":"",className:s}),a.createElement(mc,{"aria-label":e.label,"cmdk-dialog":"",className:i},a.createElement(Xv,{ref:t,...c}))))}),sy=a.forwardRef((e,t)=>my(e=>0===e.filtered.count)?a.createElement(ii.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),iy=a.forwardRef((e,t)=>{let{progress:r,children:n,label:s="Loading...",...i}=e;return a.createElement(ii.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},gy(e,e=>a.createElement("div",{"aria-hidden":!0},e)))}),oy=Object.assign(Xv,{List:ny,Item:Qv,Input:ry,Group:ey,Separator:ty,Dialog:ay,Empty:sy,Loading:iy});function cy(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function ly(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function dy(e){let t=a.useRef(e);return uy(()=>{t.current=e}),t}var uy="undefined"==typeof window?a.useEffect:a.useLayoutEffect;function py(e){let t=a.useRef();return void 0===t.current&&(t.current=e()),t}function my(e){let t=Jv(),r=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,r,r)}function hy(e,t,r,n=[]){let s=a.useRef(),i=qv();return uy(()=>{var a;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():s.current}})(),c=n.map(e=>e.trim());i.value(e,o,c),null==(a=t.current)||a.setAttribute(Hv,o),s.current=o}),s}var fy=()=>{let[e,t]=a.useState(),r=py(()=>new Map);return uy(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function gy({asChild:e,children:t},r){return e&&a.isValidElement(t)?a.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 by={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const vy=a.forwardRef(({className:t,...r},n)=>e.jsx(oy,{ref:n,className:Se("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...r}));vy.displayName=oy.displayName;const yy=a.forwardRef(({className:t,...r},n)=>e.jsxs("div",{className:"flex items-center border-b px-3","data-cmdk-input-wrapper":"",children:[e.jsx(Ec,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(oy.Input,{ref:n,className:Se("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",t),...r})]}));yy.displayName=oy.Input.displayName;const xy=a.forwardRef(({className:t,...r},n)=>e.jsx(oy.List,{ref:n,className:Se("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...r}));xy.displayName=oy.List.displayName;a.forwardRef((t,r)=>e.jsx(oy.Empty,{ref:r,className:"py-6 text-center text-sm",...t})).displayName=oy.Empty.displayName;const wy=a.forwardRef(({className:t,...r},n)=>e.jsx(oy.Group,{ref:n,className:Se("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",t),...r}));wy.displayName=oy.Group.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(oy.Separator,{ref:n,className:Se("-mx-1 h-px bg-border",t),...r})).displayName=oy.Separator.displayName;const Sy=a.forwardRef(({className:t,...r},n)=>e.jsx(oy.Item,{ref:n,className:Se("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",t),...r}));Sy.displayName=oy.Item.displayName;const ky=["top","right","bottom","left"],Cy=Math.min,Ey=Math.max,Ny=Math.round,jy=Math.floor,Ay=e=>({x:e,y:e}),_y={left:"right",right:"left",bottom:"top",top:"bottom"},Py={start:"end",end:"start"};function Ty(e,t,r){return Ey(e,Cy(t,r))}function Ry(e,t){return"function"==typeof e?e(t):e}function Dy(e){return e.split("-")[0]}function Iy(e){return e.split("-")[1]}function My(e){return"x"===e?"y":"x"}function Uy(e){return"y"===e?"height":"width"}const Ly=new Set(["top","bottom"]);function Oy(e){return Ly.has(Dy(e))?"y":"x"}function zy(e){return My(Oy(e))}function Fy(e){return e.replace(/start|end/g,e=>Py[e])}const By=["left","right"],Wy=["right","left"],Vy=["top","bottom"],Gy=["bottom","top"];function Hy(e,t,r,n){const a=Iy(e);let s=function(e,t,r){switch(e){case"top":case"bottom":return r?t?Wy:By:t?By:Wy;case"left":case"right":return t?Vy:Gy;default:return[]}}(Dy(e),"start"===r,n);return a&&(s=s.map(e=>e+"-"+a),t&&(s=s.concat(s.map(Fy)))),s}function $y(e){return e.replace(/left|right|bottom|top/g,e=>_y[e])}function Ky(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 qy(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 Zy(e,t,r){let{reference:n,floating:a}=e;const s=Oy(t),i=zy(t),o=Uy(i),c=Dy(t),l="y"===s,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(Iy(t)){case"start":m[i]-=p*(r&&l?-1:1);break;case"end":m[i]+=p*(r&&l?-1:1)}return m}async function Jy(e,t){var r;void 0===t&&(t={});const{x:n,y:a,platform:s,rects:i,elements:o,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:m=0}=Ry(t,e),h=Ky(m),f=o[p?"floating"===u?"reference":"floating":u],g=qy(await s.getClippingRect({element:null==(r=await(null==s.isElement?void 0:s.isElement(f)))||r?f:f.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(o.floating)),boundary:l,rootBoundary:d,strategy:c})),b="floating"===u?{x:n,y:a,width:i.floating.width,height:i.floating.height}:i.reference,v=await(null==s.getOffsetParent?void 0:s.getOffsetParent(o.floating)),y=await(null==s.isElement?void 0:s.isElement(v))&&await(null==s.getScale?void 0:s.getScale(v))||{x:1,y:1},x=qy(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:b,offsetParent:v,strategy:c}):b);return{top:(g.top-x.top+h.top)/y.y,bottom:(x.bottom-g.bottom+h.bottom)/y.y,left:(g.left-x.left+h.left)/y.x,right:(x.right-g.right+h.right)/y.x}}function Yy(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Xy(e){return ky.some(t=>e[t]>=0)}const Qy=new Set(["left","top"]);function ex(){return"undefined"!=typeof window}function tx(e){return ax(e)?(e.nodeName||"").toLowerCase():"#document"}function rx(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function nx(e){var t;return null==(t=(ax(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ax(e){return!!ex()&&(e instanceof Node||e instanceof rx(e).Node)}function sx(e){return!!ex()&&(e instanceof Element||e instanceof rx(e).Element)}function ix(e){return!!ex()&&(e instanceof HTMLElement||e instanceof rx(e).HTMLElement)}function ox(e){return!(!ex()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof rx(e).ShadowRoot)}const cx=new Set(["inline","contents"]);function lx(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=wx(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!cx.has(a)}const dx=new Set(["table","td","th"]);function ux(e){return dx.has(tx(e))}const px=[":popover-open",":modal"];function mx(e){return px.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const hx=["transform","translate","scale","rotate","perspective"],fx=["transform","translate","scale","rotate","perspective","filter"],gx=["paint","layout","strict","content"];function bx(e){const t=vx(),r=sx(e)?wx(e):e;return hx.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||fx.some(e=>(r.willChange||"").includes(e))||gx.some(e=>(r.contain||"").includes(e))}function vx(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const yx=new Set(["html","body","#document"]);function xx(e){return yx.has(tx(e))}function wx(e){return rx(e).getComputedStyle(e)}function Sx(e){return sx(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kx(e){if("html"===tx(e))return e;const t=e.assignedSlot||e.parentNode||ox(e)&&e.host||nx(e);return ox(t)?t.host:t}function Cx(e){const t=kx(e);return xx(t)?e.ownerDocument?e.ownerDocument.body:e.body:ix(t)&&lx(t)?t:Cx(t)}function Ex(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const a=Cx(e),s=a===(null==(n=e.ownerDocument)?void 0:n.body),i=rx(a);if(s){const e=Nx(i);return t.concat(i,i.visualViewport||[],lx(a)?a:[],e&&r?Ex(e):[])}return t.concat(a,Ex(a,[],r))}function Nx(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jx(e){const t=wx(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=ix(e),s=a?e.offsetWidth:r,i=a?e.offsetHeight:n,o=Ny(r)!==s||Ny(n)!==i;return o&&(r=s,n=i),{width:r,height:n,$:o}}function Ax(e){return sx(e)?e:e.contextElement}function _x(e){const t=Ax(e);if(!ix(t))return Ay(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:s}=jx(t);let i=(s?Ny(r.width):r.width)/n,o=(s?Ny(r.height):r.height)/a;return i&&Number.isFinite(i)||(i=1),o&&Number.isFinite(o)||(o=1),{x:i,y:o}}const Px=Ay(0);function Tx(e){const t=rx(e);return vx()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Px}function Rx(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const a=e.getBoundingClientRect(),s=Ax(e);let i=Ay(1);t&&(n?sx(n)&&(i=_x(n)):i=_x(e));const o=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==rx(e))&&t}(s,r,n)?Tx(s):Ay(0);let c=(a.left+o.x)/i.x,l=(a.top+o.y)/i.y,d=a.width/i.x,u=a.height/i.y;if(s){const e=rx(s),t=n&&sx(n)?rx(n):n;let r=e,a=Nx(r);for(;a&&n&&t!==r;){const e=_x(a),t=a.getBoundingClientRect(),n=wx(a),s=t.left+(a.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(a.clientTop+parseFloat(n.paddingTop))*e.y;c*=e.x,l*=e.y,d*=e.x,u*=e.y,c+=s,l+=i,r=rx(a),a=Nx(r)}}return qy({width:d,height:u,x:c,y:l})}function Dx(e,t){const r=Sx(e).scrollLeft;return t?t.left+r:Rx(nx(e)).left+r}function Ix(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-Dx(e,r),y:r.top+t.scrollTop}}const Mx=new Set(["absolute","fixed"]);function Ux(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=rx(e),n=nx(e),a=r.visualViewport;let s=n.clientWidth,i=n.clientHeight,o=0,c=0;if(a){s=a.width,i=a.height;const e=vx();(!e||e&&"fixed"===t)&&(o=a.offsetLeft,c=a.offsetTop)}const l=Dx(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,i=Math.abs(n.clientWidth-t.clientWidth-a);i<=25&&(s-=i)}else l<=25&&(s+=l);return{width:s,height:i,x:o,y:c}}(e,r);else if("document"===t)n=function(e){const t=nx(e),r=Sx(e),n=e.ownerDocument.body,a=Ey(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=Ey(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Dx(e);const o=-r.scrollTop;return"rtl"===wx(n).direction&&(i+=Ey(t.clientWidth,n.clientWidth)-a),{width:a,height:s,x:i,y:o}}(nx(e));else if(sx(t))n=function(e,t){const r=Rx(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,s=ix(e)?_x(e):Ay(1);return{width:e.clientWidth*s.x,height:e.clientHeight*s.y,x:a*s.x,y:n*s.y}}(t,r);else{const r=Tx(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return qy(n)}function Lx(e,t){const r=kx(e);return!(r===t||!sx(r)||xx(r))&&("fixed"===wx(r).position||Lx(r,t))}function Ox(e,t,r){const n=ix(t),a=nx(t),s="fixed"===r,i=Rx(e,!0,s,t);let o={scrollLeft:0,scrollTop:0};const c=Ay(0);function l(){c.x=Dx(a)}if(n||!n&&!s)if(("body"!==tx(t)||lx(a))&&(o=Sx(t)),n){const e=Rx(t,!0,s,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else a&&l();s&&!n&&a&&l();const d=!a||n||s?Ay(0):Ix(a,o);return{x:i.left+o.scrollLeft-c.x-d.x,y:i.top+o.scrollTop-c.y-d.y,width:i.width,height:i.height}}function zx(e){return"static"===wx(e).position}function Fx(e,t){if(!ix(e)||"fixed"===wx(e).position)return null;if(t)return t(e);let r=e.offsetParent;return nx(e)===r&&(r=r.ownerDocument.body),r}function Bx(e,t){const r=rx(e);if(mx(e))return r;if(!ix(e)){let t=kx(e);for(;t&&!xx(t);){if(sx(t)&&!zx(t))return t;t=kx(t)}return r}let n=Fx(e,t);for(;n&&ux(n)&&zx(n);)n=Fx(n,t);return n&&xx(n)&&zx(n)&&!bx(n)?r:n||function(e){let t=kx(e);for(;ix(t)&&!xx(t);){if(bx(t))return t;if(mx(t))return null;t=kx(t)}return null}(e)||r}const Wx={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const s="fixed"===a,i=nx(n),o=!!t&&mx(t.floating);if(n===i||o&&s)return r;let c={scrollLeft:0,scrollTop:0},l=Ay(1);const d=Ay(0),u=ix(n);if((u||!u&&!s)&&(("body"!==tx(n)||lx(i))&&(c=Sx(n)),ix(n))){const e=Rx(n);l=_x(n),d.x=e.x+n.clientLeft,d.y=e.y+n.clientTop}const p=!i||u||s?Ay(0):Ix(i,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:nx,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const s=[..."clippingAncestors"===r?mx(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=Ex(e,[],!1).filter(e=>sx(e)&&"body"!==tx(e)),a=null;const s="fixed"===wx(e).position;let i=s?kx(e):e;for(;sx(i)&&!xx(i);){const t=wx(i),r=bx(i);r||"fixed"!==t.position||(a=null),(s?!r&&!a:!r&&"static"===t.position&&a&&Mx.has(a.position)||lx(i)&&!r&&Lx(e,i))?n=n.filter(e=>e!==i):a=t,i=kx(i)}return t.set(e,n),n}(t,this._c):[].concat(r),n],i=s[0],o=s.reduce((e,r)=>{const n=Ux(t,r,a);return e.top=Ey(n.top,e.top),e.right=Cy(n.right,e.right),e.bottom=Cy(n.bottom,e.bottom),e.left=Ey(n.left,e.left),e},Ux(t,i,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:Ox(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}=jx(e);return{width:t,height:r}},getScale:_x,isElement:sx,isRTL:function(e){return"rtl"===wx(e).direction}};function Vx(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Gx(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:o="function"==typeof IntersectionObserver,animationFrame:c=!1}=n,l=Ax(e),d=a||s?[...l?Ex(l):[],...Ex(t)]:[];d.forEach(e=>{a&&e.addEventListener("scroll",r,{passive:!0}),s&&e.addEventListener("resize",r)});const u=l&&o?function(e,t){let r,n=null;const a=nx(e);function s(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function i(o,c){void 0===o&&(o=!1),void 0===c&&(c=1),s();const l=e.getBoundingClientRect(),{left:d,top:u,width:p,height:m}=l;if(o||t(),!p||!m)return;const h={rootMargin:-jy(u)+"px "+-jy(a.clientWidth-(d+p))+"px "+-jy(a.clientHeight-(u+m))+"px "+-jy(d)+"px",threshold:Ey(0,Cy(1,c))||1};let f=!0;function g(t){const n=t[0].intersectionRatio;if(n!==c){if(!f)return i();n?i(!1,n):r=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==n||Vx(l,e.getBoundingClientRect())||i(),f=!1}try{n=new IntersectionObserver(g,{...h,root:a.ownerDocument})}catch(e){n=new IntersectionObserver(g,h)}n.observe(e)}(!0),s}(l,r):null;let p,m=-1,h=null;i&&(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?Rx(e):null;return c&&function t(){const n=Rx(e);f&&!Vx(f,n)&&r();f=n,p=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{a&&e.removeEventListener("scroll",r),s&&e.removeEventListener("resize",r)}),null==u||u(),null==(e=h)||e.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const Hx=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:s,placement:i,middlewareData:o}=t,c=await async function(e,t){const{placement:r,platform:n,elements:a}=e,s=await(null==n.isRTL?void 0:n.isRTL(a.floating)),i=Dy(r),o=Iy(r),c="y"===Oy(r),l=Qy.has(i)?-1:1,d=s&&c?-1:1,u=Ry(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 i===(null==(r=o.offset)?void 0:r.placement)&&null!=(n=o.arrow)&&n.alignmentOffset?{}:{x:a+c.x,y:s+c.y,data:{...c,placement:i}}}}},$x=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a,platform:s}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:c={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=Ry(e,t),d={x:r,y:n},u=await s.detectOverflow(t,l),p=Oy(Dy(a)),m=My(p);let h=d[m],f=d[p];if(i){const e="y"===m?"bottom":"right";h=Ty(h+u["y"===m?"top":"left"],h,h-u[e])}if(o){const e="y"===p?"bottom":"right";f=Ty(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]:i,[p]:o}}}}}},Kx=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:s,rects:i,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}=Ry(e,t);if(null!=(r=s.arrow)&&r.alignmentOffset)return{};const b=Dy(a),v=Oy(o),y=Dy(o)===o,x=await(null==c.isRTL?void 0:c.isRTL(l.floating)),w=p||(y||!f?[$y(o)]:function(e){const t=$y(e);return[Fy(e),t,Fy(t)]}(o)),S="none"!==h;!p&&S&&w.push(...Hy(o,f,h,x));const k=[o,...w],C=await c.detectOverflow(t,g),E=[];let N=(null==(n=s.flip)?void 0:n.overflows)||[];if(d&&E.push(C[b]),u){const e=function(e,t,r){void 0===r&&(r=!1);const n=Iy(e),a=zy(e),s=Uy(a);let i="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=$y(i)),[i,$y(i)]}(a,i,x);E.push(C[e[0]],C[e[1]])}if(N=[...N,{placement:a,overflows:E}],!E.every(e=>e<=0)){var j,A;const e=((null==(j=s.flip)?void 0:j.index)||0)+1,t=k[e];if(t){if(!("alignment"===u&&v!==Oy(t))||N.every(e=>Oy(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:N},reset:{placement:t}}}let r=null==(A=N.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:A.placement;if(!r)switch(m){case"bestFit":{var _;const e=null==(_=N.filter(e=>{if(S){const t=Oy(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:_[0];e&&(r=e);break}case"initialPlacement":r=o}if(a!==r)return{reset:{placement:r}}}return{}}}},qx=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:s,platform:i,elements:o}=t,{apply:c=()=>{},...l}=Ry(e,t),d=await i.detectOverflow(t,l),u=Dy(a),p=Iy(a),m="y"===Oy(a),{width:h,height:f}=s.floating;let g,b;"top"===u||"bottom"===u?(g=u,b=p===(await(null==i.isRTL?void 0:i.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,x=Cy(f-d[g],v),w=Cy(h-d[b],y),S=!t.middlewareData.shift;let k=x,C=w;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(C=y),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(k=v),S&&!p){const e=Ey(d.left,0),t=Ey(d.right,0),r=Ey(d.top,0),n=Ey(d.bottom,0);m?C=h-2*(0!==e||0!==t?e+t:Ey(d.left,d.right)):k=f-2*(0!==r||0!==n?r+n:Ey(d.top,d.bottom))}await c({...t,availableWidth:C,availableHeight:k});const E=await i.getDimensions(o.floating);return h!==E.width||f!==E.height?{reset:{rects:!0}}:{}}}},Zx=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:a="referenceHidden",...s}=Ry(e,t);switch(a){case"referenceHidden":{const e=Yy(await n.detectOverflow(t,{...s,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Xy(e)}}}case"escaped":{const e=Yy(await n.detectOverflow(t,{...s,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:Xy(e)}}}default:return{}}}}},Jx=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:s,platform:i,elements:o,middlewareData:c}=t,{element:l,padding:d=0}=Ry(e,t)||{};if(null==l)return{};const u=Ky(d),p={x:r,y:n},m=zy(a),h=Uy(m),f=await i.getDimensions(l),g="y"===m,b=g?"top":"left",v=g?"bottom":"right",y=g?"clientHeight":"clientWidth",x=s.reference[h]+s.reference[m]-p[m]-s.floating[h],w=p[m]-s.reference[m],S=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l));let k=S?S[y]:0;k&&await(null==i.isElement?void 0:i.isElement(S))||(k=o.floating[y]||s.floating[h]);const C=x/2-w/2,E=k/2-f[h]/2-1,N=Cy(u[b],E),j=Cy(u[v],E),A=N,_=k-f[h]-j,P=k/2-f[h]/2+C,T=Ty(A,P,_),R=!c.arrow&&null!=Iy(a)&&P!==T&&s.reference[h]/2-(P<A?N:j)-f[h]/2<0,D=R?P<A?P-A:P-_:0;return{[m]:p[m]+D,data:{[m]:T,centerOffset:P-T-D,...R&&{alignmentOffset:D}},reset:R}}}),Yx=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:s,middlewareData:i}=t,{offset:o=0,mainAxis:c=!0,crossAxis:l=!0}=Ry(e,t),d={x:r,y:n},u=Oy(a),p=My(u);let m=d[p],h=d[u];const f=Ry(o,t),g="number"==typeof f?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const e="y"===p?"height":"width",t=s.reference[p]-s.floating[e]+g.mainAxis,r=s.reference[p]+s.reference[e]-g.mainAxis;m<t?m=t:m>r&&(m=r)}if(l){var b,v;const e="y"===p?"width":"height",t=Qy.has(Dy(a)),r=s.reference[u]-s.floating[e]+(t&&(null==(b=i.offset)?void 0:b[u])||0)+(t?0:g.crossAxis),n=s.reference[u]+s.reference[e]+(t?0:(null==(v=i.offset)?void 0:v[u])||0)-(t?g.crossAxis:0);h<r?h=r:h>n&&(h=n)}return{[p]:m,[u]:h}}}},Xx=(e,t,r)=>{const n=new Map,a={platform:Wx,...r},s={...a.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:s=[],platform:i}=r,o=s.filter(Boolean),c=await(null==i.isRTL?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:u}=Zy(l,n,c),p=n,m={},h=0;for(let r=0;r<o.length;r++){var f;const{name:s,fn:g}=o[r],{x:b,y:v,data:y,reset:x}=await g({x:d,y:u,initialPlacement:n,placement:p,strategy:a,middlewareData:m,rects:l,platform:{...i,detectOverflow:null!=(f=i.detectOverflow)?f:Jy},elements:{reference:e,floating:t}});d=null!=b?b:d,u=null!=v?v:u,m={...m,[s]:{...m[s],...y}},x&&h<=50&&(h++,"object"==typeof x&&(x.placement&&(p=x.placement),x.rects&&(l=!0===x.rects?await i.getElementRects({reference:e,floating:t,strategy:a}):x.rects),({x:d,y:u}=Zy(l,p,c))),r=-1)}return{x:d,y:u,placement:p,strategy:a,middlewareData:m}})(e,t,{...a,platform:s})};var Qx="undefined"!=typeof document?t.useLayoutEffect:function(){};function ew(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(!ew(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)&&!ew(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function tw(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rw(e,t){const r=tw(e);return Math.round(t*r)/r}function nw(e){const t=a.useRef(e);return Qx(()=>{t.current=e}),t}const aw=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?Jx({element:r.current,padding:n}).fn(t):{}:r?Jx({element:r,padding:n}).fn(t):{};var a}}),sw=(e,t)=>({...Hx(e),options:[e,t]}),iw=(e,t)=>({...$x(e),options:[e,t]}),ow=(e,t)=>({...Yx(e),options:[e,t]}),cw=(e,t)=>({...Kx(e),options:[e,t]}),lw=(e,t)=>({...qx(e),options:[e,t]}),dw=(e,t)=>({...Zx(e),options:[e,t]}),uw=(e,t)=>({...aw(e),options:[e,t]});var pw=a.forwardRef((t,r)=>{const{children:n,width:a=10,height:s=5,...i}=t;return e.jsx(ii.svg,{...i,ref:r,width:a,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});pw.displayName="Arrow";var mw=pw,hw="Popper",[fw,gw]=Zs(hw),[bw,vw]=fw(hw),yw=t=>{const{__scopePopper:r,children:n}=t,[s,i]=a.useState(null);return e.jsx(bw,{scope:r,anchor:s,onAnchorChange:i,children:n})};yw.displayName=hw;var xw="PopperAnchor",ww=a.forwardRef((t,r)=>{const{__scopePopper:n,virtualRef:s,...i}=t,o=vw(xw,n),c=a.useRef(null),l=Is(r,c),d=a.useRef(null);return a.useEffect(()=>{const e=d.current;d.current=s?.current||c.current,e!==d.current&&o.onAnchorChange(d.current)}),s?null:e.jsx(ii.div,{...i,ref:l})});ww.displayName=xw;var Sw="PopperContent",[kw,Cw]=fw(Sw),Ew=a.forwardRef((t,r)=>{const{__scopePopper:n,side:i="bottom",sideOffset:o=0,align:c="center",alignOffset:l=0,arrowPadding:d=0,avoidCollisions:u=!0,collisionBoundary:p=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:b,...v}=t,y=vw(Sw,n),[x,w]=a.useState(null),S=Is(r,e=>w(e)),[k,C]=a.useState(null),E=ld(k),N=E?.width??0,j=E?.height??0,A=i+("center"!==c?"-"+c:""),_="number"==typeof m?m:{top:0,right:0,bottom:0,left:0,...m},P=Array.isArray(p)?p:[p],T=P.length>0,R={padding:_,boundary:P.filter(_w),altBoundary:T},{refs:D,floatingStyles:I,placement:M,isPositioned:U,middlewareData:L}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:o,floating:c}={},transform:l=!0,whileElementsMounted:d,open:u}=e,[p,m]=a.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=a.useState(n);ew(h,n)||f(n);const[g,b]=a.useState(null),[v,y]=a.useState(null),x=a.useCallback(e=>{e!==C.current&&(C.current=e,b(e))},[]),w=a.useCallback(e=>{e!==E.current&&(E.current=e,y(e))},[]),S=o||g,k=c||v,C=a.useRef(null),E=a.useRef(null),N=a.useRef(p),j=null!=d,A=nw(d),_=nw(i),P=nw(u),T=a.useCallback(()=>{if(!C.current||!E.current)return;const e={placement:t,strategy:r,middleware:h};_.current&&(e.platform=_.current),Xx(C.current,E.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};R.current&&!ew(N.current,t)&&(N.current=t,s.flushSync(()=>{m(t)}))})},[h,t,r,_,P]);Qx(()=>{!1===u&&N.current.isPositioned&&(N.current.isPositioned=!1,m(e=>({...e,isPositioned:!1})))},[u]);const R=a.useRef(!1);Qx(()=>(R.current=!0,()=>{R.current=!1}),[]),Qx(()=>{if(S&&(C.current=S),k&&(E.current=k),S&&k){if(A.current)return A.current(S,k,T);T()}},[S,k,T,A,j]);const D=a.useMemo(()=>({reference:C,floating:E,setReference:x,setFloating:w}),[x,w]),I=a.useMemo(()=>({reference:S,floating:k}),[S,k]),M=a.useMemo(()=>{const e={position:r,left:0,top:0};if(!I.floating)return e;const t=rw(I.floating,p.x),n=rw(I.floating,p.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...tw(I.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,I.floating,p.x,p.y]);return a.useMemo(()=>({...p,update:T,refs:D,elements:I,floatingStyles:M}),[p,T,D,I,M])}({strategy:"fixed",placement:A,whileElementsMounted:(...e)=>Gx(...e,{animationFrame:"always"===g}),elements:{reference:y.anchor},middleware:[sw({mainAxis:o+j,alignmentAxis:l}),u&&iw({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?ow():void 0,...R}),u&&cw({...R}),lw({...R,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:a,height:s}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${r}px`),i.setProperty("--radix-popper-available-height",`${n}px`),i.setProperty("--radix-popper-anchor-width",`${a}px`),i.setProperty("--radix-popper-anchor-height",`${s}px`)}}),k&&uw({element:k,padding:d}),Pw({arrowWidth:N,arrowHeight:j}),f&&dw({strategy:"referenceHidden",...R})]}),[O,z]=Tw(M),F=oi(b);Ys(()=>{U&&F?.()},[U,F]);const B=L.arrow?.x,W=L.arrow?.y,V=0!==L.arrow?.centerOffset,[G,H]=a.useState();return Ys(()=>{x&&H(window.getComputedStyle(x).zIndex)},[x]),e.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:U?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:e.jsx(kw,{scope:n,placedSide:O,onArrowChange:C,arrowX:B,arrowY:W,shouldHideArrow:V,children:e.jsx(ii.div,{"data-side":O,"data-align":z,...v,ref:S,style:{...v.style,animation:U?void 0:"none"}})})})});Ew.displayName=Sw;var Nw="PopperArrow",jw={top:"bottom",right:"left",bottom:"top",left:"right"},Aw=a.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,s=Cw(Nw,n),i=jw[s.placedSide];return e.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:e.jsx(mw,{...a,ref:r,style:{...a.style,display:"block"}})})});function _w(e){return null!==e}Aw.displayName=Nw;var Pw=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:a}=t,s=0!==a.arrow?.centerOffset,i=s?0:e.arrowWidth,o=s?0:e.arrowHeight,[c,l]=Tw(r),d={start:"0%",center:"50%",end:"100%"}[l],u=(a.arrow?.x??0)+i/2,p=(a.arrow?.y??0)+o/2;let m="",h="";return"bottom"===c?(m=s?d:`${u}px`,h=-o+"px"):"top"===c?(m=s?d:`${u}px`,h=`${n.floating.height+o}px`):"right"===c?(m=-o+"px",h=s?d:`${p}px`):"left"===c&&(m=`${n.floating.width+o}px`,h=s?d:`${p}px`),{data:{x:m,y:h}}}});function Tw(e){const[t,r="center"]=e.split("-");return[t,r]}var Rw=yw,Dw=ww,Iw=Ew,Mw=Aw;function Uw(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.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),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?Ds(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Lw=Symbol("radix.slottable");function Ow(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Lw}var zw="Popover",[Fw]=Zs(zw,[gw]),Bw=gw(),[Ww,Vw]=Fw(zw),Gw=t=>{const{__scopePopover:r,children:n,open:s,defaultOpen:i,onOpenChange:o,modal:c=!1}=t,l=Bw(r),d=a.useRef(null),[u,p]=a.useState(!1),[m,h]=ri({prop:s,defaultProp:i??!1,onChange:o,caller:zw});return e.jsx(Rw,{...l,children:e.jsx(Ww,{scope:r,contentId:ei(),triggerRef:d,open:m,onOpenChange:h,onOpenToggle:a.useCallback(()=>h(e=>!e),[h]),hasCustomAnchor:u,onCustomAnchorAdd:a.useCallback(()=>p(!0),[]),onCustomAnchorRemove:a.useCallback(()=>p(!1),[]),modal:c,children:n})})};Gw.displayName=zw;var Hw="PopoverAnchor";a.forwardRef((t,r)=>{const{__scopePopover:n,...s}=t,i=Vw(Hw,n),o=Bw(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=i;return a.useEffect(()=>(c(),()=>l()),[c,l]),e.jsx(Dw,{...o,...s,ref:r})}).displayName=Hw;var $w="PopoverTrigger",Kw=a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=Vw($w,n),i=Bw(n),o=Is(r,s.triggerRef),c=e.jsx(ii.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":sS(s.open),...a,ref:o,onClick:qs(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:e.jsx(Dw,{asChild:!0,...i,children:c})});Kw.displayName=$w;var qw="PopoverPortal",[Zw,Jw]=Fw(qw,{forceMount:void 0}),Yw=t=>{const{__scopePopover:r,forceMount:n,children:a,container:s}=t,i=Vw(qw,r);return e.jsx(Zw,{scope:r,forceMount:n,children:e.jsx(ji,{present:n||i.open,children:e.jsx(Ni,{asChild:!0,container:s,children:a})})})};Yw.displayName=qw;var Xw="PopoverContent",Qw=a.forwardRef((t,r)=>{const n=Jw(Xw,t.__scopePopover),{forceMount:a=n.forceMount,...s}=t,i=Vw(Xw,t.__scopePopover);return e.jsx(ji,{present:a||i.open,children:i.modal?e.jsx(tS,{...s,ref:r}):e.jsx(rS,{...s,ref:r})})});Qw.displayName=Xw;var eS=function(t){const r=Uw(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(Ow);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}("PopoverContent.RemoveScroll"),tS=a.forwardRef((t,r)=>{const n=Vw(Xw,t.__scopePopover),s=a.useRef(null),i=Is(r,s),o=a.useRef(!1);return a.useEffect(()=>{const e=s.current;if(e)return No(e)},[]),e.jsx(yo,{as:eS,allowPinchZoom:!0,children:e.jsx(nS,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:qs(t.onCloseAutoFocus,e=>{e.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:qs(t.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:qs(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),rS=a.forwardRef((t,r)=>{const n=Vw(Xw,t.__scopePopover),s=a.useRef(!1),i=a.useRef(!1);return e.jsx(nS,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(s.current||n.triggerRef.current?.focus(),e.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(s.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const r=e.target,a=n.triggerRef.current?.contains(r);a&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),nS=a.forwardRef((t,r)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:u,...p}=t,m=Vw(Xw,n),h=Bw(n);return Pi(),e.jsx(yi,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:i,children:e.jsx(mi,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:e.jsx(Iw,{"data-state":sS(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)"}})})})}),aS="PopoverClose";a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=Vw(aS,n);return e.jsx(ii.button,{type:"button",...a,ref:r,onClick:qs(t.onClick,()=>s.onOpenChange(!1))})}).displayName=aS;function sS(e){return e?"open":"closed"}a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=Bw(n);return e.jsx(Mw,{...s,...a,ref:r})}).displayName="PopoverArrow";var iS=Yw,oS=Qw;const cS=Gw,lS=Kw,dS=a.forwardRef(({className:t,align:r="center",sideOffset:n=4,...s},i)=>{const{container:o}=a.useContext(Nc);return e.jsx(iS,{container:o,children:e.jsx(oS,{ref:i,align:r,sideOffset:n,className:Se("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",t),...s})})});function uS({options:r,value:n,onChange:a,placeholder:s="Search...",emptyLabel:i="Choose option"}){const[o,c]=t.useState(n??""),[l,d]=t.useState(!1);t.useEffect(()=>{void 0!==n&&c(n)},[n]);const u=r.find(e=>e.value===o);return e.jsxs(cS,{open:l,onOpenChange:d,children:[e.jsx(lS,{asChild:!0,children:e.jsxs(Ks,{variant:"outline",role:"combobox","aria-expanded":l,className:"justify-between overflow-hidden text-ellipsis",children:[u?e.jsxs("div",{children:[String(u.label).trim(),u.icon&&e.jsx("span",{className:"ms-2 text-xs text-muted-foreground",children:u.icon})]}):e.jsx("span",{className:"text-muted-foreground",children:i}),e.jsx(is,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(dS,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(vy,{children:[e.jsx(yy,{placeholder:s}),e.jsx(xy,{children:e.jsx(wy,{children:r.map(t=>e.jsxs(Sy,{className:Se("whitespace-nowrap text-start",{"text-green-500":o===t.value}),value:t.value,defaultValue:t.value,onSelect:()=>{return e=t.value,c(e),a?.(e),void d(!1);var e},children:[o===t.value&&e.jsx(ss,{className:Se("me-2 h-4 w-4 text-green-400",o===t.value?"opacity-100":"opacity-0")}),String(t.label).trim(),t.icon&&e.jsx("span",{className:"ms-2 text-xs text-muted-foreground",children:t.icon})]},t.value))})})]})})]})}dS.displayName=oS.displayName;const pS={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"},mS={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"},hS=[{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=mS[e.code]||"USD",r=pS[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 fS({value:t,onChange:r}){const{t:n}=sn(),a=hS.map(e=>({value:e.value,label:e.text,icon:e.flag}));return e.jsx(uS,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchCountry"),emptyLabel:n("dropdowns.chooseCountry")})}const gS=hS.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),bS=Array.from(new Set(gS.map(e=>e.value))).map(e=>gS.find(t=>t.value===e)).filter(e=>void 0!==e);function vS({value:t,onChange:r}){const{t:n}=sn(),a=bS.map(e=>({value:e.value,label:e.text,icon:e.icon??void 0}));return e.jsx(uS,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchCurrency"),emptyLabel:n("dropdowns.chooseCurrency")})}let yS=[{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:"🇮🇱"}];yS=yS.filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)),yS.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const xS=yS.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 wS({value:t,onChange:r}){const{t:n}=sn(),a=xS.map(e=>({value:e.value,label:e.label,icon:e.flag}));return e.jsx(uS,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchLanguage"),emptyLabel:n("dropdowns.chooseLanguage")})}const SS=[{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],s=t.text;let i=s.substring(s.indexOf("(")+1,s.indexOf(")"));-1!==i.indexOf("UTC")&&e.push({value:a,abbr:t.abbr,offset:t.offset,isdst:t.isdst,text:`(${i}) ${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 kS({value:t,onChange:r}){const{t:n}=sn(),a=SS.map(e=>({value:e.value,label:e.text}));return e.jsx(uS,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchTimezone"),emptyLabel:n("dropdowns.chooseTimezone")})}const CS=({workspace:r})=>{const{t:n}=sn(),{updateUserProfile:a,getProfile:s}=wC(),[i,o]=t.useState(!1),[c,l]=t.useState(),[d,u]=t.useState(0),[p,m]=t.useState(null),h=t.useRef(null);t.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const f=qu({resolver:rf(tg({name:Af().min(2,{message:n("profile.nameMinLength")}),country:Af().optional(),timezone:Af().optional(),language:Af().optional(),currency:Af().optional()})),defaultValues:{name:c?.name||"",country:c?.country||"",timezone:c?.timezone||"",language:c?.language||"",currency:c?.currency||""}});return t.useEffect(()=>{s().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.jsxs("div",{children:[p&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:n("settings.common.success")}),e.jsx("p",{className:"text-sm",children:p})]}),e.jsx("div",{className:"space-y-4",children:e.jsx(Ag,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){o(!0),m(null);try{await a({name:e.name,country:e.country,timezone:e.timezone,language:e.language,currency:e.currency}),m(n("profile.success")),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{m(null)},5e3)}catch(e){Re(e,{component:"WorkspaceSettingsProfile",action:"updateUserProfile",metadata:{workspaceId:r._id}})}finally{o(!1)}}),className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:n("profile.email")}),e.jsx(Og,{disabled:!0,className:"w-full border rounded px-3 py-2 bg-gray-100",value:c?.email})]}),e.jsx(Pg,{disabled:i,control:f.control,name:"name",render:({field:t})=>e.jsxs(Dg,{children:[e.jsx(Ig,{children:n("profile.name")}),e.jsx(Mg,{children:e.jsx(Og,{...t})}),e.jsx(Lg,{})]})}),e.jsxs("div",{className:"flex gap-y-2 my-4 flex-col",children:[e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:n("profile.language")}),e.jsx(wS,{value:f.watch("language"),onChange:e=>{f.setValue("language",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:n("profile.country")}),e.jsx(fS,{value:f.watch("country"),onChange:e=>{f.setValue("country",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:n("profile.currency")}),e.jsx(vS,{value:f.watch("currency"),onChange:e=>{f.setValue("currency",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:n("profile.timezone")}),e.jsx(kS,{value:f.watch("timezone"),onChange:e=>{f.setValue("timezone",e)}})]})]}),e.jsxs("div",{className:"flex justify-end gap-x-2",children:[e.jsx(Ks,{type:"submit",progress:i,disabled:i,children:n("profile.save")}),e.jsx(Ks,{type:"button",variant:"outline",onClick:()=>{u(e=>e+1)},disabled:i,children:n("profile.reset")})]})]})})}),c?.image&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:n("profile.profileImage")}),e.jsx("div",{className:"w-16 h-16 rounded-full overflow-hidden",children:e.jsx("img",{src:c.image,alt:c.name,className:"w-full h-full object-cover"})})]})]}):e.jsx(id,{})},ES=({open:r,onOpenChange:n,packages:a,billingCurrency:s,workspaceName:i,onSelectPackage:o,purchasingPackageId:c,loading:l=!1})=>{const{t:d,dir:u,fmtNum:p,fmtCents:m}=sn(),h=t.useMemo(()=>{const e=new Set;return a.forEach(t=>{t.pricingVariants?.forEach(t=>{t.currency&&e.add(t.currency.toLowerCase())})}),Array.from(e)},[a]),f=t.useMemo(()=>{const e=s?.trim().toLowerCase();return e?h.includes(e)?[e]:[]:h},[s,h]),[g,b]=t.useState(()=>f.length>0?f[0]:""),v=s?.trim().toLowerCase()||g,y=l||!!c;return e.jsx(Ac,{open:r,onOpenChange:n,children:e.jsxs(Rc,{dir:u,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.jsxs("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.jsxs("div",{children:[e.jsx(Ic,{className:"text-xl sm:text-2xl font-bold",children:d("credits.dialogTitle")}),e.jsxs(Mc,{className:"mt-1 text-sm",children:[d("credits.dialogDescription"),i&&e.jsx("span",{className:"ms-1 font-medium text-foreground",children:d("credits.dialogDescriptionWorkspace",{workspace:i})})]})]}),!s?.trim()&&f.length>1&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-slate-600",children:d("pricing.currency")}),e.jsx("div",{className:"flex gap-1 rounded-lg border border-gray-200 bg-gray-50/50 p-1",children:f.map(t=>e.jsxs("button",{type:"button",onClick:()=>b(t),className:Se("rounded-md px-3 py-1.5 text-sm font-medium transition-colors",v===t?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-700"),children:[Sg(t)," ",t.toUpperCase()]},t))})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:0===a.length?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-gray-400",children:[e.jsx(cs,{className:"h-12 w-12 mb-3"}),e.jsx("p",{className:"text-sm",children:d("credits.noPackages")})]}):e.jsx("div",{className:"max-w-2xl mx-auto px-4 py-6 sm:px-6 space-y-4",children:a.map(t=>{const r=t.pricingVariants?.find(e=>e.currency?.toLowerCase()===v)??t.pricingVariants?.[0],n=r?.amount,a=r?.currency??v,s=c===t._id,i=null!=n&&n>0&&t.creditAmount>0?Math.round(n/t.creditAmount):null;return e.jsxs("div",{className:Se("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.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:t.name}),e.jsxs("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:[e.jsx(cs,{className:"h-3 w-3"}),d("credits.creditsAmount",{count:p(t.creditAmount)})]})]}),t.description&&e.jsx("p",{className:"text-sm text-gray-500 mb-2",children:t.description}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-gray-400",children:[e.jsx("span",{children:t.validityDays?d("credits.validityDays",{count:t.validityDays}):d("credits.validityUnlimited")}),null!=i&&e.jsx("span",{children:d("credits.perCredit",{price:m(i,a)})})]})]}),e.jsxs("div",{className:"flex items-center gap-4 sm:flex-col sm:items-end sm:gap-2 shrink-0",children:[null!=n&&e.jsx("span",{className:"text-2xl sm:text-3xl font-bold text-gray-900 whitespace-nowrap",children:m(n,a)}),e.jsx(Ks,{size:"sm",onClick:()=>o(t),disabled:y,progress:s,className:"whitespace-nowrap",children:s?d("credits.purchasing"):d("credits.buyAmount",{count:p(t.creditAmount)})})]})]},t._id)})})})]})})};function NS(e,t="en-US"){try{const r=new Date(e);return isNaN(r.getTime())?"":new Intl.DateTimeFormat(t,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(r)}catch{return""}}const jS={[wa]:"credits.type.plan_grant",[Sa]:"credits.type.pack_purchased",[ka]:"credits.type.consumed",[Ca]:"credits.type.expired",[Ea]:"credits.type.admin_grant",[Na]:"credits.type.admin_revoke",[ja]:"credits.type.refund"};const AS=({workspace:r})=>{const n=r._id?.toString(),{t:a,fmtNum:s}=sn(),{balance:i,loading:o,error:c,refetch:l}=na(),{packages:d,loading:u}=Yn(n),{expiringCredits:p,loading:m}=Qn(n,7),[h,f]=t.useState(1),{transactions:g,hasNextPage:b,loading:v}=Xn(n,{limit:10,page:h}),[y,x]=t.useState([]);t.useEffect(()=>{v||0===g.length||x(1===h?g:e=>{const t=new Set(e.map(e=>e._id)),r=g.filter(e=>!t.has(e._id));return r.length>0?[...e,...r]:e})},[g,h,v]);const w=t.useCallback(()=>{b&&!v&&f(e=>e+1)},[b,v]),S=y,{purchaseCredits:k,loading:C}=Jn(n),[E,N]=t.useState(!1),[j,A]=t.useState(null),[_,P]=t.useState(!1),[T,R]=t.useState(!1),[D,I]=t.useState(null),[M,U]=t.useState(!1),L=t.useRef(!1),O=o&&!i;t.useEffect(()=>{if(L.current)return;const e=xC.getState();if(!e.params?.action)return;if(e.params.action===Gl)return L.current=!0,xC.clearParams(),void U(!0);if(e.params.action!==Vl)return;L.current=!0;const t=e.params.status;if(xC.clearParams(),t===Hl){P(!0),$n();const e=setTimeout(()=>P(!1),8e3);return()=>clearTimeout(e)}if(t===$l){R(!0);const e=setTimeout(()=>R(!1),5e3);return()=>clearTimeout(e)}t===Kl&&A(a("credits.purchaseFailed"))},[]);if(O)return e.jsx(id,{});if(!n)return e.jsx("div",{className:"border rounded-lg p-4 text-center text-gray-500",children:e.jsx("p",{children:a("subscription.invalidWorkspace")})});const z=!u&&d.length>0;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-gray-600",children:a("credits.description")}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[z&&e.jsxs(Ks,{size:"sm",onClick:()=>U(!0),children:[e.jsx(ks,{className:"h-3.5 w-3.5 me-1.5"}),a("credits.buyCredits")]}),e.jsxs(Ks,{variant:"ghost",size:"sm",onClick:async()=>{N(!0);try{await l()}finally{N(!1)}},disabled:E,children:[e.jsx(vs,{className:Se("h-3.5 w-3.5 me-1.5",E&&"animate-spin")}),a("settings.common.refreshAction",{loading:String(E)})]})]})]}),c&&e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg",children:[e.jsx("p",{className:"font-medium",children:a("credits.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:c})]}),_&&e.jsxs("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.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(os,{className:"h-4 w-4 flex-shrink-0"}),e.jsx("p",{className:"text-sm font-medium",children:a("credits.purchaseSuccess")})]}),e.jsx(Ks,{variant:"outline",size:"sm",onClick:()=>P(!1),className:"flex-shrink-0 border-green-200 text-green-700 hover:bg-green-100",children:a("settings.common.dismiss")})]}),T&&e.jsxs("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:[e.jsx("p",{className:"text-sm font-medium",children:a("credits.purchaseCanceled")}),e.jsx(Ks,{variant:"outline",size:"sm",onClick:()=>R(!1),className:"flex-shrink-0 border-amber-200 text-amber-700 hover:bg-amber-100",children:a("settings.common.dismiss")})]}),j&&e.jsxs("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.jsx("p",{className:"text-sm",children:j}),e.jsx(Ks,{variant:"outline",size:"sm",onClick:()=>A(null),className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:a("settings.common.dismiss")})]}),e.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[e.jsxs("div",{className:"bg-gray-50/50 p-4 sm:p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-500 uppercase tracking-wider",children:a("credits.balance")}),e.jsx(cs,{className:"h-5 w-5 text-gray-400"})]}),i?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-3xl font-bold text-gray-900 mb-4",children:s(i.available)}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500",children:a("credits.totalGranted")}),e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s(i.totalGranted)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500",children:a("credits.totalConsumed")}),e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s(i.totalConsumed)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500",children:a("credits.totalExpired")}),e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s(i.totalExpired)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500",children:a("credits.available")}),e.jsx("p",{className:"text-sm font-semibold text-green-600",children:s(i.available)})]})]})]}):e.jsxs("div",{className:"text-center py-4",children:[e.jsx(cs,{className:"h-10 w-10 text-gray-300 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600",children:a("credits.noCredits")}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:a("credits.noCreditsHint")}),z&&e.jsxs(Ks,{size:"sm",className:"mt-3",onClick:()=>U(!0),children:[e.jsx(ks,{className:"h-3.5 w-3.5 me-1.5"}),a("credits.buyCredits")]})]})]}),!m&&p>0&&e.jsx("div",{className:"px-4 py-3 bg-amber-50 border-t border-amber-200 text-sm text-amber-800",children:a("credits.expiringInDays",{count:p,days:7})})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-3",children:a("credits.transactions")}),v&&0===S.length?e.jsxs("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:[e.jsx(hs,{className:"h-4 w-4 animate-spin flex-shrink-0"}),e.jsx("span",{children:a("settings.common.loading")})]}):0===S.length?e.jsx("div",{className:"border rounded-lg p-6 text-center",children:e.jsx("p",{className:"text-sm text-gray-500",children:a("credits.noTransactions")})}):e.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[e.jsx("div",{className:"divide-y divide-gray-100",children:S.map(t=>e.jsx(_S,{tx:t},t._id))}),b&&e.jsx("div",{className:"border-t border-gray-200 px-4 py-3 text-center",children:e.jsx(Ks,{variant:"ghost",size:"sm",onClick:w,disabled:v,progress:v&&h>1,children:a("credits.loadMore")})})]})]}),z&&e.jsx(ES,{open:M,onOpenChange:U,packages:d,billingCurrency:r.billingCurrency,workspaceName:r.name,onSelectPackage:async e=>{if(n){A(null),I(e._id);try{const{successUrl:t,cancelUrl:r}=Yl(n),a=await k({creditPackageId:e._id,successUrl:t,cancelUrl:r});a.url&&Il(a.url)}catch(e){A(e instanceof Error?e.message:a("errors.purchaseCredits")),I(null)}}},purchasingPackageId:D,loading:C})]})};function _S({tx:t}){const{t:r,formattingLocale:n,fmtNum:a}=sn(),s=jS[t.type]??"credits.type.consumed",i=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"}}(t.type),o=t.amount>0;return e.jsx("div",{className:"px-3 py-3 sm:px-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mb-0.5",children:[e.jsx("span",{className:Se("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium shrink-0",i),children:r(s)}),t.description&&e.jsx("p",{className:"text-sm text-gray-700 truncate",children:t.description})]}),e.jsx("p",{className:"text-xs text-gray-400",children:NS(t.createdAt,n)})]}),e.jsxs("div",{className:"text-end shrink-0",children:[e.jsxs("span",{className:Se("text-sm font-semibold",o?"text-green-600":"text-gray-900"),children:[o?"+":"",a(t.amount)]}),e.jsx("p",{className:"text-xs text-gray-400",children:a(t.balanceAfter)})]})]})})}function PS(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 TS(e,t,r={}){if(null==e)return null;const{overageInCents:n=!0,currency:a,locale:s="en"}=r,{included:i,overage:o}=e;if(!(!1!==e.allowOverage))return{included:i,hasOverage:!1,allowOverage:!1,price:"",unit:""};if(null==o)return{included:i,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(s,{style:"currency",currency:l,minimumFractionDigits:2}).format(c)}catch{d=`${r.currencySymbol??Sg(a??"")}${c.toFixed(2)}`}else{d=`${r.currencySymbol??Sg(a??"")}${"number"==typeof c?c.toFixed(2):String(o)}`}return{included:i,hasOverage:!0,allowOverage:!0,price:d,unit:t&&"unitSize"in e&&null!=e.unitSize&&e.unitSize>0?`${e.unitSize.toLocaleString(s)} ${t}`:t||""}}const RS="personal",DS=(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,t="en-US")=>e?new Date(1e3*e).toLocaleDateString(t,{year:"numeric",month:"short",day:"numeric"}):"",MS=e=>{switch(e){case pa:return"bg-green-100 text-green-800";case ua:return"bg-yellow-100 text-yellow-800";case da:return"bg-gray-100 text-gray-800";case ma:return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}},US=({workspaceId:t,hasActiveSubscription:r=!1,onViewPricingPlans:n,limit:a=20})=>{const{t:s,formattingLocale:i}=sn(),{invoices:o,loading:c,error:l,refetch:d}=In(t,a),u=o.length>0;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:s("invoices.title")}),e.jsx("p",{className:"text-sm text-gray-600",children:s("invoices.description")})]}),e.jsx(Ks,{variant:"ghost",size:"sm",progress:c,onClick:d,disabled:c,children:s("settings.common.refreshAction",{loading:String(c)})})]}),l&&e.jsxs("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.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s("invoices.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:l})]}),e.jsx(Ks,{variant:"outline",size:"sm",onClick:d,disabled:c,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:s("settings.common.retryAction",{loading:String(c)})})]}),c&&!u?e.jsx("div",{className:"border rounded-lg p-6",children:e.jsx(id,{})}):u?e.jsx("div",{className:"space-y-2",children:o.map(t=>{const r=(e=>{switch(e.status){case da:case ua:return{textKey:"invoices.pay",color:"bg-blue-600 hover:bg-blue-700"};case pa:return{textKey:"invoices.view",color:"bg-green-600 hover:bg-green-700"};case ma:case ha: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"}}})(t);return e.jsxs("div",{className:"border rounded-lg bg-white hover:shadow-sm transition-shadow p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[e.jsx("span",{className:"text-sm font-medium text-gray-900 truncate min-w-0",children:t.description||t.number||t.id.slice(-8)}),e.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium shrink-0 ${MS(t.status)}`,children:s(`invoices.status.${t.status}`)})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-0.5 text-sm text-gray-600 mb-2.5",children:[e.jsx("span",{className:"font-medium text-gray-900",children:DS(t.amount_due,t.currency,i)}),t.created&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-300 hidden sm:inline",children:"·"}),e.jsx("span",{children:IS(t.created,i)})]}),t.amount_paid>0&&t.amount_due>0&&e.jsx("span",{className:"text-xs text-gray-500",children:s("invoices.paidAmount",{amount:DS(t.amount_paid,t.currency,i)})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(Ks,{size:"sm",disabled:!t.hosted_invoice_url,onClick:()=>t.hosted_invoice_url&&window.open(t.hosted_invoice_url,"_blank","noopener,noreferrer"),className:r.color,children:[s(r.textKey),e.jsx(us,{className:"h-3 w-3 ms-1.5"})]}),t.invoice_pdf&&e.jsxs(Ks,{size:"sm",variant:"outline",onClick:()=>window.open(t.invoice_pdf,"_blank","noopener,noreferrer"),children:[e.jsx(ds,{className:"h-3 w-3 me-1.5"}),s("invoices.download")]})]})]},t.id)})}):e.jsxs("div",{className:"border rounded-lg p-6 text-center",children:[e.jsx(ps,{className:"h-12 w-12 mx-auto text-gray-400 mb-3"}),e.jsx("p",{className:"text-sm text-gray-500",children:s(r?"invoices.noInvoicesWithSub":"invoices.noInvoices")}),!r&&n&&e.jsx(Ks,{size:"sm",className:"mt-4",onClick:n,children:s("subscription.viewPricingPlans")})]})]})},LS=t.lazy(()=>Promise.resolve().then(function(){return oN}).then(e=>({default:e.default}))),OS=(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""}},zS=({workspace:r})=>{const n=r._id?.toString(),{t:a,formattingLocale:s,fmtNum:i,fmtCents:o}=sn(),{api:c}=En(),{can:l}=ad(),{settings:d}=Cn(),u=l(jl.WORKSPACE_BILLING_VIEW),p=l(jl.WORKSPACE_BILLING_MANAGE),m=d?.workspace?.mode===RS,{subscription:h,loading:f,error:g,updateSubscription:b,refetch:v}=Dn(n),{createCheckoutSession:y}=Tn(n),{cancelSubscription:x,loading:w}=Un(n),{resumeSubscription:S,loading:k}=Ln(n),{openBillingPortal:C,loading:E}=Mn(n),{versions:N,loading:j,error:A,refetch:_}=Pn(n),P=f||j,T=g||A,{currentVersion:R,latestVersion:D,isDeprecated:I,plansToShow:M}=t.useMemo(()=>{const e=N?.currentVersion,t=N?.availableVersions||[],r=null!=h?.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:[]}},[N,h?.subscription]),[U,L]=t.useState(!1),[O,z]=t.useState(null),[F,B]=t.useState(null),W=t.useRef(null),[V,G]=t.useState(!1),[H,$]=t.useState(!1),K=t.useRef(void 0),q=t.useRef(!1);t.useEffect(()=>{if(q.current)return;if(f||!M||0===M.length)return;const e=xC.getState(),t=e.params?.action===Wl;h?.subscription&&!t||(q.current=!0,t&&(K.current=e.params,xC.clearParams()),G(!0))},[f,h?.subscription,M]),t.useEffect(()=>()=>{W.current&&clearTimeout(W.current)},[]);const[Z,J]=t.useState(!1),[Y,X]=t.useState("subscription"),Q=async()=>{await Promise.all([v(),_()])},ee=t.useMemo(()=>Ra(h?.subscription?.stripePriceId,M??[]),[h?.subscription?.stripePriceId,M]),te=async()=>{if(n){$(!1),L(!0),z(null),B(null);try{await x(),B(a("subscription.cancelSuccess")),await Q()}catch(e){const t=e instanceof Error?e.message:a("subscription.errorCanceling");z(t)}finally{L(!1),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{z(null),B(null)},5e3)}}};if(P&&!h&&!N)return e.jsx(id,{});if(!u)return null;const re=h?.planVersion?._id||null;return n?e.jsxs("div",{className:"space-y-6",children:[T&&e.jsxs("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.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:a("subscription.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:T}),e.jsx("p",{className:"text-xs mt-2 text-red-600",children:a("subscription.errorLoadingDescription")})]}),e.jsx(Ks,{variant:"outline",size:"sm",onClick:Q,disabled:P,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:a("settings.common.retryAction",{loading:String(P)})})]}),O&&e.jsxs("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.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:a("subscription.updateFailed")}),e.jsx("p",{className:"text-sm mt-1",children:O})]}),e.jsx(Ks,{variant:"outline",size:"sm",onClick:()=>z(null),className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:a("settings.common.dismiss")})]}),F&&e.jsxs("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.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:a("settings.common.success")}),e.jsx("p",{className:"text-sm mt-1",children:F})]}),e.jsx(Ks,{variant:"outline",size:"sm",onClick:()=>B(null),className:"flex-shrink-0 border-green-200 text-green-700 hover:bg-green-100",children:a("settings.common.dismiss")})]}),e.jsx("div",{className:"border-b border-gray-200",children:e.jsxs("nav",{className:"-mb-px flex gap-6","aria-label":"Subscription tabs",children:[e.jsx("button",{type:"button",onClick:()=>X("subscription"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("subscription"===Y?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:a("subscription.plan")}),e.jsx("button",{type:"button",onClick:()=>X("invoices"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("invoices"===Y?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:a("subscription.invoicesTab")})]})}),"subscription"===Y&&e.jsxs(e.Fragment,{children:[P&&e.jsxs("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:[e.jsx(hs,{className:"h-4 w-4 animate-spin flex-shrink-0"}),e.jsx("span",{children:a("settings.common.loading")})]}),I&&h?.subscription&&e.jsxs("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.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(_s,{className:"h-4 w-4 text-amber-600 shrink-0"}),e.jsxs("span",{className:"text-sm text-amber-800",children:[e.jsx("span",{className:"font-medium",children:a("subscription.planUpdateAvailable")}),e.jsxs("span",{className:"text-amber-600",children:[" ","— v",R?.version||"?"," → v",D?.version||"?"]})]})]}),e.jsx(Ks,{size:"sm",variant:"outline",className:"shrink-0 border-amber-300 text-amber-700 hover:bg-amber-100",onClick:()=>G(!0),children:a("subscription.viewPlans")})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{children:e.jsx("p",{className:"text-sm text-gray-600",children:a("subscription.managePlan")})}),e.jsxs("div",{className:"flex items-center gap-2",children:[(()=>{const t=h?.subscription?.subscriptionStatus===oa,r=h?.subscription?.cancelAtPeriodEnd;return r||w?null:t&&M&&M.length>0?e.jsx(Ks,{size:"sm",onClick:()=>G(!0),children:a("subscription.viewPricingPlans")}):h?.subscription&&!t&&p?e.jsx(Ks,{variant:"outline",size:"sm",onClick:()=>G(!0),children:a("subscription.changePlanButton")}):!h?.subscription&&M&&M.length>0?e.jsx(Ks,{size:"sm",onClick:()=>G(!0),children:a("subscription.viewPricingPlans")}):null})(),e.jsx(Ks,{variant:"ghost",size:"sm",progress:P,onClick:Q,disabled:P||U,children:a("settings.common.refreshAction",{loading:String(P)})})]})]}),h?.subscription?(()=>{const t=Ra(h.subscription.stripePriceId,M??[]),n=t?.interval??null,c=t?.currency??h.plan?.currency??r?.billingCurrency??"",l=n&&h.planVersion?_a(h.planVersion,c,n):null,d=c,u=h.planVersion?Da(h.planVersion,c):null,f=u&&n?Ia(h.planVersion,c,n):null,g=Array.isArray(r?.users)?r.users.length:1,b=u?.includedSeats??0,v=Math.max(0,g-b),y=!!h.plan?.isFreemium,x=null!=l?0===l?a("subscription.free"):o(l,d):y?a("subscription.free"):null,S=n===aa.Monthly?a("subscription.billingInterval.perMonth"):n===aa.Quarterly?a("subscription.billingInterval.perQuarter"):n===aa.Yearly?a("subscription.billingInterval.perYear"):"";return e.jsxs("div",{className:"border rounded-lg overflow-hidden "+(I?"border-amber-300":"border-gray-200"),children:[h.subscription.subscriptionStatus===ia&&!h.subscription.cancelAtPeriodEnd&&(()=>{const t=h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd,r=t?new Date(t):null,n=r&&!isNaN(r.getTime())?r:null,s=n?Math.max(0,Math.ceil((n.getTime()-Date.now())/864e5)):null,i=null!==s&&s<=3;return e.jsxs("div",{className:"px-4 py-3 sm:px-5 text-sm flex flex-col sm:flex-row sm:items-center justify-between gap-2 "+(i?"bg-amber-50 text-amber-800 border-b border-amber-200":"bg-blue-50 text-blue-800 border-b border-blue-200"),children:[e.jsxs("span",{children:[null!==s&&s<=0?a("subscription.trialEnded"):null!==s?a("subscription.trialEndsIn",{days:s}):a("subscription.onTrial")," ",a("subscription.upgradeToKeepAccess")]}),e.jsx(Ks,{size:"sm",variant:i?"default":"outline",className:"shrink-0 "+(i?"":"border-blue-300 text-blue-700 hover:bg-blue-100"),onClick:()=>G(!0),children:a("subscription.upgradePlan")})]})})(),e.jsxs("div",{className:"p-4 sm:p-5 "+(I?"bg-amber-50/50":"bg-gray-50/50"),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:h.plan?.name||a("subscription.noPlanAssigned")}),e.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium "+(h.subscription.subscriptionStatus===sa?h.subscription.cancelAtPeriodEnd?"bg-amber-100 text-amber-800":"bg-green-100 text-green-800":h.subscription.subscriptionStatus===ia?"bg-blue-100 text-blue-800":h.subscription.subscriptionStatus===oa?"bg-gray-100 text-gray-800":"bg-red-100 text-red-800"),children:[h.subscription.subscriptionStatus===sa&&(h.subscription.cancelAtPeriodEnd?a("subscription.status.canceling"):a("subscription.status.active")),h.subscription.subscriptionStatus===ia&&a("subscription.status.trial"),h.subscription.subscriptionStatus===oa&&a("subscription.status.canceled"),h.subscription.subscriptionStatus===ca&&a("subscription.status.pastDue")]}),h.subscription.subscriptionStatus===ia&&OS(s,h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd)&&e.jsxs("span",{className:"text-xs text-gray-500",children:["(ends"," ",OS(s,h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd),")"]}),I&&e.jsxs("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:[e.jsx(_s,{className:"h-3 w-3"}),a("subscription.status.deprecated")]})]}),h.plan?.description&&e.jsx("p",{className:"text-sm text-gray-600 mb-3",children:h.plan.description}),!y&&e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 sm:gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline gap-1 whitespace-nowrap",children:[e.jsx("span",{className:"text-2xl font-bold text-gray-900",children:x||a("invoices.na")}),x&&x!==a("subscription.free")&&S&&e.jsx("span",{className:"text-sm text-gray-500",children:S})]}),u&&f&&f>0&&!m&&e.jsx("div",{className:"text-xs text-gray-500 mt-1",children:a("subscription.perSeatDisplay",{price:o(f,d),interval:S})}),!m&&u&&f&&f>0&&v>0&&x&&x!==a("subscription.free")&&null!=l&&e.jsx("div",{className:"text-xs text-gray-500 mt-1 pt-1 border-t border-gray-200",children:a("subscription.estTotalDisplay",{total:o(l+f*v,d),interval:S,count:v})})]}),(h.subscription.subscriptionStatus===sa||h.subscription.subscriptionStatus===ia)&&!h.subscription.cancelAtPeriodEnd&&OS(s,h.subscription.stripeCurrentPeriodEnd)&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[e.jsx(ns,{className:"h-3.5 w-3.5 flex-shrink-0"}),e.jsx("span",{children:a("subscription.nextBillingDisplay",{date:OS(s,h.subscription.stripeCurrentPeriodEnd)??""})})]})]}),I&&e.jsxs("p",{className:"text-xs text-amber-600 mt-2",children:["Version ",R?.version||a("invoices.na")]}),!y&&(h.subscription.subscriptionStatus===sa||h.subscription.subscriptionStatus===ia||h.subscription.subscriptionStatus===ca)&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3 mt-4 pt-4 border-t border-gray-200",children:[h.subscription&&p&&h.subscription.subscriptionId&&e.jsx(Ks,{variant:"outline",size:"sm",onClick:()=>C(),disabled:E,progress:E,children:a(E?"subscription.openingPortal":"subscription.managePayment")}),p&&h.subscription.subscriptionId&&(h.subscription.subscriptionStatus===sa||h.subscription.subscriptionStatus===ia)&&e.jsx(e.Fragment,{children:h.subscription.cancelAtPeriodEnd?e.jsx(Ks,{variant:"outline",size:"sm",onClick:()=>J(!0),disabled:U||w||k,progress:k,children:h.subscription.subscriptionStatus===ia?a("subscription.resumeTrial"):a("subscription.resumeTitle")}):e.jsx(Ks,{variant:"outline",size:"sm",className:"text-red-600 hover:text-red-700 hover:bg-red-50 border-red-200",onClick:()=>$(!0),disabled:U||w||k,progress:w||U,children:w||U?a("subscription.canceling"):h.subscription.subscriptionStatus===ia?a("subscription.cancelTrial"):a("subscription.cancelTitle")})})]})]}),h.subscription.subscriptionStatus===ca&&e.jsx("div",{className:"px-5 py-3 bg-red-50 border-t border-red-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(_s,{className:"h-5 w-5 text-red-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-800",children:a("subscription.paymentPastDue")}),e.jsx("p",{className:"text-sm text-red-700 mt-0.5",children:a("subscription.paymentPastDueDescription")}),e.jsx(Ks,{variant:"outline",size:"sm",className:"mt-2 border-red-200 text-red-700 hover:bg-red-100",onClick:()=>X("invoices"),children:a("subscription.viewInvoices")})]})]})}),h.subscription.subscriptionStatus===ca&&h.subscription.dunningState&&h.subscription.dunningState!==va&&e.jsx("div",{className:"px-5 py-3 bg-red-50 border-t border-red-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(_s,{className:"h-5 w-5 text-red-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-800",children:h.subscription.dunningState===ya?a("subscription.dunningFinal"):h.subscription.dunningState===xa?a("subscription.dunningSuspended"):a("subscription.dunningRecovery")}),e.jsx("p",{className:"text-sm text-red-700 mt-0.5",children:h.subscription.dunningState===xa?a("subscription.dunningSuspendedDescription"):a("subscription.dunningRecoveryDescription")})]})]})}),h.subscription.subscriptionStatus===la&&e.jsx("div",{className:"px-5 py-3 bg-blue-50 border-t border-blue-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ns,{className:"h-5 w-5 text-blue-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-blue-800",children:a("subscription.subscriptionPaused")}),e.jsx("p",{className:"text-sm text-blue-700 mt-0.5",children:a("subscription.subscriptionPausedDescription")})]})]})}),h.subscription.cancelAtPeriodEnd&&e.jsx("div",{className:"px-5 py-3 bg-amber-50 border-t border-amber-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ns,{className:"h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-amber-800",children:h.subscription.subscriptionStatus===ia?a("subscription.scheduledTrialCancellation"):a("subscription.scheduledCancellation")}),e.jsx("p",{className:"text-sm text-amber-700 mt-0.5",children:OS(s,h.subscription.subscriptionStatus===ia&&h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd)?e.jsxs(e.Fragment,{children:[h.subscription.subscriptionStatus===ia?a("subscription.trialEndDescription"):a("subscription.cancelEndDescription")," ",e.jsx("span",{className:"font-medium",children:OS(s,h.subscription.subscriptionStatus===ia&&h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd)}),"."]}):a("subscription.cancelEndFallback")})]})]})}),h.planVersion&&(()=>{const t=((e,t,r=aa.Monthly)=>{if(!e?.subscriptionItems)return{features:[],limits:[],quotas:[]};const n=[],a=[],s=[];return e.subscriptionItems.forEach(i=>{const o=i.slug;if(i.type===fa){const t=e.features?.[o]??!1;n.push({item:i,enabled:t})}else if(i.type===ga){const t=e.limits?.[o]??0;a.push({item:i,value:t})}else if(i.type===ba){const n=t&&e.pricingVariants?.length?Ta(e,t,o,r):PS(e.quotas?.[o],r);null!=n&&s.push({item:i,value:n})}}),{features:n,limits:a,quotas:s}})(h.planVersion,c,n??"monthly");return t.features.length>0||t.limits.length>0||t.quotas.length>0?e.jsx("div",{className:"px-4 py-4 sm:px-5 sm:py-5 border-t border-gray-100",children:e.jsxs("div",{className:"space-y-5",children:[t.features.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:a("subscription.items.features")}),e.jsx("ul",{className:"space-y-1.5",children:t.features.sort(e=>e.enabled?-1:1).map(({item:t,enabled:r})=>e.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"w-4 text-center shrink-0 "+(r?"text-green-500":"text-gray-300"),children:r?"✓":"✕"}),e.jsx("span",{className:r?"text-gray-700":"text-gray-400",children:t.name})]},t._id))})]}),t.limits.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:a("subscription.items.limits")}),e.jsx("ul",{className:"space-y-1.5",children:t.limits.map(({item:t,value:r})=>e.jsxs("li",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:t.name}),e.jsx("span",{className:"font-medium text-gray-900",children:i(r)})]},t._id))})]}),t.quotas.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:a("subscription.items.quotas")}),e.jsx("ul",{className:"space-y-1.5",children:t.quotas.map(({item:t,value:r})=>{const n=TS(r,t.name.toLowerCase(),{currency:c,locale:s}),i=n?n.hasOverage?a("quota.includedWithOverage",{count:n.included,price:n.price,unit:n.unit}):a("quota.includedOnly",{count:n.included}):"—";return e.jsx("li",{className:"text-sm",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-0.5",children:[e.jsx("span",{className:"text-gray-600",children:t.name}),e.jsx("span",{className:"font-medium text-gray-900 text-xs sm:text-sm",children:i})]})},t._id)})})]}),u&&!m&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:a("subscription.seats.title")}),e.jsxs("div",{className:"bg-gray-50 rounded-lg p-3 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.seats.members")}),e.jsx("span",{className:"font-semibold text-gray-900",children:i(g)})]}),e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.seats.included")}),e.jsx("span",{className:"text-gray-900",children:i(b)})]}),v>0&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.seats.billable")}),e.jsxs("span",{className:"font-medium text-amber-600",children:[i(v)," ",a("subscription.seats.extra")]})]}),f&&f>0&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.seats.perExtraSeat")}),e.jsxs("span",{className:"text-gray-900",children:[o(f,c),S]})]}),u.maxSeats>0&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.seats.limit")}),e.jsx("span",{className:"text-gray-900",children:i(u.maxSeats)})]})]})]}),h.planVersion?.creditGrant?.enabled&&"object"==typeof h.planVersion.creditGrant.creditPackage&&null!==h.planVersion.creditGrant.creditPackage&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:a("subscription.items.credits")}),e.jsxs("div",{className:"bg-purple-50 rounded-lg p-3 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:h.planVersion.creditGrant.renewOnPeriod?a("subscription.items.creditsPerMonth"):a("subscription.items.creditsOneTime")}),e.jsx("span",{className:"font-semibold text-purple-700",children:i(h.planVersion.creditGrant.creditPackage.creditAmount??0)})]}),e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.items.creditRenewal")}),e.jsx("span",{className:"font-medium text-gray-900",children:h.planVersion.creditGrant.renewOnPeriod?"reset"===h.planVersion.creditGrant.mode?a("subscription.items.creditModeReset"):a("subscription.items.creditModeTopup"):a("subscription.items.creditModeLifetime")})]})]})]})]})}):null})()]})})():e.jsxs("div",{className:"border rounded-lg p-6 text-center",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx(ls,{className:"h-12 w-12 mx-auto text-gray-400 mb-3"}),e.jsx("p",{className:"text-lg font-medium text-gray-700",children:a("subscription.noSubscription")}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:a("subscription.noSubscriptionDescription")})]}),M&&M.length>0&&e.jsx(Ks,{size:"sm",onClick:()=>G(!0),children:a("subscription.viewPricingPlans")})]})]}),!N&&!P&&e.jsxs("div",{className:"border rounded-lg p-4 text-center",children:[e.jsxs("div",{className:"text-gray-500 mb-2",children:[e.jsx("p",{className:"font-medium",children:a("subscription.errorLoading")}),T&&e.jsxs("p",{className:"text-sm mt-2 text-red-600",children:["Error: ",T]}),!T&&e.jsx("p",{className:"text-sm mt-2",children:a("subscription.noPlansAvailable")})]}),e.jsx(Ks,{variant:"outline",size:"sm",progress:P,onClick:Q,disabled:P,className:"mt-4",children:a("settings.common.refreshAction",{loading:String(P)})})]})]}),"invoices"===Y&&e.jsxs(e.Fragment,{children:[P&&e.jsxs("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:[e.jsx(hs,{className:"h-4 w-4 animate-spin flex-shrink-0"}),e.jsx("span",{children:a("settings.common.loading")})]}),e.jsx(US,{workspaceId:n,hasActiveSubscription:null!==h?.subscription,onViewPricingPlans:()=>X("subscription"),limit:20})]}),M&&M.length>0&&e.jsx(t.Suspense,{fallback:V?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(hs,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{children:a("settings.common.loading")})]})}):null,children:e.jsx(LS,{open:V,onOpenChange:G,planVersions:M,currentPlanVersionId:re||null,currentStripePriceId:h?.subscription?.stripePriceId,billingCurrency:r.billingCurrency,trialUsedAt:r.trialUsedAt,workspaceName:r.name,initialInterval:K.current?.interval,initialCurrency:K.current?.currency,currentMemberCount:Array.isArray(r?.users)?r.users.length:void 0,onSelectPlan:async(e,t=aa.Monthly,s)=>{if(!n)return;const i=M?.find(t=>t._id===e),o=s??ee?.currency??h?.plan?.currency??r?.billingCurrency??"",l=i?function(e,t,r){const n=Aa(e,t);if(!n?.stripePrices)return null;const a=r===aa.Monthly?"monthlyPriceId":r===aa.Yearly?"yearlyPriceId":"quarterlyPriceId",s=r===aa.Monthly?"monthly":r===aa.Yearly?"yearly":void 0;return n.stripePrices[a]??(s?n.stripePrices[s]:void 0)??null}(i,o,t):null,d=h?.subscription?.stripePriceId;if(!l||!d||l!==d){L(!0),z(null),B(null);try{const{successUrl:r,cancelUrl:s}=function(e){const t="undefined"!=typeof window?window.location.href:void 0;return{successUrl:Jl({action:Fl,status:Hl,ws:e,screen:ql},t),cancelUrl:Jl({action:Fl,status:$l,ws:e,screen:ql},t)}}(n);let l;if(i?.plan?.isFreemium){return h?.subscription?.subscriptionId?(G(!1),void $(!0)):(await c.selectFreePlan(n,e),G(!1),It(),await Q(),void B(a("subscription.updateSuccess")))}const d=h?.subscription?.subscriptionStatus===oa;if(l=h?.subscription&&!d?await b(e,{billingInterval:t,successUrl:r,cancelUrl:s}):await y({planVersionId:e,billingInterval:t,currency:o||void 0,successUrl:r,cancelUrl:s}),l&&"checkoutUrl"in l&&l.checkoutUrl)return void Il(l.checkoutUrl);B(a("subscription.updateSuccess")),await Q()}catch(e){const t=e instanceof Error?e.message:a("subscription.errorProcessing");z(t)}finally{L(!1),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{z(null),B(null)},5e3)}}},loading:U||P})}),e.jsx(ll,{open:Z,onOpenChange:J,children:e.jsxs(ml,{children:[e.jsxs(hl,{children:[e.jsx(gl,{children:a("subscription.resumeTitle")}),e.jsx(bl,{asChild:!0,children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:a("subscription.resumeConfirm")}),e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4 space-y-2 text-sm",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(_s,{className:"h-4 w-4 text-amber-600 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[a("subscription.resumeChargeDate")," ",h?.subscription?.stripeCurrentPeriodEnd&&OS(s,h.subscription.stripeCurrentPeriodEnd)?e.jsx("span",{className:"font-medium",children:OS(s,h.subscription.stripeCurrentPeriodEnd)}):a("subscription.resumeChargeFallback")]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-amber-600 mt-0.5",children:"•"}),e.jsx("span",{children:a("subscription.resumeContinue")})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-blue-600 mt-0.5",children:"ℹ"}),e.jsx("span",{children:a("subscription.resumeCancelAnytime")})]})]})]})})]}),e.jsxs(fl,{children:[e.jsx(yl,{disabled:k,children:a("subscription.resumeKeep")}),e.jsx(vl,{onClick:async()=>{if(n){J(!1),L(!0),z(null),B(null);try{await S(),B(a("subscription.resumeSuccess")),await Q()}catch(e){const t=e instanceof Error?e.message:a("subscription.errorResuming");z(t)}finally{L(!1),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{z(null),B(null)},5e3)}}},disabled:k,children:a(k?"subscription.resuming":"subscription.resumeButton")})]})]})}),(()=>{const t=h?.subscription?.subscriptionStatus===ia,r=t&&h?.subscription?.trialEnd||h?.subscription?.stripeCurrentPeriodEnd;return e.jsx(ll,{open:H,onOpenChange:$,children:e.jsxs(ml,{children:[e.jsxs(hl,{children:[e.jsx(gl,{children:a(t?"subscription.cancelTrialTitle":"subscription.cancelTitle")}),e.jsx(bl,{asChild:!0,children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:a(t?"subscription.cancelTrialConfirm":"subscription.cancelConfirm")}),e.jsxs("div",{className:"bg-gray-50 rounded-lg p-4 space-y-2 text-sm",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600 mt-0.5",children:"✓"}),e.jsxs("span",{children:[a(t?"subscription.cancelTrialAccess":"subscription.retainAccess")," ",r&&OS(s,r)?e.jsx("span",{className:"font-medium",children:OS(s,r)}):a("subscription.retainAccessFallback")]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600 mt-0.5",children:"✓"}),e.jsx("span",{children:a(t?"subscription.cancelTrialNoCharge":"subscription.cancelNotCharged")})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-blue-600 mt-0.5",children:"ℹ"}),e.jsx("span",{children:a(t?"subscription.cancelTrialResume":"subscription.cancelResumeAnytime")})]})]})]})})]}),e.jsxs(fl,{children:[e.jsx(yl,{disabled:w,children:a(t?"subscription.cancelTrialKeep":"subscription.cancelKeep")}),e.jsx(vl,{onClick:te,disabled:w,className:"bg-red-600 hover:bg-red-700 focus:ring-red-600",children:a(w?"subscription.canceling":t?"subscription.cancelTrialButton":"subscription.cancelButton")})]})]})})})()]}):e.jsx("div",{className:"border rounded-lg p-4 text-center text-gray-500",children:e.jsx("p",{children:a("subscription.invalidWorkspace")})})};function FS(e){return e.replace(/[_-]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function BS(e,t,r){return t+e.toLocaleString(r,{minimumFractionDigits:2,maximumFractionDigits:2})}function WS(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 VS=()=>{const{quotas:r,loading:n,error:a,refetch:s}=EC(),{t:i,formattingLocale:o,fmtNum:c}=sn(),{can:l}=ad(),d=(e,t)=>BS(e,t,o),{response:u}=Bn(),[p,m]=t.useState(!1),h=t.useMemo(()=>{const e={};if(!u?.planVersion||!u?.subscription)return e;const t=u.planVersion,n=u.subscription,a=n.billingInterval??"monthly",s=n.plan?.currency??"usd",i=Sg(s);if(!r)return e;for(const n of Object.keys(r)){const o=Pa(t,s,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:s,currencySymbol:i,estimatedCost:p}}return e},[u,r]),f=t.useMemo(()=>{const e=u?.subscription?.usageCurrentPeriodEnd||u?.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,o);return t?{endDate:t,daysRemaining:WS(e)}:null},[u,o]),g=async()=>{m(!0);try{await s()}finally{m(!1)}};if(n&&!r)return e.jsx(id,{});if(!l(jl.WORKSPACE_USAGE_VIEW))return null;if(a)return e.jsxs("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.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:i("usage.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:a})]}),e.jsx(Ks,{variant:"outline",size:"sm",onClick:g,disabled:p,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:i("settings.common.retryAction",{loading:String(p)})})]});const b=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===b.length)return e.jsxs("div",{className:"border rounded-lg p-8 text-center",children:[e.jsx(as,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-gray-600",children:i("usage.noData")}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:i("usage.noDataHint")})]});const v=b.filter(([,e])=>e.hasOverage).length,y=b.length>0?Math.round(b.reduce((e,[,t])=>e+(t.included>0?t.consumed/t.included*100:0),0)/b.length):0,x=Object.values(h).reduce((e,t)=>e+t.estimatedCost,0),w=Object.values(h)[0]?.currencySymbol??"$";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-sm text-gray-600",children:i("usage.description")}),e.jsxs(Ks,{variant:"ghost",size:"sm",onClick:g,disabled:p,children:[e.jsx(vs,{className:Se("h-3.5 w-3.5 me-1.5",p&&"animate-spin")}),i("settings.common.refreshAction",{loading:String(p)})]})]}),f&&e.jsxs("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:[e.jsx(ns,{className:"h-4 w-4 text-gray-400 flex-shrink-0"}),e.jsxs("span",{children:[i("usage.resetDateDisplay",{date:f.endDate}),null!==f.daysRemaining&&f.daysRemaining>0&&e.jsxs("span",{className:"text-gray-500",children:[" ","(",i("usage.daysRemainingDisplay",{count:f.daysRemaining}),")"]}),null!==f.daysRemaining&&f.daysRemaining<=0&&e.jsxs("span",{className:"text-amber-600 font-medium",children:[" (",i("usage.renewingSoon"),")"]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2 sm:gap-3",children:[e.jsxs("div",{className:"border border-gray-200 rounded-lg p-3 sm:p-4",children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:i("usage.totalResources")}),e.jsx("p",{className:"text-lg sm:text-xl font-semibold text-gray-900 mt-1",children:c(b.length)})]}),e.jsxs("div",{className:"border border-gray-200 rounded-lg p-3 sm:p-4",children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:i("usage.overallUsage")}),e.jsx("p",{className:"text-lg sm:text-xl font-semibold text-gray-900 mt-1",children:c(y)+"%"})]}),e.jsxs("div",{className:Se("border rounded-lg p-3 sm:p-4",v>0?"border-red-200 bg-red-50":"border-gray-200"),children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:i("usage.inOverage")}),e.jsx("p",{className:Se("text-lg sm:text-xl font-semibold mt-1",v>0?"text-red-600":"text-gray-900"),children:c(v)})]}),v>0&&x>0&&e.jsxs("div",{className:"border border-red-200 bg-red-50 rounded-lg p-3 sm:p-4",children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:i("usage.estOverageCost")}),e.jsx("p",{className:"text-lg sm:text-xl font-semibold mt-1 text-red-600",children:d(x,w)})]})]}),v>0&&e.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(_s,{className:"h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5 hidden sm:block"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-sm font-semibold text-amber-800 mb-1",children:i("usage.overageDetected")}),e.jsx("p",{className:"text-sm text-amber-700",children:i("usage.overageWarning",{count:v})}),x>0&&e.jsx("p",{className:"text-sm text-amber-700 font-medium mt-1",children:i("usage.estOverageCharges",{amount:d(x,w)})})]})]})}),e.jsx("div",{className:"space-y-3",children:b.map(([t,r])=>{const n=(a=r.consumed,(s=r.included)<=0?a>0?100:0:Math.min(a/s*100,100));var a,s;const i=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=h[t];return e.jsx(GS,{slug:t,quota:r,percent:n,colors:i,pricing:o},t)})})]})};function GS({slug:t,quota:r,percent:n,colors:a,pricing:s}){const{t:i,formattingLocale:o}=sn(),c=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,o),l=(e,t)=>BS(e,t,o);return e.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 sm:p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-y-1 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900 truncate",children:FS(t)}),r.hasOverage&&e.jsx("span",{className:Se("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",a.badge,a.badgeText),children:i("usage.overage")}),!r.hasOverage&&n>=90&&e.jsx("span",{className:Se("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",a.badge,a.badgeText),children:i("usage.almostFull")})]}),e.jsxs("span",{className:"text-sm text-gray-500 whitespace-nowrap",children:[c(r.consumed)," / ",c(r.included)]})]}),e.jsx("div",{className:Se("h-2 rounded-full w-full",a.bg),children:e.jsx("div",{className:Se("h-2 rounded-full transition-all duration-500",a.bar),style:{width:`${n}%`}})}),e.jsxs("div",{className:"flex items-center justify-between mt-2 text-xs text-gray-500",children:[e.jsx("span",{children:i("usage.percentUsed",{percent:Math.round(n)})}),e.jsx("span",{children:r.available>0?i("usage.availableRemaining",{count:c(r.available)}):r.hasOverage?i("usage.overLimitCount",{count:c(r.overage)}):i("usage.fullyUsed")})]}),r.hasOverage&&s&&e.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-200 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-500",children:i("usage.overageUnits")}),e.jsx("span",{className:"font-medium text-gray-900",children:c(r.overage)})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-500",children:i("usage.rate")}),e.jsx("span",{className:"font-medium text-gray-900",children:i("usage.rateDisplay",{rate:l(s.overageCents/100,s.currencySymbol),unitSize:s.unitSize})})]}),s.unitSize>1&&e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-500",children:i("usage.billableBlocks")}),e.jsx("span",{className:"font-medium text-gray-900",children:c(Math.ceil(r.overage/s.unitSize))})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs pt-2 border-t border-gray-200",children:[e.jsx("span",{className:"font-medium text-red-600",children:i("usage.estimatedCharge")}),e.jsx("span",{className:"font-semibold text-red-600",children:l(s.estimatedCost,s.currencySymbol)})]})]}),!r.hasOverage&&s&&e.jsx("div",{className:"mt-2 text-xs text-gray-500",children:i("usage.overageRateDisplay",{rate:i("usage.rateDisplay",{rate:l(s.overageCents/100,s.currencySymbol),unitSize:s.unitSize})})})]})}function HS(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.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),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?Ds(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $S=Symbol("radix.slottable");function KS(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===$S}var qS=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"});a.forwardRef((t,r)=>e.jsx(ii.span,{...t,ref:r,style:{...qS,...t.style}})).displayName="VisuallyHidden";var ZS=[" ","Enter","ArrowUp","ArrowDown"],JS=[" ","Enter"],YS="Select",[XS,QS,ek]=Vg(YS),[tk]=Zs(YS,[ek,gw]),rk=gw(),[nk,ak]=tk(YS),[sk,ik]=tk(YS),ok=t=>{const{__scopeSelect:r,children:n,open:s,defaultOpen:i,onOpenChange:o,value:c,defaultValue:l,onValueChange:d,dir:u,name:p,autoComplete:m,disabled:h,required:f,form:g}=t,b=rk(r),[v,y]=a.useState(null),[x,w]=a.useState(null),[S,k]=a.useState(!1),C=Hg(u),[E,N]=ri({prop:s,defaultProp:i??!1,onChange:o,caller:YS}),[j,A]=ri({prop:c,defaultProp:l,onChange:d,caller:YS}),_=a.useRef(null),P=!v||(g||!!v.closest("form")),[T,R]=a.useState(new Set),D=Array.from(T).map(e=>e.props.value).join(";");return e.jsx(Rw,{...b,children:e.jsxs(nk,{required:f,scope:r,trigger:v,onTriggerChange:y,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:k,contentId:ei(),value:j,onValueChange:A,open:E,onOpenChange:N,dir:C,triggerPointerDownPosRef:_,disabled:h,children:[e.jsx(XS.Provider,{scope:r,children:e.jsx(sk,{scope:t.__scopeSelect,onNativeOptionAdd:a.useCallback(e=>{R(t=>new Set(t).add(e))},[]),onNativeOptionRemove:a.useCallback(e=>{R(t=>{const r=new Set(t);return r.delete(e),r})},[]),children:n})}),P?e.jsxs(Hk,{"aria-hidden":!0,required:f,tabIndex:-1,name:p,autoComplete:m,value:j,onChange:e=>A(e.target.value),disabled:h,form:g,children:[void 0===j?e.jsx("option",{value:""}):null,Array.from(T)]},D):null]})})};ok.displayName=YS;var ck="SelectTrigger",lk=a.forwardRef((t,r)=>{const{__scopeSelect:n,disabled:s=!1,...i}=t,o=rk(n),c=ak(ck,n),l=c.disabled||s,d=Is(r,c.onTriggerChange),u=QS(n),p=a.useRef("touch"),[m,h,f]=Kk(e=>{const t=u().filter(e=>!e.disabled),r=t.find(e=>e.value===c.value),n=qk(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 e.jsx(Dw,{asChild:!0,...o,children:e.jsx(ii.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":$k(c.value)?"":void 0,...i,ref:d,onClick:qs(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:qs(i.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:qs(i.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||ZS.includes(e.key)&&(g(),e.preventDefault())})})})});lk.displayName=ck;var dk="SelectValue",uk=a.forwardRef((t,r)=>{const{__scopeSelect:n,className:a,style:s,children:i,placeholder:o="",...c}=t,l=ak(dk,n),{onValueNodeHasChildrenChange:d}=l,u=void 0!==i,p=Is(r,l.onValueNodeChange);return Ys(()=>{d(u)},[d,u]),e.jsx(ii.span,{...c,ref:p,style:{pointerEvents:"none"},children:$k(l.value)?e.jsx(e.Fragment,{children:o}):i})});uk.displayName=dk;var pk=a.forwardRef((t,r)=>{const{__scopeSelect:n,children:a,...s}=t;return e.jsx(ii.span,{"aria-hidden":!0,...s,ref:r,children:a||"▼"})});pk.displayName="SelectIcon";var mk=t=>e.jsx(Ni,{asChild:!0,...t});mk.displayName="SelectPortal";var hk="SelectContent",fk=a.forwardRef((t,r)=>{const n=ak(hk,t.__scopeSelect),[i,o]=a.useState();if(Ys(()=>{o(new DocumentFragment)},[]),!n.open){const r=i;return r?s.createPortal(e.jsx(bk,{scope:t.__scopeSelect,children:e.jsx(XS.Slot,{scope:t.__scopeSelect,children:e.jsx("div",{children:t.children})})}),r):null}return e.jsx(xk,{...t,ref:r})});fk.displayName=hk;var gk=10,[bk,vk]=tk(hk),yk=function(t){const r=HS(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(KS);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}("SelectContent.RemoveScroll"),xk=a.forwardRef((t,r)=>{const{__scopeSelect:n,position:s="item-aligned",onCloseAutoFocus:i,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}=t,x=ak(hk,n),[w,S]=a.useState(null),[k,C]=a.useState(null),E=Is(r,e=>S(e)),[N,j]=a.useState(null),[A,_]=a.useState(null),P=QS(n),[T,R]=a.useState(!1),D=a.useRef(!1);a.useEffect(()=>{if(w)return No(w)},[w]),Pi();const I=a.useCallback(e=>{const[t,...r]=P().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}},[P,k]),M=a.useCallback(()=>I([N,w]),[I,N,w]);a.useEffect(()=>{T&&M()},[T,M]);const{onOpenChange:U,triggerPointerDownPosRef:L}=x;a.useEffect(()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(L.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(L.current?.y??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():w.contains(r.target)||U(!1),document.removeEventListener("pointermove",t),L.current=null};return null!==L.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[w,U,L]),a.useEffect(()=>{const e=()=>U(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[U]);const[O,z]=Kk(e=>{const t=P().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=qk(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),F=a.useCallback((e,t,r)=>{const n=!D.current&&!r;(void 0!==x.value&&x.value===t||n)&&(j(e),n&&(D.current=!0))},[x.value]),B=a.useCallback(()=>w?.focus(),[w]),W=a.useCallback((e,t,r)=>{const n=!D.current&&!r;(void 0!==x.value&&x.value===t||n)&&_(e)},[x.value]),V="popper"===s?Sk:wk,G=V===Sk?{side:l,sideOffset:d,align:u,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:b,avoidCollisions:v}:{};return e.jsx(bk,{scope:n,content:w,viewport:k,onViewportChange:C,itemRefCallback:F,selectedItem:N,onItemLeave:B,itemTextRefCallback:W,focusSelectedItem:M,selectedItemText:A,position:s,isPositioned:T,searchRef:O,children:e.jsx(yo,{as:yk,allowPinchZoom:!0,children:e.jsx(yi,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:qs(i,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:e.jsx(mi,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:e.jsx(V,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...y,...G,onPlaced:()=>R(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:qs(y.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||z(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=P().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(()=>I(t)),e.preventDefault()}})})})})})})});xk.displayName="SelectContentImpl";var wk=a.forwardRef((t,r)=>{const{__scopeSelect:n,onPlaced:s,...i}=t,o=ak(hk,n),c=vk(hk,n),[l,d]=a.useState(null),[u,p]=a.useState(null),m=Is(r,e=>p(e)),h=QS(n),f=a.useRef(!1),g=a.useRef(!0),{viewport:b,selectedItem:v,selectedItemText:y,focusSelectedItem:x}=c,w=a.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,s=r.left-a,i=e.left-s,o=e.width+i,c=Math.max(o,t.width),d=window.innerWidth-gk,u=Ub(s,[gk,Math.max(gk,d-c)]);l.style.minWidth=o+"px",l.style.left=u+"px"}else{const a=t.right-n.right,s=window.innerWidth-r.right-a,i=window.innerWidth-e.right-s,o=e.width+i,c=Math.max(o,t.width),d=window.innerWidth-gk,u=Ub(s,[gk,Math.max(gk,d-c)]);l.style.minWidth=o+"px",l.style.right=u+"px"}const a=h(),i=window.innerHeight-2*gk,c=b.scrollHeight,d=window.getComputedStyle(u),p=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),x=p+m+c+parseInt(d.paddingBottom,10)+g,w=Math.min(5*v.offsetHeight,x),S=window.getComputedStyle(b),k=parseInt(S.paddingTop,10),C=parseInt(S.paddingBottom,10),E=e.top+e.height/2-gk,N=i-E,j=v.offsetHeight/2,A=p+m+(v.offsetTop+j),_=x-A;if(A<=E){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=A+Math.max(N,j+(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(E,p+b.offsetTop+(e?k:0)+j)+_;l.style.height=t+"px",b.scrollTop=A-E+b.offsetTop}l.style.margin=`${gk}px 0`,l.style.minHeight=w+"px",l.style.maxHeight=i+"px",s?.(),requestAnimationFrame(()=>f.current=!0)}},[h,o.trigger,o.valueNode,l,u,b,v,y,o.dir,s]);Ys(()=>w(),[w]);const[S,k]=a.useState();Ys(()=>{u&&k(window.getComputedStyle(u).zIndex)},[u]);const C=a.useCallback(e=>{e&&!0===g.current&&(w(),x?.(),g.current=!1)},[w,x]);return e.jsx(kk,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:f,onScrollButtonChange:C,children:e.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:e.jsx(ii.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});wk.displayName="SelectItemAlignedPosition";var Sk=a.forwardRef((t,r)=>{const{__scopeSelect:n,align:a="start",collisionPadding:s=gk,...i}=t,o=rk(n);return e.jsx(Iw,{...o,...i,ref:r,align:a,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Sk.displayName="SelectPopperPosition";var[kk,Ck]=tk(hk,{}),Ek="SelectViewport",Nk=a.forwardRef((t,r)=>{const{__scopeSelect:n,nonce:s,...i}=t,o=vk(Ek,n),c=Ck(Ek,n),l=Is(r,o.onViewportChange),d=a.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),e.jsx(XS.Slot,{scope:n,children:e.jsx(ii.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:qs(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=c;if(n?.current&&r){const e=Math.abs(d.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*gk,a=parseFloat(r.style.minHeight),s=parseFloat(r.style.height),i=Math.max(a,s);if(i<n){const a=i+e,s=Math.min(n,a),o=a-s;r.style.height=s+"px","0px"===r.style.bottom&&(t.scrollTop=o>0?o:0,r.style.justifyContent="flex-end")}}}d.current=t.scrollTop})})})]})});Nk.displayName=Ek;var jk="SelectGroup",[Ak,_k]=tk(jk);a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=ei();return e.jsx(Ak,{scope:n,id:s,children:e.jsx(ii.div,{role:"group","aria-labelledby":s,...a,ref:r})})}).displayName=jk;var Pk="SelectLabel",Tk=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=_k(Pk,n);return e.jsx(ii.div,{id:s.id,...a,ref:r})});Tk.displayName=Pk;var Rk="SelectItem",[Dk,Ik]=tk(Rk),Mk=a.forwardRef((t,r)=>{const{__scopeSelect:n,value:s,disabled:i=!1,textValue:o,...c}=t,l=ak(Rk,n),d=vk(Rk,n),u=l.value===s,[p,m]=a.useState(o??""),[h,f]=a.useState(!1),g=Is(r,e=>d.itemRefCallback?.(e,s,i)),b=ei(),v=a.useRef("touch"),y=()=>{i||(l.onValueChange(s),l.onOpenChange(!1))};if(""===s)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 e.jsx(Dk,{scope:n,value:s,disabled:i,textId:b,isSelected:u,onItemTextChange:a.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:e.jsx(XS.ItemSlot,{scope:n,value:s,disabled:i,textValue:p,children:e.jsx(ii.div,{role:"option","aria-labelledby":b,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...c,ref:g,onFocus:qs(c.onFocus,()=>f(!0)),onBlur:qs(c.onBlur,()=>f(!1)),onClick:qs(c.onClick,()=>{"mouse"!==v.current&&y()}),onPointerUp:qs(c.onPointerUp,()=>{"mouse"===v.current&&y()}),onPointerDown:qs(c.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:qs(c.onPointerMove,e=>{v.current=e.pointerType,i?d.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:qs(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:qs(c.onKeyDown,e=>{""!==d.searchRef?.current&&" "===e.key||(JS.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});Mk.displayName=Rk;var Uk="SelectItemText",Lk=a.forwardRef((t,r)=>{const{__scopeSelect:n,className:i,style:o,...c}=t,l=ak(Uk,n),d=vk(Uk,n),u=Ik(Uk,n),p=ik(Uk,n),[m,h]=a.useState(null),f=Is(r,e=>h(e),u.onItemTextChange,e=>d.itemTextRefCallback?.(e,u.value,u.disabled)),g=m?.textContent,b=a.useMemo(()=>e.jsx("option",{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=p;return Ys(()=>(v(b),()=>y(b)),[v,y,b]),e.jsxs(e.Fragment,{children:[e.jsx(ii.span,{id:u.textId,...c,ref:f}),u.isSelected&&l.valueNode&&!l.valueNodeHasChildren?s.createPortal(c.children,l.valueNode):null]})});Lk.displayName=Uk;var Ok="SelectItemIndicator",zk=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return Ik(Ok,n).isSelected?e.jsx(ii.span,{"aria-hidden":!0,...a,ref:r}):null});zk.displayName=Ok;var Fk="SelectScrollUpButton";a.forwardRef((t,r)=>{const n=vk(Fk,t.__scopeSelect),s=Ck(Fk,t.__scopeSelect),[i,o]=a.useState(!1),c=Is(r,s.onScrollButtonChange);return Ys(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;o(e)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),i?e.jsx(Wk,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=Fk;var Bk="SelectScrollDownButton";a.forwardRef((t,r)=>{const n=vk(Bk,t.__scopeSelect),s=Ck(Bk,t.__scopeSelect),[i,o]=a.useState(!1),c=Is(r,s.onScrollButtonChange);return Ys(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;o(r)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),i?e.jsx(Wk,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=Bk;var Wk=a.forwardRef((t,r)=>{const{__scopeSelect:n,onAutoScroll:s,...i}=t,o=vk("SelectScrollButton",n),c=a.useRef(null),l=QS(n),d=a.useCallback(()=>{null!==c.current&&(window.clearInterval(c.current),c.current=null)},[]);return a.useEffect(()=>()=>d(),[d]),Ys(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),e.jsx(ii.div,{"aria-hidden":!0,...i,ref:r,style:{flexShrink:0,...i.style},onPointerDown:qs(i.onPointerDown,()=>{null===c.current&&(c.current=window.setInterval(s,50))}),onPointerMove:qs(i.onPointerMove,()=>{o.onItemLeave?.(),null===c.current&&(c.current=window.setInterval(s,50))}),onPointerLeave:qs(i.onPointerLeave,()=>{d()})})}),Vk=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return e.jsx(ii.div,{"aria-hidden":!0,...a,ref:r})});Vk.displayName="SelectSeparator";var Gk="SelectArrow";a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=rk(n),i=ak(Gk,n),o=vk(Gk,n);return i.open&&"popper"===o.position?e.jsx(Mw,{...s,...a,ref:r}):null}).displayName=Gk;var Hk=a.forwardRef(({__scopeSelect:t,value:r,...n},s)=>{const i=a.useRef(null),o=Is(s,i),c=cd(r);return a.useEffect(()=>{const e=i.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]),e.jsx(ii.select,{...n,style:{...qS,...n.style},ref:o,defaultValue:r})});function $k(e){return""===e||void 0===e}function Kk(e){const t=oi(e),r=a.useRef(""),n=a.useRef(0),s=a.useCallback(e=>{const a=r.current+e;t(a),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(a)},[t]),i=a.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,i]}function qk(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 s=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(a,0));1===n.length&&(s=s.filter(e=>e!==r));const i=s.find(e=>e.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==r?i:void 0}Hk.displayName="SelectBubbleInput";var Zk=lk,Jk=pk,Yk=mk,Xk=fk,Qk=Nk,eC=Tk,tC=Mk,rC=Lk,nC=zk,aC=Vk;const sC=ok,iC=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(Zk,{ref:a,className:Se("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",t),...n,children:[r,e.jsx(Jk,{asChild:!0,children:e.jsx(yc,{className:"h-4 w-4 opacity-50"})})]}));iC.displayName=Zk.displayName;const oC=a.forwardRef(({className:t,children:r,position:n="popper",...s},i)=>{const{container:o}=a.useContext(Nc);return e.jsx(Yk,{container:o,children:e.jsx(Xk,{ref:i,className:Se("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"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...s,children:e.jsx(Qk,{className:Se("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r})})})});oC.displayName=Xk.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(eC,{ref:n,className:Se("px-2 py-1.5 text-sm font-semibold",t),...r})).displayName=eC.displayName;const cC=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(tC,{ref:a,className:Se("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",t),...n,children:[e.jsx("span",{className:"absolute end-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(nC,{children:e.jsx(wc,{className:"h-4 w-4"})})}),e.jsx(rC,{children:r})]}));cC.displayName=tC.displayName;function lC(e,r){const{response:n}=Bn();return t.useMemo(()=>{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 t=e.users?.length??0,a=n?.planVersion,s=n?.subscription,i=e.billingCurrency||"usd",o=Ma({planVersion:a,currency:i,settingsMaxUsers:r?.settingsMaxUsers}),{maxUsers:c,hasSeatPricing:l,includedSeats:d}=o,u=l?Math.max(0,t-d):0,p=c>0?Math.max(0,c-t):1/0,m=c>0&&t>=c,h=c>0&&t>=.8*c&&!m,f=l&&a?Ia(a,i,s?.billingInterval??"monthly"):null,g=Ua({memberCount:t,maxUsersConfig:o});return{hasSeatPricing:l,memberCount:t,includedSeats:d,maxUsers:c,maxSeats:c,limitSource:o.source,billableSeats:u,availableSeats:p,isAtMax:m,isNearMax:h,perSeatPriceCents:f,currency:i,canInvite:g.canInvite,inviteBlockReason:g.blockReason,inviteBlockMessageKey:g.blockMessageKey,inviteBlockMessageValues:g.blockMessageValues}},[n,e,r?.settingsMaxUsers])}a.forwardRef(({className:t,...r},n)=>e.jsx(aC,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",t),...r})).displayName=aC.displayName;const dC=({workspace:r})=>{const{user:n}=nd(),{t:a,fmtNum:s,fmtCents:i}=sn(),[o,c]=t.useState(0),[l,d]=t.useState(!1),[u,p]=t.useState([]),[m,h]=t.useState(null),{getUsers:f,removeUser:g,updateUser:b}=wC(),{settings:v}=Cn(),{can:y}=ad(),{response:x}=Bn(),w=lC(r,{settingsMaxUsers:v?.workspace?.maxWorkspaceUsers});t.useEffect(()=>{r&&(d(!0),f(r._id).then(e=>{p(e)}).catch(e=>{Re(e,{component:"WorkspaceSettingsUsers",action:"getUsers",metadata:{workspaceId:r._id}})}).finally(()=>{d(!1)}))},[r,o]);const S=()=>{c(e=>e+1)},k=v?.workspace?.mode===RS;if(l||!r)return e.jsx(id,{});if(k)return null;const C=e=>"string"==typeof e?{name:a("users.unknownUser"),email:e,id:e,role:"-"}:{name:e.name,email:e.email,id:e._id},E=u.map(e=>({...e,...C(e.user)})),N=y(jl.WORKSPACE_MEMBERS_INVITE),j=y(jl.WORKSPACE_MEMBERS_REMOVE),A=y(jl.WORKSPACE_MEMBERS_ROLE_CHANGE),{hasSeatPricing:_,includedSeats:P,maxUsers:T,canInvite:R,inviteBlockReason:D,inviteBlockMessageKey:I,inviteBlockMessageValues:M,perSeatPriceCents:U,currency:L}=w,O=u.length,z=x?.subscription?.billingInterval??"monthly",F=_&&O>=P;return e.jsxs("div",{children:[!N&&!j&&!A&&e.jsx("div",{className:"text-red-500",children:a("users.adminOnly")}),N&&e.jsx("div",{className:"mb-4",children:R?e.jsxs("div",{children:[e.jsx(uC,{onInvite:S,workspaceId:r._id}),F&&U&&U>0&&e.jsx("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:e.jsx("span",{children:a("users.extraSeatCost",{price:i(U,L),interval:z})})})]}):e.jsx("div",{className:"flex items-center justify-between p-3 bg-red-50 border border-red-100 rounded-md",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-700",children:a("users.limitReached",{reason:D??"member_limit_reached"})}),e.jsx("p",{className:"text-xs text-red-600 mt-0.5",children:I?a(I,M??void 0):""})]})})}),(_||T>0)&&e.jsxs("div",{className:"mb-4 rounded-lg border bg-gray-50 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-900",children:a("users.seatHeading",{hasSeatPricing:String(_)})}),T>0&&e.jsxs("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full "+(O>=T?"bg-red-100 text-red-700":O>=.8*T?"bg-amber-100 text-amber-700":"bg-emerald-100 text-emerald-700"),children:[s(O)," / ",s(T)]})]}),T>0&&e.jsx("div",{className:"w-full h-1.5 bg-gray-200 rounded-full mb-3",children:e.jsx("div",{className:"h-1.5 rounded-full transition-all "+(O>=T?"bg-red-500":O>=.8*T?"bg-amber-500":"bg-emerald-500"),style:{width:`${Math.min(100,O/T*100)}%`}})}),e.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[e.jsx("div",{children:_?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-900 font-medium",children:s(P)})," ",a("users.included"),U&&U>0&&e.jsxs("span",{className:"text-gray-400",children:[" ","· ",i(U,L),a("users.perExtraSeat")]})]}):e.jsxs("span",{children:[e.jsx("span",{className:"text-gray-900 font-medium",children:s(T)})," ",a("users.maxMembers")]})}),T>0?e.jsxs("span",{children:[s(Math.max(0,T-O))," ",a("users.available")]}):e.jsx("span",{className:"text-gray-400",children:a("users.noMemberLimit")})]})]}),e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("div",{children:e.jsx("div",{className:"text-sm text-gray-600",children:a("users.memberCount",{count:O})})}),e.jsx("div",{children:e.jsx(Ks,{variant:"ghost",size:"sm",onClick:S,progress:l,children:a("settings.common.refreshAction",{loading:String(l)})})})]}),e.jsx("ul",{className:"space-y-2",children:E.map((t,s)=>{const i=t.id===n?.id,o=("object"==typeof r.createdBy&&null!==r.createdBy?r.createdBy._id:r.createdBy)===t.id;return e.jsxs("li",{className:"border rounded p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0",children:[e.jsx("div",{className:"w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center text-sm font-medium shrink-0",children:t.name.charAt(0).toUpperCase()}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500 truncate",children:t.email})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[i&&e.jsx("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-0.5 rounded",children:a("users.you")}),o&&e.jsx("span",{className:"text-xs bg-purple-100 text-purple-800 px-2 py-0.5 rounded",children:a("users.owner")})]})]}),A&&e.jsxs("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.jsxs("div",{className:"relative flex-1 sm:flex-initial",children:[e.jsxs(sC,{disabled:i||!A||o||m===t.id,value:t.role,onValueChange:e=>{return n=r._id,a=t.id,s=e,void(El(r,a)?Re(new Error("Cannot change the role of the workspace owner"),{component:"WorkspaceSettingsUsers",action:"handleUpdateRole",metadata:{workspaceId:n,userId:a,role:s}}):(h(a),b(n,a,{role:s}).then(()=>{S()}).catch(e=>{Re(e,{component:"WorkspaceSettingsUsers",action:"handleUpdateRole",metadata:{workspaceId:n,userId:a,role:s}})}).finally(()=>{h(null)})));var n,a,s},children:[e.jsx(iC,{children:e.jsx(uk,{placeholder:a("users.selectRole")})}),e.jsx(oC,{children:r?.roles.map(t=>e.jsx(cC,{value:t,children:t},t))})]}),m===t.id&&e.jsx("div",{className:"absolute end-8 top-1/2 -translate-y-1/2 pointer-events-none",children:e.jsx(hs,{className:"h-4 w-4 animate-spin text-gray-500"})})]}),!i&&!o&&j&&e.jsx(Ks,{variant:"destructive",size:"sm",startIcon:e.jsx(As,{}),onClick:()=>{return e=t.id,void(El(r,e)?Re(new Error("Cannot remove the workspace owner"),{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:r._id,userId:e}}):g(r._id,e).then(()=>{S()}).catch(t=>{Re(t,{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:r._id,userId:e}})}));var e}})]})]},s)})}),0===u.length&&e.jsx("div",{className:"text-center py-8 text-gray-500",children:a("users.noMembers")})]})};function uC({onInvite:r,workspaceId:n}){const{t:a}=sn(),{addUser:s,getWorkspace:i}=wC(),{settings:o}=Cn(),[c,l]=t.useState(""),[d,u]=t.useState("admin"),[p,m]=t.useState(!1),[h,f]=t.useState(null),[g,b]=t.useState(null),[v,y]=t.useState(null),x=t.useRef(null),w=o?.workspace.roles??v?.roles??[];t.useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]),t.useEffect(()=>{n&&i(n).then(y)},[n]);const S=()=>{f(null),b(null),l(""),u("admin")};return e.jsxs("div",{className:"flex gap-2 flex-col gap-y-2",children:[h&&e.jsx("div",{className:"text-red-500",children:h}),g&&e.jsx("div",{className:"text-green-500",children:g}),e.jsxs("div",{children:[e.jsx(jg,{children:a("users.inviteByEmail")}),e.jsx(Og,{type:"email",value:c,onChange:e=>l(e.target.value),placeholder:"example@example.com"})]}),e.jsxs("div",{children:[e.jsx(jg,{children:a("users.role")}),e.jsxs(sC,{value:d,onValueChange:u,children:[e.jsx(iC,{children:e.jsx(uk,{placeholder:a("users.selectRole")})}),e.jsx(oC,{children:w.map(t=>e.jsx(cC,{value:t,children:t},t))})]})]}),e.jsx("div",{children:e.jsx(Ks,{progress:p,onClick:async()=>{const e=c.trim();if(!e)return void f(a("users.emailRequired"));/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?(m(!0),await s(n,e,d).then(()=>{b(a("users.inviteSuccess")),r?.()}).catch(t=>{Re(t,{component:"InviteMember",action:"addUser",metadata:{workspaceId:n,email:e,role:d}}),f(t instanceof Error?t.message:a("users.inviteFailed"))}).finally(()=>{m(!1),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{S()},6e3)})):f(a("users.invalidEmail"))},disabled:p||!c||!d,children:p?a("users.inviting"):a("users.inviteAs",{role:d})})})]})}const pC=({workspace:t,section:r,setSection:n})=>{const{t:a}=sn(),{settings:s}=Cn(),{can:i}=ad(),{appPermissions:o}=Gn(),c=s?.workspace?.mode===RS,l=i(jl.WORKSPACE_DELETE),d=o&&Object.keys(o).length>0;return e.jsxs("div",{className:"w-44 sm:w-56 h-full flex flex-col space-y-4 sm:space-y-6 shrink-0",children:[t&&e.jsx("div",{className:"border-b p-2 py-4",children:e.jsxs("div",{className:"flex items-center gap-x-2",children:[t.image&&t.image.trim()&&e.jsx("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:e.jsx("img",{src:t.image,className:"w-full h-full object-contain",style:{width:"36px",height:"36px",maxWidth:"36px",maxHeight:"36px",objectFit:"contain"},alt:t.name})}),e.jsxs("div",{className:Se("flex-1 min-w-0",t.image?"":"ps-2"),children:[e.jsx("div",{className:"font-medium text-sm line-clamp-1 text-ellipsis overflow-hidden",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500",children:t.workspaceId})]})]})}),e.jsx(mC,{title:a("settings.sidebar.account"),children:e.jsx(hC,{activeSection:r,icon:e.jsx(Ps,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.profile"),section:fC.Profile,onClick:()=>n(fC.Profile)})}),e.jsxs(mC,{title:a("settings.sidebar.workspace"),children:[i(jl.WORKSPACE_SETTINGS_VIEW)&&e.jsx(hC,{activeSection:r,icon:e.jsx(xs,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.general"),section:fC.General,onClick:()=>n(fC.General)}),!c&&i(jl.WORKSPACE_MEMBERS_VIEW)&&e.jsx(hC,{activeSection:r,icon:e.jsx(Ts,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.users"),section:fC.Users,onClick:()=>n(fC.Users)}),i(jl.WORKSPACE_BILLING_VIEW)&&e.jsx(hC,{activeSection:r,icon:e.jsx(ls,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.subscription"),section:fC.Subscription,onClick:()=>n(fC.Subscription)}),i(jl.WORKSPACE_USAGE_VIEW)&&e.jsx(hC,{activeSection:r,icon:e.jsx(as,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.usage"),section:fC.Usage,onClick:()=>n(fC.Usage)}),i(jl.WORKSPACE_BILLING_VIEW)&&e.jsx(hC,{activeSection:r,icon:e.jsx(cs,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.credits"),section:fC.Credits,onClick:()=>n(fC.Credits)}),i(jl.WORKSPACE_FEATURES_VIEW)&&e.jsx(hC,{activeSection:r,icon:e.jsx(Ns,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.features"),section:fC.Features,onClick:()=>n(fC.Features)}),e.jsx(hC,{activeSection:r,icon:e.jsx(ts,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.notifications"),section:fC.Notifications,onClick:()=>n(fC.Notifications)}),d&&!c&&e.jsx(hC,{activeSection:r,icon:e.jsx(Ss,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.permissions"),section:fC.Permissions,onClick:()=>n(fC.Permissions)}),l&&!c&&e.jsx(hC,{activeSection:r,icon:e.jsx(_s,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.danger"),section:fC.Danger,onClick:()=>n(fC.Danger)})]})]})};function mC({title:t,children:r}){return e.jsxs("div",{className:"px-2 flex flex-col space-y-1",children:[e.jsx("div",{className:"text-xs font-bold mb-2 text-gray-500 uppercase tracking-wide px-2",children:t}),r]})}function hC({icon:t,label:r,section:n,onClick:a,activeSection:s}){return e.jsxs("button",{className:Se("flex w-full text-start px-2 py-1 rounded text-sm items-center gap-x-1",n===s?"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"},gC=new Set(Object.values(fC)),bC={[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:s,defaultSection:i=fC.Profile,section:o,onSectionChange:c,showTrigger:l=!0,trigger:d})=>{const{t:u,dir:p}=sn(),[m,h]=t.useState(!1),[f,g]=t.useState(i),b=void 0!==a?a:m,v=s||h,y=void 0!==o?o:f,x=c||g;if(!r)return null;const w=e.jsx(Ks,{variant:"outline",size:"icon",children:e.jsx(xs,{className:"h-4 w-4"})});return e.jsxs(Ac,{open:b,onOpenChange:e=>{v(e),!e&&n&&n()},children:[l&&e.jsx(_c,{asChild:!0,children:d||w}),e.jsxs(Rc,{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:[e.jsx(Mc,{className:"sr-only",children:u(bC[y])}),e.jsx(pC,{workspace:r,section:y,setSection:x}),e.jsxs("div",{className:"flex-1 p-6 overflow-auto flex flex-col bg-background",children:[e.jsx(Ic,{className:"text-xl font-bold mb-4",children:u(bC[y])}),e.jsxs("div",{className:"sm:max-h-[500px] overflow-y-auto",children:[y===fC.Profile&&e.jsx(CS,{workspace:r}),y===fC.General&&e.jsx(kv,{workspace:r}),y===fC.Users&&e.jsx(dC,{workspace:r}),y===fC.Subscription&&e.jsx(zS,{workspace:r}),y===fC.Usage&&e.jsx(VS,{}),y===fC.Credits&&e.jsx(AS,{workspace:r}),y===fC.Features&&e.jsx(Sd,{workspaceId:r._id?.toString()}),y===fC.Notifications&&e.jsx(Pv,{workspace:r}),y===fC.Permissions&&e.jsx(Tv,{workspace:r}),y===fC.Danger&&e.jsx(od,{workspace:r})]})]})]})]})};var yC=Object.freeze({__proto__:null,SETTINGS_SCREENS:gC,SettingsScreen:fC,WorkspaceSettingsDialog:vC,default:vC});const xC=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)})}},wC=()=>{const e=vn(),{os:r,api:n}=En(),{settings:a}=Cn(),s=yn(e=>e.workspaces),i=yn(e=>e.auth.session?.user),o=t.useCallback((t,r)=>{if((!(t._id===s.currentWorkspace?._id)||r?.forceEmit)&&t){const r=s.currentWorkspace;wl(t),e.workspaces(ft(t)),$a.emitWorkspaceChanged(t,r).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceChanged",metadata:{workspaceId:t._id}})})}},[s.currentWorkspace,e]),c=t.useCallback(async(t,n)=>{const a=++p.current;e.workspaces(wt(t._id));try{const e=r.auth?.callbacks?.onWorkspaceChange;if(e){const r=Nl(t,i?.id);try{await e({workspace:t,user:i??null,role:r})}catch(e){throw Re(e,{component:"useSaaSWorkspaces",action:"onWorkspaceChange",metadata:{workspaceId:t._id}}),e}if(a!==p.current)return}o(t,n)}finally{a===p.current&&e.workspaces(wt(null))}},[e,r.auth?.callbacks?.onWorkspaceChange,o,i]);t.useEffect(()=>{if(!s.isInitialized){const t=Sl();if(e.workspaces(bt(!0)),t){const e=s.workspaces.find(e=>e._id===t);e&&c(e,{forceEmit:!0}).catch(()=>{})}}},[s.isInitialized,s.workspaces,s.currentWorkspace,e,c]);const l=t.useCallback(()=>{kl(),e.workspaces(gt())},[e]),d=t.useRef(!1),u=t.useRef(!1),p=t.useRef(0),m=t.useCallback(async()=>{if(!s.loading&&!d.current){d.current=!0,e.workspaces(vt(!0)),e.workspaces(yt(null));try{const t=await n.getWorkspaces();if(e.workspaces(dt(t)),t.length>0){const e=Sl();if(e&&Cl(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(yt(t instanceof Error?t.message:"Failed to fetch workspaces"))}finally{e.workspaces(vt(!1)),d.current=!1}}},[n,s.loading,e,c]),h=t.useCallback(async()=>{if(!s.refreshing&&!d.current){d.current=!0,e.workspaces(xt(!0));try{const t=await n.getWorkspaces();e.workspaces(dt(t))}catch(e){}finally{e.workspaces(xt(!1)),d.current=!1}}},[n,s.refreshing,e]),f=t.useCallback(async(t,r)=>{const a=await n.createWorkspace({name:t,image:r});e.workspaces(ut(a)),await c(a),$a.emitWorkspaceCreated(a).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceCreated",metadata:{workspaceId:a._id}})}),setTimeout(()=>{xC.openWorkspaceSettings(fC.Subscription)},300)},[n,e,c]),g=t.useCallback(async(t,r)=>{const a=await n.updateWorkspace(t._id,r);e.workspaces(pt(a)),$a.emitWorkspaceUpdated(a).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceUpdated",metadata:{workspaceId:a._id}})})},[n,e]),b=t.useCallback(async()=>{if(u.current)return s.allFeatures.length>0?s.allFeatures:null;if(s.allFeatures.length>0)return s.allFeatures;u.current=!0;try{const t=await n.getFeatures();return e.workspaces(ht(t)),t}catch(e){return Re(e,{component:"useSaaSWorkspaces",action:"getFeatures"}),null}finally{u.current=!1}},[n,e,s.allFeatures]),v=t.useCallback(async(e,t,r)=>await n.updateFeature(e,t,r),[n]),y=t.useCallback(async e=>n.updateSettings(e),[n]),x=t.useCallback(async(e,t)=>{const r=await n.updateWorkspacePermissions(e,t);return await h(),r},[n,h]);t.useEffect(()=>{if(!s.currentWorkspace?._id||0===s.workspaces.length)return;const t=s.currentWorkspace._id,r=s.workspaces.find(e=>e._id===t);if(r)r!==s.currentWorkspace&&(wl(r),e.workspaces(ft(r)));else if(s.workspaces.length>0){const e=s.workspaces[0];e._id!==t&&c(e).catch(()=>{})}},[s.workspaces,s.currentWorkspace,e,c]);const w=t.useCallback(async e=>await n.getWorkspaceUsers(e),[n]),S=t.useCallback(async(e,t,r)=>{const i=s.workspaces.find(t=>t._id===e);if(i){const e=Ma({settingsMaxUsers:a?.workspace?.maxWorkspaceUsers}),t=Ua({memberCount:i.users?.length??0,maxUsersConfig:e});if(!t.canInvite)throw new Error(t.blockMessageKey||"users.memberLimitReached")}const o=await n.addUser(e,{email:t,role:r});return i&&$a.emitWorkspaceUserAdded(o.userId,i,r).catch(t=>{Re(t,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserAdded",metadata:{workspaceId:e,userId:o.userId,role:r}})}),h().catch(()=>{}),It(),o},[n,s.workspaces,h,a]),k=t.useCallback(async(e,t)=>{const r=s.workspaces.find(t=>t._id===e);if(r&&El(r,t))throw new Error("Cannot remove the workspace owner");const a=(await n.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user._id)===t),i=await n.removeUser(e,t);if(r&&a){const t=a.role;$a.emitWorkspaceUserRemoved(i.userId,r,t).catch(r=>{Re(r,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRemoved",metadata:{workspaceId:e,userId:i.userId,role:t}})})}return h().catch(()=>{}),It(),i},[n,s.workspaces,h]),C=t.useCallback(async(e,t,r)=>{if(r.role){const r=s.workspaces.find(t=>t._id===e);if(r&&El(r,t))throw new Error("Cannot change the role of the workspace owner")}let a;if(r.role){const r=(await n.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user._id)===t);a=r?.role}const i=await n.updateUser(e,t,r);return r.role&&a&&a!==r.role&&$a.emitWorkspaceUserRoleChanged(i.userId,i.workspace,a,r.role).catch(n=>{Re(n,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRoleChanged",metadata:{workspaceId:e,userId:t,previousRole:a,newRole:r.role}})}),i},[n,s.workspaces]),E=t.useCallback(async e=>{const t=await n.getProfile().catch(()=>null),r=await n.updateUserProfile(e);return $a.emitUserUpdated(r,t||void 0).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitUserUpdated",metadata:{userId:r._id}})}),r},[n]),N=t.useCallback(async()=>await n.getProfile(),[n]),j=t.useCallback(async e=>await n.getWorkspace(e),[n]),A=t.useCallback(async t=>{if(!i)throw new Error("User must be authenticated to delete a workspace");const r=s.workspaces.find(e=>e._id===t);if(!r)throw new Error("Workspace not found");if(!El(r,i.id))throw new Error("Only the workspace creator can delete the workspace");const a=await n.deleteWorkspace(t);return e.workspaces(mt(t)),s.currentWorkspace?._id===t&&(kl(),e.workspaces(gt())),r&&$a.emitWorkspaceDeleted(r).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceDeleted",metadata:{workspaceId:t}})}),a},[n,s.workspaces,s.currentWorkspace,e,i]);return{workspaces:s.workspaces,loading:s.loading,error:s.error,fetchWorkspaces:m,refreshWorkspaces:h,refreshing:s.refreshing,currentWorkspace:s.currentWorkspace,setCurrentWorkspace:o,switchToWorkspace:c,resetCurrentWorkspace:l,createWorkspace:f,allFeatures:s.allFeatures,getFeatures:b,updateFeature:v,updateWorkspaceSettings:y,updateWorkspacePermissions:x,getWorkspace:j,updateWorkspace:g,getUsers:w,addUser:S,removeUser:k,updateUser:C,getProfile:N,updateUserProfile:E,deleteWorkspace:A,switching:null!==s.switchingToId,switchingToId:s.switchingToId}},SC=t.createContext(null);SC.displayName="QuotaUsageContext";const kC="useQuotaUsageContext must be used within QuotaUsageContextProvider. Make sure QuotaUsageContextProvider is wrapping your application (or the tree that uses quota gates).",CC=t.memo(function({children:r}){const{currentWorkspace:n}=wC(),{quotas:a,loading:s,error:i,refetch:o}=On(n?._id);t.useEffect(()=>{return e=o,Tt.add(e),()=>{Tt.delete(e)};var e},[o]);const c=t.useMemo(()=>({quotas:a,loading:s,error:i,refetch:o}),[a,s,i,o]);return e.jsx(SC.Provider,{value:c,children:r})});function EC(){const e=t.useContext(SC);if(null===e)throw new Error(kC);return e}CC.displayName="QuotaUsageContextProvider";let NC=!1,jC=null;const AC=t.memo(({children:r,callbacks:n})=>{const a=vn(),s=rd(),i=Sn(),o=Ve(s.status).isAuthenticated,c=t.useRef(!1),l=t.useRef(null);t.useEffect(()=>{o||(NC=!1,jC=null)},[]);const d=t.useCallback(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=i;if(!rt(r))throw new Error("OS configuration is not available");const{serverUrl:s,version:o,orgId:c}=r,l=new Rl({serverUrl:s,version:o}),d=await l.getProfile(t),u=td(ed(d,c,r.auth?.clientId||""),t);pn(u.sessionId),a.auth(Oe(u)),function(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.delete(un),window.history.replaceState({},"",e.toString())}catch(e){Re(e,{component:"auth-utils",action:"removeTokenFromUrl",metadata:{param:un}})}}();const p=Ol();p&&p!==window.location.href&&Il(p)}}catch(t){throw Ol(),Re(t,{component:"AuthProviderWrapper",action:"handleAuthRedirect",metadata:{hasCode:!!e}}),a.auth(Le()),t}},[a,n,i]);return t.useEffect(()=>{if("undefined"==typeof window)return;if(o)return;if(NC)return;if(jC)return;if(!rt(i))return;if(hn())return;if(!n?.getSession)return NC=!0,void a.auth(Le());const e=n.getSession,{serverUrl:t,version:r,orgId:s}=i,c=i.auth?.clientId||"";jC=(async()=>{let i=null;try{i=await e()}catch(e){Re(e,{component:"AuthProviderWrapper",action:"getSession"})}if(!i)return NC=!0,a.auth(Le()),"undefined"!=typeof window&&Ll(window.location.href),void n?.onSessionExpired?.("missing");try{const e=new Rl({serverUrl:t,version:r}),n=await e.getProfile(i),o=td(ed(n,s,c),i);pn(o.sessionId),NC=!0,a.auth(Oe(o));const l=Ol();l&&l!==window.location.href&&Il(l)}catch(e){Re(e,{component:"AuthProviderWrapper",action:"fetchUserProfile"}),NC=!0,a.auth(Le()),"undefined"!=typeof window&&Ll(window.location.href),n?.onSessionExpired?.("expired")}finally{jC=null}})()},[o,a,i,n]),t.useEffect(()=>{const e=hn();if(!e)return;if(c.current||l.current===e)return;if(!rt(i))return;c.current=!0,l.current=e;let t=!1;return a.auth(Ue()),d(e).then(()=>{t||(l.current=null)}).catch(e=>{t||(Re(e,{component:"AuthProviderWrapper",action:"handleAuthRedirectEffect",metadata:{hasCode:!0}}),l.current=null)}).finally(()=>{c.current=!1}),()=>{t=!0}},[d,i.serverUrl,i.version,i.orgId]),e.jsx(e.Fragment,{children:r})});AC.displayName="AuthProviderWrapper";const _C=t.memo(({config:r,auth:n,children:a})=>{const s=vn(),i=Sn(),o=t.useMemo(()=>({clientId:n?.clientId||"",redirectUrl:n?.redirectUrl||"",callbacks:n?.callbacks}),[n?.clientId,n?.redirectUrl,n?.callbacks]);t.useEffect(()=>{s.os(Qe({...r,auth:o}))},[r,o,s]);const c=t.useMemo(()=>rt(i)?new wn(i):null,[i.serverUrl,i.version,i.orgId]);return xn(async e=>{if(!c||i.settings)return;const t=await c.getSettings(e);s.os(et(t))},[c,i.settings,s],{onError:e=>Re(e,{component:"ContextConfigProvider",action:"fetchSettings",metadata:{serverUrl:i.serverUrl,version:i.version,orgId:i.orgId}})}),e.jsx(e.Fragment,{children:a})});_C.displayName="ContextConfigProvider";class PC extends gn{constructor(e){super(e)}async getAttributes(e){const t=await this.fetchResponse("users/attributes",{signal:e});if(!t.ok)throw new Error(await je(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 je(t,"Failed to fetch user features"));const r=await t.json();return"object"==typeof r&&null!==r?r:{}}}const TC=t.createContext(void 0),RC=t.memo(({children:r})=>{const{t:n}=sn(),a=Sn(),s=function(){const e=Sn();return t.useMemo(()=>new PC(e),[e.serverUrl,e.version])}(),{isAuthenticated:i}=nd(),{serverUrl:o,version:c}=a,[l,d]=t.useState({}),[u,p]=t.useState({}),[m,h]=t.useState(!1),[f,g]=t.useState(null),b=t.useCallback(async e=>{if(o&&c&&i)try{const t=await s.getAttributes(e);d(t)}catch(e){if(Ne(e))return;const t=e instanceof Error?e:new Error(n("errors.generic"));g(t),Re(e,{component:"UserProvider",action:"fetchAttributes"})}else d({})},[s,o,c,i]),v=t.useCallback(async()=>{if(o&&c&&i){h(!0),g(null);try{await b()}finally{h(!1)}}},[o,c,i,b]),y=t.useCallback(async e=>{h(!0),g(null);try{const t=await s.updateAttributes(e);return await b(),t}catch(t){const r=t instanceof Error?t:new Error(n("errors.generic"));throw g(r),Re(t,{component:"UserProvider",action:"updateAttributes",metadata:{updates:e}}),t}finally{h(!1)}},[s,b]),x=t.useCallback(async(e,t)=>{h(!0),g(null);try{const r=await s.updateAttribute(e,t);return await b(),r}catch(r){const a=r instanceof Error?r:new Error(n("errors.generic"));throw g(a),Re(r,{component:"UserProvider",action:"updateAttribute",metadata:{attributeKey:e,value:t}}),r}finally{h(!1)}},[s,b]),w=t.useCallback(async e=>{if(o&&c&&i)try{const t=await s.getFeatures(e);p(t)}catch(e){if(Ne(e))return;const t=e instanceof Error?e:new Error(n("errors.generic"));g(t),Re(e,{component:"UserProvider",action:"fetchFeatures"})}else p({})},[s,o,c,i]),S=t.useCallback(async()=>{if(o&&c&&i){h(!0),g(null);try{await w()}finally{h(!1)}}},[o,c,i,w]);xn(async e=>{if(!i||!o||!c)return d({}),void p({});h(!0),g(null);try{await Promise.all([b(e),w(e)])}finally{h(!1)}},[i,o,c,b,w],{onError:e=>Re(e,{component:"UserProvider",action:"initialFetch",metadata:{step:"fetchAttributesAndFeatures"}})});const k=t.useMemo(()=>({attributes:l,features:u,isLoading:m,error:f,updateAttributes:y,updateAttribute:x,refreshAttributes:v,refreshFeatures:S}),[l,u,m,f,y,x,v,S]);return e.jsx(TC.Provider,{value:k,children:r})});RC.displayName="UserProvider";const DC=t.lazy(()=>Promise.resolve().then(function(){return yC}).then(e=>({default:e.default})));const IC=({children:r})=>{const{currentWorkspace:n,switchToWorkspace:a,workspaces:s}=wC(),[i,o]=t.useState(!1),[c,l]=t.useState(fC.Profile),d=t.useRef(!1);return t.useEffect(()=>{const e=xC.getState();o(e.open),l(e.section);return xC.subscribe(e=>{o(e.open),l(e.section)})},[]),t.useEffect(()=>{if(d.current)return;if(!n)return;const e=Xl();if(!e)return;const t=function(e){if(e.screen&&gC.has(e.screen))return e.screen;switch(e.action){case Fl:case Bl:case Wl:return fC.Subscription;case Vl:return fC.Credits;default:return null}}(e);if(!t)return d.current=!0,void Ql();const r=e.ws;if(r&&r!==n._id){const e=s.find(e=>e._id===r);return e?void a(e).catch(()=>{d.current=!0,Ql()}):(d.current=!0,void Ql())}d.current=!0,xC.openWorkspaceSettings(t,e),Ql()},[n,s,a]),e.jsxs(e.Fragment,{children:[r,n&&i&&e.jsx(t.Suspense,{fallback:null,children:e.jsx(DC,{workspace:n,open:i,onOpenChange:e=>{e||xC.closeSettings()},section:c,onSectionChange:e=>{xC.setSection(e)},showTrigger:!1})})]})},MC=(e,t,r)=>{if(t!==tt.V1)throw new Error(`Invalid version: "${t}". Only "${tt.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).`)},UC=t.memo(({serverUrl:r,version:n,orgId:a,auth:s,locale:i,defaultPermissions:o,getCheckoutStripeParams:c,children:l})=>{MC(r,n,a);const d=t.useMemo(()=>({serverUrl:r,version:n,orgId:a}),[r,n,a]),u=t.useMemo(()=>s?.callbacks,[s?.callbacks?.handleAuthentication,s?.callbacks?.onSignOut,s?.callbacks?.handleEvent,s?.callbacks?.onWorkspaceChange]),p=s?.callbacks?.handleEvent;return t.useEffect(()=>($a.setCallbacks(p?{handleEvent:p}:null),()=>{$a.setCallbacks(null)}),[p]),e.jsx(Xr,{locale:i,children:e.jsx(At,{children:e.jsx(AC,{callbacks:u,children:e.jsx(jc,{children:e.jsx(_C,{config:d,auth:s,children:e.jsx(Pt,{getCheckoutStripeParams:c,children:e.jsx(Vn,{appPermissions:o,children:e.jsx(RC,{children:e.jsx(Fn,{children:e.jsx(CC,{children:e.jsx(ra,{children:e.jsx(jv,{children:e.jsx(IC,{children:l})})})})})})})})})})})})})});UC.displayName="SaaSOSProviderInner";const LC=({children:t,...r})=>e.jsx(Ie,{children:e.jsx(UC,{...r,children:t})});LC.displayName="SaaSOSProvider";const OC=e=>{const{children:t}=e,{status:r}=nd();return r!==We.authenticated?null:t},zC=e=>{const{children:t}=e,{status:r}=nd();return r!==We.unauthenticated?null:t};OC.displayName="WhenAuthenticated",zC.displayName="WhenUnauthenticated";const FC=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=nd();return n.includes(a?.role??"")?t:r||null},BC=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=nd(),{currentWorkspace:s}=wC(),i=s?.users.find(e=>e._id===a?.id);return i&&n.includes(i?.role??"")?t:r||null};FC.displayName="WhenRoles",BC.displayName="WhenWorkspaceRoles";const WC=e=>{const{children:t,fallback:r,permission:n}=e,{can:a}=ad();return a(n)?t:r??null};function VC(){const e=t.useContext(TC);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])}}WC.displayName="WhenPermission";const GC=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=wC(),a=n?.features?.[r];return a?t:null},HC=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=wC(),a=n?.features?.[r];return a?null:t},$C=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=VC();return n(r)?t:null},KC=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=VC();return n(r)?null:t};GC.displayName="WhenWorkspaceFeatureEnabled",HC.displayName="WhenWorkspaceFeatureDisabled",$C.displayName="WhenUserFeatureEnabled",KC.displayName="WhenUserFeatureDisabled";const qC=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=Bn();return s?r??null:a?.subscription?t:n??null},ZC=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=Bn();return s?r??null:a?.subscription?n??null:t},JC=e=>{const{children:t,plans:r,loadingComponent:n,fallbackComponent:a}=e,{response:s,loading:i}=Bn();if(i)return n??null;if(!s?.subscription)return a??null;const o=s.plan??s.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},YC=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=Bn();return s?r??null:"trialing"!==a?.subscription?.subscriptionStatus?n??null:t},XC=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=Bn();return s?r??null:a?.subscription?.subscriptionStatus===ia?n??null:t},QC=e=>{const{children:t,loadingComponent:r,fallbackComponent:n,daysThreshold:a=3}=e,{response:s,loading:i}=Bn();if(i)return r??null;const o=s?.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};qC.displayName="WhenSubscription",ZC.displayName="WhenNoSubscription",JC.displayName="WhenSubscriptionToPlans",YC.displayName="WhenTrialing",XC.displayName="WhenNotTrialing",QC.displayName="WhenTrialEnding";const eE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=EC();if(i)return n??null;const o=s?.[t];return o?o.available<=0?a??null:r:a??null},tE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=EC();if(i)return n??null;const o=s?.[t];return o?o.available>0?a??null:r:a??null},rE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=EC();if(i)return n??null;const o=s?.[t];return o&&o.hasOverage&&!1!==o.allowOverage?r:a??null},nE=e=>{const{slug:t,threshold:r,children:n,loadingComponent:a,fallbackComponent:s}=e,{quotas:i,loading:o}=EC();if(o)return a??null;const c=i?.[t];if(!c)return s??null;return(c.included>0?c.consumed/c.included*100:c.consumed>0?100:0)<r?s??null:n};eE.displayName="WhenQuotaAvailable",tE.displayName="WhenQuotaExhausted",rE.displayName="WhenQuotaOverage",nE.displayName="WhenQuotaThreshold";const aE=({children:e})=>{const{currentWorkspace:t}=wC(),r=t?._id,{balance:n,loading:a,error:s,refetch:i}=na(),{packages:o,loading:c}=Yn(r),{consumeCredits:l,loading:d,error:u}=Zn(r),{purchaseCredits:p,loading:m,error:h}=Jn(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}=Yl(r),a=await p({creditPackageId:e._id,successUrl:t,cancelUrl:n});a.url&&Il(a.url)},purchasing:m,refetch:i,error:u||h||s})};aE.displayName="CreditActionsProvider";const sE=({children:e})=>{const{balance:t,loading:r,error:n,refetch:a}=na();return e({balance:t,loading:r,error:n,refetch:a})};sE.displayName="CreditBalance";const iE=e=>{const{min:t=1,children:r,loadingComponent:n,fallbackComponent:a}=e,{balance:s,loading:i}=na();return i?n??null:s?s.available<t?a??null:r:a??null},oE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{balance:a,loading:s}=na();return s?r??null:a?a.available>0?n??null:t:n??null},cE=e=>{const{threshold:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{balance:s,loading:i}=na();return i?n??null:s?s.available>t?a??null:r:a??null};function lE(e){if(!e)return null;const t=new Date(e);return isNaN(t.getTime())?null:t}iE.displayName="WhenCreditsAvailable",oE.displayName="WhenCreditsExhausted",cE.displayName="WhenCreditsLow";class dE extends gn{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 uE=class{constructor(e){this.api=new dE(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),s=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:s}})}};const pE=tg({name:Af().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:Af().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)")});function mE({screen:t}){return e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[e.jsx("p",{className:"text-2xl font-bold",children:t?.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t?.description})]})}function hE({logo:t}){return"string"==typeof t?e.jsx("img",{src:t,alt:"Logo",className:"max-h-24"}):e.jsx("img",{src:t.bucket?.url,alt:"Logo",className:"max-h-24"})}function fE(...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 n=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}var gE,bE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=Os(`Primitive.${r}`),s=a.forwardRef((t,a)=>{const{asChild:s,...i}=t,o=s?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(o,{...i,ref:a})});return s.displayName=`Primitive.${r}`,{...t,[r]:s}},{}),vE={exports:{}},yE={};function xE(){if(gE)return yE;gE=1;var e=t;var r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,a=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function o(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(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 r=t(),c=n({inst:{value:r,getSnapshot:t}}),l=c[0].inst,d=c[1];return s(function(){l.value=r,l.getSnapshot=t,o(l)&&d({inst:l})},[e,r,t]),a(function(){return o(l)&&d({inst:l}),e(function(){o(l)&&d({inst:l})})},[e]),i(r),r};return yE.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:c,yE}var wE,SE,kE={};
|
|
28
28
|
/**
|
|
29
29
|
* @license React
|
|
30
30
|
* use-sync-external-store-shim.development.js
|
|
@@ -33,4 +33,4 @@ var Ta={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 IE(){return TE||(TE=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=t,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useState,s=r.useEffect,i=r.useLayoutEffect,o=r.useDebugValue,c=!1,l=!1,u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(t,u){c||void 0===r.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();n(d,p)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),l=!0)}var m=(p=a({inst:{value:d,getSnapshot:u}}))[0].inst,h=p[1];return i(function(){m.value=d,m.getSnapshot=u,e(m)&&h({inst:m})},[t,d,u]),s(function(){return e(m)&&h({inst:m}),t(function(){e(m)&&h({inst:m})})},[t]),o(d),d};DE.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),DE}function UE(){return RE||(RE=1,"production"===process.env.NODE_ENV?_E.exports=PE():_E.exports=IE()),_E.exports}var ME=UE();function OE(){return()=>{}}var LE="Avatar",[zE]=function(t,r=[]){let n=[];const s=()=>{const e=n.map(e=>a.createContext(e));return function(r){const n=r?.[t]||e;return a.useMemo(()=>({[`__scope${t}`]:{...r,[t]:n}}),[r,n])}};return s.scopeName=t,[function(r,s){const i=a.createContext(s);i.displayName=r+"Context";const o=n.length;n=[...n,s];const c=r=>{const{scope:n,children:s,...c}=r,l=n?.[t]?.[o]||i,u=a.useMemo(()=>c,Object.values(c));return e.jsx(l.Provider,{value:u,children:s})};return c.displayName=r+"Provider",[c,function(e,n){const c=n?.[t]?.[o]||i,l=a.useContext(c);if(l)return l;if(void 0!==s)return s;throw new Error(`\`${e}\` must be used within \`${r}\``)}]},CE(s,...r)]}(LE),[FE,BE]=zE(LE),WE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,...s}=t,[i,o]=a.useState("idle");return e.jsx(FE,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:e.jsx(AE.span,{...s,ref:r})})});WE.displayName=LE;var VE="AvatarImage",HE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,src:s,onLoadingStatusChange:i=()=>{},...o}=t,c=BE(VE,n),l=function(e,{referrerPolicy:t,crossOrigin:r}){const n=ME.useSyncExternalStore(OE,()=>!0,()=>!1),s=a.useRef(null),i=n?(s.current||(s.current=new window.Image),s.current):null,[o,c]=a.useState(()=>KE(i,e));return _s(()=>{c(KE(i,e))},[i,e]),_s(()=>{const e=e=>()=>{c(e)};if(!i)return;const n=e("loaded"),a=e("error");return i.addEventListener("load",n),i.addEventListener("error",a),t&&(i.referrerPolicy=t),"string"==typeof r&&(i.crossOrigin=r),()=>{i.removeEventListener("load",n),i.removeEventListener("error",a)}},[i,r,t]),o}(s,o),u=Ls(e=>{i(e),c.onImageLoadingStatusChange(e)});return _s(()=>{"idle"!==l&&u(l)},[l,u]),"loaded"===l?e.jsx(AE.img,{...o,ref:r,src:s}):null});HE.displayName=VE;var GE="AvatarFallback",$E=a.forwardRef((t,r)=>{const{__scopeAvatar:n,delayMs:s,...i}=t,o=BE(GE,n),[c,l]=a.useState(void 0===s);return a.useEffect(()=>{if(void 0!==s){const e=window.setTimeout(()=>l(!0),s);return()=>window.clearTimeout(e)}},[s]),c&&"loaded"!==o.imageLoadingStatus?e.jsx(AE.span,{...i,ref:r}):null});function KE(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}$E.displayName=GE;var qE=WE,ZE=HE,JE=$E;const YE=a.forwardRef(({className:t,...r},n)=>e.jsx(qE,{ref:n,className:Se("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...r}));YE.displayName=qE.displayName;const XE=a.forwardRef(({className:t,...r},n)=>e.jsx(ZE,{ref:n,className:Se("aspect-square h-full w-full",t),...r}));XE.displayName=ZE.displayName;const QE=a.forwardRef(({className:t,...r},n)=>e.jsx(JE,{ref:n,className:Se("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...r}));QE.displayName=JE.displayName;var eC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=fs(`Primitive.${r}`),s=a.forwardRef((t,a)=>{const{asChild:s,...i}=t,o=s?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(o,{...i,ref:a})});return s.displayName=`Primitive.${r}`,{...t,[r]:s}},{}),tC="horizontal",rC=["horizontal","vertical"],nC=a.forwardRef((t,r)=>{const{decorative:n,orientation:a=tC,...s}=t,i=function(e){return rC.includes(e)}(a)?a:tC,o=n?{role:"none"}:{"aria-orientation":"vertical"===i?i:void 0,role:"separator"};return e.jsx(eC.div,{"data-orientation":i,...o,...s,ref:r})});nC.displayName="Separator";var aC=nC;const sC=a.forwardRef(({className:t,orientation:r="horizontal",decorative:n=!0,...a},s)=>e.jsx(aC,{ref:s,decorative:n,orientation:r,className:Se("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",t),...a}));function iC(t){const{t:r}=sn(),{workspace:n,setCurrentWorkspace:a,setOpen:s,workspacesToUse:i,switchingToId:o}=t,c=t.isCurrentWorkspace??!1,l=o===n._id,u=n.subscription??null,d=null!=u&&"object"==typeof u?u.plan??null:null,p=d?.name??"";return e.jsxs("div",{className:Se("flex items-center gap-3 rounded-lg border-2 p-3 border-border",{"bg-muted text-muted-foreground":c}),children:[e.jsxs(YE,{className:"h-8 w-8 flex items-center justify-center",children:[e.jsx("div",{children:e.jsx(XE,{src:n.image&&n.image.trim()?n.image:void 0})}),e.jsx(QE,{children:(m=n.name,m.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2))})]}),e.jsxs("div",{className:"flex-1 min-w-0 max-w-full",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"font-medium line-clamp-1 text-ellipsis overflow-hidden max-w-full",children:n.name})}),e.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e.jsx(cs,{className:"h-3 w-3"}),e.jsx("span",{children:r("workspace.membersCount",{count:n.users?.length||0})})]}),p&&e.jsx("div",{className:"max-w-fit",children:e.jsx("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:e.jsx("span",{className:"text-xs",children:p})})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[c?null:e.jsx(Es,{size:"sm",disabled:null!==o||l,progress:l,onClick:()=>{t.switchToWorkspace(n).then(()=>s(!1)).catch(e=>{Re(e,{component:"WorkspaceItem",action:"switchToWorkspace",metadata:{workspaceId:n._id}})})},children:r("workspace.switchTo")}),e.jsx(Dk,{workspace:n,onClose:()=>{if(c){const e=i.findIndex(e=>e._id?.toString()===n._id?.toString());-1!==e&&a(i[e])}}})]})]});var m}function oC(r){const{t:n,dir:a}=sn(),{switching:s}=Mk(),[i,o]=t.useState(!1),[c,l]=t.useState("emoji"),[u,d]=t.useState("🏢"),[p,m]=t.useState(!1),{createWorkspace:h}=Mk(),f=ud({resolver:vh(bf({name:Vh().min(2,{message:n("workspace.workspaceNameMinLength")}),image:Vh().optional()})),defaultValues:{name:"",image:""}});return e.jsxs(sc,{open:i,onOpenChange:o,children:[e.jsx(ic,{asChild:!0,children:e.jsxs(Es,{className:"w-full rounded-none",disabled:s,children:[e.jsx(qa,{className:"h-4 w-4 me-2"}),n("workspace.createNew")]})}),e.jsxs(lc,{dir:a,className:"max-w-xl min-w-full sm:min-w-[600px]",children:[e.jsxs(uc,{children:[e.jsx(dc,{children:n("workspace.createTitle")}),e.jsx(pc,{children:n("workspace.createDescription")})]}),e.jsx(Hf,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){let t="";if("emoji"===c)t=Ob(u);else if("url"===c&&e.image)try{new URL(e.image),t=e.image}catch{return void f.setError("image",{message:n("workspace.invalidUrl")})}m(!0);try{await h(e.name,t),o(!1),f.reset(),d("🏢"),l("emoji"),r?.onCreated?.()}catch(t){Re(t,{component:"WorkspaceProvider",action:"createWorkspace",metadata:{name:e.name}})}finally{m(!1)}}),children:[e.jsx($f,{control:f.control,name:"name",render:({field:t})=>e.jsxs(Zf,{children:[e.jsx(Jf,{children:n("workspace.workspaceName")}),e.jsx(Yf,{children:e.jsx(eg,{placeholder:n("workspace.workspaceNamePlaceholder"),...t})}),e.jsx(Qf,{})]})}),e.jsxs("div",{className:"flex flex-col gap-y-2 my-2",children:[e.jsxs("div",{children:[e.jsx(Vf,{className:"text-sm font-medium",children:n("workspace.workspaceIcon")}),e.jsx(Xf,{children:n("workspace.iconDescription")})]}),e.jsxs(Jg,{value:c,onValueChange:e=>l(e),className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(Yg,{value:"emoji",id:"emoji"}),e.jsxs(Vf,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(rs,{className:"h-4 w-4"}),n("workspace.chooseEmoji")]})]}),e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(Yg,{value:"url",id:"url"}),e.jsxs(Vf,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(Ga,{className:"h-4 w-4"}),n("workspace.customImageUrl")]})]})]}),"emoji"===c&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:u})]}),e.jsx(Ub,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Lb.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{d(e),f.setValue("image",Ob(e))})(t),className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(u===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===c&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsx($f,{control:f.control,name:"image",render:({field:t})=>e.jsxs(Zf,{children:[e.jsx(Jf,{children:n("workspace.imageUrl")}),e.jsx(Yf,{children:e.jsx(eg,{placeholder:n("workspace.imageUrlPlaceholder"),...t})}),e.jsx(Xf,{children:n("workspace.imageUrlDescription")}),e.jsx(Qf,{})]})}),f.watch("image")&&f.watch("image")?.trim()&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e.jsx("img",{src:f.watch("image")||void 0,alt:"Workspace preview",className:"w-full h-full object-cover",onError:e=>{e.currentTarget.style.display="none"}})})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[e.jsx(Es,{type:"button",variant:"outline",onClick:()=>{o(!1),f.reset(),d("🏢"),l("emoji")},disabled:p,children:n("settings.common.cancel")}),e.jsx(Es,{type:"submit",disabled:p,children:p?e.jsxs(e.Fragment,{children:[e.jsx($a,{className:"me-2 h-4 w-4 animate-spin"}),n("workspace.creating")]}):n("workspace.createWorkspace")})]})]})})]})]})}sC.displayName=aC.displayName;var cC=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 lC=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 uC=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 dC=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 pC=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 mC=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 hC=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 fC={[Gn.Monthly]:"subscription.billingInterval.perMonth",[Gn.Quarterly]:"subscription.billingInterval.perQuarter",[Gn.Yearly]:"subscription.billingInterval.perYear"},gC=(e,t,r)=>{if(!e||0===e)return null;let n;switch(r){case Gn.Yearly:n=t/12;break;case Gn.Quarterly:n=t/3;break;default:return null}const a=(e-n)/e*100;return a>0?Math.round(a):null};var bC=Object.freeze({__proto__:null,default:({open:r,onOpenChange:n,planVersions:a,currentPlanVersionId:s,currentStripePriceId:i,billingCurrency:o,currentMemberCount:c,trialUsedAt:l,workspaceName:u,initialInterval:d,initialCurrency:p,onSelectPlan:m,loading:h=!1})=>{const[f,g]=t.useState(!1),{t:b,formattingLocale:v,dir:y,fmtNum:x,fmtCents:w}=sn(),{settings:S}=En(),k=S?.workspace?.mode===Kw,E=(e,t)=>null==e||0===e?"":w(e,t),C=e=>b(fC[e]??fC[Gn.Monthly]),[N,A]=t.useState(null),_=t.useRef(!1),j=t.useMemo(()=>pa(i,a),[i,a]),P=j?.interval??null,T=j?.currency??null,R=t.useMemo(()=>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()}(a),[a]),D=t.useMemo(()=>{const e=o?.trim().toLowerCase();return e?R.includes(e)?[e]:[]:R},[o,R]),[I,U]=t.useState(d||P||Gn.Monthly),[M,O]=t.useState(()=>p&&D.includes(p)?p:T&&D.includes(T)?T:D.length>0?D[0]:""),L=o?.trim()||M;t.useEffect(()=>{if(r){U(d||P||Gn.Monthly);const e=p||T;e&&D.includes(e)?O(e):D.length>0&&!D.includes(M)&&O(D[0])}},[r,d,p,P,T,D]);const z=t.useMemo(()=>[...a],[a]),F=(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())})(z),B=F.filter(e=>e.type===ra),W=F.filter(e=>e.type===na),V=F.filter(e=>e.type===aa),H=async e=>{if(!(e===s&&P===I||h||f||_.current)){_.current=!0,g(!0),A(e);try{await m(e,I,L),n(!1)}catch(e){}finally{_.current=!1,g(!1),A(null)}}},G=e=>la(e,L,I),$=e=>!!e.pricingVariants?.some(e=>e.currency?.toLowerCase()===L.toLowerCase()),K=h||f,q=e=>{switch(e){case Gn.Monthly:return b("subscription.billingInterval.monthly");case Gn.Quarterly:return b("subscription.billingInterval.quarterly");case Gn.Yearly:return b("subscription.billingInterval.yearly");default:return b("subscription.billingInterval.monthly")}},Z=e=>{const t=e._id===s,r=P===I;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:b("subscription.switchToInterval",{interval:q(I)}),variant:"default",disabled:!1};const n=e.trial?.enabled&&e.trial.durationDays>0&&!l&&!i;if(!s)return n?{labelKey:"_dynamic",dynamicLabel:b("subscription.startTrialDays",{days:e.trial.durationDays}),variant:"default",disabled:!1}:{labelKey:"subscription.subscribe",variant:"default",disabled:!1};const a=z.findIndex(e=>e._id===s),o=z.findIndex(t=>t._id===e._id);return-1===a||-1===o?n?{labelKey:"_dynamic",dynamicLabel:b("subscription.startTrialDays",{days:e.trial.durationDays}),variant:"default",disabled:!1}:{labelKey:"subscription.checkout.select",variant:"default",disabled:!1}:o<a?{labelKey:"subscription.checkout.downgrade",variant:"outline",disabled:!1}:o>a?n?{labelKey:"_dynamic",dynamicLabel:b("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}},J=(e,t,r=Gn.Monthly)=>{if(t.type===ra)return e.features?.[t.slug]??!1;if(t.type===na)return e.limits?.[t.slug]??null;if(t.type===aa){const n=da(e,L,t.slug,r);return n||Bw(e.quotas?.[t.slug],r)}return null},Y=(e,t,r)=>{if(t.type===ra)return!0===e?"✓":"—";if(t.type===na)return null!=e&&"number"==typeof e?x(e):"—";if(t.type===aa){const n=Ww("object"==typeof e&&null!==e&&"included"in e?e:null,t.name.toLowerCase(),{currency:r,locale:v});return n?n.allowOverage?n.hasOverage?b("quota.includedWithOverage",{count:n.included,price:n.price,unit:n.unit}):b("quota.includedOnly",{count:n.included}):b("quota.includedHardLimit",{count:n.included}):"—"}return"—"};return e.jsx(sc,{open:r,onOpenChange:n,children:e.jsxs(lc,{dir:y,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.jsxs("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.jsxs("div",{children:[e.jsx(dc,{className:"text-xl sm:text-2xl font-bold",children:b("pricing.title")}),e.jsxs(pc,{className:"mt-1 text-sm",children:[b("subscription.choosePlanDescription"),u&&e.jsx("span",{className:"ml-1 font-medium text-foreground",children:b("subscription.forWorkspace",{name:u})})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 sm:gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[!o?.trim()&&D.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-sm text-slate-600",children:b("pricing.currency")}),e.jsx("select",{"aria-label":b("pricing.selectCurrency"),value:M,onChange:e=>O(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:D.map(t=>{const r=Of(t);return e.jsx("option",{value:t,children:r?`${r} ${t.toUpperCase()}`:t.toUpperCase()},t)})})]}),o?.trim()&&e.jsx("span",{className:"text-xs text-slate-500",children:b("subscription.billingInCurrency",{currency:o.toUpperCase()})})]}),e.jsx("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":b("pricing.billingInterval"),children:[Gn.Monthly,Gn.Quarterly,Gn.Yearly].map(t=>{const r=P===t;return e.jsx("button",{onClick:()=>U(t),"aria-pressed":I===t,className:"flex-1 sm:flex-initial px-3 sm:px-4 py-2 text-sm font-medium rounded-md transition-all relative "+(I===t?"bg-white text-slate-900 shadow-sm":"text-slate-600 hover:text-slate-900"),children:e.jsxs("span",{className:"flex items-center justify-center gap-1 sm:gap-1.5",children:[t===Gn.Monthly&&b("subscription.billingInterval.monthly"),t===Gn.Quarterly&&b("subscription.billingInterval.quarterly"),t===Gn.Yearly&&b("subscription.billingInterval.yearly"),t===Gn.Yearly&&e.jsx("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:b("pricing.save")}),r&&s&&e.jsx("span",{className:"hidden sm:inline text-xs px-1.5 py-0.5 bg-blue-100 text-blue-700 rounded-full font-semibold",children:b("pricing.current")})]})},t)})})]})]}),e.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:o?.trim()&&0===D.length?e.jsxs("div",{className:"text-center py-12 px-4",children:[e.jsx("p",{className:"text-slate-600 font-medium",children:b("pricing.noPlansCurrency")}),e.jsx("p",{className:"text-slate-500 text-sm mt-2",children:b("pricing.noPlansCurrencyHint")})]}):0===z.length?e.jsx("div",{className:"text-center py-12 text-gray-500",children:e.jsx("p",{children:b("pricing.noPlans")})}):e.jsxs("div",{className:"flex-1 min-h-0 overflow-hidden bg-white",children:[e.jsx("div",{className:"md:hidden overflow-auto h-full",style:{maxHeight:"calc(100vh - 13rem)"},children:e.jsx("div",{className:"p-4 space-y-4",children:z.map(t=>{const r=t._id===s,n=Z(t),a=K&&t._id===N,o=G(t),u=$(t),d=t.pricingVariants?.length&&t.pricingVariants.some(e=>e.currency?.toLowerCase()===L.toLowerCase())?L:t.plan?.currency??L??"",p=la(t,L,Gn.Monthly)??0,m=I!==Gn.Monthly&&null!==o?gC(p,o,I):null,h=ma(t,L),f=h?ha(t,L,I):null;return e.jsxs("div",{className:"rounded-xl border-2 p-4 "+(r?"border-blue-500 bg-blue-50/30":"border-slate-200 bg-white"),children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-lg font-bold text-slate-900",children:t.plan.name}),t.trial?.enabled&&t.trial.durationDays>0&&!r&&!l&&!i&&e.jsx("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:b("subscription.trialBadge",{days:t.trial.durationDays})})]}),t.plan.description&&e.jsx("p",{className:"text-xs text-slate-500 mt-0.5 line-clamp-2",children:t.plan.description})]}),r&&e.jsx("span",{className:"shrink-0 rounded-md bg-blue-600 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",children:b("pricing.current")})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-baseline gap-1 whitespace-nowrap",children:[e.jsx("span",{className:"text-2xl font-bold text-slate-900",children:u&&null!==o||u?E(o,d)||b("pricing.free"):"—"}),null!==o&&o>0&&u&&e.jsx("span",{className:"text-sm text-slate-500",children:C(I)})]}),null!==m&&m>0&&u&&e.jsx("span",{className:"text-xs text-emerald-600 font-medium",children:b("subscription.savingsPercent",{percent:m})}),h?.enabled&&f&&f>0&&!k&&e.jsx("div",{className:"text-xs text-slate-500 mt-1",children:b("subscription.seatPriceDisplay",{price:w(f,d),interval:C(I),included:x(h.includedSeats),includedLabel:b("pricing.included")})})]}),B.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-1.5",children:b("subscription.items.features")}),e.jsx("div",{className:"space-y-1",children:B.map(r=>{const n=J(t,r,I),a=r.type===ra&&!0===n;return e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.type===ra?a?e.jsx("span",{className:"text-emerald-500 text-xs",children:"✓"}):e.jsx("span",{className:"text-slate-300 text-xs",children:"✕"}):null,e.jsx("span",{className:a?"text-slate-700":"text-slate-400",children:r.name})]},r._id)})})]}),W.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-1.5",children:b("subscription.items.limits")}),e.jsx("div",{className:"space-y-1",children:W.map(r=>{const n=J(t,r,I);return e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-slate-600",children:r.name}),e.jsx("span",{className:"font-medium text-slate-700",children:"number"==typeof n?x(n):"—"})]},r._id)})})]}),h?.enabled&&!k&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-semibold text-emerald-600 uppercase tracking-wider mb-1.5",children:b("subscription.seats.title")}),e.jsxs("div",{className:"space-y-1 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:b("subscription.seats.included")}),e.jsx("span",{className:"font-medium",children:x(h.includedSeats||0)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:b("subscription.seats.maxSeats")}),e.jsx("span",{className:"font-medium",children:h.maxSeats>0?x(h.maxSeats):b("subscription.seats.unlimited")})]}),null!=c&&c>0&&(()=>{const t=Math.max(0,c-(h.includedSeats||0));return e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:b("subscription.seats.billable")}),e.jsx("span",{className:"font-medium "+(0===t?"text-emerald-600":"text-amber-600"),children:0===t?b("subscription.seats.allIncluded"):`${x(t)} ${b("subscription.seats.extra")}`})]})})()]})]}),e.jsx(Es,{className:"w-full mt-2",variant:n.variant,disabled:n.disabled||K||!u,progress:a,onClick:()=>H(t._id),children:a?b("pricing.processing"):u?n.dynamicLabel??b(n.labelKey):b("pricing.unavailable")})]},t._id)})})}),e.jsx("div",{className:"hidden md:block overflow-auto h-full",style:{maxHeight:"calc(100vh - 12rem)"},children:e.jsxs("table",{className:"w-full border-separate border-spacing-0",style:{minWidth:260+220*z.length+"px",borderCollapse:"separate"},children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:260,minWidth:260}}),z.map(t=>e.jsx("col",{style:{width:220,minWidth:220}},t._id))]}),e.jsx("thead",{children:e.jsxs("tr",{className:"align-top",children:[e.jsx("th",{className:"sticky top-0 start-0 z-30 p-0 bg-white text-start"}),z.map(t=>{const r=t._id===s,n=Z(t),a=K&&t._id===N,o=G(t),c=la(t,L,Gn.Monthly)??0,u=I!==Gn.Monthly&&null!==o?gC(c,o,I):null,d=$(t),p=t.pricingVariants?.length&&t.pricingVariants.some(e=>e.currency?.toLowerCase()===L.toLowerCase())?L:t.plan?.currency??L??"";return e.jsx("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)] "+(t._id===s?"bg-blue-50/80":"bg-white"),children:e.jsxs("div",{className:"flex h-full flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("h3",{className:"text-base font-bold text-slate-900 truncate",children:t.plan.name}),t.trial?.enabled&&t.trial.durationDays>0&&!r&&!l&&!i&&e.jsx("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:b("subscription.trialBadge",{days:t.trial.durationDays})})]}),r&&e.jsx("span",{className:"shrink-0 rounded-md bg-blue-600 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",children:b("pricing.current")})]}),e.jsxs("div",{className:"flex flex-col items-start min-h-[3rem]",children:[e.jsxs("div",{className:"flex items-baseline gap-1 flex-wrap",children:[e.jsx("span",{className:"text-2xl font-bold text-slate-900",children:d&&null!==o||d?E(o,p)||b("pricing.free"):"—"}),null!==o&&o>0&&d&&e.jsx("span",{className:"text-sm text-slate-500",children:C(I)}),null!==u&&u>0&&d&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 bg-emerald-100 text-emerald-700 rounded-full font-semibold whitespace-nowrap",children:b("subscription.savingsPercent",{percent:u})})]}),(()=>{if(k)return null;const r=ma(t,L);if(!r)return null;const n=ha(t,L,I);return!n||n<=0?null:e.jsx("div",{className:"text-[11px] text-slate-500 mt-1.5 border-t border-slate-100 pt-1 leading-tight",children:e.jsx("div",{children:b("subscription.seatPriceDisplay",{price:w(n,p),interval:C(I),included:x(r.includedSeats),includedLabel:b("pricing.included")})})})})()]}),t.plan.description&&e.jsx("p",{className:"text-xs text-slate-500 line-clamp-2 leading-relaxed text-start",children:t.plan.description}),e.jsx(Es,{className:"mt-auto w-full",variant:n.variant,disabled:n.disabled||K||!d,progress:a,onClick:()=>H(t._id),children:a?b("pricing.processing"):d?n.dynamicLabel??b(n.labelKey):b("pricing.unavailable")})]})},t._id)})]})}),e.jsxs("tbody",{children:[B.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("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:b("subscription.items.features")}),e.jsx("td",{colSpan:z.length,className:"border-t border-slate-200 bg-slate-100"})]}),B.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("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:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:t.description})]}),z.map(r=>{const n=J(r,t,I),a=r.pricingVariants?.length?L:r.plan?.currency??L??"",i=Y(n,t,a),o=t.type===ra&&!0===n;return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(r._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium "+(o?"text-emerald-600":"—"===i?"text-slate-400":"text-slate-700"),children:i})},r._id)})]},t._id))]}),W.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("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:b("subscription.items.limits")}),e.jsx("td",{colSpan:z.length,className:"border-t border-slate-200 bg-slate-100"})]}),W.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("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:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:t.description})]}),z.map(r=>{const n=J(r,t,I),a=r.pricingVariants?.length?L:r.plan?.currency??L??"",i=Y(n,t,a);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(r._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium "+("—"===i?"text-slate-400":"text-slate-700"),children:i})},r._id)})]},t._id))]}),V.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("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:b("subscription.items.quotas")}),e.jsx("td",{colSpan:z.length,className:"border-t border-slate-200 bg-slate-100"})]}),V.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("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:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:t.description})]}),z.map(r=>{const n=J(r,t,I),a=r.pricingVariants?.length?L:r.plan?.currency??L??"",i=Y(n,t,a);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(r._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium "+("—"===i?"text-slate-400":"text-slate-700"),children:i})},r._id)})]},t._id))]}),!k&&z.some(e=>{const t=ma(e,L);return t?.enabled})&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("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:b("subscription.seats.title")}),e.jsx("td",{colSpan:z.length,className:"border-t border-emerald-200 bg-emerald-50"})]}),e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("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:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:b("subscription.seats.includedSeats")}),e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:b("subscription.seats.freeWithBase")})]}),z.map(t=>{const r=ma(t,L);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium text-slate-700",children:r?.enabled?x(r.includedSeats||0):"—"})},t._id)})]}),e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsx("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:e.jsx("div",{className:"font-medium text-sm text-slate-900",children:b("subscription.seats.maxSeats")})}),z.map(t=>{const r=ma(t,L);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium text-slate-700",children:r?.enabled?r.maxSeats>0?x(r.maxSeats):b("subscription.seats.unlimited"):"—"})},t._id)})]}),e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsx("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:e.jsx("div",{className:"font-medium text-sm text-slate-900",children:b("subscription.seats.perExtraSeat")})}),z.map(t=>{const r=ha(t,L,I),n=t.pricingVariants?.length?L:t.plan?.currency??L??"";return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium text-slate-700",children:r&&r>0?`${w(r,n)}${C(I)}`:"—"})},t._id)})]}),null!=c&&c>0&&e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("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:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:b("subscription.seats.billable")}),e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:b("subscription.membersInWorkspace",{count:c})})]}),z.map(t=>{const r=ma(t,L);if(!r?.enabled)return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm text-slate-400",children:"—"})},t._id);const n=r.includedSeats||0,a=Math.max(0,c-n);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:0===a?e.jsx("span",{className:"text-sm font-medium text-emerald-600",children:b("subscription.seats.allIncluded")}):e.jsxs("span",{className:"text-sm font-medium text-amber-600",children:[x(a)," ",b("subscription.seats.extra")]})},t._id)})]})]})]})]})})]})})]})})}});exports.BetaForm=({onSuccess:r,onError:n,className:a="w-full",fieldClassName:s="flex flex-col gap-1.5 w-full",autoFocus:i=!0,showSuccessMessage:o=!0,hideLogo:c=!1,hideTitles:l=!1})=>{const{t:u}=sn(),[d,p]=t.useState(!1),[m,h]=t.useState(!1),{submitBetaForm:f,isLoading:g,isSubmitting:b,error:v,config:y,success:x,message:w}=(()=>{const{t:e}=sn(),r=Sn(),[n,a]=t.useState(null),[s,i]=t.useState(!0),[o,c]=t.useState(!1),[l,u]=t.useState(null),[d,p]=t.useState(!1),[m,h]=t.useState(null);return t.useEffect(()=>{let t=!1;return(async()=>{i(!0),u(null);try{const e=new wE(r),n=await e.fetchConfig();t||a(n)}catch(r){t||u(r instanceof Error?r.message:e("beta.errorMessage"))}finally{t||i(!1)}})(),()=>{t=!0}},[r]),{isLoading:s,isSubmitting:o,config:n,error:l,success:d,message:m,submitBetaForm:t.useCallback(async t=>{if(!r){const t=e("errors.generic");return u(t),{success:!1,message:t}}try{c(!0),u(null),p(!1),h(null);const e=new wE(r),n=await e.submitBetaUser({name:t.name||"",email:t.email}),a="success"===n.status;return p(a),h(n.message),{success:a,message:n.message}}catch(t){const r=t instanceof Error?t.message:e("beta.errorMessage");return u(r),p(!1),h(r),{success:!1,message:r}}finally{c(!1)}},[r])}})();t.useEffect(()=>{x&&o&&(p(!0),h(!0)),v&&h(!0)},[x,o,v]);const S=ud({resolver:vh(SE),defaultValues:{email:"",name:""},mode:"onChange",reValidateMode:"onChange"});t.useEffect(()=>{i&&S.setFocus("name")},[i,S]);const k=S.formState.isValid&&!b;return e.jsx("div",{className:"saas-os-ui",style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:g?e.jsxs("div",{className:Se("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",a),children:[e.jsx(wl,{className:"h-24 w-24 rounded-lg"}),e.jsx(wl,{className:"h-6 w-32"}),e.jsxs("div",{className:"w-full space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(wl,{className:"h-4 w-16"}),e.jsx(wl,{className:"h-10 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(wl,{className:"h-4 w-16"}),e.jsx(wl,{className:"h-10 w-full"})]}),e.jsx(wl,{className:"h-10 w-full"})]})]}):e.jsxs("div",{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:[!c&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[y?.logo&&e.jsx(EE,{logo:y?.logo}),y?.name&&e.jsx("div",{children:y?.name})]}),e.jsx(_u,{...S,children:e.jsxs("form",{onSubmit:S.handleSubmit(async e=>{try{const t=await f(e);t.success?(r?.(),S.reset(),o&&p(!0),h(!0)):(n?.(t.message),h(!0))}catch(e){n?.(e instanceof Error?e.message:u("beta.errorMessage")),h(!0)}}),className:a,noValidate:!0,"aria-busy":b,children:[!m&&e.jsxs(e.Fragment,{children:[!l&&y?.screen?.register&&e.jsx(kE,{screen:y?.screen?.register}),e.jsx($f,{control:S.control,name:"name",render:({field:t})=>e.jsxs(Zf,{className:s,children:[e.jsx(Jf,{children:u("beta.nameLabel")}),e.jsx(Yf,{children:e.jsx(eg,{...t})}),e.jsx(Xf,{}),e.jsx(Qf,{})]})}),e.jsx($f,{control:S.control,name:"email",render:({field:t})=>e.jsxs(Zf,{className:s,children:[e.jsx(Jf,{children:u("beta.emailLabel")}),e.jsx(Yf,{children:e.jsx(eg,{...t})}),e.jsx(Xf,{}),e.jsx(Qf,{})]})}),e.jsx(Es,{type:"submit",disabled:!k,className:s,children:u(b?"beta.submittingText":"beta.submitText")})]}),m&&v&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[e.jsxs("div",{className:"border-red-300 text-red-700",role:"alert","aria-live":"assertive","aria-atomic":!0,children:[e.jsx("span",{className:"text-4xl mb-2",role:"img","aria-label":u("settings.common.error"),children:"❗"}),v]}),e.jsx("div",{className:"mt-4 flex justify-center",children:e.jsx(Es,{type:"button",onClick:()=>{h(!1),S.reset()},className:s,children:u("beta.tryAgain")})})]}),m&&d&&w&&e.jsx("div",{className:"flex flex-col items-center justify-center w-full text-green-700 border-green-300 text-center",children:y?.screen?.thankYou&&e.jsx(kE,{screen:y?.screen?.thankYou})})]})}),!m&&e.jsx("div",{children:e.jsxs("div",{children:[u("beta.privacyConsent")," ",e.jsx("a",{href:y?.privacyPolicy,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:u("beta.privacyPolicy")})," ",u("beta.and")," ",e.jsx("a",{href:y?.termsOfService,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:u("beta.termsOfService")}),"."]})})]})})},exports.PricingPage=function({slug:r,children:n,loadingFallback:a,errorFallback:s,redirectBaseUrl:i}){const{items:o,plans:c,notes:l,loading:u,error:d,refetch:p}=An(r),{isAuthenticated:m,signIn:h}=yl(),f=t.useCallback((e,t,r)=>i?Hw({action:"selectPlan",plan:e,interval:t,currency:r},i):null,[i]),g=t.useCallback((e,t,r)=>{if(m)return void Uk.openWorkspaceSettings("subscription",{action:"selectPlan",plan:e,interval:t,currency:r});const n=f(e,t,r);h(n??void 0)},[m,h,f]);return u?void 0!==a?e.jsx(e.Fragment,{children:a}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(wl,{className:"h-8 w-48"}),e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[1,2,3].map(t=>e.jsx(wl,{className:"h-64 rounded-lg"},t))})]}):d?s?e.jsx(e.Fragment,{children:s(d)}):e.jsx("div",{className:"rounded-lg border border-destructive/50 bg-destructive/10 p-4 text-sm text-destructive",children:d}):e.jsx(e.Fragment,{children:n({loading:u,error:d,items:o,plans:c,notes:l,refetch:p,selectPlan:g})})},exports.PushNotificationProvider=Vb,exports.QuotaUsageContextProvider=zk,exports.SETTINGS_SCREENS=Tk,exports.SUPPORTED_LOCALES=Zr,exports.SaaSOSProvider=Xk,exports.SettingsScreen=Pk,exports.SubscriptionContextProvider=Fn,exports.WhenAuthenticated=Qk,exports.WhenNoSubscription=uE,exports.WhenNotTrialing=mE,exports.WhenPermission=nE,exports.WhenQuotaAvailable=fE,exports.WhenQuotaExhausted=gE,exports.WhenQuotaOverage=bE,exports.WhenQuotaThreshold=vE,exports.WhenRoles=tE,exports.WhenSubscription=lE,exports.WhenSubscriptionToPlans=dE,exports.WhenTrialEnding=hE,exports.WhenTrialing=pE,exports.WhenUnauthenticated=eE,exports.WhenUserFeatureDisabled=cE,exports.WhenUserFeatureEnabled=oE,exports.WhenWorkspaceFeatureDisabled=iE,exports.WhenWorkspaceFeatureEnabled=sE,exports.WhenWorkspaceRoles=rE,exports.WorkspaceSwitcher=function(r){const{t:n,dir:a}=sn(),{isAuthenticated:s,user:i}=yl(),o=rt(Sn()),{workspaces:c,currentWorkspace:l,loading:u,refreshing:d,switchingToId:p,fetchWorkspaces:m,getFeatures:h,refreshWorkspaces:f,setCurrentWorkspace:g,switchToWorkspace:b}=Mk(),{settings:v}=En(),[y,x]=t.useState(!1),[w,S]=t.useState(0),[k,E]=t.useState(""),C=u||d;t.useEffect(()=>{s&&o&&(0===c.length?(m(),h()):h())},[s,o]),t.useEffect(()=>{s&&o&&w>0&&f()},[w,s,o]);const N=c,A=N.filter(e=>e._id!==l?._id).filter(e=>e.name.toLowerCase().includes(k.toLowerCase())),_=v?.workspace?.canCreateWorkspace??!0,j=v?.workspace?.showSwitcher??!0,P=v?.workspace?.maxWorkspacesPerUser??0,T=N?.filter(e=>("object"==typeof e.createdBy?e.createdBy._id?.toString():e.createdBy?.toString())===i?.id?.toString()).length??0,R=!1!==_&&(0===P||T<P);return t.useEffect(()=>{!j&&c.length>0&&!l&&b(c[0]).catch(()=>{})},[j,c,l]),!j&&l?e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>x(!0),children:r.trigger?.(C,l)}),e.jsx(Dk,{workspace:l,open:y,onOpenChange:x,showTrigger:!1})]}):e.jsxs(sc,{open:y,onOpenChange:x,children:[e.jsx(ic,{children:r.trigger?.(C,l)}),e.jsxs(lc,{dir:a,className:"max-w-2xl min-w-full sm:min-w-[800px]",children:[e.jsxs(uc,{dir:a,children:[e.jsxs(dc,{className:"flex items-center gap-2",children:[e.jsx(Ma,{className:"h-5 w-5"}),n("workspace.switchTitle")]}),e.jsx(pc,{children:n("workspace.switchDescription")})]}),!i&&e.jsx("div",{className:"flex flex-col items-center justify-center h-full py-4 sm:py-8",children:e.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:n("workspace.notLoggedIn")})}),i&&e.jsxs("div",{dir:a,className:"flex flex-col gap-4",children:[l&&e.jsx(iC,{workspace:l,isCurrentWorkspace:!0,switchToWorkspace:b,switchingToId:p,onClose:()=>x(!1),setCurrentWorkspace:g,setOpen:x,workspacesToUse:N}),e.jsx(sC,{}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:n("workspace.availableWorkspaces",{count:A.length})}),e.jsx("div",{children:e.jsx(Es,{progress:d,disabled:d,variant:"ghost",onClick:function(){s&&o&&S(e=>e+1)},startIcon:e.jsx(Za,{}),children:n("settings.common.refreshAction",{loading:String(d)})})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Ya,{className:"absolute start-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),e.jsx(eg,{placeholder:n("workspace.searchPlaceholder"),value:k,onChange:e=>E(e.target.value),className:"ps-10"})]}),u?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx($a,{className:"h-6 w-6 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ms-2 text-sm text-muted-foreground",children:n("workspace.loadingWorkspaces")})]}):0===A.length?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(Ma,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:n(k?"workspace.noWorkspacesFound":"workspace.noWorkspacesAvailable")})]}):e.jsx(Ub,{className:"h-64",dir:a,children:e.jsx("div",{dir:a,className:"flex flex-col gap-2 my-2.5",children:A.map(t=>{const r=t._id===l?._id;return e.jsx(iC,{workspace:t,isCurrentWorkspace:r,switchToWorkspace:b,switchingToId:p,onClose:()=>x(!1),setCurrentWorkspace:g,setOpen:x,workspacesToUse:N},t._id)})})})]}),R&&e.jsxs(e.Fragment,{children:[e.jsx(sC,{}),e.jsx(oC,{onCreated:()=>{m()}})]})]})]})]})},exports.useAllQuotaUsage=Ln,exports.useBillingPortal=Un,exports.useCancelSubscription=Mn,exports.useCreateCheckoutSession=Tn,exports.useInvoice=(e,r)=>{const{t:n}=sn(),{api:a}=Cn(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,u]=t.useState(null),d=t.useCallback(async()=>{if(e&&r){c(!0),u(null);try{const t=await a.getInvoice(e,r);i(t.invoice)}catch(t){const a=Nn(t,"errors.fetchInvoice",n);u(a),Re(t,{component:"useInvoice",action:"fetchInvoice",metadata:{workspaceId:e,invoiceId:r}})}finally{c(!1)}}else i(null)},[a,e,r]);return t.useEffect(()=>{d()},[d]),{invoice:s,loading:o,error:l,refetch:d}},exports.useInvoices=In,exports.usePermissions=xl,exports.usePlanGroup=jn,exports.usePlanGroupVersions=Pn,exports.usePublicPlanGroupVersion=e=>{const{t:r}=sn(),{api:n}=Cn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),u=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getPlanGroupVersion(e);s(t)}catch(t){const n=Nn(t,"errors.fetchPlanGroupVersion",r);l(n),Re(t,{component:"usePublicPlanGroupVersion",action:"fetchVersion",metadata:{groupVersionId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{u()},[u]),{planGroupVersion:a,loading:i,error:c,refetch:u}},exports.usePublicPlans=An,exports.usePushNotifications=Hb,exports.useQuotaUsageContext=Fk,exports.useQuotaUsageStatus=(e,r)=>{const{t:n}=sn(),{api:a}=Cn(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,u]=t.useState(null),d=t.useCallback(async()=>{if(e&&r){c(!0),u(null);try{const t=await a.getQuotaUsageStatus(e,r);i(t)}catch(t){const a=Nn(t,"errors.fetchQuotaUsage",n);u(a),Re(t,{component:"useQuotaUsageStatus",action:"fetchStatus",metadata:{workspaceId:e,quotaSlug:r}})}finally{c(!1)}}else i(null)},[a,e,r]);return t.useEffect(()=>{d()},[d]),{status:s,loading:o,error:l,refetch:d}},exports.useRecordUsage=e=>{const{t:r}=sn(),{api:n}=Cn(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{recordUsage:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const r=await n.recordUsage(e,t);return Rt(),r}catch(n){const a=Nn(n,"errors.recordUsage",r);throw o(a),Re(n,{component:"useRecordUsage",action:"recordUsage",metadata:{workspaceId:e,request:t}}),n}finally{s(!1)}},[n,e]),loading:a,error:i}},exports.useResumeSubscription=On,exports.useSaaSAuth=yl,exports.useSaaSOs=Sn,exports.useSaaSSettings=En,exports.useSaaSWorkspaces=Mk,exports.useSeatStatus=Ek,exports.useSubscription=_n,exports.useSubscriptionContext=Bn,exports.useSubscriptionManagement=Dn,exports.useTranslation=sn,exports.useTrialStatus=function(){const{response:e}=Bn();return t.useMemo(()=>{const t=e?.subscription;if(!t||"trialing"!==t.subscriptionStatus)return{isTrialing:!1,daysRemaining:0,trialEndsAt:null,trialStartedAt:null,isTrialEnding:!1};const r=yE(t.trialEnd)??yE(t.stripeCurrentPeriodEnd),n=yE(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])},exports.useUpdateSubscription=Rn,exports.useUsageLogs=(e,r,n)=>{const{t:a}=sn(),{api:s}=Cn(),[i,o]=t.useState([]),[c,l]=t.useState(0),[u,d]=t.useState(0),[p,m]=t.useState(1),[h,f]=t.useState(!1),[g,b]=t.useState(!1),[v,y]=t.useState(!1),[x,w]=t.useState(null),S=n?.from,k=n?.to,E=n?.source,C=n?.page,N=n?.limit,A=t.useCallback(async()=>{if(!e)return o([]),l(0),d(0),m(1),f(!1),void b(!1);y(!0),w(null);try{const t={...r&&{quotaSlug:r},...S&&{from:S},...k&&{to:k},...E&&{source:E},...C&&{page:C},...N&&{limit:N}},n=await s.getUsageLogs(e,t);o(n.docs||[]),l(n.totalDocs||0),d(n.totalPages||0),m(n.page||1),f(n.hasNextPage||!1),b(n.hasPrevPage||!1)}catch(t){const n=Nn(t,"errors.fetchUsageLogs",a);w(n),Re(t,{component:"useUsageLogs",action:"fetchLogs",metadata:{workspaceId:e,quotaSlug:r}})}finally{y(!1)}},[s,e,r,S,k,E,C,N]);return t.useEffect(()=>{A()},[A]),{logs:i,totalDocs:c,totalPages:u,page:p,hasNextPage:h,hasPrevPage:g,loading:v,error:x,refetch:A}},exports.useUserAttributes=function(){const e=t.useContext($k);if(void 0===e)throw new Error("useUserAttributes must be used within a UserProvider");return e},exports.useUserFeatures=aE;
|
|
36
|
+
*/function CE(){return wE||(wE=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=t,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useState,s=r.useEffect,i=r.useLayoutEffect,o=r.useDebugValue,c=!1,l=!1,d="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(t,d){c||void 0===r.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();n(u,p)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),l=!0)}var m=(p=a({inst:{value:u,getSnapshot:d}}))[0].inst,h=p[1];return i(function(){m.value=u,m.getSnapshot=d,e(m)&&h({inst:m})},[t,u,d]),s(function(){return e(m)&&h({inst:m}),t(function(){e(m)&&h({inst:m})})},[t]),o(u),u};kE.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:d,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),kE}function EE(){return SE||(SE=1,"production"===process.env.NODE_ENV?vE.exports=xE():vE.exports=CE()),vE.exports}var NE=EE();function jE(){return()=>{}}var AE="Avatar",[_E]=function(t,r=[]){let n=[];const s=()=>{const e=n.map(e=>a.createContext(e));return function(r){const n=r?.[t]||e;return a.useMemo(()=>({[`__scope${t}`]:{...r,[t]:n}}),[r,n])}};return s.scopeName=t,[function(r,s){const i=a.createContext(s);i.displayName=r+"Context";const o=n.length;n=[...n,s];const c=r=>{const{scope:n,children:s,...c}=r,l=n?.[t]?.[o]||i,d=a.useMemo(()=>c,Object.values(c));return e.jsx(l.Provider,{value:d,children:s})};return c.displayName=r+"Provider",[c,function(e,n){const c=n?.[t]?.[o]||i,l=a.useContext(c);if(l)return l;if(void 0!==s)return s;throw new Error(`\`${e}\` must be used within \`${r}\``)}]},fE(s,...r)]}(AE),[PE,TE]=_E(AE),RE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,...s}=t,[i,o]=a.useState("idle");return e.jsx(PE,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:e.jsx(bE.span,{...s,ref:r})})});RE.displayName=AE;var DE="AvatarImage",IE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,src:s,onLoadingStatusChange:i=()=>{},...o}=t,c=TE(DE,n),l=function(e,{referrerPolicy:t,crossOrigin:r}){const n=NE.useSyncExternalStore(jE,()=>!0,()=>!1),s=a.useRef(null),i=n?(s.current||(s.current=new window.Image),s.current):null,[o,c]=a.useState(()=>LE(i,e));return Ys(()=>{c(LE(i,e))},[i,e]),Ys(()=>{const e=e=>()=>{c(e)};if(!i)return;const n=e("loaded"),a=e("error");return i.addEventListener("load",n),i.addEventListener("error",a),t&&(i.referrerPolicy=t),"string"==typeof r&&(i.crossOrigin=r),()=>{i.removeEventListener("load",n),i.removeEventListener("error",a)}},[i,r,t]),o}(s,o),d=oi(e=>{i(e),c.onImageLoadingStatusChange(e)});return Ys(()=>{"idle"!==l&&d(l)},[l,d]),"loaded"===l?e.jsx(bE.img,{...o,ref:r,src:s}):null});IE.displayName=DE;var ME="AvatarFallback",UE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,delayMs:s,...i}=t,o=TE(ME,n),[c,l]=a.useState(void 0===s);return a.useEffect(()=>{if(void 0!==s){const e=window.setTimeout(()=>l(!0),s);return()=>window.clearTimeout(e)}},[s]),c&&"loaded"!==o.imageLoadingStatus?e.jsx(bE.span,{...i,ref:r}):null});function LE(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}UE.displayName=ME;var OE=RE,zE=IE,FE=UE;const BE=a.forwardRef(({className:t,...r},n)=>e.jsx(OE,{ref:n,className:Se("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...r}));BE.displayName=OE.displayName;const WE=a.forwardRef(({className:t,...r},n)=>e.jsx(zE,{ref:n,className:Se("aspect-square h-full w-full",t),...r}));WE.displayName=zE.displayName;const VE=a.forwardRef(({className:t,...r},n)=>e.jsx(FE,{ref:n,className:Se("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...r}));VE.displayName=FE.displayName;var GE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=Os(`Primitive.${r}`),s=a.forwardRef((t,a)=>{const{asChild:s,...i}=t,o=s?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(o,{...i,ref:a})});return s.displayName=`Primitive.${r}`,{...t,[r]:s}},{}),HE="horizontal",$E=["horizontal","vertical"],KE=a.forwardRef((t,r)=>{const{decorative:n,orientation:a=HE,...s}=t,i=function(e){return $E.includes(e)}(a)?a:HE,o=n?{role:"none"}:{"aria-orientation":"vertical"===i?i:void 0,role:"separator"};return e.jsx(GE.div,{"data-orientation":i,...o,...s,ref:r})});KE.displayName="Separator";var qE=KE;const ZE=a.forwardRef(({className:t,orientation:r="horizontal",decorative:n=!0,...a},s)=>e.jsx(qE,{ref:s,decorative:n,orientation:r,className:Se("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",t),...a}));function JE(t){const{t:r}=sn(),{workspace:n,setCurrentWorkspace:a,setOpen:s,workspacesToUse:i,switchingToId:o}=t,c=t.isCurrentWorkspace??!1,l=o===n._id,d=n.subscription??null,u=null!=d&&"object"==typeof d?d.plan??null:null,p=u?.name??"";return e.jsxs("div",{className:Se("flex items-center gap-3 rounded-lg border-2 p-3 border-border",{"bg-muted text-muted-foreground":c}),children:[e.jsxs(BE,{className:"h-8 w-8 flex items-center justify-center",children:[e.jsx("div",{children:e.jsx(WE,{src:n.image&&n.image.trim()?n.image:void 0})}),e.jsx(VE,{children:(m=n.name,m.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2))})]}),e.jsxs("div",{className:"flex-1 min-w-0 max-w-full",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"font-medium line-clamp-1 text-ellipsis overflow-hidden max-w-full",children:n.name})}),e.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e.jsx(Ts,{className:"h-3 w-3"}),e.jsx("span",{children:r("workspace.membersCount",{count:n.users?.length||0})})]}),p&&e.jsx("div",{className:"max-w-fit",children:e.jsx("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:e.jsx("span",{className:"text-xs",children:p})})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[c?null:e.jsx(Ks,{size:"sm",disabled:null!==o||l,progress:l,onClick:()=>{t.switchToWorkspace(n).then(()=>s(!1)).catch(e=>{Re(e,{component:"WorkspaceItem",action:"switchToWorkspace",metadata:{workspaceId:n._id}})})},children:r("workspace.switchTo")}),e.jsx(vC,{workspace:n,onClose:()=>{if(c){const e=i.findIndex(e=>e._id?.toString()===n._id?.toString());-1!==e&&a(i[e])}}})]})]});var m}function YE(r){const{t:n,dir:a}=sn(),{switching:s}=wC(),[i,o]=t.useState(!1),[c,l]=t.useState("emoji"),[d,u]=t.useState("🏢"),[p,m]=t.useState(!1),{createWorkspace:h}=wC(),f=qu({resolver:rf(tg({name:Af().min(2,{message:n("workspace.workspaceNameMinLength")}),image:Af().optional()})),defaultValues:{name:"",image:""}});return e.jsxs(Ac,{open:i,onOpenChange:o,children:[e.jsx(_c,{asChild:!0,children:e.jsxs(Ks,{className:"w-full rounded-none",disabled:s,children:[e.jsx(gs,{className:"h-4 w-4 me-2"}),n("workspace.createNew")]})}),e.jsxs(Rc,{dir:a,className:"max-w-xl min-w-full sm:min-w-[600px]",children:[e.jsxs(Dc,{children:[e.jsx(Ic,{children:n("workspace.createTitle")}),e.jsx(Mc,{children:n("workspace.createDescription")})]}),e.jsx(Ag,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){let t="";if("emoji"===c)t=wv(d);else if("url"===c&&e.image)try{new URL(e.image),t=e.image}catch{return void f.setError("image",{message:n("workspace.invalidUrl")})}m(!0);try{await h(e.name,t),o(!1),f.reset(),u("🏢"),l("emoji"),r?.onCreated?.()}catch(t){Re(t,{component:"WorkspaceProvider",action:"createWorkspace",metadata:{name:e.name}})}finally{m(!1)}}),children:[e.jsx(Pg,{control:f.control,name:"name",render:({field:t})=>e.jsxs(Dg,{children:[e.jsx(Ig,{children:n("workspace.workspaceName")}),e.jsx(Mg,{children:e.jsx(Og,{placeholder:n("workspace.workspaceNamePlaceholder"),...t})}),e.jsx(Lg,{})]})}),e.jsxs("div",{className:"flex flex-col gap-y-2 my-2",children:[e.jsxs("div",{children:[e.jsx(jg,{className:"text-sm font-medium",children:n("workspace.workspaceIcon")}),e.jsx(Ug,{children:n("workspace.iconDescription")})]}),e.jsxs(Ib,{value:c,onValueChange:e=>l(e),className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(Mb,{value:"emoji",id:"emoji"}),e.jsxs(jg,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(Es,{className:"h-4 w-4"}),n("workspace.chooseEmoji")]})]}),e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(Mb,{value:"url",id:"url"}),e.jsxs(jg,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(ms,{className:"h-4 w-4"}),n("workspace.customImageUrl")]})]})]}),"emoji"===c&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:d})]}),e.jsx(yv,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Sv.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{u(e),f.setValue("image",wv(e))})(t),className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(d===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===c&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsx(Pg,{control:f.control,name:"image",render:({field:t})=>e.jsxs(Dg,{children:[e.jsx(Ig,{children:n("workspace.imageUrl")}),e.jsx(Mg,{children:e.jsx(Og,{placeholder:n("workspace.imageUrlPlaceholder"),...t})}),e.jsx(Ug,{children:n("workspace.imageUrlDescription")}),e.jsx(Lg,{})]})}),f.watch("image")&&f.watch("image")?.trim()&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e.jsx("img",{src:f.watch("image")||void 0,alt:"Workspace preview",className:"w-full h-full object-cover",onError:e=>{e.currentTarget.style.display="none"}})})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[e.jsx(Ks,{type:"button",variant:"outline",onClick:()=>{o(!1),f.reset(),u("🏢"),l("emoji")},disabled:p,children:n("settings.common.cancel")}),e.jsx(Ks,{type:"submit",disabled:p,children:p?e.jsxs(e.Fragment,{children:[e.jsx(hs,{className:"me-2 h-4 w-4 animate-spin"}),n("workspace.creating")]}):n("workspace.createWorkspace")})]})]})})]})]})}ZE.displayName=qE.displayName;var XE=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}}"}},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 QE=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}}"}},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 eN=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}}"}},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 tN=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 {再試行}}"}},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 rN=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 {重试}}"}},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 nN=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 {पुनः प्रयास}}"}},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 aN=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 {إعادة المحاولة}}"}},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 sN={[aa.Monthly]:"subscription.billingInterval.perMonth",[aa.Quarterly]:"subscription.billingInterval.perQuarter",[aa.Yearly]:"subscription.billingInterval.perYear"},iN=(e,t,r)=>{if(!e||0===e)return null;let n;switch(r){case aa.Yearly:n=t/12;break;case aa.Quarterly:n=t/3;break;default:return null}const a=(e-n)/e*100;return a>0?Math.round(a):null};var oN=Object.freeze({__proto__:null,default:({open:r,onOpenChange:n,planVersions:a,currentPlanVersionId:s,currentStripePriceId:i,billingCurrency:o,currentMemberCount:c,trialUsedAt:l,workspaceName:d,initialInterval:u,initialCurrency:p,onSelectPlan:m,loading:h=!1})=>{const[f,g]=t.useState(!1),{t:b,formattingLocale:v,dir:y,fmtNum:x,fmtCents:w}=sn(),{settings:S}=Cn(),k=S?.workspace?.mode===RS,C=(e,t)=>null==e||0===e?"":w(e,t),E=e=>b(sN[e]??sN[aa.Monthly]),[N,j]=t.useState(null),A=t.useRef(!1),_=t.useMemo(()=>Ra(i,a),[i,a]),P=_?.interval??null,T=_?.currency??null,R=t.useMemo(()=>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()}(a),[a]),D=t.useMemo(()=>{const e=o?.trim().toLowerCase();return e?R.includes(e)?[e]:[]:R},[o,R]),[I,M]=t.useState(u||P||aa.Monthly),[U,L]=t.useState(()=>p&&D.includes(p)?p:T&&D.includes(T)?T:D.length>0?D[0]:""),O=o?.trim()||U;t.useEffect(()=>{if(r){M(u||P||aa.Monthly);const e=p||T;e&&D.includes(e)?L(e):D.length>0&&!D.includes(U)&&L(D[0])}},[r,u,p,P,T,D]);const z=t.useMemo(()=>[...a],[a]),F=(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())})(z),B=F.filter(e=>e.type===fa),W=F.filter(e=>e.type===ga),V=F.filter(e=>e.type===ba),G=async e=>{if(!(e===s&&P===I||h||f||A.current)){A.current=!0,g(!0),j(e);try{await m(e,I,O),n(!1)}catch(e){}finally{A.current=!1,g(!1),j(null)}}},H=e=>_a(e,O,I),$=e=>!!e.pricingVariants?.some(e=>e.currency?.toLowerCase()===O.toLowerCase()),K=h||f,q=e=>{switch(e){case aa.Monthly:return b("subscription.billingInterval.monthly");case aa.Quarterly:return b("subscription.billingInterval.quarterly");case aa.Yearly:return b("subscription.billingInterval.yearly");default:return b("subscription.billingInterval.monthly")}},Z=e=>{const t=e._id===s,r=P===I;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:b("subscription.switchToInterval",{interval:q(I)}),variant:"default",disabled:!1};const n=e.trial?.enabled&&e.trial.durationDays>0&&!l&&!i;if(!s)return n?{labelKey:"_dynamic",dynamicLabel:b("subscription.startTrialDays",{days:e.trial.durationDays}),variant:"default",disabled:!1}:{labelKey:"subscription.subscribe",variant:"default",disabled:!1};const a=z.findIndex(e=>e._id===s),o=z.findIndex(t=>t._id===e._id);return-1===a||-1===o?n?{labelKey:"_dynamic",dynamicLabel:b("subscription.startTrialDays",{days:e.trial.durationDays}),variant:"default",disabled:!1}:{labelKey:"subscription.checkout.select",variant:"default",disabled:!1}:o<a?{labelKey:"subscription.checkout.downgrade",variant:"outline",disabled:!1}:o>a?n?{labelKey:"_dynamic",dynamicLabel:b("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}},J=(e,t,r=aa.Monthly)=>{if(t.type===fa)return e.features?.[t.slug]??!1;if(t.type===ga)return e.limits?.[t.slug]??null;if(t.type===ba){const n=Ta(e,O,t.slug,r);return n||PS(e.quotas?.[t.slug],r)}return null},Y=(e,t,r)=>{if(t.type===fa)return!0===e?"✓":"—";if(t.type===ga)return null!=e&&"number"==typeof e?x(e):"—";if(t.type===ba){const n=TS("object"==typeof e&&null!==e&&"included"in e?e:null,t.name.toLowerCase(),{currency:r,locale:v});return n?n.allowOverage?n.hasOverage?b("quota.includedWithOverage",{count:n.included,price:n.price,unit:n.unit}):b("quota.includedOnly",{count:n.included}):b("quota.includedHardLimit",{count:n.included}):"—"}return"—"};return e.jsx(Ac,{open:r,onOpenChange:n,children:e.jsxs(Rc,{dir:y,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.jsxs("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.jsxs("div",{children:[e.jsx(Ic,{className:"text-xl sm:text-2xl font-bold",children:b("pricing.title")}),e.jsxs(Mc,{className:"mt-1 text-sm",children:[b("subscription.choosePlanDescription"),d&&e.jsx("span",{className:"ml-1 font-medium text-foreground",children:b("subscription.forWorkspace",{name:d})})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 sm:gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[!o?.trim()&&D.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-sm text-slate-600",children:b("pricing.currency")}),e.jsx("select",{"aria-label":b("pricing.selectCurrency"),value:U,onChange:e=>L(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:D.map(t=>{const r=wg(t);return e.jsx("option",{value:t,children:r?`${r} ${t.toUpperCase()}`:t.toUpperCase()},t)})})]}),o?.trim()&&e.jsx("span",{className:"text-xs text-slate-500",children:b("subscription.billingInCurrency",{currency:o.toUpperCase()})})]}),e.jsx("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":b("pricing.billingInterval"),children:[aa.Monthly,aa.Quarterly,aa.Yearly].map(t=>{const r=P===t;return e.jsx("button",{onClick:()=>M(t),"aria-pressed":I===t,className:"flex-1 sm:flex-initial px-3 sm:px-4 py-2 text-sm font-medium rounded-md transition-all relative "+(I===t?"bg-white text-slate-900 shadow-sm":"text-slate-600 hover:text-slate-900"),children:e.jsxs("span",{className:"flex items-center justify-center gap-1 sm:gap-1.5",children:[t===aa.Monthly&&b("subscription.billingInterval.monthly"),t===aa.Quarterly&&b("subscription.billingInterval.quarterly"),t===aa.Yearly&&b("subscription.billingInterval.yearly"),t===aa.Yearly&&e.jsx("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:b("pricing.save")}),r&&s&&e.jsx("span",{className:"hidden sm:inline text-xs px-1.5 py-0.5 bg-blue-100 text-blue-700 rounded-full font-semibold",children:b("pricing.current")})]})},t)})})]})]}),e.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:o?.trim()&&0===D.length?e.jsxs("div",{className:"text-center py-12 px-4",children:[e.jsx("p",{className:"text-slate-600 font-medium",children:b("pricing.noPlansCurrency")}),e.jsx("p",{className:"text-slate-500 text-sm mt-2",children:b("pricing.noPlansCurrencyHint")})]}):0===z.length?e.jsx("div",{className:"text-center py-12 text-gray-500",children:e.jsx("p",{children:b("pricing.noPlans")})}):e.jsxs("div",{className:"flex-1 min-h-0 overflow-hidden bg-white",children:[e.jsx("div",{className:"md:hidden overflow-auto h-full",style:{maxHeight:"calc(100vh - 13rem)"},children:e.jsx("div",{className:"p-4 space-y-4",children:z.map(t=>{const r=t._id===s,n=Z(t),a=K&&t._id===N,o=H(t),d=$(t),u=t.pricingVariants?.length&&t.pricingVariants.some(e=>e.currency?.toLowerCase()===O.toLowerCase())?O:t.plan?.currency??O??"",p=_a(t,O,aa.Monthly)??0,m=I!==aa.Monthly&&null!==o?iN(p,o,I):null,h=Da(t,O),f=h?Ia(t,O,I):null;return e.jsxs("div",{className:"rounded-xl border-2 p-4 "+(r?"border-blue-500 bg-blue-50/30":"border-slate-200 bg-white"),children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-lg font-bold text-slate-900",children:t.plan.name}),t.trial?.enabled&&t.trial.durationDays>0&&!r&&!l&&!i&&e.jsx("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:b("subscription.trialBadge",{days:t.trial.durationDays})})]}),t.plan.description&&e.jsx("p",{className:"text-xs text-slate-500 mt-0.5 line-clamp-2",children:t.plan.description})]}),r&&e.jsx("span",{className:"shrink-0 rounded-md bg-blue-600 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",children:b("pricing.current")})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-baseline gap-1 whitespace-nowrap",children:[e.jsx("span",{className:"text-2xl font-bold text-slate-900",children:d&&null!==o||d?C(o,u)||b("pricing.free"):"—"}),null!==o&&o>0&&d&&e.jsx("span",{className:"text-sm text-slate-500",children:E(I)})]}),null!==m&&m>0&&d&&e.jsx("span",{className:"text-xs text-emerald-600 font-medium",children:b("subscription.savingsPercent",{percent:m})}),h?.enabled&&f&&f>0&&!k&&e.jsx("div",{className:"text-xs text-slate-500 mt-1",children:b("subscription.seatPriceDisplay",{price:w(f,u),interval:E(I),included:x(h.includedSeats),includedLabel:b("pricing.included")})})]}),B.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-1.5",children:b("subscription.items.features")}),e.jsx("div",{className:"space-y-1",children:B.map(r=>{const n=J(t,r,I),a=r.type===fa&&!0===n;return e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.type===fa?a?e.jsx("span",{className:"text-emerald-500 text-xs",children:"✓"}):e.jsx("span",{className:"text-slate-300 text-xs",children:"✕"}):null,e.jsx("span",{className:a?"text-slate-700":"text-slate-400",children:r.name})]},r._id)})})]}),W.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-1.5",children:b("subscription.items.limits")}),e.jsx("div",{className:"space-y-1",children:W.map(r=>{const n=J(t,r,I);return e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-slate-600",children:r.name}),e.jsx("span",{className:"font-medium text-slate-700",children:"number"==typeof n?x(n):"—"})]},r._id)})})]}),h?.enabled&&!k&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-semibold text-emerald-600 uppercase tracking-wider mb-1.5",children:b("subscription.seats.title")}),e.jsxs("div",{className:"space-y-1 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:b("subscription.seats.included")}),e.jsx("span",{className:"font-medium",children:x(h.includedSeats||0)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:b("subscription.seats.maxSeats")}),e.jsx("span",{className:"font-medium",children:h.maxSeats>0?x(h.maxSeats):b("subscription.seats.unlimited")})]}),null!=c&&c>0&&(()=>{const t=Math.max(0,c-(h.includedSeats||0));return e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:b("subscription.seats.billable")}),e.jsx("span",{className:"font-medium "+(0===t?"text-emerald-600":"text-amber-600"),children:0===t?b("subscription.seats.allIncluded"):`${x(t)} ${b("subscription.seats.extra")}`})]})})()]})]}),t.creditGrant?.enabled&&"object"==typeof t.creditGrant.creditPackage&&null!==t.creditGrant.creditPackage&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-semibold text-purple-600 uppercase tracking-wider mb-1.5",children:b("subscription.items.credits")}),e.jsxs("div",{className:"space-y-1 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:t.creditGrant.renewOnPeriod?b("subscription.items.creditsPerMonth"):b("subscription.items.creditsOneTime")}),e.jsx("span",{className:"font-semibold text-purple-700",children:x(t.creditGrant.creditPackage.creditAmount)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:b("subscription.items.creditRenewal")}),e.jsx("span",{className:"font-medium text-slate-700",children:t.creditGrant.renewOnPeriod?"reset"===t.creditGrant.mode?b("subscription.items.creditModeReset"):b("subscription.items.creditModeTopup"):b("subscription.items.creditModeLifetime")})]})]})]}),e.jsx(Ks,{className:"w-full mt-2",variant:n.variant,disabled:n.disabled||K||!d,progress:a,onClick:()=>G(t._id),children:a?b("pricing.processing"):d?n.dynamicLabel??b(n.labelKey):b("pricing.unavailable")})]},t._id)})})}),e.jsx("div",{className:"hidden md:block overflow-auto h-full",style:{maxHeight:"calc(100vh - 12rem)"},children:e.jsxs("table",{className:"w-full border-separate border-spacing-0",style:{minWidth:260+220*z.length+"px",borderCollapse:"separate"},children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:260,minWidth:260}}),z.map(t=>e.jsx("col",{style:{width:220,minWidth:220}},t._id))]}),e.jsx("thead",{children:e.jsxs("tr",{className:"align-top",children:[e.jsx("th",{className:"sticky top-0 start-0 z-30 p-0 bg-white text-start"}),z.map(t=>{const r=t._id===s,n=Z(t),a=K&&t._id===N,o=H(t),c=_a(t,O,aa.Monthly)??0,d=I!==aa.Monthly&&null!==o?iN(c,o,I):null,u=$(t),p=t.pricingVariants?.length&&t.pricingVariants.some(e=>e.currency?.toLowerCase()===O.toLowerCase())?O:t.plan?.currency??O??"";return e.jsx("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)] "+(t._id===s?"bg-blue-50/80":"bg-white"),children:e.jsxs("div",{className:"flex h-full flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("h3",{className:"text-base font-bold text-slate-900 truncate",children:t.plan.name}),t.trial?.enabled&&t.trial.durationDays>0&&!r&&!l&&!i&&e.jsx("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:b("subscription.trialBadge",{days:t.trial.durationDays})})]}),r&&e.jsx("span",{className:"shrink-0 rounded-md bg-blue-600 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",children:b("pricing.current")})]}),e.jsxs("div",{className:"flex flex-col items-start min-h-[3rem]",children:[e.jsxs("div",{className:"flex items-baseline gap-1 flex-wrap",children:[e.jsx("span",{className:"text-2xl font-bold text-slate-900",children:u&&null!==o||u?C(o,p)||b("pricing.free"):"—"}),null!==o&&o>0&&u&&e.jsx("span",{className:"text-sm text-slate-500",children:E(I)}),null!==d&&d>0&&u&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 bg-emerald-100 text-emerald-700 rounded-full font-semibold whitespace-nowrap",children:b("subscription.savingsPercent",{percent:d})})]}),(()=>{if(k)return null;const r=Da(t,O);if(!r)return null;const n=Ia(t,O,I);return!n||n<=0?null:e.jsx("div",{className:"text-[11px] text-slate-500 mt-1.5 border-t border-slate-100 pt-1 leading-tight",children:e.jsx("div",{children:b("subscription.seatPriceDisplay",{price:w(n,p),interval:E(I),included:x(r.includedSeats),includedLabel:b("pricing.included")})})})})()]}),t.plan.description&&e.jsx("p",{className:"text-xs text-slate-500 line-clamp-2 leading-relaxed text-start",children:t.plan.description}),e.jsx(Ks,{className:"mt-auto w-full",variant:n.variant,disabled:n.disabled||K||!u,progress:a,onClick:()=>G(t._id),children:a?b("pricing.processing"):u?n.dynamicLabel??b(n.labelKey):b("pricing.unavailable")})]})},t._id)})]})}),e.jsxs("tbody",{children:[B.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("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:b("subscription.items.features")}),e.jsx("td",{colSpan:z.length,className:"border-t border-slate-200 bg-slate-100"})]}),B.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("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:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:t.description})]}),z.map(r=>{const n=J(r,t,I),a=r.pricingVariants?.length?O:r.plan?.currency??O??"",i=Y(n,t,a),o=t.type===fa&&!0===n;return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(r._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium "+(o?"text-emerald-600":"—"===i?"text-slate-400":"text-slate-700"),children:i})},r._id)})]},t._id))]}),W.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("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:b("subscription.items.limits")}),e.jsx("td",{colSpan:z.length,className:"border-t border-slate-200 bg-slate-100"})]}),W.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("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:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:t.description})]}),z.map(r=>{const n=J(r,t,I),a=r.pricingVariants?.length?O:r.plan?.currency??O??"",i=Y(n,t,a);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(r._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium "+("—"===i?"text-slate-400":"text-slate-700"),children:i})},r._id)})]},t._id))]}),V.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("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:b("subscription.items.quotas")}),e.jsx("td",{colSpan:z.length,className:"border-t border-slate-200 bg-slate-100"})]}),V.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("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:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:t.description})]}),z.map(r=>{const n=J(r,t,I),a=r.pricingVariants?.length?O:r.plan?.currency??O??"",i=Y(n,t,a);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(r._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium "+("—"===i?"text-slate-400":"text-slate-700"),children:i})},r._id)})]},t._id))]}),!k&&z.some(e=>{const t=Da(e,O);return t?.enabled})&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("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:b("subscription.seats.title")}),e.jsx("td",{colSpan:z.length,className:"border-t border-emerald-200 bg-emerald-50"})]}),e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("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:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:b("subscription.seats.includedSeats")}),e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:b("subscription.seats.freeWithBase")})]}),z.map(t=>{const r=Da(t,O);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium text-slate-700",children:r?.enabled?x(r.includedSeats||0):"—"})},t._id)})]}),e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsx("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:e.jsx("div",{className:"font-medium text-sm text-slate-900",children:b("subscription.seats.maxSeats")})}),z.map(t=>{const r=Da(t,O);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium text-slate-700",children:r?.enabled?r.maxSeats>0?x(r.maxSeats):b("subscription.seats.unlimited"):"—"})},t._id)})]}),e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsx("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:e.jsx("div",{className:"font-medium text-sm text-slate-900",children:b("subscription.seats.perExtraSeat")})}),z.map(t=>{const r=Ia(t,O,I),n=t.pricingVariants?.length?O:t.plan?.currency??O??"";return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium text-slate-700",children:r&&r>0?`${w(r,n)}${E(I)}`:"—"})},t._id)})]}),null!=c&&c>0&&e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("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:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:b("subscription.seats.billable")}),e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:b("subscription.membersInWorkspace",{count:c})})]}),z.map(t=>{const r=Da(t,O);if(!r?.enabled)return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm text-slate-400",children:"—"})},t._id);const n=r.includedSeats||0,a=Math.max(0,c-n);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:0===a?e.jsx("span",{className:"text-sm font-medium text-emerald-600",children:b("subscription.seats.allIncluded")}):e.jsxs("span",{className:"text-sm font-medium text-amber-600",children:[x(a)," ",b("subscription.seats.extra")]})},t._id)})]})]}),z.some(e=>e.creditGrant?.enabled&&"object"==typeof e.creditGrant.creditPackage&&null!==e.creditGrant.creditPackage)&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("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:b("subscription.items.credits")}),e.jsx("td",{colSpan:z.length,className:"border-t border-purple-200 bg-purple-50"})]}),e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsx("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:e.jsx("div",{className:"font-medium text-sm text-slate-900",children:z.every(e=>!e.creditGrant?.enabled||!e.creditGrant.renewOnPeriod)?b("subscription.items.creditsOneTime"):b("subscription.items.creditsPerMonth")})}),z.map(t=>{const r=t.creditGrant,n=r?.enabled&&"object"==typeof r.creditPackage&&null!==r.creditPackage?r.creditPackage:null;return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:n?e.jsx("span",{className:"text-sm font-semibold text-purple-700",children:x(n.creditAmount)}):e.jsx("span",{className:"text-sm text-slate-400",children:"—"})},t._id)})]}),e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsx("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:e.jsx("div",{className:"font-medium text-sm text-slate-900",children:b("subscription.items.creditRenewal")})}),z.map(t=>{const r=t.creditGrant;return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:r?.enabled?e.jsx("span",{className:"text-sm font-medium text-slate-700",children:r.renewOnPeriod?"reset"===r.mode?b("subscription.items.creditModeReset"):b("subscription.items.creditModeTopup"):b("subscription.items.creditModeLifetime")}):e.jsx("span",{className:"text-sm text-slate-400",children:"—"})},t._id)})]})]})]})]})})]})})]})})}});exports.BetaForm=({onSuccess:r,onError:n,className:a="w-full",fieldClassName:s="flex flex-col gap-1.5 w-full",autoFocus:i=!0,showSuccessMessage:o=!0,hideLogo:c=!1,hideTitles:l=!1})=>{const{t:d}=sn(),[u,p]=t.useState(!1),[m,h]=t.useState(!1),{submitBetaForm:f,isLoading:g,isSubmitting:b,error:v,config:y,success:x,message:w}=(()=>{const{t:e}=sn(),r=Sn(),[n,a]=t.useState(null),[s,i]=t.useState(!0),[o,c]=t.useState(!1),[l,d]=t.useState(null),[u,p]=t.useState(!1),[m,h]=t.useState(null);return t.useEffect(()=>{let t=!1;return(async()=>{i(!0),d(null);try{const e=new uE(r),n=await e.fetchConfig();t||a(n)}catch(r){t||d(r instanceof Error?r.message:e("beta.errorMessage"))}finally{t||i(!1)}})(),()=>{t=!0}},[r]),{isLoading:s,isSubmitting:o,config:n,error:l,success:u,message:m,submitBetaForm:t.useCallback(async t=>{if(!r){const t=e("errors.generic");return d(t),{success:!1,message:t}}try{c(!0),d(null),p(!1),h(null);const e=new uE(r),n=await e.submitBetaUser({name:t.name||"",email:t.email}),a="success"===n.status;return p(a),h(n.message),{success:a,message:n.message}}catch(t){const r=t instanceof Error?t.message:e("beta.errorMessage");return d(r),p(!1),h(r),{success:!1,message:r}}finally{c(!1)}},[r])}})();t.useEffect(()=>{x&&o&&(p(!0),h(!0)),v&&h(!0)},[x,o,v]);const S=qu({resolver:rf(pE),defaultValues:{email:"",name:""},mode:"onChange",reValidateMode:"onChange"});t.useEffect(()=>{i&&S.setFocus("name")},[i,S]);const k=S.formState.isValid&&!b;return e.jsx("div",{className:"saas-os-ui",style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:g?e.jsxs("div",{className:Se("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",a),children:[e.jsx(sd,{className:"h-24 w-24 rounded-lg"}),e.jsx(sd,{className:"h-6 w-32"}),e.jsxs("div",{className:"w-full space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(sd,{className:"h-4 w-16"}),e.jsx(sd,{className:"h-10 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(sd,{className:"h-4 w-16"}),e.jsx(sd,{className:"h-10 w-full"})]}),e.jsx(sd,{className:"h-10 w-full"})]})]}):e.jsxs("div",{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:[!c&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[y?.logo&&e.jsx(hE,{logo:y?.logo}),y?.name&&e.jsx("div",{children:y?.name})]}),e.jsx(pu,{...S,children:e.jsxs("form",{onSubmit:S.handleSubmit(async e=>{try{const t=await f(e);t.success?(r?.(),S.reset(),o&&p(!0),h(!0)):(n?.(t.message),h(!0))}catch(e){n?.(e instanceof Error?e.message:d("beta.errorMessage")),h(!0)}}),className:a,noValidate:!0,"aria-busy":b,children:[!m&&e.jsxs(e.Fragment,{children:[!l&&y?.screen?.register&&e.jsx(mE,{screen:y?.screen?.register}),e.jsx(Pg,{control:S.control,name:"name",render:({field:t})=>e.jsxs(Dg,{className:s,children:[e.jsx(Ig,{children:d("beta.nameLabel")}),e.jsx(Mg,{children:e.jsx(Og,{...t})}),e.jsx(Ug,{}),e.jsx(Lg,{})]})}),e.jsx(Pg,{control:S.control,name:"email",render:({field:t})=>e.jsxs(Dg,{className:s,children:[e.jsx(Ig,{children:d("beta.emailLabel")}),e.jsx(Mg,{children:e.jsx(Og,{...t})}),e.jsx(Ug,{}),e.jsx(Lg,{})]})}),e.jsx(Ks,{type:"submit",disabled:!k,className:s,children:d(b?"beta.submittingText":"beta.submitText")})]}),m&&v&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[e.jsxs("div",{className:"border-red-300 text-red-700",role:"alert","aria-live":"assertive","aria-atomic":!0,children:[e.jsx("span",{className:"text-4xl mb-2",role:"img","aria-label":d("settings.common.error"),children:"❗"}),v]}),e.jsx("div",{className:"mt-4 flex justify-center",children:e.jsx(Ks,{type:"button",onClick:()=>{h(!1),S.reset()},className:s,children:d("beta.tryAgain")})})]}),m&&u&&w&&e.jsx("div",{className:"flex flex-col items-center justify-center w-full text-green-700 border-green-300 text-center",children:y?.screen?.thankYou&&e.jsx(mE,{screen:y?.screen?.thankYou})})]})}),!m&&e.jsx("div",{children:e.jsxs("div",{children:[d("beta.privacyConsent")," ",e.jsx("a",{href:y?.privacyPolicy,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:d("beta.privacyPolicy")})," ",d("beta.and")," ",e.jsx("a",{href:y?.termsOfService,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:d("beta.termsOfService")}),"."]})})]})})},exports.CreditActionsProvider=aE,exports.CreditBalance=sE,exports.CreditBalanceContextProvider=ra,exports.CreditStorePage=function({children:r,loadingFallback:n,errorFallback:a,redirectBaseUrl:s}){const{packages:i,notes:o,loading:c,error:l,refetch:d}=ea(),{isAuthenticated:u,signIn:p}=nd(),m=t.useCallback(e=>{if(u)xC.openWorkspaceSettings(fC.Credits,{action:Vl,packageId:e});else if(s){const t=Jl({action:Vl,screen:"credits",packageId:e},s);p(t)}else p()},[u,p,s]);return c?void 0!==n?e.jsx(e.Fragment,{children:n}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(sd,{className:"h-8 w-48"}),e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[1,2,3].map(t=>e.jsx(sd,{className:"h-48 rounded-lg"},t))})]}):l?a?e.jsx(e.Fragment,{children:a(l)}):e.jsx("div",{className:"rounded-lg border border-destructive/50 bg-destructive/10 p-4 text-sm text-destructive",children:l}):e.jsx(e.Fragment,{children:r({loading:c,error:l,packages:i,notes:o,refetch:d,selectPackage:m})})},exports.PricingPage=function({slug:r,children:n,loadingFallback:a,errorFallback:s,redirectBaseUrl:i}){const{items:o,plans:c,notes:l,loading:d,error:u,refetch:p}=jn(r),{isAuthenticated:m,signIn:h}=nd(),f=t.useCallback((e,t,r)=>i?Jl({action:"selectPlan",plan:e,interval:t,currency:r},i):null,[i]),g=t.useCallback((e,t,r)=>{if(m)return void xC.openWorkspaceSettings(fC.Subscription,{action:"selectPlan",plan:e,interval:t,currency:r});const n=f(e,t,r);h(n??void 0)},[m,h,f]);return d?void 0!==a?e.jsx(e.Fragment,{children:a}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(sd,{className:"h-8 w-48"}),e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[1,2,3].map(t=>e.jsx(sd,{className:"h-64 rounded-lg"},t))})]}):u?s?e.jsx(e.Fragment,{children:s(u)}):e.jsx("div",{className:"rounded-lg border border-destructive/50 bg-destructive/10 p-4 text-sm text-destructive",children:u}):e.jsx(e.Fragment,{children:n({loading:d,error:u,items:o,plans:c,notes:l,refetch:p,selectPlan:g})})},exports.PushNotificationProvider=jv,exports.QuotaUsageContextProvider=CC,exports.SETTINGS_SCREENS=gC,exports.SUPPORTED_LOCALES=Zr,exports.SaaSOSProvider=LC,exports.SettingsScreen=fC,exports.SubscriptionContextProvider=Fn,exports.WhenAuthenticated=OC,exports.WhenCreditsAvailable=iE,exports.WhenCreditsExhausted=oE,exports.WhenCreditsLow=cE,exports.WhenNoSubscription=ZC,exports.WhenNotTrialing=XC,exports.WhenPermission=WC,exports.WhenQuotaAvailable=eE,exports.WhenQuotaExhausted=tE,exports.WhenQuotaOverage=rE,exports.WhenQuotaThreshold=nE,exports.WhenRoles=FC,exports.WhenSubscription=qC,exports.WhenSubscriptionToPlans=JC,exports.WhenTrialEnding=QC,exports.WhenTrialing=YC,exports.WhenUnauthenticated=zC,exports.WhenUserFeatureDisabled=KC,exports.WhenUserFeatureEnabled=$C,exports.WhenWorkspaceFeatureDisabled=HC,exports.WhenWorkspaceFeatureEnabled=GC,exports.WhenWorkspaceRoles=BC,exports.WorkspaceSwitcher=function(r){const{t:n,dir:a}=sn(),{isAuthenticated:s,user:i}=nd(),o=rt(Sn()),{workspaces:c,currentWorkspace:l,loading:d,refreshing:u,switchingToId:p,fetchWorkspaces:m,getFeatures:h,refreshWorkspaces:f,setCurrentWorkspace:g,switchToWorkspace:b}=wC(),{settings:v}=Cn(),[y,x]=t.useState(!1),[w,S]=t.useState(0),[k,C]=t.useState(""),E=d||u;t.useEffect(()=>{s&&o&&(0===c.length?(m(),h()):h())},[s,o]),t.useEffect(()=>{s&&o&&w>0&&f()},[w,s,o]);const N=c,j=N.filter(e=>e._id!==l?._id).filter(e=>e.name.toLowerCase().includes(k.toLowerCase())),A=v?.workspace?.canCreateWorkspace??!0,_=v?.workspace?.showSwitcher??!0,P=v?.workspace?.maxWorkspacesPerUser??0,T=N?.filter(e=>("object"==typeof e.createdBy?e.createdBy._id?.toString():e.createdBy?.toString())===i?.id?.toString()).length??0,R=!1!==A&&(0===P||T<P);return t.useEffect(()=>{!_&&c.length>0&&!l&&b(c[0]).catch(()=>{})},[_,c,l]),!_&&l?e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>x(!0),children:r.trigger?.(E,l)}),e.jsx(vC,{workspace:l,open:y,onOpenChange:x,showTrigger:!1})]}):e.jsxs(Ac,{open:y,onOpenChange:x,children:[e.jsx(_c,{children:r.trigger?.(E,l)}),e.jsxs(Rc,{dir:a,className:"max-w-2xl min-w-full sm:min-w-[800px]",children:[e.jsxs(Dc,{dir:a,children:[e.jsxs(Ic,{className:"flex items-center gap-2",children:[e.jsx(rs,{className:"h-5 w-5"}),n("workspace.switchTitle")]}),e.jsx(Mc,{children:n("workspace.switchDescription")})]}),!i&&e.jsx("div",{className:"flex flex-col items-center justify-center h-full py-4 sm:py-8",children:e.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:n("workspace.notLoggedIn")})}),i&&e.jsxs("div",{dir:a,className:"flex flex-col gap-4",children:[l&&e.jsx(JE,{workspace:l,isCurrentWorkspace:!0,switchToWorkspace:b,switchingToId:p,onClose:()=>x(!1),setCurrentWorkspace:g,setOpen:x,workspacesToUse:N}),e.jsx(ZE,{}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:n("workspace.availableWorkspaces",{count:j.length})}),e.jsx("div",{children:e.jsx(Ks,{progress:u,disabled:u,variant:"ghost",onClick:function(){s&&o&&S(e=>e+1)},startIcon:e.jsx(bs,{}),children:n("settings.common.refreshAction",{loading:String(u)})})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(ys,{className:"absolute start-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),e.jsx(Og,{placeholder:n("workspace.searchPlaceholder"),value:k,onChange:e=>C(e.target.value),className:"ps-10"})]}),d?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(hs,{className:"h-6 w-6 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ms-2 text-sm text-muted-foreground",children:n("workspace.loadingWorkspaces")})]}):0===j.length?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(rs,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:n(k?"workspace.noWorkspacesFound":"workspace.noWorkspacesAvailable")})]}):e.jsx(yv,{className:"h-64",dir:a,children:e.jsx("div",{dir:a,className:"flex flex-col gap-2 my-2.5",children:j.map(t=>{const r=t._id===l?._id;return e.jsx(JE,{workspace:t,isCurrentWorkspace:r,switchToWorkspace:b,switchingToId:p,onClose:()=>x(!1),setCurrentWorkspace:g,setOpen:x,workspacesToUse:N},t._id)})})})]}),R&&e.jsxs(e.Fragment,{children:[e.jsx(ZE,{}),e.jsx(YE,{onCreated:()=>{m()}})]})]})]})]})},exports.useAllQuotaUsage=On,exports.useBillingPortal=Mn,exports.useCancelSubscription=Un,exports.useConsumeCredits=Zn,exports.useCreateCheckoutSession=Tn,exports.useCreditBalance=qn,exports.useCreditBalanceContext=na,exports.useCreditPackages=Yn,exports.useCreditTransactions=Xn,exports.useExpiringCredits=Qn,exports.useInvoice=(e,r)=>{const{t:n}=sn(),{api:a}=En(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,d]=t.useState(null),u=t.useCallback(async()=>{if(e&&r){c(!0),d(null);try{const t=await a.getInvoice(e,r);i(t.invoice)}catch(t){const a=Nn(t,"errors.fetchInvoice",n);d(a),Re(t,{component:"useInvoice",action:"fetchInvoice",metadata:{workspaceId:e,invoiceId:r}})}finally{c(!1)}}else i(null)},[a,e,r]);return t.useEffect(()=>{u()},[u]),{invoice:s,loading:o,error:l,refetch:u}},exports.useInvoices=In,exports.usePermissions=ad,exports.usePlanGroup=_n,exports.usePlanGroupVersions=Pn,exports.usePublicCreditPackages=ea,exports.usePublicPlanGroupVersion=e=>{const{t:r}=sn(),{api:n}=En(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),d=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getPlanGroupVersion(e);s(t)}catch(t){const n=Nn(t,"errors.fetchPlanGroupVersion",r);l(n),Re(t,{component:"usePublicPlanGroupVersion",action:"fetchVersion",metadata:{groupVersionId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{d()},[d]),{planGroupVersion:a,loading:i,error:c,refetch:d}},exports.usePublicPlans=jn,exports.usePurchaseCredits=Jn,exports.usePushNotifications=Av,exports.useQuotaUsageContext=EC,exports.useQuotaUsageStatus=(e,r)=>{const{t:n}=sn(),{api:a}=En(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,d]=t.useState(null),u=t.useCallback(async()=>{if(e&&r){c(!0),d(null);try{const t=await a.getQuotaUsageStatus(e,r);i(t)}catch(t){const a=Nn(t,"errors.fetchQuotaUsage",n);d(a),Re(t,{component:"useQuotaUsageStatus",action:"fetchStatus",metadata:{workspaceId:e,quotaSlug:r}})}finally{c(!1)}}else i(null)},[a,e,r]);return t.useEffect(()=>{u()},[u]),{status:s,loading:o,error:l,refetch:u}},exports.useRecordUsage=e=>{const{t:r}=sn(),{api:n}=En(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{recordUsage:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const r=await n.recordUsage(e,t);return Rt(),r}catch(n){const a=Nn(n,"errors.recordUsage",r);throw o(a),Re(n,{component:"useRecordUsage",action:"recordUsage",metadata:{workspaceId:e,request:t}}),n}finally{s(!1)}},[n,e]),loading:a,error:i}},exports.useResumeSubscription=Ln,exports.useSaaSAuth=nd,exports.useSaaSOs=Sn,exports.useSaaSSettings=Cn,exports.useSaaSWorkspaces=wC,exports.useSeatStatus=lC,exports.useSubscription=An,exports.useSubscriptionContext=Bn,exports.useSubscriptionManagement=Dn,exports.useTranslation=sn,exports.useTrialStatus=function(){const{response:e}=Bn();return t.useMemo(()=>{const t=e?.subscription;if(!t||"trialing"!==t.subscriptionStatus)return{isTrialing:!1,daysRemaining:0,trialEndsAt:null,trialStartedAt:null,isTrialEnding:!1};const r=lE(t.trialEnd)??lE(t.stripeCurrentPeriodEnd),n=lE(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])},exports.useUpdateSubscription=Rn,exports.useUsageLogs=(e,r,n)=>{const{t:a}=sn(),{api:s}=En(),[i,o]=t.useState([]),[c,l]=t.useState(0),[d,u]=t.useState(0),[p,m]=t.useState(1),[h,f]=t.useState(!1),[g,b]=t.useState(!1),[v,y]=t.useState(!1),[x,w]=t.useState(null),S=n?.from,k=n?.to,C=n?.source,E=n?.page,N=n?.limit,j=t.useCallback(async()=>{if(!e)return o([]),l(0),u(0),m(1),f(!1),void b(!1);y(!0),w(null);try{const t={...r&&{quotaSlug:r},...S&&{from:S},...k&&{to:k},...C&&{source:C},...E&&{page:E},...N&&{limit:N}},n=await s.getUsageLogs(e,t);o(n.docs||[]),l(n.totalDocs||0),u(n.totalPages||0),m(n.page||1),f(n.hasNextPage||!1),b(n.hasPrevPage||!1)}catch(t){const n=Nn(t,"errors.fetchUsageLogs",a);w(n),Re(t,{component:"useUsageLogs",action:"fetchLogs",metadata:{workspaceId:e,quotaSlug:r}})}finally{y(!1)}},[s,e,r,S,k,C,E,N]);return t.useEffect(()=>{j()},[j]),{logs:i,totalDocs:c,totalPages:d,page:p,hasNextPage:h,hasPrevPage:g,loading:v,error:x,refetch:j}},exports.useUserAttributes=function(){const e=t.useContext(TC);if(void 0===e)throw new Error("useUserAttributes must be used within a UserProvider");return e},exports.useUserFeatures=VC;
|