@buildbase/sdk 0.0.42 → 0.0.43
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/react/index.js +2 -2
- package/dist/react/index.mjs +2 -2
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -24,7 +24,7 @@ var ja={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
|
|
|
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 os(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function cs(...e){return t=>{let r=!1;const n=e.map(e=>{const n=os(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():os(e[t],null)}}}}function ls(...e){return a.useCallback(cs(...e),e)}var us=Symbol.for("react.lazy"),ds=a[" use ".trim().toString()];function ps(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===us&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}function ms(t){const r=fs(t),n=a.forwardRef((t,n)=>{let{children:s,...i}=t;ps(s)&&"function"==typeof ds&&(s=ds(s._payload));const o=a.Children.toArray(s),c=o.find(bs);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 hs=ms("Slot");function fs(e){const t=a.forwardRef((e,t)=>{let{children:r,...n}=e;if(ps(r)&&"function"==typeof ds&&(r=ds(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?cs(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 gs=Symbol("radix.slottable");function bs(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===gs}const vs=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,ys=o,xs=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return ys(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 ys(e,i,c,null==r?void 0:r.class,null==r?void 0:r.className)},ws=xs("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"}}),Ss=a.forwardRef(({className:t,variant:r,progress:n,size:s,startIcon:i,endIcon:o,asChild:c=!1,...l},u)=>{const d=c?hs:"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(ws({variant:r,size:s,withIcon:null!=n||null!=i||null!=o,className:t})),ref:u,...l,children:[n&&e.jsx(Ha,{size:p,className:"animate-spin"}),i&&a.cloneElement(i,{size:p}),l.children,o&&a.cloneElement(o,{size:p})]})});function ks(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function Es(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}\``)}]},Cs(s,...r)]}function Cs(...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}Ss.displayName="Button";var Ns=globalThis?.document?a.useLayoutEffect:()=>{},As=a[" useId ".trim().toString()]||(()=>{}),_s=0;function js(e){const[t,r]=a.useState(As());return Ns(()=>{r(e=>e??String(_s++))},[e]),e||(t?`radix-${t}`:"")}var Ps=a[" useInsertionEffect ".trim().toString()]||Ns;function Ts({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 Ps(()=>{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 Rs(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?cs(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 Ds=Symbol("radix.slottable");function Is(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Ds}var Us=["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=Rs(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(Is);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 Ms(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...e)=>t.current?.(...e),[])}var Ls,Os="dismissableLayer.update",zs="dismissableLayer.pointerDownOutside",Fs="dismissableLayer.focusOutside",Bs=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ws=a.forwardRef((t,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:c,onDismiss:l,...u}=t,d=a.useContext(Bs),[p,m]=a.useState(null),h=p?.ownerDocument??globalThis?.document,[,f]=a.useState({}),g=ls(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=Ms(e),n=a.useRef(!1),s=a.useRef(()=>{});return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){Hs(zs,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=Ms(e),n=a.useRef(!1);return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){Hs(Fs,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=Ms(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&&(Ls=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),Vs(),()=>{n&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Ls)}},[p,h,n,d]),a.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),Vs())},[p,d]),a.useEffect(()=>{const e=()=>f({});return document.addEventListener(Os,e),()=>document.removeEventListener(Os,e)},[]),e.jsx(Us.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...t.style},onFocusCapture:ks(t.onFocusCapture,E.onFocusCapture),onBlurCapture:ks(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:ks(t.onPointerDownCapture,k.onPointerDownCapture)})});Ws.displayName="DismissableLayer";function Vs(){const e=new CustomEvent(Os);document.dispatchEvent(e)}function Hs(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(Bs),s=a.useRef(null),i=ls(r,s);return a.useEffect(()=>{const e=s.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),e.jsx(Us.div,{...t,ref:i})}).displayName="DismissableLayerBranch";var Gs="focusScope.autoFocusOnMount",$s="focusScope.autoFocusOnUnmount",Ks={bubbles:!1,cancelable:!0},qs=a.forwardRef((t,r)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...c}=t,[l,u]=a.useState(null),d=Ms(i),p=Ms(o),m=a.useRef(null),h=ls(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:Xs(m.current,{select:!0})},t=function(e){if(f.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||Xs(m.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Xs(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){Qs.add(f);const t=document.activeElement;if(!l.contains(t)){const r=new CustomEvent(Gs,Ks);l.addEventListener(Gs,d),l.dispatchEvent(r),r.defaultPrevented||(!function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Xs(n,{select:t}),document.activeElement!==r)return}((e=Zs(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Xs(l))}return()=>{l.removeEventListener(Gs,d),setTimeout(()=>{const e=new CustomEvent($s,Ks);l.addEventListener($s,p),l.dispatchEvent(e),e.defaultPrevented||Xs(t??document.body,{select:!0}),l.removeEventListener($s,p),Qs.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=Zs(e),r=Js(t,e),n=Js(t.reverse(),e);return[r,n]}(t);a&&s?e.shiftKey||r!==s?e.shiftKey&&r===a&&(e.preventDefault(),n&&Xs(s,{select:!0})):(e.preventDefault(),n&&Xs(a,{select:!0})):r===t&&e.preventDefault()}},[n,s,f.paused]);return e.jsx(Us.div,{tabIndex:-1,...c,ref:h,onKeyDown:g})});function Zs(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 Js(e,t){for(const r of e)if(!Ys(r,{upTo:t}))return r}function Ys(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Xs(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()}}qs.displayName="FocusScope";var Qs=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 ti=a.forwardRef((t,n)=>{const{container:s,...i}=t,[o,c]=a.useState(!1);Ns(()=>c(!0),[]);const l=s||o&&globalThis?.document?.body;return l?r.createPortal(e.jsx(Us.div,{...i,ref:n}),l):null});ti.displayName="Portal";var ri=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=ni(n.current);i.current="mounted"===c?e:"none"},[c]),Ns(()=>{const t=n.current,r=s.current;if(r!==e){const n=i.current,a=ni(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]),Ns(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,a=a=>{const i=ni(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=ni(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=ls(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 ni(e){return e?.animationName||"none"}ri.displayName="Presence";var ai=0;function si(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ii()),document.body.insertAdjacentElement("beforeend",e[1]??ii()),ai++,()=>{1===ai&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),ai--}},[])}function ii(){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 oi=function(){return oi=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},oi.apply(this,arguments)};function ci(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 li="right-scroll-bar-position",ui="width-before-scroll-bar";function di(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var pi="undefined"!=typeof window?a.useLayoutEffect:a.useEffect,mi=new WeakMap;function hi(e,r){var n,a,s,i=(n=null,a=function(t){return e.forEach(function(e){return di(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 pi(function(){var t=mi.get(i);if(t){var r=new Set(t),n=new Set(e),a=i.current;r.forEach(function(e){n.has(e)||di(e,null)}),n.forEach(function(e){r.has(e)||di(e,a)})}mi.set(i,e)},[e]),i}function fi(e){return e}var gi=function(e){var t=e.sideCar,r=ci(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,oi({},r))};gi.isSideCarExport=!0;var bi=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=oi({async:!0,ssr:!1},e),t}(),vi=function(){},yi=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,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=ci(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,k=hi([r,t]),E=oi(oi({},w),s);return a.createElement(a.Fragment,null,d&&a.createElement(S,{sideCar:bi,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),oi(oi({},E),{ref:k})):a.createElement(y,oi({},E,{className:l,ref:k}),c))});yi.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},yi.classNames={fullWidth:ui,zeroRight:li};function xi(){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 wi=function(){var e=0,t=null;return{add:function(r){var n,a;0==e&&(t=xi())&&(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)}}},Si=function(){var e,t=(e=wi(),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}},ki={left:0,top:0,right:0,gap:0},Ei=function(e){return parseInt(e||"",10)||0},Ci=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return ki;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[Ei(r),Ei(n),Ei(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])}},Ni=Si(),Ai="data-scroll-locked",_i=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(Ai,"] {\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(li," {\n right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(ui," {\n margin-right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(li," .").concat(li," {\n right: 0 ").concat(n,";\n }\n \n .").concat(ui," .").concat(ui," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(Ai,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(o,"px;\n }\n")},ji=function(){var e=parseInt(document.body.getAttribute(Ai)||"0",10);return isFinite(e)?e:0},Pi=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(Ai,(ji()+1).toString()),function(){var e=ji()-1;e<=0?document.body.removeAttribute(Ai):document.body.setAttribute(Ai,e.toString())}},[]);var i=a.useMemo(function(){return Ci(s)},[s]);return a.createElement(Ni,{styles:_i(i,!t,s,r?"":"!important")})},Ti=!1;if("undefined"!=typeof window)try{var Ri=Object.defineProperty({},"passive",{get:function(){return Ti=!0,!0}});window.addEventListener("test",Ri,Ri),window.removeEventListener("test",Ri,Ri)}catch(e){Ti=!1}var Di=!!Ti&&{passive:!1},Ii=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])},Ui=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),Mi(e,n)){var a=Li(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Mi=function(e,t){return"v"===e?function(e){return Ii(e,"overflowY")}(t):function(e){return Ii(e,"overflowX")}(t)},Li=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)},Oi=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},zi=function(e){return[e.deltaX,e.deltaY]},Fi=function(e){return e&&"current"in e?e.current:e},Bi=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Wi=0,Vi=[];function Hi(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Gi,$i=(Gi=function(e){var t=a.useRef([]),r=a.useRef([0,0]),n=a.useRef(),s=a.useState(Wi++)[0],i=a.useState(Si)[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(Fi),!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=Oi(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=Ui(d,u);if(!h)return!0;if(h?a=d:(a="v"===d?"h":"v",h=Ui(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=Li(e,i),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Mi(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(Vi.length&&Vi[Vi.length-1]===i){var n="deltaY"in r?zi(r):Oi(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(Fi).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:Hi(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=Oi(e),n.current=void 0},[]),p=a.useCallback(function(t){u(t.type,zi(t),t.target,c(t,e.lockRef.current))},[]),m=a.useCallback(function(t){u(t.type,Oi(t),t.target,c(t,e.lockRef.current))},[]);a.useEffect(function(){return Vi.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Di),document.addEventListener("touchmove",l,Di),document.addEventListener("touchstart",d,Di),function(){Vi=Vi.filter(function(e){return e!==i}),document.removeEventListener("wheel",l,Di),document.removeEventListener("touchmove",l,Di),document.removeEventListener("touchstart",d,Di)}},[]);var h=e.removeScrollBar,f=e.inert;return a.createElement(a.Fragment,null,f?a.createElement(i,{styles:Bi(s)}):null,h?a.createElement(Pi,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},bi.useMedium(Gi),gi),Ki=a.forwardRef(function(e,t){return a.createElement(yi,oi({},e,{ref:t,sideCar:$i}))});Ki.classNames=yi.classNames;var qi=new WeakMap,Zi=new WeakMap,Ji={},Yi=0,Xi=function(e){return e&&(e.host||Xi(e.parentNode))},Qi=function(e,t,r,n){var a=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=Xi(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]);Ji[r]||(Ji[r]=new WeakMap);var s=Ji[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=(qi.get(e)||0)+1,l=(s.get(e)||0)+1;qi.set(e,c),s.set(e,l),i.push(e),1===c&&a&&Zi.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(),Yi++,function(){i.forEach(function(e){var t=qi.get(e)-1,a=s.get(e)-1;qi.set(e,t),s.set(e,a),t||(Zi.has(e)||e.removeAttribute(n),Zi.delete(e)),a||e.removeAttribute(r)}),--Yi||(qi=new WeakMap,qi=new WeakMap,Zi=new WeakMap,Ji={})}},eo=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"))),Qi(n,a,r,"aria-hidden")):function(){return null}};function to(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?cs(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 ro=Symbol("radix.slottable");function no(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===ro}var ao="Dialog",[so,io]=Es(ao),[oo,co]=so(ao),lo=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]=Ts({prop:s,defaultProp:i??!1,onChange:o,caller:ao});return e.jsx(oo,{scope:r,triggerRef:l,contentRef:u,contentId:js(),titleId:js(),descriptionId:js(),open:d,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:c,children:n})};lo.displayName=ao;var uo="DialogTrigger",po=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=co(uo,n),i=ls(r,s.triggerRef);return e.jsx(Us.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Ro(s.open),...a,ref:i,onClick:ks(t.onClick,s.onOpenToggle)})});po.displayName=uo;var mo="DialogPortal",[ho,fo]=so(mo,{forceMount:void 0}),go=t=>{const{__scopeDialog:r,forceMount:n,children:s,container:i}=t,o=co(mo,r);return e.jsx(ho,{scope:r,forceMount:n,children:a.Children.map(s,t=>e.jsx(ri,{present:n||o.open,children:e.jsx(ti,{asChild:!0,container:i,children:t})}))})};go.displayName=mo;var bo="DialogOverlay",vo=a.forwardRef((t,r)=>{const n=fo(bo,t.__scopeDialog),{forceMount:a=n.forceMount,...s}=t,i=co(bo,t.__scopeDialog);return i.modal?e.jsx(ri,{present:a||i.open,children:e.jsx(xo,{...s,ref:r})}):null});vo.displayName=bo;var yo=function(t){const r=to(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(no);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"),xo=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=co(bo,n);return e.jsx(Ki,{as:yo,allowPinchZoom:!0,shards:[s.contentRef],children:e.jsx(Us.div,{"data-state":Ro(s.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),wo="DialogContent",So=a.forwardRef((t,r)=>{const n=fo(wo,t.__scopeDialog),{forceMount:a=n.forceMount,...s}=t,i=co(wo,t.__scopeDialog);return e.jsx(ri,{present:a||i.open,children:i.modal?e.jsx(ko,{...s,ref:r}):e.jsx(Eo,{...s,ref:r})})});So.displayName=wo;var ko=a.forwardRef((t,r)=>{const n=co(wo,t.__scopeDialog),s=a.useRef(null),i=ls(r,n.contentRef,s);return a.useEffect(()=>{const e=s.current;if(e)return eo(e)},[]),e.jsx(Co,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ks(t.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ks(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:ks(t.onFocusOutside,e=>e.preventDefault())})}),Eo=a.forwardRef((t,r)=>{const n=co(wo,t.__scopeDialog),s=a.useRef(!1),i=a.useRef(!1);return e.jsx(Co,{...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()}})}),Co=a.forwardRef((t,r)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,...c}=t,l=co(wo,n),u=a.useRef(null),d=ls(r,u);return si(),e.jsxs(e.Fragment,{children:[e.jsx(qs,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:o,children:e.jsx(Ws,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Ro(l.open),...c,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(Mo,{titleId:l.titleId}),e.jsx(Lo,{contentRef:u,descriptionId:l.descriptionId})]})]})}),No="DialogTitle",Ao=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=co(No,n);return e.jsx(Us.h2,{id:s.titleId,...a,ref:r})});Ao.displayName=No;var _o="DialogDescription",jo=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=co(_o,n);return e.jsx(Us.p,{id:s.descriptionId,...a,ref:r})});jo.displayName=_o;var Po="DialogClose",To=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=co(Po,n);return e.jsx(Us.button,{type:"button",...a,ref:r,onClick:ks(t.onClick,()=>s.onOpenChange(!1))})});function Ro(e){return e?"open":"closed"}To.displayName=Po;var Do="DialogTitleWarning",[Io,Uo]=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}\``)}]}(Do,{contentName:wo,titleName:No,docsSlug:"dialog"}),Mo=({titleId:e})=>{const t=Uo(Do),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},Lo=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Uo("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},Oo=lo,zo=po,Fo=go,Bo=vo,Wo=So,Vo=Ao,Ho=jo,Go=To;function $o(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 Ko=["color"],qo=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=$o(e,Ko);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"}))}),Zo=["color"],Jo=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=$o(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:"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"}))}),Yo=["color"],Xo=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=$o(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.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"}))}),Qo=["color"],ec=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=$o(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:"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 tc=t.createContext({container:null,setContainer:()=>{}}),rc=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(tc.Provider,{value:s,children:[i,e.jsx("div",{ref:a,id:"saas-os-portal",className:"saas-os-ui",style:{width:"100%",height:"100%"}})]})});rc.displayName="PortalProvider";const nc=Oo,ac=zo,sc=Fo,ic=a.forwardRef(({className:t,...r},n)=>e.jsx(Bo,{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}));ic.displayName=Bo.displayName;const oc=a.forwardRef(({className:t,children:r,...n},s)=>{const{container:i}=a.useContext(tc);return e.jsxs(sc,{container:i,children:[e.jsx(ic,{}),e.jsxs(Wo,{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(Go,{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(Xo,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});oc.displayName=Wo.displayName;const cc=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col space-y-1.5 text-center sm:text-start",t),...r});cc.displayName="DialogHeader";const lc=a.forwardRef(({className:t,...r},n)=>e.jsx(Vo,{ref:n,className:Se("text-lg font-semibold leading-none tracking-tight",t),...r}));lc.displayName=Vo.displayName;const uc=a.forwardRef(({className:t,...r},n)=>e.jsx(Ho,{ref:n,className:Se("text-sm text-muted-foreground",t),...r}));uc.displayName=Ho.displayName;var dc=Symbol("radix.slottable");var pc="AlertDialog",[mc]=Es(pc,[io]),hc=io(),fc=t=>{const{__scopeAlertDialog:r,...n}=t,a=hc(r);return e.jsx(Oo,{...a,...n,modal:!0})};fc.displayName=pc;var gc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=hc(n);return e.jsx(zo,{...s,...a,ref:r})});gc.displayName="AlertDialogTrigger";var bc=t=>{const{__scopeAlertDialog:r,...n}=t,a=hc(r);return e.jsx(Fo,{...a,...n})};bc.displayName="AlertDialogPortal";var vc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=hc(n);return e.jsx(Bo,{...s,...a,ref:r})});vc.displayName="AlertDialogOverlay";var yc="AlertDialogContent",[xc,wc]=mc(yc),Sc=function(t){const r=({children:t})=>e.jsx(e.Fragment,{children:t});return r.displayName=`${t}.Slottable`,r.__radixId=dc,r}("AlertDialogContent"),kc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,children:s,...i}=t,o=hc(n),c=a.useRef(null),l=ls(r,c),u=a.useRef(null);return e.jsx(Io,{contentName:yc,titleName:Ec,docsSlug:"alert-dialog",children:e.jsx(xc,{scope:n,cancelRef:u,children:e.jsxs(Wo,{role:"alertdialog",...o,...i,ref:l,onOpenAutoFocus:ks(i.onOpenAutoFocus,e=>{e.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[e.jsx(Sc,{children:s}),e.jsx(Tc,{contentRef:c})]})})})});kc.displayName=yc;var Ec="AlertDialogTitle",Cc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=hc(n);return e.jsx(Vo,{...s,...a,ref:r})});Cc.displayName=Ec;var Nc="AlertDialogDescription",Ac=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=hc(n);return e.jsx(Ho,{...s,...a,ref:r})});Ac.displayName=Nc;var _c=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=hc(n);return e.jsx(Go,{...s,...a,ref:r})});_c.displayName="AlertDialogAction";var jc="AlertDialogCancel",Pc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,{cancelRef:s}=wc(jc,n),i=hc(n),o=ls(r,s);return e.jsx(Go,{...i,...a,ref:o})});Pc.displayName=jc;var Tc=({contentRef:e})=>{const t=`\`${yc}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${yc}\` by passing a \`${Nc}\` 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 \`${yc}\`. 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},Rc=vc,Dc=kc,Ic=_c,Uc=Pc,Mc=Cc,Lc=Ac;const Oc=fc,zc=gc,Fc=bc,Bc=a.forwardRef(({className:t,...r},n)=>e.jsx(Rc,{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}));Bc.displayName=Rc.displayName;const Wc=a.forwardRef(({className:t,...r},n)=>{const{container:s}=a.useContext(tc);return e.jsxs(Fc,{container:s,children:[e.jsx(Bc,{}),e.jsx(Dc,{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})]})});Wc.displayName=Dc.displayName;const Vc=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-start",t),...r});Vc.displayName="AlertDialogHeader";const Hc=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r});Hc.displayName="AlertDialogFooter";const Gc=a.forwardRef(({className:t,...r},n)=>e.jsx(Mc,{ref:n,className:Se("text-lg font-semibold",t),...r}));Gc.displayName=Mc.displayName;const $c=a.forwardRef(({className:t,...r},n)=>e.jsx(Lc,{ref:n,className:Se("text-sm text-muted-foreground",t),...r}));$c.displayName=Lc.displayName;const Kc=a.forwardRef(({className:t,...r},n)=>e.jsx(Ic,{ref:n,className:Se(ws(),t),...r}));Kc.displayName=Ic.displayName;const qc=a.forwardRef(({className:t,...r},n)=>e.jsx(Uc,{ref:n,className:Se(ws({variant:"outline"}),"mt-2 sm:mt-0",t),...r}));qc.displayName=Uc.displayName;const Zc="saas-workspace-current",Jc=e=>{e?sn(Zc,e._id):on(Zc)},Yc=()=>an(Zc),Xc=()=>{on(Zc)},Qc=(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 tl(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 rl={WORKSPACE_SETTINGS_VIEW:"workspace:settings:view",WORKSPACE_SETTINGS_EDIT:"workspace:settings:edit",WORKSPACE_DELETE:"workspace:delete",WORKSPACE_MEMBERS_VIEW:"workspace:members:view",WORKSPACE_MEMBERS_INVITE:"workspace:members:invite",WORKSPACE_MEMBERS_REMOVE:"workspace:members:remove",WORKSPACE_MEMBERS_ROLE_CHANGE:"workspace:members:role-change",WORKSPACE_FEATURES_VIEW:"workspace:features:view",WORKSPACE_FEATURES_EDIT:"workspace:features:edit",WORKSPACE_BILLING_VIEW:"workspace:billing:view",WORKSPACE_BILLING_MANAGE:"workspace:billing:manage",WORKSPACE_USAGE_VIEW:"workspace:usage:view"},nl=Object.values(rl),al={admin:nl.filter(e=>e!==rl.WORKSPACE_DELETE),member:[rl.WORKSPACE_SETTINGS_VIEW,rl.WORKSPACE_MEMBERS_VIEW,rl.WORKSPACE_FEATURES_VIEW,rl.WORKSPACE_BILLING_VIEW,rl.WORKSPACE_USAGE_VIEW],viewer:[rl.WORKSPACE_SETTINGS_VIEW,rl.WORKSPACE_MEMBERS_VIEW]};function sl(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 il(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(nl);if(a)for(const t of sl(a))e.add(t);if(r.permissions)for(const t of sl(r.permissions))e.add(t);if(n?.workspace?.permissions)for(const t of sl(n.workspace.permissions))e.add(t);return e}const s=e.workspaceRole??tl(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=al[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=al[n?.workspace?.defaultRole??"member"]??al.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(rl.WORKSPACE_MEMBERS_INVITE)}(h,s,n),h}class ol extends hn{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 cl(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 ll(e,t="/"){const r=cl(e);window.location.href=r||t}const ul="saas-auth-intent";function dl(e){return"object"==typeof e&&null!==e&&"string"==typeof e.returnUrl&&"number"==typeof e.createdAt}function pl(e){cl(e)&&function(e,t){try{sn(e,JSON.stringify(t))}catch(t){Re(t,{component:"storage",action:"setStorageJSON",metadata:{key:e}})}}(ul,{returnUrl:e,createdAt:Date.now()})}function ml(){const e=function(e,t){const r=an(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}}),on(e),null):n}catch(t){return Re(t,{component:"storage",action:"getStorageJSON",metadata:{key:e}}),on(e),null}}(ul,dl);return on(ul),e?Date.now()-e.createdAt>6e5?null:cl(e.returnUrl):null}function hl(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 fl(e,t){return{user:e,sessionId:t,expires:new Date(Date.now()+864e5).toISOString()}}function gl(){return bn(e=>e.auth)}function bl(){const{t:e}=nn(),r=gn(),n=gl(),a=xn(),{serverUrl:s,orgId:i,auth:o}=a,{resetCurrentWorkspace:c,currentWorkspace:l}=Ik(),u=t.useMemo(()=>new ol({serverUrl:s,version:a.version}),[s,a.version]),d=t.useCallback(async t=>{pl(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(Le()),new Error(t.message||e("errors.generic"));ll(t.data.redirectUrl)}catch(e){throw r.auth(Le()),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{on(cn),r.auth(ze()),c()}},[r,c,o?.callbacks?.onSignOut]),m=t.useCallback(e=>{l?Dk.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 vl(e){const{user:r}=bl(),{currentWorkspace:n}=Ik(),{settings:a}=Sn(),{appPermissions:s}=Wn(),i=e??n??null,o=r?.id??null,c=t.useMemo(()=>i?tl(i,o):null,[i,o]),l=t.useMemo(()=>!!i&&el(i,o),[i,o]),u=t.useMemo(()=>il({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 yl({className:t,...r}){return e.jsx("div",{className:Se("animate-pulse rounded-md bg-primary/10",t),...r})}function xl(){return e.jsxs("div",{className:"space-y-3.5",children:[e.jsx(yl,{className:"h-10 w-full"}),e.jsx(yl,{className:"h-10 w-full"}),e.jsx(yl,{className:"h-10 w-full"})]})}const wl=({workspace:r})=>{const[n,a]=t.useState(!1),{deleteWorkspace:s}=Ik(),{can:i}=vl(),{settings:o}=Sn(),{t:c}=nn();if(1===(o?.workspace?.maxWorkspacesPerUser??0))return null;if(!r)return e.jsx(xl,{});return i(rl.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(Oc,{children:[e.jsx(zc,{asChild:!0,children:e.jsxs(Ss,{variant:"destructive",disabled:n,progress:n,children:[e.jsx(rs,{className:"h-4 w-4 me-2"}),c("danger.deleteWorkspace")]})}),e.jsxs(Wc,{children:[e.jsxs(Vc,{children:[e.jsx(Gc,{children:c("danger.deleteConfirm")}),e.jsx($c,{children:c("danger.deleteConfirmDescription")})]}),e.jsxs(Hc,{children:[e.jsx(qc,{disabled:n,children:c("settings.common.cancel")}),e.jsx(Kc,{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(Ha,{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 Sl(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 kl(e){const[t,r]=a.useState(void 0);return Ns(()=>{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 El="Switch",[Cl]=Es(El),[Nl,Al]=Cl(El),_l=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=ls(r,e=>f(e)),b=a.useRef(!1),v=!h||(p||!!h.closest("form")),[y,x]=Ts({prop:i,defaultProp:o??!1,onChange:d,caller:El});return e.jsxs(Nl,{scope:n,checked:y,disabled:l,children:[e.jsx(Us.button,{type:"button",role:"switch","aria-checked":y,"aria-required":c,"data-state":Rl(y),"data-disabled":l?"":void 0,disabled:l,value:u,...m,ref:g,onClick:ks(t.onClick,e=>{x(e=>!e),v&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})}),v&&e.jsx(Tl,{control:h,bubbles:!b.current,name:s,value:u,checked:y,required:c,disabled:l,form:p,style:{transform:"translateX(-100%)"}})]})});_l.displayName=El;var jl="SwitchThumb",Pl=a.forwardRef((t,r)=>{const{__scopeSwitch:n,...a}=t,s=Al(jl,n);return e.jsx(Us.span,{"data-state":Rl(s.checked),"data-disabled":s.disabled?"":void 0,...a,ref:r})});Pl.displayName=jl;var Tl=a.forwardRef(({__scopeSwitch:t,control:r,checked:n,bubbles:s=!0,...i},o)=>{const c=a.useRef(null),l=ls(c,o),u=Sl(n),d=kl(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 Rl(e){return e?"checked":"unchecked"}Tl.displayName="SwitchBubbleInput";var Dl=_l,Il=Pl;const Ul=a.forwardRef(({className:t,...r},n)=>e.jsx(Dl,{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(Il,{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")})}));Ul.displayName=Dl.displayName;const Ml=({workspaceId:r})=>{const{t:n}=nn(),{allFeatures:a,updateFeature:s,getWorkspace:i}=Ik(),{can:o}=vl(),[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(xl,{});const f=o(rl.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(Ha,{className:"h-4 w-4 animate-spin text-gray-500"}),e.jsxs("span",{className:"text-sm text-gray-600",children:[u,"..."]})]}):e.jsx(Ul,{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 Ll=e=>"checkbox"===e.type,Ol=e=>e instanceof Date,zl=e=>null==e;const Fl=e=>"object"==typeof e;var Bl=e=>!zl(e)&&!Array.isArray(e)&&Fl(e)&&!Ol(e),Wl=e=>Bl(e)&&e.target?Ll(e.target)?e.target.checked:e.target.value:e,Vl=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),Hl="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function Gl(e){if(e instanceof Date)return new Date(e);const t="undefined"!=typeof FileList&&e instanceof FileList;if(Hl&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!(r||Bl(e)&&(e=>{const t=e.constructor&&e.constructor.prototype;return Bl(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]=Gl(e[t]));return n}var $l=e=>/^\w*$/.test(e),Kl=e=>void 0===e,ql=e=>Array.isArray(e)?e.filter(Boolean):[],Zl=e=>ql(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Jl=(e,t,r)=>{if(!t||!Bl(e))return r;const n=($l(t)?[t]:Zl(t)).reduce((e,t)=>zl(e)?e:e[t],e);return Kl(n)||n===e?Kl(e[t])?r:e[t]:n},Yl=e=>"boolean"==typeof e,Xl=e=>"function"==typeof e,Ql=(e,t,r)=>{let n=-1;const a=$l(t)?[t]:Zl(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=Bl(r)||Array.isArray(r)?r:isNaN(+a[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=s,e=e[t]}};const eu="blur",tu="focusout",ru="change",nu="onBlur",au="onChange",su="onSubmit",iu="onTouched",ou="all",cu="max",lu="min",uu="maxLength",du="minLength",pu="pattern",mu="required",hu="validate",fu=t.createContext(null);fu.displayName="HookFormControlContext";const gu=()=>t.useContext(fu);var bu=(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]!==ou&&(t._proxyFormState[a]=!n||ou),r&&(r[a]=!0),e[a]}});return a};const vu="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;var yu=e=>"string"==typeof e,xu=(e,t,r,n,a)=>yu(e)?(n&&t.watch.add(e),Jl(r,e,a)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),Jl(r,e))):(n&&(t.watchAll=!0),r),wu=e=>zl(e)||!Fl(e);function Su(e,t,r=new WeakSet){if(wu(e)||wu(t))return Object.is(e,t);if(Ol(e)&&Ol(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(Ol(n)&&Ol(e)||Bl(n)&&Bl(e)||Array.isArray(n)&&Array.isArray(e)?!Su(n,e,r):!Object.is(n,e))return!1}}return!0}function ku(e){const r=gu(),{name:n,disabled:a,control:s=r,shouldUnregister:i,defaultValue:o,exact:c=!0}=e,l=Vl(s._names.array,n),u=t.useMemo(()=>Jl(s._formValues,n,Jl(s._defaultValues,n,o)),[s,n,o]),d=function(e){const r=gu(),{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=xu(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=xu(a,n._names,e||n._formValues,!1,l.current);if(u.current){const e=u.current(t);Su(e,d.current)||(f(e),d.current=e)}else f(t)}},[n._formValues,n._names,i,a]);vu(()=>(p.current===n&&Su(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&&!Su(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=gu(),{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 vu(()=>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(()=>bu(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,...Yl(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const g=t.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Jl(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!Jl(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Jl(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Jl(p.validatingFields,n)},error:{enumerable:!0,get:()=>Jl(p.errors,n)}}),[p,n]),b=t.useCallback(e=>f.current.onChange({target:{value:Wl(e),name:n},type:ru}),[n]),v=t.useCallback(()=>f.current.onBlur({target:{value:Jl(s._formValues,n),name:n},type:eu}),[n,s._formValues]),y=t.useCallback(e=>{const t=Jl(s._fields,n);t&&t._f&&e&&(t._f.ref={focus:()=>Xl(e.focus)&&e.focus(),select:()=>Xl(e.select)&&e.select(),setCustomValidity:t=>Xl(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>Xl(e.reportValidity)&&e.reportValidity()})},[s._fields,n]),x=t.useMemo(()=>({name:n,value:d,...Yl(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,...Yl(m.current.disabled)?{disabled:m.current.disabled}:{}});const r=(e,t)=>{const r=Jl(s._fields,e);r&&r._f&&(r._f.mount=t)};if(r(n,!0),e){const e=Gl(Jl(s._options.defaultValues,n,m.current.defaultValue));Ql(s._defaultValues,n,e),Kl(Jl(s._formValues,n))&&Ql(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 Eu=e=>e.render(ku(e)),Cu=t.createContext(null);Cu.displayName="HookFormContext";const Nu=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(Cu.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(fu.Provider,{value:f},r))};var Au=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},_u=e=>Array.isArray(e)?e:[e],ju=()=>{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 Pu(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const a=e[n],s=t[n];if(a&&Bl(a)&&s){const e=Pu(a,s);Bl(e)&&(r[n]=e)}else e[n]&&(r[n]=s)}return r}var Tu=e=>Bl(e)&&!Object.keys(e).length,Ru=e=>"file"===e.type,Du=e=>{if(!Hl)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Iu=e=>"select-multiple"===e.type,Uu=e=>"radio"===e.type,Mu=e=>Du(e)&&e.isConnected;function Lu(e,t){const r=Array.isArray(t)?t:$l(t)?[t]:Zl(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Kl(e)?n++:e[t[n++]];return e}(e,r),a=r.length-1,s=r[a];return n&&delete n[s],0!==a&&(Bl(n)&&Tu(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!Kl(e[t]))return!1;return!0}(n))&&Lu(e,r.slice(0,-1)),e}function Ou(e){return Array.isArray(e)||Bl(e)&&!(e=>{for(const t in e)if(Xl(e[t]))return!0;return!1})(e)}function zu(e,t={}){for(const r in e){const n=e[r];Ou(n)?(t[r]=Array.isArray(n)?[]:{},zu(n,t[r])):Kl(n)||(t[r]=!0)}return t}function Fu(e,t,r){r||(r=zu(t));for(const n in e){const a=e[n];if(Ou(a))Kl(t)||wu(r[n])?r[n]=zu(a,Array.isArray(a)?[]:{}):Fu(a,zl(t)?{}:t[n],r[n]);else{const e=t[n];r[n]=!Su(a,e)}}return r}const Bu={value:!1,isValid:!1},Wu={value:!0,isValid:!0};var Vu=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&&!Kl(e[0].attributes.value)?Kl(e[0].value)||""===e[0].value?Wu:{value:e[0].value,isValid:!0}:Wu:Bu}return Bu},Hu=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Kl(e)?e:t?""===e?NaN:e?+e:e:r&&yu(e)?new Date(e):n?n(e):e;const Gu={isValid:!1,value:null};var $u=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Gu):Gu;function Ku(e){const t=e.ref;return Ru(t)?t.files:Uu(t)?$u(e.refs).value:Iu(t)?[...t.selectedOptions].map(({value:e})=>e):Ll(t)?Vu(e.refs).value:Hu(Kl(t.value)?e.ref.value:t.value,e)}var qu=e=>e instanceof RegExp,Zu=e=>Kl(e)?e:qu(e)?e.source:Bl(e)?qu(e.value)?e.value.source:e.value:e,Ju=e=>({isOnSubmit:!e||e===su,isOnBlur:e===nu,isOnChange:e===au,isOnAll:e===ou,isOnTouch:e===iu});const Yu="AsyncFunction";var Xu=e=>!!e&&!!e.validate&&!!(Xl(e.validate)&&e.validate.constructor.name===Yu||Bl(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===Yu)),Qu=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const ed=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const r=Jl(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(ed(s,t))break}else if(Bl(s)&&ed(s,t))break}}};function td(e,t,r){const n=Jl(e,r);if(n||$l(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const n=a.join("."),s=Jl(t,n),i=Jl(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 rd=(e,t,r)=>{const n=_u(Jl(e,r));return Ql(n,"root",t[r]),Ql(e,r,n),e};function nd(e,t,r="validate"){if(yu(e)||Array.isArray(e)&&e.every(yu)||Yl(e)&&!e)return{type:r,message:yu(e)?e:"",ref:t}}var ad=e=>Bl(e)&&!qu(e)?e:{value:e,message:""},sd=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=Jl(r,f);if(!b||t.has(f))return{};const y=o?o[0]:i,x=e=>{a&&y.reportValidity&&(y.setCustomValidity(Yl(e)?"":e||""),y.reportValidity())},w={},S=Uu(i),k=Ll(i),E=S||k,C=(g||Ru(i))&&Kl(i.value)&&Kl(v)||Du(i)&&""===i.value||""===v||Array.isArray(v)&&!v.length,N=Au.bind(null,f,n,w),A=(e,t,r,n=uu,a=du)=>{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||zl(v))||Yl(v)&&!v||k&&!Vu(o).isValid||S&&!$u(o).isValid)){const{value:e,message:t}=yu(c)?{value:!!c,message:c}:ad(c);if(e&&(w[f]={type:mu,message:t,ref:y,...N(mu,t)},!n))return x(t),w}if(!(C||zl(d)&&zl(p))){let e,t;const r=ad(p),a=ad(d);if(zl(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;yu(r.value)&&v&&(e=o?s(v)>s(r.value):c?v>r.value:n>new Date(r.value)),yu(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);zl(r.value)||(e=n>r.value),zl(a.value)||(t=n<a.value)}if((e||t)&&(A(!!e,r.message,a.message,cu,lu),!n))return x(w[f].message),w}if((l||u)&&!C&&(yu(v)||s&&Array.isArray(v))){const e=ad(l),t=ad(u),r=!zl(e.value)&&v.length>+e.value,a=!zl(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&&yu(v)){const{value:e,message:t}=ad(m);if(qu(e)&&!v.match(e)&&(w[f]={type:pu,message:t,ref:i,...N(pu,t)},!n))return x(t),w}if(h)if(Xl(h)){const e=nd(await h(v,r),y);if(e&&(w[f]={...e,...N(hu,e.message)},!n))return x(e.message),w}else if(Bl(h)){let e={};for(const t in h){if(!Tu(e)&&!n)break;const a=nd(await h[t](v,r),y,t);a&&(e={...a,...N(t,a.message)},x(a.message),n&&(w[f]=e))}if(!Tu(e)&&(w[f]={ref:y,...e},!n))return w}return x(!0),w};const id={mode:su,reValidateMode:au,shouldFocusError:!0};function od(e={}){let t,r={...id,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Xl(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},s=(Bl(r.defaultValues)||Bl(r.values))&&Gl(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:Gl(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:ju(),state:ju()},h=r.criteriaMode===ou,f=async e=>{if(!o.keepIsValid&&!r.disabled&&(d.isValid||p.isValid||e)){let e;r.resolver?(e=Tu((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?Ql(n.validatingFields,e,t):Lu(n.validatingFields,e))}),m.state.next({validatingFields:n.validatingFields,isValidating:!Tu(n.validatingFields)}))},b=(e,t,r,n)=>{const c=Jl(a,e);if(c){const a=Jl(i,e,Kl(r)?Jl(s,e):r);Kl(a)||n&&n.defaultChecked||t?Ql(i,e,t?a:Ku(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=Su(Jl(s,e),t);l=!!Jl(n.dirtyFields,e),r?Lu(n.dirtyFields,e):Ql(n.dirtyFields,e,!0),u.dirtyFields=n.dirtyFields,c=c||(d.dirtyFields||p.dirtyFields)&&l!==!r}if(a){const t=Jl(n.touchedFields,e);t||(Ql(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=Jl(n.errors,e),c=(d.isValid||p.isValid)&&Yl(a)&&n.isValid!==a;var u;if(r.delayError&&s?(u=()=>((e,t)=>{Ql(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?Ql(n.errors,e,s):Lu(n.errors,e)),(s?!Su(o,s):o)||!Tu(i)||c){const t={...i,...c&&Yl(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=Jl(t,r);e&&Ql(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&&Xu(l._f);u&&d.validatingFields&&g([t.name],!0);const p=await sd(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&&(Jl(p,t.name)?o?rd(n.errors,p,t.name):Ql(n.errors,t.name,p[t.name]):Lu(n.errors,t.name))}!Tu(o)&&await w(o,a,s)}}return s.valid},S=(e,t)=>!r.disabled&&(e&&t&&Ql(i,e,t),!Su(P(),s)),k=(e,t,r)=>xu(e,c,{...o.mount?i:Kl(t)?s:yu(e)?{[e]:t}:t},r,t),E=(e,t,r={})=>{const n=Jl(a,e);let s=t;if(n){const r=n._f;r&&(!r.disabled&&Ql(i,e,Hu(t,r)),s=Du(r.ref)&&zl(t)?"":t,Iu(r.ref)?[...r.ref.options].forEach(e=>e.selected=s.includes(e.value)):r.refs?Ll(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):Ru(r.ref)?r.ref.value="":(r.ref.value=s,r.ref.type||m.state.next({name:e,values:Gl(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=Jl(a,i);(c.array.has(e)||Bl(s)||o&&!o._f)&&!Ol(s)?C(i,s,r):E(i,s,r)}},N=(e,t,r={})=>{const l=Jl(a,e),u=c.array.has(e),h=Gl(t);Ql(i,e,h),u?(m.array.next({name:e,values:Gl(i)}),(d.isDirty||d.dirtyFields||p.isDirty||p.dirtyFields)&&r.shouldDirty&&m.state.next({name:e,dirtyFields:Fu(s,i),isDirty:S(e,h)})):!l||l._f||zl(h)?E(e,h,r):C(e,h,r),Qu(e,c)?m.state.next({...n,name:e,values:Gl(i)}):m.state.next({name:o.mount?e:void 0,values:Gl(i)})},A=async e=>{o.mount=!0;const s=e.target;let l=s.name,u=!0;const b=Jl(a,l),S=e=>{u=Number.isNaN(e)||Ol(e)&&isNaN(e.getTime())||Su(e,Jl(i,l,e))},k=Ju(r.mode),E=Ju(r.reValidateMode);if(b){let o,C;const N=s.type?Ku(b._f):Wl(e),A=e.type===eu||e.type===tu,_=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(b._f)&&!r.resolver&&!Jl(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,Jl(n.touchedFields,l),n.isSubmitted,E,k),P=Qu(l,c,A);Ql(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=!Tu(T)||P;if(!A&&m.state.next({name:l,type:e.type,values:Gl(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=td(n.errors,a,l),r=td(e,a,t.name||l);o=r.error,l=r.name,C=Tu(e)}}else g([l],!0),o=(await sd(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(Jl(n.errors,t)&&e.focus)return e.focus(),1},j=async(e,t={})=>{let s,i;const o=_u(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=Jl(t,r);e?Ql(n.errors,r,e):Lu(n.errors,r)}else n.errors=t;return t})(Kl(e)?e:o);s=Tu(t),i=e?!o.some(e=>Jl(t,e)):s}else e?(i=(await Promise.all(o.map(async e=>{const t=Jl(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({...!yu(e)||(d.isValid||p.isValid)&&s!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:s}:{},errors:n.errors}),t.shouldFocus&&!i&&ed(a,_,e?o:c.mount),i},P=(e,t)=>{let r={...o.mount?i:s};return t&&(r=Pu(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),Kl(e)?r:yu(e)?Jl(r,e):e.map(e=>Jl(r,e))},T=(e,t)=>({invalid:!!Jl((t||n).errors,e),isDirty:!!Jl((t||n).dirtyFields,e),error:Jl((t||n).errors,e),isValidating:!!Jl(n.validatingFields,e),isTouched:!!Jl((t||n).touchedFields,e)}),R=(e,t,r)=>{const s=(Jl(a,e,{_f:{}})._f||{}).ref,i=Jl(n.errors,e)||{},{ref:o,message:c,type:l,...u}=i;Ql(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&&!_u(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 Tu(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(e=>t[e]===(!n||ou))})(t,e.formState||d,B,e.reRenderRoot)||e.callback({values:{...i},...n,...t,defaultValues:s})}}).unsubscribe,I=(e,t={})=>{for(const o of e?_u(e):c.mount)c.mount.delete(o),c.array.delete(o),t.keepValue||(Lu(a,o),Lu(i,o)),!t.keepError&&Lu(n.errors,o),!t.keepDirty&&Lu(n.dirtyFields,o),!t.keepTouched&&Lu(n.touchedFields,o),!t.keepIsValidating&&Lu(n.validatingFields,o),!r.shouldUnregister&&!t.keepDefaultValue&&Lu(s,o);m.state.next({values:Gl(i)}),m.state.next({...n,...t.keepDirty?{isDirty:S()}:{}}),!t.keepIsValid&&f()},U=({disabled:e,name:t})=>{if(Yl(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=Jl(a,e);const i=Yl(t.disabled)||Yl(r.disabled);return Ql(a,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),c.mount.add(e),n?U({disabled:Yl(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:Zu(t.min),max:Zu(t.max),minLength:Zu(t.minLength),maxLength:Zu(t.maxLength),pattern:Zu(t.pattern)}:{},name:e,onChange:A,onBlur:A,ref:i=>{if(i){M(e,t),n=Jl(a,e);const r=Kl(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,o=(e=>Uu(e)||Ll(e))(r),c=n._f.refs||[];if(o?c.find(e=>e===r):r===n._f.ref)return;Ql(a,e,{_f:{...n._f,...o?{refs:[...c.filter(Mu),r,...Array.isArray(Jl(s,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),b(e,!1,void 0,r)}else n=Jl(a,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!Vl(c.array,e)||!o.action)&&c.unMount.add(e)}}},L=()=>r.shouldFocusError&&ed(a,_,c.mount),O=(e,t)=>async s=>{let o;s&&(s.preventDefault&&s.preventDefault(),s.persist&&s.persist());let l=Gl(i);if(m.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await x();g(),n.errors=e,l=Gl(t)}else await w(a);if(c.disabled.size)for(const e of c.disabled)Lu(l,e);if(Lu(n.errors,"root"),Tu(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:Tu(n.errors)&&!o,submitCount:n.submitCount+1,errors:n.errors}),o)throw o},z=(e,t={})=>{const l=e?Gl(e):s,u=Gl(l),p=Tu(e),h=p?s:u;if(t.keepDefaultValues||(s=l),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...c.mount,...Object.keys(Fu(s,i))]);for(const t of Array.from(e)){const e=Jl(n.dirtyFields,t),r=Jl(i,t),a=Jl(h,t);e&&!Kl(r)?Ql(h,t,r):e||Kl(a)||N(t,a)}}else{if(Hl&&Kl(e))for(const e of c.mount){const t=Jl(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Du(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of c.mount)N(e,Jl(h,e));else a={}}i=r.shouldUnregister?t.keepDefaultValues?Gl(s):{}:Gl(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&&!Tu(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||Su(e,s))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:p?{}:t.keepDirtyValues?t.keepDefaultValues&&i?Fu(s,i):n.dirtyFields:t.keepDefaultValues&&e?Fu(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(Xl(e)?e(i):e,{...r.resetOptions,...t}),B=e=>{n={...n,...e}},W={control:{register:M,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,u=!0,h=!0)=>{if(l&&c&&!r.disabled){if(o.action=!0,h&&Array.isArray(Jl(a,e))){const t=c(Jl(a,e),l.argA,l.argB);u&&Ql(a,e,t)}if(h&&Array.isArray(Jl(n.errors,e))){const t=c(Jl(n.errors,e),l.argA,l.argB);u&&Ql(n.errors,e,t),((e,t)=>{!ql(Jl(e,t)).length&&Lu(e,t)})(n.errors,e)}if((d.touchedFields||p.touchedFields)&&h&&Array.isArray(Jl(n.touchedFields,e))){const t=c(Jl(n.touchedFields,e),l.argA,l.argB);u&&Ql(n.touchedFields,e,t)}(d.dirtyFields||p.dirtyFields)&&(n.dirtyFields=Fu(s,i)),m.state.next({name:e,isDirty:S(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Ql(i,e,t)},_setDisabledField:U,_setErrors:e=>{n.errors=e,m.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>ql(Jl(o.mount?i:s,e,r.shouldUnregister?Jl(s,e,[]):[])),_reset:z,_resetDefaultValues:()=>Xl(r.defaultValues)&&r.defaultValues().then(e=>{F(e,r.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of c.unMount){const t=Jl(a,e);t&&(t._f.refs?t._f.refs.every(e=>!Mu(e)):!Mu(t._f.ref))&&I(e)}c.unMount=new Set},_disableForm:e=>{Yl(e)&&(m.state.next({disabled:e}),ed(a,(t,r)=>{const n=Jl(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:O,watch:(e,t)=>Xl(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={})=>{Jl(a,e)&&(Kl(t.defaultValue)?N(e,Gl(Jl(s,e))):(N(e,t.defaultValue),Ql(s,e,Gl(t.defaultValue))),t.keepTouched||Lu(n.touchedFields,e),t.keepDirty||(Lu(n.dirtyFields,e),n.isDirty=t.defaultValue?S(e,Gl(Jl(s,e))):S()),t.keepError||(Lu(n.errors,e),d.isValid&&f()),m.state.next({...n}))},clearErrors:e=>{e&&_u(e).forEach(e=>Lu(n.errors,e)),m.state.next({errors:e?n.errors:{}})},unregister:I,setError:R,setFocus:(e,t={})=>{const r=Jl(a,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&Xl(e.select)&&e.select()})}},getFieldState:T};return{...W,formControl:W}}function cd(e={}){const r=t.useRef(void 0),n=t.useRef(void 0),[a,s]=t.useState({isDirty:!1,isValidating:!1,isLoading:Xl(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:Xl(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:a},e.defaultValues&&!Xl(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:t,...n}=od(e);r.current={...n,formState:a}}const i=r.current.control;return i._options=e,vu(()=>{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&&!Su(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(()=>bu(a,i),[i,a]),r.current}const ld=(e,t,r)=>{if(e&&"reportValidity"in e){const n=Jl(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},ud=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?ld(n.ref,r,e):n&&n.refs&&n.refs.forEach(t=>ld(t,r,e))}},dd=(e,t)=>{t.shouldUseNativeValidation&&ud(e,t);const r={};for(const n in e){const a=Jl(t.fields,n),s=Object.assign(e[n]||{},{ref:a&&a.ref});if(pd(t.names||Object.keys(e),n)){const e=Object.assign({},Jl(r,n));Ql(e,"root",s),Ql(r,n,e)}else Ql(r,n,s)}return r},pd=(e,t)=>{const r=md(t);return e.some(e=>md(e).match(`^${r}\\.\\d+`))};function md(e){return e.replace(/\]|\[/g,"")}function hd(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 fd extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class gd extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const bd={};function vd(e){return bd}function yd(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 xd(e,t){return"bigint"==typeof t?t.toString():t}function wd(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Sd(e){return null==e}function kd(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const Ed=Symbol("evaluating");function Cd(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Ed)return void 0===n&&(n=Ed,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Nd(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ad(...e){const t={};for(const r of e){const e=Object.getOwnPropertyDescriptors(r);Object.assign(t,e)}return Object.defineProperties({},t)}function _d(e){return JSON.stringify(e)}const jd="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Pd(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Td=wd(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Rd(e){if(!1===Pd(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!==Pd(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function Dd(e){return Rd(e)?{...e}:Array.isArray(e)?[...e]:e}const Id=new Set(["string","number","symbol"]);function Ud(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Md(e,t,r){const n=new e._zod.constr(t??e._zod.def);return t&&!r?.parent||(n._zod.parent=e),n}function Ld(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 Od(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 zd(e,t){return t.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function Fd(e){return"string"==typeof e?e:e?.message}function Bd(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const a=Fd(e.inst?._zod.def?.error?.(e))??Fd(t?.error?.(e))??Fd(r.customError?.(e))??Fd(r.localeError?.(e))??"Invalid input";n.message=a}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function Wd(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Vd(...e){const[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}const Hd=(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,xd,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Gd=hd("$ZodError",Hd),$d=hd("$ZodError",Hd,{Parent:Error});const Kd=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 fd;if(i.issues.length){const t=new(a?.Err??e)(i.issues.map(e=>Bd(e,s,vd())));throw jd(t,a?.callee),t}return i.value},qd=Kd($d),Zd=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=>Bd(e,s,vd())));throw jd(t,a?.callee),t}return i.value},Jd=Zd($d),Yd=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 fd;return s.issues.length?{success:!1,error:new(e??Gd)(s.issues.map(e=>Bd(e,a,vd())))}:{success:!0,data:s.value}},Xd=Yd($d),Qd=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=>Bd(e,a,vd())))}:{success:!0,data:s.value}},ep=Qd($d),tp=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Kd(e)(t,r,a)},rp=e=>(t,r,n)=>Kd(e)(t,r,n),np=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Zd(e)(t,r,a)},ap=e=>async(t,r,n)=>Zd(e)(t,r,n),sp=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Yd(e)(t,r,a)},ip=e=>(t,r,n)=>Yd(e)(t,r,n),op=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Qd(e)(t,r,a)},cp=e=>async(t,r,n)=>Qd(e)(t,r,n),lp=/^[cC][^\s-]{8,}$/,up=/^[0-9a-z]+$/,dp=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,pp=/^[0-9a-vA-V]{20}$/,mp=/^[A-Za-z0-9]{27}$/,hp=/^[a-zA-Z0-9_-]{21}$/,fp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,gp=/^([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})$/,bp=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)$/,vp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const yp=/^(?:(?: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])$/,xp=/^(([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}|:))$/,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])\/([0-9]|[1-2][0-9]|3[0-2])$/,Sp=/^(([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])$/,kp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ep=/^[A-Za-z0-9_-]*$/,Cp=/^\+[1-9]\d{6,14}$/,Np="(?:(?:\\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])))",Ap=new RegExp(`^${Np}$`);function _p(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 jp=/^[^A-Z]*$/,Pp=/^[^a-z]*$/,Tp=hd("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Rp=hd("$ZodCheckMaxLength",(e,t)=>{var r;Tp.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Sd(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=Wd(n);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Dp=hd("$ZodCheckMinLength",(e,t)=>{var r;Tp.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Sd(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=Wd(n);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Ip=hd("$ZodCheckLengthEquals",(e,t)=>{var r;Tp.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Sd(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=Wd(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})}}),Up=hd("$ZodCheckStringFormat",(e,t)=>{var r,n;Tp.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=()=>{})}),Mp=hd("$ZodCheckRegex",(e,t)=>{Up.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})}}),Lp=hd("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=jp),Up.init(e,t)}),Op=hd("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Pp),Up.init(e,t)}),zp=hd("$ZodCheckIncludes",(e,t)=>{Tp.init(e,t);const r=Ud(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})}}),Fp=hd("$ZodCheckStartsWith",(e,t)=>{Tp.init(e,t);const r=new RegExp(`^${Ud(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})}}),Bp=hd("$ZodCheckEndsWith",(e,t)=>{Tp.init(e,t);const r=new RegExp(`.*${Ud(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})}}),Wp=hd("$ZodCheckOverwrite",(e,t)=>{Tp.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class Vp{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 Hp={major:4,minor:3,patch:6},Gp=hd("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Hp;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=Od(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 fd;if(n||i instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await i;e.issues.length!==t&&(a||(a=Od(e,t)))});else{if(e.issues.length===t)continue;a||(a=Od(e,t))}}return n?n.then(()=>e):e},r=(r,a,s)=>{if(Od(r))return r.aborted=!0,r;const i=t(a,n,s);if(i instanceof Promise){if(!1===s.async)throw new fd;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 fd;return i.then(e=>t(e,n,s))}return t(i,n,s)}}Cd(e,"~standard",()=>({validate:t=>{try{const r=Xd(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return ep(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),$p=hd("$ZodString",(e,t)=>{var r;Gp.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}}),Kp=hd("$ZodStringFormat",(e,t)=>{Up.init(e,t),$p.init(e,t)}),qp=hd("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=gp),Kp.init(e,t)}),Zp=hd("$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=bp(e))}else t.pattern??(t.pattern=bp());Kp.init(e,t)}),Jp=hd("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=vp),Kp.init(e,t)}),Yp=hd("$ZodURL",(e,t)=>{Kp.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})}}}),Xp=hd("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Kp.init(e,t)}),Qp=hd("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=hp),Kp.init(e,t)}),em=hd("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=lp),Kp.init(e,t)}),tm=hd("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=up),Kp.init(e,t)}),rm=hd("$ZodULID",(e,t)=>{t.pattern??(t.pattern=dp),Kp.init(e,t)}),nm=hd("$ZodXID",(e,t)=>{t.pattern??(t.pattern=pp),Kp.init(e,t)}),am=hd("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=mp),Kp.init(e,t)}),sm=hd("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=_p({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(`^${Np}T(?:${n})$`)}(t)),Kp.init(e,t)}),im=hd("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ap),Kp.init(e,t)}),om=hd("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${_p(t)}$`)),Kp.init(e,t)}),cm=hd("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=fp),Kp.init(e,t)}),lm=hd("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=yp),Kp.init(e,t),e._zod.bag.format="ipv4"}),um=hd("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=xp),Kp.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})}}}),dm=hd("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=wp),Kp.init(e,t)}),pm=hd("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Sp),Kp.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(2!==n.length)throw new Error;const[e,t]=n;if(!t)throw new Error;const r=Number(t);if(`${r}`!==t)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function mm(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const hm=hd("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=kp),Kp.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{mm(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});const fm=hd("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ep),Kp.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{(function(e){if(!Ep.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return mm(t.padEnd(4*Math.ceil(t.length/4),"="))})(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),gm=hd("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Cp),Kp.init(e,t)});const bm=hd("$ZodJWT",(e,t)=>{Kp.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})}}),vm=hd("$ZodUnknown",(e,t)=>{Gp.init(e,t),e._zod.parse=e=>e}),ym=hd("$ZodNever",(e,t)=>{Gp.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function xm(e,t,r){e.issues.length&&t.issues.push(...zd(r,e.issues)),t.value[r]=e.value}const wm=hd("$ZodArray",(e,t)=>{Gp.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=>xm(t,r,e))):xm(o,r,e)}return s.length?Promise.all(s).then(()=>r):r}});function Sm(e,t,r,n,a){if(e.issues.length){if(a&&!(r in n))return;t.issues.push(...zd(r,e.issues))}void 0===e.value?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function km(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 Em(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=>Sm(e,r,a,t,u))):Sm(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 Cm=hd("$ZodObject",(e,t)=>{Gp.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=wd(()=>km(t));Cd(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=Pd,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=>Sm(r,t,e,o,a))):Sm(s,t,e,o,a)}return s?Em(c,o,t,r,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Nm=hd("$ZodObjectJIT",(e,t)=>{Cm.init(e,t);const r=e._zod.parse,n=wd(()=>km(t));let a;const s=Pd,i=!bd.jitless,o=i&&Td.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 Vp(["shape","payload","ctx"]),r=n.value,a=e=>{const t=_d(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=_d(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?Em([],p,u,d,l,e):u):r(u,d):(u.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),u)}});function Am(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=>!Od(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=>Bd(e,n,vd())))}),t)}const _m=hd("$ZodUnion",(e,t)=>{Gp.init(e,t),Cd(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Cd(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Cd(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Cd(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=>kd(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=>Am(t,a,e,s)):Am(o,a,e,s)}}),jm=hd("$ZodIntersection",(e,t)=>{Gp.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])=>Tm(e,t,r)):Tm(e,a,s)}});function Pm(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(Rd(e)&&Rd(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=Pm(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=Pm(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 Tm(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}),Od(e))return e;const i=Pm(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 Rm=hd("$ZodEnum",(e,t)=>{Gp.init(e,t);const r=yd(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(e=>Id.has(typeof e)).map(e=>"string"==typeof e?Ud(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}}),Dm=hd("$ZodTransform",(e,t)=>{Gp.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new gd(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 fd;return r.value=a,r}});function Im(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Um=hd("$ZodOptional",(e,t)=>{Gp.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Cd(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Cd(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${kd(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=>Im(t,e.value)):Im(n,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),Mm=hd("$ZodExactOptional",(e,t)=>{Um.init(e,t),Cd(e._zod,"values",()=>t.innerType._zod.values),Cd(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),Lm=hd("$ZodNullable",(e,t)=>{Gp.init(e,t),Cd(e._zod,"optin",()=>t.innerType._zod.optin),Cd(e._zod,"optout",()=>t.innerType._zod.optout),Cd(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${kd(e.source)}|null)$`):void 0}),Cd(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)}),Om=hd("$ZodDefault",(e,t)=>{Gp.init(e,t),e._zod.optin="optional",Cd(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=>zm(e,t)):zm(n,t)}});function zm(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Fm=hd("$ZodPrefault",(e,t)=>{Gp.init(e,t),e._zod.optin="optional",Cd(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))}),Bm=hd("$ZodNonOptional",(e,t)=>{Gp.init(e,t),Cd(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=>Wm(t,e)):Wm(a,e)}});function Wm(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 Vm=hd("$ZodCatch",(e,t)=>{Gp.init(e,t),Cd(e._zod,"optin",()=>t.innerType._zod.optin),Cd(e._zod,"optout",()=>t.innerType._zod.optout),Cd(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=>Bd(e,r,vd()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>Bd(e,r,vd()))},input:e.value}),e.issues=[]),e)}}),Hm=hd("$ZodPipe",(e,t)=>{Gp.init(e,t),Cd(e._zod,"values",()=>t.in._zod.values),Cd(e._zod,"optin",()=>t.in._zod.optin),Cd(e._zod,"optout",()=>t.out._zod.optout),Cd(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=>Gm(e,t.in,r)):Gm(n,t.in,r)}const n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>Gm(e,t.out,r)):Gm(n,t.out,r)}});function Gm(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const $m=hd("$ZodReadonly",(e,t)=>{Gp.init(e,t),Cd(e._zod,"propValues",()=>t.innerType._zod.propValues),Cd(e._zod,"values",()=>t.innerType._zod.values),Cd(e._zod,"optin",()=>t.innerType?._zod?.optin),Cd(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(Km):Km(n)}});function Km(e){return e.value=Object.freeze(e.value),e}const qm=hd("$ZodCustom",(e,t)=>{Tp.init(e,t),Gp.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=>Zm(t,r,n,e));Zm(a,r,n,e)}});function Zm(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(Vd(e))}}var Jm;class Ym{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)}}(Jm=globalThis).__zod_globalRegistry??(Jm.__zod_globalRegistry=new Ym);const Xm=globalThis.__zod_globalRegistry;function Qm(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ld(t)})}function eh(e,t){return new Rp({check:"max_length",...Ld(t),maximum:e})}function th(e,t){return new Dp({check:"min_length",...Ld(t),minimum:e})}function rh(e,t){return new Ip({check:"length_equals",...Ld(t),length:e})}function nh(e){return new Wp({check:"overwrite",tx:e})}function ah(e){const t=function(e,t){const r=new Tp({check:"custom",...Ld(t)});return r._zod.check=e,r}(r=>(r.addIssue=e=>{if("string"==typeof e)r.issues.push(Vd(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(Vd(n))}},e(r.value,r)));return t}function sh(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??Xm,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 ih(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),ih(s,t,n),t.seen.get(s).isParent=!0)}const c=t.metadataRegistry.get(e);c&&Object.assign(i.schema,c),"input"===t.io&&lh(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 oh(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 ch(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:uh(t,"input",e.processors),output:uh(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw new Error("Error converting schema to JSON.")}}function lh(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 lh(n.element,r);if("set"===n.type)return lh(n.valueType,r);if("lazy"===n.type)return lh(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 lh(n.innerType,r);if("intersection"===n.type)return lh(n.left,r)||lh(n.right,r);if("record"===n.type||"map"===n.type)return lh(n.keyType,r)||lh(n.valueType,r);if("pipe"===n.type)return lh(n.in,r)||lh(n.out,r);if("object"===n.type){for(const e in n.shape)if(lh(n.shape[e],r))return!0;return!1}if("union"===n.type){for(const e of n.options)if(lh(e,r))return!0;return!1}if("tuple"===n.type){for(const e of n.items)if(lh(e,r))return!0;return!(!n.rest||!lh(n.rest,r))}return!1}const uh=(e,t,r={})=>n=>{const{libraryOptions:a,target:s}=n??{},i=sh({...a??{},target:s,io:t,processors:r});return ih(e,i),oh(i,e),ch(i,e)},dh={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ph=(e,t,r,n)=>{const a=e._zod.def;ih(a.innerType,t,n);t.seen.get(e).ref=a.innerType};function mh(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}function hh(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]=Au(i,t,r,a,l?[].concat(l,n.message):n.message)}e.shift()}return r}function fh(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]=Au(i,t,r,a,l?[].concat(l,n.message):n.message)}e.shift()}return r}function gh(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(mh(function(){return Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return s.shouldUseNativeValidation&&ud({},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:dd(hh(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(mh(function(){return Promise.resolve(("sync"===r.mode?qd:Jd)(e,n,t)).then(function(e){return s.shouldUseNativeValidation&&ud({},s),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return e instanceof Gd}(e))return{values:{},errors:dd(fh(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 bh=hd("ZodISODateTime",(e,t)=>{sm.init(e,t),Wh.init(e,t)});function vh(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ld(t)})}(bh,e)}const yh=hd("ZodISODate",(e,t)=>{im.init(e,t),Wh.init(e,t)});function xh(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Ld(t)})}(yh,e)}const wh=hd("ZodISOTime",(e,t)=>{om.init(e,t),Wh.init(e,t)});function Sh(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ld(t)})}(wh,e)}const kh=hd("ZodISODuration",(e,t)=>{cm.init(e,t),Wh.init(e,t)});function Eh(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ld(t)})}(kh,e)}const Ch=hd("ZodError",(e,t)=>{Gd.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,xd,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,xd,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),Nh=Kd(Ch),Ah=Zd(Ch),_h=Yd(Ch),jh=Qd(Ch),Ph=tp(Ch),Th=rp(Ch),Rh=np(Ch),Dh=ap(Ch),Ih=sp(Ch),Uh=ip(Ch),Mh=op(Ch),Lh=cp(Ch),Oh=hd("ZodType",(e,t)=>(Gp.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:uh(e,"input"),output:uh(e,"output")}}),e.toJSONSchema=((e,t={})=>r=>{const n=sh({...r,processors:t});return ih(e,n),oh(n,e),ch(n,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(Ad(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)=>Md(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>Nh(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>_h(e,t,r),e.parseAsync=async(t,r)=>Ah(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>jh(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>Ph(e,t,r),e.decode=(t,r)=>Th(e,t,r),e.encodeAsync=async(t,r)=>Rh(e,t,r),e.decodeAsync=async(t,r)=>Dh(e,t,r),e.safeEncode=(t,r)=>Ih(e,t,r),e.safeDecode=(t,r)=>Uh(e,t,r),e.safeEncodeAsync=async(t,r)=>Mh(e,t,r),e.safeDecodeAsync=async(t,r)=>Lh(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,...Ld(r)})}(Rf,e,t)}(t,r)),e.superRefine=t=>e.check(ah(t)),e.overwrite=t=>e.check(nh(t)),e.optional=()=>wf(e),e.exactOptional=()=>new Sf({type:"optional",innerType:e}),e.nullable=()=>Ef(e),e.nullish=()=>wf(Ef(e)),e.nonoptional=t=>function(e,t){return new Af({type:"nonoptional",innerType:e,...Ld(t)})}(e,t),e.array=()=>{return function(e,t,r){return new e({type:"array",element:t,...Ld(r)})}(mf,e,t);var t},e.or=t=>function(e,t){return new gf({type:"union",options:e,...Ld(t)})}([e,t]),e.and=t=>new bf({type:"intersection",left:e,right:t}),e.transform=t=>Pf(e,new yf({type:"transform",transform:t})),e.default=t=>{return r=t,new Cf({type:"default",innerType:e,get defaultValue(){return"function"==typeof r?r():Dd(r)}});var r},e.prefault=t=>{return r=t,new Nf({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof r?r():Dd(r)}});var r},e.catch=t=>{return new _f({type:"catch",innerType:e,catchValue:"function"==typeof(r=t)?r:()=>r});var r},e.pipe=t=>Pf(e,t),e.readonly=()=>new Tf({type:"readonly",innerType:e}),e.describe=t=>{const r=e.clone();return Xm.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>Xm.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Xm.get(e);const r=e.clone();return Xm.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),zh=hd("_ZodString",(e,t)=>{$p.init(e,t),Oh.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=dh[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 Mp({check:"string_format",format:"regex",...Ld(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new zp({check:"string_format",format:"includes",...Ld(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Fp({check:"string_format",format:"starts_with",...Ld(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Bp({check:"string_format",format:"ends_with",...Ld(t),suffix:e})}(...t)),e.min=(...t)=>e.check(th(...t)),e.max=(...t)=>e.check(eh(...t)),e.length=(...t)=>e.check(rh(...t)),e.nonempty=(...t)=>e.check(th(1,...t)),e.lowercase=t=>e.check(function(e){return new Lp({check:"string_format",format:"lowercase",...Ld(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Op({check:"string_format",format:"uppercase",...Ld(e)})}(t)),e.trim=()=>e.check(nh(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return nh(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(nh(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(nh(e=>e.toUpperCase())),e.slugify=()=>e.check(nh(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}),Fh=hd("ZodString",(e,t)=>{$p.init(e,t),zh.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ld(t)})}(Vh,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ld(t)})}($h,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ld(t)})}(cf,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ld(t)})}(Kh,t)),e.guid=t=>e.check(Qm(Hh,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ld(t)})}(Gh,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ld(t)})}(Gh,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ld(t)})}(Gh,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ld(t)})}(Gh,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ld(t)})}(qh,t)),e.guid=t=>e.check(Qm(Hh,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ld(t)})}(Zh,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ld(t)})}(Jh,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ld(t)})}(Yh,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ld(t)})}(af,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ld(t)})}(sf,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ld(t)})}(Xh,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ld(t)})}(Qh,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ld(t)})}(ef,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ld(t)})}(tf,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ld(t)})}(rf,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ld(t)})}(nf,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ld(t)})}(of,t)),e.datetime=t=>e.check(vh(t)),e.date=t=>e.check(xh(t)),e.time=t=>e.check(Sh(t)),e.duration=t=>e.check(Eh(t))});function Bh(e){return function(e,t){return new e({type:"string",...Ld(t)})}(Fh,e)}const Wh=hd("ZodStringFormat",(e,t)=>{Kp.init(e,t),zh.init(e,t)}),Vh=hd("ZodEmail",(e,t)=>{Jp.init(e,t),Wh.init(e,t)}),Hh=hd("ZodGUID",(e,t)=>{qp.init(e,t),Wh.init(e,t)}),Gh=hd("ZodUUID",(e,t)=>{Zp.init(e,t),Wh.init(e,t)}),$h=hd("ZodURL",(e,t)=>{Yp.init(e,t),Wh.init(e,t)}),Kh=hd("ZodEmoji",(e,t)=>{Xp.init(e,t),Wh.init(e,t)}),qh=hd("ZodNanoID",(e,t)=>{Qp.init(e,t),Wh.init(e,t)}),Zh=hd("ZodCUID",(e,t)=>{em.init(e,t),Wh.init(e,t)}),Jh=hd("ZodCUID2",(e,t)=>{tm.init(e,t),Wh.init(e,t)}),Yh=hd("ZodULID",(e,t)=>{rm.init(e,t),Wh.init(e,t)}),Xh=hd("ZodXID",(e,t)=>{nm.init(e,t),Wh.init(e,t)}),Qh=hd("ZodKSUID",(e,t)=>{am.init(e,t),Wh.init(e,t)}),ef=hd("ZodIPv4",(e,t)=>{lm.init(e,t),Wh.init(e,t)}),tf=hd("ZodIPv6",(e,t)=>{um.init(e,t),Wh.init(e,t)}),rf=hd("ZodCIDRv4",(e,t)=>{dm.init(e,t),Wh.init(e,t)}),nf=hd("ZodCIDRv6",(e,t)=>{pm.init(e,t),Wh.init(e,t)}),af=hd("ZodBase64",(e,t)=>{hm.init(e,t),Wh.init(e,t)}),sf=hd("ZodBase64URL",(e,t)=>{fm.init(e,t),Wh.init(e,t)}),of=hd("ZodE164",(e,t)=>{gm.init(e,t),Wh.init(e,t)}),cf=hd("ZodJWT",(e,t)=>{bm.init(e,t),Wh.init(e,t)}),lf=hd("ZodUnknown",(e,t)=>{vm.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{}});function uf(){return new lf({type:"unknown"})}const df=hd("ZodNever",(e,t)=>{ym.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r)=>{r.not={}})(0,0,t)});function pf(e){return function(e,t){return new e({type:"never",...Ld(t)})}(df,e)}const mf=hd("ZodArray",(e,t)=>{wm.init(e,t),Oh.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=ih(s.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element,e.min=(t,r)=>e.check(th(t,r)),e.nonempty=t=>e.check(th(1,t)),e.max=(t,r)=>e.check(eh(t,r)),e.length=(t,r)=>e.check(rh(t,r)),e.unwrap=()=>e.element});const hf=hd("ZodObject",(e,t)=>{Nm.init(e,t),Oh.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]=ih(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=ih(s.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(a.additionalProperties=!1)})(e,t,r,n),Cd(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new vf({type:"enum",entries:r,...Ld(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:uf()}),e.loose=()=>e.clone({...e._zod.def,catchall:uf()}),e.strict=()=>e.clone({...e._zod.def,catchall:pf()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Rd(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=Ad(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Nd(this,"shape",r),r}});return Md(e,n)}(e,t),e.safeExtend=t=>function(e,t){if(!Rd(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Ad(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Nd(this,"shape",r),r}});return Md(e,r)}(e,t),e.merge=t=>function(e,t){const r=Ad(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Nd(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Md(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 Md(e,Ad(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 Nd(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=Ad(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 Nd(this,"shape",n),n},checks:[]});return Md(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=Ad(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 Nd(this,"shape",a),a},checks:[]});return Md(t,a)}(xf,e,t[0]),e.required=(...t)=>function(e,t,r){const n=Ad(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 Nd(this,"shape",a),a}});return Md(t,n)}(Af,e,t[0])});function ff(e,t){const r={type:"object",shape:e??{},...Ld(t)};return new hf(r)}const gf=hd("ZodUnion",(e,t)=>{_m.init(e,t),Oh.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)=>ih(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 bf=hd("ZodIntersection",(e,t)=>{jm.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s=ih(a.left,t,{...n,path:[...n.path,"allOf",0]}),i=ih(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 vf=hd("ZodEnum",(e,t)=>{Rm.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{const n=yd(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 vf({...t,checks:[],...Ld(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 vf({...t,checks:[],...Ld(n),entries:a})}});const yf=hd("ZodTransform",(e,t)=>{Dm.init(e,t),Oh.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 gd(e.constructor.name);r.addIssue=n=>{if("string"==typeof n)r.issues.push(Vd(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(Vd(t))}};const a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r)):(r.value=a,r)}});const xf=hd("ZodOptional",(e,t)=>{Um.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>ph(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});function wf(e){return new xf({type:"optional",innerType:e})}const Sf=hd("ZodExactOptional",(e,t)=>{Mm.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>ph(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const kf=hd("ZodNullable",(e,t)=>{Lm.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s=ih(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 Ef(e){return new kf({type:"nullable",innerType:e})}const Cf=hd("ZodDefault",(e,t)=>{Om.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;ih(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 Nf=hd("ZodPrefault",(e,t)=>{Fm.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;ih(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 Af=hd("ZodNonOptional",(e,t)=>{Bm.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;ih(a.innerType,t,n),t.seen.get(e).ref=a.innerType})(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const _f=hd("ZodCatch",(e,t)=>{Vm.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;let s;ih(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 jf=hd("ZodPipe",(e,t)=>{Hm.init(e,t),Oh.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;ih(s,t,n),t.seen.get(e).ref=s})(e,t,0,n),e.in=t.in,e.out=t.out});function Pf(e,t){return new jf({type:"pipe",in:e,out:t})}const Tf=hd("ZodReadonly",(e,t)=>{$m.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;ih(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 Rf=hd("ZodCustom",(e,t)=>{qm.init(e,t),Oh.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 Df={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:"฿"},If={usd:"🇺🇸",eur:"🇪🇺",gbp:"🇬🇧",jpy:"🇯🇵",cad:"🇨🇦",aud:"🇦🇺",chf:"🇨🇭",cny:"🇨🇳",hkd:"🇭🇰",sgd:"🇸🇬",inr:"🇮🇳",mxn:"🇲🇽",brl:"🇧🇷",nzd:"🇳🇿",sek:"🇸🇪",nok:"🇳🇴",dkk:"🇩🇰",pln:"🇵🇱",thb:"🇹🇭"};function Uf(e){return e&&e.trim()?If[e.trim().toLowerCase()]??"":""}function Mf(e){if(!e||!e.trim())return"";const t=e.trim().toLowerCase();return Df[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()} (${Mf(e)})`}));var Lf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=ms(`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}},{}),Of=a.forwardRef((t,r)=>e.jsx(Lf.label,{...t,ref:r,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));Of.displayName="Label";var zf=Of;const Ff=xs("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Bf=a.forwardRef(({className:t,...r},n)=>e.jsx(zf,{ref:n,className:Se(Ff(),t),...r}));Bf.displayName=zf.displayName;const Wf=Nu,Vf=a.createContext({}),Hf=({...t})=>e.jsx(Vf.Provider,{value:{name:t.name},children:e.jsx(Eu,{...t})}),Gf=()=>{const e=a.useContext(Vf),r=a.useContext($f),{getFieldState:n,formState:s}=t.useContext(Cu),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}},$f=a.createContext({}),Kf=a.forwardRef(({className:t,...r},n)=>{const s=a.useId();return e.jsx($f.Provider,{value:{id:s},children:e.jsx("div",{ref:n,className:Se("space-y-2",t),...r})})});Kf.displayName="FormItem";const qf=a.forwardRef(({className:t,...r},n)=>{const{error:a,formItemId:s}=Gf();return e.jsx(Bf,{ref:n,className:Se(a&&"text-destructive",t),htmlFor:s,...r})});qf.displayName="FormLabel";const Zf=a.forwardRef(({...t},r)=>{const{error:n,formItemId:a,formDescriptionId:s,formMessageId:i}=Gf();return e.jsx(hs,{ref:r,id:a,"aria-describedby":n?`${s} ${i}`:`${s}`,"aria-invalid":!!n,...t})});Zf.displayName="FormControl";const Jf=a.forwardRef(({className:t,...r},n)=>{const{formDescriptionId:a}=Gf();return e.jsx("p",{ref:n,id:a,className:Se("text-sm text-muted-foreground",t),...r})});Jf.displayName="FormDescription";const Yf=a.forwardRef(({className:t,children:r,...n},a)=>{const{error:s,formMessageId:i}=Gf(),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});Yf.displayName="FormMessage";const Xf=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 Qf(t){const r=eg(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(rg);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 eg(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?cs(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}Xf.displayName="Input";var tg=Symbol("radix.slottable");function rg(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===tg}function ng(r){const n=r+"CollectionProvider",[a,s]=Es(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=Qf(l),d=t.forwardRef((t,r)=>{const{scope:n,children:a}=t,s=ls(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=Qf(p),f=t.forwardRef((r,n)=>{const{scope:a,children:s,...i}=r,c=t.useRef(null),l=ls(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 ag=a.createContext(void 0);function sg(e){const t=a.useContext(ag);return e||t||"ltr"}var ig="rovingFocusGroup.onEntryFocus",og={bubbles:!1,cancelable:!0},cg="RovingFocusGroup",[lg,ug,dg]=ng(cg),[pg,mg]=Es(cg,[dg]),[hg,fg]=pg(cg),gg=a.forwardRef((t,r)=>e.jsx(lg.Provider,{scope:t.__scopeRovingFocusGroup,children:e.jsx(lg.Slot,{scope:t.__scopeRovingFocusGroup,children:e.jsx(bg,{...t,ref:r})})}));gg.displayName=cg;var bg=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=ls(r,h),g=sg(o),[b,v]=Ts({prop:c,defaultProp:l??null,onChange:u,caller:cg}),[y,x]=a.useState(!1),w=Ms(d),S=ug(n),k=a.useRef(!1),[E,C]=a.useState(0);return a.useEffect(()=>{const e=h.current;if(e)return e.addEventListener(ig,w),()=>e.removeEventListener(ig,w)},[w]),e.jsx(hg,{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(Us.div,{tabIndex:y||0===E?-1:0,"data-orientation":s,...m,ref:f,style:{outline:"none",...t.style},onMouseDown:ks(t.onMouseDown,()=>{k.current=!0}),onFocus:ks(t.onFocus,e=>{const t=!k.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(ig,og);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter(e=>e.focusable);wg([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),p)}}k.current=!1}),onBlur:ks(t.onBlur,()=>x(!1))})})}),vg="RovingFocusGroupItem",yg=a.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:i=!1,tabStopId:o,children:c,...l}=t,u=js(),d=o||u,p=fg(vg,n),m=p.currentTabStopId===d,h=ug(n),{onFocusableItemAdd:f,onFocusableItemRemove:g,currentTabStopId:b}=p;return a.useEffect(()=>{if(s)return f(),()=>g()},[s,f,g]),e.jsx(lg.ItemSlot,{scope:n,id:d,focusable:s,active:i,children:e.jsx(Us.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...l,ref:r,onMouseDown:ks(t.onMouseDown,e=>{s?p.onItemFocus(d):e.preventDefault()}),onFocus:ks(t.onFocus,()=>p.onItemFocus(d)),onKeyDown:ks(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:xg[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(()=>wg(r))}}),children:"function"==typeof c?c({isCurrentTabStop:m,hasTabStop:null!=b}):c})})});yg.displayName=vg;var xg={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function wg(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 Sg=gg,kg=yg,Eg="Radio",[Cg,Ng]=Es(Eg),[Ag,_g]=Cg(Eg),jg=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=ls(r,e=>h(e)),g=a.useRef(!1),b=!m||(d||!!m.closest("form"));return e.jsxs(Ag,{scope:n,checked:i,disabled:c,children:[e.jsx(Us.button,{type:"button",role:"radio","aria-checked":i,"data-state":Dg(i),"data-disabled":c?"":void 0,disabled:c,value:l,...p,ref:f,onClick:ks(t.onClick,e=>{i||u?.(),b&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),b&&e.jsx(Rg,{control:m,bubbles:!g.current,name:s,value:l,checked:i,required:o,disabled:c,form:d,style:{transform:"translateX(-100%)"}})]})});jg.displayName=Eg;var Pg="RadioIndicator",Tg=a.forwardRef((t,r)=>{const{__scopeRadio:n,forceMount:a,...s}=t,i=_g(Pg,n);return e.jsx(ri,{present:a||i.checked,children:e.jsx(Us.span,{"data-state":Dg(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:r})})});Tg.displayName=Pg;var Rg=a.forwardRef(({__scopeRadio:t,control:r,checked:n,bubbles:s=!0,...i},o)=>{const c=a.useRef(null),l=ls(c,o),u=Sl(n),d=kl(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(Us.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 Dg(e){return e?"checked":"unchecked"}Rg.displayName="RadioBubbleInput";var Ig=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ug="RadioGroup",[Mg]=Es(Ug,[mg,Ng]),Lg=mg(),Og=Ng(),[zg,Fg]=Mg(Ug),Bg=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=Lg(n),f=sg(u),[g,b]=Ts({prop:i,defaultProp:s??null,onChange:p,caller:Ug});return e.jsx(zg,{scope:n,name:a,required:o,disabled:c,value:g,onValueChange:b,children:e.jsx(Sg,{asChild:!0,...h,orientation:l,dir:f,loop:d,children:e.jsx(Us.div,{role:"radiogroup","aria-required":o,"aria-orientation":l,"data-disabled":c?"":void 0,dir:f,...m,ref:r})})})});Bg.displayName=Ug;var Wg="RadioGroupItem",Vg=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,disabled:s,...i}=t,o=Fg(Wg,n),c=o.disabled||s,l=Lg(n),u=Og(n),d=a.useRef(null),p=ls(r,d),m=o.value===i.value,h=a.useRef(!1);return a.useEffect(()=>{const e=e=>{Ig.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(kg,{asChild:!0,...l,focusable:!c,active:m,children:e.jsx(jg,{disabled:c,required:o.required,checked:m,...u,...i,name:o.name,ref:p,onCheck:()=>o.onValueChange(i.value),onKeyDown:ks(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:ks(i.onFocus,()=>{h.current&&d.current?.click()})})})});Vg.displayName=Wg;var Hg=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,...a}=t,s=Og(n);return e.jsx(Tg,{...s,...a,ref:r})});Hg.displayName="RadioGroupIndicator";var Gg=Bg,$g=Vg,Kg=Hg;const qg=a.forwardRef(({className:t,...r},n)=>e.jsx(Gg,{className:Se("grid gap-2",t),...r,ref:n}));qg.displayName=Gg.displayName;const Zg=a.forwardRef(({className:t,...r},n)=>e.jsx($g,{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(Kg,{className:"flex items-center justify-center",children:e.jsx(Jo,{className:"h-3.5 w-3.5 fill-primary"})})}));function Jg(e,[t,r]){return Math.min(r,Math.max(t,e))}Zg.displayName=$g.displayName;var Yg="ScrollArea",[Xg]=Es(Yg),[Qg,eb]=Xg(Yg),tb=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=ls(r,e=>u(e)),_=sg(i);return e.jsx(Qg,{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(Us.div,{dir:_,...c,ref:A,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":w+"px",...t.style}})})});tb.displayName=Yg;var rb="ScrollAreaViewport",nb=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,children:s,nonce:i,...o}=t,c=eb(rb,n),l=ls(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(Us.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})})]})});nb.displayName=rb;var ab="ScrollAreaScrollbar",sb=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=eb(ab,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(ib,{...s,ref:r,forceMount:n}):"scroll"===i.type?e.jsx(ob,{...s,ref:r,forceMount:n}):"auto"===i.type?e.jsx(cb,{...s,ref:r,forceMount:n}):"always"===i.type?e.jsx(lb,{...s,ref:r}):null});sb.displayName=ab;var ib=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=eb(ab,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(ri,{present:n||o,children:e.jsx(cb,{"data-state":o?"visible":"hidden",...s,ref:r})})}),ob=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=eb(ab,t.__scopeScrollArea),o="horizontal"===t.orientation,c=_b(()=>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(ri,{present:n||"hidden"!==l,children:e.jsx(lb,{"data-state":"hidden"===l?"hidden":"visible",...s,ref:r,onPointerEnter:ks(t.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:ks(t.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),cb=a.forwardRef((t,r)=>{const n=eb(ab,t.__scopeScrollArea),{forceMount:s,...i}=t,[o,c]=a.useState(!1),l="horizontal"===t.orientation,u=_b(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;c(l?e:t)}},10);return jb(n.viewport,u),jb(n.content,u),e.jsx(ri,{present:s||o,children:e.jsx(lb,{"data-state":o?"visible":"hidden",...i,ref:r})})}),lb=a.forwardRef((t,r)=>{const{orientation:n="vertical",...s}=t,i=eb(ab,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=Sb(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=kb(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 Cb([c,l],d)(e)}(e,c.current,l,t)}return"horizontal"===n?e.jsx(ub,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&o.current){const e=Eb(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(db,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&o.current){const e=Eb(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}),ub=a.forwardRef((t,r)=>{const{sizes:n,onSizesChange:s,...i}=t,o=eb(ab,t.__scopeScrollArea),[c,l]=a.useState(),u=a.useRef(null),d=ls(r,u,o.onScrollbarXChange);return a.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),e.jsx(hb,{"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":kb(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),Nb(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:wb(c.paddingLeft),paddingEnd:wb(c.paddingRight)}})}})}),db=a.forwardRef((t,r)=>{const{sizes:n,onSizesChange:s,...i}=t,o=eb(ab,t.__scopeScrollArea),[c,l]=a.useState(),u=a.useRef(null),d=ls(r,u,o.onScrollbarYChange);return a.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),e.jsx(hb,{"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":kb(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),Nb(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:wb(c.paddingTop),paddingEnd:wb(c.paddingBottom)}})}})}),[pb,mb]=Xg(ab),hb=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=eb(ab,n),[g,b]=a.useState(null),v=ls(r,e=>b(e)),y=a.useRef(null),x=a.useRef(""),w=f.viewport,S=s.content-s.viewport,k=Ms(p),E=Ms(u),C=_b(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]),jb(g,C),jb(f.content,C),e.jsx(pb,{scope:n,scrollbar:g,hasThumb:i,onThumbChange:Ms(o),onThumbPointerUp:Ms(c),onThumbPositionChange:E,onThumbPointerDown:Ms(l),children:e.jsx(Us.div,{...h,ref:v,style:{position:"absolute",...h.style},onPointerDown:ks(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:ks(t.onPointerMove,N),onPointerUp:ks(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})})})}),fb="ScrollAreaThumb",gb=a.forwardRef((t,r)=>{const{forceMount:n,...a}=t,s=mb(fb,t.__scopeScrollArea);return e.jsx(ri,{present:n||s.hasThumb,children:e.jsx(bb,{ref:r,...a})})}),bb=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,style:s,...i}=t,o=eb(fb,n),c=mb(fb,n),{onThumbPositionChange:l}=c,u=ls(r,e=>c.onThumbChange(e)),d=a.useRef(void 0),p=_b(()=>{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=Ab(e,l);d.current=t,l()}};return l(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,p,l]),e.jsx(Us.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:ks(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:ks(t.onPointerUp,c.onThumbPointerUp)})});gb.displayName=fb;var vb="ScrollAreaCorner",yb=a.forwardRef((t,r)=>{const n=eb(vb,t.__scopeScrollArea),a=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&a?e.jsx(xb,{...t,ref:r}):null});yb.displayName=vb;var xb=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,...s}=t,i=eb(vb,n),[o,c]=a.useState(0),[l,u]=a.useState(0),d=Boolean(o&&l);return jb(i.scrollbarX,()=>{const e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),u(e)}),jb(i.scrollbarY,()=>{const e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),c(e)}),d?e.jsx(Us.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 wb(e){return e?parseInt(e,10):0}function Sb(e,t){const r=e/t;return isNaN(r)?0:r}function kb(e){const t=Sb(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function Eb(e,t,r="ltr"){const n=kb(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-a,i=t.content-t.viewport,o=s-n,c=Jg(e,"ltr"===r?[0,i]:[-1*i,0]);return Cb([0,i],[0,o])(c)}function Cb(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 Nb(e,t){return e>0&&e<t}var Ab=(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 _b(e,t){const r=Ms(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 jb(e,t){const r=Ms(t);Ns(()=>{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 Pb=tb,Tb=nb,Rb=yb;const Db=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(Pb,{ref:a,className:Se("relative overflow-hidden",t),...n,children:[e.jsx(Tb,{className:"h-full w-full rounded-[inherit]",children:r}),e.jsx(Ib,{}),e.jsx(Rb,{})]}));Db.displayName=Pb.displayName;const Ib=a.forwardRef(({className:t,orientation:r="vertical",...n},a)=>e.jsx(sb,{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(gb,{className:Se("relative rounded-full bg-border","vertical"===r&&"flex-1")})}));function Ub(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>`}Ib.displayName=sb.displayName;const Mb=["🏢","🏬","🏣","🏤","🏦","🏛️","🏠","🏡","🏭","🏗️","🏪","🏨","🏫","🏥","💼","📊","📈","📉","📋","📁","📂","🗂️","🗃️","🗄️","📅","🗓️","📝","🖋️","✏️","🖊️","🖌️","🖍️","📇","📌","📍","📎","🖇️","💻","🖥️","🖨️","🖱️","⌨️","📱","📲","📡","🌐","🔗","🔒","🔓","⚙️","🔧","🛠️","🧑💻","👨💻","👩💻","🕹️","💾","📟","🖥️","🖲️","🚀","💡","🎨","🖼️","🧪","🔬","🧬","🎯","⚡","🎲","🎮","🧩","📷","🎥","✉️","📨","📩","📧","📞","☎️","📠","🗣️","💬","🗨️","📢","📣","🔔","🛎️","💰","💸","💳","🏦","📈","📉","⚖️","🧾","🪙","🏛️","⚗️","🧪","🔭","🔬","🩺","🧬","🩻","🏥","🌱","🌍","🌏","🌎","🌡️","👨💼","👩💼","👨🏫","👩🏫","👨🔬","👩🔬","👨🎨","👩🎨","👨🔧","👩🔧","👨🚀","👩🚀","👨⚖️","👩⚖️","🏅","🎖️","🥇","🥈","🥉","🏆","🎗️","🔑","🗝️","🧭","🛡️","🚩","🏳️🌈","🎟️","🎫"],Lb=({workspace:r})=>{const{t:n}=nn(),{updateWorkspace:a}=Ik(),{can:s}=vl(),[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=cd({resolver:gh(ff({name:Bh().min(2,{message:n("general.nameMinLength")}),image:Bh().optional()})),defaultValues:{name:r.name||"",image:r.image||""}});if(!r)return e.jsx(xl,{});const g=s(rl.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(Wf,{...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(Hf,{control:f.control,name:"name",render:({field:t})=>e.jsxs(Kf,{children:[e.jsx(qf,{children:n("general.name")}),e.jsx(Zf,{children:e.jsx(Xf,{placeholder:n("general.namePlaceholder"),...t,disabled:!g})}),e.jsx(Yf,{})]})}),r.billingCurrency?.trim()&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Bf,{className:"text-sm font-medium text-muted-foreground",children:n("general.billingCurrency")}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[Uf(r.billingCurrency)&&e.jsx("span",{className:"text-base",children:Uf(r.billingCurrency)}),e.jsx("span",{children:r.billingCurrency.trim().toUpperCase()})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(Bf,{className:"text-sm font-medium",children:n("general.icon")}),e.jsx(Jf,{children:n("general.iconDescription")})]}),e.jsxs(qg,{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(Zg,{value:"emoji",id:"emoji"}),e.jsxs(Bf,{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(Zg,{value:"url",id:"url"}),e.jsxs(Bf,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(Va,{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(Db,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Mb.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{d(e),f.setValue("image",Ub(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(Hf,{control:f.control,name:"image",render:({field:t})=>e.jsxs(Kf,{children:[e.jsx(qf,{children:n("general.imageUrl")}),e.jsx(Zf,{children:e.jsx(Xf,{placeholder:n("general.imageUrlPlaceholder"),...t,disabled:!g})}),e.jsx(Jf,{children:n("general.imageUrlDescription")}),e.jsx(Yf,{})]})}),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(Ss,{type:"submit",disabled:i,progress:i,children:n("general.updateWorkspace")})})]})})]})};class Ob extends hn{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 zb=t.createContext(null);function Fb(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 Bb=t.memo(function({children:r,serviceWorkerPath:n="/push-sw.js",autoSubscribe:a=!1}){const{t:s}=nn(),i=xn(),{isAuthenticated:o}=bl(),c=t.useMemo(()=>"undefined"!=typeof window&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window,[]),l=t.useMemo(()=>new Ob({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:Fb(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(zb.Provider,{value:f,children:r})});function Wb(){const e=t.useContext(zb);if(!e)throw new Error("usePushNotifications must be used within PushNotificationProvider");return e}const Vb={firefox:4,safari:4,edge:4,chrome:4},Hb=({workspace:r})=>{const{isSupported:n,permission:a,isSubscribed:s,loading:i,error:o,subscribe:c,unsubscribe:l}=Wb(),{t:u}=nn(),{api:d}=kn(),{can:p}=vl(),m=p(rl.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=Vb[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(Ya,{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(Da,{className:"h-4 w-4 text-green-600"}):e.jsx(Ra,{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(Ss,{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(Ga,{className:"h-3.5 w-3.5 text-gray-400"})}),e.jsx("div",{className:"w-12 flex justify-center",children:e.jsx(Qa,{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(Ul,{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(Ul,{checked:n,onCheckedChange:()=>j(t.slug,"push",n),disabled:s}):e.jsx("span",{className:"text-xs text-gray-300",children:"—"})})]})]},t.slug)})]})]},t))]})]})},Gb=({workspace:r})=>{const{t:n}=nn(),{isOwner:a}=vl(),{settings:s}=Sn(),{appPermissions:i}=Wn(),{updateWorkspacePermissions:o}=Ik(),[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(xl,{});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(Ul,{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(Ss,{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 $b=.999,Kb=/[\\\/_+.#"@\[\(\{&]/,qb=/[\\\/_+.#"@\[\(\{&]/g,Zb=/[\s-]/,Jb=/[\s-]/g;function Yb(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=Yb(e,t,r,n,m+1,s+1,i))>h&&(m===a?c*=1:Kb.test(e.charAt(m-1))?(c*=.8,(u=e.slice(a,m-1).match(qb))&&a>0&&(c*=Math.pow($b,u.length))):Zb.test(e.charAt(m-1))?(c*=.9,(d=e.slice(a,m-1).match(Jb))&&a>0&&(c*=Math.pow($b,d.length))):(c*=.17,a>0&&(c*=Math.pow($b,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=Yb(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 Xb(e){return e.toLowerCase().replace(Jb," ")}function Qb(e,t,r){return Yb(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,Xb(e),Xb(t),0,0,{})}var ev='[cmdk-group=""]',tv='[cmdk-group-items=""]',rv='[cmdk-item=""]',nv=`${rv}:not([aria-disabled="true"])`,av="cmdk-item-select",sv="data-value",iv=(e,t,r)=>Qb(e,t,r),ov=a.createContext(void 0),cv=()=>a.useContext(ov),lv=a.createContext(void 0),uv=()=>a.useContext(lv),dv=a.createContext(void 0),pv=a.forwardRef((e,t)=>{let r=Nv(()=>{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=Nv(()=>new Set),s=Nv(()=>new Map),i=Nv(()=>new Map),o=Nv(()=>new Set),c=Ev(e),{label:l,children:u,value:d,onValueChange:p,filter:m,shouldFilter:h,loop:f,disablePointerSelection:g=!1,vimBindings:b=!0,...v}=e,y=js(),x=js(),w=js(),S=a.useRef(null),k=jv();Cv(()=>{if(void 0!==d){let e=d.trim();r.current.value=e,E.emit()}},[d]),Cv(()=>{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:iv;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(tv);t?t.appendChild(e.parentElement===t?e:e.closest(`${tv} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${tv} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=S.current)?void 0:t.querySelector(`${ev}[${sv}="${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(sv);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(ev))?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(`${rv}[aria-selected="true"]`)}function R(){var e;return Array.from((null==(e=S.current)?void 0:e.querySelectorAll(nv))||[])}function D(e){let t=R()[e];t&&E.setState("value",t.getAttribute(sv))}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(sv))}function U(e){let t,r=T(),n=null==r?void 0:r.closest(ev);for(;n&&!t;)n=e>0?Sv(n,ev):kv(n,ev),t=null==n?void 0:n.querySelector(nv);t?E.setState("value",t.getAttribute(sv)):I(e)}let M=()=>D(R().length-1),L=e=>{e.preventDefault(),e.metaKey?M():e.altKey?U(1):I(1)},O=e=>{e.preventDefault(),e.metaKey?D(0):e.altKey?U(-1):I(-1)};return a.createElement(Us.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(),M();break;case"Enter":{e.preventDefault();let t=T();if(t){let e=new Event(av);t.dispatchEvent(e)}}}}},a.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:Tv},l),Pv(e,e=>a.createElement(lv.Provider,{value:E},a.createElement(ov.Provider,{value:C},e))))}),mv=a.forwardRef((e,t)=>{var r,n;let s=js(),i=a.useRef(null),o=a.useContext(dv),c=cv(),l=Ev(e),u=null!=(n=null==(r=l.current)?void 0:r.forceMount)?n:null==o?void 0:o.forceMount;Cv(()=>{if(!u)return c.item(s,null==o?void 0:o.id)},[u]);let d=_v(s,i,[e.value,e.children,i],e.keywords),p=uv(),m=Av(e=>e.value&&e.value===d.current),h=Av(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(av,f),()=>t.removeEventListener(av,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(Us.div,{ref:cs(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)}),hv=a.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:s,...i}=e,o=js(),c=a.useRef(null),l=a.useRef(null),u=js(),d=cv(),p=Av(e=>!(!s&&!1!==d.filter())||(!e.search||e.filtered.groups.has(o)));Cv(()=>d.group(o),[]),_v(o,c,[e.value,e.heading,l]);let m=a.useMemo(()=>({id:o,forceMount:s}),[s]);return a.createElement(Us.div,{ref:cs(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),Pv(e,e=>a.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},a.createElement(dv.Provider,{value:m},e))))}),fv=a.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,s=a.useRef(null),i=Av(e=>!e.search);return r||i?a.createElement(Us.div,{ref:cs(s,t),...n,"cmdk-separator":"",role:"separator"}):null}),gv=a.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,s=null!=e.value,i=uv(),o=Av(e=>e.search),c=Av(e=>e.selectedItemId),l=cv();return a.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),a.createElement(Us.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)}})}),bv=a.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...s}=e,i=a.useRef(null),o=a.useRef(null),c=Av(e=>e.selectedItemId),l=cv();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(Us.div,{ref:cs(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":n,id:l.listId},Pv(e,e=>a.createElement("div",{ref:cs(o,l.listInnerRef),"cmdk-list-sizer":""},e)))}),vv=a.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:i,container:o,...c}=e;return a.createElement(Oo,{open:r,onOpenChange:n},a.createElement(Fo,{container:o},a.createElement(Bo,{"cmdk-overlay":"",className:s}),a.createElement(Wo,{"aria-label":e.label,"cmdk-dialog":"",className:i},a.createElement(pv,{ref:t,...c}))))}),yv=a.forwardRef((e,t)=>Av(e=>0===e.filtered.count)?a.createElement(Us.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),xv=a.forwardRef((e,t)=>{let{progress:r,children:n,label:s="Loading...",...i}=e;return a.createElement(Us.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Pv(e,e=>a.createElement("div",{"aria-hidden":!0},e)))}),wv=Object.assign(pv,{List:bv,Item:mv,Input:gv,Group:hv,Separator:fv,Dialog:vv,Empty:yv,Loading:xv});function Sv(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function kv(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function Ev(e){let t=a.useRef(e);return Cv(()=>{t.current=e}),t}var Cv="undefined"==typeof window?a.useEffect:a.useLayoutEffect;function Nv(e){let t=a.useRef();return void 0===t.current&&(t.current=e()),t}function Av(e){let t=uv(),r=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,r,r)}function _v(e,t,r,n=[]){let s=a.useRef(),i=cv();return Cv(()=>{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(sv,o),s.current=o}),s}var jv=()=>{let[e,t]=a.useState(),r=Nv(()=>new Map);return Cv(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function Pv({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 Tv={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Rv=a.forwardRef(({className:t,...r},n)=>e.jsx(wv,{ref:n,className:Se("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...r}));Rv.displayName=wv.displayName;const Dv=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(wv.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})]}));Dv.displayName=wv.Input.displayName;const Iv=a.forwardRef(({className:t,...r},n)=>e.jsx(wv.List,{ref:n,className:Se("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...r}));Iv.displayName=wv.List.displayName;a.forwardRef((t,r)=>e.jsx(wv.Empty,{ref:r,className:"py-6 text-center text-sm",...t})).displayName=wv.Empty.displayName;const Uv=a.forwardRef(({className:t,...r},n)=>e.jsx(wv.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}));Uv.displayName=wv.Group.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(wv.Separator,{ref:n,className:Se("-mx-1 h-px bg-border",t),...r})).displayName=wv.Separator.displayName;const Mv=a.forwardRef(({className:t,...r},n)=>e.jsx(wv.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}));Mv.displayName=wv.Item.displayName;const Lv=["top","right","bottom","left"],Ov=Math.min,zv=Math.max,Fv=Math.round,Bv=Math.floor,Wv=e=>({x:e,y:e}),Vv={left:"right",right:"left",bottom:"top",top:"bottom"},Hv={start:"end",end:"start"};function Gv(e,t,r){return zv(e,Ov(t,r))}function $v(e,t){return"function"==typeof e?e(t):e}function Kv(e){return e.split("-")[0]}function qv(e){return e.split("-")[1]}function Zv(e){return"x"===e?"y":"x"}function Jv(e){return"y"===e?"height":"width"}const Yv=new Set(["top","bottom"]);function Xv(e){return Yv.has(Kv(e))?"y":"x"}function Qv(e){return Zv(Xv(e))}function ey(e){return e.replace(/start|end/g,e=>Hv[e])}const ty=["left","right"],ry=["right","left"],ny=["top","bottom"],ay=["bottom","top"];function sy(e,t,r,n){const a=qv(e);let s=function(e,t,r){switch(e){case"top":case"bottom":return r?t?ry:ty:t?ty:ry;case"left":case"right":return t?ny:ay;default:return[]}}(Kv(e),"start"===r,n);return a&&(s=s.map(e=>e+"-"+a),t&&(s=s.concat(s.map(ey)))),s}function iy(e){return e.replace(/left|right|bottom|top/g,e=>Vv[e])}function oy(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 cy(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 ly(e,t,r){let{reference:n,floating:a}=e;const s=Xv(t),i=Qv(t),o=Jv(i),c=Kv(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(qv(t)){case"start":m[i]-=p*(r&&l?-1:1);break;case"end":m[i]+=p*(r&&l?-1:1)}return m}async function uy(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}=$v(t,e),h=oy(m),f=o[p?"floating"===d?"reference":"floating":d],g=cy(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=cy(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 dy(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function py(e){return Lv.some(t=>e[t]>=0)}const my=new Set(["left","top"]);function hy(){return"undefined"!=typeof window}function fy(e){return vy(e)?(e.nodeName||"").toLowerCase():"#document"}function gy(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function by(e){var t;return null==(t=(vy(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function vy(e){return!!hy()&&(e instanceof Node||e instanceof gy(e).Node)}function yy(e){return!!hy()&&(e instanceof Element||e instanceof gy(e).Element)}function xy(e){return!!hy()&&(e instanceof HTMLElement||e instanceof gy(e).HTMLElement)}function wy(e){return!(!hy()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof gy(e).ShadowRoot)}const Sy=new Set(["inline","contents"]);function ky(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=Uy(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Sy.has(a)}const Ey=new Set(["table","td","th"]);function Cy(e){return Ey.has(fy(e))}const Ny=[":popover-open",":modal"];function Ay(e){return Ny.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const _y=["transform","translate","scale","rotate","perspective"],jy=["transform","translate","scale","rotate","perspective","filter"],Py=["paint","layout","strict","content"];function Ty(e){const t=Ry(),r=yy(e)?Uy(e):e;return _y.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||jy.some(e=>(r.willChange||"").includes(e))||Py.some(e=>(r.contain||"").includes(e))}function Ry(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Dy=new Set(["html","body","#document"]);function Iy(e){return Dy.has(fy(e))}function Uy(e){return gy(e).getComputedStyle(e)}function My(e){return yy(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ly(e){if("html"===fy(e))return e;const t=e.assignedSlot||e.parentNode||wy(e)&&e.host||by(e);return wy(t)?t.host:t}function Oy(e){const t=Ly(e);return Iy(t)?e.ownerDocument?e.ownerDocument.body:e.body:xy(t)&&ky(t)?t:Oy(t)}function zy(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const a=Oy(e),s=a===(null==(n=e.ownerDocument)?void 0:n.body),i=gy(a);if(s){const e=Fy(i);return t.concat(i,i.visualViewport||[],ky(a)?a:[],e&&r?zy(e):[])}return t.concat(a,zy(a,[],r))}function Fy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function By(e){const t=Uy(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=xy(e),s=a?e.offsetWidth:r,i=a?e.offsetHeight:n,o=Fv(r)!==s||Fv(n)!==i;return o&&(r=s,n=i),{width:r,height:n,$:o}}function Wy(e){return yy(e)?e:e.contextElement}function Vy(e){const t=Wy(e);if(!xy(t))return Wv(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:s}=By(t);let i=(s?Fv(r.width):r.width)/n,o=(s?Fv(r.height):r.height)/a;return i&&Number.isFinite(i)||(i=1),o&&Number.isFinite(o)||(o=1),{x:i,y:o}}const Hy=Wv(0);function Gy(e){const t=gy(e);return Ry()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Hy}function $y(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const a=e.getBoundingClientRect(),s=Wy(e);let i=Wv(1);t&&(n?yy(n)&&(i=Vy(n)):i=Vy(e));const o=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==gy(e))&&t}(s,r,n)?Gy(s):Wv(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=gy(s),t=n&&yy(n)?gy(n):n;let r=e,a=Fy(r);for(;a&&n&&t!==r;){const e=Vy(a),t=a.getBoundingClientRect(),n=Uy(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=gy(a),a=Fy(r)}}return cy({width:u,height:d,x:c,y:l})}function Ky(e,t){const r=My(e).scrollLeft;return t?t.left+r:$y(by(e)).left+r}function qy(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-Ky(e,r),y:r.top+t.scrollTop}}const Zy=new Set(["absolute","fixed"]);function Jy(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=gy(e),n=by(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=Ry();(!e||e&&"fixed"===t)&&(o=a.offsetLeft,c=a.offsetTop)}const l=Ky(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=by(e),r=My(e),n=e.ownerDocument.body,a=zv(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=zv(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Ky(e);const o=-r.scrollTop;return"rtl"===Uy(n).direction&&(i+=zv(t.clientWidth,n.clientWidth)-a),{width:a,height:s,x:i,y:o}}(by(e));else if(yy(t))n=function(e,t){const r=$y(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,s=xy(e)?Vy(e):Wv(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=Gy(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return cy(n)}function Yy(e,t){const r=Ly(e);return!(r===t||!yy(r)||Iy(r))&&("fixed"===Uy(r).position||Yy(r,t))}function Xy(e,t,r){const n=xy(t),a=by(t),s="fixed"===r,i=$y(e,!0,s,t);let o={scrollLeft:0,scrollTop:0};const c=Wv(0);function l(){c.x=Ky(a)}if(n||!n&&!s)if(("body"!==fy(t)||ky(a))&&(o=My(t)),n){const e=$y(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?Wv(0):qy(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 Qy(e){return"static"===Uy(e).position}function ex(e,t){if(!xy(e)||"fixed"===Uy(e).position)return null;if(t)return t(e);let r=e.offsetParent;return by(e)===r&&(r=r.ownerDocument.body),r}function tx(e,t){const r=gy(e);if(Ay(e))return r;if(!xy(e)){let t=Ly(e);for(;t&&!Iy(t);){if(yy(t)&&!Qy(t))return t;t=Ly(t)}return r}let n=ex(e,t);for(;n&&Cy(n)&&Qy(n);)n=ex(n,t);return n&&Iy(n)&&Qy(n)&&!Ty(n)?r:n||function(e){let t=Ly(e);for(;xy(t)&&!Iy(t);){if(Ty(t))return t;if(Ay(t))return null;t=Ly(t)}return null}(e)||r}const rx={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const s="fixed"===a,i=by(n),o=!!t&&Ay(t.floating);if(n===i||o&&s)return r;let c={scrollLeft:0,scrollTop:0},l=Wv(1);const u=Wv(0),d=xy(n);if((d||!d&&!s)&&(("body"!==fy(n)||ky(i))&&(c=My(n)),xy(n))){const e=$y(n);l=Vy(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}const p=!i||d||s?Wv(0):qy(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:by,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const s=[..."clippingAncestors"===r?Ay(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=zy(e,[],!1).filter(e=>yy(e)&&"body"!==fy(e)),a=null;const s="fixed"===Uy(e).position;let i=s?Ly(e):e;for(;yy(i)&&!Iy(i);){const t=Uy(i),r=Ty(i);r||"fixed"!==t.position||(a=null),(s?!r&&!a:!r&&"static"===t.position&&a&&Zy.has(a.position)||ky(i)&&!r&&Yy(e,i))?n=n.filter(e=>e!==i):a=t,i=Ly(i)}return t.set(e,n),n}(t,this._c):[].concat(r),n],i=s[0],o=s.reduce((e,r)=>{const n=Jy(t,r,a);return e.top=zv(n.top,e.top),e.right=Ov(n.right,e.right),e.bottom=Ov(n.bottom,e.bottom),e.left=zv(n.left,e.left),e},Jy(t,i,a));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:tx,getElementRects:async function(e){const t=this.getOffsetParent||tx,r=this.getDimensions,n=await r(e.floating);return{reference:Xy(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}=By(e);return{width:t,height:r}},getScale:Vy,isElement:yy,isRTL:function(e){return"rtl"===Uy(e).direction}};function nx(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ax(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=Wy(e),u=a||s?[...l?zy(l):[],...zy(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=by(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:-Bv(d)+"px "+-Bv(a.clientWidth-(u+p))+"px "+-Bv(a.clientHeight-(d+m))+"px "+-Bv(u)+"px",threshold:zv(0,Ov(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||nx(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?$y(e):null;return c&&function t(){const n=$y(e);f&&!nx(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 sx=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=Kv(r),o=qv(r),c="y"===Xv(r),l=my.has(i)?-1:1,u=s&&c?-1:1,d=$v(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}}}}},ix=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}=$v(e,t),u={x:r,y:n},d=await s.detectOverflow(t,l),p=Xv(Kv(a)),m=Zv(p);let h=u[m],f=u[p];if(i){const e="y"===m?"bottom":"right";h=Gv(h+d["y"===m?"top":"left"],h,h-d[e])}if(o){const e="y"===p?"bottom":"right";f=Gv(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}}}}}},ox=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}=$v(e,t);if(null!=(r=s.arrow)&&r.alignmentOffset)return{};const b=Kv(a),v=Xv(o),y=Kv(o)===o,x=await(null==c.isRTL?void 0:c.isRTL(l.floating)),w=p||(y||!f?[iy(o)]:function(e){const t=iy(e);return[ey(e),t,ey(t)]}(o)),S="none"!==h;!p&&S&&w.push(...sy(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=qv(e),a=Qv(e),s=Jv(a);let i="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=iy(i)),[i,iy(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!==Xv(t))||N.every(e=>Xv(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=Xv(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{}}}},cx=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}=$v(e,t),u=await i.detectOverflow(t,l),d=Kv(a),p=qv(a),m="y"===Xv(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=Ov(f-u[g],v),w=Ov(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=zv(u.left,0),t=zv(u.right,0),r=zv(u.top,0),n=zv(u.bottom,0);m?E=h-2*(0!==e||0!==t?e+t:zv(u.left,u.right)):k=f-2*(0!==r||0!==n?r+n:zv(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}}:{}}}},lx=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:a="referenceHidden",...s}=$v(e,t);switch(a){case"referenceHidden":{const e=dy(await n.detectOverflow(t,{...s,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:py(e)}}}case"escaped":{const e=dy(await n.detectOverflow(t,{...s,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:py(e)}}}default:return{}}}}},ux=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}=$v(e,t)||{};if(null==l)return{};const d=oy(u),p={x:r,y:n},m=Qv(a),h=Jv(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=Ov(d[b],C),A=Ov(d[v],C),_=N,j=k-f[h]-A,P=k/2-f[h]/2+E,T=Gv(_,P,j),R=!c.arrow&&null!=qv(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}}}),dx=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}=$v(e,t),u={x:r,y:n},d=Xv(a),p=Zv(d);let m=u[p],h=u[d];const f=$v(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=my.has(Kv(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}}}},px=(e,t,r)=>{const n=new Map,a={platform:rx,...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}=ly(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:uy},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}=ly(l,p,c))),r=-1)}return{x:u,y:d,placement:p,strategy:a,middlewareData:m}})(e,t,{...a,platform:s})};var mx="undefined"!=typeof document?t.useLayoutEffect:function(){};function hx(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(!hx(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)&&!hx(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function fx(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gx(e,t){const r=fx(e);return Math.round(t*r)/r}function bx(e){const t=a.useRef(e);return mx(()=>{t.current=e}),t}const vx=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?ux({element:r.current,padding:n}).fn(t):{}:r?ux({element:r,padding:n}).fn(t):{};var a}}),yx=(e,t)=>({...sx(e),options:[e,t]}),xx=(e,t)=>({...ix(e),options:[e,t]}),wx=(e,t)=>({...dx(e),options:[e,t]}),Sx=(e,t)=>({...ox(e),options:[e,t]}),kx=(e,t)=>({...cx(e),options:[e,t]}),Ex=(e,t)=>({...lx(e),options:[e,t]}),Cx=(e,t)=>({...vx(e),options:[e,t]});var Nx=a.forwardRef((t,r)=>{const{children:n,width:a=10,height:s=5,...i}=t;return e.jsx(Us.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"})})});Nx.displayName="Arrow";var Ax=Nx,_x="Popper",[jx,Px]=Es(_x),[Tx,Rx]=jx(_x),Dx=t=>{const{__scopePopper:r,children:n}=t,[s,i]=a.useState(null);return e.jsx(Tx,{scope:r,anchor:s,onAnchorChange:i,children:n})};Dx.displayName=_x;var Ix="PopperAnchor",Ux=a.forwardRef((t,r)=>{const{__scopePopper:n,virtualRef:s,...i}=t,o=Rx(Ix,n),c=a.useRef(null),l=ls(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(Us.div,{...i,ref:l})});Ux.displayName=Ix;var Mx="PopperContent",[Lx,Ox]=jx(Mx),zx=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=Rx(Mx,n),[x,w]=a.useState(null),S=ls(r,e=>w(e)),[k,E]=a.useState(null),C=kl(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(Vx),altBoundary:T},{refs:D,floatingStyles:I,placement:U,isPositioned:M,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:u,open:d}=e,[p,m]=a.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=a.useState(n);hx(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,_=bx(u),j=bx(i),P=bx(d),T=a.useCallback(()=>{if(!E.current||!C.current)return;const e={placement:t,strategy:r,middleware:h};j.current&&(e.platform=j.current),px(E.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};R.current&&!hx(N.current,t)&&(N.current=t,s.flushSync(()=>{m(t)}))})},[h,t,r,j,P]);mx(()=>{!1===d&&N.current.isPositioned&&(N.current.isPositioned=!1,m(e=>({...e,isPositioned:!1})))},[d]);const R=a.useRef(!1);mx(()=>(R.current=!0,()=>{R.current=!1}),[]),mx(()=>{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=gx(I.floating,p.x),n=gx(I.floating,p.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...fx(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)=>ax(...e,{animationFrame:"always"===g}),elements:{reference:y.anchor},middleware:[yx({mainAxis:o+A,alignmentAxis:l}),d&&xx({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?wx():void 0,...R}),d&&Sx({...R}),kx({...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&&Cx({element:k,padding:u}),Hx({arrowWidth:N,arrowHeight:A}),f&&Ex({strategy:"referenceHidden",...R})]}),[O,z]=Gx(U),F=Ms(b);Ns(()=>{M&&F?.()},[M,F]);const B=L.arrow?.x,W=L.arrow?.y,V=0!==L.arrow?.centerOffset,[H,G]=a.useState();return Ns(()=>{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":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:e.jsx(Lx,{scope:n,placedSide:O,onArrowChange:E,arrowX:B,arrowY:W,shouldHideArrow:V,children:e.jsx(Us.div,{"data-side":O,"data-align":z,...v,ref:S,style:{...v.style,animation:M?void 0:"none"}})})})});zx.displayName=Mx;var Fx="PopperArrow",Bx={top:"bottom",right:"left",bottom:"top",left:"right"},Wx=a.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,s=Ox(Fx,n),i=Bx[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(Ax,{...a,ref:r,style:{...a.style,display:"block"}})})});function Vx(e){return null!==e}Wx.displayName=Fx;var Hx=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]=Gx(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 Gx(e){const[t,r="center"]=e.split("-");return[t,r]}var $x=Dx,Kx=Ux,qx=zx,Zx=Wx;function Jx(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?cs(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 Yx=Symbol("radix.slottable");function Xx(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Yx}var Qx="Popover",[ew]=Es(Qx,[Px]),tw=Px(),[rw,nw]=ew(Qx),aw=t=>{const{__scopePopover:r,children:n,open:s,defaultOpen:i,onOpenChange:o,modal:c=!1}=t,l=tw(r),u=a.useRef(null),[d,p]=a.useState(!1),[m,h]=Ts({prop:s,defaultProp:i??!1,onChange:o,caller:Qx});return e.jsx($x,{...l,children:e.jsx(rw,{scope:r,contentId:js(),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})})};aw.displayName=Qx;var sw="PopoverAnchor";a.forwardRef((t,r)=>{const{__scopePopover:n,...s}=t,i=nw(sw,n),o=tw(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=i;return a.useEffect(()=>(c(),()=>l()),[c,l]),e.jsx(Kx,{...o,...s,ref:r})}).displayName=sw;var iw="PopoverTrigger",ow=a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=nw(iw,n),i=tw(n),o=ls(r,s.triggerRef),c=e.jsx(Us.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":yw(s.open),...a,ref:o,onClick:ks(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:e.jsx(Kx,{asChild:!0,...i,children:c})});ow.displayName=iw;var cw="PopoverPortal",[lw,uw]=ew(cw,{forceMount:void 0}),dw=t=>{const{__scopePopover:r,forceMount:n,children:a,container:s}=t,i=nw(cw,r);return e.jsx(lw,{scope:r,forceMount:n,children:e.jsx(ri,{present:n||i.open,children:e.jsx(ti,{asChild:!0,container:s,children:a})})})};dw.displayName=cw;var pw="PopoverContent",mw=a.forwardRef((t,r)=>{const n=uw(pw,t.__scopePopover),{forceMount:a=n.forceMount,...s}=t,i=nw(pw,t.__scopePopover);return e.jsx(ri,{present:a||i.open,children:i.modal?e.jsx(fw,{...s,ref:r}):e.jsx(gw,{...s,ref:r})})});mw.displayName=pw;var hw=function(t){const r=Jx(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(Xx);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"),fw=a.forwardRef((t,r)=>{const n=nw(pw,t.__scopePopover),s=a.useRef(null),i=ls(r,s),o=a.useRef(!1);return a.useEffect(()=>{const e=s.current;if(e)return eo(e)},[]),e.jsx(Ki,{as:hw,allowPinchZoom:!0,children:e.jsx(bw,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ks(t.onCloseAutoFocus,e=>{e.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:ks(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:ks(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),gw=a.forwardRef((t,r)=>{const n=nw(pw,t.__scopePopover),s=a.useRef(!1),i=a.useRef(!1);return e.jsx(bw,{...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()}})}),bw=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=nw(pw,n),h=tw(n);return si(),e.jsx(qs,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:i,children:e.jsx(Ws,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:e.jsx(qx,{"data-state":yw(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)"}})})})}),vw="PopoverClose";a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=nw(vw,n);return e.jsx(Us.button,{type:"button",...a,ref:r,onClick:ks(t.onClick,()=>s.onOpenChange(!1))})}).displayName=vw;function yw(e){return e?"open":"closed"}a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=tw(n);return e.jsx(Zx,{...s,...a,ref:r})}).displayName="PopoverArrow";var xw=dw,ww=mw;const Sw=aw,kw=ow,Ew=a.forwardRef(({className:t,align:r="center",sideOffset:n=4,...s},i)=>{const{container:o}=a.useContext(tc);return e.jsx(xw,{container:o,children:e.jsx(ww,{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 Cw({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(Sw,{open:l,onOpenChange:u,children:[e.jsx(kw,{asChild:!0,children:e.jsxs(Ss,{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(Oa,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(Ew,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(Rv,{children:[e.jsx(Dv,{placeholder:s}),e.jsx(Iv,{children:e.jsx(Uv,{children:r.map(t=>e.jsxs(Mv,{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(La,{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))})})]})})]})}Ew.displayName=ww.displayName;const Nw={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"},Aw={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"},_w=[{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=Aw[e.code]||"USD",r=Nw[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 jw({value:t,onChange:r}){const{t:n}=nn(),a=_w.map(e=>({value:e.value,label:e.text,icon:e.flag}));return e.jsx(Cw,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchCountry"),emptyLabel:n("dropdowns.chooseCountry")})}const Pw=_w.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),Tw=Array.from(new Set(Pw.map(e=>e.value))).map(e=>Pw.find(t=>t.value===e)).filter(e=>void 0!==e);function Rw({value:t,onChange:r}){const{t:n}=nn(),a=Tw.map(e=>({value:e.value,label:e.text,icon:e.icon??void 0}));return e.jsx(Cw,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchCurrency"),emptyLabel:n("dropdowns.chooseCurrency")})}let Dw=[{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:"🇮🇱"}];Dw=Dw.filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)),Dw.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const Iw=Dw.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 Uw({value:t,onChange:r}){const{t:n}=nn(),a=Iw.map(e=>({value:e.value,label:e.label,icon:e.flag}));return e.jsx(Cw,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchLanguage"),emptyLabel:n("dropdowns.chooseLanguage")})}const Mw=[{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 Lw({value:t,onChange:r}){const{t:n}=nn(),a=Mw.map(e=>({value:e.value,label:e.text}));return e.jsx(Cw,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchTimezone"),emptyLabel:n("dropdowns.chooseTimezone")})}const Ow=({workspace:r})=>{const{t:n}=nn(),{updateUserProfile:a,getProfile:s}=Ik(),[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=cd({resolver:gh(ff({name:Bh().min(2,{message:n("profile.nameMinLength")}),country:Bh().optional(),timezone:Bh().optional(),language:Bh().optional(),currency:Bh().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(Wf,{...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(Xf,{disabled:!0,className:"w-full border rounded px-3 py-2 bg-gray-100",value:c?.email})]}),e.jsx(Hf,{disabled:i,control:f.control,name:"name",render:({field:t})=>e.jsxs(Kf,{children:[e.jsx(qf,{children:n("profile.name")}),e.jsx(Zf,{children:e.jsx(Xf,{...t})}),e.jsx(Yf,{})]})}),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(Uw,{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(jw,{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(Rw,{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(Lw,{value:f.watch("timezone"),onChange:e=>{f.setValue("timezone",e)}})]})]}),e.jsxs("div",{className:"flex justify-end gap-x-2",children:[e.jsx(Ss,{type:"submit",progress:i,disabled:i,children:n("profile.save")}),e.jsx(Ss,{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(xl,{})};function zw(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 Fw(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??Mf(a??"")}${c.toFixed(2)}`}else{u=`${r.currencySymbol??Mf(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 Bw="bb";function Ww(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(Bw,function(e){return Object.entries(e).filter(([,e])=>null!=e&&""!==e).map(([e,t])=>`${encodeURIComponent(e)}:${encodeURIComponent(t)}`).join(",")}(e)),r.toString()}function Vw(){if("undefined"==typeof window)return null;try{const e=new URLSearchParams(window.location.search).get(Bw);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 Hw(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.has(Bw)&&(e.searchParams.delete(Bw),window.history.replaceState({},"",e.toString()))}catch{}}const Gw="personal",$w=(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)},Kw=(e,t="en-US")=>e?new Date(1e3*e).toLocaleDateString(t,{year:"numeric",month:"short",day:"numeric"}):"",qw=e=>{switch(e){case Yn:return"bg-green-100 text-green-800";case Jn:return"bg-yellow-100 text-yellow-800";case Zn:return"bg-gray-100 text-gray-800";case Xn:return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}},Zw=({workspaceId:t,hasActiveSubscription:r=!1,onViewPricingPlans:n,limit:a=20})=>{const{t:s,formattingLocale:i}=nn(),{invoices:o,loading:c,error:l,refetch:u}=Rn(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(Ss,{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(Ss,{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(xl,{})}):d?e.jsx("div",{className:"space-y-2",children:o.map(t=>{const r=(e=>{switch(e.status){case Zn:case Jn:return{textKey:"invoices.pay",color:"bg-blue-600 hover:bg-blue-700"};case Yn:return{textKey:"invoices.view",color:"bg-green-600 hover:bg-green-700"};case Xn:case Qn: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 ${qw(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:$w(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:Kw(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:$w(t.amount_paid,t.currency,i)})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(Ss,{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(Ba,{className:"h-3 w-3 ms-1.5"})]}),t.invoice_pdf&&e.jsxs(Ss,{size:"sm",variant:"outline",onClick:()=>window.open(t.invoice_pdf,"_blank","noopener,noreferrer"),children:[e.jsx(Fa,{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(Wa,{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(Ss,{size:"sm",className:"mt-4",onClick:n,children:s("subscription.viewPricingPlans")})]})]})},Jw=t.lazy(()=>Promise.resolve().then(function(){return fC}).then(e=>({default:e.default}))),Yw=(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""}},Xw=({workspace:r})=>{const n=r._id?.toString(),{t:a,formattingLocale:s,fmtNum:i,fmtCents:o}=nn(),{api:c}=kn(),{can:l}=vl(),{settings:u}=Sn(),d=l(rl.WORKSPACE_BILLING_VIEW),p=l(rl.WORKSPACE_BILLING_MANAGE),m=u?.workspace?.mode===Gw,{subscription:h,loading:f,error:g,updateSubscription:b,refetch:v}=Tn(n),{createCheckoutSession:y}=jn(n),{cancelSubscription:x,loading:w}=In(n),{resumeSubscription:S,loading:k}=Un(n),{openBillingPortal:E,loading:C}=Dn(n),{versions:N,loading:A,error:_,refetch:j}=_n(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,L]=t.useState(!1),[O,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=Dk.getState(),t="selectPlan"===e.params?.action;h?.subscription&&!t||(q.current=!0,t&&(K.current=e.params,Dk.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(()=>ua(h?.subscription?.stripePriceId,U??[]),[h?.subscription?.stripePriceId,U]),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(xl,{});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(Ss,{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(Ss,{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(Ss,{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(Ha,{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(as,{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(Ss,{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===$n,r=h?.subscription?.cancelAtPeriodEnd;return r||w?null:t&&U&&U.length>0?e.jsx(Ss,{size:"sm",onClick:()=>H(!0),children:a("subscription.viewPricingPlans")}):h?.subscription&&!t&&p?e.jsx(Ss,{variant:"outline",size:"sm",onClick:()=>H(!0),children:a("subscription.changePlanButton")}):!h?.subscription&&U&&U.length>0?e.jsx(Ss,{size:"sm",onClick:()=>H(!0),children:a("subscription.viewPricingPlans")}):null})(),e.jsx(Ss,{variant:"ghost",size:"sm",progress:P,onClick:Q,disabled:P||M,children:a("settings.common.refreshAction",{loading:String(P)})})]})]}),h?.subscription?(()=>{const t=ua(h.subscription.stripePriceId,U??[]),n=t?.interval??null,c=t?.currency??h.plan?.currency??r?.billingCurrency??"",l=n&&h.planVersion?oa(h.planVersion,c,n):null,u=c,d=h.planVersion?da(h.planVersion,c):null,f=d&&n?pa(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===Vn.Monthly?a("subscription.billingInterval.perMonth"):n===Vn.Quarterly?a("subscription.billingInterval.perQuarter"):n===Vn.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===Gn&&!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(Ss,{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===Hn?h.subscription.cancelAtPeriodEnd?"bg-amber-100 text-amber-800":"bg-green-100 text-green-800":h.subscription.subscriptionStatus===Gn?"bg-blue-100 text-blue-800":h.subscription.subscriptionStatus===$n?"bg-gray-100 text-gray-800":"bg-red-100 text-red-800"),children:[h.subscription.subscriptionStatus===Hn&&(h.subscription.cancelAtPeriodEnd?a("subscription.status.canceling"):a("subscription.status.active")),h.subscription.subscriptionStatus===Gn&&a("subscription.status.trial"),h.subscription.subscriptionStatus===$n&&a("subscription.status.canceled"),h.subscription.subscriptionStatus===Kn&&a("subscription.status.pastDue")]}),h.subscription.subscriptionStatus===Gn&&Yw(s,h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd)&&e.jsxs("span",{className:"text-xs text-gray-500",children:["(ends"," ",Yw(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(as,{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===Hn||h.subscription.subscriptionStatus===Gn)&&!h.subscription.cancelAtPeriodEnd&&Yw(s,h.subscription.stripeCurrentPeriodEnd)&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[e.jsx(Ua,{className:"h-3.5 w-3.5 flex-shrink-0"}),e.jsx("span",{children:a("subscription.nextBillingDisplay",{date:Yw(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===Hn||h.subscription.subscriptionStatus===Gn||h.subscription.subscriptionStatus===Kn)&&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(Ss,{variant:"outline",size:"sm",onClick:()=>E(),disabled:C,progress:C,children:a(C?"subscription.openingPortal":"subscription.managePayment")}),p&&h.subscription.subscriptionId&&(h.subscription.subscriptionStatus===Hn||h.subscription.subscriptionStatus===Gn)&&e.jsx(e.Fragment,{children:h.subscription.cancelAtPeriodEnd?e.jsx(Ss,{variant:"outline",size:"sm",onClick:()=>J(!0),disabled:M||w||k,progress:k,children:h.subscription.subscriptionStatus===Gn?a("subscription.resumeTrial"):a("subscription.resumeTitle")}):e.jsx(Ss,{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===Gn?a("subscription.cancelTrial"):a("subscription.cancelTitle")})})]})]}),h.subscription.subscriptionStatus===Kn&&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(as,{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(Ss,{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===Kn&&h.subscription.dunningState&&h.subscription.dunningState!==na&&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(as,{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===aa?a("subscription.dunningFinal"):h.subscription.dunningState===sa?a("subscription.dunningSuspended"):a("subscription.dunningRecovery")}),e.jsx("p",{className:"text-sm text-red-700 mt-0.5",children:h.subscription.dunningState===sa?a("subscription.dunningSuspendedDescription"):a("subscription.dunningRecoveryDescription")})]})]})}),h.subscription.subscriptionStatus===qn&&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(Ua,{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(Ua,{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===Gn?a("subscription.scheduledTrialCancellation"):a("subscription.scheduledCancellation")}),e.jsx("p",{className:"text-sm text-amber-700 mt-0.5",children:Yw(s,h.subscription.subscriptionStatus===Gn&&h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd)?e.jsxs(e.Fragment,{children:[h.subscription.subscriptionStatus===Gn?a("subscription.trialEndDescription"):a("subscription.cancelEndDescription")," ",e.jsx("span",{className:"font-medium",children:Yw(s,h.subscription.subscriptionStatus===Gn&&h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd)}),"."]}):a("subscription.cancelEndFallback")})]})]})}),h.planVersion&&(()=>{const t=((e,t,r=Vn.Monthly)=>{if(!e?.subscriptionItems)return{features:[],limits:[],quotas:[]};const n=[],a=[],s=[];return e.subscriptionItems.forEach(i=>{const o=i.slug;if(i.type===ea){const t=e.features?.[o]??!1;n.push({item:i,enabled:t})}else if(i.type===ta){const t=e.limits?.[o]??0;a.push({item:i,value:t})}else if(i.type===ra){const n=t&&e.pricingVariants?.length?la(e,t,o,r):zw(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: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=Fw(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(za,{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(Ss,{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(Ss,{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(Ha,{className:"h-4 w-4 animate-spin flex-shrink-0"}),e.jsx("span",{children:a("settings.common.loading")})]}),e.jsx(Zw,{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(Ha,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{children:a("settings.common.loading")})]})}):null,children:e.jsx(Jw,{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=Vn.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=ia(e,t);if(!n?.stripePrices)return null;const a=r===Vn.Monthly?"monthlyPriceId":r===Vn.Yearly?"yearlyPriceId":"quarterlyPriceId",s=r===Vn.Monthly?"monthly":r===Vn.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){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:Ww({action:"checkout",status:"success",ws:e,screen:"subscription"},t),cancelUrl:Ww({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),Rt(),await Q(),void B(a("subscription.updateSuccess")))}const u=h?.subscription?.subscriptionStatus===$n;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 ll(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:M||P})}),e.jsx(Oc,{open:Z,onOpenChange:J,children:e.jsxs(Wc,{children:[e.jsxs(Vc,{children:[e.jsx(Gc,{children:a("subscription.resumeTitle")}),e.jsx($c,{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(as,{className:"h-4 w-4 text-amber-600 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[a("subscription.resumeChargeDate")," ",h?.subscription?.stripeCurrentPeriodEnd&&Yw(s,h.subscription.stripeCurrentPeriodEnd)?e.jsx("span",{className:"font-medium",children:Yw(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(Hc,{children:[e.jsx(qc,{disabled:k,children:a("subscription.resumeKeep")}),e.jsx(Kc,{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===Gn,r=t&&h?.subscription?.trialEnd||h?.subscription?.stripeCurrentPeriodEnd;return e.jsx(Oc,{open:G,onOpenChange:$,children:e.jsxs(Wc,{children:[e.jsxs(Vc,{children:[e.jsx(Gc,{children:a(t?"subscription.cancelTrialTitle":"subscription.cancelTitle")}),e.jsx($c,{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&&Yw(s,r)?e.jsx("span",{className:"font-medium",children:Yw(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(Hc,{children:[e.jsx(qc,{disabled:w,children:a(t?"subscription.cancelTrialKeep":"subscription.cancelKeep")}),e.jsx(Kc,{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 Qw(e){return e.replace(/[_-]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function eS(e,t,r){return t+e.toLocaleString(r,{minimumFractionDigits:2,maximumFractionDigits:2})}function tS(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 rS=()=>{const{quotas:r,loading:n,error:a,refetch:s}=Ok(),{t:i,formattingLocale:o,fmtNum:c}=nn(),{can:l}=vl(),u=(e,t)=>eS(e,t,o),{response:d}=zn(),[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=Mf(s);if(!r)return e;for(const n of Object.keys(r)){const o=ca(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:tS(e)}:null},[d,o]),g=async()=>{m(!0);try{await s()}finally{m(!1)}};if(n&&!r)return e.jsx(xl,{});if(!l(rl.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(Ss,{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(Ma,{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(Ss,{variant:"ghost",size:"sm",onClick:g,disabled:p,children:[e.jsx(qa,{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(Ua,{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(as,{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(nS,{slug:t,quota:r,percent:n,colors:i,pricing:o},t)})})]})};function nS({slug:t,quota:r,percent:n,colors:a,pricing:s}){const{t:i,formattingLocale:o}=nn(),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)=>eS(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:Qw(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:Math.ceil(r.overage/s.unitSize).toLocaleString(o)})]}),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 aS(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?cs(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 sS=Symbol("radix.slottable");function iS(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===sS}var oS=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(Us.span,{...t,ref:r,style:{...oS,...t.style}})).displayName="VisuallyHidden";var cS=[" ","Enter","ArrowUp","ArrowDown"],lS=[" ","Enter"],uS="Select",[dS,pS,mS]=ng(uS),[hS]=Es(uS,[mS,Px]),fS=Px(),[gS,bS]=hS(uS),[vS,yS]=hS(uS),xS=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=fS(r),[v,y]=a.useState(null),[x,w]=a.useState(null),[S,k]=a.useState(!1),E=sg(d),[C,N]=Ts({prop:s,defaultProp:i??!1,onChange:o,caller:uS}),[A,_]=Ts({prop:c,defaultProp:l,onChange:u,caller:uS}),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($x,{...b,children:e.jsxs(gS,{required:f,scope:r,trigger:v,onTriggerChange:y,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:k,contentId:js(),value:A,onValueChange:_,open:C,onOpenChange:N,dir:E,triggerPointerDownPosRef:j,disabled:h,children:[e.jsx(dS.Provider,{scope:r,children:e.jsx(vS,{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(ak,{"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]})})};xS.displayName=uS;var wS="SelectTrigger",SS=a.forwardRef((t,r)=>{const{__scopeSelect:n,disabled:s=!1,...i}=t,o=fS(n),c=bS(wS,n),l=c.disabled||s,u=ls(r,c.onTriggerChange),d=pS(n),p=a.useRef("touch"),[m,h,f]=ik(e=>{const t=d().filter(e=>!e.disabled),r=t.find(e=>e.value===c.value),n=ok(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(Kx,{asChild:!0,...o,children:e.jsx(Us.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":sk(c.value)?"":void 0,...i,ref:u,onClick:ks(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:ks(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:ks(i.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||cS.includes(e.key)&&(g(),e.preventDefault())})})})});SS.displayName=wS;var kS="SelectValue",ES=a.forwardRef((t,r)=>{const{__scopeSelect:n,className:a,style:s,children:i,placeholder:o="",...c}=t,l=bS(kS,n),{onValueNodeHasChildrenChange:u}=l,d=void 0!==i,p=ls(r,l.onValueNodeChange);return Ns(()=>{u(d)},[u,d]),e.jsx(Us.span,{...c,ref:p,style:{pointerEvents:"none"},children:sk(l.value)?e.jsx(e.Fragment,{children:o}):i})});ES.displayName=kS;var CS=a.forwardRef((t,r)=>{const{__scopeSelect:n,children:a,...s}=t;return e.jsx(Us.span,{"aria-hidden":!0,...s,ref:r,children:a||"▼"})});CS.displayName="SelectIcon";var NS=t=>e.jsx(ti,{asChild:!0,...t});NS.displayName="SelectPortal";var AS="SelectContent",_S=a.forwardRef((t,r)=>{const n=bS(AS,t.__scopeSelect),[i,o]=a.useState();if(Ns(()=>{o(new DocumentFragment)},[]),!n.open){const r=i;return r?s.createPortal(e.jsx(PS,{scope:t.__scopeSelect,children:e.jsx(dS.Slot,{scope:t.__scopeSelect,children:e.jsx("div",{children:t.children})})}),r):null}return e.jsx(DS,{...t,ref:r})});_S.displayName=AS;var jS=10,[PS,TS]=hS(AS),RS=function(t){const r=aS(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(iS);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"),DS=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=bS(AS,n),[w,S]=a.useState(null),[k,E]=a.useState(null),C=ls(r,e=>S(e)),[N,A]=a.useState(null),[_,j]=a.useState(null),P=pS(n),[T,R]=a.useState(!1),D=a.useRef(!1);a.useEffect(()=>{if(w)return eo(w)},[w]),si();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: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)||M(!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,M,L]),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[O,z]=ik(e=>{const t=P().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=ok(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?US:IS,H=V===US?{side:l,sideOffset:u,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:b,avoidCollisions:v}:{};return e.jsx(PS,{scope:n,content:w,viewport:k,onViewportChange:E,itemRefCallback:F,selectedItem:N,onItemLeave:B,itemTextRefCallback:W,focusSelectedItem:U,selectedItemText:_,position:s,isPositioned:T,searchRef:O,children:e.jsx(Ki,{as:RS,allowPinchZoom:!0,children:e.jsx(qs,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:ks(i,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:e.jsx(Ws,{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:ks(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()}})})})})})})});DS.displayName="SelectContentImpl";var IS=a.forwardRef((t,r)=>{const{__scopeSelect:n,onPlaced:s,...i}=t,o=bS(AS,n),c=TS(AS,n),[l,u]=a.useState(null),[d,p]=a.useState(null),m=ls(r,e=>p(e)),h=pS(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-jS,d=Jg(s,[jS,Math.max(jS,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-jS,d=Jg(s,[jS,Math.max(jS,u-c)]);l.style.minWidth=o+"px",l.style.right=d+"px"}const a=h(),i=window.innerHeight-2*jS,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-jS,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=`${jS}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]);Ns(()=>w(),[w]);const[S,k]=a.useState();Ns(()=>{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(MS,{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(Us.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});IS.displayName="SelectItemAlignedPosition";var US=a.forwardRef((t,r)=>{const{__scopeSelect:n,align:a="start",collisionPadding:s=jS,...i}=t,o=fS(n);return e.jsx(qx,{...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)"}})});US.displayName="SelectPopperPosition";var[MS,LS]=hS(AS,{}),OS="SelectViewport",zS=a.forwardRef((t,r)=>{const{__scopeSelect:n,nonce:s,...i}=t,o=TS(OS,n),c=LS(OS,n),l=ls(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(dS.Slot,{scope:n,children:e.jsx(Us.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ks(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*jS,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})})})]})});zS.displayName=OS;var FS="SelectGroup",[BS,WS]=hS(FS);a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=js();return e.jsx(BS,{scope:n,id:s,children:e.jsx(Us.div,{role:"group","aria-labelledby":s,...a,ref:r})})}).displayName=FS;var VS="SelectLabel",HS=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=WS(VS,n);return e.jsx(Us.div,{id:s.id,...a,ref:r})});HS.displayName=VS;var GS="SelectItem",[$S,KS]=hS(GS),qS=a.forwardRef((t,r)=>{const{__scopeSelect:n,value:s,disabled:i=!1,textValue:o,...c}=t,l=bS(GS,n),u=TS(GS,n),d=l.value===s,[p,m]=a.useState(o??""),[h,f]=a.useState(!1),g=ls(r,e=>u.itemRefCallback?.(e,s,i)),b=js(),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($S,{scope:n,value:s,disabled:i,textId:b,isSelected:d,onItemTextChange:a.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:e.jsx(dS.ItemSlot,{scope:n,value:s,disabled:i,textValue:p,children:e.jsx(Us.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:ks(c.onFocus,()=>f(!0)),onBlur:ks(c.onBlur,()=>f(!1)),onClick:ks(c.onClick,()=>{"mouse"!==v.current&&y()}),onPointerUp:ks(c.onPointerUp,()=>{"mouse"===v.current&&y()}),onPointerDown:ks(c.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:ks(c.onPointerMove,e=>{v.current=e.pointerType,i?u.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ks(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:ks(c.onKeyDown,e=>{""!==u.searchRef?.current&&" "===e.key||(lS.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});qS.displayName=GS;var ZS="SelectItemText",JS=a.forwardRef((t,r)=>{const{__scopeSelect:n,className:i,style:o,...c}=t,l=bS(ZS,n),u=TS(ZS,n),d=KS(ZS,n),p=yS(ZS,n),[m,h]=a.useState(null),f=ls(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 Ns(()=>(v(b),()=>y(b)),[v,y,b]),e.jsxs(e.Fragment,{children:[e.jsx(Us.span,{id:d.textId,...c,ref:f}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?s.createPortal(c.children,l.valueNode):null]})});JS.displayName=ZS;var YS="SelectItemIndicator",XS=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return KS(YS,n).isSelected?e.jsx(Us.span,{"aria-hidden":!0,...a,ref:r}):null});XS.displayName=YS;var QS="SelectScrollUpButton";a.forwardRef((t,r)=>{const n=TS(QS,t.__scopeSelect),s=LS(QS,t.__scopeSelect),[i,o]=a.useState(!1),c=ls(r,s.onScrollButtonChange);return Ns(()=>{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(tk,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=QS;var ek="SelectScrollDownButton";a.forwardRef((t,r)=>{const n=TS(ek,t.__scopeSelect),s=LS(ek,t.__scopeSelect),[i,o]=a.useState(!1),c=ls(r,s.onScrollButtonChange);return Ns(()=>{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(tk,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=ek;var tk=a.forwardRef((t,r)=>{const{__scopeSelect:n,onAutoScroll:s,...i}=t,o=TS("SelectScrollButton",n),c=a.useRef(null),l=pS(n),u=a.useCallback(()=>{null!==c.current&&(window.clearInterval(c.current),c.current=null)},[]);return a.useEffect(()=>()=>u(),[u]),Ns(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),e.jsx(Us.div,{"aria-hidden":!0,...i,ref:r,style:{flexShrink:0,...i.style},onPointerDown:ks(i.onPointerDown,()=>{null===c.current&&(c.current=window.setInterval(s,50))}),onPointerMove:ks(i.onPointerMove,()=>{o.onItemLeave?.(),null===c.current&&(c.current=window.setInterval(s,50))}),onPointerLeave:ks(i.onPointerLeave,()=>{u()})})}),rk=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return e.jsx(Us.div,{"aria-hidden":!0,...a,ref:r})});rk.displayName="SelectSeparator";var nk="SelectArrow";a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=fS(n),i=bS(nk,n),o=TS(nk,n);return i.open&&"popper"===o.position?e.jsx(Zx,{...s,...a,ref:r}):null}).displayName=nk;var ak=a.forwardRef(({__scopeSelect:t,value:r,...n},s)=>{const i=a.useRef(null),o=ls(s,i),c=Sl(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(Us.select,{...n,style:{...oS,...n.style},ref:o,defaultValue:r})});function sk(e){return""===e||void 0===e}function ik(e){const t=Ms(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 ok(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}ak.displayName="SelectBubbleInput";var ck=SS,lk=CS,uk=NS,dk=_S,pk=zS,mk=HS,hk=qS,fk=JS,gk=XS,bk=rk;const vk=xS,yk=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(ck,{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(lk,{asChild:!0,children:e.jsx(qo,{className:"h-4 w-4 opacity-50"})})]}));yk.displayName=ck.displayName;const xk=a.forwardRef(({className:t,children:r,position:n="popper",...s},i)=>{const{container:o}=a.useContext(tc);return e.jsx(uk,{container:o,children:e.jsx(dk,{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(pk,{className:Se("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r})})})});xk.displayName=dk.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(mk,{ref:n,className:Se("px-2 py-1.5 text-sm font-semibold",t),...r})).displayName=mk.displayName;const wk=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(hk,{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(gk,{children:e.jsx(Jo,{className:"h-4 w-4"})})}),e.jsx(fk,{children:r})]}));wk.displayName=hk.displayName;function Sk(e,r){const{response:n}=zn();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: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?pa(a,i,s?.billingInterval??"monthly"):null,g=ha({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(bk,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",t),...r})).displayName=bk.displayName;const kk=({workspace:r})=>{const{user:n}=bl(),{t:a,fmtNum:s,fmtCents:i}=nn(),[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}=Ik(),{settings:v}=Sn(),{can:y}=vl(),{response:x}=zn(),w=Sk(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===Gw;if(l||!r)return e.jsx(xl,{});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(rl.WORKSPACE_MEMBERS_INVITE),A=y(rl.WORKSPACE_MEMBERS_REMOVE),_=y(rl.WORKSPACE_MEMBERS_ROLE_CHANGE),{hasSeatPricing:j,includedSeats:P,maxUsers:T,canInvite:R,inviteBlockReason:D,inviteBlockMessageKey:I,inviteBlockMessageValues:U,perSeatPriceCents:M,currency:L}=w,O=d.length,z=x?.subscription?.billingInterval??"monthly",F=j&&O>=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(Ek,{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,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,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 "+(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: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,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(Ss,{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(vk,{disabled:i||!_||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(yk,{children:e.jsx(ES,{placeholder:a("users.selectRole")})}),e.jsx(xk,{children:r?.roles.map(t=>e.jsx(wk,{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(Ha,{className:"h-4 w-4 animate-spin text-gray-500"})})]}),!i&&!o&&A&&e.jsx(Ss,{variant:"destructive",size:"sm",startIcon:e.jsx(ns,{}),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===d.length&&e.jsx("div",{className:"text-center py-8 text-gray-500",children:a("users.noMembers")})]})};function Ek({onInvite:r,workspaceId:n}){const{t:a}=nn(),{addUser:s,getWorkspace:i}=Ik(),{settings:o}=Sn(),[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(Bf,{children:a("users.inviteByEmail")}),e.jsx(Xf,{type:"email",value:c,onChange:e=>l(e.target.value),placeholder:"example@example.com"})]}),e.jsxs("div",{children:[e.jsx(Bf,{children:a("users.role")}),e.jsxs(vk,{value:u,onValueChange:d,children:[e.jsx(yk,{children:e.jsx(ES,{placeholder:a("users.selectRole")})}),e.jsx(xk,{children:w.map(t=>e.jsx(wk,{value:t,children:t},t))})]})]}),e.jsx("div",{children:e.jsx(Ss,{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 Ck=({workspace:t,section:r,setSection:n})=>{const{t:a}=nn(),{settings:s}=Sn(),{can:i}=vl(),{appPermissions:o}=Wn(),c=s?.workspace?.mode===Gw,l=i(rl.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(Nk,{title:a("settings.sidebar.account"),children:e.jsx(Ak,{activeSection:r,icon:e.jsx(ss,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.profile"),section:_k.Profile,onClick:()=>n(_k.Profile)})}),e.jsxs(Nk,{title:a("settings.sidebar.workspace"),children:[i(rl.WORKSPACE_SETTINGS_VIEW)&&e.jsx(Ak,{activeSection:r,icon:e.jsx(Ja,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.general"),section:_k.General,onClick:()=>n(_k.General)}),!c&&i(rl.WORKSPACE_MEMBERS_VIEW)&&e.jsx(Ak,{activeSection:r,icon:e.jsx(is,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.users"),section:_k.Users,onClick:()=>n(_k.Users)}),i(rl.WORKSPACE_BILLING_VIEW)&&e.jsx(Ak,{activeSection:r,icon:e.jsx(za,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.subscription"),section:_k.Subscription,onClick:()=>n(_k.Subscription)}),i(rl.WORKSPACE_USAGE_VIEW)&&e.jsx(Ak,{activeSection:r,icon:e.jsx(Ma,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.usage"),section:_k.Usage,onClick:()=>n(_k.Usage)}),i(rl.WORKSPACE_FEATURES_VIEW)&&e.jsx(Ak,{activeSection:r,icon:e.jsx(ts,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.features"),section:_k.Features,onClick:()=>n(_k.Features)}),e.jsx(Ak,{activeSection:r,icon:e.jsx(Da,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.notifications"),section:_k.Notifications,onClick:()=>n(_k.Notifications)}),u&&!c&&e.jsx(Ak,{activeSection:r,icon:e.jsx(Xa,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.permissions"),section:_k.Permissions,onClick:()=>n(_k.Permissions)}),l&&!c&&e.jsx(Ak,{activeSection:r,icon:e.jsx(as,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.danger"),section:_k.Danger,onClick:()=>n(_k.Danger)})]})]})};function Nk({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 Ak({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 _k={Profile:"profile",General:"general",Users:"users",Subscription:"subscription",Usage:"usage",Features:"features",Notifications:"notifications",Permissions:"permissions",Danger:"danger"},jk=new Set(Object.values(_k)),Pk={[_k.Profile]:"settings.titles.profile",[_k.General]:"settings.titles.general",[_k.Users]:"settings.titles.users",[_k.Subscription]:"settings.titles.subscription",[_k.Usage]:"settings.titles.usage",[_k.Features]:"settings.titles.features",[_k.Notifications]:"settings.titles.notifications",[_k.Permissions]:"settings.titles.permissions",[_k.Danger]:"settings.titles.danger"},Tk=({workspace:r,onClose:n,open:a,onOpenChange:s,defaultSection:i=_k.Profile,section:o,onSectionChange:c,showTrigger:l=!0,trigger:u})=>{const{t:d,dir:p}=nn(),[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(Ss,{variant:"outline",size:"icon",children:e.jsx(Ja,{className:"h-4 w-4"})});return e.jsxs(nc,{open:b,onOpenChange:e=>{v(e),!e&&n&&n()},children:[l&&e.jsx(ac,{asChild:!0,children:u||w}),e.jsxs(oc,{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(uc,{className:"sr-only",children:d(Pk[y])}),e.jsx(Ck,{workspace:r,section:y,setSection:x}),e.jsxs("div",{className:"flex-1 p-6 overflow-auto flex flex-col bg-background",children:[e.jsx(lc,{className:"text-xl font-bold mb-4",children:d(Pk[y])}),e.jsxs("div",{className:"sm:max-h-[500px] overflow-y-auto",children:[y===_k.Profile&&e.jsx(Ow,{workspace:r}),y===_k.General&&e.jsx(Lb,{workspace:r}),y===_k.Users&&e.jsx(kk,{workspace:r}),y===_k.Subscription&&e.jsx(Xw,{workspace:r}),y===_k.Usage&&e.jsx(rS,{}),y===_k.Features&&e.jsx(Ml,{workspaceId:r._id?.toString()}),y===_k.Notifications&&e.jsx(Hb,{workspace:r}),y===_k.Permissions&&e.jsx(Gb,{workspace:r}),y===_k.Danger&&e.jsx(wl,{workspace:r})]})]})]})]})};var Rk=Object.freeze({__proto__:null,SETTINGS_SCREENS:jk,SettingsScreen:_k,WorkspaceSettingsDialog:Tk,default:Tk});const Dk=new class{constructor(){this.listeners=new Set,this.currentState={open:!1,section:_k.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||_k.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)})}},Ik=()=>{const e=gn(),{os:r,api:n}=kn(),{settings:a}=Sn(),s=bn(e=>e.workspaces),i=bn(e=>e.auth.session?.user),o=t.useCallback((t,r)=>{if((!(t._id===s.currentWorkspace?._id)||r?.forceEmit)&&t){const r=s.currentWorkspace;Jc(t),e.workspaces(ft(t)),Ea.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=tl(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=Yc();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(()=>{Xc(),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=Yc();if(e&&Qc(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),Ea.emitWorkspaceCreated(a).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceCreated",metadata:{workspaceId:a._id}})}),setTimeout(()=>{Dk.openWorkspaceSettings(_k.Subscription)},300)},[n,e,c]),g=t.useCallback(async(t,r)=>{const a=await n.updateWorkspace(t._id,r);e.workspaces(pt(a)),Ea.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&&(Jc(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=ha({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&&Ea.emitWorkspaceUserAdded(o.userId,i,r).catch(t=>{Re(t,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserAdded",metadata:{workspaceId:e,userId:o.userId,role:r}})}),h().catch(()=>{}),Rt(),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;Ea.emitWorkspaceUserRemoved(i.userId,r,t).catch(r=>{Re(r,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRemoved",metadata:{workspaceId:e,userId:i.userId,role:t}})})}return h().catch(()=>{}),Rt(),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&&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&&Ea.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 Ea.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(!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&&(Xc(),e.workspaces(gt())),r&&Ea.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}},Uk=t.createContext(null);Uk.displayName="QuotaUsageContext";const Mk="useQuotaUsageContext must be used within QuotaUsageContextProvider. Make sure QuotaUsageContextProvider is wrapping your application (or the tree that uses quota gates).",Lk=t.memo(function({children:r}){const{currentWorkspace:n}=Ik(),{quotas:a,loading:s,error:i,refetch:o}=Mn(n?._id);t.useEffect(()=>{return e=o,jt.add(e),()=>{jt.delete(e)};var e},[o]);const c=t.useMemo(()=>({quotas:a,loading:s,error:i,refetch:o}),[a,s,i,o]);return e.jsx(Uk.Provider,{value:c,children:r})});function Ok(){const e=t.useContext(Uk);if(null===e)throw new Error(Mk);return e}Lk.displayName="QuotaUsageContextProvider";let zk=!1,Fk=null;const Bk=t.memo(({children:r,callbacks:n})=>{const a=gn(),s=gl(),i=xn(),o=Ve(s.status).isAuthenticated,c=t.useRef(!1),l=t.useRef(null);t.useEffect(()=>{o||(zk=!1,Fk=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 ol({serverUrl:s,version:o}),u=await l.getProfile(t),d=fl(hl(u,c,r.auth?.clientId||""),t);un(d.sessionId),a.auth(Oe(d)),function(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.delete(ln),window.history.replaceState({},"",e.toString())}catch(e){Re(e,{component:"auth-utils",action:"removeTokenFromUrl",metadata:{param:ln}})}}();const p=ml();p&&p!==window.location.href&&ll(p)}}catch(t){throw ml(),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(zk)return;if(Fk)return;if(!rt(i))return;if(pn())return;if(!n?.getSession)return zk=!0,void a.auth(Le());const e=n.getSession,{serverUrl:t,version:r,orgId:s}=i,c=i.auth?.clientId||"";Fk=(async()=>{let i=null;try{i=await e()}catch(e){Re(e,{component:"AuthProviderWrapper",action:"getSession"})}if(!i)return zk=!0,a.auth(Le()),"undefined"!=typeof window&&pl(window.location.href),void n?.onSessionExpired?.("missing");try{const e=new ol({serverUrl:t,version:r}),n=await e.getProfile(i),o=fl(hl(n,s,c),i);un(o.sessionId),zk=!0,a.auth(Oe(o));const l=ml();l&&l!==window.location.href&&ll(l)}catch(e){Re(e,{component:"AuthProviderWrapper",action:"fetchUserProfile"}),zk=!0,a.auth(Le()),"undefined"!=typeof window&&pl(window.location.href),n?.onSessionExpired?.("expired")}finally{Fk=null}})()},[o,a,i,n]),t.useEffect(()=>{const e=pn();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})});Bk.displayName="AuthProviderWrapper";const Wk=t.memo(({config:r,auth:n,children:a})=>{const s=gn(),i=xn(),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 yn(i):null,[i.serverUrl,i.version,i.orgId]);return vn(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})});Wk.displayName="ContextConfigProvider";class Vk extends hn{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 Hk=t.createContext(void 0),Gk=t.memo(({children:r})=>{const{t:n}=nn(),a=xn(),s=function(){const e=xn();return t.useMemo(()=>new Vk(e),[e.serverUrl,e.version])}(),{isAuthenticated:i}=bl(),{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]);vn(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(Hk.Provider,{value:k,children:r})});Gk.displayName="UserProvider";const $k=t.lazy(()=>Promise.resolve().then(function(){return Rk}).then(e=>({default:e.default})));const Kk=({children:r})=>{const{currentWorkspace:n,switchToWorkspace:a,workspaces:s}=Ik(),[i,o]=t.useState(!1),[c,l]=t.useState(_k.Profile),u=t.useRef(!1);return t.useEffect(()=>{const e=Dk.getState();o(e.open),l(e.section);return Dk.subscribe(e=>{o(e.open),l(e.section)})},[]),t.useEffect(()=>{if(u.current)return;if(!n)return;const e=Vw();if(!e)return;const t=function(e){if(e.screen&&jk.has(e.screen))return e.screen;switch(e.action){case"checkout":case"billing":case"selectPlan":return _k.Subscription;default:return null}}(e);if(!t)return u.current=!0,void Hw();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,Hw()}):(u.current=!0,void Hw())}u.current=!0,Dk.openWorkspaceSettings(t,e),Hw()},[n,s,a]),e.jsxs(e.Fragment,{children:[r,n&&i&&e.jsx(t.Suspense,{fallback:null,children:e.jsx($k,{workspace:n,open:i,onOpenChange:e=>{e||Dk.closeSettings()},section:c,onSectionChange:e=>{Dk.setSection(e)},showTrigger:!1})})]})},qk=(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).`)},Zk=t.memo(({serverUrl:r,version:n,orgId:a,auth:s,locale:i,defaultPermissions:o,children:c})=>{qk(r,n,a);const l=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]),d=s?.callbacks?.handleEvent;return t.useEffect(()=>(Ea.setCallbacks(d?{handleEvent:d}:null),()=>{Ea.setCallbacks(null)}),[d]),e.jsx(Jr,{locale:i,children:e.jsx(_t,{children:e.jsx(Bk,{callbacks:u,children:e.jsx(rc,{children:e.jsx(Wk,{config:l,auth:s,children:e.jsx(Bn,{appPermissions:o,children:e.jsx(Gk,{children:e.jsx(On,{children:e.jsx(Lk,{children:e.jsx(Bb,{children:e.jsx(Kk,{children:c})})})})})})})})})})})});Zk.displayName="SaaSOSProviderInner";const Jk=({children:t,...r})=>e.jsx(Ie,{children:e.jsx(Zk,{...r,children:t})});Jk.displayName="SaaSOSProvider";const Yk=e=>{const{children:t}=e,{status:r}=bl();return r!==We.authenticated?null:t},Xk=e=>{const{children:t}=e,{status:r}=bl();return r!==We.unauthenticated?null:t};Yk.displayName="WhenAuthenticated",Xk.displayName="WhenUnauthenticated";const Qk=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=bl();return n.includes(a?.role??"")?t:r||null},eE=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=bl(),{currentWorkspace:s}=Ik(),i=s?.users.find(e=>e._id===a?.id);return i&&n.includes(i?.role??"")?t:r||null};Qk.displayName="WhenRoles",eE.displayName="WhenWorkspaceRoles";const tE=e=>{const{children:t,fallback:r,permission:n}=e,{can:a}=vl();return a(n)?t:r??null};function rE(){const e=t.useContext(Hk);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])}}tE.displayName="WhenPermission";const nE=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=Ik(),a=n?.features?.[r];return a?t:null},aE=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=Ik(),a=n?.features?.[r];return a?null:t},sE=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=rE();return n(r)?t:null},iE=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=rE();return n(r)?null:t};nE.displayName="WhenWorkspaceFeatureEnabled",aE.displayName="WhenWorkspaceFeatureDisabled",sE.displayName="WhenUserFeatureEnabled",iE.displayName="WhenUserFeatureDisabled";const oE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=zn();return s?r??null:a?.subscription?t:n??null},cE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=zn();return s?r??null:a?.subscription?n??null:t},lE=e=>{const{children:t,plans:r,loadingComponent:n,fallbackComponent:a}=e,{response:s,loading:i}=zn();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},uE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=zn();return s?r??null:"trialing"!==a?.subscription?.subscriptionStatus?n??null:t},dE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=zn();return s?r??null:a?.subscription?.subscriptionStatus===Gn?n??null:t},pE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n,daysThreshold:a=3}=e,{response:s,loading:i}=zn();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};oE.displayName="WhenSubscription",cE.displayName="WhenNoSubscription",lE.displayName="WhenSubscriptionToPlans",uE.displayName="WhenTrialing",dE.displayName="WhenNotTrialing",pE.displayName="WhenTrialEnding";const mE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=Ok();if(i)return n??null;const o=s?.[t];return o?o.available<=0?a??null:r:a??null},hE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=Ok();if(i)return n??null;const o=s?.[t];return o?o.available>0?a??null:r:a??null},fE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=Ok();if(i)return n??null;const o=s?.[t];return o&&o.hasOverage&&!1!==o.allowOverage?r:a??null},gE=e=>{const{slug:t,threshold:r,children:n,loadingComponent:a,fallbackComponent:s}=e,{quotas:i,loading:o}=Ok();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 bE(e){if(!e)return null;const t=new Date(e);return isNaN(t.getTime())?null:t}mE.displayName="WhenQuotaAvailable",hE.displayName="WhenQuotaExhausted",fE.displayName="WhenQuotaOverage",gE.displayName="WhenQuotaThreshold";class vE extends hn{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 yE=class{constructor(e){this.api=new vE(e),this.orgId=e.orgId}async fetchConfig(){return this.api.fetchConfig()}async submitBetaUser(e){const t=e?.context??{},r=t?.country??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[1]:void 0),n=t?.language??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[0]:void 0),a=t?.timezone??("undefined"!=typeof Intl&&Intl.DateTimeFormat?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0),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 xE=ff({name:Bh().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:Bh().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 wE({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 SE({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 kE(...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 EE,CE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=ms(`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}},{}),NE={exports:{}},AE={};function _E(){if(EE)return AE;EE=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 AE.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:c,AE}var jE,PE,TE={};
|
|
27
|
+
*/function os(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function cs(...e){return t=>{let r=!1;const n=e.map(e=>{const n=os(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():os(e[t],null)}}}}function ls(...e){return a.useCallback(cs(...e),e)}var us=Symbol.for("react.lazy"),ds=a[" use ".trim().toString()];function ps(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===us&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}function ms(t){const r=fs(t),n=a.forwardRef((t,n)=>{let{children:s,...i}=t;ps(s)&&"function"==typeof ds&&(s=ds(s._payload));const o=a.Children.toArray(s),c=o.find(bs);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 hs=ms("Slot");function fs(e){const t=a.forwardRef((e,t)=>{let{children:r,...n}=e;if(ps(r)&&"function"==typeof ds&&(r=ds(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?cs(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 gs=Symbol("radix.slottable");function bs(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===gs}const vs=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,ys=o,xs=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return ys(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 ys(e,i,c,null==r?void 0:r.class,null==r?void 0:r.className)},ws=xs("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"}}),Ss=a.forwardRef(({className:t,variant:r,progress:n,size:s,startIcon:i,endIcon:o,asChild:c=!1,...l},u)=>{const d=c?hs:"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(ws({variant:r,size:s,withIcon:null!=n||null!=i||null!=o,className:t})),ref:u,...l,children:[n&&e.jsx(Ha,{size:p,className:"animate-spin"}),i&&a.cloneElement(i,{size:p}),l.children,o&&a.cloneElement(o,{size:p})]})});function ks(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function Es(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}\``)}]},Cs(s,...r)]}function Cs(...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}Ss.displayName="Button";var Ns=globalThis?.document?a.useLayoutEffect:()=>{},As=a[" useId ".trim().toString()]||(()=>{}),_s=0;function js(e){const[t,r]=a.useState(As());return Ns(()=>{r(e=>e??String(_s++))},[e]),e||(t?`radix-${t}`:"")}var Ps=a[" useInsertionEffect ".trim().toString()]||Ns;function Ts({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 Ps(()=>{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 Rs(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?cs(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 Ds=Symbol("radix.slottable");function Is(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Ds}var Us=["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=Rs(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(Is);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 Ms(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...e)=>t.current?.(...e),[])}var Ls,Os="dismissableLayer.update",zs="dismissableLayer.pointerDownOutside",Fs="dismissableLayer.focusOutside",Bs=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ws=a.forwardRef((t,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:c,onDismiss:l,...u}=t,d=a.useContext(Bs),[p,m]=a.useState(null),h=p?.ownerDocument??globalThis?.document,[,f]=a.useState({}),g=ls(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=Ms(e),n=a.useRef(!1),s=a.useRef(()=>{});return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){Hs(zs,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=Ms(e),n=a.useRef(!1);return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){Hs(Fs,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=Ms(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&&(Ls=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),Vs(),()=>{n&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Ls)}},[p,h,n,d]),a.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),Vs())},[p,d]),a.useEffect(()=>{const e=()=>f({});return document.addEventListener(Os,e),()=>document.removeEventListener(Os,e)},[]),e.jsx(Us.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...t.style},onFocusCapture:ks(t.onFocusCapture,E.onFocusCapture),onBlurCapture:ks(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:ks(t.onPointerDownCapture,k.onPointerDownCapture)})});Ws.displayName="DismissableLayer";function Vs(){const e=new CustomEvent(Os);document.dispatchEvent(e)}function Hs(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(Bs),s=a.useRef(null),i=ls(r,s);return a.useEffect(()=>{const e=s.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),e.jsx(Us.div,{...t,ref:i})}).displayName="DismissableLayerBranch";var Gs="focusScope.autoFocusOnMount",$s="focusScope.autoFocusOnUnmount",Ks={bubbles:!1,cancelable:!0},qs=a.forwardRef((t,r)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...c}=t,[l,u]=a.useState(null),d=Ms(i),p=Ms(o),m=a.useRef(null),h=ls(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:Xs(m.current,{select:!0})},t=function(e){if(f.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||Xs(m.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Xs(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){Qs.add(f);const t=document.activeElement;if(!l.contains(t)){const r=new CustomEvent(Gs,Ks);l.addEventListener(Gs,d),l.dispatchEvent(r),r.defaultPrevented||(!function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Xs(n,{select:t}),document.activeElement!==r)return}((e=Zs(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Xs(l))}return()=>{l.removeEventListener(Gs,d),setTimeout(()=>{const e=new CustomEvent($s,Ks);l.addEventListener($s,p),l.dispatchEvent(e),e.defaultPrevented||Xs(t??document.body,{select:!0}),l.removeEventListener($s,p),Qs.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=Zs(e),r=Js(t,e),n=Js(t.reverse(),e);return[r,n]}(t);a&&s?e.shiftKey||r!==s?e.shiftKey&&r===a&&(e.preventDefault(),n&&Xs(s,{select:!0})):(e.preventDefault(),n&&Xs(a,{select:!0})):r===t&&e.preventDefault()}},[n,s,f.paused]);return e.jsx(Us.div,{tabIndex:-1,...c,ref:h,onKeyDown:g})});function Zs(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 Js(e,t){for(const r of e)if(!Ys(r,{upTo:t}))return r}function Ys(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Xs(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()}}qs.displayName="FocusScope";var Qs=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 ti=a.forwardRef((t,n)=>{const{container:s,...i}=t,[o,c]=a.useState(!1);Ns(()=>c(!0),[]);const l=s||o&&globalThis?.document?.body;return l?r.createPortal(e.jsx(Us.div,{...i,ref:n}),l):null});ti.displayName="Portal";var ri=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=ni(n.current);i.current="mounted"===c?e:"none"},[c]),Ns(()=>{const t=n.current,r=s.current;if(r!==e){const n=i.current,a=ni(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]),Ns(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,a=a=>{const i=ni(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=ni(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=ls(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 ni(e){return e?.animationName||"none"}ri.displayName="Presence";var ai=0;function si(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ii()),document.body.insertAdjacentElement("beforeend",e[1]??ii()),ai++,()=>{1===ai&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),ai--}},[])}function ii(){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 oi=function(){return oi=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},oi.apply(this,arguments)};function ci(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 li="right-scroll-bar-position",ui="width-before-scroll-bar";function di(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var pi="undefined"!=typeof window?a.useLayoutEffect:a.useEffect,mi=new WeakMap;function hi(e,r){var n,a,s,i=(n=null,a=function(t){return e.forEach(function(e){return di(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 pi(function(){var t=mi.get(i);if(t){var r=new Set(t),n=new Set(e),a=i.current;r.forEach(function(e){n.has(e)||di(e,null)}),n.forEach(function(e){r.has(e)||di(e,a)})}mi.set(i,e)},[e]),i}function fi(e){return e}var gi=function(e){var t=e.sideCar,r=ci(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,oi({},r))};gi.isSideCarExport=!0;var bi=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=oi({async:!0,ssr:!1},e),t}(),vi=function(){},yi=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,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=ci(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,k=hi([r,t]),E=oi(oi({},w),s);return a.createElement(a.Fragment,null,d&&a.createElement(S,{sideCar:bi,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),oi(oi({},E),{ref:k})):a.createElement(y,oi({},E,{className:l,ref:k}),c))});yi.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},yi.classNames={fullWidth:ui,zeroRight:li};function xi(){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 wi=function(){var e=0,t=null;return{add:function(r){var n,a;0==e&&(t=xi())&&(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)}}},Si=function(){var e,t=(e=wi(),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}},ki={left:0,top:0,right:0,gap:0},Ei=function(e){return parseInt(e||"",10)||0},Ci=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return ki;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[Ei(r),Ei(n),Ei(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])}},Ni=Si(),Ai="data-scroll-locked",_i=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(Ai,"] {\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(li," {\n right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(ui," {\n margin-right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(li," .").concat(li," {\n right: 0 ").concat(n,";\n }\n \n .").concat(ui," .").concat(ui," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(Ai,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(o,"px;\n }\n")},ji=function(){var e=parseInt(document.body.getAttribute(Ai)||"0",10);return isFinite(e)?e:0},Pi=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(Ai,(ji()+1).toString()),function(){var e=ji()-1;e<=0?document.body.removeAttribute(Ai):document.body.setAttribute(Ai,e.toString())}},[]);var i=a.useMemo(function(){return Ci(s)},[s]);return a.createElement(Ni,{styles:_i(i,!t,s,r?"":"!important")})},Ti=!1;if("undefined"!=typeof window)try{var Ri=Object.defineProperty({},"passive",{get:function(){return Ti=!0,!0}});window.addEventListener("test",Ri,Ri),window.removeEventListener("test",Ri,Ri)}catch(e){Ti=!1}var Di=!!Ti&&{passive:!1},Ii=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])},Ui=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),Mi(e,n)){var a=Li(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Mi=function(e,t){return"v"===e?function(e){return Ii(e,"overflowY")}(t):function(e){return Ii(e,"overflowX")}(t)},Li=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)},Oi=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},zi=function(e){return[e.deltaX,e.deltaY]},Fi=function(e){return e&&"current"in e?e.current:e},Bi=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Wi=0,Vi=[];function Hi(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Gi,$i=(Gi=function(e){var t=a.useRef([]),r=a.useRef([0,0]),n=a.useRef(),s=a.useState(Wi++)[0],i=a.useState(Si)[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(Fi),!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=Oi(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=Ui(d,u);if(!h)return!0;if(h?a=d:(a="v"===d?"h":"v",h=Ui(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=Li(e,i),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Mi(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(Vi.length&&Vi[Vi.length-1]===i){var n="deltaY"in r?zi(r):Oi(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(Fi).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:Hi(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=Oi(e),n.current=void 0},[]),p=a.useCallback(function(t){u(t.type,zi(t),t.target,c(t,e.lockRef.current))},[]),m=a.useCallback(function(t){u(t.type,Oi(t),t.target,c(t,e.lockRef.current))},[]);a.useEffect(function(){return Vi.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Di),document.addEventListener("touchmove",l,Di),document.addEventListener("touchstart",d,Di),function(){Vi=Vi.filter(function(e){return e!==i}),document.removeEventListener("wheel",l,Di),document.removeEventListener("touchmove",l,Di),document.removeEventListener("touchstart",d,Di)}},[]);var h=e.removeScrollBar,f=e.inert;return a.createElement(a.Fragment,null,f?a.createElement(i,{styles:Bi(s)}):null,h?a.createElement(Pi,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},bi.useMedium(Gi),gi),Ki=a.forwardRef(function(e,t){return a.createElement(yi,oi({},e,{ref:t,sideCar:$i}))});Ki.classNames=yi.classNames;var qi=new WeakMap,Zi=new WeakMap,Ji={},Yi=0,Xi=function(e){return e&&(e.host||Xi(e.parentNode))},Qi=function(e,t,r,n){var a=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=Xi(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]);Ji[r]||(Ji[r]=new WeakMap);var s=Ji[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=(qi.get(e)||0)+1,l=(s.get(e)||0)+1;qi.set(e,c),s.set(e,l),i.push(e),1===c&&a&&Zi.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(),Yi++,function(){i.forEach(function(e){var t=qi.get(e)-1,a=s.get(e)-1;qi.set(e,t),s.set(e,a),t||(Zi.has(e)||e.removeAttribute(n),Zi.delete(e)),a||e.removeAttribute(r)}),--Yi||(qi=new WeakMap,qi=new WeakMap,Zi=new WeakMap,Ji={})}},eo=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"))),Qi(n,a,r,"aria-hidden")):function(){return null}};function to(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?cs(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 ro=Symbol("radix.slottable");function no(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===ro}var ao="Dialog",[so,io]=Es(ao),[oo,co]=so(ao),lo=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]=Ts({prop:s,defaultProp:i??!1,onChange:o,caller:ao});return e.jsx(oo,{scope:r,triggerRef:l,contentRef:u,contentId:js(),titleId:js(),descriptionId:js(),open:d,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:c,children:n})};lo.displayName=ao;var uo="DialogTrigger",po=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=co(uo,n),i=ls(r,s.triggerRef);return e.jsx(Us.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Ro(s.open),...a,ref:i,onClick:ks(t.onClick,s.onOpenToggle)})});po.displayName=uo;var mo="DialogPortal",[ho,fo]=so(mo,{forceMount:void 0}),go=t=>{const{__scopeDialog:r,forceMount:n,children:s,container:i}=t,o=co(mo,r);return e.jsx(ho,{scope:r,forceMount:n,children:a.Children.map(s,t=>e.jsx(ri,{present:n||o.open,children:e.jsx(ti,{asChild:!0,container:i,children:t})}))})};go.displayName=mo;var bo="DialogOverlay",vo=a.forwardRef((t,r)=>{const n=fo(bo,t.__scopeDialog),{forceMount:a=n.forceMount,...s}=t,i=co(bo,t.__scopeDialog);return i.modal?e.jsx(ri,{present:a||i.open,children:e.jsx(xo,{...s,ref:r})}):null});vo.displayName=bo;var yo=function(t){const r=to(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(no);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"),xo=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=co(bo,n);return e.jsx(Ki,{as:yo,allowPinchZoom:!0,shards:[s.contentRef],children:e.jsx(Us.div,{"data-state":Ro(s.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),wo="DialogContent",So=a.forwardRef((t,r)=>{const n=fo(wo,t.__scopeDialog),{forceMount:a=n.forceMount,...s}=t,i=co(wo,t.__scopeDialog);return e.jsx(ri,{present:a||i.open,children:i.modal?e.jsx(ko,{...s,ref:r}):e.jsx(Eo,{...s,ref:r})})});So.displayName=wo;var ko=a.forwardRef((t,r)=>{const n=co(wo,t.__scopeDialog),s=a.useRef(null),i=ls(r,n.contentRef,s);return a.useEffect(()=>{const e=s.current;if(e)return eo(e)},[]),e.jsx(Co,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ks(t.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ks(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:ks(t.onFocusOutside,e=>e.preventDefault())})}),Eo=a.forwardRef((t,r)=>{const n=co(wo,t.__scopeDialog),s=a.useRef(!1),i=a.useRef(!1);return e.jsx(Co,{...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()}})}),Co=a.forwardRef((t,r)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,...c}=t,l=co(wo,n),u=a.useRef(null),d=ls(r,u);return si(),e.jsxs(e.Fragment,{children:[e.jsx(qs,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:o,children:e.jsx(Ws,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Ro(l.open),...c,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(Mo,{titleId:l.titleId}),e.jsx(Lo,{contentRef:u,descriptionId:l.descriptionId})]})]})}),No="DialogTitle",Ao=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=co(No,n);return e.jsx(Us.h2,{id:s.titleId,...a,ref:r})});Ao.displayName=No;var _o="DialogDescription",jo=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=co(_o,n);return e.jsx(Us.p,{id:s.descriptionId,...a,ref:r})});jo.displayName=_o;var Po="DialogClose",To=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=co(Po,n);return e.jsx(Us.button,{type:"button",...a,ref:r,onClick:ks(t.onClick,()=>s.onOpenChange(!1))})});function Ro(e){return e?"open":"closed"}To.displayName=Po;var Do="DialogTitleWarning",[Io,Uo]=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}\``)}]}(Do,{contentName:wo,titleName:No,docsSlug:"dialog"}),Mo=({titleId:e})=>{const t=Uo(Do),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},Lo=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Uo("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},Oo=lo,zo=po,Fo=go,Bo=vo,Wo=So,Vo=Ao,Ho=jo,Go=To;function $o(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 Ko=["color"],qo=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=$o(e,Ko);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"}))}),Zo=["color"],Jo=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=$o(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:"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"}))}),Yo=["color"],Xo=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=$o(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.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"}))}),Qo=["color"],ec=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=$o(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:"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 tc=t.createContext({container:null,setContainer:()=>{}}),rc=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(tc.Provider,{value:s,children:[i,e.jsx("div",{ref:a,id:"saas-os-portal",className:"saas-os-ui",style:{width:"100%",height:"100%"}})]})});rc.displayName="PortalProvider";const nc=Oo,ac=zo,sc=Fo,ic=a.forwardRef(({className:t,...r},n)=>e.jsx(Bo,{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}));ic.displayName=Bo.displayName;const oc=a.forwardRef(({className:t,children:r,...n},s)=>{const{container:i}=a.useContext(tc);return e.jsxs(sc,{container:i,children:[e.jsx(ic,{}),e.jsxs(Wo,{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(Go,{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(Xo,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});oc.displayName=Wo.displayName;const cc=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col space-y-1.5 text-center sm:text-start",t),...r});cc.displayName="DialogHeader";const lc=a.forwardRef(({className:t,...r},n)=>e.jsx(Vo,{ref:n,className:Se("text-lg font-semibold leading-none tracking-tight",t),...r}));lc.displayName=Vo.displayName;const uc=a.forwardRef(({className:t,...r},n)=>e.jsx(Ho,{ref:n,className:Se("text-sm text-muted-foreground",t),...r}));uc.displayName=Ho.displayName;var dc=Symbol("radix.slottable");var pc="AlertDialog",[mc]=Es(pc,[io]),hc=io(),fc=t=>{const{__scopeAlertDialog:r,...n}=t,a=hc(r);return e.jsx(Oo,{...a,...n,modal:!0})};fc.displayName=pc;var gc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=hc(n);return e.jsx(zo,{...s,...a,ref:r})});gc.displayName="AlertDialogTrigger";var bc=t=>{const{__scopeAlertDialog:r,...n}=t,a=hc(r);return e.jsx(Fo,{...a,...n})};bc.displayName="AlertDialogPortal";var vc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=hc(n);return e.jsx(Bo,{...s,...a,ref:r})});vc.displayName="AlertDialogOverlay";var yc="AlertDialogContent",[xc,wc]=mc(yc),Sc=function(t){const r=({children:t})=>e.jsx(e.Fragment,{children:t});return r.displayName=`${t}.Slottable`,r.__radixId=dc,r}("AlertDialogContent"),kc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,children:s,...i}=t,o=hc(n),c=a.useRef(null),l=ls(r,c),u=a.useRef(null);return e.jsx(Io,{contentName:yc,titleName:Ec,docsSlug:"alert-dialog",children:e.jsx(xc,{scope:n,cancelRef:u,children:e.jsxs(Wo,{role:"alertdialog",...o,...i,ref:l,onOpenAutoFocus:ks(i.onOpenAutoFocus,e=>{e.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[e.jsx(Sc,{children:s}),e.jsx(Tc,{contentRef:c})]})})})});kc.displayName=yc;var Ec="AlertDialogTitle",Cc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=hc(n);return e.jsx(Vo,{...s,...a,ref:r})});Cc.displayName=Ec;var Nc="AlertDialogDescription",Ac=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=hc(n);return e.jsx(Ho,{...s,...a,ref:r})});Ac.displayName=Nc;var _c=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=hc(n);return e.jsx(Go,{...s,...a,ref:r})});_c.displayName="AlertDialogAction";var jc="AlertDialogCancel",Pc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,{cancelRef:s}=wc(jc,n),i=hc(n),o=ls(r,s);return e.jsx(Go,{...i,...a,ref:o})});Pc.displayName=jc;var Tc=({contentRef:e})=>{const t=`\`${yc}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${yc}\` by passing a \`${Nc}\` 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 \`${yc}\`. 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},Rc=vc,Dc=kc,Ic=_c,Uc=Pc,Mc=Cc,Lc=Ac;const Oc=fc,zc=gc,Fc=bc,Bc=a.forwardRef(({className:t,...r},n)=>e.jsx(Rc,{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}));Bc.displayName=Rc.displayName;const Wc=a.forwardRef(({className:t,...r},n)=>{const{container:s}=a.useContext(tc);return e.jsxs(Fc,{container:s,children:[e.jsx(Bc,{}),e.jsx(Dc,{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})]})});Wc.displayName=Dc.displayName;const Vc=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-start",t),...r});Vc.displayName="AlertDialogHeader";const Hc=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r});Hc.displayName="AlertDialogFooter";const Gc=a.forwardRef(({className:t,...r},n)=>e.jsx(Mc,{ref:n,className:Se("text-lg font-semibold",t),...r}));Gc.displayName=Mc.displayName;const $c=a.forwardRef(({className:t,...r},n)=>e.jsx(Lc,{ref:n,className:Se("text-sm text-muted-foreground",t),...r}));$c.displayName=Lc.displayName;const Kc=a.forwardRef(({className:t,...r},n)=>e.jsx(Ic,{ref:n,className:Se(ws(),t),...r}));Kc.displayName=Ic.displayName;const qc=a.forwardRef(({className:t,...r},n)=>e.jsx(Uc,{ref:n,className:Se(ws({variant:"outline"}),"mt-2 sm:mt-0",t),...r}));qc.displayName=Uc.displayName;const Zc="saas-workspace-current",Jc=e=>{e?sn(Zc,e._id):on(Zc)},Yc=()=>an(Zc),Xc=()=>{on(Zc)},Qc=(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 tl(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 rl={WORKSPACE_SETTINGS_VIEW:"workspace:settings:view",WORKSPACE_SETTINGS_EDIT:"workspace:settings:edit",WORKSPACE_DELETE:"workspace:delete",WORKSPACE_MEMBERS_VIEW:"workspace:members:view",WORKSPACE_MEMBERS_INVITE:"workspace:members:invite",WORKSPACE_MEMBERS_REMOVE:"workspace:members:remove",WORKSPACE_MEMBERS_ROLE_CHANGE:"workspace:members:role-change",WORKSPACE_FEATURES_VIEW:"workspace:features:view",WORKSPACE_FEATURES_EDIT:"workspace:features:edit",WORKSPACE_BILLING_VIEW:"workspace:billing:view",WORKSPACE_BILLING_MANAGE:"workspace:billing:manage",WORKSPACE_USAGE_VIEW:"workspace:usage:view"},nl=Object.values(rl),al={admin:nl.filter(e=>e!==rl.WORKSPACE_DELETE),member:[rl.WORKSPACE_SETTINGS_VIEW,rl.WORKSPACE_MEMBERS_VIEW,rl.WORKSPACE_FEATURES_VIEW,rl.WORKSPACE_BILLING_VIEW,rl.WORKSPACE_USAGE_VIEW],viewer:[rl.WORKSPACE_SETTINGS_VIEW,rl.WORKSPACE_MEMBERS_VIEW]};function sl(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 il(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(nl);if(a)for(const t of sl(a))e.add(t);if(r.permissions)for(const t of sl(r.permissions))e.add(t);if(n?.workspace?.permissions)for(const t of sl(n.workspace.permissions))e.add(t);return e}const s=e.workspaceRole??tl(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=al[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=al[n?.workspace?.defaultRole??"member"]??al.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(rl.WORKSPACE_MEMBERS_INVITE)}(h,s,n),h}class ol extends hn{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 cl(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 ll(e,t="/"){const r=cl(e);window.location.href=r||t}const ul="saas-auth-intent";function dl(e){return"object"==typeof e&&null!==e&&"string"==typeof e.returnUrl&&"number"==typeof e.createdAt}function pl(e){cl(e)&&function(e,t){try{sn(e,JSON.stringify(t))}catch(t){Re(t,{component:"storage",action:"setStorageJSON",metadata:{key:e}})}}(ul,{returnUrl:e,createdAt:Date.now()})}function ml(){const e=function(e,t){const r=an(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}}),on(e),null):n}catch(t){return Re(t,{component:"storage",action:"getStorageJSON",metadata:{key:e}}),on(e),null}}(ul,dl);return on(ul),e?Date.now()-e.createdAt>6e5?null:cl(e.returnUrl):null}function hl(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 fl(e,t){return{user:e,sessionId:t,expires:new Date(Date.now()+864e5).toISOString()}}function gl(){return bn(e=>e.auth)}function bl(){const{t:e}=nn(),r=gn(),n=gl(),a=xn(),{serverUrl:s,orgId:i,auth:o}=a,{resetCurrentWorkspace:c,currentWorkspace:l}=Ik(),u=t.useMemo(()=>new ol({serverUrl:s,version:a.version}),[s,a.version]),d=t.useCallback(async t=>{pl(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(Le()),new Error(t.message||e("errors.generic"));ll(t.data.redirectUrl)}catch(e){throw r.auth(Le()),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{on(cn),r.auth(ze()),c()}},[r,c,o?.callbacks?.onSignOut]),m=t.useCallback(e=>{l?Dk.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 vl(e){const{user:r}=bl(),{currentWorkspace:n}=Ik(),{settings:a}=Sn(),{appPermissions:s}=Wn(),i=e??n??null,o=r?.id??null,c=t.useMemo(()=>i?tl(i,o):null,[i,o]),l=t.useMemo(()=>!!i&&el(i,o),[i,o]),u=t.useMemo(()=>il({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 yl({className:t,...r}){return e.jsx("div",{className:Se("animate-pulse rounded-md bg-primary/10",t),...r})}function xl(){return e.jsxs("div",{className:"space-y-3.5",children:[e.jsx(yl,{className:"h-10 w-full"}),e.jsx(yl,{className:"h-10 w-full"}),e.jsx(yl,{className:"h-10 w-full"})]})}const wl=({workspace:r})=>{const[n,a]=t.useState(!1),{deleteWorkspace:s}=Ik(),{can:i}=vl(),{settings:o}=Sn(),{t:c}=nn();if(1===(o?.workspace?.maxWorkspacesPerUser??0))return null;if(!r)return e.jsx(xl,{});return i(rl.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(Oc,{children:[e.jsx(zc,{asChild:!0,children:e.jsxs(Ss,{variant:"destructive",disabled:n,progress:n,children:[e.jsx(rs,{className:"h-4 w-4 me-2"}),c("danger.deleteWorkspace")]})}),e.jsxs(Wc,{children:[e.jsxs(Vc,{children:[e.jsx(Gc,{children:c("danger.deleteConfirm")}),e.jsx($c,{children:c("danger.deleteConfirmDescription")})]}),e.jsxs(Hc,{children:[e.jsx(qc,{disabled:n,children:c("settings.common.cancel")}),e.jsx(Kc,{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(Ha,{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 Sl(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 kl(e){const[t,r]=a.useState(void 0);return Ns(()=>{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 El="Switch",[Cl]=Es(El),[Nl,Al]=Cl(El),_l=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=ls(r,e=>f(e)),b=a.useRef(!1),v=!h||(p||!!h.closest("form")),[y,x]=Ts({prop:i,defaultProp:o??!1,onChange:d,caller:El});return e.jsxs(Nl,{scope:n,checked:y,disabled:l,children:[e.jsx(Us.button,{type:"button",role:"switch","aria-checked":y,"aria-required":c,"data-state":Rl(y),"data-disabled":l?"":void 0,disabled:l,value:u,...m,ref:g,onClick:ks(t.onClick,e=>{x(e=>!e),v&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})}),v&&e.jsx(Tl,{control:h,bubbles:!b.current,name:s,value:u,checked:y,required:c,disabled:l,form:p,style:{transform:"translateX(-100%)"}})]})});_l.displayName=El;var jl="SwitchThumb",Pl=a.forwardRef((t,r)=>{const{__scopeSwitch:n,...a}=t,s=Al(jl,n);return e.jsx(Us.span,{"data-state":Rl(s.checked),"data-disabled":s.disabled?"":void 0,...a,ref:r})});Pl.displayName=jl;var Tl=a.forwardRef(({__scopeSwitch:t,control:r,checked:n,bubbles:s=!0,...i},o)=>{const c=a.useRef(null),l=ls(c,o),u=Sl(n),d=kl(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 Rl(e){return e?"checked":"unchecked"}Tl.displayName="SwitchBubbleInput";var Dl=_l,Il=Pl;const Ul=a.forwardRef(({className:t,...r},n)=>e.jsx(Dl,{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(Il,{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")})}));Ul.displayName=Dl.displayName;const Ml=({workspaceId:r})=>{const{t:n}=nn(),{allFeatures:a,updateFeature:s,getWorkspace:i}=Ik(),{can:o}=vl(),[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(xl,{});const f=o(rl.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(Ha,{className:"h-4 w-4 animate-spin text-gray-500"}),e.jsxs("span",{className:"text-sm text-gray-600",children:[u,"..."]})]}):e.jsx(Ul,{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 Ll=e=>"checkbox"===e.type,Ol=e=>e instanceof Date,zl=e=>null==e;const Fl=e=>"object"==typeof e;var Bl=e=>!zl(e)&&!Array.isArray(e)&&Fl(e)&&!Ol(e),Wl=e=>Bl(e)&&e.target?Ll(e.target)?e.target.checked:e.target.value:e,Vl=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),Hl="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function Gl(e){if(e instanceof Date)return new Date(e);const t="undefined"!=typeof FileList&&e instanceof FileList;if(Hl&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!(r||Bl(e)&&(e=>{const t=e.constructor&&e.constructor.prototype;return Bl(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]=Gl(e[t]));return n}var $l=e=>/^\w*$/.test(e),Kl=e=>void 0===e,ql=e=>Array.isArray(e)?e.filter(Boolean):[],Zl=e=>ql(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Jl=(e,t,r)=>{if(!t||!Bl(e))return r;const n=($l(t)?[t]:Zl(t)).reduce((e,t)=>zl(e)?e:e[t],e);return Kl(n)||n===e?Kl(e[t])?r:e[t]:n},Yl=e=>"boolean"==typeof e,Xl=e=>"function"==typeof e,Ql=(e,t,r)=>{let n=-1;const a=$l(t)?[t]:Zl(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=Bl(r)||Array.isArray(r)?r:isNaN(+a[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=s,e=e[t]}};const eu="blur",tu="focusout",ru="change",nu="onBlur",au="onChange",su="onSubmit",iu="onTouched",ou="all",cu="max",lu="min",uu="maxLength",du="minLength",pu="pattern",mu="required",hu="validate",fu=t.createContext(null);fu.displayName="HookFormControlContext";const gu=()=>t.useContext(fu);var bu=(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]!==ou&&(t._proxyFormState[a]=!n||ou),r&&(r[a]=!0),e[a]}});return a};const vu="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;var yu=e=>"string"==typeof e,xu=(e,t,r,n,a)=>yu(e)?(n&&t.watch.add(e),Jl(r,e,a)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),Jl(r,e))):(n&&(t.watchAll=!0),r),wu=e=>zl(e)||!Fl(e);function Su(e,t,r=new WeakSet){if(wu(e)||wu(t))return Object.is(e,t);if(Ol(e)&&Ol(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(Ol(n)&&Ol(e)||Bl(n)&&Bl(e)||Array.isArray(n)&&Array.isArray(e)?!Su(n,e,r):!Object.is(n,e))return!1}}return!0}function ku(e){const r=gu(),{name:n,disabled:a,control:s=r,shouldUnregister:i,defaultValue:o,exact:c=!0}=e,l=Vl(s._names.array,n),u=t.useMemo(()=>Jl(s._formValues,n,Jl(s._defaultValues,n,o)),[s,n,o]),d=function(e){const r=gu(),{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=xu(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=xu(a,n._names,e||n._formValues,!1,l.current);if(u.current){const e=u.current(t);Su(e,d.current)||(f(e),d.current=e)}else f(t)}},[n._formValues,n._names,i,a]);vu(()=>(p.current===n&&Su(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&&!Su(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=gu(),{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 vu(()=>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(()=>bu(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,...Yl(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const g=t.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Jl(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!Jl(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Jl(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Jl(p.validatingFields,n)},error:{enumerable:!0,get:()=>Jl(p.errors,n)}}),[p,n]),b=t.useCallback(e=>f.current.onChange({target:{value:Wl(e),name:n},type:ru}),[n]),v=t.useCallback(()=>f.current.onBlur({target:{value:Jl(s._formValues,n),name:n},type:eu}),[n,s._formValues]),y=t.useCallback(e=>{const t=Jl(s._fields,n);t&&t._f&&e&&(t._f.ref={focus:()=>Xl(e.focus)&&e.focus(),select:()=>Xl(e.select)&&e.select(),setCustomValidity:t=>Xl(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>Xl(e.reportValidity)&&e.reportValidity()})},[s._fields,n]),x=t.useMemo(()=>({name:n,value:d,...Yl(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,...Yl(m.current.disabled)?{disabled:m.current.disabled}:{}});const r=(e,t)=>{const r=Jl(s._fields,e);r&&r._f&&(r._f.mount=t)};if(r(n,!0),e){const e=Gl(Jl(s._options.defaultValues,n,m.current.defaultValue));Ql(s._defaultValues,n,e),Kl(Jl(s._formValues,n))&&Ql(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 Eu=e=>e.render(ku(e)),Cu=t.createContext(null);Cu.displayName="HookFormContext";const Nu=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(Cu.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(fu.Provider,{value:f},r))};var Au=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},_u=e=>Array.isArray(e)?e:[e],ju=()=>{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 Pu(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const a=e[n],s=t[n];if(a&&Bl(a)&&s){const e=Pu(a,s);Bl(e)&&(r[n]=e)}else e[n]&&(r[n]=s)}return r}var Tu=e=>Bl(e)&&!Object.keys(e).length,Ru=e=>"file"===e.type,Du=e=>{if(!Hl)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Iu=e=>"select-multiple"===e.type,Uu=e=>"radio"===e.type,Mu=e=>Du(e)&&e.isConnected;function Lu(e,t){const r=Array.isArray(t)?t:$l(t)?[t]:Zl(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Kl(e)?n++:e[t[n++]];return e}(e,r),a=r.length-1,s=r[a];return n&&delete n[s],0!==a&&(Bl(n)&&Tu(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!Kl(e[t]))return!1;return!0}(n))&&Lu(e,r.slice(0,-1)),e}function Ou(e){return Array.isArray(e)||Bl(e)&&!(e=>{for(const t in e)if(Xl(e[t]))return!0;return!1})(e)}function zu(e,t={}){for(const r in e){const n=e[r];Ou(n)?(t[r]=Array.isArray(n)?[]:{},zu(n,t[r])):Kl(n)||(t[r]=!0)}return t}function Fu(e,t,r){r||(r=zu(t));for(const n in e){const a=e[n];if(Ou(a))Kl(t)||wu(r[n])?r[n]=zu(a,Array.isArray(a)?[]:{}):Fu(a,zl(t)?{}:t[n],r[n]);else{const e=t[n];r[n]=!Su(a,e)}}return r}const Bu={value:!1,isValid:!1},Wu={value:!0,isValid:!0};var Vu=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&&!Kl(e[0].attributes.value)?Kl(e[0].value)||""===e[0].value?Wu:{value:e[0].value,isValid:!0}:Wu:Bu}return Bu},Hu=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Kl(e)?e:t?""===e?NaN:e?+e:e:r&&yu(e)?new Date(e):n?n(e):e;const Gu={isValid:!1,value:null};var $u=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Gu):Gu;function Ku(e){const t=e.ref;return Ru(t)?t.files:Uu(t)?$u(e.refs).value:Iu(t)?[...t.selectedOptions].map(({value:e})=>e):Ll(t)?Vu(e.refs).value:Hu(Kl(t.value)?e.ref.value:t.value,e)}var qu=e=>e instanceof RegExp,Zu=e=>Kl(e)?e:qu(e)?e.source:Bl(e)?qu(e.value)?e.value.source:e.value:e,Ju=e=>({isOnSubmit:!e||e===su,isOnBlur:e===nu,isOnChange:e===au,isOnAll:e===ou,isOnTouch:e===iu});const Yu="AsyncFunction";var Xu=e=>!!e&&!!e.validate&&!!(Xl(e.validate)&&e.validate.constructor.name===Yu||Bl(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===Yu)),Qu=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const ed=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const r=Jl(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(ed(s,t))break}else if(Bl(s)&&ed(s,t))break}}};function td(e,t,r){const n=Jl(e,r);if(n||$l(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const n=a.join("."),s=Jl(t,n),i=Jl(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 rd=(e,t,r)=>{const n=_u(Jl(e,r));return Ql(n,"root",t[r]),Ql(e,r,n),e};function nd(e,t,r="validate"){if(yu(e)||Array.isArray(e)&&e.every(yu)||Yl(e)&&!e)return{type:r,message:yu(e)?e:"",ref:t}}var ad=e=>Bl(e)&&!qu(e)?e:{value:e,message:""},sd=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=Jl(r,f);if(!b||t.has(f))return{};const y=o?o[0]:i,x=e=>{a&&y.reportValidity&&(y.setCustomValidity(Yl(e)?"":e||""),y.reportValidity())},w={},S=Uu(i),k=Ll(i),E=S||k,C=(g||Ru(i))&&Kl(i.value)&&Kl(v)||Du(i)&&""===i.value||""===v||Array.isArray(v)&&!v.length,N=Au.bind(null,f,n,w),A=(e,t,r,n=uu,a=du)=>{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||zl(v))||Yl(v)&&!v||k&&!Vu(o).isValid||S&&!$u(o).isValid)){const{value:e,message:t}=yu(c)?{value:!!c,message:c}:ad(c);if(e&&(w[f]={type:mu,message:t,ref:y,...N(mu,t)},!n))return x(t),w}if(!(C||zl(d)&&zl(p))){let e,t;const r=ad(p),a=ad(d);if(zl(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;yu(r.value)&&v&&(e=o?s(v)>s(r.value):c?v>r.value:n>new Date(r.value)),yu(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);zl(r.value)||(e=n>r.value),zl(a.value)||(t=n<a.value)}if((e||t)&&(A(!!e,r.message,a.message,cu,lu),!n))return x(w[f].message),w}if((l||u)&&!C&&(yu(v)||s&&Array.isArray(v))){const e=ad(l),t=ad(u),r=!zl(e.value)&&v.length>+e.value,a=!zl(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&&yu(v)){const{value:e,message:t}=ad(m);if(qu(e)&&!v.match(e)&&(w[f]={type:pu,message:t,ref:i,...N(pu,t)},!n))return x(t),w}if(h)if(Xl(h)){const e=nd(await h(v,r),y);if(e&&(w[f]={...e,...N(hu,e.message)},!n))return x(e.message),w}else if(Bl(h)){let e={};for(const t in h){if(!Tu(e)&&!n)break;const a=nd(await h[t](v,r),y,t);a&&(e={...a,...N(t,a.message)},x(a.message),n&&(w[f]=e))}if(!Tu(e)&&(w[f]={ref:y,...e},!n))return w}return x(!0),w};const id={mode:su,reValidateMode:au,shouldFocusError:!0};function od(e={}){let t,r={...id,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Xl(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},s=(Bl(r.defaultValues)||Bl(r.values))&&Gl(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:Gl(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:ju(),state:ju()},h=r.criteriaMode===ou,f=async e=>{if(!o.keepIsValid&&!r.disabled&&(d.isValid||p.isValid||e)){let e;r.resolver?(e=Tu((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?Ql(n.validatingFields,e,t):Lu(n.validatingFields,e))}),m.state.next({validatingFields:n.validatingFields,isValidating:!Tu(n.validatingFields)}))},b=(e,t,r,n)=>{const c=Jl(a,e);if(c){const a=Jl(i,e,Kl(r)?Jl(s,e):r);Kl(a)||n&&n.defaultChecked||t?Ql(i,e,t?a:Ku(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=Su(Jl(s,e),t);l=!!Jl(n.dirtyFields,e),r?Lu(n.dirtyFields,e):Ql(n.dirtyFields,e,!0),u.dirtyFields=n.dirtyFields,c=c||(d.dirtyFields||p.dirtyFields)&&l!==!r}if(a){const t=Jl(n.touchedFields,e);t||(Ql(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=Jl(n.errors,e),c=(d.isValid||p.isValid)&&Yl(a)&&n.isValid!==a;var u;if(r.delayError&&s?(u=()=>((e,t)=>{Ql(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?Ql(n.errors,e,s):Lu(n.errors,e)),(s?!Su(o,s):o)||!Tu(i)||c){const t={...i,...c&&Yl(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=Jl(t,r);e&&Ql(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&&Xu(l._f);u&&d.validatingFields&&g([t.name],!0);const p=await sd(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&&(Jl(p,t.name)?o?rd(n.errors,p,t.name):Ql(n.errors,t.name,p[t.name]):Lu(n.errors,t.name))}!Tu(o)&&await w(o,a,s)}}return s.valid},S=(e,t)=>!r.disabled&&(e&&t&&Ql(i,e,t),!Su(P(),s)),k=(e,t,r)=>xu(e,c,{...o.mount?i:Kl(t)?s:yu(e)?{[e]:t}:t},r,t),E=(e,t,r={})=>{const n=Jl(a,e);let s=t;if(n){const r=n._f;r&&(!r.disabled&&Ql(i,e,Hu(t,r)),s=Du(r.ref)&&zl(t)?"":t,Iu(r.ref)?[...r.ref.options].forEach(e=>e.selected=s.includes(e.value)):r.refs?Ll(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):Ru(r.ref)?r.ref.value="":(r.ref.value=s,r.ref.type||m.state.next({name:e,values:Gl(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=Jl(a,i);(c.array.has(e)||Bl(s)||o&&!o._f)&&!Ol(s)?C(i,s,r):E(i,s,r)}},N=(e,t,r={})=>{const l=Jl(a,e),u=c.array.has(e),h=Gl(t);Ql(i,e,h),u?(m.array.next({name:e,values:Gl(i)}),(d.isDirty||d.dirtyFields||p.isDirty||p.dirtyFields)&&r.shouldDirty&&m.state.next({name:e,dirtyFields:Fu(s,i),isDirty:S(e,h)})):!l||l._f||zl(h)?E(e,h,r):C(e,h,r),Qu(e,c)?m.state.next({...n,name:e,values:Gl(i)}):m.state.next({name:o.mount?e:void 0,values:Gl(i)})},A=async e=>{o.mount=!0;const s=e.target;let l=s.name,u=!0;const b=Jl(a,l),S=e=>{u=Number.isNaN(e)||Ol(e)&&isNaN(e.getTime())||Su(e,Jl(i,l,e))},k=Ju(r.mode),E=Ju(r.reValidateMode);if(b){let o,C;const N=s.type?Ku(b._f):Wl(e),A=e.type===eu||e.type===tu,_=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(b._f)&&!r.resolver&&!Jl(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,Jl(n.touchedFields,l),n.isSubmitted,E,k),P=Qu(l,c,A);Ql(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=!Tu(T)||P;if(!A&&m.state.next({name:l,type:e.type,values:Gl(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=td(n.errors,a,l),r=td(e,a,t.name||l);o=r.error,l=r.name,C=Tu(e)}}else g([l],!0),o=(await sd(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(Jl(n.errors,t)&&e.focus)return e.focus(),1},j=async(e,t={})=>{let s,i;const o=_u(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=Jl(t,r);e?Ql(n.errors,r,e):Lu(n.errors,r)}else n.errors=t;return t})(Kl(e)?e:o);s=Tu(t),i=e?!o.some(e=>Jl(t,e)):s}else e?(i=(await Promise.all(o.map(async e=>{const t=Jl(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({...!yu(e)||(d.isValid||p.isValid)&&s!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:s}:{},errors:n.errors}),t.shouldFocus&&!i&&ed(a,_,e?o:c.mount),i},P=(e,t)=>{let r={...o.mount?i:s};return t&&(r=Pu(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),Kl(e)?r:yu(e)?Jl(r,e):e.map(e=>Jl(r,e))},T=(e,t)=>({invalid:!!Jl((t||n).errors,e),isDirty:!!Jl((t||n).dirtyFields,e),error:Jl((t||n).errors,e),isValidating:!!Jl(n.validatingFields,e),isTouched:!!Jl((t||n).touchedFields,e)}),R=(e,t,r)=>{const s=(Jl(a,e,{_f:{}})._f||{}).ref,i=Jl(n.errors,e)||{},{ref:o,message:c,type:l,...u}=i;Ql(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&&!_u(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 Tu(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(e=>t[e]===(!n||ou))})(t,e.formState||d,B,e.reRenderRoot)||e.callback({values:{...i},...n,...t,defaultValues:s})}}).unsubscribe,I=(e,t={})=>{for(const o of e?_u(e):c.mount)c.mount.delete(o),c.array.delete(o),t.keepValue||(Lu(a,o),Lu(i,o)),!t.keepError&&Lu(n.errors,o),!t.keepDirty&&Lu(n.dirtyFields,o),!t.keepTouched&&Lu(n.touchedFields,o),!t.keepIsValidating&&Lu(n.validatingFields,o),!r.shouldUnregister&&!t.keepDefaultValue&&Lu(s,o);m.state.next({values:Gl(i)}),m.state.next({...n,...t.keepDirty?{isDirty:S()}:{}}),!t.keepIsValid&&f()},U=({disabled:e,name:t})=>{if(Yl(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=Jl(a,e);const i=Yl(t.disabled)||Yl(r.disabled);return Ql(a,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),c.mount.add(e),n?U({disabled:Yl(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:Zu(t.min),max:Zu(t.max),minLength:Zu(t.minLength),maxLength:Zu(t.maxLength),pattern:Zu(t.pattern)}:{},name:e,onChange:A,onBlur:A,ref:i=>{if(i){M(e,t),n=Jl(a,e);const r=Kl(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,o=(e=>Uu(e)||Ll(e))(r),c=n._f.refs||[];if(o?c.find(e=>e===r):r===n._f.ref)return;Ql(a,e,{_f:{...n._f,...o?{refs:[...c.filter(Mu),r,...Array.isArray(Jl(s,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),b(e,!1,void 0,r)}else n=Jl(a,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!Vl(c.array,e)||!o.action)&&c.unMount.add(e)}}},L=()=>r.shouldFocusError&&ed(a,_,c.mount),O=(e,t)=>async s=>{let o;s&&(s.preventDefault&&s.preventDefault(),s.persist&&s.persist());let l=Gl(i);if(m.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await x();g(),n.errors=e,l=Gl(t)}else await w(a);if(c.disabled.size)for(const e of c.disabled)Lu(l,e);if(Lu(n.errors,"root"),Tu(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:Tu(n.errors)&&!o,submitCount:n.submitCount+1,errors:n.errors}),o)throw o},z=(e,t={})=>{const l=e?Gl(e):s,u=Gl(l),p=Tu(e),h=p?s:u;if(t.keepDefaultValues||(s=l),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...c.mount,...Object.keys(Fu(s,i))]);for(const t of Array.from(e)){const e=Jl(n.dirtyFields,t),r=Jl(i,t),a=Jl(h,t);e&&!Kl(r)?Ql(h,t,r):e||Kl(a)||N(t,a)}}else{if(Hl&&Kl(e))for(const e of c.mount){const t=Jl(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Du(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of c.mount)N(e,Jl(h,e));else a={}}i=r.shouldUnregister?t.keepDefaultValues?Gl(s):{}:Gl(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&&!Tu(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||Su(e,s))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:p?{}:t.keepDirtyValues?t.keepDefaultValues&&i?Fu(s,i):n.dirtyFields:t.keepDefaultValues&&e?Fu(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(Xl(e)?e(i):e,{...r.resetOptions,...t}),B=e=>{n={...n,...e}},W={control:{register:M,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,u=!0,h=!0)=>{if(l&&c&&!r.disabled){if(o.action=!0,h&&Array.isArray(Jl(a,e))){const t=c(Jl(a,e),l.argA,l.argB);u&&Ql(a,e,t)}if(h&&Array.isArray(Jl(n.errors,e))){const t=c(Jl(n.errors,e),l.argA,l.argB);u&&Ql(n.errors,e,t),((e,t)=>{!ql(Jl(e,t)).length&&Lu(e,t)})(n.errors,e)}if((d.touchedFields||p.touchedFields)&&h&&Array.isArray(Jl(n.touchedFields,e))){const t=c(Jl(n.touchedFields,e),l.argA,l.argB);u&&Ql(n.touchedFields,e,t)}(d.dirtyFields||p.dirtyFields)&&(n.dirtyFields=Fu(s,i)),m.state.next({name:e,isDirty:S(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Ql(i,e,t)},_setDisabledField:U,_setErrors:e=>{n.errors=e,m.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>ql(Jl(o.mount?i:s,e,r.shouldUnregister?Jl(s,e,[]):[])),_reset:z,_resetDefaultValues:()=>Xl(r.defaultValues)&&r.defaultValues().then(e=>{F(e,r.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of c.unMount){const t=Jl(a,e);t&&(t._f.refs?t._f.refs.every(e=>!Mu(e)):!Mu(t._f.ref))&&I(e)}c.unMount=new Set},_disableForm:e=>{Yl(e)&&(m.state.next({disabled:e}),ed(a,(t,r)=>{const n=Jl(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:O,watch:(e,t)=>Xl(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={})=>{Jl(a,e)&&(Kl(t.defaultValue)?N(e,Gl(Jl(s,e))):(N(e,t.defaultValue),Ql(s,e,Gl(t.defaultValue))),t.keepTouched||Lu(n.touchedFields,e),t.keepDirty||(Lu(n.dirtyFields,e),n.isDirty=t.defaultValue?S(e,Gl(Jl(s,e))):S()),t.keepError||(Lu(n.errors,e),d.isValid&&f()),m.state.next({...n}))},clearErrors:e=>{e&&_u(e).forEach(e=>Lu(n.errors,e)),m.state.next({errors:e?n.errors:{}})},unregister:I,setError:R,setFocus:(e,t={})=>{const r=Jl(a,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&Xl(e.select)&&e.select()})}},getFieldState:T};return{...W,formControl:W}}function cd(e={}){const r=t.useRef(void 0),n=t.useRef(void 0),[a,s]=t.useState({isDirty:!1,isValidating:!1,isLoading:Xl(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:Xl(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:a},e.defaultValues&&!Xl(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:t,...n}=od(e);r.current={...n,formState:a}}const i=r.current.control;return i._options=e,vu(()=>{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&&!Su(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(()=>bu(a,i),[i,a]),r.current}const ld=(e,t,r)=>{if(e&&"reportValidity"in e){const n=Jl(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},ud=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?ld(n.ref,r,e):n&&n.refs&&n.refs.forEach(t=>ld(t,r,e))}},dd=(e,t)=>{t.shouldUseNativeValidation&&ud(e,t);const r={};for(const n in e){const a=Jl(t.fields,n),s=Object.assign(e[n]||{},{ref:a&&a.ref});if(pd(t.names||Object.keys(e),n)){const e=Object.assign({},Jl(r,n));Ql(e,"root",s),Ql(r,n,e)}else Ql(r,n,s)}return r},pd=(e,t)=>{const r=md(t);return e.some(e=>md(e).match(`^${r}\\.\\d+`))};function md(e){return e.replace(/\]|\[/g,"")}function hd(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 fd extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class gd extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const bd={};function vd(e){return bd}function yd(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 xd(e,t){return"bigint"==typeof t?t.toString():t}function wd(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Sd(e){return null==e}function kd(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const Ed=Symbol("evaluating");function Cd(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Ed)return void 0===n&&(n=Ed,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Nd(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ad(...e){const t={};for(const r of e){const e=Object.getOwnPropertyDescriptors(r);Object.assign(t,e)}return Object.defineProperties({},t)}function _d(e){return JSON.stringify(e)}const jd="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Pd(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Td=wd(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Rd(e){if(!1===Pd(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!==Pd(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function Dd(e){return Rd(e)?{...e}:Array.isArray(e)?[...e]:e}const Id=new Set(["string","number","symbol"]);function Ud(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Md(e,t,r){const n=new e._zod.constr(t??e._zod.def);return t&&!r?.parent||(n._zod.parent=e),n}function Ld(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 Od(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 zd(e,t){return t.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function Fd(e){return"string"==typeof e?e:e?.message}function Bd(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const a=Fd(e.inst?._zod.def?.error?.(e))??Fd(t?.error?.(e))??Fd(r.customError?.(e))??Fd(r.localeError?.(e))??"Invalid input";n.message=a}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function Wd(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Vd(...e){const[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}const Hd=(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,xd,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Gd=hd("$ZodError",Hd),$d=hd("$ZodError",Hd,{Parent:Error});const Kd=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 fd;if(i.issues.length){const t=new(a?.Err??e)(i.issues.map(e=>Bd(e,s,vd())));throw jd(t,a?.callee),t}return i.value},qd=Kd($d),Zd=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=>Bd(e,s,vd())));throw jd(t,a?.callee),t}return i.value},Jd=Zd($d),Yd=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 fd;return s.issues.length?{success:!1,error:new(e??Gd)(s.issues.map(e=>Bd(e,a,vd())))}:{success:!0,data:s.value}},Xd=Yd($d),Qd=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=>Bd(e,a,vd())))}:{success:!0,data:s.value}},ep=Qd($d),tp=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Kd(e)(t,r,a)},rp=e=>(t,r,n)=>Kd(e)(t,r,n),np=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Zd(e)(t,r,a)},ap=e=>async(t,r,n)=>Zd(e)(t,r,n),sp=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Yd(e)(t,r,a)},ip=e=>(t,r,n)=>Yd(e)(t,r,n),op=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Qd(e)(t,r,a)},cp=e=>async(t,r,n)=>Qd(e)(t,r,n),lp=/^[cC][^\s-]{8,}$/,up=/^[0-9a-z]+$/,dp=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,pp=/^[0-9a-vA-V]{20}$/,mp=/^[A-Za-z0-9]{27}$/,hp=/^[a-zA-Z0-9_-]{21}$/,fp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,gp=/^([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})$/,bp=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)$/,vp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const yp=/^(?:(?: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])$/,xp=/^(([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}|:))$/,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])\/([0-9]|[1-2][0-9]|3[0-2])$/,Sp=/^(([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])$/,kp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ep=/^[A-Za-z0-9_-]*$/,Cp=/^\+[1-9]\d{6,14}$/,Np="(?:(?:\\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])))",Ap=new RegExp(`^${Np}$`);function _p(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 jp=/^[^A-Z]*$/,Pp=/^[^a-z]*$/,Tp=hd("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Rp=hd("$ZodCheckMaxLength",(e,t)=>{var r;Tp.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Sd(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=Wd(n);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Dp=hd("$ZodCheckMinLength",(e,t)=>{var r;Tp.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Sd(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=Wd(n);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Ip=hd("$ZodCheckLengthEquals",(e,t)=>{var r;Tp.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Sd(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=Wd(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})}}),Up=hd("$ZodCheckStringFormat",(e,t)=>{var r,n;Tp.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=()=>{})}),Mp=hd("$ZodCheckRegex",(e,t)=>{Up.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})}}),Lp=hd("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=jp),Up.init(e,t)}),Op=hd("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Pp),Up.init(e,t)}),zp=hd("$ZodCheckIncludes",(e,t)=>{Tp.init(e,t);const r=Ud(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})}}),Fp=hd("$ZodCheckStartsWith",(e,t)=>{Tp.init(e,t);const r=new RegExp(`^${Ud(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})}}),Bp=hd("$ZodCheckEndsWith",(e,t)=>{Tp.init(e,t);const r=new RegExp(`.*${Ud(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})}}),Wp=hd("$ZodCheckOverwrite",(e,t)=>{Tp.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class Vp{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 Hp={major:4,minor:3,patch:6},Gp=hd("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Hp;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=Od(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 fd;if(n||i instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await i;e.issues.length!==t&&(a||(a=Od(e,t)))});else{if(e.issues.length===t)continue;a||(a=Od(e,t))}}return n?n.then(()=>e):e},r=(r,a,s)=>{if(Od(r))return r.aborted=!0,r;const i=t(a,n,s);if(i instanceof Promise){if(!1===s.async)throw new fd;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 fd;return i.then(e=>t(e,n,s))}return t(i,n,s)}}Cd(e,"~standard",()=>({validate:t=>{try{const r=Xd(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return ep(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),$p=hd("$ZodString",(e,t)=>{var r;Gp.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}}),Kp=hd("$ZodStringFormat",(e,t)=>{Up.init(e,t),$p.init(e,t)}),qp=hd("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=gp),Kp.init(e,t)}),Zp=hd("$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=bp(e))}else t.pattern??(t.pattern=bp());Kp.init(e,t)}),Jp=hd("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=vp),Kp.init(e,t)}),Yp=hd("$ZodURL",(e,t)=>{Kp.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})}}}),Xp=hd("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Kp.init(e,t)}),Qp=hd("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=hp),Kp.init(e,t)}),em=hd("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=lp),Kp.init(e,t)}),tm=hd("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=up),Kp.init(e,t)}),rm=hd("$ZodULID",(e,t)=>{t.pattern??(t.pattern=dp),Kp.init(e,t)}),nm=hd("$ZodXID",(e,t)=>{t.pattern??(t.pattern=pp),Kp.init(e,t)}),am=hd("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=mp),Kp.init(e,t)}),sm=hd("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=_p({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(`^${Np}T(?:${n})$`)}(t)),Kp.init(e,t)}),im=hd("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ap),Kp.init(e,t)}),om=hd("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${_p(t)}$`)),Kp.init(e,t)}),cm=hd("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=fp),Kp.init(e,t)}),lm=hd("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=yp),Kp.init(e,t),e._zod.bag.format="ipv4"}),um=hd("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=xp),Kp.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})}}}),dm=hd("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=wp),Kp.init(e,t)}),pm=hd("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Sp),Kp.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(2!==n.length)throw new Error;const[e,t]=n;if(!t)throw new Error;const r=Number(t);if(`${r}`!==t)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function mm(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const hm=hd("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=kp),Kp.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{mm(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});const fm=hd("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ep),Kp.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{(function(e){if(!Ep.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return mm(t.padEnd(4*Math.ceil(t.length/4),"="))})(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),gm=hd("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Cp),Kp.init(e,t)});const bm=hd("$ZodJWT",(e,t)=>{Kp.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})}}),vm=hd("$ZodUnknown",(e,t)=>{Gp.init(e,t),e._zod.parse=e=>e}),ym=hd("$ZodNever",(e,t)=>{Gp.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function xm(e,t,r){e.issues.length&&t.issues.push(...zd(r,e.issues)),t.value[r]=e.value}const wm=hd("$ZodArray",(e,t)=>{Gp.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=>xm(t,r,e))):xm(o,r,e)}return s.length?Promise.all(s).then(()=>r):r}});function Sm(e,t,r,n,a){if(e.issues.length){if(a&&!(r in n))return;t.issues.push(...zd(r,e.issues))}void 0===e.value?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function km(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 Em(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=>Sm(e,r,a,t,u))):Sm(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 Cm=hd("$ZodObject",(e,t)=>{Gp.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=wd(()=>km(t));Cd(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=Pd,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=>Sm(r,t,e,o,a))):Sm(s,t,e,o,a)}return s?Em(c,o,t,r,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Nm=hd("$ZodObjectJIT",(e,t)=>{Cm.init(e,t);const r=e._zod.parse,n=wd(()=>km(t));let a;const s=Pd,i=!bd.jitless,o=i&&Td.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 Vp(["shape","payload","ctx"]),r=n.value,a=e=>{const t=_d(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=_d(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?Em([],p,u,d,l,e):u):r(u,d):(u.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),u)}});function Am(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=>!Od(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=>Bd(e,n,vd())))}),t)}const _m=hd("$ZodUnion",(e,t)=>{Gp.init(e,t),Cd(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Cd(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Cd(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Cd(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=>kd(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=>Am(t,a,e,s)):Am(o,a,e,s)}}),jm=hd("$ZodIntersection",(e,t)=>{Gp.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])=>Tm(e,t,r)):Tm(e,a,s)}});function Pm(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(Rd(e)&&Rd(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=Pm(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=Pm(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 Tm(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}),Od(e))return e;const i=Pm(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 Rm=hd("$ZodEnum",(e,t)=>{Gp.init(e,t);const r=yd(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(e=>Id.has(typeof e)).map(e=>"string"==typeof e?Ud(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}}),Dm=hd("$ZodTransform",(e,t)=>{Gp.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new gd(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 fd;return r.value=a,r}});function Im(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Um=hd("$ZodOptional",(e,t)=>{Gp.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Cd(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Cd(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${kd(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=>Im(t,e.value)):Im(n,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),Mm=hd("$ZodExactOptional",(e,t)=>{Um.init(e,t),Cd(e._zod,"values",()=>t.innerType._zod.values),Cd(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),Lm=hd("$ZodNullable",(e,t)=>{Gp.init(e,t),Cd(e._zod,"optin",()=>t.innerType._zod.optin),Cd(e._zod,"optout",()=>t.innerType._zod.optout),Cd(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${kd(e.source)}|null)$`):void 0}),Cd(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)}),Om=hd("$ZodDefault",(e,t)=>{Gp.init(e,t),e._zod.optin="optional",Cd(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=>zm(e,t)):zm(n,t)}});function zm(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Fm=hd("$ZodPrefault",(e,t)=>{Gp.init(e,t),e._zod.optin="optional",Cd(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))}),Bm=hd("$ZodNonOptional",(e,t)=>{Gp.init(e,t),Cd(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=>Wm(t,e)):Wm(a,e)}});function Wm(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 Vm=hd("$ZodCatch",(e,t)=>{Gp.init(e,t),Cd(e._zod,"optin",()=>t.innerType._zod.optin),Cd(e._zod,"optout",()=>t.innerType._zod.optout),Cd(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=>Bd(e,r,vd()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>Bd(e,r,vd()))},input:e.value}),e.issues=[]),e)}}),Hm=hd("$ZodPipe",(e,t)=>{Gp.init(e,t),Cd(e._zod,"values",()=>t.in._zod.values),Cd(e._zod,"optin",()=>t.in._zod.optin),Cd(e._zod,"optout",()=>t.out._zod.optout),Cd(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=>Gm(e,t.in,r)):Gm(n,t.in,r)}const n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>Gm(e,t.out,r)):Gm(n,t.out,r)}});function Gm(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const $m=hd("$ZodReadonly",(e,t)=>{Gp.init(e,t),Cd(e._zod,"propValues",()=>t.innerType._zod.propValues),Cd(e._zod,"values",()=>t.innerType._zod.values),Cd(e._zod,"optin",()=>t.innerType?._zod?.optin),Cd(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(Km):Km(n)}});function Km(e){return e.value=Object.freeze(e.value),e}const qm=hd("$ZodCustom",(e,t)=>{Tp.init(e,t),Gp.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=>Zm(t,r,n,e));Zm(a,r,n,e)}});function Zm(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(Vd(e))}}var Jm;class Ym{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)}}(Jm=globalThis).__zod_globalRegistry??(Jm.__zod_globalRegistry=new Ym);const Xm=globalThis.__zod_globalRegistry;function Qm(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ld(t)})}function eh(e,t){return new Rp({check:"max_length",...Ld(t),maximum:e})}function th(e,t){return new Dp({check:"min_length",...Ld(t),minimum:e})}function rh(e,t){return new Ip({check:"length_equals",...Ld(t),length:e})}function nh(e){return new Wp({check:"overwrite",tx:e})}function ah(e){const t=function(e,t){const r=new Tp({check:"custom",...Ld(t)});return r._zod.check=e,r}(r=>(r.addIssue=e=>{if("string"==typeof e)r.issues.push(Vd(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(Vd(n))}},e(r.value,r)));return t}function sh(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??Xm,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 ih(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),ih(s,t,n),t.seen.get(s).isParent=!0)}const c=t.metadataRegistry.get(e);c&&Object.assign(i.schema,c),"input"===t.io&&lh(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 oh(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 ch(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:uh(t,"input",e.processors),output:uh(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw new Error("Error converting schema to JSON.")}}function lh(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 lh(n.element,r);if("set"===n.type)return lh(n.valueType,r);if("lazy"===n.type)return lh(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 lh(n.innerType,r);if("intersection"===n.type)return lh(n.left,r)||lh(n.right,r);if("record"===n.type||"map"===n.type)return lh(n.keyType,r)||lh(n.valueType,r);if("pipe"===n.type)return lh(n.in,r)||lh(n.out,r);if("object"===n.type){for(const e in n.shape)if(lh(n.shape[e],r))return!0;return!1}if("union"===n.type){for(const e of n.options)if(lh(e,r))return!0;return!1}if("tuple"===n.type){for(const e of n.items)if(lh(e,r))return!0;return!(!n.rest||!lh(n.rest,r))}return!1}const uh=(e,t,r={})=>n=>{const{libraryOptions:a,target:s}=n??{},i=sh({...a??{},target:s,io:t,processors:r});return ih(e,i),oh(i,e),ch(i,e)},dh={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ph=(e,t,r,n)=>{const a=e._zod.def;ih(a.innerType,t,n);t.seen.get(e).ref=a.innerType};function mh(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}function hh(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]=Au(i,t,r,a,l?[].concat(l,n.message):n.message)}e.shift()}return r}function fh(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]=Au(i,t,r,a,l?[].concat(l,n.message):n.message)}e.shift()}return r}function gh(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(mh(function(){return Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return s.shouldUseNativeValidation&&ud({},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:dd(hh(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(mh(function(){return Promise.resolve(("sync"===r.mode?qd:Jd)(e,n,t)).then(function(e){return s.shouldUseNativeValidation&&ud({},s),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return e instanceof Gd}(e))return{values:{},errors:dd(fh(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 bh=hd("ZodISODateTime",(e,t)=>{sm.init(e,t),Wh.init(e,t)});function vh(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ld(t)})}(bh,e)}const yh=hd("ZodISODate",(e,t)=>{im.init(e,t),Wh.init(e,t)});function xh(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Ld(t)})}(yh,e)}const wh=hd("ZodISOTime",(e,t)=>{om.init(e,t),Wh.init(e,t)});function Sh(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ld(t)})}(wh,e)}const kh=hd("ZodISODuration",(e,t)=>{cm.init(e,t),Wh.init(e,t)});function Eh(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ld(t)})}(kh,e)}const Ch=hd("ZodError",(e,t)=>{Gd.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,xd,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,xd,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),Nh=Kd(Ch),Ah=Zd(Ch),_h=Yd(Ch),jh=Qd(Ch),Ph=tp(Ch),Th=rp(Ch),Rh=np(Ch),Dh=ap(Ch),Ih=sp(Ch),Uh=ip(Ch),Mh=op(Ch),Lh=cp(Ch),Oh=hd("ZodType",(e,t)=>(Gp.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:uh(e,"input"),output:uh(e,"output")}}),e.toJSONSchema=((e,t={})=>r=>{const n=sh({...r,processors:t});return ih(e,n),oh(n,e),ch(n,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(Ad(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)=>Md(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>Nh(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>_h(e,t,r),e.parseAsync=async(t,r)=>Ah(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>jh(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>Ph(e,t,r),e.decode=(t,r)=>Th(e,t,r),e.encodeAsync=async(t,r)=>Rh(e,t,r),e.decodeAsync=async(t,r)=>Dh(e,t,r),e.safeEncode=(t,r)=>Ih(e,t,r),e.safeDecode=(t,r)=>Uh(e,t,r),e.safeEncodeAsync=async(t,r)=>Mh(e,t,r),e.safeDecodeAsync=async(t,r)=>Lh(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,...Ld(r)})}(Rf,e,t)}(t,r)),e.superRefine=t=>e.check(ah(t)),e.overwrite=t=>e.check(nh(t)),e.optional=()=>wf(e),e.exactOptional=()=>new Sf({type:"optional",innerType:e}),e.nullable=()=>Ef(e),e.nullish=()=>wf(Ef(e)),e.nonoptional=t=>function(e,t){return new Af({type:"nonoptional",innerType:e,...Ld(t)})}(e,t),e.array=()=>{return function(e,t,r){return new e({type:"array",element:t,...Ld(r)})}(mf,e,t);var t},e.or=t=>function(e,t){return new gf({type:"union",options:e,...Ld(t)})}([e,t]),e.and=t=>new bf({type:"intersection",left:e,right:t}),e.transform=t=>Pf(e,new yf({type:"transform",transform:t})),e.default=t=>{return r=t,new Cf({type:"default",innerType:e,get defaultValue(){return"function"==typeof r?r():Dd(r)}});var r},e.prefault=t=>{return r=t,new Nf({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof r?r():Dd(r)}});var r},e.catch=t=>{return new _f({type:"catch",innerType:e,catchValue:"function"==typeof(r=t)?r:()=>r});var r},e.pipe=t=>Pf(e,t),e.readonly=()=>new Tf({type:"readonly",innerType:e}),e.describe=t=>{const r=e.clone();return Xm.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>Xm.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Xm.get(e);const r=e.clone();return Xm.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),zh=hd("_ZodString",(e,t)=>{$p.init(e,t),Oh.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=dh[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 Mp({check:"string_format",format:"regex",...Ld(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new zp({check:"string_format",format:"includes",...Ld(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Fp({check:"string_format",format:"starts_with",...Ld(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Bp({check:"string_format",format:"ends_with",...Ld(t),suffix:e})}(...t)),e.min=(...t)=>e.check(th(...t)),e.max=(...t)=>e.check(eh(...t)),e.length=(...t)=>e.check(rh(...t)),e.nonempty=(...t)=>e.check(th(1,...t)),e.lowercase=t=>e.check(function(e){return new Lp({check:"string_format",format:"lowercase",...Ld(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Op({check:"string_format",format:"uppercase",...Ld(e)})}(t)),e.trim=()=>e.check(nh(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return nh(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(nh(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(nh(e=>e.toUpperCase())),e.slugify=()=>e.check(nh(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}),Fh=hd("ZodString",(e,t)=>{$p.init(e,t),zh.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ld(t)})}(Vh,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ld(t)})}($h,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ld(t)})}(cf,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ld(t)})}(Kh,t)),e.guid=t=>e.check(Qm(Hh,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ld(t)})}(Gh,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ld(t)})}(Gh,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ld(t)})}(Gh,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ld(t)})}(Gh,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ld(t)})}(qh,t)),e.guid=t=>e.check(Qm(Hh,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ld(t)})}(Zh,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ld(t)})}(Jh,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ld(t)})}(Yh,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ld(t)})}(af,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ld(t)})}(sf,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ld(t)})}(Xh,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ld(t)})}(Qh,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ld(t)})}(ef,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ld(t)})}(tf,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ld(t)})}(rf,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ld(t)})}(nf,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ld(t)})}(of,t)),e.datetime=t=>e.check(vh(t)),e.date=t=>e.check(xh(t)),e.time=t=>e.check(Sh(t)),e.duration=t=>e.check(Eh(t))});function Bh(e){return function(e,t){return new e({type:"string",...Ld(t)})}(Fh,e)}const Wh=hd("ZodStringFormat",(e,t)=>{Kp.init(e,t),zh.init(e,t)}),Vh=hd("ZodEmail",(e,t)=>{Jp.init(e,t),Wh.init(e,t)}),Hh=hd("ZodGUID",(e,t)=>{qp.init(e,t),Wh.init(e,t)}),Gh=hd("ZodUUID",(e,t)=>{Zp.init(e,t),Wh.init(e,t)}),$h=hd("ZodURL",(e,t)=>{Yp.init(e,t),Wh.init(e,t)}),Kh=hd("ZodEmoji",(e,t)=>{Xp.init(e,t),Wh.init(e,t)}),qh=hd("ZodNanoID",(e,t)=>{Qp.init(e,t),Wh.init(e,t)}),Zh=hd("ZodCUID",(e,t)=>{em.init(e,t),Wh.init(e,t)}),Jh=hd("ZodCUID2",(e,t)=>{tm.init(e,t),Wh.init(e,t)}),Yh=hd("ZodULID",(e,t)=>{rm.init(e,t),Wh.init(e,t)}),Xh=hd("ZodXID",(e,t)=>{nm.init(e,t),Wh.init(e,t)}),Qh=hd("ZodKSUID",(e,t)=>{am.init(e,t),Wh.init(e,t)}),ef=hd("ZodIPv4",(e,t)=>{lm.init(e,t),Wh.init(e,t)}),tf=hd("ZodIPv6",(e,t)=>{um.init(e,t),Wh.init(e,t)}),rf=hd("ZodCIDRv4",(e,t)=>{dm.init(e,t),Wh.init(e,t)}),nf=hd("ZodCIDRv6",(e,t)=>{pm.init(e,t),Wh.init(e,t)}),af=hd("ZodBase64",(e,t)=>{hm.init(e,t),Wh.init(e,t)}),sf=hd("ZodBase64URL",(e,t)=>{fm.init(e,t),Wh.init(e,t)}),of=hd("ZodE164",(e,t)=>{gm.init(e,t),Wh.init(e,t)}),cf=hd("ZodJWT",(e,t)=>{bm.init(e,t),Wh.init(e,t)}),lf=hd("ZodUnknown",(e,t)=>{vm.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{}});function uf(){return new lf({type:"unknown"})}const df=hd("ZodNever",(e,t)=>{ym.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r)=>{r.not={}})(0,0,t)});function pf(e){return function(e,t){return new e({type:"never",...Ld(t)})}(df,e)}const mf=hd("ZodArray",(e,t)=>{wm.init(e,t),Oh.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=ih(s.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element,e.min=(t,r)=>e.check(th(t,r)),e.nonempty=t=>e.check(th(1,t)),e.max=(t,r)=>e.check(eh(t,r)),e.length=(t,r)=>e.check(rh(t,r)),e.unwrap=()=>e.element});const hf=hd("ZodObject",(e,t)=>{Nm.init(e,t),Oh.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]=ih(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=ih(s.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(a.additionalProperties=!1)})(e,t,r,n),Cd(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new vf({type:"enum",entries:r,...Ld(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:uf()}),e.loose=()=>e.clone({...e._zod.def,catchall:uf()}),e.strict=()=>e.clone({...e._zod.def,catchall:pf()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Rd(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=Ad(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Nd(this,"shape",r),r}});return Md(e,n)}(e,t),e.safeExtend=t=>function(e,t){if(!Rd(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Ad(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Nd(this,"shape",r),r}});return Md(e,r)}(e,t),e.merge=t=>function(e,t){const r=Ad(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Nd(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Md(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 Md(e,Ad(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 Nd(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=Ad(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 Nd(this,"shape",n),n},checks:[]});return Md(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=Ad(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 Nd(this,"shape",a),a},checks:[]});return Md(t,a)}(xf,e,t[0]),e.required=(...t)=>function(e,t,r){const n=Ad(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 Nd(this,"shape",a),a}});return Md(t,n)}(Af,e,t[0])});function ff(e,t){const r={type:"object",shape:e??{},...Ld(t)};return new hf(r)}const gf=hd("ZodUnion",(e,t)=>{_m.init(e,t),Oh.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)=>ih(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 bf=hd("ZodIntersection",(e,t)=>{jm.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s=ih(a.left,t,{...n,path:[...n.path,"allOf",0]}),i=ih(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 vf=hd("ZodEnum",(e,t)=>{Rm.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{const n=yd(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 vf({...t,checks:[],...Ld(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 vf({...t,checks:[],...Ld(n),entries:a})}});const yf=hd("ZodTransform",(e,t)=>{Dm.init(e,t),Oh.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 gd(e.constructor.name);r.addIssue=n=>{if("string"==typeof n)r.issues.push(Vd(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(Vd(t))}};const a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r)):(r.value=a,r)}});const xf=hd("ZodOptional",(e,t)=>{Um.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>ph(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});function wf(e){return new xf({type:"optional",innerType:e})}const Sf=hd("ZodExactOptional",(e,t)=>{Mm.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>ph(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const kf=hd("ZodNullable",(e,t)=>{Lm.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s=ih(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 Ef(e){return new kf({type:"nullable",innerType:e})}const Cf=hd("ZodDefault",(e,t)=>{Om.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;ih(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 Nf=hd("ZodPrefault",(e,t)=>{Fm.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;ih(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 Af=hd("ZodNonOptional",(e,t)=>{Bm.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;ih(a.innerType,t,n),t.seen.get(e).ref=a.innerType})(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const _f=hd("ZodCatch",(e,t)=>{Vm.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;let s;ih(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 jf=hd("ZodPipe",(e,t)=>{Hm.init(e,t),Oh.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;ih(s,t,n),t.seen.get(e).ref=s})(e,t,0,n),e.in=t.in,e.out=t.out});function Pf(e,t){return new jf({type:"pipe",in:e,out:t})}const Tf=hd("ZodReadonly",(e,t)=>{$m.init(e,t),Oh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;ih(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 Rf=hd("ZodCustom",(e,t)=>{qm.init(e,t),Oh.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 Df={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:"฿"},If={usd:"🇺🇸",eur:"🇪🇺",gbp:"🇬🇧",jpy:"🇯🇵",cad:"🇨🇦",aud:"🇦🇺",chf:"🇨🇭",cny:"🇨🇳",hkd:"🇭🇰",sgd:"🇸🇬",inr:"🇮🇳",mxn:"🇲🇽",brl:"🇧🇷",nzd:"🇳🇿",sek:"🇸🇪",nok:"🇳🇴",dkk:"🇩🇰",pln:"🇵🇱",thb:"🇹🇭"};function Uf(e){return e&&e.trim()?If[e.trim().toLowerCase()]??"":""}function Mf(e){if(!e||!e.trim())return"";const t=e.trim().toLowerCase();return Df[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()} (${Mf(e)})`}));var Lf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=ms(`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}},{}),Of=a.forwardRef((t,r)=>e.jsx(Lf.label,{...t,ref:r,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));Of.displayName="Label";var zf=Of;const Ff=xs("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Bf=a.forwardRef(({className:t,...r},n)=>e.jsx(zf,{ref:n,className:Se(Ff(),t),...r}));Bf.displayName=zf.displayName;const Wf=Nu,Vf=a.createContext({}),Hf=({...t})=>e.jsx(Vf.Provider,{value:{name:t.name},children:e.jsx(Eu,{...t})}),Gf=()=>{const e=a.useContext(Vf),r=a.useContext($f),{getFieldState:n,formState:s}=t.useContext(Cu),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}},$f=a.createContext({}),Kf=a.forwardRef(({className:t,...r},n)=>{const s=a.useId();return e.jsx($f.Provider,{value:{id:s},children:e.jsx("div",{ref:n,className:Se("space-y-2",t),...r})})});Kf.displayName="FormItem";const qf=a.forwardRef(({className:t,...r},n)=>{const{error:a,formItemId:s}=Gf();return e.jsx(Bf,{ref:n,className:Se(a&&"text-destructive",t),htmlFor:s,...r})});qf.displayName="FormLabel";const Zf=a.forwardRef(({...t},r)=>{const{error:n,formItemId:a,formDescriptionId:s,formMessageId:i}=Gf();return e.jsx(hs,{ref:r,id:a,"aria-describedby":n?`${s} ${i}`:`${s}`,"aria-invalid":!!n,...t})});Zf.displayName="FormControl";const Jf=a.forwardRef(({className:t,...r},n)=>{const{formDescriptionId:a}=Gf();return e.jsx("p",{ref:n,id:a,className:Se("text-sm text-muted-foreground",t),...r})});Jf.displayName="FormDescription";const Yf=a.forwardRef(({className:t,children:r,...n},a)=>{const{error:s,formMessageId:i}=Gf(),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});Yf.displayName="FormMessage";const Xf=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 Qf(t){const r=eg(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(rg);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 eg(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?cs(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}Xf.displayName="Input";var tg=Symbol("radix.slottable");function rg(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===tg}function ng(r){const n=r+"CollectionProvider",[a,s]=Es(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=Qf(l),d=t.forwardRef((t,r)=>{const{scope:n,children:a}=t,s=ls(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=Qf(p),f=t.forwardRef((r,n)=>{const{scope:a,children:s,...i}=r,c=t.useRef(null),l=ls(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 ag=a.createContext(void 0);function sg(e){const t=a.useContext(ag);return e||t||"ltr"}var ig="rovingFocusGroup.onEntryFocus",og={bubbles:!1,cancelable:!0},cg="RovingFocusGroup",[lg,ug,dg]=ng(cg),[pg,mg]=Es(cg,[dg]),[hg,fg]=pg(cg),gg=a.forwardRef((t,r)=>e.jsx(lg.Provider,{scope:t.__scopeRovingFocusGroup,children:e.jsx(lg.Slot,{scope:t.__scopeRovingFocusGroup,children:e.jsx(bg,{...t,ref:r})})}));gg.displayName=cg;var bg=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=ls(r,h),g=sg(o),[b,v]=Ts({prop:c,defaultProp:l??null,onChange:u,caller:cg}),[y,x]=a.useState(!1),w=Ms(d),S=ug(n),k=a.useRef(!1),[E,C]=a.useState(0);return a.useEffect(()=>{const e=h.current;if(e)return e.addEventListener(ig,w),()=>e.removeEventListener(ig,w)},[w]),e.jsx(hg,{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(Us.div,{tabIndex:y||0===E?-1:0,"data-orientation":s,...m,ref:f,style:{outline:"none",...t.style},onMouseDown:ks(t.onMouseDown,()=>{k.current=!0}),onFocus:ks(t.onFocus,e=>{const t=!k.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(ig,og);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter(e=>e.focusable);wg([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),p)}}k.current=!1}),onBlur:ks(t.onBlur,()=>x(!1))})})}),vg="RovingFocusGroupItem",yg=a.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:i=!1,tabStopId:o,children:c,...l}=t,u=js(),d=o||u,p=fg(vg,n),m=p.currentTabStopId===d,h=ug(n),{onFocusableItemAdd:f,onFocusableItemRemove:g,currentTabStopId:b}=p;return a.useEffect(()=>{if(s)return f(),()=>g()},[s,f,g]),e.jsx(lg.ItemSlot,{scope:n,id:d,focusable:s,active:i,children:e.jsx(Us.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...l,ref:r,onMouseDown:ks(t.onMouseDown,e=>{s?p.onItemFocus(d):e.preventDefault()}),onFocus:ks(t.onFocus,()=>p.onItemFocus(d)),onKeyDown:ks(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:xg[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(()=>wg(r))}}),children:"function"==typeof c?c({isCurrentTabStop:m,hasTabStop:null!=b}):c})})});yg.displayName=vg;var xg={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function wg(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 Sg=gg,kg=yg,Eg="Radio",[Cg,Ng]=Es(Eg),[Ag,_g]=Cg(Eg),jg=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=ls(r,e=>h(e)),g=a.useRef(!1),b=!m||(d||!!m.closest("form"));return e.jsxs(Ag,{scope:n,checked:i,disabled:c,children:[e.jsx(Us.button,{type:"button",role:"radio","aria-checked":i,"data-state":Dg(i),"data-disabled":c?"":void 0,disabled:c,value:l,...p,ref:f,onClick:ks(t.onClick,e=>{i||u?.(),b&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),b&&e.jsx(Rg,{control:m,bubbles:!g.current,name:s,value:l,checked:i,required:o,disabled:c,form:d,style:{transform:"translateX(-100%)"}})]})});jg.displayName=Eg;var Pg="RadioIndicator",Tg=a.forwardRef((t,r)=>{const{__scopeRadio:n,forceMount:a,...s}=t,i=_g(Pg,n);return e.jsx(ri,{present:a||i.checked,children:e.jsx(Us.span,{"data-state":Dg(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:r})})});Tg.displayName=Pg;var Rg=a.forwardRef(({__scopeRadio:t,control:r,checked:n,bubbles:s=!0,...i},o)=>{const c=a.useRef(null),l=ls(c,o),u=Sl(n),d=kl(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(Us.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 Dg(e){return e?"checked":"unchecked"}Rg.displayName="RadioBubbleInput";var Ig=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ug="RadioGroup",[Mg]=Es(Ug,[mg,Ng]),Lg=mg(),Og=Ng(),[zg,Fg]=Mg(Ug),Bg=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=Lg(n),f=sg(u),[g,b]=Ts({prop:i,defaultProp:s??null,onChange:p,caller:Ug});return e.jsx(zg,{scope:n,name:a,required:o,disabled:c,value:g,onValueChange:b,children:e.jsx(Sg,{asChild:!0,...h,orientation:l,dir:f,loop:d,children:e.jsx(Us.div,{role:"radiogroup","aria-required":o,"aria-orientation":l,"data-disabled":c?"":void 0,dir:f,...m,ref:r})})})});Bg.displayName=Ug;var Wg="RadioGroupItem",Vg=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,disabled:s,...i}=t,o=Fg(Wg,n),c=o.disabled||s,l=Lg(n),u=Og(n),d=a.useRef(null),p=ls(r,d),m=o.value===i.value,h=a.useRef(!1);return a.useEffect(()=>{const e=e=>{Ig.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(kg,{asChild:!0,...l,focusable:!c,active:m,children:e.jsx(jg,{disabled:c,required:o.required,checked:m,...u,...i,name:o.name,ref:p,onCheck:()=>o.onValueChange(i.value),onKeyDown:ks(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:ks(i.onFocus,()=>{h.current&&d.current?.click()})})})});Vg.displayName=Wg;var Hg=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,...a}=t,s=Og(n);return e.jsx(Tg,{...s,...a,ref:r})});Hg.displayName="RadioGroupIndicator";var Gg=Bg,$g=Vg,Kg=Hg;const qg=a.forwardRef(({className:t,...r},n)=>e.jsx(Gg,{className:Se("grid gap-2",t),...r,ref:n}));qg.displayName=Gg.displayName;const Zg=a.forwardRef(({className:t,...r},n)=>e.jsx($g,{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(Kg,{className:"flex items-center justify-center",children:e.jsx(Jo,{className:"h-3.5 w-3.5 fill-primary"})})}));function Jg(e,[t,r]){return Math.min(r,Math.max(t,e))}Zg.displayName=$g.displayName;var Yg="ScrollArea",[Xg]=Es(Yg),[Qg,eb]=Xg(Yg),tb=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=ls(r,e=>u(e)),_=sg(i);return e.jsx(Qg,{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(Us.div,{dir:_,...c,ref:A,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":w+"px",...t.style}})})});tb.displayName=Yg;var rb="ScrollAreaViewport",nb=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,children:s,nonce:i,...o}=t,c=eb(rb,n),l=ls(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(Us.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})})]})});nb.displayName=rb;var ab="ScrollAreaScrollbar",sb=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=eb(ab,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(ib,{...s,ref:r,forceMount:n}):"scroll"===i.type?e.jsx(ob,{...s,ref:r,forceMount:n}):"auto"===i.type?e.jsx(cb,{...s,ref:r,forceMount:n}):"always"===i.type?e.jsx(lb,{...s,ref:r}):null});sb.displayName=ab;var ib=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=eb(ab,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(ri,{present:n||o,children:e.jsx(cb,{"data-state":o?"visible":"hidden",...s,ref:r})})}),ob=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=eb(ab,t.__scopeScrollArea),o="horizontal"===t.orientation,c=_b(()=>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(ri,{present:n||"hidden"!==l,children:e.jsx(lb,{"data-state":"hidden"===l?"hidden":"visible",...s,ref:r,onPointerEnter:ks(t.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:ks(t.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),cb=a.forwardRef((t,r)=>{const n=eb(ab,t.__scopeScrollArea),{forceMount:s,...i}=t,[o,c]=a.useState(!1),l="horizontal"===t.orientation,u=_b(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;c(l?e:t)}},10);return jb(n.viewport,u),jb(n.content,u),e.jsx(ri,{present:s||o,children:e.jsx(lb,{"data-state":o?"visible":"hidden",...i,ref:r})})}),lb=a.forwardRef((t,r)=>{const{orientation:n="vertical",...s}=t,i=eb(ab,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=Sb(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=kb(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 Cb([c,l],d)(e)}(e,c.current,l,t)}return"horizontal"===n?e.jsx(ub,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&o.current){const e=Eb(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(db,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&o.current){const e=Eb(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}),ub=a.forwardRef((t,r)=>{const{sizes:n,onSizesChange:s,...i}=t,o=eb(ab,t.__scopeScrollArea),[c,l]=a.useState(),u=a.useRef(null),d=ls(r,u,o.onScrollbarXChange);return a.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),e.jsx(hb,{"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":kb(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),Nb(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:wb(c.paddingLeft),paddingEnd:wb(c.paddingRight)}})}})}),db=a.forwardRef((t,r)=>{const{sizes:n,onSizesChange:s,...i}=t,o=eb(ab,t.__scopeScrollArea),[c,l]=a.useState(),u=a.useRef(null),d=ls(r,u,o.onScrollbarYChange);return a.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),e.jsx(hb,{"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":kb(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),Nb(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:wb(c.paddingTop),paddingEnd:wb(c.paddingBottom)}})}})}),[pb,mb]=Xg(ab),hb=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=eb(ab,n),[g,b]=a.useState(null),v=ls(r,e=>b(e)),y=a.useRef(null),x=a.useRef(""),w=f.viewport,S=s.content-s.viewport,k=Ms(p),E=Ms(u),C=_b(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]),jb(g,C),jb(f.content,C),e.jsx(pb,{scope:n,scrollbar:g,hasThumb:i,onThumbChange:Ms(o),onThumbPointerUp:Ms(c),onThumbPositionChange:E,onThumbPointerDown:Ms(l),children:e.jsx(Us.div,{...h,ref:v,style:{position:"absolute",...h.style},onPointerDown:ks(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:ks(t.onPointerMove,N),onPointerUp:ks(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})})})}),fb="ScrollAreaThumb",gb=a.forwardRef((t,r)=>{const{forceMount:n,...a}=t,s=mb(fb,t.__scopeScrollArea);return e.jsx(ri,{present:n||s.hasThumb,children:e.jsx(bb,{ref:r,...a})})}),bb=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,style:s,...i}=t,o=eb(fb,n),c=mb(fb,n),{onThumbPositionChange:l}=c,u=ls(r,e=>c.onThumbChange(e)),d=a.useRef(void 0),p=_b(()=>{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=Ab(e,l);d.current=t,l()}};return l(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,p,l]),e.jsx(Us.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:ks(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:ks(t.onPointerUp,c.onThumbPointerUp)})});gb.displayName=fb;var vb="ScrollAreaCorner",yb=a.forwardRef((t,r)=>{const n=eb(vb,t.__scopeScrollArea),a=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&a?e.jsx(xb,{...t,ref:r}):null});yb.displayName=vb;var xb=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,...s}=t,i=eb(vb,n),[o,c]=a.useState(0),[l,u]=a.useState(0),d=Boolean(o&&l);return jb(i.scrollbarX,()=>{const e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),u(e)}),jb(i.scrollbarY,()=>{const e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),c(e)}),d?e.jsx(Us.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 wb(e){return e?parseInt(e,10):0}function Sb(e,t){const r=e/t;return isNaN(r)?0:r}function kb(e){const t=Sb(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function Eb(e,t,r="ltr"){const n=kb(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-a,i=t.content-t.viewport,o=s-n,c=Jg(e,"ltr"===r?[0,i]:[-1*i,0]);return Cb([0,i],[0,o])(c)}function Cb(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 Nb(e,t){return e>0&&e<t}var Ab=(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 _b(e,t){const r=Ms(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 jb(e,t){const r=Ms(t);Ns(()=>{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 Pb=tb,Tb=nb,Rb=yb;const Db=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(Pb,{ref:a,className:Se("relative overflow-hidden",t),...n,children:[e.jsx(Tb,{className:"h-full w-full rounded-[inherit]",children:r}),e.jsx(Ib,{}),e.jsx(Rb,{})]}));Db.displayName=Pb.displayName;const Ib=a.forwardRef(({className:t,orientation:r="vertical",...n},a)=>e.jsx(sb,{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(gb,{className:Se("relative rounded-full bg-border","vertical"===r&&"flex-1")})}));function Ub(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>`}Ib.displayName=sb.displayName;const Mb=["🏢","🏬","🏣","🏤","🏦","🏛️","🏠","🏡","🏭","🏗️","🏪","🏨","🏫","🏥","💼","📊","📈","📉","📋","📁","📂","🗂️","🗃️","🗄️","📅","🗓️","📝","🖋️","✏️","🖊️","🖌️","🖍️","📇","📌","📍","📎","🖇️","💻","🖥️","🖨️","🖱️","⌨️","📱","📲","📡","🌐","🔗","🔒","🔓","⚙️","🔧","🛠️","🧑💻","👨💻","👩💻","🕹️","💾","📟","🖥️","🖲️","🚀","💡","🎨","🖼️","🧪","🔬","🧬","🎯","⚡","🎲","🎮","🧩","📷","🎥","✉️","📨","📩","📧","📞","☎️","📠","🗣️","💬","🗨️","📢","📣","🔔","🛎️","💰","💸","💳","🏦","📈","📉","⚖️","🧾","🪙","🏛️","⚗️","🧪","🔭","🔬","🩺","🧬","🩻","🏥","🌱","🌍","🌏","🌎","🌡️","👨💼","👩💼","👨🏫","👩🏫","👨🔬","👩🔬","👨🎨","👩🎨","👨🔧","👩🔧","👨🚀","👩🚀","👨⚖️","👩⚖️","🏅","🎖️","🥇","🥈","🥉","🏆","🎗️","🔑","🗝️","🧭","🛡️","🚩","🏳️🌈","🎟️","🎫"],Lb=({workspace:r})=>{const{t:n}=nn(),{updateWorkspace:a}=Ik(),{can:s}=vl(),[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=cd({resolver:gh(ff({name:Bh().min(2,{message:n("general.nameMinLength")}),image:Bh().optional()})),defaultValues:{name:r.name||"",image:r.image||""}});if(!r)return e.jsx(xl,{});const g=s(rl.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(Wf,{...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(Hf,{control:f.control,name:"name",render:({field:t})=>e.jsxs(Kf,{children:[e.jsx(qf,{children:n("general.name")}),e.jsx(Zf,{children:e.jsx(Xf,{placeholder:n("general.namePlaceholder"),...t,disabled:!g})}),e.jsx(Yf,{})]})}),r.billingCurrency?.trim()&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Bf,{className:"text-sm font-medium text-muted-foreground",children:n("general.billingCurrency")}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[Uf(r.billingCurrency)&&e.jsx("span",{className:"text-base",children:Uf(r.billingCurrency)}),e.jsx("span",{children:r.billingCurrency.trim().toUpperCase()})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(Bf,{className:"text-sm font-medium",children:n("general.icon")}),e.jsx(Jf,{children:n("general.iconDescription")})]}),e.jsxs(qg,{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(Zg,{value:"emoji",id:"emoji"}),e.jsxs(Bf,{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(Zg,{value:"url",id:"url"}),e.jsxs(Bf,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(Va,{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(Db,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Mb.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{d(e),f.setValue("image",Ub(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(Hf,{control:f.control,name:"image",render:({field:t})=>e.jsxs(Kf,{children:[e.jsx(qf,{children:n("general.imageUrl")}),e.jsx(Zf,{children:e.jsx(Xf,{placeholder:n("general.imageUrlPlaceholder"),...t,disabled:!g})}),e.jsx(Jf,{children:n("general.imageUrlDescription")}),e.jsx(Yf,{})]})}),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(Ss,{type:"submit",disabled:i,progress:i,children:n("general.updateWorkspace")})})]})})]})};class Ob extends hn{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 zb=t.createContext(null);function Fb(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 Bb=t.memo(function({children:r,serviceWorkerPath:n="/push-sw.js",autoSubscribe:a=!1}){const{t:s}=nn(),i=xn(),{isAuthenticated:o}=bl(),c=t.useMemo(()=>"undefined"!=typeof window&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window,[]),l=t.useMemo(()=>new Ob({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:Fb(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(zb.Provider,{value:f,children:r})});function Wb(){const e=t.useContext(zb);if(!e)throw new Error("usePushNotifications must be used within PushNotificationProvider");return e}const Vb={firefox:4,safari:4,edge:4,chrome:4},Hb=({workspace:r})=>{const{isSupported:n,permission:a,isSubscribed:s,loading:i,error:o,subscribe:c,unsubscribe:l}=Wb(),{t:u}=nn(),{api:d}=kn(),{can:p}=vl(),m=p(rl.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=Vb[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(Ya,{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(Da,{className:"h-4 w-4 text-green-600"}):e.jsx(Ra,{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(Ss,{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(Ga,{className:"h-3.5 w-3.5 text-gray-400"})}),e.jsx("div",{className:"w-12 flex justify-center",children:e.jsx(Qa,{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(Ul,{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(Ul,{checked:n,onCheckedChange:()=>j(t.slug,"push",n),disabled:s}):e.jsx("span",{className:"text-xs text-gray-300",children:"—"})})]})]},t.slug)})]})]},t))]})]})},Gb=({workspace:r})=>{const{t:n}=nn(),{isOwner:a}=vl(),{settings:s}=Sn(),{appPermissions:i}=Wn(),{updateWorkspacePermissions:o}=Ik(),[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(xl,{});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(Ul,{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(Ss,{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 $b=.999,Kb=/[\\\/_+.#"@\[\(\{&]/,qb=/[\\\/_+.#"@\[\(\{&]/g,Zb=/[\s-]/,Jb=/[\s-]/g;function Yb(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=Yb(e,t,r,n,m+1,s+1,i))>h&&(m===a?c*=1:Kb.test(e.charAt(m-1))?(c*=.8,(u=e.slice(a,m-1).match(qb))&&a>0&&(c*=Math.pow($b,u.length))):Zb.test(e.charAt(m-1))?(c*=.9,(d=e.slice(a,m-1).match(Jb))&&a>0&&(c*=Math.pow($b,d.length))):(c*=.17,a>0&&(c*=Math.pow($b,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=Yb(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 Xb(e){return e.toLowerCase().replace(Jb," ")}function Qb(e,t,r){return Yb(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,Xb(e),Xb(t),0,0,{})}var ev='[cmdk-group=""]',tv='[cmdk-group-items=""]',rv='[cmdk-item=""]',nv=`${rv}:not([aria-disabled="true"])`,av="cmdk-item-select",sv="data-value",iv=(e,t,r)=>Qb(e,t,r),ov=a.createContext(void 0),cv=()=>a.useContext(ov),lv=a.createContext(void 0),uv=()=>a.useContext(lv),dv=a.createContext(void 0),pv=a.forwardRef((e,t)=>{let r=Nv(()=>{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=Nv(()=>new Set),s=Nv(()=>new Map),i=Nv(()=>new Map),o=Nv(()=>new Set),c=Ev(e),{label:l,children:u,value:d,onValueChange:p,filter:m,shouldFilter:h,loop:f,disablePointerSelection:g=!1,vimBindings:b=!0,...v}=e,y=js(),x=js(),w=js(),S=a.useRef(null),k=jv();Cv(()=>{if(void 0!==d){let e=d.trim();r.current.value=e,E.emit()}},[d]),Cv(()=>{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:iv;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(tv);t?t.appendChild(e.parentElement===t?e:e.closest(`${tv} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${tv} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=S.current)?void 0:t.querySelector(`${ev}[${sv}="${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(sv);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(ev))?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(`${rv}[aria-selected="true"]`)}function R(){var e;return Array.from((null==(e=S.current)?void 0:e.querySelectorAll(nv))||[])}function D(e){let t=R()[e];t&&E.setState("value",t.getAttribute(sv))}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(sv))}function U(e){let t,r=T(),n=null==r?void 0:r.closest(ev);for(;n&&!t;)n=e>0?Sv(n,ev):kv(n,ev),t=null==n?void 0:n.querySelector(nv);t?E.setState("value",t.getAttribute(sv)):I(e)}let M=()=>D(R().length-1),L=e=>{e.preventDefault(),e.metaKey?M():e.altKey?U(1):I(1)},O=e=>{e.preventDefault(),e.metaKey?D(0):e.altKey?U(-1):I(-1)};return a.createElement(Us.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(),M();break;case"Enter":{e.preventDefault();let t=T();if(t){let e=new Event(av);t.dispatchEvent(e)}}}}},a.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:Tv},l),Pv(e,e=>a.createElement(lv.Provider,{value:E},a.createElement(ov.Provider,{value:C},e))))}),mv=a.forwardRef((e,t)=>{var r,n;let s=js(),i=a.useRef(null),o=a.useContext(dv),c=cv(),l=Ev(e),u=null!=(n=null==(r=l.current)?void 0:r.forceMount)?n:null==o?void 0:o.forceMount;Cv(()=>{if(!u)return c.item(s,null==o?void 0:o.id)},[u]);let d=_v(s,i,[e.value,e.children,i],e.keywords),p=uv(),m=Av(e=>e.value&&e.value===d.current),h=Av(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(av,f),()=>t.removeEventListener(av,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(Us.div,{ref:cs(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)}),hv=a.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:s,...i}=e,o=js(),c=a.useRef(null),l=a.useRef(null),u=js(),d=cv(),p=Av(e=>!(!s&&!1!==d.filter())||(!e.search||e.filtered.groups.has(o)));Cv(()=>d.group(o),[]),_v(o,c,[e.value,e.heading,l]);let m=a.useMemo(()=>({id:o,forceMount:s}),[s]);return a.createElement(Us.div,{ref:cs(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),Pv(e,e=>a.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},a.createElement(dv.Provider,{value:m},e))))}),fv=a.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,s=a.useRef(null),i=Av(e=>!e.search);return r||i?a.createElement(Us.div,{ref:cs(s,t),...n,"cmdk-separator":"",role:"separator"}):null}),gv=a.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,s=null!=e.value,i=uv(),o=Av(e=>e.search),c=Av(e=>e.selectedItemId),l=cv();return a.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),a.createElement(Us.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)}})}),bv=a.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...s}=e,i=a.useRef(null),o=a.useRef(null),c=Av(e=>e.selectedItemId),l=cv();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(Us.div,{ref:cs(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":n,id:l.listId},Pv(e,e=>a.createElement("div",{ref:cs(o,l.listInnerRef),"cmdk-list-sizer":""},e)))}),vv=a.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:i,container:o,...c}=e;return a.createElement(Oo,{open:r,onOpenChange:n},a.createElement(Fo,{container:o},a.createElement(Bo,{"cmdk-overlay":"",className:s}),a.createElement(Wo,{"aria-label":e.label,"cmdk-dialog":"",className:i},a.createElement(pv,{ref:t,...c}))))}),yv=a.forwardRef((e,t)=>Av(e=>0===e.filtered.count)?a.createElement(Us.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),xv=a.forwardRef((e,t)=>{let{progress:r,children:n,label:s="Loading...",...i}=e;return a.createElement(Us.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Pv(e,e=>a.createElement("div",{"aria-hidden":!0},e)))}),wv=Object.assign(pv,{List:bv,Item:mv,Input:gv,Group:hv,Separator:fv,Dialog:vv,Empty:yv,Loading:xv});function Sv(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function kv(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function Ev(e){let t=a.useRef(e);return Cv(()=>{t.current=e}),t}var Cv="undefined"==typeof window?a.useEffect:a.useLayoutEffect;function Nv(e){let t=a.useRef();return void 0===t.current&&(t.current=e()),t}function Av(e){let t=uv(),r=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,r,r)}function _v(e,t,r,n=[]){let s=a.useRef(),i=cv();return Cv(()=>{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(sv,o),s.current=o}),s}var jv=()=>{let[e,t]=a.useState(),r=Nv(()=>new Map);return Cv(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function Pv({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 Tv={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Rv=a.forwardRef(({className:t,...r},n)=>e.jsx(wv,{ref:n,className:Se("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...r}));Rv.displayName=wv.displayName;const Dv=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(wv.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})]}));Dv.displayName=wv.Input.displayName;const Iv=a.forwardRef(({className:t,...r},n)=>e.jsx(wv.List,{ref:n,className:Se("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...r}));Iv.displayName=wv.List.displayName;a.forwardRef((t,r)=>e.jsx(wv.Empty,{ref:r,className:"py-6 text-center text-sm",...t})).displayName=wv.Empty.displayName;const Uv=a.forwardRef(({className:t,...r},n)=>e.jsx(wv.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}));Uv.displayName=wv.Group.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(wv.Separator,{ref:n,className:Se("-mx-1 h-px bg-border",t),...r})).displayName=wv.Separator.displayName;const Mv=a.forwardRef(({className:t,...r},n)=>e.jsx(wv.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}));Mv.displayName=wv.Item.displayName;const Lv=["top","right","bottom","left"],Ov=Math.min,zv=Math.max,Fv=Math.round,Bv=Math.floor,Wv=e=>({x:e,y:e}),Vv={left:"right",right:"left",bottom:"top",top:"bottom"},Hv={start:"end",end:"start"};function Gv(e,t,r){return zv(e,Ov(t,r))}function $v(e,t){return"function"==typeof e?e(t):e}function Kv(e){return e.split("-")[0]}function qv(e){return e.split("-")[1]}function Zv(e){return"x"===e?"y":"x"}function Jv(e){return"y"===e?"height":"width"}const Yv=new Set(["top","bottom"]);function Xv(e){return Yv.has(Kv(e))?"y":"x"}function Qv(e){return Zv(Xv(e))}function ey(e){return e.replace(/start|end/g,e=>Hv[e])}const ty=["left","right"],ry=["right","left"],ny=["top","bottom"],ay=["bottom","top"];function sy(e,t,r,n){const a=qv(e);let s=function(e,t,r){switch(e){case"top":case"bottom":return r?t?ry:ty:t?ty:ry;case"left":case"right":return t?ny:ay;default:return[]}}(Kv(e),"start"===r,n);return a&&(s=s.map(e=>e+"-"+a),t&&(s=s.concat(s.map(ey)))),s}function iy(e){return e.replace(/left|right|bottom|top/g,e=>Vv[e])}function oy(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 cy(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 ly(e,t,r){let{reference:n,floating:a}=e;const s=Xv(t),i=Qv(t),o=Jv(i),c=Kv(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(qv(t)){case"start":m[i]-=p*(r&&l?-1:1);break;case"end":m[i]+=p*(r&&l?-1:1)}return m}async function uy(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}=$v(t,e),h=oy(m),f=o[p?"floating"===d?"reference":"floating":d],g=cy(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=cy(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 dy(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function py(e){return Lv.some(t=>e[t]>=0)}const my=new Set(["left","top"]);function hy(){return"undefined"!=typeof window}function fy(e){return vy(e)?(e.nodeName||"").toLowerCase():"#document"}function gy(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function by(e){var t;return null==(t=(vy(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function vy(e){return!!hy()&&(e instanceof Node||e instanceof gy(e).Node)}function yy(e){return!!hy()&&(e instanceof Element||e instanceof gy(e).Element)}function xy(e){return!!hy()&&(e instanceof HTMLElement||e instanceof gy(e).HTMLElement)}function wy(e){return!(!hy()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof gy(e).ShadowRoot)}const Sy=new Set(["inline","contents"]);function ky(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=Uy(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Sy.has(a)}const Ey=new Set(["table","td","th"]);function Cy(e){return Ey.has(fy(e))}const Ny=[":popover-open",":modal"];function Ay(e){return Ny.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const _y=["transform","translate","scale","rotate","perspective"],jy=["transform","translate","scale","rotate","perspective","filter"],Py=["paint","layout","strict","content"];function Ty(e){const t=Ry(),r=yy(e)?Uy(e):e;return _y.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||jy.some(e=>(r.willChange||"").includes(e))||Py.some(e=>(r.contain||"").includes(e))}function Ry(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Dy=new Set(["html","body","#document"]);function Iy(e){return Dy.has(fy(e))}function Uy(e){return gy(e).getComputedStyle(e)}function My(e){return yy(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ly(e){if("html"===fy(e))return e;const t=e.assignedSlot||e.parentNode||wy(e)&&e.host||by(e);return wy(t)?t.host:t}function Oy(e){const t=Ly(e);return Iy(t)?e.ownerDocument?e.ownerDocument.body:e.body:xy(t)&&ky(t)?t:Oy(t)}function zy(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const a=Oy(e),s=a===(null==(n=e.ownerDocument)?void 0:n.body),i=gy(a);if(s){const e=Fy(i);return t.concat(i,i.visualViewport||[],ky(a)?a:[],e&&r?zy(e):[])}return t.concat(a,zy(a,[],r))}function Fy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function By(e){const t=Uy(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=xy(e),s=a?e.offsetWidth:r,i=a?e.offsetHeight:n,o=Fv(r)!==s||Fv(n)!==i;return o&&(r=s,n=i),{width:r,height:n,$:o}}function Wy(e){return yy(e)?e:e.contextElement}function Vy(e){const t=Wy(e);if(!xy(t))return Wv(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:s}=By(t);let i=(s?Fv(r.width):r.width)/n,o=(s?Fv(r.height):r.height)/a;return i&&Number.isFinite(i)||(i=1),o&&Number.isFinite(o)||(o=1),{x:i,y:o}}const Hy=Wv(0);function Gy(e){const t=gy(e);return Ry()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Hy}function $y(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const a=e.getBoundingClientRect(),s=Wy(e);let i=Wv(1);t&&(n?yy(n)&&(i=Vy(n)):i=Vy(e));const o=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==gy(e))&&t}(s,r,n)?Gy(s):Wv(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=gy(s),t=n&&yy(n)?gy(n):n;let r=e,a=Fy(r);for(;a&&n&&t!==r;){const e=Vy(a),t=a.getBoundingClientRect(),n=Uy(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=gy(a),a=Fy(r)}}return cy({width:u,height:d,x:c,y:l})}function Ky(e,t){const r=My(e).scrollLeft;return t?t.left+r:$y(by(e)).left+r}function qy(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-Ky(e,r),y:r.top+t.scrollTop}}const Zy=new Set(["absolute","fixed"]);function Jy(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=gy(e),n=by(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=Ry();(!e||e&&"fixed"===t)&&(o=a.offsetLeft,c=a.offsetTop)}const l=Ky(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=by(e),r=My(e),n=e.ownerDocument.body,a=zv(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=zv(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Ky(e);const o=-r.scrollTop;return"rtl"===Uy(n).direction&&(i+=zv(t.clientWidth,n.clientWidth)-a),{width:a,height:s,x:i,y:o}}(by(e));else if(yy(t))n=function(e,t){const r=$y(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,s=xy(e)?Vy(e):Wv(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=Gy(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return cy(n)}function Yy(e,t){const r=Ly(e);return!(r===t||!yy(r)||Iy(r))&&("fixed"===Uy(r).position||Yy(r,t))}function Xy(e,t,r){const n=xy(t),a=by(t),s="fixed"===r,i=$y(e,!0,s,t);let o={scrollLeft:0,scrollTop:0};const c=Wv(0);function l(){c.x=Ky(a)}if(n||!n&&!s)if(("body"!==fy(t)||ky(a))&&(o=My(t)),n){const e=$y(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?Wv(0):qy(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 Qy(e){return"static"===Uy(e).position}function ex(e,t){if(!xy(e)||"fixed"===Uy(e).position)return null;if(t)return t(e);let r=e.offsetParent;return by(e)===r&&(r=r.ownerDocument.body),r}function tx(e,t){const r=gy(e);if(Ay(e))return r;if(!xy(e)){let t=Ly(e);for(;t&&!Iy(t);){if(yy(t)&&!Qy(t))return t;t=Ly(t)}return r}let n=ex(e,t);for(;n&&Cy(n)&&Qy(n);)n=ex(n,t);return n&&Iy(n)&&Qy(n)&&!Ty(n)?r:n||function(e){let t=Ly(e);for(;xy(t)&&!Iy(t);){if(Ty(t))return t;if(Ay(t))return null;t=Ly(t)}return null}(e)||r}const rx={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const s="fixed"===a,i=by(n),o=!!t&&Ay(t.floating);if(n===i||o&&s)return r;let c={scrollLeft:0,scrollTop:0},l=Wv(1);const u=Wv(0),d=xy(n);if((d||!d&&!s)&&(("body"!==fy(n)||ky(i))&&(c=My(n)),xy(n))){const e=$y(n);l=Vy(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}const p=!i||d||s?Wv(0):qy(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:by,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const s=[..."clippingAncestors"===r?Ay(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=zy(e,[],!1).filter(e=>yy(e)&&"body"!==fy(e)),a=null;const s="fixed"===Uy(e).position;let i=s?Ly(e):e;for(;yy(i)&&!Iy(i);){const t=Uy(i),r=Ty(i);r||"fixed"!==t.position||(a=null),(s?!r&&!a:!r&&"static"===t.position&&a&&Zy.has(a.position)||ky(i)&&!r&&Yy(e,i))?n=n.filter(e=>e!==i):a=t,i=Ly(i)}return t.set(e,n),n}(t,this._c):[].concat(r),n],i=s[0],o=s.reduce((e,r)=>{const n=Jy(t,r,a);return e.top=zv(n.top,e.top),e.right=Ov(n.right,e.right),e.bottom=Ov(n.bottom,e.bottom),e.left=zv(n.left,e.left),e},Jy(t,i,a));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:tx,getElementRects:async function(e){const t=this.getOffsetParent||tx,r=this.getDimensions,n=await r(e.floating);return{reference:Xy(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}=By(e);return{width:t,height:r}},getScale:Vy,isElement:yy,isRTL:function(e){return"rtl"===Uy(e).direction}};function nx(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ax(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=Wy(e),u=a||s?[...l?zy(l):[],...zy(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=by(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:-Bv(d)+"px "+-Bv(a.clientWidth-(u+p))+"px "+-Bv(a.clientHeight-(d+m))+"px "+-Bv(u)+"px",threshold:zv(0,Ov(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||nx(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?$y(e):null;return c&&function t(){const n=$y(e);f&&!nx(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 sx=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=Kv(r),o=qv(r),c="y"===Xv(r),l=my.has(i)?-1:1,u=s&&c?-1:1,d=$v(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}}}}},ix=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}=$v(e,t),u={x:r,y:n},d=await s.detectOverflow(t,l),p=Xv(Kv(a)),m=Zv(p);let h=u[m],f=u[p];if(i){const e="y"===m?"bottom":"right";h=Gv(h+d["y"===m?"top":"left"],h,h-d[e])}if(o){const e="y"===p?"bottom":"right";f=Gv(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}}}}}},ox=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}=$v(e,t);if(null!=(r=s.arrow)&&r.alignmentOffset)return{};const b=Kv(a),v=Xv(o),y=Kv(o)===o,x=await(null==c.isRTL?void 0:c.isRTL(l.floating)),w=p||(y||!f?[iy(o)]:function(e){const t=iy(e);return[ey(e),t,ey(t)]}(o)),S="none"!==h;!p&&S&&w.push(...sy(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=qv(e),a=Qv(e),s=Jv(a);let i="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=iy(i)),[i,iy(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!==Xv(t))||N.every(e=>Xv(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=Xv(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{}}}},cx=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}=$v(e,t),u=await i.detectOverflow(t,l),d=Kv(a),p=qv(a),m="y"===Xv(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=Ov(f-u[g],v),w=Ov(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=zv(u.left,0),t=zv(u.right,0),r=zv(u.top,0),n=zv(u.bottom,0);m?E=h-2*(0!==e||0!==t?e+t:zv(u.left,u.right)):k=f-2*(0!==r||0!==n?r+n:zv(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}}:{}}}},lx=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:a="referenceHidden",...s}=$v(e,t);switch(a){case"referenceHidden":{const e=dy(await n.detectOverflow(t,{...s,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:py(e)}}}case"escaped":{const e=dy(await n.detectOverflow(t,{...s,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:py(e)}}}default:return{}}}}},ux=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}=$v(e,t)||{};if(null==l)return{};const d=oy(u),p={x:r,y:n},m=Qv(a),h=Jv(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=Ov(d[b],C),A=Ov(d[v],C),_=N,j=k-f[h]-A,P=k/2-f[h]/2+E,T=Gv(_,P,j),R=!c.arrow&&null!=qv(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}}}),dx=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}=$v(e,t),u={x:r,y:n},d=Xv(a),p=Zv(d);let m=u[p],h=u[d];const f=$v(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=my.has(Kv(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}}}},px=(e,t,r)=>{const n=new Map,a={platform:rx,...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}=ly(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:uy},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}=ly(l,p,c))),r=-1)}return{x:u,y:d,placement:p,strategy:a,middlewareData:m}})(e,t,{...a,platform:s})};var mx="undefined"!=typeof document?t.useLayoutEffect:function(){};function hx(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(!hx(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)&&!hx(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function fx(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gx(e,t){const r=fx(e);return Math.round(t*r)/r}function bx(e){const t=a.useRef(e);return mx(()=>{t.current=e}),t}const vx=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?ux({element:r.current,padding:n}).fn(t):{}:r?ux({element:r,padding:n}).fn(t):{};var a}}),yx=(e,t)=>({...sx(e),options:[e,t]}),xx=(e,t)=>({...ix(e),options:[e,t]}),wx=(e,t)=>({...dx(e),options:[e,t]}),Sx=(e,t)=>({...ox(e),options:[e,t]}),kx=(e,t)=>({...cx(e),options:[e,t]}),Ex=(e,t)=>({...lx(e),options:[e,t]}),Cx=(e,t)=>({...vx(e),options:[e,t]});var Nx=a.forwardRef((t,r)=>{const{children:n,width:a=10,height:s=5,...i}=t;return e.jsx(Us.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"})})});Nx.displayName="Arrow";var Ax=Nx,_x="Popper",[jx,Px]=Es(_x),[Tx,Rx]=jx(_x),Dx=t=>{const{__scopePopper:r,children:n}=t,[s,i]=a.useState(null);return e.jsx(Tx,{scope:r,anchor:s,onAnchorChange:i,children:n})};Dx.displayName=_x;var Ix="PopperAnchor",Ux=a.forwardRef((t,r)=>{const{__scopePopper:n,virtualRef:s,...i}=t,o=Rx(Ix,n),c=a.useRef(null),l=ls(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(Us.div,{...i,ref:l})});Ux.displayName=Ix;var Mx="PopperContent",[Lx,Ox]=jx(Mx),zx=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=Rx(Mx,n),[x,w]=a.useState(null),S=ls(r,e=>w(e)),[k,E]=a.useState(null),C=kl(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(Vx),altBoundary:T},{refs:D,floatingStyles:I,placement:U,isPositioned:M,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:u,open:d}=e,[p,m]=a.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=a.useState(n);hx(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,_=bx(u),j=bx(i),P=bx(d),T=a.useCallback(()=>{if(!E.current||!C.current)return;const e={placement:t,strategy:r,middleware:h};j.current&&(e.platform=j.current),px(E.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};R.current&&!hx(N.current,t)&&(N.current=t,s.flushSync(()=>{m(t)}))})},[h,t,r,j,P]);mx(()=>{!1===d&&N.current.isPositioned&&(N.current.isPositioned=!1,m(e=>({...e,isPositioned:!1})))},[d]);const R=a.useRef(!1);mx(()=>(R.current=!0,()=>{R.current=!1}),[]),mx(()=>{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=gx(I.floating,p.x),n=gx(I.floating,p.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...fx(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)=>ax(...e,{animationFrame:"always"===g}),elements:{reference:y.anchor},middleware:[yx({mainAxis:o+A,alignmentAxis:l}),d&&xx({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?wx():void 0,...R}),d&&Sx({...R}),kx({...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&&Cx({element:k,padding:u}),Hx({arrowWidth:N,arrowHeight:A}),f&&Ex({strategy:"referenceHidden",...R})]}),[O,z]=Gx(U),F=Ms(b);Ns(()=>{M&&F?.()},[M,F]);const B=L.arrow?.x,W=L.arrow?.y,V=0!==L.arrow?.centerOffset,[H,G]=a.useState();return Ns(()=>{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":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:e.jsx(Lx,{scope:n,placedSide:O,onArrowChange:E,arrowX:B,arrowY:W,shouldHideArrow:V,children:e.jsx(Us.div,{"data-side":O,"data-align":z,...v,ref:S,style:{...v.style,animation:M?void 0:"none"}})})})});zx.displayName=Mx;var Fx="PopperArrow",Bx={top:"bottom",right:"left",bottom:"top",left:"right"},Wx=a.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,s=Ox(Fx,n),i=Bx[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(Ax,{...a,ref:r,style:{...a.style,display:"block"}})})});function Vx(e){return null!==e}Wx.displayName=Fx;var Hx=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]=Gx(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 Gx(e){const[t,r="center"]=e.split("-");return[t,r]}var $x=Dx,Kx=Ux,qx=zx,Zx=Wx;function Jx(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?cs(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 Yx=Symbol("radix.slottable");function Xx(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Yx}var Qx="Popover",[ew]=Es(Qx,[Px]),tw=Px(),[rw,nw]=ew(Qx),aw=t=>{const{__scopePopover:r,children:n,open:s,defaultOpen:i,onOpenChange:o,modal:c=!1}=t,l=tw(r),u=a.useRef(null),[d,p]=a.useState(!1),[m,h]=Ts({prop:s,defaultProp:i??!1,onChange:o,caller:Qx});return e.jsx($x,{...l,children:e.jsx(rw,{scope:r,contentId:js(),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})})};aw.displayName=Qx;var sw="PopoverAnchor";a.forwardRef((t,r)=>{const{__scopePopover:n,...s}=t,i=nw(sw,n),o=tw(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=i;return a.useEffect(()=>(c(),()=>l()),[c,l]),e.jsx(Kx,{...o,...s,ref:r})}).displayName=sw;var iw="PopoverTrigger",ow=a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=nw(iw,n),i=tw(n),o=ls(r,s.triggerRef),c=e.jsx(Us.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":yw(s.open),...a,ref:o,onClick:ks(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:e.jsx(Kx,{asChild:!0,...i,children:c})});ow.displayName=iw;var cw="PopoverPortal",[lw,uw]=ew(cw,{forceMount:void 0}),dw=t=>{const{__scopePopover:r,forceMount:n,children:a,container:s}=t,i=nw(cw,r);return e.jsx(lw,{scope:r,forceMount:n,children:e.jsx(ri,{present:n||i.open,children:e.jsx(ti,{asChild:!0,container:s,children:a})})})};dw.displayName=cw;var pw="PopoverContent",mw=a.forwardRef((t,r)=>{const n=uw(pw,t.__scopePopover),{forceMount:a=n.forceMount,...s}=t,i=nw(pw,t.__scopePopover);return e.jsx(ri,{present:a||i.open,children:i.modal?e.jsx(fw,{...s,ref:r}):e.jsx(gw,{...s,ref:r})})});mw.displayName=pw;var hw=function(t){const r=Jx(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(Xx);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"),fw=a.forwardRef((t,r)=>{const n=nw(pw,t.__scopePopover),s=a.useRef(null),i=ls(r,s),o=a.useRef(!1);return a.useEffect(()=>{const e=s.current;if(e)return eo(e)},[]),e.jsx(Ki,{as:hw,allowPinchZoom:!0,children:e.jsx(bw,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ks(t.onCloseAutoFocus,e=>{e.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:ks(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:ks(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),gw=a.forwardRef((t,r)=>{const n=nw(pw,t.__scopePopover),s=a.useRef(!1),i=a.useRef(!1);return e.jsx(bw,{...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()}})}),bw=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=nw(pw,n),h=tw(n);return si(),e.jsx(qs,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:i,children:e.jsx(Ws,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:e.jsx(qx,{"data-state":yw(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)"}})})})}),vw="PopoverClose";a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=nw(vw,n);return e.jsx(Us.button,{type:"button",...a,ref:r,onClick:ks(t.onClick,()=>s.onOpenChange(!1))})}).displayName=vw;function yw(e){return e?"open":"closed"}a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=tw(n);return e.jsx(Zx,{...s,...a,ref:r})}).displayName="PopoverArrow";var xw=dw,ww=mw;const Sw=aw,kw=ow,Ew=a.forwardRef(({className:t,align:r="center",sideOffset:n=4,...s},i)=>{const{container:o}=a.useContext(tc);return e.jsx(xw,{container:o,children:e.jsx(ww,{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 Cw({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(Sw,{open:l,onOpenChange:u,children:[e.jsx(kw,{asChild:!0,children:e.jsxs(Ss,{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(Oa,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(Ew,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(Rv,{children:[e.jsx(Dv,{placeholder:s}),e.jsx(Iv,{children:e.jsx(Uv,{children:r.map(t=>e.jsxs(Mv,{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(La,{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))})})]})})]})}Ew.displayName=ww.displayName;const Nw={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"},Aw={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"},_w=[{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=Aw[e.code]||"USD",r=Nw[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 jw({value:t,onChange:r}){const{t:n}=nn(),a=_w.map(e=>({value:e.value,label:e.text,icon:e.flag}));return e.jsx(Cw,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchCountry"),emptyLabel:n("dropdowns.chooseCountry")})}const Pw=_w.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),Tw=Array.from(new Set(Pw.map(e=>e.value))).map(e=>Pw.find(t=>t.value===e)).filter(e=>void 0!==e);function Rw({value:t,onChange:r}){const{t:n}=nn(),a=Tw.map(e=>({value:e.value,label:e.text,icon:e.icon??void 0}));return e.jsx(Cw,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchCurrency"),emptyLabel:n("dropdowns.chooseCurrency")})}let Dw=[{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:"🇮🇱"}];Dw=Dw.filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)),Dw.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const Iw=Dw.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 Uw({value:t,onChange:r}){const{t:n}=nn(),a=Iw.map(e=>({value:e.value,label:e.label,icon:e.flag}));return e.jsx(Cw,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchLanguage"),emptyLabel:n("dropdowns.chooseLanguage")})}const Mw=[{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 Lw({value:t,onChange:r}){const{t:n}=nn(),a=Mw.map(e=>({value:e.value,label:e.text}));return e.jsx(Cw,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchTimezone"),emptyLabel:n("dropdowns.chooseTimezone")})}const Ow=({workspace:r})=>{const{t:n}=nn(),{updateUserProfile:a,getProfile:s}=Ik(),[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=cd({resolver:gh(ff({name:Bh().min(2,{message:n("profile.nameMinLength")}),country:Bh().optional(),timezone:Bh().optional(),language:Bh().optional(),currency:Bh().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(Wf,{...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(Xf,{disabled:!0,className:"w-full border rounded px-3 py-2 bg-gray-100",value:c?.email})]}),e.jsx(Hf,{disabled:i,control:f.control,name:"name",render:({field:t})=>e.jsxs(Kf,{children:[e.jsx(qf,{children:n("profile.name")}),e.jsx(Zf,{children:e.jsx(Xf,{...t})}),e.jsx(Yf,{})]})}),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(Uw,{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(jw,{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(Rw,{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(Lw,{value:f.watch("timezone"),onChange:e=>{f.setValue("timezone",e)}})]})]}),e.jsxs("div",{className:"flex justify-end gap-x-2",children:[e.jsx(Ss,{type:"submit",progress:i,disabled:i,children:n("profile.save")}),e.jsx(Ss,{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(xl,{})};function zw(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 Fw(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??Mf(a??"")}${c.toFixed(2)}`}else{u=`${r.currencySymbol??Mf(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 Bw="bb";function Ww(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(Bw,function(e){return Object.entries(e).filter(([,e])=>null!=e&&""!==e).map(([e,t])=>`${encodeURIComponent(e)}:${encodeURIComponent(t)}`).join(",")}(e)),r.toString()}function Vw(){if("undefined"==typeof window)return null;try{const e=new URLSearchParams(window.location.search).get(Bw);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 Hw(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.has(Bw)&&(e.searchParams.delete(Bw),window.history.replaceState({},"",e.toString()))}catch{}}const Gw="personal",$w=(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)},Kw=(e,t="en-US")=>e?new Date(1e3*e).toLocaleDateString(t,{year:"numeric",month:"short",day:"numeric"}):"",qw=e=>{switch(e){case Yn:return"bg-green-100 text-green-800";case Jn:return"bg-yellow-100 text-yellow-800";case Zn:return"bg-gray-100 text-gray-800";case Xn:return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}},Zw=({workspaceId:t,hasActiveSubscription:r=!1,onViewPricingPlans:n,limit:a=20})=>{const{t:s,formattingLocale:i}=nn(),{invoices:o,loading:c,error:l,refetch:u}=Rn(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(Ss,{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(Ss,{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(xl,{})}):d?e.jsx("div",{className:"space-y-2",children:o.map(t=>{const r=(e=>{switch(e.status){case Zn:case Jn:return{textKey:"invoices.pay",color:"bg-blue-600 hover:bg-blue-700"};case Yn:return{textKey:"invoices.view",color:"bg-green-600 hover:bg-green-700"};case Xn:case Qn: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 ${qw(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:$w(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:Kw(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:$w(t.amount_paid,t.currency,i)})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(Ss,{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(Ba,{className:"h-3 w-3 ms-1.5"})]}),t.invoice_pdf&&e.jsxs(Ss,{size:"sm",variant:"outline",onClick:()=>window.open(t.invoice_pdf,"_blank","noopener,noreferrer"),children:[e.jsx(Fa,{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(Wa,{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(Ss,{size:"sm",className:"mt-4",onClick:n,children:s("subscription.viewPricingPlans")})]})]})},Jw=t.lazy(()=>Promise.resolve().then(function(){return fC}).then(e=>({default:e.default}))),Yw=(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""}},Xw=({workspace:r})=>{const n=r._id?.toString(),{t:a,formattingLocale:s,fmtNum:i,fmtCents:o}=nn(),{api:c}=kn(),{can:l}=vl(),{settings:u}=Sn(),d=l(rl.WORKSPACE_BILLING_VIEW),p=l(rl.WORKSPACE_BILLING_MANAGE),m=u?.workspace?.mode===Gw,{subscription:h,loading:f,error:g,updateSubscription:b,refetch:v}=Tn(n),{createCheckoutSession:y}=jn(n),{cancelSubscription:x,loading:w}=In(n),{resumeSubscription:S,loading:k}=Un(n),{openBillingPortal:E,loading:C}=Dn(n),{versions:N,loading:A,error:_,refetch:j}=_n(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,L]=t.useState(!1),[O,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=Dk.getState(),t="selectPlan"===e.params?.action;h?.subscription&&!t||(q.current=!0,t&&(K.current=e.params,Dk.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(()=>ua(h?.subscription?.stripePriceId,U??[]),[h?.subscription?.stripePriceId,U]),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(xl,{});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(Ss,{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(Ss,{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(Ss,{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(Ha,{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(as,{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(Ss,{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===$n,r=h?.subscription?.cancelAtPeriodEnd;return r||w?null:t&&U&&U.length>0?e.jsx(Ss,{size:"sm",onClick:()=>H(!0),children:a("subscription.viewPricingPlans")}):h?.subscription&&!t&&p?e.jsx(Ss,{variant:"outline",size:"sm",onClick:()=>H(!0),children:a("subscription.changePlanButton")}):!h?.subscription&&U&&U.length>0?e.jsx(Ss,{size:"sm",onClick:()=>H(!0),children:a("subscription.viewPricingPlans")}):null})(),e.jsx(Ss,{variant:"ghost",size:"sm",progress:P,onClick:Q,disabled:P||M,children:a("settings.common.refreshAction",{loading:String(P)})})]})]}),h?.subscription?(()=>{const t=ua(h.subscription.stripePriceId,U??[]),n=t?.interval??null,c=t?.currency??h.plan?.currency??r?.billingCurrency??"",l=n&&h.planVersion?oa(h.planVersion,c,n):null,u=c,d=h.planVersion?da(h.planVersion,c):null,f=d&&n?pa(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===Vn.Monthly?a("subscription.billingInterval.perMonth"):n===Vn.Quarterly?a("subscription.billingInterval.perQuarter"):n===Vn.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===Gn&&!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(Ss,{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===Hn?h.subscription.cancelAtPeriodEnd?"bg-amber-100 text-amber-800":"bg-green-100 text-green-800":h.subscription.subscriptionStatus===Gn?"bg-blue-100 text-blue-800":h.subscription.subscriptionStatus===$n?"bg-gray-100 text-gray-800":"bg-red-100 text-red-800"),children:[h.subscription.subscriptionStatus===Hn&&(h.subscription.cancelAtPeriodEnd?a("subscription.status.canceling"):a("subscription.status.active")),h.subscription.subscriptionStatus===Gn&&a("subscription.status.trial"),h.subscription.subscriptionStatus===$n&&a("subscription.status.canceled"),h.subscription.subscriptionStatus===Kn&&a("subscription.status.pastDue")]}),h.subscription.subscriptionStatus===Gn&&Yw(s,h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd)&&e.jsxs("span",{className:"text-xs text-gray-500",children:["(ends"," ",Yw(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(as,{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===Hn||h.subscription.subscriptionStatus===Gn)&&!h.subscription.cancelAtPeriodEnd&&Yw(s,h.subscription.stripeCurrentPeriodEnd)&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[e.jsx(Ua,{className:"h-3.5 w-3.5 flex-shrink-0"}),e.jsx("span",{children:a("subscription.nextBillingDisplay",{date:Yw(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===Hn||h.subscription.subscriptionStatus===Gn||h.subscription.subscriptionStatus===Kn)&&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(Ss,{variant:"outline",size:"sm",onClick:()=>E(),disabled:C,progress:C,children:a(C?"subscription.openingPortal":"subscription.managePayment")}),p&&h.subscription.subscriptionId&&(h.subscription.subscriptionStatus===Hn||h.subscription.subscriptionStatus===Gn)&&e.jsx(e.Fragment,{children:h.subscription.cancelAtPeriodEnd?e.jsx(Ss,{variant:"outline",size:"sm",onClick:()=>J(!0),disabled:M||w||k,progress:k,children:h.subscription.subscriptionStatus===Gn?a("subscription.resumeTrial"):a("subscription.resumeTitle")}):e.jsx(Ss,{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===Gn?a("subscription.cancelTrial"):a("subscription.cancelTitle")})})]})]}),h.subscription.subscriptionStatus===Kn&&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(as,{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(Ss,{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===Kn&&h.subscription.dunningState&&h.subscription.dunningState!==na&&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(as,{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===aa?a("subscription.dunningFinal"):h.subscription.dunningState===sa?a("subscription.dunningSuspended"):a("subscription.dunningRecovery")}),e.jsx("p",{className:"text-sm text-red-700 mt-0.5",children:h.subscription.dunningState===sa?a("subscription.dunningSuspendedDescription"):a("subscription.dunningRecoveryDescription")})]})]})}),h.subscription.subscriptionStatus===qn&&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(Ua,{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(Ua,{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===Gn?a("subscription.scheduledTrialCancellation"):a("subscription.scheduledCancellation")}),e.jsx("p",{className:"text-sm text-amber-700 mt-0.5",children:Yw(s,h.subscription.subscriptionStatus===Gn&&h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd)?e.jsxs(e.Fragment,{children:[h.subscription.subscriptionStatus===Gn?a("subscription.trialEndDescription"):a("subscription.cancelEndDescription")," ",e.jsx("span",{className:"font-medium",children:Yw(s,h.subscription.subscriptionStatus===Gn&&h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd)}),"."]}):a("subscription.cancelEndFallback")})]})]})}),h.planVersion&&(()=>{const t=((e,t,r=Vn.Monthly)=>{if(!e?.subscriptionItems)return{features:[],limits:[],quotas:[]};const n=[],a=[],s=[];return e.subscriptionItems.forEach(i=>{const o=i.slug;if(i.type===ea){const t=e.features?.[o]??!1;n.push({item:i,enabled:t})}else if(i.type===ta){const t=e.limits?.[o]??0;a.push({item:i,value:t})}else if(i.type===ra){const n=t&&e.pricingVariants?.length?la(e,t,o,r):zw(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=Fw(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(za,{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(Ss,{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(Ss,{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(Ha,{className:"h-4 w-4 animate-spin flex-shrink-0"}),e.jsx("span",{children:a("settings.common.loading")})]}),e.jsx(Zw,{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(Ha,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{children:a("settings.common.loading")})]})}):null,children:e.jsx(Jw,{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=Vn.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=ia(e,t);if(!n?.stripePrices)return null;const a=r===Vn.Monthly?"monthlyPriceId":r===Vn.Yearly?"yearlyPriceId":"quarterlyPriceId",s=r===Vn.Monthly?"monthly":r===Vn.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){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:Ww({action:"checkout",status:"success",ws:e,screen:"subscription"},t),cancelUrl:Ww({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),Rt(),await Q(),void B(a("subscription.updateSuccess")))}const u=h?.subscription?.subscriptionStatus===$n;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 ll(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:M||P})}),e.jsx(Oc,{open:Z,onOpenChange:J,children:e.jsxs(Wc,{children:[e.jsxs(Vc,{children:[e.jsx(Gc,{children:a("subscription.resumeTitle")}),e.jsx($c,{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(as,{className:"h-4 w-4 text-amber-600 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[a("subscription.resumeChargeDate")," ",h?.subscription?.stripeCurrentPeriodEnd&&Yw(s,h.subscription.stripeCurrentPeriodEnd)?e.jsx("span",{className:"font-medium",children:Yw(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(Hc,{children:[e.jsx(qc,{disabled:k,children:a("subscription.resumeKeep")}),e.jsx(Kc,{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===Gn,r=t&&h?.subscription?.trialEnd||h?.subscription?.stripeCurrentPeriodEnd;return e.jsx(Oc,{open:G,onOpenChange:$,children:e.jsxs(Wc,{children:[e.jsxs(Vc,{children:[e.jsx(Gc,{children:a(t?"subscription.cancelTrialTitle":"subscription.cancelTitle")}),e.jsx($c,{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&&Yw(s,r)?e.jsx("span",{className:"font-medium",children:Yw(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(Hc,{children:[e.jsx(qc,{disabled:w,children:a(t?"subscription.cancelTrialKeep":"subscription.cancelKeep")}),e.jsx(Kc,{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 Qw(e){return e.replace(/[_-]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function eS(e,t,r){return t+e.toLocaleString(r,{minimumFractionDigits:2,maximumFractionDigits:2})}function tS(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 rS=()=>{const{quotas:r,loading:n,error:a,refetch:s}=Ok(),{t:i,formattingLocale:o,fmtNum:c}=nn(),{can:l}=vl(),u=(e,t)=>eS(e,t,o),{response:d}=zn(),[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=Mf(s);if(!r)return e;for(const n of Object.keys(r)){const o=ca(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:tS(e)}:null},[d,o]),g=async()=>{m(!0);try{await s()}finally{m(!1)}};if(n&&!r)return e.jsx(xl,{});if(!l(rl.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(Ss,{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(Ma,{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(Ss,{variant:"ghost",size:"sm",onClick:g,disabled:p,children:[e.jsx(qa,{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(Ua,{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(as,{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(nS,{slug:t,quota:r,percent:n,colors:i,pricing:o},t)})})]})};function nS({slug:t,quota:r,percent:n,colors:a,pricing:s}){const{t:i,formattingLocale:o}=nn(),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)=>eS(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:Qw(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 aS(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?cs(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 sS=Symbol("radix.slottable");function iS(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===sS}var oS=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(Us.span,{...t,ref:r,style:{...oS,...t.style}})).displayName="VisuallyHidden";var cS=[" ","Enter","ArrowUp","ArrowDown"],lS=[" ","Enter"],uS="Select",[dS,pS,mS]=ng(uS),[hS]=Es(uS,[mS,Px]),fS=Px(),[gS,bS]=hS(uS),[vS,yS]=hS(uS),xS=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=fS(r),[v,y]=a.useState(null),[x,w]=a.useState(null),[S,k]=a.useState(!1),E=sg(d),[C,N]=Ts({prop:s,defaultProp:i??!1,onChange:o,caller:uS}),[A,_]=Ts({prop:c,defaultProp:l,onChange:u,caller:uS}),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($x,{...b,children:e.jsxs(gS,{required:f,scope:r,trigger:v,onTriggerChange:y,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:k,contentId:js(),value:A,onValueChange:_,open:C,onOpenChange:N,dir:E,triggerPointerDownPosRef:j,disabled:h,children:[e.jsx(dS.Provider,{scope:r,children:e.jsx(vS,{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(ak,{"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]})})};xS.displayName=uS;var wS="SelectTrigger",SS=a.forwardRef((t,r)=>{const{__scopeSelect:n,disabled:s=!1,...i}=t,o=fS(n),c=bS(wS,n),l=c.disabled||s,u=ls(r,c.onTriggerChange),d=pS(n),p=a.useRef("touch"),[m,h,f]=ik(e=>{const t=d().filter(e=>!e.disabled),r=t.find(e=>e.value===c.value),n=ok(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(Kx,{asChild:!0,...o,children:e.jsx(Us.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":sk(c.value)?"":void 0,...i,ref:u,onClick:ks(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:ks(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:ks(i.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||cS.includes(e.key)&&(g(),e.preventDefault())})})})});SS.displayName=wS;var kS="SelectValue",ES=a.forwardRef((t,r)=>{const{__scopeSelect:n,className:a,style:s,children:i,placeholder:o="",...c}=t,l=bS(kS,n),{onValueNodeHasChildrenChange:u}=l,d=void 0!==i,p=ls(r,l.onValueNodeChange);return Ns(()=>{u(d)},[u,d]),e.jsx(Us.span,{...c,ref:p,style:{pointerEvents:"none"},children:sk(l.value)?e.jsx(e.Fragment,{children:o}):i})});ES.displayName=kS;var CS=a.forwardRef((t,r)=>{const{__scopeSelect:n,children:a,...s}=t;return e.jsx(Us.span,{"aria-hidden":!0,...s,ref:r,children:a||"▼"})});CS.displayName="SelectIcon";var NS=t=>e.jsx(ti,{asChild:!0,...t});NS.displayName="SelectPortal";var AS="SelectContent",_S=a.forwardRef((t,r)=>{const n=bS(AS,t.__scopeSelect),[i,o]=a.useState();if(Ns(()=>{o(new DocumentFragment)},[]),!n.open){const r=i;return r?s.createPortal(e.jsx(PS,{scope:t.__scopeSelect,children:e.jsx(dS.Slot,{scope:t.__scopeSelect,children:e.jsx("div",{children:t.children})})}),r):null}return e.jsx(DS,{...t,ref:r})});_S.displayName=AS;var jS=10,[PS,TS]=hS(AS),RS=function(t){const r=aS(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(iS);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"),DS=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=bS(AS,n),[w,S]=a.useState(null),[k,E]=a.useState(null),C=ls(r,e=>S(e)),[N,A]=a.useState(null),[_,j]=a.useState(null),P=pS(n),[T,R]=a.useState(!1),D=a.useRef(!1);a.useEffect(()=>{if(w)return eo(w)},[w]),si();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: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)||M(!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,M,L]),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[O,z]=ik(e=>{const t=P().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=ok(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?US:IS,H=V===US?{side:l,sideOffset:u,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:b,avoidCollisions:v}:{};return e.jsx(PS,{scope:n,content:w,viewport:k,onViewportChange:E,itemRefCallback:F,selectedItem:N,onItemLeave:B,itemTextRefCallback:W,focusSelectedItem:U,selectedItemText:_,position:s,isPositioned:T,searchRef:O,children:e.jsx(Ki,{as:RS,allowPinchZoom:!0,children:e.jsx(qs,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:ks(i,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:e.jsx(Ws,{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:ks(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()}})})})})})})});DS.displayName="SelectContentImpl";var IS=a.forwardRef((t,r)=>{const{__scopeSelect:n,onPlaced:s,...i}=t,o=bS(AS,n),c=TS(AS,n),[l,u]=a.useState(null),[d,p]=a.useState(null),m=ls(r,e=>p(e)),h=pS(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-jS,d=Jg(s,[jS,Math.max(jS,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-jS,d=Jg(s,[jS,Math.max(jS,u-c)]);l.style.minWidth=o+"px",l.style.right=d+"px"}const a=h(),i=window.innerHeight-2*jS,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-jS,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=`${jS}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]);Ns(()=>w(),[w]);const[S,k]=a.useState();Ns(()=>{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(MS,{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(Us.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});IS.displayName="SelectItemAlignedPosition";var US=a.forwardRef((t,r)=>{const{__scopeSelect:n,align:a="start",collisionPadding:s=jS,...i}=t,o=fS(n);return e.jsx(qx,{...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)"}})});US.displayName="SelectPopperPosition";var[MS,LS]=hS(AS,{}),OS="SelectViewport",zS=a.forwardRef((t,r)=>{const{__scopeSelect:n,nonce:s,...i}=t,o=TS(OS,n),c=LS(OS,n),l=ls(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(dS.Slot,{scope:n,children:e.jsx(Us.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ks(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*jS,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})})})]})});zS.displayName=OS;var FS="SelectGroup",[BS,WS]=hS(FS);a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=js();return e.jsx(BS,{scope:n,id:s,children:e.jsx(Us.div,{role:"group","aria-labelledby":s,...a,ref:r})})}).displayName=FS;var VS="SelectLabel",HS=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=WS(VS,n);return e.jsx(Us.div,{id:s.id,...a,ref:r})});HS.displayName=VS;var GS="SelectItem",[$S,KS]=hS(GS),qS=a.forwardRef((t,r)=>{const{__scopeSelect:n,value:s,disabled:i=!1,textValue:o,...c}=t,l=bS(GS,n),u=TS(GS,n),d=l.value===s,[p,m]=a.useState(o??""),[h,f]=a.useState(!1),g=ls(r,e=>u.itemRefCallback?.(e,s,i)),b=js(),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($S,{scope:n,value:s,disabled:i,textId:b,isSelected:d,onItemTextChange:a.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:e.jsx(dS.ItemSlot,{scope:n,value:s,disabled:i,textValue:p,children:e.jsx(Us.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:ks(c.onFocus,()=>f(!0)),onBlur:ks(c.onBlur,()=>f(!1)),onClick:ks(c.onClick,()=>{"mouse"!==v.current&&y()}),onPointerUp:ks(c.onPointerUp,()=>{"mouse"===v.current&&y()}),onPointerDown:ks(c.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:ks(c.onPointerMove,e=>{v.current=e.pointerType,i?u.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ks(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:ks(c.onKeyDown,e=>{""!==u.searchRef?.current&&" "===e.key||(lS.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});qS.displayName=GS;var ZS="SelectItemText",JS=a.forwardRef((t,r)=>{const{__scopeSelect:n,className:i,style:o,...c}=t,l=bS(ZS,n),u=TS(ZS,n),d=KS(ZS,n),p=yS(ZS,n),[m,h]=a.useState(null),f=ls(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 Ns(()=>(v(b),()=>y(b)),[v,y,b]),e.jsxs(e.Fragment,{children:[e.jsx(Us.span,{id:d.textId,...c,ref:f}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?s.createPortal(c.children,l.valueNode):null]})});JS.displayName=ZS;var YS="SelectItemIndicator",XS=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return KS(YS,n).isSelected?e.jsx(Us.span,{"aria-hidden":!0,...a,ref:r}):null});XS.displayName=YS;var QS="SelectScrollUpButton";a.forwardRef((t,r)=>{const n=TS(QS,t.__scopeSelect),s=LS(QS,t.__scopeSelect),[i,o]=a.useState(!1),c=ls(r,s.onScrollButtonChange);return Ns(()=>{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(tk,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=QS;var ek="SelectScrollDownButton";a.forwardRef((t,r)=>{const n=TS(ek,t.__scopeSelect),s=LS(ek,t.__scopeSelect),[i,o]=a.useState(!1),c=ls(r,s.onScrollButtonChange);return Ns(()=>{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(tk,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=ek;var tk=a.forwardRef((t,r)=>{const{__scopeSelect:n,onAutoScroll:s,...i}=t,o=TS("SelectScrollButton",n),c=a.useRef(null),l=pS(n),u=a.useCallback(()=>{null!==c.current&&(window.clearInterval(c.current),c.current=null)},[]);return a.useEffect(()=>()=>u(),[u]),Ns(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),e.jsx(Us.div,{"aria-hidden":!0,...i,ref:r,style:{flexShrink:0,...i.style},onPointerDown:ks(i.onPointerDown,()=>{null===c.current&&(c.current=window.setInterval(s,50))}),onPointerMove:ks(i.onPointerMove,()=>{o.onItemLeave?.(),null===c.current&&(c.current=window.setInterval(s,50))}),onPointerLeave:ks(i.onPointerLeave,()=>{u()})})}),rk=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return e.jsx(Us.div,{"aria-hidden":!0,...a,ref:r})});rk.displayName="SelectSeparator";var nk="SelectArrow";a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=fS(n),i=bS(nk,n),o=TS(nk,n);return i.open&&"popper"===o.position?e.jsx(Zx,{...s,...a,ref:r}):null}).displayName=nk;var ak=a.forwardRef(({__scopeSelect:t,value:r,...n},s)=>{const i=a.useRef(null),o=ls(s,i),c=Sl(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(Us.select,{...n,style:{...oS,...n.style},ref:o,defaultValue:r})});function sk(e){return""===e||void 0===e}function ik(e){const t=Ms(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 ok(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}ak.displayName="SelectBubbleInput";var ck=SS,lk=CS,uk=NS,dk=_S,pk=zS,mk=HS,hk=qS,fk=JS,gk=XS,bk=rk;const vk=xS,yk=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(ck,{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(lk,{asChild:!0,children:e.jsx(qo,{className:"h-4 w-4 opacity-50"})})]}));yk.displayName=ck.displayName;const xk=a.forwardRef(({className:t,children:r,position:n="popper",...s},i)=>{const{container:o}=a.useContext(tc);return e.jsx(uk,{container:o,children:e.jsx(dk,{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(pk,{className:Se("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r})})})});xk.displayName=dk.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(mk,{ref:n,className:Se("px-2 py-1.5 text-sm font-semibold",t),...r})).displayName=mk.displayName;const wk=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(hk,{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(gk,{children:e.jsx(Jo,{className:"h-4 w-4"})})}),e.jsx(fk,{children:r})]}));wk.displayName=hk.displayName;function Sk(e,r){const{response:n}=zn();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: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?pa(a,i,s?.billingInterval??"monthly"):null,g=ha({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(bk,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",t),...r})).displayName=bk.displayName;const kk=({workspace:r})=>{const{user:n}=bl(),{t:a,fmtNum:s,fmtCents:i}=nn(),[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}=Ik(),{settings:v}=Sn(),{can:y}=vl(),{response:x}=zn(),w=Sk(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===Gw;if(l||!r)return e.jsx(xl,{});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(rl.WORKSPACE_MEMBERS_INVITE),A=y(rl.WORKSPACE_MEMBERS_REMOVE),_=y(rl.WORKSPACE_MEMBERS_ROLE_CHANGE),{hasSeatPricing:j,includedSeats:P,maxUsers:T,canInvite:R,inviteBlockReason:D,inviteBlockMessageKey:I,inviteBlockMessageValues:U,perSeatPriceCents:M,currency:L}=w,O=d.length,z=x?.subscription?.billingInterval??"monthly",F=j&&O>=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(Ek,{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,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,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 "+(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: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,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(Ss,{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(vk,{disabled:i||!_||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(yk,{children:e.jsx(ES,{placeholder:a("users.selectRole")})}),e.jsx(xk,{children:r?.roles.map(t=>e.jsx(wk,{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(Ha,{className:"h-4 w-4 animate-spin text-gray-500"})})]}),!i&&!o&&A&&e.jsx(Ss,{variant:"destructive",size:"sm",startIcon:e.jsx(ns,{}),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===d.length&&e.jsx("div",{className:"text-center py-8 text-gray-500",children:a("users.noMembers")})]})};function Ek({onInvite:r,workspaceId:n}){const{t:a}=nn(),{addUser:s,getWorkspace:i}=Ik(),{settings:o}=Sn(),[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(Bf,{children:a("users.inviteByEmail")}),e.jsx(Xf,{type:"email",value:c,onChange:e=>l(e.target.value),placeholder:"example@example.com"})]}),e.jsxs("div",{children:[e.jsx(Bf,{children:a("users.role")}),e.jsxs(vk,{value:u,onValueChange:d,children:[e.jsx(yk,{children:e.jsx(ES,{placeholder:a("users.selectRole")})}),e.jsx(xk,{children:w.map(t=>e.jsx(wk,{value:t,children:t},t))})]})]}),e.jsx("div",{children:e.jsx(Ss,{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 Ck=({workspace:t,section:r,setSection:n})=>{const{t:a}=nn(),{settings:s}=Sn(),{can:i}=vl(),{appPermissions:o}=Wn(),c=s?.workspace?.mode===Gw,l=i(rl.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(Nk,{title:a("settings.sidebar.account"),children:e.jsx(Ak,{activeSection:r,icon:e.jsx(ss,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.profile"),section:_k.Profile,onClick:()=>n(_k.Profile)})}),e.jsxs(Nk,{title:a("settings.sidebar.workspace"),children:[i(rl.WORKSPACE_SETTINGS_VIEW)&&e.jsx(Ak,{activeSection:r,icon:e.jsx(Ja,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.general"),section:_k.General,onClick:()=>n(_k.General)}),!c&&i(rl.WORKSPACE_MEMBERS_VIEW)&&e.jsx(Ak,{activeSection:r,icon:e.jsx(is,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.users"),section:_k.Users,onClick:()=>n(_k.Users)}),i(rl.WORKSPACE_BILLING_VIEW)&&e.jsx(Ak,{activeSection:r,icon:e.jsx(za,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.subscription"),section:_k.Subscription,onClick:()=>n(_k.Subscription)}),i(rl.WORKSPACE_USAGE_VIEW)&&e.jsx(Ak,{activeSection:r,icon:e.jsx(Ma,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.usage"),section:_k.Usage,onClick:()=>n(_k.Usage)}),i(rl.WORKSPACE_FEATURES_VIEW)&&e.jsx(Ak,{activeSection:r,icon:e.jsx(ts,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.features"),section:_k.Features,onClick:()=>n(_k.Features)}),e.jsx(Ak,{activeSection:r,icon:e.jsx(Da,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.notifications"),section:_k.Notifications,onClick:()=>n(_k.Notifications)}),u&&!c&&e.jsx(Ak,{activeSection:r,icon:e.jsx(Xa,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.permissions"),section:_k.Permissions,onClick:()=>n(_k.Permissions)}),l&&!c&&e.jsx(Ak,{activeSection:r,icon:e.jsx(as,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.danger"),section:_k.Danger,onClick:()=>n(_k.Danger)})]})]})};function Nk({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 Ak({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 _k={Profile:"profile",General:"general",Users:"users",Subscription:"subscription",Usage:"usage",Features:"features",Notifications:"notifications",Permissions:"permissions",Danger:"danger"},jk=new Set(Object.values(_k)),Pk={[_k.Profile]:"settings.titles.profile",[_k.General]:"settings.titles.general",[_k.Users]:"settings.titles.users",[_k.Subscription]:"settings.titles.subscription",[_k.Usage]:"settings.titles.usage",[_k.Features]:"settings.titles.features",[_k.Notifications]:"settings.titles.notifications",[_k.Permissions]:"settings.titles.permissions",[_k.Danger]:"settings.titles.danger"},Tk=({workspace:r,onClose:n,open:a,onOpenChange:s,defaultSection:i=_k.Profile,section:o,onSectionChange:c,showTrigger:l=!0,trigger:u})=>{const{t:d,dir:p}=nn(),[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(Ss,{variant:"outline",size:"icon",children:e.jsx(Ja,{className:"h-4 w-4"})});return e.jsxs(nc,{open:b,onOpenChange:e=>{v(e),!e&&n&&n()},children:[l&&e.jsx(ac,{asChild:!0,children:u||w}),e.jsxs(oc,{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(uc,{className:"sr-only",children:d(Pk[y])}),e.jsx(Ck,{workspace:r,section:y,setSection:x}),e.jsxs("div",{className:"flex-1 p-6 overflow-auto flex flex-col bg-background",children:[e.jsx(lc,{className:"text-xl font-bold mb-4",children:d(Pk[y])}),e.jsxs("div",{className:"sm:max-h-[500px] overflow-y-auto",children:[y===_k.Profile&&e.jsx(Ow,{workspace:r}),y===_k.General&&e.jsx(Lb,{workspace:r}),y===_k.Users&&e.jsx(kk,{workspace:r}),y===_k.Subscription&&e.jsx(Xw,{workspace:r}),y===_k.Usage&&e.jsx(rS,{}),y===_k.Features&&e.jsx(Ml,{workspaceId:r._id?.toString()}),y===_k.Notifications&&e.jsx(Hb,{workspace:r}),y===_k.Permissions&&e.jsx(Gb,{workspace:r}),y===_k.Danger&&e.jsx(wl,{workspace:r})]})]})]})]})};var Rk=Object.freeze({__proto__:null,SETTINGS_SCREENS:jk,SettingsScreen:_k,WorkspaceSettingsDialog:Tk,default:Tk});const Dk=new class{constructor(){this.listeners=new Set,this.currentState={open:!1,section:_k.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||_k.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)})}},Ik=()=>{const e=gn(),{os:r,api:n}=kn(),{settings:a}=Sn(),s=bn(e=>e.workspaces),i=bn(e=>e.auth.session?.user),o=t.useCallback((t,r)=>{if((!(t._id===s.currentWorkspace?._id)||r?.forceEmit)&&t){const r=s.currentWorkspace;Jc(t),e.workspaces(ft(t)),Ea.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=tl(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=Yc();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(()=>{Xc(),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=Yc();if(e&&Qc(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),Ea.emitWorkspaceCreated(a).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceCreated",metadata:{workspaceId:a._id}})}),setTimeout(()=>{Dk.openWorkspaceSettings(_k.Subscription)},300)},[n,e,c]),g=t.useCallback(async(t,r)=>{const a=await n.updateWorkspace(t._id,r);e.workspaces(pt(a)),Ea.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&&(Jc(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=ha({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&&Ea.emitWorkspaceUserAdded(o.userId,i,r).catch(t=>{Re(t,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserAdded",metadata:{workspaceId:e,userId:o.userId,role:r}})}),h().catch(()=>{}),Rt(),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;Ea.emitWorkspaceUserRemoved(i.userId,r,t).catch(r=>{Re(r,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRemoved",metadata:{workspaceId:e,userId:i.userId,role:t}})})}return h().catch(()=>{}),Rt(),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&&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&&Ea.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 Ea.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(!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&&(Xc(),e.workspaces(gt())),r&&Ea.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}},Uk=t.createContext(null);Uk.displayName="QuotaUsageContext";const Mk="useQuotaUsageContext must be used within QuotaUsageContextProvider. Make sure QuotaUsageContextProvider is wrapping your application (or the tree that uses quota gates).",Lk=t.memo(function({children:r}){const{currentWorkspace:n}=Ik(),{quotas:a,loading:s,error:i,refetch:o}=Mn(n?._id);t.useEffect(()=>{return e=o,jt.add(e),()=>{jt.delete(e)};var e},[o]);const c=t.useMemo(()=>({quotas:a,loading:s,error:i,refetch:o}),[a,s,i,o]);return e.jsx(Uk.Provider,{value:c,children:r})});function Ok(){const e=t.useContext(Uk);if(null===e)throw new Error(Mk);return e}Lk.displayName="QuotaUsageContextProvider";let zk=!1,Fk=null;const Bk=t.memo(({children:r,callbacks:n})=>{const a=gn(),s=gl(),i=xn(),o=Ve(s.status).isAuthenticated,c=t.useRef(!1),l=t.useRef(null);t.useEffect(()=>{o||(zk=!1,Fk=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 ol({serverUrl:s,version:o}),u=await l.getProfile(t),d=fl(hl(u,c,r.auth?.clientId||""),t);un(d.sessionId),a.auth(Oe(d)),function(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.delete(ln),window.history.replaceState({},"",e.toString())}catch(e){Re(e,{component:"auth-utils",action:"removeTokenFromUrl",metadata:{param:ln}})}}();const p=ml();p&&p!==window.location.href&&ll(p)}}catch(t){throw ml(),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(zk)return;if(Fk)return;if(!rt(i))return;if(pn())return;if(!n?.getSession)return zk=!0,void a.auth(Le());const e=n.getSession,{serverUrl:t,version:r,orgId:s}=i,c=i.auth?.clientId||"";Fk=(async()=>{let i=null;try{i=await e()}catch(e){Re(e,{component:"AuthProviderWrapper",action:"getSession"})}if(!i)return zk=!0,a.auth(Le()),"undefined"!=typeof window&&pl(window.location.href),void n?.onSessionExpired?.("missing");try{const e=new ol({serverUrl:t,version:r}),n=await e.getProfile(i),o=fl(hl(n,s,c),i);un(o.sessionId),zk=!0,a.auth(Oe(o));const l=ml();l&&l!==window.location.href&&ll(l)}catch(e){Re(e,{component:"AuthProviderWrapper",action:"fetchUserProfile"}),zk=!0,a.auth(Le()),"undefined"!=typeof window&&pl(window.location.href),n?.onSessionExpired?.("expired")}finally{Fk=null}})()},[o,a,i,n]),t.useEffect(()=>{const e=pn();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})});Bk.displayName="AuthProviderWrapper";const Wk=t.memo(({config:r,auth:n,children:a})=>{const s=gn(),i=xn(),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 yn(i):null,[i.serverUrl,i.version,i.orgId]);return vn(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})});Wk.displayName="ContextConfigProvider";class Vk extends hn{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 Hk=t.createContext(void 0),Gk=t.memo(({children:r})=>{const{t:n}=nn(),a=xn(),s=function(){const e=xn();return t.useMemo(()=>new Vk(e),[e.serverUrl,e.version])}(),{isAuthenticated:i}=bl(),{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]);vn(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(Hk.Provider,{value:k,children:r})});Gk.displayName="UserProvider";const $k=t.lazy(()=>Promise.resolve().then(function(){return Rk}).then(e=>({default:e.default})));const Kk=({children:r})=>{const{currentWorkspace:n,switchToWorkspace:a,workspaces:s}=Ik(),[i,o]=t.useState(!1),[c,l]=t.useState(_k.Profile),u=t.useRef(!1);return t.useEffect(()=>{const e=Dk.getState();o(e.open),l(e.section);return Dk.subscribe(e=>{o(e.open),l(e.section)})},[]),t.useEffect(()=>{if(u.current)return;if(!n)return;const e=Vw();if(!e)return;const t=function(e){if(e.screen&&jk.has(e.screen))return e.screen;switch(e.action){case"checkout":case"billing":case"selectPlan":return _k.Subscription;default:return null}}(e);if(!t)return u.current=!0,void Hw();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,Hw()}):(u.current=!0,void Hw())}u.current=!0,Dk.openWorkspaceSettings(t,e),Hw()},[n,s,a]),e.jsxs(e.Fragment,{children:[r,n&&i&&e.jsx(t.Suspense,{fallback:null,children:e.jsx($k,{workspace:n,open:i,onOpenChange:e=>{e||Dk.closeSettings()},section:c,onSectionChange:e=>{Dk.setSection(e)},showTrigger:!1})})]})},qk=(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).`)},Zk=t.memo(({serverUrl:r,version:n,orgId:a,auth:s,locale:i,defaultPermissions:o,children:c})=>{qk(r,n,a);const l=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]),d=s?.callbacks?.handleEvent;return t.useEffect(()=>(Ea.setCallbacks(d?{handleEvent:d}:null),()=>{Ea.setCallbacks(null)}),[d]),e.jsx(Jr,{locale:i,children:e.jsx(_t,{children:e.jsx(Bk,{callbacks:u,children:e.jsx(rc,{children:e.jsx(Wk,{config:l,auth:s,children:e.jsx(Bn,{appPermissions:o,children:e.jsx(Gk,{children:e.jsx(On,{children:e.jsx(Lk,{children:e.jsx(Bb,{children:e.jsx(Kk,{children:c})})})})})})})})})})})});Zk.displayName="SaaSOSProviderInner";const Jk=({children:t,...r})=>e.jsx(Ie,{children:e.jsx(Zk,{...r,children:t})});Jk.displayName="SaaSOSProvider";const Yk=e=>{const{children:t}=e,{status:r}=bl();return r!==We.authenticated?null:t},Xk=e=>{const{children:t}=e,{status:r}=bl();return r!==We.unauthenticated?null:t};Yk.displayName="WhenAuthenticated",Xk.displayName="WhenUnauthenticated";const Qk=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=bl();return n.includes(a?.role??"")?t:r||null},eE=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=bl(),{currentWorkspace:s}=Ik(),i=s?.users.find(e=>e._id===a?.id);return i&&n.includes(i?.role??"")?t:r||null};Qk.displayName="WhenRoles",eE.displayName="WhenWorkspaceRoles";const tE=e=>{const{children:t,fallback:r,permission:n}=e,{can:a}=vl();return a(n)?t:r??null};function rE(){const e=t.useContext(Hk);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])}}tE.displayName="WhenPermission";const nE=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=Ik(),a=n?.features?.[r];return a?t:null},aE=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=Ik(),a=n?.features?.[r];return a?null:t},sE=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=rE();return n(r)?t:null},iE=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=rE();return n(r)?null:t};nE.displayName="WhenWorkspaceFeatureEnabled",aE.displayName="WhenWorkspaceFeatureDisabled",sE.displayName="WhenUserFeatureEnabled",iE.displayName="WhenUserFeatureDisabled";const oE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=zn();return s?r??null:a?.subscription?t:n??null},cE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=zn();return s?r??null:a?.subscription?n??null:t},lE=e=>{const{children:t,plans:r,loadingComponent:n,fallbackComponent:a}=e,{response:s,loading:i}=zn();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},uE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=zn();return s?r??null:"trialing"!==a?.subscription?.subscriptionStatus?n??null:t},dE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=zn();return s?r??null:a?.subscription?.subscriptionStatus===Gn?n??null:t},pE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n,daysThreshold:a=3}=e,{response:s,loading:i}=zn();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};oE.displayName="WhenSubscription",cE.displayName="WhenNoSubscription",lE.displayName="WhenSubscriptionToPlans",uE.displayName="WhenTrialing",dE.displayName="WhenNotTrialing",pE.displayName="WhenTrialEnding";const mE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=Ok();if(i)return n??null;const o=s?.[t];return o?o.available<=0?a??null:r:a??null},hE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=Ok();if(i)return n??null;const o=s?.[t];return o?o.available>0?a??null:r:a??null},fE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=Ok();if(i)return n??null;const o=s?.[t];return o&&o.hasOverage&&!1!==o.allowOverage?r:a??null},gE=e=>{const{slug:t,threshold:r,children:n,loadingComponent:a,fallbackComponent:s}=e,{quotas:i,loading:o}=Ok();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 bE(e){if(!e)return null;const t=new Date(e);return isNaN(t.getTime())?null:t}mE.displayName="WhenQuotaAvailable",hE.displayName="WhenQuotaExhausted",fE.displayName="WhenQuotaOverage",gE.displayName="WhenQuotaThreshold";class vE extends hn{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 yE=class{constructor(e){this.api=new vE(e),this.orgId=e.orgId}async fetchConfig(){return this.api.fetchConfig()}async submitBetaUser(e){const t=e?.context??{},r=t?.country??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[1]:void 0),n=t?.language??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[0]:void 0),a=t?.timezone??("undefined"!=typeof Intl&&Intl.DateTimeFormat?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0),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 xE=ff({name:Bh().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:Bh().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 wE({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 SE({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 kE(...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 EE,CE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=ms(`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}},{}),NE={exports:{}},AE={};function _E(){if(EE)return AE;EE=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 AE.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:c,AE}var jE,PE,TE={};
|
|
28
28
|
/**
|
|
29
29
|
* @license React
|
|
30
30
|
* use-sync-external-store-shim.development.js
|
|
@@ -33,4 +33,4 @@ var ja={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 RE(){return jE||(jE=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};TE.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())}()),TE}function DE(){return PE||(PE=1,"production"===process.env.NODE_ENV?NE.exports=_E():NE.exports=RE()),NE.exports}var IE=DE();function UE(){return()=>{}}var ME="Avatar",[LE]=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}\``)}]},kE(s,...r)]}(ME),[OE,zE]=LE(ME),FE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,...s}=t,[i,o]=a.useState("idle");return e.jsx(OE,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:e.jsx(CE.span,{...s,ref:r})})});FE.displayName=ME;var BE="AvatarImage",WE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,src:s,onLoadingStatusChange:i=()=>{},...o}=t,c=zE(BE,n),l=function(e,{referrerPolicy:t,crossOrigin:r}){const n=IE.useSyncExternalStore(UE,()=>!0,()=>!1),s=a.useRef(null),i=n?(s.current||(s.current=new window.Image),s.current):null,[o,c]=a.useState(()=>GE(i,e));return Ns(()=>{c(GE(i,e))},[i,e]),Ns(()=>{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=Ms(e=>{i(e),c.onImageLoadingStatusChange(e)});return Ns(()=>{"idle"!==l&&u(l)},[l,u]),"loaded"===l?e.jsx(CE.img,{...o,ref:r,src:s}):null});WE.displayName=BE;var VE="AvatarFallback",HE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,delayMs:s,...i}=t,o=zE(VE,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(CE.span,{...i,ref:r}):null});function GE(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}HE.displayName=VE;var $E=FE,KE=WE,qE=HE;const ZE=a.forwardRef(({className:t,...r},n)=>e.jsx($E,{ref:n,className:Se("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...r}));ZE.displayName=$E.displayName;const JE=a.forwardRef(({className:t,...r},n)=>e.jsx(KE,{ref:n,className:Se("aspect-square h-full w-full",t),...r}));JE.displayName=KE.displayName;const YE=a.forwardRef(({className:t,...r},n)=>e.jsx(qE,{ref:n,className:Se("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...r}));YE.displayName=qE.displayName;var XE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=ms(`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}},{}),QE="horizontal",eC=["horizontal","vertical"],tC=a.forwardRef((t,r)=>{const{decorative:n,orientation:a=QE,...s}=t,i=function(e){return eC.includes(e)}(a)?a:QE,o=n?{role:"none"}:{"aria-orientation":"vertical"===i?i:void 0,role:"separator"};return e.jsx(XE.div,{"data-orientation":i,...o,...s,ref:r})});tC.displayName="Separator";var rC=tC;const nC=a.forwardRef(({className:t,orientation:r="horizontal",decorative:n=!0,...a},s)=>e.jsx(rC,{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 aC(t){const{t:r}=nn(),{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(ZE,{className:"h-8 w-8 flex items-center justify-center",children:[e.jsx("div",{children:e.jsx(JE,{src:n.image&&n.image.trim()?n.image:void 0})}),e.jsx(YE,{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(is,{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(Ss,{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(Tk,{workspace:n,onClose:()=>{if(c){const e=i.findIndex(e=>e._id?.toString()===n._id?.toString());-1!==e&&a(i[e])}}})]})]});var m}function sC(r){const{t:n,dir:a}=nn(),{switching:s}=Ik(),[i,o]=t.useState(!1),[c,l]=t.useState("emoji"),[u,d]=t.useState("🏢"),[p,m]=t.useState(!1),{createWorkspace:h}=Ik(),f=cd({resolver:gh(ff({name:Bh().min(2,{message:n("workspace.workspaceNameMinLength")}),image:Bh().optional()})),defaultValues:{name:"",image:""}});return e.jsxs(nc,{open:i,onOpenChange:o,children:[e.jsx(ac,{asChild:!0,children:e.jsxs(Ss,{className:"w-full rounded-none",disabled:s,children:[e.jsx($a,{className:"h-4 w-4 me-2"}),n("workspace.createNew")]})}),e.jsxs(oc,{dir:a,className:"max-w-xl min-w-full sm:min-w-[600px]",children:[e.jsxs(cc,{children:[e.jsx(lc,{children:n("workspace.createTitle")}),e.jsx(uc,{children:n("workspace.createDescription")})]}),e.jsx(Wf,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){let t="";if("emoji"===c)t=Ub(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(Hf,{control:f.control,name:"name",render:({field:t})=>e.jsxs(Kf,{children:[e.jsx(qf,{children:n("workspace.workspaceName")}),e.jsx(Zf,{children:e.jsx(Xf,{placeholder:n("workspace.workspaceNamePlaceholder"),...t})}),e.jsx(Yf,{})]})}),e.jsxs("div",{className:"flex flex-col gap-y-2 my-2",children:[e.jsxs("div",{children:[e.jsx(Bf,{className:"text-sm font-medium",children:n("workspace.workspaceIcon")}),e.jsx(Jf,{children:n("workspace.iconDescription")})]}),e.jsxs(qg,{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(Zg,{value:"emoji",id:"emoji"}),e.jsxs(Bf,{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(Zg,{value:"url",id:"url"}),e.jsxs(Bf,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(Va,{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(Db,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Mb.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{d(e),f.setValue("image",Ub(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(Hf,{control:f.control,name:"image",render:({field:t})=>e.jsxs(Kf,{children:[e.jsx(qf,{children:n("workspace.imageUrl")}),e.jsx(Zf,{children:e.jsx(Xf,{placeholder:n("workspace.imageUrlPlaceholder"),...t})}),e.jsx(Jf,{children:n("workspace.imageUrlDescription")}),e.jsx(Yf,{})]})}),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(Ss,{type:"button",variant:"outline",onClick:()=>{o(!1),f.reset(),d("🏢"),l("emoji")},disabled:p,children:n("settings.common.cancel")}),e.jsx(Ss,{type:"submit",disabled:p,children:p?e.jsxs(e.Fragment,{children:[e.jsx(Ha,{className:"me-2 h-4 w-4 animate-spin"}),n("workspace.creating")]}):n("workspace.createWorkspace")})]})]})})]})]})}nC.displayName=rC.displayName;var iC=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 oC=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 cC=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 lC=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 uC=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 dC=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 pC=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 mC={[Vn.Monthly]:"subscription.billingInterval.perMonth",[Vn.Quarterly]:"subscription.billingInterval.perQuarter",[Vn.Yearly]:"subscription.billingInterval.perYear"},hC=(e,t,r)=>{if(!e||0===e)return null;let n;switch(r){case Vn.Yearly:n=t/12;break;case Vn.Quarterly:n=t/3;break;default:return null}const a=(e-n)/e*100;return a>0?Math.round(a):null};var fC=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}=nn(),{settings:S}=Sn(),k=S?.workspace?.mode===Gw,E=(e,t)=>null==e||0===e?"":w(e,t),C=e=>b(mC[e]??mC[Vn.Monthly]),[N,A]=t.useState(null),_=t.useRef(!1),j=t.useMemo(()=>ua(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||Vn.Monthly),[M,L]=t.useState(()=>p&&D.includes(p)?p:T&&D.includes(T)?T:D.length>0?D[0]:""),O=o?.trim()||M;t.useEffect(()=>{if(r){U(d||P||Vn.Monthly);const e=p||T;e&&D.includes(e)?L(e):D.length>0&&!D.includes(M)&&L(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===ea),W=F.filter(e=>e.type===ta),V=F.filter(e=>e.type===ra),H=async e=>{if(!(e===s&&P===I||h||f||_.current)){_.current=!0,g(!0),A(e);try{await m(e,I,O),n(!1)}catch(e){}finally{_.current=!1,g(!1),A(null)}}},G=e=>oa(e,O,I),$=e=>!!e.pricingVariants?.some(e=>e.currency?.toLowerCase()===O.toLowerCase()),K=h||f,q=e=>{switch(e){case Vn.Monthly:return b("subscription.billingInterval.monthly");case Vn.Quarterly:return b("subscription.billingInterval.quarterly");case Vn.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=Vn.Monthly)=>{if(t.type===ea)return e.features?.[t.slug]??!1;if(t.type===ta)return e.limits?.[t.slug]??null;if(t.type===ra){const n=la(e,O,t.slug,r);return n||zw(e.quotas?.[t.slug],r)}return null},Y=(e,t,r)=>{if(t.type===ea)return!0===e?"✓":"—";if(t.type===ta)return null!=e?String(e):"—";if(t.type===ra){const n=Fw("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(nc,{open:r,onOpenChange:n,children:e.jsxs(oc,{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(lc,{className:"text-xl sm:text-2xl font-bold",children:b("pricing.title")}),e.jsxs(uc,{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=>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=Uf(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:[Vn.Monthly,Vn.Quarterly,Vn.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===Vn.Monthly&&b("subscription.billingInterval.monthly"),t===Vn.Quarterly&&b("subscription.billingInterval.quarterly"),t===Vn.Yearly&&b("subscription.billingInterval.yearly"),t===Vn.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()===O.toLowerCase())?O:t.plan?.currency??O??"",p=oa(t,O,Vn.Monthly)??0,m=I!==Vn.Monthly&&null!==o?hC(p,o,I):null,h=da(t,O),f=h?pa(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: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===ea&&!0===n;return e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.type===ea?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(Ss,{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=oa(t,O,Vn.Monthly)??0,u=I!==Vn.Monthly&&null!==o?hC(c,o,I):null,d=$(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: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=da(t,O);if(!r)return null;const n=pa(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: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(Ss,{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?O:r.plan?.currency??O??"",i=Y(n,t,a),o=t.type===ea&&!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=pa(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)}${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=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)})]})]})]})]})})]})})]})})}});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}=nn(),[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}=nn(),r=xn(),[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 yE(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 yE(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=cd({resolver:gh(xE),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(yl,{className:"h-24 w-24 rounded-lg"}),e.jsx(yl,{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(yl,{className:"h-4 w-16"}),e.jsx(yl,{className:"h-10 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(yl,{className:"h-4 w-16"}),e.jsx(yl,{className:"h-10 w-full"})]}),e.jsx(yl,{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(SE,{logo:y?.logo}),y?.name&&e.jsx("div",{children:y?.name})]}),e.jsx(Nu,{...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(wE,{screen:y?.screen?.register}),e.jsx(Hf,{control:S.control,name:"name",render:({field:t})=>e.jsxs(Kf,{className:s,children:[e.jsx(qf,{children:u("beta.nameLabel")}),e.jsx(Zf,{children:e.jsx(Xf,{...t})}),e.jsx(Jf,{}),e.jsx(Yf,{})]})}),e.jsx(Hf,{control:S.control,name:"email",render:({field:t})=>e.jsxs(Kf,{className:s,children:[e.jsx(qf,{children:u("beta.emailLabel")}),e.jsx(Zf,{children:e.jsx(Xf,{...t})}),e.jsx(Jf,{}),e.jsx(Yf,{})]})}),e.jsx(Ss,{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(Ss,{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(wE,{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}=Cn(r),{isAuthenticated:m,signIn:h}=bl(),f=t.useCallback((e,t,r)=>i?Ww({action:"selectPlan",plan:e,interval:t,currency:r},i):null,[i]),g=t.useCallback((e,t,r)=>{if(m)return void Dk.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(yl,{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(yl,{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=Bb,exports.QuotaUsageContextProvider=Lk,exports.SETTINGS_SCREENS=jk,exports.SUPPORTED_LOCALES=Kr,exports.SaaSOSProvider=Jk,exports.SettingsScreen=_k,exports.SubscriptionContextProvider=On,exports.WhenAuthenticated=Yk,exports.WhenNoSubscription=cE,exports.WhenNotTrialing=dE,exports.WhenPermission=tE,exports.WhenQuotaAvailable=mE,exports.WhenQuotaExhausted=hE,exports.WhenQuotaOverage=fE,exports.WhenQuotaThreshold=gE,exports.WhenRoles=Qk,exports.WhenSubscription=oE,exports.WhenSubscriptionToPlans=lE,exports.WhenTrialEnding=pE,exports.WhenTrialing=uE,exports.WhenUnauthenticated=Xk,exports.WhenUserFeatureDisabled=iE,exports.WhenUserFeatureEnabled=sE,exports.WhenWorkspaceFeatureDisabled=aE,exports.WhenWorkspaceFeatureEnabled=nE,exports.WhenWorkspaceRoles=eE,exports.WorkspaceSwitcher=function(r){const{t:n,dir:a}=nn(),{isAuthenticated:s,user:i}=bl(),o=rt(xn()),{workspaces:c,currentWorkspace:l,loading:u,refreshing:d,switchingToId:p,fetchWorkspaces:m,getFeatures:h,refreshWorkspaces:f,setCurrentWorkspace:g,switchToWorkspace:b}=Ik(),{settings:v}=Sn(),[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(Tk,{workspace:l,open:y,onOpenChange:x,showTrigger:!1})]}):e.jsxs(nc,{open:y,onOpenChange:x,children:[e.jsx(ac,{children:r.trigger?.(C,l)}),e.jsxs(oc,{dir:a,className:"max-w-2xl min-w-full sm:min-w-[800px]",children:[e.jsxs(cc,{dir:a,children:[e.jsxs(lc,{className:"flex items-center gap-2",children:[e.jsx(Ia,{className:"h-5 w-5"}),n("workspace.switchTitle")]}),e.jsx(uc,{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(aC,{workspace:l,isCurrentWorkspace:!0,switchToWorkspace:b,switchingToId:p,onClose:()=>x(!1),setCurrentWorkspace:g,setOpen:x,workspacesToUse:N}),e.jsx(nC,{}),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(Ss,{progress:d,disabled:d,variant:"ghost",onClick:function(){s&&o&&S(e=>e+1)},startIcon:e.jsx(Ka,{}),children:n("settings.common.refreshAction",{loading:String(d)})})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Za,{className:"absolute start-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),e.jsx(Xf,{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(Ha,{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(Ia,{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(Db,{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(aC,{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(nC,{}),e.jsx(sC,{onCreated:()=>{m()}})]})]})]})]})},exports.useAllQuotaUsage=Mn,exports.useBillingPortal=Dn,exports.useCancelSubscription=In,exports.useCreateCheckoutSession=jn,exports.useInvoice=(e,r)=>{const{t:n}=nn(),{api:a}=kn(),[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=En(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=Rn,exports.usePermissions=vl,exports.usePlanGroup=An,exports.usePlanGroupVersions=_n,exports.usePublicPlanGroupVersion=e=>{const{t:r}=nn(),{api:n}=kn(),[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=En(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=Cn,exports.usePushNotifications=Wb,exports.useQuotaUsageContext=Ok,exports.useQuotaUsageStatus=(e,r)=>{const{t:n}=nn(),{api:a}=kn(),[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=En(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}=nn(),{api:n}=kn(),[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 Pt(),r}catch(n){const a=En(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=Un,exports.useSaaSAuth=bl,exports.useSaaSOs=xn,exports.useSaaSSettings=Sn,exports.useSaaSWorkspaces=Ik,exports.useSeatStatus=Sk,exports.useSubscription=Nn,exports.useSubscriptionContext=zn,exports.useSubscriptionManagement=Tn,exports.useTranslation=nn,exports.useTrialStatus=function(){const{response:e}=zn();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=bE(t.trialEnd)??bE(t.stripeCurrentPeriodEnd),n=bE(t.trialStart),a=r?Math.max(0,Math.ceil((r.getTime()-Date.now())/864e5)):0;return{isTrialing:!0,daysRemaining:a,trialEndsAt:r,trialStartedAt:n,isTrialEnding:a<=3}},[e])},exports.useUpdateSubscription=Pn,exports.useUsageLogs=(e,r,n)=>{const{t:a}=nn(),{api:s}=kn(),[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=En(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(Hk);if(void 0===e)throw new Error("useUserAttributes must be used within a UserProvider");return e},exports.useUserFeatures=rE;
|
|
36
|
+
*/function RE(){return jE||(jE=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};TE.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())}()),TE}function DE(){return PE||(PE=1,"production"===process.env.NODE_ENV?NE.exports=_E():NE.exports=RE()),NE.exports}var IE=DE();function UE(){return()=>{}}var ME="Avatar",[LE]=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}\``)}]},kE(s,...r)]}(ME),[OE,zE]=LE(ME),FE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,...s}=t,[i,o]=a.useState("idle");return e.jsx(OE,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:e.jsx(CE.span,{...s,ref:r})})});FE.displayName=ME;var BE="AvatarImage",WE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,src:s,onLoadingStatusChange:i=()=>{},...o}=t,c=zE(BE,n),l=function(e,{referrerPolicy:t,crossOrigin:r}){const n=IE.useSyncExternalStore(UE,()=>!0,()=>!1),s=a.useRef(null),i=n?(s.current||(s.current=new window.Image),s.current):null,[o,c]=a.useState(()=>GE(i,e));return Ns(()=>{c(GE(i,e))},[i,e]),Ns(()=>{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=Ms(e=>{i(e),c.onImageLoadingStatusChange(e)});return Ns(()=>{"idle"!==l&&u(l)},[l,u]),"loaded"===l?e.jsx(CE.img,{...o,ref:r,src:s}):null});WE.displayName=BE;var VE="AvatarFallback",HE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,delayMs:s,...i}=t,o=zE(VE,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(CE.span,{...i,ref:r}):null});function GE(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}HE.displayName=VE;var $E=FE,KE=WE,qE=HE;const ZE=a.forwardRef(({className:t,...r},n)=>e.jsx($E,{ref:n,className:Se("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...r}));ZE.displayName=$E.displayName;const JE=a.forwardRef(({className:t,...r},n)=>e.jsx(KE,{ref:n,className:Se("aspect-square h-full w-full",t),...r}));JE.displayName=KE.displayName;const YE=a.forwardRef(({className:t,...r},n)=>e.jsx(qE,{ref:n,className:Se("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...r}));YE.displayName=qE.displayName;var XE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=ms(`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}},{}),QE="horizontal",eC=["horizontal","vertical"],tC=a.forwardRef((t,r)=>{const{decorative:n,orientation:a=QE,...s}=t,i=function(e){return eC.includes(e)}(a)?a:QE,o=n?{role:"none"}:{"aria-orientation":"vertical"===i?i:void 0,role:"separator"};return e.jsx(XE.div,{"data-orientation":i,...o,...s,ref:r})});tC.displayName="Separator";var rC=tC;const nC=a.forwardRef(({className:t,orientation:r="horizontal",decorative:n=!0,...a},s)=>e.jsx(rC,{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 aC(t){const{t:r}=nn(),{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(ZE,{className:"h-8 w-8 flex items-center justify-center",children:[e.jsx("div",{children:e.jsx(JE,{src:n.image&&n.image.trim()?n.image:void 0})}),e.jsx(YE,{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(is,{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(Ss,{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(Tk,{workspace:n,onClose:()=>{if(c){const e=i.findIndex(e=>e._id?.toString()===n._id?.toString());-1!==e&&a(i[e])}}})]})]});var m}function sC(r){const{t:n,dir:a}=nn(),{switching:s}=Ik(),[i,o]=t.useState(!1),[c,l]=t.useState("emoji"),[u,d]=t.useState("🏢"),[p,m]=t.useState(!1),{createWorkspace:h}=Ik(),f=cd({resolver:gh(ff({name:Bh().min(2,{message:n("workspace.workspaceNameMinLength")}),image:Bh().optional()})),defaultValues:{name:"",image:""}});return e.jsxs(nc,{open:i,onOpenChange:o,children:[e.jsx(ac,{asChild:!0,children:e.jsxs(Ss,{className:"w-full rounded-none",disabled:s,children:[e.jsx($a,{className:"h-4 w-4 me-2"}),n("workspace.createNew")]})}),e.jsxs(oc,{dir:a,className:"max-w-xl min-w-full sm:min-w-[600px]",children:[e.jsxs(cc,{children:[e.jsx(lc,{children:n("workspace.createTitle")}),e.jsx(uc,{children:n("workspace.createDescription")})]}),e.jsx(Wf,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){let t="";if("emoji"===c)t=Ub(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(Hf,{control:f.control,name:"name",render:({field:t})=>e.jsxs(Kf,{children:[e.jsx(qf,{children:n("workspace.workspaceName")}),e.jsx(Zf,{children:e.jsx(Xf,{placeholder:n("workspace.workspaceNamePlaceholder"),...t})}),e.jsx(Yf,{})]})}),e.jsxs("div",{className:"flex flex-col gap-y-2 my-2",children:[e.jsxs("div",{children:[e.jsx(Bf,{className:"text-sm font-medium",children:n("workspace.workspaceIcon")}),e.jsx(Jf,{children:n("workspace.iconDescription")})]}),e.jsxs(qg,{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(Zg,{value:"emoji",id:"emoji"}),e.jsxs(Bf,{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(Zg,{value:"url",id:"url"}),e.jsxs(Bf,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(Va,{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(Db,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Mb.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{d(e),f.setValue("image",Ub(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(Hf,{control:f.control,name:"image",render:({field:t})=>e.jsxs(Kf,{children:[e.jsx(qf,{children:n("workspace.imageUrl")}),e.jsx(Zf,{children:e.jsx(Xf,{placeholder:n("workspace.imageUrlPlaceholder"),...t})}),e.jsx(Jf,{children:n("workspace.imageUrlDescription")}),e.jsx(Yf,{})]})}),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(Ss,{type:"button",variant:"outline",onClick:()=>{o(!1),f.reset(),d("🏢"),l("emoji")},disabled:p,children:n("settings.common.cancel")}),e.jsx(Ss,{type:"submit",disabled:p,children:p?e.jsxs(e.Fragment,{children:[e.jsx(Ha,{className:"me-2 h-4 w-4 animate-spin"}),n("workspace.creating")]}):n("workspace.createWorkspace")})]})]})})]})]})}nC.displayName=rC.displayName;var iC=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 oC=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 cC=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 lC=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 uC=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 dC=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 pC=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 mC={[Vn.Monthly]:"subscription.billingInterval.perMonth",[Vn.Quarterly]:"subscription.billingInterval.perQuarter",[Vn.Yearly]:"subscription.billingInterval.perYear"},hC=(e,t,r)=>{if(!e||0===e)return null;let n;switch(r){case Vn.Yearly:n=t/12;break;case Vn.Quarterly:n=t/3;break;default:return null}const a=(e-n)/e*100;return a>0?Math.round(a):null};var fC=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}=nn(),{settings:S}=Sn(),k=S?.workspace?.mode===Gw,E=(e,t)=>null==e||0===e?"":w(e,t),C=e=>b(mC[e]??mC[Vn.Monthly]),[N,A]=t.useState(null),_=t.useRef(!1),j=t.useMemo(()=>ua(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||Vn.Monthly),[M,L]=t.useState(()=>p&&D.includes(p)?p:T&&D.includes(T)?T:D.length>0?D[0]:""),O=o?.trim()||M;t.useEffect(()=>{if(r){U(d||P||Vn.Monthly);const e=p||T;e&&D.includes(e)?L(e):D.length>0&&!D.includes(M)&&L(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===ea),W=F.filter(e=>e.type===ta),V=F.filter(e=>e.type===ra),H=async e=>{if(!(e===s&&P===I||h||f||_.current)){_.current=!0,g(!0),A(e);try{await m(e,I,O),n(!1)}catch(e){}finally{_.current=!1,g(!1),A(null)}}},G=e=>oa(e,O,I),$=e=>!!e.pricingVariants?.some(e=>e.currency?.toLowerCase()===O.toLowerCase()),K=h||f,q=e=>{switch(e){case Vn.Monthly:return b("subscription.billingInterval.monthly");case Vn.Quarterly:return b("subscription.billingInterval.quarterly");case Vn.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=Vn.Monthly)=>{if(t.type===ea)return e.features?.[t.slug]??!1;if(t.type===ta)return e.limits?.[t.slug]??null;if(t.type===ra){const n=la(e,O,t.slug,r);return n||zw(e.quotas?.[t.slug],r)}return null},Y=(e,t,r)=>{if(t.type===ea)return!0===e?"✓":"—";if(t.type===ta)return null!=e&&"number"==typeof e?x(e):"—";if(t.type===ra){const n=Fw("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(nc,{open:r,onOpenChange:n,children:e.jsxs(oc,{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(lc,{className:"text-xl sm:text-2xl font-bold",children:b("pricing.title")}),e.jsxs(uc,{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=>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=Uf(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:[Vn.Monthly,Vn.Quarterly,Vn.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===Vn.Monthly&&b("subscription.billingInterval.monthly"),t===Vn.Quarterly&&b("subscription.billingInterval.quarterly"),t===Vn.Yearly&&b("subscription.billingInterval.yearly"),t===Vn.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()===O.toLowerCase())?O:t.plan?.currency??O??"",p=oa(t,O,Vn.Monthly)??0,m=I!==Vn.Monthly&&null!==o?hC(p,o,I):null,h=da(t,O),f=h?pa(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: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===ea&&!0===n;return e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.type===ea?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(Ss,{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=oa(t,O,Vn.Monthly)??0,u=I!==Vn.Monthly&&null!==o?hC(c,o,I):null,d=$(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: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=da(t,O);if(!r)return null;const n=pa(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: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(Ss,{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?O:r.plan?.currency??O??"",i=Y(n,t,a),o=t.type===ea&&!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=pa(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)}${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=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)})]})]})]})]})})]})})]})})}});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}=nn(),[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}=nn(),r=xn(),[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 yE(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 yE(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=cd({resolver:gh(xE),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(yl,{className:"h-24 w-24 rounded-lg"}),e.jsx(yl,{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(yl,{className:"h-4 w-16"}),e.jsx(yl,{className:"h-10 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(yl,{className:"h-4 w-16"}),e.jsx(yl,{className:"h-10 w-full"})]}),e.jsx(yl,{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(SE,{logo:y?.logo}),y?.name&&e.jsx("div",{children:y?.name})]}),e.jsx(Nu,{...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(wE,{screen:y?.screen?.register}),e.jsx(Hf,{control:S.control,name:"name",render:({field:t})=>e.jsxs(Kf,{className:s,children:[e.jsx(qf,{children:u("beta.nameLabel")}),e.jsx(Zf,{children:e.jsx(Xf,{...t})}),e.jsx(Jf,{}),e.jsx(Yf,{})]})}),e.jsx(Hf,{control:S.control,name:"email",render:({field:t})=>e.jsxs(Kf,{className:s,children:[e.jsx(qf,{children:u("beta.emailLabel")}),e.jsx(Zf,{children:e.jsx(Xf,{...t})}),e.jsx(Jf,{}),e.jsx(Yf,{})]})}),e.jsx(Ss,{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(Ss,{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(wE,{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}=Cn(r),{isAuthenticated:m,signIn:h}=bl(),f=t.useCallback((e,t,r)=>i?Ww({action:"selectPlan",plan:e,interval:t,currency:r},i):null,[i]),g=t.useCallback((e,t,r)=>{if(m)return void Dk.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(yl,{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(yl,{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=Bb,exports.QuotaUsageContextProvider=Lk,exports.SETTINGS_SCREENS=jk,exports.SUPPORTED_LOCALES=Kr,exports.SaaSOSProvider=Jk,exports.SettingsScreen=_k,exports.SubscriptionContextProvider=On,exports.WhenAuthenticated=Yk,exports.WhenNoSubscription=cE,exports.WhenNotTrialing=dE,exports.WhenPermission=tE,exports.WhenQuotaAvailable=mE,exports.WhenQuotaExhausted=hE,exports.WhenQuotaOverage=fE,exports.WhenQuotaThreshold=gE,exports.WhenRoles=Qk,exports.WhenSubscription=oE,exports.WhenSubscriptionToPlans=lE,exports.WhenTrialEnding=pE,exports.WhenTrialing=uE,exports.WhenUnauthenticated=Xk,exports.WhenUserFeatureDisabled=iE,exports.WhenUserFeatureEnabled=sE,exports.WhenWorkspaceFeatureDisabled=aE,exports.WhenWorkspaceFeatureEnabled=nE,exports.WhenWorkspaceRoles=eE,exports.WorkspaceSwitcher=function(r){const{t:n,dir:a}=nn(),{isAuthenticated:s,user:i}=bl(),o=rt(xn()),{workspaces:c,currentWorkspace:l,loading:u,refreshing:d,switchingToId:p,fetchWorkspaces:m,getFeatures:h,refreshWorkspaces:f,setCurrentWorkspace:g,switchToWorkspace:b}=Ik(),{settings:v}=Sn(),[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(Tk,{workspace:l,open:y,onOpenChange:x,showTrigger:!1})]}):e.jsxs(nc,{open:y,onOpenChange:x,children:[e.jsx(ac,{children:r.trigger?.(C,l)}),e.jsxs(oc,{dir:a,className:"max-w-2xl min-w-full sm:min-w-[800px]",children:[e.jsxs(cc,{dir:a,children:[e.jsxs(lc,{className:"flex items-center gap-2",children:[e.jsx(Ia,{className:"h-5 w-5"}),n("workspace.switchTitle")]}),e.jsx(uc,{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(aC,{workspace:l,isCurrentWorkspace:!0,switchToWorkspace:b,switchingToId:p,onClose:()=>x(!1),setCurrentWorkspace:g,setOpen:x,workspacesToUse:N}),e.jsx(nC,{}),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(Ss,{progress:d,disabled:d,variant:"ghost",onClick:function(){s&&o&&S(e=>e+1)},startIcon:e.jsx(Ka,{}),children:n("settings.common.refreshAction",{loading:String(d)})})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Za,{className:"absolute start-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),e.jsx(Xf,{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(Ha,{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(Ia,{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(Db,{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(aC,{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(nC,{}),e.jsx(sC,{onCreated:()=>{m()}})]})]})]})]})},exports.useAllQuotaUsage=Mn,exports.useBillingPortal=Dn,exports.useCancelSubscription=In,exports.useCreateCheckoutSession=jn,exports.useInvoice=(e,r)=>{const{t:n}=nn(),{api:a}=kn(),[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=En(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=Rn,exports.usePermissions=vl,exports.usePlanGroup=An,exports.usePlanGroupVersions=_n,exports.usePublicPlanGroupVersion=e=>{const{t:r}=nn(),{api:n}=kn(),[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=En(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=Cn,exports.usePushNotifications=Wb,exports.useQuotaUsageContext=Ok,exports.useQuotaUsageStatus=(e,r)=>{const{t:n}=nn(),{api:a}=kn(),[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=En(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}=nn(),{api:n}=kn(),[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 Pt(),r}catch(n){const a=En(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=Un,exports.useSaaSAuth=bl,exports.useSaaSOs=xn,exports.useSaaSSettings=Sn,exports.useSaaSWorkspaces=Ik,exports.useSeatStatus=Sk,exports.useSubscription=Nn,exports.useSubscriptionContext=zn,exports.useSubscriptionManagement=Tn,exports.useTranslation=nn,exports.useTrialStatus=function(){const{response:e}=zn();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=bE(t.trialEnd)??bE(t.stripeCurrentPeriodEnd),n=bE(t.trialStart),a=r?Math.max(0,Math.ceil((r.getTime()-Date.now())/864e5)):0;return{isTrialing:!0,daysRemaining:a,trialEndsAt:r,trialStartedAt:n,isTrialEnding:a<=3}},[e])},exports.useUpdateSubscription=Pn,exports.useUsageLogs=(e,r,n)=>{const{t:a}=nn(),{api:s}=kn(),[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=En(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(Hk);if(void 0===e)throw new Error("useUserAttributes must be used within a UserProvider");return e},exports.useUserFeatures=rE;
|